@qwanyx/stack 0.2.16 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/MailClient.d.ts +10 -0
- package/dist/components/MailEditor.d.ts +37 -0
- package/dist/index.cjs.js +106 -24
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +7985 -1612
- package/package.json +9 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`)}finalize(){return
|
|
3
|
-
`;if(
|
|
4
|
-
`+s).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let e=
|
|
5
|
-
`+
|
|
6
|
-
`,"𝔑":"𝔑","⁠":""," ":" ","ℕ":"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩","Ñ":"Ñ","Ñ":"Ñ","Ν":"Ν","Œ":"Œ","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","О":"О","Ő":"Ő","𝔒":"𝔒","Ò":"Ò","Ò":"Ò","Ō":"Ō","Ω":"Ω","Ο":"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪","Ø":"Ø","Ø":"Ø","Õ":"Õ","Õ":"Õ","⨷":"⨷","Ö":"Ö","Ö":"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂","П":"П","𝔓":"𝔓","Φ":"Φ","Π":"Π","±":"±","ℌ":"ℌ","ℙ":"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∷":"∷","∝":"∝","𝒫":"𝒫","Ψ":"Ψ",""":'"',""":'"',"𝔔":"𝔔","ℚ":"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®","®":"®","Ŕ":"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖","Ř":"Ř","Ŗ":"Ŗ","Р":"Р","ℜ":"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯","ℜ":"ℜ","Ρ":"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓","⇒":"⇒","ℝ":"ℝ","⥰":"⥰","⇛":"⇛","ℛ":"ℛ","↱":"↱","⧴":"⧴","Щ":"Щ","Ш":"Ш","Ь":"Ь","Ś":"Ś","⪼":"⪼","Š":"Š","Ş":"Ş","Ŝ":"Ŝ","С":"С","𝔖":"𝔖","↓":"↓","←":"←","→":"→","↑":"↑","Σ":"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∋":"∋","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇","⋑":"⋑","Þ":"Þ","Þ":"Þ","™":"™","Ћ":"Ћ","Ц":"Ц","	":" ","Τ":"Τ","Ť":"Ť","Ţ":"Ţ","Т":"Т","𝔗":"𝔗","∴":"∴","Θ":"Θ","  ":" "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯","Ŧ":"Ŧ","Ú":"Ú","Ú":"Ú","↟":"↟","⥉":"⥉","Ў":"Ў","Ŭ":"Ŭ","Û":"Û","Û":"Û","У":"У","Ű":"Ű","𝔘":"𝔘","Ù":"Ù","Ù":"Ù","Ū":"Ū","_":"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎","Ų":"Ų","𝕌":"𝕌","↑":"↑","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","⇑":"⇑","⇕":"⇕","↖":"↖","↗":"↗","ϒ":"ϒ","Υ":"Υ","Ů":"Ů","𝒰":"𝒰","Ũ":"Ũ","Ü":"Ü","Ü":"Ü","⊫":"⊫","⫫":"⫫","В":"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪","Ŵ":"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛","Ξ":"Ξ","𝕏":"𝕏","𝒳":"𝒳","Я":"Я","Ї":"Ї","Ю":"Ю","Ý":"Ý","Ý":"Ý","Ŷ":"Ŷ","Ы":"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴","Ÿ":"Ÿ","Ж":"Ж","Ź":"Ź","Ž":"Ž","З":"З","Ż":"Ż","​":"","Ζ":"Ζ","ℨ":"ℨ","ℤ":"ℤ","𝒵":"𝒵","á":"á","á":"á","ă":"ă","∾":"∾","∾̳":"∾̳","∿":"∿","â":"â","â":"â","´":"´","´":"´","а":"а","æ":"æ","æ":"æ","⁡":"","𝔞":"𝔞","à":"à","à":"à","ℵ":"ℵ","ℵ":"ℵ","α":"α","ā":"ā","⨿":"⨿","&":"&","&":"&","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∠":"∠","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","Å":"Å","⍼":"⍼","ą":"ą","𝕒":"𝕒","≈":"≈","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'","≈":"≈","≊":"≊","å":"å","å":"å","𝒶":"𝒶","*":"*","≈":"≈","≍":"≍","ã":"ã","ã":"ã","ä":"ä","ä":"ä","∳":"∳","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⌅":"⌅","⎵":"⎵","⎶":"⎶","≌":"≌","б":"б","„":"„","∵":"∵","∵":"∵","⦰":"⦰","϶":"϶","ℬ":"ℬ","β":"β","ℶ":"ℶ","≬":"≬","𝔟":"𝔟","⋂":"⋂","◯":"◯","⋃":"⋃","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⋁":"⋁","⋀":"⋀","⤍":"⤍","⧫":"⧫","▪":"▪","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⊥":"⊥","⊥":"⊥","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","─":"─","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","‵":"‵","˘":"˘","¦":"¦","¦":"¦","𝒷":"𝒷","⁏":"⁏","∽":"∽","⋍":"⋍","\":"\\","⧅":"⧅","⟈":"⟈","•":"•","•":"•","≎":"≎","⪮":"⪮","≏":"≏","≏":"≏","ć":"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","ˇ":"ˇ","⩍":"⩍","č":"č","ç":"ç","ç":"ç","ĉ":"ĉ","⩌":"⩌","⩐":"⩐","ċ":"ċ","¸":"¸","¸":"¸","⦲":"⦲","¢":"¢","¢":"¢","·":"·","𝔠":"𝔠","ч":"ч","✓":"✓","✓":"✓","χ":"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","®":"®","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","≗":"≗","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣","♣":"♣",":":":","≔":"≔","≔":"≔",",":",","@":"@","∁":"∁","∘":"∘","∁":"∁","ℂ":"ℂ","≅":"≅","⩭":"⩭","∮":"∮","𝕔":"𝕔","∐":"∐","©":"©","©":"©","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋞":"⋞","⋟":"⋟","⋎":"⋎","⋏":"⋏","¤":"¤","¤":"¤","↶":"↶","↷":"↷","⋎":"⋎","⋏":"⋏","∲":"∲","∱":"∱","⌭":"⌭","⇓":"⇓","⥥":"⥥","†":"†","ℸ":"ℸ","↓":"↓","‐":"‐","⊣":"⊣","⤏":"⤏","˝":"˝","ď":"ď","д":"д","ⅆ":"ⅆ","‡":"‡","⇊":"⇊","⩷":"⩷","°":"°","°":"°","δ":"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","⇃":"⇃","⇂":"⇂","⋄":"⋄","⋄":"⋄","♦":"♦","♦":"♦","¨":"¨","ϝ":"ϝ","⋲":"⋲","÷":"÷","÷":"÷","÷":"÷","⋇":"⋇","⋇":"⋇","ђ":"ђ","⌞":"⌞","⌍":"⌍","$":"$","𝕕":"𝕕","˙":"˙","≐":"≐","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌆":"⌆","↓":"↓","⇊":"⇊","⇃":"⇃","⇂":"⇂","⤐":"⤐","⌟":"⌟","⌌":"⌌","𝒹":"𝒹","ѕ":"ѕ","⧶":"⧶","đ":"đ","⋱":"⋱","▿":"▿","▾":"▾","⇵":"⇵","⥯":"⥯","⦦":"⦦","џ":"џ","⟿":"⟿","⩷":"⩷","≑":"≑","é":"é","é":"é","⩮":"⩮","ě":"ě","≖":"≖","ê":"ê","ê":"ê","≕":"≕","э":"э","ė":"ė","ⅇ":"ⅇ","≒":"≒","𝔢":"𝔢","⪚":"⪚","è":"è","è":"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧","ℓ":"ℓ","⪕":"⪕","⪗":"⪗","ē":"ē","∅":"∅","∅":"∅","∅":"∅"," ":" "," ":" "," ":" ","ŋ":"ŋ"," ":" ","ę":"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱","ε":"ε","ε":"ε","ϵ":"ϵ","≖":"≖","≕":"≕","≂":"≂","⪖":"⪖","⪕":"⪕","=":"=","≟":"≟","≡":"≡","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱","ℯ":"ℯ","≐":"≐","≂":"≂","η":"η","ð":"ð","ð":"ð","ë":"ë","ë":"ë","€":"€","!":"!","∃":"∃","ℰ":"ℰ","ⅇ":"ⅇ","≒":"≒","ф":"ф","♀":"♀","ffi":"ffi","ff":"ff","ffl":"ffl","𝔣":"𝔣","fi":"fi","fj":"fj","♭":"♭","fl":"fl","▱":"▱","ƒ":"ƒ","𝕗":"𝕗","∀":"∀","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","½":"½","⅓":"⅓","¼":"¼","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","≧":"≧","⪌":"⪌","ǵ":"ǵ","γ":"γ","ϝ":"ϝ","⪆":"⪆","ğ":"ğ","ĝ":"ĝ","г":"г","ġ":"ġ","≥":"≥","⋛":"⋛","≥":"≥","≧":"≧","⩾":"⩾","⩾":"⩾","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤","≫":"≫","⋙":"⋙","ℷ":"ℷ","ѓ":"ѓ","≷":"≷","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪊":"⪊","⪈":"⪈","⪈":"⪈","≩":"≩","⋧":"⋧","𝕘":"𝕘","`":"`","ℊ":"ℊ","≳":"≳","⪎":"⪎","⪐":"⪐",">":">",">":">","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⪆":"⪆","⥸":"⥸","⋗":"⋗","⋛":"⋛","⪌":"⪌","≷":"≷","≳":"≳","≩︀":"≩︀","≩︀":"≩︀","⇔":"⇔"," ":" ","½":"½","ℋ":"ℋ","ъ":"ъ","↔":"↔","⥈":"⥈","↭":"↭","ℏ":"ℏ","ĥ":"ĥ","♥":"♥","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽","ℏ":"ℏ","ħ":"ħ","⁃":"⁃","‐":"‐","í":"í","í":"í","⁣":"","î":"î","î":"î","и":"и","е":"е","¡":"¡","¡":"¡","⇔":"⇔","𝔦":"𝔦","ì":"ì","ì":"ì","ⅈ":"ⅈ","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩","ij":"ij","ī":"ī","ℑ":"ℑ","ℐ":"ℐ","ℑ":"ℑ","ı":"ı","⊷":"⊷","Ƶ":"Ƶ","∈":"∈","℅":"℅","∞":"∞","⧝":"⧝","ı":"ı","∫":"∫","⊺":"⊺","ℤ":"ℤ","⊺":"⊺","⨗":"⨗","⨼":"⨼","ё":"ё","į":"į","𝕚":"𝕚","ι":"ι","⨼":"⨼","¿":"¿","¿":"¿","𝒾":"𝒾","∈":"∈","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳","∈":"∈","⁢":"","ĩ":"ĩ","і":"і","ï":"ï","ï":"ï","ĵ":"ĵ","й":"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿","ј":"ј","є":"є","κ":"κ","ϰ":"ϰ","ķ":"ķ","к":"к","𝔨":"𝔨","ĸ":"ĸ","х":"х","ќ":"ќ","𝕜":"𝕜","𝓀":"𝓀","⇚":"⇚","⇐":"⇐","⤛":"⤛","⤎":"⤎","≦":"≦","⪋":"⪋","⥢":"⥢","ĺ":"ĺ","⦴":"⦴","ℒ":"ℒ","λ":"λ","⟨":"⟨","⦑":"⦑","⟨":"⟨","⪅":"⪅","«":"«","«":"«","←":"←","⇤":"⇤","⤟":"⤟","⤝":"⤝","↩":"↩","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍","ľ":"ľ","ļ":"ļ","⌈":"⌈","{":"{","л":"л","⤶":"⤶","“":"“","„":"„","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","←":"←","↢":"↢","↽":"↽","↼":"↼","⇇":"⇇","↔":"↔","⇆":"⇆","⇋":"⇋","↭":"↭","⋋":"⋋","⋚":"⋚","≤":"≤","≦":"≦","⩽":"⩽","⩽":"⩽","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⪅":"⪅","⋖":"⋖","⋚":"⋚","⪋":"⪋","≶":"≶","≲":"≲","⥼":"⥼","⌊":"⌊","𝔩":"𝔩","≶":"≶","⪑":"⪑","↽":"↽","↼":"↼","⥪":"⥪","▄":"▄","љ":"љ","≪":"≪","⇇":"⇇","⌞":"⌞","⥫":"⥫","◺":"◺","ŀ":"ŀ","⎰":"⎰","⎰":"⎰","≨":"≨","⪉":"⪉","⪉":"⪉","⪇":"⪇","⪇":"⪇","≨":"≨","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟦":"⟦","⟵":"⟵","⟷":"⟷","⟼":"⟼","⟶":"⟶","↫":"↫","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","_":"_","◊":"◊","◊":"◊","⧫":"⧫","(":"(","⦓":"⦓","⇆":"⇆","⌟":"⌟","⇋":"⇋","⥭":"⥭","‎":"","⊿":"⊿","‹":"‹","𝓁":"𝓁","↰":"↰","≲":"≲","⪍":"⪍","⪏":"⪏","[":"[","‘":"‘","‚":"‚","ł":"ł","<":"<","<":"<","⪦":"⪦","⩹":"⩹","⋖":"⋖","⋋":"⋋","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⊴":"⊴","◂":"◂","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","≨︀":"≨︀","∺":"∺","¯":"¯","¯":"¯","♂":"♂","✠":"✠","✠":"✠","↦":"↦","↦":"↦","↧":"↧","↤":"↤","↥":"↥","▮":"▮","⨩":"⨩","м":"м","—":"—","∡":"∡","𝔪":"𝔪","℧":"℧","µ":"µ","µ":"µ","∣":"∣","*":"*","⫰":"⫰","·":"·","·":"·","−":"−","⊟":"⊟","∸":"∸","⨪":"⨪","⫛":"⫛","…":"…","∓":"∓","⊧":"⊧","𝕞":"𝕞","∓":"∓","𝓂":"𝓂","∾":"∾","μ":"μ","⊸":"⊸","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","≫̸":"≫̸","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","≪̸":"≪̸","⇏":"⇏","⊯":"⊯","⊮":"⊮","∇":"∇","ń":"ń","∠⃒":"∠⃒","≉":"≉","⩰̸":"⩰̸","≋̸":"≋̸","ʼn":"ʼn","≉":"≉","♮":"♮","♮":"♮","ℕ":"ℕ"," ":" "," ":" ","≎̸":"≎̸","≏̸":"≏̸","⩃":"⩃","ň":"ň","ņ":"ņ","≇":"≇","⩭̸":"⩭̸","⩂":"⩂","н":"н","–":"–","≠":"≠","⇗":"⇗","⤤":"⤤","↗":"↗","↗":"↗","≐̸":"≐̸","≢":"≢","⤨":"⤨","≂̸":"≂̸","∄":"∄","∄":"∄","𝔫":"𝔫","≧̸":"≧̸","≱":"≱","≱":"≱","≧̸":"≧̸","⩾̸":"⩾̸","⩾̸":"⩾̸","≵":"≵","≯":"≯","≯":"≯","⇎":"⇎","↮":"↮","⫲":"⫲","∋":"∋","⋼":"⋼","⋺":"⋺","∋":"∋","њ":"њ","⇍":"⇍","≦̸":"≦̸","↚":"↚","‥":"‥","≰":"≰","↚":"↚","↮":"↮","≰":"≰","≦̸":"≦̸","⩽̸":"⩽̸","⩽̸":"⩽̸","≮":"≮","≴":"≴","≮":"≮","⋪":"⋪","⋬":"⋬","∤":"∤","𝕟":"𝕟","¬":"¬","¬":"¬","∉":"∉","⋹̸":"⋹̸","⋵̸":"⋵̸","∉":"∉","⋷":"⋷","⋶":"⋶","∌":"∌","∌":"∌","⋾":"⋾","⋽":"⋽","∦":"∦","∦":"∦","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","⊀":"⊀","⋠":"⋠","⪯̸":"⪯̸","⊀":"⊀","⪯̸":"⪯̸","⇏":"⇏","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","↛":"↛","⋫":"⋫","⋭":"⋭","⊁":"⊁","⋡":"⋡","⪰̸":"⪰̸","𝓃":"𝓃","∤":"∤","∦":"∦","≁":"≁","≄":"≄","≄":"≄","∤":"∤","∦":"∦","⋢":"⋢","⋣":"⋣","⊄":"⊄","⫅̸":"⫅̸","⊈":"⊈","⊂⃒":"⊂⃒","⊈":"⊈","⫅̸":"⫅̸","⊁":"⊁","⪰̸":"⪰̸","⊅":"⊅","⫆̸":"⫆̸","⊉":"⊉","⊃⃒":"⊃⃒","⊉":"⊉","⫆̸":"⫆̸","≹":"≹","ñ":"ñ","ñ":"ñ","≸":"≸","⋪":"⋪","⋬":"⋬","⋫":"⋫","⋭":"⋭","ν":"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","↖":"↖","↖":"↖","⤧":"⤧","Ⓢ":"Ⓢ","ó":"ó","ó":"ó","⊛":"⊛","⊚":"⊚","ô":"ô","ô":"ô","о":"о","⊝":"⊝","ő":"ő","⨸":"⨸","⊙":"⊙","⦼":"⦼","œ":"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛","ò":"ò","ò":"ò","⧁":"⧁","⦵":"⦵","Ω":"Ω","∮":"∮","↺":"↺","⦾":"⦾","⦻":"⦻","‾":"‾","⧀":"⧀","ō":"ō","ω":"ω","ο":"ο","⦶":"⦶","⊖":"⊖","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","⊕":"⊕","∨":"∨","↻":"↻","⩝":"⩝","ℴ":"ℴ","ℴ":"ℴ","ª":"ª","ª":"ª","º":"º","º":"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛","ℴ":"ℴ","ø":"ø","ø":"ø","⊘":"⊘","õ":"õ","õ":"õ","⊗":"⊗","⨶":"⨶","ö":"ö","ö":"ö","⌽":"⌽","∥":"∥","¶":"¶","¶":"¶","∥":"∥","⫳":"⫳","⫽":"⫽","∂":"∂","п":"п","%":"%",".":".","‰":"‰","⊥":"⊥","‱":"‱","𝔭":"𝔭","φ":"φ","ϕ":"ϕ","ℳ":"ℳ","☎":"☎","π":"π","⋔":"⋔","ϖ":"ϖ","ℏ":"ℏ","ℎ":"ℎ","ℏ":"ℏ","+":"+","⨣":"⨣","⊞":"⊞","⨢":"⨢","∔":"∔","⨥":"⨥","⩲":"⩲","±":"±","±":"±","⨦":"⨦","⨧":"⨧","±":"±","⨕":"⨕","𝕡":"𝕡","£":"£","£":"£","≺":"≺","⪳":"⪳","⪷":"⪷","≼":"≼","⪯":"⪯","≺":"≺","⪷":"⪷","≼":"≼","⪯":"⪯","⪹":"⪹","⪵":"⪵","⋨":"⋨","≾":"≾","′":"′","ℙ":"ℙ","⪵":"⪵","⪹":"⪹","⋨":"⋨","∏":"∏","⌮":"⌮","⌒":"⌒","⌓":"⌓","∝":"∝","∝":"∝","≾":"≾","⊰":"⊰","𝓅":"𝓅","ψ":"ψ"," ":" ","𝔮":"𝔮","⨌":"⨌","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","ℍ":"ℍ","⨖":"⨖","?":"?","≟":"≟",""":'"',""":'"',"⇛":"⇛","⇒":"⇒","⤜":"⤜","⤏":"⤏","⥤":"⥤","∽̱":"∽̱","ŕ":"ŕ","√":"√","⦳":"⦳","⟩":"⟩","⦒":"⦒","⦥":"⦥","⟩":"⟩","»":"»","»":"»","→":"→","⥵":"⥵","⇥":"⇥","⤠":"⤠","⤳":"⤳","⤞":"⤞","↪":"↪","↬":"↬","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","ℚ":"ℚ","⤍":"⤍","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐","ř":"ř","ŗ":"ŗ","⌉":"⌉","}":"}","р":"р","⤷":"⤷","⥩":"⥩","”":"”","”":"”","↳":"↳","ℜ":"ℜ","ℛ":"ℛ","ℜ":"ℜ","ℝ":"ℝ","▭":"▭","®":"®","®":"®","⥽":"⥽","⌋":"⌋","𝔯":"𝔯","⇁":"⇁","⇀":"⇀","⥬":"⥬","ρ":"ρ","ϱ":"ϱ","→":"→","↣":"↣","⇁":"⇁","⇀":"⇀","⇄":"⇄","⇌":"⇌","⇉":"⇉","↝":"↝","⋌":"⋌","˚":"˚","≓":"≓","⇄":"⇄","⇌":"⇌","‏":"","⎱":"⎱","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⟧":"⟧","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","⇉":"⇉","›":"›","𝓇":"𝓇","↱":"↱","]":"]","’":"’","’":"’","⋌":"⋌","⋊":"⋊","▹":"▹","⊵":"⊵","▸":"▸","⧎":"⧎","⥨":"⥨","℞":"℞","ś":"ś","‚":"‚","≻":"≻","⪴":"⪴","⪸":"⪸","š":"š","≽":"≽","⪰":"⪰","ş":"ş","ŝ":"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓","≿":"≿","с":"с","⋅":"⋅","⊡":"⊡","⩦":"⩦","⇘":"⇘","⤥":"⤥","↘":"↘","↘":"↘","§":"§","§":"§",";":";","⤩":"⤩","∖":"∖","∖":"∖","✶":"✶","𝔰":"𝔰","⌢":"⌢","♯":"♯","щ":"щ","ш":"ш","∣":"∣","∥":"∥","­":"","­":"","σ":"σ","ς":"ς","ς":"ς","∼":"∼","⩪":"⩪","≃":"≃","≃":"≃","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","←":"←","∖":"∖","⨳":"⨳","⧤":"⧤","∣":"∣","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀","ь":"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","♠":"♠","∥":"∥","⊓":"⊓","⊓︀":"⊓︀","⊔":"⊔","⊔︀":"⊔︀","⊏":"⊏","⊑":"⊑","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊐":"⊐","⊒":"⊒","□":"□","□":"□","▪":"▪","▪":"▪","→":"→","𝓈":"𝓈","∖":"∖","⌣":"⌣","⋆":"⋆","☆":"☆","★":"★","ϵ":"ϵ","ϕ":"ϕ","¯":"¯","⊂":"⊂","⫅":"⫅","⪽":"⪽","⊆":"⊆","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⊂":"⊂","⊆":"⊆","⫅":"⫅","⊊":"⊊","⫋":"⫋","⫇":"⫇","⫕":"⫕","⫓":"⫓","≻":"≻","⪸":"⪸","≽":"≽","⪰":"⪰","⪺":"⪺","⪶":"⪶","⋩":"⋩","≿":"≿","∑":"∑","♪":"♪","¹":"¹","¹":"¹","²":"²","²":"²","³":"³","³":"³","⊃":"⊃","⫆":"⫆","⪾":"⪾","⫘":"⫘","⊇":"⊇","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⊃":"⊃","⊇":"⊇","⫆":"⫆","⊋":"⊋","⫌":"⫌","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤦":"⤦","↙":"↙","↙":"↙","⤪":"⤪","ß":"ß","ß":"ß","⌖":"⌖","τ":"τ","⎴":"⎴","ť":"ť","ţ":"ţ","т":"т","⃛":"⃛","⌕":"⌕","𝔱":"𝔱","∴":"∴","∴":"∴","θ":"θ","ϑ":"ϑ","ϑ":"ϑ","≈":"≈","∼":"∼"," ":" ","≈":"≈","∼":"∼","þ":"þ","þ":"þ","˜":"˜","×":"×","×":"×","⊠":"⊠","⨱":"⨱","⨰":"⨰","∭":"∭","⤨":"⤨","⊤":"⊤","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","⤩":"⤩","‴":"‴","™":"™","▵":"▵","▿":"▿","◃":"◃","⊴":"⊴","≜":"≜","▹":"▹","⊵":"⊵","◬":"◬","≜":"≜","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉","ц":"ц","ћ":"ћ","ŧ":"ŧ","≬":"≬","↞":"↞","↠":"↠","⇑":"⇑","⥣":"⥣","ú":"ú","ú":"ú","↑":"↑","ў":"ў","ŭ":"ŭ","û":"û","û":"û","у":"у","⇅":"⇅","ű":"ű","⥮":"⥮","⥾":"⥾","𝔲":"𝔲","ù":"ù","ù":"ù","↿":"↿","↾":"↾","▀":"▀","⌜":"⌜","⌜":"⌜","⌏":"⌏","◸":"◸","ū":"ū","¨":"¨","¨":"¨","ų":"ų","𝕦":"𝕦","↑":"↑","↕":"↕","↿":"↿","↾":"↾","⊎":"⊎","υ":"υ","ϒ":"ϒ","υ":"υ","⇈":"⇈","⌝":"⌝","⌝":"⌝","⌎":"⌎","ů":"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰","ũ":"ũ","▵":"▵","▴":"▴","⇈":"⇈","ü":"ü","ü":"ü","⦧":"⦧","⇕":"⇕","⫨":"⫨","⫩":"⫩","⊨":"⊨","⦜":"⦜","ϵ":"ϵ","ϰ":"ϰ","∅":"∅","ϕ":"ϕ","ϖ":"ϖ","∝":"∝","↕":"↕","ϱ":"ϱ","ς":"ς","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀","ϑ":"ϑ","⊲":"⊲","⊳":"⊳","в":"в","⊢":"⊢","∨":"∨","⊻":"⊻","≚":"≚","⋮":"⋮","|":"|","|":"|","𝔳":"𝔳","⊲":"⊲","⊂⃒":"⊂⃒","⊃⃒":"⊃⃒","𝕧":"𝕧","∝":"∝","⊳":"⊳","𝓋":"𝓋","⫋︀":"⫋︀","⊊︀":"⊊︀","⫌︀":"⫌︀","⊋︀":"⊋︀","⦚":"⦚","ŵ":"ŵ","⩟":"⩟","∧":"∧","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","℘":"℘","≀":"≀","≀":"≀","𝓌":"𝓌","⋂":"⋂","◯":"◯","⋃":"⋃","▽":"▽","𝔵":"𝔵","⟺":"⟺","⟷":"⟷","ξ":"ξ","⟸":"⟸","⟵":"⟵","⟼":"⟼","⋻":"⋻","⨀":"⨀","𝕩":"𝕩","⨁":"⨁","⨂":"⨂","⟹":"⟹","⟶":"⟶","𝓍":"𝓍","⨆":"⨆","⨄":"⨄","△":"△","⋁":"⋁","⋀":"⋀","ý":"ý","ý":"ý","я":"я","ŷ":"ŷ","ы":"ы","¥":"¥","¥":"¥","𝔶":"𝔶","ї":"ї","𝕪":"𝕪","𝓎":"𝓎","ю":"ю","ÿ":"ÿ","ÿ":"ÿ","ź":"ź","ž":"ž","з":"з","ż":"ż","ℨ":"ℨ","ζ":"ζ","𝔷":"𝔷","ж":"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","‍":"","‌":""};function er(o){return o.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,r)=>{if(typeof ht[e]=="string")return ht[e];if(r.charAt(0)!=="#"||e.charAt(e.length-1)!==";")return e;let u;r.charAt(1)==="x"?u=parseInt(r.substr(2),16):u=parseInt(r.substr(1),10);var s="";return u>=55296&&u<=57343||u>1114111?"�":(u>65535&&(u-=65536,s+=String.fromCharCode(u>>>10&1023|55296),u=56320|u&1023),s+=String.fromCharCode(u),s)})}function se(o){return o.trim().replace(/[<>"'?&]/g,e=>{let r=e.charCodeAt(0).toString(16);return r.length<2&&(r="0"+r),"&#x"+r.toUpperCase()+";"})}function tr(o){return"<div>"+se(o).replace(/\n/g,"<br />")+"</div>"}function rr(o){return o=o.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
|
|
1
|
+
"use strict";var Pl=Object.defineProperty;var Ol=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var rr=(r,e,t)=>Ol(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),wi=require("react-dom");function Rl(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const ts=Rl(T);class Ml{constructor(e){rr(this,"config");rr(this,"defaultUploadOptions",{maxSizeMB:10,maxImageDimension:0,imageQuality:.9});if(!e.system_id)throw new Error("GraphClient: system_id is REQUIRED. No system_id → No start.");this.config=e}async callGraph(e,t={}){const n={coprocessor:"graph",method:e,system_id:this.config.system_id,params:t};try{const s=await fetch(`${this.config.baseUrl}/spu/invoke`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getToken()}`},body:JSON.stringify(n)});if(!s.ok){const i=await s.text();throw new Error(`API error (${s.status}): ${i}`)}const o=await s.json();if(!o.success&&o.error)throw new Error(o.error);return o}catch(s){throw console.error("Graph API call failed:",s),s}}getToken(){return typeof window<"u"&&window.localStorage&&localStorage.getItem("qwanyx_token")||""}async getChildren(e){return(await this.callGraph("get_children",{parent_id:e})).result||[]}async getNode(e){return(await this.callGraph("get_node",{node_id:e})).result||null}async addNode(e){const t={...e,created:e.created||new Date().toISOString(),modified:new Date().toISOString()},n=await this.callGraph("add_node",t);if(!n.result)throw new Error("Failed to add node");return n.result}async updateNode(e,t){const n={node_id:e,updates:{...t,modified:new Date().toISOString()}},s=await this.callGraph("update_node",n);if(!s.result)throw new Error("Failed to update node");return s.result}async deleteNode(e,t=!1){return(await this.callGraph("delete_node",{node_id:e,cascade:t})).success===!0}async getChildrenWithEdges(e,t="children",n,s){return(await this.callGraph("get_children_with_edges",{node_id:e,display_mode:t,edge_type:n,node_type:s})).result||[]}async addEdge(e,t,n="link",s){return await this.callGraph("add_edge",{source_id:e,target_id:t,edge_type:n,data:s})}async deleteEdge(e,t,n){return await this.callGraph("delete_edge",{source_id:e,target_id:t,edge_type:n})}async getEdges(e,t,n){return(await this.callGraph("get_edges",{source_id:e,edge_type:t,target_id:n})).result||[]}async getAncestors(e){return(await this.callGraph("get_ancestors",{node_id:e})).ancestors||[]}async getTree(e,t=10){return(await this.callGraph("get_tree",{root_id:e,max_depth:t})).tree||[]}async moveNode(e,t){const n=await this.callGraph("move",{node_id:e,new_parent_id:t});if(!n.node)throw new Error("Failed to move node");return n.node}async searchNodes(e,t){return(await this.callGraph("search",{query:e,type:t})).nodes||[]}async getNodesByType(e){return(await this.callGraph("get_nodes_by_type",{type:e})).result||[]}fileToBase64(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const i=s.result.split(",")[1];t(i)},s.onerror=()=>n(new Error("Failed to read file")),s.readAsDataURL(e)})}async resizeImage(e,t,n){return e.type.startsWith("image/")?new Promise(s=>{const o=new Image,i=URL.createObjectURL(e);o.onload=()=>{if(URL.revokeObjectURL(i),o.width<=t&&o.height<=t){s(e);return}let u,l;o.width>o.height?(u=t,l=Math.round(o.height/o.width*t)):(l=t,u=Math.round(o.width/o.height*t));const a=document.createElement("canvas");a.width=u,a.height=l;const c=a.getContext("2d");if(!c){s(e);return}c.drawImage(o,0,0,u,l);const f=e.type==="image/png"?"image/png":"image/jpeg";a.toBlob(d=>{if(d){const h=new File([d],e.name,{type:f});s(h)}else s(e)},f,n)},o.onerror=()=>{URL.revokeObjectURL(i),s(e)},o.src=i}):e}async uploadFile(e,t,n,s={}){const o={...this.defaultUploadOptions,...s};try{let i=n;o.maxImageDimension>0&&n.type.startsWith("image/")&&(i=await this.resizeImage(n,o.maxImageDimension,o.imageQuality));const u=o.maxSizeMB*1024*1024;if(i.size>u)return{success:!1,error:`File too large (${(i.size/1024/1024).toFixed(1)} MB). Max: ${o.maxSizeMB} MB`};const l=await this.fileToBase64(i),a=await this.callGraph("upload_file",{node_id:e,filename:t,content:l});return a.success?{success:!0,path:a.path}:{success:!1,error:a.error||"Upload failed"}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Upload failed"}}}async listFiles(e){var s;return(((s=(await this.callGraph("list_files",{node_id:e})).result)==null?void 0:s.files)||[]).map(o=>({filename:o.name,path:o.path}))}async deleteFile(e,t){return{success:(await this.callGraph("delete_file",{node_id:e,filename:t})).success||!1}}getFileUrl(e,t){return`${this.config.baseUrl}/files/${this.config.system_id}/${e}/${t}`}}const Ht=new TextEncoder,Ai="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cr=new Uint8Array(256);for(var Hr=0;Hr<Ai.length;Hr++)cr[Ai.charCodeAt(Hr)]=Hr;function ys(r){let e=Math.ceil(r.length/4)*3;const t=r.length;let n=0;r.length%4===3?e--:r.length%4===2?e-=2:r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);const s=new ArrayBuffer(e),o=new Uint8Array(s);for(let i=0;i<t;i+=4){let u=cr[r.charCodeAt(i)],l=cr[r.charCodeAt(i+1)],a=cr[r.charCodeAt(i+2)],c=cr[r.charCodeAt(i+3)];o[n++]=u<<2|l>>4,o[n++]=(l&15)<<4|a>>2,o[n++]=(a&3)<<6|c&63}return s}function pr(r){r=r||"utf8";let e;try{e=new TextDecoder(r)}catch{e=new TextDecoder("windows-1252")}return e}async function Sn(r){if("arrayBuffer"in r)return await r.arrayBuffer();const e=new FileReader;return new Promise((t,n)=>{e.onload=function(s){t(s.target.result)},e.onerror=function(s){n(e.error)},e.readAsArrayBuffer(r)})}function Ei(r){return r>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70?String.fromCharCode(r):!1}function jl(r,e,t){let n=r.indexOf("*");n>=0&&(r=r.substr(0,n)),e=e.toUpperCase();let s;if(e==="Q"){t=t.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let o=Ht.encode(t),i=[];for(let l=0,a=o.length;l<a;l++){let c=o[l];if(l<=a-2&&c===61){let f=Ei(o[l+1]),d=Ei(o[l+2]);if(f&&d){let h=parseInt(f+d,16);i.push(h),l+=2;continue}}i.push(c)}s=new ArrayBuffer(i.length);let u=new DataView(s);for(let l=0,a=i.length;l<a;l++)u.setUint8(l,i[l])}else e==="B"?s=ys(t.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):s=Ht.encode(t);return pr(r).decode(s)}function gr(r){let e=!0;for(;;){let t=(r||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(n,s,o,i,u)=>e&&o===u&&i.length%4===0&&!/=$/.test(i)?s+"__\0JOIN\0__":n).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(n,s,o,i)=>e&&o===i?s+"__\0JOIN\0__":n).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(n,s,o,i)=>jl(s,o,i));if(e&&t.indexOf("�")>=0)e=!1;else return t}}function Il(r,e){e=e||"utf-8";let t=[];for(let o=0;o<r.length;o++){let i=r.charAt(o);if(i==="%"&&/^[a-f0-9]{2}/i.test(r.substr(o+1,2))){let u=r.substr(o+1,2);o+=2,t.push(parseInt(u,16))}else if(i.charCodeAt(0)>126){i=Ht.encode(i);for(let u=0;u<i.length;u++)t.push(i[u])}else t.push(i.charCodeAt(0))}const n=new ArrayBuffer(t.length),s=new DataView(n);for(let o=0,i=t.length;o<i;o++)s.setUint8(o,t[o]);return pr(e).decode(n)}function $l(r){let e=new Map;Object.keys(r.params).forEach(t=>{let n=t.match(/\*((\d+)\*?)?$/);if(!n)return;let s=t.substr(0,n.index).toLowerCase(),o=Number(n[2])||0,i;e.has(s)?i=e.get(s):(i={charset:!1,values:[]},e.set(s,i));let u=r.params[t];o===0&&n[0].charAt(n[0].length-1)==="*"&&(n=u.match(/^([^']*)'[^']*'(.*)$/))&&(i.charset=n[1]||"utf-8",u=n[2]),i.values.push({nr:o,value:u}),delete r.params[t]}),e.forEach((t,n)=>{r.params[n]=Il(t.values.sort((s,o)=>s.nr-o.nr).map(s=>s.value).join(""),t.charset)})}class ql{constructor(){this.chunks=[]}update(e){this.chunks.push(e),this.chunks.push(`
|
|
2
|
+
`)}finalize(){return Sn(new Blob(this.chunks,{type:"application/octet-stream"}))}}class zl{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.chunks=[],this.remainder=""}update(e){let t=this.decoder.decode(e);if(/[^a-zA-Z0-9+\/]/.test(t)&&(t=t.replace(/[^a-zA-Z0-9+\/]+/g,"")),this.remainder+=t,this.remainder.length>=this.maxChunkSize){let n=Math.floor(this.remainder.length/4)*4,s;n===this.remainder.length?(s=this.remainder,this.remainder=""):(s=this.remainder.substr(0,n),this.remainder=this.remainder.substr(n)),s.length&&this.chunks.push(ys(s))}}finalize(){return this.remainder&&!/^=+$/.test(this.remainder)&&this.chunks.push(ys(this.remainder)),Sn(new Blob(this.chunks,{type:"application/octet-stream"}))}}const ki=/^=[a-f0-9]{2}$/i,Ul=/(?==[a-f0-9]{2})/i,Wl=/=\r?\n/g,Vl=/=[a-fA-F0-9]?$/;class Kl{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.remainder="",this.chunks=[]}decodeQPBytes(e){let t=new ArrayBuffer(e.length),n=new DataView(t);for(let s=0,o=e.length;s<o;s++)n.setUint8(s,parseInt(e[s],16));return t}decodeChunks(e){e=e.replace(Wl,"");let t=e.split(Ul),n=[];for(let s of t){if(s.charAt(0)!=="="){n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s);continue}if(s.length===3){ki.test(s)?n.push(s.substr(1)):(n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s));continue}if(s.length>3){const o=s.substr(0,3);ki.test(o)?(n.push(s.substr(1,2)),this.chunks.push(this.decodeQPBytes(n)),n=[],s=s.substr(3),this.chunks.push(s)):(n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s))}}n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[])}update(e){let t=this.decoder.decode(e)+`
|
|
3
|
+
`;if(t=this.remainder+t,t.length<this.maxChunkSize){this.remainder=t;return}this.remainder="";let n=t.match(Vl);if(n){if(n.index===0){this.remainder=t;return}this.remainder=t.substr(n.index),t=t.substr(0,n.index)}this.decodeChunks(t)}finalize(){return this.remainder.length&&(this.decodeChunks(this.remainder),this.remainder=""),Sn(new Blob(this.chunks,{type:"application/octet-stream"}))}}class Si{constructor(e){if(this.options=e||{},this.postalMime=this.options.postalMime,this.root=!!this.options.parentNode,this.childNodes=[],this.options.parentNode){if(this.parentNode=this.options.parentNode,this.depth=this.parentNode.depth+1,this.depth>this.options.maxNestingDepth)throw new Error(`Maximum MIME nesting depth of ${this.options.maxNestingDepth} levels exceeded`);this.options.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[],this.headerSize=0,this.contentType={value:"text/plain",default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(e){/base64/i.test(e)?this.contentDecoder=new zl:/quoted-printable/i.test(e)?this.contentDecoder=new Kl({decoder:pr(this.contentType.parsed.params.charset)}):this.contentDecoder=new ql}async finalize(){if(this.state==="finished")return;this.state==="header"&&this.processHeaders();let e=this.postalMime.boundaries;for(let t=e.length-1;t>=0;t--)if(e[t].node===this){e.splice(t,1);break}await this.finalizeChildNodes(),this.content=this.contentDecoder?await this.contentDecoder.finalize():null,this.state="finished"}async finalizeChildNodes(){for(let e of this.childNodes)await e.finalize()}parseStructuredHeader(e){let t={value:!1,params:{}},n=!1,s="",o="value",i=!1,u=!1,l;for(let a=0,c=e.length;a<c;a++)switch(l=e.charAt(a),o){case"key":if(l==="="){n=s.trim().toLowerCase(),o="value",s="";break}s+=l;break;case"value":if(u)s+=l;else if(l==="\\"){u=!0;continue}else i&&l===i?i=!1:!i&&l==='"'?i=l:!i&&l===";"?(n===!1?t.value=s.trim():t.params[n]=s.trim(),o="key",s=""):s+=l;u=!1;break}return s=s.trim(),o==="value"?n===!1?t.value=s:t.params[n]=s:s&&(t.params[s.toLowerCase()]=""),t.value&&(t.value=t.value.toLowerCase()),$l(t),t}decodeFlowedText(e,t){return e.split(/\r?\n/).reduce((n,s)=>/ $/.test(n)&&!/(^|\n)-- $/.test(n)?t?n.slice(0,-1)+s:n+s:n+`
|
|
4
|
+
`+s).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let e=pr(this.contentType.parsed.params.charset).decode(this.content);return/^flowed$/i.test(this.contentType.parsed.params.format)&&(e=this.decodeFlowedText(e,/^yes$/i.test(this.contentType.parsed.params.delsp))),e}processHeaders(){for(let e=this.headerLines.length-1;e>=0;e--){let t=this.headerLines[e];if(e&&/^\s/.test(t))this.headerLines[e-1]+=`
|
|
5
|
+
`+t,this.headerLines.splice(e,1);else{t=t.replace(/\s+/g," ");let n=t.indexOf(":"),s=n<0?t.trim():t.substr(0,n).trim(),o=n<0?"":t.substr(n+1).trim();switch(this.headers.push({key:s.toLowerCase(),originalKey:s,value:o}),s.toLowerCase()){case"content-type":this.contentType.default&&(this.contentType={value:o,parsed:{}});break;case"content-transfer-encoding":this.contentTransferEncoding={value:o,parsed:{}};break;case"content-disposition":this.contentDisposition={value:o,parsed:{}};break;case"content-id":this.contentId=o;break;case"content-description":this.contentDescription=o;break}}}this.contentType.parsed=this.parseStructuredHeader(this.contentType.value),this.contentType.multipart=/^multipart\//i.test(this.contentType.parsed.value)?this.contentType.parsed.value.substr(this.contentType.parsed.value.indexOf("/")+1):!1,this.contentType.multipart&&this.contentType.parsed.params.boundary&&this.postalMime.boundaries.push({value:Ht.encode(this.contentType.parsed.params.boundary),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value),this.contentTransferEncoding.encoding=this.contentTransferEncoding.value.toLowerCase().split(/[^\w-]/).shift(),this.setupContentDecoder(this.contentTransferEncoding.encoding)}feed(e){switch(this.state){case"header":if(!e.length)return this.state="body",this.processHeaders();if(this.headerSize+=e.length,this.headerSize>this.options.maxHeadersSize)throw new Error(`Maximum header size of ${this.options.maxHeadersSize} bytes exceeded`);this.headerLines.push(pr().decode(e));break;case"body":this.contentDecoder.update(e)}}}const Ti={"Æ":"Æ","Æ":"Æ","&":"&","&":"&","Á":"Á","Á":"Á","Ă":"Ă","Â":"Â","Â":"Â","А":"А","𝔄":"𝔄","À":"À","À":"À","Α":"Α","Ā":"Ā","⩓":"⩓","Ą":"Ą","𝔸":"𝔸","⁡":"","Å":"Å","Å":"Å","𝒜":"𝒜","≔":"≔","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","∖":"∖","⫧":"⫧","⌆":"⌆","Б":"Б","∵":"∵","ℬ":"ℬ","Β":"Β","𝔅":"𝔅","𝔹":"𝔹","˘":"˘","ℬ":"ℬ","≎":"≎","Ч":"Ч","©":"©","©":"©","Ć":"Ć","⋒":"⋒","ⅅ":"ⅅ","ℭ":"ℭ","Č":"Č","Ç":"Ç","Ç":"Ç","Ĉ":"Ĉ","∰":"∰","Ċ":"Ċ","¸":"¸","·":"·","ℭ":"ℭ","Χ":"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮","ℂ":"ℂ","∐":"∐","∳":"∳","⨯":"⨯","𝒞":"𝒞","⋓":"⋓","≍":"≍","ⅅ":"ⅅ","⤑":"⤑","Ђ":"Ђ","Ѕ":"Ѕ","Џ":"Џ","‡":"‡","↡":"↡","⫤":"⫤","Ď":"Ď","Д":"Д","∇":"∇","Δ":"Δ","𝔇":"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄","ⅆ":"ⅆ","𝔻":"𝔻","¨":"¨","⃜":"⃜","≐":"≐","∯":"∯","¨":"¨","⇓":"⇓","⇐":"⇐","⇔":"⇔","⫤":"⫤","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧","⇓":"⇓","𝒟":"𝒟","Đ":"Đ","Ŋ":"Ŋ","Ð":"Ð","Ð":"Ð","É":"É","É":"É","Ě":"Ě","Ê":"Ê","Ê":"Ê","Э":"Э","Ė":"Ė","𝔈":"𝔈","È":"È","È":"È","∈":"∈","Ē":"Ē","◻":"◻","▫":"▫","Ę":"Ę","𝔼":"𝔼","Ε":"Ε","⩵":"⩵","≂":"≂","⇌":"⇌","ℰ":"ℰ","⩳":"⩳","Η":"Η","Ë":"Ë","Ë":"Ë","∃":"∃","ⅇ":"ⅇ","Ф":"Ф","𝔉":"𝔉","◼":"◼","▪":"▪","𝔽":"𝔽","∀":"∀","ℱ":"ℱ","ℱ":"ℱ","Ѓ":"Ѓ",">":">",">":">","Γ":"Γ","Ϝ":"Ϝ","Ğ":"Ğ","Ģ":"Ģ","Ĝ":"Ĝ","Г":"Г","Ġ":"Ġ","𝔊":"𝔊","⋙":"⋙","𝔾":"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳","𝒢":"𝒢","≫":"≫","Ъ":"Ъ","ˇ":"ˇ","^":"^","Ĥ":"Ĥ","ℌ":"ℌ","ℋ":"ℋ","ℍ":"ℍ","─":"─","ℋ":"ℋ","Ħ":"Ħ","≎":"≎","≏":"≏","Е":"Е","IJ":"IJ","Ё":"Ё","Í":"Í","Í":"Í","Î":"Î","Î":"Î","И":"И","İ":"İ","ℑ":"ℑ","Ì":"Ì","Ì":"Ì","ℑ":"ℑ","Ī":"Ī","ⅈ":"ⅈ","⇒":"⇒","∬":"∬","∫":"∫","⋂":"⋂","⁣":"","⁢":"","Į":"Į","𝕀":"𝕀","Ι":"Ι","ℐ":"ℐ","Ĩ":"Ĩ","І":"І","Ï":"Ï","Ï":"Ï","Ĵ":"Ĵ","Й":"Й","𝔍":"𝔍","𝕁":"𝕁","𝒥":"𝒥","Ј":"Ј","Є":"Є","Х":"Х","Ќ":"Ќ","Κ":"Κ","Ķ":"Ķ","К":"К","𝔎":"𝔎","𝕂":"𝕂","𝒦":"𝒦","Љ":"Љ","<":"<","<":"<","Ĺ":"Ĺ","Λ":"Λ","⟪":"⟪","ℒ":"ℒ","↞":"↞","Ľ":"Ľ","Ļ":"Ļ","Л":"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⇐":"⇐","⇔":"⇔","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲","𝔏":"𝔏","⋘":"⋘","⇚":"⇚","Ŀ":"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶","⟸":"⟸","⟺":"⟺","⟹":"⟹","𝕃":"𝕃","↙":"↙","↘":"↘","ℒ":"ℒ","↰":"↰","Ł":"Ł","≪":"≪","⤅":"⤅","М":"М"," ":" ","ℳ":"ℳ","𝔐":"𝔐","∓":"∓","𝕄":"𝕄","ℳ":"ℳ","Μ":"Μ","Њ":"Њ","Ń":"Ń","Ň":"Ň","Ņ":"Ņ","Н":"Н","​":"","​":"","​":"","​":"","≫":"≫","≪":"≪","
":`
|
|
6
|
+
`,"𝔑":"𝔑","⁠":""," ":" ","ℕ":"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩","Ñ":"Ñ","Ñ":"Ñ","Ν":"Ν","Œ":"Œ","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","О":"О","Ő":"Ő","𝔒":"𝔒","Ò":"Ò","Ò":"Ò","Ō":"Ō","Ω":"Ω","Ο":"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪","Ø":"Ø","Ø":"Ø","Õ":"Õ","Õ":"Õ","⨷":"⨷","Ö":"Ö","Ö":"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂","П":"П","𝔓":"𝔓","Φ":"Φ","Π":"Π","±":"±","ℌ":"ℌ","ℙ":"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∷":"∷","∝":"∝","𝒫":"𝒫","Ψ":"Ψ",""":'"',""":'"',"𝔔":"𝔔","ℚ":"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®","®":"®","Ŕ":"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖","Ř":"Ř","Ŗ":"Ŗ","Р":"Р","ℜ":"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯","ℜ":"ℜ","Ρ":"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓","⇒":"⇒","ℝ":"ℝ","⥰":"⥰","⇛":"⇛","ℛ":"ℛ","↱":"↱","⧴":"⧴","Щ":"Щ","Ш":"Ш","Ь":"Ь","Ś":"Ś","⪼":"⪼","Š":"Š","Ş":"Ş","Ŝ":"Ŝ","С":"С","𝔖":"𝔖","↓":"↓","←":"←","→":"→","↑":"↑","Σ":"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∋":"∋","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇","⋑":"⋑","Þ":"Þ","Þ":"Þ","™":"™","Ћ":"Ћ","Ц":"Ц","	":" ","Τ":"Τ","Ť":"Ť","Ţ":"Ţ","Т":"Т","𝔗":"𝔗","∴":"∴","Θ":"Θ","  ":" "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯","Ŧ":"Ŧ","Ú":"Ú","Ú":"Ú","↟":"↟","⥉":"⥉","Ў":"Ў","Ŭ":"Ŭ","Û":"Û","Û":"Û","У":"У","Ű":"Ű","𝔘":"𝔘","Ù":"Ù","Ù":"Ù","Ū":"Ū","_":"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎","Ų":"Ų","𝕌":"𝕌","↑":"↑","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","⇑":"⇑","⇕":"⇕","↖":"↖","↗":"↗","ϒ":"ϒ","Υ":"Υ","Ů":"Ů","𝒰":"𝒰","Ũ":"Ũ","Ü":"Ü","Ü":"Ü","⊫":"⊫","⫫":"⫫","В":"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪","Ŵ":"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛","Ξ":"Ξ","𝕏":"𝕏","𝒳":"𝒳","Я":"Я","Ї":"Ї","Ю":"Ю","Ý":"Ý","Ý":"Ý","Ŷ":"Ŷ","Ы":"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴","Ÿ":"Ÿ","Ж":"Ж","Ź":"Ź","Ž":"Ž","З":"З","Ż":"Ż","​":"","Ζ":"Ζ","ℨ":"ℨ","ℤ":"ℤ","𝒵":"𝒵","á":"á","á":"á","ă":"ă","∾":"∾","∾̳":"∾̳","∿":"∿","â":"â","â":"â","´":"´","´":"´","а":"а","æ":"æ","æ":"æ","⁡":"","𝔞":"𝔞","à":"à","à":"à","ℵ":"ℵ","ℵ":"ℵ","α":"α","ā":"ā","⨿":"⨿","&":"&","&":"&","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∠":"∠","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","Å":"Å","⍼":"⍼","ą":"ą","𝕒":"𝕒","≈":"≈","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'","≈":"≈","≊":"≊","å":"å","å":"å","𝒶":"𝒶","*":"*","≈":"≈","≍":"≍","ã":"ã","ã":"ã","ä":"ä","ä":"ä","∳":"∳","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⌅":"⌅","⎵":"⎵","⎶":"⎶","≌":"≌","б":"б","„":"„","∵":"∵","∵":"∵","⦰":"⦰","϶":"϶","ℬ":"ℬ","β":"β","ℶ":"ℶ","≬":"≬","𝔟":"𝔟","⋂":"⋂","◯":"◯","⋃":"⋃","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⋁":"⋁","⋀":"⋀","⤍":"⤍","⧫":"⧫","▪":"▪","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⊥":"⊥","⊥":"⊥","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","─":"─","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","‵":"‵","˘":"˘","¦":"¦","¦":"¦","𝒷":"𝒷","⁏":"⁏","∽":"∽","⋍":"⋍","\":"\\","⧅":"⧅","⟈":"⟈","•":"•","•":"•","≎":"≎","⪮":"⪮","≏":"≏","≏":"≏","ć":"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","ˇ":"ˇ","⩍":"⩍","č":"č","ç":"ç","ç":"ç","ĉ":"ĉ","⩌":"⩌","⩐":"⩐","ċ":"ċ","¸":"¸","¸":"¸","⦲":"⦲","¢":"¢","¢":"¢","·":"·","𝔠":"𝔠","ч":"ч","✓":"✓","✓":"✓","χ":"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","®":"®","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","≗":"≗","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣","♣":"♣",":":":","≔":"≔","≔":"≔",",":",","@":"@","∁":"∁","∘":"∘","∁":"∁","ℂ":"ℂ","≅":"≅","⩭":"⩭","∮":"∮","𝕔":"𝕔","∐":"∐","©":"©","©":"©","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋞":"⋞","⋟":"⋟","⋎":"⋎","⋏":"⋏","¤":"¤","¤":"¤","↶":"↶","↷":"↷","⋎":"⋎","⋏":"⋏","∲":"∲","∱":"∱","⌭":"⌭","⇓":"⇓","⥥":"⥥","†":"†","ℸ":"ℸ","↓":"↓","‐":"‐","⊣":"⊣","⤏":"⤏","˝":"˝","ď":"ď","д":"д","ⅆ":"ⅆ","‡":"‡","⇊":"⇊","⩷":"⩷","°":"°","°":"°","δ":"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","⇃":"⇃","⇂":"⇂","⋄":"⋄","⋄":"⋄","♦":"♦","♦":"♦","¨":"¨","ϝ":"ϝ","⋲":"⋲","÷":"÷","÷":"÷","÷":"÷","⋇":"⋇","⋇":"⋇","ђ":"ђ","⌞":"⌞","⌍":"⌍","$":"$","𝕕":"𝕕","˙":"˙","≐":"≐","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌆":"⌆","↓":"↓","⇊":"⇊","⇃":"⇃","⇂":"⇂","⤐":"⤐","⌟":"⌟","⌌":"⌌","𝒹":"𝒹","ѕ":"ѕ","⧶":"⧶","đ":"đ","⋱":"⋱","▿":"▿","▾":"▾","⇵":"⇵","⥯":"⥯","⦦":"⦦","џ":"џ","⟿":"⟿","⩷":"⩷","≑":"≑","é":"é","é":"é","⩮":"⩮","ě":"ě","≖":"≖","ê":"ê","ê":"ê","≕":"≕","э":"э","ė":"ė","ⅇ":"ⅇ","≒":"≒","𝔢":"𝔢","⪚":"⪚","è":"è","è":"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧","ℓ":"ℓ","⪕":"⪕","⪗":"⪗","ē":"ē","∅":"∅","∅":"∅","∅":"∅"," ":" "," ":" "," ":" ","ŋ":"ŋ"," ":" ","ę":"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱","ε":"ε","ε":"ε","ϵ":"ϵ","≖":"≖","≕":"≕","≂":"≂","⪖":"⪖","⪕":"⪕","=":"=","≟":"≟","≡":"≡","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱","ℯ":"ℯ","≐":"≐","≂":"≂","η":"η","ð":"ð","ð":"ð","ë":"ë","ë":"ë","€":"€","!":"!","∃":"∃","ℰ":"ℰ","ⅇ":"ⅇ","≒":"≒","ф":"ф","♀":"♀","ffi":"ffi","ff":"ff","ffl":"ffl","𝔣":"𝔣","fi":"fi","fj":"fj","♭":"♭","fl":"fl","▱":"▱","ƒ":"ƒ","𝕗":"𝕗","∀":"∀","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","½":"½","⅓":"⅓","¼":"¼","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","≧":"≧","⪌":"⪌","ǵ":"ǵ","γ":"γ","ϝ":"ϝ","⪆":"⪆","ğ":"ğ","ĝ":"ĝ","г":"г","ġ":"ġ","≥":"≥","⋛":"⋛","≥":"≥","≧":"≧","⩾":"⩾","⩾":"⩾","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤","≫":"≫","⋙":"⋙","ℷ":"ℷ","ѓ":"ѓ","≷":"≷","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪊":"⪊","⪈":"⪈","⪈":"⪈","≩":"≩","⋧":"⋧","𝕘":"𝕘","`":"`","ℊ":"ℊ","≳":"≳","⪎":"⪎","⪐":"⪐",">":">",">":">","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⪆":"⪆","⥸":"⥸","⋗":"⋗","⋛":"⋛","⪌":"⪌","≷":"≷","≳":"≳","≩︀":"≩︀","≩︀":"≩︀","⇔":"⇔"," ":" ","½":"½","ℋ":"ℋ","ъ":"ъ","↔":"↔","⥈":"⥈","↭":"↭","ℏ":"ℏ","ĥ":"ĥ","♥":"♥","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽","ℏ":"ℏ","ħ":"ħ","⁃":"⁃","‐":"‐","í":"í","í":"í","⁣":"","î":"î","î":"î","и":"и","е":"е","¡":"¡","¡":"¡","⇔":"⇔","𝔦":"𝔦","ì":"ì","ì":"ì","ⅈ":"ⅈ","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩","ij":"ij","ī":"ī","ℑ":"ℑ","ℐ":"ℐ","ℑ":"ℑ","ı":"ı","⊷":"⊷","Ƶ":"Ƶ","∈":"∈","℅":"℅","∞":"∞","⧝":"⧝","ı":"ı","∫":"∫","⊺":"⊺","ℤ":"ℤ","⊺":"⊺","⨗":"⨗","⨼":"⨼","ё":"ё","į":"į","𝕚":"𝕚","ι":"ι","⨼":"⨼","¿":"¿","¿":"¿","𝒾":"𝒾","∈":"∈","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳","∈":"∈","⁢":"","ĩ":"ĩ","і":"і","ï":"ï","ï":"ï","ĵ":"ĵ","й":"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿","ј":"ј","є":"є","κ":"κ","ϰ":"ϰ","ķ":"ķ","к":"к","𝔨":"𝔨","ĸ":"ĸ","х":"х","ќ":"ќ","𝕜":"𝕜","𝓀":"𝓀","⇚":"⇚","⇐":"⇐","⤛":"⤛","⤎":"⤎","≦":"≦","⪋":"⪋","⥢":"⥢","ĺ":"ĺ","⦴":"⦴","ℒ":"ℒ","λ":"λ","⟨":"⟨","⦑":"⦑","⟨":"⟨","⪅":"⪅","«":"«","«":"«","←":"←","⇤":"⇤","⤟":"⤟","⤝":"⤝","↩":"↩","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍","ľ":"ľ","ļ":"ļ","⌈":"⌈","{":"{","л":"л","⤶":"⤶","“":"“","„":"„","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","←":"←","↢":"↢","↽":"↽","↼":"↼","⇇":"⇇","↔":"↔","⇆":"⇆","⇋":"⇋","↭":"↭","⋋":"⋋","⋚":"⋚","≤":"≤","≦":"≦","⩽":"⩽","⩽":"⩽","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⪅":"⪅","⋖":"⋖","⋚":"⋚","⪋":"⪋","≶":"≶","≲":"≲","⥼":"⥼","⌊":"⌊","𝔩":"𝔩","≶":"≶","⪑":"⪑","↽":"↽","↼":"↼","⥪":"⥪","▄":"▄","љ":"љ","≪":"≪","⇇":"⇇","⌞":"⌞","⥫":"⥫","◺":"◺","ŀ":"ŀ","⎰":"⎰","⎰":"⎰","≨":"≨","⪉":"⪉","⪉":"⪉","⪇":"⪇","⪇":"⪇","≨":"≨","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟦":"⟦","⟵":"⟵","⟷":"⟷","⟼":"⟼","⟶":"⟶","↫":"↫","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","_":"_","◊":"◊","◊":"◊","⧫":"⧫","(":"(","⦓":"⦓","⇆":"⇆","⌟":"⌟","⇋":"⇋","⥭":"⥭","‎":"","⊿":"⊿","‹":"‹","𝓁":"𝓁","↰":"↰","≲":"≲","⪍":"⪍","⪏":"⪏","[":"[","‘":"‘","‚":"‚","ł":"ł","<":"<","<":"<","⪦":"⪦","⩹":"⩹","⋖":"⋖","⋋":"⋋","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⊴":"⊴","◂":"◂","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","≨︀":"≨︀","∺":"∺","¯":"¯","¯":"¯","♂":"♂","✠":"✠","✠":"✠","↦":"↦","↦":"↦","↧":"↧","↤":"↤","↥":"↥","▮":"▮","⨩":"⨩","м":"м","—":"—","∡":"∡","𝔪":"𝔪","℧":"℧","µ":"µ","µ":"µ","∣":"∣","*":"*","⫰":"⫰","·":"·","·":"·","−":"−","⊟":"⊟","∸":"∸","⨪":"⨪","⫛":"⫛","…":"…","∓":"∓","⊧":"⊧","𝕞":"𝕞","∓":"∓","𝓂":"𝓂","∾":"∾","μ":"μ","⊸":"⊸","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","≫̸":"≫̸","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","≪̸":"≪̸","⇏":"⇏","⊯":"⊯","⊮":"⊮","∇":"∇","ń":"ń","∠⃒":"∠⃒","≉":"≉","⩰̸":"⩰̸","≋̸":"≋̸","ʼn":"ʼn","≉":"≉","♮":"♮","♮":"♮","ℕ":"ℕ"," ":" "," ":" ","≎̸":"≎̸","≏̸":"≏̸","⩃":"⩃","ň":"ň","ņ":"ņ","≇":"≇","⩭̸":"⩭̸","⩂":"⩂","н":"н","–":"–","≠":"≠","⇗":"⇗","⤤":"⤤","↗":"↗","↗":"↗","≐̸":"≐̸","≢":"≢","⤨":"⤨","≂̸":"≂̸","∄":"∄","∄":"∄","𝔫":"𝔫","≧̸":"≧̸","≱":"≱","≱":"≱","≧̸":"≧̸","⩾̸":"⩾̸","⩾̸":"⩾̸","≵":"≵","≯":"≯","≯":"≯","⇎":"⇎","↮":"↮","⫲":"⫲","∋":"∋","⋼":"⋼","⋺":"⋺","∋":"∋","њ":"њ","⇍":"⇍","≦̸":"≦̸","↚":"↚","‥":"‥","≰":"≰","↚":"↚","↮":"↮","≰":"≰","≦̸":"≦̸","⩽̸":"⩽̸","⩽̸":"⩽̸","≮":"≮","≴":"≴","≮":"≮","⋪":"⋪","⋬":"⋬","∤":"∤","𝕟":"𝕟","¬":"¬","¬":"¬","∉":"∉","⋹̸":"⋹̸","⋵̸":"⋵̸","∉":"∉","⋷":"⋷","⋶":"⋶","∌":"∌","∌":"∌","⋾":"⋾","⋽":"⋽","∦":"∦","∦":"∦","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","⊀":"⊀","⋠":"⋠","⪯̸":"⪯̸","⊀":"⊀","⪯̸":"⪯̸","⇏":"⇏","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","↛":"↛","⋫":"⋫","⋭":"⋭","⊁":"⊁","⋡":"⋡","⪰̸":"⪰̸","𝓃":"𝓃","∤":"∤","∦":"∦","≁":"≁","≄":"≄","≄":"≄","∤":"∤","∦":"∦","⋢":"⋢","⋣":"⋣","⊄":"⊄","⫅̸":"⫅̸","⊈":"⊈","⊂⃒":"⊂⃒","⊈":"⊈","⫅̸":"⫅̸","⊁":"⊁","⪰̸":"⪰̸","⊅":"⊅","⫆̸":"⫆̸","⊉":"⊉","⊃⃒":"⊃⃒","⊉":"⊉","⫆̸":"⫆̸","≹":"≹","ñ":"ñ","ñ":"ñ","≸":"≸","⋪":"⋪","⋬":"⋬","⋫":"⋫","⋭":"⋭","ν":"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","↖":"↖","↖":"↖","⤧":"⤧","Ⓢ":"Ⓢ","ó":"ó","ó":"ó","⊛":"⊛","⊚":"⊚","ô":"ô","ô":"ô","о":"о","⊝":"⊝","ő":"ő","⨸":"⨸","⊙":"⊙","⦼":"⦼","œ":"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛","ò":"ò","ò":"ò","⧁":"⧁","⦵":"⦵","Ω":"Ω","∮":"∮","↺":"↺","⦾":"⦾","⦻":"⦻","‾":"‾","⧀":"⧀","ō":"ō","ω":"ω","ο":"ο","⦶":"⦶","⊖":"⊖","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","⊕":"⊕","∨":"∨","↻":"↻","⩝":"⩝","ℴ":"ℴ","ℴ":"ℴ","ª":"ª","ª":"ª","º":"º","º":"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛","ℴ":"ℴ","ø":"ø","ø":"ø","⊘":"⊘","õ":"õ","õ":"õ","⊗":"⊗","⨶":"⨶","ö":"ö","ö":"ö","⌽":"⌽","∥":"∥","¶":"¶","¶":"¶","∥":"∥","⫳":"⫳","⫽":"⫽","∂":"∂","п":"п","%":"%",".":".","‰":"‰","⊥":"⊥","‱":"‱","𝔭":"𝔭","φ":"φ","ϕ":"ϕ","ℳ":"ℳ","☎":"☎","π":"π","⋔":"⋔","ϖ":"ϖ","ℏ":"ℏ","ℎ":"ℎ","ℏ":"ℏ","+":"+","⨣":"⨣","⊞":"⊞","⨢":"⨢","∔":"∔","⨥":"⨥","⩲":"⩲","±":"±","±":"±","⨦":"⨦","⨧":"⨧","±":"±","⨕":"⨕","𝕡":"𝕡","£":"£","£":"£","≺":"≺","⪳":"⪳","⪷":"⪷","≼":"≼","⪯":"⪯","≺":"≺","⪷":"⪷","≼":"≼","⪯":"⪯","⪹":"⪹","⪵":"⪵","⋨":"⋨","≾":"≾","′":"′","ℙ":"ℙ","⪵":"⪵","⪹":"⪹","⋨":"⋨","∏":"∏","⌮":"⌮","⌒":"⌒","⌓":"⌓","∝":"∝","∝":"∝","≾":"≾","⊰":"⊰","𝓅":"𝓅","ψ":"ψ"," ":" ","𝔮":"𝔮","⨌":"⨌","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","ℍ":"ℍ","⨖":"⨖","?":"?","≟":"≟",""":'"',""":'"',"⇛":"⇛","⇒":"⇒","⤜":"⤜","⤏":"⤏","⥤":"⥤","∽̱":"∽̱","ŕ":"ŕ","√":"√","⦳":"⦳","⟩":"⟩","⦒":"⦒","⦥":"⦥","⟩":"⟩","»":"»","»":"»","→":"→","⥵":"⥵","⇥":"⇥","⤠":"⤠","⤳":"⤳","⤞":"⤞","↪":"↪","↬":"↬","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","ℚ":"ℚ","⤍":"⤍","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐","ř":"ř","ŗ":"ŗ","⌉":"⌉","}":"}","р":"р","⤷":"⤷","⥩":"⥩","”":"”","”":"”","↳":"↳","ℜ":"ℜ","ℛ":"ℛ","ℜ":"ℜ","ℝ":"ℝ","▭":"▭","®":"®","®":"®","⥽":"⥽","⌋":"⌋","𝔯":"𝔯","⇁":"⇁","⇀":"⇀","⥬":"⥬","ρ":"ρ","ϱ":"ϱ","→":"→","↣":"↣","⇁":"⇁","⇀":"⇀","⇄":"⇄","⇌":"⇌","⇉":"⇉","↝":"↝","⋌":"⋌","˚":"˚","≓":"≓","⇄":"⇄","⇌":"⇌","‏":"","⎱":"⎱","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⟧":"⟧","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","⇉":"⇉","›":"›","𝓇":"𝓇","↱":"↱","]":"]","’":"’","’":"’","⋌":"⋌","⋊":"⋊","▹":"▹","⊵":"⊵","▸":"▸","⧎":"⧎","⥨":"⥨","℞":"℞","ś":"ś","‚":"‚","≻":"≻","⪴":"⪴","⪸":"⪸","š":"š","≽":"≽","⪰":"⪰","ş":"ş","ŝ":"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓","≿":"≿","с":"с","⋅":"⋅","⊡":"⊡","⩦":"⩦","⇘":"⇘","⤥":"⤥","↘":"↘","↘":"↘","§":"§","§":"§",";":";","⤩":"⤩","∖":"∖","∖":"∖","✶":"✶","𝔰":"𝔰","⌢":"⌢","♯":"♯","щ":"щ","ш":"ш","∣":"∣","∥":"∥","­":"","­":"","σ":"σ","ς":"ς","ς":"ς","∼":"∼","⩪":"⩪","≃":"≃","≃":"≃","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","←":"←","∖":"∖","⨳":"⨳","⧤":"⧤","∣":"∣","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀","ь":"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","♠":"♠","∥":"∥","⊓":"⊓","⊓︀":"⊓︀","⊔":"⊔","⊔︀":"⊔︀","⊏":"⊏","⊑":"⊑","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊐":"⊐","⊒":"⊒","□":"□","□":"□","▪":"▪","▪":"▪","→":"→","𝓈":"𝓈","∖":"∖","⌣":"⌣","⋆":"⋆","☆":"☆","★":"★","ϵ":"ϵ","ϕ":"ϕ","¯":"¯","⊂":"⊂","⫅":"⫅","⪽":"⪽","⊆":"⊆","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⊂":"⊂","⊆":"⊆","⫅":"⫅","⊊":"⊊","⫋":"⫋","⫇":"⫇","⫕":"⫕","⫓":"⫓","≻":"≻","⪸":"⪸","≽":"≽","⪰":"⪰","⪺":"⪺","⪶":"⪶","⋩":"⋩","≿":"≿","∑":"∑","♪":"♪","¹":"¹","¹":"¹","²":"²","²":"²","³":"³","³":"³","⊃":"⊃","⫆":"⫆","⪾":"⪾","⫘":"⫘","⊇":"⊇","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⊃":"⊃","⊇":"⊇","⫆":"⫆","⊋":"⊋","⫌":"⫌","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤦":"⤦","↙":"↙","↙":"↙","⤪":"⤪","ß":"ß","ß":"ß","⌖":"⌖","τ":"τ","⎴":"⎴","ť":"ť","ţ":"ţ","т":"т","⃛":"⃛","⌕":"⌕","𝔱":"𝔱","∴":"∴","∴":"∴","θ":"θ","ϑ":"ϑ","ϑ":"ϑ","≈":"≈","∼":"∼"," ":" ","≈":"≈","∼":"∼","þ":"þ","þ":"þ","˜":"˜","×":"×","×":"×","⊠":"⊠","⨱":"⨱","⨰":"⨰","∭":"∭","⤨":"⤨","⊤":"⊤","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","⤩":"⤩","‴":"‴","™":"™","▵":"▵","▿":"▿","◃":"◃","⊴":"⊴","≜":"≜","▹":"▹","⊵":"⊵","◬":"◬","≜":"≜","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉","ц":"ц","ћ":"ћ","ŧ":"ŧ","≬":"≬","↞":"↞","↠":"↠","⇑":"⇑","⥣":"⥣","ú":"ú","ú":"ú","↑":"↑","ў":"ў","ŭ":"ŭ","û":"û","û":"û","у":"у","⇅":"⇅","ű":"ű","⥮":"⥮","⥾":"⥾","𝔲":"𝔲","ù":"ù","ù":"ù","↿":"↿","↾":"↾","▀":"▀","⌜":"⌜","⌜":"⌜","⌏":"⌏","◸":"◸","ū":"ū","¨":"¨","¨":"¨","ų":"ų","𝕦":"𝕦","↑":"↑","↕":"↕","↿":"↿","↾":"↾","⊎":"⊎","υ":"υ","ϒ":"ϒ","υ":"υ","⇈":"⇈","⌝":"⌝","⌝":"⌝","⌎":"⌎","ů":"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰","ũ":"ũ","▵":"▵","▴":"▴","⇈":"⇈","ü":"ü","ü":"ü","⦧":"⦧","⇕":"⇕","⫨":"⫨","⫩":"⫩","⊨":"⊨","⦜":"⦜","ϵ":"ϵ","ϰ":"ϰ","∅":"∅","ϕ":"ϕ","ϖ":"ϖ","∝":"∝","↕":"↕","ϱ":"ϱ","ς":"ς","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀","ϑ":"ϑ","⊲":"⊲","⊳":"⊳","в":"в","⊢":"⊢","∨":"∨","⊻":"⊻","≚":"≚","⋮":"⋮","|":"|","|":"|","𝔳":"𝔳","⊲":"⊲","⊂⃒":"⊂⃒","⊃⃒":"⊃⃒","𝕧":"𝕧","∝":"∝","⊳":"⊳","𝓋":"𝓋","⫋︀":"⫋︀","⊊︀":"⊊︀","⫌︀":"⫌︀","⊋︀":"⊋︀","⦚":"⦚","ŵ":"ŵ","⩟":"⩟","∧":"∧","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","℘":"℘","≀":"≀","≀":"≀","𝓌":"𝓌","⋂":"⋂","◯":"◯","⋃":"⋃","▽":"▽","𝔵":"𝔵","⟺":"⟺","⟷":"⟷","ξ":"ξ","⟸":"⟸","⟵":"⟵","⟼":"⟼","⋻":"⋻","⨀":"⨀","𝕩":"𝕩","⨁":"⨁","⨂":"⨂","⟹":"⟹","⟶":"⟶","𝓍":"𝓍","⨆":"⨆","⨄":"⨄","△":"△","⋁":"⋁","⋀":"⋀","ý":"ý","ý":"ý","я":"я","ŷ":"ŷ","ы":"ы","¥":"¥","¥":"¥","𝔶":"𝔶","ї":"ї","𝕪":"𝕪","𝓎":"𝓎","ю":"ю","ÿ":"ÿ","ÿ":"ÿ","ź":"ź","ž":"ž","з":"з","ż":"ż","ℨ":"ℨ","ζ":"ζ","𝔷":"𝔷","ж":"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","‍":"","‌":""};function Hl(r){return r.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,t)=>{if(typeof Ti[e]=="string")return Ti[e];if(t.charAt(0)!=="#"||e.charAt(e.length-1)!==";")return e;let n;t.charAt(1)==="x"?n=parseInt(t.substr(2),16):n=parseInt(t.substr(1),10);var s="";return n>=55296&&n<=57343||n>1114111?"�":(n>65535&&(n-=65536,s+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),s+=String.fromCharCode(n),s)})}function Ct(r){return r.trim().replace(/[<>"'?&]/g,e=>{let t=e.charCodeAt(0).toString(16);return t.length<2&&(t="0"+t),"&#x"+t.toUpperCase()+";"})}function Gl(r){return"<div>"+Ct(r).replace(/\n/g,"<br />")+"</div>"}function Jl(r){return r=r.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
|
|
7
7
|
`).replace(/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,`
|
|
8
8
|
|
|
9
9
|
`).replace(/<script\b[^>]*>.*?<\/script\b[^>]*>/gi," ").replace(/^.*<body\b[^>]*>/i,"").replace(/^.*<\/head\b[^>]*>/i,"").replace(/^.*<\!doctype\b[^>]*>/i,"").replace(/<\/body\b[^>]*>.*$/i,"").replace(/<\/html\b[^>]*>.*$/i,"").replace(/<a\b[^>]*href\s*=\s*["']?([^\s"']+)[^>]*>/gi," ($1) ").replace(/<\/?(span|em|i|strong|b|u|a)\b[^>]*>/gi,"").replace(/<li\b[^>]*>[\n\u0001\s]*/gi,"* ").replace(/<hr\b[^>]*>/g,`
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
|
|
14
14
|
`).replace(/^\n+/,`
|
|
15
15
|
`).replace(/\n+$/,`
|
|
16
|
-
`),
|
|
17
|
-
`)}return
|
|
16
|
+
`),r=Hl(r),r}function Ko(r){return[].concat(r.name||[]).concat(r.name?`<${r.address}>`:r.address).join(" ")}function rs(r){let e=[],t=(n,s)=>{if(s&&e.push(", "),n.group){let o=`${n.name}:`,i=";";e.push(o),n.group.forEach(t),e.push(i)}else e.push(Ko(n))};return r.forEach(t),e.join("")}function Ho(r){return`<a href="mailto:${Ct(r.address)}" class="postal-email-address">${Ct(r.name||`<${r.address}>`)}</a>`}function ns(r){let e=[],t=(n,s)=>{if(s&&e.push('<span class="postal-email-address-separator">, </span>'),n.group){let o=`<span class="postal-email-address-group">${Ct(n.name)}:</span>`,i='<span class="postal-email-address-group">;</span>';e.push(o),n.group.forEach(t),e.push(i)}else e.push(Ho(n))};return r.forEach(t),e.join(" ")}function Ql(r,e,t){r=(r||"").toString(),e=e||76;let n=0,s=r.length,o="",i,u;for(;n<s;){if(i=r.substr(n,e),i.length<e){o+=i;break}if(u=i.match(/^[^\n\r]*(\r?\n|\r)/)){i=u[0],o+=i,n+=i.length;continue}else(u=i.match(/(\s+)[^\s]*$/))&&u[0].length-(u[1]||"").length<i.length?i=i.substr(0,i.length-(u[0].length-(u[1]||"").length)):(u=r.substr(n+i.length).match(/^[^\s]+(\s*)/))&&(i=i+u[0].substr(0,u[0].length-0));o+=i,n+=i.length,n<s&&(o+=`\r
|
|
17
|
+
`)}return o}function Bi(r){let e=[];if(r.from&&e.push({key:"From",val:Ko(r.from)}),r.subject&&e.push({key:"Subject",val:r.subject}),r.date){let i={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},u=typeof Intl>"u"?r.date:new Intl.DateTimeFormat("default",i).format(new Date(r.date));e.push({key:"Date",val:u})}r.to&&r.to.length&&e.push({key:"To",val:rs(r.to)}),r.cc&&r.cc.length&&e.push({key:"Cc",val:rs(r.cc)}),r.bcc&&r.bcc.length&&e.push({key:"Bcc",val:rs(r.bcc)});let t=e.map(i=>i.key.length).reduce((i,u)=>u>i?u:i,0);e=e.flatMap(i=>{let u=t-i.key.length,l=`${i.key}: ${" ".repeat(u)}`,a=`${" ".repeat(i.key.length+1)} ${" ".repeat(u)}`;return Ql(i.val,80).split(/\r?\n/).map(f=>f.trim()).map((f,d)=>`${d?a:l}${f}`)});let n=e.map(i=>i.length).reduce((i,u)=>u>i?u:i,0),s="-".repeat(n);return`
|
|
18
18
|
${s}
|
|
19
19
|
${e.join(`
|
|
20
20
|
`)}
|
|
21
21
|
${s}
|
|
22
|
-
`}function
|
|
23
|
-
<div class="postal-email-header-row">`)}${e.length?"</div>":""}</div>`}function
|
|
24
|
-
`,",",";"].includes(
|
|
25
|
-
`&&(e=" "),(e.charCodeAt(0)>=33||[" "," "].includes(e))&&(this.node.value+=e),this.escaped=!1}}const
|
|
22
|
+
`}function Ni(r){let e=[];if(r.from&&e.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${Ho(r.from)}</div>`),r.subject&&e.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${Ct(r.subject)}</div>`),r.date){let n={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},s=typeof Intl>"u"?r.date:new Intl.DateTimeFormat("default",n).format(new Date(r.date));e.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${Ct(r.date)}">${Ct(s)}</div>`)}return r.to&&r.to.length&&e.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${ns(r.to)}</div>`),r.cc&&r.cc.length&&e.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${ns(r.cc)}</div>`),r.bcc&&r.bcc.length&&e.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${ns(r.bcc)}</div>`),`<div class="postal-email-header">${e.length?'<div class="postal-email-header-row">':""}${e.join(`</div>
|
|
23
|
+
<div class="postal-email-header-row">`)}${e.length?"</div>":""}</div>`}function Yl(r,e){let t=!1,n="text",s,o=[],i={address:[],comment:[],group:[],text:[],textWasQuoted:[]},u,l,a=!1;for(u=0,l=r.length;u<l;u++){let c=r[u],f=u?r[u-1]:null;if(c.type==="operator")switch(c.value){case"<":n="address",a=!1;break;case"(":n="comment",a=!1;break;case":":n="group",t=!0,a=!1;break;case'"':a=!a,n="text";break;default:n="text",a=!1;break}else c.value&&(n==="address"&&(c.value=c.value.replace(/^[^<]*<\s*/,"")),f&&f.noBreak&&i[n].length?(i[n][i[n].length-1]+=c.value,n==="text"&&a&&(i.textWasQuoted[i.textWasQuoted.length-1]=!0)):(i[n].push(c.value),n==="text"&&i.textWasQuoted.push(a)))}if(!i.text.length&&i.comment.length&&(i.text=i.comment,i.comment=[]),t){i.text=i.text.join(" ");let c=[];i.group.length&&mr(i.group.join(","),{_depth:e+1}).forEach(d=>{d.group?c=c.concat(d.group):c.push(d)}),o.push({name:gr(i.text||s&&s.name),group:c})}else{if(!i.address.length&&i.text.length){for(u=i.text.length-1;u>=0;u--)if(!i.textWasQuoted[u]&&i.text[u].match(/^[^@\s]+@[^@\s]+$/)){i.address=i.text.splice(u,1),i.textWasQuoted.splice(u,1);break}let c=function(f){return i.address.length?f:(i.address=[f.trim()]," ")};if(!i.address.length)for(u=i.text.length-1;u>=0&&!(!i.textWasQuoted[u]&&(i.text[u]=i.text[u].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,c).trim(),i.address.length));u--);}if(!i.text.length&&i.comment.length&&(i.text=i.comment,i.comment=[]),i.address.length>1&&(i.text=i.text.concat(i.address.splice(1))),i.text=i.text.join(" "),i.address=i.address.join(" "),!i.address&&/^=\?[^=]+?=$/.test(i.text.trim())){const c=mr(gr(i.text));if(c&&c.length)return c}if(!i.address&&t)return[];s={address:i.address||i.text||"",name:gr(i.text||i.address||"")},s.address===s.name&&((s.address||"").match(/@/)?s.name="":s.address=""),o.push(s)}return o}class Xl{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let e=[];for(let t=0,n=this.str.length;t<n;t++){let s=this.str.charAt(t),o=t<n-1?this.str.charAt(t+1):null;this.checkChar(s,o)}return this.list.forEach(t=>{t.value=(t.value||"").toString().trim(),t.value&&e.push(t)}),e}checkChar(e,t){if(!this.escaped){if(e===this.operatorExpecting){this.node={type:"operator",value:e},t&&![" "," ","\r",`
|
|
24
|
+
`,",",";"].includes(t)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",this.escaped=!1;return}else if(!this.operatorExpecting&&e in this.operators){this.node={type:"operator",value:e},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[e],this.escaped=!1;return}else if(['"',"'"].includes(this.operatorExpecting)&&e==="\\"){this.escaped=!0;return}}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),e===`
|
|
25
|
+
`&&(e=" "),(e.charCodeAt(0)>=33||[" "," "].includes(e))&&(this.node.value+=e),this.escaped=!1}}const Zl=50;function mr(r,e){e=e||{};let t=e._depth||0;if(t>Zl)return[];let s=new Xl(r).tokenize(),o=[],i=[],u=[];if(s.forEach(l=>{l.type==="operator"&&(l.value===","||l.value===";")?(i.length&&o.push(i),i=[]):i.push(l)}),i.length&&o.push(i),o.forEach(l=>{l=Yl(l,t),l.length&&(u=u.concat(l))}),e.flatten){let l=[],a=c=>{c.forEach(f=>{if(f.group)return a(f.group);l.push(f)})};return a(u),l}return u}function ea(r){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(r),s=n.byteLength,o=s%3,i=s-o,u,l,a,c,f,d=0;d<i;d=d+3)f=n[d]<<16|n[d+1]<<8|n[d+2],u=(f&16515072)>>18,l=(f&258048)>>12,a=(f&4032)>>6,c=f&63,e+=t[u]+t[l]+t[a]+t[c];return o==1?(f=n[i],u=(f&252)>>2,l=(f&3)<<4,e+=t[u]+t[l]+"=="):o==2&&(f=n[i]<<8|n[i+1],u=(f&64512)>>10,l=(f&1008)>>4,a=(f&15)<<2,e+=t[u]+t[l]+t[a]+"="),e}const ta=256,ra=2*1024*1024;class un{static parse(e,t){return new un(t).parse(e)}constructor(e){this.options=e||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||ta,maxHeadersSize:this.options.maxHeadersSize||ra},this.root=this.currentNode=new Si({postalMime:this,...this.mimeOptions}),this.boundaries=[],this.textContent={},this.attachments=[],this.attachmentEncoding=(this.options.attachmentEncoding||"").toString().replace(/[-_\s]/g,"").trim().toLowerCase()||"arraybuffer",this.started=!1}async finalize(){await this.root.finalize()}async processLine(e,t){let n=this.boundaries;if(n.length&&e.length>2&&e[0]===45&&e[1]===45)for(let s=n.length-1;s>=0;s--){let o=n[s];if(e.length!==o.value.length+2&&e.length!==o.value.length+4)continue;let i=e.length===o.value.length+4;if(i&&(e[e.length-2]!==45||e[e.length-1]!==45))continue;let u=!0;for(let l=0;l<o.value.length;l++)if(e[l+2]!==o.value[l]){u=!1;break}if(u)return i?(await o.node.finalize(),this.currentNode=o.node.parentNode||this.root):(await o.node.finalizeChildNodes(),this.currentNode=new Si({postalMime:this,parentNode:o.node,...this.mimeOptions})),t?this.finalize():void 0}if(this.currentNode.feed(e),t)return this.finalize()}readLine(){let e=this.readPos,t=this.readPos,n=()=>({bytes:new Uint8Array(this.buf,e,t-e),done:this.readPos>=this.av.length});for(;this.readPos<this.av.length;){const s=this.av[this.readPos++];if(s!==13&&s!==10&&(t=this.readPos),s===10)return n()}return n()}async processNodeTree(){let e={},t=new Set,n=this.textMap=new Map,s=this.forceRfc822Attachments(),o=async(i,u,l)=>{if(u=u||!1,l=l||!1,i.contentType.multipart)i.contentType.multipart==="alternative"?u=i:i.contentType.multipart==="related"&&(l=i);else if(this.isInlineMessageRfc822(i)&&!s){const a=new un;i.subMessage=await a.parse(i.content),n.has(i)||n.set(i,{});let c=n.get(i);(i.subMessage.text||!i.subMessage.html)&&(c.plain=c.plain||[],c.plain.push({type:"subMessage",value:i.subMessage}),t.add("plain")),i.subMessage.html&&(c.html=c.html||[],c.html.push({type:"subMessage",value:i.subMessage}),t.add("html")),a.textMap&&a.textMap.forEach((f,d)=>{n.set(d,f)});for(let f of i.subMessage.attachments||[])this.attachments.push(f)}else if(this.isInlineTextNode(i)){let a=i.contentType.parsed.value.substr(i.contentType.parsed.value.indexOf("/")+1),c=u||i;n.has(c)||n.set(c,{});let f=n.get(c);f[a]=f[a]||[],f[a].push({type:"text",value:i.getTextContent()}),t.add(a)}else if(i.content){const a=i.contentDisposition.parsed.params.filename||i.contentType.parsed.params.name||null,c={filename:a?gr(a):null,mimeType:i.contentType.parsed.value,disposition:i.contentDisposition.parsed.value||null};switch(l&&i.contentId&&(c.related=!0),i.contentDescription&&(c.description=i.contentDescription),i.contentId&&(c.contentId=i.contentId),i.contentType.parsed.value){case"text/calendar":case"application/ics":{i.contentType.parsed.params.method&&(c.method=i.contentType.parsed.params.method.toString().toUpperCase().trim());const f=i.getTextContent().replace(/\r?\n/g,`
|
|
26
26
|
`).replace(/\n*$/,`
|
|
27
|
-
`);
|
|
28
|
-
`)}),this.textContent=e}isInlineTextNode(e){if(e.contentDisposition.parsed.value==="attachment")return!1;switch(e.contentType.parsed.value){case"text/html":case"text/plain":return!0;case"text/calendar":case"text/csv":default:return!1}}isInlineMessageRfc822(e){return e.contentType.parsed.value!=="message/rfc822"?!1:(e.contentDisposition.parsed.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let e=!1,r=u=>{u.contentType.multipart||["message/delivery-status","message/feedback-report"].includes(u.contentType.parsed.value)&&(e=!0);for(let s of u.childNodes)r(s)};return r(this.root),e}async resolveStream(e){let r=0,u=[];const s=e.getReader();for(;;){const{done:i,value:l}=await s.read();if(i)break;u.push(l),r+=l.length}const n=new Uint8Array(r);let t=0;for(let i of u)n.set(i,t),t+=i.length;return n}async parse(e){var s,n;if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,e&&typeof e.getReader=="function"&&(e=await this.resolveStream(e)),e=e||new ArrayBuffer(0),typeof e=="string"&&(e=fe.encode(e)),(e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]")&&(e=await Oe(e)),e.buffer instanceof ArrayBuffer&&(e=new Uint8Array(e).buffer),this.buf=e,this.av=new Uint8Array(e),this.readPos=0;this.readPos<this.av.length;){const t=this.readLine();await this.processLine(t.bytes,t.done)}await this.processNodeTree();const r={headers:this.root.headers.map(t=>({key:t.key,value:t.value})).reverse()};for(const t of["from","sender"]){const i=this.root.headers.find(l=>l.key===t);if(i&&i.value){const l=Be(i.value);l&&l.length&&(r[t]=l[0])}}for(const t of["delivered-to","return-path"]){const i=this.root.headers.find(l=>l.key===t);if(i&&i.value){const l=Be(i.value);if(l&&l.length&&l[0].address){const c=t.replace(/\-(.)/g,(d,p)=>p.toUpperCase());r[c]=l[0].address}}}for(const t of["to","cc","bcc","reply-to"]){const i=this.root.headers.filter(c=>c.key===t);let l=[];if(i.filter(c=>c&&c.value).map(c=>Be(c.value)).forEach(c=>l=l.concat(c||[])),l&&l.length){const c=t.replace(/\-(.)/g,(d,p)=>p.toUpperCase());r[c]=l}}for(const t of["subject","message-id","in-reply-to","references"]){const i=this.root.headers.find(l=>l.key===t);if(i&&i.value){const l=t.replace(/\-(.)/g,(c,d)=>d.toUpperCase());r[l]=Ce(i.value)}}let u=this.root.headers.find(t=>t.key==="date");if(u){let t=new Date(u.value);!t||t.toString()==="Invalid Date"?t=u.value:t=t.toISOString(),r.date=t}switch((s=this.textContent)!=null&&s.html&&(r.html=this.textContent.html),(n=this.textContent)!=null&&n.plain&&(r.text=this.textContent.plain),r.attachments=this.attachments,this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let i of r.attachments||[])i!=null&&i.content&&(i.content=ir(i.content),i.encoding="base64");break;case"utf8":let t=new TextDecoder("utf8");for(let i of r.attachments||[])i!=null&&i.content&&(i.content=t.decode(i.content),i.encoding="utf8");break;default:throw new Error("Unknwon attachment encoding")}return r}}class xt{constructor(e){ye(this,"config");if(!e.system_id)throw new Error("MailClient: system_id is REQUIRED");this.config=e}async callCoprocessor(e,r,u={}){const s={coprocessor:e,method:r,system_id:this.config.system_id,params:{user_id:this.config.system_id,...u}};try{const n=await fetch(`${this.config.baseUrl}/spu/invoke`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getToken()}`},body:JSON.stringify(s)});if(!n.ok){const i=await n.text();throw new Error(`API error (${n.status}): ${i}`)}const t=await n.json();if(!t.success&&t.error)throw new Error(t.error);return t.result}catch(n){throw console.error("API call failed:",n),n}}async callMail(e,r={}){return this.callCoprocessor("mail",e,r)}async callEmail(e,r={}){return this.callCoprocessor("email",e,r)}getToken(){return typeof window<"u"&&window.localStorage&&localStorage.getItem("qwanyx_token")||""}async getSettings(){try{return await this.callMail("get_email_settings")||{accounts:[]}}catch{return{accounts:[]}}}async saveSettings(e){await this.callMail("save_email_settings",{accounts:e})}async listEmails(e,r=20,u){return this.callMail("list_emails",{account_id:e,limit:r,folder:u})}async deleteEmails(e,r,u=!0){return this.callMail("delete_emails",{account_id:e,uids:r,expunge:u})}async imapExec(e,r){return this.callMail("imap_exec",{account_id:e,commands:r})}async trashEmails(e,r){const u=["[Gmail]/Trash","[Gmail]/Corbeille","[Gmail]/Bin","Trash"];for(const s of u){const n=["SELECT INBOX",...r.map(l=>`UID MOVE ${l} ${s}`)],i=(await this.imapExec(e,n)).responses.filter(l=>l.ok&&l.command==="UID MOVE").length;if(i>0)return{success:!0,moved:i}}return{success:!1,moved:0}}async archiveEmails(e,r){const u=["SELECT INBOX",...r.map(t=>`UID STORE ${t} +FLAGS (\\Deleted)`),"EXPUNGE"],n=(await this.imapExec(e,u)).responses.filter(t=>t.ok&&t.command==="UID STORE").length;return{success:n>0,archived:n}}async listFolders(e){const u=(await this.imapExec(e,['LIST "" *'])).responses.find(s=>s.command==="LIST");return u!=null&&u.ok&&u.folders?{success:!0,folders:u.folders}:{success:!1,folders:[]}}async listEmailsSorted(e,r="INBOX",u=20){const s=await this.imapExec(e,[`SELECT ${r}`,"FETCH 1:* (UID INTERNALDATE)"]),n=s.responses.find(D=>D.command==="SELECT");if(!(n!=null&&n.ok))throw new Error(`Failed to select folder: ${(n==null?void 0:n.error)||"Unknown error"}`);const t=s.responses.find(D=>D.command==="FETCH");if(!(t!=null&&t.ok)||!t.messages)return{account:{id:e,label:"",email:""},mailbox:{name:r,total:n.exists||0},messages:[]};const l=[...t.messages].sort((D,w)=>{const k=D.internalDate?new Date(D.internalDate).getTime():0;return(w.internalDate?new Date(w.internalDate).getTime():0)-k}).slice(0,u).map(D=>D.uid).filter(Boolean);if(l.length===0)return{account:{id:e,label:"",email:""},mailbox:{name:r,total:n.exists||0},messages:[]};const d=(await this.imapExec(e,[`SELECT ${r}`,`UID FETCH ${l.join(",")} (UID FLAGS ENVELOPE)`])).responses.find(D=>D.command==="UID FETCH");if(!(d!=null&&d.ok)||!d.messages)throw new Error(`Failed to fetch details: ${(d==null?void 0:d.error)||"Unknown error"}`);const p=new Map;for(const D of d.messages)D.uid&&p.set(D.uid,D);const m=l.map(D=>{var U,g,F,y,N;const w=p.get(D);if(!w)return null;const k=((U=w.flags)==null?void 0:U.some(P=>P.includes("Seen")))||!1,M=((F=(g=w.envelope)==null?void 0:g.from)==null?void 0:F.email)||"Unknown",O=((y=w.envelope)==null?void 0:y.subject)||"(No subject)",B=((N=w.envelope)==null?void 0:N.date)||"";return{uid:D,from:M,subject:O,date:B,seen:k}}).filter(Boolean);return{account:{id:e,label:"",email:""},mailbox:{name:r,total:n.exists||0},messages:m}}async getEmail(e,r,u="INBOX"){return this.callMail("get_email",{account_id:e,uid:r,folder:u})}async getEmailParsed(e,r,u="INBOX"){var w,k,M,O;const n=(await this.imapExec(e,[`SELECT "${u}"`,`UID FETCH ${r} (FLAGS BODY[])`])).responses.find(B=>B.command==="UID FETCH");if(!(n!=null&&n.ok)||!((w=n.messages)!=null&&w[0]))return console.error("Failed to fetch raw email:",n==null?void 0:n.error),null;const t=n.messages[0],i=t.body||t.raw;if(!i)return console.error("No raw email content in response"),null;const c=await new _e().parse(i),d=new Map;for(const B of c.attachments||[])if(B.contentId){const U=this.contentToBase64(B.content),g=`data:${B.mimeType};base64,${U}`,F=B.contentId.replace(/^<|>$/g,"");d.set(F,g),d.set(`<${F}>`,g)}let p=c.html||"";p&&d.size>0&&(p=p.replace(/src=["']cid:([^"']+)["']/gi,(B,U)=>{const g=d.get(U)||d.get(`<${U}>`);return g?`src="${g}"`:B}));const m=((k=t.flags)==null?void 0:k.some(B=>B.toLowerCase().includes("seen")))||!1,D=((M=c.from)==null?void 0:M.address)||((O=c.from)==null?void 0:O.name)||"Unknown";return{uid:r,from:D,subject:c.subject||"(No subject)",date:c.date||"",body:p||c.text||"",html:p,text:c.text||"",seen:m,attachments:(c.attachments||[]).map(B=>({filename:B.filename||"attachment",mimeType:B.mimeType||"application/octet-stream",size:this.getContentSize(B.content)}))}}contentToBase64(e){if(typeof e=="string")try{return btoa(e)}catch{return e}const r=e instanceof Uint8Array?e:new Uint8Array(e);let u="";for(let s=0;s<r.byteLength;s++)u+=String.fromCharCode(r[s]);return btoa(u)}getContentSize(e){return e?typeof e=="string"?e.length:(e instanceof Uint8Array,e.byteLength):0}async sendMail(e){const r={to:e.to,subject:e.subject,body:e.body};return e.html&&(r.html=e.html),e.from&&(r.from=e.from),e.smtpConfig&&(r.smtp_config=e.smtpConfig),this.callEmail("send",r)}}const Xe="qwanyx_auth_token",Ze="qwanyx_refresh_token";class vt{static setToken(e){typeof window<"u"&&localStorage.setItem(Xe,e)}static getToken(){return typeof window<"u"?localStorage.getItem(Xe):null}static clearToken(){typeof window<"u"&&(localStorage.removeItem(Xe),localStorage.removeItem(Ze))}static setRefreshToken(e){typeof window<"u"&&localStorage.setItem(Ze,e)}static getRefreshToken(){return typeof window<"u"?localStorage.getItem(Ze):null}static isAuthenticated(){return!!this.getToken()}static getAuthHeader(){const e=this.getToken();return e?{Authorization:`Bearer ${e}`}:{}}}class Et{constructor(e){ye(this,"config");this.config={timeout:3e4,headers:{"Content-Type":"application/json"},...e}}buildQueryString(e){if(!e||Object.keys(e).length===0)return"";const r=new URLSearchParams;Object.entries(e).forEach(([s,n])=>{n!=null&&r.append(s,String(n))});const u=r.toString();return u?`?${u}`:""}async request(e,r={}){const{method:u="GET",headers:s={},body:n,params:t}=r,i=`${this.config.baseUrl}/${e}${this.buildQueryString(t)}`,l={...this.config.headers,...vt.getAuthHeader(),...s},c={method:u,headers:l};n&&u!=="GET"&&(c.body=JSON.stringify(n));try{const d=new AbortController,p=setTimeout(()=>d.abort(),this.config.timeout),m=await fetch(i,{...c,signal:d.signal});if(clearTimeout(p),!m.ok){const D=await m.json().catch(()=>({message:m.statusText}));throw new Error(D.message||`HTTP ${m.status}`)}return await m.json()}catch(d){throw d instanceof Error?d:new Error("An unexpected error occurred")}}async get(e,r){return this.request(e,{method:"GET",params:r})}async post(e,r,u){return this.request(e,{method:"POST",body:r,params:u})}async put(e,r,u){return this.request(e,{method:"PUT",body:r,params:u})}async patch(e,r,u){return this.request(e,{method:"PATCH",body:r,params:u})}async delete(e,r){return this.request(e,{method:"DELETE",params:r})}setBaseUrl(e){this.config.baseUrl=e}getBaseUrl(){return this.config.baseUrl}}let Le=null;function cr(o){return Le=new Et(o),Le}function rt(){if(!Le)throw new Error("API client not initialized. Call initializeApiClient() first.");return Le}function wt(o,e,r={}){const{enabled:u=!0,refetchOnMount:s=!0,onSuccess:n,onError:t}=r,[i,l]=x.useState(null),[c,d]=x.useState(u),[p,m]=x.useState(null),D=x.useCallback(async()=>{if(u){d(!0),m(null);try{const k=await rt().get(o,e);l(k),n==null||n(k)}catch(w){const k=w instanceof Error?w:new Error("Unknown error");m(k),t==null||t(k)}finally{d(!1)}}},[o,JSON.stringify(e),u,n,t]);return x.useEffect(()=>{s&&D()},[D,s]),{data:i,loading:c,error:p,refetch:D}}function dr(o,e="POST",r={}){const{onSuccess:u,onError:s}=r,[n,t]=x.useState(null),[i,l]=x.useState(!1),[c,d]=x.useState(null),p=x.useCallback(async D=>{l(!0),d(null);try{const w=rt();let k;switch(e){case"POST":k=await w.post(o,D);break;case"PUT":k=await w.put(o,D);break;case"PATCH":k=await w.patch(o,D);break;case"DELETE":k=await w.delete(o);break;default:throw new Error(`Unsupported method: ${e}`)}return t(k),u==null||u(k,D),k}catch(w){const k=w instanceof Error?w:new Error("Unknown error");return d(k),s==null||s(k,D),null}finally{l(!1)}},[o,e,u,s]),m=x.useCallback(()=>{t(null),d(null),l(!1)},[]);return{data:n,loading:i,error:c,mutate:p,reset:m}}var tt={exports:{}},xe={};/**
|
|
27
|
+
`);c.content=Ht.encode(f);break}default:c.content=i.content}this.attachments.push(c)}for(let a of i.childNodes)await o(a,u,l)};await o(this.root,!1,[]),n.forEach(i=>{t.forEach(u=>{if(e[u]||(e[u]=[]),i[u])i[u].forEach(l=>{switch(l.type){case"text":e[u].push(l.value);break;case"subMessage":switch(u){case"html":e[u].push(Ni(l.value));break;case"plain":e[u].push(Bi(l.value));break}break}});else{let l;switch(u){case"html":l="plain";break;case"plain":l="html";break}(i[l]||[]).forEach(a=>{switch(a.type){case"text":switch(u){case"html":e[u].push(Gl(a.value));break;case"plain":e[u].push(Jl(a.value));break}break;case"subMessage":switch(u){case"html":e[u].push(Ni(a.value));break;case"plain":e[u].push(Bi(a.value));break}break}})}})}),Object.keys(e).forEach(i=>{e[i]=e[i].join(`
|
|
28
|
+
`)}),this.textContent=e}isInlineTextNode(e){if(e.contentDisposition.parsed.value==="attachment")return!1;switch(e.contentType.parsed.value){case"text/html":case"text/plain":return!0;case"text/calendar":case"text/csv":default:return!1}}isInlineMessageRfc822(e){return e.contentType.parsed.value!=="message/rfc822"?!1:(e.contentDisposition.parsed.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let e=!1,t=n=>{n.contentType.multipart||["message/delivery-status","message/feedback-report"].includes(n.contentType.parsed.value)&&(e=!0);for(let s of n.childNodes)t(s)};return t(this.root),e}async resolveStream(e){let t=0,n=[];const s=e.getReader();for(;;){const{done:u,value:l}=await s.read();if(u)break;n.push(l),t+=l.length}const o=new Uint8Array(t);let i=0;for(let u of n)o.set(u,i),i+=u.length;return o}async parse(e){var s,o;if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,e&&typeof e.getReader=="function"&&(e=await this.resolveStream(e)),e=e||new ArrayBuffer(0),typeof e=="string"&&(e=Ht.encode(e)),(e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]")&&(e=await Sn(e)),e.buffer instanceof ArrayBuffer&&(e=new Uint8Array(e).buffer),this.buf=e,this.av=new Uint8Array(e),this.readPos=0;this.readPos<this.av.length;){const i=this.readLine();await this.processLine(i.bytes,i.done)}await this.processNodeTree();const t={headers:this.root.headers.map(i=>({key:i.key,value:i.value})).reverse()};for(const i of["from","sender"]){const u=this.root.headers.find(l=>l.key===i);if(u&&u.value){const l=mr(u.value);l&&l.length&&(t[i]=l[0])}}for(const i of["delivered-to","return-path"]){const u=this.root.headers.find(l=>l.key===i);if(u&&u.value){const l=mr(u.value);if(l&&l.length&&l[0].address){const a=i.replace(/\-(.)/g,(c,f)=>f.toUpperCase());t[a]=l[0].address}}}for(const i of["to","cc","bcc","reply-to"]){const u=this.root.headers.filter(a=>a.key===i);let l=[];if(u.filter(a=>a&&a.value).map(a=>mr(a.value)).forEach(a=>l=l.concat(a||[])),l&&l.length){const a=i.replace(/\-(.)/g,(c,f)=>f.toUpperCase());t[a]=l}}for(const i of["subject","message-id","in-reply-to","references"]){const u=this.root.headers.find(l=>l.key===i);if(u&&u.value){const l=i.replace(/\-(.)/g,(a,c)=>c.toUpperCase());t[l]=gr(u.value)}}let n=this.root.headers.find(i=>i.key==="date");if(n){let i=new Date(n.value);!i||i.toString()==="Invalid Date"?i=n.value:i=i.toISOString(),t.date=i}switch((s=this.textContent)!=null&&s.html&&(t.html=this.textContent.html),(o=this.textContent)!=null&&o.plain&&(t.text=this.textContent.plain),t.attachments=this.attachments,this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let u of t.attachments||[])u!=null&&u.content&&(u.content=ea(u.content),u.encoding="base64");break;case"utf8":let i=new TextDecoder("utf8");for(let u of t.attachments||[])u!=null&&u.content&&(u.content=i.decode(u.content),u.encoding="utf8");break;default:throw new Error("Unknwon attachment encoding")}return t}}class Go{constructor(e){rr(this,"config");if(!e.system_id)throw new Error("MailClient: system_id is REQUIRED");this.config=e}async callCoprocessor(e,t,n={}){const s={coprocessor:e,method:t,system_id:this.config.system_id,params:{user_id:this.config.system_id,...n}};try{const o=await fetch(`${this.config.baseUrl}/spu/invoke`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getToken()}`},body:JSON.stringify(s)});if(!o.ok){const u=await o.text();throw new Error(`API error (${o.status}): ${u}`)}const i=await o.json();if(!i.success&&i.error)throw new Error(i.error);return i.result}catch(o){throw console.error("API call failed:",o),o}}async callMail(e,t={}){return this.callCoprocessor("mail",e,t)}async callEmail(e,t={}){return this.callCoprocessor("email",e,t)}getToken(){return typeof window<"u"&&window.localStorage&&localStorage.getItem("qwanyx_token")||""}async getSettings(){try{return await this.callMail("get_email_settings")||{accounts:[]}}catch{return{accounts:[]}}}async saveSettings(e){await this.callMail("save_email_settings",{accounts:e})}async listEmails(e,t=20,n){return this.callMail("list_emails",{account_id:e,limit:t,folder:n})}async deleteEmails(e,t,n=!0){return this.callMail("delete_emails",{account_id:e,uids:t,expunge:n})}async imapExec(e,t){return this.callMail("imap_exec",{account_id:e,commands:t})}async trashEmails(e,t){const n=["[Gmail]/Trash","[Gmail]/Corbeille","[Gmail]/Bin","Trash"];for(const s of n){const o=["SELECT INBOX",...t.map(l=>`UID MOVE ${l} ${s}`)],u=(await this.imapExec(e,o)).responses.filter(l=>l.ok&&l.command==="UID MOVE").length;if(u>0)return{success:!0,moved:u}}return{success:!1,moved:0}}async archiveEmails(e,t){const n=["SELECT INBOX",...t.map(i=>`UID STORE ${i} +FLAGS (\\Deleted)`),"EXPUNGE"],o=(await this.imapExec(e,n)).responses.filter(i=>i.ok&&i.command==="UID STORE").length;return{success:o>0,archived:o}}async listFolders(e){const n=(await this.imapExec(e,['LIST "" *'])).responses.find(s=>s.command==="LIST");return n!=null&&n.ok&&n.folders?{success:!0,folders:n.folders}:{success:!1,folders:[]}}async listEmailsSorted(e,t="INBOX",n=20){const s=await this.imapExec(e,[`SELECT ${t}`,"FETCH 1:* (UID INTERNALDATE)"]),o=s.responses.find(h=>h.command==="SELECT");if(!(o!=null&&o.ok))throw new Error(`Failed to select folder: ${(o==null?void 0:o.error)||"Unknown error"}`);const i=s.responses.find(h=>h.command==="FETCH");if(!(i!=null&&i.ok)||!i.messages)return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:[]};const l=[...i.messages].sort((h,p)=>{const g=h.internalDate?new Date(h.internalDate).getTime():0;return(p.internalDate?new Date(p.internalDate).getTime():0)-g}).slice(0,n).map(h=>h.uid).filter(Boolean);if(l.length===0)return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:[]};const c=(await this.imapExec(e,[`SELECT ${t}`,`UID FETCH ${l.join(",")} (UID FLAGS ENVELOPE)`])).responses.find(h=>h.command==="UID FETCH");if(!(c!=null&&c.ok)||!c.messages)throw new Error(`Failed to fetch details: ${(c==null?void 0:c.error)||"Unknown error"}`);const f=new Map;for(const h of c.messages)h.uid&&f.set(h.uid,h);const d=l.map(h=>{var C,x,w,b,k;const p=f.get(h);if(!p)return null;const g=((C=p.flags)==null?void 0:C.some(A=>A.includes("Seen")))||!1,_=((w=(x=p.envelope)==null?void 0:x.from)==null?void 0:w.email)||"Unknown",D=((b=p.envelope)==null?void 0:b.subject)||"(No subject)",y=((k=p.envelope)==null?void 0:k.date)||"";return{uid:h,from:_,subject:D,date:y,seen:g}}).filter(Boolean);return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:d}}async getEmail(e,t,n="INBOX"){return this.callMail("get_email",{account_id:e,uid:t,folder:n})}async getAttachment(e,t,n,s="INBOX"){return this.callMail("get_attachment",{account_id:e,uid:t,attachment_index:n,folder:s})}async getEmailParsed(e,t,n="INBOX"){var p,g,_,D;const o=(await this.imapExec(e,[`SELECT "${n}"`,`UID FETCH ${t} (FLAGS BODY[])`])).responses.find(y=>y.command==="UID FETCH");if(!(o!=null&&o.ok)||!((p=o.messages)!=null&&p[0]))return console.error("Failed to fetch raw email:",o==null?void 0:o.error),null;const i=o.messages[0],u=i.body||i.raw;if(!u)return console.error("No raw email content in response"),null;const a=await new un().parse(u),c=new Map;for(const y of a.attachments||[])if(y.contentId){const C=this.contentToBase64(y.content),x=`data:${y.mimeType};base64,${C}`,w=y.contentId.replace(/^<|>$/g,"");c.set(w,x),c.set(`<${w}>`,x)}let f=a.html||"";f&&c.size>0&&(f=f.replace(/src=["']cid:([^"']+)["']/gi,(y,C)=>{const x=c.get(C)||c.get(`<${C}>`);return x?`src="${x}"`:y}));const d=((g=i.flags)==null?void 0:g.some(y=>y.toLowerCase().includes("seen")))||!1,h=((_=a.from)==null?void 0:_.address)||((D=a.from)==null?void 0:D.name)||"Unknown";return{uid:t,from:h,subject:a.subject||"(No subject)",date:a.date||"",body:f||a.text||"",html:f,text:a.text||"",seen:d,attachments:(a.attachments||[]).map(y=>({filename:y.filename||"attachment",mimeType:y.mimeType||"application/octet-stream",size:this.getContentSize(y.content)}))}}contentToBase64(e){if(typeof e=="string")try{return btoa(e)}catch{return e}const t=e instanceof Uint8Array?e:new Uint8Array(e);let n="";for(let s=0;s<t.byteLength;s++)n+=String.fromCharCode(t[s]);return btoa(n)}getContentSize(e){return e?typeof e=="string"?e.length:(e instanceof Uint8Array,e.byteLength):0}async sendMail(e){const t={to:e.to,subject:e.subject,body:e.body};return e.html&&(t.html=e.html),e.from&&(t.from=e.from),e.smtpConfig&&(t.smtp_config=e.smtpConfig),this.callEmail("send",t)}}const ss="qwanyx_auth_token",is="qwanyx_refresh_token";class Jo{static setToken(e){typeof window<"u"&&localStorage.setItem(ss,e)}static getToken(){return typeof window<"u"?localStorage.getItem(ss):null}static clearToken(){typeof window<"u"&&(localStorage.removeItem(ss),localStorage.removeItem(is))}static setRefreshToken(e){typeof window<"u"&&localStorage.setItem(is,e)}static getRefreshToken(){return typeof window<"u"?localStorage.getItem(is):null}static isAuthenticated(){return!!this.getToken()}static getAuthHeader(){const e=this.getToken();return e?{Authorization:`Bearer ${e}`}:{}}}class Qo{constructor(e){rr(this,"config");this.config={timeout:3e4,headers:{"Content-Type":"application/json"},...e}}buildQueryString(e){if(!e||Object.keys(e).length===0)return"";const t=new URLSearchParams;Object.entries(e).forEach(([s,o])=>{o!=null&&t.append(s,String(o))});const n=t.toString();return n?`?${n}`:""}async request(e,t={}){const{method:n="GET",headers:s={},body:o,params:i}=t,u=`${this.config.baseUrl}/${e}${this.buildQueryString(i)}`,l={...this.config.headers,...Jo.getAuthHeader(),...s},a={method:n,headers:l};o&&n!=="GET"&&(a.body=JSON.stringify(o));try{const c=new AbortController,f=setTimeout(()=>c.abort(),this.config.timeout),d=await fetch(u,{...a,signal:c.signal});if(clearTimeout(f),!d.ok){const h=await d.json().catch(()=>({message:d.statusText}));throw new Error(h.message||`HTTP ${d.status}`)}return await d.json()}catch(c){throw c instanceof Error?c:new Error("An unexpected error occurred")}}async get(e,t){return this.request(e,{method:"GET",params:t})}async post(e,t,n){return this.request(e,{method:"POST",body:t,params:n})}async put(e,t,n){return this.request(e,{method:"PUT",body:t,params:n})}async patch(e,t,n){return this.request(e,{method:"PATCH",body:t,params:n})}async delete(e,t){return this.request(e,{method:"DELETE",params:t})}setBaseUrl(e){this.config.baseUrl=e}getBaseUrl(){return this.config.baseUrl}}let ln=null;function na(r){return ln=new Qo(r),ln}function qs(){if(!ln)throw new Error("API client not initialized. Call initializeApiClient() first.");return ln}function Yo(r,e,t={}){const{enabled:n=!0,refetchOnMount:s=!0,onSuccess:o,onError:i}=t,[u,l]=T.useState(null),[a,c]=T.useState(n),[f,d]=T.useState(null),h=T.useCallback(async()=>{if(n){c(!0),d(null);try{const g=await qs().get(r,e);l(g),o==null||o(g)}catch(p){const g=p instanceof Error?p:new Error("Unknown error");d(g),i==null||i(g)}finally{c(!1)}}},[r,JSON.stringify(e),n,o,i]);return T.useEffect(()=>{s&&h()},[h,s]),{data:u,loading:a,error:f,refetch:h}}function sa(r,e="POST",t={}){const{onSuccess:n,onError:s}=t,[o,i]=T.useState(null),[u,l]=T.useState(!1),[a,c]=T.useState(null),f=T.useCallback(async h=>{l(!0),c(null);try{const p=qs();let g;switch(e){case"POST":g=await p.post(r,h);break;case"PUT":g=await p.put(r,h);break;case"PATCH":g=await p.patch(r,h);break;case"DELETE":g=await p.delete(r);break;default:throw new Error(`Unsupported method: ${e}`)}return i(g),n==null||n(g,h),g}catch(p){const g=p instanceof Error?p:new Error("Unknown error");return c(g),s==null||s(g,h),null}finally{l(!1)}},[r,e,n,s]),d=T.useCallback(()=>{i(null),c(null),l(!1)},[]);return{data:o,loading:u,error:a,mutate:f,reset:d}}var _s={exports:{}},nr={};/**
|
|
29
29
|
* @license React
|
|
30
30
|
* react-jsx-runtime.production.min.js
|
|
31
31
|
*
|
|
@@ -33,7 +33,7 @@ ${s}
|
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the MIT license found in the
|
|
35
35
|
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/var
|
|
36
|
+
*/var Fi;function ia(){if(Fi)return nr;Fi=1;var r=T,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(u,l,a){var c,f={},d=null,h=null;a!==void 0&&(d=""+a),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(h=l.ref);for(c in l)n.call(l,c)&&!o.hasOwnProperty(c)&&(f[c]=l[c]);if(u&&u.defaultProps)for(c in l=u.defaultProps,l)f[c]===void 0&&(f[c]=l[c]);return{$$typeof:e,type:u,key:d,ref:h,props:f,_owner:s.current}}return nr.Fragment=t,nr.jsx=i,nr.jsxs=i,nr}var sr={};/**
|
|
37
37
|
* @license React
|
|
38
38
|
* react-jsx-runtime.development.js
|
|
39
39
|
*
|
|
@@ -41,21 +41,103 @@ ${s}
|
|
|
41
41
|
*
|
|
42
42
|
* This source code is licensed under the MIT license found in the
|
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/var
|
|
45
|
-
`+
|
|
46
|
-
`),
|
|
47
|
-
`),
|
|
48
|
-
`+
|
|
44
|
+
*/var Li;function oa(){return Li||(Li=1,process.env.NODE_ENV!=="production"&&function(){var r=T,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),p=Symbol.iterator,g="@@iterator";function _(m){if(m===null||typeof m!="object")return null;var B=p&&m[p]||m[g];return typeof B=="function"?B:null}var D=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(m){{for(var B=arguments.length,M=new Array(B>1?B-1:0),z=1;z<B;z++)M[z-1]=arguments[z];C("error",m,M)}}function C(m,B,M){{var z=D.ReactDebugCurrentFrame,Q=z.getStackAddendum();Q!==""&&(B+="%s",M=M.concat([Q]));var X=M.map(function(H){return String(H)});X.unshift("Warning: "+B),Function.prototype.apply.call(console[m],console,X)}}var x=!1,w=!1,b=!1,k=!1,A=!1,S;S=Symbol.for("react.module.reference");function O(m){return!!(typeof m=="string"||typeof m=="function"||m===n||m===o||A||m===s||m===a||m===c||k||m===h||x||w||b||typeof m=="object"&&m!==null&&(m.$$typeof===d||m.$$typeof===f||m.$$typeof===i||m.$$typeof===u||m.$$typeof===l||m.$$typeof===S||m.getModuleId!==void 0))}function L(m,B,M){var z=m.displayName;if(z)return z;var Q=B.displayName||B.name||"";return Q!==""?M+"("+Q+")":M}function W(m){return m.displayName||"Context"}function q(m){if(m==null)return null;if(typeof m.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof m=="function")return m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case n:return"Fragment";case t:return"Portal";case o:return"Profiler";case s:return"StrictMode";case a:return"Suspense";case c:return"SuspenseList"}if(typeof m=="object")switch(m.$$typeof){case u:var B=m;return W(B)+".Consumer";case i:var M=m;return W(M._context)+".Provider";case l:return L(m,m.render,"ForwardRef");case f:var z=m.displayName||null;return z!==null?z:q(m.type)||"Memo";case d:{var Q=m,X=Q._payload,H=Q._init;try{return q(H(X))}catch{return null}}}return null}var $=Object.assign,V=0,re,Ae,Me,_t,it,ue,Be;function je(){}je.__reactDisabledLog=!0;function ot(){{if(V===0){re=console.log,Ae=console.info,Me=console.warn,_t=console.error,it=console.group,ue=console.groupCollapsed,Be=console.groupEnd;var m={configurable:!0,enumerable:!0,value:je,writable:!0};Object.defineProperties(console,{info:m,log:m,warn:m,error:m,group:m,groupCollapsed:m,groupEnd:m})}V++}}function ut(){{if(V--,V===0){var m={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},m,{value:re}),info:$({},m,{value:Ae}),warn:$({},m,{value:Me}),error:$({},m,{value:_t}),group:$({},m,{value:it}),groupCollapsed:$({},m,{value:ue}),groupEnd:$({},m,{value:Be})})}V<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ye=D.ReactCurrentDispatcher,Qe;function Ee(m,B,M){{if(Qe===void 0)try{throw Error()}catch(Q){var z=Q.stack.trim().match(/\n( *(at )?)/);Qe=z&&z[1]||""}return`
|
|
45
|
+
`+Qe+m}}var Ie=!1,Ye;{var Vn=typeof WeakMap=="function"?WeakMap:Map;Ye=new Vn}function Ur(m,B){if(!m||Ie)return"";{var M=Ye.get(m);if(M!==void 0)return M}var z;Ie=!0;var Q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var X;X=ye.current,ye.current=null,ot();try{if(B){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(_e){z=_e}Reflect.construct(m,[],H)}else{try{H.call()}catch(_e){z=_e}m.call(H.prototype)}}else{try{throw Error()}catch(_e){z=_e}m()}}catch(_e){if(_e&&z&&typeof _e.stack=="string"){for(var K=_e.stack.split(`
|
|
46
|
+
`),he=z.stack.split(`
|
|
47
|
+
`),ne=K.length-1,se=he.length-1;ne>=1&&se>=0&&K[ne]!==he[se];)se--;for(;ne>=1&&se>=0;ne--,se--)if(K[ne]!==he[se]){if(ne!==1||se!==1)do if(ne--,se--,se<0||K[ne]!==he[se]){var Se=`
|
|
48
|
+
`+K[ne].replace(" at new "," at ");return m.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",m.displayName)),typeof m=="function"&&Ye.set(m,Se),Se}while(ne>=1&&se>=0);break}}}finally{Ie=!1,ye.current=X,ut(),Error.prepareStackTrace=Q}var jt=m?m.displayName||m.name:"",vt=jt?Ee(jt):"";return typeof m=="function"&&Ye.set(m,vt),vt}function Kn(m,B,M){return Ur(m,!1)}function Hn(m){var B=m.prototype;return!!(B&&B.isReactComponent)}function Ot(m,B,M){if(m==null)return"";if(typeof m=="function")return Ur(m,Hn(m));if(typeof m=="string")return Ee(m);switch(m){case a:return Ee("Suspense");case c:return Ee("SuspenseList")}if(typeof m=="object")switch(m.$$typeof){case l:return Kn(m.render);case f:return Ot(m.type,B,M);case d:{var z=m,Q=z._payload,X=z._init;try{return Ot(X(Q),B,M)}catch{}}}return""}var xt=Object.prototype.hasOwnProperty,Wr={},Vr=D.ReactDebugCurrentFrame;function Rt(m){if(m){var B=m._owner,M=Ot(m.type,m._source,B?B.type:null);Vr.setExtraStackFrame(M)}else Vr.setExtraStackFrame(null)}function Gn(m,B,M,z,Q){{var X=Function.call.bind(xt);for(var H in m)if(X(m,H)){var K=void 0;try{if(typeof m[H]!="function"){var he=Error((z||"React class")+": "+M+" type `"+H+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof m[H]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw he.name="Invariant Violation",he}K=m[H](B,H,z,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ne){K=ne}K&&!(K instanceof Error)&&(Rt(Q),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",z||"React class",M,H,typeof K),Rt(null)),K instanceof Error&&!(K.message in Wr)&&(Wr[K.message]=!0,Rt(Q),y("Failed %s type: %s",M,K.message),Rt(null))}}}var Jn=Array.isArray;function j(m){return Jn(m)}function U(m){{var B=typeof Symbol=="function"&&Symbol.toStringTag,M=B&&m[Symbol.toStringTag]||m.constructor.name||"Object";return M}}function De(m){try{return ke(m),!1}catch{return!0}}function ke(m){return""+m}function Xe(m){if(De(m))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",U(m)),ke(m)}var $e=D.ReactCurrentOwner,Qn={key:!0,ref:!0,__self:!0,__source:!0},tr,Kr;function yl(m){if(xt.call(m,"ref")){var B=Object.getOwnPropertyDescriptor(m,"ref").get;if(B&&B.isReactWarning)return!1}return m.ref!==void 0}function _l(m){if(xt.call(m,"key")){var B=Object.getOwnPropertyDescriptor(m,"key").get;if(B&&B.isReactWarning)return!1}return m.key!==void 0}function xl(m,B){typeof m.ref=="string"&&$e.current}function vl(m,B){{var M=function(){tr||(tr=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",B))};M.isReactWarning=!0,Object.defineProperty(m,"key",{get:M,configurable:!0})}}function bl(m,B){{var M=function(){Kr||(Kr=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",B))};M.isReactWarning=!0,Object.defineProperty(m,"ref",{get:M,configurable:!0})}}var Dl=function(m,B,M,z,Q,X,H){var K={$$typeof:e,type:m,key:B,ref:M,props:H,_owner:X};return K._store={},Object.defineProperty(K._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(K,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(K,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Q}),Object.freeze&&(Object.freeze(K.props),Object.freeze(K)),K};function Cl(m,B,M,z,Q){{var X,H={},K=null,he=null;M!==void 0&&(Xe(M),K=""+M),_l(B)&&(Xe(B.key),K=""+B.key),yl(B)&&(he=B.ref,xl(B,Q));for(X in B)xt.call(B,X)&&!Qn.hasOwnProperty(X)&&(H[X]=B[X]);if(m&&m.defaultProps){var ne=m.defaultProps;for(X in ne)H[X]===void 0&&(H[X]=ne[X])}if(K||he){var se=typeof m=="function"?m.displayName||m.name||"Unknown":m;K&&vl(H,se),he&&bl(H,se)}return Dl(m,K,he,Q,z,$e.current,H)}}var Yn=D.ReactCurrentOwner,yi=D.ReactDebugCurrentFrame;function Mt(m){if(m){var B=m._owner,M=Ot(m.type,m._source,B?B.type:null);yi.setExtraStackFrame(M)}else yi.setExtraStackFrame(null)}var Xn;Xn=!1;function Zn(m){return typeof m=="object"&&m!==null&&m.$$typeof===e}function _i(){{if(Yn.current){var m=q(Yn.current.type);if(m)return`
|
|
49
49
|
|
|
50
|
-
Check the render method of \``+
|
|
50
|
+
Check the render method of \``+m+"`."}return""}}function wl(m){return""}var xi={};function Al(m){{var B=_i();if(!B){var M=typeof m=="string"?m:m.displayName||m.name;M&&(B=`
|
|
51
51
|
|
|
52
|
-
Check the top-level render call using <`+
|
|
52
|
+
Check the top-level render call using <`+M+">.")}return B}}function vi(m,B){{if(!m._store||m._store.validated||m.key!=null)return;m._store.validated=!0;var M=Al(B);if(xi[M])return;xi[M]=!0;var z="";m&&m._owner&&m._owner!==Yn.current&&(z=" It was passed a child from "+q(m._owner.type)+"."),Mt(m),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',M,z),Mt(null)}}function bi(m,B){{if(typeof m!="object")return;if(j(m))for(var M=0;M<m.length;M++){var z=m[M];Zn(z)&&vi(z,B)}else if(Zn(m))m._store&&(m._store.validated=!0);else if(m){var Q=_(m);if(typeof Q=="function"&&Q!==m.entries)for(var X=Q.call(m),H;!(H=X.next()).done;)Zn(H.value)&&vi(H.value,B)}}}function El(m){{var B=m.type;if(B==null||typeof B=="string")return;var M;if(typeof B=="function")M=B.propTypes;else if(typeof B=="object"&&(B.$$typeof===l||B.$$typeof===f))M=B.propTypes;else return;if(M){var z=q(B);Gn(M,m.props,"prop",z,m)}else if(B.PropTypes!==void 0&&!Xn){Xn=!0;var Q=q(B);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Q||"Unknown")}typeof B.getDefaultProps=="function"&&!B.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function kl(m){{for(var B=Object.keys(m.props),M=0;M<B.length;M++){var z=B[M];if(z!=="children"&&z!=="key"){Mt(m),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),Mt(null);break}}m.ref!==null&&(Mt(m),y("Invalid attribute `ref` supplied to `React.Fragment`."),Mt(null))}}var Di={};function Ci(m,B,M,z,Q,X){{var H=O(m);if(!H){var K="";(m===void 0||typeof m=="object"&&m!==null&&Object.keys(m).length===0)&&(K+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var he=wl();he?K+=he:K+=_i();var ne;m===null?ne="null":j(m)?ne="array":m!==void 0&&m.$$typeof===e?(ne="<"+(q(m.type)||"Unknown")+" />",K=" Did you accidentally export a JSX literal instead of a component?"):ne=typeof m,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ne,K)}var se=Cl(m,B,M,Q,X);if(se==null)return se;if(H){var Se=B.children;if(Se!==void 0)if(z)if(j(Se)){for(var jt=0;jt<Se.length;jt++)bi(Se[jt],m);Object.freeze&&Object.freeze(Se)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else bi(Se,m)}if(xt.call(B,"key")){var vt=q(m),_e=Object.keys(B).filter(function(Ll){return Ll!=="key"}),es=_e.length>0?"{key: someKey, "+_e.join(": ..., ")+": ...}":"{key: someKey}";if(!Di[vt+es]){var Fl=_e.length>0?"{"+_e.join(": ..., ")+": ...}":"{}";y(`A props object containing a "key" prop is being spread into JSX:
|
|
53
53
|
let props = %s;
|
|
54
54
|
<%s {...props} />
|
|
55
55
|
React keys must be passed directly to JSX without using spread:
|
|
56
56
|
let props = %s;
|
|
57
|
-
<%s key={someKey} {...props} />`,
|
|
57
|
+
<%s key={someKey} {...props} />`,es,vt,Fl,vt),Di[vt+es]=!0}}return m===n?kl(se):El(se),se}}function Sl(m,B,M){return Ci(m,B,M,!0)}function Tl(m,B,M){return Ci(m,B,M,!1)}var Bl=Tl,Nl=Sl;sr.Fragment=n,sr.jsx=Bl,sr.jsxs=Nl}()),sr}process.env.NODE_ENV==="production"?_s.exports=ia():_s.exports=oa();var v=_s.exports;class nn{static filter(e,t){return e.filter(t)}static filterBy(e,t,n){return e.filter(s=>s[t]===n)}static filterByFields(e,t){return e.filter(n=>Object.entries(t).every(([s,o])=>n[s]===o))}static sort(e,t,n="asc"){return[...e].sort((s,o)=>{const i=s[t],u=o[t];if(i===u)return 0;let l=0;return i>u&&(l=1),i<u&&(l=-1),n==="asc"?l:-l})}static search(e,t,n){if(!t.trim())return e;const s=t.toLowerCase();return e.filter(o=>n.some(i=>{const u=o[i];return u==null?!1:String(u).toLowerCase().includes(s)}))}static paginate(e,t,n){const s=(t-1)*n,o=s+n;return{data:e.slice(s,o),total:e.length,page:t,totalPages:Math.ceil(e.length/n)}}static groupBy(e,t){return e.reduce((n,s)=>{const o=String(s[t]);return n[o]||(n[o]=[]),n[o].push(s),n},{})}static unique(e,t){const n=e.map(s=>s[t]);return[...new Set(n)]}static countBy(e,t){return e.reduce((n,s)=>{const o=String(s[t]);return n[o]=(n[o]||0)+1,n},{})}static pipe(e,t){return t.reduce((n,s)=>s(n),e)}}function ua({endpoint:r,params:e,layout:t="list",title:n,emptyMessage:s="No items found",renderItem:o,keyExtractor:i=(g,_)=>g.id||g._id||String(_),searchable:u=!1,searchFields:l=[],searchPlaceholder:a="Search...",filters:c=[],pageSize:f=20,onItemClick:d,onRefresh:h,theme:p={}}){const{data:g,loading:_,error:D,refetch:y}=Yo(r,e),[C,x]=T.useState(""),[w,b]=T.useState({}),[k,A]=T.useState(1),S=T.useMemo(()=>{if(!g)return{data:[],total:0,totalPages:0};let $=g;return u&&C&&l.length>0&&($=nn.search($,C,l)),Object.keys(w).length>0&&($=nn.filterByFields($,w)),nn.paginate($,k,f)},[g,C,w,k,f,u,l]);T.useEffect(()=>{A(1)},[C,w]);const O=()=>{x(""),b({}),A(1),y(),h==null||h()},L={background:p.background||"#ffffff",cardBackground:p.cardBackground||"#f9fafb",text:p.text||"#111827",textSecondary:p.textSecondary||"#6b7280",border:p.border||"#e5e7eb",primary:p.primary||"#3b82f6"},q=o||($=>v.jsxs("div",{style:{padding:"16px",cursor:d?"pointer":"default"},children:[v.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:L.text},children:$.title||$.name||$.label||"Untitled"}),$.description&&v.jsx("div",{style:{fontSize:"13px",color:L.textSecondary,marginTop:"4px"},children:$.description})]}));return _&&!g?v.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"48px",color:L.textSecondary},children:"Loading..."}):D?v.jsxs("div",{style:{padding:"24px",textAlign:"center",color:"#ef4444"},children:[v.jsx("div",{style:{fontWeight:500,marginBottom:"8px"},children:"Error"}),v.jsx("div",{style:{fontSize:"14px"},children:D.message}),v.jsx("button",{onClick:O,style:{marginTop:"16px",padding:"8px 16px",background:L.primary,color:"white",border:"none",borderRadius:"6px",cursor:"pointer"},children:"Retry"})]}):v.jsxs("div",{style:{background:L.background,borderRadius:"12px",overflow:"hidden"},children:[(n||u||c.length>0)&&v.jsxs("div",{style:{padding:"16px",borderBottom:`1px solid ${L.border}`},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:u||c.length>0?"12px":"0"},children:[n&&v.jsx("h2",{style:{margin:0,fontSize:"18px",fontWeight:600,color:L.text},children:n}),v.jsx("button",{onClick:O,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${L.border}`,borderRadius:"6px",color:L.textSecondary,cursor:"pointer",fontSize:"13px"},children:"Refresh"})]}),u&&v.jsx("input",{type:"text",placeholder:a,value:C,onChange:$=>x($.target.value),style:{width:"100%",padding:"8px 12px",border:`1px solid ${L.border}`,borderRadius:"8px",fontSize:"14px",outline:"none"}})]}),v.jsx("div",{style:{display:t==="grid"?"grid":"flex",flexDirection:t==="list"?"column":void 0,gridTemplateColumns:t==="grid"?"repeat(auto-fill, minmax(250px, 1fr))":void 0,gap:t==="list"?"0":"16px",padding:t==="list"?"0":"16px"},children:S.data.length===0?v.jsx("div",{style:{padding:"48px",textAlign:"center",color:L.textSecondary},children:s}):S.data.map(($,V)=>v.jsx("div",{onClick:()=>d==null?void 0:d($),style:{background:L.cardBackground,borderRadius:t==="list"?"0":"8px",borderBottom:t==="list"?`1px solid ${L.border}`:"none",transition:"all 0.15s ease"},onMouseEnter:re=>{d&&(re.currentTarget.style.background=L.border)},onMouseLeave:re=>{re.currentTarget.style.background=L.cardBackground},children:q($,V)},i($,V)))}),S.totalPages>1&&v.jsxs("div",{style:{padding:"16px",borderTop:`1px solid ${L.border}`,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[v.jsxs("div",{style:{fontSize:"13px",color:L.textSecondary},children:["Page ",k," of ",S.totalPages]}),v.jsxs("div",{style:{display:"flex",gap:"8px"},children:[v.jsx("button",{onClick:()=>A($=>Math.max(1,$-1)),disabled:k===1,style:{padding:"6px 12px",border:`1px solid ${L.border}`,borderRadius:"6px",background:"white",cursor:k===1?"not-allowed":"pointer",opacity:k===1?.5:1},children:"Previous"}),v.jsx("button",{onClick:()=>A($=>Math.min(S.totalPages,$+1)),disabled:k===S.totalPages,style:{padding:"6px 12px",border:`1px solid ${L.border}`,borderRadius:"6px",background:"white",cursor:k===S.totalPages?"not-allowed":"pointer",opacity:k===S.totalPages?.5:1},children:"Next"})]})]})]})}function la({item:r,onClick:e,title:t=i=>i.title||i.name||i.label||"Untitled",subtitle:n=i=>i.description||i.subtitle||"",image:s=i=>i.image||i.thumbnail||i.photo,badge:o=i=>i.badge||i.tag||i.type}){const i=t(r),u=n(r),l=s(r),a=o(r);return v.jsxs("div",{onClick:e,className:`
|
|
58
58
|
flex items-center gap-4 p-4 border-b border-gray-200
|
|
59
59
|
hover:bg-gray-50 transition-colors
|
|
60
60
|
${e?"cursor-pointer":""}
|
|
61
|
-
`,children:[l&&f.jsx("div",{className:"flex-shrink-0",children:f.jsx("img",{src:l,alt:t,className:"w-16 h-16 object-cover rounded-lg"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("h3",{className:"font-medium text-gray-900 truncate",children:t}),c&&f.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full",children:c})]}),i&&f.jsx("p",{className:"text-sm text-gray-600 truncate mt-0.5",children:i})]}),e&&f.jsx("div",{className:"flex-shrink-0 text-gray-400",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})}function mr({item:o,onClose:e,title:r=n=>n.title||n.name||n.label||"Detail",image:u=n=>n.image||n.thumbnail||n.photo,fields:s=[]}){if(!o)return null;const n=r(o),t=u(o);return f.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:f.jsxs("div",{className:"bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl",children:[f.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between",children:[f.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:n}),e&&f.jsx("button",{onClick:e,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("div",{className:"p-6",children:[t&&f.jsx("div",{className:"mb-6",children:f.jsx("img",{src:t,alt:n,className:"w-full h-64 object-cover rounded-lg"})}),s.length>0&&f.jsx("div",{className:"space-y-4",children:s.map((i,l)=>{const c=i.value(o);return c==null||c===""?null:f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-gray-500 mb-1",children:i.label}),f.jsx("div",{className:"text-base text-gray-900",children:typeof c=="object"?JSON.stringify(c,null,2):String(c)})]},l)})}),s.length===0&&f.jsx("pre",{className:"bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto",children:JSON.stringify(o,null,2)})]}),e&&f.jsx("div",{className:"sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4",children:f.jsx("button",{onClick:e,className:"w-full px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium",children:"Close"})})]})})}const Dr={small:"w-32 h-32",medium:"w-48 h-48",large:"w-64 h-64"};function Ar({nodes:o,cardCount:e=2,minInterval:r=1e3,maxInterval:u=3e3,onCardClick:s,cardSize:n="medium",className:t=""}){const i=Math.min(Math.max(e,1),5),[l,c]=x.useState([]),[d,p]=x.useState([]),[m,D]=x.useState(Array(i).fill(!1)),[w,k]=x.useState(Array(i).fill(!1)),M=x.useRef([]),O=x.useCallback(y=>{const N=o.filter(T=>!y.includes(T._id));if(N.length===0)return null;const P=Math.floor(Math.random()*N.length);return N[P]},[o]),B=x.useCallback(()=>Math.random()*(u-r)+r,[r,u]);x.useEffect(()=>{if(o.length===0){c([]),p([]);return}const y=[],N=[],P=[];for(let T=0;T<i&&T<o.length;T++){const R=O(P);R&&(y.push(R),P.push(R._id))}for(let T=0;T<y.length;T++){const R=[y[T]._id,...y.filter((H,z)=>z!==T).map(H=>H._id)],v=O(R);v?N.push(v):N.push(y[T])}c(y),p(N)},[o,i,O]);const U=x.useCallback(y=>{const N=B(),P=setTimeout(()=>{D(T=>{const R=[...T];return R[y]=!R[y],R}),setTimeout(()=>{k(T=>{const R=[...T];return R[y]=!R[y],R}),setTimeout(()=>{const T=!w[y];T&&c(R=>{const v=[...R];return v[y]=d[y],v}),p(R=>{const v=[...R],z=[(T?d[y]:l[y])._id,...l.filter((G,J)=>J!==y).map(G=>G._id),...R.filter((G,J)=>J!==y).map(G=>G._id)],j=O(z);return j&&(v[y]=j),v}),setTimeout(()=>{U(y)},150)},200)},150)},N);M.current[y]=P},[B,O,l,d,w]),g=x.useRef(!1);x.useEffect(()=>{if(!(l.length===0||o.length<=1)&&!g.current){g.current=!0;for(let y=0;y<l.length;y++)U(y);return()=>{M.current.forEach(y=>clearTimeout(y)),M.current=[],g.current=!1}}},[l.length,o.length]);const F=y=>{s&&s(y)};return o.length===0?f.jsx("div",{className:`flex items-center justify-center p-8 ${t}`,children:f.jsx("p",{className:"text-gray-500",children:"No nodes available"})}):l.length===0?f.jsx("div",{className:`flex items-center justify-center p-8 ${t}`,children:f.jsx("p",{className:"text-gray-500",children:"Loading..."})}):f.jsx("div",{className:`flex gap-4 justify-center items-center flex-wrap ${t}`,children:l.map((y,N)=>{const P=d[N],T=w[N];return f.jsx("div",{className:`relative ${Dr[n]}`,style:{perspective:"1000px"},onClick:()=>F(T?P:y),children:f.jsxs("div",{className:"w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",style:{transform:`rotateY(${m[N]?180:0}deg)`,transition:"transform 0.5s",transformStyle:"preserve-3d"},children:[f.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:T?0:1},children:f.jsxs("div",{style:{transform:m[N]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[f.jsx("img",{src:y.data.image,alt:y.title,className:"w-full h-full object-cover"}),f.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:f.jsx("p",{className:"text-white text-sm font-medium truncate",children:y.title})})]})}),P&&f.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:T?1:0},children:f.jsxs("div",{style:{transform:m[N]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[f.jsx("img",{src:P.data.image,alt:P.title,className:"w-full h-full object-cover"}),f.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:f.jsx("p",{className:"text-white text-sm font-medium truncate",children:P.title})})]})})]})},`slot-${N}`)})})}function Ne(o){if(!o)return"";const e=/=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;return o.replace(e,(r,u,s,n)=>{try{if(s.toUpperCase()==="B"){const t=atob(n);return decodeURIComponent(escape(t))}else if(s.toUpperCase()==="Q"){const t=n.replace(/_/g," ").replace(/=([0-9A-Fa-f]{2})/g,(i,l)=>String.fromCharCode(parseInt(l,16)));return decodeURIComponent(escape(t))}}catch(t){console.warn("MIME decode error:",t)}return r}).replace(/\s+/g," ").trim()}const br={background:"#ffffff",cardBackground:"#ffffff",selectedBackground:"#f5f5f5",unreadBackground:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",danger:"#ef4444"};function yr({baseUrl:o,systemId:e,accountId:r,limit:u=30,folder:s,selectable:n=!0,showDetail:t=!1,emptyMessage:i="No emails",autoLoad:l=!0,onSelect:c,onSelectionChange:d,onDelete:p,onError:m,onLoad:D,renderItem:w,renderDetail:k,renderActions:M,renderEmpty:O,renderLoading:B,theme:U={}}){const g={...br,...U},[F,y]=x.useState([]),[N,P]=x.useState(!1),[T,R]=x.useState(null),[v,H]=x.useState(new Set),[z,j]=x.useState(null),[G,J]=x.useState(null),[pe,he]=x.useState(null),[ke,ge]=x.useState(!1),V=x.useMemo(()=>e?new xt({baseUrl:o,system_id:e}):null,[o,e]),te=x.useCallback(async()=>{if(V){P(!0),R(null);try{const b=await V.listEmails(r,u,s);b!=null&&b.messages&&(y(b.messages),D==null||D(b.messages))}catch(b){const C=b instanceof Error?b:new Error("Failed to fetch emails");R(C.message),m==null||m(C)}P(!1)}},[V,r,u,s,m,D]);x.useEffect(()=>{l&&te()},[l,te]),x.useEffect(()=>{te()},[s]);const ae=x.useCallback(async b=>{if(V){J(b),he(null),ge(!0);try{const C=await V.getEmailParsed(r,b.uid,s||"INBOX");C!=null&&C.body&&he(C.body)}catch(C){console.error("Failed to fetch email body:",C)}ge(!1)}},[V,r,s]),Pe=x.useCallback(b=>{c==null||c(b),t&&ae(b)},[c,t,ae]),Ue=x.useCallback((b,C,Y)=>{if(!n){c==null||c(b),t&&ae(b);return}const K=b.uid;if(Y.shiftKey&&z!==null){const ee=Math.min(z,C),Z=Math.max(z,C),He=F.slice(ee,Z+1).map(je=>je.uid),be=new Set(He);H(be),d==null||d(Array.from(be))}else if(Y.ctrlKey||Y.metaKey)H(ee=>{const Z=new Set(ee);return Z.has(K)?Z.delete(K):Z.add(K),d==null||d(Array.from(Z)),Z}),j(C);else{const ee=new Set([K]);H(ee),j(C),d==null||d(Array.from(ee))}},[n,z,F,v,c,d,t]),me=x.useCallback(async()=>{if(!(!V||v.size===0))try{const b=await V.trashEmails(r,Array.from(v));if(console.log("Trash result:",b),b.success&&b.moved>0){y(Y=>Y.filter(K=>!v.has(K.uid)));const C=Array.from(v);H(new Set),p==null||p(C)}else R("Failed to move emails to trash")}catch(b){const C=b instanceof Error?b:new Error("Trash failed");console.error("Trash error:",C),R(C.message),m==null||m(C)}},[V,r,v,p,m]),De=x.useCallback(async()=>{if(!(!V||v.size===0))try{const b=await V.archiveEmails(r,Array.from(v));if(console.log("Archive result:",b),b.success&&b.archived>0){y(Y=>Y.filter(K=>!v.has(K.uid)));const C=Array.from(v);H(new Set),p==null||p(C)}else R("Failed to archive emails")}catch(b){const C=b instanceof Error?b:new Error("Archive failed");console.error("Archive error:",C),R(C.message),m==null||m(C)}},[V,r,v,p,m]),ne=x.useCallback(()=>{if(v.size===F.length)H(new Set),d==null||d([]);else{const b=new Set(F.map(C=>C.uid));H(b),d==null||d(Array.from(b))}},[F,v.size,d]),Ae=x.useCallback(()=>{H(new Set),d==null||d([])},[d]),ie={delete:me,archive:De,refresh:te,selectAll:ne,clearSelection:Ae},Ie=b=>{if(!b)return"";const C=new Date(b),Y=new Date;return C.toDateString()===Y.toDateString()?C.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):C.toLocaleDateString([],{month:"short",day:"numeric"})},Fe=(b,C)=>f.jsx("div",{style:{padding:"12px 16px",background:C?g.selectedBackground:b.seen?g.cardBackground:g.unreadBackground,borderBottom:`1px solid ${g.border}`,cursor:"pointer",transition:"background 0.15s ease"},children:f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[f.jsxs("div",{style:{flex:1,minWidth:0},children:[f.jsx("div",{style:{fontSize:"14px",fontWeight:b.seen?400:600,color:g.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Ne(b.from).split("@")[0]}),f.jsx("div",{style:{fontSize:"14px",fontWeight:b.seen?400:500,color:b.seen?g.textSecondary:g.text,marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Ne(b.subject)||"(No subject)"})]}),f.jsx("div",{style:{fontSize:"12px",color:g.textSecondary,flexShrink:0},children:Ie(b.date)})]})}),$e=b=>f.jsxs("div",{style:{padding:"24px"},children:[f.jsx("h2",{style:{margin:"0 0 8px",fontSize:"20px",color:g.text},children:Ne(b.subject)||"(No subject)"}),f.jsxs("div",{style:{fontSize:"14px",color:g.textSecondary,marginBottom:"16px"},children:["From: ",Ne(b.from)," • ",new Date(b.date).toLocaleString()]}),ke?f.jsx("div",{style:{fontSize:"14px",color:g.textSecondary},children:"Loading..."}):pe?f.jsx("div",{style:{fontSize:"14px",color:g.text},dangerouslySetInnerHTML:{__html:pe}}):f.jsx("div",{style:{fontSize:"14px",color:g.textSecondary},children:"No content available"})]}),Me=(b,C)=>f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",background:g.cardBackground,borderBottom:`1px solid ${g.border}`},children:[f.jsx("button",{onClick:C.selectAll,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${g.border}`,borderRadius:"6px",fontSize:"13px",cursor:"pointer",color:g.text},children:b.length===F.length?"Deselect All":"Select All"}),b.length>0&&f.jsxs(f.Fragment,{children:[f.jsxs("span",{style:{fontSize:"13px",color:g.textSecondary},children:[b.length," selected"]}),f.jsx("button",{onClick:C.archive,title:"Archive",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${g.border}`,borderRadius:"6px",cursor:"pointer",color:g.textSecondary},children:f.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"archive"})}),f.jsx("button",{onClick:C.delete,title:"Delete",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${g.border}`,borderRadius:"6px",cursor:"pointer",color:g.textSecondary},children:f.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"delete"})})]}),f.jsx("div",{style:{flex:1}}),f.jsx("button",{onClick:C.refresh,title:"Refresh",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${g.border}`,borderRadius:"6px",cursor:"pointer",color:g.textSecondary},children:f.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"refresh"})})]}),oe=()=>f.jsx("div",{style:{padding:"48px",textAlign:"center",color:g.textSecondary},children:i}),re=()=>f.jsx("div",{style:{padding:"48px",textAlign:"center",color:g.textSecondary},children:"Loading..."}),Te=w||Fe,Se=k||$e,le=M||Me,ze=O||oe,Ge=B||re;return N&&F.length===0?f.jsx("div",{style:{background:g.background,width:"100%",height:"100%"},children:Ge()}):f.jsxs("div",{style:{display:"flex",background:g.background,width:"100%",height:"100%"},children:[f.jsxs("div",{style:{flex:t&&G?"0 0 50%":"1",display:"flex",flexDirection:"column",borderRight:t&&G?`1px solid ${g.border}`:"none",overflow:"hidden"},children:[n&&le(Array.from(v),ie),T&&f.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",color:g.danger,fontSize:"14px",borderBottom:`1px solid ${g.border}`},children:T}),f.jsx("div",{style:{flex:1,overflowY:"auto"},children:F.length===0?ze():F.map((b,C)=>f.jsx("div",{onClick:Y=>Ue(b,C,Y),onDoubleClick:()=>Pe(b),children:Te(b,v.has(b.uid))},b.uid))})]}),t&&G&&f.jsx("div",{style:{flex:1,overflowY:"auto"},children:Se(G)})]})}function xr({items:o,renderItem:e,onSelectionChange:r,onCurrentChange:u,onAction:s,actions:n=[],emptyMessage:t="No items",showSelectAll:i=!0,className:l=""}){const[c,d]=x.useState(new Set),[p,m]=x.useState(-1),D=o.filter(g=>c.has(g.id)),w=p>=0&&p<D.length?D[p]:null,k=x.useCallback(g=>{d(F=>{const y=new Set(F);return y.has(g)?y.delete(g):y.add(g),r==null||r(Array.from(y)),y})},[r]),M=x.useCallback(()=>{if(c.size===o.length)d(new Set),m(-1),r==null||r([]);else{const g=new Set(o.map(F=>F.id));d(g),o.length>0&&(m(0),u==null||u(o[0],0)),r==null||r(o.map(F=>F.id))}},[o,c.size,r,u]),O=x.useCallback(()=>{if(D.length===0)return;const g=p<=0?D.length-1:p-1;m(g),u==null||u(D[g],g)},[D,p,u]),B=x.useCallback(()=>{if(D.length===0)return;const g=p>=D.length-1?0:p+1;m(g),u==null||u(D[g],g)},[D,p,u]),U=x.useCallback(g=>{s==null||s(g,D,w)},[s,D,w]);return x.useEffect(()=>{D.length===0?m(-1):p>=D.length?m(D.length-1):p<0&&D.length>0&&(m(0),u==null||u(D[0],0))},[D.length,p,u]),o.length===0?f.jsx("div",{className:`text-sm text-neutral-400 text-center py-4 ${l}`,children:t}):f.jsxs("div",{className:`space-y-2 ${l}`,children:[f.jsxs("div",{className:"flex items-center justify-between text-xs text-neutral-500",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[i&&f.jsxs("button",{onClick:M,className:"flex items-center gap-1 hover:text-neutral-700 transition-colors",children:[f.jsx("span",{className:"material-icons text-sm",children:c.size===o.length?"check_box":c.size>0?"indeterminate_check_box":"check_box_outline_blank"}),f.jsx("span",{children:c.size===o.length?"Deselect all":"Select all"})]}),c.size>0&&f.jsxs("span",{className:"text-neutral-400",children:["(",c.size," selected)"]})]}),D.length>1&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{onClick:O,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Previous",children:f.jsx("span",{className:"material-icons text-sm",children:"chevron_left"})}),f.jsxs("span",{className:"text-xs min-w-[3rem] text-center",children:[p+1," / ",D.length]}),f.jsx("button",{onClick:B,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Next",children:f.jsx("span",{className:"material-icons text-sm",children:"chevron_right"})})]})]}),f.jsx("div",{className:"space-y-1",children:o.map(g=>{const F=c.has(g.id),y=(w==null?void 0:w.id)===g.id;return f.jsxs("div",{className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${y?"bg-blue-50 ring-1 ring-blue-200":F?"bg-neutral-100":"hover:bg-neutral-50"}`,onClick:()=>k(g.id),children:[f.jsx("span",{className:`material-icons text-lg ${F?"text-blue-500":"text-neutral-300"}`,children:F?"check_box":"check_box_outline_blank"}),f.jsx("div",{className:"flex-1 min-w-0",children:e(g,F,y)})]},g.id)})}),n.length>0&&c.size>0&&f.jsx("div",{className:"flex items-center gap-2 pt-2 border-t border-neutral-100",children:n.map(g=>{var y;const F=((y=g.disabled)==null?void 0:y.call(g,D))??!1;return f.jsxs("button",{onClick:()=>U(g.id),disabled:F,className:`flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${F?"bg-neutral-100 text-neutral-400 cursor-not-allowed":"bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,children:[g.icon&&f.jsx("span",{className:"material-icons text-sm",children:g.icon}),g.label]},g.id)})})]})}exports.AnimatedCardFlip=Ar;exports.ApiClient=Et;exports.AuthManager=vt;exports.Card=gr;exports.DataOperations=Re;exports.Detail=mr;exports.GraphClient=Gt;exports.Mail=yr;exports.MailClient=xt;exports.SelectableList=xr;exports.Stack=hr;exports.getApiClient=rt;exports.initializeApiClient=cr;exports.useMutation=dr;exports.useQuery=wt;
|
|
61
|
+
`,children:[l&&v.jsx("div",{className:"flex-shrink-0",children:v.jsx("img",{src:l,alt:i,className:"w-16 h-16 object-cover rounded-lg"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h3",{className:"font-medium text-gray-900 truncate",children:i}),a&&v.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full",children:a})]}),u&&v.jsx("p",{className:"text-sm text-gray-600 truncate mt-0.5",children:u})]}),e&&v.jsx("div",{className:"flex-shrink-0 text-gray-400",children:v.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})}function aa({item:r,onClose:e,title:t=o=>o.title||o.name||o.label||"Detail",image:n=o=>o.image||o.thumbnail||o.photo,fields:s=[]}){if(!r)return null;const o=t(r),i=n(r);return v.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:v.jsxs("div",{className:"bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl",children:[v.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between",children:[v.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o}),e&&v.jsx("button",{onClick:e,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:v.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),v.jsxs("div",{className:"p-6",children:[i&&v.jsx("div",{className:"mb-6",children:v.jsx("img",{src:i,alt:o,className:"w-full h-64 object-cover rounded-lg"})}),s.length>0&&v.jsx("div",{className:"space-y-4",children:s.map((u,l)=>{const a=u.value(r);return a==null||a===""?null:v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium text-gray-500 mb-1",children:u.label}),v.jsx("div",{className:"text-base text-gray-900",children:typeof a=="object"?JSON.stringify(a,null,2):String(a)})]},l)})}),s.length===0&&v.jsx("pre",{className:"bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto",children:JSON.stringify(r,null,2)})]}),e&&v.jsx("div",{className:"sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4",children:v.jsx("button",{onClick:e,className:"w-full px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium",children:"Close"})})]})})}const ca={small:"w-32 h-32",medium:"w-48 h-48",large:"w-64 h-64"};function da({nodes:r,cardCount:e=2,minInterval:t=1e3,maxInterval:n=3e3,onCardClick:s,cardSize:o="medium",className:i=""}){const u=Math.min(Math.max(e,1),5),[l,a]=T.useState([]),[c,f]=T.useState([]),[d,h]=T.useState(Array(u).fill(!1)),[p,g]=T.useState(Array(u).fill(!1)),_=T.useRef([]),D=T.useCallback(b=>{const k=r.filter(S=>!b.includes(S._id));if(k.length===0)return null;const A=Math.floor(Math.random()*k.length);return k[A]},[r]),y=T.useCallback(()=>Math.random()*(n-t)+t,[t,n]);T.useEffect(()=>{if(r.length===0){a([]),f([]);return}const b=[],k=[],A=[];for(let S=0;S<u&&S<r.length;S++){const O=D(A);O&&(b.push(O),A.push(O._id))}for(let S=0;S<b.length;S++){const O=[b[S]._id,...b.filter((W,q)=>q!==S).map(W=>W._id)],L=D(O);L?k.push(L):k.push(b[S])}a(b),f(k)},[r,u,D]);const C=T.useCallback(b=>{const k=y(),A=setTimeout(()=>{h(S=>{const O=[...S];return O[b]=!O[b],O}),setTimeout(()=>{g(S=>{const O=[...S];return O[b]=!O[b],O}),setTimeout(()=>{const S=!p[b];S&&a(O=>{const L=[...O];return L[b]=c[b],L}),f(O=>{const L=[...O],q=[(S?c[b]:l[b])._id,...l.filter((V,re)=>re!==b).map(V=>V._id),...O.filter((V,re)=>re!==b).map(V=>V._id)],$=D(q);return $&&(L[b]=$),L}),setTimeout(()=>{C(b)},150)},200)},150)},k);_.current[b]=A},[y,D,l,c,p]),x=T.useRef(!1);T.useEffect(()=>{if(!(l.length===0||r.length<=1)&&!x.current){x.current=!0;for(let b=0;b<l.length;b++)C(b);return()=>{_.current.forEach(b=>clearTimeout(b)),_.current=[],x.current=!1}}},[l.length,r.length]);const w=b=>{s&&s(b)};return r.length===0?v.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:v.jsx("p",{className:"text-gray-500",children:"No nodes available"})}):l.length===0?v.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:v.jsx("p",{className:"text-gray-500",children:"Loading..."})}):v.jsx("div",{className:`flex gap-4 justify-center items-center flex-wrap ${i}`,children:l.map((b,k)=>{const A=c[k],S=p[k];return v.jsx("div",{className:`relative ${ca[o]}`,style:{perspective:"1000px"},onClick:()=>w(S?A:b),children:v.jsxs("div",{className:"w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",style:{transform:`rotateY(${d[k]?180:0}deg)`,transition:"transform 0.5s",transformStyle:"preserve-3d"},children:[v.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:S?0:1},children:v.jsxs("div",{style:{transform:d[k]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[v.jsx("img",{src:b.data.image,alt:b.title,className:"w-full h-full object-cover"}),v.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:v.jsx("p",{className:"text-white text-sm font-medium truncate",children:b.title})})]})}),A&&v.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:S?1:0},children:v.jsxs("div",{style:{transform:d[k]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[v.jsx("img",{src:A.data.image,alt:A.title,className:"w-full h-full object-cover"}),v.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:v.jsx("p",{className:"text-white text-sm font-medium truncate",children:A.title})})]})})]})},`slot-${k}`)})})}function Gr(r){if(!r)return"";const e=/=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;return r.replace(e,(t,n,s,o)=>{try{if(s.toUpperCase()==="B"){const i=atob(o);return decodeURIComponent(escape(i))}else if(s.toUpperCase()==="Q"){const i=o.replace(/_/g," ").replace(/=([0-9A-Fa-f]{2})/g,(u,l)=>String.fromCharCode(parseInt(l,16)));return decodeURIComponent(escape(i))}}catch(i){console.warn("MIME decode error:",i)}return t}).replace(/\s+/g," ").trim()}const fa={background:"#ffffff",cardBackground:"#ffffff",selectedBackground:"#f5f5f5",unreadBackground:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",danger:"#ef4444"};function ha({baseUrl:r,systemId:e,accountId:t,limit:n=30,folder:s,selectable:o=!0,showDetail:i=!1,emptyMessage:u="No emails",autoLoad:l=!0,onSelect:a,onSelectionChange:c,onDelete:f,onError:d,onLoad:h,renderItem:p,renderDetail:g,renderActions:_,renderEmpty:D,renderLoading:y,theme:C={}}){const x={...fa,...C},[w,b]=T.useState([]),[k,A]=T.useState(!1),[S,O]=T.useState(null),[L,W]=T.useState(new Set),[q,$]=T.useState(null),[V,re]=T.useState(null),[Ae,Me]=T.useState(null),[_t,it]=T.useState(!1),ue=T.useMemo(()=>e?new Go({baseUrl:r,system_id:e}):null,[r,e]),Be=T.useCallback(async()=>{if(ue){A(!0),O(null);try{const j=await ue.listEmails(t,n,s);j!=null&&j.messages&&(b(j.messages),h==null||h(j.messages))}catch(j){const U=j instanceof Error?j:new Error("Failed to fetch emails");O(U.message),d==null||d(U)}A(!1)}},[ue,t,n,s,d,h]);T.useEffect(()=>{l&&Be()},[l,Be]),T.useEffect(()=>{Be()},[s]);const je=T.useCallback(async j=>{if(ue){re(j),Me(null),it(!0);try{const U=await ue.getEmailParsed(t,j.uid,s||"INBOX");U!=null&&U.body&&Me(U.body)}catch(U){console.error("Failed to fetch email body:",U)}it(!1)}},[ue,t,s]),ot=T.useCallback(j=>{a==null||a(j),i&&je(j)},[a,i,je]),ut=T.useCallback((j,U,De)=>{if(!o){a==null||a(j),i&&je(j);return}const ke=j.uid;if(De.shiftKey&&q!==null){const Xe=Math.min(q,U),$e=Math.max(q,U),Qn=w.slice(Xe,$e+1).map(Kr=>Kr.uid),tr=new Set(Qn);W(tr),c==null||c(Array.from(tr))}else if(De.ctrlKey||De.metaKey)W(Xe=>{const $e=new Set(Xe);return $e.has(ke)?$e.delete(ke):$e.add(ke),c==null||c(Array.from($e)),$e}),$(U);else{const Xe=new Set([ke]);W(Xe),$(U),c==null||c(Array.from(Xe))}},[o,q,w,L,a,c,i]),ye=T.useCallback(async()=>{if(!(!ue||L.size===0))try{const j=await ue.trashEmails(t,Array.from(L));if(console.log("Trash result:",j),j.success&&j.moved>0){b(De=>De.filter(ke=>!L.has(ke.uid)));const U=Array.from(L);W(new Set),f==null||f(U)}else O("Failed to move emails to trash")}catch(j){const U=j instanceof Error?j:new Error("Trash failed");console.error("Trash error:",U),O(U.message),d==null||d(U)}},[ue,t,L,f,d]),Qe=T.useCallback(async()=>{if(!(!ue||L.size===0))try{const j=await ue.archiveEmails(t,Array.from(L));if(console.log("Archive result:",j),j.success&&j.archived>0){b(De=>De.filter(ke=>!L.has(ke.uid)));const U=Array.from(L);W(new Set),f==null||f(U)}else O("Failed to archive emails")}catch(j){const U=j instanceof Error?j:new Error("Archive failed");console.error("Archive error:",U),O(U.message),d==null||d(U)}},[ue,t,L,f,d]),Ee=T.useCallback(()=>{if(L.size===w.length)W(new Set),c==null||c([]);else{const j=new Set(w.map(U=>U.uid));W(j),c==null||c(Array.from(j))}},[w,L.size,c]),Ie=T.useCallback(()=>{W(new Set),c==null||c([])},[c]),Ye={delete:ye,archive:Qe,refresh:Be,selectAll:Ee,clearSelection:Ie},Vn=j=>{if(!j)return"";const U=new Date(j),De=new Date;return U.toDateString()===De.toDateString()?U.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):U.toLocaleDateString([],{month:"short",day:"numeric"})},Ur=(j,U)=>v.jsx("div",{style:{padding:"12px 16px",background:U?x.selectedBackground:j.seen?x.cardBackground:x.unreadBackground,borderBottom:`1px solid ${x.border}`,cursor:"pointer",transition:"background 0.15s ease"},children:v.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[v.jsxs("div",{style:{flex:1,minWidth:0},children:[v.jsx("div",{style:{fontSize:"14px",fontWeight:j.seen?400:600,color:x.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Gr(j.from).split("@")[0]}),v.jsx("div",{style:{fontSize:"14px",fontWeight:j.seen?400:500,color:j.seen?x.textSecondary:x.text,marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Gr(j.subject)||"(No subject)"})]}),v.jsx("div",{style:{fontSize:"12px",color:x.textSecondary,flexShrink:0},children:Vn(j.date)})]})}),Kn=j=>v.jsxs("div",{style:{padding:"24px"},children:[v.jsx("h2",{style:{margin:"0 0 8px",fontSize:"20px",color:x.text},children:Gr(j.subject)||"(No subject)"}),v.jsxs("div",{style:{fontSize:"14px",color:x.textSecondary,marginBottom:"16px"},children:["From: ",Gr(j.from)," • ",new Date(j.date).toLocaleString()]}),_t?v.jsx("div",{style:{fontSize:"14px",color:x.textSecondary},children:"Loading..."}):Ae?v.jsx("div",{style:{fontSize:"14px",color:x.text},dangerouslySetInnerHTML:{__html:Ae}}):v.jsx("div",{style:{fontSize:"14px",color:x.textSecondary},children:"No content available"})]}),Hn=(j,U)=>v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",background:x.cardBackground,borderBottom:`1px solid ${x.border}`},children:[v.jsx("button",{onClick:U.selectAll,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${x.border}`,borderRadius:"6px",fontSize:"13px",cursor:"pointer",color:x.text},children:j.length===w.length?"Deselect All":"Select All"}),j.length>0&&v.jsxs(v.Fragment,{children:[v.jsxs("span",{style:{fontSize:"13px",color:x.textSecondary},children:[j.length," selected"]}),v.jsx("button",{onClick:U.archive,title:"Archive",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${x.border}`,borderRadius:"6px",cursor:"pointer",color:x.textSecondary},children:v.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"archive"})}),v.jsx("button",{onClick:U.delete,title:"Delete",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${x.border}`,borderRadius:"6px",cursor:"pointer",color:x.textSecondary},children:v.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"delete"})})]}),v.jsx("div",{style:{flex:1}}),v.jsx("button",{onClick:U.refresh,title:"Refresh",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${x.border}`,borderRadius:"6px",cursor:"pointer",color:x.textSecondary},children:v.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"refresh"})})]}),Ot=()=>v.jsx("div",{style:{padding:"48px",textAlign:"center",color:x.textSecondary},children:u}),xt=()=>v.jsx("div",{style:{padding:"48px",textAlign:"center",color:x.textSecondary},children:"Loading..."}),Wr=p||Ur,Vr=g||Kn,Rt=_||Hn,Gn=D||Ot,Jn=y||xt;return k&&w.length===0?v.jsx("div",{style:{background:x.background,width:"100%",height:"100%"},children:Jn()}):v.jsxs("div",{style:{display:"flex",background:x.background,width:"100%",height:"100%"},children:[v.jsxs("div",{style:{flex:i&&V?"0 0 50%":"1",display:"flex",flexDirection:"column",borderRight:i&&V?`1px solid ${x.border}`:"none",overflow:"hidden"},children:[o&&Rt(Array.from(L),Ye),S&&v.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",color:x.danger,fontSize:"14px",borderBottom:`1px solid ${x.border}`},children:S}),v.jsx("div",{style:{flex:1,overflowY:"auto"},children:w.length===0?Gn():w.map((j,U)=>v.jsx("div",{onClick:De=>ut(j,U,De),onDoubleClick:()=>ot(j),children:Wr(j,L.has(j.uid))},j.uid))})]}),i&&V&&v.jsx("div",{style:{flex:1,overflowY:"auto"},children:Vr(V)})]})}function pa({items:r,renderItem:e,onSelectionChange:t,onCurrentChange:n,onAction:s,actions:o=[],emptyMessage:i="No items",showSelectAll:u=!0,className:l=""}){const[a,c]=T.useState(new Set),[f,d]=T.useState(-1),h=r.filter(x=>a.has(x.id)),p=f>=0&&f<h.length?h[f]:null,g=T.useCallback(x=>{c(w=>{const b=new Set(w);return b.has(x)?b.delete(x):b.add(x),t==null||t(Array.from(b)),b})},[t]),_=T.useCallback(()=>{if(a.size===r.length)c(new Set),d(-1),t==null||t([]);else{const x=new Set(r.map(w=>w.id));c(x),r.length>0&&(d(0),n==null||n(r[0],0)),t==null||t(r.map(w=>w.id))}},[r,a.size,t,n]),D=T.useCallback(()=>{if(h.length===0)return;const x=f<=0?h.length-1:f-1;d(x),n==null||n(h[x],x)},[h,f,n]),y=T.useCallback(()=>{if(h.length===0)return;const x=f>=h.length-1?0:f+1;d(x),n==null||n(h[x],x)},[h,f,n]),C=T.useCallback(x=>{s==null||s(x,h,p)},[s,h,p]);return T.useEffect(()=>{h.length===0?d(-1):f>=h.length?d(h.length-1):f<0&&h.length>0&&(d(0),n==null||n(h[0],0))},[h.length,f,n]),r.length===0?v.jsx("div",{className:`text-sm text-neutral-400 text-center py-4 ${l}`,children:i}):v.jsxs("div",{className:`space-y-2 ${l}`,children:[v.jsxs("div",{className:"flex items-center justify-between text-xs text-neutral-500",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[u&&v.jsxs("button",{onClick:_,className:"flex items-center gap-1 hover:text-neutral-700 transition-colors",children:[v.jsx("span",{className:"material-icons text-sm",children:a.size===r.length?"check_box":a.size>0?"indeterminate_check_box":"check_box_outline_blank"}),v.jsx("span",{children:a.size===r.length?"Deselect all":"Select all"})]}),a.size>0&&v.jsxs("span",{className:"text-neutral-400",children:["(",a.size," selected)"]})]}),h.length>1&&v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("button",{onClick:D,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Previous",children:v.jsx("span",{className:"material-icons text-sm",children:"chevron_left"})}),v.jsxs("span",{className:"text-xs min-w-[3rem] text-center",children:[f+1," / ",h.length]}),v.jsx("button",{onClick:y,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Next",children:v.jsx("span",{className:"material-icons text-sm",children:"chevron_right"})})]})]}),v.jsx("div",{className:"space-y-1",children:r.map(x=>{const w=a.has(x.id),b=(p==null?void 0:p.id)===x.id;return v.jsxs("div",{className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${b?"bg-blue-50 ring-1 ring-blue-200":w?"bg-neutral-100":"hover:bg-neutral-50"}`,onClick:()=>g(x.id),children:[v.jsx("span",{className:`material-icons text-lg ${w?"text-blue-500":"text-neutral-300"}`,children:w?"check_box":"check_box_outline_blank"}),v.jsx("div",{className:"flex-1 min-w-0",children:e(x,w,b)})]},x.id)})}),o.length>0&&a.size>0&&v.jsx("div",{className:"flex items-center gap-2 pt-2 border-t border-neutral-100",children:o.map(x=>{var b;const w=((b=x.disabled)==null?void 0:b.call(x,h))??!1;return v.jsxs("button",{onClick:()=>C(x.id),disabled:w,className:`flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${w?"bg-neutral-100 text-neutral-400 cursor-not-allowed":"bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,children:[x.icon&&v.jsx("span",{className:"material-icons text-sm",children:x.icon}),x.label]},x.id)})})]})}function ga(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ma=ga(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Xo=T.createContext(null);function ya(r,e){return{getTheme:function(){return e??null}}}function Ge(){const r=T.useContext(Xo);return r==null&&ma(8),r}function Br(r){return{}}const zs={},_a={},Zo={},wt={},Wt={},Cr={},Vt={},Tn={},xs={},wr={},Ar={},Pe={},Us={},Ws={},xa={},eu={},va={},tu={},ba={},ru={},nu={},an={},Da={},su={},iu={},ou={},Ca={},wa={},Aa={},Pi={},uu={},Ea={},lu={},au={},ka={},Bn={},Vs={},vs={},Sa={},Ta={},Jr={},Qr={},Ba={},Na={},Fa={},Re=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,La=Re&&"documentMode"in document?document.documentMode:null,Ne=Re&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),pt=Re&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),cn=!(!Re||!("InputEvent"in window)||La)&&"getTargetRanges"in new window.InputEvent("input"),Nn=Re&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Nr=Re&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pa=Re&&/Android/.test(navigator.userAgent),cu=Re&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Oa=Re&&Pa&&cu,Ks=Re&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!cu,Fr=1,mt=3,kt=0,du=1,Gt=2,Ra=0,Ma=1,ja=2,dn=4,fn=8,Hs=128,Ia=112|(3|dn|fn)|Hs,Gs=1,Js=2,Qs=3,Ys=4,Xs=5,Zs=6,Fn=Nn||Nr||Ks?" ":"",tt=`
|
|
62
|
+
|
|
63
|
+
`,$a=pt?" ":Fn,fu="֑-߿יִ-﷽ﹰ-ﻼ",hu="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",qa=new RegExp("^[^"+hu+"]*["+fu+"]"),za=new RegExp("^[^"+fu+"]*["+hu+"]"),St={bold:1,code:16,highlight:Hs,italic:2,strikethrough:dn,subscript:32,superscript:64,underline:fn},Ua={directionless:1,unmergeable:2},Oi={center:Js,end:Zs,justify:Ys,left:Gs,right:Qs,start:Xs},Wa={[Js]:"center",[Zs]:"end",[Ys]:"justify",[Gs]:"left",[Qs]:"right",[Xs]:"start"},Va={normal:0,segmented:2,token:1},Ka={[Ra]:"normal",[ja]:"segmented",[Ma]:"token"};function Ha(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var F=Ha(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function hn(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}const Ga=100;let bs=!1,ei=0;function Ja(r){ei=r.timeStamp}function os(r,e,t){const n=r.nodeName==="BR",s=e.__lexicalLineBreak;return s&&(r===s||n&&r.previousSibling===s)||n&&Pn(r,t)!==void 0}function Qa(r,e,t){const n=Te(t._window);let s=null,o=null;n!==null&&n.anchorNode===r&&(s=n.anchorOffset,o=n.focusOffset);const i=r.nodeValue;i!==null&&ii(e,i,s,o,!1)}function Ya(r,e,t){if(N(r)){const n=r.anchor.getNode();if(n.is(t)&&r.format!==n.getFormat())return!1}return e.nodeType===mt&&t.isAttached()}function Xa(r,e,t,n){for(let s=r;s&&!dc(s);s=Pr(s)){const o=Pn(s,e);if(o!==void 0){const i=fe(o,t);if(i)return Y(i)?void 0:[s,i]}else if(s===n)return[n,Du(t)]}}function pu(r,e,t){bs=!0;const n=performance.now()-ei>Ga;try{Ce(r,()=>{const s=I()||function(d){return d.getEditorState().read(()=>{const h=I();return h!==null?h.clone():null})}(r),o=new Map,i=r.getRootElement(),u=r._editorState,l=r._blockCursorElement;let a=!1,c="";for(let d=0;d<e.length;d++){const h=e[d],p=h.type,g=h.target,_=Xa(g,r,u,i);if(!_)continue;const[D,y]=_;if(p==="characterData")n&&P(y)&&Ya(s,g,y)&&Qa(g,y,r);else if(p==="childList"){a=!0;const C=h.addedNodes;for(let b=0;b<C.length;b++){const k=C[b],A=vu(k),S=k.parentNode;if(S!=null&&k!==l&&A===null&&!os(k,S,r)){if(pt){const O=k.innerText||k.nodeValue;O&&(c+=O)}S.removeChild(k)}}const x=h.removedNodes,w=x.length;if(w>0){let b=0;for(let k=0;k<w;k++){const A=x[k];(os(A,g,r)||l===A)&&(g.appendChild(A),b++)}w!==b&&o.set(D,y)}}}if(o.size>0)for(const[d,h]of o)h.reconcileObservedMutation(d,r);const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],p=h.addedNodes,g=h.target;for(let _=0;_<p.length;_++){const D=p[_],y=D.parentNode;y==null||D.nodeName!=="BR"||os(D,g,r)||y.removeChild(D)}}t.takeRecords()}s!==null&&(a&&(s.dirty=!0,Ve(s)),pt&&Eu(r)&&s.insertRawText(c))})}finally{bs=!1}}function gu(r){const e=r._observer;e!==null&&pu(r,e.takeRecords(),e)}function mu(r){(function(e){ei===0&&Rn(e).addEventListener("textInput",Ja,!0)})(r),r._observer=new MutationObserver((e,t)=>{pu(r,e,t)})}function Ri(r,e){const t=r.__mode,n=r.__format,s=r.__style,o=e.__mode,i=e.__format,u=e.__style;return!(t!==null&&t!==o||n!==null&&n!==i||s!==null&&s!==u)}function Mi(r,e){const t=r.mergeWithSibling(e),n=ee()._normalizedNodes;return n.add(r.__key),n.add(e.__key),t}function ji(r){let e,t,n=r;if(n.__text!==""||!n.isSimpleText()||n.isUnmergeable()){for(;(e=n.getPreviousSibling())!==null&&P(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Ri(e,n)){n=Mi(e,n);break}break}e.remove()}for(;(t=n.getNextSibling())!==null&&P(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Ri(n,t)){n=Mi(n,t);break}break}t.remove()}}else n.remove()}function yu(r){return Ii(r.anchor),Ii(r.focus),r}function Ii(r){for(;r.type==="element";){const e=r.getNode(),t=r.offset;let n,s;if(t===e.getChildrenSize()?(n=e.getChildAtIndex(t-1),s=!0):(n=e.getChildAtIndex(t),s=!1),P(n)){r.set(n.__key,s?n.getTextContentSize():0,"text");break}if(!E(n))break;r.set(n.__key,s?n.getChildrenSize():0,"element")}}let Za=1;const ec=typeof queueMicrotask=="function"?queueMicrotask:r=>{Promise.resolve().then(r)};function ti(r){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return Y(Jt(r))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Ln(e)==null)}function Lr(r,e,t){const n=r.getRootElement();try{return n!==null&&n.contains(e)&&n.contains(t)&&e!==null&&!ti(e)&&_u(e)===r}catch{return!1}}function ri(r){return r instanceof qn}function _u(r){let e=r;for(;e!=null;){const t=Ln(e);if(ri(t))return t;e=Pr(e)}return null}function Ln(r){return r?r.__lexicalEditor:null}function Dt(r){return r.isToken()||r.isSegmented()}function tc(r){return r.nodeType===mt}function pn(r){let e=r;for(;e!=null;){if(tc(e))return e;e=e.firstChild}return null}function gn(r,e,t){const n=St[e];if(t!==null&&(r&n)==(t&n))return r;let s=r^n;return e==="subscript"?s&=-65:e==="superscript"&&(s&=-33),s}function xu(r){return P(r)||Et(r)||Y(r)}function rc(r,e){if(e!=null)return void(r.__key=e);xe(),Ku();const t=ee(),n=nt(),s=""+Za++;n._nodeMap.set(s,r),E(r)?t._dirtyElements.set(s,!0):t._dirtyLeaves.add(s),t._cloneNotNeeded.add(s),t._dirtyType=du,r.__key=s}function At(r){const e=r.getParent();if(e!==null){const t=r.getWritable(),n=e.getWritable(),s=r.getPreviousSibling(),o=r.getNextSibling();if(s===null)if(o!==null){const i=o.getWritable();n.__first=o.__key,i.__prev=null}else n.__first=null;else{const i=s.getWritable();if(o!==null){const u=o.getWritable();u.__prev=i.__key,i.__next=u.__key}else i.__next=null;t.__prev=null}if(o===null)if(s!==null){const i=s.getWritable();n.__last=s.__key,i.__next=null}else n.__last=null;else{const i=o.getWritable();if(s!==null){const u=s.getWritable();u.__next=i.__key,i.__prev=u.__key}else i.__prev=null;t.__next=null}n.__size--,t.__parent=null}}function mn(r){Ku();const e=r.getLatest(),t=e.__parent,n=nt(),s=ee(),o=n._nodeMap,i=s._dirtyElements;t!==null&&function(l,a,c){let f=l;for(;f!==null;){if(c.has(f))return;const d=a.get(f);if(d===void 0)break;c.set(f,!1),f=d.__parent}}(t,o,i);const u=e.__key;s._dirtyType=du,E(r)?i.set(u,!0):s._dirtyLeaves.add(u)}function de(r){xe();const e=ee(),t=e._compositionKey;if(r!==t){if(e._compositionKey=r,t!==null){const n=fe(t);n!==null&&n.getWritable()}if(r!==null){const n=fe(r);n!==null&&n.getWritable()}}}function dt(){return Ir()?null:ee()._compositionKey}function fe(r,e){const t=(e||nt())._nodeMap.get(r);return t===void 0?null:t}function vu(r,e){const t=Pn(r,ee());return t!==void 0?fe(t,e):null}function Pn(r,e){return r[`__lexicalKey_${e._key}`]}function Jt(r,e){let t=r;for(;t!=null;){const n=vu(t,e);if(n!==null)return n;t=Pr(t)}return null}function bu(r){const e=r._decorators,t=Object.assign({},e);return r._pendingDecorators=t,t}function $i(r){return r.read(()=>te().getTextContent())}function te(){return Du(nt())}function Du(r){return r._nodeMap.get("root")}function Ve(r){xe();const e=nt();r!==null&&(r.dirty=!0,r.setCachedNodes(null)),e._selection=r}function zt(r){const e=ee(),t=function(n,s){let o=n;for(;o!=null;){const i=Pn(o,s);if(i!==void 0)return i;o=Pr(o)}return null}(r,e);return t===null?r===e.getRootElement()?fe("root"):null:fe(t)}function qi(r,e){return e?r.getTextContentSize():0}function Cu(r){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(r)}function ni(r){const e=[];let t=r;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function wu(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Au(r){return r.nodeType===mt?r.nodeValue:null}function si(r,e,t){const n=Te(e._window);if(n===null)return;const s=n.anchorNode;let{anchorOffset:o,focusOffset:i}=n;if(s!==null){let u=Au(s);const l=Jt(s);if(u!==null&&P(l)){if(u===Fn&&t){const a=t.length;u=t,o=a,i=a}u!==null&&ii(l,u,o,i,r)}}}function ii(r,e,t,n,s){let o=r;if(o.isAttached()&&(s||!o.isDirty())){const i=o.isComposing();let u=e;(i||s)&&e[e.length-1]===Fn&&(u=e.slice(0,-1));const l=o.getTextContent();if(s||u!==l){if(u===""){if(de(null),Nn||Nr||Ks)o.remove();else{const g=ee();setTimeout(()=>{g.update(()=>{o.isAttached()&&o.remove()})},20)}return}const a=o.getParent(),c=jr(),f=o.getTextContentSize(),d=dt(),h=o.getKey();if(o.isToken()||d!==null&&h===d&&!i||N(c)&&(a!==null&&!a.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===r.__key&&c.anchor.offset===0&&!o.canInsertTextBefore()&&!i||c.focus.key===r.__key&&c.focus.offset===f&&!o.canInsertTextAfter()&&!i))return void o.markDirty();const p=I();if(!N(p)||t===null||n===null)return void o.setTextContent(u);if(p.setTextNodeRange(o,t,o,n),o.isSegmented()){const g=le(o.getTextContent());o.replace(g),o=g}o.setTextContent(u)}}}function nc(r,e){if(e.isSegmented())return!0;if(!r.isCollapsed())return!1;const t=r.anchor.offset,n=e.getParentOrThrow(),s=e.isToken();return t===0?!e.canInsertTextBefore()||!n.canInsertTextBefore()&&!e.isComposing()||s||function(o){const i=o.getPreviousSibling();return(P(i)||E(i)&&i.isInline())&&!i.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!n.canInsertTextAfter()&&!e.isComposing()||s)}function zi(r){return r==="ArrowLeft"}function Ui(r){return r==="ArrowRight"}function dr(r,e){return Ne?r:e}function Wi(r){return r==="Enter"}function ir(r){return r==="Backspace"}function or(r){return r==="Delete"}function Vi(r,e,t){return r.toLowerCase()==="a"&&dr(e,t)}function sc(){const r=te();Ve(yu(r.select(0,r.getChildrenSize())))}function yr(r,e){r.__lexicalClassNameCache===void 0&&(r.__lexicalClassNameCache={});const t=r.__lexicalClassNameCache,n=t[e];if(n!==void 0)return n;const s=r[e];if(typeof s=="string"){const o=hn(s);return t[e]=o,o}return s}function oi(r,e,t,n,s){if(t.size===0)return;const o=n.__type,i=n.__key,u=e.get(o);u===void 0&&F(33,o);const l=u.klass;let a=r.get(l);a===void 0&&(a=new Map,r.set(l,a));const c=a.get(i),f=c==="destroyed"&&s==="created";(c===void 0||f)&&a.set(i,f?"updated":s)}function Ki(r,e,t){const n=r.getParent();let s=t,o=r;return n!==null&&(e&&t===0?(s=o.getIndexWithinParent(),o=n):e||t!==o.getChildrenSize()||(s=o.getIndexWithinParent()+1,o=n)),o.getChildAtIndex(e?s-1:s)}function Er(r,e){const t=r.offset;if(r.type==="element")return Ki(r.getNode(),e,t);{const n=r.getNode();if(e&&t===0||!e&&t===n.getTextContentSize()){const s=e?n.getPreviousSibling():n.getNextSibling();return s===null?Ki(n.getParentOrThrow(),e,n.getIndexWithinParent()+(e?0:1)):s}}return null}function Eu(r){const e=Rn(r).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function R(r,e,t){return Ju(r,e,t)}function On(r){return!ge(r)&&!r.isLastChild()&&!r.isInline()}function yn(r,e){const t=r._keyToDOMMap.get(e);return t===void 0&&F(75,e),t}function Pr(r){const e=r.assignedSlot||r.parentElement;return e!==null&&e.nodeType===11?e.host:e}function _r(r,e){let t=r.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Rn(r){const e=r._window;return e===null&&F(78),e}function ic(r){let e=r.getParentOrThrow();for(;e!==null;){if(Ke(e))return e;e=e.getParentOrThrow()}return e}function Ke(r){return ge(r)||E(r)&&r.isShadowRoot()}function Je(r){const e=ee(),t=r.constructor.getType(),n=e._nodes.get(t);n===void 0&&F(200,r.constructor.name,t);const{replace:s,replaceWithKlass:o}=n;if(s!==null){const i=s(r),u=i.constructor;return o!==null?i instanceof o||F(201,o.name,o.getType(),u.name,u.getType(),r.constructor.name,t):i instanceof r.constructor&&u!==r.constructor||F(202,u.name,u.getType(),r.constructor.name,t),i.__key===r.__key&&F(203,r.constructor.name,t,u.name,u.getType()),i}return r}function us(r,e){!ge(r.getParent())||E(e)||Y(e)||F(99)}function ls(r){return(Y(r)||E(r)&&!r.canBeEmpty())&&!r.isInline()}function ui(r,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const n=r.parentElement;n!==null&&n.removeChild(r)}function oc(r,e,t){let n=r._blockCursorElement;if(N(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const s=t.anchor,o=s.getNode(),i=s.offset;let u=!1,l=null;if(i===o.getChildrenSize())ls(o.getChildAtIndex(i-1))&&(u=!0);else{const a=o.getChildAtIndex(i);if(a!==null&&ls(a)){const c=a.getPreviousSibling();(c===null||ls(c))&&(u=!0,l=r.getElementByKey(a.__key))}}if(u){const a=r.getElementByKey(o.__key);return n===null&&(r._blockCursorElement=n=function(c){const f=c.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let h=f.blockCursor;if(h!==void 0){if(typeof h=="string"){const p=hn(h);h=f.blockCursor=p}h!==void 0&&d.classList.add(...h)}return d}(r._config)),e.style.caretColor="transparent",void(l===null?a.appendChild(n):a.insertBefore(n,l))}}n!==null&&ui(n,r,e)}function Te(r){return Re?(r||window).getSelection():null}function uc(r){return rt(r)&&r.tagName==="A"}function rt(r){return r.nodeType===1}function Hi(r){return r.nodeType===11}function Ds(r){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return r.nodeName.match(e)!==null}function _n(r){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return r.nodeName.match(e)!==null}function at(r){if(Y(r)&&!r.isInline())return!0;if(!E(r)||Ke(r))return!1;const e=r.getFirstChild(),t=e===null||Et(e)||P(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function ur(r,e){let t=r;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function lc(){return ee()}const Gi=new WeakMap,ac=new Map;function cc(r){if(!r._readOnly&&r.isEmpty())return ac;r._readOnly||F(192);let e=Gi.get(r);if(!e){e=new Map,Gi.set(r,e);for(const[t,n]of r._nodeMap){const s=n.__type;let o=e.get(s);o||(o=new Map,e.set(s,o)),o.set(t,n)}}return e}function li(r){const e=r.constructor.clone(r);return e.afterCloneFrom(r),e}function ai(r,e){const t=(parseInt(r.style.paddingInlineStart,10)||0)/40;e.setIndent(t)}function dc(r){return r.__lexicalUnmanaged===!0}function ku(r,e,t,n,s,o){let i=r.getFirstChild();for(;i!==null;){const u=i.__key;i.__parent===e&&(E(i)&&ku(i,u,t,n,s,o),t.has(u)||o.delete(u),s.push(u)),i=i.getNextSibling()}}let gt,me,kr,Mn,Cs,ws,Tt,Oe,As,Sr,ie="",pe="",qe=null,Fe="",et="",Su=!1,Tr=!1,sn=null;function xn(r,e){const t=Tt.get(r);if(e!==null){const n=Ss(r);n.parentNode===e&&e.removeChild(n)}if(Oe.has(r)||me._keyToDOMMap.delete(r),E(t)){const n=bn(t,Tt);Es(n,0,n.length-1,null)}t!==void 0&&oi(Sr,kr,Mn,t,"destroyed")}function Es(r,e,t,n){let s=e;for(;s<=t;++s){const o=r[s];o!==void 0&&xn(o,n)}}function bt(r,e){r.setProperty("text-align",e)}const fc="40px";function Tu(r,e){const t=gt.theme.indent;if(typeof t=="string"){const s=r.classList.contains(t);e>0&&!s?r.classList.add(t):e<1&&s&&r.classList.remove(t)}const n=getComputedStyle(r).getPropertyValue("--lexical-indent-base-value")||fc;r.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${n})`)}function Bu(r,e){const t=r.style;e===0?bt(t,""):e===Gs?bt(t,"left"):e===Js?bt(t,"center"):e===Qs?bt(t,"right"):e===Ys?bt(t,"justify"):e===Xs?bt(t,"start"):e===Zs&&bt(t,"end")}function vn(r,e){const t=Oe.get(r);t===void 0&&F(60);const n=t.createDOM(gt,me);if(function(s,o,i){const u=i._keyToDOMMap;(function(l,a,c){l[`__lexicalKey_${a._key}`]=c})(o,i,s),u.set(s,o)}(r,n,me),P(t)?n.setAttribute("data-lexical-text","true"):Y(t)&&n.setAttribute("data-lexical-decorator","true"),E(t)){const s=t.__indent,o=t.__size;if(s!==0&&Tu(n,s),o!==0){const u=o-1;(function(l,a,c,f){const d=pe;pe="",ks(l,c,0,a,c.getDOMSlot(f)),Fu(c,f),pe=d})(bn(t,Oe),u,t,n)}const i=t.__format;i!==0&&Bu(n,i),t.isInline()||Nu(null,t,n),On(t)&&(ie+=tt,et+=tt)}else{const s=t.getTextContent();if(Y(t)){const o=t.decorate(me,gt);o!==null&&Lu(r,o),n.contentEditable="false"}else P(t)&&(t.isDirectionless()||(pe+=s));ie+=s,et+=s}return e!==null&&e.insertChild(n),oi(Sr,kr,Mn,t,"created"),n}function ks(r,e,t,n,s){const o=ie;ie="";let i=t;for(;i<=n;++i){vn(r[i],s);const u=Oe.get(r[i]);u!==null&&P(u)&&(qe===null&&(qe=u.getFormat()),Fe===""&&(Fe=u.getStyle()))}On(e)&&(ie+=tt),s.element.__lexicalTextContent=ie,ie=o+ie}function Ji(r,e){if(r){const t=r.__last;if(t){const n=e.get(t);if(n)return Et(n)?"line-break":Y(n)&&n.isInline()?"decorator":null}return"empty"}return null}function Nu(r,e,t){const n=Ji(r,Tt),s=Ji(e,Oe);n!==s&&e.getDOMSlot(t).setManagedLineBreak(s)}function Fu(r,e){const t=e.__lexicalDirTextContent||"",n=e.__lexicalDir||"";if(t!==pe||n!==sn){const o=pe==="",i=o?sn:(s=pe,qa.test(s)?"rtl":za.test(s)?"ltr":null);if(i!==n){const u=e.classList,l=gt.theme;let a=n!==null?l[n]:void 0,c=i!==null?l[i]:void 0;if(a!==void 0){if(typeof a=="string"){const f=hn(a);a=l[n]=f}u.remove(...a)}if(i===null||o&&i==="ltr")e.removeAttribute("dir");else{if(c!==void 0){if(typeof c=="string"){const f=hn(c);c=l[i]=f}c!==void 0&&u.add(...c)}e.dir=i}Tr||(r.getWritable().__dir=i)}sn=i,e.__lexicalDirTextContent=pe,e.__lexicalDir=i}var s}function hc(r,e,t){const n=pe;var s;pe="",qe=null,Fe="",function(o,i,u){const l=ie,a=o.__size,c=i.__size;ie="";const f=u.element;if(a===1&&c===1){const d=o.__first,h=i.__first;if(d===h)fr(d,f);else{const g=Ss(d),_=vn(h,null);try{f.replaceChild(_,g)}catch(D){if(typeof D=="object"&&D!=null){const y=`${D.toString()} Parent: ${f.tagName}, new child: {tag: ${_.tagName} key: ${h}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(y)}throw D}xn(d,null)}const p=Oe.get(h);P(p)&&(qe===null&&(qe=p.getFormat()),Fe===""&&(Fe=p.getStyle()))}else{const d=bn(o,Tt),h=bn(i,Oe);if(d.length!==a&&F(227),h.length!==c&&F(228),a===0)c!==0&&ks(h,i,0,c-1,u);else if(c===0){if(a!==0){const p=u.after==null&&u.before==null&&u.element.__lexicalLineBreak==null;Es(d,0,a-1,p?null:f),p&&(f.textContent="")}}else(function(p,g,_,D,y,C){const x=D-1,w=y-1;let b,k,A=C.getFirstChild(),S=0,O=0;for(;S<=x&&O<=w;){const q=g[S],$=_[O];if(q===$)A=as(fr($,C.element)),S++,O++;else{b===void 0&&(b=new Set(g)),k===void 0&&(k=new Set(_));const re=k.has(q),Ae=b.has($);if(re)if(Ae){const Me=yn(me,$);Me===A?A=as(fr($,C.element)):(C.withBefore(A).insertChild(Me),fr($,C.element)),S++,O++}else vn($,C.withBefore(A)),O++;else A=as(Ss(q)),xn(q,C.element),S++}const V=Oe.get($);V!==null&&P(V)&&(qe===null&&(qe=V.getFormat()),Fe===""&&(Fe=V.getStyle()))}const L=S>x,W=O>w;if(L&&!W){const q=_[w+1],$=q===void 0?null:me.getElementByKey(q);ks(_,p,O,w,C.withBefore($))}else W&&!L&&Es(g,S,x,C.element)})(i,d,h,a,c,u)}On(i)&&(ie+=tt),f.__lexicalTextContent=ie,ie=l+ie}(r,e,e.getDOMSlot(t)),Fu(e,t),Qt(s=e)&&qe!=null&&qe!==s.__textFormat&&!Tr&&(s.setTextFormat(qe),s.setTextStyle(Fe)),function(o){Qt(o)&&Fe!==""&&Fe!==o.__textStyle&&!Tr&&o.setTextStyle(Fe)}(e),pe=n}function bn(r,e){const t=[];let n=r.__first;for(;n!==null;){const s=e.get(n);s===void 0&&F(101),t.push(n),n=s.__next}return t}function fr(r,e){const t=Tt.get(r);let n=Oe.get(r);t!==void 0&&n!==void 0||F(61);const s=Su||ws.has(r)||Cs.has(r),o=yn(me,r);if(t===n&&!s){if(E(t)){const i=o.__lexicalTextContent;i!==void 0&&(ie+=i,et+=i);const u=o.__lexicalDirTextContent;u!==void 0&&(pe+=u)}else{const i=t.getTextContent();P(t)&&!t.isDirectionless()&&(pe+=i),et+=i,ie+=i}return o}if(t!==n&&s&&oi(Sr,kr,Mn,n,"updated"),n.updateDOM(t,o,gt)){const i=vn(r,null);return e===null&&F(62),e.replaceChild(i,o),xn(r,null),i}if(E(t)&&E(n)){const i=n.__indent;i!==t.__indent&&Tu(o,i);const u=n.__format;u!==t.__format&&Bu(o,u),s&&(hc(t,n,o),ge(n)||n.isInline()||Nu(t,n,o)),On(n)&&(ie+=tt,et+=tt)}else{const i=n.getTextContent();if(Y(n)){const u=n.decorate(me,gt);u!==null&&Lu(r,u)}else P(n)&&!n.isDirectionless()&&(pe+=i);ie+=i,et+=i}if(!Tr&&ge(n)&&n.__cachedText!==et){const i=n.getWritable();i.__cachedText=et,n=i}return o}function Lu(r,e){let t=me._pendingDecorators;const n=me._decorators;if(t===null){if(n[r]===e)return;t=bu(me)}t[r]=e}function as(r){let e=r.nextSibling;return e!==null&&e===me._blockCursorElement&&(e=e.nextSibling),e}function pc(r,e,t,n,s,o){ie="",et="",pe="",Su=n===Gt,sn=null,me=t,gt=t._config,kr=t._nodes,Mn=me._listeners.mutation,Cs=s,ws=o,Tt=r._nodeMap,Oe=e._nodeMap,Tr=e._readOnly,As=new Map(t._keyToDOMMap);const i=new Map;return Sr=i,fr("root",null),me=void 0,kr=void 0,Cs=void 0,ws=void 0,Tt=void 0,Oe=void 0,gt=void 0,As=void 0,Sr=void 0,i}function Ss(r){const e=As.get(r);return e===void 0&&F(75,r),e}const Ze=Object.freeze({}),Ts=30,Bs=[["keydown",function(r,e){if(xr=r.timeStamp,Pu=r.key,e.isComposing())return;const{key:t,shiftKey:n,ctrlKey:s,metaKey:o,altKey:i}=r;if(!R(e,xa,r)&&t!=null){if(function(u,l,a,c){return Ui(u)&&!l&&!c&&!a}(t,s,i,o))R(e,eu,r);else if(function(u,l,a,c,f){return Ui(u)&&!c&&!a&&(l||f)}(t,s,n,i,o))R(e,va,r);else if(function(u,l,a,c){return zi(u)&&!l&&!c&&!a}(t,s,i,o))R(e,tu,r);else if(function(u,l,a,c,f){return zi(u)&&!c&&!a&&(l||f)}(t,s,n,i,o))R(e,ba,r);else if(function(u,l,a){return function(c){return c==="ArrowUp"}(u)&&!l&&!a}(t,s,o))R(e,ru,r);else if(function(u,l,a){return function(c){return c==="ArrowDown"}(u)&&!l&&!a}(t,s,o))R(e,nu,r);else if(function(u,l){return Wi(u)&&l}(t,n))vr=!0,R(e,an,r);else if(function(u){return u===" "}(t))R(e,Da,r);else if(function(u,l){return Ne&&l&&u.toLowerCase()==="o"}(t,s))r.preventDefault(),vr=!0,R(e,Wt,!0);else if(function(u,l){return Wi(u)&&!l}(t,n))vr=!1,R(e,an,r);else if(function(u,l,a,c){return Ne?!l&&!a&&(ir(u)||u.toLowerCase()==="h"&&c):!(c||l||a)&&ir(u)}(t,i,o,s))ir(t)?R(e,su,r):(r.preventDefault(),R(e,wt,!0));else if(function(u){return u==="Escape"}(t))R(e,iu,r);else if(function(u,l,a,c,f){return Ne?!(a||c||f)&&(or(u)||u.toLowerCase()==="d"&&l):!(l||c||f)&&or(u)}(t,s,n,i,o))or(t)?R(e,ou,r):(r.preventDefault(),R(e,wt,!1));else if(function(u,l,a){return ir(u)&&(Ne?l:a)}(t,i,s))r.preventDefault(),R(e,wr,!0);else if(function(u,l,a){return or(u)&&(Ne?l:a)}(t,i,s))r.preventDefault(),R(e,wr,!1);else if(function(u,l){return Ne&&l&&ir(u)}(t,o))r.preventDefault(),R(e,Ar,!0);else if(function(u,l){return Ne&&l&&or(u)}(t,o))r.preventDefault(),R(e,Ar,!1);else if(function(u,l,a,c){return u.toLowerCase()==="b"&&!l&&dr(a,c)}(t,i,o,s))r.preventDefault(),R(e,Pe,"bold");else if(function(u,l,a,c){return u.toLowerCase()==="u"&&!l&&dr(a,c)}(t,i,o,s))r.preventDefault(),R(e,Pe,"underline");else if(function(u,l,a,c){return u.toLowerCase()==="i"&&!l&&dr(a,c)}(t,i,o,s))r.preventDefault(),R(e,Pe,"italic");else if(function(u,l,a,c){return u==="Tab"&&!l&&!a&&!c}(t,i,s,o))R(e,Ca,r);else if(function(u,l,a,c){return u.toLowerCase()==="z"&&!l&&dr(a,c)}(t,n,o,s))r.preventDefault(),R(e,Us,void 0);else if(function(u,l,a,c){return Ne?u.toLowerCase()==="z"&&a&&l:u.toLowerCase()==="y"&&c||u.toLowerCase()==="z"&&c&&l}(t,n,o,s))r.preventDefault(),R(e,Ws,void 0);else{const u=e._editorState._selection;u===null||N(u)?!pt&&Vi(t,o,s)&&(r.preventDefault(),R(e,vs,r)):function(l,a,c,f){return!a&&l.toLowerCase()==="c"&&(Ne?c:f)}(t,n,o,s)?(r.preventDefault(),R(e,Bn,r)):function(l,a,c,f){return!a&&l.toLowerCase()==="x"&&(Ne?c:f)}(t,n,o,s)?(r.preventDefault(),R(e,Vs,r)):Vi(t,o,s)&&(r.preventDefault(),R(e,vs,r))}(function(u,l,a,c){return u||l||a||c})(s,n,i,o)&&R(e,Fa,r)}}],["pointerdown",function(r,e){const t=r.target,n=r.pointerType;t instanceof Node&&n!=="touch"&&Ce(e,()=>{Y(Jt(t))||(Fs=!0)})}],["compositionstart",function(r,e){Ce(e,()=>{const t=I();if(N(t)&&!e.isComposing()){const n=t.anchor,s=t.anchor.getNode();de(n.key),(r.timeStamp<xr+Ts||n.type==="element"||!t.isCollapsed()||s.getFormat()!==t.format||P(s)&&s.getStyle()!==t.style)&&R(e,Vt,$a)}})}],["compositionend",function(r,e){pt?lr=!0:Ce(e,()=>{cs(e,r.data)})}],["input",function(r,e){r.stopPropagation(),Ce(e,()=>{const t=I(),n=r.data,s=ju(r);if(n!=null&&N(t)&&Mu(t,s,n,r.timeStamp,!1)){lr&&(cs(e,n),lr=!1);const o=t.anchor.getNode(),i=Te(e._window);if(i===null)return;const u=t.isBackward(),l=u?t.anchor.offset:t.focus.offset,a=u?t.focus.offset:t.anchor.offset;cn&&!t.isCollapsed()&&P(o)&&i.anchorNode!==null&&o.getTextContent().slice(0,l)+n+o.getTextContent().slice(l+a)===Au(i.anchorNode)||R(e,Vt,n);const c=n.length;pt&&c>1&&r.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),Nn||Nr||Ks||!e.isComposing()||(xr=0,de(null))}else si(!1,e,n!==null?n:void 0),lr&&(cs(e,n||void 0),lr=!1);xe(),gu(ee())}),qt=null}],["click",function(r,e){Ce(e,()=>{const t=I(),n=Te(e._window),s=jr();if(n){if(N(t)){const o=t.anchor,i=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!ge(i)&&te().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&s!==null&&t.is(s)?(n.removeAllRanges(),t.dirty=!0):r.detail===3&&!t.isCollapsed()&&i!==t.focus.getNode()&&(E(i)?i.select(0):i.getParentOrThrow().select(0))}else if(r.pointerType==="touch"){const o=n.anchorNode;if(o!==null){const i=o.nodeType;(i===Fr||i===mt)&&Ve(di(s,n,e,r))}}}R(e,Zo,r)})}],["cut",Ze],["copy",Ze],["dragstart",Ze],["dragover",Ze],["dragend",Ze],["paste",Ze],["focus",Ze],["blur",Ze],["drop",Ze]];cn&&Bs.push(["beforeinput",(r,e)=>function(t,n){const s=t.inputType,o=ju(t);s==="deleteCompositionText"||pt&&Eu(n)||s!=="insertCompositionText"&&Ce(n,()=>{const i=I();if(s==="deleteContentBackward"){if(i===null){const h=jr();if(!N(h))return;Ve(h.clone())}if(N(i)){const h=i.anchor.key===i.focus.key;if(u=t.timeStamp,Pu==="MediaLast"&&u<xr+Ts&&n.isComposing()&&h){if(de(null),xr=0,setTimeout(()=>{Ce(n,()=>{de(null)})},Ts),N(i)){const p=i.anchor.getNode();p.markDirty(),i.format=p.getFormat(),P(p)||F(142),i.style=p.getStyle()}}else{de(null),t.preventDefault();const p=i.anchor.getNode(),g=p.getTextContent(),_=p.canInsertTextAfter(),D=i.anchor.offset===0&&i.focus.offset===g.length;Oa&&h&&!D&&_||R(n,wt,!0)}return}}var u;if(!N(i))return;const l=t.data;qt!==null&&si(!1,n,qt),i.dirty&&qt===null||!i.isCollapsed()||ge(i.anchor.getNode())||o===null||i.applyDOMRange(o),qt=null;const a=i.anchor,c=i.focus,f=a.getNode(),d=c.getNode();if(s!=="insertText"&&s!=="insertTranspose")switch(t.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":R(n,Vt,t);break;case"insertFromComposition":de(null),R(n,Vt,t);break;case"insertLineBreak":de(null),R(n,Wt,!1);break;case"insertParagraph":de(null),vr&&!Nr?(vr=!1,R(n,Wt,!1)):R(n,Cr,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":R(n,Tn,t);break;case"deleteByComposition":(function(h,p){return h!==p||E(h)||E(p)||!h.isToken()||!p.isToken()})(f,d)&&R(n,xs,t);break;case"deleteByDrag":case"deleteByCut":R(n,xs,t);break;case"deleteContent":R(n,wt,!1);break;case"deleteWordBackward":R(n,wr,!0);break;case"deleteWordForward":R(n,wr,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":R(n,Ar,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":R(n,Ar,!1);break;case"formatStrikeThrough":R(n,Pe,"strikethrough");break;case"formatBold":R(n,Pe,"bold");break;case"formatItalic":R(n,Pe,"italic");break;case"formatUnderline":R(n,Pe,"underline");break;case"historyUndo":R(n,Us,void 0);break;case"historyRedo":R(n,Ws,void 0)}else{if(l===`
|
|
64
|
+
`)t.preventDefault(),R(n,Wt,!1);else if(l===tt)t.preventDefault(),R(n,Cr,void 0);else if(l==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),i.insertRawText(h)}else l!=null&&Mu(i,o,l,t.timeStamp,!0)?(t.preventDefault(),R(n,Vt,l)):qt=l;Ou=t.timeStamp}})}(r,e)]);let xr=0,Pu=null,Ou=0,qt=null;const Dn=new WeakMap;let Ns=!1,Fs=!1,vr=!1,lr=!1,Ru=[0,"",0,"root",0];function Mu(r,e,t,n,s){const o=r.anchor,i=r.focus,u=o.getNode(),l=ee(),a=Te(l._window),c=a!==null?a.anchorNode:null,f=o.key,d=l.getElementByKey(f),h=t.length;return f!==i.key||!P(u)||(!s&&(!cn||Ou<n+50)||u.isDirty()&&h<2||Cu(t))&&o.offset!==i.offset&&!u.isComposing()||Dt(u)||u.isDirty()&&h>1||(s||!cn)&&d!==null&&!u.isComposing()&&c!==pn(d)||a!==null&&e!==null&&(!e.collapsed||e.startContainer!==a.anchorNode||e.startOffset!==a.anchorOffset)||u.getFormat()!==r.format||u.getStyle()!==r.style||nc(r,u)}function Qi(r,e){return r!==null&&r.nodeValue!==null&&r.nodeType===mt&&e!==0&&e!==r.nodeValue.length}function Yi(r,e,t){const{anchorNode:n,anchorOffset:s,focusNode:o,focusOffset:i}=r;Ns&&(Ns=!1,Qi(n,s)&&Qi(o,i))||Ce(e,()=>{if(!t)return void Ve(null);if(!Lr(e,n,o))return;const u=I();if(N(u)){const l=u.anchor,a=l.getNode();if(u.isCollapsed()){r.type==="Range"&&r.anchorNode===r.focusNode&&(u.dirty=!0);const c=Rn(e).event,f=c?c.timeStamp:performance.now(),[d,h,p,g,_]=Ru,D=te(),y=e.isComposing()===!1&&D.getTextContent()==="";if(f<_+200&&l.offset===p&&l.key===g)u.format=d,u.style=h;else if(l.type==="text")P(a)||F(141),u.format=a.getFormat(),u.style=a.getStyle();else if(l.type==="element"&&!y){const C=l.getNode();u.style="",C instanceof Xt&&C.getChildrenSize()===0?(u.format=C.getTextFormat(),u.style=C.getTextStyle()):u.format=0}}else{const c=l.key,f=u.focus.key,d=u.getNodes(),h=d.length,p=u.isBackward(),g=p?i:s,_=p?s:i,D=p?f:c,y=p?c:f;let C=Ia,x=!1;for(let w=0;w<h;w++){const b=d[w],k=b.getTextContentSize();if(P(b)&&k!==0&&!(w===0&&b.__key===D&&g===k||w===h-1&&b.__key===y&&_===0)&&(x=!0,C&=b.getFormat(),C===0))break}u.format=x?C:0}}R(e,zs,void 0)})}function ju(r){if(!r.getTargetRanges)return null;const e=r.getTargetRanges();return e.length===0?null:e[0]}function cs(r,e){const t=r._compositionKey;if(de(null),t!==null&&e!=null){if(e===""){const n=fe(t),s=pn(r.getElementByKey(t));return void(s!==null&&s.nodeValue!==null&&P(n)&&ii(n,s.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
65
|
+
`){const n=I();if(N(n)){const s=n.focus;return n.anchor.set(s.key,s.offset,s.type),void R(r,an,null)}}}si(!0,r,e)}function Iu(r){let e=r.__lexicalEventHandles;return e===void 0&&(e=[],r.__lexicalEventHandles=e),e}const Kt=new Map;function $u(r){const e=r.target,t=Te(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const n=_u(t.anchorNode);if(n===null)return;Fs&&(Fs=!1,Ce(n,()=>{const a=jr(),c=t.anchorNode;if(c===null)return;const f=c.nodeType;f!==Fr&&f!==mt||Ve(di(a,t,n,r))}));const s=ni(n),o=s[s.length-1],i=o._key,u=Kt.get(i),l=u||o;l!==n&&Yi(t,l,!1),Yi(t,n,!0),n!==o?Kt.set(i,n):u&&Kt.delete(i)}function Xi(r){r._lexicalHandled=!0}function Zi(r){return r._lexicalHandled===!0}function gc(r){const e=r.ownerDocument,t=Dn.get(e);t===void 0&&F(162);const n=t-1;n>=0||F(164),Dn.set(e,n),n===0&&e.removeEventListener("selectionchange",$u);const s=Ln(r);ri(s)?(function(i){if(i._parentEditor!==null){const u=ni(i),l=u[u.length-1]._key;Kt.get(l)===i&&Kt.delete(l)}else Kt.delete(i._key)}(s),r.__lexicalEditor=null):s&&F(198);const o=Iu(r);for(let i=0;i<o.length;i++)o[i]();r.__lexicalEventHandles=[]}function Ls(r,e,t){xe();const n=r.__key,s=r.getParent();if(s===null)return;const o=function(u){const l=I();if(!N(l)||!E(u))return l;const{anchor:a,focus:c}=l,f=a.getNode(),d=c.getNode();return _r(f,u)&&a.set(u.__key,0,"element"),_r(d,u)&&c.set(u.__key,0,"element"),l}(r);let i=!1;if(N(o)&&e){const u=o.anchor,l=o.focus;u.key===n&&(wn(u,r,s,r.getPreviousSibling(),r.getNextSibling()),i=!0),l.key===n&&(wn(l,r,s,r.getPreviousSibling(),r.getNextSibling()),i=!0)}else ze(o)&&e&&r.isSelected()&&r.selectPrevious();if(N(o)&&e&&!i){const u=r.getIndexWithinParent();At(r),Cn(o,s,u,-1)}else At(r);t||Ke(s)||s.canBeEmpty()||!s.isEmpty()||Ls(s,e),e&&ge(s)&&s.isEmpty()&&s.selectEnd()}class jn{static getType(){F(64,this.name)}static clone(e){F(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,rc(this,e)}getType(){return this.__type}isInline(){F(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=fe(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||I();if(t==null)return!1;const n=t.getNodes().some(s=>s.__key===this.__key);if(P(this))return n;if(N(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const s=this.getParent();if(Y(this)&&this.isInline()&&s){const o=t.isBackward()?t.focus:t.anchor,i=o.getNode();if(o.offset===i.getChildrenSize()&&i.is(s)&&i.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:fe(e)}getParentOrThrow(){const e=this.getParent();return e===null&&F(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(Ke(t))return E(e)||e===this&&Y(e)||F(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&F(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:fe(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:fe(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();E(this)&&t.unshift(this),E(e)&&n.unshift(e);const s=t.length,o=n.length;if(s===0||o===0||t[s-1]!==n[o-1])return null;const i=new Set(n);for(let u=0;u<s;u++){const l=t[u];if(i.has(l))return l}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let n=0,s=0,o=this;for(;;){const i=o.getParentOrThrow();if(i===t){n=o.getIndexWithinParent();break}o=i}for(o=e;;){const i=o.getParentOrThrow();if(i===t){s=o.getIndexWithinParent();break}o=i}return n<s}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;n!==null;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],s=new Set;let o=this;for(;o!==null;){const i=o.__key;if(s.has(i)||(s.add(i),n.push(o)),o===e)break;const u=E(o)?t?o.getFirstChild():o.getLastChild():null;if(u!==null){o=u;continue}const l=t?o.getNextSibling():o.getPreviousSibling();if(l!==null){o=l;continue}const a=o.getParentOrThrow();if(s.has(a.__key)||n.push(a),a===e)break;let c=null,f=a;do{if(f===null&&F(68),c=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;c!==null||s.has(f.__key)||n.push(f)}while(c===null);o=c}return t||n.reverse(),n}isDirty(){const e=ee()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=fe(this.__key);return e===null&&F(113),e}getWritable(){xe();const e=nt(),t=ee(),n=e._nodeMap,s=this.__key,o=this.getLatest(),i=t._cloneNotNeeded,u=I();if(u!==null&&u.setCachedNodes(null),i.has(s))return mn(o),o;const l=li(o);return i.add(s),mn(l),n.set(s,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){F(70)}updateDOM(e,t,n){F(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){F(72)}static importJSON(e){F(18,this.name)}static transform(){return null}remove(e){Ls(this,!0,e)}replace(e,t){xe();let n=I();n!==null&&(n=n.clone()),us(this,e);const s=this.getLatest(),o=this.__key,i=e.__key,u=e.getWritable(),l=this.getParentOrThrow().getWritable(),a=l.__size;At(u);const c=s.getPreviousSibling(),f=s.getNextSibling(),d=s.__prev,h=s.__next,p=s.__parent;if(Ls(s,!1,!0),c===null?l.__first=i:c.getWritable().__next=i,u.__prev=d,f===null?l.__last=i:f.getWritable().__prev=i,u.__next=h,u.__parent=p,l.__size=a,t&&(E(this)&&E(u)||F(139),this.getChildren().forEach(g=>{u.append(g)})),N(n)){Ve(n);const g=n.anchor,_=n.focus;g.key===o&&no(g,u),_.key===o&&no(_,u)}return dt()===o&&de(i),u}insertAfter(e,t=!0){xe(),us(this,e);const n=this.getWritable(),s=e.getWritable(),o=s.getParent(),i=I();let u=!1,l=!1;if(o!==null){const h=e.getIndexWithinParent();if(At(s),N(i)){const p=o.__key,g=i.anchor,_=i.focus;u=g.type==="element"&&g.key===p&&g.offset===h+1,l=_.type==="element"&&_.key===p&&_.offset===h+1}}const a=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),f=s.__key,d=n.__next;if(a===null?c.__last=f:a.getWritable().__prev=f,c.__size++,n.__next=f,s.__next=d,s.__prev=n.__key,s.__parent=n.__parent,t&&N(i)){const h=this.getIndexWithinParent();Cn(i,c,h+1);const p=c.__key;u&&i.anchor.set(p,h+2,"element"),l&&i.focus.set(p,h+2,"element")}return e}insertBefore(e,t=!0){xe(),us(this,e);const n=this.getWritable(),s=e.getWritable(),o=s.__key;At(s);const i=this.getPreviousSibling(),u=this.getParentOrThrow().getWritable(),l=n.__prev,a=this.getIndexWithinParent();i===null?u.__first=o:i.getWritable().__next=o,u.__size++,n.__prev=o,s.__prev=l,s.__next=n.__key,s.__parent=n.__parent;const c=I();return t&&N(c)&&Cn(c,this.getParentOrThrow(),a),e}isParentRequired(){return!1}createParentElementNode(){return oe()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){xe();const n=this.getPreviousSibling(),s=this.getParentOrThrow();if(n===null)return s.select(0,0);if(E(n))return n.select();if(!P(n)){const o=n.getIndexWithinParent()+1;return s.select(o,o)}return n.select(e,t)}selectNext(e,t){xe();const n=this.getNextSibling(),s=this.getParentOrThrow();if(n===null)return s.select();if(E(n))return n.select(0,0);if(!P(n)){const o=n.getIndexWithinParent();return s.select(o,o)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}class Or extends jn{static getType(){return"linebreak"}static clone(e){return new Or(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
66
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const n=t.parentElement;if(n!==null&&_n(n)){const s=n.firstChild;if(s===t||s.nextSibling===t&&Yr(s)){const o=n.lastChild;if(o===t||o.previousSibling===t&&Yr(o))return!0}}return!1}(e)||function(t){const n=t.parentElement;if(n!==null&&_n(n)){const s=n.firstChild;if(s===t||s.nextSibling===t&&Yr(s))return!1;const o=n.lastChild;if(o===t||o.previousSibling===t&&Yr(o))return!0}return!1}(e)?null:{conversion:mc,priority:0}}}static importJSON(e){return Bt()}exportJSON(){return{type:"linebreak",version:1}}}function mc(r){return{node:Bt()}}function Bt(){return Je(new Or)}function Et(r){return r instanceof Or}function Yr(r){return r.nodeType===mt&&/^( |\t|\r?\n)+$/.test(r.textContent||"")}function ds(r,e){return 16&e?"code":e&Hs?"mark":32&e?"sub":64&e?"sup":null}function fs(r,e){return 1&e?"strong":2&e?"em":"span"}function qu(r,e,t,n,s){const o=n.classList;let i=yr(s,"base");i!==void 0&&o.add(...i),i=yr(s,"underlineStrikethrough");let u=!1;const l=e&fn&&e&dn;i!==void 0&&(t&fn&&t&dn?(u=!0,l||o.add(...i)):l&&o.remove(...i));for(const a in St){const c=St[a];if(i=yr(s,a),i!==void 0)if(t&c){if(u&&(a==="underline"||a==="strikethrough")){e&c&&o.remove(...i);continue}e&c&&(!l||a!=="underline")&&a!=="strikethrough"||o.add(...i)}else e&c&&o.remove(...i)}}function zu(r,e,t){const n=e.firstChild,s=t.isComposing(),o=r+(s?Fn:"");if(n==null)e.textContent=o;else{const i=n.nodeValue;if(i!==o)if(s||pt){const[u,l,a]=function(c,f){const d=c.length,h=f.length;let p=0,g=0;for(;p<d&&p<h&&c[p]===f[p];)p++;for(;g+p<d&&g+p<h&&c[d-g-1]===f[h-g-1];)g++;return[p,d-p-g,f.slice(p,h-g)]}(i,o);l!==0&&n.deleteData(u,l),n.insertData(u,a)}else n.nodeValue=o}}function eo(r,e,t,n,s,o){zu(s,r,e);const i=o.theme.text;i!==void 0&&qu(0,0,n,r,i)}function Xr(r,e){const t=document.createElement(e);return t.appendChild(r),t}class Yt extends jn{static getType(){return"text"}static clone(e){return new Yt(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Ka[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===dt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=St[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return gn(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const n=this.__format,s=ds(0,n),o=fs(0,n),i=s===null?o:s,u=document.createElement(i);let l=u;this.hasFormat("code")&&u.setAttribute("spellcheck","false"),s!==null&&(l=document.createElement(o),u.appendChild(l)),eo(l,this,0,n,this.__text,e);const a=this.__style;return a!==""&&(u.style.cssText=a),u}updateDOM(e,t,n){const s=this.__text,o=e.__format,i=this.__format,u=ds(0,o),l=ds(0,i),a=fs(0,o),c=fs(0,i);if((u===null?a:u)!==(l===null?c:l))return!0;if(u===l&&a!==c){const g=t.firstChild;g==null&&F(48);const _=document.createElement(c);return eo(_,this,0,i,s,n),t.replaceChild(_,g),!1}let f=t;l!==null&&u!==null&&(f=t.firstChild,f==null&&F(49)),zu(s,f,this);const d=n.theme.text;d!==void 0&&o!==i&&qu(0,o,i,f,d);const h=e.__style,p=this.__style;return h!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:vc,priority:0}),b:()=>({conversion:_c,priority:0}),code:()=>({conversion:lt,priority:0}),em:()=>({conversion:lt,priority:0}),i:()=>({conversion:lt,priority:0}),s:()=>({conversion:lt,priority:0}),span:()=>({conversion:yc,priority:0}),strong:()=>({conversion:lt,priority:0}),sub:()=>({conversion:lt,priority:0}),sup:()=>({conversion:lt,priority:0}),u:()=>({conversion:lt,priority:0})}}static importJSON(e){const t=le(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&rt(t)||F(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Xr(t,"b")),this.hasFormat("italic")&&(t=Xr(t,"i")),this.hasFormat("strikethrough")&&(t=Xr(t,"s")),this.hasFormat("underline")&&(t=Xr(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?St[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?Ua[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=gn(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Va[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){xe();let n=e,s=t;const o=I(),i=this.getTextContent(),u=this.__key;if(typeof i=="string"){const l=i.length;n===void 0&&(n=l),s===void 0&&(s=l)}else n=0,s=0;if(!N(o))return Vu(u,n,u,s,"text","text");{const l=dt();l!==o.anchor.key&&l!==o.focus.key||de(u),o.setTextNodeRange(this,n,this,s)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,s){const o=this.getWritable(),i=o.__text,u=n.length;let l=e;l<0&&(l=u+l,l<0&&(l=0));const a=I();if(s&&N(a)){const f=e+u;a.setTextNodeRange(o,f,o,f)}const c=i.slice(0,l)+n+i.slice(l+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){xe();const t=this.getLatest(),n=t.getTextContent(),s=t.__key,o=dt(),i=new Set(e),u=[],l=n.length;let a="";for(let w=0;w<l;w++)a!==""&&i.has(w)&&(u.push(a),a=""),a+=n[w];a!==""&&u.push(a);const c=u.length;if(c===0)return[];if(u[0]===n)return[t];const f=u[0],d=t.getParent();let h;const p=t.getFormat(),g=t.getStyle(),_=t.__detail;let D=!1;t.isSegmented()?(h=le(f),h.__format=p,h.__style=g,h.__detail=_,D=!0):(h=t.getWritable(),h.__text=f);const y=I(),C=[h];let x=f.length;for(let w=1;w<c;w++){const b=u[w],k=b.length,A=le(b).getWritable();A.__format=p,A.__style=g,A.__detail=_;const S=A.__key,O=x+k;if(N(y)){const L=y.anchor,W=y.focus;L.key===s&&L.type==="text"&&L.offset>x&&L.offset<=O&&(L.key=S,L.offset-=x,y.dirty=!0),W.key===s&&W.type==="text"&&W.offset>x&&W.offset<=O&&(W.key=S,W.offset-=x,y.dirty=!0)}o===s&&de(S),x=O,C.push(A)}if(d!==null){(function(k){const A=k.getPreviousSibling(),S=k.getNextSibling();A!==null&&mn(A),S!==null&&mn(S)})(this);const w=d.getWritable(),b=this.getIndexWithinParent();D?(w.splice(b,0,C),this.remove()):w.splice(b,1,C),N(y)&&Cn(y,d,b,c-1)}return C}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||F(50);const n=this.__key,s=e.__key,o=this.__text,i=o.length;dt()===s&&de(n);const u=I();if(N(u)){const f=u.anchor,d=u.focus;f!==null&&f.key===s&&(co(f,t,n,e,i),u.dirty=!0),d!==null&&d.key===s&&(co(d,t,n,e,i),u.dirty=!0)}const l=e.__text,a=t?l+o:o+l;this.setTextContent(a);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function yc(r){return{forChild:ci(r.style),node:null}}function _c(r){const e=r,t=e.style.fontWeight==="normal";return{forChild:ci(e.style,t?void 0:"bold"),node:null}}const to=new WeakMap;function xc(r){return r.nodeName==="PRE"||r.nodeType===Fr&&r.style!==void 0&&r.style.whiteSpace!==void 0&&r.style.whiteSpace.startsWith("pre")}function vc(r){const e=r;r.parentElement===null&&F(129);let t=e.textContent||"";if(function(n){let s,o=n.parentNode;const i=[n];for(;o!==null&&(s=to.get(o))===void 0&&!xc(o);)i.push(o),o=o.parentNode;const u=s===void 0?o:s;for(let l=0;l<i.length;l++)to.set(i[l],u);return u}(e)!==null){const n=t.split(/(\r?\n|\t)/),s=[],o=n.length;for(let i=0;i<o;i++){const u=n[i];u===`
|
|
67
|
+
`||u===`\r
|
|
68
|
+
`?s.push(Bt()):u===" "?s.push(Mr()):u!==""&&s.push(le(u))}return{node:s}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let n=e,s=!0;for(;n!==null&&(n=ro(n,!1))!==null;){const o=n.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),s=!1;break}}s&&(t=t.slice(1))}if(t[t.length-1]===" "){let n=e,s=!0;for(;n!==null&&(n=ro(n,!0))!==null;)if((n.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){s=!1;break}s&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:le(t)}}function ro(r,e){let t=r;for(;;){let n;for(;(n=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=n,t.nodeType===Fr){const o=t.style.display;if(o===""&&!Ds(t)||o!==""&&!o.startsWith("inline"))return null}let s=t;for(;(s=e?t.firstChild:t.lastChild)!==null;)t=s;if(t.nodeType===mt)return t;if(t.nodeName==="BR")return null}}const bc={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function lt(r){const e=bc[r.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:ci(r.style,e),node:null}}function le(r=""){return Je(new Yt(r))}function P(r){return r instanceof Yt}function ci(r,e){const t=r.fontWeight,n=r.textDecoration.split(" "),s=t==="700"||t==="bold",o=n.includes("line-through"),i=r.fontStyle==="italic",u=n.includes("underline"),l=r.verticalAlign;return a=>(P(a)&&(s&&!a.hasFormat("bold")&&a.toggleFormat("bold"),o&&!a.hasFormat("strikethrough")&&a.toggleFormat("strikethrough"),i&&!a.hasFormat("italic")&&a.toggleFormat("italic"),u&&!a.hasFormat("underline")&&a.toggleFormat("underline"),l!=="sub"||a.hasFormat("subscript")||a.toggleFormat("subscript"),l!=="super"||a.hasFormat("superscript")||a.toggleFormat("superscript"),e&&!a.hasFormat(e)&&a.toggleFormat(e)),a)}class Rr extends Yt{static getType(){return"tab"}static clone(e){return new Rr(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Mr();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){F(126)}setDetail(e){F(127)}setMode(e){F(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Mr(){return Je(new Rr)}function Dc(r){return r instanceof Rr}class Cc{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const s=this.offset,o=e.offset;if(E(t)){const i=t.getDescendantByIndex(s);t=i??t}if(E(n)){const i=n.getDescendantByIndex(o);n=i??n}return t===n?s<o:t.isBefore(n)}getNode(){const e=fe(this.key);return e===null&&F(20),e}set(e,t,n){const s=this._selection,o=this.key;this.key=e,this.offset=t,this.type=n,Ir()||(dt()===o&&de(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0))}}function He(r,e,t){return new Cc(r,e,t)}function hs(r,e){let t=e.__key,n=r.offset,s="element";if(P(e)){s="text";const o=e.getTextContentSize();n>o&&(n=o)}else if(!E(e)){const o=e.getNextSibling();if(P(o))t=o.__key,n=0,s="text";else{const i=e.getParent();i&&(t=i.__key,n=e.getIndexWithinParent()+1)}}r.set(t,n,s)}function no(r,e){if(E(e)){const t=e.getLastDescendant();E(t)||P(t)?hs(r,t):hs(r,e)}else hs(r,e)}function ct(r,e,t,n){r.key=e,r.offset=t,r.type=n}class In{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ze(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(s=>n.has(s))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new In(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,s=t[n-1];let o;if(P(s))o=s.select();else{const i=s.getIndexWithinParent()+1;o=s.getParentOrThrow().select(i,i)}o.insertNodes(e);for(let i=0;i<n;i++)t[i].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,n=[];for(const s of t){const o=fe(s);o!==null&&n.push(o)}return Ir()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function N(r){return r instanceof yt}class yt{constructor(e,t,n,s){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!N(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,n=this.focus,s=t.isBefore(n),o=s?t:n,i=s?n:t;let u=o.getNode(),l=i.getNode();const a=o.offset,c=i.offset;if(E(u)){const d=u.getDescendantByIndex(a);u=d??u}if(E(l)){let d=l.getDescendantByIndex(c);d!==null&&d!==u&&l.getChildAtIndex(c)===d&&(d=d.getPreviousSibling()),l=d??l}let f;return f=u.is(l)?E(u)&&u.getChildrenSize()>0?[]:[u]:u.getNodesBetween(l),Ir()||(this._cachedNodes=f),f}setTextNodeRange(e,t,n,s){ct(this.anchor,e.__key,t,"text"),ct(this.focus,n.__key,s,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],n=e[e.length-1],s=this.anchor,o=this.focus,i=s.isBefore(o),[u,l]=Ps(this);let a="",c=!0;for(let f=0;f<e.length;f++){const d=e[f];if(E(d)&&!d.isInline())c||(a+=`
|
|
69
|
+
`),c=!d.isEmpty();else if(c=!1,P(d)){let h=d.getTextContent();d===t?d===n?s.type==="element"&&o.type==="element"&&o.offset!==s.offset||(h=u<l?h.slice(u,l):h.slice(l,u)):h=i?h.slice(u):h.slice(l):d===n&&(h=i?h.slice(0,l):h.slice(0,u)),a+=h}else!Y(d)&&!Et(d)||d===n&&this.isCollapsed()||(a+=d.getTextContent())}return a}applyDOMRange(e){const t=ee(),n=t.getEditorState()._selection,s=Wu(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(s===null)return;const[o,i]=s;ct(this.anchor,o.key,o.offset,o.type),ct(this.focus,i.key,i.offset,i.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new yt(He(e.key,e.offset,e.type),He(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=gn(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=St[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],s=t.length;for(let o=0;o<s;o++){const i=t[o];i===`
|
|
70
|
+
`||i===`\r
|
|
71
|
+
`?n.push(Bt()):i===" "?n.push(Mr()):n.push(le(i))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,s=this.format,o=this.style;let i=t,u=n;!this.isCollapsed()&&n.isBefore(t)&&(i=n,u=t),i.type==="element"&&function(_,D,y,C){const x=_.getNode(),w=x.getChildAtIndex(_.offset),b=le(),k=ge(x)?oe().append(b):b;b.setFormat(y),b.setStyle(C),w===null?x.append(k):w.insertBefore(k),_.is(D)&&D.set(b.__key,0,"text"),_.set(b.__key,0,"text")}(i,u,s,o);const l=i.offset;let a=u.offset;const c=this.getNodes(),f=c.length;let d=c[0];P(d)||F(26);const h=d.getTextContent().length,p=d.getParentOrThrow();let g=c[f-1];if(f===1&&u.type==="element"&&(a=h,u.set(i.key,a,"text")),this.isCollapsed()&&l===h&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(P(_)&&_.canInsertTextBefore()&&!Dt(_)||(_=le(),_.setFormat(s),_.setStyle(o),p.canInsertTextAfter()?d.insertAfter(_):p.insertAfter(_)),_.select(0,0),d=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&l===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(P(_)&&!Dt(_)||(_=le(),_.setFormat(s),p.canInsertTextBefore()?d.insertBefore(_):p.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&l!==h){const _=le(d.getTextContent());_.setFormat(s),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){const _=g.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||E(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Uu(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(d.isToken()){const C=le(e);return C.select(),void d.replace(C)}const _=d.getFormat(),D=d.getStyle();if(l!==a||_===s&&D===o){if(Dc(d)){const C=le(e);return C.setFormat(s),C.setStyle(o),C.select(),void d.replace(C)}}else{if(d.getTextContent()!==""){const C=le(e);if(C.setFormat(s),C.setStyle(o),C.select(),l===0)d.insertBefore(C,!1);else{const[x]=d.splitText(l);x.insertAfter(C,!1)}return void(C.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(s),d.setStyle(o)}const y=a-l;d=d.spliceText(l,y,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=D))}else{const _=new Set([...d.getParentKeys(),...g.getParentKeys()]),D=E(d)?d:d.getParentOrThrow();let y=E(g)?g:g.getParentOrThrow(),C=g;if(!D.is(y)&&y.isInline())do C=y,y=y.getParentOrThrow();while(y.isInline());if(u.type==="text"&&(a!==0||g.getTextContent()==="")||u.type==="element"&&g.getIndexWithinParent()<a)if(P(g)&&!g.isToken()&&a!==g.getTextContentSize()){if(g.isSegmented()){const A=le(g.getTextContent());g.replace(A),g=A}ge(u.getNode())||u.type!=="text"||(g=g.spliceText(0,a,"")),_.add(g.__key)}else{const A=g.getParentOrThrow();A.canBeEmpty()||A.getChildrenSize()!==1?g.remove():A.remove()}else _.add(g.__key);const x=y.getChildren(),w=new Set(c),b=D.is(y),k=D.isInline()&&d.getNextSibling()===null?D:d;for(let A=x.length-1;A>=0;A--){const S=x[A];if(S.is(d)||E(S)&&S.isParentOf(d))break;S.isAttached()&&(!w.has(S)||S.is(C)?b||k.insertAfter(S,!1):S.remove())}if(!b){let A=y,S=null;for(;A!==null;){const O=A.getChildren(),L=O.length;(L===0||O[L-1].is(S))&&(_.delete(A.__key),S=A),A=A.getParent()}}if(d.isToken())if(l===h)d.select();else{const A=le(e);A.select(),d.replace(A)}else d=d.spliceText(l,h-l,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let A=1;A<f;A++){const S=c[A],O=S.__key;_.has(O)||S.remove()}}}removeText(){if(this.isCollapsed())return;const{anchor:e,focus:t}=this,n=this.getNodes(),s=this.isBackward()?t:e,o=this.isBackward()?e:t;let i=s.getNode(),u=o.getNode();const l=ur(i,at),a=ur(u,at);P(i)&&i.isToken()&&s.offset<i.getTextContentSize()&&(s.offset=0),o.offset>0&&P(u)&&u.isToken()&&(o.offset=u.getTextContentSize()),n.forEach(f=>{_r(i,f)||_r(u,f)||f.getKey()===i.getKey()||f.getKey()===u.getKey()||f.remove()});const c=(f,d)=>{if(f.getTextContent()==="")f.remove();else if(d!==0&&Dt(f)){const h=le(f.getTextContent());return h.setFormat(f.getFormat()),h.setStyle(f.getStyle()),f.replace(h)}};if(i===u&&P(i)){const f=Math.abs(t.offset-e.offset);return i.spliceText(s.offset,f,"",!0),void c(i,f)}if(P(i)){const f=i.getTextContentSize()-s.offset;i.spliceText(s.offset,f,""),i=c(i,f)||i}P(u)&&(u.spliceText(0,o.offset,""),u=c(u,o.offset)||u),i.isAttached()&&P(i)?i.selectEnd():u.isAttached()&&P(u)&&u.selectStart(),E(l)&&E(a)&&l!==a&&(l.append(...a.getChildren()),a.remove(),o.set(s.key,s.offset,s.type))}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void de(null);const n=this.getNodes(),s=[];for(const x of n)P(x)&&s.push(x);const o=x=>{n.forEach(w=>{if(Qt(w)){const b=w.getFormatFlags(e,x);w.setTextFormat(b)}})},i=s.length;if(i===0)return this.toggleFormat(e),de(null),void o(t);const u=this.anchor,l=this.focus,a=this.isBackward(),c=a?l:u,f=a?u:l;let d=0,h=s[0],p=c.type==="element"?0:c.offset;if(c.type==="text"&&p===h.getTextContentSize()&&(d=1,h=s[1],p=0),h==null)return;const g=h.getFormatFlags(e,t);o(g);const _=i-1;let D=s[_];const y=f.type==="text"?f.offset:D.getTextContentSize();if(h.is(D)){if(p===y)return;if(Dt(h)||p===0&&y===h.getTextContentSize())h.setFormat(g);else{const x=h.splitText(p,y),w=p===0?x[0]:x[1];w.setFormat(g),c.type==="text"&&c.set(w.__key,0,"text"),f.type==="text"&&f.set(w.__key,y-p,"text")}return void(this.format=g)}p===0||Dt(h)||([,h]=h.splitText(p),p=0),h.setFormat(g);const C=D.getFormatFlags(e,g);y>0&&(y===D.getTextContentSize()||Dt(D)||([D]=D.splitText(y)),D.setFormat(C));for(let x=d+1;x<_;x++){const w=s[x],b=w.getFormatFlags(e,C);w.setFormat(b)}c.type==="text"&&c.set(h.__key,p,"text"),f.type==="text"&&f.set(D.__key,y,"text"),this.format=g|C}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const p=I();return N(p)||F(134),p.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),n=ur(t,at),s=e[e.length-1];if(E(n)&&"__language"in n){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const p=ps(this);n.splice(p,0,e),s.selectEnd()}return}if(!e.some(p=>(E(p)||Y(p))&&!p.isInline())){E(n)||F(211,t.constructor.name,t.getType());const p=ps(this);return n.splice(p,0,e),void s.selectEnd()}const o=function(p){const g=oe();let _=null;for(let D=0;D<p.length;D++){const y=p[D],C=Et(y);if(C||Y(y)&&y.isInline()||E(y)&&y.isInline()||P(y)||y.isParentRequired()){if(_===null&&(_=y.createParentElementNode(),g.append(_),C))continue;_!==null&&_.append(y)}else g.append(y),_=null}return g}(e),i=o.getLastDescendant(),u=o.getChildren(),l=!E(n)||!n.isEmpty()?this.insertParagraph():null,a=u[u.length-1];let c=u[0];var f;E(f=c)&&at(f)&&!f.isEmpty()&&E(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(E(n)||F(211,t.constructor.name,t.getType()),n.append(...c.getChildren()),c=u[1]),c&&(n===null&&F(212,t.constructor.name,t.getType()),function(p,g,_){const D=g.getParentOrThrow().getLastChild();let y=g;const C=[g];for(;y!==D;)y.getNextSibling()||F(140),y=y.getNextSibling(),C.push(y);let x=p;for(const w of C)x=x.insertAfter(w)}(n,c));const d=ur(i,at);l&&E(d)&&(l.canMergeWhenEmpty()||at(a))&&(d.append(...l.getChildren()),l.remove()),E(n)&&n.isEmpty()&&n.remove(),i.selectEnd();const h=E(n)?n.getLastChild():null;Et(h)&&d!==n&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const i=oe();return te().splice(this.anchor.offset,0,[i]),i.select(),i}const e=ps(this),t=ur(this.anchor.getNode(),at);E(t)||F(213);const n=t.getChildAtIndex(e),s=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...s),o.selectStart(),o):null}insertLineBreak(e){const t=Bt();if(this.insertNodes([t]),e){const n=t.getParentOrThrow(),s=t.getIndexWithinParent();n.select(s,s)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,s=this.anchor,o=this.focus;let i=e[0],u=e[n];const[l,a]=Ps(this);if(t===0)return[];if(t===1){if(P(i)&&!this.isCollapsed()){const f=l>a?a:l,d=l>a?l:a,h=i.splitText(f,d),p=f===0?h[0]:h[1];return p!=null?[p]:[]}return[i]}const c=s.isBefore(o);if(P(i)){const f=c?l:a;f===i.getTextContentSize()?e.shift():f!==0&&([,i]=i.splitText(f),e[0]=i)}if(P(u)){const f=u.getTextContent().length,d=c?a:l;d===0?e.pop():d!==f&&([u]=u.splitText(d),e[n]=u)}return e}modify(e,t,n){const s=this.focus,o=this.anchor,i=e==="move",u=Er(s,t);if(Y(u)&&!u.isIsolated()){if(i&&u.isKeyboardSelectable()){const h=lo();return h.add(u.__key),void Ve(h)}const d=t?u.getPreviousSibling():u.getNextSibling();if(P(d)){const h=d.__key,p=t?d.getTextContent().length:0;return s.set(h,p,"text"),void(i&&o.set(h,p,"text"))}{const h=u.getParentOrThrow();let p,g;return E(d)?(g=d.__key,p=t?d.getChildrenSize():0):(p=u.getIndexWithinParent(),g=h.__key,t||p++),s.set(g,p,"element"),void(i&&o.set(g,p,"element"))}}const l=ee(),a=Te(l._window);if(!a)return;const c=l._blockCursorElement,f=l._rootElement;if(f===null||c===null||!E(u)||u.isInline()||u.canBeEmpty()||ui(c,l,f),function(d,h,p,g){d.modify(h,p,g)}(a,e,t?"backward":"forward",n),a.rangeCount>0){const d=a.getRangeAt(0),h=this.anchor.getNode(),p=ge(h)?h:ic(h);if(this.applyDOMRange(d),this.dirty=!0,!i){const g=this.getNodes(),_=[];let D=!1;for(let y=0;y<g.length;y++){const C=g[y];_r(C,p)?_.push(C):D=!0}if(D&&_.length>0)if(t){const y=_[0];E(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=_[_.length-1];E(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}a.anchorNode===d.startContainer&&a.anchorOffset===d.startOffset||function(y){const C=y.focus,x=y.anchor,w=x.key,b=x.offset,k=x.type;ct(x,C.key,C.offset,C.type),ct(C,w,b,k),y._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&(e.type==="element"&&E(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const s=t.getParent(),o=t.getNextSibling()||(s===null?null:s.getNextSibling());if(E(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const n=this.anchor;let s=n.getNode();if(this.forwardDeletion(n,s,e))return;const o=this.focus,i=Er(o,e);if(Y(i)&&!i.isIsolated()){if(i.isKeyboardSelectable()&&E(s)&&s.getChildrenSize()===0){s.remove();const u=lo();u.add(i.__key),Ve(u)}else i.remove(),ee().dispatchCommand(zs,void 0);return}if(!e&&E(i)&&E(s)&&s.isEmpty())return s.remove(),void i.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&n.offset===0&&(n.type==="element"?n.getNode():n.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const u=o.type==="text"?o.getNode():null;if(s=n.type==="text"?n.getNode():null,u!==null&&u.isSegmented()){const l=o.offset,a=u.getTextContentSize();if(u.is(s)||e&&l!==a||!e&&l!==0)return void io(u,e,l)}else if(s!==null&&s.isSegmented()){const l=n.offset,a=s.getTextContentSize();if(s.is(u)||e&&l!==0||!e&&l!==a)return void io(s,e,l)}(function(l,a){const c=l.anchor,f=l.focus,d=c.getNode(),h=f.getNode();if(d===h&&c.type==="text"&&f.type==="text"){const p=c.offset,g=f.offset,_=p<g,D=_?p:g,y=_?g:p,C=y-1;D!==C&&(Cu(d.getTextContent().slice(D,y))||(a?f.offset=C:c.offset=C))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const n=this.anchor.getNode();n.isEmpty()&&ge(n.getParent())&&n.getIndexWithinParent()===0&&n.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),this.isCollapsed()&&this.anchor.offset===0&&this.modify("extend",e,"character"),t){const n=e?this.anchor:this.focus;n.set(n.key,n.offset+1,n.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ze(r){return r instanceof In}function so(r){const e=r.offset;if(r.type==="text")return e;const t=r.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Ps(r){const e=r.getStartEndPoints();if(e===null)return[0,0];const[t,n]=e;return t.type==="element"&&n.type==="element"&&t.key===n.key&&t.offset===n.offset?[0,0]:[so(t),so(n)]}function io(r,e,t){const n=r,s=n.getTextContent().split(/(?=\s)/g),o=s.length;let i=0,u=0;for(let a=0;a<o;a++){const c=a===o-1;if(u=i,i+=s[a].length,e&&i===t||i>t||c){s.splice(a,1),c&&(u=void 0);break}}const l=s.join("").trim();l===""?n.remove():(n.setTextContent(l),n.select(u,u))}function oo(r,e,t,n){let s,o=e;if(r.nodeType===Fr){let i=!1;const u=r.childNodes,l=u.length,a=n._blockCursorElement;o===l&&(i=!0,o=l-1);let c=u[o],f=!1;if(c===a)c=u[o+1],f=!0;else if(a!==null){const d=a.parentNode;r===d&&e>Array.prototype.indexOf.call(d.children,a)&&o--}if(s=zt(c),P(s))o=qi(s,i);else{let d=zt(r);if(d===null)return null;if(E(d)){const h=n.getElementByKey(d.getKey());h===null&&F(214),[d,o]=d.getDOMSlot(h).resolveChildIndex(d,h,r,e),E(d)||F(215),i&&o>=d.getChildrenSize()&&(o=Math.max(0,d.getChildrenSize()-1));let g=d.getChildAtIndex(o);if(E(g)&&function(_,D,y){const C=_.getParent();return y===null||C===null||!C.canBeEmpty()||C!==y.getNode()}(g,0,t)){const _=i?g.getLastDescendant():g.getFirstDescendant();_===null?d=g:(g=_,d=E(g)?g:g.getParentOrThrow()),o=0}P(g)?(s=g,d=null,o=qi(g,i)):g!==d&&i&&!f&&(E(d)||F(216),o=Math.min(d.getChildrenSize(),o+1))}else{const h=d.getIndexWithinParent();o=e===0&&Y(d)&&zt(r)===d?h:h+1,d=d.getParentOrThrow()}if(E(d))return He(d.__key,o,"element")}}else s=zt(r);return P(s)?He(s.__key,o,"text"):null}function uo(r,e,t){const n=r.offset,s=r.getNode();if(n===0){const o=s.getPreviousSibling(),i=s.getParent();if(e){if((t||!e)&&o===null&&E(i)&&i.isInline()){const u=i.getPreviousSibling();P(u)&&(r.key=u.__key,r.offset=u.getTextContent().length)}}else E(o)&&!t&&o.isInline()?(r.key=o.__key,r.offset=o.getChildrenSize(),r.type="element"):P(o)&&(r.key=o.__key,r.offset=o.getTextContent().length)}else if(n===s.getTextContent().length){const o=s.getNextSibling(),i=s.getParent();if(e&&E(o)&&o.isInline())r.key=o.__key,r.offset=0,r.type="element";else if((t||e)&&o===null&&E(i)&&i.isInline()&&!i.canInsertTextAfter()){const u=i.getNextSibling();P(u)&&(r.key=u.__key,r.offset=0)}}}function Uu(r,e,t){if(r.type==="text"&&e.type==="text"){const n=r.isBefore(e),s=r.is(e);uo(r,n,s),uo(e,!n,s),s&&(e.key=r.key,e.offset=r.offset,e.type=r.type);const o=ee();if(o.isComposing()&&o._compositionKey!==r.key&&N(t)){const i=t.anchor,u=t.focus;ct(r,i.key,i.offset,i.type),ct(e,u.key,u.offset,u.type)}}}function Wu(r,e,t,n,s,o){if(r===null||t===null||!Lr(s,r,t))return null;const i=oo(r,e,N(o)?o.anchor:null,s);if(i===null)return null;const u=oo(t,n,N(o)?o.focus:null,s);if(u===null)return null;if(i.type==="element"&&u.type==="element"){const l=zt(r),a=zt(t);if(Y(l)&&Y(a))return null}return Uu(i,u,o),[i,u]}function Os(r){return E(r)&&!r.isInline()}function Vu(r,e,t,n,s,o){const i=nt(),u=new yt(He(r,e,s),He(t,n,o),0,"");return u.dirty=!0,i._selection=u,u}function wc(){const r=He("root",0,"element"),e=He("root",0,"element");return new yt(r,e,0,"")}function lo(){return new In(new Set)}function di(r,e,t,n){const s=t._window;if(s===null)return null;const o=n||s.event,i=o?o.type:void 0,u=i==="selectionchange",l=!bs&&(u||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&o&&o.detail===3||i==="drop"||i===void 0);let a,c,f,d;if(N(r)&&!l)return r.clone();if(e===null)return null;if(a=e.anchorNode,c=e.focusNode,f=e.anchorOffset,d=e.focusOffset,u&&N(r)&&!Lr(t,a,c))return r.clone();const h=Wu(a,f,c,d,t,r);if(h===null)return null;const[p,g]=h;return new yt(p,g,N(r)?r.format:0,N(r)?r.style:"")}function I(){return nt()._selection}function jr(){return ee()._editorState._selection}function Cn(r,e,t,n=1){const s=r.anchor,o=r.focus,i=s.getNode(),u=o.getNode();if(!e.is(i)&&!e.is(u))return;const l=e.__key;if(r.isCollapsed()){const a=s.offset;if(t<=a&&n>0||t<a&&n<0){const c=Math.max(0,a+n);s.set(l,c,"element"),o.set(l,c,"element"),ao(r)}}else{const a=r.isBackward(),c=a?o:s,f=c.getNode(),d=a?s:o,h=d.getNode();if(e.is(f)){const p=c.offset;(t<=p&&n>0||t<p&&n<0)&&c.set(l,Math.max(0,p+n),"element")}if(e.is(h)){const p=d.offset;(t<=p&&n>0||t<p&&n<0)&&d.set(l,Math.max(0,p+n),"element")}}ao(r)}function ao(r){const e=r.anchor,t=e.offset,n=r.focus,s=n.offset,o=e.getNode(),i=n.getNode();if(r.isCollapsed()){if(!E(o))return;const u=o.getChildrenSize(),l=t>=u,a=l?o.getChildAtIndex(u-1):o.getChildAtIndex(t);if(P(a)){let c=0;l&&(c=a.getTextContentSize()),e.set(a.__key,c,"text"),n.set(a.__key,c,"text")}}else{if(E(o)){const u=o.getChildrenSize(),l=t>=u,a=l?o.getChildAtIndex(u-1):o.getChildAtIndex(t);if(P(a)){let c=0;l&&(c=a.getTextContentSize()),e.set(a.__key,c,"text")}}if(E(i)){const u=i.getChildrenSize(),l=s>=u,a=l?i.getChildAtIndex(u-1):i.getChildAtIndex(s);if(P(a)){let c=0;l&&(c=a.getTextContentSize()),n.set(a.__key,c,"text")}}}}function wn(r,e,t,n,s){let o=null,i=0,u=null;n!==null?(o=n.__key,P(n)?(i=n.getTextContentSize(),u="text"):E(n)&&(i=n.getChildrenSize(),u="element")):s!==null&&(o=s.__key,P(s)?u="text":E(s)&&(u="element")),o!==null&&u!==null?r.set(o,i,u):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),r.set(t.__key,i,"element"))}function co(r,e,t,n,s){r.type==="text"?(r.key=t,e||(r.offset+=s)):r.offset>n.getIndexWithinParent()&&(r.offset-=1)}function Ac(r,e,t,n,s,o,i){const u=n.anchorNode,l=n.focusNode,a=n.anchorOffset,c=n.focusOffset,f=document.activeElement;if(s.has("collaboration")&&f!==o||f!==null&&ti(f))return;if(!N(e))return void(r!==null&&Lr(t,u,l)&&n.removeAllRanges());const d=e.anchor,h=e.focus,p=d.key,g=h.key,_=yn(t,p),D=yn(t,g),y=d.offset,C=h.offset,x=e.format,w=e.style,b=e.isCollapsed();let k=_,A=D,S=!1;if(d.type==="text"){k=pn(_);const V=d.getNode();S=V.getFormat()!==x||V.getStyle()!==w}else N(r)&&r.anchor.type==="text"&&(S=!0);var O,L,W,q,$;if(h.type==="text"&&(A=pn(D)),k!==null&&A!==null&&(b&&(r===null||S||N(r)&&(r.format!==x||r.style!==w))&&(O=x,L=w,W=y,q=p,$=performance.now(),Ru=[O,L,W,q,$]),a!==y||c!==C||u!==k||l!==A||n.type==="Range"&&b||(f!==null&&o.contains(f)||o.focus({preventScroll:!0}),d.type==="element"))){try{n.setBaseAndExtent(k,y,A,C)}catch{}if(!s.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const V=e instanceof yt&&e.anchor.type==="element"?k.childNodes[y]||null:n.rangeCount>0?n.getRangeAt(0):null;if(V!==null){let re;if(V instanceof Text){const Ae=document.createRange();Ae.selectNode(V),re=Ae.getBoundingClientRect()}else re=V.getBoundingClientRect();(function(Ae,Me,_t){const it=_t.ownerDocument,ue=it.defaultView;if(ue===null)return;let{top:Be,bottom:je}=Me,ot=0,ut=0,ye=_t;for(;ye!==null;){const Qe=ye===it.body;if(Qe)ot=0,ut=Rn(Ae).innerHeight;else{const Ie=ye.getBoundingClientRect();ot=Ie.top,ut=Ie.bottom}let Ee=0;if(Be<ot?Ee=-(ot-Be):je>ut&&(Ee=je-ut),Ee!==0)if(Qe)ue.scrollBy(0,Ee);else{const Ie=ye.scrollTop;ye.scrollTop+=Ee;const Ye=ye.scrollTop-Ie;Be-=Ye,je-=Ye}if(Qe)break;ye=Pr(ye)}})(t,re,o)}}Ns=!0}}function Ec(r){let e=I()||jr();e===null&&(e=te().selectEnd()),e.insertNodes(r)}function ps(r){let e=r;r.isCollapsed()||e.removeText();const t=I();N(t)&&(e=t),N(e)||F(161);const n=e.anchor;let s=n.getNode(),o=n.offset;for(;!at(s);)[s,o]=kc(s,o);return o}function kc(r,e){const t=r.getParent();if(!t){const s=oe();return te().append(s),s.select(),[te(),0]}if(P(r)){const s=r.splitText(e);if(s.length===0)return[t,r.getIndexWithinParent()];const o=e===0?0:1;return[t,s[0].getIndexWithinParent()+o]}if(!E(r)||e===0)return[t,r.getIndexWithinParent()];const n=r.getChildAtIndex(e);if(n){const s=new yt(He(r.__key,e,"element"),He(r.__key,e,"element"),0,""),o=r.insertNewAfter(s);o&&o.append(n,...n.getNextSiblings())}return[t,r.getIndexWithinParent()+1]}let ae=null,ce=null,ve=!1,gs=!1,on=0;const fo={characterData:!0,childList:!0,subtree:!0};function Ir(){return ve||ae!==null&&ae._readOnly}function xe(){ve&&F(13)}function Ku(){on>99&&F(14)}function nt(){return ae===null&&F(195,Hu()),ae}function ee(){return ce===null&&F(196,Hu()),ce}function Hu(){let r=0;const e=new Set,t=qn.version;if(typeof window<"u")for(const s of document.querySelectorAll("[contenteditable]")){const o=Ln(s);if(ri(o))r++;else if(o){let i=String(o.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let n=` Detected on the page: ${r} compatible editor(s) with version ${t}`;return e.size&&(n+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),n}function Sc(){return ce}function ho(r,e,t){const n=e.__type,s=function(u,l){const a=u._nodes.get(l);return a===void 0&&F(30,l),a}(r,n);let o=t.get(n);o===void 0&&(o=Array.from(s.transforms),t.set(n,o));const i=o.length;for(let u=0;u<i&&(o[u](e),e.isAttached());u++);}function po(r,e){return r!==void 0&&r.__key!==e&&r.isAttached()}function Gu(r,e){if(!e)return;const t=r._updateTags;let n=e;Array.isArray(e)||(n=[e]);for(const s of n)t.add(s)}function Tc(r){return fi(r,ee()._nodes)}function fi(r,e){const t=r.type,n=e.get(t);n===void 0&&F(17,t);const s=n.klass;r.type!==s.getType()&&F(18,s.name);const o=s.importJSON(r),i=r.children;if(E(o)&&Array.isArray(i))for(let u=0;u<i.length;u++){const l=fi(i[u],e);o.append(l)}return o}function go(r,e,t){const n=ae,s=ve,o=ce;ae=e,ve=!0,ce=r;try{return t()}finally{ae=n,ve=s,ce=o}}function ft(r,e){const t=r._pendingEditorState,n=r._rootElement,s=r._headless||n===null;if(t===null)return;const o=r._editorState,i=o._selection,u=t._selection,l=r._dirtyType!==kt,a=ae,c=ve,f=ce,d=r._updating,h=r._observer;let p=null;if(r._pendingEditorState=null,r._editorState=t,!s&&l&&h!==null){ce=r,ae=t,ve=!1,r._updating=!0;try{const b=r._dirtyType,k=r._dirtyElements,A=r._dirtyLeaves;h.disconnect(),p=pc(o,t,r,b,k,A)}catch(b){if(b instanceof Error&&r._onError(b),gs)throw b;return Zu(r,null,n,t),mu(r),r._dirtyType=Gt,gs=!0,ft(r,o),void(gs=!1)}finally{h.observe(n,fo),r._updating=d,ae=a,ve=c,ce=f}}t._readOnly||(t._readOnly=!0);const g=r._dirtyLeaves,_=r._dirtyElements,D=r._normalizedNodes,y=r._updateTags,C=r._deferred;l&&(r._dirtyType=kt,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements=new Map,r._normalizedNodes=new Set,r._updateTags=new Set),function(b,k){const A=b._decorators;let S=b._pendingDecorators||A;const O=k._nodeMap;let L;for(L in S)O.has(L)||(S===A&&(S=bu(b)),delete S[L])}(r,t);const x=s?null:Te(r._window);if(r._editable&&x!==null&&(l||u===null||u.dirty)){ce=r,ae=t;try{if(h!==null&&h.disconnect(),l||u===null||u.dirty){const b=r._blockCursorElement;b!==null&&ui(b,r,n),Ac(i,u,r,x,y,n)}oc(r,n,u),h!==null&&h.observe(n,fo)}finally{ce=f,ae=a}}p!==null&&function(b,k,A,S,O){const L=Array.from(b._listeners.mutation),W=L.length;for(let q=0;q<W;q++){const[$,V]=L[q],re=k.get(V);re!==void 0&&$(re,{dirtyLeaves:S,prevEditorState:O,updateTags:A})}}(r,p,y,g,o),N(u)||u===null||i!==null&&i.is(u)||r.dispatchCommand(zs,void 0);const w=r._pendingDecorators;w!==null&&(r._decorators=w,r._pendingDecorators=null,br("decorator",r,!0,w)),function(b,k,A){const S=$i(k),O=$i(A);S!==O&&br("textcontent",b,!0,O)}(r,e||o,t),br("update",r,!0,{dirtyElements:_,dirtyLeaves:g,editorState:t,normalizedNodes:D,prevEditorState:e||o,tags:y}),function(b,k){if(b._deferred=[],k.length!==0){const A=b._updating;b._updating=!0;try{for(let S=0;S<k.length;S++)k[S]()}finally{b._updating=A}}}(r,C),function(b){const k=b._updates;if(k.length!==0){const A=k.shift();if(A){const[S,O]=A;Qu(b,S,O)}}}(r)}function br(r,e,t,...n){const s=e._updating;e._updating=t;try{const o=Array.from(e._listeners[r]);for(let i=0;i<o.length;i++)o[i].apply(null,n)}finally{e._updating=s}}function Ju(r,e,t){if(r._updating===!1||ce!==r){let s=!1;return r.update(()=>{s=Ju(r,e,t)}),s}const n=ni(r);for(let s=4;s>=0;s--)for(let o=0;o<n.length;o++){const i=n[o]._commands.get(e);if(i!==void 0){const u=i[s];if(u!==void 0){const l=Array.from(u),a=l.length;for(let c=0;c<a;c++)if(l[c](t,r)===!0)return!0}}}return!1}function mo(r,e){const t=r._updates;let n=e||!1;for(;t.length!==0;){const s=t.shift();if(s){const[o,i]=s;let u;if(i!==void 0){if(u=i.onUpdate,i.skipTransforms&&(n=!0),i.discrete){const l=r._pendingEditorState;l===null&&F(191),l._flushSync=!0}u&&r._deferred.push(u),Gu(r,i.tag)}o()}}return n}function Qu(r,e,t){const n=r._updateTags;let s,o=!1,i=!1;t!==void 0&&(s=t.onUpdate,Gu(r,t.tag),o=t.skipTransforms||!1,i=t.discrete||!1),s&&r._deferred.push(s);const u=r._editorState;let l=r._pendingEditorState,a=!1;(l===null||l._readOnly)&&(l=r._pendingEditorState=Yu(l||u),a=!0),l._flushSync=i;const c=ae,f=ve,d=ce,h=r._updating;ae=l,ve=!1,r._updating=!0,ce=r;try{a&&(r._headless?u._selection!==null&&(l._selection=u._selection.clone()):l._selection=function(D){const y=D.getEditorState()._selection,C=Te(D._window);return N(y)||y==null?di(y,C,D,null):y.clone()}(r));const g=r._compositionKey;e(),o=mo(r,o),function(D,y){const C=y.getEditorState()._selection,x=D._selection;if(N(x)){const w=x.anchor,b=x.focus;let k;if(w.type==="text"&&(k=w.getNode(),k.selectionTransform(C,x)),b.type==="text"){const A=b.getNode();k!==A&&A.selectionTransform(C,x)}}}(l,r),r._dirtyType!==kt&&(o?function(D,y){const C=y._dirtyLeaves,x=D._nodeMap;for(const w of C){const b=x.get(w);P(b)&&b.isAttached()&&b.isSimpleText()&&!b.isUnmergeable()&&ji(b)}}(l,r):function(D,y){const C=y._dirtyLeaves,x=y._dirtyElements,w=D._nodeMap,b=dt(),k=new Map;let A=C,S=A.size,O=x,L=O.size;for(;S>0||L>0;){if(S>0){y._dirtyLeaves=new Set;for(const W of A){const q=w.get(W);P(q)&&q.isAttached()&&q.isSimpleText()&&!q.isUnmergeable()&&ji(q),q!==void 0&&po(q,b)&&ho(y,q,k),C.add(W)}if(A=y._dirtyLeaves,S=A.size,S>0){on++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const W of O){const q=W[0],$=W[1];if(q!=="root"&&!$)continue;const V=w.get(q);V!==void 0&&po(V,b)&&ho(y,V,k),x.set(q,$)}A=y._dirtyLeaves,S=A.size,O=y._dirtyElements,L=O.size,on++}y._dirtyLeaves=C,y._dirtyElements=x}(l,r),mo(r),function(D,y,C,x){const w=D._nodeMap,b=y._nodeMap,k=[];for(const[A]of x){const S=b.get(A);S!==void 0&&(S.isAttached()||(E(S)&&ku(S,A,w,b,k,x),w.has(A)||x.delete(A),k.push(A)))}for(const A of k)b.delete(A);for(const A of C){const S=b.get(A);S===void 0||S.isAttached()||(w.has(A)||C.delete(A),b.delete(A))}}(u,l,r._dirtyLeaves,r._dirtyElements)),g!==r._compositionKey&&(l._flushSync=!0);const _=l._selection;if(N(_)){const D=l._nodeMap,y=_.anchor.key,C=_.focus.key;D.get(y)!==void 0&&D.get(C)!==void 0||F(19)}else ze(_)&&_._nodes.size===0&&(l._selection=null)}catch(g){return g instanceof Error&&r._onError(g),r._pendingEditorState=u,r._dirtyType=Gt,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements.clear(),void ft(r)}finally{ae=c,ve=f,ce=d,r._updating=h,on=0}r._dirtyType!==kt||function(g,_){const D=_.getEditorState()._selection,y=g._selection;if(y!==null){if(y.dirty||!y.is(D))return!0}else if(D!==null)return!0;return!1}(l,r)?l._flushSync?(l._flushSync=!1,ft(r)):a&&ec(()=>{ft(r)}):(l._flushSync=!1,a&&(n.clear(),r._deferred=[],r._pendingEditorState=null))}function Ce(r,e,t){r._updating?r._updates.push([e,t]):Qu(r,e,t)}class Dr{constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new Dr(this.element,e,this.after)}withAfter(e){return new Dr(this.element,this.before,e)}withElement(e){return new Dr(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&F(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&F(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&F(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(Nr||Nn);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,n=e.nodeName==="IMG"?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const n=this.element,s=this.before,o=document.createElement("br");if(n.insertBefore(o,s),e){const i=document.createElement("img");i.setAttribute("data-lexical-linebreak","true"),i.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",i.alt="",n.insertBefore(i,o),n.__lexicalLineBreak=i}else n.__lexicalLineBreak=o}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,s){if(n===this.element){const l=this.getFirstChildOffset();return[e,Math.min(l+e.getChildrenSize(),Math.max(l,s))]}const o=yo(t,n);o.push(s);const i=yo(t,this.element);let u=e.getIndexWithinParent();for(let l=0;l<i.length;l++){const a=o[l],c=i[l];if(a===void 0||a<c)break;if(a>c){u+=1;break}}return[e.getParentOrThrow(),u]}}function yo(r,e){const t=[];let n=e;for(;n!==r&&n!==null;n=e.parentNode){let s=0;for(let o=n.previousSibling;o!==null;o=n.previousSibling)s++;t.push(s)}return n!==r&&F(225),t.reverse()}class st extends jn{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Wa[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=ee()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(P(t)&&e.push(t),E(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;E(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;E(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const o=t[n-1];return E(o)&&o.getLastDescendant()||o||null}const s=t[e];return E(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:fe(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&F(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:fe(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&F(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,s;if(e<t/2){for(n=this.getFirstChild(),s=0;n!==null&&s<=e;){if(s===e)return n;n=n.getNextSibling(),s++}return null}for(n=this.getLastChild(),s=t-1;n!==null&&s>=e;){if(s===e)return n;n=n.getPreviousSibling(),s--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let s=0;s<n;s++){const o=t[s];e+=o.getTextContent(),E(o)&&s!==n-1&&!o.isInline()&&(e+=tt)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let s=0;s<n;s++){const o=t[s];e+=o.getTextContentSize(),E(o)&&s!==n-1&&!o.isInline()&&(e+=tt.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Oi[e];return!!(this.getFormat()&t)}return!1}select(e,t){xe();const n=I();let s=e,o=t;const i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const l=this.getFirstChild();if(P(l)||E(l))return l.select(0,0)}else if(!(e!==void 0&&e!==i||t!==void 0&&t!==i)){const l=this.getLastChild();if(P(l)||E(l))return l.select()}}s===void 0&&(s=i),o===void 0&&(o=i);const u=this.__key;return N(n)?(n.anchor.set(u,s,"element"),n.focus.set(u,o,"element"),n.dirty=!0,n):Vu(u,s,u,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Oi[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const s=n.length,o=this.getChildrenSize(),i=this.getWritable();e+t<=o||F(226,String(e),String(t),String(o));const u=i.__key,l=[],a=[],c=this.getChildAtIndex(e+t);let f=null,d=o-t+s;if(e!==0)if(e===o)f=this.getLastChild();else{const p=this.getChildAtIndex(e);p!==null&&(f=p.getPreviousSibling())}if(t>0){let p=f===null?this.getFirstChild():f.getNextSibling();for(let g=0;g<t;g++){p===null&&F(100);const _=p.getNextSibling(),D=p.__key;At(p.getWritable()),a.push(D),p=_}}let h=f;for(let p=0;p<s;p++){const g=n[p];h!==null&&g.is(h)&&(f=h=h.getPreviousSibling());const _=g.getWritable();_.__parent===u&&d--,At(_);const D=g.__key;if(h===null)i.__first=D,_.__prev=null;else{const y=h.getWritable();y.__next=D,_.__prev=y.__key}g.__key===u&&F(76),_.__parent=u,l.push(D),h=g}if(e+t===o)h!==null&&(h.getWritable().__next=null,i.__last=h.__key);else if(c!==null){const p=c.getWritable();if(h!==null){const g=h.getWritable();p.__prev=h.__key,g.__next=c.__key}else p.__prev=null}if(i.__size=d,a.length){const p=I();if(N(p)){const g=new Set(a),_=new Set(l),{anchor:D,focus:y}=p;_o(D,g,_)&&wn(D,D.getNode(),this,f,c),_o(y,g,_)&&wn(y,y.getNode(),this,f,c),d!==0||this.canBeEmpty()||Ke(this)||this.remove()}}return i}getDOMSlot(e){return new Dr(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&rt(t)){const n=this.getIndent();n>0&&(t.style.paddingInlineStart=40*n+"px")}return{element:t}}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=this.getDOMSlot(e);let s=n.getFirstChild();for(let o=this.getFirstChild();o;o=o.getNextSibling()){const i=t.getElementByKey(o.getKey());i!==null&&(s==null?(n.insertChild(i),s=i):s!==i&&n.replaceChild(i,s),s=s.nextSibling)}}}function E(r){return r instanceof st}function _o(r,e,t){let n=r.getNode();for(;n;){const s=n.__key;if(e.has(s)&&!t.has(s))return!0;n=n.getParent()}return!1}class Bc extends jn{constructor(e){super(e)}decorate(e,t){F(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Y(r){return r instanceof Bc}class $r extends st{static getType(){return"root"}static clone(){return new $r}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){F(51)}getTextContent(){const e=this.__cachedText;return!Ir()&&ee()._dirtyType!==kt||e===null?super.getTextContent():e}remove(){F(52)}replace(e){F(53)}insertBefore(e){F(54)}insertAfter(e){F(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];E(n)||Y(n)||F(56)}return super.append(...e)}static importJSON(e){const t=te();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function ge(r){return r instanceof $r}function Yu(r){return new $n(new Map(r._nodeMap))}function hi(){return new $n(new Map([["root",new $r]]))}function Xu(r){const e=r.exportJSON(),t=r.constructor;if(e.type!==t.getType()&&F(130,t.name),E(r)){const n=e.children;Array.isArray(n)||F(59,t.name);const s=r.getChildren();for(let o=0;o<s.length;o++){const i=Xu(s[o]);n.push(i)}}return e}class $n{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return go(t&&t.editor||null,this,e)}clone(e){const t=new $n(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return go(null,this,()=>({root:Xu(te())}))}}class pi extends st{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Xt extends st{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=St[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return gn(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Xt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=yr(e.theme,"paragraph");return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Nc,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&rt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=oe();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=oe();n.setTextFormat(e.format),n.setTextStyle(e.style);const s=this.getDirection();return n.setDirection(s),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(e.length===0||P(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Nc(r){const e=oe();return r.style&&(e.setFormat(r.style.textAlign),ai(r,e)),{node:e}}function oe(){return Je(new Xt)}function Qt(r){return r instanceof Xt}const J=0,Ut=1,Fc=4;function Zu(r,e,t,n){const s=r._keyToDOMMap;s.clear(),r._editorState=hi(),r._pendingEditorState=n,r._compositionKey=null,r._dirtyType=kt,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements.clear(),r._normalizedNodes=new Set,r._updateTags=new Set,r._updates=[],r._blockCursorElement=null;const o=r._observer;o!==null&&(o.disconnect(),r._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",s.set("root",t))}function Lc(r){const e=r||{},t=Sc(),n=e.theme||{},s=r===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,i=hi(),u=e.namespace||(s!==null?s._config.namespace:wu()),l=e.editorState,a=[$r,Yt,Or,Rr,Xt,pi,...e.nodes||[]],{onError:c,html:f}=e,d=e.editable===void 0||e.editable;let h;if(r===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let g=0;g<a.length;g++){let _=a[g],D=null,y=null;if(typeof _!="function"){const b=_;_=b.replace,D=b.with,y=b.withKlass||null}const C=_.getType(),x=_.transform(),w=new Set;x!==null&&w.add(x),h.set(C,{exportDOM:f&&f.export?f.export.get(_):void 0,klass:_,replace:D,replaceWithKlass:y,transforms:w})}}const p=new qn(i,s,h,{disableEvents:o,namespace:u,theme:n},c||console.error,function(g,_){const D=new Map,y=new Set,C=x=>{Object.keys(x).forEach(w=>{let b=D.get(w);b===void 0&&(b=[],D.set(w,b)),b.push(x[w])})};return g.forEach(x=>{const w=x.klass.importDOM;if(w==null||y.has(w))return;y.add(w);const b=w.call(x.klass);b!==null&&C(b)}),_&&C(_),D}(h,f?f.import:void 0),d);return l!==void 0&&(p._pendingEditorState=l,p._dirtyType=Gt),p}class qn{constructor(e,t,n,s,o,i,u){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=s,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=kt,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=wu(),this._onError=o,this._htmlConversions=i,this._editable=u,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){n===void 0&&F(35);const s=this._commands;s.has(e)||s.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=s.get(e);o===void 0&&F(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every(u=>u.size===0)&&s.delete(e)}}registerMutationListener(e,t,n){const s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,s);const i=n&&n.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(t,s),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&F(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,s=cc(n).get(t.getType());if(!s)return;const o=new Map;for(const i of s.keys())o.set(i,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),s=[n],o=n.replaceWithKlass;if(o!=null){const l=this.registerNodeTransformToKlass(o,t);s.push(l)}var i,u;return i=this,u=e.getType(),Ce(i,()=>{const l=nt();if(l.isEmpty())return;if(u==="root")return void te().markDirty();const a=l._nodeMap;for(const[,c]of a)c.markDirty()},i._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{s.forEach(l=>l.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return R(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=yr(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,Zu(this,t,e,s),t!==null&&(this._config.disableEvents||gc(t),n!=null&&t.classList.remove(...n)),e!==null){const o=function(u){const l=u.ownerDocument;return l&&l.defaultView||null}(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=Gt,mu(this),this._updateTags.add("history-merge"),ft(this),this._config.disableEvents||function(u,l){const a=u.ownerDocument,c=Dn.get(a);(c===void 0||c<1)&&a.addEventListener("selectionchange",$u),Dn.set(a,(c||0)+1),u.__lexicalEditor=l;const f=Iu(u);for(let d=0;d<Bs.length;d++){const[h,p]=Bs[d],g=typeof p=="function"?_=>{Zi(_)||(Xi(_),(l.isEditable()||h==="click")&&p(_,l))}:_=>{if(Zi(_))return;Xi(_);const D=l.isEditable();switch(h){case"cut":return D&&R(l,Vs,_);case"copy":return R(l,Bn,_);case"paste":return D&&R(l,Tn,_);case"dragstart":return D&&R(l,lu,_);case"dragover":return D&&R(l,au,_);case"dragend":return D&&R(l,ka,_);case"focus":return D&&R(l,Ba,_);case"blur":return D&&R(l,Na,_);case"drop":return D&&R(l,uu,_)}};u.addEventListener(h,g),f.push(()=>{u.removeEventListener(h,g)})}}(e,this),n!=null&&e.classList.add(...n)}else this._editorState=s,this._pendingEditorState=null,this._window=null;br("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&F(38);let n=e;n._readOnly&&(n=Yu(e),n._selection=e._selection?e._selection.clone():null),gu(this);const s=this._pendingEditorState,o=this._updateTags,i=t!==void 0?t.tag:null;s===null||s.isEmpty()||(i!=null&&o.add(i),ft(this)),this._pendingEditorState=n,this._dirtyType=Gt,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&o.add(i),this._updating||ft(this)}parseEditorState(e,t){return function(n,s,o){const i=hi(),u=ae,l=ve,a=ce,c=s._dirtyElements,f=s._dirtyLeaves,d=s._cloneNotNeeded,h=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,ae=i,ve=!1,ce=s;try{const p=s._nodes;fi(n.root,p),o&&o(),i._readOnly=!0}catch(p){p instanceof Error&&s._onError(p)}finally{s._dirtyElements=c,s._dirtyLeaves=f,s._cloneNotNeeded=d,s._dirtyType=h,ae=u,ve=l,ce=a}return i}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return ft(this),this.getEditorState().read(e,{editor:this})}update(e,t){Ce(this,e,t)}focus(e,t={}){const n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),Ce(this,()=>{const s=I(),o=te();s!==null?s.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Te(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,br("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}qn.version="0.21.0+prod.esm";const el=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Pc=el?T.useLayoutEffect:T.useEffect,Zr={tag:"history-merge"};function Oc({initialConfig:r,children:e}){const t=T.useMemo(()=>{const{theme:n,namespace:s,nodes:o,onError:i,editorState:u,html:l}=r,a=ya(null,n),c=Lc({editable:r.editable,html:l,namespace:s,nodes:o,onError:f=>i(f,c),theme:n});return function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=te();if(h.isEmpty()){const p=oe();h.append(p);const g=el?document.activeElement:null;(I()!==null||g!==null&&g===f.getRootElement())&&p.select()}},Zr);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Zr);break}case"object":f.setEditorState(d,Zr);break;case"function":f.update(()=>{te().isEmpty()&&d(f)},Zr)}}}(c,u),[c,a]},[]);return Pc(()=>{const n=r.editable,[s]=t;s.setEditable(n===void 0||n)},[]),v.jsx(Xo.Provider,{value:t,children:e})}const Rc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function Mc(r){return{initialValueFn:()=>r.isEditable(),subscribe:e=>r.registerEditableListener(e)}}function jc(){return function(r){const[e]=Ge(),t=T.useMemo(()=>r(e),[e,r]),[n,s]=T.useState(()=>t.initialValueFn()),o=T.useRef(n);return Rc(()=>{const{initialValueFn:i,subscribe:u}=t,l=i();return o.current!==l&&(o.current=l,s(l)),u(a=>{o.current=a,s(a)})},[t,r]),n}(Mc)}function Ic(){return te().getTextContent()}function $c(r,e=!0){if(r)return!1;let t=Ic();return e&&(t=t.trim()),t===""}function qc(r){if(!$c(r,!1))return!1;const e=te().getChildren(),t=e.length;if(t>1)return!1;for(let n=0;n<t;n++){const s=e[n];if(Y(s))return!1;if(E(s)){if(!Qt(s)||s.__indent!==0)return!1;const o=s.getChildren(),i=o.length;for(let u=0;u<i;u++){const l=o[n];if(!P(l))return!1}}}return!0}function tl(r){return()=>qc(r)}function zc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}zc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Uc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Wc=Uc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Vc=new Map;function Kc(r){const e={};if(!r)return e;const t=r.split(";");for(const n of t)if(n!==""){const[s,o]=n.split(/:([^]+)/);s&&o&&(e[s.trim()]=o.trim())}return e}function rl(r,e){const t=r.getStartEndPoints();if(e.isSelected(r)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[n,s]=t,o=r.isBackward(),i=n.getNode(),u=s.getNode(),l=e.is(i),a=e.is(u);if(l||a){const[c,f]=Ps(r),d=i.is(u),h=e.is(o?u:i),p=e.is(o?i:u);let g,_=0;return d?(_=c>f?f:c,g=c>f?c:f):h?(_=o?f:c,g=void 0):p&&(_=0,g=o?c:f),e.__text=e.__text.slice(_,g),e}}return e}function Hc(r){const e=r.getStyle(),t=Kc(e);Vc.set(e,t)}function Gc(r,e){if(r===null)return;const t=r.getStartEndPoints(),n=t?t[0]:null;if(n!==null&&n.key==="root"){const i=e(),u=te(),l=u.getFirstChild();return void(l?l.replace(i,!0):u.append(i))}const s=r.getNodes(),o=n!==null&&function(i,u){let l=i;for(;l!==null&&l.getParent()!==null&&!u(l);)l=l.getParentOrThrow();return u(l)?l:null}(n.getNode(),bo);o&&s.indexOf(o)===-1&&s.push(o);for(let i=0;i<s.length;i++){const u=s[i];if(!bo(u))continue;E(u)||Wc(178);const l=e();l.setFormat(u.getFormatType()),l.setIndent(u.getIndent()),u.replace(l,!0)}}function xo(r,e){const t=Er(r.focus,e);return Y(t)&&!t.isIsolated()||E(t)&&!t.isInline()&&!t.canBeEmpty()}function Jc(r,e,t,n){r.modify(e?"extend":"move",t,n)}function Qc(r){const e=r.anchor.getNode();return(ge(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function vo(r,e,t){const n=Qc(r);Jc(r,e,t?!n:n,"character")}function bo(r){if(Y(r)||!E(r)||Ke(r))return!1;const e=r.getFirstChild(),t=e===null||Et(e)||P(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function Yc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Xc=Yc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const nl=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Zc=nl&&"documentMode"in document?document.documentMode:null;!(!nl||!("InputEvent"in window)||Zc)&&"getTargetRanges"in new window.InputEvent("input");function sl(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}function Ft(...r){return()=>{for(let e=r.length-1;e>=0;e--)r[e]();r.length=0}}function qr(r,...e){const t=sl(...e);t.length>0&&r.classList.add(...t)}function il(r,...e){const t=sl(...e);t.length>0&&r.classList.remove(...t)}function ed(r,e){let t=r;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function td(r){const e=zn(r,t=>E(t)&&!t.isInline());return E(e)||Xc(4,r.__key),e}const zn=(r,e)=>{let t=r;for(;t!==te()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function ht(r,e){return r!==null&&Object.getPrototypeOf(r).constructor.name===e.name}function rd(r){const e=window.location.origin,t=n=>{if(n.origin!==e)return;const s=r.getRootElement();if(document.activeElement!==s)return;const o=n.data;if(typeof o=="string"){let i;try{i=JSON.parse(o)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){const u=i.payload;if(u&&u.functionId==="makeChanges"){const l=u.args;if(l){const[a,c,f,d,h,p]=l;r.update(()=>{const g=I();if(N(g)){const _=g.anchor;let D=_.getNode(),y=0,C=0;if(P(D)&&a>=0&&c>=0&&(y=a,C=a+c,g.setTextNodeRange(D,y,D,C)),y===C&&f===""||(g.insertRawText(f),D=_.getNode()),P(D)){y=d,C=d+h;const x=D.getTextContentSize();y=y>x?x:y,C=C>x?x:C,g.setTextNodeRange(D,y,D,C)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function ol(r,e){const t=e.body?e.body.childNodes:[];let n=[];const s=[];for(let o=0;o<t.length;o++){const i=t[o];if(!al.has(i.nodeName)){const u=cl(i,r,s,!1);u!==null&&(n=n.concat(u))}}return function(o){for(const i of o)i.getNextSibling()instanceof pi&&i.insertAfter(Bt());for(const i of o){const u=i.getChildren();for(const l of u)i.insertBefore(l);i.remove()}}(s),n}function ul(r,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),n=te().getChildren();for(let s=0;s<n.length;s++)ll(r,n[s],t,e);return t.innerHTML}function ll(r,e,t,n=null){let s=n===null||e.isSelected(n);const o=E(e)&&e.excludeFromCopy("html");let i=e;if(n!==null){let h=li(e);h=P(h)&&n!==null?rl(n,h):h,i=h}const u=E(i)?i.getChildren():[],l=r._nodes.get(i.getType());let a;a=l&&l.exportDOM!==void 0?l.exportDOM(r,i):i.exportDOM(r);const{element:c,after:f}=a;if(!c)return!1;const d=document.createDocumentFragment();for(let h=0;h<u.length;h++){const p=u[h],g=ll(r,p,d,n);!s&&E(e)&&g&&e.extractWithChild(p,n,"html")&&(s=!0)}if(s&&!o){if((rt(c)||Hi(c))&&c.append(d),t.append(c),f){const h=f.call(i,c);h&&(Hi(c)?c.replaceChildren(h):c.replaceWith(h))}}else t.append(d);return s}const al=new Set(["STYLE","SCRIPT"]);function cl(r,e,t,n,s=new Map,o){let i=[];if(al.has(r.nodeName))return i;let u=null;const l=function(p,g){const{nodeName:_}=p,D=g._htmlConversions.get(_.toLowerCase());let y=null;if(D!==void 0)for(const C of D){const x=C(p);x!==null&&(y===null||(y.priority||0)<=(x.priority||0))&&(y=x)}return y!==null?y.conversion:null}(r,e),a=l?l(r):null;let c=null;if(a!==null){c=a.after;const p=a.node;if(u=Array.isArray(p)?p[p.length-1]:p,u!==null){for(const[,g]of s)if(u=g(u,o),!u)break;u&&i.push(...Array.isArray(p)?p:[u])}a.forChild!=null&&s.set(r.nodeName,a.forChild)}const f=r.childNodes;let d=[];const h=(u==null||!Ke(u))&&(u!=null&&Os(u)||n);for(let p=0;p<f.length;p++)d.push(...cl(f[p],e,t,h,new Map(s),u));return c!=null&&(d=c(d)),_n(r)&&(d=nd(r,d,h?()=>{const p=new pi;return t.push(p),p}:oe)),u==null?d.length>0?i=i.concat(d):_n(r)&&function(p){return p.nextSibling==null||p.previousSibling==null?!1:Ds(p.nextSibling)&&Ds(p.previousSibling)}(r)&&(i=i.concat(Bt())):E(u)&&u.append(...d),i}function nd(r,e,t){const n=r.style.textAlign,s=[];let o=[];for(let i=0;i<e.length;i++){const u=e[i];if(Os(u))n&&!u.getFormat()&&u.setFormat(n),s.push(u);else if(o.push(u),i===e.length-1||i<e.length-1&&Os(e[i+1])){const l=t();l.setFormat(n),l.append(...o),s.push(l),o=[]}}return s}function sd(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var An=sd(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function id(r,e=I()){return e==null&&An(166),N(e)&&e.isCollapsed()||e.getNodes().length===0?"":ul(r,e)}function od(r,e=I()){return e==null&&An(166),N(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(ud(r,e))}function Do(r,e,t){const n=r.getData("application/x-lexical-editor");if(n)try{const i=JSON.parse(n);if(i.namespace===t._config.namespace&&Array.isArray(i.nodes))return Co(t,ld(i.nodes),e)}catch{}const s=r.getData("text/html");if(s)try{const i=new DOMParser().parseFromString(function(u){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:l=>l}).createHTML(u):u}(s),"text/html");return Co(t,ol(t,i),e)}catch{}const o=r.getData("text/plain")||r.getData("text/uri-list");if(o!=null)if(N(e)){const i=o.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let u=0;u<i.length;u++){const l=I();if(N(l)){const a=i[u];a===`
|
|
72
|
+
`||a===`\r
|
|
73
|
+
`?l.insertParagraph():a===" "?l.insertNodes([Mr()]):l.insertText(a)}}}else e.insertRawText(o)}function Co(r,e,t){r.dispatchCommand(_a,{nodes:e,selection:t})||t.insertNodes(e)}function dl(r,e,t,n=[]){let s=e===null||t.isSelected(e);const o=E(t)&&t.excludeFromCopy("html");let i=t;if(e!==null){let a=li(t);a=P(a)&&e!==null?rl(e,a):a,i=a}const u=E(i)?i.getChildren():[],l=function(a){const c=a.exportJSON(),f=a.constructor;if(c.type!==f.getType()&&An(58,f.name),E(a)){const d=c.children;Array.isArray(d)||An(59,f.name)}return c}(i);if(P(i)){const a=i.__text;a.length>0?l.text=a:s=!1}for(let a=0;a<u.length;a++){const c=u[a],f=dl(r,e,c,l.children);!s&&E(t)&&f&&t.extractWithChild(c,e,"clone")&&(s=!0)}if(s&&!o)n.push(l);else if(Array.isArray(l.children))for(let a=0;a<l.children.length;a++){const c=l.children[a];n.push(c)}return s}function ud(r,e){const t=[],n=te().getChildren();for(let s=0;s<n.length;s++)dl(r,e,n[s],t);return{namespace:r._config.namespace,nodes:t}}function ld(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t],s=Tc(n);P(s)&&Hc(s),e.push(s)}return e}let It=null;async function wo(r,e,t){if(It!==null)return!1;if(e!==null)return new Promise((l,a)=>{r.update(()=>{l(Ao(r,e,t))})});const n=r.getRootElement(),s=r._window==null?window.document:r._window.document,o=Te(r._window);if(n===null||o===null)return!1;const i=s.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(s.createTextNode("#")),n.append(i);const u=new Range;return u.setStart(i,0),u.setEnd(i,1),o.removeAllRanges(),o.addRange(u),new Promise((l,a)=>{const c=r.registerCommand(Bn,f=>(ht(f,ClipboardEvent)&&(c(),It!==null&&(window.clearTimeout(It),It=null),l(Ao(r,f,t))),!0),Fc);It=window.setTimeout(()=>{c(),It=null,l(!1)},50),s.execCommand("copy"),i.remove()})}function Ao(r,e,t){if(t===void 0){const s=Te(r._window);if(!s)return!1;const o=s.anchorNode,i=s.focusNode;if(o!==null&&i!==null&&!Lr(r,o,i))return!1;const u=I();if(u===null)return!1;t=cd(u)}e.preventDefault();const n=e.clipboardData;return n!==null&&(dd(n,t),!0)}const ad=[["text/html",id],["application/x-lexical-editor",od]];function cd(r=I()){const e={"text/plain":r?r.getTextContent():""};if(r){const t=lc();for(const[n,s]of ad){const o=s(t,r);o!==null&&(e[n]=o)}}return e}function dd(r,e){for(const t in e){const n=e[t];n!==void 0&&r.setData(t,n)}}function Eo(r,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(r,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(r,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const Zt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,fd=Zt&&"documentMode"in document?document.documentMode:null,hd=!(!Zt||!("InputEvent"in window)||fd)&&"getTargetRanges"in new window.InputEvent("input"),pd=Zt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ko=Zt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,gd=Zt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),md=Zt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!gd,So=Br();class Un extends st{static getType(){return"quote"}static clone(e){return new Un(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return qr(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:yd,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&rt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=gi();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=oe(),s=this.getDirection();return n.setDirection(s),this.insertAfter(n,t),n}collapseAtStart(){const e=oe();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function gi(){return Je(new Un)}class Wn extends st{static getType(){return"heading"}static clone(e){return new Wn(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),s=e.theme.heading;if(s!==void 0){const o=s[t];qr(n,o)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:$t,priority:0}),h2:e=>({conversion:$t,priority:0}),h3:e=>({conversion:$t,priority:0}),h4:e=>({conversion:$t,priority:0}),h5:e=>({conversion:$t,priority:0}),h6:e=>({conversion:$t,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&To(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>To(e)?{conversion:t=>({node:hr("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&rt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=hr(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,s=this.getLastDescendant(),o=!s||e&&e.anchor.key===s.getKey()&&n===s.getTextContentSize()||!e?oe():hr(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,t),n===0&&!this.isEmpty()&&e){const u=oe();u.select(),this.replace(u,!0)}return o}collapseAtStart(){const e=this.isEmpty()?oe():hr(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function To(r){return r.nodeName.toLowerCase()==="span"&&r.style.fontSize==="26pt"}function $t(r){const e=r.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=hr(e),r.style!==null&&(ai(r,t),t.setFormat(r.style.textAlign))),{node:t}}function yd(r){const e=gi();return r.style!==null&&(e.setFormat(r.style.textAlign),ai(r,e)),{node:e}}function hr(r){return Je(new Wn(r))}function en(r){let e=null;if(ht(r,DragEvent)?e=r.dataTransfer:ht(r,ClipboardEvent)&&(e=r.clipboardData),e===null)return[!1,[],!1];const t=e.types,n=t.includes("Files"),s=t.includes("text/html")||t.includes("text/plain");return[n,Array.from(e.files),s]}function Bo(r){const e=I();if(!N(e))return!1;const t=new Set,n=e.getNodes();for(let s=0;s<n.length;s++){const o=n[s],i=o.getKey();if(t.has(i))continue;const u=zn(o,a=>E(a)&&!a.isInline());if(u===null)continue;const l=u.getKey();u.canIndent()&&!t.has(l)&&(t.add(l),r(u))}return t.size>0}function tn(r){const e=Jt(r);return Y(e)}function _d(r){return Ft(r.registerCommand(Zo,e=>{const t=I();return!!ze(t)&&(t.clear(),!0)},0),r.registerCommand(wt,e=>{const t=I();return!!N(t)&&(t.deleteCharacter(e),!0)},J),r.registerCommand(wr,e=>{const t=I();return!!N(t)&&(t.deleteWord(e),!0)},J),r.registerCommand(Ar,e=>{const t=I();return!!N(t)&&(t.deleteLine(e),!0)},J),r.registerCommand(Vt,e=>{const t=I();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const n=e.dataTransfer;if(n!=null)Do(n,t,r);else if(N(t)){const s=e.data;return s&&t.insertText(s),!0}}return!0},J),r.registerCommand(xs,()=>{const e=I();return!!N(e)&&(e.removeText(),!0)},J),r.registerCommand(Pe,e=>{const t=I();return!!N(t)&&(t.formatText(e),!0)},J),r.registerCommand(Ea,e=>{const t=I();if(!N(t)&&!ze(t))return!1;const n=t.getNodes();for(const s of n){const o=zn(s,i=>E(i)&&!i.isInline());o!==null&&o.setFormat(e)}return!0},J),r.registerCommand(Wt,e=>{const t=I();return!!N(t)&&(t.insertLineBreak(e),!0)},J),r.registerCommand(Cr,()=>{const e=I();return!!N(e)&&(e.insertParagraph(),!0)},J),r.registerCommand(wa,()=>(Ec([Mr()]),!0),J),r.registerCommand(Aa,()=>Bo(e=>{const t=e.getIndent();e.setIndent(t+1)}),J),r.registerCommand(Pi,()=>Bo(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),J),r.registerCommand(ru,e=>{const t=I();if(ze(t)&&!tn(e.target)){const n=t.getNodes();if(n.length>0)return n[0].selectPrevious(),!0}else if(N(t)){const n=Er(t.focus,!0);if(!e.shiftKey&&Y(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},J),r.registerCommand(nu,e=>{const t=I();if(ze(t)){const n=t.getNodes();if(n.length>0)return n[0].selectNext(0,0),!0}else if(N(t)){if(function(s){const o=s.focus;return o.key==="root"&&o.offset===te().getChildrenSize()}(t))return e.preventDefault(),!0;const n=Er(t.focus,!1);if(!e.shiftKey&&Y(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1},J),r.registerCommand(tu,e=>{const t=I();if(ze(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!N(t))return!1;if(xo(t,!0)){const n=e.shiftKey;return e.preventDefault(),vo(t,n,!0),!0}return!1},J),r.registerCommand(eu,e=>{const t=I();if(ze(t)&&!tn(e.target)){const s=t.getNodes();if(s.length>0)return e.preventDefault(),s[0].selectNext(0,0),!0}if(!N(t))return!1;const n=e.shiftKey;return!!xo(t,!1)&&(e.preventDefault(),vo(t,n,!1),!0)},J),r.registerCommand(su,e=>{if(tn(e.target))return!1;const t=I();if(!N(t))return!1;const{anchor:n}=t,s=n.getNode();return t.isCollapsed()&&n.offset===0&&!ge(s)&&td(s).getIndent()>0?(e.preventDefault(),r.dispatchCommand(Pi,void 0)):(!ko||navigator.language!=="ko-KR")&&(e.preventDefault(),r.dispatchCommand(wt,!0))},J),r.registerCommand(ou,e=>{if(tn(e.target))return!1;const t=I();return!!N(t)&&(e.preventDefault(),r.dispatchCommand(wt,!1))},J),r.registerCommand(an,e=>{const t=I();if(!N(t))return!1;if(e!==null){if((ko||pd||md)&&hd)return!1;if(e.preventDefault(),e.shiftKey)return r.dispatchCommand(Wt,!1)}return r.dispatchCommand(Cr,void 0)},J),r.registerCommand(iu,()=>{const e=I();return!!N(e)&&(r.blur(),!0)},J),r.registerCommand(uu,e=>{const[,t]=en(e);if(t.length>0){const s=Eo(e.clientX,e.clientY);if(s!==null){const{offset:o,node:i}=s,u=Jt(i);if(u!==null){const l=wc();if(P(u))l.anchor.set(u.getKey(),o,"text"),l.focus.set(u.getKey(),o,"text");else{const c=u.getParentOrThrow().getKey(),f=u.getIndexWithinParent()+1;l.anchor.set(c,f,"element"),l.focus.set(c,f,"element")}const a=yu(l);Ve(a)}r.dispatchCommand(So,t)}return e.preventDefault(),!0}const n=I();return!!N(n)},J),r.registerCommand(lu,e=>{const[t]=en(e),n=I();return!(t&&!N(n))},J),r.registerCommand(au,e=>{const[t]=en(e),n=I();if(t&&!N(n))return!1;const s=Eo(e.clientX,e.clientY);if(s!==null){const o=Jt(s.node);Y(o)&&e.preventDefault()}return!0},J),r.registerCommand(vs,()=>(sc(),!0),J),r.registerCommand(Bn,e=>(wo(r,ht(e,ClipboardEvent)?e:null),!0),J),r.registerCommand(Vs,e=>(async function(t,n){await wo(n,ht(t,ClipboardEvent)?t:null),n.update(()=>{const s=I();N(s)?s.removeText():ze(s)&&s.getNodes().forEach(o=>o.remove())})}(e,r),!0),J),r.registerCommand(Tn,e=>{const[,t,n]=en(e);return t.length>0&&!n?(r.dispatchCommand(So,t),!0):ti(e.target)?!1:I()!==null&&(function(s,o){s.preventDefault(),o.update(()=>{const i=I(),u=ht(s,InputEvent)||ht(s,KeyboardEvent)?null:s.clipboardData;u!=null&&i!==null&&Do(u,i,o)},{tag:"paste"})}(e,r),!0)},J))}const Rs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function No(r){return r.getEditorState().read(tl(r.isComposing()))}function xd({contentEditable:r,placeholder:e=null,ErrorBoundary:t}){const[n]=Ge(),s=function(o,i){const[u,l]=T.useState(()=>o.getDecorators());return Rs(()=>o.registerDecoratorListener(a=>{wi.flushSync(()=>{l(a)})}),[o]),T.useEffect(()=>{l(o.getDecorators())},[o]),T.useMemo(()=>{const a=[],c=Object.keys(u);for(let f=0;f<c.length;f++){const d=c[f],h=v.jsx(i,{onError:g=>o._onError(g),children:v.jsx(T.Suspense,{fallback:null,children:u[d]})}),p=o.getElementByKey(d);p!==null&&a.push(wi.createPortal(h,p,d))}return a},[i,u,o])}(n,t);return function(o){Rs(()=>Ft(_d(o),rd(o)),[o])}(n),v.jsxs(v.Fragment,{children:[r,v.jsx(vd,{content:e}),s]})}function vd({content:r}){const[e]=Ge(),t=function(s){const[o,i]=T.useState(()=>No(s));return Rs(()=>{function u(){const l=No(s);i(l)}return u(),Ft(s.registerUpdateListener(()=>{u()}),s.registerEditableListener(()=>{u()}))},[s]),o}(e),n=jc();return t?typeof r=="function"?r(n):r:null}const fl=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function bd({editor:r,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:s,ariaErrorMessage:o,ariaExpanded:i,ariaInvalid:u,ariaLabel:l,ariaLabelledBy:a,ariaMultiline:c,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:p,id:g,role:_="textbox",spellCheck:D=!0,style:y,tabIndex:C,"data-testid":x,...w},b){const[k,A]=T.useState(r.isEditable()),S=T.useCallback(L=>{L&&L.ownerDocument&&L.ownerDocument.defaultView?r.setRootElement(L):r.setRootElement(null)},[r]),O=T.useMemo(()=>function(...L){return W=>{L.forEach(q=>{typeof q=="function"?q(W):q!=null&&(q.current=W)})}}(b,S),[S,b]);return fl(()=>(A(r.isEditable()),r.registerEditableListener(L=>{A(L)})),[r]),v.jsx("div",{"aria-activedescendant":k?e:void 0,"aria-autocomplete":k?t:"none","aria-controls":k?n:void 0,"aria-describedby":s,...o!=null?{"aria-errormessage":o}:{},"aria-expanded":k&&_==="combobox"?!!i:void 0,...u!=null?{"aria-invalid":u}:{},"aria-label":l,"aria-labelledby":a,"aria-multiline":c,"aria-owns":k?f:void 0,"aria-readonly":!k||void 0,"aria-required":d,autoCapitalize:h,className:p,contentEditable:k,"data-testid":x,id:g,ref:O,role:k?_:void 0,spellCheck:D,style:y,tabIndex:C,...w})}const Dd=T.forwardRef(bd);function Fo(r){return r.getEditorState().read(tl(r.isComposing()))}const Cd=T.forwardRef(wd);function wd(r,e){const{placeholder:t,...n}=r,[s]=Ge();return v.jsxs(v.Fragment,{children:[v.jsx(Dd,{editor:s,...n,ref:e}),t!=null&&v.jsx(Ad,{editor:s,content:t})]})}function Ad({content:r,editor:e}){const t=function(i){const[u,l]=T.useState(()=>Fo(i));return fl(()=>{function a(){const c=Fo(i);l(c)}return a(),Ft(i.registerUpdateListener(()=>{a()}),i.registerEditableListener(()=>{a()}))},[i]),u}(e),[n,s]=T.useState(e.isEditable());if(T.useLayoutEffect(()=>(s(e.isEditable()),e.registerEditableListener(i=>{s(i)})),[e]),!t)return null;let o=null;return typeof r=="function"?o=r(n):r!==null&&(o=r),o===null?null:v.jsx("div",{"aria-hidden":!0,children:o})}const rn=0,Ms=1,js=2,Le=0,Ed=1,Lo=2,kd=3,Sd=4;function Td(r,e,t,n,s){if(r===null||t.size===0&&n.size===0&&!s)return Le;const o=e._selection,i=r._selection;if(s)return Ed;if(!(N(o)&&N(i)&&i.isCollapsed()&&o.isCollapsed()))return Le;const u=function(D,y,C){const x=D._nodeMap,w=[];for(const b of y){const k=x.get(b);k!==void 0&&w.push(k)}for(const[b,k]of C){if(!k)continue;const A=x.get(b);A===void 0||ge(A)||w.push(A)}return w}(e,t,n);if(u.length===0)return Le;if(u.length>1){const D=e._nodeMap,y=D.get(o.anchor.key),C=D.get(i.anchor.key);return y&&C&&!r._nodeMap.has(y.__key)&&P(y)&&y.__text.length===1&&o.anchor.offset===1?Lo:Le}const l=u[0],a=r._nodeMap.get(l.__key);if(!P(a)||!P(l)||a.__mode!==l.__mode)return Le;const c=a.__text,f=l.__text;if(c===f)return Le;const d=o.anchor,h=i.anchor;if(d.key!==h.key||d.type!=="text")return Le;const p=d.offset,g=h.offset,_=f.length-c.length;return _===1&&g===p-1?Lo:_===-1&&g===p+1?kd:_===-1&&g===p?Sd:Le}function Bd(r,e){let t=Date.now(),n=Le;return(s,o,i,u,l,a)=>{const c=Date.now();if(a.has("historic"))return n=Le,t=c,js;const f=Td(s,o,u,l,r.isComposing()),d=(()=>{const h=i===null||i.editor===r,p=a.has("history-push");if(!p&&h&&a.has("history-merge"))return rn;if(s===null)return Ms;const g=o._selection;return u.size>0||l.size>0?p===!1&&f!==Le&&f===n&&c<t+e&&h||u.size===1&&function(_,D,y){const C=D._nodeMap.get(_),x=y._nodeMap.get(_),w=D._selection,b=y._selection;return!(N(w)&&N(b)&&w.anchor.type==="element"&&w.focus.type==="element"&&b.anchor.type==="text"&&b.focus.type==="text"||!P(C)||!P(x)||C.__parent!==x.__parent)&&JSON.stringify(D.read(()=>C.exportJSON()))===JSON.stringify(y.read(()=>x.exportJSON()))}(Array.from(u)[0],s,o)?rn:Ms:g!==null?rn:js})();return t=c,n=f,d}}function Po(r){r.undoStack=[],r.redoStack=[],r.current=null}function Nd(r,e,t){const n=Bd(r,t);return Ft(r.registerCommand(Us,()=>(function(o,i){const u=i.redoStack,l=i.undoStack;if(l.length!==0){const a=i.current,c=l.pop();a!==null&&(u.push(a),o.dispatchCommand(Jr,!0)),l.length===0&&o.dispatchCommand(Qr,!1),i.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(r,e),!0),J),r.registerCommand(Ws,()=>(function(o,i){const u=i.redoStack,l=i.undoStack;if(u.length!==0){const a=i.current;a!==null&&(l.push(a),o.dispatchCommand(Qr,!0));const c=u.pop();u.length===0&&o.dispatchCommand(Jr,!1),i.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(r,e),!0),J),r.registerCommand(Sa,()=>(Po(e),!1),J),r.registerCommand(Ta,()=>(Po(e),r.dispatchCommand(Jr,!1),r.dispatchCommand(Qr,!1),!0),J),r.registerUpdateListener(({editorState:o,prevEditorState:i,dirtyLeaves:u,dirtyElements:l,tags:a})=>{const c=e.current,f=e.redoStack,d=e.undoStack,h=c===null?null:c.editorState;if(c!==null&&o===h)return;const p=n(i,o,c,u,l,a);if(p===Ms)f.length!==0&&(e.redoStack=[],r.dispatchCommand(Jr,!1)),c!==null&&(d.push({...c}),r.dispatchCommand(Qr,!0));else if(p===js)return;e.current={editor:r,editorState:o}}))}function Fd(){return{current:null,redoStack:[],undoStack:[]}}function Ld({delay:r,externalHistoryState:e}){const[t]=Ge();return function(n,s,o=1e3){const i=T.useMemo(()=>s||Fd(),[s]);T.useEffect(()=>Nd(n,i,o),[o,n,i])}(t,e,r),null}const Pd=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function Od({ignoreHistoryMergeTagChange:r=!0,ignoreSelectionChange:e=!1,onChange:t}){const[n]=Ge();return Pd(()=>{if(t)return n.registerUpdateListener(({editorState:s,dirtyElements:o,dirtyLeaves:i,prevEditorState:u,tags:l})=>{e&&o.size===0&&i.size===0||r&&l.has("history-merge")||u.isEmpty()||t(s,n,l)})},[n,r,e,t]),null}function Is(r,e){return Is=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},Is(r,e)}var Oo={error:null},Rd=function(r){var e,t;function n(){for(var o,i=arguments.length,u=new Array(i),l=0;l<i;l++)u[l]=arguments[l];return(o=r.call.apply(r,[this].concat(u))||this).state=Oo,o.resetErrorBoundary=function(){for(var a,c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];o.props.onReset==null||(a=o.props).onReset.apply(a,f),o.reset()},o}t=r,(e=n).prototype=Object.create(t.prototype),e.prototype.constructor=e,Is(e,t),n.getDerivedStateFromError=function(o){return{error:o}};var s=n.prototype;return s.reset=function(){this.setState(Oo)},s.componentDidCatch=function(o,i){var u,l;(u=(l=this.props).onError)==null||u.call(l,o,i)},s.componentDidUpdate=function(o,i){var u,l,a,c,f=this.state.error,d=this.props.resetKeys;f!==null&&i.error!==null&&((a=o.resetKeys)===void 0&&(a=[]),(c=d)===void 0&&(c=[]),a.length!==c.length||a.some(function(h,p){return!Object.is(h,c[p])}))&&((u=(l=this.props).onResetKeysChange)==null||u.call(l,o.resetKeys,d),this.reset())},s.render=function(){var o=this.state.error,i=this.props,u=i.fallbackRender,l=i.FallbackComponent,a=i.fallback;if(o!==null){var c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(ts.isValidElement(a))return a;if(typeof u=="function")return u(c);if(l)return ts.createElement(l,c);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},n}(ts.Component);function Md({children:r,onError:e}){return v.jsx(Rd,{fallback:v.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:r})}function jd(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ue=jd(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Id(r){let e=1,t=r.getParent();for(;t!=null;){if(Z(t)){const n=t.getParent();if(G(n)){e++,t=n.getParent();continue}Ue(40)}return e}return e}function $s(r){let e=r.getParent();G(e)||Ue(40);let t=e;for(;t!==null;)t=t.getParent(),G(t)&&(e=t);return e}function hl(r){let e=[];const t=r.getChildren().filter(Z);for(let n=0;n<t.length;n++){const s=t[n],o=s.getFirstChild();G(o)?e=e.concat(hl(o)):e.push(s)}return e}function We(r){return Z(r)&&G(r.getFirstChild())}function Ro(r){return we().append(r)}function pl(r,e){return Z(r)&&(e.length===0||e.length===1&&r.is(e[0])&&r.getChildrenSize()===0)}function Mo(r,e){r.update(()=>{const t=I();if(t!==null){const n=t.getNodes();if(N(t)){const o=t.getStartEndPoints();o===null&&Ue(143);const[i]=o,u=i.getNode(),l=u.getParent();if(pl(u,n)){const a=be(e);if(Ke(l)){u.replace(a);const c=we();E(u)&&(c.setFormat(u.getFormatType()),c.setIndent(u.getIndent())),a.append(c)}else if(Z(u)){const c=u.getParentOrThrow();Nt(a,c.getChildren()),c.replace(a)}return}}const s=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(!E(i)||!i.isEmpty()||Z(i)||s.has(i.getKey())){if(xu(i)){let u=i.getParent();for(;u!=null;){const l=u.getKey();if(G(u)){if(!s.has(l)){const a=be(e);Nt(a,u.getChildren()),u.replace(a),s.add(l)}break}{const a=u.getParent();if(Ke(a)&&!s.has(l)){s.add(l),jo(u,e);break}u=a}}}}else jo(i,e)}}})}function Nt(r,e){r.splice(r.getChildrenSize(),0,e)}function jo(r,e){if(G(r))return r;const t=r.getPreviousSibling(),n=r.getNextSibling(),s=we();let o;if(Nt(s,r.getChildren()),G(t)&&e===t.getListType())t.append(s),G(n)&&e===n.getListType()&&(Nt(t,n.getChildren()),n.remove()),o=t;else if(G(n)&&e===n.getListType())n.getFirstChildOrThrow().insertBefore(s),o=n;else{const i=be(e);i.append(s),r.replace(i),o=i}return s.setFormat(r.getFormatType()),s.setIndent(r.getIndent()),r.remove(),o}function mi(r,e){const t=r.getLastChild(),n=e.getFirstChild();t&&n&&We(t)&&We(n)&&(mi(t.getFirstChild(),n.getFirstChild()),n.remove());const s=e.getChildren();s.length>0&&r.append(...s),e.remove()}function $d(r){r.update(()=>{const e=I();if(N(e)){const t=new Set,n=e.getNodes(),s=e.anchor.getNode();if(pl(s,n))t.add($s(s));else for(let o=0;o<n.length;o++){const i=n[o];if(xu(i)){const u=ed(i,Lt);u!=null&&t.add($s(u))}}for(const o of t){let i=o;const u=hl(o);for(const l of u){const a=oe();Nt(a,l.getChildren()),i.insertAfter(a),i=a,l.__key===e.anchor.key&&e.anchor.set(a.getKey(),0,"element"),l.__key===e.focus.key&&e.focus.set(a.getKey(),0,"element"),l.remove()}o.remove()}}})}function qd(r){const e=new Set;if(We(r)||e.has(r.getKey()))return;const t=r.getParent(),n=r.getNextSibling(),s=r.getPreviousSibling();if(We(n)&&We(s)){const o=s.getFirstChild();if(G(o)){o.append(r);const i=n.getFirstChild();G(i)&&(Nt(o,i.getChildren()),n.remove(),e.add(n.getKey()))}}else if(We(n)){const o=n.getFirstChild();if(G(o)){const i=o.getFirstChild();i!==null&&i.insertBefore(r)}}else if(We(s)){const o=s.getFirstChild();G(o)&&o.append(r)}else if(G(t)){const o=we(),i=be(t.getListType());o.append(i),i.append(r),s?s.insertAfter(o):n?n.insertBefore(o):t.append(o)}}function zd(r){if(We(r))return;const e=r.getParent(),t=e?e.getParent():void 0;if(G(t?t.getParent():void 0)&&Z(t)&&G(e)){const n=e?e.getFirstChild():void 0,s=e?e.getLastChild():void 0;if(r.is(n))t.insertBefore(r),e.isEmpty()&&t.remove();else if(r.is(s))t.insertAfter(r),e.isEmpty()&&t.remove();else{const o=e.getListType(),i=we(),u=be(o);i.append(u),r.getPreviousSiblings().forEach(c=>u.append(c));const l=we(),a=be(o);l.append(a),Nt(a,r.getNextSiblings()),t.insertBefore(i),t.insertAfter(l),t.replace(r)}}}function Ud(){const r=I();if(!N(r)||!r.isCollapsed())return!1;const e=r.anchor.getNode();if(!Z(e)||e.getChildrenSize()!==0)return!1;const t=$s(e),n=e.getParent();G(n)||Ue(40);const s=n.getParent();let o;if(Ke(s))o=oe(),t.insertAfter(o);else{if(!Z(s))return!1;o=we(),s.insertAfter(o)}o.select();const i=e.getNextSiblings();if(i.length>0){const u=be(n.getListType());if(Qt(o))o.insertAfter(u);else{const l=we();l.append(u),o.insertAfter(l)}i.forEach(l=>{l.remove(),u.append(l)})}return function(u){let l=u;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const a=l.getParent();if(a==null||!Z(l)&&!G(l))break;l=a}l.remove()}(e),!0}function En(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}class Lt extends st{static getType(){return"listitem"}static clone(e){return new Lt(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return G(n)&&n.getListType()==="check"&&$o(t,this,null),t.value=this.__value,Io(t,e.theme,this),t}updateDOM(e,t,n){const s=this.getParent();return G(s)&&s.getListType()==="check"&&$o(t,this,e),t.value=this.__value,Io(t,n.theme,this),!1}static transform(){return e=>{if(Z(e)||Ue(144),e.__checked==null)return;const t=e.getParent();G(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:Wd,priority:0})}}static importJSON(e){const t=we();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(E(n)&&this.canMergeWith(n)){const s=n.getChildren();this.append(...s),n.remove()}else super.append(n)}return this}replace(e,t){if(Z(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!G(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const s=be(n.getListType());let o=this.getNextSibling();for(;o;){const i=o;o=o.getNextSibling(),s.append(i)}n.insertAfter(e),e.insertAfter(s)}return t&&(E(e)||Ue(139),this.getChildren().forEach(s=>{e.append(s)})),this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(G(n)||Ue(39),Z(e))return super.insertAfter(e,t);const s=this.getNextSiblings();if(n.insertAfter(e,t),s.length!==0){const o=be(n.getListType());s.forEach(i=>o.append(i)),e.insertAfter(o,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&We(t)&&We(n)&&(mi(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=we(this.__checked==null&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=oe();this.getChildren().forEach(i=>t.append(i));const n=this.getParentOrThrow(),s=n.getParentOrThrow(),o=Z(s);if(n.getChildrenSize()===1)if(o)n.remove(),s.select();else{n.insertBefore(t),n.remove();const i=e.anchor,u=e.focus,l=t.getKey();i.type==="element"&&i.getNode().is(this)&&i.set(l,i.offset,"element"),u.type==="element"&&u.getNode().is(this)&&u.set(l,u.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return G(n)&&(t=n.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(e===null)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;Z(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!="number"&&Ue(117),(e=Math.floor(e))>=0||Ue(199);let t=this.getIndent();for(;t!==e;)t<e?(qd(this),t++):(zd(this),t--);return this}canInsertAfter(e){return Z(e)}canReplaceWith(e){return Z(e)}canMergeWith(e){return Qt(e)||Z(e)}extractWithChild(e,t){if(!N(t))return!1;const n=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(s)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return be("bullet")}canMergeWhenEmpty(){return!0}}function Io(r,e,t){const n=[],s=[],o=e.list,i=o?o.listitem:void 0;let u;if(o&&o.nested&&(u=o.nested.listitem),i!==void 0&&n.push(...En(i)),o){const l=t.getParent(),a=G(l)&&l.getListType()==="check",c=t.getChecked();a&&!c||s.push(o.listitemUnchecked),a&&c||s.push(o.listitemChecked),a&&n.push(c?o.listitemChecked:o.listitemUnchecked)}if(u!==void 0){const l=En(u);t.getChildren().some(a=>G(a))?n.push(...l):s.push(...l)}s.length>0&&il(r,...s),n.length>0&&qr(r,...n)}function $o(r,e,t,n){G(e.getFirstChild())?(r.removeAttribute("role"),r.removeAttribute("tabIndex"),r.removeAttribute("aria-checked")):(r.setAttribute("role","checkbox"),r.setAttribute("tabIndex","-1"),t&&e.__checked===t.__checked||r.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function Wd(r){if(r.classList.contains("task-list-item")){for(const t of r.children)if(t.tagName==="INPUT")return Vd(t)}const e=r.getAttribute("aria-checked");return{node:we(e==="true"||e!=="false"&&void 0)}}function Vd(r){return r.getAttribute("type")!=="checkbox"?{node:null}:{node:we(r.hasAttribute("checked"))}}function we(r){return Je(new Lt(void 0,r))}function Z(r){return r instanceof Lt}class er extends st{static getType(){return"list"}static clone(e){const t=e.__listType||Uo[e.__tag];return new er(t,e.__start,e.__key)}constructor(e,t,n){super(n);const s=Uo[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag=e==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const n=this.__tag,s=document.createElement(n);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,qo(s,e.theme,this),s}updateDOM(e,t,n){return e.__tag!==this.__tag||(qo(t,n.theme,this),!1)}static transform(){return e=>{G(e)||Ue(163),function(t){const n=t.getNextSibling();G(n)&&t.getListType()===n.getListType()&&mi(t,n)}(e),function(t){const n=t.getListType()!=="check";let s=t.getStart();for(const o of t.getChildren())Z(o)&&(o.getValue()!==s&&o.setValue(s),n&&o.getLatest().__checked!=null&&o.setChecked(void 0),G(o.getFirstChild())||s++)}(e)}}static importDOM(){return{ol:()=>({conversion:zo,priority:0}),ul:()=>({conversion:zo,priority:0})}}static importJSON(e){const t=be(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config,e);return t&&rt(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(Z(n))super.append(n);else{const s=we();if(G(n))s.append(n);else if(E(n))if(n.isInline())s.append(n);else{const o=le(n.getTextContent());s.append(o)}else s.append(n);super.append(s)}}return this}extractWithChild(e){return Z(e)}}function qo(r,e,t){const n=[],s=[],o=e.list;if(o!==void 0){const i=o[`${t.__tag}Depth`]||[],u=Id(t)-1,l=u%i.length,a=i[l],c=o[t.__tag];let f;const d=o.nested,h=o.checklist;if(d!==void 0&&d.list&&(f=d.list),c!==void 0&&n.push(c),h!==void 0&&t.__listType==="check"&&n.push(h),a!==void 0){n.push(...En(a));for(let p=0;p<i.length;p++)p!==l&&s.push(t.__tag+p)}if(f!==void 0){const p=En(f);u>1?n.push(...p):s.push(...p)}}s.length>0&&il(r,...s),n.length>0&&qr(r,...n)}function Kd(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t];if(Z(n)){e.push(n);const s=n.getChildren();s.length>1&&s.forEach(o=>{G(o)&&e.push(Ro(o))})}else e.push(Ro(n))}return e}function zo(r){const e=r.nodeName.toLowerCase();let t=null;return e==="ol"?t=be("number",r.start):e==="ul"&&(t=function(n){if(n.getAttribute("__lexicallisttype")==="check"||n.classList.contains("contains-task-list"))return!0;for(const s of n.childNodes)if(rt(s)&&s.hasAttribute("aria-checked"))return!0;return!1}(r)?be("check"):be("bullet")),{after:Kd,node:t}}const Uo={ol:"number",ul:"bullet"};function be(r,e=1){return Je(new er(r,e))}function G(r){return r instanceof er}const gl=Br(),ml=Br(),Hd=Br();function Gd(r){return Ft(r.registerCommand(ml,()=>(Mo(r,"number"),!0),Ut),r.registerCommand(gl,()=>(Mo(r,"bullet"),!0),Ut),r.registerCommand(Hd,()=>($d(r),!0),Ut),r.registerCommand(Cr,()=>!!Ud(),Ut))}function Jd(){const[r]=Ge();return T.useEffect(()=>{if(!r.hasNodes([er,Lt]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[r]),function(e){T.useEffect(()=>Gd(e),[e])}(r),null}const Qd=new Set(["http:","https:","mailto:","sms:","tel:"]);class Pt extends st{static getType(){return"link"}static clone(e){return new Pt(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},n){super(n);const{target:s=null,rel:o=null,title:i=null}=t;this.__url=e,this.__target=s,this.__rel=o,this.__title=i}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),qr(t,e.theme.link),t}updateDOM(e,t,n){if(t instanceof HTMLAnchorElement){const s=this.__url,o=this.__target,i=this.__rel,u=this.__title;s!==e.__url&&(t.href=s),o!==e.__target&&(o?t.target=o:t.removeAttribute("target")),i!==e.__rel&&(i?t.rel=i:t.removeAttribute("rel")),u!==e.__title&&(u?t.title=u:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:Yd,priority:1})}}static importJSON(e){const t=kn(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!Qd.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const n=kn(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!N(t))return!1;const s=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(s)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Yd(r){let e=null;if(uc(r)){const t=r.textContent;(t!==null&&t!==""||r.children.length>0)&&(e=kn(r.getAttribute("href")||"",{rel:r.getAttribute("rel"),target:r.getAttribute("target"),title:r.getAttribute("title")}))}return{node:e}}function kn(r,e){return Je(new Pt(r,e))}function ar(r){return r instanceof Pt}class zr extends Pt{constructor(e,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new zr(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){const t=Wo(e.url,{isUnlinked:e.isUnlinked,rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked,type:"autolink",version:1}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(E(n)){const s=Wo(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(s),s}return null}}function Wo(r,e){return Je(new zr(r,e))}function Xd(r){return r instanceof zr}const Vo=Br();function ms(r,e={}){const{target:t,title:n}=e,s=e.rel===void 0?"noreferrer":e.rel,o=I();if(!N(o))return;const i=o.extract();if(r===null)i.forEach(u=>{const l=zn(u,a=>!Xd(a)&&ar(a));if(l){const a=l.getChildren();for(let c=0;c<a.length;c++)l.insertBefore(a[c]);l.remove()}});else{if(i.length===1){const a=function(c,f){let d=c;for(;d!==null&&d.getParent()!==null&&!f(d);)d=d.getParentOrThrow();return f(d)?d:null}(i[0],ar);if(a!==null)return a.setURL(r),t!==void 0&&a.setTarget(t),s!==null&&a.setRel(s),void(n!==void 0&&a.setTitle(n))}let u=null,l=null;i.forEach(a=>{const c=a.getParent();if(c!==l&&c!==null&&(!E(a)||a.isInline())){if(ar(c))return l=c,c.setURL(r),t!==void 0&&c.setTarget(t),s!==null&&l.setRel(s),void(n!==void 0&&l.setTitle(n));if(c.is(u)||(u=c,l=kn(r,{rel:s,target:t,title:n}),ar(c)?a.getPreviousSibling()===null?c.insertBefore(l):c.insertAfter(l):a.insertBefore(l)),ar(a)){if(a.is(l))return;if(l!==null){const f=a.getChildren();for(let d=0;d<f.length;d++)l.append(f[d])}a.remove()}else l!==null&&l.append(a)}})}}function Zd({validateUrl:r,attributes:e}){const[t]=Ge();return T.useEffect(()=>{if(!t.hasNodes([Pt]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Ft(t.registerCommand(Vo,n=>{if(n===null)return ms(n),!0;if(typeof n=="string")return!(r!==void 0&&!r(n))&&(ms(n,e),!0);{const{url:s,target:o,rel:i,title:u}=n;return ms(s,{...e,rel:i,target:o,title:u}),!0}},Ut),r!==void 0?t.registerCommand(Tn,n=>{const s=I();if(!N(s)||s.isCollapsed()||!ht(n,ClipboardEvent))return!1;const o=n;if(o.clipboardData===null)return!1;const i=o.clipboardData.getData("text");return!!r(i)&&!s.getNodes().some(u=>E(u))&&(t.dispatchCommand(Vo,{...e,url:i}),n.preventDefault(),!0)},Ut):()=>{})},[t,r,e]),null}const ef={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",toolbarBackground:"#f9fafb",quoteBorder:"#d1d5db",quoteBackground:"#f3f4f6"},tf={paragraph:"mail-editor-paragraph",text:{bold:"mail-editor-bold",italic:"mail-editor-italic",underline:"mail-editor-underline"},list:{ul:"mail-editor-ul",ol:"mail-editor-ol",listitem:"mail-editor-li"},link:"mail-editor-link",quote:"mail-editor-quote",heading:{h1:"mail-editor-h1",h2:"mail-editor-h2",h3:"mail-editor-h3"}};function rf({theme:r,disabled:e}){const[t]=Ge(),n=T.useCallback(()=>{t.dispatchCommand(Pe,"bold")},[t]),s=T.useCallback(()=>{t.dispatchCommand(Pe,"italic")},[t]),o=T.useCallback(()=>{t.dispatchCommand(Pe,"underline")},[t]),i=T.useCallback(()=>{t.dispatchCommand(gl,void 0)},[t]),u=T.useCallback(()=>{t.dispatchCommand(ml,void 0)},[t]),l=T.useCallback(()=>{t.update(()=>{const f=I();N(f)&&Gc(f,()=>gi())})},[t]),a={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",borderRadius:"4px",cursor:e?"not-allowed":"pointer",color:e?r.textSecondary:r.text,fontSize:"14px",fontWeight:600,opacity:e?.5:1},c=`
|
|
74
|
+
.mail-editor-toolbar-btn:hover:not(:disabled) {
|
|
75
|
+
background: ${r.border};
|
|
76
|
+
}
|
|
77
|
+
`;return v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"2px",padding:"8px",borderBottom:`1px solid ${r.border}`,background:r.toolbarBackground},children:[v.jsx("style",{children:c}),v.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:n,disabled:e,style:a,title:"Bold (Ctrl+B)",children:"B"}),v.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:s,disabled:e,style:{...a,fontStyle:"italic"},title:"Italic (Ctrl+I)",children:"I"}),v.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:o,disabled:e,style:{...a,textDecoration:"underline"},title:"Underline (Ctrl+U)",children:"U"}),v.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),v.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:i,disabled:e,style:a,title:"Bullet List",children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[v.jsx("circle",{cx:"4",cy:"6",r:"2"}),v.jsx("circle",{cx:"4",cy:"12",r:"2"}),v.jsx("circle",{cx:"4",cy:"18",r:"2"}),v.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),v.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),v.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),v.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:u,disabled:e,style:a,title:"Numbered List",children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[v.jsx("text",{x:"2",y:"8",fontSize:"8",fontFamily:"sans-serif",children:"1"}),v.jsx("text",{x:"2",y:"14",fontSize:"8",fontFamily:"sans-serif",children:"2"}),v.jsx("text",{x:"2",y:"20",fontSize:"8",fontFamily:"sans-serif",children:"3"}),v.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),v.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),v.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),v.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),v.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:l,disabled:e,style:a,title:"Quote",children:v.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:v.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})})})]})}function nf({html:r}){const[e]=Ge();return T.useEffect(()=>{r&&e.update(()=>{const t=te();t.clear();const s=new DOMParser().parseFromString(r,"text/html"),o=ol(e,s);o.length>0?t.append(...o):t.append(oe())})},[]),null}function sf({replyTo:r,theme:e}){const t=n=>{try{return new Date(n).toLocaleString()}catch{return n}};return v.jsxs("div",{style:{marginTop:"16px",paddingTop:"16px",borderTop:`1px solid ${e.border}`},children:[v.jsxs("div",{style:{fontSize:"12px",color:e.textSecondary,marginBottom:"8px"},children:["On ",t(r.date),", ",r.from," wrote:"]}),v.jsx("blockquote",{style:{margin:0,padding:"12px 16px",borderLeft:`3px solid ${e.quoteBorder}`,background:e.quoteBackground,fontSize:"14px",color:e.textSecondary},dangerouslySetInnerHTML:{__html:r.body}})]})}function of({value:r="",onChange:e,placeholder:t="Write your message...",replyTo:n,theme:s={},disabled:o=!1,className:i="",minHeight:u="200px"}){const l={...ef,...s},a={namespace:"MailEditor",theme:tf,onError:d=>{console.error("Lexical error:",d)},nodes:[er,Lt,Pt,zr,Wn,Un],editable:!o},c=T.useCallback((d,h)=>{d.read(()=>{const p=ul(h,null);e==null||e(p)})},[e]),f=`
|
|
78
|
+
.mail-editor-paragraph {
|
|
79
|
+
margin: 0 0 8px 0;
|
|
80
|
+
line-height: 1.5;
|
|
81
|
+
}
|
|
82
|
+
.mail-editor-bold {
|
|
83
|
+
font-weight: 600;
|
|
84
|
+
}
|
|
85
|
+
.mail-editor-italic {
|
|
86
|
+
font-style: italic;
|
|
87
|
+
}
|
|
88
|
+
.mail-editor-underline {
|
|
89
|
+
text-decoration: underline;
|
|
90
|
+
}
|
|
91
|
+
.mail-editor-ul, .mail-editor-ol {
|
|
92
|
+
margin: 0 0 8px 0;
|
|
93
|
+
padding-left: 24px;
|
|
94
|
+
}
|
|
95
|
+
.mail-editor-li {
|
|
96
|
+
margin: 4px 0;
|
|
97
|
+
}
|
|
98
|
+
.mail-editor-link {
|
|
99
|
+
color: ${l.primary};
|
|
100
|
+
text-decoration: underline;
|
|
101
|
+
}
|
|
102
|
+
.mail-editor-quote {
|
|
103
|
+
margin: 8px 0;
|
|
104
|
+
padding: 8px 16px;
|
|
105
|
+
border-left: 3px solid ${l.quoteBorder};
|
|
106
|
+
background: ${l.quoteBackground};
|
|
107
|
+
color: ${l.textSecondary};
|
|
108
|
+
}
|
|
109
|
+
.mail-editor-h1 {
|
|
110
|
+
font-size: 24px;
|
|
111
|
+
font-weight: 600;
|
|
112
|
+
margin: 16px 0 8px 0;
|
|
113
|
+
}
|
|
114
|
+
.mail-editor-h2 {
|
|
115
|
+
font-size: 20px;
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
margin: 14px 0 6px 0;
|
|
118
|
+
}
|
|
119
|
+
.mail-editor-h3 {
|
|
120
|
+
font-size: 16px;
|
|
121
|
+
font-weight: 600;
|
|
122
|
+
margin: 12px 0 4px 0;
|
|
123
|
+
}
|
|
124
|
+
.mail-editor-content {
|
|
125
|
+
outline: none;
|
|
126
|
+
min-height: ${u};
|
|
127
|
+
padding: 16px;
|
|
128
|
+
font-size: 14px;
|
|
129
|
+
line-height: 1.6;
|
|
130
|
+
color: ${l.text};
|
|
131
|
+
}
|
|
132
|
+
.mail-editor-content:focus {
|
|
133
|
+
outline: none;
|
|
134
|
+
}
|
|
135
|
+
.mail-editor-placeholder {
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: 16px;
|
|
138
|
+
left: 16px;
|
|
139
|
+
color: ${l.textSecondary};
|
|
140
|
+
pointer-events: none;
|
|
141
|
+
font-size: 14px;
|
|
142
|
+
}
|
|
143
|
+
`;return v.jsxs("div",{className:i,style:{border:`1px solid ${l.border}`,borderRadius:"8px",background:l.background,overflow:"hidden"},children:[v.jsx("style",{children:f}),v.jsxs(Oc,{initialConfig:a,children:[v.jsx(rf,{theme:l,disabled:o}),v.jsx("div",{style:{position:"relative"},children:v.jsx(xd,{contentEditable:v.jsx(Cd,{className:"mail-editor-content",style:{outline:"none",minHeight:u,padding:"16px",fontSize:"14px",lineHeight:1.6,color:l.text}}),placeholder:v.jsx("div",{className:"mail-editor-placeholder",children:t}),ErrorBoundary:Md})}),v.jsx(Jd,{}),v.jsx(Zd,{}),v.jsx(Ld,{}),v.jsx(Od,{onChange:c}),r&&v.jsx(nf,{html:r})]}),n&&v.jsx(sf,{replyTo:n,theme:l})]})}exports.AnimatedCardFlip=da;exports.ApiClient=Qo;exports.AuthManager=Jo;exports.Card=la;exports.DataOperations=nn;exports.Detail=aa;exports.GraphClient=Ml;exports.Mail=ha;exports.MailClient=Go;exports.MailEditor=of;exports.SelectableList=pa;exports.Stack=ua;exports.getApiClient=qs;exports.initializeApiClient=na;exports.useMutation=sa;exports.useQuery=Yo;
|