@runeya/runeya 2.0.4 → 2.0.6

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 (147) hide show
  1. package/agent/index.js +8 -0
  2. package/agent/index.js.map +1 -1
  3. package/{dist-6LF3EWHR.js → dist-RZD3EUA3.js} +51 -4
  4. package/{dist-6LF3EWHR.js.map → dist-RZD3EUA3.js.map} +1 -1
  5. package/index.js +1 -1
  6. package/package.json +2 -2
  7. package/web/assets/{AddressBar.vue-BKDjFQEO.js → AddressBar.vue-BOHUxRhN.js} +1 -1
  8. package/web/assets/{AgentPage-BgJ6Oumo.js → AgentPage-DFHxsu-9.js} +1 -1
  9. package/web/assets/{AgentScalarChatInterface.vue-C__iUL1Z.js → AgentScalarChatInterface.vue-Cxxiyyj8.js} +1 -1
  10. package/web/assets/{AgentTerminalPage-10MrzYed.js → AgentTerminalPage-D-T5emEl.js} +1 -1
  11. package/web/assets/AiChatPage-C81mFvv5.js +1 -0
  12. package/web/assets/{ApiDocsPage-BLR94Cpt.js → ApiDocsPage-CMGvcGEJ.js} +3 -3
  13. package/web/assets/{AppLayout-CDmZkp4X.js → AppLayout-D10vX1fo.js} +1 -1
  14. package/web/assets/{AuditPage-DmzLNZum.js → AuditPage-DZiwogoY.js} +1 -1
  15. package/web/assets/{CodeInput.vue-DESnqXGT.js → CodeInput.vue-8aNMYCYM.js} +1 -1
  16. package/web/assets/{Collection.vue-DsMsUTvq.js → Collection.vue-N8zZa4pa.js} +1 -1
  17. package/web/assets/{CollectionAuthentication.vue-CMRcgbVh.js → CollectionAuthentication.vue-cJOxjafo.js} +1 -1
  18. package/web/assets/CollectionCookies.vue-DrFQqbwv.js +1 -0
  19. package/web/assets/{CollectionEnvironment.vue-1tFpk-iW.js → CollectionEnvironment.vue-DWPTZ8qx.js} +1 -1
  20. package/web/assets/{CollectionOverview.vue-ClKgsIxR.js → CollectionOverview.vue-1Qf130d5.js} +1 -1
  21. package/web/assets/CollectionScripts.vue-DhcFFz80.js +1 -0
  22. package/web/assets/{CollectionServers.vue-DQQoH4jS.js → CollectionServers.vue-h7E03W0v.js} +1 -1
  23. package/web/assets/{CollectionSettings.vue-BNccb6p7.js → CollectionSettings.vue-CFrOwl7U.js} +1 -1
  24. package/web/assets/CollectionSync.vue-PV_tIrJS.js +1 -0
  25. package/web/assets/{CommandActionInput.vue-B3M0qimk.js → CommandActionInput.vue-L7AcEf6T.js} +1 -1
  26. package/web/assets/{Cookies.vue-Dm17xLaC.js → Cookies.vue-_P19OjMm.js} +1 -1
  27. package/web/assets/{DashboardPage-jcsHhPai.js → DashboardPage-BUDWnuJT.js} +1 -1
  28. package/web/assets/{DataTable.vue-zdywGoM2.js → DataTable.vue-DYVeGQPP.js} +1 -1
  29. package/web/assets/{DataTableCheckbox.vue-CclkBKvE.js → DataTableCheckbox.vue-n2xCTJj1.js} +1 -1
  30. package/web/assets/{DataTableHeader.vue-CeoLy43w.js → DataTableHeader.vue-ByesjY2f.js} +1 -1
  31. package/web/assets/{DataTableInput.vue-3ERbFJoE.js → DataTableInput.vue-uPpuKzrX.js} +1 -1
  32. package/web/assets/{DeleteSidebarListElement.vue-3UGiyFzi.js → DeleteSidebarListElement.vue-CBIb58rU.js} +1 -1
  33. package/web/assets/{EditSidebarListElement.vue-CCE5jAED.js → EditSidebarListElement.vue-DqTVSZtI.js} +1 -1
  34. package/web/assets/{EditorIcon-C2ppEtfo.js → EditorIcon-B70ii4EM.js} +1 -1
  35. package/web/assets/{EmptyState.vue-DlGCQP8X.js → EmptyState.vue-CcnWPtfW.js} +1 -1
  36. package/web/assets/{Environment.vue-B9fCQn_o.js → Environment.vue-Cgx06nkH.js} +1 -1
  37. package/web/assets/{EnvironmentForm-B6sX-gjz.js → EnvironmentForm-iBZzqZKd.js} +1 -1
  38. package/web/assets/{EnvironmentFormPage-LkjLL2Tx.js → EnvironmentFormPage-YVxAAreT.js} +1 -1
  39. package/web/assets/{EnvironmentListPage-DJrq-bw9.js → EnvironmentListPage-CHYDJ_c-.js} +1 -1
  40. package/web/assets/{EnvironmentModal.vue-CGuZ2LaE.js → EnvironmentModal.vue-BJNYZuPC.js} +1 -1
  41. package/web/assets/{EnvironmentSelector-BLJiz2gj.js → EnvironmentSelector-BZn_taec.js} +1 -1
  42. package/web/assets/{Form.vue-Cv791OrG.js → Form.vue-NLXFw40d.js} +1 -1
  43. package/web/assets/{IconSelector.vue-fCHQhHMO.js → IconSelector.vue-Ykh6DAln.js} +1 -1
  44. package/web/assets/{KanbanBoardPage-DhSVHsG8.js → KanbanBoardPage-gtXv0ZhK.js} +3 -3
  45. package/web/assets/{KanbanListPage-BeViEJtv.js → KanbanListPage-DMNSYO_o.js} +1 -1
  46. package/web/assets/{LaunchProjectPage-CIGYCxFP.js → LaunchProjectPage-DSyBuhky.js} +1 -1
  47. package/web/assets/{LaunchServicesPage-D0j30OXl.js → LaunchServicesPage-CiGkiqwE.js} +1 -1
  48. package/web/assets/{LogViewer-CXdJvW0h.js → LogViewer-DBVkaZnm.js} +1 -1
  49. package/web/assets/{ProcessControls-DL7EynVq.js → ProcessControls-Cya4eb3d.js} +1 -1
  50. package/web/assets/{ProcessDetailPage-DrFtEQIB.js → ProcessDetailPage-8ypC6zkc.js} +1 -1
  51. package/web/assets/{ProcessMetrics-DI_OfGVK.js → ProcessMetrics-CxRgbaUS.js} +1 -1
  52. package/web/assets/{ProjectDetailPage-BbTkdOjA.js → ProjectDetailPage-a1lTAjKP.js} +1 -1
  53. package/web/assets/{ProjectListPage-D5AjQ76w.js → ProjectListPage-Dewqu8Dm.js} +1 -1
  54. package/web/assets/{RandomJobTestPage-BqA1OISu.js → RandomJobTestPage-E6mevkqw.js} +1 -1
  55. package/web/assets/{Request.vue-DZqQbBpT.js → Request.vue-DQPTi6ur.js} +1 -1
  56. package/web/assets/{RequestAuth.vue-D_xgg-Np.js → RequestAuth.vue-DV5nNO3f.js} +1 -1
  57. package/web/assets/{RequestRoot.vue-BNteZz7y.js → RequestRoot.vue-DKlASKU5.js} +1 -1
  58. package/web/assets/{ScalarAsciiArt.vue-Bq6jHX7k.js → ScalarAsciiArt.vue-mk9jZSKh.js} +1 -1
  59. package/web/assets/{ScalarIconEyeSlash.vue-BmXqf-BS.js → ScalarIconEyeSlash.vue-DWKhR_BX.js} +1 -1
  60. package/web/assets/{ScalarIconTrash.vue-B6zURvRt.js → ScalarIconTrash.vue-CtSwrO5S.js} +1 -1
  61. package/web/assets/{ScenarioEditorPage-C6ezD0zR.js → ScenarioEditorPage-DogHTbNU.js} +1 -1
  62. package/web/assets/{ServerVariablesForm.vue-DNmYrfHr.js → ServerVariablesForm.vue-DYmWiAuz.js} +1 -1
  63. package/web/assets/{ServiceControlsBar-IQttXg13.js → ServiceControlsBar-B8Sm6p9E.js} +1 -1
  64. package/web/assets/{ServiceDetailPage-KU1gvCBw.js → ServiceDetailPage-DpWLccOg.js} +1 -1
  65. package/web/assets/{ServiceFormPage-DJjK3iWz.js → ServiceFormPage-DQbOgtB3.js} +1 -1
  66. package/web/assets/{Settings.vue-DKVhG7ed.js → Settings.vue-buoYkM3l.js} +1 -1
  67. package/web/assets/{SettingsPage-B_3jbuRH.js → SettingsPage-CCjZq5jP.js} +1 -1
  68. package/web/assets/{SetupKeyPage-CuqL0je4.js → SetupKeyPage-BdSpJPDR.js} +1 -1
  69. package/web/assets/{SetupPage-66SJwdOq.js → SetupPage-BsWaVllB.js} +1 -1
  70. package/web/assets/{Sidebar.vue-Bi6nDDuM.js → Sidebar.vue-DntMEn5m.js} +1 -1
  71. package/web/assets/{SidebarButton.vue-DXlFKFt7.js → SidebarButton.vue-DTin2zI2.js} +1 -1
  72. package/web/assets/{SidebarListElement.vue-RCpzoEDa.js → SidebarListElement.vue-zlfRLuE5.js} +1 -1
  73. package/web/assets/{UnlockPage-DOJwyaIc.js → UnlockPage-CmwRV1XA.js} +1 -1
  74. package/web/assets/{VariablesTable-DKZDozPX.js → VariablesTable-C8lxLV1V.js} +1 -1
  75. package/web/assets/{ViewLayout.vue-CA3dFsBE.js → ViewLayout.vue-C7w_U_o6.js} +1 -1
  76. package/web/assets/{ViewLayoutContent.vue-D0ZyDMeg.js → ViewLayoutContent.vue-CAXM5eIo.js} +1 -1
  77. package/web/assets/{ViewLayoutSection.vue-2zO572AC.js → ViewLayoutSection.vue-BzJIsja7.js} +1 -1
  78. package/web/assets/{active-entities-y4R6TMSt.js → active-entities-C2TbBQeI.js} +1 -1
  79. package/web/assets/{api-reference-BxlRg4qR.js → api-reference-BJkGMKQj.js} +1 -1
  80. package/web/assets/{autocomplete-6qBTCyf6.js → autocomplete-CxPmwkcZ.js} +1 -1
  81. package/web/assets/{card-CCBkP2P8.js → card-D5_gGGD-.js} +1 -1
  82. package/web/assets/{checkbox-C1esDvCD.js → checkbox-C0sXsL9e.js} +1 -1
  83. package/web/assets/{chip-DEYEeW-F.js → chip-rnk9_cKV.js} +1 -1
  84. package/web/assets/{column-aK2I8PaJ.js → column-ChvIrUdH.js} +1 -1
  85. package/web/assets/{core-CGdWGCUX.js → core-wYvkV3-A.js} +1 -1
  86. package/web/assets/{cssMode-DpoqIkov.js → cssMode-DdlczEni.js} +1 -1
  87. package/web/assets/{dist-BFf6fIdo.js → dist-BHh6fQzR.js} +1 -1
  88. package/web/assets/{dist-wmfsxjxc.js → dist-DBBhfLmf.js} +1 -1
  89. package/web/assets/{dist-Cu0IbGNw.js → dist-DeOvPbza.js} +1 -1
  90. package/web/assets/{dist-BpDjOvWf.js → dist-ZJ37S89a.js} +1 -1
  91. package/web/assets/{divider-Bk4Brbv7.js → divider-D6L7p-FU.js} +1 -1
  92. package/web/assets/{editor.store-BF8_S543.js → editor.store-CWtgIxvE.js} +1 -1
  93. package/web/assets/{fieldset-DA1GYALV.js → fieldset-CiwzR0un.js} +1 -1
  94. package/web/assets/{freemarker2-C0SgSEQX.js → freemarker2-_wLEdPSz.js} +1 -1
  95. package/web/assets/{handlebars-DgMfQd2U.js → handlebars-66zKrSAk.js} +1 -1
  96. package/web/assets/{html-XhTY3nJ1.js → html-oM24gnvF.js} +1 -1
  97. package/web/assets/{htmlMode-a8Q5--J-.js → htmlMode-D65_fKu-.js} +1 -1
  98. package/web/assets/{index-DtgzVYQA.js → index-D5xJxOo2.js} +5 -5
  99. package/web/assets/index-Pqvy10Qz.css +1 -0
  100. package/web/assets/{javascript-CF3GRA6J.js → javascript-D-njx6Yh.js} +1 -1
  101. package/web/assets/{jsonMode-BVI1ty1E.js → jsonMode-bqHogKpM.js} +1 -1
  102. package/web/assets/{keyboard-C-kSRd_7.js → keyboard-BzTLpobK.js} +1 -1
  103. package/web/assets/{lib-Byz6Xoc7.js → lib-CPo2W-Kx.js} +1 -1
  104. package/web/assets/{library-yLls1gid.js → library-DmdL5Pgv.js} +1 -1
  105. package/web/assets/{liquid-BTUbnx76.js → liquid-BDL70fhI.js} +1 -1
  106. package/web/assets/{mdx-CT9JRVqk.js → mdx-Bo_N_Jd-.js} +1 -1
  107. package/web/assets/{mediaTypes-C2O-9mqw.js → mediaTypes-Cnm-r_sv.js} +1 -1
  108. package/web/assets/{message-BP6E2kB3.js → message-gtjFpAbc.js} +1 -1
  109. package/web/assets/{minus-l3m1t2VR.js → minus-C5Lsl7Wp.js} +1 -1
  110. package/web/assets/{multiselect-Dx1fcUSk.js → multiselect-BlmCsiSW.js} +1 -1
  111. package/web/assets/{password-DrgM_4MT.js → password-RYOg4soC.js} +1 -1
  112. package/web/assets/{plus-Dz5uLOsa.js → plus-C52I3-BN.js} +1 -1
  113. package/web/assets/{pretty-ms-BlzIQVgC.js → pretty-ms-BBvjfSt1.js} +1 -1
  114. package/web/assets/process.store-3BOses3z.js +1 -0
  115. package/web/assets/{project.store-IkiJVnHi.js → project.store-emr8mjg8.js} +1 -1
  116. package/web/assets/{python-D-ygMaD7.js → python-D1UXSNgK.js} +1 -1
  117. package/web/assets/{radiobutton-BF_JCgK5.js → radiobutton-B0t-WlKP.js} +1 -1
  118. package/web/assets/{razor-Cj7iiXRp.js → razor-Bd4GOtMe.js} +1 -1
  119. package/web/assets/router-DHhyM3YQ.js +1 -0
  120. package/web/assets/{settings.store-DlrIalG7.js → settings.store-CDr0Mia7.js} +1 -1
  121. package/web/assets/{store-DIQ5cnJB.js → store-CZKREOuj.js} +1 -1
  122. package/web/assets/{tabpanel-BFvptblG.js → tabpanel-geoVG-sX.js} +1 -1
  123. package/web/assets/{tag-Bg6HzaCD.js → tag-Dv5CaUPa.js} +1 -1
  124. package/web/assets/{toggleswitch-COqZTyfv.js → toggleswitch-DNzwv4Lc.js} +1 -1
  125. package/web/assets/trpc-B-vyi6vd.js +1 -0
  126. package/web/assets/{tsMode-IV67jT9w.js → tsMode-BkM4CkKr.js} +1 -1
  127. package/web/assets/{typescript-Bx9S0mR5.js → typescript-CUKl0qxN.js} +1 -1
  128. package/web/assets/{urls-D-5DkVsl.js → urls-BqL-MrG5.js} +1 -1
  129. package/web/assets/{use-tree-walker-Xi56Kyhe.js → use-tree-walker-E64HILpa.js} +1 -1
  130. package/web/assets/useAiChatDrawer-uS6dsG6x.js +1 -0
  131. package/web/assets/{useClipboard-CQwV_ErZ.js → useClipboard-Bep2crMO.js} +1 -1
  132. package/web/assets/{useLayout-CtomPxVB.js → useLayout-F9XKAPPL.js} +1 -1
  133. package/web/assets/{usePluginManager-B0LLVYIo.js → usePluginManager-yL67GqCi.js} +1 -1
  134. package/web/assets/{useSidebar-lFxMzh7T.js → useSidebar-DVRRagIa.js} +1 -1
  135. package/web/assets/{vue-router-DyWP0jFg.js → vue-router-uE6ClrN-.js} +1 -1
  136. package/web/assets/{xml-Chbr5k8r.js → xml-DMOW2yTg.js} +1 -1
  137. package/web/assets/{yaml-W-9gxiit.js → yaml-D2q3K0ZL.js} +1 -1
  138. package/web/index.html +2 -2
  139. package/web/assets/AiChatPage-DHXHJArt.js +0 -1
  140. package/web/assets/CollectionCookies.vue-giwIx9Oo.js +0 -1
  141. package/web/assets/CollectionScripts.vue-CfmQLF4T.js +0 -1
  142. package/web/assets/CollectionSync.vue-Cvrk773s.js +0 -1
  143. package/web/assets/index-BRDI9Dib.css +0 -1
  144. package/web/assets/process.store-Bt4k1TZl.js +0 -1
  145. package/web/assets/router-DcgtzWsZ.js +0 -1
  146. package/web/assets/trpc-tQqsDgwJ.js +0 -1
  147. package/web/assets/useAiChatDrawer-CaLJAha9.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/trpc-tQqsDgwJ.js","assets/index-DtgzVYQA.js","assets/index-BRDI9Dib.css"])))=>i.map(i=>d[i]);
