archsight 0.1.4 → 0.2.0

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.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +5 -4
  3. data/README.md +44 -59
  4. data/chart/archsight/Chart.yaml +6 -0
  5. data/chart/archsight/README.md +3 -0
  6. data/chart/archsight/templates/NOTES.txt +22 -0
  7. data/chart/archsight/templates/_helpers.tpl +62 -0
  8. data/chart/archsight/templates/deployment.yaml +114 -0
  9. data/chart/archsight/templates/ingress.yaml +56 -0
  10. data/chart/archsight/templates/resources-configmap.yaml +10 -0
  11. data/chart/archsight/templates/resources-pvc.yaml +23 -0
  12. data/chart/archsight/templates/service.yaml +15 -0
  13. data/chart/archsight/templates/serviceaccount.yaml +12 -0
  14. data/chart/archsight/values.yaml +162 -0
  15. data/docs/architecture.md +39 -0
  16. data/docs/docker.md +49 -0
  17. data/{lib/archsight/web/doc → docs}/import.md +10 -2
  18. data/{lib/archsight/web/doc → docs}/index.md.erb +3 -1
  19. data/docs/kubernetes.md +149 -0
  20. data/docs/licenses.md +307 -0
  21. data/lib/archsight/analysis/executor.rb +0 -10
  22. data/lib/archsight/annotations/annotation.rb +85 -36
  23. data/lib/archsight/annotations/architecture_annotations.rb +1 -34
  24. data/lib/archsight/annotations/computed.rb +1 -1
  25. data/lib/archsight/annotations/generated_annotations.rb +6 -3
  26. data/lib/archsight/annotations/git_annotations.rb +8 -4
  27. data/lib/archsight/annotations/interface_annotations.rb +35 -0
  28. data/lib/archsight/cli.rb +4 -2
  29. data/lib/archsight/editor/content_hasher.rb +37 -0
  30. data/lib/archsight/editor/file_writer.rb +79 -0
  31. data/lib/archsight/editor.rb +237 -0
  32. data/lib/archsight/graph.rb +1 -51
  33. data/lib/archsight/helpers.rb +0 -20
  34. data/lib/archsight/import/handlers/github.rb +16 -6
  35. data/lib/archsight/import/handlers/gitlab.rb +28 -10
  36. data/lib/archsight/import/handlers/repository.rb +56 -6
  37. data/lib/archsight/import/handlers/rest_api.rb +13 -1
  38. data/lib/archsight/import/license_analyzer.rb +650 -0
  39. data/lib/archsight/import/team_matcher.rb +111 -61
  40. data/lib/archsight/linter.rb +1 -1
  41. data/lib/archsight/mcp/base.rb +11 -0
  42. data/lib/archsight/mcp/execute_analysis_tool.rb +100 -0
  43. data/lib/archsight/mcp.rb +1 -0
  44. data/lib/archsight/renderer.rb +4 -4
  45. data/lib/archsight/resources/analysis.rb +1 -17
  46. data/lib/archsight/resources/application_interface.rb +1 -5
  47. data/lib/archsight/resources/base.rb +14 -14
  48. data/lib/archsight/resources/business_actor.rb +18 -3
  49. data/lib/archsight/resources/technology_artifact.rb +48 -0
  50. data/lib/archsight/resources/technology_interface.rb +1 -1
  51. data/lib/archsight/resources/technology_service.rb +5 -0
  52. data/lib/archsight/version.rb +1 -1
  53. data/lib/archsight/web/api/docs.rb +37 -2
  54. data/lib/archsight/web/api/json_helpers.rb +79 -13
  55. data/lib/archsight/web/api/openapi/spec.yaml +699 -0
  56. data/lib/archsight/web/api/routes.rb +23 -0
  57. data/lib/archsight/web/application.rb +48 -128
  58. data/lib/archsight/web/editor/form_builder.rb +100 -0
  59. data/lib/archsight/web/editor/helpers.rb +150 -0
  60. data/lib/archsight/web/editor/routes.rb +166 -0
  61. data/lib/archsight/web/public/vue/ApiDocsPage-B1RqTNqh.js +1 -0
  62. data/lib/archsight/web/public/vue/ApiDocsPage-DhNTOH4o.css +1 -0
  63. data/lib/archsight/web/public/vue/DocPage-DzwBgBd4.js +1 -0
  64. data/lib/archsight/web/public/vue/EditorPage-D_miHSv4.js +34 -0
  65. data/lib/archsight/web/public/vue/EditorPage-Dq0MuTnp.css +1 -0
  66. data/lib/archsight/web/public/vue/ErrorPage-CQQtPey3.js +2 -0
  67. data/lib/archsight/web/public/vue/ErrorPage-CwPT3JUr.css +1 -0
  68. data/lib/archsight/web/public/vue/GraphView-DRcIqAiR.css +1 -0
  69. data/lib/archsight/web/public/vue/GraphView-T9jFH_qg.js +1 -0
  70. data/lib/archsight/web/public/vue/InstanceRouter-1Sm-CRhf.js +2 -0
  71. data/lib/archsight/web/public/vue/InstanceRouter-BJkDRXZY.css +1 -0
  72. data/lib/archsight/web/public/vue/KindList-JA_L_-Cz.js +1 -0
  73. data/lib/archsight/web/public/vue/ResourceList-8iqavWdg.js +1 -0
  74. data/lib/archsight/web/public/vue/ResourceList-DP-z-j71.css +1 -0
  75. data/lib/archsight/web/public/vue/SearchResults-BGHbg48-.css +1 -0
  76. data/lib/archsight/web/public/vue/SearchResults-BdgFeHcm.js +1 -0
  77. data/lib/archsight/web/public/vue/_basePickBy-CVgieyx-.js +1 -0
  78. data/lib/archsight/web/public/vue/_baseUniq-BNfrOSaP.js +1 -0
  79. data/lib/archsight/web/public/vue/architectureDiagram-VXUJARFQ-CJXNpTr5.js +36 -0
  80. data/lib/archsight/web/public/vue/blockDiagram-VD42YOAC-B5488Hes.js +122 -0
  81. data/lib/archsight/web/public/vue/c4Diagram-YG6GDRKO-eYY3hprM.js +10 -0
  82. data/lib/archsight/web/public/vue/chunk-4BX2VUAB-ZoXeL4D1.js +1 -0
  83. data/lib/archsight/web/public/vue/chunk-55IACEB6-rNtQYnu_.js +1 -0
  84. data/lib/archsight/web/public/vue/chunk-B4BG7PRW-DolAeVV9.js +165 -0
  85. data/lib/archsight/web/public/vue/chunk-DI55MBZ5-DnN0f_hj.js +220 -0
  86. data/lib/archsight/web/public/vue/chunk-FMBD7UC4-BQWOCMuR.js +15 -0
  87. data/lib/archsight/web/public/vue/chunk-QN33PNHL-DId301Kb.js +1 -0
  88. data/lib/archsight/web/public/vue/chunk-QZHKN3VN-xbY0NLgv.js +1 -0
  89. data/lib/archsight/web/public/vue/chunk-TZMSLE5B-CgF9_37b.js +1 -0
  90. data/lib/archsight/web/public/vue/classDiagram-2ON5EDUG-jGlvI-Za.js +1 -0
  91. data/lib/archsight/web/public/vue/classDiagram-v2-WZHVMYZB-jGlvI-Za.js +1 -0
  92. data/lib/archsight/web/public/vue/clone-6iRPe1-W.js +1 -0
  93. data/lib/archsight/web/public/vue/cose-bilkent-S5V4N54A-CB9Zfu50.js +1 -0
  94. data/lib/archsight/web/public/vue/cytoscape.esm-5J0xJHOV.js +321 -0
  95. data/lib/archsight/web/public/vue/dagre-6UL2VRFP-BqkmE-LI.js +4 -0
  96. data/lib/archsight/web/public/vue/diagram-PSM6KHXK-CKBfqtw3.js +24 -0
  97. data/lib/archsight/web/public/vue/diagram-QEK2KX5R-B78rOlvK.js +43 -0
  98. data/lib/archsight/web/public/vue/diagram-S2PKOQOG-BlXC6Cia.js +24 -0
  99. data/lib/archsight/web/public/vue/erDiagram-Q2GNP2WA-BnliyziJ.js +60 -0
  100. data/lib/archsight/web/public/vue/flowDiagram-NV44I4VS-wuqPowTd.js +162 -0
  101. data/lib/archsight/web/public/vue/ganttDiagram-JELNMOA3-GSffAIH3.js +267 -0
  102. data/lib/archsight/web/public/vue/gitGraphDiagram-V2S2FVAM-OA7VyugW.js +65 -0
  103. data/lib/archsight/web/public/vue/graph-BXHAtA0S.js +1 -0
  104. data/lib/archsight/web/public/vue/graphviz-CJms5bxZ.js +13 -0
  105. data/lib/archsight/web/public/vue/index-DsEsN0_K.js +2 -0
  106. data/lib/archsight/web/public/vue/index-Tiu4C-Sb.css +1 -0
  107. data/lib/archsight/web/public/vue/infoDiagram-HS3SLOUP-nlVe2qgv.js +2 -0
  108. data/lib/archsight/web/public/vue/journeyDiagram-XKPGCS4Q-CtTIcKwf.js +139 -0
  109. data/lib/archsight/web/public/vue/kanban-definition-3W4ZIXB7-837KX0sW.js +89 -0
  110. data/lib/archsight/web/public/vue/katex-C-M49wc6.js +261 -0
  111. data/lib/archsight/web/public/vue/layout-DtE0QdL6.js +1 -0
  112. data/lib/archsight/web/public/vue/mermaid-DpPHPFQh.js +250 -0
  113. data/lib/archsight/web/public/vue/mindmap-definition-VGOIOE7T-9gLF2AoY.js +68 -0
  114. data/lib/archsight/web/public/vue/pieDiagram-ADFJNKIX-CyCNgw3u.js +30 -0
  115. data/lib/archsight/web/public/vue/quadrantDiagram-AYHSOK5B-CkPh8g02.js +7 -0
  116. data/lib/archsight/web/public/vue/requirementDiagram-UZGBJVZJ-Dkt6OSlY.js +64 -0
  117. data/lib/archsight/web/public/vue/sankeyDiagram-TZEHDZUN-BqprTk8x.js +10 -0
  118. data/lib/archsight/web/public/vue/sequenceDiagram-WL72ISMW-CTmTe1FQ.js +145 -0
  119. data/lib/archsight/web/public/vue/stateDiagram-FKZM4ZOC-CphqmkEU.js +1 -0
  120. data/lib/archsight/web/public/vue/stateDiagram-v2-4FDKWEC3-CxaDW5sW.js +1 -0
  121. data/lib/archsight/web/public/vue/timeline-definition-IT6M3QCI-CSQUZkyE.js +61 -0
  122. data/lib/archsight/web/public/vue/treemap-GDKQZRPO-DTojm7Yr.js +162 -0
  123. data/lib/archsight/web/public/{css/graph.css → vue/useGraphviz-A5s4h76R.js} +2 -1
  124. data/lib/archsight/web/public/vue/useHighlight-C6Kb5G3l.js +10 -0
  125. data/lib/archsight/web/public/vue/useMermaid-DqxTrLRB.js +1 -0
  126. data/lib/archsight/web/public/vue/usePanZoom-BybZ_rfh.js +11 -0
  127. data/lib/archsight/web/public/vue/xychartDiagram-PRI3JC2R-B1ZJZtDC.js +7 -0
  128. data/lib/archsight/web/public/vue.html +15 -0
  129. data/media/artifact.jpg +0 -0
  130. data/media/service.jpg +0 -0
  131. metadata +104 -77
  132. data/lib/archsight/web/public/css/artifact.css +0 -995
  133. data/lib/archsight/web/public/css/base.css +0 -201
  134. data/lib/archsight/web/public/css/highlight.min.css +0 -10
  135. data/lib/archsight/web/public/css/iconoir.css +0 -22
  136. data/lib/archsight/web/public/css/instance.css +0 -818
  137. data/lib/archsight/web/public/css/layout.css +0 -421
  138. data/lib/archsight/web/public/css/mermaid-layers.css +0 -188
  139. data/lib/archsight/web/public/css/pico.min.css +0 -4
  140. data/lib/archsight/web/public/img/archimate.png +0 -0
  141. data/lib/archsight/web/public/img/togaf-high-level.png +0 -0
  142. data/lib/archsight/web/public/js/graph-zoom.js +0 -18
  143. data/lib/archsight/web/public/js/highlight.min.js +0 -3899
  144. data/lib/archsight/web/public/js/htmx.min.js +0 -1
  145. data/lib/archsight/web/public/js/mermaid-init.js +0 -88
  146. data/lib/archsight/web/public/js/mermaid.min.js +0 -2811
  147. data/lib/archsight/web/public/js/sparkline.js +0 -42
  148. data/lib/archsight/web/public/js/svg-pan-zoom.min.js +0 -3
  149. data/lib/archsight/web/public/js/svg-zoom-controls.js +0 -93
  150. data/lib/archsight/web/views/api_docs.erb +0 -19
  151. data/lib/archsight/web/views/index.haml +0 -12
  152. data/lib/archsight/web/views/partials/artifact/_activity.haml +0 -55
  153. data/lib/archsight/web/views/partials/artifact/_agentic.haml +0 -25
  154. data/lib/archsight/web/views/partials/artifact/_deployment.haml +0 -29
  155. data/lib/archsight/web/views/partials/artifact/_git_info.haml +0 -16
  156. data/lib/archsight/web/views/partials/artifact/_language_stats.haml +0 -53
  157. data/lib/archsight/web/views/partials/artifact/_links.haml +0 -24
  158. data/lib/archsight/web/views/partials/artifact/_project_estimate.haml +0 -32
  159. data/lib/archsight/web/views/partials/artifact/_repositories.haml +0 -55
  160. data/lib/archsight/web/views/partials/artifact/_team.haml +0 -83
  161. data/lib/archsight/web/views/partials/artifact/_workflow.haml +0 -69
  162. data/lib/archsight/web/views/partials/components/_activity.haml +0 -37
  163. data/lib/archsight/web/views/partials/components/_git.haml +0 -17
  164. data/lib/archsight/web/views/partials/components/_jira.haml +0 -18
  165. data/lib/archsight/web/views/partials/components/_languages.haml +0 -29
  166. data/lib/archsight/web/views/partials/components/_owner.haml +0 -15
  167. data/lib/archsight/web/views/partials/components/_repositories.haml +0 -37
  168. data/lib/archsight/web/views/partials/components/_status.haml +0 -23
  169. data/lib/archsight/web/views/partials/instance/_analysis_detail.haml +0 -74
  170. data/lib/archsight/web/views/partials/instance/_analysis_result.haml +0 -64
  171. data/lib/archsight/web/views/partials/instance/_detail.haml +0 -103
  172. data/lib/archsight/web/views/partials/instance/_graph.haml +0 -6
  173. data/lib/archsight/web/views/partials/instance/_import_detail.haml +0 -87
  174. data/lib/archsight/web/views/partials/instance/_list.haml +0 -84
  175. data/lib/archsight/web/views/partials/instance/_relations.haml +0 -43
  176. data/lib/archsight/web/views/partials/instance/_requirements.haml +0 -41
  177. data/lib/archsight/web/views/partials/instance/_view_detail.haml +0 -57
  178. data/lib/archsight/web/views/partials/layout/_content.haml +0 -44
  179. data/lib/archsight/web/views/partials/layout/_error.haml +0 -22
  180. data/lib/archsight/web/views/partials/layout/_head.haml +0 -24
  181. data/lib/archsight/web/views/partials/layout/_navigation.haml +0 -21
  182. data/lib/archsight/web/views/partials/layout/_sidebar.haml +0 -27
  183. data/lib/archsight/web/views/search.haml +0 -53
  184. /data/{lib/archsight/web/doc → docs}/archimate.md +0 -0
  185. /data/{lib/archsight/web/doc → docs}/computed_annotations.md +0 -0
  186. /data/{lib/archsight/web/doc → docs}/icons.md +0 -0
  187. /data/{lib/archsight/web/doc → docs}/modeling.md +0 -0
  188. /data/{lib/archsight/web/doc → docs}/search.md +0 -0
  189. /data/{lib/archsight/web/doc → docs}/togaf.md +0 -0
  190. /data/{lib/archsight/web/doc → docs}/tool.md +0 -0
@@ -0,0 +1,34 @@
1
+ import{_ as nr,o as D,c as R,a as A,d as le,t as ne,b as Fe,I as Ge,J as Ri,F as yt,x as fn,K as Ft,n as Mt,y as Xe,w as Es,r as ie,l as ga,L as Tc,k as wc,p as Nc,M as Ac,N as Fc,e as Mn,f as go,B as Oc,v as $c,g as Ic,z as Mc,i as Pc,q as Lc,O as Dc,P as Rc}from"./index-DsEsN0_K.js";import{h as ho}from"./useHighlight-C6Kb5G3l.js";import{b9 as po}from"./mermaid-DpPHPFQh.js";const zc={class:"label-row"},Bc=["for","title"],Kc={key:0,class:"required"},Uc=["id","aria-invalid"],Wc=["value"],jc={key:1,class:"markdown-field"},Hc=["id","aria-invalid","placeholder"],Jc={key:0,class:"future-hint"},Vc={key:2,class:"code-field"},qc=["id","aria-invalid","placeholder"],Gc={class:"future-hint"},Yc=["id","step","aria-invalid"],Zc=["id","aria-invalid"],Xc=["id","aria-invalid"],Qc=["id","aria-invalid"],ed={key:7,class:"field-description"},td={key:8,class:"field-error"},nd={__name:"EditorField",props:{field:Object,modelValue:[String,Number,null],error:[Array,null]},emits:["update:modelValue","openMarkdown"],setup(n,{emit:e}){const t=n,r=e,i=Xe({get:()=>t.modelValue??"",set:l=>r("update:modelValue",l)}),s=Xe(()=>["textarea","markdown","code"].includes(t.field.input_type)),o=Xe(()=>t.error&&t.error.length>0);return(l,a)=>(D(),R("div",{class:Mt(["field-group",{"field-full-width":s.value}])},[A("div",zc,[A("label",{for:n.field.key,title:n.field.description},[le(ne(n.field.title)+" ",1),n.field.required?(D(),R("span",Kc,"*")):Fe("",!0)],8,Bc),n.field.input_type==="markdown"?(D(),R("button",{key:0,type:"button",class:"btn-edit-markdown",title:"Open rich text editor",onClick:a[0]||(a[0]=u=>l.$emit("openMarkdown",n.field.key))},[...a[8]||(a[8]=[A("i",{class:"iconoir-edit-pencil"},null,-1),le(" Edit ",-1)])])):Fe("",!0)]),n.field.input_type==="select"?Ge((D(),R("select",{key:0,id:n.field.key,"onUpdate:modelValue":a[1]||(a[1]=u=>i.value=u),"aria-invalid":o.value?"true":void 0},[a[9]||(a[9]=A("option",{value:""},"Select...",-1)),(D(!0),R(yt,null,fn(n.field.options,u=>(D(),R("option",{key:u,value:u},ne(u),9,Wc))),128))],8,Uc)),[[Ri,i.value]]):n.field.input_type==="textarea"||n.field.input_type==="markdown"?(D(),R("div",jc,[Ge(A("textarea",{id:n.field.key,"onUpdate:modelValue":a[2]||(a[2]=u=>i.value=u),"aria-invalid":o.value?"true":void 0,placeholder:n.field.input_type==="markdown"?"Enter markdown content...":"One entry per line..."},null,8,Hc),[[Ft,i.value]]),n.field.input_type==="markdown"?(D(),R("small",Jc,[...a[10]||(a[10]=[A("i",{class:"iconoir-info-circle"},null,-1),le(" Supports Markdown formatting ",-1)])])):Fe("",!0)])):n.field.input_type==="code"?(D(),R("div",Vc,[Ge(A("textarea",{id:n.field.key,"onUpdate:modelValue":a[3]||(a[3]=u=>i.value=u),"aria-invalid":o.value?"true":void 0,placeholder:`Enter ${n.field.code_language||""} code...`,spellcheck:"false"},null,8,qc),[[Ft,i.value]]),A("small",Gc,[a[11]||(a[11]=A("i",{class:"iconoir-code"},null,-1)),le(" "+ne((n.field.code_language||"").charAt(0).toUpperCase()+(n.field.code_language||"").slice(1))+" code ",1)])])):n.field.input_type==="number"?Ge((D(),R("input",{key:3,id:n.field.key,type:"number","onUpdate:modelValue":a[4]||(a[4]=u=>i.value=u),step:n.field.step,"aria-invalid":o.value?"true":void 0},null,8,Yc)),[[Ft,i.value]]):n.field.input_type==="url"?Ge((D(),R("input",{key:4,id:n.field.key,type:"url","onUpdate:modelValue":a[5]||(a[5]=u=>i.value=u),placeholder:"https://...","aria-invalid":o.value?"true":void 0},null,8,Zc)),[[Ft,i.value]]):n.field.input_type==="list"?Ge((D(),R("input",{key:5,id:n.field.key,type:"text","onUpdate:modelValue":a[6]||(a[6]=u=>i.value=u),placeholder:"Comma-separated values","aria-invalid":o.value?"true":void 0},null,8,Xc)),[[Ft,i.value]]):Ge((D(),R("input",{key:6,id:n.field.key,type:"text","onUpdate:modelValue":a[7]||(a[7]=u=>i.value=u),"aria-invalid":o.value?"true":void 0},null,8,Qc)),[[Ft,i.value]]),n.field.description&&!["textarea","markdown","code"].includes(n.field.input_type)?(D(),R("small",ed,ne(n.field.description),1)):Fe("",!0),o.value?(D(),R("div",td,ne(n.error.join(", ")),1)):Fe("",!0)],2))}},rd=nr(nd,[["__scopeId","data-v-6dfd17ff"]]),id={class:"relations-editor"},sd={key:0,class:"no-relations"},od={id:"relations-list"},ld={class:"relation-text"},ad=["onClick"],ud={class:"add-relation-row"},cd=["value"],dd=["value"],fd={__name:"EditorRelations",props:{relations:Array,relationOptions:Array,instancesByKind:Object},emits:["update:relations"],setup(n,{emit:e}){const t=n,r=e,i=ie(""),s=ie(""),o=Xe(()=>[...t.relations].sort((f,d)=>(f.verb+f.kind+f.name).localeCompare(d.verb+d.kind+d.name))),l=Xe(()=>i.value?t.relationOptions.find(d=>d.combo===i.value)?.target_kind:null),a=Xe(()=>l.value?t.instancesByKind[l.value]||[]:[]);Es(i,()=>{s.value=""});function u(){if(!i.value||!s.value)return;const f=t.relationOptions.find(g=>g.combo===i.value);if(!f||t.relations.some(g=>g.verb===f.verb&&g.kind===f.target_kind&&g.name===s.value))return;const h=[...t.relations,{verb:f.verb,kind:f.target_kind,name:s.value}];r("update:relations",h),i.value="",s.value=""}function c(f){const d=t.relations.filter((h,g)=>g!==f);r("update:relations",d)}return(f,d)=>(D(),R("div",id,[!n.relationOptions||n.relationOptions.length===0?(D(),R("p",sd," This resource type has no defined relations. ")):(D(),R(yt,{key:1},[A("div",od,[(D(!0),R(yt,null,fn(o.value,(h,g)=>(D(),R("div",{key:`${h.verb}:${h.kind}:${h.name}`,class:"relation-item"},[A("span",ld,[A("strong",null,ne(h.verb),1),le(" → "+ne(h.kind)+": ",1),A("em",null,ne(h.name),1)]),A("button",{class:"btn-remove",type:"button",title:"Remove",onClick:_=>c(g)},[...d[2]||(d[2]=[A("i",{class:"iconoir-xmark"},null,-1)])],8,ad)]))),128))]),A("div",ud,[Ge(A("select",{"onUpdate:modelValue":d[0]||(d[0]=h=>i.value=h)},[d[3]||(d[3]=A("option",{value:""},"Select relation...",-1)),(D(!0),R(yt,null,fn(n.relationOptions,h=>(D(),R("option",{key:h.combo,value:h.combo},ne(h.verb)+" → "+ne(h.target_kind),9,cd))),128))],512),[[Ri,i.value]]),Ge(A("select",{"onUpdate:modelValue":d[1]||(d[1]=h=>s.value=h)},[d[4]||(d[4]=A("option",{value:""},"Select instance...",-1)),(D(!0),R(yt,null,fn(a.value,h=>(D(),R("option",{key:h,value:h},ne(h),9,dd))),128))],512),[[Ri,s.value]]),A("button",{class:"secondary btn-add",type:"button",onClick:u},[...d[5]||(d[5]=[A("i",{class:"iconoir-plus"},null,-1),le(" Add ",-1)])])])],64))]))}},gd=nr(fd,[["__scopeId","data-v-e27dc1c0"]]),hd={class:"yaml-output-container"},pd={key:0,class:"conflict-error"},md={id:"yaml-content"},yd={class:"language-yaml"},_d={key:0,class:"yaml-file-info"},vd={key:1,class:"yaml-instructions"},xd={class:"yaml-actions"},bd=["disabled"],Sd={__name:"EditorYamlOutput",props:{yaml:String,kind:String,name:String,contentHash:String,pathRef:String,inlineEditEnabled:Boolean},emits:["editAgain"],setup(n,{emit:e}){const t=n,r=ie(null),i=ie("idle"),s=ie("idle"),o=ie(null);ga(()=>{r.value&&ho(r.value)}),Es(()=>t.yaml,async()=>{await wc(),r.value&&ho(r.value)});async function l(){try{await navigator.clipboard.writeText(t.yaml),i.value="copied",setTimeout(()=>{i.value="idle"},2e3)}catch{const u=document.createElement("textarea");u.value=t.yaml,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u),i.value="copied",setTimeout(()=>{i.value="idle"},2e3)}}async function a(){s.value="saving",o.value=null;try{const u=await Tc(t.kind,t.name,t.yaml,t.contentHash);u.success?(s.value="saved",setTimeout(()=>{s.value="idle"},2e3)):u.conflict?(o.value=u.error,s.value="idle"):(alert("Save failed: "+u.error),s.value="idle")}catch(u){alert("Save failed: "+u.message),s.value="idle"}}return(u,c)=>(D(),R("div",hd,[o.value?(D(),R("div",pd,[c[1]||(c[1]=A("i",{class:"iconoir-warning-triangle"},null,-1)),A("span",null,ne(o.value),1)])):Fe("",!0),c[5]||(c[5]=A("p",{class:"yaml-success"},[A("i",{class:"iconoir-check-circle"}),le(" Generated YAML ")],-1)),A("div",{ref_key:"codeEl",ref:r},[A("pre",md,[A("code",yd,ne(n.yaml),1)])],512),A("footer",null,[n.pathRef?(D(),R("p",_d,[c[2]||(c[2]=A("i",{class:"iconoir-folder"},null,-1)),A("span",null,"Source: "+ne(n.pathRef),1)])):(D(),R("p",vd,[...c[3]||(c[3]=[A("i",{class:"iconoir-info-circle"},null,-1),A("span",null,[le(" Copy this YAML and save it to a "),A("code",null,".yaml"),le(" file in your resources directory, "),A("br"),le("then reload the application. ")],-1)])])),A("div",xd,[n.pathRef&&n.inlineEditEnabled?(D(),R("button",{key:0,type:"button",onClick:a,disabled:s.value==="saving",class:Mt({saved:s.value==="saved"})},[A("i",{class:Mt(s.value==="saving"?"iconoir-refresh":s.value==="saved"?"iconoir-check":"iconoir-check-circle")},null,2),le(" "+ne(s.value==="saving"?"Saving...":s.value==="saved"?"Saved!":"Save to File"),1)],10,bd)):Fe("",!0),A("button",{type:"button",onClick:l,class:Mt({copied:i.value==="copied"})},[A("i",{class:Mt(i.value==="copied"?"iconoir-check":"iconoir-copy")},null,2),le(" "+ne(i.value==="copied"?"Copied!":"Copy to Clipboard"),1)],2),A("button",{class:"secondary",type:"button",onClick:c[0]||(c[0]=f=>u.$emit("editAgain"))},[...c[4]||(c[4]=[A("i",{class:"iconoir-edit-pencil"},null,-1),le(" Edit Again ",-1)])])])])]))}},kd=nr(Sd,[["__scopeId","data-v-f7e6a550"]]);function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ha(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const He=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Cd=He&&"documentMode"in document?document.documentMode:null,Ke=He&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),kt=He&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),$r=!(!He||!("InputEvent"in window)||Cd)&&"getTargetRanges"in new window.InputEvent("input"),Xr=He&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),rr=He&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ed=He&&/Android/.test(navigator.userAgent),pa=He&&/^(?=.*Chrome).*/i.test(navigator.userAgent),zi=He&&Ed&&pa,Qr=He&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ke&&!pa,Td=0,wd=1,Nd=2,ma=128,Ad=1,Fd=2,Od=3,$d=4,Id=5,Md=6,Jn=Xr||rr||Qr?" ":"​",ei=`
2
+
3
+ `,Ts=kt?" ":Jn,ya="֑-߿יִ-﷽ﹰ-ﻼ",_a="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Pd=new RegExp("^[^"+_a+"]*["+ya+"]"),Ld=new RegExp("^[^"+ya+"]*["+_a+"]"),Wt={bold:1,capitalize:1024,code:16,highlight:ma,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Dd={directionless:1,unmergeable:2},Bi={center:2,end:6,justify:4,left:1,right:3,start:5},Rd={[Fd]:"center",[Md]:"end",[$d]:"justify",[Ad]:"left",[Od]:"right",[Id]:"start"},zd={normal:0,segmented:2,token:1},Bd={[Td]:"normal",[Nd]:"segmented",[wd]:"token"},mo="$config";function va(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(T(o)&&va(o,l,t,r,i,s),t.has(l)||s.delete(l),i.push(l)),o=o.getNextSibling()}}let Ki=!1,ws=0;function Kd(n){ws=n.timeStamp}function yi(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&li(n,t)!==void 0}function Ud(n,e,t){const r=Be(Le(t));let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&Vs(e,o,i,s,!1)}function Wd(n,e,t){if(N(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return pt(e)&&t.isAttached()}function jd(n,e,t,r){for(let i=n;i&&!Jf(i);i=lr(i)){const s=li(i,e);if(s!==void 0){const o=Q(s,t);if(o)return W(o)||!oe(i)?void 0:[i,o]}else if(i===r)return[r,Tu(t)]}}function xa(n,e,t){Ki=!0;const r=performance.now()-ws>100;try{tt(n,()=>{const i=$()||(function(d){return d.getEditorState().read(()=>{const h=$();return h!==null?h.clone():null})})(n),s=new Map,o=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let u=!1,c="";for(let d=0;d<e.length;d++){const h=e[d],g=h.type,_=h.target,p=jd(_,n,l,o);if(!p)continue;const[y,m]=p;if(g==="characterData")r&&O(m)&&pt(_)&&Wd(i,_,m)&&Ud(_,m,n);else if(g==="childList"){u=!0;const v=h.addedNodes;for(let x=0;x<v.length;x++){const C=v[x],E=Cu(C),k=C.parentNode;if(k!=null&&C!==a&&E===null&&!yi(C,k,n)){if(kt){const w=(oe(C)?C.innerText:null)||C.nodeValue;w&&(c+=w)}k.removeChild(C)}}const b=h.removedNodes,S=b.length;if(S>0){let x=0;for(let C=0;C<S;C++){const E=b[C];(yi(E,_,n)||a===E)&&(_.appendChild(E),x++)}S!==x&&s.set(y,m)}}}if(s.size>0)for(const[d,h]of s)h.reconcileObservedMutation(d,n);const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,_=h.target;for(let p=0;p<g.length;p++){const y=g[p],m=y.parentNode;m==null||y.nodeName!=="BR"||yi(y,_,n)||m.removeChild(y)}}t.takeRecords()}i!==null&&(u&&xe(i),kt&&Fu(n)&&i.insertRawText(c))})}finally{Ki=!1}}function ba(n){const e=n._observer;e!==null&&xa(n,e.takeRecords(),e)}function Sa(n){(function(e){ws===0&&Le(e).addEventListener("textInput",Kd,!0)})(n),n._observer=new MutationObserver((e,t)=>{xa(n,e,t)})}let Hd=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||qd).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function Ns(n,e){return new Hd(n,e)}function As(n,e,t="latest"){const r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function br(n,e,t){let r;if(ce(),typeof t=="function"){const s=n.getLatest(),o=As(s,e);if(r=t(o),e.isEqual(o,r))return s}else r=t;const i=n.getWritable();return Ca(i).updateFromKnown(e,r),i}function Jd(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:i}=ui(r);if(i&&i.stateConfigs)for(const s of i.stateConfigs){let o;"stateConfig"in s?(o=s.stateConfig,s.flat&&t.add(o.key)):o=s,e.set(o.key,o)}}return{flatKeys:t,sharedConfigMap:e}}let Vd=class ka{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,i=new Map,s=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:o}=this.sharedNodeState,l=s!==void 0?s:(function(a,u,c){let f=c.size;if(u)for(const d in u){const h=a.get(d);h&&c.has(h)||f++}return f})(o,r,i);this.size=l}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return yo(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new ka(e,t,(function(s,o,l){let a;if(l)for(const[u,c]of Object.entries(l)){const f=s.get(u);f?o.has(f)||o.set(f,f.parse(c)):(a=a||{},a[u]=c)}return a})(t.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||(s&&(delete s[r],this.unknownState=yo(s)),this.size++),i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}};function Ca(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new Vd(e,Ea(e));return e.__state=t,t}function Ea(n){return n.__state?n.__state.sharedNodeState:vu(ai(),n.getType()).sharedNodeState}function yo(n){if(n)for(const e in n)return n}function qd(n){return n}function _o(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const s=t?t.getValue(r):r.defaultValue;if(s!==i&&!r.isEqual(s,i))return!0}return!1}function vo(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[s,o]of Object.entries(r))if(!n.has(s)&&(n.add(s),o!==(i?i[s]:void 0)))return!0}return!1}function xo(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function bo(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,l=e.__style,a=n.__state,u=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===l)&&(n.__state===null||a===u||(function(c,f){if(c===f)return!0;if(c&&f&&c.size!==f.size)return!1;const d=new Set;return!(c&&_o(d,c,f)||f&&_o(d,f,c)||c&&vo(d,c,f)||f&&vo(d,f,c))})(a,u))}function So(n,e){const t=n.mergeWithSibling(e),r=q()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function ko(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&O(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(bo(e,r)){r=So(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&O(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(bo(r,t)){r=So(r,t);break}break}t.remove()}}else r.remove()}function Ir(n){return Co(n.anchor),Co(n.focus),n}function Co(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),O(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!T(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let jt,pe,Vn,ti,Ui,Wi,Ht,Ue,ji,qn,ae="",qe=null,Ot=null,ln=!1,Mr=!1;function Pr(n,e){const t=Ht.get(n);if(e!==null){const r=qi(n);r.parentNode===e&&e.removeChild(r)}if(Ue.has(n)||pe._keyToDOMMap.delete(n),T(t)){const r=Dr(t,Ht);Hi(r,0,r.length-1,null)}t!==void 0&&qs(qn,Vn,ti,t,"destroyed")}function Hi(n,e,t,r){for(let i=e;i<=t;++i){const s=n[i];s!==void 0&&Pr(s,r)}}function At(n,e){n.setProperty("text-align",e)}const Gd="40px";function Ta(n,e){const t=jt.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}if(e===0)return void n.style.setProperty("padding-inline-start","");const r=getComputedStyle(pe._rootElement||n).getPropertyValue("--lexical-indent-base-value")||Gd;n.style.setProperty("padding-inline-start",`calc(${e} * ${r})`)}function wa(n,e){const t=n.style;e===0?At(t,""):e===1?At(t,"left"):e===2?At(t,"center"):e===3?At(t,"right"):e===4?At(t,"justify"):e===5?At(t,"start"):e===6&&At(t,"end")}function Ji(n,e){const t=(function(r){const i=r.__dir;if(i!==null)return i;if(ue(r))return null;const s=r.getParentOrThrow();return ue(s)&&s.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function Lr(n,e){const t=Ue.get(n);t===void 0&&F(60);const r=t.createDOM(jt,pe);if((function(i,s,o){const l=o._keyToDOMMap;(function(a,u,c){const f=`__lexicalKey_${u._key}`;a[f]=c})(s,o,i),l.set(i,s)})(n,r,pe),O(t)?r.setAttribute("data-lexical-text","true"):W(t)&&r.setAttribute("data-lexical-decorator","true"),T(t)){const i=t.__indent,s=t.__size;if(Ji(r,t),i!==0&&Ta(r,i),s!==0){const l=s-1;Vi(Dr(t,Ue),t,0,l,t.getDOMSlot(r))}const o=t.__format;o!==0&&wa(r,o),t.isInline()||Na(null,t,r)}else{const i=t.getTextContent();if(W(t)){const s=t.decorate(pe,jt);s!==null&&Aa(n,s),r.contentEditable="false"}ae+=i}return e!==null&&e.insertChild(r),qs(qn,Vn,ti,t,"created"),r}function Vi(n,e,t,r,i){const s=ae;ae="";let o=t;for(;o<=r;++o){Lr(n[o],i);const l=Ue.get(n[o]);l!==null&&O(l)?qe===null&&(qe=l.getFormat(),Ot=l.getStyle()):T(l)&&o<r&&!l.isInline()&&(ae+=ei)}i.element.__lexicalTextContent=ae,ae=s+ae}function Eo(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return ee(r)?"line-break":W(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Na(n,e,t){const r=Eo(n,Ht),i=Eo(e,Ue);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function Yd(n,e,t){var r;qe=null,Ot=null,(function(i,s,o){const l=ae,a=i.__size,u=s.__size;ae="";const c=o.element;if(a===1&&u===1){const f=i.__first,d=s.__first;if(f===d)Sr(f,c);else{const g=qi(f),_=Lr(d,null);try{c.replaceChild(_,g)}catch(p){if(typeof p=="object"&&p!=null){const y=`${p.toString()} Parent: ${c.tagName}, new child: {tag: ${_.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(y)}throw p}Pr(f,null)}const h=Ue.get(d);O(h)&&qe===null&&(qe=h.getFormat(),Ot=h.getStyle())}else{const f=Dr(i,Ht),d=Dr(s,Ue);if(f.length!==a&&F(227),d.length!==u&&F(228),a===0)u!==0&&Vi(d,0,0,u-1,o);else if(u===0){if(a!==0){const h=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;Hi(f,0,a-1,h?null:c),h&&(c.textContent="")}}else(function(h,g,_,p,y,m){const v=p-1,b=y-1;let S,x,C=m.getFirstChild(),E=0,k=0;for(;E<=v&&k<=b;){const P=g[E],K=_[k];if(P===K)C=_i(Sr(K,m.element)),E++,k++;else{if(x===void 0&&(x=To(_,k)),S===void 0)S=To(g,E);else if(!S.has(P)){E++;continue}if(!x.has(P)){C=_i(qi(P)),Pr(P,m.element),E++,S.delete(P);continue}if(S.has(K)){const X=Sn(pe,K);X!==C&&m.withBefore(C).insertChild(X),C=_i(Sr(K,m.element)),E++,k++}else Lr(K,m.withBefore(C)),k++}const U=Ue.get(K);U!==null&&O(U)?qe===null&&(qe=U.getFormat(),Ot=U.getStyle()):T(U)&&k<=b&&!U.isInline()&&(ae+=ei)}const w=E>v,M=k>b;if(w&&!M){const P=_[b+1],K=P===void 0?null:pe.getElementByKey(P);Vi(_,0,k,b,m.withBefore(K))}else M&&!w&&Hi(g,E,v,m.element)})(0,f,d,a,u,o)}c.__lexicalTextContent=ae,ae=l+ae})(n,e,e.getDOMSlot(t)),r=e,qe==null||qe===r.__textFormat||Mr||r.setTextFormat(qe),(function(i){Ot==null||Ot===i.__textStyle||Mr||i.setTextStyle(Ot)})(e)}function Dr(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&F(101),t.push(r),r=i.__next}return t}function Sr(n,e){const t=Ht.get(n);let r=Ue.get(n);t!==void 0&&r!==void 0||F(61);const i=ln||Wi.has(n)||Ui.has(n),s=Sn(pe,n);if(t===r&&!i){let o;if(T(t)){const l=s.__lexicalTextContent;typeof l=="string"?o=l:(o=t.getTextContent(),s.__lexicalTextContent=o)}else o=t.getTextContent();return ae+=o,s}if(t!==r&&i&&qs(qn,Vn,ti,r,"updated"),r.updateDOM(t,s,jt)){const o=Lr(n,null);return e===null&&F(62),e.replaceChild(o,s),Pr(n,null),o}if(T(t)){T(r)||F(334,n);const o=r.__indent;(ln||o!==t.__indent)&&Ta(s,o);const l=r.__format;if((ln||l!==t.__format)&&wa(s,l),i)Yd(t,r,s),ue(r)||r.isInline()||Na(t,r,s);else{const a=s.__lexicalTextContent;let u;typeof a=="string"?u=a:(u=t.getTextContent(),s.__lexicalTextContent=u),ae+=u}if((ln||r.__dir!==t.__dir)&&(Ji(s,r),ue(r)&&!ln))for(const a of r.getChildren())T(a)&&Ji(Sn(pe,a.getKey()),a)}else{const o=r.getTextContent();if(W(r)){const l=r.decorate(pe,jt);l!==null&&Aa(n,l)}ae+=o}if(!Mr&&ue(r)&&r.__cachedText!==ae){const o=r.getWritable();o.__cachedText=ae,r=o}return s}function Aa(n,e){let t=pe._pendingDecorators;const r=pe._decorators;if(t===null){if(r[n]===e)return;t=Eu(pe)}t[n]=e}function _i(n){let e=n.nextSibling;return e!==null&&e===pe._blockCursorElement&&(e=e.nextSibling),e}function To(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function Zd(n,e,t,r,i,s){ae="",ln=r===2,pe=t,jt=t._config,Vn=t._nodes,ti=pe._listeners.mutation,Ui=i,Wi=s,Ht=n._nodeMap,Ue=e._nodeMap,Mr=e._readOnly,ji=new Map(t._keyToDOMMap);const o=new Map;return qn=o,Sr("root",null),pe=void 0,Vn=void 0,Ui=void 0,Wi=void 0,Ht=void 0,Ue=void 0,jt=void 0,ji=void 0,qn=void 0,o}function qi(n){const e=ji.get(n);return e===void 0&&F(75,n),e}function L(n){return{type:n}}const Fa=L("SELECTION_CHANGE_COMMAND"),Xd=L("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Oa=L("CLICK_COMMAND"),$a=L("BEFORE_INPUT_COMMAND"),Ia=L("INPUT_COMMAND"),Ma=L("COMPOSITION_START_COMMAND"),Pa=L("COMPOSITION_END_COMMAND"),Rt=L("DELETE_CHARACTER_COMMAND"),gn=L("INSERT_LINE_BREAK_COMMAND"),Gn=L("INSERT_PARAGRAPH_COMMAND"),hn=L("CONTROLLED_TEXT_INSERTION_COMMAND"),Fs=L("PASTE_COMMAND"),Gi=L("REMOVE_TEXT_COMMAND"),Yn=L("DELETE_WORD_COMMAND"),Zn=L("DELETE_LINE_COMMAND"),ct=L("FORMAT_TEXT_COMMAND"),Os=L("UNDO_COMMAND"),$s=L("REDO_COMMAND"),La=L("KEYDOWN_COMMAND"),Da=L("KEY_ARROW_RIGHT_COMMAND"),Yi=L("MOVE_TO_END"),Ra=L("KEY_ARROW_LEFT_COMMAND"),Rr=L("MOVE_TO_START"),_n=L("KEY_ARROW_UP_COMMAND"),zr=L("KEY_ARROW_DOWN_COMMAND"),Br=L("KEY_ENTER_COMMAND"),za=L("KEY_SPACE_COMMAND"),Ba=L("KEY_BACKSPACE_COMMAND"),Ka=L("KEY_ESCAPE_COMMAND"),Ua=L("KEY_DELETE_COMMAND"),Is=L("KEY_TAB_COMMAND"),Zi=L("INSERT_TAB_COMMAND"),zt=L("INDENT_CONTENT_COMMAND"),cn=L("OUTDENT_CONTENT_COMMAND"),Wa=L("DROP_COMMAND"),Qd=L("FORMAT_ELEMENT_COMMAND"),ja=L("DRAGSTART_COMMAND"),Ha=L("DRAGOVER_COMMAND"),ef=L("DRAGEND_COMMAND"),ni=L("COPY_COMMAND"),Ms=L("CUT_COMMAND"),Xi=L("SELECT_ALL_COMMAND"),tf=L("CLEAR_EDITOR_COMMAND"),nf=L("CLEAR_HISTORY_COMMAND"),cr=L("CAN_REDO_COMMAND"),dr=L("CAN_UNDO_COMMAND"),rf=L("FOCUS_COMMAND"),sf=L("BLUR_COMMAND"),of=L("KEY_MODIFIER_COMMAND"),st=Object.freeze({}),Qi=[["keydown",function(n,e){Xn=n.timeStamp,Ja=n.key,!e.isComposing()&&I(e,La,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;On(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&tt(e,()=>{xu(t)||(ns=!0)})}],["compositionstart",function(n,e){I(e,Ma,n)}],["compositionend",function(n,e){kt?Rn=!0:rr||!Xr&&!Qr?I(e,Pa,n):(kr=!0,Cr=n.data)}],["input",function(n,e){n.stopPropagation(),tt(e,()=>{e.dispatchCommand(Ia,n)},{event:n}),an=null}],["click",function(n,e){tt(e,()=>{const t=$(),r=Be(Le(e)),i=Nn();if(r){if(N(t)){const s=t.anchor,o=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!ue(o)&&te().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const l=ze(o,a=>T(a)&&!a.isInline());T(l)&&l.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const s=r.anchorNode;(oe(s)||pt(s))&&xe(Ds(i,r,e,n))}}I(e,Oa,n)})}],["cut",st],["copy",st],["dragstart",st],["dragover",st],["dragend",st],["paste",st],["focus",st],["blur",st],["drop",st]];$r&&Qi.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType;i==="deleteCompositionText"||kt&&Fu(r)||i!=="insertCompositionText"&&I(r,$a,t)})(n,e)]);let Xn=0,Ja=null,Va=0,an=null;const es=new WeakMap,Kr=new WeakMap;let ts=!1,ns=!1,Kn=!1,Rn=!1,kr=!1,Cr="",It=null,qa=[0,"",0,"root",0];function Ga(n,e,t,r,i){const s=n.anchor,o=n.focus,l=s.getNode(),a=q(),u=Be(Le(a)),c=u!==null?u.anchorNode:null,f=s.key,d=a.getElementByKey(f),h=t.length;return f!==o.key||!O(l)||(!i&&(!$r||Va<r+50)||l.isDirty()&&h<2||wu(t))&&s.offset!==o.offset&&!l.isComposing()||at(l)||l.isDirty()&&h>1||(i||!$r)&&d!==null&&!l.isComposing()&&c!==xn(d)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||!l.isComposing()&&(l.getFormat()!==n.format||l.getStyle()!==n.style)||(function(g,_){if(_.isSegmented())return!0;if(!g.isCollapsed())return!1;const p=g.anchor.offset,y=_.getParentOrThrow(),m=Bt(_);return p===0?!_.canInsertTextBefore()||!y.canInsertTextBefore()&&!_.isComposing()||m||(function(v){const b=v.getPreviousSibling();return(O(b)||T(b)&&b.isInline())&&!b.canInsertTextAfter()})(_):p===_.getTextContentSize()&&(!_.canInsertTextAfter()||!y.canInsertTextAfter()&&!_.isComposing()||m)})(n,l)}function wo(n,e){return pt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function No(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;ts&&(ts=!1,wo(r,i)&&wo(s,o)&&!It)||tt(e,()=>{if(!t)return void xe(null);if(!or(e,r,s))return;let l=$();if(It&&N(l)&&l.isCollapsed()){const a=l.anchor,u=It.anchor;(a.key===u.key&&a.offset===u.offset+1||a.offset===1&&u.getNode().is(a.getNode().getPreviousSibling()))&&(l=It.clone(),xe(l))}if(It=null,N(l)){const a=l.anchor,u=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const c=Le(e).event,f=c?c.timeStamp:performance.now(),[d,h,g,_,p]=qa,y=te(),m=e.isComposing()===!1&&y.getTextContent()==="";if(f<p+200&&a.offset===g&&a.key===_)Er(l,d,h);else if(a.type==="text")O(u)||F(141),Ya(l,u);else if(a.type==="element"&&!m){T(u)||F(259);const v=a.getNode();v.isEmpty()?(function(b,S){const x=S.getTextFormat(),C=S.getTextStyle();Er(b,x,C)})(l,v):Er(l,0,"")}}else{const c=a.key,f=l.focus.key,d=l.getNodes(),h=d.length,g=l.isBackward(),_=g?o:i,p=g?i:o,y=g?f:c,m=g?c:f;let v=2047,b=!1;for(let S=0;S<h;S++){const x=d[S],C=x.getTextContentSize();if(O(x)&&C!==0&&!(S===0&&x.__key===y&&_===C||S===h-1&&x.__key===m&&p===0)&&(b=!0,v&=x.getFormat(),v===0))break}l.format=b?v:0}}I(e,Fa,void 0)})}function Er(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Ya(n,e){Er(n,e.getFormat(),e.getStyle())}function Za(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function lf(n){const e=n.inputType,t=Za(n),r=q(),i=$();if(e==="deleteContentBackward"){if(i===null){const f=Nn();if(!N(f))return!0;xe(f.clone())}if(N(i)){const f=i.anchor.key===i.focus.key;if(s=n.timeStamp,Ja==="MediaLast"&&s<Xn+30&&r.isComposing()&&f){if(he(null),Xn=0,setTimeout(()=>{tt(r,()=>{he(null)})},30),N(i)){const d=i.anchor.getNode();d.markDirty(),O(d)||F(142),Ya(i,d)}}else{he(null),n.preventDefault();const d=i.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),_=i.anchor.offset===0&&i.focus.offset===h.length;let p=zi&&f&&!_&&g;if(p&&i.isCollapsed()&&(p=!W(as(i.anchor,!0))),!p){I(r,Rt,!0);const y=$();zi&&N(y)&&y.isCollapsed()&&(It=y,setTimeout(()=>It=null))}}return!0}}var s;if(!N(i))return!0;const o=n.data;an!==null&&Js(!1,r,an),i.dirty&&an===null||!i.isCollapsed()||ue(i.anchor.getNode())||t===null||i.applyDOMRange(t),an=null;const l=i.anchor,a=i.focus,u=l.getNode(),c=a.getNode();if(e==="insertText"||e==="insertTranspose"){if(o===`
4
+ `)n.preventDefault(),I(r,gn,!1);else if(o===ei)n.preventDefault(),I(r,Gn,void 0);else if(o==null&&n.dataTransfer){const f=n.dataTransfer.getData("text/plain");n.preventDefault(),i.insertRawText(f)}else o!=null&&Ga(i,t,o,n.timeStamp,!0)?(n.preventDefault(),I(r,hn,o)):an=o;return Va=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":I(r,hn,n);break;case"insertFromComposition":he(null),I(r,hn,n);break;case"insertLineBreak":he(null),I(r,gn,!1);break;case"insertParagraph":he(null),Kn&&!rr?(Kn=!1,I(r,gn,!1)):I(r,Gn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":I(r,Fs,n);break;case"deleteByComposition":(function(f,d){return f!==d||T(f)||T(d)||!Bt(f)||!Bt(d)})(u,c)&&I(r,Gi,n);break;case"deleteByDrag":case"deleteByCut":I(r,Gi,n);break;case"deleteContent":I(r,Rt,!1);break;case"deleteWordBackward":I(r,Yn,!0);break;case"deleteWordForward":I(r,Yn,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":I(r,Zn,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":I(r,Zn,!1);break;case"formatStrikeThrough":I(r,ct,"strikethrough");break;case"formatBold":I(r,ct,"bold");break;case"formatItalic":I(r,ct,"italic");break;case"formatUnderline":I(r,ct,"underline");break;case"historyUndo":I(r,Os,void 0);break;case"historyRedo":I(r,$s,void 0)}return!0}function af(n){if(oe(n.target)&&xu(n.target))return!0;const e=q(),t=$(),r=n.data,i=Za(n);if(r!=null&&N(t)&&Ga(t,i,r,n.timeStamp,!1)){Rn&&(Ur(e,r),Rn=!1);const s=t.anchor.getNode(),o=Be(Le(e));if(o===null)return!0;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,u=l?t.focus.offset:t.anchor.offset;$r&&!t.isCollapsed()&&O(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,a)+r+s.getTextContent().slice(a+u)===Au(o.anchorNode)||I(e,hn,r);const c=r.length;kt&&c>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),zi&&e.isComposing()&&(Xn=0,he(null))}else Js(!1,e,r!==null?r:void 0),Rn&&(Ur(e,r||void 0),Rn=!1);return(function(){ce();const s=q();ba(s)})(),!0}function uf(n){const e=q(),t=$();if(N(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();he(r.key),Gs(tu),(n.timeStamp<Xn+30||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||O(i)&&i.getStyle()!==t.style)&&I(e,hn,Ts)}return!0}function cf(n){return Ur(q(),n.data),Gs(nu),!0}function Ur(n,e){const t=n._compositionKey;if(he(null),t!==null&&e!=null){if(e===""){const r=Q(t),i=xn(n.getElementByKey(t));if(i!==null&&i.nodeValue!==null&&O(r)){const s=Be(Le(n));let o=null,l=null;s!==null&&s.anchorNode===i&&(o=s.anchorOffset,l=s.focusOffset),Vs(r,i.nodeValue,o,l,!0)}return}if(e[e.length-1]===`
5
+ `){const r=$();if(N(r)||be(r)){if(N(r)){const i=r.focus;r.anchor.set(i.key,i.offset,i.type)}return void I(n,Br,null)}}}Js(!0,n,e)}function df(n){const e=q();if(n.key==null)return!0;if(kr){if(tl(n))return tt(e,()=>{Ur(e,Cr)}),kr=!1,Cr="",!0;kr=!1,Cr=""}if((function(t){return H(t,"ArrowRight",{shiftKey:"any"})})(n))I(e,Da,n);else if((function(t){return H(t,"ArrowRight",lt)})(n))I(e,Yi,n);else if((function(t){return H(t,"ArrowLeft",{shiftKey:"any"})})(n))I(e,Ra,n);else if((function(t){return H(t,"ArrowLeft",lt)})(n))I(e,Rr,n);else if((function(t){return H(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))I(e,_n,n);else if((function(t){return H(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))I(e,zr,n);else if((function(t){return H(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))Kn=!0,I(e,Br,n);else if((function(t){return t.key===" "})(n))I(e,za,n);else if((function(t){return Ke&&H(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),Kn=!0,I(e,gn,!0);else if((function(t){return H(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))Kn=!1,I(e,Br,n);else if((function(t){return H(t,"Backspace",{shiftKey:"any"})||Ke&&H(t,"h",{ctrlKey:!0})})(n))tl(n)?I(e,Ba,n):(n.preventDefault(),I(e,Rt,!0));else if((function(t){return t.key==="Escape"})(n))I(e,Ka,n);else if((function(t){return H(t,"Delete",{})||Ke&&H(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?I(e,Ua,n):(n.preventDefault(),I(e,Rt,!1));else if((function(t){return H(t,"Backspace",el)})(n))n.preventDefault(),I(e,Yn,!0);else if((function(t){return H(t,"Delete",el)})(n))n.preventDefault(),I(e,Yn,!1);else if((function(t){return Ke&&H(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),I(e,Zn,!0);else if((function(t){return Ke&&(H(t,"Delete",{metaKey:!0})||H(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),I(e,Zn,!1);else if((function(t){return H(t,"b",lt)})(n))n.preventDefault(),I(e,ct,"bold");else if((function(t){return H(t,"u",lt)})(n))n.preventDefault(),I(e,ct,"underline");else if((function(t){return H(t,"i",lt)})(n))n.preventDefault(),I(e,ct,"italic");else if((function(t){return H(t,"Tab",{shiftKey:"any"})})(n))I(e,Is,n);else if((function(t){return H(t,"z",lt)})(n))n.preventDefault(),I(e,Os,void 0);else if((function(t){return Ke?H(t,"z",{metaKey:!0,shiftKey:!0}):H(t,"y",{ctrlKey:!0})||H(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),I(e,$s,void 0);else{const t=e._editorState._selection;t===null||N(t)?nl(n)&&(n.preventDefault(),I(e,Xi,n)):(function(r){return H(r,"c",lt)})(n)?(n.preventDefault(),I(e,ni,n)):(function(r){return H(r,"x",lt)})(n)?(n.preventDefault(),I(e,Ms,n)):nl(n)&&(n.preventDefault(),I(e,Xi,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(of,n),!0}function Xa(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const pn=new Map;function Qa(n){const e=Wf(n.target);if(e===null)return;const t=bu(e.anchorNode);if(t===null)return;ns&&(ns=!1,tt(t,()=>{const a=Nn(),u=e.anchorNode;(oe(u)||pt(u))&&xe(Ds(a,e,t,n))}));const r=Hs(t),i=r[r.length-1],s=i._key,o=pn.get(s),l=o||i;l!==t&&No(e,l,!1),No(e,t,!0),t!==i?pn.set(s,t):o&&pn.delete(s)}function Ao(n){n._lexicalHandled=!0}function Fo(n){return n._lexicalHandled===!0}function ff(n){const e=es.get(n);if(e===void 0)return;const t=Kr.get(e);if(t===void 0)return;const r=t-1;r>=0||F(164),es.delete(n),Kr.set(e,r),r===0&&e.removeEventListener("selectionchange",Qa);const i=oi(n);js(i)?((function(o){if(o._parentEditor!==null){const l=Hs(o),a=l[l.length-1]._key;pn.get(a)===o&&pn.delete(a)}else pn.delete(o._key)})(i),n.__lexicalEditor=null):i&&F(198);const s=Xa(n);for(let o=0;o<s.length;o++)s[o]();n.__lexicalEventHandles=[]}function rs(n,e,t){ce();const r=n.__key,i=n.getParent();if(i===null)return;const s=(function(l){const a=$();if(!N(a)||!T(l))return a;const{anchor:u,focus:c}=a,f=u.getNode(),d=c.getNode();return us(f,l)&&u.set(l.__key,0,"element"),us(d,l)&&c.set(l.__key,0,"element"),a})(n);let o=!1;if(N(s)&&e){const l=s.anchor,a=s.focus;l.key===r&&(Hr(l,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0),a.key===r&&(Hr(a,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0)}else be(s)&&e&&n.isSelected()&&n.selectPrevious();if(N(s)&&e&&!o){const l=n.getIndexWithinParent();Kt(n),jr(s,i,l,-1)}else Kt(n);t||ke(i)||i.canBeEmpty()||!i.isEmpty()||rs(i,e),e&&s&&ue(i)&&i.isEmpty()&&i.selectEnd()}const eu=Symbol.for("ephemeral");function Wr(n){return n[eu]||!1}class et{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=ui(this);return e===void 0&&F(64,this.name),e}static clone(e){F(65,this.name)}$config(){return{}}config(e,t){const r=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:r,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Df(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=Q(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||$();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(O(this))return r;if(N(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(W(this)&&this.isInline()&&i){const s=t.isBackward()?t.focus:t.anchor;if(i.is(s.getNode())&&s.offset===i.getChildrenSize()&&this.is(i.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:Q(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 T(e)||e===this&&W(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:Q(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:Q(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=T(this)?this:this.getParent(),r=T(e)?e:e.getParent(),i=t&&r?wr(t,r):null;return i?i.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=wr(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?Lu(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&F(279),!1)))}isParentOf(e){const t=wr(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let s=this;for(;s!==null;){const o=s.__key;if(i.has(o)||(i.add(o),r.push(s)),s===e)break;const l=T(s)?t?s.getFirstChild():s.getLastChild():null;if(l!==null){s=l;continue}const a=t?s.getNextSibling():s.getPreviousSibling();if(a!==null){s=a;continue}const u=s.getParentOrThrow();if(i.has(u.__key)||r.push(u),u===e)break;let c=null,f=u;do{if(f===null&&F(68),c=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;c!==null||i.has(f.__key)||r.push(f)}while(c===null);s=c}return t||r.reverse(),r}isDirty(){const e=q()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Wr(this))return this;const e=Q(this.__key);return e===null&&F(113),e}getWritable(){if(Wr(this))return this;ce();const e=Tt(),t=q(),r=e._nodeMap,i=this.__key,s=this.getLatest(),o=t._cloneNotNeeded,l=$();if(l!==null&&l.setCachedNodes(null),o.has(i))return Vr(s),s;const a=Iu(s);return o.add(i),Vr(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){F(70)}updateDOM(e,t,r){F(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){F(18,this.name)}updateFromJSON(e){return(function(t,r){const i=t.getWritable(),s=r.$;let o=s;for(const l of Ea(i).flatKeys)l in r&&(o!==void 0&&o!==s||(o={...s}),o[l]=r[l]);return(i.__state||o)&&Ca(t).updateFromJSON(o),i})(this,e)}static transform(){return null}remove(e){rs(this,!0,e)}replace(e,t){ce();let r=$();r!==null&&(r=r.clone()),Ci(this,e);const i=this.getLatest(),s=this.__key,o=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),u=a.__size;Kt(l);const c=i.getPreviousSibling(),f=i.getNextSibling(),d=i.__prev,h=i.__next,g=i.__parent;if(rs(i,!1,!0),c===null?a.__first=o:c.getWritable().__next=o,l.__prev=d,f===null?a.__last=o:f.getWritable().__prev=o,l.__next=h,l.__parent=g,a.__size=u,t&&(T(this)&&T(l)||F(139),this.getChildren().forEach(_=>{l.append(_)})),N(r)){xe(r);const _=r.anchor,p=r.focus;_.key===s&&Po(_,l),p.key===s&&Po(p,l)}return _t()===s&&he(o),l}insertAfter(e,t=!0){ce(),Ci(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.getParent(),o=$();let l=!1,a=!1;if(s!==null){const h=e.getIndexWithinParent();if(Kt(i),N(o)){const g=s.__key,_=o.anchor,p=o.focus;l=_.type==="element"&&_.key===g&&_.offset===h+1,a=p.type==="element"&&p.key===g&&p.offset===h+1}}const u=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),f=i.__key,d=r.__next;if(u===null?c.__last=f:u.getWritable().__prev=f,c.__size++,r.__next=f,i.__next=d,i.__prev=r.__key,i.__parent=r.__parent,t&&N(o)){const h=this.getIndexWithinParent();jr(o,c,h+1);const g=c.__key;l&&o.anchor.set(g,h+2,"element"),a&&o.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){ce(),Ci(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.__key;Kt(i);const o=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,u=this.getIndexWithinParent();o===null?l.__first=s:o.getWritable().__next=s,l.__size++,r.__prev=s,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent;const c=$();return t&&N(c)&&jr(c,this.getParentOrThrow(),u),e}isParentRequired(){return!1}createParentElementNode(){return Z()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){ce();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(T(r))return r.select();if(!O(r)){const s=r.getIndexWithinParent()+1;return i.select(s,s)}return r.select(e,t)}selectNext(e,t){ce();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(T(r))return r.select(0,0);if(!O(r)){const s=r.getIndexWithinParent();return i.select(s,s)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const is="historic",gf="history-push",Un="history-merge",hf="paste",pf="collaboration",mf="skip-scroll-into-view",yf="skip-dom-selection",Oo="skip-selection-focus",tu="composition-start",nu="composition-end";class Tn extends et{static getType(){return"linebreak"}static clone(e){return new Tn(e.__key)}constructor(e){super(e)}getTextContent(){return`
6
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){const r=t.parentElement;if(r!==null&&qr(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&fr(i)){const s=r.lastChild;if(s===t||s.previousSibling===t&&fr(s))return!0}}return!1})(e)||(function(t){const r=t.parentElement;if(r!==null&&qr(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&fr(i))return!1;const s=r.lastChild;if(s===t||s.previousSibling===t&&fr(s))return!0}return!1})(e)?null:{conversion:_f,priority:0}}}static importJSON(e){return Ie().updateFromJSON(e)}}function _f(n){return{node:Ie()}}function Ie(){return Je(new Tn)}function ee(n){return n instanceof Tn}function fr(n){return pt(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function vi(n,e){return 16&e?"code":e&ma?"mark":32&e?"sub":64&e?"sup":null}function xi(n,e){return 1&e?"strong":2&e?"em":"span"}function ru(n,e,t,r,i){const s=r.classList;let o=mn(i,"base");o!==void 0&&s.add(...o),o=mn(i,"underlineStrikethrough");let l=!1;const a=8&e&&4&e;o!==void 0&&(8&t&&4&t?(l=!0,a||s.add(...o)):a&&s.remove(...o));for(const u in Wt){const c=Wt[u];if(o=mn(i,u),o!==void 0)if(t&c){if(l&&(u==="underline"||u==="strikethrough")){e&c&&s.remove(...o);continue}((e&c)===0||a&&u==="underline"||u==="strikethrough")&&s.add(...o)}else e&c&&s.remove(...o)}}function iu(n,e,t){const r=e.firstChild,i=t.isComposing(),s=n+(i?Jn:"");if(r==null)e.textContent=s;else{const o=r.nodeValue;if(o!==s)if(i||kt){const[l,a,u]=(function(c,f){const d=c.length,h=f.length;let g=0,_=0;for(;g<d&&g<h&&c[g]===f[g];)g++;for(;_+g<d&&_+g<h&&c[d-_-1]===f[h-_-1];)_++;return[g,d-g-_,f.slice(g,h-_)]})(o,s);a!==0&&r.deleteData(l,a),r.insertData(l,u)}else r.nodeValue=s}}function $o(n,e,t,r,i,s){iu(i,n,e);const o=s.theme.text;o!==void 0&&ru(0,0,r,n,o)}function gr(n,e){const t=document.createElement(e);return t.appendChild(n),t}class rt extends et{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new rt(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,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 Bd[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===_t()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Wt[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Jr(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const r=this.__format,i=vi(0,r),s=xi(0,r),o=i===null?s:i,l=document.createElement(o);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),i!==null&&(a=document.createElement(s),l.appendChild(a)),$o(a,this,0,r,this.__text,e);const u=this.__style;return u!==""&&(l.style.cssText=u),l}updateDOM(e,t,r){const i=this.__text,s=e.__format,o=this.__format,l=vi(0,s),a=vi(0,o),u=xi(0,s),c=xi(0,o);if((l===null?u:l)!==(a===null?c:a))return!0;if(l===a&&u!==c){const _=t.firstChild;_==null&&F(48);const p=document.createElement(c);return $o(p,this,0,o,i,r),t.replaceChild(p,_),!1}let f=t;a!==null&&l!==null&&(f=t.firstChild,f==null&&F(49)),iu(i,f,this);const d=r.theme.text;d!==void 0&&s!==o&&ru(0,s,o,f,d);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Sf,priority:0}),b:()=>({conversion:xf,priority:0}),code:()=>({conversion:ot,priority:0}),em:()=>({conversion:ot,priority:0}),i:()=>({conversion:ot,priority:0}),mark:()=>({conversion:ot,priority:0}),s:()=>({conversion:ot,priority:0}),span:()=>({conversion:vf,priority:0}),strong:()=>({conversion:ot,priority:0}),sub:()=>({conversion:ot,priority:0}),sup:()=>({conversion:ot,priority:0}),u:()=>({conversion:ot,priority:0})}}static importJSON(e){return G().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return oe(t)||F(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=gr(t,"b")),this.hasFormat("italic")&&(t=gr(t,"i")),this.hasFormat("strikethrough")&&(t=gr(t,"s")),this.hasFormat("underline")&&(t=gr(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?Wt[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?Dd[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Jr(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=zd[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){ce();let r=e,i=t;const s=$(),o=this.getTextContent(),l=this.__key;if(typeof o=="string"){const a=o.length;r===void 0&&(r=a),i===void 0&&(i=a)}else r=0,i=0;if(!N(s))return lu(l,r,l,i,"text","text");{const a=_t();a!==s.anchor.key&&a!==s.focus.key||he(l),s.setTextNodeRange(this,r,this,i)}return s}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const s=this.getWritable(),o=s.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const u=$();if(i&&N(u)){const f=e+l;u.setTextNodeRange(s,f,s,f)}const c=o.slice(0,a)+r+o.slice(a+t);return s.__text=c,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ce();const t=this.getLatest(),r=t.getTextContent();if(r==="")return[];const i=t.__key,s=_t(),o=r.length;e.sort((E,k)=>E-k),e.push(o);const l=[],a=e.length;for(let E=0,k=0;E<o&&k<=a;k++){const w=e[k];w>E&&(l.push(r.slice(E,w)),E=w)}const u=l.length;if(u===1)return[t];const c=l[0],f=t.getParent();let d;const h=t.getFormat(),g=t.getStyle(),_=t.__detail;let p=!1,y=null,m=null;const v=$();if(N(v)){const[E,k]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];E.type==="text"&&E.key===i&&(y=E),k.type==="text"&&k.key===i&&(m=k)}t.isSegmented()?(d=G(c),d.__format=h,d.__style=g,d.__detail=_,d.__state=xo(t,d),p=!0):d=t.setTextContent(c);const b=[d];for(let E=1;E<u;E++){const k=G(l[E]);k.__format=h,k.__style=g,k.__detail=_,k.__state=xo(t,k);const w=k.__key;s===i&&he(w),b.push(k)}const S=y?y.offset:null,x=m?m.offset:null;let C=0;for(const E of b){if(!y&&!m)break;const k=C+E.getTextContentSize();if(y!==null&&S!==null&&S<=k&&S>=C&&(y.set(E.getKey(),S-C,"text"),S<k&&(y=null)),m!==null&&x!==null&&x<=k&&x>=C){m.set(E.getKey(),x-C,"text");break}C=k}if(f!==null){(function(w){const M=w.getPreviousSibling(),P=w.getNextSibling();M!==null&&Vr(M),P!==null&&Vr(P)})(this);const E=f.getWritable(),k=this.getIndexWithinParent();p?(E.splice(k,0,b),this.remove()):E.splice(k,1,b),N(v)&&jr(v,f,k,u-1)}return b}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||F(50);const r=this.__key,i=e.__key,s=this.__text,o=s.length;_t()===i&&he(r);const l=$();if(N(l)){const f=l.anchor,d=l.focus;f!==null&&f.key===i&&Uo(f,t,r,e,o),d!==null&&d.key===i&&Uo(d,t,r,e,o)}const a=e.__text,u=t?a+s:s+a;this.setTextContent(u);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function vf(n){return{forChild:Ps(n.style),node:null}}function xf(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Ps(e.style,t?void 0:"bold"),node:null}}const Io=new WeakMap;function bf(n){if(!oe(n))return!1;if(n.nodeName==="PRE")return!0;const e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function Sf(n){const e=n;n.parentElement===null&&F(129);let t=e.textContent||"";if((function(r){let i,s=r.parentNode;const o=[r];for(;s!==null&&(i=Io.get(s))===void 0&&!bf(s);)o.push(s),s=s.parentNode;const l=i===void 0?s:i;for(let a=0;a<o.length;a++)Io.set(o[a],l);return l})(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],s=r.length;for(let o=0;o<s;o++){const l=r[o];l===`
7
+ `||l===`\r
8
+ `?i.push(Ie()):l===" "?i.push(We()):l!==""&&i.push(G(l))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=Mo(r,!1))!==null;){const s=r.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=Mo(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:G(t)}}function Mo(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const s=t.parentElement;if(s===null)return null;t=s}if(t=r,oe(t)){const s=t.style.display;if(s===""&&!fs(t)||s!==""&&!s.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(pt(t))return t;if(t.nodeName==="BR")return null}}const kf={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function ot(n){const e=kf[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Ps(n.style,e),node:null}}function G(n=""){return Je(new rt(n))}function O(n){return n instanceof rt}function Ps(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",s=r.includes("line-through"),o=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return u=>(O(u)&&(i&&!u.hasFormat("bold")&&u.toggleFormat("bold"),s&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),o&&!u.hasFormat("italic")&&u.toggleFormat("italic"),l&&!u.hasFormat("underline")&&u.toggleFormat("underline"),a!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),a!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),e&&!u.hasFormat(e)&&u.toggleFormat(e)),u)}class wn extends rt{static getType(){return"tab"}static clone(e){return new wn(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),r=mn(e.theme,"tab");return r!==void 0&&t.classList.add(...r),t}static importJSON(e){return We().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&ha(126),super.setTextContent(" ")}spliceText(e,t,r,i){return r===""&&t===0||r===" "&&t===1||F(286),this}setDetail(e){return e!==2&&F(127),this}setMode(e){return e!=="normal"&&F(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function We(){return Je(new wn)}function ve(n){return n instanceof wn}class Cf{key;offset;type;_selection;constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Pu(Oe(gt(this,"next")),Oe(gt(e,"next")))<0}getNode(){const e=Q(this.key);return e===null&&F(20),e}set(e,t,r,i){const s=this._selection,o=this.key;i&&this.key===e&&this.offset===t&&this.type===r||(this.key=e,this.offset=t,this.type=r,ir()||(_t()===o&&he(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0)))}}function Ee(n,e,t){return new Cf(n,e,t)}function bi(n,e){let t=e.__key,r=n.offset,i="element";if(O(e)){i="text";const s=e.getTextContentSize();r>s&&(r=s)}else if(!T(e)){const s=e.getNextSibling();if(O(s))t=s.__key,r=0,i="text";else{const o=e.getParent();o&&(t=o.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function Po(n,e){if(T(e)){const t=e.getLastDescendant();T(t)||O(t)?bi(n,t):bi(n,e)}else bi(n,e)}class ri{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!be(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}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 ri(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let s;if(O(i))s=i.select();else{const o=i.getIndexWithinParent()+1;s=i.getParentOrThrow().select(o,o)}s.insertNodes(e);for(let o=0;o<r;o++)t[o].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const s=Q(i);s!==null&&r.push(s)}return ir()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}deleteNodes(){const e=this.getNodes();if(($()||Nn())===this&&e[0]){const t=ge(e[0],"next");Du(ft(t,t))}for(const t of e)t.remove()}}function N(n){return n instanceof Yt}class Yt{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,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=(function(r){const i=[],[s,o]=r.getTextSlices();s&&i.push(s.caret.origin);const l=new Set,a=new Set;for(const u of r)if(nt(u)){const{origin:c}=u;i.length===0?l.add(c):(a.add(c),i.push(c))}else{const{origin:c}=u;T(c)&&a.has(c)||i.push(c)}if(o&&i.push(o.caret.origin),kn(r.focus)&&T(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let u=je(r.focus.origin,"previous");nt(u)&&l.has(u.origin)&&!u.origin.isEmpty()&&u.origin.is(i[i.length-1]);u=eo(u))l.delete(u.origin),i.pop();for(;i.length>1;){const u=i[i.length-1];if(!T(u)||a.has(u)||u.isEmpty()||l.has(u))break;i.pop()}if(i.length===0&&r.isCollapsed()){const u=Oe(r.anchor),c=Oe(r.anchor.getFlipped()),f=h=>xt(h)?h.origin:h.getNodeAtCaret(),d=f(u)||f(c)||(r.anchor.getNodeAtCaret()?u.origin:c.origin);i.push(d)}return i})(io(al(this),"next"));return ir()||(this._cachedNodes=t),t}setTextNodeRange(e,t,r,i){this.anchor.set(e.__key,t,"text"),this.focus.set(r.__key,i,"text")}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,s=this.focus,o=i.isBefore(s),[l,a]=ss(this);let u="",c=!0;for(let f=0;f<e.length;f++){const d=e[f];if(T(d)&&!d.isInline())c||(u+=`
9
+ `),c=!d.isEmpty();else if(c=!1,O(d)){let h=d.getTextContent();d===t?d===r?i.type==="element"&&s.type==="element"&&s.offset!==i.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=o?h.slice(l):h.slice(a):d===r&&(h=o?h.slice(0,a):h.slice(0,l)),u+=h}else!W(d)&&!ee(d)||d===r&&this.isCollapsed()||(u+=d.getTextContent())}return u}applyDOMRange(e){const t=q(),r=t.getEditorState()._selection,i=ou(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[s,o]=i;this.anchor.set(s.key,s.offset,s.type,!0),this.focus.set(o.key,o.offset,o.type,!0),Ir(this)}clone(){const e=this.anchor,t=this.focus;return new Yt(Ee(e.key,e.offset,e.type),Ee(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Jr(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Wt[e];return(this.format&t)!==0}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];o===`
10
+ `||o===`\r
11
+ `?r.push(Ie()):o===" "?r.push(We()):r.push(G(o))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,s=this.style;let o=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(o=r,l=t),o.type==="element"&&(function(p,y,m,v){const b=p.getNode(),S=b.getChildAtIndex(p.offset),x=G();if(x.setFormat(m),x.setStyle(v),si(S))S.splice(0,0,[x]);else{const C=ue(b)?Z().append(x):x;S===null?b.append(C):S.insertBefore(C)}p.is(y)&&y.set(x.__key,0,"text"),p.set(x.__key,0,"text")})(o,l,i,s),l.type==="element"&&qt(l,Oe(gt(l,"next")));const a=o.offset;let u=l.offset;const c=this.getNodes(),f=c.length;let d=c[0];O(d)||F(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let _=c[f-1];if(f===1&&l.type==="element"&&(u=h,l.set(o.key,u,"text")),this.isCollapsed()&&a===h&&(at(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let p=d.getNextSibling();if(O(p)&&p.canInsertTextBefore()&&!at(p)||(p=G(),p.setFormat(i),p.setStyle(s),g.canInsertTextAfter()?d.insertAfter(p):g.insertAfter(p)),p.select(0,0),d=p,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(at(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let p=d.getPreviousSibling();if(O(p)&&!at(p)||(p=G(),p.setFormat(i),g.canInsertTextBefore()?d.insertBefore(p):g.insertBefore(p)),p.select(),d=p,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==h){const p=G(d.getTextContent());p.setFormat(i),d.replace(p),d=p}else if(!this.isCollapsed()&&e!==""){const p=_.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||T(p)&&(!p.canInsertTextBefore()||!p.canInsertTextAfter()))return this.insertText(""),su(this.anchor,this.focus),void this.insertText(e)}if(f===1){if(Bt(d)){const v=G(e);return v.select(),void d.replace(v)}const p=d.getFormat(),y=d.getStyle();if(a!==u||p===i&&y===s){if(ve(d)){const v=G(e);return v.setFormat(i),v.setStyle(s),v.select(),void d.replace(v)}}else{if(d.getTextContent()!==""){const v=G(e);if(v.setFormat(i),v.setStyle(s),v.select(),a===0)d.insertBefore(v,!1);else{const[b]=d.splitText(a);b.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(i),d.setStyle(s)}const m=u-a;d=d.spliceText(a,m,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(this.format=p,this.style=y,d.isComposing()&&(this.anchor.offset-=e.length))}else{const p=new Set([...d.getParentKeys(),..._.getParentKeys()]),y=T(d)?d:d.getParentOrThrow();let m=T(_)?_:_.getParentOrThrow(),v=_;if(!y.is(m)&&m.isInline())do v=m,m=m.getParentOrThrow();while(m.isInline());if(l.type==="text"&&(u!==0||_.getTextContent()==="")||l.type==="element"&&_.getIndexWithinParent()<u)if(O(_)&&!Bt(_)&&u!==_.getTextContentSize()){if(_.isSegmented()){const E=G(_.getTextContent());_.replace(E),_=E}ue(l.getNode())||l.type!=="text"||(_=_.spliceText(0,u,"")),p.add(_.__key)}else{const E=_.getParentOrThrow();E.canBeEmpty()||E.getChildrenSize()!==1?_.remove():E.remove()}else p.add(_.__key);const b=m.getChildren(),S=new Set(c),x=y.is(m),C=y.isInline()&&d.getNextSibling()===null?y:d;for(let E=b.length-1;E>=0;E--){const k=b[E];if(k.is(d)||T(k)&&k.isParentOf(d))break;k.isAttached()&&(!S.has(k)||k.is(v)?x||C.insertAfter(k,!1):k.remove())}if(!x){let E=m,k=null;for(;E!==null;){const w=E.getChildren(),M=w.length;(M===0||w[M-1].is(k))&&(p.delete(E.__key),k=E),E=E.getParent()}}if(Bt(d))if(a===h)d.select();else{const E=G(e);E.select(),d.replace(E)}else d=d.spliceText(a,h-a,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length));for(let E=1;E<f;E++){const k=c[E],w=k.__key;p.has(w)||k.remove()}}}removeText(){const e=$()===this;Nr(this,ng(al(this))),e&&$()!==this&&xe(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void he(null);const r=this.getNodes(),i=[];for(const b of r)O(b)&&i.push(b);const s=b=>{r.forEach(S=>{if(T(S)){const x=S.getFormatFlags(e,b);S.setTextFormat(x)}})},o=i.length;if(o===0)return this.toggleFormat(e),he(null),void s(t);const l=this.anchor,a=this.focus,u=this.isBackward(),c=u?a:l,f=u?l:a;let d=0,h=i[0],g=c.type==="element"?0:c.offset;if(c.type==="text"&&g===h.getTextContentSize()&&(d=1,h=i[1],g=0),h==null)return;const _=h.getFormatFlags(e,t);s(_);const p=o-1;let y=i[p];const m=f.type==="text"?f.offset:y.getTextContentSize();if(h.is(y)){if(g===m)return;if(at(h)||g===0&&m===h.getTextContentSize())h.setFormat(_);else{const b=h.splitText(g,m),S=g===0?b[0]:b[1];S.setFormat(_),c.type==="text"&&c.set(S.__key,0,"text"),f.type==="text"&&f.set(S.__key,m-g,"text")}return void(this.format=_)}g===0||at(h)||([,h]=h.splitText(g),g=0),h.setFormat(_);const v=y.getFormatFlags(e,_);m>0&&(m===y.getTextContentSize()||at(y)||([y]=y.splitText(m)),y.setFormat(v));for(let b=d+1;b<p;b++){const S=i[b],x=S.getFormatFlags(e,v);S.setFormat(x)}c.type==="text"&&c.set(h.__key,g,"text"),f.type==="text"&&f.set(y.__key,m,"text"),this.format=_|v}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=$();return N(g)||F(134),g.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),r=ze(t,Re),i=e[e.length-1];if(T(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=Si(this);r.splice(g,0,e),i.selectEnd()}return}if(!e.some(g=>(T(g)||W(g))&&!g.isInline())){T(r)||F(211,t.constructor.name,t.getType());const g=Si(this);return r.splice(g,0,e),void i.selectEnd()}const s=(function(g){const _=Z();let p=null;for(let y=0;y<g.length;y++){const m=g[y],v=ee(m);if(v||W(m)&&m.isInline()||T(m)&&m.isInline()||O(m)||m.isParentRequired()){if(p===null&&(p=m.createParentElementNode(),_.append(p),v))continue;p!==null&&p.append(m)}else _.append(m),p=null}return _})(e),o=s.getLastDescendant(),l=s.getChildren(),a=!T(r)||!r.isEmpty()?this.insertParagraph():null,u=l[l.length-1];let c=l[0];var f;T(f=c)&&Re(f)&&!f.isEmpty()&&T(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(T(r)||F(211,t.constructor.name,t.getType()),r.append(...c.getChildren()),c=l[1]),c&&(r===null&&F(212,t.constructor.name,t.getType()),(function(g,_){const p=_.getParentOrThrow().getLastChild();let y=_;const m=[_];for(;y!==p;)y.getNextSibling()||F(140),y=y.getNextSibling(),m.push(y);let v=g;for(const b of m)v=v.insertAfter(b)})(r,c));const d=ze(o,Re);a&&T(d)&&(a.canMergeWhenEmpty()||Re(u))&&(d.append(...a.getChildren()),a.remove()),T(r)&&r.isEmpty()&&r.remove(),o.selectEnd();const h=T(r)?r.getLastChild():null;ee(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=Z();return te().splice(this.anchor.offset,0,[o]),o.select(),o}const e=Si(this),t=ze(this.anchor.getNode(),Re);T(t)||F(213);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],s=t.insertNewAfter(this,!1);return s?(s.append(...i),s.selectStart(),s):null}insertLineBreak(e){const t=Ie();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=[...this.getNodes()],t=e.length;let r=e[0],i=e[t-1];const[s,o]=ss(this),l=this.isBackward(),[a,u]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[c,f]=l?[o,s]:[s,o];if(t===0)return[];if(t===1){if(O(r)&&!this.isCollapsed()){const d=r.splitText(c,f),h=c===0?d[0]:d[1];return h?(a.set(h.getKey(),0,"text"),u.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(O(r)&&(c===r.getTextContentSize()?e.shift():c!==0&&([,r]=r.splitText(c),e[0]=r,a.set(r.getKey(),0,"text"))),O(i)){const d=i.getTextContent().length;f===0?e.pop():f!==d&&([i]=i.splitText(f),e[e.length-1]=i,u.set(i.getKey(),i.getTextContentSize(),"text"))}return e}modify(e,t,r){if(jo(this,e,t,r))return;const i=e==="move",s=q(),o=Be(Le(s));if(!o)return;const l=s._blockCursorElement,a=s._rootElement,u=this.focus.getNode();if(a===null||l===null||!T(u)||u.isInline()||u.canBeEmpty()||cs(l,s,a),this.dirty){let c=Sn(s,this.anchor.key),f=Sn(s,this.focus.key);this.anchor.type==="text"&&(c=xn(c)),this.focus.type==="text"&&(f=xn(f)),c&&f&&uu(o,c,this.anchor.offset,f,this.focus.offset)}if((function(c,f,d,h){c.modify(f,d,h)})(o,e,t?"backward":"forward",r),o.rangeCount>0){const c=o.getRangeAt(0),f=this.anchor.getNode(),d=ue(f)?f:Kf(f);if(this.applyDOMRange(c),this.dirty=!0,!i){const h=this.getNodes(),g=[];let _=!1;for(let p=0;p<h.length;p++){const y=h[p];us(y,d)?g.push(y):_=!0}if(_&&g.length>0)if(t){const p=g[0];T(p)?p.selectStart():p.getParentOrThrow().selectStart()}else{const p=g[g.length-1];T(p)?p.selectEnd():p.getParentOrThrow().selectEnd()}o.anchorNode===c.startContainer&&o.anchorOffset===c.startOffset||(function(p){const y=p.focus,m=p.anchor,v=m.key,b=m.offset,S=m.type;m.set(y.key,y.offset,y.type,!0),y.set(v,b,S,!0)})(this)}}r==="lineboundary"&&jo(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&T(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),s=t.getNextSibling()||(i===null?null:i.getNextSibling());if(T(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const s=no(gt(r,e?"previous":"next"));if(s.getTextSlices().every(l=>l===null||l.distance===0)){let l={type:"initial"};for(const a of s.iterNodeCarets("shadowRoot"))if(nt(a)){if(!a.origin.isInline()){if(a.origin.isShadowRoot()){if(l.type==="merge-block")break;if(T(s.anchor.origin)&&s.anchor.origin.isEmpty()){const u=Oe(a);Nr(this,ft(u,u)),s.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:a,type:"merge-block"})}}else{if(l.type==="merge-block")break;if(kn(a)){if(T(a.origin)){if(a.origin.isInline()){if(!a.origin.isParentOf(s.anchor.origin))break}else l={block:a.origin,type:"merge-next-block"};continue}if(W(a.origin)){if(!a.origin.isIsolated())if(l.type==="merge-next-block"&&(a.origin.isKeyboardSelectable()||!a.origin.isInline())&&T(s.anchor.origin)&&s.anchor.origin.isEmpty()){s.anchor.origin.remove();const u=au();u.add(a.origin.getKey()),xe(u)}else a.origin.remove();return}break}}if(l.type==="merge-block"){const{caret:a,block:u}=l;return Nr(this,ft(!a.origin.isEmpty()&&u.isEmpty()?ro(ge(u,a.direction)):s.anchor,a)),this.removeText()}}const o=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&Do(this,r.getNode()))return}else{const l=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,u=l.getTextContentSize();if(l.is(i)||e&&a!==u||!e&&a!==0)return void Ro(l,e,a)}else if(i!==null&&i.isSegmented()){const a=r.offset,u=i.getTextContentSize();if(i.is(l)||e&&a!==0||!e&&a!==u)return void Ro(i,e,a)}(function(a,u){const c=a.anchor,f=a.focus,d=c.getNode(),h=f.getNode();if(d===h&&c.type==="text"&&f.type==="text"){const g=c.offset,_=f.offset,p=g<_,y=p?g:_,m=p?_:g,v=m-1;y!==v&&(function(b){return!(wu(b)||Ef(b))})(d.getTextContent().slice(y,m))&&(u?f.set(f.key,v,f.type):c.set(c.key,v,c.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&ue(r.getParent())&&r.getPreviousSibling()===null&&Do(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function be(n){return n instanceof ri}function Lo(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function ss(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Lo(t),Lo(r)]}function Do(n,e){for(let t=e;t;t=t.getParent()){if(T(t)){if(t.collapseAtStart(n))return!0;if(ke(t))break}if(t.getPreviousSibling())break}return!1}const Ef=(()=>{try{const n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function Ro(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,l=0;for(let u=0;u<s;u++){const c=u===s-1;if(l=o,o+=i[u].length,e&&o===t||o>t||c){i.splice(u,1),c&&(l=void 0);break}}const a=i.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function zo(n,e,t,r){let i,s=e;if(oe(n)){let o=!1;const l=n.childNodes,a=l.length,u=r._blockCursorElement;s===a&&(o=!0,s=a-1);let c=l[s],f=!1;if(c===u)c=l[s+1],f=!0;else if(u!==null){const d=u.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,u)&&s--}if(i=dn(c),O(i))s=bt(i,o?"next":"previous");else{let d=dn(n);if(d===null)return null;if(T(d)){const h=r.getElementByKey(d.getKey());h===null&&F(214),[d,s]=d.getDOMSlot(h).resolveChildIndex(d,h,n,e),T(d)||F(215),o&&s>=d.getChildrenSize()&&(s=Math.max(0,d.getChildrenSize()-1));let _=d.getChildAtIndex(s);if(T(_)&&(function(p,y,m){const v=p.getParent();return m===null||v===null||!v.canBeEmpty()||v!==m.getNode()})(_,0,t)){const p=o?_.getLastDescendant():_.getFirstDescendant();p===null?d=_:(_=p,d=T(_)?_:_.getParentOrThrow()),s=0}O(_)?(i=_,d=null,s=bt(_,o?"next":"previous")):_!==d&&o&&!f&&(T(d)||F(216),s=Math.min(d.getChildrenSize(),s+1))}else{const h=d.getIndexWithinParent();s=e===0&&W(d)&&dn(n)===d?h:h+1,d=d.getParentOrThrow()}if(T(d))return Ee(d.__key,s,"element")}}else i=dn(n);return O(i)?Ee(i.__key,bt(i,s,"clamp"),"text"):null}function Bo(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const s=i.getPreviousSibling(),o=i.getParent();if(e){if((t||!e)&&s===null&&T(o)&&o.isInline()){const l=o.getPreviousSibling();O(l)&&n.set(l.__key,l.getTextContent().length,"text")}}else T(s)&&!t&&s.isInline()?n.set(s.__key,s.getChildrenSize(),"element"):O(s)&&n.set(s.__key,s.getTextContent().length,"text")}else if(r===i.getTextContent().length){const s=i.getNextSibling(),o=i.getParent();if(e&&T(s)&&s.isInline())n.set(s.__key,0,"element");else if((t||e)&&s===null&&T(o)&&o.isInline()&&!o.canInsertTextAfter()){const l=o.getNextSibling();O(l)&&n.set(l.__key,0,"text")}}}function su(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Bo(n,r,i),Bo(e,!r,i),i&&e.set(n.key,n.offset,n.type)}}function ou(n,e,t,r,i,s){if(n===null||t===null||!or(i,n,t))return null;const o=zo(n,e,N(s)?s.anchor:null,i);if(o===null)return null;const l=zo(t,r,N(s)?s.focus:null,i);if(l===null)return null;if(o.type==="element"&&l.type==="element"){const a=dn(n),u=dn(t);if(W(a)&&W(u))return null}return su(o,l),[o,l]}function os(n){return T(n)&&!n.isInline()}function lu(n,e,t,r,i,s){const o=Tt(),l=new Yt(Ee(n,e,i),Ee(t,r,s),0,"");return l.dirty=!0,o._selection=l,l}function Ls(){const n=Ee("root",0,"element"),e=Ee("root",0,"element");return new Yt(n,e,0,"")}function au(){return new ri(new Set)}function Ds(n,e,t,r){const i=t._window;if(i===null)return null;const s=r||i.event,o=s?s.type:void 0,l=o==="selectionchange",a=!Ki&&(l||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&s&&s.detail===3||o==="drop"||o===void 0);let u,c,f,d;if(N(n)&&!a)return n.clone();if(e===null)return null;if(u=e.anchorNode,c=e.focusNode,f=e.anchorOffset,d=e.focusOffset,(l||o===void 0)&&N(n)&&!or(t,u,c))return n.clone();const h=ou(u,f,c,d,t,n);if(h===null)return null;const[g,_]=h;let p=0,y="";if(N(n)){const m=n.anchor;if(g.key===m.key)p=n.format,y=n.style;else{const v=g.getNode();O(v)?(p=v.getFormat(),y=v.getStyle()):T(v)&&(p=v.getTextFormat(),y=v.getTextStyle())}}return new Yt(g,_,p,y)}function $(){return Tt()._selection}function Nn(){return q()._editorState._selection}function jr(n,e,t,r=1){const i=n.anchor,s=n.focus,o=i.getNode(),l=s.getNode();if(!e.is(o)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const u=i.offset;if(t<=u&&r>0||t<u&&r<0){const c=Math.max(0,u+r);i.set(a,c,"element"),s.set(a,c,"element"),Ko(n)}}else{const u=n.isBackward(),c=u?s:i,f=c.getNode(),d=u?i:s,h=d.getNode();if(e.is(f)){const g=c.offset;(t<=g&&r>0||t<g&&r<0)&&c.set(a,Math.max(0,g+r),"element")}if(e.is(h)){const g=d.offset;(t<=g&&r>0||t<g&&r<0)&&d.set(a,Math.max(0,g+r),"element")}}Ko(n)}function Ko(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,s=e.getNode(),o=r.getNode();if(n.isCollapsed()){if(!T(s))return;const l=s.getChildrenSize(),a=t>=l,u=a?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(O(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text"),r.set(u.__key,c,"text")}return}if(T(s)){const l=s.getChildrenSize(),a=t>=l,u=a?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(O(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text")}}if(T(o)){const l=o.getChildrenSize(),a=i>=l,u=a?o.getChildAtIndex(l-1):o.getChildAtIndex(i);if(O(u)){let c=0;a&&(c=u.getTextContentSize()),r.set(u.__key,c,"text")}}}function Hr(n,e,t,r,i){let s=null,o=0,l=null;r!==null?(s=r.__key,O(r)?(o=r.getTextContentSize(),l="text"):T(r)&&(o=r.getChildrenSize(),l="element")):i!==null&&(s=i.__key,O(i)?l="text":T(i)&&(l="element")),s!==null&&l!==null?n.set(s,o,l):(o=e.getIndexWithinParent(),o===-1&&(o=t.getChildrenSize()),n.set(t.__key,o,"element"))}function Uo(n,e,t,r,i){n.type==="text"?n.set(t,n.offset+(e?0:i),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function uu(n,e,t,r,i){try{n.setBaseAndExtent(e,t,r,i)}catch{}}function Wo(n,e,t){const r=Sn(n,e.getKey());if(T(e)){const i=e.getDOMSlot(r);return[i.element,t+i.getFirstChildOffset()]}return[r,t]}function Tf(n,e,t,r,i,s,o){const l=r.anchorNode,a=r.focusNode,u=r.anchorOffset,c=r.focusOffset,f=document.activeElement;if(i.has(pf)&&f!==s||f!==null&&Ws(f))return;if(!N(e))return void(n!==null&&or(t,l,a)&&r.removeAllRanges());const d=e.anchor,h=e.focus,g=d.getNode(),_=h.getNode(),[p,y]=Wo(t,g,d.offset),[m,v]=Wo(t,_,h.offset),b=e.format,S=e.style,x=e.isCollapsed();let C=p,E=m,k=!1;var w,M,P,K,U;if(d.type==="text"?(C=xn(p),k=g.getFormat()!==b||g.getStyle()!==S):N(n)&&n.anchor.type==="text"&&(k=!0),h.type==="text"&&(E=xn(m)),C!==null&&E!==null&&(x&&(n===null||k||N(n)&&(n.format!==b||n.style!==S))&&(w=b,M=S,P=y,K=d.key,U=performance.now(),qa=[w,M,P,K,U]),u!==y||c!==v||l!==C||a!==E||r.type==="Range"&&x||(f!==null&&s.contains(f)||i.has(Oo)||s.focus({preventScroll:!0}),d.type==="element"))){if(uu(r,C,y,E,v),!kt||!e.isCollapsed()||s===null||i.has(Oo)||document.activeElement!==null&&s.contains(document.activeElement)||s.focus({preventScroll:!0}),!i.has(mf)&&e.isCollapsed()&&s!==null&&s===document.activeElement){const X=N(e)&&e.anchor.type==="element"?C.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(X!==null){let me;if(X instanceof Text){const Te=document.createRange();Te.selectNode(X),me=Te.getBoundingClientRect()}else me=X.getBoundingClientRect();(function(Te,Y,re){const De=Ou(re),wt=Ys(De);if(De===null||wt===null)return;let{top:ye,bottom:In}=Y,we=0,Ve=0,Ne=re;for(;Ne!==null;){const mt=Ne===De.body;if(mt)we=0,Ve=Le(Te).innerHeight;else{const Nt=Ne.getBoundingClientRect();we=Nt.top,Ve=Nt.bottom}let it=0;if(ye<we?it=-(we-ye):In>Ve&&(it=In-Ve),it!==0)if(mt)wt.scrollBy(0,it);else{const Nt=Ne.scrollTop;Ne.scrollTop+=it;const en=Ne.scrollTop-Nt;ye-=en,In-=en}if(mt)break;Ne=lr(Ne)}})(t,me,s)}}ts=!0}}function cu(n){let e=$()||Nn();e===null&&(e=te().selectEnd()),e.insertNodes(n)}function Si(n){let e=n;n.isCollapsed()||e.removeText();const t=$();N(t)&&(e=t),N(e)||F(161);const r=e.anchor;let i=r.getNode(),s=r.offset;for(;!Re(i);){const o=i;if([i,s]=wf(i,s),o.is(i))break}return s}function wf(n,e){const t=n.getParent();if(!t){const i=Z();return te().append(i),i.select(),[te(),0]}if(O(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const s=e===0?0:1;return[t,i[0].getIndexWithinParent()+s]}if(!T(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Yt(Ee(n.__key,e,"element"),Ee(n.__key,e,"element"),0,""),s=n.insertNewAfter(i);s&&s.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function jo(n,e,t,r,i="decorators-and-blocks"){if(e==="move"&&r==="character"&&!n.isCollapsed()){const[c,f]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return f.set(c.key,c.offset,c.type),!0}const s=gt(n.focus,t?"previous":"next"),o=r==="lineboundary",l=e==="move";let a=s,u=i==="decorators-and-blocks";if(!Ru(a)){for(const c of a){u=!1;const{origin:f}=c;if(!W(f)||f.isIsolated()||(a=c,!o||!f.isInline()))break}if(u)for(const c of no(s).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(nt(c))c.origin.isInline()||(a=c);else{if(T(c.origin))continue;W(c.origin)&&!c.origin.isInline()&&(a=c)}break}}if(a===s)return!1;if(l&&!o&&W(a.origin)&&a.origin.isKeyboardSelectable()){const c=au();return c.add(a.origin.getKey()),xe(c),!0}return a=Oe(a),l&&qt(n.anchor,a),qt(n.focus,a),u||!o}let de=null,fe=null,Se=!1,ki=!1,Tr=0;const Ho={characterData:!0,childList:!0,subtree:!0};function ir(){return Se||de!==null&&de._readOnly}function ce(){Se&&F(13)}function du(){Tr>99&&F(14)}function Tt(){return de===null&&F(195,fu()),de}function q(){return fe===null&&F(196,fu()),fe}function fu(){let n=0;const e=new Set,t=vn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const s=oi(i);if(js(s))n++;else if(s){let o=String(s.constructor.version||"<0.17.1");o===t&&(o+=" (separately built, likely a bundler configuration issue)"),e.add(o)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function Nf(){return fe}function Jo(n,e,t){const r=e.__type,i=vu(n,r);let s=t.get(r);s===void 0&&(s=Array.from(i.transforms),t.set(r,s));const o=s.length;for(let l=0;l<o&&(s[l](e),e.isAttached());l++);}function Vo(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function gu(n,e){if(!e)return;const t=n._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)t.add(i)}function Af(n){return Rs(n,q()._nodes)}function Rs(n,e){const t=n.type,r=e.get(t);r===void 0&&F(17,t);const i=r.klass;n.type!==i.getType()&&F(18,i.name);const s=i.importJSON(n),o=n.children;if(T(s)&&Array.isArray(o))for(let l=0;l<o.length;l++){const a=Rs(o[l],e);s.append(a)}return s}function qo(n,e,t){const r=de,i=Se,s=fe;de=e,Se=!0,fe=n;try{return t()}finally{de=r,Se=i,fe=s}}function ut(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const s=n._editorState,o=s._selection,l=t._selection,a=n._dirtyType!==0,u=de,c=Se,f=fe,d=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&h!==null){fe=n,de=t,Se=!1,n._updating=!0;try{const x=n._dirtyType,C=n._dirtyElements,E=n._dirtyLeaves;h.disconnect(),g=Zd(s,t,n,x,C,E)}catch(x){if(x instanceof Error&&n._onError(x),ki)throw x;return yu(n,null,r,t),Sa(n),n._dirtyType=2,ki=!0,ut(n,s),void(ki=!1)}finally{h.observe(r,Ho),n._updating=d,de=u,Se=c,fe=f}}t._readOnly||(t._readOnly=!0);const _=n._dirtyLeaves,p=n._dirtyElements,y=n._normalizedNodes,m=n._updateTags,v=n._deferred;a&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(x,C){const E=x._decorators;let k=x._pendingDecorators||E;const w=C._nodeMap;let M;for(M in k)w.has(M)||(k===E&&(k=Eu(x)),delete k[M])})(n,t);const b=i?null:Be(Le(n));if(n._editable&&b!==null&&(a||l===null||l.dirty||!l.is(o))&&r!==null&&!m.has(yf)){fe=n,de=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const x=n._blockCursorElement;x!==null&&cs(x,n,r),Tf(o,l,n,b,m,r)}(function(x,C,E){let k=x._blockCursorElement;if(N(E)&&E.isCollapsed()&&E.anchor.type==="element"&&C.contains(document.activeElement)){const w=E.anchor,M=w.getNode(),P=w.offset;let K=!1,U=null;if(P===M.getChildrenSize())Ei(M.getChildAtIndex(P-1))&&(K=!0);else{const X=M.getChildAtIndex(P);if(X!==null&&Ei(X)){const me=X.getPreviousSibling();(me===null||Ei(me))&&(K=!0,U=x.getElementByKey(X.__key))}}if(K){const X=x.getElementByKey(M.__key);return k===null&&(x._blockCursorElement=k=(function(me){const Te=me.theme,Y=document.createElement("div");Y.contentEditable="false",Y.setAttribute("data-lexical-cursor","true");let re=Te.blockCursor;if(re!==void 0){if(typeof re=="string"){const De=Et(re);re=Te.blockCursor=De}re!==void 0&&Y.classList.add(...re)}return Y})(x._config)),C.style.caretColor="transparent",void(U===null?X.appendChild(k):X.insertBefore(k,U))}}k!==null&&cs(k,x,C)})(n,r,l)}finally{h!==null&&h.observe(r,Ho),fe=f,de=u}}g!==null&&(function(x,C,E,k,w){const M=Array.from(x._listeners.mutation),P=M.length;for(let K=0;K<P;K++){const[U,X]=M[K];for(const me of X){const Te=C.get(me);Te!==void 0&&U(Te,{dirtyLeaves:k,prevEditorState:w,updateTags:E})}}})(n,g,m,_,s),N(l)||l===null||o!==null&&o.is(l)||n.dispatchCommand(Fa,void 0);const S=n._pendingDecorators;S!==null&&(n._decorators=S,n._pendingDecorators=null,Wn("decorator",n,!0,S)),(function(x,C,E){const k=Xo(C),w=Xo(E);k!==w&&Wn("textcontent",x,!0,w)})(n,e||s,t),Wn("update",n,!0,{dirtyElements:p,dirtyLeaves:_,editorState:t,mutatedNodes:g,normalizedNodes:y,prevEditorState:e||s,tags:m}),(function(x,C){if(x._deferred=[],C.length!==0){const E=x._updating;x._updating=!0;try{for(let k=0;k<C.length;k++)C[k]()}finally{x._updating=E}}})(n,v),(function(x){const C=x._updates;if(C.length!==0){const E=C.shift();if(E){const[k,w]=E;ii(x,k,w)}}})(n)}function Wn(n,e,t,...r){const i=e._updating;e._updating=t;try{const s=Array.from(e._listeners[n]);for(let o=0;o<s.length;o++)s[o].apply(null,r)}finally{e._updating=i}}function Go(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[s,o]=i,l=n._pendingEditorState;let a;o!==void 0&&(a=o.onUpdate,o.skipTransforms&&(r=!0),o.discrete&&(l===null&&F(191),l._flushSync=!0),a&&n._deferred.push(a),gu(n,o.tag)),l==null?ii(n,s,o):s()}}return r}function ii(n,e,t){const r=n._updateTags;let i,s=!1,o=!1;t!==void 0&&(i=t.onUpdate,gu(n,t.tag),s=t.skipTransforms||!1,o=t.discrete||!1),i&&n._deferred.push(i);const l=n._editorState;let a=n._pendingEditorState,u=!1;(a===null||a._readOnly)&&(a=n._pendingEditorState=pu(a||l),u=!0),a._flushSync=o;const c=de,f=Se,d=fe,h=n._updating;de=a,Se=!1,n._updating=!0,fe=n;const g=n._headless||n.getRootElement()===null;Ks(null);try{u&&(g?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=(function(m,v){const b=m.getEditorState()._selection,S=Be(Le(m));return N(b)||b==null?Ds(b,S,m,v):b.clone()})(n,t&&t.event||null));const p=n._compositionKey;e(),s=Go(n,s),(function(m,v){const b=v.getEditorState()._selection,S=m._selection;if(N(S)){const x=S.anchor,C=S.focus;let E;if(x.type==="text"&&(E=x.getNode(),E.selectionTransform(b,S)),C.type==="text"){const k=C.getNode();E!==k&&k.selectionTransform(b,S)}}})(a,n),n._dirtyType!==0&&(s?(function(m,v){const b=v._dirtyLeaves,S=m._nodeMap;for(const x of b){const C=S.get(x);O(C)&&C.isAttached()&&C.isSimpleText()&&!C.isUnmergeable()&&ko(C)}})(a,n):(function(m,v){const b=v._dirtyLeaves,S=v._dirtyElements,x=m._nodeMap,C=_t(),E=new Map;let k=b,w=k.size,M=S,P=M.size;for(;w>0||P>0;){if(w>0){v._dirtyLeaves=new Set;for(const K of k){const U=x.get(K);O(U)&&U.isAttached()&&U.isSimpleText()&&!U.isUnmergeable()&&ko(U),U!==void 0&&Vo(U,C)&&Jo(v,U,E),b.add(K)}if(k=v._dirtyLeaves,w=k.size,w>0){Tr++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,M.delete("root")&&M.set("root",!0);for(const K of M){const U=K[0],X=K[1];if(S.set(U,X),!X)continue;const me=x.get(U);me!==void 0&&Vo(me,C)&&Jo(v,me,E)}k=v._dirtyLeaves,w=k.size,M=v._dirtyElements,P=M.size,Tr++}v._dirtyLeaves=b,v._dirtyElements=S})(a,n),Go(n),(function(m,v,b,S){const x=m._nodeMap,C=v._nodeMap,E=[];for(const[k]of S){const w=C.get(k);w!==void 0&&(w.isAttached()||(T(w)&&va(w,k,x,C,E,S),x.has(k)||S.delete(k),E.push(k)))}for(const k of E)C.delete(k);for(const k of b){const w=C.get(k);w===void 0||w.isAttached()||(x.has(k)||b.delete(k),C.delete(k))}})(l,a,n._dirtyLeaves,n._dirtyElements)),p!==n._compositionKey&&(a._flushSync=!0);const y=a._selection;if(N(y)){const m=a._nodeMap,v=y.anchor.key,b=y.focus.key;m.get(v)!==void 0&&m.get(b)!==void 0||F(19)}else be(y)&&y._nodes.size===0&&(a._selection=null)}catch(p){return p instanceof Error&&n._onError(p),n._pendingEditorState=l,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void ut(n)}finally{de=c,Se=f,fe=d,n._updating=h,Tr=0}n._dirtyType!==0||n._deferred.length>0||(function(p,y){const m=y.getEditorState()._selection,v=p._selection;if(v!==null){if(v.dirty||!v.is(m))return!0}else if(m!==null)return!0;return!1})(a,n)?a._flushSync?(a._flushSync=!1,ut(n)):u&&Pf(()=>{ut(n)}):(a._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function tt(n,e,t){fe===n&&t===void 0?e():ii(n,e,t)}class jn{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new jn(this.element,e,this.after)}withAfter(e){return new jn(this.element,this.before,e)}withElement(e){return this.element===e?this:new jn(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"&&(Qr||rr||Xr);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before,s=document.createElement("br");if(r.insertBefore(s,i),e){const o=document.createElement("img");o.setAttribute("data-lexical-linebreak","true"),o.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",o.alt="",r.insertBefore(o,s),r.__lexicalLineBreak=o}else r.__lexicalLineBreak=s}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,i){if(r===this.element){const a=this.getFirstChildOffset();return[e,Math.min(a+e.getChildrenSize(),Math.max(a,i))]}const s=Yo(t,r);s.push(i);const o=Yo(t,this.element);let l=e.getIndexWithinParent();for(let a=0;a<o.length;a++){const u=s[a],c=o[a];if(u===void 0||u<c)break;if(u>c){l+=1;break}}return[e.getParentOrThrow(),l]}}function Yo(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let i=0;for(let s=r.previousSibling;s!==null;s=s.previousSibling)i++;t.push(i)}return r!==n&&F(225),t.reverse()}class Me extends et{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(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,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Rd[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=q()._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(O(t)&&e.push(t),T(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;T(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;T(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const s=t[r-1];return T(s)&&s.getLastDescendant()||s||null}const i=t[e];return T(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Q(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&F(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Q(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&F(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const s=t[i];e+=s.getTextContent(),T(s)&&i!==r-1&&!s.isInline()&&(e+=ei)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const s=t[i];e+=s.getTextContentSize(),T(s)&&i!==r-1&&!s.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=Bi[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=Wt[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Jr(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){ce();const r=$();let i=e,s=t;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(O(a)||T(a))return a.select(0,0)}else if(!(e!==void 0&&e!==o||t!==void 0&&t!==o)){const a=this.getLastChild();if(O(a)||T(a))return a.select()}}i===void 0&&(i=o),s===void 0&&(s=o);const l=this.__key;return N(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,s,"element"),r.dirty=!0,r):lu(l,i,l,s,"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!==""?Bi[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){Wr(this)&&F(324,this.__key,this.__type);const i=this.getChildrenSize(),s=this.getWritable();e+t<=i||F(226,String(e),String(t),String(i));const o=s.__key,l=[],a=[],u=this.getChildAtIndex(e+t);let c=null,f=i-t+r.length;if(e!==0)if(e===i)c=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(c=h.getPreviousSibling())}if(t>0){let h=c===null?this.getFirstChild():c.getNextSibling();for(let g=0;g<t;g++){h===null&&F(100);const _=h.getNextSibling(),p=h.__key;Kt(h.getWritable()),a.push(p),h=_}}let d=c;for(const h of r){d!==null&&h.is(d)&&(c=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===o&&f--,Kt(g);const _=h.__key;if(d===null)s.__first=_,g.__prev=null;else{const p=d.getWritable();p.__next=_,g.__prev=p.__key}h.__key===o&&F(76),g.__parent=o,l.push(_),d=h}if(e+t===i)d!==null&&(d.getWritable().__next=null,s.__last=d.__key);else if(u!==null){const h=u.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=u.__key}else h.__prev=null}if(s.__size=f,a.length){const h=$();if(N(h)){const g=new Set(a),_=new Set(l),{anchor:p,focus:y}=h;Zo(p,g,_)&&Hr(p,p.getNode(),this,c,u),Zo(y,g,_)&&Hr(y,y.getNode(),this,c,u),f!==0||this.canBeEmpty()||ke(this)||this.remove()}}return s}getDOMSlot(e){return new jn(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(oe(t)){const r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");const i=this.getDirection();i&&(t.dir=i)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),r=this.getTextStyle();return t===0&&r===""||ke(this)||this.getChildren().some(O)||(t!==0&&(e.textFormat=t),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}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,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const r=this.getDOMSlot(e);let i=r.getFirstChild();for(let s=this.getFirstChild();s;s=s.getNextSibling()){const o=t.getElementByKey(s.getKey());o!==null&&(i==null?(r.insertChild(o),i=o):i!==o&&r.replaceChild(o,i),i=i.nextSibling)}}}function T(n){return n instanceof Me}function Zo(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class hu extends et{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function W(n){return n instanceof hu}class An extends Me{__cachedText;static getType(){return"root"}static clone(){return new An}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){F(51)}getTextContent(){const e=this.__cachedText;return!ir()&&q()._dirtyType!==0||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}splice(e,t,r){for(const i of r)T(i)||W(i)||F(282);return super.splice(e,t,r)}static importJSON(e){return te().updateFromJSON(e)}collapseAtStart(){return!0}}function ue(n){return n instanceof An}function pu(n){return new sr(new Map(n._nodeMap))}function zs(){return new sr(new Map([["root",new An]]))}function mu(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&F(130,t.name),T(n)){const r=e.children;Array.isArray(r)||F(59,t.name);const i=n.getChildren();for(let s=0;s<i.length;s++){const o=mu(i[s]);r.push(o)}}return e}function Ff(n){return n instanceof sr}class sr{_nodeMap;_selection;_flushSync;_readOnly;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 qo(t&&t.editor||null,this,e)}clone(e){const t=new sr(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return qo(null,this,()=>({root:mu(te())}))}}class Bs extends Me{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Fn extends Me{static getType(){return"paragraph"}static clone(e){return new Fn(e.__key)}createDOM(e){const t=document.createElement("p"),r=mn(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Of,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(oe(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return Z().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const t=this.getChildren().find(O);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const r=Z();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||O(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 Of(n){const e=Z();if(n.style&&(e.setFormat(n.style.textAlign),Zs(n,e)),e.getFormatType()===""){const t=n.getAttribute("align");t&&t&&t in Bi&&e.setFormat(t)}return{node:e}}function Z(){return Je(new Fn)}function si(n){return n instanceof Fn}const z=0,Ae=1,$f=4;function yu(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=zs(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const s=n._observer;s!==null&&(s.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function If(n){const e=new Set,t=new Set;let r=n;for(;r;){const{ownNodeConfig:i}=ui(r),s=r.transform;if(!t.has(s)){t.add(s);const o=r.transform();o&&e.add(o)}if(i){const o=i.$transform;o&&e.add(o),r=i.extends}else{const o=Object.getPrototypeOf(r);r=o.prototype instanceof et&&o!==et?o:void 0}}return e}function _u(n){const e=n||{},t=Nf(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,o=zs(),l=e.namespace||(i!==null?i._config.namespace:Nu()),a=e.editorState,u=[An,rt,Tn,wn,Fn,Bs,...e.nodes||[]],{onError:c,html:f}=e,d=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let _=0;_<u.length;_++){let p=u[_],y=null,m=null;if(typeof p!="function"){const S=p;p=S.replace,y=S.with,m=S.withKlass||null}ui(p);const v=p.getType(),b=If(p);h.set(v,{exportDOM:f&&f.export?f.export.get(p):void 0,klass:p,replace:y,replaceWithKlass:m,sharedNodeState:Jd(u[_]),transforms:b})}}const g=new vn(o,i,h,{disableEvents:s,namespace:l,theme:r},c||console.error,(function(_,p){const y=new Map,m=new Set,v=b=>{Object.keys(b).forEach(S=>{let x=y.get(S);x===void 0&&(x=[],y.set(S,x)),x.push(b[S])})};return _.forEach(b=>{const S=b.klass.importDOM;if(S==null||m.has(S))return;m.add(S);const x=S.call(b.klass);x!==null&&v(x)}),p&&v(p),y})(h,f?f.import:void 0),d,n);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=2),(function(_){_.registerCommand($a,lf,z),_.registerCommand(Ia,af,z),_.registerCommand(Ma,uf,z),_.registerCommand(Pa,cf,z),_.registerCommand(La,df,z)})(g),g}class vn{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,r,i,s,o,l,a){this._createEditorArgs=a,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=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,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=Nu(),this._onError=s,this._htmlConversions=o,this._editable=l,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,r){r===void 0&&F(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const s=i.get(e);s===void 0&&F(36,String(e));const o=s[r];return o.add(t),()=>{o.delete(t),s.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation;let o=s.get(t);o===void 0&&(o=new Set,s.set(t,o)),o.add(i);const l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(t,i),()=>{o.delete(i),o.size===0&&s.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 r=this._editorState,i=sl(r).get(t.getType());if(!i)return;const s=new Map;for(const o of i.keys())s.set(o,"created");s.size>0&&e(s,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],s=r.replaceWithKlass;if(s!=null){const o=this.registerNodeTransformToKlass(s,t);i.push(o)}return(function(o,l){const a=sl(o.getEditorState()),u=[];for(const c of l){const f=a.get(c);f&&u.push(f)}u.length!==0&&o.update(()=>{for(const c of u)for(const f of c.keys()){const d=Q(f);d&&d.markDirty()}},o._pendingEditorState===null?{tag:Un}:void 0)})(this,i.map(o=>o.klass.getType())),()=>{i.forEach(o=>o.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return I(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 r=mn(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,yu(this,t,e,i),t!==null&&(this._config.disableEvents||ff(t),r!=null&&t.classList.remove(...r)),e!==null){const s=Ys(e),o=e.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=2,Sa(this),this._updateTags.add(Un),ut(this),this._config.disableEvents||(function(l,a){const u=l.ownerDocument;es.set(l,u);const c=Kr.get(u)??0;c<1&&u.addEventListener("selectionchange",Qa),Kr.set(u,c+1),l.__lexicalEditor=a;const f=Xa(l);for(let d=0;d<Qi.length;d++){const[h,g]=Qi[d],_=typeof g=="function"?p=>{Fo(p)||(Ao(p),(a.isEditable()||h==="click")&&g(p,a))}:p=>{if(Fo(p))return;Ao(p);const y=a.isEditable();switch(h){case"cut":return y&&I(a,Ms,p);case"copy":return I(a,ni,p);case"paste":return y&&I(a,Fs,p);case"dragstart":return y&&I(a,ja,p);case"dragover":return y&&I(a,Ha,p);case"dragend":return y&&I(a,ef,p);case"focus":return y&&I(a,rf,p);case"blur":return y&&I(a,sf,p);case"drop":return y&&I(a,Wa,p)}};l.addEventListener(h,_),f.push(()=>{l.removeEventListener(h,_)})}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(Un),ut(this);Wn("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 r=e;r._readOnly&&(r=pu(e),r._selection=e._selection?e._selection.clone():null),ba(this);const i=this._pendingEditorState,s=this._updateTags,o=t!==void 0?t.tag:null;i===null||i.isEmpty()||(o!=null&&s.add(o),ut(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&s.add(o),this._updating||ut(this)}parseEditorState(e,t){return(function(r,i,s){const o=zs(),l=de,a=Se,u=fe,c=i._dirtyElements,f=i._dirtyLeaves,d=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,de=o,Se=!1,fe=i,Ks(null);try{const g=i._nodes;Rs(r.root,g),s&&s(),o._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=c,i._dirtyLeaves=f,i._cloneNotNeeded=d,i._dirtyType=h,de=l,Se=a,fe=u}return o})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return ut(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,i,s){r._updating?r._updates.push([i,s]):ii(r,i,s)})(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),tt(this,()=>{const i=$(),s=te();i!==null?i.dirty||xe(i.clone()):s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),Gs("focus"),Bf(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Be(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Wn("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}vn.version="0.41.0+prod.esm";let ls=null;function Ks(n){ls=n}let Mf=1;function vu(n,e){const t=Us(n,e);return t===void 0&&F(30,e),t}function Us(n,e){return n._nodes.get(e)}const Pf=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function xu(n){return W(bn(n))}function Ws(n){const e=document.activeElement;if(!oe(e))return!1;const t=e.nodeName;return W(bn(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&oi(e)==null)}function or(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!Ws(e)&&bu(e)===n}catch{return!1}}function js(n){return n instanceof vn}function bu(n){let e=n;for(;e!=null;){const t=oi(e);if(js(t))return t;e=lr(e)}return null}function oi(n){return n?n.__lexicalEditor:null}function Lf(n){return Pd.test(n)?"rtl":Ld.test(n)?"ltr":null}function Bt(n){return ve(n)||n.isToken()}function at(n){return Bt(n)||n.isSegmented()}function pt(n){return On(n)&&n.nodeType===3}function Su(n){return On(n)&&n.nodeType===9}function xn(n){let e=n;for(;e!=null;){if(pt(e))return e;e=e.firstChild}return null}function Jr(n,e,t){const r=Wt[e];if(t!==null&&(n&r)===(t&r))return n;let i=n^r;return e==="subscript"?i&=-65:e==="superscript"?i&=-33:e==="lowercase"?(i&=-513,i&=-1025):e==="uppercase"?(i&=-257,i&=-1025):e==="capitalize"&&(i&=-257,i&=-513),i}function ku(n){return O(n)||ee(n)||W(n)}function Df(n,e){const t=(function(){const o=ls;return ls=null,o})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);ce(),du();const r=q(),i=Tt(),s=""+Mf++;i._nodeMap.set(s,n),T(n)?r._dirtyElements.set(s,!0):r._dirtyLeaves.add(s),r._cloneNotNeeded.add(s),r._dirtyType=1,n.__key=s}function Kt(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),s=n.getNextSibling(),o=s!==null?s.__key:null,l=i!==null?i.__key:null,a=i!==null?i.getWritable():null,u=s!==null?s.getWritable():null;i===null&&(r.__first=o),s===null&&(r.__last=l),a!==null&&(a.__next=o),u!==null&&(u.__prev=l),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function Vr(n){du(),Wr(n)&&F(323,n.__key,n.__type);const e=n.getLatest(),t=e.__parent,r=Tt(),i=q(),s=r._nodeMap,o=i._dirtyElements;t!==null&&(function(a,u,c){let f=a;for(;f!==null;){if(c.has(f))return;const d=u.get(f);if(d===void 0)break;c.set(f,!1),f=d.__parent}})(t,s,o);const l=e.__key;i._dirtyType=1,T(n)?o.set(l,!0):i._dirtyLeaves.add(l)}function he(n){ce();const e=q(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=Q(t);r!==null&&r.getWritable()}if(n!==null){const r=Q(n);r!==null&&r.getWritable()}}}function _t(){return ir()?null:q()._compositionKey}function Q(n,e){const t=(e||Tt())._nodeMap.get(n);return t===void 0?null:t}function Cu(n,e){const t=li(n,q());return t!==void 0?Q(t,e):null}function li(n,e){return n[`__lexicalKey_${e._key}`]}function bn(n,e){let t=n;for(;t!=null;){const r=Cu(t,e);if(r!==null)return r;t=lr(t)}return null}function Eu(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Xo(n){return n.read(()=>te().getTextContent())}function te(){return Tu(Tt())}function Tu(n){return n._nodeMap.get("root")}function xe(n){ce();const e=Tt();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function dn(n){const e=q(),t=(function(r,i){let s=r;for(;s!=null;){const o=li(s,i);if(o!==void 0)return o;s=lr(s)}return null})(n,e);return t===null?n===e.getRootElement()?Q("root"):null:Q(t)}function wu(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Hs(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Nu(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Au(n){return pt(n)?n.nodeValue:null}function Js(n,e,t){const r=Be(Le(e));if(r===null)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(i!==null){let l=Au(i);const a=bn(i);if(l!==null&&O(a)){if((l===Jn||l===Ts)&&t){const u=t.length;l=t,s=u,o=u}l!==null&&Vs(a,l,s,o,n)}}}function Vs(n,e,t,r,i){let s=n;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let l=e;if((o||i)&&(e.endsWith(Jn)&&(l=e.slice(0,-Jn.length)),i)){const u=Ts;let c;for(;(c=l.indexOf(u))!==-1;)l=l.slice(0,c)+l.slice(c+u.length),t!==null&&t>c&&(t=Math.max(c,t-u.length)),r!==null&&r>c&&(r=Math.max(c,r-u.length))}const a=s.getTextContent();if(i||l!==a){if(l===""){if(he(null),Xr||rr||Qr)s.remove();else{const _=q();setTimeout(()=>{_.update(()=>{s.isAttached()&&s.remove()})},20)}return}const u=s.getParent(),c=Nn(),f=s.getTextContentSize(),d=_t(),h=s.getKey();if(s.isToken()||d!==null&&h===d&&!o||N(c)&&(u!==null&&!u.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===n.__key&&c.anchor.offset===0&&!s.canInsertTextBefore()&&!o||c.focus.key===n.__key&&c.focus.offset===f&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const g=$();if(!N(g)||t===null||r===null)return void Qo(s,l,g);if(g.setTextNodeRange(s,t,s,r),s.isSegmented()){const _=G(s.getTextContent());s.replace(_),s=_}Qo(s,l,g)}}}function Qo(n,e,t){if(n.setTextContent(e),N(t)){const r=n.getKey();for(const i of["anchor","focus"]){const s=t[i];s.type==="text"&&s.key===r&&(s.offset=bt(n,s.offset,"clamp"))}}}function hr(n,e,t){const r=e[t]||!1;return r==="any"||r===n[t]}function Rf(n,e){return hr(n,e,"altKey")&&hr(n,e,"ctrlKey")&&hr(n,e,"shiftKey")&&hr(n,e,"metaKey")}function H(n,e,t){if(!Rf(n,t))return!1;if(n.key.toLowerCase()===e.toLowerCase())return!0;if(e.length>1||n.key.length===1&&n.key.charCodeAt(0)<=127)return!1;const r="Key"+e.toUpperCase();return n.code===r}const lt={ctrlKey:!Ke,metaKey:Ke},el={altKey:Ke,ctrlKey:!Ke};function tl(n){return n.key==="Backspace"}function nl(n){return H(n,"a",lt)}function zf(n){const e=te();if(N(n)){const t=n.anchor,r=n.focus,i=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),Ir(n),n}{const t=e.select(0,e.getChildrenSize());return xe(Ir(t)),t}}function mn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const s=Et(i);return t[e]=s,s}return i}function qs(n,e,t,r,i){if(t.size===0)return;const s=r.__type,o=r.__key,l=e.get(s);l===void 0&&F(33,s);const a=l.klass;let u=n.get(a);u===void 0&&(u=new Map,n.set(a,u));const c=u.get(o),f=c==="destroyed"&&i==="created";(c===void 0||f)&&u.set(o,f?"updated":i)}function rl(n,e,t){const r=n.getParent();let i=t,s=n;return r!==null&&(e&&t===0?(i=s.getIndexWithinParent(),s=r):e||t!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?i-1:i)}function as(n,e){const t=n.offset;if(n.type==="element")return rl(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?rl(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function Fu(n){const e=Le(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function I(n,e,t){return(function(r,i,s){const o=Hs(r);for(let l=4;l>=0;l--)for(let a=0;a<o.length;a++){const u=o[a],c=u._commands.get(i);if(c!==void 0){const f=c[l];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(tt(u,()=>{for(let _=0;_<h;_++)if(d[_](s,r))return void(g=!0)}),g)return g}}}return!1})(n,e,t)}function Sn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&F(75,e),t}function lr(n){const e=n.assignedSlot||n.parentElement;return ds(e)?e.host:e}function Ou(n){return Su(n)?n:oe(n)?n.ownerDocument:null}function Gs(n){ce(),q()._updateTags.add(n)}function Bf(n){ce(),q()._deferred.push(n)}function us(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Ys(n){const e=Ou(n);return e?e.defaultView:null}function Le(n){const e=n._window;return e===null&&F(78),e}function Kf(n){let e=n.getParentOrThrow();for(;e!==null;){if(ke(e))return e;e=e.getParentOrThrow()}return e}function ke(n){return ue(n)||T(n)&&n.isShadowRoot()}function Je(n){const e=q(),t=n.getType(),r=Us(e,t);r===void 0&&F(200,n.constructor.name,t);const{replace:i,replaceWithKlass:s}=r;if(i!==null){const o=i(n),l=o.constructor;return s!==null?o instanceof s||F(201,s.name,s.getType(),l.name,l.getType(),n.constructor.name,t):o instanceof n.constructor&&l!==n.constructor||F(202,l.name,l.getType(),n.constructor.name,t),o.__key===n.__key&&F(203,n.constructor.name,t,l.name,l.getType()),o}return n}function Ci(n,e){!ue(n.getParent())||T(e)||W(e)||F(99)}function Uf(n){const e=Q(n);return e===null&&F(63,n),e}function Ei(n){return(W(n)||T(n)&&!n.canBeEmpty())&&!n.isInline()}function cs(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Be(n){return He?(n||window).getSelection():null}function Wf(n){const e=Ys(n);return e?e.getSelection():null}function $u(n){return oe(n)&&n.tagName==="A"}function oe(n){return On(n)&&n.nodeType===1}function On(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function ds(n){return On(n)&&n.nodeType===11}function fs(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function qr(n){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 n.nodeName.match(e)!==null}function Re(n){if(W(n)&&!n.isInline())return!0;if(!T(n)||ke(n))return!1;const e=n.getFirstChild(),t=e===null||ee(e)||O(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function ai(){return q()}const il=new WeakMap,jf=new Map;function sl(n){if(!n._readOnly&&n.isEmpty())return jf;n._readOnly||F(192);let e=il.get(n);return e||(e=(function(t){const r=new Map;for(const[i,s]of t._nodeMap){const o=s.__type;let l=r.get(o);l||(l=new Map,r.set(o,l)),l.set(i,s)}return r})(n),il.set(n,e)),e}function Iu(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function Hf(n){return(e=Iu(n))[eu]=!0,e;var e}function Zs(n,e){const t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function Jf(n){return n.__lexicalUnmanaged===!0}function Pn(n,e){return(function(t,r){return Object.prototype.hasOwnProperty.call(t,r)})(n,e)&&n[e]!==et[e]}function ui(n){const e=mo in n.prototype?n.prototype[mo]():void 0,t=(function(o){if(!(o===et||o.prototype instanceof et)){let l="<unknown>",a="<unknown>";try{l=o.getType()}catch{}try{vn.version&&(a=JSON.parse(vn.version))}catch{}F(290,o.name,l,a)}return o===hu||o===Me||o===et})(n),r=!t&&Pn(n,"getType")?n.getType():void 0;let i,s=r;if(e)if(r)i=e[r];else for(const[o,l]of Object.entries(e))s=o,i=l;if(!t&&s&&(Pn(n,"getType")||(n.getType=()=>s),Pn(n,"clone")||(n.clone=o=>(Ks(o),new n)),Pn(n,"importJSON")||(n.importJSON=i&&i.$importJSON||(o=>new n().updateFromJSON(o))),!Pn(n,"importDOM")&&i)){const{importDOM:o}=i;o&&(n.importDOM=()=>o)}return{ownNodeConfig:i,ownNodeType:s}}function Vf(n){const e=ai();return ce(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}const ze=(n,e)=>{let t=n;for(;t!=null&&!ue(t);){if(e(t))return t;t=t.getParent()}return null},qf={next:"previous",previous:"next"};class Xs{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Mu({hasNext:kn,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return ge(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return ge(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,t)),this}splice(e,t,r="next"){const i=r===this.direction?t:Array.from(t).reverse();let s=this;const o=this.getParentAtCaret(),l=new Map;for(let a=s.getAdjacentCaret();a!==null&&l.size<e;a=a.getAdjacentCaret()){const u=a.origin.getWritable();l.set(u.getKey(),u)}for(const a of i){if(l.size>0){const u=s.getNodeAtCaret();if(u){if(l.delete(u.getKey()),l.delete(a.getKey()),!(u.is(a)||s.origin.is(a))){const c=a.getParent();c&&c.is(o)&&a.remove(),u.replace(a)}}else u===null&&F(263,Array.from(l).join(" "))}else s.insert(a);s=ge(a,this.direction)}for(const a of l.values())a.remove();return this}}class Qn extends Xs{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:je(e,this.direction)}getParentCaret(e="root"){return ge(Qs(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=$n(this.direction);return ge(this.getNodeAtCaret(),e)||je(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Qn&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const Gf={root:ue,shadowRoot:ke};function $n(n){return qf[n]}function Qs(n,e="root"){return Gf[e](n)?null:n}class Jt extends Xs{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ge(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return T(this.origin)?je(this.origin,this.direction):null}getParentCaret(e="root"){return ge(Qs(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=$n(this.direction);return ge(this.getNodeAtCaret(),e)||je(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof Jt&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof Jt||e instanceof Vt)&&this.direction===e.direction&&this.origin.is(e.origin)}}class Vt extends Xs{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Ct(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return ge(Qs(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Ct(this.origin,$n(this.direction),this.offset)}isSamePointCaret(e){return e instanceof Vt&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Jt||e instanceof Vt)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return ge(this.origin,this.direction)}}function xt(n){return n instanceof Vt}function kn(n){return n instanceof Jt}function nt(n){return n instanceof Qn}const Yf={next:class extends Vt{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends Vt{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Zf={next:class extends Jt{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends Jt{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Xf={next:class extends Qn{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends Qn{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function ge(n,e){return n?new Zf[e](n):null}function Ct(n,e,t){return n?new Yf[e](n,bt(n,t)):null}function bt(n,e,t="error"){const r=n.getTextContentSize();let i=e==="next"?r:e==="previous"?0:e;return(i<0||i>r)&&(t!=="clamp"&&ha(284,String(e),String(r),n.getKey()),i=i<0?0:r),i}function ol(n,e){return new eg(n,e)}function je(n,e){return T(n)?new Xf[e](n):null}function Qf(n){return n&&n.getChildCaret()||n}function eo(n){return n&&Qf(n.getAdjacentCaret())}class to{type="node-caret-range";direction;anchor;focus;constructor(e,t,r){this.anchor=e,this.focus=t,this.direction=r}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new to(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=i=>{const s=this[i].getLatest();return xt(s)?(function(o,l){const{direction:a,origin:u}=o,c=bt(u,l==="focus"?$n(a):a);return ol(o,c-o.offset)})(s,i):null},t=e("anchor"),r=e("focus");if(t&&r){const{caret:i}=t,{caret:s}=r;if(i.isSameNodeCaret(s))return[ol(i,s.offset-i.offset),null]}return[t,r]}iterNodeCarets(e="root"){const t=xt(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),i=xt(r),s=o=>o.isSameNodeCaret(r)?null:eo(o)||o.getParentCaret(e);return Mu({hasNext:o=>o!==null&&!(i&&r.isSameNodeCaret(o)),initial:t.isSameNodeCaret(r)?null:s(t),map:o=>o,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class eg{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,r=t+e;return r<t?[r,t]:[t,r]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[r,i]=this.getSliceIndices(),s=e.getTextContent();return Ct(e.setTextContent(s.slice(0,r)+s.slice(i)),t,r)}}function no(n){return ft(n,ge(te(),n.direction))}function tg(n){return ft(n,n)}function ft(n,e){return n.direction!==e.direction&&F(265),new to(n,e,n.direction)}function Mu(n){const{initial:e,hasNext:t,step:r,map:i}=n;let s=e;return{[Symbol.iterator](){return this},next(){if(!t(s))return{done:!0,value:void 0};const o={done:!1,value:i(s)};return s=r(s),o}}}function Pu(n,e){const t=wr(n.origin,e.origin);switch(t===null&&F(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{const r=n.type==="text",i=e.type==="text";return r&&i?(function(s,o){return Math.sign(s-o)})(n.offset,e.offset):n.type===e.type?0:r?-1:i?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return Lu(t)}}function Lu(n){const{a:e,b:t}=n,r=e.__key,i=t.__key;let s=e,o=t;for(;s&&o;s=s.getNextSibling(),o=o.getNextSibling()){if(s.__key===i)return-1;if(o.__key===r)return 1}return s===null?1:-1}function pr(n,e){return e.is(n)}function ll(n){return T(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function wr(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};const t=new Map;for(let[r,i]=ll(n);r;i=r,r=r.getParent())t.set(r,i);for(let[r,i]=ll(e);r;i=r,r=r.getParent()){const s=t.get(r);if(s!==void 0)return s===null?(pr(n,r)||F(276),{commonAncestor:r,type:"ancestor"}):i===null?(pr(e,r)||F(277),{commonAncestor:r,type:"descendant"}):((T(s)||pr(n,s))&&(T(i)||pr(e,i))&&r.is(s.getParent())&&r.is(i.getParent())||F(278),{a:s,b:i,commonAncestor:r,type:"branch"})}return null}function gt(n,e){const{type:t,key:r,offset:i}=n,s=Uf(n.key);return t==="text"?(O(s)||F(266,s.getType(),r),Ct(s,e,i)):(T(s)||F(267,s.getType(),r),rg(s,n.offset,e))}function qt(n,e){const{origin:t,direction:r}=e,i=r==="next";xt(e)?n.set(t.getKey(),e.offset,"text"):kn(e)?O(t)?n.set(t.getKey(),bt(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(i?1:0),"element"):(nt(e)&&T(t)||F(268),n.set(t.getKey(),i?0:t.getChildrenSize(),"element"))}function Du(n){const e=$(),t=N(e)?e:Ls();return Nr(t,n),xe(t),t}function Nr(n,e){qt(n.anchor,e.anchor),qt(n.focus,e.focus)}function al(n){const{anchor:e,focus:t}=n,r=gt(e,"next"),i=gt(t,"next"),s=Pu(r,i)<=0?"next":"previous";return ft(Cn(r,s),Cn(i,s))}function ro(n){const{direction:e,origin:t}=n,r=ge(t,$n(e)).getNodeAtCaret();return r?ge(r,e):je(t.getParentOrThrow(),e)}function ul(n,e="root"){const t=[n];for(let r=nt(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(ro(r));return t}function Ti(n){return!!n&&n.origin.isAttached()}function ng(n,e="removeEmptySlices"){if(n.isCollapsed())return n;const t="root",r="next";let i=e;const s=io(n,r),o=ul(s.anchor,t),l=ul(s.focus.getFlipped(),t),a=new Set,u=[];for(const g of s.iterNodeCarets(t))if(nt(g))a.add(g.origin.getKey());else if(kn(g)){const{origin:_}=g;T(_)&&!a.has(_.getKey())||u.push(_)}for(const g of u)g.remove();for(const g of s.getTextSlices()){if(!g)continue;const{origin:_}=g.caret,p=_.getTextContentSize(),y=ro(ge(_,r)),m=_.getMode();if(Math.abs(g.distance)===p&&i==="removeEmptySlices"||m==="token"&&g.distance!==0)y.remove();else if(g.distance!==0){i="removeEmptySlices";let v=g.removeTextSlice();const b=g.caret.origin;if(m==="segmented"){const S=v.origin,x=G(S.getTextContent()).setStyle(S.getStyle()).setFormat(S.getFormat());y.replaceOrInsert(x),v=Ct(x,r,v.offset)}b.is(o[0].origin)&&(o[0]=v),b.is(l[0].origin)&&(l[0]=v.getFlipped())}}let c,f;for(const g of o)if(Ti(g)){c=Oe(g);break}for(const g of l)if(Ti(g)){f=Oe(g);break}const d=(function(g,_,p){if(!g||!_)return null;const y=g.getParentAtCaret(),m=_.getParentAtCaret();if(!y||!m)return null;const v=y.getParents().reverse();v.push(y);const b=m.getParents().reverse();b.push(m);const S=Math.min(v.length,b.length);let x;for(x=0;x<S&&v[x]===b[x];x++);const C=(w,M)=>{let P;for(let K=x;K<w.length;K++){const U=w[K];if(ke(U))return;!P&&M(U)&&(P=U)}return P},E=C(v,Re),k=E&&C(b,w=>p.has(w.getKey())&&Re(w));return E&&k?[E,k]:null})(c,f,a);if(d){const[g,_]=d;je(g,"previous").splice(0,_.getChildren());let p=_.getParent();for(_.remove(!0);p&&p.isEmpty();){const y=p;p=p.getParent(),y.remove(!0)}}const h=[c,f,...o,...l].find(Ti);if(h)return tg(Cn(Oe(h),n.direction));F(269,JSON.stringify(o.map(g=>g.origin.__key)))}function Oe(n){const e=(function(i){let s=i;for(;nt(s);){const o=eo(s);if(!nt(o))break;s=o}return s})(n.getLatest()),{direction:t}=e;if(O(e.origin))return xt(e)?e:Ct(e.origin,t,t);const r=e.getAdjacentCaret();return kn(r)&&O(r.origin)?Ct(r.origin,t,$n(t)):e}function Ru(n){return xt(n)&&n.offset!==bt(n.origin,n.direction)}function Cn(n,e){return n.direction===e?n:n.getFlipped()}function io(n,e){return n.direction===e?n:ft(Cn(n.focus,e),Cn(n.anchor,e))}function rg(n,e,t){let r=je(n,"next");for(let i=0;i<e;i++){const s=r.getAdjacentCaret();if(s===null)break;r=s}return Cn(r,t)}function ig(...n){return n}function sg(n,e){if(!e||n===e)return n;for(const t in e)if(n[t]!==e[t])return{...n,...e};return n}function Et(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function ht(n,...e){const t=Et(...e);t.length>0&&n.classList.add(...t)}function so(n,...e){const t=Et(...e);t.length>0&&n.classList.remove(...t)}function En(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}const gs=new Map;function zu(n){const e={};if(!n)return e;const t=n.split(";");for(const r of t)if(r!==""){const[i,s]=r.split(/:([^]+)/);i&&s&&(e[i.trim()]=s.trim())}return e}function cl(n){let e=gs.get(n);return e===void 0&&(e=zu(n),gs.set(n,e)),e}function Bu(n){const e=ai().getElementByKey(n.getKey());if(e===null)return null;const t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function Ku(n){return Bu(ue(n)?n:n.getParentOrThrow())}function dl(n){const e=Ku(n);return e!==null&&e.direction==="rtl"}function Uu(n,e,t="self"){const r=n.getStartEndPoints();if(e.isSelected(n)&&!at(e)&&r!==null){const[i,s]=r,o=n.isBackward(),l=i.getNode(),a=s.getNode(),u=e.is(l),c=e.is(a);if(u||c){const[f,d]=ss(n),h=l.is(a),g=e.is(o?a:l),_=e.is(o?l:a);let p,y=0;h?(y=f>d?d:f,p=f>d?f:d):g?(y=o?d:f,p=void 0):_&&(y=0,p=o?f:d);const m=e.__text.slice(y,p);m!==e.__text&&(t==="clone"&&(e=Hf(e)),e.__text=m)}}return e}function og(n){const e=n.getStyle(),t=zu(e);gs.set(e,t)}function lg(n,e){const t=n.getFormatType(),r=n.getIndent();t!==e.getFormatType()&&e.setFormat(t),r!==e.getIndent()&&e.setIndent(r)}function wi(n,e,t=lg){if(n===null)return;const r=n.getStartEndPoints(),i=new Map;let s=null;if(r){const[o,l]=r;s=Ls(),s.anchor.set(o.key,o.offset,o.type),s.focus.set(l.key,l.offset,l.type);const a=ze(o.getNode(),Re),u=ze(l.getNode(),Re);T(a)&&i.set(a.getKey(),a),T(u)&&i.set(u.getKey(),u)}for(const o of n.getNodes())if(T(o)&&Re(o))i.set(o.getKey(),o);else if(r===null){const l=ze(o,Re);T(l)&&i.set(l.getKey(),l)}for(const[o,l]of i){const a=e();t(l,a),l.replace(a,!0),s&&(o===s.anchor.key&&s.anchor.set(a.getKey(),s.anchor.offset,s.anchor.type),o===s.focus.key&&s.focus.set(a.getKey(),s.focus.offset,s.focus.type))}s&&n.is($())&&xe(s)}function Wu(n){const e=ju(n);return e!==null&&e.writingMode==="vertical-rl"}function ju(n){const e=n.anchor.getNode();return T(e)?Bu(e):Ku(e)}function fl(n,e){let t=Wu(n)?!e:e;Hu(n)&&(t=!t);const r=gt(n.focus,t?"previous":"next");if(Ru(r))return!1;for(const i of no(r)){if(nt(i))return!i.origin.isInline();if(!T(i.origin)){if(W(i.origin))return!0;break}}return!1}function ag(n,e,t,r){n.modify(e?"extend":"move",t,r)}function Hu(n){const e=ju(n);return e!==null&&e.direction==="rtl"}function gl(n,e,t){const r=Hu(n);let i;i=Wu(n)||r?!t:t,ag(n,e,i,"character")}function ug(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ju=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,cg=Ju&&"documentMode"in document?document.documentMode:null;!(!Ju||!("InputEvent"in window)||cg)&&"getTargetRanges"in new window.InputEvent("input");function dg(n){return n?n.getAdjacentCaret():null}function fg(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function gg(n){const e=ze(n,t=>T(t)&&!t.isInline());return T(e)||ug(4,n.__key),e}function Pt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}function hl(n){const e=$();if(!N(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const s=r[i],o=s.getKey();if(t.has(o))continue;const l=ze(s,u=>T(u)&&!u.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function hg(n,e){const t=Su(e)?e.body.childNodes:e.childNodes;let r=[];const i=[];for(const s of t)if(!qu.has(s.nodeName)){const o=Gu(s,n,i,!1);o!==null&&(r=r.concat(o))}return(function(s){for(const o of s)o.getNextSibling()instanceof Bs&&o.insertAfter(Ie());for(const o of s){const l=o.getChildren();for(const a of l)o.insertBefore(a);o.remove()}})(i),r}function pg(n,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"),r=te().getChildren();for(let i=0;i<r.length;i++)Vu(n,r[i],t,e);return t.innerHTML}function Vu(n,e,t,r=null){let i=r===null||e.isSelected(r);const s=T(e)&&e.excludeFromCopy("html");let o=e;r!==null&&O(e)&&(o=Uu(r,e,"clone"));const l=T(o)?o.getChildren():[],a=Us(n,o.getType());let u;u=a&&a.exportDOM!==void 0?a.exportDOM(n,o):o.exportDOM(n);const{element:c,after:f}=u;if(!c)return!1;const d=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],_=Vu(n,g,d,r);!i&&T(e)&&_&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!s){if((oe(c)||ds(c))&&c.append(d),t.append(c),f){const h=f.call(o,c);h&&(ds(c)?c.replaceChildren(h):c.replaceWith(h))}}else t.append(d);return i}const qu=new Set(["STYLE","SCRIPT"]);function Gu(n,e,t,r,i=new Map,s){let o=[];if(qu.has(n.nodeName))return o;let l=null;const a=(function(g,_){const{nodeName:p}=g,y=_._htmlConversions.get(p.toLowerCase());let m=null;if(y!==void 0)for(const v of y){const b=v(g);b!==null&&(m===null||(m.priority||0)<=(b.priority||0))&&(m=b)}return m!==null?m.conversion:null})(n,e),u=a?a(n):null;let c=null;if(u!==null){c=u.after;const g=u.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,_]of i)if(l=_(l,s),!l)break;l&&o.push(...Array.isArray(g)?g:[l])}u.forChild!=null&&i.set(n.nodeName,u.forChild)}const f=n.childNodes;let d=[];const h=(l==null||!ke(l))&&(l!=null&&os(l)||r);for(let g=0;g<f.length;g++)d.push(...Gu(f[g],e,t,h,new Map(i),l));return c!=null&&(d=c(d)),qr(n)&&(d=mg(n,d,h?()=>{const g=new Bs;return t.push(g),g}:Z)),l==null?d.length>0?o=o.concat(d):qr(n)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:fs(g.nextSibling)&&fs(g.previousSibling)})(n)&&(o=o.concat(Ie())):T(l)&&l.append(...d),o}function mg(n,e,t){const r=n.style.textAlign,i=[];let s=[];for(let o=0;o<e.length;o++){const l=e[o];if(os(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(s.push(l),o===e.length-1||o<e.length-1&&os(e[o+1])){const a=t();a.setFormat(r),a.append(...s),i.push(a),s=[]}}return i}function Gr(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function yg(n,e=$()){return e==null&&Gr(166),N(e)&&e.isCollapsed()||e.getNodes().length===0?"":pg(n,e)}function _g(n,e=$()){return e==null&&Gr(166),N(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(vg(n,e))}function pl(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const l=JSON.parse(r);if(l.namespace===t._config.namespace&&Array.isArray(l.nodes))return ml(t,xg(l.nodes),e)}catch(l){console.error(l)}const i=n.getData("text/html"),s=n.getData("text/plain");if(i&&s!==i)try{const l=new DOMParser().parseFromString((function(a){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:u=>u}).createHTML(a):a})(i),"text/html");return ml(t,hg(t,l),e)}catch(l){console.error(l)}const o=s||n.getData("text/uri-list");if(o!=null)if(N(e)){const l=o.split(/(\r?\n|\t)/);l[l.length-1]===""&&l.pop();for(let a=0;a<l.length;a++){const u=$();if(N(u)){const c=l[a];c===`
12
+ `||c===`\r
13
+ `?u.insertParagraph():c===" "?u.insertNodes([We()]):u.insertText(c)}}}else e.insertRawText(o)}function ml(n,e,t){n.dispatchCommand(Xd,{nodes:e,selection:t})||(t.insertNodes(e),(function(r){if(N(r)&&r.isCollapsed()){const i=r.anchor;let s=null;const o=gt(i,"previous");if(o)if(xt(o))s=o.origin;else{const l=ft(o,je(te(),"next").getFlipped());for(const a of l){if(O(a.origin)){s=a.origin;break}if(T(a.origin)&&!a.origin.isInline())break}}if(s&&O(s)){const l=s.getFormat(),a=s.getStyle();r.format===l&&r.style===a||(r.format=l,r.style=a,r.dirty=!0)}}})(t))}function Yu(n,e,t,r=[]){let i=e===null||t.isSelected(e);const s=T(t)&&t.excludeFromCopy("html");let o=t;e!==null&&O(o)&&(o=Uu(e,o,"clone"));const l=T(o)?o.getChildren():[],a=(function(u){const c=u.exportJSON(),f=u.constructor;if(c.type!==f.getType()&&Gr(58,f.name),T(u)){const d=c.children;Array.isArray(d)||Gr(59,f.name)}return c})(o);O(o)&&o.getTextContentSize()===0&&(i=!1);for(let u=0;u<l.length;u++){const c=l[u],f=Yu(n,e,c,a.children);!i&&T(t)&&f&&t.extractWithChild(c,e,"clone")&&(i=!0)}if(i&&!s)r.push(a);else if(Array.isArray(a.children))for(let u=0;u<a.children.length;u++){const c=a.children[u];r.push(c)}return i}function vg(n,e){const t=[],r=te().getChildren();for(let i=0;i<r.length;i++)Yu(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function xg(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=Af(r);O(i)&&og(i),e.push(i)}return e}let tn=null;async function yl(n,e,t){if(tn!==null)return!1;if(e!==null)return new Promise((u,c)=>{n.update(()=>{u(_l(n,e,t))})});const r=n.getRootElement(),i=n._window||window,s=i.document,o=Be(i);if(r===null||o===null)return!1;const l=s.createElement("span");l.style.cssText="position: fixed; top: -1000px;",l.append(s.createTextNode("#")),r.append(l);const a=new Range;return a.setStart(l,0),a.setEnd(l,1),o.removeAllRanges(),o.addRange(a),new Promise((u,c)=>{const f=n.registerCommand(ni,d=>(Pt(d,ClipboardEvent)&&(f(),tn!==null&&(i.clearTimeout(tn),tn=null),u(_l(n,d,t))),!0),$f);tn=i.setTimeout(()=>{f(),tn=null,u(!1)},50),s.execCommand("copy"),l.remove()})}function _l(n,e,t){if(t===void 0){const i=Be(n._window),s=$();if(!s||s.isCollapsed()||!i)return!1;const o=i.anchorNode,l=i.focusNode;if(o!==null&&l!==null&&!or(n,o,l))return!1;t=bg(s)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Sg(r,t),!0)}const Zu=[["text/html",yg],["application/x-lexical-editor",_g]];function bg(n=$()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=ai();for(const[r,i]of Zu){const s=i(t,n);s!==null&&(e[r]=s)}}return e}function Sg(n,e){for(const[t]of Zu)e[t]===void 0&&n.setData(t,"");for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}const kg=Symbol.for("preact-signals");function ci(){if(St>1)return void St--;let n,e=!1;for(;Hn!==void 0;){let t=Hn;for(Hn=void 0,hs++;t!==void 0;){const r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&Xu(t))try{t.c()}catch(i){e||(n=i,e=!0)}t=r}}if(hs=0,St--,e)throw n}function Cg(n){if(St>0)return n();St++;try{return n()}finally{ci()}}let j,Hn;function vl(n){const e=j;j=void 0;try{return n()}finally{j=e}}let St=0,hs=0,Ar=0;function xl(n){if(j===void 0)return;let e=n.n;return e===void 0||e.t!==j?(e={i:0,S:n,p:j.s,n:void 0,t:j,e:void 0,x:void 0,r:e},j.s!==void 0&&(j.s.n=e),j.s=e,n.n=e,32&j.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=j.s,e.n=void 0,j.s.n=e,j.s=e),e):void 0}function _e(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Eg(n,e){return new _e(n,e)}function Xu(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function bl(n){for(let e=n.s;e!==void 0;e=e.n){const t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function Qu(n){let e,t=n.s;for(;t!==void 0;){const r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}n.s=e}function nn(n,e){_e.call(this,void 0),this.x=n,this.s=void 0,this.g=Ar-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function ec(n){const e=n.u;if(n.u=void 0,typeof e=="function"){St++;const t=j;j=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,oo(n),r}finally{j=t,ci()}}}function oo(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,ec(n)}function Tg(n){if(j!==this)throw new Error("Out-of-order effect");Qu(this),j=n,this.f&=-2,8&this.f&&oo(this),ci()}function un(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function lo(n,e){const t=new un(n,e);try{t.c()}catch(i){throw t.d(),i}const r=t.d.bind(t);return r[Symbol.dispose]=r,r}function wg(n,e={}){const t={};for(const r in n){const i=e[r],s=Eg(i===void 0?n[r]:i);t[r]=s}return t}_e.prototype.brand=kg,_e.prototype.h=function(){return!0},_e.prototype.S=function(n){const e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:vl(()=>{var t;(t=this.W)==null||t.call(this)}))},_e.prototype.U=function(n){if(this.t!==void 0){const e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&vl(()=>{var r;(r=this.Z)==null||r.call(this)}))}},_e.prototype.subscribe=function(n){return lo(()=>{const e=this.value,t=j;j=void 0;try{n(e)}finally{j=t}},{name:"sub"})},_e.prototype.valueOf=function(){return this.value},_e.prototype.toString=function(){return this.value+""},_e.prototype.toJSON=function(){return this.value},_e.prototype.peek=function(){const n=j;j=void 0;try{return this.value}finally{j=n}},Object.defineProperty(_e.prototype,"value",{get(){const n=xl(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(hs>100)throw new Error("Cycle detected");this.v=n,this.i++,Ar++,St++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{ci()}}}}),nn.prototype=new _e,nn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ar))return!0;if(this.g=Ar,this.f|=1,this.i>0&&!Xu(this))return this.f&=-2,!0;const n=j;try{bl(this),j=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return j=n,Qu(this),this.f&=-2,!0},nn.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}_e.prototype.S.call(this,n)},nn.prototype.U=function(n){if(this.t!==void 0&&(_e.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},nn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(nn.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const n=xl(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),un.prototype.c=function(){const n=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},un.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ec(this),bl(this),St++;const n=j;return j=this,Tg.bind(this,n)},un.prototype.N=function(){2&this.f||(this.f|=2,this.o=Hn,Hn=this)},un.prototype.d=function(){this.f|=8,1&this.f||oo(this)},un.prototype.dispose=function(){this.d()};function Ng(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}Ns("format",{parse:n=>typeof n=="number"?n:0});function J(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function tc(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){const t=n,r=e;for(const i in r)t[i]=tc(t[i],r[i]);return n}return e}const ao=0,ps=1,nc=2,Ni=3,mr=4,rn=5,Ai=6,Ln=7;function Fi(n){return n.id===ao}function rc(n){return n.id===nc}function Ag(n){return(function(e){return e.id===ps})(n)||J(305,String(n.id),String(ps)),Object.assign(n,{id:nc})}const Fg=new Set;class Og{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:ao}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):sg;for(const r of this.configs)e=t(e,r);return e}init(e){const t=this.state;rc(t)||J(306,String(t.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(l,a,u){return Object.assign(l,{config:a,id:Ni,registerState:u})})(t,this.mergeConfigs(),r);let o;this.state=s,this.extension.init&&(o=this.extension.init(e,s.config,r)),this.state=(function(l,a,u){return Object.assign(l,{id:mr,initResult:a,registerState:u})})(s,o,i)}build(e){const t=this.state;let r;t.id!==mr&&J(307,String(t.id),String(rn)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));const i={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(s,o,l){return Object.assign(s,{id:rn,output:o,registerState:l})})(t,r,i)}register(e,t){this._signal=t;const r=this.state;r.id!==rn&&J(308,String(r.id),String(rn));const i=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(s){return Object.assign(s,{id:Ai})})(r),()=>{const s=this.state;s.id!==Ln&&J(309,String(r.id),String(Ln)),this.state=(function(o){return Object.assign(o,{id:rn})})(s),i&&i()}}afterRegistration(e){const t=this.state;let r;return t.id!==Ai&&J(310,String(t.id),String(Ai)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(i){return Object.assign(i,{id:Ln})})(t),r}getSignal(){return this._signal===void 0&&J(311),this._signal}getInitResult(){this.extension.init===void 0&&J(312,this.extension.name);const e=this.state;return(function(t){return t.id>=mr})(e)||J(313,String(e.id),String(mr)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(t){return t.id>=Ni})(e)||J(314,String(e.id),String(Ni)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&J(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&J(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=Ln})(e)||J(316,String(e.id),String(Ln)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Fg}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(t){return t.id>=rn})(e)||J(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}const Sl={tag:Un};function $g(){const n=te();n.isEmpty()&&n.append(Z())}const Ig={config:{setOptions:Sl,updateOptions:Sl},init:({$initialEditorState:n=$g})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:s}=i;if(Ff(s))n.setEditorState(s,t);else if(typeof s=="function")n.update(()=>{s(n)},e);else if(s&&(typeof s=="string"||typeof s=="object")){const o=n.parseEditorState(s);n.setEditorState(o,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[An,rt,Tn,wn,Fn]},kl=Symbol.for("@lexical/extension/LexicalBuilder");function Cl(){}function Mg(n){throw n}function yr(n){return Array.isArray(n)?n:[n]}const Oi="0.41.0+prod.esm";let Pg=class Fr{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Oi,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[yr(Ig)];for(const r of e)t.push(yr(r));return new Fr(t)}static maybeFromEditor(e){const t=e[kl];return t&&(t.PACKAGE_VERSION!==Oi&&J(292,t.PACKAGE_VERSION,Oi),t instanceof Fr||J(293)),t}static fromEditor(e){const t=Fr.maybeFromEditor(e);return t===void 0&&J(294),t}constructEditor(){const{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),i=Object.assign(_u({...r,...t?{onError:s=>{t(s,i)}}:{}}),{[kl]:this});for(const s of this.sortedExtensionReps())s.build(i);return i}buildEditor(){let e=Cl;function t(){try{e()}finally{e=Cl}}const r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=En(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&J(295,e.name),t}addEdge(e,t,r){const i=this.outgoingConfigEdges.get(e);i?i.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));const s=this.incomingEdges.get(t);s?s.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&J(296);const t=yr(e),[r]=t;typeof r.name!="string"&&J(297,typeof r.name);let i=this.extensionNameMap.get(r.name);if(i!==void 0&&i.extension!==r&&J(298,r.name),!i){i=new Og(this,r),this.extensionNameMap.set(r.name,i);const s=this.conflicts.get(r.name);typeof s=="string"&&J(299,r.name,s);for(const o of r.conflictsWith||[])this.extensionNameMap.has(o)&&J(299,r.name,o),this.conflicts.set(o,r.name);for(const o of r.dependencies||[]){const l=yr(o);this.addEdge(r.name,l[0].name,l.slice(1)),this.addExtension(l)}for(const[o,l]of r.peerDependencies||[])this.addEdge(r.name,o,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(r,i)=>{let s=r.state;if(rc(s))return;const o=r.extension.name;var l;Fi(s)||J(300,o,i||"[unknown]"),Fi(l=s)||J(304,String(l.id),String(ao)),s=Object.assign(l,{id:ps}),r.state=s;const a=this.outgoingConfigEdges.get(o);if(a)for(const u of a.keys()){const c=this.extensionNameMap.get(u);c&&t(c,o)}s=Ag(s),r.state=s,e.push(r)};for(const r of this.extensionNameMap.values())Fi(r.state)&&t(r);for(const r of e)for(const[i,s]of this.outgoingConfigEdges.get(r.extension.name)||[])if(s.length>0){const o=this.extensionNameMap.get(i);if(o)for(const l of s)o.configs.add(l)}for(const[r,...i]of this.roots)if(i.length>0){const s=this.extensionNameMap.get(r.name);s===void 0&&J(301,r.name);for(const o of i)s.configs.add(o)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],s=r.signal;for(const o of t){const l=o.register(e,s);l&&i.push(l)}for(const o of t){const l=o.afterRegistration(e);l&&i.push(l)}return En(...i)}buildCreateEditorArgs(){const e={},t=new Set,r=new Map,i=new Map,s={},o={},l=this.sortedExtensionReps();for(const c of l){const{extension:f}=c;if(f.onError!==void 0&&(e.onError=f.onError),f.disableEvents!==void 0&&(e.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(e.parentEditor=f.parentEditor),f.editable!==void 0&&(e.editable=f.editable),f.namespace!==void 0&&(e.namespace=f.namespace),f.$initialEditorState!==void 0&&(e.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of Ng(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&J(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,c)}t.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())i.set(d,h);f.html.import&&Object.assign(s,f.html.import)}f.theme&&tc(o,f.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);const a=Object.keys(s).length>0,u=i.size>0;(a||u)&&(e.html={},a&&(e.html.import=s),u&&(e.html.export=i));for(const c of l)c.init(e);return e.onError||(e.onError=Mg),e}};function Lg(n,e){const t=Pg.fromEditor(n).extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}function El(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,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,Dg=Zt&&"documentMode"in document?document.documentMode:null,Rg=Zt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),zg=!(!Zt||!("InputEvent"in window)||Dg)&&"getTargetRanges"in new window.InputEvent("input"),Bg=Zt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Tl=Zt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Kg=Zt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ug=Zt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Rg&&!Kg,wl=L("DRAG_DROP_PASTE_FILE");let di=class ic extends Me{static getType(){return"quote"}static clone(e){return new ic(e.__key)}createDOM(e){const t=document.createElement("blockquote");return ht(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Wg,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(oe(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return fi().updateFromJSON(e)}insertNewAfter(e,t){const r=Z(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,t),r}collapseAtStart(){const e=Z();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function fi(){return Je(new di)}function ms(n){return n instanceof di}let gi=class sc extends Me{__tag;static getType(){return"heading"}static clone(e){return new sc(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,r=document.createElement(t),i=e.theme.heading;if(i!==void 0){const s=i[t];ht(r,s)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:sn,priority:0}),h2:e=>({conversion:sn,priority:0}),h3:e=>({conversion:sn,priority:0}),h4:e=>({conversion:sn,priority:0}),h5:e=>({conversion:sn,priority:0}),h6:e=>({conversion:sn,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&Nl(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Nl(e)?{conversion:t=>({node:Lt("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(oe(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return Lt(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,i=this.getLastDescendant(),s=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?Z():Lt(this.getTag()),o=this.getDirection();if(s.setDirection(o),this.insertAfter(s,t),r===0&&!this.isEmpty()&&e){const l=Z();l.select(),this.replace(l,!0)}return s}collapseAtStart(){const e=this.isEmpty()?Z():Lt(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function Nl(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function sn(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Lt(e),n.style!==null&&(Zs(n,t),t.setFormat(n.style.textAlign))),{node:t}}function Wg(n){const e=fi();return n.style!==null&&(e.setFormat(n.style.textAlign),Zs(n,e)),{node:e}}function Lt(n="h1"){return Je(new gi(n))}function jg(n){return n instanceof gi}function _r(n){let e=null;if(Pt(n,DragEvent)?e=n.dataTransfer:Pt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function Al(n){const e=bn(n);return W(e)}function $i(n){for(const e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function Hg(n){return En(n.registerCommand(Oa,e=>{const t=$();return!!be(t)&&(t.clear(),!0)},z),n.registerCommand(Rt,e=>{const t=$();return N(t)?(t.deleteCharacter(e),!0):!!be(t)&&(t.deleteNodes(),!0)},z),n.registerCommand(Yn,e=>{const t=$();return!!N(t)&&(t.deleteWord(e),!0)},z),n.registerCommand(Zn,e=>{const t=$();return!!N(t)&&(t.deleteLine(e),!0)},z),n.registerCommand(hn,e=>{const t=$();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)pl(r,t,n);else if(N(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},z),n.registerCommand(Gi,()=>{const e=$();return!!N(e)&&(e.removeText(),!0)},z),n.registerCommand(ct,e=>{const t=$();return!!N(t)&&(t.formatText(e),!0)},z),n.registerCommand(Qd,e=>{const t=$();if(!N(t)&&!be(t))return!1;const r=t.getNodes();for(const i of r){const s=ze(i,o=>T(o)&&!o.isInline());s!==null&&s.setFormat(e)}return!0},z),n.registerCommand(gn,e=>{const t=$();return!!N(t)&&(t.insertLineBreak(e),!0)},z),n.registerCommand(Gn,()=>{const e=$();return!!N(e)&&(e.insertParagraph(),!0)},z),n.registerCommand(Zi,()=>{const e=We(),t=$();return N(t)&&(e.setFormat(t.format),e.setStyle(t.style)),cu([e]),!0},z),n.registerCommand(zt,()=>hl(e=>{const t=e.getIndent();e.setIndent(t+1)}),z),n.registerCommand(cn,()=>hl(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),z),n.registerCommand(_n,e=>{const t=$();if(be(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(N(t)){const r=as(t.focus,!0);if(!e.shiftKey&&W(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},z),n.registerCommand(zr,e=>{const t=$();if(be(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(N(t)){if((function(i){const s=i.focus;return s.key==="root"&&s.offset===te().getChildrenSize()})(t))return e.preventDefault(),!0;const r=as(t.focus,!1);if(!e.shiftKey&&W(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},z),n.registerCommand(Ra,e=>{const t=$();if(be(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),dl(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!N(t))return!1;if(fl(t,!0)){const r=e.shiftKey;return e.preventDefault(),gl(t,r,!0),!0}return!1},z),n.registerCommand(Da,e=>{const t=$();if(be(t)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),dl(i[0])?i[0].selectPrevious():i[0].selectNext(0,0),!0}if(!N(t))return!1;const r=e.shiftKey;return!!fl(t,!1)&&(e.preventDefault(),gl(t,r,!1),!0)},z),n.registerCommand(Ba,e=>{if(Al(e.target))return!1;const t=$();if(N(t)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:i}=r;if(i.offset!==0)return!1;const s=i.getNode();if(ue(s))return!1;const o=gg(s);return o.getIndent()>0&&(o.is(s)||s.is(o.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(cn,void 0);if(Tl&&navigator.language==="ko-KR")return!1}else if(!be(t))return!1;return e.preventDefault(),n.dispatchCommand(Rt,!0)},z),n.registerCommand(Ua,e=>{if(Al(e.target))return!1;const t=$();return!(!N(t)&&!be(t))&&(e.preventDefault(),n.dispatchCommand(Rt,!1))},z),n.registerCommand(Br,e=>{const t=$();if(!N(t))return!1;if($i(t),e!==null){if((Tl||Bg||Ug)&&zg)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(gn,!1)}return n.dispatchCommand(Gn,void 0)},z),n.registerCommand(Ka,()=>{const e=$();return!!N(e)&&(n.blur(),!0)},z),n.registerCommand(Wa,e=>{const[,t]=_r(e);if(t.length>0){const i=El(e.clientX,e.clientY);if(i!==null){const{offset:s,node:o}=i,l=bn(o);if(l!==null){const a=Ls();if(O(l))a.anchor.set(l.getKey(),s,"text"),a.focus.set(l.getKey(),s,"text");else{const c=l.getParentOrThrow().getKey(),f=l.getIndexWithinParent()+1;a.anchor.set(c,f,"element"),a.focus.set(c,f,"element")}const u=Ir(a);xe(u)}n.dispatchCommand(wl,t)}return e.preventDefault(),!0}const r=$();return!!N(r)},z),n.registerCommand(ja,e=>{const[t]=_r(e),r=$();return!(t&&!N(r))},z),n.registerCommand(Ha,e=>{const[t]=_r(e),r=$();if(t&&!N(r))return!1;const i=El(e.clientX,e.clientY);if(i!==null){const s=bn(i.node);W(s)&&e.preventDefault()}return!0},z),n.registerCommand(Xi,()=>(zf(),!0),z),n.registerCommand(ni,e=>(yl(n,Pt(e,ClipboardEvent)?e:null),!0),z),n.registerCommand(Ms,e=>((async function(t,r){await yl(r,Pt(t,ClipboardEvent)?t:null),r.update(()=>{const i=$();N(i)?i.removeText():be(i)&&i.getNodes().forEach(s=>s.remove())})})(e,n),!0),z),n.registerCommand(Fs,e=>{const[,t,r]=_r(e);return t.length>0&&!r?(n.dispatchCommand(wl,t),!0):On(e.target)&&Ws(e.target)?!1:$()!==null&&((function(i,s){i.preventDefault(),s.update(()=>{const o=$(),l=Pt(i,InputEvent)||Pt(i,KeyboardEvent)?null:i.clipboardData;l!=null&&o!==null&&pl(l,o,s)},{tag:hf})})(e,n),!0)},z),n.registerCommand(za,e=>{const t=$();return N(t)&&$i(t),!1},z),n.registerCommand(Is,e=>{const t=$();return N(t)&&$i(t),!1},z))}function Jg(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return 0;const s=e._selection,o=n._selection;if(i)return 1;if(!(N(s)&&N(o)&&o.isCollapsed()&&s.isCollapsed()))return 0;const l=(function(y,m,v){const b=y._nodeMap,S=[];for(const x of m){const C=b.get(x);C!==void 0&&S.push(C)}for(const[x,C]of v){if(!C)continue;const E=b.get(x);E===void 0||ue(E)||S.push(E)}return S})(e,t,r);if(l.length===0)return 0;if(l.length>1){const y=e._nodeMap,m=y.get(s.anchor.key),v=y.get(o.anchor.key);return m&&v&&!n._nodeMap.has(m.__key)&&O(m)&&m.__text.length===1&&s.anchor.offset===1?2:0}const a=l[0],u=n._nodeMap.get(a.__key);if(!O(u)||!O(a)||u.__mode!==a.__mode)return 0;const c=u.__text,f=a.__text;if(c===f)return 0;const d=s.anchor,h=o.anchor;if(d.key!==h.key||d.type!=="text")return 0;const g=d.offset,_=h.offset,p=f.length-c.length;return p===1&&_===g-1?2:p===-1&&_===g+1?3:p===-1&&_===g?4:0}function Vg(n,e){let t=Date.now(),r=0,i=Date.now(),s=0,o=null;return(l,a,u,c,f,d)=>{const h=Date.now();if(d.has(tu)&&(i=t,s=r,o=l),d.has(is))return r=0,t=h,2;d.has(nu)&&o&&(t=i,r=s,l=o);const g=Jg(l,a,c,f,n.isComposing()),_=(()=>{const p=u===null||u.editor===n,y=d.has(gf);if(!y&&p&&d.has(Un))return 0;if(g===1)return 2;if(l===null)return 1;const m=a._selection;if(!(c.size>0||f.size>0))return m!==null?0:2;const v=typeof e=="number"?e:e.peek();return y===!1&&g!==0&&g===r&&h<t+v&&p||c.size===1&&(function(b,S,x){const C=S._nodeMap.get(b),E=x._nodeMap.get(b),k=S._selection,w=x._selection;return!(N(k)&&N(w)&&k.anchor.type==="element"&&k.focus.type==="element"&&w.anchor.type==="text"&&w.focus.type==="text"||!O(C)||!O(E)||C.__parent!==E.__parent)&&JSON.stringify(S.read(()=>C.exportJSON()))===JSON.stringify(x.read(()=>E.exportJSON()))})(Array.from(c)[0],l,a)?0:1})();return t=h,r=g,_}}function Fl(n){n.undoStack=[],n.redoStack=[],n.current=null}function oc(n,e,t){const r=Vg(n,t);return En(n.registerCommand(Os,()=>((function(s,o){const l=o.redoStack,a=o.undoStack;if(a.length!==0){const u=o.current,c=a.pop();u!==null&&(l.push(u),s.dispatchCommand(cr,!0)),a.length===0&&s.dispatchCommand(dr,!1),o.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:is})}})(n,e),!0),z),n.registerCommand($s,()=>((function(s,o){const l=o.redoStack,a=o.undoStack;if(l.length!==0){const u=o.current;u!==null&&(a.push(u),s.dispatchCommand(dr,!0));const c=l.pop();l.length===0&&s.dispatchCommand(cr,!1),o.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:is})}})(n,e),!0),z),n.registerCommand(tf,()=>(Fl(e),!1),z),n.registerCommand(nf,()=>(Fl(e),n.dispatchCommand(cr,!1),n.dispatchCommand(dr,!1),!0),z),n.registerUpdateListener(({editorState:s,prevEditorState:o,dirtyLeaves:l,dirtyElements:a,tags:u})=>{const c=e.current,f=e.redoStack,d=e.undoStack,h=c===null?null:c.editorState;if(c!==null&&s===h)return;const g=r(o,s,c,l,a,u);if(g===1)f.length!==0&&(e.redoStack=[],n.dispatchCommand(cr,!1)),c!==null&&(d.push({...c}),n.dispatchCommand(dr,!0));else if(g===2)return;e.current={editor:n,editorState:s}}))}function lc(){return{current:null,redoStack:[],undoStack:[]}}const Ii={build:(n,{delay:e,createInitialHistoryState:t,disabled:r})=>wg({delay:e,disabled:r,historyState:t(n)}),config:{createInitialHistoryState:lc,delay:300,disabled:typeof window>"u"},name:"@lexical/history/History",register:(n,e,t)=>{const r=t.getOutput();return lo(()=>r.disabled.value?void 0:oc(n,r.historyState.value,r.delay))}};ig(Ii,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0});function vt(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function qg(n){let e=1,t=n.getParent();for(;t!=null;){if(V(t)){const r=t.getParent();if(B(r)){e++,t=r.getParent();continue}vt(40)}return e}return e}function ys(n){let e=n.getParent();B(e)||vt(40);let t=e;for(;t!==null;)t=t.getParent(),B(t)&&(e=t);return e}function ac(n){let e=[];const t=n.getChildren().filter(V);for(let r=0;r<t.length;r++){const i=t[r],s=i.getFirstChild();B(s)?e=e.concat(ac(s)):e.push(i)}return e}function Ze(n){return V(n)&&B(n.getFirstChild())}function Ol(n){return Pe().append(n)}function uc(n,e){return V(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function $l(n){const e=$();if(e!==null){let t=e.getNodes();if(N(e)){const i=e.getStartEndPoints();i===null&&vt(143);const[s]=i,o=s.getNode(),l=o.getParent();if(ke(o)){const a=o.getFirstChild();if(a)t=a.selectStart().getNodes();else{const u=Z();o.append(u),t=u.select().getNodes()}}else if(uc(o,t)){const a=Ce(n);if(ke(l)){o.replace(a);const u=Pe();T(o)&&(u.setFormat(o.getFormatType()),u.setIndent(o.getIndent())),a.append(u)}else if(V(o)){const u=o.getParentOrThrow();Gt(a,u.getChildren()),u.replace(a)}return}}const r=new Set;for(let i=0;i<t.length;i++){const s=t[i];if(T(s)&&s.isEmpty()&&!V(s)&&!r.has(s.getKey())){Il(s,n);continue}let o=ku(s)?s.getParent():V(s)&&s.isEmpty()?s:null;for(;o!=null;){const l=o.getKey();if(B(o)){if(!r.has(l)){const a=Ce(n);Gt(a,o.getChildren()),o.replace(a),r.add(l)}break}{const a=o.getParent();if(ke(a)&&!r.has(l)){r.add(l),Il(o,n);break}o=a}}}}}function Gt(n,e){n.splice(n.getChildrenSize(),0,e)}function Il(n,e){if(B(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=Pe();let s;if(Gt(i,n.getChildren()),B(t)&&e===t.getListType())t.append(i),B(r)&&e===r.getListType()&&(Gt(t,r.getChildren()),r.remove()),s=t;else if(B(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const l=Ce(e);l.append(i),n.replace(l),s=l}i.setFormat(n.getFormatType()),i.setIndent(n.getIndent());const o=$();return N(o)&&(s.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,"element"),s.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,"element")),n.remove(),s}function uo(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&Ze(t)&&Ze(r)&&(uo(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function Gg(){const n=$();if(N(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(uc(r,t))e.add(ys(r));else for(let i=0;i<t.length;i++){const s=t[i];if(ku(s)){const o=fg(s,Xt);o!=null&&e.add(ys(o))}}for(const i of e){let s=i;const o=ac(i);for(const l of o){const a=Z().setTextStyle(n.style).setTextFormat(n.format);Gt(a,l.getChildren()),s.insertAfter(a),s=a,l.__key===n.anchor.key&&qt(n.anchor,Oe(je(a,"next"))),l.__key===n.focus.key&&qt(n.focus,Oe(je(a,"next"))),l.remove()}i.remove()}}}function cc(n){const e=n.getListType()!=="check";let t=n.getStart();for(const r of n.getChildren())V(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),B(r.getFirstChild())||t++)}function Yg(n){const e=new Set;if(Ze(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(Ze(r)&&Ze(i)){const s=i.getFirstChild();if(B(s)){s.append(n);const o=r.getFirstChild();B(o)&&(Gt(s,o.getChildren()),r.remove(),e.add(r.getKey()))}}else if(Ze(r)){const s=r.getFirstChild();if(B(s)){const o=s.getFirstChild();o!==null&&o.insertBefore(n)}}else if(Ze(i)){const s=i.getFirstChild();B(s)&&s.append(n)}else if(B(t)){const s=Pe().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),o=Ce(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(o),o.append(n),i?i.insertAfter(s):r?r.insertBefore(s):t.append(s)}}function Zg(n){if(Ze(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(B(t?t.getParent():void 0)&&V(t)&&B(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(i))t.insertAfter(n),e.isEmpty()&&t.remove();else{const s=e.getListType(),o=Pe(),l=Ce(s);o.append(l),n.getPreviousSiblings().forEach(c=>l.append(c));const a=Pe(),u=Ce(s);a.append(u),Gt(u,n.getNextSiblings()),t.insertBefore(o),t.insertAfter(a),t.replace(n)}}}function Xg(n=!1){const e=$();if(!N(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();let r=null;if(V(t)&&t.getChildrenSize()===0)r=t;else if(O(t)){const u=t.getParent();V(u)&&u.getChildren().every(c=>O(c)&&c.getTextContent().trim()==="")&&(r=u)}if(r===null)return!1;const i=ys(r),s=r.getParent();B(s)||vt(40);const o=s.getParent();let l;if(ke(o))l=Z(),i.insertAfter(l);else{if(!V(o))return!1;l=Pe(),o.insertAfter(l)}l.setTextStyle(e.style).setTextFormat(e.format).select();const a=r.getNextSiblings();if(a.length>0){const u=n?(function(f,d){return f.getStart()+d.getIndexWithinParent()})(s,r):1,c=Ce(s.getListType(),u);if(V(l)){const f=Pe();f.append(c),l.insertAfter(f)}else l.insertAfter(c);c.append(...a)}return(function(u){let c=u;for(;c.getNextSibling()==null&&c.getPreviousSibling()==null;){const f=c.getParent();if(f==null||!V(f)&&!B(f))break;c=f}c.remove()})(r),!0}class Xt extends Me{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;const t=e.getParent();B(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:Me,importDOM:{li:()=>({conversion:Qg,priority:0})}})}constructor(e=1,t=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,r){(function(o,l,a){const u=l.getParent();!B(u)||u.getListType()!=="check"||B(l.getFirstChild())?(o.removeAttribute("role"),o.removeAttribute("tabIndex"),o.removeAttribute("aria-checked")):(o.setAttribute("role","checkbox"),o.setAttribute("tabIndex","-1"),a&&l.__checked===a.__checked||o.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(o,l,a){const u=[],c=[],f=l.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&u.push(...Et(d)),f){const g=a.getParent(),_=B(g)&&g.getListType()==="check",p=a.getChecked();_&&!p||c.push(f.listitemUnchecked),_&&p||c.push(f.listitemChecked),_&&u.push(p?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=Et(h);a.getChildren().some(_=>B(_))?u.push(...g):c.push(...g)}c.length>0&&so(o,...c),u.length>0&&ht(o,...u)})(t,r.theme,this);const i=e?e.__style:"",s=this.__style;i!==s&&(s===""?t.removeAttribute("style"):t.style.cssText=s),(function(o,l,a){const u=cl(l.__textStyle);for(const c in u)o.style.setProperty(`--listitem-marker-${c}`,u[c]);if(a)for(const c in cl(a.__textStyle))c in u||o.style.removeProperty(`--listitem-marker-${c}`)})(t,this,e)}updateDOM(e,t,r){const i=t;return this.updateListItemDOM(e,i,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();return i&&(t.dir=i),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(T(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(V(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!B(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=Ce(r.getListType());let s=this.getNextSibling();for(;s;){const o=s;s=s.getNextSibling(),i.append(o)}r.insertAfter(e),e.insertAfter(i)}return t&&(T(e)||vt(139),this.getChildren().forEach(i=>{e.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if(B(r)||vt(39),V(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const s=Ce(r.getListType());i.forEach(o=>s.append(o)),e.insertAfter(s,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&Ze(t)&&Ze(r)&&(uo(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=Pe().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=Z();this.getChildren().forEach(o=>t.append(o));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),s=V(i);if(r.getChildrenSize()===1)if(s)r.remove(),i.select();else{r.insertBefore(t),r.remove();const o=e.anchor,l=e.focus,a=t.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(a,o.offset,"element"),l.type==="element"&&l.getNode().is(this)&&l.set(a,l.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return B(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;V(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&vt(117),(e=Math.floor(e))>=0||vt(199);let t=this.getIndent();for(;t!==e;)t<e?(Yg(this),t++):(Zg(this),t--);return this}canInsertAfter(e){return V(e)}canReplaceWith(e){return V(e)}canMergeWith(e){return V(e)||si(e)}extractWithChild(e,t){if(!N(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ce("bullet")}canMergeWhenEmpty(){return!0}}function Qg(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return Ml(t)}if(n.classList.contains("joplin-checkbox")){for(const t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return Ml(t.children[0])}const e=n.getAttribute("aria-checked");return{node:Pe(e==="true"||e!=="false"&&void 0)}}function Ml(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:Pe(n.hasAttribute("checked"))}}function Pe(n){return Je(new Xt(void 0,n))}function V(n){return n instanceof Xt}class ar extends Me{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){const r=t.getNextSibling();B(r)&&t.getListType()===r.getListType()&&uo(t,r)})(e),cc(e)},extends:Me,importDOM:{ol:()=>({conversion:Ll,priority:0}),ul:()=>({conversion:Ll,priority:0})}})}constructor(e="number",t=1,r){super(r);const i=th[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,Pl(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(Pl(t,r.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return oe(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()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,r){let i=r;for(let s=0;s<r.length;s++){const o=r[s];V(o)||(i===r&&(i=[...r]),i[s]=Pe().append(!T(o)||B(o)||o.isInline()?o:G(o.getTextContent())))}return super.splice(e,t,i)}extractWithChild(e){return V(e)}}function Pl(n,e,t){const r=[],i=[],s=e.list;if(s!==void 0){const o=s[`${t.__tag}Depth`]||[],l=qg(t)-1,a=l%o.length,u=o[a],c=s[t.__tag];let f;const d=s.nested,h=s.checklist;if(d!==void 0&&d.list&&(f=d.list),c!==void 0&&r.push(c),h!==void 0&&t.__listType==="check"&&r.push(h),u!==void 0){r.push(...Et(u));for(let g=0;g<o.length;g++)g!==a&&i.push(t.__tag+g)}if(f!==void 0){const g=Et(f);l>1?r.push(...g):i.push(...g)}}i.length>0&&so(n,...i),r.length>0&&ht(n,...r)}function eh(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(V(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach(s=>{B(s)&&e.push(Ol(s))})}else e.push(Ol(r))}return e}function Ll(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=Ce("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const i of r.childNodes)if(oe(i)&&i.hasAttribute("aria-checked"))return!0;return!1})(n)?Ce("check"):Ce("bullet")),{after:eh,node:t}}const th={ol:"number",ul:"bullet"};function Ce(n="number",e=1){return Je(new ar(n,e))}function B(n){return n instanceof ar}const nh=L("UPDATE_LIST_START_COMMAND"),dc=L("INSERT_UNORDERED_LIST_COMMAND"),fc=L("INSERT_ORDERED_LIST_COMMAND"),rh=L("REMOVE_LIST_COMMAND");function ih(n,e){return En(n.registerCommand(fc,()=>($l("number"),!0),Ae),n.registerCommand(nh,t=>{const{listNodeKey:r,newStart:i}=t,s=Q(r);return!!B(s)&&(s.getListType()==="number"&&(s.setStart(i),cc(s)),!0)},Ae),n.registerCommand(dc,()=>($l("bullet"),!0),Ae),n.registerCommand(rh,()=>(Gg(),!0),Ae),n.registerCommand(Gn,()=>Xg(!1),Ae),n.registerNodeTransform(Xt,t=>{const r=t.getFirstChild();if(r){if(O(r)){const i=r.getStyle(),s=r.getFormat();t.getTextStyle()!==i&&t.setTextStyle(i),t.getTextFormat()!==s&&t.setTextFormat(s)}}else{const i=$();N(i)&&(i.style!==t.getTextStyle()||i.format!==t.getTextFormat())&&i.isCollapsed()&&t.is(i.anchor.getNode())&&t.setTextStyle(i.style).setTextFormat(i.format)}}),n.registerNodeTransform(rt,t=>{const r=t.getParent();if(V(r)&&t.is(r.getFirstChild())){const i=t.getStyle(),s=t.getFormat();i===r.getTextStyle()&&s===r.getTextFormat()||r.setTextStyle(i).setTextFormat(s)}}))}var Mi={exports:{}},Dl;function sh(){return Dl||(Dl=1,(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var t=(function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},l={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function m(v){return v instanceof a?new a(v.type,m(v.content),v.alias):Array.isArray(v)?v.map(m):v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(m){return Object.prototype.toString.call(m).slice(8,-1)},objId:function(m){return m.__id||Object.defineProperty(m,"__id",{value:++s}),m.__id},clone:function m(v,b){b=b||{};var S,x;switch(l.util.type(v)){case"Object":if(x=l.util.objId(v),b[x])return b[x];S={},b[x]=S;for(var C in v)v.hasOwnProperty(C)&&(S[C]=m(v[C],b));return S;case"Array":return x=l.util.objId(v),b[x]?b[x]:(S=[],b[x]=S,v.forEach(function(E,k){S[k]=m(E,b)}),S);default:return v}},getLanguage:function(m){for(;m;){var v=i.exec(m.className);if(v)return v[1].toLowerCase();m=m.parentElement}return"none"},setLanguage:function(m,v){m.className=m.className.replace(RegExp(i,"gi"),""),m.classList.add("language-"+v)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(S){var m=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(S.stack)||[])[1];if(m){var v=document.getElementsByTagName("script");for(var b in v)if(v[b].src==m)return v[b]}return null}},isActive:function(m,v,b){for(var S="no-"+v;m;){var x=m.classList;if(x.contains(v))return!0;if(x.contains(S))return!1;m=m.parentElement}return!!b}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(m,v){var b=l.util.clone(l.languages[m]);for(var S in v)b[S]=v[S];return b},insertBefore:function(m,v,b,S){S=S||l.languages;var x=S[m],C={};for(var E in x)if(x.hasOwnProperty(E)){if(E==v)for(var k in b)b.hasOwnProperty(k)&&(C[k]=b[k]);b.hasOwnProperty(E)||(C[E]=x[E])}var w=S[m];return S[m]=C,l.languages.DFS(l.languages,function(M,P){P===w&&M!=m&&(this[M]=C)}),C},DFS:function m(v,b,S,x){x=x||{};var C=l.util.objId;for(var E in v)if(v.hasOwnProperty(E)){b.call(v,E,v[E],S||E);var k=v[E],w=l.util.type(k);w==="Object"&&!x[C(k)]?(x[C(k)]=!0,m(k,b,null,x)):w==="Array"&&!x[C(k)]&&(x[C(k)]=!0,m(k,b,E,x))}}},plugins:{},highlightAll:function(m,v){l.highlightAllUnder(document,m,v)},highlightAllUnder:function(m,v,b){var S={callback:b,container:m,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};l.hooks.run("before-highlightall",S),S.elements=Array.prototype.slice.apply(S.container.querySelectorAll(S.selector)),l.hooks.run("before-all-elements-highlight",S);for(var x=0,C;C=S.elements[x++];)l.highlightElement(C,v===!0,S.callback)},highlightElement:function(m,v,b){var S=l.util.getLanguage(m),x=l.languages[S];l.util.setLanguage(m,S);var C=m.parentElement;C&&C.nodeName.toLowerCase()==="pre"&&l.util.setLanguage(C,S);var E=m.textContent,k={element:m,language:S,grammar:x,code:E};function w(P){k.highlightedCode=P,l.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,l.hooks.run("after-highlight",k),l.hooks.run("complete",k),b&&b.call(k.element)}if(l.hooks.run("before-sanity-check",k),C=k.element.parentElement,C&&C.nodeName.toLowerCase()==="pre"&&!C.hasAttribute("tabindex")&&C.setAttribute("tabindex","0"),!k.code){l.hooks.run("complete",k),b&&b.call(k.element);return}if(l.hooks.run("before-highlight",k),!k.grammar){w(l.util.encode(k.code));return}if(v&&r.Worker){var M=new Worker(l.filename);M.onmessage=function(P){w(P.data)},M.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else w(l.highlight(k.code,k.grammar,k.language))},highlight:function(m,v,b){var S={code:m,grammar:v,language:b};if(l.hooks.run("before-tokenize",S),!S.grammar)throw new Error('The language "'+S.language+'" has no grammar.');return S.tokens=l.tokenize(S.code,S.grammar),l.hooks.run("after-tokenize",S),a.stringify(l.util.encode(S.tokens),S.language)},tokenize:function(m,v){var b=v.rest;if(b){for(var S in b)v[S]=b[S];delete v.rest}var x=new f;return d(x,x.head,m),c(m,x,v,x.head,0),g(x)},hooks:{all:{},add:function(m,v){var b=l.hooks.all;b[m]=b[m]||[],b[m].push(v)},run:function(m,v){var b=l.hooks.all[m];if(!(!b||!b.length))for(var S=0,x;x=b[S++];)x(v)}},Token:a};r.Prism=l;function a(m,v,b,S){this.type=m,this.content=v,this.alias=b,this.length=(S||"").length|0}a.stringify=function m(v,b){if(typeof v=="string")return v;if(Array.isArray(v)){var S="";return v.forEach(function(w){S+=m(w,b)}),S}var x={type:v.type,content:m(v.content,b),tag:"span",classes:["token",v.type],attributes:{},language:b},C=v.alias;C&&(Array.isArray(C)?Array.prototype.push.apply(x.classes,C):x.classes.push(C)),l.hooks.run("wrap",x);var E="";for(var k in x.attributes)E+=" "+k+'="'+(x.attributes[k]||"").replace(/"/g,"&quot;")+'"';return"<"+x.tag+' class="'+x.classes.join(" ")+'"'+E+">"+x.content+"</"+x.tag+">"};function u(m,v,b,S){m.lastIndex=v;var x=m.exec(b);if(x&&S&&x[1]){var C=x[1].length;x.index+=C,x[0]=x[0].slice(C)}return x}function c(m,v,b,S,x,C){for(var E in b)if(!(!b.hasOwnProperty(E)||!b[E])){var k=b[E];k=Array.isArray(k)?k:[k];for(var w=0;w<k.length;++w){if(C&&C.cause==E+","+w)return;var M=k[w],P=M.inside,K=!!M.lookbehind,U=!!M.greedy,X=M.alias;if(U&&!M.pattern.global){var me=M.pattern.toString().match(/[imsuy]*$/)[0];M.pattern=RegExp(M.pattern.source,me+"g")}for(var Te=M.pattern||M,Y=S.next,re=x;Y!==v.tail&&!(C&&re>=C.reach);re+=Y.value.length,Y=Y.next){var De=Y.value;if(v.length>m.length)return;if(!(De instanceof a)){var wt=1,ye;if(U){if(ye=u(Te,re,m,K),!ye||ye.index>=m.length)break;var Ne=ye.index,In=ye.index+ye[0].length,we=re;for(we+=Y.value.length;Ne>=we;)Y=Y.next,we+=Y.value.length;if(we-=Y.value.length,re=we,Y.value instanceof a)continue;for(var Ve=Y;Ve!==v.tail&&(we<In||typeof Ve.value=="string");Ve=Ve.next)wt++,we+=Ve.value.length;wt--,De=m.slice(re,we),ye.index-=re}else if(ye=u(Te,0,De,K),!ye)continue;var Ne=ye.index,mt=ye[0],it=De.slice(0,Ne),Nt=De.slice(Ne+mt.length),en=re+De.length;C&&en>C.reach&&(C.reach=en);var ur=Y.prev;it&&(ur=d(v,ur,it),re+=it.length),h(v,ur,wt);var Ec=new a(E,P?l.tokenize(mt,P):mt,X,mt);if(Y=d(v,ur,Ec),Nt&&d(v,Y,Nt),wt>1){var mi={cause:E+","+w,reach:en};c(m,v,b,Y.prev,re,mi),C&&mi.reach>C.reach&&(C.reach=mi.reach)}}}}}}function f(){var m={value:null,prev:null,next:null},v={value:null,prev:m,next:null};m.next=v,this.head=m,this.tail=v,this.length=0}function d(m,v,b){var S=v.next,x={value:b,prev:v,next:S};return v.next=x,S.prev=x,m.length++,x}function h(m,v,b){for(var S=v.next,x=0;x<b&&S!==m.tail;x++)S=S.next;v.next=S,S.prev=v,m.length-=x}function g(m){for(var v=[],b=m.head.next;b!==m.tail;)v.push(b.value),b=b.next;return v}if(!r.document)return r.addEventListener&&(l.disableWorkerMessageHandler||r.addEventListener("message",function(m){var v=JSON.parse(m.data),b=v.language,S=v.code,x=v.immediateClose;r.postMessage(l.highlight(S,l.languages[b],b)),x&&r.close()},!1)),l;var _=l.util.currentScript();_&&(l.filename=_.src,_.hasAttribute("data-manual")&&(l.manual=!0));function p(){l.manual||l.highlightAll()}if(!l.manual){var y=document.readyState;y==="loading"||y==="interactive"&&_&&_.defer?document.addEventListener("DOMContentLoaded",p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return l})(e);n.exports&&(n.exports=t),typeof po<"u"&&(po.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(i,s){var o={};o["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[s]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};l["language-"+s]={pattern:/[\s\S]+/,inside:t.languages[s]};var a={};a[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:l},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(r,i){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[i,"language-"+i],inside:t.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,(function(r){var i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+i.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var s=r.languages.markup;s&&(s.tag.addInlined("style","css"),s.tag.addAttribute("style","css"))})(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,(function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",i=function(_,p){return"✖ Error "+_+" while fetching file: "+p},s="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},l="data-src-status",a="loading",u="loaded",c="failed",f="pre[data-src]:not(["+l+'="'+u+'"]):not(['+l+'="'+a+'"])';function d(_,p,y){var m=new XMLHttpRequest;m.open("GET",_,!0),m.onreadystatechange=function(){m.readyState==4&&(m.status<400&&m.responseText?p(m.responseText):m.status>=400?y(i(m.status,m.statusText)):y(s))},m.send(null)}function h(_){var p=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(_||"");if(p){var y=Number(p[1]),m=p[2],v=p[3];return m?v?[y,Number(v)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(_){_.selector+=", "+f}),t.hooks.add("before-sanity-check",function(_){var p=_.element;if(p.matches(f)){_.code="",p.setAttribute(l,a);var y=p.appendChild(document.createElement("CODE"));y.textContent=r;var m=p.getAttribute("data-src"),v=_.language;if(v==="none"){var b=(/\.(\w+)$/.exec(m)||[,"none"])[1];v=o[b]||b}t.util.setLanguage(y,v),t.util.setLanguage(p,v);var S=t.plugins.autoloader;S&&S.loadLanguages(v),d(m,function(x){p.setAttribute(l,u);var C=h(p.getAttribute("data-range"));if(C){var E=x.split(/\r\n?|\n/g),k=C[0],w=C[1]==null?E.length:C[1];k<0&&(k+=E.length),k=Math.max(0,Math.min(k-1,E.length)),w<0&&(w+=E.length),w=Math.max(0,Math.min(w,E.length)),x=E.slice(k,w).join(`
14
+ `),p.hasAttribute("data-start")||p.setAttribute("data-start",String(k+1))}y.textContent=x,t.highlightElement(y)},function(x){p.setAttribute(l,c),y.textContent=x})}}),t.plugins.fileHighlight={highlight:function(p){for(var y=(p||document).querySelectorAll(f),m=0,v;v=y[m++];)t.highlightElement(v)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(Mi)),Mi.exports}sh();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(n,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(n){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function t(c){return c=c.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:t(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(f){c!==f&&(n.languages.markdown[c].inside.content.inside[f]=n.languages.markdown[f])})}),n.hooks.add("after-tokenize",function(c){if(c.language!=="markdown"&&c.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var _=d[h];if(_.type!=="code"){f(_.content);continue}var p=_.content[1],y=_.content[3];if(p&&y&&p.type==="code-language"&&y.type==="code-block"&&typeof p.content=="string"){var m=p.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");m=(/[a-z][\w-]*/i.exec(m)||[""])[0].toLowerCase();var v="language-"+m;y.alias?typeof y.alias=="string"?y.alias=[y.alias,v]:y.alias.push(v):y.alias=[v]}}}f(c.tokens)}),n.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var f="",d=0,h=c.classes.length;d<h;d++){var g=c.classes[d],_=/language-(.+)/.exec(g);if(_){f=_[1];break}}var p=n.languages[f];if(p)c.content=n.highlight(u(c.content),p,f);else if(f&&f!=="none"&&n.plugins.autoloader){var y="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);c.attributes.id=y,n.plugins.autoloader.loadLanguages(f,function(){var m=document.getElementById(y);m&&(m.innerHTML=n.highlight(m.textContent,n.languages[f],f))})}}});var o=RegExp(n.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},a=String.fromCodePoint||String.fromCharCode;function u(c){var f=c.replace(o,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),a(g)}else{var _=l[h];return _||d}}),f}n.languages.md=n.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(n){var e=n.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}})(Prism);var Rl={},zl;function oh(){return zl||(zl=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Rl}oh();var Bl={},Kl;function lh(){return Kl||(Kl=1,(function(n){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,t=0;t<2;t++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(Prism)),Bl}lh();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=Prism.languages.swift});var Ul={},Wl;function ah(){return Wl||(Wl=1,(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var e=n.languages.extend("typescript",{});delete e["class-name"],n.languages.typescript["class-name"].inside=e,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),n.languages.ts=n.languages.typescript})(Prism)),Ul}ah();var jl={},Hl;function uh(){return Hl||(Hl=1,(function(n){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+t+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+t+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+t+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),jl}uh();var Jl={},Vl;function ch(){return Vl||(Vl=1,(function(n){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,t=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(Prism)),Jl}ch();function hi(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const dh="javascript";function gc(n,e){for(const t of n.childNodes){if(oe(t)&&t.tagName===e)return!0;gc(t,e)}return!1}const zn="data-language",Dn="data-highlight-language",vr="data-theme";class dt extends Me{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new dt(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");ht(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(zn,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Dn,r));const i=this.getTheme();i&&t.setAttribute(vr,i);const s=this.getStyle();return s&&t.setAttribute("style",s),t}updateDOM(e,t,r){const i=this.__language,s=e.__language;i?i!==s&&t.setAttribute(zn,i):s&&t.removeAttribute(zn);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&s?o&&i?i!==s&&t.setAttribute(Dn,i):t.removeAttribute(Dn):o&&i&&t.setAttribute(Dn,i);const l=this.__theme,a=e.__theme;l?l!==a&&t.setAttribute(vr,l):a&&t.removeAttribute(vr);const u=this.__style,c=e.__style;return u?u!==c&&t.setAttribute("style",u):c&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");ht(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(zn,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Dn,r));const i=this.getTheme();i&&t.setAttribute(vr,i);const s=this.getStyle();return s&&t.setAttribute("style",s),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||gc(e,"BR"))?{conversion:ql,priority:1}:null,div:()=>({conversion:fh,priority:1}),pre:()=>({conversion:ql,priority:0}),table:e=>Pi(e)?{conversion:gh,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&Pi(r)?{conversion:Gl,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&Pi(t)?{conversion:Gl,priority:3}:null}}}static importJSON(e){return Qe().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const r=this.getChildren(),i=r.length;if(i>=2&&r[i-1].getTextContent()===`
15
+ `&&r[i-2].getTextContent()===`
16
+ `&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const a=Z();return this.insertAfter(a,t),a}const{anchor:s,focus:o}=e,l=(s.isBefore(o)?s:o).getNode();if(O(l)){let a=Ut(l);const u=[];for(;;)if(ve(a))u.push(We()),a=a.getNextSibling();else{if(!se(a))break;{let p=0;const y=a.getTextContent(),m=a.getTextContentSize();for(;p<m&&y[p]===" ";)p++;if(p!==0&&u.push(co(" ".repeat(p))),p!==m)break;a=a.getNextSibling()}}const c=l.splitText(s.offset)[0],f=s.offset===0?0:1,d=c.getIndexWithinParent()+f,h=l.getParentOrThrow(),g=[Ie(),...u];h.splice(d,0,g);const _=u[u.length-1];_?_.select():s.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if($e(l)){const{offset:a}=e.anchor;l.splice(a,0,[Ie()]),l.select(a+1,a+1)}return null}canIndent(){return!1}collapseAtStart(){const e=Z();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}}function Qe(n,e){return Vf(dt).setLanguage(n).setTheme(e)}function $e(n){return n instanceof dt}function ql(n){return{node:Qe(n.getAttribute(zn))}}function fh(n){const e=n,t=Yl(e);return t||(function(r){let i=r.parentElement;for(;i!==null;){if(Yl(i))return!0;i=i.parentElement}return!1})(e)?{node:t?Qe():null}:{node:null}}function gh(){return{node:Qe()}}function Gl(){return{node:null}}function Yl(n){return n.style.fontFamily.match("monospace")!==null}function Pi(n){return n.classList.contains("js-file-line-container")}let er=class hc extends rt{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new hc(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),r=Li(e.theme,this.__highlightType);return ht(t,r),t}updateDOM(e,t,r){const i=super.updateDOM(e,t,r),s=Li(r.theme,e.__highlightType),o=Li(r.theme,this.__highlightType);return s!==o&&(s&&so(t,s),o&&ht(t,o)),i}static importJSON(e){return co().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return Qe()}};function Li(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function co(n="",e){return Je(new er(n,e))}function se(n){return n instanceof er}function pc(n,e){let t=n;for(let r=ge(n,e);r&&(se(r.origin)||ve(r.origin));r=dg(r))t=r.origin;return t}function Ut(n){return pc(n,"previous")}function yn(n){return pc(n,"next")}function hh(n){const e=Ut(n),t=yn(n);let r=e;for(;r!==null;){if(se(r)){const s=Lf(r.getTextContent());if(s!==null)return s}if(r===t)break;r=r.getNextSibling()}const i=e.getParent();if(T(i)){const s=i.getDirection();if(s==="ltr"||s==="rtl")return s}return null}function ph(n,e){let t=null,r=null,i=n,s=e,o=n.getTextContent();for(;;){if(s===0){if(i=i.getPreviousSibling(),i===null)break;if(se(i)||ve(i)||ee(i)||hi(167),ee(i)){t={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const a=o[s];se(i)&&a!==" "&&(r={node:i,offset:s})}if(r!==null)return r;let l=null;if(e<n.getTextContentSize())se(n)&&(l=n.getTextContent()[e]);else{const a=n.getNextSibling();se(a)&&(l=a.getTextContent()[0])}if(l!==null&&l!==" ")return t;{const a=(function(u,c){let f=u,d=c,h=u.getTextContent(),g=u.getTextContentSize();for(;;){if(!se(f)||d===g){if(f=f.getNextSibling(),f===null||ee(f))return null;se(f)&&(d=0,h=f.getTextContent(),g=f.getTextContentSize())}if(se(f)){if(h[d]!==" ")return{node:f,offset:d};d++}}})(n,e);return a!==null?a:t}}function mh(n){const e=yn(n);return ee(e)&&hi(168),e}(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],i=[];/^\w+$/.test(t)||i.push(/\w+/.exec(t)[0]),t==="diff"&&i.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
17
+ ?|
18
+ |(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);const Ye=globalThis.Prism||window.Prism;function _s(n){return typeof n=="string"?n:Array.isArray(n)?n.map(_s).join(""):_s(n.content)}function yh(n,e){const t=/^diff-([\w-]+)/i.exec(e),r=n.getTextContent();let i=Ye.tokenize(r,Ye.languages[t?"diff":e]);return t&&(i=(function(s,o){const l=o,a=Ye.languages[l],u={tokens:s},c=Ye.languages.diff.PREFIXES;for(const f of u.tokens){if(typeof f=="string"||!(f.type in c)||!Array.isArray(f.content))continue;const d=f.type;let h=0;const g=()=>(h++,new Ye.Token("prefix",c[d],d.replace(/^(\w+).*/,"$1"))),_=f.content.filter(S=>typeof S=="string"||S.type!=="prefix"),p=f.content.length-_.length,y=Ye.tokenize(_s(_),a);y.unshift(g());const m=/\r\n|\n/g,v=S=>{const x=[];m.lastIndex=0;let C,E=0;for(;h<p&&(C=m.exec(S));){const k=C.index+C[0].length;x.push(S.slice(E,k)),E=k,x.push(g())}if(x.length!==0)return E<S.length&&x.push(S.slice(E)),x},b=S=>{for(let x=0;x<S.length&&h<p;x++){const C=S[x];if(typeof C=="string"){const E=v(C);E&&(S.splice(x,1,...E),x+=E.length-1)}else if(typeof C.content=="string"){const E=v(C.content);E&&(C.content=E)}else Array.isArray(C.content)?b(C.content):b([C.content])}};b(y),h<p&&y.push(g()),f.content=y}return u.tokens})(i,t[1])),vs(i)}function vs(n,e){const t=[];for(const r of n)if(typeof r=="string"){const i=r.split(/(\n|\t)/),s=i.length;for(let o=0;o<s;o++){const l=i[o];l===`
19
+ `||l===`\r
20
+ `?t.push(Ie()):l===" "?t.push(We()):l.length>0&&t.push(co(l,e))}}else{const{content:i,alias:s}=r;typeof i=="string"?t.push(...vs([i],r.type==="prefix"&&typeof s=="string"?s:r.type)):Array.isArray(i)&&t.push(...vs(i,r.type==="unchanged"?void 0:r.type))}return t}const _h={$tokenize(n,e){return yh(n,e||this.defaultLanguage)},defaultLanguage:dh,tokenize(n,e){return Ye.tokenize(n,Ye.languages[e||""]||Ye.languages[this.defaultLanguage])}};function Zl(n,e,t){const r=n.getParent();$e(r)?mc(r,e,t):se(n)&&n.replace(G(n.__text))}function vh(n,e){const t=e.getElementByKey(n.getKey());if(t===null)return;const r=n.getChildren(),i=r.length;if(i===t.__cachedChildrenLength)return;t.__cachedChildrenLength=i;let s="1",o=1;for(let l=0;l<i;l++)ee(r[l])&&(s+=`
21
+ `+ ++o);t.setAttribute("data-gutter",s)}const Di=new Set;function mc(n,e,t){const r=n.getKey(),i=e.getKey()+"/"+r;n.getLanguage()===void 0&&n.setLanguage(t.defaultLanguage);const s=n.getLanguage()||t.defaultLanguage;if(!(function(o){const l=(function(u){const c=/^diff-([\w-]+)/i.exec(u);return c?c[1]:null})(o),a=l||o;try{return!!a&&Ye.languages.hasOwnProperty(a)}catch{return!1}})(s))return n.getIsSyntaxHighlightSupported()&&n.setIsSyntaxHighlightSupported(!1),void(async function(){})();n.getIsSyntaxHighlightSupported()||n.setIsSyntaxHighlightSupported(!0),Di.has(i)||(Di.add(i),e.update(()=>{(function(o,l){const a=Q(o);if(!$e(a)||!a.isAttached())return;const u=$();if(!N(u))return void l();const c=u.anchor,f=c.offset,d=c.type==="element"&&ee(a.getChildAtIndex(c.offset-1));let h=0;if(!d){const g=c.getNode();h=f+g.getPreviousSiblings().reduce((_,p)=>_+p.getTextContentSize(),0)}if(l()){if(d)return void c.getNode().select(f,f);a.getChildren().some(g=>{const _=O(g);if(_||ee(g)){const p=g.getTextContentSize();if(_&&p>=h)return g.select(h,h),!0;h-=p}return!1})}})(r,()=>{const o=Q(r);if(!$e(o)||!o.isAttached())return!1;const l=o.getLanguage()||t.defaultLanguage,a=t.$tokenize(o,l),u=(function(h,g){let _=0;for(;_<h.length&&Xl(h[_],g[_]);)_++;const p=h.length,y=g.length,m=Math.min(p,y)-_;let v=0;for(;v<m;)if(v++,!Xl(h[p-v],g[y-v])){v--;break}const b=_,S=p-v,x=g.slice(_,y-v);return{from:b,nodesForReplacement:x,to:S}})(o.getChildren(),a),{from:c,to:f,nodesForReplacement:d}=u;return!(c===f&&!d.length)&&(n.splice(c,f-c,d),!0)})},{onUpdate:()=>{Di.delete(i)},skipTransforms:!0}))}function Xl(n,e){return se(n)&&se(e)&&n.__text===e.__text&&n.__highlightType===e.__highlightType||ve(n)&&ve(e)||ee(n)&&ee(e)}function Dt(n){if(!N(n))return!1;const e=n.anchor.getNode(),t=$e(e)?e:e.getParent(),r=n.focus.getNode(),i=$e(r)?r:r.getParent();return $e(t)&&t.is(i)}function yc(n){const e=n.getNodes(),t=[];if(e.length===1&&$e(e[0]))return t;let r=[];for(let i=0;i<e.length;i++){const s=e[i];se(s)||ve(s)||ee(s)||hi(169),ee(s)?r.length>0&&(t.push(r),r=[]):r.push(s)}if(r.length>0){const i=n.isBackward()?n.anchor:n.focus,s=Ee(r[0].getKey(),0,"text");i.is(s)||t.push(r)}return t}function Ql(n){const e=$();if(!N(e)||!Dt(e))return!1;const t=yc(e),r=t.length;if(r===0&&e.isCollapsed())return n===zt&&e.insertNodes([We()]),!0;if(r===0&&n===zt&&e.getTextContent()===`
22
+ `){const i=We(),s=Ie(),o=e.isBackward()?"previous":"next";return e.insertNodes([i,s]),Du(io(ft(Ct(i,"next",0),Oe(ge(s,"next"))),o)),!0}for(let i=0;i<r;i++){const s=t[i];if(s.length>0){let o=s[0];if(i===0&&(o=Ut(o)),n===zt){const l=We();if(o.insertBefore(l),i===0){const a=e.isBackward()?"focus":"anchor",u=Ee(o.getKey(),0,"text");e[a].is(u)&&e[a].set(l.getKey(),0,"text")}}else ve(o)&&o.remove()}}return!0}function ea(n,e){const t=$();if(!N(t))return!1;const{anchor:r,focus:i}=t,s=r.offset,o=i.offset,l=r.getNode(),a=i.getNode(),u=n===_n;if(!Dt(t)||!se(l)&&!ve(l)||!se(a)&&!ve(a))return!1;if(!e.altKey){if(t.isCollapsed()){const y=l.getParentOrThrow();if(u&&s===0&&l.getPreviousSibling()===null){if(y.getPreviousSibling()===null)return y.selectPrevious(),e.preventDefault(),!0}else if(!u&&s===l.getTextContentSize()&&l.getNextSibling()===null&&y.getNextSibling()===null)return y.selectNext(),e.preventDefault(),!0}return!1}let c,f;if(l.isBefore(a)?(c=Ut(l),f=yn(a)):(c=Ut(a),f=yn(l)),c==null||f==null)return!1;const d=c.getNodesBetween(f);for(let y=0;y<d.length;y++){const m=d[y];if(!se(m)&&!ve(m)&&!ee(m))return!1}e.preventDefault(),e.stopPropagation();const h=u?c.getPreviousSibling():f.getNextSibling();if(!ee(h))return!0;const g=u?h.getPreviousSibling():h.getNextSibling();if(g==null)return!0;const _=se(g)||ve(g)||ee(g)?u?Ut(g):yn(g):null;let p=_??g;return h.remove(),d.forEach(y=>y.remove()),n===_n?(d.forEach(y=>p.insertBefore(y)),p.insertBefore(h)):(p.insertAfter(h),p=h,d.forEach(y=>{p.insertAfter(y),p=y})),t.setTextNodeRange(l,s,a,o),!0}function ta(n,e){const t=$();if(!N(t))return!1;const{anchor:r,focus:i}=t,s=r.getNode(),o=i.getNode(),l=n===Rr;if(!Dt(t)||!se(s)&&!ve(s)||!se(o)&&!ve(o))return!1;const a=o;if(hh(a)==="rtl"?!l:l){const u=ph(a,i.offset);if(u!==null){const{node:c,offset:f}=u;ee(c)?c.selectNext(0,0):t.setTextNodeRange(c,f,c,f)}else a.getParentOrThrow().selectStart()}else mh(a).select();return e.preventDefault(),e.stopPropagation(),!0}function xh(n,e){if(!n.hasNodes([dt,er]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");e==null&&(e=_h);const t=[];return n._headless!==!0&&t.push(n.registerMutationListener(dt,r=>{n.getEditorState().read(()=>{for(const[i,s]of r)if(s!=="destroyed"){const o=Q(i);o!==null&&vh(o,n)}})},{skipInitialization:!1})),t.push(n.registerNodeTransform(dt,r=>mc(r,n,e)),n.registerNodeTransform(rt,r=>Zl(r,n,e)),n.registerNodeTransform(er,r=>Zl(r,n,e)),n.registerCommand(Is,r=>{const i=(function(s){const o=$();if(!N(o)||!Dt(o))return null;const l=s?cn:zt,a=s?cn:Zi,u=o.anchor,c=o.focus;if(u.is(c))return a;const f=yc(o);if(f.length!==1)return l;const d=f[0];let h,g;d.length===0&&hi(285),o.isBackward()?(h=c,g=u):(h=u,g=c);const _=Ut(d[0]),p=yn(d[0]),y=Ee(_.getKey(),0,"text"),m=Ee(p.getKey(),p.getTextContentSize(),"text");return h.isBefore(y)||m.isBefore(g)?l:y.isBefore(h)||g.isBefore(m)?a:l})(r.shiftKey);return i!==null&&(r.preventDefault(),n.dispatchCommand(i,void 0),!0)},Ae),n.registerCommand(Zi,()=>!!Dt($())&&(cu([We()]),!0),Ae),n.registerCommand(zt,r=>Ql(zt),Ae),n.registerCommand(cn,r=>Ql(cn),Ae),n.registerCommand(_n,r=>{const i=$();if(!N(i)||!Dt(i))return!1;const s=te().getFirstDescendant(),{anchor:o}=i,l=o.getNode();return(!s||!l||s.getKey()!==l.getKey())&&ea(_n,r)},Ae),n.registerCommand(zr,r=>{const i=$();if(!N(i)||!Dt(i))return!1;const s=te().getLastDescendant(),{anchor:o}=i,l=o.getNode();return(!s||!l||s.getKey()!==l.getKey())&&ea(zr,r)},Ae),n.registerCommand(Rr,r=>ta(Rr,r),Ae),n.registerCommand(Yi,r=>ta(Yi,r),Ae)),En(...t)}const bh=new Set(["http:","https:","mailto:","sms:","tel:"]);class Qt extends Me{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new Qt(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);const{target:i=null,rel:s=null,title:o=null}=t;this.__url=e,this.__target=i,this.__rel=s,this.__title=o}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),ht(t,e.theme.link),t}updateLinkDOM(e,t,r){if($u(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const s=`__${i}`,o=this[s];e&&e[s]===o||(o?t[i]=o:t.removeAttribute(i))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:Sh,priority:1})}}static importJSON(e){return tr().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=ra(e);try{const t=new URL(ra(e));if(!bh.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=tr(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!N(t))return!1;const i=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Sh(n){let e=null;if($u(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=tr(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function tr(n="",e){return Je(new Qt(n,e))}function xs(n){return n instanceof Qt}class pi extends Qt{__isUnlinked;constructor(e="",t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new pi(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,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return na().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=na(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}}function na(n="",e){return Je(new pi(n,e))}function kh(n){return n instanceof pi}const Ch=/^\+?[0-9\s()-]{5,}$/;function ra(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:Ch.test(n)?`tel:${n}`:`https://${n}`}function Eh(n,e){const t={};for(const r of n){const i=e(r);i&&(t[i]?t[i].push(r):t[i]=[r])}return t}function _c(n){const e=Eh(n,t=>t.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}const ia=/[ \t\n\r\f]/,bs=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Th=/^\s{0,3}$/;function Ss(n){if(!si(n))return!1;const e=n.getFirstChild();return e==null||n.getChildrenSize()===1&&O(e)&&Th.test(e.getTextContent())}function wh(n,e,t,r){for(const i of e){if(!i.export)continue;const s=i.export(n,o=>Yr(o,t,r));if(s!=null)return s}return T(n)?Yr(n,t,r):W(n)?n.getTextContent():null}function Yr(n,e,t,r,i){const s=[],o=n.getChildren();r||(r=[]),i||(i=[]);e:for(const l of o){for(const a of t){if(!a.export)continue;const u=a.export(l,c=>Yr(c,e,t,r,[...i,...r]),(c,f)=>sa(c,f,e,r,i));if(u!=null){s.push(u);continue e}}ee(l)?s.push(`
23
+ `):O(l)?s.push(sa(l,l.getTextContent(),e,r,i)):T(l)?s.push(Yr(l,e,t,r,i)):W(l)&&s.push(l.getTextContent())}return s.join("")}function sa(n,e,t,r,i){let s=n.getFormat()===0?e:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(e);n.hasFormat("code")||(s=s.replace(/([*_`~\\])/g,"\\$1"));let o="",l="",a="";const u=oa(n,!0),c=oa(n,!1),f=new Set;for(const d of t){const h=d.format[0],g=d.tag;xr(n,h)&&!f.has(h)&&(f.add(h),xr(u,h)&&r.find(_=>_.tag===g)||(r.push({format:h,tag:g}),o+=g))}for(let d=0;d<r.length;d++){const h=xr(n,r[d].format),g=xr(c,r[d].format);if(h&&g)continue;const _=[...r];for(;_.length>d;){const p=_.pop();i&&p&&i.find(y=>y.tag===p.tag)||(p&&typeof p.tag=="string"&&(h?g||(a+=p.tag):l+=p.tag),r.pop())}break}return s=o+s+a,l+s}function oa(n,e){const t=e?n.getPreviousSibling():n.getNextSibling();return O(t)?t:null}function xr(n,e){return O(n)&&n.hasFormat(e)}function Nh(n,e){const t=n.getTextContent(),r=e.fullMatchRegExpByTag["`"],i=e.transformersByTag["`"],s=[];let o=null;if(r&&i){const d=new RegExp(r.source,"g"),h=Array.from(t.matchAll(d));for(const g of h){const _=g.index,p=_+g[0].length;o||(o={content:g[2],endIndex:p,startIndex:_,tag:"`"}),s.push({end:p,start:_})}}const l=(function(d,h,g=[]){const _=[],p=new Set(Object.keys(h.transformersByTag).filter(b=>b[0]!=="`").map(b=>b[0])),y=b=>{let S=0;for(let x=b-1;x>=0&&d[x]==="\\";x--)S++;return S%2==1},m=b=>g.some(S=>b>=S.start&&b<S.end);let v=0;for(;v<d.length;){const b=d[v];if(!p.has(b)||y(v)||m(v)){v++;continue}let S=1;for(;v+S<d.length&&d[v+S]===b;)S++;const x=la(b,d,v,S,!0),C=la(b,d,v,S,!1);(x||C)&&_.push({active:!0,canClose:C,canOpen:x,char:b,index:v,length:S,originalLength:S}),v+=S}return _})(t,e,s),a=l.length>0?(function(d,h,g){const _={};let p=0,y=null;for(;p<h.length;){const m=h[p];if(!m.active||!m.canClose||m.length===0){p++;continue}const v=`${m.char}${m.canOpen}`,b=_[v]??-1;let S=!1;for(let x=p-1;x>b;x--){const C=h[x];if(!C.active||!C.canOpen||C.length===0||C.char!==m.char||(C.canClose||m.canOpen)&&(C.originalLength+m.originalLength)%3==0&&C.originalLength%3!=0&&m.originalLength%3!=0)continue;const E=Math.min(C.length,m.length),k=Object.keys(g.transformersByTag).filter(P=>P[0]===C.char&&P.length<=E).sort((P,K)=>K.length-P.length)[0];if(!k)continue;S=!0;const w=k.length,M={content:d.slice(C.index+C.length,m.index),endIndex:m.index+w,startIndex:C.index+(C.length-w),tag:k};(!y||M.startIndex<y.startIndex||M.startIndex===y.startIndex&&M.endIndex>y.endIndex)&&(y=M);for(let P=x+1;P<p;P++)h[P].active=!1;C.length-=w,m.length-=w,C.active=C.length>0,m.length>0?m.index+=w:(m.active=!1,p++);break}S||(_[v]=p-1,m.canOpen||(m.active=!1),p++)}return y})(t,l,e):null;let u=null,c=null;if(o&&a?a.startIndex<=o.startIndex&&a.endIndex>=o.endIndex?(u=a,c=e.transformersByTag[a.tag]):(u=o,c=i):o?(u=o,c=i):a&&(u=a,c=e.transformersByTag[a.tag]),!u||!c)return null;const f=[t.slice(u.startIndex,u.endIndex),u.tag,u.content];return f.index=u.startIndex,f.input=t,{endIndex:u.endIndex,match:f,startIndex:u.startIndex,transformer:c}}function la(n,e,t,r,i){if(!aa(e,t,r,i))return!1;if(n==="*")return!0;if(n==="_"){if(!aa(e,t,r,!i))return!0;const s=i?e[t-1]:e[t+r];return s!==void 0&&bs.test(s)}return!0}function aa(n,e,t,r){const i=n[e-1],s=n[e+t],[o,l]=r?[s,i]:[i,s];return o!==void 0&&!ia.test(o)&&(!bs.test(o)||l===void 0||ia.test(l)||bs.test(l))}function on(n){return O(n)&&!n.hasFormat("code")}function $t(n,e,t){let r=Nh(n,e),i=(function(o,l){const a=o;let u,c,f,d;for(const h of l){if(!h.replace||!h.importRegExp)continue;const g=a.getTextContent().match(h.importRegExp);if(!g)continue;const _=g.index||0,p=h.getEndIndex?h.getEndIndex(a,g):_+g[0].length;p!==!1&&(u===void 0||c===void 0||_<u&&(p>c||p<=u))&&(u=_,c=p,f=h,d=g)}return u===void 0||c===void 0||f===void 0||d===void 0?null:{endIndex:c,match:d,startIndex:u,transformer:f}})(n,t);if(r&&i&&(r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){const o=(function(l,a,u,c,f){const d=l.getTextContent();let h,g,_;if(f[0]===d?h=l:a===0?[h,g]=l.splitText(u):[_,h,g]=l.splitText(a,u),h.setTextContent(f[2]),c)for(const p of c.format)h.hasFormat(p)||h.toggleFormat(p);return{nodeAfter:g,nodeBefore:_,transformedNode:h}})(n,r.startIndex,r.endIndex,r.transformer,r.match);on(o.nodeAfter)&&$t(o.nodeAfter,e,t),on(o.nodeBefore)&&$t(o.nodeBefore,e,t),on(o.transformedNode)&&$t(o.transformedNode,e,t)}else if(i){const o=(function(l,a,u,c,f){let d,h,g;return a===0?[d,h]=l.splitText(u):[g,d,h]=l.splitText(a,u),c.replace?{nodeAfter:h,nodeBefore:g,transformedNode:c.replace(d,f)||void 0}:null})(n,i.startIndex,i.endIndex,i.transformer,i.match);if(!o)return;on(o.nodeAfter)&&$t(o.nodeAfter,e,t),on(o.nodeBefore)&&$t(o.nodeBefore,e,t),on(o.transformedNode)&&$t(o.transformedNode,e,t)}const s=n.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(o,l)=>String.fromCodePoint(l));n.setTextContent(s)}function Ah(n,e=!1){const t=_c(n),r=(function(i){const s={},o={},l=[],a="(?<![\\\\])";for(const u of i){const{tag:c}=u;s[c]=u;const f=c.replace(/(\*|\^|\+)/g,"\\$1");l.push(f),c.length===1?o[c]=c==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):o[c]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:o,openTagsRegExp:new RegExp(`${a}(${l.join("|")})`,"g"),transformersByTag:s}})(t.textFormat);return(i,s)=>{const o=i.split(`
24
+ `),l=o.length,a=s||te();a.clear();for(let c=0;c<l;c++){const f=o[c],[d,h]=Fh(o,c,t.multilineElement,a);d?c=h:Oh(f,a,t.element,r,t.textMatch,e)}const u=a.getChildren();for(const c of u)!e&&Ss(c)&&a.getChildrenSize()>1&&c.remove();$()!==null&&a.selectStart()}}function Fh(n,e,t,r){for(const i of t){const{handleImportAfterStartMatch:s,regExpEnd:o,regExpStart:l,replace:a}=i,u=n[e].match(l);if(!u)continue;if(s){const g=s({lines:n,rootNode:r,startLineIndex:e,startMatch:u,transformer:i});if(g===null)continue;if(g)return g}const c=typeof o=="object"&&"regExp"in o?o.regExp:o,f=o&&typeof o=="object"&&"optional"in o?o.optional:!o;let d=e;const h=n.length;for(;d<h;){const g=c?n[d].match(c):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&e===d&&g.index===u.index){d++;continue}const _=[];if(g&&e===d)_.push(n[e].slice(u[0].length,-g[0].length));else for(let p=e;p<=d;p++)if(p===e){const y=n[p].slice(u[0].length);_.push(y)}else if(p===d&&g){const y=n[p].slice(0,-g[0].length);_.push(y)}else _.push(n[p]);if(a(r,null,u,g,_,!0)!==!1)return[!0,d];break}}return[!1,e]}function Oh(n,e,t,r,i,s){const o=G(n),l=Z();l.append(o),e.append(l);for(const{regExp:a,replace:u}of t){const c=n.match(a);if(c&&(o.setTextContent(n.slice(c[0].length)),u(l,[o],c,!0)!==!1))break}if($t(o,r,i),l.isAttached()&&n.length>0){const a=l.getPreviousSibling();if(!s&&(si(a)||ms(a)||B(a))){let u=a;if(B(a)){const c=a.getLastDescendant();u=c==null?null:ze(c,V)}u!=null&&u.getTextContentSize()>0&&(u.splice(u.getChildrenSize(),0,[Ie(),...l.getChildren()]),l.remove())}}}const vc=/^(\s*)(\d{1,})\.\s/,xc=/^(\s*)[-*+]\s/,$h=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,ks=/^(#{1,6})\s/,bc=/^>\s/,Sc=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,Cs=/^[ \t]*`{3,}$/,Ih=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Mh=/^(?:\|)(.+)(?:\|)\s?$/,Ph=/^(\| ?:?-*:? ?)+\|\s?$/,ua=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,ca=/^<\/[a-z_][\w-]*\s*>/i,da=n=>new RegExp(`(?:${n.source})$`,n.flags),Bn=Ns("mdListMarker",{parse:n=>typeof n=="string"&&/^[-*+]$/.test(n)?n:"-"}),fa=Ns("mdCodeFence",{parse:n=>typeof n=="string"&&/^`{3,}$/.test(n)?n:"```"}),kc=n=>(e,t,r,i)=>{const s=n(r);s.append(...t),e.replace(s),i||s.select(0,0)},Cc=n=>(e,t,r,i)=>{const s=e.getPreviousSibling(),o=e.getNextSibling(),l=Pe(n==="check"?r[3]==="x":void 0),a=r[0].trim()[0],u=n!=="bullet"&&n!=="check"||a!==Bn.parse(a)?void 0:a;if(B(o)&&o.getListType()===n){u&&br(o,Bn,u);const f=o.getFirstChild();f!==null?f.insertBefore(l):o.append(l),e.remove()}else if(B(s)&&s.getListType()===n)u&&br(s,Bn,u),s.append(l),e.remove();else{const f=Ce(n,n==="number"?Number(r[2]):void 0);u&&br(f,Bn,u),f.append(l),e.replace(f)}l.append(...t),i||l.select(0,0);const c=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);c&&l.setIndent(c)},fo=(n,e,t)=>{const r=[],i=n.getChildren();let s=0;for(const o of i)if(V(o)){if(o.getChildrenSize()===1){const f=o.getFirstChild();if(B(f)){r.push(fo(f,e,t+1));continue}}const l=" ".repeat(4*t),a=n.getListType(),u=As(n,Bn),c=a==="number"?`${n.getStart()+s}. `:a==="check"?`${u} [${o.getChecked()?"x":" "}] `:u+" ";r.push(l+c+e(o)),s++}return r.join(`
25
+ `)},Lh={dependencies:[gi],export:(n,e)=>{if(!jg(n))return null;const t=Number(n.getTag().slice(1));return"#".repeat(t)+" "+e(n)},regExp:ks,replace:kc(n=>{const e="h"+n[1].length;return Lt(e)}),type:"element"},Dh={dependencies:[di],export:(n,e)=>{if(!ms(n))return null;const t=e(n).split(`
26
+ `),r=[];for(const i of t)r.push("> "+i);return r.join(`
27
+ `)},regExp:bc,replace:(n,e,t,r)=>{if(r){const s=n.getPreviousSibling();if(ms(s))return s.splice(s.getChildrenSize(),0,[Ie(),...e]),void n.remove()}const i=fi();i.append(...e),n.replace(i),r||i.select(0,0)},type:"element"},Or={dependencies:[dt],export:n=>{if(!$e(n))return null;const e=n.getTextContent();let t=As(n,fa);if(e.indexOf(t)>-1){const r=e.match(/`{3,}/g);if(r){const i=Math.max(...r.map(s=>s.length));t="`".repeat(i+1)}}return t+(n.getLanguage()||"")+(e?`
28
+ `+e:"")+`
29
+ `+t},handleImportAfterStartMatch:({lines:n,rootNode:e,startLineIndex:t,startMatch:r})=>{const i=r[1],s=i.trim().length,o=n[t],l=r.index+i.length,a=o.slice(l),u=new RegExp(`\`{${s},}$`);if(u.test(a)){const h=a.match(u),g=a.slice(0,a.lastIndexOf(h[0])),_=[...r];return _[2]="",Or.replace(e,null,_,h,[g],!0),[!0,t]}const c=new RegExp(`^[ \\t]*\`{${s},}$`);for(let h=t+1;h<n.length;h++){const g=n[h];if(c.test(g)){const _=g.match(c),p=n.slice(t+1,h),y=o.slice(r[0].length);return y.length>0&&p.unshift(y),Or.replace(e,null,r,_,p,!0),[!0,h]}}const f=n.slice(t+1),d=o.slice(r[0].length);return d.length>0&&f.unshift(d),Or.replace(e,null,r,null,f,!0),[!0,n.length-1]},regExpEnd:{optional:!0,regExp:Cs},regExpStart:Sc,replace:(n,e,t,r,i,s)=>{let o,l;const a=t[1]?t[1].trim():"```",u=t[2]||void 0;if(!e&&i){if(i.length===1)r?(o=Qe(u),l=i[0]):(o=Qe(u),l=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(o=Qe(u),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(" ")&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();l=i.join(`
30
+ `)}br(o,fa,a);const c=G(l);o.append(c),n.append(o)}else e&&kc(c=>Qe(c?c[2]:void 0))(n,e,t,s)},type:"multiline-element"},Rh={dependencies:[ar,Xt],export:(n,e)=>B(n)?fo(n,e,0):null,regExp:xc,replace:Cc("bullet"),type:"element"},zh={dependencies:[ar,Xt],export:(n,e)=>B(n)?fo(n,e,0):null,regExp:vc,replace:Cc("number"),type:"element"},Bh={format:["code"],tag:"`",type:"text-format"},Kh={format:["highlight"],tag:"==",type:"text-format"},Uh={format:["bold","italic"],tag:"***",type:"text-format"},Wh={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},jh={format:["bold"],tag:"**",type:"text-format"},Hh={format:["bold"],intraword:!1,tag:"__",type:"text-format"},Jh={format:["strikethrough"],tag:"~~",type:"text-format"},Vh={format:["italic"],tag:"*",type:"text-format"},qh={format:["italic"],intraword:!1,tag:"_",type:"text-format"},Gh={dependencies:[Qt],export:(n,e,t)=>{if(!xs(n)||kh(n))return null;const r=n.getTitle(),i=e(n);return r?`[${i}](${n.getURL()} "${r}")`:`[${i}](${n.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{if(ze(n,xs))return;const[,t,r,i]=e,s=tr(r,{title:i}),o=t.split("[").length-1,l=t.split("]").length-1;let a=t,u="";if(o<l)return;if(o>l){const f=t.split("[");u="["+f[0],a=f.slice(1).join("[")}const c=G(a);return c.setFormat(n.getFormat()),s.append(c),n.replace(s),u&&s.insertBefore(G(u)),c},trigger:")",type:"text-match"},Yh=[Lh,Dh,Rh,zh],Zh=[Or],Xh=[Bh,Uh,Wh,jh,Hh,Kh,Vh,qh,Jh],Qh=[Gh],Zr=[...Yh,...Zh,...Xh,...Qh];function ep(n,e=Zr,t,r=!1,i=!1){const s=r?n:(function(o,l=!1){const a=o.split(`
31
+ `);let u=!1;const c=[];for(let f=0;f<a.length;f++){const d=a[f].trimEnd(),h=c[c.length-1];Ih.test(d)?c.push(d):Sc.test(d)||Cs.test(d)?(u=!u,c.push(d)):u||d===""||h===""||!h||ks.test(h)||ks.test(d)||bc.test(d)||vc.test(d)||xc.test(d)||$h.test(d)||Mh.test(d)||Ph.test(d)||!l||ua.test(d)||ca.test(d)||da(ca).test(h)||da(ua).test(h)||Cs.test(h)?c.push(d):c[c.length-1]=h+" "+d.trimStart()}return c.join(`
32
+ `)})(n,i);return Ah(e,r)(s,t)}function tp(n=Zr,e,t=!1){return(function(i,s=!1){const o=_c(i),l=[...o.multilineElement,...o.element],a=!s,u=o.textFormat.filter(c=>c.format.length===1).sort((c,f)=>Number(c.format.includes("code"))-Number(f.format.includes("code")));return c=>{const f=[],d=(c||te()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],_=wh(g,l,u,o.textMatch);_!=null&&f.push(a&&h>0&&!Ss(g)&&!Ss(d[h-1])?`
33
+ `.concat(_):_)}return f.join(`
34
+ `)}})(n,t)(e)}const np={class:"markdown-editor-panel"},rp={class:"lexical-toolbar"},ip=["value"],sp=["value"],op={class:"lexical-editor-container"},lp={__name:"MarkdownEditor",props:{modelValue:String,visible:Boolean},emits:["update:modelValue","close"],setup(n,{emit:e}){const t=n,r=e,i=ie(null);let s=null;const o=ie(null),l=["javascript","typescript","ruby","python","html","css","json","yaml","bash","sql","go","rust","java","mermaid","markdown","text"];function a(){s||!i.value||(s=_u({namespace:"ArchsightMarkdownEditor",nodes:[gi,di,ar,Xt,dt,er,Qt],onError:p=>console.error("Lexical Error:",p),theme:{paragraph:"lexical-paragraph",heading:{h1:"lexical-h1",h2:"lexical-h2",h3:"lexical-h3"},list:{ul:"lexical-ul",ol:"lexical-ol",listitem:"lexical-li"},quote:"lexical-quote",code:"lexical-code",codeHighlight:{atrule:"tokenAttr",attr:"tokenAttr",boolean:"tokenProperty",builtin:"tokenSelector",cdata:"tokenComment",char:"tokenSelector",class:"tokenFunction","class-name":"tokenFunction",comment:"tokenComment",constant:"tokenProperty",deleted:"tokenProperty",doctype:"tokenComment",entity:"tokenOperator",function:"tokenFunction",important:"tokenVariable",inserted:"tokenSelector",keyword:"tokenAttr",namespace:"tokenVariable",number:"tokenProperty",operator:"tokenOperator",prolog:"tokenComment",property:"tokenProperty",punctuation:"tokenPunctuation",regex:"tokenVariable",selector:"tokenSelector",string:"tokenSelector",symbol:"tokenProperty",tag:"tokenProperty",url:"tokenOperator",variable:"tokenVariable"},link:"lexical-link",text:{bold:"lexical-bold",italic:"lexical-italic",underline:"lexical-underline",strikethrough:"lexical-strikethrough",code:"lexical-text-code"}}}),s.setRootElement(i.value),Hg(s),ih(s),xh(s),oc(s,lc(),300),s.registerUpdateListener(()=>{s.getEditorState().read(()=>{const p=$();if(N(p)){const y=p.getNodes();for(const m of y){const v=m.getParent();if($e(v)){o.value=v.getLanguage()||"";return}if($e(m)){o.value=m.getLanguage()||"";return}}}o.value=null})}))}Es(()=>t.visible,p=>{p&&setTimeout(()=>{s&&(s.setRootElement(null),s=null),a(),s&&s.update(()=>{te().clear(),ep(t.modelValue||"",Zr)})},0)});function u(){s&&s.update(()=>{const p=tp(Zr);r("update:modelValue",p),r("close")})}function c(p){s&&s.dispatchCommand(ct,p)}function f(p){if(s){if(p==="bullet"){s.dispatchCommand(dc,void 0);return}if(p==="number"){s.dispatchCommand(fc,void 0);return}s.update(()=>{const y=$();N(y)&&(["h1","h2","h3"].includes(p)?wi(y,()=>Lt(p)):p==="quote"?wi(y,()=>fi()):p==="paragraph"&&wi(y,()=>Z()))})}}function d(){s&&s.update(()=>{const p=$();if(N(p)){const y=Qe("");p.insertNodes([y]),y.select()}})}function h(p){s&&s.update(()=>{const y=$();if(N(y))for(const m of y.getNodes()){const v=m.getParent();if($e(v)){v.setLanguage(p);return}if($e(m)){m.setLanguage(p);return}}})}function g(){const p=prompt("Enter URL:","https://");p!==null&&s&&s.update(()=>{const y=$();if(N(y))if(p==="")y.getNodes().forEach(m=>{const v=m.getParent();xs(v)&&(v.getChildren().forEach(b=>v.insertBefore(b)),v.remove())});else{const m=y.getTextContent()||p,v=tr(p);v.append(G(m)),y.insertNodes([v])}})}function _(p){p.key==="Escape"&&r("close")}return Nc(()=>{s&&(s.setRootElement(null),s=null)}),(p,y)=>n.visible?(D(),R("div",{key:0,id:"markdown-editor-overlay",onKeydown:_},[A("div",{class:"markdown-editor-backdrop",onClick:y[0]||(y[0]=m=>p.$emit("close"))}),A("div",np,[A("div",rp,[A("button",{class:"toolbar-btn",type:"button",onClick:y[1]||(y[1]=m=>c("bold")),title:"Bold (Ctrl+B)"},[...y[15]||(y[15]=[A("i",{class:"iconoir-bold"},null,-1)])]),A("button",{class:"toolbar-btn",type:"button",onClick:y[2]||(y[2]=m=>c("italic")),title:"Italic (Ctrl+I)"},[...y[16]||(y[16]=[A("i",{class:"iconoir-italic"},null,-1)])]),A("button",{class:"toolbar-btn",type:"button",onClick:y[3]||(y[3]=m=>c("strikethrough")),title:"Strikethrough"},[...y[17]||(y[17]=[A("i",{class:"iconoir-strikethrough"},null,-1)])]),A("button",{class:"toolbar-btn",type:"button",onClick:y[4]||(y[4]=m=>c("code")),title:"Inline Code"},[...y[18]||(y[18]=[A("i",{class:"iconoir-code"},null,-1)])]),y[25]||(y[25]=A("div",{class:"toolbar-divider"},null,-1)),A("button",{class:"toolbar-btn",type:"button",onClick:y[5]||(y[5]=m=>f("h1")),title:"Heading 1"},"H1"),A("button",{class:"toolbar-btn",type:"button",onClick:y[6]||(y[6]=m=>f("h2")),title:"Heading 2"},"H2"),A("button",{class:"toolbar-btn",type:"button",onClick:y[7]||(y[7]=m=>f("h3")),title:"Heading 3"},"H3"),y[26]||(y[26]=A("div",{class:"toolbar-divider"},null,-1)),A("button",{class:"toolbar-btn",type:"button",onClick:y[8]||(y[8]=m=>f("bullet")),title:"Bullet List"},[...y[19]||(y[19]=[A("i",{class:"iconoir-list"},null,-1)])]),A("button",{class:"toolbar-btn",type:"button",onClick:y[9]||(y[9]=m=>f("number")),title:"Numbered List"},[...y[20]||(y[20]=[A("i",{class:"iconoir-numbered-list-left"},null,-1)])]),A("button",{class:"toolbar-btn",type:"button",onClick:y[10]||(y[10]=m=>f("quote")),title:"Quote"},[...y[21]||(y[21]=[A("i",{class:"iconoir-quote"},null,-1)])]),y[27]||(y[27]=A("div",{class:"toolbar-divider"},null,-1)),A("button",{class:"toolbar-btn",type:"button",onClick:y[11]||(y[11]=m=>g()),title:"Insert Link"},[...y[22]||(y[22]=[A("i",{class:"iconoir-link"},null,-1)])]),y[28]||(y[28]=A("div",{class:"toolbar-divider"},null,-1)),A("button",{class:"toolbar-btn",type:"button",onClick:y[12]||(y[12]=m=>d()),title:"Code Block"},[...y[23]||(y[23]=[A("i",{class:"iconoir-code-brackets"},null,-1)])]),o.value!==null?(D(),R("select",{key:0,class:"toolbar-select",value:o.value,onChange:y[13]||(y[13]=m=>h(m.target.value)),title:"Code Language"},[y[24]||(y[24]=A("option",{value:""},"Language...",-1)),(D(),R(yt,null,fn(l,m=>A("option",{key:m,value:m},ne(m.charAt(0).toUpperCase()+m.slice(1)),9,sp)),64))],40,ip)):Fe("",!0),y[29]||(y[29]=A("div",{class:"toolbar-spacer"},null,-1)),A("button",{class:"secondary toolbar-action",type:"button",onClick:y[14]||(y[14]=m=>p.$emit("close"))},"Cancel"),A("button",{class:"toolbar-action",type:"button",onClick:u},"Save")]),A("div",op,[A("div",{ref_key:"editorRoot",ref:i,id:"lexical-editor-root",contenteditable:"true"},null,512)])])],32)):Fe("",!0)}},ap=nr(lp,[["__scopeId","data-v-9ca3d00d"]]),up={key:0},cp={key:1},dp={key:2,class:"yaml-output"},fp={key:0,class:"field-group"},gp=["value"],hp={key:1,class:"field-group"},pp=["aria-invalid"],mp={key:0,class:"field-error"},yp={class:"annotations-grid"},_p={class:"form-actions"},vp={__name:"EditorPage",props:{kind:String,instance:String},setup(n){const e=n,t=Mc(),r=Pc("kinds"),i=ie(!0),s=ie(null),o=ie(null),l=ie(""),a=ie({}),u=ie([]),c=ie({}),f=ie(null),d=ie(null),h=ie(null),g=ie(null),_=ie(!1),p=Xe(()=>!!e.instance),y=Xe(()=>p.value?`Edit ${e.kind}`:`New ${e.kind}`),m=Xe(()=>p.value?`/kinds/${e.kind}/instances/${e.instance}`:`/kinds/${e.kind}`),v=Xe(()=>!r.value||!s.value?null:{icon:s.value.icon,layer:s.value.layer});ga(async()=>{try{const k=p.value?await Ac(e.kind,e.instance):await Fc(e.kind);s.value=k,p.value&&(l.value=k.name||"",a.value=k.annotations||{},u.value=k.relations||[],h.value=k.content_hash,d.value=k.path_ref)}catch(k){o.value=k.message}finally{i.value=!1}});async function b(){c.value={};const k={name:l.value,annotations:a.value,relations:u.value.map(M=>({verb:M.verb,kind:M.kind,names:[M.name]})),content_hash:h.value},w=p.value?await Dc(e.kind,e.instance,k):await Rc(e.kind,k);w.errors?c.value=w.errors:(f.value=w.yaml,w.path_ref&&(d.value=w.path_ref),w.content_hash&&(h.value=w.content_hash))}function S(){f.value=null}function x(k){g.value=k,_.value=!0}function C(k){g.value&&(a.value[g.value]=k)}function E(){_.value=!1,g.value=null}return(k,w)=>{const M=Ic("router-link");return i.value?(D(),R("article",up,[...w[3]||(w[3]=[A("p",null,"Loading...",-1)])])):o.value?(D(),R("article",cp,[w[4]||(w[4]=A("header",null,[A("h2",null,"Error")],-1)),A("p",null,ne(o.value),1)])):f.value?(D(),R("article",dp,[A("header",null,[A("h3",null,[v.value?(D(),R("i",{key:0,class:Mt(`iconoir-${v.value.icon} icon-${v.value.layer}`)},null,2)):Fe("",!0),le(" "+ne(y.value),1)]),Mn(M,{class:"btn-back",to:m.value},{default:go(()=>[...w[5]||(w[5]=[A("i",{class:"iconoir-arrow-left"},null,-1),le(" Back ",-1)])]),_:1},8,["to"])]),Mn(kd,{yaml:f.value,kind:n.kind,name:l.value,"content-hash":h.value,"path-ref":d.value,"inline-edit-enabled":s.value.inline_edit_enabled,onEditAgain:S},null,8,["yaml","kind","name","content-hash","path-ref","inline-edit-enabled"])])):s.value?(D(),R(yt,{key:3},[A("form",{class:"editor-form",onSubmit:$c(b,["prevent"])},[A("article",null,[A("header",null,[A("h3",null,[v.value?(D(),R("i",{key:0,class:Mt(`iconoir-${v.value.icon} icon-${v.value.layer}`)},null,2)):Fe("",!0),le(" "+ne(y.value),1)]),Mn(M,{class:"btn-back",to:m.value},{default:go(()=>[...w[6]||(w[6]=[A("i",{class:"iconoir-arrow-left"},null,-1),le(" Back ",-1)])]),_:1},8,["to"])]),p.value?(D(),R("div",fp,[A("input",{id:"name",type:"text",value:l.value,disabled:""},null,8,gp)])):(D(),R("div",hp,[w[7]||(w[7]=A("label",{for:"name"},[le(" Name "),A("span",{class:"required"},"*")],-1)),Ge(A("input",{id:"name",type:"text","onUpdate:modelValue":w[0]||(w[0]=P=>l.value=P),required:"",placeholder:"Enter resource name (no spaces)",pattern:"\\S+","aria-invalid":c.value.name?"true":void 0},null,8,pp),[[Ft,l.value]]),c.value.name?(D(),R("div",mp,ne(c.value.name.join(", ")),1)):Fe("",!0)]))]),A("article",null,[w[8]||(w[8]=A("header",null,[A("h3",null,"Annotations")],-1)),A("div",yp,[(D(!0),R(yt,null,fn(s.value.fields,P=>(D(),Lc(rd,{key:P.key,field:P,"model-value":a.value[P.key],error:c.value[P.key],"onUpdate:modelValue":K=>a.value[P.key]=K,onOpenMarkdown:x},null,8,["field","model-value","error","onUpdate:modelValue"]))),128))])]),A("article",null,[w[9]||(w[9]=A("header",null,[A("h3",null,"Relations")],-1)),Mn(gd,{relations:u.value,"relation-options":s.value.relation_options,"instances-by-kind":s.value.instances_by_kind,"onUpdate:relations":w[1]||(w[1]=P=>u.value=P)},null,8,["relations","relation-options","instances-by-kind"])]),A("div",_p,[w[10]||(w[10]=A("button",{type:"submit"},[A("i",{class:"iconoir-code"}),le(" Generate YAML ")],-1)),A("button",{type:"button",class:"secondary",onClick:w[2]||(w[2]=P=>Oc(t).push(m.value))}," Cancel ")])],32),Mn(ap,{visible:_.value,"model-value":g.value&&a.value[g.value]||"","onUpdate:modelValue":C,onClose:E},null,8,["visible","model-value"])],64)):Fe("",!0)}}},Cp=nr(vp,[["__scopeId","data-v-998cb080"]]);export{Cp as default};