2
- import{$i as e,$r as t,Bi as n,Bn as r,Ca as i,Cn as a,Dn as o,Ea as s,Gi as c,Gr as l,Hi as u,Ii as d,M as f,Mi as p,N as m,Ri as h,Si as g,Tn as _,V as ee,Wn as te,Wr as v,Yn as y,_a as ne,_i as b,aa as re,ai as ie,at as ae,bi as oe,ci as se,d as ce,da as x,di as S,ea as le,et as ue,fi as C,gi as de,gn as fe,ha as w,hn as pe,ia as me,j as he,ka as T,ki as ge,li as E,ni as _e,q as ve,ra as D,ri as ye,u as be,ui as xe,yi as Se,zn as Ce}from"./index-DtgzVYQA.js";import{A as we,C as Te,D as Ee,E as De,M as Oe,N as ke,O as Ae,P as je,S as Me,T as Ne,_ as Pe,a as Fe,b as Ie,c as Le,d as Re,f as ze,g as Be,h as Ve,i as He,j as Ue,k as We,l as Ge,m as Ke,n as qe,o as Je,p as Ye,r as O,s as Xe,t as Ze,u as Qe,v as $e,w as k,x as et,y as tt}from"./lib-Byz6Xoc7.js";import{n as nt,t as rt}from"./w3c-keyname-DDCGDLuI.js";import{a as it,i as at,n as ot,r as st,t as ct}from"./tabpanel-BFvptblG.js";import{t as lt}from"./uuid-B9GFVXPm.js";function ut(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`decltype\\(auto\\)`,i=`[a-zA-Z_]\\w*::`,a=`(?!struct)(`+r+`|`+t.optional(i)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,o={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},s={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:`title`,begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+`\\s*\\(`,f=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),p=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],m=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),h=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),g={type:p,keyword:f,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:m},_={className:`function.dispatch`,relevance:0,keywords:{_hint:h},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},ee=[_,l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],te={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:g,contains:ee.concat([{begin:/\(/,end:/\)/,keywords:g,contains:ee.concat([`self`]),relevance:0}]),relevance:0},v={className:`function`,begin:`(`+a+`[\\*&\\s]+)+`+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,c]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:g,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(te,v,_,ee,[l,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:g,contains:[`self`,o]},{begin:e.IDENT_RE+`::`,keywords:g},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function dt(e){let t={type:[`boolean`,`byte`,`word`,`String`],built_in:`KeyboardController.MouseController.SoftwareSerial.EthernetServer.EthernetClient.LiquidCrystal.RobotControl.GSMVoiceCall.EthernetUDP.EsploraTFT.HttpClient.RobotMotor.WiFiClient.GSMScanner.FileSystem.Scheduler.GSMServer.YunClient.YunServer.IPAddress.GSMClient.GSMModem.Keyboard.Ethernet.Console.GSMBand.Esplora.Stepper.Process.WiFiUDP.GSM_SMS.Mailbox.USBHost.Firmata.PImage.Client.Server.GSMPIN.FileIO.Bridge.Serial.EEPROM.Stream.Mouse.Audio.Servo.File.Task.GPRS.WiFi.Wire.TFT.GSM.SPI.SD`.split(`.`),_hints:`setup.loop.runShellCommandAsynchronously.analogWriteResolution.retrieveCallingNumber.printFirmwareVersion.analogReadResolution.sendDigitalPortPair.noListenOnLocalhost.readJoystickButton.setFirmwareVersion.readJoystickSwitch.scrollDisplayRight.getVoiceCallStatus.scrollDisplayLeft.writeMicroseconds.delayMicroseconds.beginTransmission.getSignalStrength.runAsynchronously.getAsynchronously.listenOnLocalhost.getCurrentCarrier.readAccelerometer.messageAvailable.sendDigitalPorts.lineFollowConfig.countryNameWrite.runShellCommand.readStringUntil.rewindDirectory.readTemperature.setClockDivider.readLightSensor.endTransmission.analogReference.detachInterrupt.countryNameRead.attachInterrupt.encryptionType.readBytesUntil.robotNameWrite.readMicrophone.robotNameRead.cityNameWrite.userNameWrite.readJoystickY.readJoystickX.mouseReleased.openNextFile.scanNetworks.noInterrupts.digitalWrite.beginSpeaker.mousePressed.isActionDone.mouseDragged.displayLogos.noAutoscroll.addParameter.remoteNumber.getModifiers.keyboardRead.userNameRead.waitContinue.processInput.parseCommand.printVersion.readNetworks.writeMessage.blinkVersion.cityNameRead.readMessage.setDataMode.parsePacket.isListening.setBitOrder.beginPacket.isDirectory.motorsWrite.drawCompass.digitalRead.clearScreen.serialEvent.rightToLeft.setTextSize.leftToRight.requestFrom.keyReleased.compassRead.analogWrite.interrupts.WiFiServer.disconnect.playMelody.parseFloat.autoscroll.getPINUsed.setPINUsed.setTimeout.sendAnalog.readSlider.analogRead.beginWrite.createChar.motorsStop.keyPressed.tempoWrite.readButton.subnetMask.debugPrint.macAddress.writeGreen.randomSeed.attachGPRS.readString.sendString.remotePort.releaseAll.mouseMoved.background.getXChange.getYChange.answerCall.getResult.voiceCall.endPacket.constrain.getSocket.writeJSON.getButton.available.connected.findUntil.readBytes.exitValue.readGreen.writeBlue.startLoop.IPAddress.isPressed.sendSysex.pauseMode.gatewayIP.setCursor.getOemKey.tuneWrite.noDisplay.loadImage.switchPIN.onRequest.onReceive.changePIN.playFile.noBuffer.parseInt.overflow.checkPIN.knobRead.beginTFT.bitClear.updateIR.bitWrite.position.writeRGB.highByte.writeRed.setSpeed.readBlue.noStroke.remoteIP.transfer.shutdown.hangCall.beginSMS.endWrite.attached.maintain.noCursor.checkReg.checkPUK.shiftOut.isValid.shiftIn.pulseIn.connect.println.localIP.pinMode.getIMEI.display.noBlink.process.getBand.running.beginSD.drawBMP.lowByte.setBand.release.bitRead.prepare.pointTo.readRed.setMode.noFill.remove.listen.stroke.detach.attach.noTone.exists.buffer.height.bitSet.circle.config.cursor.random.IRread.setDNS.endSMS.getKey.micros.millis.begin.print.write.ready.flush.width.isPIN.blink.clear.press.mkdir.rmdir.close.point.yield.image.BSSID.click.delay.read.text.move.peek.beep.rect.line.open.seek.fill.size.turn.stop.home.find.step.tone.sqrt.RSSI.SSID.end.bit.tan.cos.sin.pow.map.abs.max.min.get.run.put`.split(`.`),literal:[`DIGITAL_MESSAGE`,`FIRMATA_STRING`,`ANALOG_MESSAGE`,`REPORT_DIGITAL`,`REPORT_ANALOG`,`INPUT_PULLUP`,`SET_PIN_MODE`,`INTERNAL2V56`,`SYSTEM_RESET`,`LED_BUILTIN`,`INTERNAL1V1`,`SYSEX_START`,`INTERNAL`,`EXTERNAL`,`DEFAULT`,`OUTPUT`,`INPUT`,`HIGH`,`LOW`]},n=ut(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name=`Arduino`,n.aliases=[`ino`],n.supersetOf=`cpp`,n}function ft(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function A(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function pt(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function mt(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);t.contains.push(`self`);let n=e.COMMENT(/;;/,/$/),r=`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`),i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},a={className:`variable`,begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},s={className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},l={className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},a,o,i,e.QUOTE_STRING_MODE,c,l,s]}}const j={arduino:dt,bash:je,c:ke,cpp:Oe,csharp:Ue,css:we,diff:We,go:Ae,graphql:Ee,ini:De,java:Ne,javascript:k,json:Te,kotlin:Me,less:et,lua:Ie,makefile:tt,markdown:$e,objectivec:Pe,perl:Be,php:Ve,"php-template":ft,plaintext:Ke,python:Ye,"python-repl":A,r:ze,ruby:Re,rust:Qe,scss:Ge,shell:Le,sql:Xe,swift:Je,typescript:Fe,vbnet:pt,wasm:mt,xml:He,yaml:O},ht=v(`kanban-queue`,()=>{let e=w({items:[],running:[],maxConcurrent:1}),t=null;async function n(){t||=pe.kanbanQueue.onChanged.subscribe(void 0,{onData(t){e.value=t}})}function r(){t?.unsubscribe(),t=null}function i(t,n){return e.value.items.some(e=>e.boardId===t&&e.cardId===n)||e.value.running.some(e=>e.boardId===t&&e.cardId===n)}function a(t,n){let r=e.value.items.find(e=>e.boardId===t&&e.cardId===n);return r?r.id:e.value.running.find(e=>e.boardId===t&&e.cardId===n)?.id??null}async function o(e){await pe.kanbanQueue.add.mutate(e)}async function s(e){await pe.kanbanQueue.addColumn.mutate(e)}async function c(e){await pe.kanbanQueue.remove.mutate({itemId:e})}async function l(){await pe.kanbanQueue.stopAll.mutate()}async function u(e){await pe.kanbanQueue.setMaxConcurrent.mutate({max:e})}return{state:e,init:n,destroy:r,isCardInQueue:i,getCardQueueItemId:a,addCard:o,addColumn:s,removeItem:c,stopAll:l,setMaxConcurrent:u}});function M(e){this.content=e}M.prototype={constructor:M,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new M(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new M(n)},addToStart:function(e,t){return new M([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new M(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new M(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=M.from(e),e.size?new M(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=M.from(e),e.size?new M(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=M.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},M.from=function(e){if(e instanceof M)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new M(t)};var gt=M;function _t(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=_t(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function vt(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=vt(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var N=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return _t(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return vt(this,e,t,n)}findIndex(e){if(e==0)return bt(0,e);if(e==this.size)return bt(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?bt(t+1,i):bt(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};N.empty=new N([],0);var yt={index:0,offset:0};function bt(e,t){return yt.index=e,yt.offset=t,yt}function xt(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!xt(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!xt(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var P=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&xt(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};P.none=[];var St=class extends Error{},F=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=wt(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Ct(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(N.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};F.empty=new F(N.empty,0,0);function Ct(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Ct(a.content,t-i-1,n-i-1)))}function wt(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=wt(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function Tt(e,t,n){if(n.openStart>e.depth)throw new St(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new St(`Inconsistent open depths`);return Et(e,t,n,0)}function Et(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Et(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return jt(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Pt(n,e);return jt(a,Mt(e,i,o,t,r))}else return jt(a,Nt(e,t,r))}function Dt(e,t){if(!t.type.compatibleContent(e.type))throw new St(`Cannot join `+t.type.name+` onto `+e.type.name)}function Ot(e,t,n){let r=e.node(n);return Dt(r,t.node(n)),r}function kt(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function At(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(kt(e.nodeAfter,r),a++));for(let e=a;e<o;e++)kt(i.child(e),r);t&&t.depth==n&&t.textOffset&&kt(t.nodeBefore,r)}function jt(e,t){return e.type.checkContent(t),e.copy(t)}function Mt(e,t,n,r,i){let a=e.depth>i&&Ot(e,t,i+1),o=r.depth>i&&Ot(n,r,i+1),s=[];return At(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Dt(a,o),kt(jt(a,Mt(e,t,n,r,i+1)),s)):(a&&kt(jt(a,Nt(e,t,i+1)),s),At(t,n,i,s),o&&kt(jt(o,Nt(n,r,i+1)),s)),At(r,null,i,s),new N(s)}function Nt(e,t,n){let r=[];return At(null,e,n,r),e.depth>n&&kt(jt(Ot(e,t,n+1),Nt(e,t,n+1)),r),At(t,null,n,r),new N(r)}function Pt(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(N.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Ft=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return P.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new zt(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Rt.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Rt.set(t,r=new It);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Lt,i}},It=class{constructor(){this.elts=[],this.i=0}},Lt=12,Rt=new WeakMap,zt=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Bt=Object.create(null),Vt=class e{constructor(e,t,n,r=P.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||N.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&xt(this.attrs,t||e.defaultAttrs||Bt)&&P.sameSet(this.marks,n||P.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return F.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new F(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Tt(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Ft.resolveCached(this,e)}resolveNoCache(e){return Ft.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Ut(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=N.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=P.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!P.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=N.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Vt.prototype.text=void 0;var Ht=class e extends Vt{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ut(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ut(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Wt=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Gt(t,n);if(r.next==null)return e.empty;let i=Kt(r);r.next&&r.err(`Unexpected trailing text`);let a=nn($t(i));return rn(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return N.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/trpc-B-vyi6vd.js","assets/index-D5xJxOo2.js","assets/index-Pqvy10Qz.css"])))=>i.map(i=>d[i]);
2
+ import{$i as e,$r as t,Bi as n,Bn as r,Ca as i,Cn as a,Dn as o,Ea as s,Gi as c,Gr as l,Hi as u,Ii as d,M as f,Mi as p,N as m,Ri as h,Si as g,Tn as _,V as ee,Wn as te,Wr as v,Yn as y,_a as ne,_i as b,aa as re,ai as ie,at as ae,bi as oe,ci as se,d as ce,da as x,di as S,ea as le,et as ue,fi as C,gi as de,gn as fe,ha as w,hn as pe,ia as me,j as he,ka as T,ki as ge,li as E,ni as _e,q as ve,ra as D,ri as ye,u as be,ui as xe,yi as Se,zn as Ce}from"./index-D5xJxOo2.js";import{A as we,C as Te,D as Ee,E as De,M as Oe,N as ke,O as Ae,P as je,S as Me,T as Ne,_ as Pe,a as Fe,b as Ie,c as Le,d as Re,f as ze,g as Be,h as Ve,i as He,j as Ue,k as We,l as Ge,m as Ke,n as qe,o as Je,p as Ye,r as O,s as Xe,t as Ze,u as Qe,v as $e,w as k,x as et,y as tt}from"./lib-CPo2W-Kx.js";import{n as nt,t as rt}from"./w3c-keyname-DDCGDLuI.js";import{a as it,i as at,n as ot,r as st,t as ct}from"./tabpanel-geoVG-sX.js";import{t as lt}from"./uuid-B9GFVXPm.js";function ut(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`decltype\\(auto\\)`,i=`[a-zA-Z_]\\w*::`,a=`(?!struct)(`+r+`|`+t.optional(i)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,o={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},s={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:`title`,begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+`\\s*\\(`,f=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),p=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],m=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),h=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),g={type:p,keyword:f,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:m},_={className:`function.dispatch`,relevance:0,keywords:{_hint:h},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},ee=[_,l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],te={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:g,contains:ee.concat([{begin:/\(/,end:/\)/,keywords:g,contains:ee.concat([`self`]),relevance:0}]),relevance:0},v={className:`function`,begin:`(`+a+`[\\*&\\s]+)+`+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,c]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:g,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(te,v,_,ee,[l,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:g,contains:[`self`,o]},{begin:e.IDENT_RE+`::`,keywords:g},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function dt(e){let t={type:[`boolean`,`byte`,`word`,`String`],built_in:`KeyboardController.MouseController.SoftwareSerial.EthernetServer.EthernetClient.LiquidCrystal.RobotControl.GSMVoiceCall.EthernetUDP.EsploraTFT.HttpClient.RobotMotor.WiFiClient.GSMScanner.FileSystem.Scheduler.GSMServer.YunClient.YunServer.IPAddress.GSMClient.GSMModem.Keyboard.Ethernet.Console.GSMBand.Esplora.Stepper.Process.WiFiUDP.GSM_SMS.Mailbox.USBHost.Firmata.PImage.Client.Server.GSMPIN.FileIO.Bridge.Serial.EEPROM.Stream.Mouse.Audio.Servo.File.Task.GPRS.WiFi.Wire.TFT.GSM.SPI.SD`.split(`.`),_hints:`setup.loop.runShellCommandAsynchronously.analogWriteResolution.retrieveCallingNumber.printFirmwareVersion.analogReadResolution.sendDigitalPortPair.noListenOnLocalhost.readJoystickButton.setFirmwareVersion.readJoystickSwitch.scrollDisplayRight.getVoiceCallStatus.scrollDisplayLeft.writeMicroseconds.delayMicroseconds.beginTransmission.getSignalStrength.runAsynchronously.getAsynchronously.listenOnLocalhost.getCurrentCarrier.readAccelerometer.messageAvailable.sendDigitalPorts.lineFollowConfig.countryNameWrite.runShellCommand.readStringUntil.rewindDirectory.readTemperature.setClockDivider.readLightSensor.endTransmission.analogReference.detachInterrupt.countryNameRead.attachInterrupt.encryptionType.readBytesUntil.robotNameWrite.readMicrophone.robotNameRead.cityNameWrite.userNameWrite.readJoystickY.readJoystickX.mouseReleased.openNextFile.scanNetworks.noInterrupts.digitalWrite.beginSpeaker.mousePressed.isActionDone.mouseDragged.displayLogos.noAutoscroll.addParameter.remoteNumber.getModifiers.keyboardRead.userNameRead.waitContinue.processInput.parseCommand.printVersion.readNetworks.writeMessage.blinkVersion.cityNameRead.readMessage.setDataMode.parsePacket.isListening.setBitOrder.beginPacket.isDirectory.motorsWrite.drawCompass.digitalRead.clearScreen.serialEvent.rightToLeft.setTextSize.leftToRight.requestFrom.keyReleased.compassRead.analogWrite.interrupts.WiFiServer.disconnect.playMelody.parseFloat.autoscroll.getPINUsed.setPINUsed.setTimeout.sendAnalog.readSlider.analogRead.beginWrite.createChar.motorsStop.keyPressed.tempoWrite.readButton.subnetMask.debugPrint.macAddress.writeGreen.randomSeed.attachGPRS.readString.sendString.remotePort.releaseAll.mouseMoved.background.getXChange.getYChange.answerCall.getResult.voiceCall.endPacket.constrain.getSocket.writeJSON.getButton.available.connected.findUntil.readBytes.exitValue.readGreen.writeBlue.startLoop.IPAddress.isPressed.sendSysex.pauseMode.gatewayIP.setCursor.getOemKey.tuneWrite.noDisplay.loadImage.switchPIN.onRequest.onReceive.changePIN.playFile.noBuffer.parseInt.overflow.checkPIN.knobRead.beginTFT.bitClear.updateIR.bitWrite.position.writeRGB.highByte.writeRed.setSpeed.readBlue.noStroke.remoteIP.transfer.shutdown.hangCall.beginSMS.endWrite.attached.maintain.noCursor.checkReg.checkPUK.shiftOut.isValid.shiftIn.pulseIn.connect.println.localIP.pinMode.getIMEI.display.noBlink.process.getBand.running.beginSD.drawBMP.lowByte.setBand.release.bitRead.prepare.pointTo.readRed.setMode.noFill.remove.listen.stroke.detach.attach.noTone.exists.buffer.height.bitSet.circle.config.cursor.random.IRread.setDNS.endSMS.getKey.micros.millis.begin.print.write.ready.flush.width.isPIN.blink.clear.press.mkdir.rmdir.close.point.yield.image.BSSID.click.delay.read.text.move.peek.beep.rect.line.open.seek.fill.size.turn.stop.home.find.step.tone.sqrt.RSSI.SSID.end.bit.tan.cos.sin.pow.map.abs.max.min.get.run.put`.split(`.`),literal:[`DIGITAL_MESSAGE`,`FIRMATA_STRING`,`ANALOG_MESSAGE`,`REPORT_DIGITAL`,`REPORT_ANALOG`,`INPUT_PULLUP`,`SET_PIN_MODE`,`INTERNAL2V56`,`SYSTEM_RESET`,`LED_BUILTIN`,`INTERNAL1V1`,`SYSEX_START`,`INTERNAL`,`EXTERNAL`,`DEFAULT`,`OUTPUT`,`INPUT`,`HIGH`,`LOW`]},n=ut(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name=`Arduino`,n.aliases=[`ino`],n.supersetOf=`cpp`,n}function ft(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function A(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function pt(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function mt(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);t.contains.push(`self`);let n=e.COMMENT(/;;/,/$/),r=`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`),i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},a={className:`variable`,begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},s={className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},l={className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},a,o,i,e.QUOTE_STRING_MODE,c,l,s]}}const j={arduino:dt,bash:je,c:ke,cpp:Oe,csharp:Ue,css:we,diff:We,go:Ae,graphql:Ee,ini:De,java:Ne,javascript:k,json:Te,kotlin:Me,less:et,lua:Ie,makefile:tt,markdown:$e,objectivec:Pe,perl:Be,php:Ve,"php-template":ft,plaintext:Ke,python:Ye,"python-repl":A,r:ze,ruby:Re,rust:Qe,scss:Ge,shell:Le,sql:Xe,swift:Je,typescript:Fe,vbnet:pt,wasm:mt,xml:He,yaml:O},ht=v(`kanban-queue`,()=>{let e=w({items:[],running:[],maxConcurrent:1}),t=null;async function n(){t||=pe.kanbanQueue.onChanged.subscribe(void 0,{onData(t){e.value=t}})}function r(){t?.unsubscribe(),t=null}function i(t,n){return e.value.items.some(e=>e.boardId===t&&e.cardId===n)||e.value.running.some(e=>e.boardId===t&&e.cardId===n)}function a(t,n){let r=e.value.items.find(e=>e.boardId===t&&e.cardId===n);return r?r.id:e.value.running.find(e=>e.boardId===t&&e.cardId===n)?.id??null}async function o(e){await pe.kanbanQueue.add.mutate(e)}async function s(e){await pe.kanbanQueue.addColumn.mutate(e)}async function c(e){await pe.kanbanQueue.remove.mutate({itemId:e})}async function l(){await pe.kanbanQueue.stopAll.mutate()}async function u(e){await pe.kanbanQueue.setMaxConcurrent.mutate({max:e})}return{state:e,init:n,destroy:r,isCardInQueue:i,getCardQueueItemId:a,addCard:o,addColumn:s,removeItem:c,stopAll:l,setMaxConcurrent:u}});function M(e){this.content=e}M.prototype={constructor:M,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new M(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new M(n)},addToStart:function(e,t){return new M([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new M(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new M(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=M.from(e),e.size?new M(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=M.from(e),e.size?new M(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=M.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},M.from=function(e){if(e instanceof M)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new M(t)};var gt=M;function _t(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=_t(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function vt(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=vt(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var N=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return _t(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return vt(this,e,t,n)}findIndex(e){if(e==0)return bt(0,e);if(e==this.size)return bt(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?bt(t+1,i):bt(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};N.empty=new N([],0);var yt={index:0,offset:0};function bt(e,t){return yt.index=e,yt.offset=t,yt}function xt(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!xt(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!xt(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var P=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&xt(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};P.none=[];var St=class extends Error{},F=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=wt(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Ct(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(N.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};F.empty=new F(N.empty,0,0);function Ct(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Ct(a.content,t-i-1,n-i-1)))}function wt(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=wt(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function Tt(e,t,n){if(n.openStart>e.depth)throw new St(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new St(`Inconsistent open depths`);return Et(e,t,n,0)}function Et(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Et(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return jt(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Pt(n,e);return jt(a,Mt(e,i,o,t,r))}else return jt(a,Nt(e,t,r))}function Dt(e,t){if(!t.type.compatibleContent(e.type))throw new St(`Cannot join `+t.type.name+` onto `+e.type.name)}function Ot(e,t,n){let r=e.node(n);return Dt(r,t.node(n)),r}function kt(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function At(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(kt(e.nodeAfter,r),a++));for(let e=a;e<o;e++)kt(i.child(e),r);t&&t.depth==n&&t.textOffset&&kt(t.nodeBefore,r)}function jt(e,t){return e.type.checkContent(t),e.copy(t)}function Mt(e,t,n,r,i){let a=e.depth>i&&Ot(e,t,i+1),o=r.depth>i&&Ot(n,r,i+1),s=[];return At(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Dt(a,o),kt(jt(a,Mt(e,t,n,r,i+1)),s)):(a&&kt(jt(a,Nt(e,t,i+1)),s),At(t,n,i,s),o&&kt(jt(o,Nt(n,r,i+1)),s)),At(r,null,i,s),new N(s)}function Nt(e,t,n){let r=[];return At(null,e,n,r),e.depth>n&&kt(jt(Ot(e,t,n+1),Nt(e,t,n+1)),r),At(t,null,n,r),new N(r)}function Pt(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(N.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Ft=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return P.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new zt(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Rt.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Rt.set(t,r=new It);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Lt,i}},It=class{constructor(){this.elts=[],this.i=0}},Lt=12,Rt=new WeakMap,zt=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Bt=Object.create(null),Vt=class e{constructor(e,t,n,r=P.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||N.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&xt(this.attrs,t||e.defaultAttrs||Bt)&&P.sameSet(this.marks,n||P.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return F.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new F(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Tt(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Ft.resolveCached(this,e)}resolveNoCache(e){return Ft.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Ut(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=N.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=P.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!P.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=N.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Vt.prototype.text=void 0;var Ht=class e extends Vt{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ut(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ut(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Wt=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Gt(t,n);if(r.next==null)return e.empty;let i=Kt(r);r.next&&r.err(`Unexpected trailing text`);let a=nn($t(i));return rn(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return N.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
3
3
  `)}};Wt.empty=new Wt(!0);var Gt=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Kt(e){let t=[];do t.push(qt(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function qt(e){let t=[];do t.push(Jt(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Jt(e){let t=Qt(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Xt(e,t);else break;return t}function Yt(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Xt(e,t){let n=Yt(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Yt(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Zt(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Qt(e){if(e.eat(`(`)){let t=Kt(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Zt(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function $t(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function en(e,t){return t-e}function tn(e,t){let n=[];return r(t),n.sort(en);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function nn(e){let t=Object.create(null);return n(tn(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);tn(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Wt(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(en);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function rn(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function an(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function on(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function sn(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function cn(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new dn(e,r,t[r]);return n}var ln=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=cn(e,n.attrs),this.defaultAttrs=an(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Wt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:on(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Vt(this,this.computeAttrs(e),N.from(t),P.setFrom(n))}createChecked(e=null,t,n){return t=N.from(t),this.checkContent(t),new Vt(this,this.computeAttrs(e),t,P.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=N.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(N.empty,!0);return i?new Vt(this,e,t.append(i),P.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){sn(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:P.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function un(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var dn=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?un(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},fn=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=cn(e,r.attrs),this.excluded=null;let i=an(this.attrs);this.instance=i?new P(this,i):null}create(e=null){return!e&&this.instance?this.instance:new P(this,on(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){sn(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},pn=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=gt.from(e.nodes),t.marks=gt.from(e.marks||{}),this.nodes=ln.compile(this.spec.nodes,this),this.marks=fn.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Wt.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?mn(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:mn(this,n.split(` `))}this.nodeFromJSON=e=>Vt.fromJSON(this,e),this.markFromJSON=e=>P.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(e instanceof ln){if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`)}else throw RangeError(`Invalid node type: `+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Ht(n,n.defaultAttrs,e,P.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function mn(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function hn(e){return e.tag!=null}function gn(e){return e.style!=null}var _n=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(hn(e))this.tags.push(e);else if(gn(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new En(this,t,!1);return n.addAll(e,P.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new En(this,t,!0);return n.addAll(e,P.none,t.from,t.to),F.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(On(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=kn(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=kn(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},vn={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},yn={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},bn={ol:!0,ul:!0},xn=1,Sn=2,Cn=4;function wn(e,t,n){return t==null?e&&e.whitespace==`pre`?xn|Sn:n&~Cn:(t?xn:0)|(t===`full`?Sn:0)}var Tn=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=P.none,this.match=i||(a&Cn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(N.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&xn)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=N.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(N.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!vn.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},En=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=wn(null,t.preserveWhitespace,0)|(n?Cn:0);i=r?new Tn(r.type,r.attrs,P.none,!0,t.topMatch||r.type.contentMatch,a):n?new Tn(null,null,P.none,!0,null,a):new Tn(e.schema.topNodeType,null,P.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Sn?`full`:this.localPreserveWS||(r.options&xn)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if(i===`full`)n=n.replace(/\r\n?/g,`
4
4
  `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);else if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;bn.hasOwnProperty(a)&&this.parser.normalizeLists&&Dn(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:yn.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(vn.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
5
5
  `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=P.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):An(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=wn(e,i,a.options);a.options&Cn&&a.content.length==0&&(o|=Cn);let s=P.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):An(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new Tn(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=xn);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Dn(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&bn.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function On(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function kn(e){let t={};for(let n in e)t[n]=e[n];return t}function An(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var jn=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Nn(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Ln(Nn(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Ln(Nn(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Ln(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Mn(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Mn(e.marks)}};function Mn(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Nn(e){return e.document||window.document}var Pn=new WeakMap;function Fn(e){let t=Pn.get(e);return t===void 0&&Pn.set(e,t=In(e)),t}function In(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function Ln(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Fn(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){for(let e in u=2,l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=Ln(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Rn=65535,zn=2**16;function Bn(e,t){return e+t*zn}function Vn(e){return e&Rn}function Hn(e){return(e-(e&Rn))/zn}var Un=1,Wn=2,Gn=4,Kn=8,qn=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Kn)>0}get deletedBefore(){return(this.delInfo&(Un|Gn))>0}get deletedAfter(){return(this.delInfo&(Wn|Gn))>0}get deletedAcross(){return(this.delInfo&Gn)>0}},Jn=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Vn(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Hn(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Bn(o/3,e-s),f=e==s?Wn:e==u?Un:Gn;return(t<0?e!=s:e!=u)&&(f|=Kn),new qn(a,f,d)}r+=l-c}return n?e+r:new qn(e+r,0,null)}touches(e,t){let n=0,r=Vn(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Jn.empty=new Jn([]);var Yn=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new qn(e,r,null)}},Xn=Object.create(null),I=class{getMap(){return Jn.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Xn[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Xn)throw RangeError(`Duplicate use of step JSON ID `+e);return Xn[e]=t,t.prototype.jsonID=e,t}},Zn=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof St)return e.fail(t.message);throw t}}};function Qn(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Qn(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return N.fromArray(r)}var $n=class e extends I{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new F(Qn(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Zn.fromReplace(e,this.from,this.to,i)}invert(){return new er(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};I.jsonID(`addMark`,$n);var er=class e extends I{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new F(Qn(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Zn.fromReplace(e,this.from,this.to,n)}invert(){return new $n(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};I.jsonID(`removeMark`,er);var tr=class e extends I{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Zn.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Zn.fromReplace(e,this.pos,this.pos+1,new F(N.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new nr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};I.jsonID(`addNodeMark`,tr);var nr=class e extends I{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Zn.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Zn.fromReplace(e,this.pos,this.pos+1,new F(N.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new tr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};I.jsonID(`removeNodeMark`,nr);var rr=class e extends I{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&ar(e,this.from,this.to)?Zn.fail(`Structure replace would overwrite content`):Zn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Jn([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?F.empty:new F(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?F.empty:new F(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,F.fromJSON(t,n.slice),!!n.structure)}};I.jsonID(`replace`,rr);var ir=class e extends I{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(ar(e,this.from,this.gapFrom)||ar(e,this.gapTo,this.to)))return Zn.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Zn.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Zn.fromReplace(e,this.from,this.to,n):Zn.fail(`Content does not fit in gap`)}getMap(){return new Jn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,F.fromJSON(t,n.slice),n.insert,!!n.structure)}};I.jsonID(`replaceAround`,ir);function ar(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function or(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new er(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new $n(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function sr(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof fn){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new er(t.from,t.to,t.style)))}function cr(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new rr(s,l,F.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new er(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new F(N.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new rr(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(N.empty,!0);e.replace(s,s,new F(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function lr(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ur(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!lr(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function dr(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=N.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=N.from(r.node(e).copy(u)),d++):c--;let f=N.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=N.from(i.node(e).copy(f)),p++):l++;e.step(new ir(c,l,o,s,new F(u.append(f),d,p),u.size-d,!0))}function fr(e,t,n=null,r=e){let i=mr(e,t),a=i&&hr(r,t);return a?i.map(pr).concat({type:t,attrs:n}).concat(a.map(pr)):null}function pr(e){return{type:e,attrs:null}}function mr(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function hr(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function gr(e,t,n){let r=N.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=N.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new ir(i,a,i,a,new F(r,0,0),n.length,!0))}function _r(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&br(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&yr(e,t,n,a),cr(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new ir(c,l,c+1,l-1,new F(N.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&vr(e,t,n,a),!1}})}function vr(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function yr(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
@@ -138,4 +138,4 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
138
138
  `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
139
139
  `),[i,a]=Sg(r);if(i.length===0)return;let o=Cg(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
140
140
  `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Tg,this.editor.getAttributes(Eg)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=$f({find:Dg,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=$f({find:Dg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Eg)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),kg=/^\s*(\[([( |x])?\])\s$/,Ag=pp.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,q(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>dp(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=pd(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[$f({find:kg,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),jg=pp.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,q(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
141
- `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=up(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=up(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});J.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(sg.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(cg.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(yg.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Og.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Ag.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(jg.configure(this.options.taskList)),e}});var Mg=`&nbsp;`,Ng=`\xA0`,Pg=pp.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,q(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return r.length===1&&r[0].type===`text`&&(r[0].text===Mg||r[0].text===Ng)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t)=>{if(!e)return``;let n=Array.isArray(e.content)?e.content:[];return n.length===0?Mg:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Fg=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ig=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Lg=Ef.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,q(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Xf({find:Fg,type:this.type})]},addPasteRules(){return[mp({find:Ig,type:this.type})]}}),Rg=pp.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),zg=Ef.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,q(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Bg=zg;function Vg(e={}){return new B({view(t){return new Hg(t,e)}})}var Hg=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=Ar(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},Ug=class e extends L{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):L.near(r)}content(){return F.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Wg(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Kg(e)||!qg(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!z.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};Ug.prototype.visible=!1,Ug.findFrom=Ug.findGapCursorFrom,L.jsonID(`gapcursor`,Ug);var Wg=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Ug.valid(t)?new Ug(t):L.near(t)}};function Gg(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Kg(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||Gg(e.type))return!0;if(e.inlineContent)return!1}}return!0}function qg(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||Gg(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Jg(){return new B({props:{decorations:$g,createSelectionBetween(e,t,n){return t.pos==n.pos&&Ug.valid(n)?new Ug(n):null},handleClick:Zg,handleKeyDown:Yg,handleDOMEvents:{beforeinput:Qg}}})}var Yg=Ll({ArrowLeft:Xg(`horiz`,-1),ArrowRight:Xg(`horiz`,1),ArrowUp:Xg(`vert`,-1),ArrowDown:Xg(`vert`,1)});function Xg(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof R){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=Ug.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new Ug(c))),!0):!1}}function Zg(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Ug.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&z.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Ug(r))),!0)}function Qg(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof Ug))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=N.empty;for(let e=r.length-1;e>=0;e--)i=N.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new F(i,0,0));return a.setSelection(R.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function $g(e){if(!(e.selection instanceof Ug))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,Uc.create(e.doc,[Bc.widget(e.selection.head,t,{key:`gapcursor`})])}var e_=200,$=function(){};$.prototype.append=function(e){return e.length?(e=$.from(e),!this.length&&e||e.length<e_&&this.leafAppend(e)||this.length<e_&&e.leafPrepend(this)||this.appendInner(e)):this},$.prototype.prepend=function(e){return e.length?$.from(e).append(this):this},$.prototype.appendInner=function(e){return new n_(this,e)},$.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?$.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},$.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},$.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},$.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},$.from=function(e){return e instanceof $?e:e&&e.length?new t_(e):$.empty};var t_=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=e_)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=e_)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}($);$.empty=new t_([]);var n_=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}($),r_=$,i_=500,a_=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new s_(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new s_(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new s_(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>l_&&(s=o_(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Yn;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new s_(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new s_(i,o,l))}else r.push(new s_(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new s_(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>i_&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new s_(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(r_.from(i.reverse()),a)}};a_.empty=new a_(r_.empty,0);function o_(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var s_=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},c_=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},l_=20;function u_(e,t,n,r){let i=n.getMeta(v_),a;if(i)return i.historyState;n.getMeta(y_)&&(e=new c_(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(v_))return o.getMeta(v_).redo?new c_(e.done.addTransform(n,void 0,r,__(t)),e.undone,f_(n.mapping.maps),e.prevTime,e.prevComposition):new c_(e.done,e.undone.addTransform(n,void 0,r,__(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!d_(n,e.prevRanges)),s=o?p_(e.prevRanges,n.mapping):f_(n.mapping.maps);return new c_(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,__(t)),a_.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new c_(e.done.rebased(n,a),e.undone.rebased(n,a),p_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new c_(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),p_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function d_(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function f_(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function p_(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function m_(e,t,n){let r=__(t),i=v_.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new c_(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(v_,{redo:n,historyState:c})}var h_=!1,g_=null;function __(e){let t=e.plugins;if(g_!=t){h_=!1,g_=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){h_=!0;break}}return h_}var v_=new V(`history`),y_=new V(`closeHistory`);function b_(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new B({key:v_,state:{init(){return new c_(a_.empty,a_.empty,null,0,-1)},apply(t,n,r){return u_(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?S_:n==`historyRedo`?C_:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function x_(e,t){return(n,r)=>{let i=v_.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=m_(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var S_=x_(!1,!0),C_=x_(!0,!0);J.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new B({key:new V(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var w_=J.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Vg(this.options)]}});J.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new B({key:new V(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return Uc.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Bc.node(t,t+e.nodeSize,{class:this.options.className}))}),Uc.create(e,a)}}})]}});var T_=J.create({name:`gapCursor`,addProseMirrorPlugins(){return[Jg()]},extendNodeSchema(e){return{allowGapCursor:K(G(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),E_=`placeholder`;function D_(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var O_=J.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:E_,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${D_(this.options.dataAttribute)}`:`data-${E_}`;return[new B({key:new V(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&Vd(t);if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=Bc.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),Uc.create(t,a)}}})]}});J.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new B({key:new V(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||Hd(n.selection)||e.view.dragging?null:Uc.create(n.doc,[Bc.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function k_({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var A_=J.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new V(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new B({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!k_({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!k_({node:r,types:n})}}})]}}),j_=J.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>S_(e,t),redo:()=>({state:e,dispatch:t})=>C_(e,t)}},addProseMirrorPlugins(){return[b_(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),M_=J.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(Ep.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(xp.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(sg.configure(this.options.bulletList)),this.options.code!==!1&&e.push(kp.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Np.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Pp.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(w_.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(T_.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Fp.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Ip.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(j_.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Lp.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Hp.configure(this.options.italic)),this.options.listItem!==!1&&e.push(cg.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(yg.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(eg.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Og.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Pg.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Lg.configure(this.options.strike)),this.options.text!==!1&&e.push(Rg.configure(this.options.text)),this.options.underline!==!1&&e.push(zg.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(A_.configure(this.options?.trailingNode)),e}}),N_=O_,P_=jg,F_=Ag,I_=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,L_=pp.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,q(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new tp({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Zf({find:I_,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),R_=J.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}}),z_=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,B_=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,V_=Ef.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,q(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Xf({find:z_,type:this.type})]},addPasteRules(){return[mp({find:B_,type:this.type})]}});function H_(e,t=[]){return e.flatMap(e=>{let n=[...t,...e.properties?e.properties.className:[]];return e.children?H_(e.children,n):{text:e.value,classes:n}})}function U_(e){return e.value||e.children||[]}function W_(e){return!!qe.getLanguage(e)}function G_({doc:e,name:t,lowlight:n,defaultLanguage:r}){let i=[];return td(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1,a=e.node.attrs.language||r,o=n.listLanguages();H_(a&&(o.includes(a)||W_(a)||n.registered?.call(n,a))?U_(n.highlight(a,e.node.textContent)):U_(n.highlightAuto(e.node.textContent))).forEach(e=>{let n=t+e.text.length;if(e.classes.length){let r=Bc.inline(t,n,{class:e.classes.join(` `)});i.push(r)}t=n})}),Uc.create(e,i)}function K_(e){return typeof e==`function`}function q_({name:e,lowlight:t,defaultLanguage:n}){if(![`highlight`,`highlightAuto`,`listLanguages`].every(e=>K_(t[e])))throw Error(`You should provide an instance of lowlight to use the code-block-lowlight extension`);let r=new B({key:new V(`lowlight`),state:{init:(r,{doc:i})=>G_({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,a,o)=>{let s=a.selection.$head.parent.type.name,c=o.selection.$head.parent.type.name,l=td(a.doc,t=>t.type.name===e),u=td(o.doc,t=>t.type.name===e);return r.docChanged&&([s,c].includes(e)||u.length!==l.length||r.steps.some(e=>e.from!==void 0&&e.to!==void 0&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?G_({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations(e){return r.getState(e)}}});return r}var J_=Np.extend({addOptions(){return{...this.parent?.call(this),lowlight:{},languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){return[...this.parent?.call(this)||[],q_({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),Y_={key:0,class:`tt`},X_={class:`tt-toolbar`},Z_={class:`tt-toolbar__group`},Q_=[`title`],$_=[`title`],ev=[`title`],tv=[`title`],nv=[`title`],rv={class:`tt-toolbar__group`},iv=[`title`],av=[`title`],ov=[`title`],sv={class:`tt-toolbar__group`},cv=[`title`],lv=[`title`],uv=[`title`],dv={class:`tt-toolbar__group`},fv=[`title`],pv=[`title`],mv=[`title`],hv=[`title`],gv={class:`tt-toolbar__group`},_v=[`title`,`disabled`],vv=[`title`,`disabled`],yv=a(Se({__name:`TiptapEditor`,props:{modelValue:{},placeholder:{default:`Write something...`},editable:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(t,{expose:r,emit:a}){let o=Ze(j),c=t,l=a,u=vp({content:c.modelValue,editable:c.editable,extensions:[M_.configure({codeBlock:!1}),N_.configure({placeholder:c.placeholder}),P_,F_.configure({nested:!0}),tg.configure({openOnClick:!1,HTMLAttributes:{class:`tt-link`}}),L_.configure({inline:!0,allowBase64:!0}),Bg,R_.configure({types:[`heading`,`paragraph`]}),V_.configure({multicolor:!0}),J_.configure({lowlight:o})],onUpdate({editor:e}){l(`update:modelValue`,e.getHTML())}});e(()=>c.modelValue,e=>{u.value&&u.value.getHTML()!==e&&u.value.commands.setContent(e,!1)}),e(()=>c.editable,e=>{u.value?.setEditable(e)}),p(()=>u.value?.destroy());function d(e){u.value?.chain().focus().setImage({src:e}).run()}r({insertImage:d});let{t:f}=y();return(e,t)=>i(u)?(n(),C(`div`,Y_,[E(`div`,X_,[E(`div`,Z_,[E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`bold`)}]),title:i(f)(`tiptapEditor.bold`),onClick:t[0]||=e=>i(u).chain().focus().toggleBold().run()},[...t[17]||=[E(`i`,{class:`pi pi-bold`},null,-1)]],10,Q_),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`italic`)}]),title:i(f)(`tiptapEditor.italic`),onClick:t[1]||=e=>i(u).chain().focus().toggleItalic().run()},[...t[18]||=[E(`i`,{class:`pi pi-italic`},null,-1)]],10,$_),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`underline`)}]),title:i(f)(`tiptapEditor.underline`),onClick:t[2]||=e=>i(u).chain().focus().toggleUnderline().run()},[...t[19]||=[E(`i`,{class:`pi pi-underline`},null,-1)]],10,ev),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`strike`)}]),title:i(f)(`tiptapEditor.strikethrough`),onClick:t[3]||=e=>i(u).chain().focus().toggleStrike().run()},[...t[20]||=[E(`i`,{class:`pi pi-strikethrough`},null,-1)]],10,tv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`highlight`)}]),title:i(f)(`tiptapEditor.highlight`),onClick:t[4]||=e=>i(u).chain().focus().toggleHighlight().run()},[...t[21]||=[E(`i`,{class:`pi pi-palette`},null,-1)]],10,nv)]),t[30]||=E(`span`,{class:`tt-toolbar__sep`},null,-1),E(`div`,rv,[E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`heading`,{level:1})}]),title:i(f)(`tiptapEditor.heading1`),onClick:t[5]||=e=>i(u).chain().focus().toggleHeading({level:1}).run()},`H1`,10,iv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`heading`,{level:2})}]),title:i(f)(`tiptapEditor.heading2`),onClick:t[6]||=e=>i(u).chain().focus().toggleHeading({level:2}).run()},`H2`,10,av),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`heading`,{level:3})}]),title:i(f)(`tiptapEditor.heading3`),onClick:t[7]||=e=>i(u).chain().focus().toggleHeading({level:3}).run()},`H3`,10,ov)]),t[31]||=E(`span`,{class:`tt-toolbar__sep`},null,-1),E(`div`,sv,[E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`bulletList`)}]),title:i(f)(`tiptapEditor.bulletList`),onClick:t[8]||=e=>i(u).chain().focus().toggleBulletList().run()},[...t[22]||=[E(`i`,{class:`pi pi-list`},null,-1)]],10,cv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`orderedList`)}]),title:i(f)(`tiptapEditor.orderedList`),onClick:t[9]||=e=>i(u).chain().focus().toggleOrderedList().run()},[...t[23]||=[E(`i`,{class:`pi pi-list-check`},null,-1)]],10,lv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`taskList`)}]),title:i(f)(`tiptapEditor.taskList`),onClick:t[10]||=e=>i(u).chain().focus().toggleTaskList().run()},[...t[24]||=[E(`i`,{class:`pi pi-check-square`},null,-1)]],10,uv)]),t[32]||=E(`span`,{class:`tt-toolbar__sep`},null,-1),E(`div`,dv,[E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`blockquote`)}]),title:i(f)(`tiptapEditor.quote`),onClick:t[11]||=e=>i(u).chain().focus().toggleBlockquote().run()},[...t[25]||=[E(`i`,{class:`pi pi-comment`},null,-1)]],10,fv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`code`)}]),title:i(f)(`tiptapEditor.inlineCode`),onClick:t[12]||=e=>i(u).chain().focus().toggleCode().run()},[...t[26]||=[E(`i`,{class:`pi pi-code`},null,-1)]],10,pv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`codeBlock`)}]),title:i(f)(`tiptapEditor.codeBlock`),onClick:t[13]||=e=>i(u).chain().focus().toggleCodeBlock().run()},`</>`,10,mv),E(`button`,{class:`tt-btn`,title:i(f)(`tiptapEditor.horizontalRule`),onClick:t[14]||=e=>i(u).chain().focus().setHorizontalRule().run()},[...t[27]||=[E(`i`,{class:`pi pi-minus`},null,-1)]],8,hv)]),t[33]||=E(`span`,{class:`tt-toolbar__sep`},null,-1),E(`div`,gv,[E(`button`,{class:`tt-btn`,title:i(f)(`tiptapEditor.undo`),disabled:!i(u).can().undo(),onClick:t[15]||=e=>i(u).chain().focus().undo().run()},[...t[28]||=[E(`i`,{class:`pi pi-undo`},null,-1)]],8,_v),E(`button`,{class:`tt-btn`,title:i(f)(`tiptapEditor.redo`),disabled:!i(u).can().redo(),onClick:t[16]||=e=>i(u).chain().focus().redo().run()},[...t[29]||=[E(`i`,{class:`pi pi-refresh`},null,-1)]],8,vv)])]),b(i(_p),{editor:i(u),class:`tt-content`},null,8,[`editor`])])):S(``,!0)}}),[[`__scopeId`,`data-v-bf6df0d6`]]),bv={key:0,class:`kb`},xv={class:`kb-header`},Sv={class:`kb-header__title`},Cv={class:`kb-header__search`},wv={key:0,class:`kb-header__saving`},Tv={class:`kb-board`},Ev=[`data-col-id`,`onDragstart`,`onDragover`,`onDragleave`,`onDrop`,`onTouchstart`],Dv={class:`kb-col__header`},Ov=[`value`,`onBlur`],kv={class:`kb-col__header-right`},Av={class:`kb-col__count`},jv={class:`kb-col__cards`},Mv=[`data-card-id`,`onDragstart`,`onDragover`,`onTouchstart`,`onClick`],Nv={class:`kb-card__top`},Pv={class:`kb-card__title`},Fv={class:`kb-card__actions`},Iv=[`onClick`],Lv=[`onClick`],Rv={key:0,class:`kb-card__badges`},zv={key:0,class:`pi pi-align-left`},Bv={key:1,class:`kb-card__img-badge`},Vv={key:2,class:`kb-card__ai-badge kb-card__ai-badge--streaming`},Hv={key:3,class:`kb-card__ai-badge kb-card__ai-badge--unread`},Uv={key:0,class:`kb-col__empty`},Wv=[`onClick`],Gv={class:`kb-add-col`},Kv={key:0,class:`kb-add-col__form`},qv={class:`kb-add-col__actions`},Jv={key:0,class:`kb-dialog`},Yv={class:`kb-dialog__edit-content`},Xv={class:`kb-dialog__field`},Zv={class:`kb-dialog__label`},Qv={class:`kb-dialog__field`},$v={class:`kb-dialog__label`},ey={class:`kb-dialog__field`},ty={class:`kb-dialog__label`},ny={key:0,class:`kb-dialog__images`},ry=[`src`],iy=[`onClick`],ay={class:`kb-dialog__upload`},oy={class:`kb-dialog__actions-zone`},sy={class:`kb-dialog__label`},cy={class:`kb-dialog__actions-buttons`},ly={class:`kb-dialog__danger-zone`},uy={class:`kb-comments`},dy={class:`kb-comments__input`},fy={key:0,class:`kb-comments__empty`},py={key:1,class:`kb-comments__list`},my=[`onClick`],hy={class:`kb-comments__avatar`},gy={class:`kb-comments__body`},_y={class:`kb-comments__meta`},vy={class:`kb-comments__author`},yy={class:`kb-comments__time`},by=[`innerHTML`],xy={class:`kb-history`},Sy={key:0,class:`kb-history__empty`},Cy={key:1,class:`kb-history__timeline`},wy=[`onClick`],Ty={class:`kb-history__icon`},Ey={class:`kb-history__body`},Dy={class:`kb-history__label`},Oy={key:0,class:`pi pi-external-link`,style:{"font-size":`0.625rem`,"margin-left":`0.25rem`}},ky={key:0,class:`kb-history__detail`},Ay={class:`kb-history__time`},jy={class:`kb-dialog__footer`},My={class:`kb-populate`},Ny={class:`kb-populate__hint`},Py={class:`kb-dialog__footer`},Fy={key:0,class:`kb-queue-panel`},Iy={class:`kb-queue-panel__header`},Ly={class:`kb-queue-panel__title`},Ry={class:`kb-queue-panel__concurrency`},zy={class:`kb-queue-panel__concurrency-label`},By={class:`kb-queue-panel__concurrency-ctrl`},Vy={key:0,class:`kb-queue-panel__section`},Hy={class:`kb-queue-panel__section-title`},Uy={class:`kb-queue-item__title`},Wy={key:1,class:`kb-queue-panel__section`},Gy={class:`kb-queue-panel__section-title`},Ky={class:`kb-queue-item__title`},qy={key:2,class:`kb-queue-panel__empty`},Jy={class:`kb-queue-panel__footer`},Yy={class:`kb-queue-col-dialog`},Xy={class:`kb-queue-col-dialog__field`},Zy=[`disabled`],Qy=[`disabled`],$y={class:`kb-queue-col-dialog__field`},eb={value:``},tb=[`value`],nb={class:`kb-dialog__footer`},rb=400,ib=8,ab=60,ob=12,sb=a(Se({__name:`KanbanBoardPage`,props:{id:{}},setup(a){function p(e){return f.sanitize(m.parse(e,{async:!1}))}let{t:g}=y(),v=te(),ne=w(null),re=w(`edit`),oe=w(``),x=ue(),{claudeCodeAvailable:le,codexAvailable:pe,providers:Se}=l(x),we=ae();d(()=>{x.init()});let Te=w(!1),Ee=w(null),De=``,Oe=null;function ke(){return{kanbanBoardId:O.value?.id,kanbanCardId:Oe?.card.id}}function Ae(e,t,n){if(!O.value||!Oe)return;let{colId:r,card:i}=Oe,a=O.value.columns.find(e=>e.id===r);if(!a)return;let o=a.cards.find(e=>e.id===i.id);o&&(o.history=[...o.history??[],{type:t,timestamp:new Date().toISOString(),detail:n??e}],Nt())}function je(){let e=k.value;Ht();let t=et.value||e?.card.title||``,n=tt.value||e?.card.markdown||``;De=n?`${t}\n\n${n}`:t,Oe=e?{...e}:null,Te.value=!0}function Me(e,t,n){Te.value=!1,Ee.value?.showScenarioDialog(e,De,t,n??void 0)}async function Ne(e,t){Te.value=!1,await Pe(e===`keep`?void 0:e,t??void 0)}async function Pe(e,t){let n=De,r=await x.createConversation({title:`Kanban: ${et.value||`Card`}`,runner:e,providerId:t,...ke()});r&&Ae(r.id,`conversation_started`),k.value=null,n?we.openWithKanbanContext(n):we.open()}async function Fe(e,t,n,r){let i=t||De,a=await x.createConversation({scenarioId:e,scenarioInput:i,title:`Kanban: ${et.value||`Card`}`,...ke()});if(i&&a){let t=n!==`keep`||r.trim()?{...n===`keep`?{}:{runnerOverride:n},...r.trim()?{modelOverride:r.trim()}:{}}:void 0;x.startScenarioRun(a.id,e,i,void 0,t),Ae(a.id,`scenario_started`,`Scenario run — ${a.id}`)}k.value=null,we.open()}let Ie=se(()=>k.value?(k.value.card.history??[]).filter(e=>e.type===`comment`):[]);function Le(){if(!k.value||!oe.value.trim())return;let e=k.value.card,t=x.activeConversation?.id;e.history=[...e.history??[],{type:`comment`,timestamp:new Date().toISOString(),detail:oe.value.trim(),author:`user`,...t?{conversationId:t}:{}}],oe.value=``,Nt()}let Re=new Set([`conversation_started`,`scenario_started`]);function ze(e){return e.type===`comment`?!!e.conversationId:Re.has(e.type)&&!!e.detail}function Be(e){if(!ze(e))return;let t;t=e.type===`comment`?e.conversationId:e.detail.includes(` — `)?e.detail.split(` — `).pop():e.detail,x.selectConversation(t),k.value=null,we.open()}function Ve(e,t,n){e.history=[...e.history??[],{type:t,timestamp:new Date().toISOString(),detail:n}]}function He(e){return O.value?.columns.find(t=>t.id===e)?.title??`Unknown`}let Ue={created:`pi pi-plus-circle`,edited:`pi pi-pencil`,moved:`pi pi-arrow-right-arrow-left`,image_added:`pi pi-image`,image_removed:`pi pi-trash`,title_changed:`pi pi-tag`,conversation_started:`pi pi-comments`,scenario_started:`pi pi-sitemap`,comment:`pi pi-comment`},We=se(()=>({created:g(`kanban.board.history.events.created`),edited:g(`kanban.board.history.events.edited`),moved:g(`kanban.board.history.events.moved`),image_added:g(`kanban.board.history.events.image_added`),image_removed:g(`kanban.board.history.events.image_removed`),title_changed:g(`kanban.board.history.events.title_changed`),conversation_started:g(`kanban.board.history.events.conversation_started`),scenario_started:g(`kanban.board.history.events.scenario_started`),comment:g(`kanban.board.history.events.comment`)}));function Ge(e){let t=new Date(e);return t.toLocaleDateString(void 0,{day:`numeric`,month:`short`,year:`numeric`})+` `+t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}let Ke=a,qe=r(),Je=Ce(),Ye=be(),O=w(null),Xe=w(!1),Ze=w(``),Qe=w(!1),$e=w(``),k=w(null),et=w(``),tt=w(``),nt=w([]),rt=w(null),ut=w(null),dt=w(null),ft=w(`after`),A=w(null),pt=w(null),mt=w(`after`),j=ht(),M=w(!1),gt=w(!1),_t=w(``),vt=w(``),N=w(``),yt=w([]);d(async()=>{j.init();try{let{trpc:e}=await fe(async()=>{let{trpc:e}=await import(`./trpc-tQqsDgwJ.js`);return{trpc:e}},__vite__mapDeps([0,1,2]));yt.value=(await e.scenario.list.query()).map(e=>({id:e.id,name:e.name}))}catch{}}),h(()=>j.destroy());function bt(e){_t.value=e,vt.value=``,N.value=``,gt.value=!0}async function xt(){O.value&&(await j.addColumn({boardId:O.value.id,columnId:_t.value,runner:vt.value||void 0,scenarioId:N.value||void 0}),gt.value=!1)}async function P(e){if(!O.value)return;let t=j.getCardQueueItemId(O.value.id,e.id);t?await j.removeItem(t):await j.addCard({boardId:O.value.id,cardId:e.id})}let St=w(!1),F=w(!1),Ct=w(``);async function wt(e,t){if(!O.value||!Ct.value.trim())return;let n=Ct.value.trim(),r=await x.createConversation({title:`Kanban populate: ${O.value.name.slice(0,30)}`,runner:e,providerId:t,kanbanBoardId:O.value.id});F.value=!1,Ct.value=``,r&&(we.openPopulate(),await ge(),x.send(n,()=>{}))}async function Tt(e,t,n){if(!O.value||!Ct.value.trim())return;let r=Ct.value.trim(),i=await x.createConversation({title:`Kanban populate: ${O.value.name.slice(0,30)}`,scenarioId:e,scenarioInput:r,...t===`keep`?{}:{runner:t},...n?{providerId:n}:{},kanbanBoardId:O.value.id});F.value=!1,Ct.value=``,i&&(x.startScenarioRun(i.id,e,r,void 0,t===`keep`?void 0:{runnerOverride:t}),we.open())}function Et(){Ct.value=``,St.value=!0}function Dt(){Ct.value.trim()&&(St.value=!1,x.fetchProviders(),x.checkCliAvailability(),F.value=!0)}async function Ot(e,t){await wt(e===`keep`?void 0:e,t??void 0)}async function kt(e,t,n){await Tt(e,t,n)}d(async()=>{let e=await Ye.fetchOne(Ke.id);if(!e){qe.push(`/kanban`);return}O.value={...e},Ye.subscribeToChanges();let t=Je.query.card;if(t){for(let n of e.columns){let e=n.cards.find(e=>e.id===t);if(e){zt(n.id,e);break}}qe.replace({query:{...Je.query,card:void 0}})}}),h(()=>{Ye.unsubscribeFromChanges()}),e(()=>Ye.boards.find(e=>e.id===Ke.id),e=>{e&&!Xe.value&&(O.value={...e})});let At=se(()=>O.value?[...O.value.columns].sort((e,t)=>e.order-t.order).map(e=>({...e,cards:[...e.cards].sort((e,t)=>e.order-t.order)})):[]),jt=se(()=>{let e=$e.value.trim().toLowerCase();return e?At.value.map(t=>({...t,cards:t.cards.filter(t=>t.title.toLowerCase().includes(e)||t.markdown&&t.markdown.toLowerCase().includes(e))})):At.value}),Mt=null;function Nt(){O.value&&(Mt&&clearTimeout(Mt),Mt=setTimeout(async()=>{if(!(!O.value||Xe.value)){Xe.value=!0;try{let e=await Ye.update(O.value.id,{columns:O.value.columns});e&&(O.value={...e})}finally{Xe.value=!1}}},300))}function Pt(){if(!O.value||!Ze.value.trim())return;let e={id:lt(),title:Ze.value.trim(),order:O.value.columns.length,cards:[]};O.value.columns=[...O.value.columns,e],Ze.value=``,Qe.value=!1,Nt()}function Ft(e){if(!O.value)return;let t=O.value.columns.find(t=>t.id===e);v.require({message:g(`kanban.board.column.confirmDeleteMessage`,{title:t?.title??``,count:t?.cards.length??0}),header:g(`kanban.board.column.confirmDeleteHeader`),icon:`pi pi-trash`,acceptClass:`p-button-danger`,accept:()=>{O.value&&(O.value.columns=O.value.columns.filter(t=>t.id!==e),Nt())}})}function It(e,t){!O.value||!t.trim()||(O.value.columns=O.value.columns.map(n=>n.id===e?{...n,title:t.trim()}:n),Nt())}function Lt(e){if(!O.value)return;let t=O.value.columns.find(t=>t.id===e);if(!t)return;let n=new Date().toISOString();zt(e,{id:lt(),title:g(`kanban.board.card.defaultTitle`),markdown:``,images:[],order:t.cards.length,history:[{type:`created`,timestamp:n,detail:g(`kanban.board.card.inColumn`,{name:He(e)})}],createdAt:n,updatedAt:n})}function Rt(e){return!e||/^<[a-z][\s\S]*>/i.test(e.trim())?e:m.parse(e,{async:!1})}function zt(e,t){k.value={colId:e,card:{...t,history:[...t.history??[]]}},et.value=t.title,tt.value=Rt(t.markdown),nt.value=[...t.images],re.value=`edit`}function Bt(e){return(e.history??[]).filter(e=>e.type===`conversation_started`||e.type===`scenario_started`).map(e=>{let t=e.detail??``;return t.includes(` — `)?t.split(` — `).pop():t}).filter(Boolean)}function Vt(e){if(j.state.running.some(t=>t.cardId===e.id))return`streaming`;if(j.state.items.some(t=>t.cardId===e.id))return`unread`;let t=Bt(e);return t.some(e=>x.streamingConvIds.has(e))?`streaming`:t.some(e=>x.unreadConvIds.has(e))?`unread`:null}e(re,e=>{(e===`comments`||e===`history`)&&k.value&&Bt(k.value.card).forEach(e=>x.markRead(e))});function Ht(){if(!O.value||!k.value)return;let{colId:e,card:t}=k.value,n=et.value||g(`kanban.board.card.untitled`),r=[...t.history??[]];n!==t.title&&t.title!==g(`kanban.board.card.defaultTitle`)&&r.push({type:`title_changed`,timestamp:new Date().toISOString(),detail:`"${t.title}" → "${n}"`}),tt.value!==t.markdown&&r.push({type:`edited`,timestamp:new Date().toISOString()});let i=nt.value.length-t.images.length;i>0?r.push({type:`image_added`,timestamp:new Date().toISOString(),detail:`${i} image(s) added`}):i<0&&r.push({type:`image_removed`,timestamp:new Date().toISOString(),detail:`${Math.abs(i)} image(s) removed`});let a={...t,title:n,markdown:tt.value,images:nt.value,history:r,updatedAt:new Date().toISOString()};O.value.columns=O.value.columns.map(t=>t.id===e?t.cards.find(e=>e.id===a.id)?{...t,cards:t.cards.map(e=>e.id===a.id?a:e)}:{...t,cards:[...t.cards,a]}:t),k.value=null,Nt()}function Ut(e,t){if(!O.value)return;let n=O.value.columns.find(t=>t.id===e)?.cards.find(e=>e.id===t);v.require({message:g(`kanban.board.editor.confirmDeleteMessage`,{title:n?.title??``}),header:g(`kanban.board.editor.confirmDeleteHeader`),icon:`pi pi-trash`,acceptClass:`p-button-danger`,accept:()=>{O.value&&(O.value.columns=O.value.columns.map(n=>n.id===e?{...n,cards:n.cards.filter(e=>e.id!==t)}:n),k.value=null,Nt())}})}function Wt(e){let t=e.target;if(t.files){for(let e of Array.from(t.files)){if(!e.type.startsWith(`image/`)||e.size>5*1024*1024)continue;let t=new FileReader;t.onload=()=>{typeof t.result==`string`&&(nt.value=[...nt.value,t.result],ne.value?.insertImage(t.result))},t.readAsDataURL(e)}t.value=``}}function Gt(e){v.require({message:g(`kanban.board.editor.confirmRemoveImageMessage`),header:g(`kanban.board.editor.confirmRemoveImageHeader`),icon:`pi pi-trash`,acceptClass:`p-button-danger`,accept:()=>{nt.value=nt.value.filter((t,n)=>n!==e)}})}let Kt=w(null),qt=w(null),Jt=w(!1),Yt=null,Xt=null,Zt=null;function Qt(e,t){Yt&&cancelAnimationFrame(Yt);let n=document.querySelector(`.kb-board`),r=()=>{let i=!1;if(n){let t=n.getBoundingClientRect();e<t.left+ab&&n.scrollLeft>0?(n.scrollLeft-=ob,i=!0):e>t.right-ab&&n.scrollLeft<n.scrollWidth-n.clientWidth&&(n.scrollLeft+=ob,i=!0)}qt.value&&(qt.value.style.display=`none`);let a=document.elementFromPoint(e,t);if(qt.value&&(qt.value.style.display=``),a){let e=a.closest(`.kb-col__cards`);if(e){let n=e.getBoundingClientRect();t<n.top+ab&&e.scrollTop>0?(e.scrollTop-=ob,i=!0):t>n.bottom-ab&&e.scrollTop<e.scrollHeight-e.clientHeight&&(e.scrollTop+=ob,i=!0)}}Yt=i&&Jt.value?requestAnimationFrame(r):null};Yt=requestAnimationFrame(r)}function $t(){Yt&&=(cancelAnimationFrame(Yt),null)}function en(){Xt&&=(clearTimeout(Xt),null),Zt=null}function tn(){if(!Zt)return;let{type:e,colId:t,cardId:n,el:r}=Zt;Kt.value=e,Jt.value=!0,e===`card`&&n?(rt.value={colId:t,cardId:n},A.value=null):(A.value=t,rt.value=null),navigator.vibrate&&navigator.vibrate(30);let i=e===`card`?r.closest(`.kb-card`):r.closest(`.kb-col`);if(i){let e=i.cloneNode(!0);e.style.cssText=`position:fixed;pointer-events:none;z-index:9999;opacity:0.8;width:${i.getBoundingClientRect().width}px;transform:rotate(2deg);`,document.body.appendChild(e),qt.value=e}Zt=null}function nn(e,t,n,r){en();let i=e.touches[0],a=i.clientX,o=i.clientY;Zt={type:t,colId:n,cardId:r,el:e.target};let s=e=>{let t=e.touches[0],n=t.clientX-a,r=t.clientY-o;Math.sqrt(n*n+r*r)>ib&&(en(),document.removeEventListener(`touchmove`,s))};document.addEventListener(`touchmove`,s,{passive:!0}),Xt=setTimeout(()=>{document.removeEventListener(`touchmove`,s),tn()},rb)}function rn(e){if(!Jt.value)return;e.preventDefault();let t=e.touches[0];qt.value&&(qt.value.style.left=`${t.clientX-40}px`,qt.value.style.top=`${t.clientY-20}px`),Qt(t.clientX,t.clientY),qt.value&&(qt.value.style.display=`none`);let n=document.elementFromPoint(t.clientX,t.clientY);if(qt.value&&(qt.value.style.display=``),n){if(Kt.value===`card`){let e=n.closest(`.kb-card`),r=n.closest(`.kb-col`);if(e&&r){let n=e.dataset.cardId||``,i=r.dataset.colId||``;if(n&&i){ut.value=i,dt.value=n;let r=e.getBoundingClientRect();ft.value=t.clientY-r.top<r.height/2?`before`:`after`}}else if(r){let e=r.dataset.colId||``;e&&(ut.value=e,dt.value=null)}}else if(Kt.value===`column`){let e=n.closest(`.kb-col`);if(e){let n=e.dataset.colId||``;if(n&&n!==A.value){pt.value=n;let r=e.getBoundingClientRect();mt.value=t.clientX-r.left<r.width/2?`before`:`after`}}}}}function an(){en(),$t(),qt.value&&=(qt.value.remove(),null),Jt.value&&(Kt.value===`card`&&ut.value?ln(ut.value):Kt.value===`column`&&pt.value&&mn(pt.value)),Kt.value=null,Jt.value=!1,sn()}function on(e,t,n){rt.value={colId:t,cardId:n},A.value=null,e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`type`,`card`))}function sn(){rt.value=null,ut.value=null,dt.value=null,A.value=null,pt.value=null}function cn(e,t,n){if(!rt.value)return;e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),ut.value=t,dt.value=n;let r=e.currentTarget.getBoundingClientRect();ft.value=e.clientY-r.top<r.height/2?`before`:`after`}function ln(e){if(!O.value)return;if(A.value){mn(e);return}if(!rt.value)return;let{colId:t,cardId:n}=rt.value,r=He(t),i=He(e),a=null;if(O.value.columns=O.value.columns.map(e=>e.id===t?(a=e.cards.find(e=>e.id===n)??null,{...e,cards:e.cards.filter(e=>e.id!==n)}):e),a){let n={...a};t!==e&&Ve(n,`moved`,`"${r}" → "${i}"`),O.value.columns=O.value.columns.map(t=>{if(t.id!==e)return t;let r=[...t.cards].sort((e,t)=>e.order-t.order),i=r.length;if(dt.value){let e=r.findIndex(e=>e.id===dt.value);e!==-1&&(i=ft.value===`before`?e:e+1)}return r.splice(i,0,n),{...t,cards:r.map((e,t)=>({...e,order:t}))}})}rt.value=null,ut.value=null,dt.value=null,Nt()}function un(e,t){!rt.value&&!A.value||(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),rt.value&&(ut.value=t,dt.value=null))}function dn(e){ut.value===e&&(ut.value=null)}function fn(e,t){A.value=t,rt.value=null,e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`type`,`column`))}function pn(e,t){if(!A.value||A.value===t)return;e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),pt.value=t;let n=e.currentTarget.getBoundingClientRect();mt.value=e.clientX-n.left<n.width/2?`before`:`after`}function mn(e){if(!O.value||!A.value||A.value===e){A.value=null,pt.value=null;return}let t=[...O.value.columns].sort((e,t)=>e.order-t.order),n=t.findIndex(e=>e.id===A.value),r=t.splice(n,1)[0],i=t.findIndex(t=>t.id===e),a=mt.value===`before`?i:i+1;t.splice(a,0,r),O.value.columns=t.map((e,t)=>({...e,order:t})),A.value=null,pt.value=null,Nt()}return(e,r)=>{let a=c(`tooltip`);return O.value?(n(),C(`div`,bv,[E(`header`,xv,[b(i(o),{icon:`pi pi-arrow-left`,text:``,rounded:``,size:`small`,onClick:r[0]||=e=>i(qe).push(`/kanban`)}),E(`h1`,Sv,T(O.value.name),1),b(i(o),{label:i(g)(`kanban.board.aiPopulate`),icon:`pi pi-sparkles`,severity:`secondary`,outlined:``,size:`small`,onClick:Et},null,8,[`label`]),b(i(o),{label:i(g)(`kanban.board.queue.panelHeader`),icon:`pi pi-list`,severity:`secondary`,outlined:``,size:`small`,badge:i(j).state.items.length+i(j).state.running.length>0?String(i(j).state.items.length+i(j).state.running.length):void 0,"badge-severity":`warn`,onClick:r[1]||=e=>M.value=!M.value},null,8,[`label`,`badge`]),E(`span`,Cv,[r[32]||=E(`i`,{class:`pi pi-search`},null,-1),b(i(ve),{modelValue:$e.value,"onUpdate:modelValue":r[2]||=e=>$e.value=e,placeholder:i(g)(`kanban.board.searchPlaceholder`),size:`small`,class:`kb-header__search-input`},null,8,[`modelValue`,`placeholder`]),$e.value?(n(),xe(i(o),{key:0,icon:`pi pi-times`,text:``,rounded:``,size:`small`,onClick:r[3]||=e=>$e.value=``})):S(``,!0)]),Xe.value?(n(),C(`span`,wv,[r[33]||=E(`i`,{class:`pi pi-spin pi-spinner`,style:{"font-size":`0.75rem`}},null,-1),de(` `+T(i(g)(`kanban.board.saving`)),1)])):S(``,!0)]),E(`div`,Tv,[(n(!0),C(ie,null,u(jt.value,e=>(n(),C(`div`,{key:e.id,class:s([`kb-col`,{"kb-col--dragover":ut.value===e.id&&!!rt.value,"kb-col--dragging":A.value===e.id,"kb-col--col-drop-before":pt.value===e.id&&mt.value===`before`,"kb-col--col-drop-after":pt.value===e.id&&mt.value===`after`}]),"data-col-id":e.id,draggable:`true`,onDragstart:t=>fn(t,e.id),onDragover:t=>{pn(t,e.id),un(t,e.id)},onDragleave:t=>dn(e.id),onDrop:ye(t=>ln(e.id),[`prevent`]),onDragend:sn,onTouchstart:t=>nn(t,`column`,e.id),onTouchmove:rn,onTouchend:an,onContextmenu:r[7]||=ye(()=>{},[`prevent`])},[E(`div`,Dv,[E(`input`,{class:`kb-col__title`,value:e.title,onBlur:t=>It(e.id,t.target.value),onKeyup:r[4]||=_e(e=>e.target.blur(),[`enter`]),onMousedown:r[5]||=ye(()=>{},[`stop`]),draggable:`false`},null,40,Ov),E(`div`,kv,[me(b(i(o),{icon:`pi pi-list`,text:``,rounded:``,size:`small`,onClick:ye(t=>bt(e.id),[`stop`])},null,8,[`onClick`]),[[a,i(g)(`kanban.board.queue.addColumnTooltip`),void 0,{bottom:!0}]]),me(b(i(o),{icon:`pi pi-trash`,text:``,rounded:``,size:`small`,severity:`danger`,onClick:t=>Ft(e.id)},null,8,[`onClick`]),[[a,i(g)(`kanban.board.column.deleteTooltip`),void 0,{bottom:!0}]]),E(`span`,Av,T(e.cards.length),1)])]),E(`div`,jv,[(n(!0),C(ie,null,u(e.cards,t=>(n(),C(`div`,{key:t.id,class:s([`kb-card`,{"kb-card--drop-before":dt.value===t.id&&ft.value===`before`,"kb-card--drop-after":dt.value===t.id&&ft.value===`after`}]),"data-card-id":t.id,draggable:`true`,onDragstart:ye(n=>on(n,e.id,t.id),[`stop`]),onDragover:n=>cn(n,e.id,t.id),onDragend:sn,onTouchstart:ye(n=>nn(n,`card`,e.id,t.id),[`stop`]),onTouchmove:rn,onTouchend:an,onContextmenu:r[6]||=ye(()=>{},[`prevent`]),onClick:n=>zt(e.id,t)},[E(`div`,Nv,[E(`span`,Pv,T(t.title),1),E(`div`,Fv,[me((n(),C(`button`,{class:s([`kb-card__queue-btn`,{"kb-card__queue-btn--active":O.value&&i(j).isCardInQueue(O.value.id,t.id)}]),onClick:ye(e=>P(t),[`stop`])},[...r[34]||=[E(`i`,{class:`pi pi-list`},null,-1)]],10,Iv)),[[a,O.value&&i(j).isCardInQueue(O.value.id,t.id)?i(g)(`kanban.board.queue.tooltipInQueue`):i(g)(`kanban.board.queue.tooltip`),void 0,{bottom:!0}]]),me((n(),C(`button`,{class:`kb-card__delete`,onClick:ye(n=>Ut(e.id,t.id),[`stop`])},[...r[35]||=[E(`i`,{class:`pi pi-times`},null,-1)]],8,Lv)),[[a,i(g)(`kanban.board.card.deleteTooltip`),void 0,{bottom:!0}]])])]),t.markdown||t.images.length||Vt(t)?(n(),C(`div`,Rv,[t.markdown?(n(),C(`i`,zv)):S(``,!0),t.images.length?(n(),C(`span`,Bv,[r[36]||=E(`i`,{class:`pi pi-image`},null,-1),de(` `+T(t.images.length),1)])):S(``,!0),Vt(t)===`streaming`?me((n(),C(`span`,Vv,null,512)),[[a,i(g)(`kanban.board.aiStatus.streaming`),void 0,{bottom:!0}]]):Vt(t)===`unread`?me((n(),C(`span`,Hv,null,512)),[[a,i(g)(`kanban.board.aiStatus.unread`),void 0,{bottom:!0}]]):S(``,!0)])):S(``,!0)],42,Mv))),128)),e.cards.length===0?(n(),C(`div`,Uv,T(i(g)(`kanban.board.column.dropZone`)),1)):S(``,!0)]),E(`button`,{class:`kb-col__add-card`,onClick:t=>Lt(e.id)},[r[37]||=E(`i`,{class:`pi pi-plus`},null,-1),de(` `+T(i(g)(`kanban.board.column.addCard`)),1)],8,Wv)],42,Ev))),128)),E(`div`,Gv,[Qe.value?(n(),C(`div`,Kv,[b(i(ve),{modelValue:Ze.value,"onUpdate:modelValue":r[8]||=e=>Ze.value=e,placeholder:i(g)(`kanban.board.column.titlePlaceholder`),autofocus:``,onKeyup:[_e(Pt,[`enter`]),r[9]||=_e(e=>Qe.value=!1,[`escape`])],class:`w-full`},null,8,[`modelValue`,`placeholder`]),E(`div`,qv,[b(i(o),{label:i(g)(`kanban.board.addColumnButton`),size:`small`,onClick:Pt,disabled:!Ze.value.trim()},null,8,[`label`,`disabled`]),b(i(o),{icon:`pi pi-times`,text:``,size:`small`,onClick:r[10]||=e=>Qe.value=!1})])])):(n(),C(`button`,{key:1,class:`kb-add-col__trigger`,onClick:r[11]||=e=>Qe.value=!0},[r[38]||=E(`i`,{class:`pi pi-plus`},null,-1),de(` `+T(i(g)(`kanban.board.addColumn`)),1)]))])]),b(i(_),{visible:!!k.value,header:i(g)(`kanban.board.editor.header`),modal:!0,style:{width:`750px`},breakpoints:{"800px":`95vw`},"onUpdate:visible":r[18]||=e=>{e||(k.value=null)}},{footer:D(()=>[E(`div`,jy,[b(i(o),{label:i(g)(`actions.cancel`),text:``,onClick:r[17]||=e=>k.value=null},null,8,[`label`]),b(i(o),{label:i(g)(`actions.save`),icon:`pi pi-check`,onClick:Ht},null,8,[`label`])])]),default:D(()=>[k.value?(n(),C(`div`,Jv,[b(i(it),{value:re.value,"onUpdate:value":r[16]||=e=>re.value=e},{default:D(()=>[b(i(at),null,{default:D(()=>[b(i(st),{value:`edit`},{default:D(()=>[r[39]||=E(`i`,{class:`pi pi-pencil`,style:{"margin-right":`0.375rem`}},null,-1),de(T(i(g)(`kanban.board.editor.tabs.edit`)),1)]),_:1}),b(i(st),{value:`comments`},{default:D(()=>[r[40]||=E(`i`,{class:`pi pi-comments`,style:{"margin-right":`0.375rem`}},null,-1),de(T(i(g)(`kanban.board.editor.tabs.comments`,{count:Ie.value.length})),1)]),_:1}),b(i(st),{value:`history`},{default:D(()=>[r[41]||=E(`i`,{class:`pi pi-history`,style:{"margin-right":`0.375rem`}},null,-1),de(T(i(g)(`kanban.board.editor.tabs.history`,{count:k.value.card.history?.length??0})),1)]),_:1})]),_:1}),b(i(ot),null,{default:D(()=>[b(i(ct),{value:`edit`},{default:D(()=>[E(`div`,Yv,[E(`div`,Xv,[E(`label`,Zv,T(i(g)(`kanban.board.editor.titleLabel`)),1),b(i(ve),{modelValue:et.value,"onUpdate:modelValue":r[12]||=e=>et.value=e,autofocus:``,onKeyup:_e(Ht,[`enter`])},null,8,[`modelValue`])]),E(`div`,Qv,[E(`label`,$v,T(i(g)(`kanban.board.editor.contentLabel`)),1),b(yv,{ref_key:`tiptapRef`,ref:ne,modelValue:tt.value,"onUpdate:modelValue":r[13]||=e=>tt.value=e,placeholder:i(g)(`kanban.board.editor.contentPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),E(`div`,ey,[E(`label`,ty,T(i(g)(`kanban.board.editor.imagesLabel`)),1),nt.value.length?(n(),C(`div`,ny,[(n(!0),C(ie,null,u(nt.value,(e,t)=>(n(),C(`div`,{key:t,class:`kb-dialog__thumb`},[E(`img`,{src:e,alt:`attachment`},null,8,ry),E(`button`,{class:`kb-dialog__thumb-remove`,onClick:e=>Gt(t)},[...r[42]||=[E(`i`,{class:`pi pi-times`},null,-1)]],8,iy)]))),128))])):S(``,!0),E(`label`,ay,[r[43]||=E(`i`,{class:`pi pi-upload`},null,-1),de(` `+T(i(g)(`kanban.board.editor.attachImage`))+` `,1),E(`input`,{type:`file`,accept:`image/*`,multiple:``,onChange:Wt},null,32)])]),E(`div`,oy,[E(`label`,sy,T(i(g)(`kanban.board.editor.actionsLabel`)),1),E(`div`,cy,[b(i(o),{label:i(g)(`kanban.board.editor.launchAi`),icon:`pi pi-sparkles`,severity:`secondary`,outlined:``,size:`small`,onClick:je},null,8,[`label`])])]),E(`div`,ly,[b(i(o),{label:i(g)(`kanban.board.editor.deleteCard`),icon:`pi pi-trash`,severity:`danger`,text:``,size:`small`,onClick:r[14]||=e=>Ut(k.value.colId,k.value.card.id)},null,8,[`label`])])])]),_:1}),b(i(ct),{value:`comments`},{default:D(()=>[E(`div`,uy,[E(`div`,dy,[b(i(ve),{modelValue:oe.value,"onUpdate:modelValue":r[15]||=e=>oe.value=e,placeholder:i(g)(`kanban.board.comments.placeholder`),class:`w-full`,onKeyup:_e(Le,[`enter`])},null,8,[`modelValue`,`placeholder`]),b(i(o),{icon:`pi pi-send`,size:`small`,disabled:!oe.value.trim(),onClick:Le},null,8,[`disabled`])]),Ie.value.length?(n(),C(`div`,py,[(n(!0),C(ie,null,u([...Ie.value].reverse(),(e,t)=>(n(),C(`div`,{key:t,class:s([`kb-comments__item`,{"kb-comments__item--ai":e.author===`ai`,"kb-comments__item--clickable":!!e.conversationId}]),onClick:t=>e.conversationId&&Be(e)},[E(`div`,hy,[E(`i`,{class:s(e.author===`ai`?`pi pi-sparkles`:`pi pi-user`)},null,2)]),E(`div`,gy,[E(`div`,_y,[E(`span`,vy,T(e.author===`ai`?i(g)(`kanban.board.comments.authorAi`):i(g)(`kanban.board.comments.authorYou`)),1),E(`span`,yy,T(Ge(e.timestamp)),1)]),E(`div`,{class:`kb-comments__text kb-comments__text--markdown`,innerHTML:p(e.detail)},null,8,by)])],10,my))),128))])):(n(),C(`div`,fy,[r[44]||=E(`i`,{class:`pi pi-comments`},null,-1),E(`span`,null,T(i(g)(`kanban.board.comments.empty`)),1)]))])]),_:1}),b(i(ct),{value:`history`},{default:D(()=>[E(`div`,xy,[k.value.card.history?.length?(n(),C(`div`,Cy,[(n(!0),C(ie,null,u([...k.value.card.history].reverse(),(e,t)=>(n(),C(`div`,{key:t,class:s([`kb-history__item`,{"kb-history__item--clickable":ze(e)}]),onClick:t=>ze(e)&&Be(e)},[E(`div`,Ty,[E(`i`,{class:s(Ue[e.type])},null,2)]),E(`div`,Ey,[E(`span`,Dy,[de(T(We.value[e.type])+` `,1),ze(e)?(n(),C(`i`,Oy)):S(``,!0)]),e.detail?(n(),C(`span`,ky,T(e.detail),1)):S(``,!0),E(`span`,Ay,T(Ge(e.timestamp)),1)])],10,wy))),128))])):(n(),C(`div`,Sy,[r[45]||=E(`i`,{class:`pi pi-clock`},null,-1),E(`span`,null,T(i(g)(`kanban.board.history.empty`)),1)]))])]),_:1})]),_:1})]),_:1},8,[`value`])])):S(``,!0)]),_:1},8,[`visible`,`header`]),b(i(_),{visible:Te.value,header:i(g)(`kanban.board.launchAiDialog.header`),modal:!0,style:{width:`700px`,maxHeight:`80vh`},breakpoints:{"800px":`95vw`},"onUpdate:visible":r[19]||=e=>{e||(Te.value=!1)},pt:{content:{style:`overflow-y:auto`}}},{default:D(()=>[b(ee,{compact:``,onSelectScenario:Me,onSkip:Ne})]),_:1},8,[`visible`,`header`]),b(ce,{ref_key:`launchModalsRef`,ref:Ee,onConfirmScenarioStart:Fe},null,512),b(i(_),{visible:St.value,header:i(g)(`kanban.board.populateDialog.header`),modal:!0,style:{width:`550px`},breakpoints:{"600px":`95vw`},"onUpdate:visible":r[22]||=e=>{e||(St.value=!1)}},{footer:D(()=>[E(`div`,Py,[b(i(o),{label:i(g)(`actions.cancel`),text:``,onClick:r[21]||=e=>St.value=!1},null,8,[`label`]),b(i(o),{label:i(g)(`kanban.board.populateDialog.generate`),icon:`pi pi-sparkles`,onClick:Dt,disabled:!Ct.value.trim()},null,8,[`label`,`disabled`])])]),default:D(()=>[E(`div`,My,[E(`p`,Ny,T(i(g)(`kanban.board.populateDialog.hint`)),1),b(i(he),{modelValue:Ct.value,"onUpdate:modelValue":r[20]||=e=>Ct.value=e,placeholder:i(g)(`kanban.board.populateDialog.placeholder`),autoResize:!0,rows:`4`,class:`w-full`,onKeydown:[_e(ye(Dt,[`ctrl`]),[`enter`]),_e(ye(Dt,[`meta`]),[`enter`])]},null,8,[`modelValue`,`placeholder`,`onKeydown`])])]),_:1},8,[`visible`,`header`]),b(i(_),{visible:F.value,header:i(g)(`kanban.board.populateDialog.header`),modal:!0,style:{width:`700px`,maxHeight:`80vh`},breakpoints:{"800px":`95vw`},"onUpdate:visible":r[23]||=e=>{e||(F.value=!1)},pt:{content:{style:`overflow-y:auto`}}},{default:D(()=>[b(ee,{compact:``,onSelectScenario:kt,onSkip:Ot})]),_:1},8,[`visible`,`header`]),M.value?(n(),C(`div`,Fy,[E(`div`,Iy,[E(`span`,Ly,T(i(g)(`kanban.board.queue.panelHeader`)),1),b(i(o),{icon:`pi pi-times`,text:``,rounded:``,size:`small`,onClick:r[24]||=e=>M.value=!1})]),E(`div`,Ry,[E(`label`,zy,T(i(g)(`kanban.board.queue.concurrency`)),1),E(`div`,By,[b(i(o),{icon:`pi pi-minus`,text:``,rounded:``,size:`small`,disabled:i(j).state.maxConcurrent<=1,onClick:r[25]||=e=>i(j).setMaxConcurrent(i(j).state.maxConcurrent-1)},null,8,[`disabled`]),E(`span`,null,T(i(j).state.maxConcurrent),1),b(i(o),{icon:`pi pi-plus`,text:``,rounded:``,size:`small`,onClick:r[26]||=e=>i(j).setMaxConcurrent(i(j).state.maxConcurrent+1)})])]),i(j).state.running.length>0?(n(),C(`div`,Vy,[E(`div`,Hy,T(i(g)(`kanban.board.queue.runningSection`,{count:i(j).state.running.length})),1),(n(!0),C(ie,null,u(i(j).state.running.filter(e=>e.boardId===O.value?.id),e=>(n(),C(`div`,{key:e.id,class:`kb-queue-item kb-queue-item--running`},[r[46]||=E(`i`,{class:`pi pi-spin pi-spinner`},null,-1),E(`span`,Uy,T(O.value?.columns.flatMap(e=>e.cards).find(t=>t.id===e.cardId)?.title??e.cardId),1),b(i(o),{icon:`pi pi-stop`,text:``,rounded:``,size:`small`,severity:`danger`,onClick:t=>i(j).removeItem(e.id)},null,8,[`onClick`])]))),128))])):S(``,!0),i(j).state.items.length>0?(n(),C(`div`,Wy,[E(`div`,Gy,T(i(g)(`kanban.board.queue.waitingSection`,{count:i(j).state.items.length})),1),(n(!0),C(ie,null,u(i(j).state.items.filter(e=>e.boardId===O.value?.id),e=>(n(),C(`div`,{key:e.id,class:`kb-queue-item`},[r[47]||=E(`i`,{class:`pi pi-clock`},null,-1),E(`span`,Ky,T(O.value?.columns.flatMap(e=>e.cards).find(t=>t.id===e.cardId)?.title??e.cardId),1),b(i(o),{icon:`pi pi-times`,text:``,rounded:``,size:`small`,onClick:t=>i(j).removeItem(e.id)},null,8,[`onClick`])]))),128))])):S(``,!0),i(j).state.items.length===0&&i(j).state.running.length===0?(n(),C(`div`,qy,T(i(g)(`kanban.board.queue.empty`)),1)):S(``,!0),E(`div`,Jy,[b(i(o),{label:i(g)(`kanban.board.queue.stopAll`),icon:`pi pi-stop`,severity:`danger`,text:``,size:`small`,disabled:i(j).state.items.length===0&&i(j).state.running.length===0,onClick:r[27]||=e=>i(j).stopAll()},null,8,[`label`,`disabled`])])])):S(``,!0),b(i(_),{visible:gt.value,header:i(g)(`kanban.board.queue.addColumnDialog.header`),modal:!0,style:{width:`420px`},"onUpdate:visible":r[31]||=e=>{e||(gt.value=!1)}},{footer:D(()=>[E(`div`,nb,[b(i(o),{label:i(g)(`actions.cancel`),text:``,onClick:r[30]||=e=>gt.value=!1},null,8,[`label`]),b(i(o),{label:i(g)(`kanban.board.queue.addColumnDialog.confirm`),icon:`pi pi-list`,onClick:xt},null,8,[`label`])])]),default:D(()=>[E(`div`,Yy,[E(`div`,Xy,[E(`label`,null,T(i(g)(`kanban.board.queue.addColumnDialog.runner`)),1),me(E(`select`,{"onUpdate:modelValue":r[28]||=e=>vt.value=e,class:`kb-queue-col-dialog__select`},[r[48]||=E(`option`,{value:``},`Auto`,-1),E(`option`,{value:`claude-code`,disabled:!i(le)},`Claude Code`+T(i(le)?``:` (non installé)`),9,Zy),E(`option`,{value:`codex`,disabled:!i(pe)},`Codex`+T(i(pe)?``:` (non installé)`),9,Qy)],512),[[t,vt.value]])]),E(`div`,$y,[E(`label`,null,T(i(g)(`kanban.board.queue.addColumnDialog.scenario`)),1),me(E(`select`,{"onUpdate:modelValue":r[29]||=e=>N.value=e,class:`kb-queue-col-dialog__select`},[E(`option`,eb,T(i(g)(`kanban.board.queue.addColumnDialog.noScenario`)),1),(n(!0),C(ie,null,u(yt.value,e=>(n(),C(`option`,{key:e.id,value:e.id},T(e.name),9,tb))),128))],512),[[t,N.value]])])])]),_:1},8,[`visible`,`header`])])):S(``,!0)}}}),[[`__scopeId`,`data-v-9991ce20`]]);export{sb as default};
141
+ `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=up(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=up(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});J.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(sg.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(cg.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(yg.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Og.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Ag.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(jg.configure(this.options.taskList)),e}});var Mg=`&nbsp;`,Ng=`\xA0`,Pg=pp.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,q(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return r.length===1&&r[0].type===`text`&&(r[0].text===Mg||r[0].text===Ng)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t)=>{if(!e)return``;let n=Array.isArray(e.content)?e.content:[];return n.length===0?Mg:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Fg=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ig=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Lg=Ef.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,q(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Xf({find:Fg,type:this.type})]},addPasteRules(){return[mp({find:Ig,type:this.type})]}}),Rg=pp.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),zg=Ef.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,q(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Bg=zg;function Vg(e={}){return new B({view(t){return new Hg(t,e)}})}var Hg=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=Ar(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},Ug=class e extends L{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):L.near(r)}content(){return F.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Wg(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Kg(e)||!qg(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!z.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};Ug.prototype.visible=!1,Ug.findFrom=Ug.findGapCursorFrom,L.jsonID(`gapcursor`,Ug);var Wg=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Ug.valid(t)?new Ug(t):L.near(t)}};function Gg(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Kg(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||Gg(e.type))return!0;if(e.inlineContent)return!1}}return!0}function qg(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||Gg(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Jg(){return new B({props:{decorations:$g,createSelectionBetween(e,t,n){return t.pos==n.pos&&Ug.valid(n)?new Ug(n):null},handleClick:Zg,handleKeyDown:Yg,handleDOMEvents:{beforeinput:Qg}}})}var Yg=Ll({ArrowLeft:Xg(`horiz`,-1),ArrowRight:Xg(`horiz`,1),ArrowUp:Xg(`vert`,-1),ArrowDown:Xg(`vert`,1)});function Xg(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof R){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=Ug.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new Ug(c))),!0):!1}}function Zg(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Ug.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&z.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Ug(r))),!0)}function Qg(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof Ug))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=N.empty;for(let e=r.length-1;e>=0;e--)i=N.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new F(i,0,0));return a.setSelection(R.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function $g(e){if(!(e.selection instanceof Ug))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,Uc.create(e.doc,[Bc.widget(e.selection.head,t,{key:`gapcursor`})])}var e_=200,$=function(){};$.prototype.append=function(e){return e.length?(e=$.from(e),!this.length&&e||e.length<e_&&this.leafAppend(e)||this.length<e_&&e.leafPrepend(this)||this.appendInner(e)):this},$.prototype.prepend=function(e){return e.length?$.from(e).append(this):this},$.prototype.appendInner=function(e){return new n_(this,e)},$.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?$.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},$.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},$.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},$.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},$.from=function(e){return e instanceof $?e:e&&e.length?new t_(e):$.empty};var t_=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=e_)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=e_)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}($);$.empty=new t_([]);var n_=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}($),r_=$,i_=500,a_=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new s_(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new s_(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new s_(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>l_&&(s=o_(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Yn;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new s_(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new s_(i,o,l))}else r.push(new s_(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new s_(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>i_&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new s_(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(r_.from(i.reverse()),a)}};a_.empty=new a_(r_.empty,0);function o_(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var s_=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},c_=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},l_=20;function u_(e,t,n,r){let i=n.getMeta(v_),a;if(i)return i.historyState;n.getMeta(y_)&&(e=new c_(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(v_))return o.getMeta(v_).redo?new c_(e.done.addTransform(n,void 0,r,__(t)),e.undone,f_(n.mapping.maps),e.prevTime,e.prevComposition):new c_(e.done,e.undone.addTransform(n,void 0,r,__(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!d_(n,e.prevRanges)),s=o?p_(e.prevRanges,n.mapping):f_(n.mapping.maps);return new c_(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,__(t)),a_.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new c_(e.done.rebased(n,a),e.undone.rebased(n,a),p_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new c_(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),p_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function d_(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function f_(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function p_(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function m_(e,t,n){let r=__(t),i=v_.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new c_(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(v_,{redo:n,historyState:c})}var h_=!1,g_=null;function __(e){let t=e.plugins;if(g_!=t){h_=!1,g_=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){h_=!0;break}}return h_}var v_=new V(`history`),y_=new V(`closeHistory`);function b_(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new B({key:v_,state:{init(){return new c_(a_.empty,a_.empty,null,0,-1)},apply(t,n,r){return u_(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?S_:n==`historyRedo`?C_:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function x_(e,t){return(n,r)=>{let i=v_.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=m_(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var S_=x_(!1,!0),C_=x_(!0,!0);J.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new B({key:new V(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var w_=J.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Vg(this.options)]}});J.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new B({key:new V(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return Uc.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Bc.node(t,t+e.nodeSize,{class:this.options.className}))}),Uc.create(e,a)}}})]}});var T_=J.create({name:`gapCursor`,addProseMirrorPlugins(){return[Jg()]},extendNodeSchema(e){return{allowGapCursor:K(G(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),E_=`placeholder`;function D_(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var O_=J.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:E_,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${D_(this.options.dataAttribute)}`:`data-${E_}`;return[new B({key:new V(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&Vd(t);if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=Bc.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),Uc.create(t,a)}}})]}});J.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new B({key:new V(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||Hd(n.selection)||e.view.dragging?null:Uc.create(n.doc,[Bc.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function k_({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var A_=J.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new V(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new B({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!k_({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!k_({node:r,types:n})}}})]}}),j_=J.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>S_(e,t),redo:()=>({state:e,dispatch:t})=>C_(e,t)}},addProseMirrorPlugins(){return[b_(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),M_=J.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(Ep.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(xp.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(sg.configure(this.options.bulletList)),this.options.code!==!1&&e.push(kp.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Np.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Pp.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(w_.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(T_.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Fp.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Ip.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(j_.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Lp.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Hp.configure(this.options.italic)),this.options.listItem!==!1&&e.push(cg.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(yg.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(eg.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Og.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Pg.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Lg.configure(this.options.strike)),this.options.text!==!1&&e.push(Rg.configure(this.options.text)),this.options.underline!==!1&&e.push(zg.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(A_.configure(this.options?.trailingNode)),e}}),N_=O_,P_=jg,F_=Ag,I_=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,L_=pp.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,q(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new tp({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Zf({find:I_,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),R_=J.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}}),z_=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,B_=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,V_=Ef.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,q(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Xf({find:z_,type:this.type})]},addPasteRules(){return[mp({find:B_,type:this.type})]}});function H_(e,t=[]){return e.flatMap(e=>{let n=[...t,...e.properties?e.properties.className:[]];return e.children?H_(e.children,n):{text:e.value,classes:n}})}function U_(e){return e.value||e.children||[]}function W_(e){return!!qe.getLanguage(e)}function G_({doc:e,name:t,lowlight:n,defaultLanguage:r}){let i=[];return td(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1,a=e.node.attrs.language||r,o=n.listLanguages();H_(a&&(o.includes(a)||W_(a)||n.registered?.call(n,a))?U_(n.highlight(a,e.node.textContent)):U_(n.highlightAuto(e.node.textContent))).forEach(e=>{let n=t+e.text.length;if(e.classes.length){let r=Bc.inline(t,n,{class:e.classes.join(` `)});i.push(r)}t=n})}),Uc.create(e,i)}function K_(e){return typeof e==`function`}function q_({name:e,lowlight:t,defaultLanguage:n}){if(![`highlight`,`highlightAuto`,`listLanguages`].every(e=>K_(t[e])))throw Error(`You should provide an instance of lowlight to use the code-block-lowlight extension`);let r=new B({key:new V(`lowlight`),state:{init:(r,{doc:i})=>G_({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,a,o)=>{let s=a.selection.$head.parent.type.name,c=o.selection.$head.parent.type.name,l=td(a.doc,t=>t.type.name===e),u=td(o.doc,t=>t.type.name===e);return r.docChanged&&([s,c].includes(e)||u.length!==l.length||r.steps.some(e=>e.from!==void 0&&e.to!==void 0&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?G_({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations(e){return r.getState(e)}}});return r}var J_=Np.extend({addOptions(){return{...this.parent?.call(this),lowlight:{},languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){return[...this.parent?.call(this)||[],q_({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),Y_={key:0,class:`tt`},X_={class:`tt-toolbar`},Z_={class:`tt-toolbar__group`},Q_=[`title`],$_=[`title`],ev=[`title`],tv=[`title`],nv=[`title`],rv={class:`tt-toolbar__group`},iv=[`title`],av=[`title`],ov=[`title`],sv={class:`tt-toolbar__group`},cv=[`title`],lv=[`title`],uv=[`title`],dv={class:`tt-toolbar__group`},fv=[`title`],pv=[`title`],mv=[`title`],hv=[`title`],gv={class:`tt-toolbar__group`},_v=[`title`,`disabled`],vv=[`title`,`disabled`],yv=a(Se({__name:`TiptapEditor`,props:{modelValue:{},placeholder:{default:`Write something...`},editable:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(t,{expose:r,emit:a}){let o=Ze(j),c=t,l=a,u=vp({content:c.modelValue,editable:c.editable,extensions:[M_.configure({codeBlock:!1}),N_.configure({placeholder:c.placeholder}),P_,F_.configure({nested:!0}),tg.configure({openOnClick:!1,HTMLAttributes:{class:`tt-link`}}),L_.configure({inline:!0,allowBase64:!0}),Bg,R_.configure({types:[`heading`,`paragraph`]}),V_.configure({multicolor:!0}),J_.configure({lowlight:o})],onUpdate({editor:e}){l(`update:modelValue`,e.getHTML())}});e(()=>c.modelValue,e=>{u.value&&u.value.getHTML()!==e&&u.value.commands.setContent(e,!1)}),e(()=>c.editable,e=>{u.value?.setEditable(e)}),p(()=>u.value?.destroy());function d(e){u.value?.chain().focus().setImage({src:e}).run()}r({insertImage:d});let{t:f}=y();return(e,t)=>i(u)?(n(),C(`div`,Y_,[E(`div`,X_,[E(`div`,Z_,[E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`bold`)}]),title:i(f)(`tiptapEditor.bold`),onClick:t[0]||=e=>i(u).chain().focus().toggleBold().run()},[...t[17]||=[E(`i`,{class:`pi pi-bold`},null,-1)]],10,Q_),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`italic`)}]),title:i(f)(`tiptapEditor.italic`),onClick:t[1]||=e=>i(u).chain().focus().toggleItalic().run()},[...t[18]||=[E(`i`,{class:`pi pi-italic`},null,-1)]],10,$_),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`underline`)}]),title:i(f)(`tiptapEditor.underline`),onClick:t[2]||=e=>i(u).chain().focus().toggleUnderline().run()},[...t[19]||=[E(`i`,{class:`pi pi-underline`},null,-1)]],10,ev),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`strike`)}]),title:i(f)(`tiptapEditor.strikethrough`),onClick:t[3]||=e=>i(u).chain().focus().toggleStrike().run()},[...t[20]||=[E(`i`,{class:`pi pi-strikethrough`},null,-1)]],10,tv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`highlight`)}]),title:i(f)(`tiptapEditor.highlight`),onClick:t[4]||=e=>i(u).chain().focus().toggleHighlight().run()},[...t[21]||=[E(`i`,{class:`pi pi-palette`},null,-1)]],10,nv)]),t[30]||=E(`span`,{class:`tt-toolbar__sep`},null,-1),E(`div`,rv,[E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`heading`,{level:1})}]),title:i(f)(`tiptapEditor.heading1`),onClick:t[5]||=e=>i(u).chain().focus().toggleHeading({level:1}).run()},`H1`,10,iv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`heading`,{level:2})}]),title:i(f)(`tiptapEditor.heading2`),onClick:t[6]||=e=>i(u).chain().focus().toggleHeading({level:2}).run()},`H2`,10,av),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`heading`,{level:3})}]),title:i(f)(`tiptapEditor.heading3`),onClick:t[7]||=e=>i(u).chain().focus().toggleHeading({level:3}).run()},`H3`,10,ov)]),t[31]||=E(`span`,{class:`tt-toolbar__sep`},null,-1),E(`div`,sv,[E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`bulletList`)}]),title:i(f)(`tiptapEditor.bulletList`),onClick:t[8]||=e=>i(u).chain().focus().toggleBulletList().run()},[...t[22]||=[E(`i`,{class:`pi pi-list`},null,-1)]],10,cv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`orderedList`)}]),title:i(f)(`tiptapEditor.orderedList`),onClick:t[9]||=e=>i(u).chain().focus().toggleOrderedList().run()},[...t[23]||=[E(`i`,{class:`pi pi-list-check`},null,-1)]],10,lv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`taskList`)}]),title:i(f)(`tiptapEditor.taskList`),onClick:t[10]||=e=>i(u).chain().focus().toggleTaskList().run()},[...t[24]||=[E(`i`,{class:`pi pi-check-square`},null,-1)]],10,uv)]),t[32]||=E(`span`,{class:`tt-toolbar__sep`},null,-1),E(`div`,dv,[E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`blockquote`)}]),title:i(f)(`tiptapEditor.quote`),onClick:t[11]||=e=>i(u).chain().focus().toggleBlockquote().run()},[...t[25]||=[E(`i`,{class:`pi pi-comment`},null,-1)]],10,fv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`code`)}]),title:i(f)(`tiptapEditor.inlineCode`),onClick:t[12]||=e=>i(u).chain().focus().toggleCode().run()},[...t[26]||=[E(`i`,{class:`pi pi-code`},null,-1)]],10,pv),E(`button`,{class:s([`tt-btn`,{"tt-btn--active":i(u).isActive(`codeBlock`)}]),title:i(f)(`tiptapEditor.codeBlock`),onClick:t[13]||=e=>i(u).chain().focus().toggleCodeBlock().run()},`</>`,10,mv),E(`button`,{class:`tt-btn`,title:i(f)(`tiptapEditor.horizontalRule`),onClick:t[14]||=e=>i(u).chain().focus().setHorizontalRule().run()},[...t[27]||=[E(`i`,{class:`pi pi-minus`},null,-1)]],8,hv)]),t[33]||=E(`span`,{class:`tt-toolbar__sep`},null,-1),E(`div`,gv,[E(`button`,{class:`tt-btn`,title:i(f)(`tiptapEditor.undo`),disabled:!i(u).can().undo(),onClick:t[15]||=e=>i(u).chain().focus().undo().run()},[...t[28]||=[E(`i`,{class:`pi pi-undo`},null,-1)]],8,_v),E(`button`,{class:`tt-btn`,title:i(f)(`tiptapEditor.redo`),disabled:!i(u).can().redo(),onClick:t[16]||=e=>i(u).chain().focus().redo().run()},[...t[29]||=[E(`i`,{class:`pi pi-refresh`},null,-1)]],8,vv)])]),b(i(_p),{editor:i(u),class:`tt-content`},null,8,[`editor`])])):S(``,!0)}}),[[`__scopeId`,`data-v-bf6df0d6`]]),bv={key:0,class:`kb`},xv={class:`kb-header`},Sv={class:`kb-header__title`},Cv={class:`kb-header__search`},wv={key:0,class:`kb-header__saving`},Tv={class:`kb-board`},Ev=[`data-col-id`,`onDragstart`,`onDragover`,`onDragleave`,`onDrop`,`onTouchstart`],Dv={class:`kb-col__header`},Ov=[`value`,`onBlur`],kv={class:`kb-col__header-right`},Av={class:`kb-col__count`},jv={class:`kb-col__cards`},Mv=[`data-card-id`,`onDragstart`,`onDragover`,`onTouchstart`,`onClick`],Nv={class:`kb-card__top`},Pv={class:`kb-card__title`},Fv={class:`kb-card__actions`},Iv=[`onClick`],Lv=[`onClick`],Rv={key:0,class:`kb-card__badges`},zv={key:0,class:`pi pi-align-left`},Bv={key:1,class:`kb-card__img-badge`},Vv={key:2,class:`kb-card__ai-badge kb-card__ai-badge--streaming`},Hv={key:3,class:`kb-card__ai-badge kb-card__ai-badge--unread`},Uv={key:0,class:`kb-col__empty`},Wv=[`onClick`],Gv={class:`kb-add-col`},Kv={key:0,class:`kb-add-col__form`},qv={class:`kb-add-col__actions`},Jv={key:0,class:`kb-dialog`},Yv={class:`kb-dialog__edit-content`},Xv={class:`kb-dialog__field`},Zv={class:`kb-dialog__label`},Qv={class:`kb-dialog__field`},$v={class:`kb-dialog__label`},ey={class:`kb-dialog__field`},ty={class:`kb-dialog__label`},ny={key:0,class:`kb-dialog__images`},ry=[`src`],iy=[`onClick`],ay={class:`kb-dialog__upload`},oy={class:`kb-dialog__actions-zone`},sy={class:`kb-dialog__label`},cy={class:`kb-dialog__actions-buttons`},ly={class:`kb-dialog__danger-zone`},uy={class:`kb-comments`},dy={class:`kb-comments__input`},fy={key:0,class:`kb-comments__empty`},py={key:1,class:`kb-comments__list`},my=[`onClick`],hy={class:`kb-comments__avatar`},gy={class:`kb-comments__body`},_y={class:`kb-comments__meta`},vy={class:`kb-comments__author`},yy={class:`kb-comments__time`},by=[`innerHTML`],xy={class:`kb-history`},Sy={key:0,class:`kb-history__empty`},Cy={key:1,class:`kb-history__timeline`},wy=[`onClick`],Ty={class:`kb-history__icon`},Ey={class:`kb-history__body`},Dy={class:`kb-history__label`},Oy={key:0,class:`pi pi-external-link`,style:{"font-size":`0.625rem`,"margin-left":`0.25rem`}},ky={key:0,class:`kb-history__detail`},Ay={class:`kb-history__time`},jy={class:`kb-dialog__footer`},My={class:`kb-populate`},Ny={class:`kb-populate__hint`},Py={class:`kb-dialog__footer`},Fy={key:0,class:`kb-queue-panel`},Iy={class:`kb-queue-panel__header`},Ly={class:`kb-queue-panel__title`},Ry={class:`kb-queue-panel__concurrency`},zy={class:`kb-queue-panel__concurrency-label`},By={class:`kb-queue-panel__concurrency-ctrl`},Vy={key:0,class:`kb-queue-panel__section`},Hy={class:`kb-queue-panel__section-title`},Uy={class:`kb-queue-item__title`},Wy={key:1,class:`kb-queue-panel__section`},Gy={class:`kb-queue-panel__section-title`},Ky={class:`kb-queue-item__title`},qy={key:2,class:`kb-queue-panel__empty`},Jy={class:`kb-queue-panel__footer`},Yy={class:`kb-queue-col-dialog`},Xy={class:`kb-queue-col-dialog__field`},Zy=[`disabled`],Qy=[`disabled`],$y={class:`kb-queue-col-dialog__field`},eb={value:``},tb=[`value`],nb={class:`kb-dialog__footer`},rb=400,ib=8,ab=60,ob=12,sb=a(Se({__name:`KanbanBoardPage`,props:{id:{}},setup(a){function p(e){return f.sanitize(m.parse(e,{async:!1}))}let{t:g}=y(),v=te(),ne=w(null),re=w(`edit`),oe=w(``),x=ue(),{claudeCodeAvailable:le,codexAvailable:pe,providers:Se}=l(x),we=ae();d(()=>{x.init()});let Te=w(!1),Ee=w(null),De=``,Oe=null;function ke(){return{kanbanBoardId:O.value?.id,kanbanCardId:Oe?.card.id}}function Ae(e,t,n){if(!O.value||!Oe)return;let{colId:r,card:i}=Oe,a=O.value.columns.find(e=>e.id===r);if(!a)return;let o=a.cards.find(e=>e.id===i.id);o&&(o.history=[...o.history??[],{type:t,timestamp:new Date().toISOString(),detail:n??e}],Nt())}function je(){let e=k.value;Ht();let t=et.value||e?.card.title||``,n=tt.value||e?.card.markdown||``;De=n?`${t}\n\n${n}`:t,Oe=e?{...e}:null,Te.value=!0}function Me(e,t,n){Te.value=!1,Ee.value?.showScenarioDialog(e,De,t,n??void 0)}async function Ne(e,t){Te.value=!1,await Pe(e===`keep`?void 0:e,t??void 0)}async function Pe(e,t){let n=De,r=await x.createConversation({title:`Kanban: ${et.value||`Card`}`,runner:e,providerId:t,...ke()});r&&Ae(r.id,`conversation_started`),k.value=null,n?we.openWithKanbanContext(n):we.open()}async function Fe(e,t,n,r){let i=t||De,a=await x.createConversation({scenarioId:e,scenarioInput:i,title:`Kanban: ${et.value||`Card`}`,...ke()});if(i&&a){let t=n!==`keep`||r.trim()?{...n===`keep`?{}:{runnerOverride:n},...r.trim()?{modelOverride:r.trim()}:{}}:void 0;x.startScenarioRun(a.id,e,i,void 0,t),Ae(a.id,`scenario_started`,`Scenario run — ${a.id}`)}k.value=null,we.open()}let Ie=se(()=>k.value?(k.value.card.history??[]).filter(e=>e.type===`comment`):[]);function Le(){if(!k.value||!oe.value.trim())return;let e=k.value.card,t=x.activeConversation?.id;e.history=[...e.history??[],{type:`comment`,timestamp:new Date().toISOString(),detail:oe.value.trim(),author:`user`,...t?{conversationId:t}:{}}],oe.value=``,Nt()}let Re=new Set([`conversation_started`,`scenario_started`]);function ze(e){return e.type===`comment`?!!e.conversationId:Re.has(e.type)&&!!e.detail}function Be(e){if(!ze(e))return;let t;t=e.type===`comment`?e.conversationId:e.detail.includes(` — `)?e.detail.split(` — `).pop():e.detail,x.selectConversation(t),k.value=null,we.open()}function Ve(e,t,n){e.history=[...e.history??[],{type:t,timestamp:new Date().toISOString(),detail:n}]}function He(e){return O.value?.columns.find(t=>t.id===e)?.title??`Unknown`}let Ue={created:`pi pi-plus-circle`,edited:`pi pi-pencil`,moved:`pi pi-arrow-right-arrow-left`,image_added:`pi pi-image`,image_removed:`pi pi-trash`,title_changed:`pi pi-tag`,conversation_started:`pi pi-comments`,scenario_started:`pi pi-sitemap`,comment:`pi pi-comment`},We=se(()=>({created:g(`kanban.board.history.events.created`),edited:g(`kanban.board.history.events.edited`),moved:g(`kanban.board.history.events.moved`),image_added:g(`kanban.board.history.events.image_added`),image_removed:g(`kanban.board.history.events.image_removed`),title_changed:g(`kanban.board.history.events.title_changed`),conversation_started:g(`kanban.board.history.events.conversation_started`),scenario_started:g(`kanban.board.history.events.scenario_started`),comment:g(`kanban.board.history.events.comment`)}));function Ge(e){let t=new Date(e);return t.toLocaleDateString(void 0,{day:`numeric`,month:`short`,year:`numeric`})+` `+t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}let Ke=a,qe=r(),Je=Ce(),Ye=be(),O=w(null),Xe=w(!1),Ze=w(``),Qe=w(!1),$e=w(``),k=w(null),et=w(``),tt=w(``),nt=w([]),rt=w(null),ut=w(null),dt=w(null),ft=w(`after`),A=w(null),pt=w(null),mt=w(`after`),j=ht(),M=w(!1),gt=w(!1),_t=w(``),vt=w(``),N=w(``),yt=w([]);d(async()=>{j.init();try{let{trpc:e}=await fe(async()=>{let{trpc:e}=await import(`./trpc-B-vyi6vd.js`);return{trpc:e}},__vite__mapDeps([0,1,2]));yt.value=(await e.scenario.list.query()).map(e=>({id:e.id,name:e.name}))}catch{}}),h(()=>j.destroy());function bt(e){_t.value=e,vt.value=``,N.value=``,gt.value=!0}async function xt(){O.value&&(await j.addColumn({boardId:O.value.id,columnId:_t.value,runner:vt.value||void 0,scenarioId:N.value||void 0}),gt.value=!1)}async function P(e){if(!O.value)return;let t=j.getCardQueueItemId(O.value.id,e.id);t?await j.removeItem(t):await j.addCard({boardId:O.value.id,cardId:e.id})}let St=w(!1),F=w(!1),Ct=w(``);async function wt(e,t){if(!O.value||!Ct.value.trim())return;let n=Ct.value.trim(),r=await x.createConversation({title:`Kanban populate: ${O.value.name.slice(0,30)}`,runner:e,providerId:t,kanbanBoardId:O.value.id});F.value=!1,Ct.value=``,r&&(we.openPopulate(),await ge(),x.send(n,()=>{}))}async function Tt(e,t,n){if(!O.value||!Ct.value.trim())return;let r=Ct.value.trim(),i=await x.createConversation({title:`Kanban populate: ${O.value.name.slice(0,30)}`,scenarioId:e,scenarioInput:r,...t===`keep`?{}:{runner:t},...n?{providerId:n}:{},kanbanBoardId:O.value.id});F.value=!1,Ct.value=``,i&&(x.startScenarioRun(i.id,e,r,void 0,t===`keep`?void 0:{runnerOverride:t}),we.open())}function Et(){Ct.value=``,St.value=!0}function Dt(){Ct.value.trim()&&(St.value=!1,x.fetchProviders(),x.checkCliAvailability(),F.value=!0)}async function Ot(e,t){await wt(e===`keep`?void 0:e,t??void 0)}async function kt(e,t,n){await Tt(e,t,n)}d(async()=>{let e=await Ye.fetchOne(Ke.id);if(!e){qe.push(`/kanban`);return}O.value={...e},Ye.subscribeToChanges();let t=Je.query.card;if(t){for(let n of e.columns){let e=n.cards.find(e=>e.id===t);if(e){zt(n.id,e);break}}qe.replace({query:{...Je.query,card:void 0}})}}),h(()=>{Ye.unsubscribeFromChanges()}),e(()=>Ye.boards.find(e=>e.id===Ke.id),e=>{e&&!Xe.value&&(O.value={...e})});let At=se(()=>O.value?[...O.value.columns].sort((e,t)=>e.order-t.order).map(e=>({...e,cards:[...e.cards].sort((e,t)=>e.order-t.order)})):[]),jt=se(()=>{let e=$e.value.trim().toLowerCase();return e?At.value.map(t=>({...t,cards:t.cards.filter(t=>t.title.toLowerCase().includes(e)||t.markdown&&t.markdown.toLowerCase().includes(e))})):At.value}),Mt=null;function Nt(){O.value&&(Mt&&clearTimeout(Mt),Mt=setTimeout(async()=>{if(!(!O.value||Xe.value)){Xe.value=!0;try{let e=await Ye.update(O.value.id,{columns:O.value.columns});e&&(O.value={...e})}finally{Xe.value=!1}}},300))}function Pt(){if(!O.value||!Ze.value.trim())return;let e={id:lt(),title:Ze.value.trim(),order:O.value.columns.length,cards:[]};O.value.columns=[...O.value.columns,e],Ze.value=``,Qe.value=!1,Nt()}function Ft(e){if(!O.value)return;let t=O.value.columns.find(t=>t.id===e);v.require({message:g(`kanban.board.column.confirmDeleteMessage`,{title:t?.title??``,count:t?.cards.length??0}),header:g(`kanban.board.column.confirmDeleteHeader`),icon:`pi pi-trash`,acceptClass:`p-button-danger`,accept:()=>{O.value&&(O.value.columns=O.value.columns.filter(t=>t.id!==e),Nt())}})}function It(e,t){!O.value||!t.trim()||(O.value.columns=O.value.columns.map(n=>n.id===e?{...n,title:t.trim()}:n),Nt())}function Lt(e){if(!O.value)return;let t=O.value.columns.find(t=>t.id===e);if(!t)return;let n=new Date().toISOString();zt(e,{id:lt(),title:g(`kanban.board.card.defaultTitle`),markdown:``,images:[],order:t.cards.length,history:[{type:`created`,timestamp:n,detail:g(`kanban.board.card.inColumn`,{name:He(e)})}],createdAt:n,updatedAt:n})}function Rt(e){return!e||/^<[a-z][\s\S]*>/i.test(e.trim())?e:m.parse(e,{async:!1})}function zt(e,t){k.value={colId:e,card:{...t,history:[...t.history??[]]}},et.value=t.title,tt.value=Rt(t.markdown),nt.value=[...t.images],re.value=`edit`}function Bt(e){return(e.history??[]).filter(e=>e.type===`conversation_started`||e.type===`scenario_started`).map(e=>{let t=e.detail??``;return t.includes(` — `)?t.split(` — `).pop():t}).filter(Boolean)}function Vt(e){if(j.state.running.some(t=>t.cardId===e.id))return`streaming`;if(j.state.items.some(t=>t.cardId===e.id))return`unread`;let t=Bt(e);return t.some(e=>x.streamingConvIds.has(e))?`streaming`:t.some(e=>x.unreadConvIds.has(e))?`unread`:null}e(re,e=>{(e===`comments`||e===`history`)&&k.value&&Bt(k.value.card).forEach(e=>x.markRead(e))});function Ht(){if(!O.value||!k.value)return;let{colId:e,card:t}=k.value,n=et.value||g(`kanban.board.card.untitled`),r=[...t.history??[]];n!==t.title&&t.title!==g(`kanban.board.card.defaultTitle`)&&r.push({type:`title_changed`,timestamp:new Date().toISOString(),detail:`"${t.title}" → "${n}"`}),tt.value!==t.markdown&&r.push({type:`edited`,timestamp:new Date().toISOString()});let i=nt.value.length-t.images.length;i>0?r.push({type:`image_added`,timestamp:new Date().toISOString(),detail:`${i} image(s) added`}):i<0&&r.push({type:`image_removed`,timestamp:new Date().toISOString(),detail:`${Math.abs(i)} image(s) removed`});let a={...t,title:n,markdown:tt.value,images:nt.value,history:r,updatedAt:new Date().toISOString()};O.value.columns=O.value.columns.map(t=>t.id===e?t.cards.find(e=>e.id===a.id)?{...t,cards:t.cards.map(e=>e.id===a.id?a:e)}:{...t,cards:[...t.cards,a]}:t),k.value=null,Nt()}function Ut(e,t){if(!O.value)return;let n=O.value.columns.find(t=>t.id===e)?.cards.find(e=>e.id===t);v.require({message:g(`kanban.board.editor.confirmDeleteMessage`,{title:n?.title??``}),header:g(`kanban.board.editor.confirmDeleteHeader`),icon:`pi pi-trash`,acceptClass:`p-button-danger`,accept:()=>{O.value&&(O.value.columns=O.value.columns.map(n=>n.id===e?{...n,cards:n.cards.filter(e=>e.id!==t)}:n),k.value=null,Nt())}})}function Wt(e){let t=e.target;if(t.files){for(let e of Array.from(t.files)){if(!e.type.startsWith(`image/`)||e.size>5*1024*1024)continue;let t=new FileReader;t.onload=()=>{typeof t.result==`string`&&(nt.value=[...nt.value,t.result],ne.value?.insertImage(t.result))},t.readAsDataURL(e)}t.value=``}}function Gt(e){v.require({message:g(`kanban.board.editor.confirmRemoveImageMessage`),header:g(`kanban.board.editor.confirmRemoveImageHeader`),icon:`pi pi-trash`,acceptClass:`p-button-danger`,accept:()=>{nt.value=nt.value.filter((t,n)=>n!==e)}})}let Kt=w(null),qt=w(null),Jt=w(!1),Yt=null,Xt=null,Zt=null;function Qt(e,t){Yt&&cancelAnimationFrame(Yt);let n=document.querySelector(`.kb-board`),r=()=>{let i=!1;if(n){let t=n.getBoundingClientRect();e<t.left+ab&&n.scrollLeft>0?(n.scrollLeft-=ob,i=!0):e>t.right-ab&&n.scrollLeft<n.scrollWidth-n.clientWidth&&(n.scrollLeft+=ob,i=!0)}qt.value&&(qt.value.style.display=`none`);let a=document.elementFromPoint(e,t);if(qt.value&&(qt.value.style.display=``),a){let e=a.closest(`.kb-col__cards`);if(e){let n=e.getBoundingClientRect();t<n.top+ab&&e.scrollTop>0?(e.scrollTop-=ob,i=!0):t>n.bottom-ab&&e.scrollTop<e.scrollHeight-e.clientHeight&&(e.scrollTop+=ob,i=!0)}}Yt=i&&Jt.value?requestAnimationFrame(r):null};Yt=requestAnimationFrame(r)}function $t(){Yt&&=(cancelAnimationFrame(Yt),null)}function en(){Xt&&=(clearTimeout(Xt),null),Zt=null}function tn(){if(!Zt)return;let{type:e,colId:t,cardId:n,el:r}=Zt;Kt.value=e,Jt.value=!0,e===`card`&&n?(rt.value={colId:t,cardId:n},A.value=null):(A.value=t,rt.value=null),navigator.vibrate&&navigator.vibrate(30);let i=e===`card`?r.closest(`.kb-card`):r.closest(`.kb-col`);if(i){let e=i.cloneNode(!0);e.style.cssText=`position:fixed;pointer-events:none;z-index:9999;opacity:0.8;width:${i.getBoundingClientRect().width}px;transform:rotate(2deg);`,document.body.appendChild(e),qt.value=e}Zt=null}function nn(e,t,n,r){en();let i=e.touches[0],a=i.clientX,o=i.clientY;Zt={type:t,colId:n,cardId:r,el:e.target};let s=e=>{let t=e.touches[0],n=t.clientX-a,r=t.clientY-o;Math.sqrt(n*n+r*r)>ib&&(en(),document.removeEventListener(`touchmove`,s))};document.addEventListener(`touchmove`,s,{passive:!0}),Xt=setTimeout(()=>{document.removeEventListener(`touchmove`,s),tn()},rb)}function rn(e){if(!Jt.value)return;e.preventDefault();let t=e.touches[0];qt.value&&(qt.value.style.left=`${t.clientX-40}px`,qt.value.style.top=`${t.clientY-20}px`),Qt(t.clientX,t.clientY),qt.value&&(qt.value.style.display=`none`);let n=document.elementFromPoint(t.clientX,t.clientY);if(qt.value&&(qt.value.style.display=``),n){if(Kt.value===`card`){let e=n.closest(`.kb-card`),r=n.closest(`.kb-col`);if(e&&r){let n=e.dataset.cardId||``,i=r.dataset.colId||``;if(n&&i){ut.value=i,dt.value=n;let r=e.getBoundingClientRect();ft.value=t.clientY-r.top<r.height/2?`before`:`after`}}else if(r){let e=r.dataset.colId||``;e&&(ut.value=e,dt.value=null)}}else if(Kt.value===`column`){let e=n.closest(`.kb-col`);if(e){let n=e.dataset.colId||``;if(n&&n!==A.value){pt.value=n;let r=e.getBoundingClientRect();mt.value=t.clientX-r.left<r.width/2?`before`:`after`}}}}}function an(){en(),$t(),qt.value&&=(qt.value.remove(),null),Jt.value&&(Kt.value===`card`&&ut.value?ln(ut.value):Kt.value===`column`&&pt.value&&mn(pt.value)),Kt.value=null,Jt.value=!1,sn()}function on(e,t,n){rt.value={colId:t,cardId:n},A.value=null,e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`type`,`card`))}function sn(){rt.value=null,ut.value=null,dt.value=null,A.value=null,pt.value=null}function cn(e,t,n){if(!rt.value)return;e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),ut.value=t,dt.value=n;let r=e.currentTarget.getBoundingClientRect();ft.value=e.clientY-r.top<r.height/2?`before`:`after`}function ln(e){if(!O.value)return;if(A.value){mn(e);return}if(!rt.value)return;let{colId:t,cardId:n}=rt.value,r=He(t),i=He(e),a=null;if(O.value.columns=O.value.columns.map(e=>e.id===t?(a=e.cards.find(e=>e.id===n)??null,{...e,cards:e.cards.filter(e=>e.id!==n)}):e),a){let n={...a};t!==e&&Ve(n,`moved`,`"${r}" → "${i}"`),O.value.columns=O.value.columns.map(t=>{if(t.id!==e)return t;let r=[...t.cards].sort((e,t)=>e.order-t.order),i=r.length;if(dt.value){let e=r.findIndex(e=>e.id===dt.value);e!==-1&&(i=ft.value===`before`?e:e+1)}return r.splice(i,0,n),{...t,cards:r.map((e,t)=>({...e,order:t}))}})}rt.value=null,ut.value=null,dt.value=null,Nt()}function un(e,t){!rt.value&&!A.value||(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),rt.value&&(ut.value=t,dt.value=null))}function dn(e){ut.value===e&&(ut.value=null)}function fn(e,t){A.value=t,rt.value=null,e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`type`,`column`))}function pn(e,t){if(!A.value||A.value===t)return;e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),pt.value=t;let n=e.currentTarget.getBoundingClientRect();mt.value=e.clientX-n.left<n.width/2?`before`:`after`}function mn(e){if(!O.value||!A.value||A.value===e){A.value=null,pt.value=null;return}let t=[...O.value.columns].sort((e,t)=>e.order-t.order),n=t.findIndex(e=>e.id===A.value),r=t.splice(n,1)[0],i=t.findIndex(t=>t.id===e),a=mt.value===`before`?i:i+1;t.splice(a,0,r),O.value.columns=t.map((e,t)=>({...e,order:t})),A.value=null,pt.value=null,Nt()}return(e,r)=>{let a=c(`tooltip`);return O.value?(n(),C(`div`,bv,[E(`header`,xv,[b(i(o),{icon:`pi pi-arrow-left`,text:``,rounded:``,size:`small`,onClick:r[0]||=e=>i(qe).push(`/kanban`)}),E(`h1`,Sv,T(O.value.name),1),b(i(o),{label:i(g)(`kanban.board.aiPopulate`),icon:`pi pi-sparkles`,severity:`secondary`,outlined:``,size:`small`,onClick:Et},null,8,[`label`]),b(i(o),{label:i(g)(`kanban.board.queue.panelHeader`),icon:`pi pi-list`,severity:`secondary`,outlined:``,size:`small`,badge:i(j).state.items.length+i(j).state.running.length>0?String(i(j).state.items.length+i(j).state.running.length):void 0,"badge-severity":`warn`,onClick:r[1]||=e=>M.value=!M.value},null,8,[`label`,`badge`]),E(`span`,Cv,[r[32]||=E(`i`,{class:`pi pi-search`},null,-1),b(i(ve),{modelValue:$e.value,"onUpdate:modelValue":r[2]||=e=>$e.value=e,placeholder:i(g)(`kanban.board.searchPlaceholder`),size:`small`,class:`kb-header__search-input`},null,8,[`modelValue`,`placeholder`]),$e.value?(n(),xe(i(o),{key:0,icon:`pi pi-times`,text:``,rounded:``,size:`small`,onClick:r[3]||=e=>$e.value=``})):S(``,!0)]),Xe.value?(n(),C(`span`,wv,[r[33]||=E(`i`,{class:`pi pi-spin pi-spinner`,style:{"font-size":`0.75rem`}},null,-1),de(` `+T(i(g)(`kanban.board.saving`)),1)])):S(``,!0)]),E(`div`,Tv,[(n(!0),C(ie,null,u(jt.value,e=>(n(),C(`div`,{key:e.id,class:s([`kb-col`,{"kb-col--dragover":ut.value===e.id&&!!rt.value,"kb-col--dragging":A.value===e.id,"kb-col--col-drop-before":pt.value===e.id&&mt.value===`before`,"kb-col--col-drop-after":pt.value===e.id&&mt.value===`after`}]),"data-col-id":e.id,draggable:`true`,onDragstart:t=>fn(t,e.id),onDragover:t=>{pn(t,e.id),un(t,e.id)},onDragleave:t=>dn(e.id),onDrop:ye(t=>ln(e.id),[`prevent`]),onDragend:sn,onTouchstart:t=>nn(t,`column`,e.id),onTouchmove:rn,onTouchend:an,onContextmenu:r[7]||=ye(()=>{},[`prevent`])},[E(`div`,Dv,[E(`input`,{class:`kb-col__title`,value:e.title,onBlur:t=>It(e.id,t.target.value),onKeyup:r[4]||=_e(e=>e.target.blur(),[`enter`]),onMousedown:r[5]||=ye(()=>{},[`stop`]),draggable:`false`},null,40,Ov),E(`div`,kv,[me(b(i(o),{icon:`pi pi-list`,text:``,rounded:``,size:`small`,onClick:ye(t=>bt(e.id),[`stop`])},null,8,[`onClick`]),[[a,i(g)(`kanban.board.queue.addColumnTooltip`),void 0,{bottom:!0}]]),me(b(i(o),{icon:`pi pi-trash`,text:``,rounded:``,size:`small`,severity:`danger`,onClick:t=>Ft(e.id)},null,8,[`onClick`]),[[a,i(g)(`kanban.board.column.deleteTooltip`),void 0,{bottom:!0}]]),E(`span`,Av,T(e.cards.length),1)])]),E(`div`,jv,[(n(!0),C(ie,null,u(e.cards,t=>(n(),C(`div`,{key:t.id,class:s([`kb-card`,{"kb-card--drop-before":dt.value===t.id&&ft.value===`before`,"kb-card--drop-after":dt.value===t.id&&ft.value===`after`}]),"data-card-id":t.id,draggable:`true`,onDragstart:ye(n=>on(n,e.id,t.id),[`stop`]),onDragover:n=>cn(n,e.id,t.id),onDragend:sn,onTouchstart:ye(n=>nn(n,`card`,e.id,t.id),[`stop`]),onTouchmove:rn,onTouchend:an,onContextmenu:r[6]||=ye(()=>{},[`prevent`]),onClick:n=>zt(e.id,t)},[E(`div`,Nv,[E(`span`,Pv,T(t.title),1),E(`div`,Fv,[me((n(),C(`button`,{class:s([`kb-card__queue-btn`,{"kb-card__queue-btn--active":O.value&&i(j).isCardInQueue(O.value.id,t.id)}]),onClick:ye(e=>P(t),[`stop`])},[...r[34]||=[E(`i`,{class:`pi pi-list`},null,-1)]],10,Iv)),[[a,O.value&&i(j).isCardInQueue(O.value.id,t.id)?i(g)(`kanban.board.queue.tooltipInQueue`):i(g)(`kanban.board.queue.tooltip`),void 0,{bottom:!0}]]),me((n(),C(`button`,{class:`kb-card__delete`,onClick:ye(n=>Ut(e.id,t.id),[`stop`])},[...r[35]||=[E(`i`,{class:`pi pi-times`},null,-1)]],8,Lv)),[[a,i(g)(`kanban.board.card.deleteTooltip`),void 0,{bottom:!0}]])])]),t.markdown||t.images.length||Vt(t)?(n(),C(`div`,Rv,[t.markdown?(n(),C(`i`,zv)):S(``,!0),t.images.length?(n(),C(`span`,Bv,[r[36]||=E(`i`,{class:`pi pi-image`},null,-1),de(` `+T(t.images.length),1)])):S(``,!0),Vt(t)===`streaming`?me((n(),C(`span`,Vv,null,512)),[[a,i(g)(`kanban.board.aiStatus.streaming`),void 0,{bottom:!0}]]):Vt(t)===`unread`?me((n(),C(`span`,Hv,null,512)),[[a,i(g)(`kanban.board.aiStatus.unread`),void 0,{bottom:!0}]]):S(``,!0)])):S(``,!0)],42,Mv))),128)),e.cards.length===0?(n(),C(`div`,Uv,T(i(g)(`kanban.board.column.dropZone`)),1)):S(``,!0)]),E(`button`,{class:`kb-col__add-card`,onClick:t=>Lt(e.id)},[r[37]||=E(`i`,{class:`pi pi-plus`},null,-1),de(` `+T(i(g)(`kanban.board.column.addCard`)),1)],8,Wv)],42,Ev))),128)),E(`div`,Gv,[Qe.value?(n(),C(`div`,Kv,[b(i(ve),{modelValue:Ze.value,"onUpdate:modelValue":r[8]||=e=>Ze.value=e,placeholder:i(g)(`kanban.board.column.titlePlaceholder`),autofocus:``,onKeyup:[_e(Pt,[`enter`]),r[9]||=_e(e=>Qe.value=!1,[`escape`])],class:`w-full`},null,8,[`modelValue`,`placeholder`]),E(`div`,qv,[b(i(o),{label:i(g)(`kanban.board.addColumnButton`),size:`small`,onClick:Pt,disabled:!Ze.value.trim()},null,8,[`label`,`disabled`]),b(i(o),{icon:`pi pi-times`,text:``,size:`small`,onClick:r[10]||=e=>Qe.value=!1})])])):(n(),C(`button`,{key:1,class:`kb-add-col__trigger`,onClick:r[11]||=e=>Qe.value=!0},[r[38]||=E(`i`,{class:`pi pi-plus`},null,-1),de(` `+T(i(g)(`kanban.board.addColumn`)),1)]))])]),b(i(_),{visible:!!k.value,header:i(g)(`kanban.board.editor.header`),modal:!0,style:{width:`750px`},breakpoints:{"800px":`95vw`},"onUpdate:visible":r[18]||=e=>{e||(k.value=null)}},{footer:D(()=>[E(`div`,jy,[b(i(o),{label:i(g)(`actions.cancel`),text:``,onClick:r[17]||=e=>k.value=null},null,8,[`label`]),b(i(o),{label:i(g)(`actions.save`),icon:`pi pi-check`,onClick:Ht},null,8,[`label`])])]),default:D(()=>[k.value?(n(),C(`div`,Jv,[b(i(it),{value:re.value,"onUpdate:value":r[16]||=e=>re.value=e},{default:D(()=>[b(i(at),null,{default:D(()=>[b(i(st),{value:`edit`},{default:D(()=>[r[39]||=E(`i`,{class:`pi pi-pencil`,style:{"margin-right":`0.375rem`}},null,-1),de(T(i(g)(`kanban.board.editor.tabs.edit`)),1)]),_:1}),b(i(st),{value:`comments`},{default:D(()=>[r[40]||=E(`i`,{class:`pi pi-comments`,style:{"margin-right":`0.375rem`}},null,-1),de(T(i(g)(`kanban.board.editor.tabs.comments`,{count:Ie.value.length})),1)]),_:1}),b(i(st),{value:`history`},{default:D(()=>[r[41]||=E(`i`,{class:`pi pi-history`,style:{"margin-right":`0.375rem`}},null,-1),de(T(i(g)(`kanban.board.editor.tabs.history`,{count:k.value.card.history?.length??0})),1)]),_:1})]),_:1}),b(i(ot),null,{default:D(()=>[b(i(ct),{value:`edit`},{default:D(()=>[E(`div`,Yv,[E(`div`,Xv,[E(`label`,Zv,T(i(g)(`kanban.board.editor.titleLabel`)),1),b(i(ve),{modelValue:et.value,"onUpdate:modelValue":r[12]||=e=>et.value=e,autofocus:``,onKeyup:_e(Ht,[`enter`])},null,8,[`modelValue`])]),E(`div`,Qv,[E(`label`,$v,T(i(g)(`kanban.board.editor.contentLabel`)),1),b(yv,{ref_key:`tiptapRef`,ref:ne,modelValue:tt.value,"onUpdate:modelValue":r[13]||=e=>tt.value=e,placeholder:i(g)(`kanban.board.editor.contentPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),E(`div`,ey,[E(`label`,ty,T(i(g)(`kanban.board.editor.imagesLabel`)),1),nt.value.length?(n(),C(`div`,ny,[(n(!0),C(ie,null,u(nt.value,(e,t)=>(n(),C(`div`,{key:t,class:`kb-dialog__thumb`},[E(`img`,{src:e,alt:`attachment`},null,8,ry),E(`button`,{class:`kb-dialog__thumb-remove`,onClick:e=>Gt(t)},[...r[42]||=[E(`i`,{class:`pi pi-times`},null,-1)]],8,iy)]))),128))])):S(``,!0),E(`label`,ay,[r[43]||=E(`i`,{class:`pi pi-upload`},null,-1),de(` `+T(i(g)(`kanban.board.editor.attachImage`))+` `,1),E(`input`,{type:`file`,accept:`image/*`,multiple:``,onChange:Wt},null,32)])]),E(`div`,oy,[E(`label`,sy,T(i(g)(`kanban.board.editor.actionsLabel`)),1),E(`div`,cy,[b(i(o),{label:i(g)(`kanban.board.editor.launchAi`),icon:`pi pi-sparkles`,severity:`secondary`,outlined:``,size:`small`,onClick:je},null,8,[`label`])])]),E(`div`,ly,[b(i(o),{label:i(g)(`kanban.board.editor.deleteCard`),icon:`pi pi-trash`,severity:`danger`,text:``,size:`small`,onClick:r[14]||=e=>Ut(k.value.colId,k.value.card.id)},null,8,[`label`])])])]),_:1}),b(i(ct),{value:`comments`},{default:D(()=>[E(`div`,uy,[E(`div`,dy,[b(i(ve),{modelValue:oe.value,"onUpdate:modelValue":r[15]||=e=>oe.value=e,placeholder:i(g)(`kanban.board.comments.placeholder`),class:`w-full`,onKeyup:_e(Le,[`enter`])},null,8,[`modelValue`,`placeholder`]),b(i(o),{icon:`pi pi-send`,size:`small`,disabled:!oe.value.trim(),onClick:Le},null,8,[`disabled`])]),Ie.value.length?(n(),C(`div`,py,[(n(!0),C(ie,null,u([...Ie.value].reverse(),(e,t)=>(n(),C(`div`,{key:t,class:s([`kb-comments__item`,{"kb-comments__item--ai":e.author===`ai`,"kb-comments__item--clickable":!!e.conversationId}]),onClick:t=>e.conversationId&&Be(e)},[E(`div`,hy,[E(`i`,{class:s(e.author===`ai`?`pi pi-sparkles`:`pi pi-user`)},null,2)]),E(`div`,gy,[E(`div`,_y,[E(`span`,vy,T(e.author===`ai`?i(g)(`kanban.board.comments.authorAi`):i(g)(`kanban.board.comments.authorYou`)),1),E(`span`,yy,T(Ge(e.timestamp)),1)]),E(`div`,{class:`kb-comments__text kb-comments__text--markdown`,innerHTML:p(e.detail)},null,8,by)])],10,my))),128))])):(n(),C(`div`,fy,[r[44]||=E(`i`,{class:`pi pi-comments`},null,-1),E(`span`,null,T(i(g)(`kanban.board.comments.empty`)),1)]))])]),_:1}),b(i(ct),{value:`history`},{default:D(()=>[E(`div`,xy,[k.value.card.history?.length?(n(),C(`div`,Cy,[(n(!0),C(ie,null,u([...k.value.card.history].reverse(),(e,t)=>(n(),C(`div`,{key:t,class:s([`kb-history__item`,{"kb-history__item--clickable":ze(e)}]),onClick:t=>ze(e)&&Be(e)},[E(`div`,Ty,[E(`i`,{class:s(Ue[e.type])},null,2)]),E(`div`,Ey,[E(`span`,Dy,[de(T(We.value[e.type])+` `,1),ze(e)?(n(),C(`i`,Oy)):S(``,!0)]),e.detail?(n(),C(`span`,ky,T(e.detail),1)):S(``,!0),E(`span`,Ay,T(Ge(e.timestamp)),1)])],10,wy))),128))])):(n(),C(`div`,Sy,[r[45]||=E(`i`,{class:`pi pi-clock`},null,-1),E(`span`,null,T(i(g)(`kanban.board.history.empty`)),1)]))])]),_:1})]),_:1})]),_:1},8,[`value`])])):S(``,!0)]),_:1},8,[`visible`,`header`]),b(i(_),{visible:Te.value,header:i(g)(`kanban.board.launchAiDialog.header`),modal:!0,style:{width:`700px`,maxHeight:`80vh`},breakpoints:{"800px":`95vw`},"onUpdate:visible":r[19]||=e=>{e||(Te.value=!1)},pt:{content:{style:`overflow-y:auto`}}},{default:D(()=>[b(ee,{compact:``,onSelectScenario:Me,onSkip:Ne})]),_:1},8,[`visible`,`header`]),b(ce,{ref_key:`launchModalsRef`,ref:Ee,onConfirmScenarioStart:Fe},null,512),b(i(_),{visible:St.value,header:i(g)(`kanban.board.populateDialog.header`),modal:!0,style:{width:`550px`},breakpoints:{"600px":`95vw`},"onUpdate:visible":r[22]||=e=>{e||(St.value=!1)}},{footer:D(()=>[E(`div`,Py,[b(i(o),{label:i(g)(`actions.cancel`),text:``,onClick:r[21]||=e=>St.value=!1},null,8,[`label`]),b(i(o),{label:i(g)(`kanban.board.populateDialog.generate`),icon:`pi pi-sparkles`,onClick:Dt,disabled:!Ct.value.trim()},null,8,[`label`,`disabled`])])]),default:D(()=>[E(`div`,My,[E(`p`,Ny,T(i(g)(`kanban.board.populateDialog.hint`)),1),b(i(he),{modelValue:Ct.value,"onUpdate:modelValue":r[20]||=e=>Ct.value=e,placeholder:i(g)(`kanban.board.populateDialog.placeholder`),autoResize:!0,rows:`4`,class:`w-full`,onKeydown:[_e(ye(Dt,[`ctrl`]),[`enter`]),_e(ye(Dt,[`meta`]),[`enter`])]},null,8,[`modelValue`,`placeholder`,`onKeydown`])])]),_:1},8,[`visible`,`header`]),b(i(_),{visible:F.value,header:i(g)(`kanban.board.populateDialog.header`),modal:!0,style:{width:`700px`,maxHeight:`80vh`},breakpoints:{"800px":`95vw`},"onUpdate:visible":r[23]||=e=>{e||(F.value=!1)},pt:{content:{style:`overflow-y:auto`}}},{default:D(()=>[b(ee,{compact:``,onSelectScenario:kt,onSkip:Ot})]),_:1},8,[`visible`,`header`]),M.value?(n(),C(`div`,Fy,[E(`div`,Iy,[E(`span`,Ly,T(i(g)(`kanban.board.queue.panelHeader`)),1),b(i(o),{icon:`pi pi-times`,text:``,rounded:``,size:`small`,onClick:r[24]||=e=>M.value=!1})]),E(`div`,Ry,[E(`label`,zy,T(i(g)(`kanban.board.queue.concurrency`)),1),E(`div`,By,[b(i(o),{icon:`pi pi-minus`,text:``,rounded:``,size:`small`,disabled:i(j).state.maxConcurrent<=1,onClick:r[25]||=e=>i(j).setMaxConcurrent(i(j).state.maxConcurrent-1)},null,8,[`disabled`]),E(`span`,null,T(i(j).state.maxConcurrent),1),b(i(o),{icon:`pi pi-plus`,text:``,rounded:``,size:`small`,onClick:r[26]||=e=>i(j).setMaxConcurrent(i(j).state.maxConcurrent+1)})])]),i(j).state.running.length>0?(n(),C(`div`,Vy,[E(`div`,Hy,T(i(g)(`kanban.board.queue.runningSection`,{count:i(j).state.running.length})),1),(n(!0),C(ie,null,u(i(j).state.running.filter(e=>e.boardId===O.value?.id),e=>(n(),C(`div`,{key:e.id,class:`kb-queue-item kb-queue-item--running`},[r[46]||=E(`i`,{class:`pi pi-spin pi-spinner`},null,-1),E(`span`,Uy,T(O.value?.columns.flatMap(e=>e.cards).find(t=>t.id===e.cardId)?.title??e.cardId),1),b(i(o),{icon:`pi pi-stop`,text:``,rounded:``,size:`small`,severity:`danger`,onClick:t=>i(j).removeItem(e.id)},null,8,[`onClick`])]))),128))])):S(``,!0),i(j).state.items.length>0?(n(),C(`div`,Wy,[E(`div`,Gy,T(i(g)(`kanban.board.queue.waitingSection`,{count:i(j).state.items.length})),1),(n(!0),C(ie,null,u(i(j).state.items.filter(e=>e.boardId===O.value?.id),e=>(n(),C(`div`,{key:e.id,class:`kb-queue-item`},[r[47]||=E(`i`,{class:`pi pi-clock`},null,-1),E(`span`,Ky,T(O.value?.columns.flatMap(e=>e.cards).find(t=>t.id===e.cardId)?.title??e.cardId),1),b(i(o),{icon:`pi pi-times`,text:``,rounded:``,size:`small`,onClick:t=>i(j).removeItem(e.id)},null,8,[`onClick`])]))),128))])):S(``,!0),i(j).state.items.length===0&&i(j).state.running.length===0?(n(),C(`div`,qy,T(i(g)(`kanban.board.queue.empty`)),1)):S(``,!0),E(`div`,Jy,[b(i(o),{label:i(g)(`kanban.board.queue.stopAll`),icon:`pi pi-stop`,severity:`danger`,text:``,size:`small`,disabled:i(j).state.items.length===0&&i(j).state.running.length===0,onClick:r[27]||=e=>i(j).stopAll()},null,8,[`label`,`disabled`])])])):S(``,!0),b(i(_),{visible:gt.value,header:i(g)(`kanban.board.queue.addColumnDialog.header`),modal:!0,style:{width:`420px`},"onUpdate:visible":r[31]||=e=>{e||(gt.value=!1)}},{footer:D(()=>[E(`div`,nb,[b(i(o),{label:i(g)(`actions.cancel`),text:``,onClick:r[30]||=e=>gt.value=!1},null,8,[`label`]),b(i(o),{label:i(g)(`kanban.board.queue.addColumnDialog.confirm`),icon:`pi pi-list`,onClick:xt},null,8,[`label`])])]),default:D(()=>[E(`div`,Yy,[E(`div`,Xy,[E(`label`,null,T(i(g)(`kanban.board.queue.addColumnDialog.runner`)),1),me(E(`select`,{"onUpdate:modelValue":r[28]||=e=>vt.value=e,class:`kb-queue-col-dialog__select`},[r[48]||=E(`option`,{value:``},`Auto`,-1),E(`option`,{value:`claude-code`,disabled:!i(le)},`Claude Code`+T(i(le)?``:` (non installé)`),9,Zy),E(`option`,{value:`codex`,disabled:!i(pe)},`Codex`+T(i(pe)?``:` (non installé)`),9,Qy)],512),[[t,vt.value]])]),E(`div`,$y,[E(`label`,null,T(i(g)(`kanban.board.queue.addColumnDialog.scenario`)),1),me(E(`select`,{"onUpdate:modelValue":r[29]||=e=>N.value=e,class:`kb-queue-col-dialog__select`},[E(`option`,eb,T(i(g)(`kanban.board.queue.addColumnDialog.noScenario`)),1),(n(!0),C(ie,null,u(yt.value,e=>(n(),C(`option`,{key:e.id,value:e.id},T(e.name),9,tb))),128))],512),[[t,N.value]])])])]),_:1},8,[`visible`,`header`])])):S(``,!0)}}}),[[`__scopeId`,`data-v-9991ce20`]]);export{sb as default};