opencode-board 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dbpolito
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,100 @@
1
- # Temporary Holding Version
1
+ # OpenCode Board
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A Kanban board for OpenCode Desktop, using native components and theme colors. Targets `@opencode/plugin` 2.2.0; the GUI plugin API is experimental.
4
+
5
+ ## Install
6
+
7
+ Add the package to `plugins` in your global `~/.config/opencode/opencode.jsonc`, preserving your existing settings:
8
+
9
+ ```jsonc
10
+ {
11
+ "$schema": "https://opencode.ai/config.json",
12
+ "plugins": ["opencode-board"]
13
+ }
14
+ ```
15
+
16
+ OpenCode installs the package and loads its Desktop GUI. This plugin does not add a CLI/TUI interface.
17
+
18
+ ## Local development setup
19
+
20
+ ```sh
21
+ bun install
22
+ bun run build
23
+ ```
24
+
25
+ Add this directory to `plugins` in your global `~/.config/opencode/opencode.jsonc`, preserving your existing settings:
26
+
27
+ ```jsonc
28
+ {
29
+ "$schema": "https://opencode.ai/config.json",
30
+ "plugins": ["/absolute/path/to/opencode-board"]
31
+ }
32
+ ```
33
+
34
+ Local builds reload the plugin automatically. Use `bun run dev` to rebuild on changes.
35
+
36
+ ## Open the board
37
+
38
+ In an existing session, click the **Kanban icon and card count** on the right of the session header. The count includes every card in the global board, across projects and servers, and updates as tasks change. An ellipsis appears while storage loads.
39
+
40
+ You can also use **Kanban: Open task board** in the command palette, `/kanban`, or **Task board** in the side-panel **+** menu. Drag the board tab below the chat for more horizontal room.
41
+
42
+ ## Tasks and columns
43
+
44
+ - Create tasks from **New task** or the **+** in a column header.
45
+ - Edit titles, Markdown descriptions, labels, and status. Cards show excerpts and checklist progress. Click checkboxes directly in the rendered description to update and save the Markdown (`- [ ]` / `- [x]`).
46
+ - One global board: projects are optional task fields, not separate boards. Assign a project in the editor, then filter by **All projects**, a specific project, or **No project**. Project choices include only projects with open root-directory session tabs, excluding worktree tabs. Labels use OpenCode's project display name, falling back to the folder name when unnamed. Closing a project's last root session removes it from the picker, not from existing tasks. New tasks default to the filtered project, or the currently open project when viewing all projects.
47
+ - Search or filter by label and project. Clear filters before dragging.
48
+ - Drag whole cards to reorder them or move between columns. Drag column titles to reorder columns. Changes save on drop; Escape cancels.
49
+ - Add, rename, recolor, or collapse columns. Deleting a populated column requires moving its tasks; the last column cannot be deleted.
50
+ - Choose **Overlay**, **Split**, or **Full** from the task-layout menu. Overlay and Split widths are resizable and saved separately. The focused resize divider also supports arrows, Shift, Home, End, and double-click reset.
51
+ - A very subtle theme-colored backdrop covers the task panel's content area, including its search and filters, behind an open Overlay. Clicking it closes the Overlay without activating the control underneath. Interacting with the composer or the rest of OpenCode leaves task details open. Task menus and confirmation dialogs stay interactive; Split and Full views have no backdrop.
52
+
53
+ Session linking is optional, and each task can have multiple linked sessions. **Start session** creates and adds a session, then immediately sends only the card title and description to begin work. **Link current session** adds an existing session without duplicates. Each linked title opens its session; its unlink icon removes only that link. Cards show the session count and animate when any linked session is running. Selection remains static, and reduced-motion preferences disable rotation. Task status is always manual. Existing single-session links remain available.
54
+
55
+ The Delete icon sits beside Edit in task details. Deleting requires confirmation and does not delete linked sessions.
56
+
57
+ Starting a session uses the task's assigned project and server. Tasks without a project use the currently open session's directory and server. Linked sessions retain their own server, even when you change a task's project.
58
+
59
+ ## Persistence
60
+
61
+ The board and view preferences use OpenCode's global plugin storage, shared across projects, servers, sessions, and windows in this local app installation. This does not sync to other machines. Tasks survive reloads; there is no automatic clearing or import from former workspace stores. The package is named `opencode-board`; existing global board data and layout preferences are imported once from the former `opencode-desktop-showcase` namespace when the new namespace has no saved value.
62
+
63
+ ## Development
64
+
65
+ ```sh
66
+ bun run check
67
+ ```
68
+
69
+ Runs TypeScript checks, builds `dist/gui-experimental.cjs`, and runs board-model, Markdown/checklist, storage, and bundle-registration tests. Tests do not verify Desktop rendering or pointer geometry; check those in OpenCode Desktop.
70
+
71
+ Source files live under `src/gui/`: `window.tsx` registers the board, `board-shortcut.tsx` provides the header action, `kanban-storage.ts` shares global storage, and `kanban.tsx`, `task-detail.tsx`, `resizable-detail.tsx`, and `kanban.css` implement the UI.
72
+
73
+ Reference: [OpenCode V2 GUI plugin documentation](https://opencode.ai/v2/docs/build/plugins/gui).
74
+
75
+ ## Publishing
76
+
77
+ The `prepublishOnly` hook runs type checks, builds the GUI bundle, and runs the tests before publishing. The package includes the built bundle, README, package metadata, and MIT license.
78
+
79
+ For the first release (`0.1.0`):
80
+
81
+ ```sh
82
+ npm login
83
+ npm publish
84
+ ```
85
+
86
+ For subsequent releases, increment the version, validate the package, commit and tag the release, then publish:
87
+
88
+ ```sh
89
+ npm version patch --no-git-tag-version
90
+ npm publish --dry-run
91
+ git add package.json
92
+ git commit -m "Release next version"
93
+ git tag -a "v$(node -p 'require("./package.json").version')" -m "Release"
94
+ git push --follow-tags
95
+ npm publish
96
+ ```
97
+
98
+ ## License
99
+
100
+ [MIT](LICENSE)
@@ -0,0 +1,139 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Ce=require("@opencode/plugin/gui"),d=require("solid-js/web"),_=require("solid-js"),W=require("effect");var Cu=d.template('<svg width=16 height=16 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.25 aria-hidden=true><rect x=1.5 y=2.5 width=13 height=11 rx=2></rect><path d="M6 2.5v11M10 2.5v11M3.5 5h.5M3.5 7h.5M8 5h.5M12 5h.5M12 7h.5M12 9h.5">'),Pu=d.template("<span class=sc-board-count>"),Eu=d.template('<span class="sc-root sc-board-shortcut">');function Au(e){const t=Ce.usePlugin(),n=t.ui,r=()=>e.board.ready()?e.board.value?.cards.length:void 0,i=()=>r()===void 0?"Open task board":`Open task board · ${r()} ${r()===1?"card":"cards"}`;return(()=>{var s=Eu();return d.insert(s,d.createComponent(n.Tooltip,{get value(){return i()},get children(){return d.createComponent(n.Button,{size:"small",variant:"ghost-muted",get"aria-label"(){return i()},onClick:()=>t.layout.open(`${t.id}:kanban`,e.session,{tab:"select"}),get children(){return[Cu(),(()=>{var a=Pu();return d.insert(a,()=>r()??"…"),a})()]}})}})),s})()}var Ou=Symbol.for("preact-signals");function wi(){if(lt>1)lt--;else{var e,t=!1;for((function(){var i=si;for(si=void 0;i!==void 0;){var s=i.S;if(s.v===i.v)for(var a=s.t;a!==void 0;a=a.x)a.i===i.i&&(a.i=s.i);i=i.o}})();ir!==void 0;){var n=ir;for(ir=void 0,ii++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Za(n))try{n.c()}catch(i){t||(e=i,t=!0)}n=r}}if(ii=0,lt--,t)throw e}}function ae(e){if(lt>0)return e();ns=++Du,lt++;try{return e()}finally{wi()}}var rr,te=void 0;function q(e){var t=te,n=rr;te=void 0,rr=void 0;try{return e()}finally{te=t,rr=n}}var ir=void 0,lt=0,ii=0,Du=0,ns=0,si=void 0,oi=0;function Ga(e){if(te!==void 0){var t=e.n;if(t===void 0||t.t!==te)return t={i:0,S:e,p:te.s,n:void 0,t:te,e:void 0,x:void 0,r:t},te.s!==void 0&&(te.s.n=t),te.s=t,e.n=t,32&te.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=te.s,t.n=void 0,te.s.n=t,te.s=t),t}}function Se(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Se.prototype.brand=Ou;Se.prototype.h=function(){return!0};Se.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:q(function(){var r;(r=t.W)==null||r.call(t)}))};Se.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&q(function(){var i;(i=t.Z)==null||i.call(t)}))}};Se.prototype.subscribe=function(e){var t=this;return Re(function(){var n=t.value;q(function(){return e(n)})},{name:"sub"})};Se.prototype.valueOf=function(){return this.value};Se.prototype.toString=function(){return this.value+""};Se.prototype.toJSON=function(){return this.value};Se.prototype.peek=function(){var e=this;return q(function(){return e.value})};Object.defineProperty(Se.prototype,"value",{get:function(){var e=Ga(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ii>100)throw new Error("Cycle detected");(function(n){lt!==0&&ii===0&&n.l!==ns&&(n.l=ns,si={S:n,v:n.v,i:n.i,o:si})})(this),this.v=e,this.i++,oi++,lt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{wi()}}}});function $t(e,t){return new Se(e,t)}function Za(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Qa(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ja(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Xt(e,t){Se.call(this,void 0,t),this.x=e,this.s=void 0,this.g=oi-1,this.f=4}Xt.prototype=new Se;Xt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===oi))return!0;if(this.g=oi,this.f|=1,this.i>0&&!Za(this))return this.f&=-2,!0;var e=te;try{Qa(this),te=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return te=e,Ja(this),this.f&=-2,!0};Xt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Se.prototype.S.call(this,e)};Xt.prototype.U=function(e){if(this.t!==void 0&&(Se.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Xt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Xt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ga(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Qo(e,t){return new Xt(e,t)}function el(e){var t=e.j;if(e.j=void 0,typeof t=="function"){lt++;var n=te;te=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,js(e),r}finally{te=n,wi()}}}function js(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,el(e)}function Tu(e){if(te!==this)throw new Error("Out-of-order effect");Ja(this),te=e,this.f&=-2;try{8&this.f&&js(this)}finally{wi()}}function wn(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,rr&&rr.push(this)}wn.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.j=t)}finally{e()}};wn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,el(this),Qa(this),lt++;var e=te;return te=this,Tu.bind(this,e)};wn.prototype.N=function(){2&this.f||(this.f|=2,this.u=ir,ir=this)};wn.prototype.d=function(){this.f|=8,1&this.f||js(this)};wn.prototype.dispose=function(){this.d()};function Re(e,t){var n=new wn(e,t);try{n.c()}catch(i){throw n.d(),i}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Iu=Object.create,Bs=Object.defineProperty,Ru=Object.defineProperties,Mu=Object.getOwnPropertyDescriptor,zu=Object.getOwnPropertyDescriptors,Jo=Object.getOwnPropertySymbols,Lu=Object.prototype.hasOwnProperty,Wu=Object.prototype.propertyIsEnumerable,ju=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),kn=e=>{throw TypeError(e)},rs=(e,t,n)=>t in e?Bs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bu=(e,t)=>{for(var n in t||(t={}))Lu.call(t,n)&&rs(e,n,t[n]);if(Jo)for(var n of Jo(t))Wu.call(t,n)&&rs(e,n,t[n]);return e},Nu=(e,t)=>Ru(e,zu(t)),ea=(e,t)=>Bs(e,"name",{value:t,configurable:!0}),Fu=e=>{var t;return[,,,Iu((t=void 0)!=null?t:null)]},tl=["class","method","getter","setter","accessor","field","value","get","set"],Bn=e=>e!==void 0&&typeof e!="function"?kn("Function expected"):e,qu=(e,t,n,r,i)=>({kind:tl[e],name:t,metadata:r,addInitializer:s=>n._?kn("Already initialized"):i.push(Bn(s||null))}),nl=(e,t)=>rs(t,ju("metadata"),e[3]),Ct=(e,t,n,r)=>{for(var i=0,s=e[t>>1],a=s&&s.length;i<a;i++)t&1?s[i].call(n):r=s[i].call(n,r);return r},_n=(e,t,n,r,i,s)=>{var a,o,l,c,u,h=t&7,p=!!(t&8),f=!!(t&16),g=h>3?e.length+1:h?p?1:2:0,b=tl[h+5],y=h>3&&(e[g-1]=[]),x=e[g]||(e[g]=[]),m=h&&(!f&&!p&&(i=i.prototype),h<5&&(h>3||!f)&&Mu(h<4?i:{get[n](){return We(this,s)},set[n](w){return mt(this,s,w)}},n));h?f&&h<4&&ea(s,(h>2?"set ":h>1?"get ":"")+n):ea(i,n);for(var v=r.length-1;v>=0;v--)c=qu(h,n,l={},e[3],x),h&&(c.static=p,c.private=f,u=c.access={has:f?w=>Vu(i,w):w=>n in w},h^3&&(u.get=f?w=>(h^1?We:Xu)(w,i,h^4?s:m.get):w=>w[n]),h>2&&(u.set=f?(w,k)=>mt(w,i,k,h^4?s:m.set):(w,k)=>w[n]=k)),o=(0,r[v])(h?h<4?f?s:m[b]:h>4?void 0:{get:m.get,set:m.set}:i,c),l._=1,h^4||o===void 0?Bn(o)&&(h>4?y.unshift(o):h?f?s=o:m[b]=o:i=o):typeof o!="object"||o===null?kn("Object expected"):(Bn(a=o.get)&&(m.get=a),Bn(a=o.set)&&(m.set=a),Bn(a=o.init)&&y.unshift(a));return h||nl(e,i),m&&Bs(i,n,m),f?h^4?s:m:i},Ns=(e,t,n)=>t.has(e)||kn("Cannot "+n),Vu=(e,t)=>Object(t)!==t?kn('Cannot use the "in" operator on this value'):e.has(t),We=(e,t,n)=>(Ns(e,t,"read from private field"),n?n.call(e):t.get(e)),Nn=(e,t,n)=>t.has(e)?kn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),mt=(e,t,n,r)=>(Ns(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Xu=(e,t,n)=>(Ns(e,t,"access private method"),n);function is(e,t){if(t){let n;return Qo(()=>{const r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return Qo(e)}function ss(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e=="function"&&typeof t=="function")return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((r,i)=>!ss(r,t[i]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:!n.some(s=>!ss(e[s],t[s]))}return!1}function U({get:e},t){return{init(n){return $t(n)},get(){return e.call(this).value},set(n){const r=e.call(this);r.peek()!==n&&(r.value=n)}}}function pe(e,t){const n=new WeakMap;return function(){let r=n.get(this);return r||(r=is(e.bind(this)),n.set(this,r)),r.value}}function qi(e=!0){return function(t,n){n.addInitializer(function(){const r=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),i=Object.getOwnPropertyDescriptor(r,n.name);i&&Object.defineProperty(r,n.name,Nu(Bu({},i),{enumerable:e}))})}}function xr(...e){const t=e.map(n=>Re(n));return()=>t.forEach(n=>n())}var rl,il,sl,ol,al,ll,we,Fs,Vi,os,as,ye,qs,Xi,cl,ls,Vs,Hi,cs,us;ll=[U],al=[U],ol=[U],sl=[qi()],il=[qi()],rl=[qi()];var Sn=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Ct(we,5,this),Nn(this,ye),Nn(this,Fs,Ct(we,8,this)),Ct(we,11,this),Nn(this,qs,Ct(we,12,this)),Ct(we,15,this),Nn(this,Vs,Ct(we,16,this)),Ct(we,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return We(this,ye,cs)}get initial(){return We(this,ye,os)}get previous(){return We(this,ye,cl)}set current(e){const t=q(()=>We(this,ye,cs));e&&t&&this.equals(t,e)||ae(()=>{We(this,ye,os)||mt(this,ye,e,as),mt(this,ye,t,ls),mt(this,ye,e,us)})}reset(e=this.defaultValue){ae(()=>{mt(this,ye,void 0,ls),mt(this,ye,e,as),mt(this,ye,e,us)})}};we=Fu();Fs=new WeakMap;ye=new WeakSet;qs=new WeakMap;Vs=new WeakMap;Vi=_n(we,20,"#initial",ll,ye,Fs),os=Vi.get,as=Vi.set;Xi=_n(we,20,"#previous",al,ye,qs),cl=Xi.get,ls=Xi.set;Hi=_n(we,20,"#current",ol,ye,Vs),cs=Hi.get,us=Hi.set;_n(we,2,"current",sl,Sn);_n(we,2,"initial",il,Sn);_n(we,2,"previous",rl,Sn);nl(we,Sn);function Ui(e){return q(()=>{const t={};for(const n in e)t[n]=e[n];return t})}var Ot,Hu=class{constructor(){Nn(this,Ot,new WeakMap)}get(e,t){var n;return e?(n=We(this,Ot).get(e))==null?void 0:n.get(t):void 0}set(e,t,n){var r;if(e)return We(this,Ot).has(e)||We(this,Ot).set(e,new Map),(r=We(this,Ot).get(e))==null?void 0:r.set(t,n)}clear(e){var t;return e?(t=We(this,Ot).get(e))==null?void 0:t.clear():void 0}};Ot=new WeakMap;var Uu=Object.create,ul=Object.defineProperty,Ku=Object.getOwnPropertyDescriptor,ta=Object.getOwnPropertySymbols,Yu=Object.prototype.hasOwnProperty,Gu=Object.prototype.propertyIsEnumerable,dl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ki=e=>{throw TypeError(e)},na=Math.pow,ds=(e,t,n)=>t in e?ul(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zu=(e,t)=>{for(var n in t||(t={}))Yu.call(t,n)&&ds(e,n,t[n]);if(ta)for(var n of ta(t))Gu.call(t,n)&&ds(e,n,t[n]);return e},Qu=e=>{var t;return[,,,Uu((t=e?.[dl("metadata")])!=null?t:null)]},hl=["class","method","getter","setter","accessor","field","value","get","set"],pl=e=>e!==void 0&&typeof e!="function"?ki("Function expected"):e,Ju=(e,t,n,r,i)=>({kind:hl[e],name:t,metadata:r,addInitializer:s=>n._?ki("Already initialized"):i.push(pl(s||null))}),ed=(e,t)=>ds(t,dl("metadata"),e[3]),td=(e,t,n,r)=>{for(var i=0,s=e[t>>1],a=s&&s.length;i<a;i++)s[i].call(n);return r},fl=(e,t,n,r,i,s)=>{for(var a,o,l,c,u=t&7,h=!1,p=!1,f=2,g=hl[u+5],b=e[f]||(e[f]=[]),y=(i=i.prototype,Ku(i,n)),x=r.length-1;x>=0;x--)l=Ju(u,n,o={},e[3],b),l.static=h,l.private=p,c=l.access={has:m=>n in m},c.get=m=>m[n],a=(0,r[x])(y[g],l),o._=1,pl(a)&&(y[g]=a);return y&&ul(i,n,y),i},gl=(e,t,n)=>t.has(e)||ki("Cannot "+n),nd=(e,t,n)=>(gl(e,t,"read from private field"),t.get(e)),rd=(e,t,n)=>t.has(e)?ki("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),id=(e,t,n,r)=>(gl(e,t,"write to private field"),t.set(e,n),n),je=class hs{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new hs(t.x-n.x,t.y-n.y)}static distance(t,n){return Math.hypot(t.x-n.x,t.y-n.y)}static equals(t,n){return t.x===n.x&&t.y===n.y}static from({x:t,y:n}){return new hs(t,n)}},Je=class Dt{constructor(t,n,r,i){this.left=t,this.top=n,this.width=r,this.height=i,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){const{top:r,left:i,width:s,height:a,scale:o}=this,l=new Dt(i+t,r+n,s,a);return l.scale=Zu({},o),l}get boundingRectangle(){const{width:t,height:n,left:r,top:i,right:s,bottom:a}=this;return{width:t,height:n,left:r,top:i,right:s,bottom:a}}get center(){const{left:t,top:n,right:r,bottom:i}=this;return new je((t+r)/2,(n+i)/2)}get area(){const{width:t,height:n}=this;return t*n}equals(t){if(!(t instanceof Dt))return!1;const{left:n,top:r,width:i,height:s}=this;return n===t.left&&r===t.top&&i===t.width&&s===t.height}containsPoint(t){const{top:n,left:r,bottom:i,right:s}=this;return n<=t.y&&t.y<=i&&r<=t.x&&t.x<=s}intersectionArea(t){return t instanceof Dt?sd(this,t):0}intersectionRatio(t){const{area:n}=this,r=this.intersectionArea(t);return r/(t.area+n-r)}get bottom(){const{top:t,height:n}=this;return t+n}get right(){const{left:t,width:n}=this;return t+n}get aspectRatio(){const{width:t,height:n}=this;return t/n}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new Dt(n,t,r,i)}static delta(t,n,r={x:"center",y:"center"}){const i=(s,a)=>{const o=r[a],l=a==="x"?s.left:s.top,c=a==="x"?s.width:s.height;return o=="start"?l:o=="end"?l+c:l+c/2};return je.delta({x:i(t,"x"),y:i(t,"y")},{x:i(n,"x"),y:i(n,"y")})}static intersectionRatio(t,n){return Dt.from(t).intersectionRatio(Dt.from(n))}};function sd(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=i-r,o=s-n;return r<i&&n<s?a*o:0}var vl,ml,ps,Yr,wr,_i=class extends(ps=Sn,ml=[pe],vl=[pe],ps){constructor(e){const t=je.from(e);super(t,(n,r)=>je.equals(n,r)),td(wr,5,this),rd(this,Yr,0),this.velocity={x:0,y:0}}get delta(){return je.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up"}get current(){return super.current}set current(e){const{current:t}=this,n=je.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),s=i-nd(this,Yr),a=o=>Math.round(o/s*100);ae(()=>{id(this,Yr,i),this.velocity={x:a(r.x),y:a(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(je.from(e)),this.velocity={x:0,y:0}}};wr=Qu(ps);Yr=new WeakMap;fl(wr,2,"delta",ml,_i);fl(wr,2,"direction",vl,_i);ed(wr,_i);function fs({x:e,y:t},n){const r=Math.abs(e),i=Math.abs(t);return typeof n=="number"?Math.sqrt(na(r,2)+na(i,2))>n:"x"in n&&"y"in n?r>n.x&&i>n.y:"x"in n?r>n.x:"y"in n?i>n.y:!1}var bl=(e=>(e.Horizontal="x",e.Vertical="y",e))(bl||{}),yl=Object.values(bl),od=Object.create,Xs=Object.defineProperty,ad=Object.defineProperties,ld=Object.getOwnPropertyDescriptor,cd=Object.getOwnPropertyDescriptors,ai=Object.getOwnPropertySymbols,xl=Object.prototype.hasOwnProperty,wl=Object.prototype.propertyIsEnumerable,kl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),$n=e=>{throw TypeError(e)},gs=(e,t,n)=>t in e?Xs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hs=(e,t)=>{for(var n in t||(t={}))xl.call(t,n)&&gs(e,n,t[n]);if(ai)for(var n of ai(t))wl.call(t,n)&&gs(e,n,t[n]);return e},Us=(e,t)=>ad(e,cd(t)),ra=(e,t)=>Xs(e,"name",{value:t,configurable:!0}),_l=(e,t)=>{var n={};for(var r in e)xl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ai)for(var r of ai(e))t.indexOf(r)<0&&wl.call(e,r)&&(n[r]=e[r]);return n},Cn=e=>{var t;return[,,,od((t=e?.[kl("metadata")])!=null?t:null)]},Sl=["class","method","getter","setter","accessor","field","value","get","set"],Fn=e=>e!==void 0&&typeof e!="function"?$n("Function expected"):e,ud=(e,t,n,r,i)=>({kind:Sl[e],name:t,metadata:r,addInitializer:s=>n._?$n("Already initialized"):i.push(Fn(s||null))}),Ht=(e,t)=>gs(t,kl("metadata"),e[3]),z=(e,t,n,r)=>{for(var i=0,s=e[t>>1],a=s&&s.length;i<a;i++)t&1?s[i].call(n):r=s[i].call(n,r);return r},K=(e,t,n,r,i,s)=>{var a,o,l,c,u,h=t&7,p=!!(t&8),f=!!(t&16),g=h>3?e.length+1:h?p?1:2:0,b=Sl[h+5],y=h>3&&(e[g-1]=[]),x=e[g]||(e[g]=[]),m=h&&(!f&&!p&&(i=i.prototype),h<5&&(h>3||!f)&&ld(h<4?i:{get[n](){return le(this,s)},set[n](w){return De(this,s,w)}},n));h?f&&h<4&&ra(s,(h>2?"set ":h>1?"get ":"")+n):ra(i,n);for(var v=r.length-1;v>=0;v--)c=ud(h,n,l={},e[3],x),h&&(c.static=p,c.private=f,u=c.access={has:f?w=>dd(i,w):w=>n in w},h^3&&(u.get=f?w=>(h^1?le:$l)(w,i,h^4?s:m.get):w=>w[n]),h>2&&(u.set=f?(w,k)=>De(w,i,k,h^4?s:m.set):(w,k)=>w[n]=k)),o=(0,r[v])(h?h<4?f?s:m[b]:h>4?void 0:{get:m.get,set:m.set}:i,c),l._=1,h^4||o===void 0?Fn(o)&&(h>4?y.unshift(o):h?f?s=o:m[b]=o:i=o):typeof o!="object"||o===null?$n("Object expected"):(Fn(a=o.get)&&(m.get=a),Fn(a=o.set)&&(m.set=a),Fn(a=o.init)&&y.unshift(a));return h||Ht(e,i),m&&Xs(i,n,m),f?h^4?s:m:i},Ks=(e,t,n)=>t.has(e)||$n("Cannot "+n),dd=(e,t)=>Object(t)!==t?$n('Cannot use the "in" operator on this value'):e.has(t),le=(e,t,n)=>(Ks(e,t,"read from private field"),n?n.call(e):t.get(e)),Z=(e,t,n)=>t.has(e)?$n("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),De=(e,t,n,r)=>(Ks(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),$l=(e,t,n)=>(Ks(e,t,"access private method"),n);function Cl(e,t){return{plugin:e,options:t}}function kr(e){return t=>Cl(e,t)}function ur(e){return typeof e=="function"?{plugin:e,options:void 0}:e}var Pl,dr,Ys,Gr;Pl=[U];var xe=class{constructor(e,t){this.manager=e,this.options=t,Z(this,Ys,z(dr,8,this,!1)),z(dr,11,this),Z(this,Gr,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return q(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){const t=Re(e.bind(this));return le(this,Gr).add(t),t}destroy(){le(this,Gr).forEach(e=>e())}static configure(e){return Cl(this,e)}};dr=Cn(null);Ys=new WeakMap;Gr=new WeakMap;K(dr,4,"disabled",Pl,xe,Ys);Ht(dr,xe);var _r=class extends xe{},Zr,Ki=class{constructor(e){this.manager=e,this.instances=new Map,Z(this,Zr,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(ur).reduce((r,i)=>{const s=r.find(({plugin:a})=>a===i.plugin);return s?(s.options=i.options,r):[...r,i]},[]),n=t.map(({plugin:r})=>r);for(const r of le(this,Zr))if(!n.includes(r)){if(r.prototype instanceof _r)continue;this.unregister(r)}for(const{plugin:r,options:i}of t)this.register(r,i);De(this,Zr,n)}get(e){return this.instances.get(e)}register(e,t){const n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;const r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){const t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(const e of this.instances.values())e.destroy();this.instances.clear()}};Zr=new WeakMap;function hd(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Lr=[],nn,rn,pd=class extends xe{constructor(e){super(e),Z(this,nn),Z(this,rn),this.computeCollisions=this.computeCollisions.bind(this),De(this,rn,$t(Lr)),this.destroy=xr(()=>{const t=this.computeCollisions(),n=q(()=>this.manager.dragOperation.position.current);if(t!==Lr){const r=le(this,nn);if(De(this,nn,n),r&&n.x==r.x&&n.y==r.y)return}else De(this,nn,void 0);le(this,rn).value=t},()=>{const{dragOperation:t}=this.manager;t.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){q(()=>{e?le(this,rn).value=this.computeCollisions():De(this,nn,void 0)})}computeCollisions(e,t){const{registry:n,dragOperation:r}=this.manager,{source:i,shape:s,status:a}=r;if(!a.initialized||!s)return Lr;const o=[],l=[];for(const c of e??n.droppables){if(c.disabled||i&&!c.accepts(i))continue;const u=t??c.collisionDetector;if(!u)continue;l.push(c),c.shape;const h=q(()=>u({droppable:c,dragOperation:r}));h&&(c.collisionPriority!=null&&(h.priority=c.collisionPriority),o.push(h))}return l.length===0?Lr:(o.sort(hd),o)}get collisions(){return le(this,rn).value}};nn=new WeakMap;rn=new WeakMap;var El,Al,Ol,Gs,Dl,qe,Zs,un,Qs,Js;Ol=[U],Al=[U],El=[U];var ct=class Tt{constructor(t,n){Z(this,Zs,z(qe,8,this)),z(qe,11,this),Z(this,un),Z(this,Qs,z(qe,12,this)),z(qe,15,this),Z(this,Js,z(qe,16,this)),z(qe,19,this);const{effects:r,id:i,data:s={},disabled:a=!1,register:o=!0}=t;let l=i;De(this,un,$t(i)),this.manager=n,this.data=s,this.disabled=a,this.effects=()=>{var c;return[()=>{const{id:u,manager:h}=this;if(u!==l)return l=u,h?.registry.register(this),()=>h?.registry.unregister(this)},...(c=r?.())!=null?c:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),n&&o&&queueMicrotask(this.register)}get id(){var t,n;const r=le(this,un).value;return(n=(t=Tt.pendingIdChanges)==null?void 0:t.get(this))!=null?n:r}set id(t){var n,r;const i=(r=(n=Tt.pendingIdChanges)==null?void 0:n.get(this))!=null?r:le(this,un).peek();t!==i&&(Tt.pendingIdChanges||(Tt.pendingIdChanges=new Map,queueMicrotask(()=>{var s;return $l(s=Tt,Gs,Dl).call(s)})),Tt.pendingIdChanges.set(this,t))}register(){var t;return(t=this.manager)==null?void 0:t.registry.register(this)}unregister(){var t;(t=this.manager)==null||t.registry.unregister(this)}destroy(){var t;(t=this.manager)==null||t.registry.unregister(this)}};qe=Cn(null);Gs=new WeakSet;Dl=function(){const e=ct.pendingIdChanges;ct.pendingIdChanges=null,e&&ae(()=>{for(const[t,n]of e)le(t,un).value=n})};Zs=new WeakMap;un=new WeakMap;Qs=new WeakMap;Js=new WeakMap;K(qe,4,"manager",Ol,ct,Zs);K(qe,4,"data",Al,ct,Qs);K(qe,4,"disabled",El,ct,Js);Z(ct,Gs);Ht(qe,ct);ct.pendingIdChanges=null;var Si=ct,ia=class{constructor(){this.map=$t(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{const n=this.map.peek(),r=n.get(e),i=()=>this.unregister(e,t);if(r===t)return i;if(r&&r.id===e){const o=this.cleanupFunctions.get(r);o?.(),this.cleanupFunctions.delete(r)}const s=new Map(n);for(const[o,l]of n)if(l===t&&o!==e){s.delete(o);break}s.set(e,t),this.map.value=s;const a=xr(...t.effects());return this.cleanupFunctions.set(t,a),i},this.unregister=(e,t)=>{const n=this.map.peek();if(n.get(e)!==t)return;const r=this.cleanupFunctions.get(t);r?.(),this.cleanupFunctions.delete(t);const i=new Map(n);i.delete(e),this.map.value=i}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(const e of this){const t=this.cleanupFunctions.get(e);t?.(),e.destroy()}this.map.value=new Map}},Tl,Il,Rl,Ml,zl,Ll,vs,ke,eo,to,no,et=class extends(vs=Si,Ll=[U],zl=[U],Ml=[U],Rl=[pe],Il=[pe],Tl=[pe],vs){constructor(t,n){var r=t,{modifiers:i,type:s,sensors:a,plugins:o,effects:l}=r,c=_l(r,["modifiers","type","sensors","plugins","effects"]);super(Us(Hs({},c),{effects:()=>{var u;return[...(u=l?.())!=null?u:[],()=>{const{manager:h,plugins:p}=this;if(!(!h||!p))for(const f of p){const{plugin:g}=ur(f);h.registry.plugins.register(g)}}]}}),n),z(ke,5,this),Z(this,eo,z(ke,8,this)),z(ke,11,this),Z(this,to,z(ke,12,this)),z(ke,15,this),Z(this,no,z(ke,16,this,this.isDragSource?"dragging":"idle")),z(ke,19,this),this.type=s,this.sensors=a,this.modifiers=i,this.alignment=c.alignment,this.plugins=o}pluginConfig(t){if(this.plugins)for(const n of this.plugins){const r=ur(n);if(r.plugin===t)return r.options}}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var t,n;return((n=(t=this.manager)==null?void 0:t.dragOperation.source)==null?void 0:n.id)===this.id}};ke=Cn(vs);eo=new WeakMap;to=new WeakMap;no=new WeakMap;K(ke,4,"type",Ll,et,eo);K(ke,4,"modifiers",zl,et,to);K(ke,4,"status",Ml,et,no);K(ke,2,"isDropping",Rl,et);K(ke,2,"isDragging",Il,et);K(ke,2,"isDragSource",Tl,et);Ht(ke,et);var Wl,jl,Bl,Nl,Fl,ql,ms,fe,ro,io,so,oo,ao,tt=class extends(ms=Si,ql=[U],Fl=[U],Nl=[U],Bl=[U],jl=[U],Wl=[pe],ms){constructor(t,n){var r=t,{accept:i,collisionDetector:s,collisionPriority:a,type:o}=r,l=_l(r,["accept","collisionDetector","collisionPriority","type"]);super(l,n),z(fe,5,this),Z(this,ro,z(fe,8,this)),z(fe,11,this),Z(this,io,z(fe,12,this)),z(fe,15,this),Z(this,so,z(fe,16,this)),z(fe,19,this),Z(this,oo,z(fe,20,this)),z(fe,23,this),Z(this,ao,z(fe,24,this)),z(fe,27,this),this.accept=i,this.collisionDetector=s,this.collisionPriority=a,this.type=o}accepts(t){const{accept:n}=this;return n?typeof n=="function"?n(t):t.type?Array.isArray(n)?n.includes(t.type):t.type===n:!1:!0}get isDropTarget(){var t,n;return((n=(t=this.manager)==null?void 0:t.dragOperation.target)==null?void 0:n.id)===this.id}};fe=Cn(ms);ro=new WeakMap;io=new WeakMap;so=new WeakMap;oo=new WeakMap;ao=new WeakMap;K(fe,4,"accept",ql,tt,ro);K(fe,4,"type",Fl,tt,io);K(fe,4,"collisionDetector",Nl,tt,so);K(fe,4,"collisionPriority",Bl,tt,oo);K(fe,4,"shape",jl,tt,ao);K(fe,2,"isDropTarget",Wl,tt);Ht(fe,tt);var fd=class{constructor(){this.registry=new Map}addEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){const{registry:n}=this,r=n.get(e);if(r)for(const i of r)i(...t)}},gd=class extends fd{constructor(e){super(),this.manager=e}dispatch(e,t){const n=[t,this.manager];super.dispatch(e,...n)}};function Qr(e,t=!0){let n=!1;return Us(Hs({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var vd=class extends _r{constructor(e){super(e);const t=(r,i)=>r.map(({id:s})=>s).join("")===i.map(({id:s})=>s).join("");let n=[];this.destroy=xr(()=>{const{dragOperation:r,collisionObserver:i}=e;r.status.initializing&&(n=[],i.enable())},()=>{const{collisionObserver:r,monitor:i}=e,{collisions:s}=r;if(r.isDisabled()||Si.pendingIdChanges)return;const a=Qr({collisions:s});if(i.dispatch("collision",a),a.defaultPrevented||t(s,n))return;n=s;const[o]=s;q(()=>{var l;o?.id!==((l=e.dragOperation.target)==null?void 0:l.id)&&(r.disable(),e.actions.setDropTarget(o?.id).then(()=>{r.enable()}))})})}},$i=(e=>(e[e.Lowest=0]="Lowest",e[e.Low=1]="Low",e[e.Normal=2]="Normal",e[e.High=3]="High",e[e.Highest=4]="Highest",e))($i||{}),Ci=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(Ci||{}),Vl,Xl,Hl,Ul,Kl,Yl,Gl,Zl,Ie,lo;Zl=[U],Gl=[pe],Yl=[pe],Kl=[pe],Ul=[pe],Hl=[pe],Xl=[pe],Vl=[pe];var nt=class{constructor(){z(Ie,5,this),Z(this,lo,z(Ie,8,this,"idle")),z(Ie,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializationPending(){return this.value==="initialization-pending"}get initializing(){return this.value==="initializing"}get initialized(){const{value:e}=this;return e!=="idle"&&e!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(e){this.value=e}};Ie=Cn(null);lo=new WeakMap;K(Ie,4,"value",Zl,nt,lo);K(Ie,2,"current",Gl,nt);K(Ie,2,"idle",Yl,nt);K(Ie,2,"initializationPending",Kl,nt);K(Ie,2,"initializing",Ul,nt);K(Ie,2,"initialized",Hl,nt);K(Ie,2,"dragging",Xl,nt);K(Ie,2,"dropped",Vl,nt);Ht(Ie,nt);var md=class{constructor(e){this.manager=e}setDragSource(e){const{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e=="string"||typeof e=="number"?e:e.id}setDropTarget(e){return q(()=>{const{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;const r=Qr({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return q(()=>{const{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw new Error("Cannot start a drag operation without a drag source");if(!t.status.idle)throw new Error("Cannot start a drag operation while another is active");const r=new AbortController,{event:i,coordinates:s}=e;ae(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=i??null,t.position.reset(s)});const a=Qr({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",a),a.defaultPrevented?(t.reset(),r.abort(),r):(t.status.set("initializing"),t.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:o}=t;o.current==="initializing"&&ae(()=>{t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:i,operation:t.snapshot(),cancelable:!1})})}),r)})}move(e){return q(()=>{var t,n;const{dragOperation:r}=this.manager,{status:i,controller:s}=r;if(!i.dragging||!s||s.signal.aborted)return;const a=Qr({nativeEvent:e.event,operation:r.snapshot(),by:e.by,to:e.to},(t=e.cancelable)!=null?t:!0);((n=e.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",a),queueMicrotask(()=>{var o,l,c,u,h;if(a.defaultPrevented)return;const p=(h=e.to)!=null?h:{x:r.position.current.x+((l=(o=e.by)==null?void 0:o.x)!=null?l:0),y:r.position.current.y+((u=(c=e.by)==null?void 0:c.y)!=null?u:0)};r.position.current=p})})}stop(e={}){return q(()=>{var t,n;const{dragOperation:r}=this.manager,{controller:i}=r;if(!i||i.signal.aborted)return;let s;const a=()=>{const l={resume:()=>{},abort:()=>{}};return s=new Promise((c,u)=>{l.resume=c,l.abort=u}),l};i.abort();const o=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");const l=q(()=>{var u;return((u=r.source)==null?void 0:u.status)==="dropping"}),c=()=>{r.controller===i&&(r.controller=void 0),r.reset()};if(l){const{source:u}=r,h=Re(()=>{u?.status==="idle"&&(h(),c())})}else this.manager.renderer.rendering.then(c)})};r.canceled=(t=e.canceled)!=null?t:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:r.snapshot(),canceled:(n=e.canceled)!=null?n:!1,suspend:a}),s?s.then(o).catch(()=>r.reset()):o()})}},gn=class extends xe{constructor(e,t){super(e,t),this.manager=e,this.options=t}},bd=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(const n of e??[])n.controller=this}onEvent(e){var t;if(!this.activated)if((t=this.constraints)!=null&&t.length)for(const n of this.constraints)n.onEvent(e);else this.activate(e)}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},Jr,Ql=class{constructor(e){this.options=e,Z(this,Jr)}set controller(e){De(this,Jr,e),e.signal.addEventListener("abort",()=>this.abort())}activate(e){var t;(t=le(this,Jr))==null||t.activate(e)}};Jr=new WeakMap;var sa=class extends xe{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},yd=class{constructor(e){this.draggables=new ia,this.droppables=new ia,this.plugins=new Ki(e),this.sensors=new Ki(e),this.modifiers=new Ki(e)}register(e,t){if(e instanceof et)return this.draggables.register(e.id,e);if(e instanceof tt)return this.droppables.register(e.id,e);if(e.prototype instanceof sa)return this.modifiers.register(e,t);if(e.prototype instanceof gn)return this.sensors.register(e,t);if(e.prototype instanceof xe)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof Si)return e instanceof et?this.draggables.unregister(e.id,e):e instanceof tt?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof sa)return this.modifiers.unregister(e);if(e.prototype instanceof gn)return this.sensors.unregister(e);if(e.prototype instanceof xe)return this.plugins.unregister(e);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},Jl,ec,tc,nc,rc,ic,sc,oc,ac,qn,ei,sn,ie,co,uo,ho,po,fo,Vn;ac=[pe],oc=[U],sc=[U],ic=[U],rc=[U],nc=[U],tc=[pe],ec=[pe],Jl=[pe];var Ue=class{constructor(e){z(ie,5,this),Z(this,qn),Z(this,ei),Z(this,sn,new Sn(void 0,(t,n)=>t&&n?t.equals(n):t===n)),this.status=new nt,Z(this,co,z(ie,8,this,!1)),z(ie,11,this),Z(this,uo,z(ie,12,this,null)),z(ie,15,this),Z(this,ho,z(ie,16,this,null)),z(ie,19,this),Z(this,po,z(ie,20,this,null)),z(ie,23,this),Z(this,fo,z(ie,24,this,[])),z(ie,27,this),this.position=new _i({x:0,y:0}),Z(this,Vn,{x:0,y:0}),De(this,qn,e)}get shape(){const{current:e,initial:t,previous:n}=le(this,sn);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?le(this,sn).current=e:le(this,sn).reset()}get source(){var e;const t=this.sourceIdentifier;if(t==null)return null;const n=le(this,qn).registry.draggables.get(t);return n&&De(this,ei,n),(e=n??le(this,ei))!=null?e:null}get target(){var e;const t=this.targetIdentifier;return t!=null&&(e=le(this,qn).registry.droppables.get(t))!=null?e:null}get transform(){const{x:e,y:t}=this.position.delta;let n={x:e,y:t};for(const r of this.modifiers)n=r.apply(Us(Hs({},this.snapshot()),{transform:n}));return De(this,Vn,n),n}snapshot(){return q(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:le(this,Vn),shape:this.shape?Ui(this.shape):null,position:Ui(this.position),status:Ui(this.status),canceled:this.canceled}))}reset(){ae(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,le(this,sn).reset(),this.position.reset({x:0,y:0}),De(this,Vn,{x:0,y:0}),this.modifiers=[]})}};ie=Cn(null);qn=new WeakMap;ei=new WeakMap;sn=new WeakMap;co=new WeakMap;uo=new WeakMap;ho=new WeakMap;po=new WeakMap;fo=new WeakMap;Vn=new WeakMap;K(ie,2,"shape",ac,Ue);K(ie,4,"canceled",oc,Ue,co);K(ie,4,"activatorEvent",sc,Ue,uo);K(ie,4,"sourceIdentifier",ic,Ue,ho);K(ie,4,"targetIdentifier",rc,Ue,po);K(ie,4,"modifiers",nc,Ue,fo);K(ie,2,"source",tc,Ue);K(ie,2,"target",ec,Ue);K(ie,2,"transform",Jl,Ue);Ht(ie,Ue);var xd={get rendering(){return Promise.resolve()}};function He(e,t){return typeof e=="function"?e(t):e??t}var wd=class{constructor(t){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(p=>p.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};var n;const r=t??{},i=He(r.plugins,[]),s=He(r.sensors,[]),a=He(r.modifiers,[]),o=(n=r.renderer)!=null?n:xd,l=new gd(this),c=new yd(this);this.registry=c,this.monitor=l,this.renderer=o,this.actions=new md(this),this.dragOperation=new Ue(this),this.collisionObserver=new pd(this),this.plugins=[vd,...i],this.modifiers=a,this.sensors=s;const{destroy:u}=this,h=xr(()=>{var p,f,g;const b=q(()=>this.dragOperation.modifiers),y=this.modifiers;for(const x of b)y.includes(x)||x.destroy();this.dragOperation.modifiers=(g=(f=(p=this.dragOperation.source)==null?void 0:p.modifiers)==null?void 0:f.map(x=>{const{plugin:m,options:v}=ur(x);return new m(this,v)}))!=null?g:y});this.destroy=()=>{h(),u()}}get plugins(){return this.registry.plugins.values}set plugins(t){this.registry.plugins.values=t}get modifiers(){return this.registry.modifiers.values}set modifiers(t){this.registry.modifiers.values=t}get sensors(){return this.registry.sensors.values}set sensors(t){this.registry.sensors.values=t}},lc=e=>{throw TypeError(e)},go=(e,t,n)=>t.has(e)||lc("Cannot "+n),M=(e,t,n)=>(go(e,t,"read from private field"),t.get(e)),$e=(e,t,n)=>t.has(e)?lc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Oe=(e,t,n,r)=>(go(e,t,"write to private field"),t.set(e,n),n),cc=(e,t,n)=>(go(e,t,"access private method"),n);function Pi(e){return e?e instanceof KeyframeEffect?!0:"getKeyframes"in e&&typeof e.getKeyframes=="function":!1}function uc(e,t){const n=e.getAnimations();let r=null;for(const i of n){if(i.playState!=="running")continue;const{effect:s}=i,o=(Pi(s)?s.getKeyframes():[]).filter(t);o.length>0&&(r=[o[o.length-1],i])}return r}function Ei(e){const{width:t,height:n,top:r,left:i,bottom:s,right:a}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:s,right:a}}function vo(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Sr(e){return"nodeType"in e}function Me(e){var t,n,r;return e?vo(e)?e:Sr(e)?"defaultView"in e?(t=e.defaultView)!=null?t:window:(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window:window:window}function mo(e){const{Document:t}=Me(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function _t(e){return!e||vo(e)?!1:e instanceof Me(e).HTMLElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("html")}function dc(e){return e instanceof Me(e).SVGElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("svg")}function Nt(e){return e?vo(e)?e.document:Sr(e)?mo(e)?e:_t(e)||dc(e)?e.ownerDocument:document:document:document}function kd(e){var t,n,r,i;const{documentElement:s}=Nt(e),a=Me(e).visualViewport,o=(t=a?.width)!=null?t:s.clientWidth,l=(n=a?.height)!=null?n:s.clientHeight,c=(r=a?.offsetTop)!=null?r:0,u=(i=a?.offsetLeft)!=null?i:0;return{top:c,left:u,right:u+o,bottom:c+l,width:o,height:l}}function _d(e,t){if(Sd(e)&&e.open===!1)return!1;const{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return n==="visible"&&r==="visible"&&i==="visible"}function Sd(e){return e.tagName==="DETAILS"}function hr(e,t=e.getBoundingClientRect(),n=0){var r,i,s,a,o;let l=t;const{ownerDocument:c}=e,u=(r=c.defaultView)!=null?r:window;let h=e.parentElement;for(;h&&h!==c.documentElement;){if(!_d(h)){const v=h.getBoundingClientRect(),w=n*(v.bottom-v.top),k=n*(v.right-v.left),$=n*(v.bottom-v.top),E=n*(v.right-v.left);l={top:Math.max(l.top,v.top-w),right:Math.min(l.right,v.right+k),bottom:Math.min(l.bottom,v.bottom+$),left:Math.max(l.left,v.left-E),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top}h=h.parentElement}const p=u.visualViewport,f=(i=p?.offsetTop)!=null?i:0,g=(s=p?.offsetLeft)!=null?s:0,b=(a=p?.width)!=null?a:u.innerWidth,y=(o=p?.height)!=null?o:u.innerHeight,x=n*y,m=n*b;return l={top:Math.max(l.top,f-x),right:Math.min(l.right,g+b+m),bottom:Math.min(l.bottom,f+y+x),left:Math.max(l.left,g-m),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top,l.width<0&&(l.width=0),l.height<0&&(l.height=0),l}function vn(e){return{x:e.clientX,y:e.clientY}}var $d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function bs(e=document,t=new Set){if(t.has(e))return[];t.add(e);const n=[e];for(const r of Array.from(e.querySelectorAll("iframe, frame")))try{const i=r.contentDocument;i&&!t.has(i)&&n.push(...bs(i,t))}catch{}try{const r=e.defaultView;if(r&&r!==window.top){const i=r.parent;i&&i.document&&i.document!==e&&n.push(...bs(i.document,t))}}catch{}return n}function bo(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function hc(){var e,t;const n=bo()?window.visualViewport:null;return{x:(e=n?.offsetLeft)!=null?e:0,y:(t=n?.offsetTop)!=null?t:0}}function Ai(e){return!e||!Sr(e)?!1:e instanceof Me(e).ShadowRoot}function li(e){if(e&&Sr(e)){let t=e.getRootNode();if(Ai(t))return t;if(t instanceof Document)return t}return Nt(e)}function yo(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches}function Cd(e){const t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((s,a)=>{const o=r[a];if(oa(s)&&oa(o)&&(s.type!=="file"&&(s.value=o.value),s.type==="radio"&&s.name&&(s.name=`Cloned__${s.name}`)),aa(s)&&aa(o)&&o.width>0&&o.height>0){const l=s.getContext("2d");l?.drawImage(o,0,0)}}),n}function oa(e){return"value"in e}function aa(e){return e.tagName==="CANVAS"}function pc(e,{x:t,y:n}){const r=e.elementFromPoint(t,n);if(Pd(r)){const{contentDocument:i}=r;if(i){const{left:s,top:a}=r.getBoundingClientRect();return pc(i,{x:t-s,y:n-a})}}return r}function Pd(e){return e?.tagName==="IFRAME"}var ys=new WeakMap;function Ed(e){return e.closest(`
2
+ input:not([disabled]),
3
+ select:not([disabled]),
4
+ textarea:not([disabled]),
5
+ button:not([disabled]),
6
+ a[href],
7
+ [contenteditable]:not([contenteditable="false"])
8
+ `)}var fc=class{constructor(){this.entries=new Set,this.clear=()=>{for(const e of this.entries){const[t,{type:n,listener:r,options:i}]=e;t.removeEventListener(n,r,i)}this.entries.clear()}}bind(e,t){const n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t],i=[];for(const a of n)for(const o of r){const{type:l,listener:c,options:u}=o,h=[a,o];a.addEventListener(l,c,u),this.entries.add(h),i.push(h)}const s=this.entries;return function(){for(const o of i){const[l,{type:c,listener:u,options:h}]=o;l.removeEventListener(c,u,h),s.delete(o)}}}};function mn(e){const t=e?.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function Ad(e){const t=new Set;let n=mn(e);for(;n;)t.add(n),n=mn(n);return t}function Od(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}function gc(e,t){const n=()=>performance.now();let r,i;return function(...s){const a=this;i?(r?.(),r=Od(()=>{e.apply(a,s),i=n()},t-(n()-i))):(e.apply(a,s),i=n())}}function Dd(e,t){return e===t?!0:!e||!t?!1:e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}function Td(e,t=e.getBoundingClientRect()){const{width:n,height:r}=hr(e,t);return n>0&&r>0}var Id=typeof ResizeObserver<"u"?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},ti,Rd=class extends Id{constructor(e){super(t=>{if(!M(this,ti)){Oe(this,ti,!0);return}e(t,this)}),$e(this,ti,!1)}};ti=new WeakMap;var la=Array.from({length:100},(e,t)=>t/100),vc=75,It,ci,gt,Rt,Xn,me,sr,Hn,ui,mc,bc,yc=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,$e(this,ui),this.disconnect=()=>{var s,a,o;Oe(this,sr,!0),(s=M(this,gt))==null||s.disconnect(),(a=M(this,Rt))==null||a.disconnect(),M(this,Xn).disconnect(),(o=M(this,me))==null||o.remove()},$e(this,It,!0),$e(this,ci),$e(this,gt),$e(this,Rt),$e(this,Xn),$e(this,me),$e(this,sr,!1),$e(this,Hn,gc(()=>{var s,a,o;const{element:l}=this;if((s=M(this,Rt))==null||s.disconnect(),M(this,sr)||!M(this,It)||!l.isConnected)return;const c=(a=l.ownerDocument)!=null?a:document,{innerHeight:u,innerWidth:h}=(o=c.defaultView)!=null?o:window,p=l.getBoundingClientRect(),f=hr(l,p),{top:g,left:b,bottom:y,right:x}=f,m=-Math.floor(g),v=-Math.floor(b),w=-Math.floor(h-x),k=-Math.floor(u-y),$=`${m}px ${w}px ${k}px ${v}px`;this.boundingClientRect=p,Oe(this,Rt,new IntersectionObserver(E=>{const[O]=E,{intersectionRect:V}=O;(O.intersectionRatio!==1?O.intersectionRatio:Je.intersectionRatio(V,hr(l)))!==1&&M(this,Hn).call(this)},{threshold:la,rootMargin:$,root:c})),M(this,Rt).observe(l),cc(this,ui,mc).call(this)},vc)),this.boundingClientRect=e.getBoundingClientRect(),Oe(this,It,Td(e,this.boundingClientRect));let r=!0;this.callback=s=>{r&&(r=!1,n.skipInitial)||t(s)};const i=e.ownerDocument;n?.debug&&(Oe(this,me,document.createElement("div")),M(this,me).style.background="rgba(0,0,0,0.15)",M(this,me).style.position="fixed",M(this,me).style.pointerEvents="none",i.body.appendChild(M(this,me))),Oe(this,Xn,new IntersectionObserver(s=>{var a,o;const l=s[s.length-1],{boundingClientRect:c,isIntersecting:u}=l,{width:h,height:p}=c,f=M(this,It);Oe(this,It,u),!(!h&&!p)&&(f&&!u?((a=M(this,Rt))==null||a.disconnect(),this.callback(null),(o=M(this,gt))==null||o.disconnect(),Oe(this,gt,void 0),M(this,me)&&(M(this,me).style.visibility="hidden")):M(this,Hn).call(this),u&&!M(this,gt)&&(Oe(this,gt,new Rd(M(this,Hn))),M(this,gt).observe(e)))},{threshold:la,root:i})),M(this,It)&&!n.skipInitial&&this.callback(this.boundingClientRect),M(this,Xn).observe(e)}};It=new WeakMap;ci=new WeakMap;gt=new WeakMap;Rt=new WeakMap;Xn=new WeakMap;me=new WeakMap;sr=new WeakMap;Hn=new WeakMap;ui=new WeakSet;mc=function(){M(this,sr)||(cc(this,ui,bc).call(this),!Dd(this.boundingClientRect,M(this,ci))&&(this.callback(this.boundingClientRect),Oe(this,ci,this.boundingClientRect)))};bc=function(){if(M(this,me)){const{top:e,left:t,width:n,height:r}=hr(this.element);M(this,me).style.overflow="hidden",M(this,me).style.visibility="visible",M(this,me).style.top=`${Math.floor(e)}px`,M(this,me).style.left=`${Math.floor(t)}px`,M(this,me).style.width=`${Math.floor(n)}px`,M(this,me).style.height=`${Math.floor(r)}px`}};var Wr=new WeakMap,jr=new WeakMap;function Md(e,t){let n=Wr.get(e);return n||(n={disconnect:new yc(e,i=>{const s=Wr.get(e);s&&s.callbacks.forEach(a=>a(i))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(t),Wr.set(e,n),()=>{n.callbacks.delete(t),n.callbacks.size===0&&(Wr.delete(e),n.disconnect())}}function zd(e,t){const n=new Set;for(const r of e){const i=Md(r,t);n.add(i)}return()=>n.forEach(r=>r())}function Ld(e,t){var n;const r=e.ownerDocument;if(!jr.has(r)){const a=new AbortController,o=new Set;document.addEventListener("scroll",l=>o.forEach(c=>c(l)),{capture:!0,passive:!0,signal:a.signal}),jr.set(r,{disconnect:()=>a.abort(),listeners:o})}const{listeners:i,disconnect:s}=(n=jr.get(r))!=null?n:{};return!i||!s?()=>{}:(i.add(t),()=>{i.delete(t),i.size===0&&(s(),jr.delete(r))})}var Un,Kn,ni,xs,Wd=class{constructor(e,t,n){this.callback=t,$e(this,Un),$e(this,Kn,!1),$e(this,ni),$e(this,xs,gc(a=>{if(!M(this,Kn)&&a.target&&"contains"in a.target&&typeof a.target.contains=="function"){for(const o of M(this,ni))if(a.target.contains(o)){this.callback(M(this,Un).boundingClientRect);break}}},vc));const r=Ad(e),i=zd(r,t),s=Ld(e,M(this,xs));Oe(this,ni,r),Oe(this,Un,new yc(e,t,n)),this.disconnect=()=>{M(this,Kn)||(Oe(this,Kn,!0),i(),s(),M(this,Un).disconnect())}}};Un=new WeakMap;Kn=new WeakMap;ni=new WeakMap;xs=new WeakMap;function ws(e){return"showPopover"in e&&"hidePopover"in e&&typeof e.showPopover=="function"&&typeof e.hidePopover=="function"}function dn(e){try{ws(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch{}}function ca(e){return!$d||!e?!1:e===Nt(e).scrollingElement}function xo(e){var t,n;const r=Me(e),i=ca(e)?kd(e):Ei(e),s=r.visualViewport,a=ca(e)?{height:(t=s?.height)!=null?t:r.innerHeight,width:(n=s?.width)!=null?n:r.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-a.width,y:e.scrollHeight-a.height}},l=o.current.y<=0,c=o.current.x<=0,u=o.current.y>=o.max.y,h=o.current.x>=o.max.x;return{rect:i,position:o,isTop:l,isLeft:c,isBottom:u,isRight:h}}function jd(e,t,n=xo(e)){const{isTop:r,isBottom:i,isLeft:s,isRight:a,position:o}=n,{x:l,y:c}=t??{x:0,y:0},u=!r&&o.current.y+c>0,h=!i&&o.current.y+c<o.max.y,p=!s&&o.current.x+l>0,f=!a&&o.current.x+l<o.max.x;return{top:u,bottom:h,left:p,right:f,x:p||f,y:u||h}}var wo=class{constructor(t){this.scheduler=t,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:n,resolvers:r}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const i of n)i();for(const i of r)i()}}schedule(t){return this.tasks.add(t),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(n=>this.resolvers.add(n))}},pr=new wo(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),Bd=new wo(e=>setTimeout(e,50)),di=new Map,Nd=di.clear.bind(di);function rt(e,t=!1){if(!t)return ua(e);let n=di.get(e);return n||(n=ua(e),di.set(e,n),Bd.schedule(Nd),n)}function ua(e){return Me(e).getComputedStyle(e)}function Fd(e,t=rt(e,!0)){return t.position==="fixed"||t.position==="sticky"}function qd(e,t=rt(e,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}var Vd={excludeElement:!0,escapeShadowDOM:!0};function ks(e,t=Vd){const{limit:n,excludeElement:r,escapeShadowDOM:i}=t,s=new Set;function a(o){if(n!=null&&s.size>=n||!o)return s;if(mo(o)&&o.scrollingElement!=null&&!s.has(o.scrollingElement))return s.add(o.scrollingElement),s;if(i&&Ai(o))return a(o.host);if(!_t(o))return dc(o)?a(o.parentElement):s;if(s.has(o))return s;const l=rt(o,!0);if(r&&o===e||qd(o,l)&&s.add(o),Fd(o,l)){const{scrollingElement:c}=o.ownerDocument;return c&&s.add(c),s}return a(o.parentNode)}return e?a(e):s}function bn(e,t=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let r=mn(e);for(;r;){if(r===t)return n;const i=Ei(r),{x:s,y:a}=Xd(r,i);n.x=n.x+i.left,n.y=n.y+i.top,n.scaleX=n.scaleX*s,n.scaleY=n.scaleY*a,r=mn(r)}return n}function Xd(e,t=Ei(e)){const n=Math.round(t.width),r=Math.round(t.height);if(_t(e))return{x:n/e.offsetWidth,y:r/e.offsetHeight};const i=rt(e,!0);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}function Hd(e){if(!e||e==="none")return null;const t=e.split(" "),n=parseFloat(t[0]),r=parseFloat(t[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}function fr(e){if(!e||e==="none")return null;const[t,n,r="0"]=e.split(" "),i={x:parseFloat(t),y:parseFloat(n),z:parseInt(r,10)};return isNaN(i.x)&&isNaN(i.y)?null:{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}function Oi(e){var t,n,r,i,s,a,o,l,c;const{scale:u,transform:h,translate:p}=e,f=Hd(u),g=fr(p),b=Ud(h);if(!b&&!f&&!g)return null;const y={x:(t=f?.x)!=null?t:1,y:(n=f?.y)!=null?n:1},x={x:(r=g?.x)!=null?r:0,y:(i=g?.y)!=null?i:0},m={x:(s=b?.x)!=null?s:0,y:(a=b?.y)!=null?a:0,scaleX:(o=b?.scaleX)!=null?o:1,scaleY:(l=b?.scaleY)!=null?l:1};return{x:x.x+m.x,y:x.y+m.y,z:(c=g?.z)!=null?c:0,scaleX:y.x*m.scaleX,scaleY:y.y*m.scaleY}}function Ud(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var Ne=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(Ne||{}),Kd={x:.2,y:.2},Yd={x:10,y:10};function Gd(e,t,n,r=25,i=Kd,s=Yd,a=xo(e)){const{x:o,y:l}=t,{rect:c,isTop:u,isBottom:h,isLeft:p,isRight:f}=a,g=bn(e),b=rt(e,!0),y=Oi(b),x=y!==null?y?.scaleX<0:!1,m=y!==null?y?.scaleY<0:!1,v=new Je(c.left*g.scaleX+g.x,c.top*g.scaleY+g.y,c.width*g.scaleX,c.height*g.scaleY),w={x:0,y:0},k={x:0,y:0},$={height:v.height*i.y,width:v.width*i.x};return $.height>0&&(!u||m&&!h)&&l<=v.top+$.height&&n?.y!==1&&o>=v.left-s.x&&o<=v.right+s.x?(w.y=m?1:-1,k.y=r*Math.abs((v.top+$.height-l)/$.height)):$.height>0&&(!h||m&&!u)&&l>=v.bottom-$.height&&n?.y!==-1&&o>=v.left-s.x&&o<=v.right+s.x&&(w.y=m?-1:1,k.y=r*Math.abs((v.bottom-$.height-l)/$.height)),$.width>0&&(!f||x&&!p)&&o>=v.right-$.width&&n?.x!==-1&&l>=v.top-s.y&&l<=v.bottom+s.y?(w.x=x?-1:1,k.x=r*Math.abs((v.right-$.width-o)/$.width)):$.width>0&&(!p||x&&!f)&&o<=v.left+$.width&&n?.x!==1&&l>=v.top-s.y&&l<=v.bottom+s.y&&(w.x=x?1:-1,k.x=r*Math.abs((v.left+$.width-o)/$.width)),{direction:w,speed:k}}function xc(e,{block:t="nearest",inline:n="nearest"}={}){if(!_t(e))return;const r=ks(e),i=[];for(const s of r){if(!_t(s))continue;const{top:a,left:o}=Zd(e,s);let l=a,c=o;for(const u of i)l-=u.scrollTop,c-=u.scrollLeft;if(t!=="none"){const u=l<s.scrollTop,h=l+e.offsetHeight>s.scrollTop+s.clientHeight;u!==h&&(t==="center"?s.scrollTop=l-s.clientHeight/2+e.offsetHeight/2:u?s.scrollTop=l:s.scrollTop=l+e.offsetHeight-s.clientHeight)}if(n!=="none"){const u=c<s.scrollLeft,h=c+e.offsetWidth>s.scrollLeft+s.clientWidth;u!==h&&(n==="center"?s.scrollLeft=c-s.clientWidth/2+e.offsetWidth/2:u?s.scrollLeft=c:s.scrollLeft=c+e.offsetWidth-s.clientWidth)}i.push(s)}}function da(e){let t=0,n=0,r=e;for(;r;){t+=r.offsetTop,n+=r.offsetLeft;const i=r.offsetParent;if(!_t(i))break;t+=i.clientTop,n+=i.clientLeft,r=i}return{top:t,left:n}}function Zd(e,t){const n=da(e),r=da(t);return{top:n.top-r.top-t.clientTop,left:n.left-r.left-t.clientLeft}}function Qd(e,t,n){const{scaleX:r,scaleY:i,x:s,y:a}=t,o=e.left+s+(1-r)*parseFloat(n),l=e.top+a+(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width*r:e.width,u=i?e.height*i:e.height;return{width:c,height:u,top:l,right:o+c,bottom:l+u,left:o}}function Jd(e,t,n){const{scaleX:r,scaleY:i,x:s,y:a}=t,o=e.left-s-(1-r)*parseFloat(n),l=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:c,height:u,top:l,right:o+c,bottom:l+u,left:o}}function wc({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function ha(e,t=rt(e).translate,n=!0){if(n){const r=uc(e,i=>"translate"in i);if(r){const{translate:i=""}=r[0];if(typeof i=="string"){const s=fr(i);if(s)return s}}}if(t){const r=fr(t);if(r)return r}return{x:0,y:0,z:0}}var eh=new wo(e=>setTimeout(e,0)),or=new Map,th=or.clear.bind(or);function nh(e){const t=e.ownerDocument;let n=or.get(t);if(n)return n;n=t.getAnimations(),or.set(t,n),eh.schedule(th);const r=n.filter(i=>Pi(i.effect)&&i.effect.target===e);return or.set(e,r),n}function rh(e,t){const n=nh(e).filter(r=>{var i,s;if(Pi(r.effect)){const{target:a}=r.effect;if((s=a&&((i=t.isValidTarget)==null?void 0:i.call(t,a)))!=null?s:!0)return r.effect.getKeyframes().some(l=>{for(const c of t.properties)if(l[c])return!0})}}).map(r=>{const{effect:i,currentTime:s}=r,a=i?.getComputedTiming().duration;if(!(r.pending||r.playState==="finished")&&typeof a=="number"&&typeof s=="number"&&s<a)return r.currentTime=a,()=>{r.currentTime=s}});if(n.length>0)return()=>n.forEach(r=>r?.())}var Qe=class extends Je{constructor(e,t={}){var n,r,i,s;const{frameTransform:a=bn(e),ignoreTransforms:o,getBoundingClientRect:l=Ei}=t,c=rh(e,{properties:["transform","translate","scale","width","height"],isValidTarget:k=>(k!==e||bo())&&k.contains(e)}),u=l(e);let{top:h,left:p,width:f,height:g}=u,b;const y=rt(e),x=Oi(y),m={x:(n=x?.scaleX)!=null?n:1,y:(r=x?.scaleY)!=null?r:1},v=ih(e,y);c?.(),x&&(b=Jd(u,x,y.transformOrigin),(o||v)&&(h=b.top,p=b.left,f=b.width,g=b.height));const w={width:(i=b?.width)!=null?i:f,height:(s=b?.height)!=null?s:g};if(v&&!o&&b){const k=Qd(b,v,y.transformOrigin);h=k.top,p=k.left,f=k.width,g=k.height,m.x=v.scaleX,m.y=v.scaleY}a&&(o||(p*=a.scaleX,f*=a.scaleX,h*=a.scaleY,g*=a.scaleY),p+=a.x,h+=a.y),super(p,h,f,g),this.scale=m,this.intrinsicWidth=w.width,this.intrinsicHeight=w.height}};function ih(e,t){const n=e.getAnimations();if(!n.length)return null;let r,i,s,a=!1;for(const o of n){if(o.playState!=="running")continue;const l=Pi(o.effect)?o.effect.getKeyframes():[],c=l[l.length-1];if(!c)continue;const{transform:u,translate:h,scale:p}=c;typeof u=="string"&&u&&(r=u,a=!0),typeof h=="string"&&h&&(i=h,a=!0),typeof p=="string"&&p&&(s=p,a=!0)}return a?Oi({transform:r??t.transform,translate:i??t.translate,scale:s??t.scale}):null}function ar(e){return"style"in e&&typeof e.style=="object"&&e.style!==null&&"setProperty"in e.style&&"removeProperty"in e.style&&typeof e.style.setProperty=="function"&&typeof e.style.removeProperty=="function"}var sh=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){const{element:n}=this;if(ar(n))for(const[r,i]of Object.entries(e)){const s=`${t}${r}`;this.initial.has(s)||this.initial.set(s,n.style.getPropertyValue(s)),n.style.setProperty(s,typeof i=="string"?i:`${i}px`)}}remove(e,t=""){const{element:n}=this;if(ar(n))for(const r of e){const i=`${t}${r}`;n.style.removeProperty(i)}}reset(){const{element:e}=this;if(ar(e)){for(const[t,n]of this.initial)e.style.setProperty(t,n);e.getAttribute("style")===""&&e.removeAttribute("style")}}};function Ft(e){return e?e instanceof Me(e).Element||Sr(e)&&e.nodeType===Node.ELEMENT_NODE:!1}function gr(e){if(!e)return!1;const{KeyboardEvent:t}=Me(e.target);return e instanceof t}function oh(e){if(!e)return!1;const{PointerEvent:t}=Me(e.target);return e instanceof t}function ah(e){if(!Ft(e))return!1;const{tagName:t}=e;return t==="INPUT"||t==="TEXTAREA"||lh(e)}function lh(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false"}var Yi={};function _s(e){const t=Yi[e]==null?0:Yi[e]+1;return Yi[e]=t,`${e}-${t}`}var ch=({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){const i=je.distance(t.shape.center,n);return{id:r,value:1/i,type:Ci.PointerIntersection,priority:$i.High}}return null},uh=({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!n?.current)return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:i}=e,s=je.distance(t.shape.center,i.current),o=r/(n.current.area+t.shape.area-r)/s;return{id:t.id,value:o,type:Ci.ShapeIntersection,priority:$i.Normal}}return null},kc=e=>{var t;return(t=ch(e))!=null?t:uh(e)},dh=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:i}=t;if(!n.shape)return null;const s=r?Je.from(r.current.boundingRectangle).corners:void 0,o=Je.from(n.shape.boundingRectangle).corners.reduce((l,c,u)=>{var h;return l+je.distance(je.from(c),(h=s?.[u])!=null?h:i.current)},0)/4;return{id:n.id,value:1/o,type:Ci.Collision,priority:$i.Normal}},hh=Object.create,ko=Object.defineProperty,ph=Object.defineProperties,fh=Object.getOwnPropertyDescriptor,gh=Object.getOwnPropertyDescriptors,hi=Object.getOwnPropertySymbols,_c=Object.prototype.hasOwnProperty,Sc=Object.prototype.propertyIsEnumerable,$c=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Pn=e=>{throw TypeError(e)},Ss=(e,t,n)=>t in e?ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vr=(e,t)=>{for(var n in t||(t={}))_c.call(t,n)&&Ss(e,n,t[n]);if(hi)for(var n of hi(t))Sc.call(t,n)&&Ss(e,n,t[n]);return e},_o=(e,t)=>ph(e,gh(t)),pa=(e,t)=>ko(e,"name",{value:t,configurable:!0}),Cc=(e,t)=>{var n={};for(var r in e)_c.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hi)for(var r of hi(e))t.indexOf(r)<0&&Sc.call(e,r)&&(n[r]=e[r]);return n},En=e=>{var t;return[,,,hh((t=e?.[$c("metadata")])!=null?t:null)]},Pc=["class","method","getter","setter","accessor","field","value","get","set"],Yn=e=>e!==void 0&&typeof e!="function"?Pn("Function expected"):e,vh=(e,t,n,r,i)=>({kind:Pc[e],name:t,metadata:r,addInitializer:s=>n._?Pn("Already initialized"):i.push(Yn(s||null))}),Ut=(e,t)=>Ss(t,$c("metadata"),e[3]),ce=(e,t,n,r)=>{for(var i=0,s=e[t>>1],a=s&&s.length;i<a;i++)t&1?s[i].call(n):r=s[i].call(n,r);return r},ze=(e,t,n,r,i,s)=>{var a,o,l,c,u,h=t&7,p=!!(t&8),f=!!(t&16),g=h>3?e.length+1:h?p?1:2:0,b=Pc[h+5],y=h>3&&(e[g-1]=[]),x=e[g]||(e[g]=[]),m=h&&(!f&&!p&&(i=i.prototype),h<5&&(h>3||!f)&&fh(h<4?i:{get[n](){return H(this,s)},set[n](w){return _e(this,s,w)}},n));h?f&&h<4&&pa(s,(h>2?"set ":h>1?"get ":"")+n):pa(i,n);for(var v=r.length-1;v>=0;v--)c=vh(h,n,l={},e[3],x),h&&(c.static=p,c.private=f,u=c.access={has:f?w=>mh(i,w):w=>n in w},h^3&&(u.get=f?w=>(h^1?H:qt)(w,i,h^4?s:m.get):w=>w[n]),h>2&&(u.set=f?(w,k)=>_e(w,i,k,h^4?s:m.set):(w,k)=>w[n]=k)),o=(0,r[v])(h?h<4?f?s:m[b]:h>4?void 0:{get:m.get,set:m.set}:i,c),l._=1,h^4||o===void 0?Yn(o)&&(h>4?y.unshift(o):h?f?s=o:m[b]=o:i=o):typeof o!="object"||o===null?Pn("Object expected"):(Yn(a=o.get)&&(m.get=a),Yn(a=o.set)&&(m.set=a),Yn(a=o.init)&&y.unshift(a));return h||Ut(e,i),m&&ko(i,n,m),f?h^4?s:m:i},So=(e,t,n)=>t.has(e)||Pn("Cannot "+n),mh=(e,t)=>Object(t)!==t?Pn('Cannot use the "in" operator on this value'):e.has(t),H=(e,t,n)=>(So(e,t,"read from private field"),n?n.call(e):t.get(e)),ne=(e,t,n)=>t.has(e)?Pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_e=(e,t,n,r)=>(So(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),qt=(e,t,n)=>(So(e,t,"access private method"),n),fa={role:"button",roleDescription:"draggable"},bh="dnd-kit-description",yh="dnd-kit-announcement",xh={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},wh={dragstart({operation:{source:e}}){if(e)return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(!(!e||e.id===t?.id))return t?`Draggable item ${e.id} was moved over droppable target ${t.id}.`:`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(e)return n?`Dragging was cancelled. Draggable item ${e.id} was dropped.`:t?`Draggable item ${e.id} was dropped over droppable target ${t.id}`:`Draggable item ${e.id} was dropped.`}};function kh(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}function _h(e){var t;return((t=e.getAttribute("role"))!=null?t:"button")==="button"}function Sh(e,t){const n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}function $h(e){const t=document.createElement("div");return t.id=e,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.setProperty("position","fixed"),t.style.setProperty("width","1px"),t.style.setProperty("height","1px"),t.style.setProperty("margin","-1px"),t.style.setProperty("border","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("clip","rect(0 0 0 0)"),t.style.setProperty("clip-path","inset(100%)"),t.style.setProperty("white-space","nowrap"),t}var Ch=["dragover","dragmove"],Ph=class extends xe{constructor(e,t){super(e);const{id:n,idPrefix:{description:r=bh,announcement:i=yh}={},announcements:s=wh,screenReaderInstructions:a=xh,debounce:o=500}=t??{},l=n?`${r}-${n}`:_s(r),c=n?`${i}-${n}`:_s(i);let u,h,p,f;const g=(k=f)=>{!p||!k||p?.nodeValue!==k&&(p.nodeValue=k)},b=()=>pr.schedule(g),y=Eh(b,o),x=Object.entries(s).map(([k,$])=>this.manager.monitor.addEventListener(k,(E,O)=>{const V=p;if(!V)return;const B=$?.(E,O);B&&V.nodeValue!==B&&(f=B,Ch.includes(k)?y():(b(),y.cancel()))})),m=()=>{let k=[];u?.isConnected||(u=Sh(l,a.draggable),k.push(u)),h?.isConnected||(h=$h(c),p=document.createTextNode(""),h.appendChild(p),k.push(h)),k.length>0&&document.body.append(...k)},v=new Set;function w(){for(const k of v)k()}this.registerEffect(()=>{var k;v.clear();for(const $ of this.manager.registry.draggables.value){const E=(k=$.handle)!=null?k:$.element;if(E){(!u||!h)&&v.add(m),(!kh(E)||bo())&&!E.hasAttribute("tabindex")&&v.add(()=>E.setAttribute("tabindex","0")),!E.hasAttribute("role")&&E.tagName.toLowerCase()!=="button"&&v.add(()=>E.setAttribute("role",fa.role)),E.hasAttribute("aria-roledescription")||v.add(()=>E.setAttribute("aria-roledescription",fa.roleDescription)),E.hasAttribute("aria-describedby")||v.add(()=>E.setAttribute("aria-describedby",l));const O=_h(E)?["aria-pressed","aria-grabbed"]:["aria-grabbed"];for(const B of O){const P=String($.isDragging);E.getAttribute(B)!==P&&v.add(()=>E.setAttribute(B,P))}const V=String($.disabled);E.getAttribute("aria-disabled")!==V&&v.add(()=>E.setAttribute("aria-disabled",V))}}v.size>0&&pr.schedule(w)}),this.destroy=()=>{super.destroy(),u?.remove(),h?.remove(),x.forEach(k=>k())}}};function Eh(e,t){let n;const r=()=>{clearTimeout(n),n=setTimeout(e,t)};return r.cancel=()=>clearTimeout(n),r}var pi=new Map;function Ah(e){return Ai(e)?e.host.isConnected:e.defaultView!=null}var Ec,Ac,Oc,Dc,Tc,$s,Be,$o,Co,hn,bt,yn,Ic,Rc,Mc,zc,ut=class extends($s=_r,Tc=[U],Dc=[U],Oc=[pe],Ac=[pe],Ec=[pe],$s){constructor(t,n){super(t,n),ce(Be,5,this),ne(this,yn),ne(this,$o,ce(Be,8,this,new Map)),ce(Be,11,this),ne(this,Co,ce(Be,12,this,new Set)),ce(Be,15,this),ne(this,hn,new Set),ne(this,bt,new Map),this.registerEffect(qt(this,yn,Ic))}register(t,n){return q(()=>{var r;const i=new Map(this.registeredRules);i.set(t,(r=n?.retain)!=null?r:!1),this.registeredRules=i}),()=>{q(()=>{const r=new Map(this.registeredRules);r.delete(t),this.registeredRules=r})}}addRoot(t){return q(()=>{const n=new Set(this.additionalRoots);n.add(t),this.additionalRoots=n}),()=>{q(()=>{const n=new Set(this.additionalRoots);n.delete(t),this.additionalRoots=n})}}get sourceRoot(){var t;const{source:n}=this.manager.dragOperation;return li((t=n?.element)!=null?t:null)}get targetRoot(){var t;const{target:n}=this.manager.dragOperation;return li((t=n?.element)!=null?t:null)}get roots(){const{status:t}=this.manager.dragOperation;if(t.initializing||t.initialized){const n=[this.sourceRoot,this.targetRoot].filter(r=>r!=null);return new Set([...n,...this.additionalRoots])}return new Set}destroy(){for(const t of H(this,bt).values())for(const n of t.values())n();H(this,bt).clear(),H(this,hn).clear(),super.destroy()}};Be=En($s);$o=new WeakMap;Co=new WeakMap;hn=new WeakMap;bt=new WeakMap;yn=new WeakSet;Ic=function(){const{roots:e,registeredRules:t}=this;for(const r of e)H(this,hn).add(r);const n=new Map;for(const r of H(this,hn)){const i=e.has(r);if(!i&&!Ah(r)){H(this,hn).delete(r);continue}for(const[s,a]of t){if(!i&&!a)continue;let o=n.get(r);o||(o=new Set,n.set(r,o)),o.add(s)}}for(const[r,i]of H(this,bt)){const s=n.get(r);for(const[a,o]of i)s?.has(a)||(o(),i.delete(a));i.size===0&&H(this,bt).delete(r)}for(const[r,i]of n){let s=H(this,bt).get(r);s||(s=new Map,H(this,bt).set(r,s));for(const a of i)s.has(a)||s.set(a,qt(this,yn,Rc).call(this,r,a))}};Rc=function(e,t){let n=pi.get(e);n||(n=new Map,pi.set(e,n));let r=n.get(t);if(!r){const s=mo(e)?qt(this,yn,Mc).call(this,e,n,t):qt(this,yn,zc).call(this,e,n,t);if(!s)return()=>{};r=s,n.set(t,r)}r.refCount++;let i=!1;return()=>{i||(i=!0,r.refCount--,r.refCount===0&&r.cleanup())}};Mc=function(e,t,n){var r;const i=e.createElement("style"),{nonce:s}=(r=this.options)!=null?r:{};s&&i.setAttribute("nonce",s),i.textContent=n,e.head.prepend(i);const a=new MutationObserver(o=>{for(const l of o)for(const c of Array.from(l.removedNodes))if(c===i){e.head.prepend(i);return}});return a.observe(e.head,{childList:!0}),{refCount:0,cleanup:()=>{a.disconnect(),i.remove(),t.delete(n),t.size===0&&pi.delete(e)}}};zc=function(e,t,n){!("adoptedStyleSheets"in e&&Array.isArray(e.adoptedStyleSheets))&&process.env.NODE_ENV!=="production"&&console.error("Cannot inject styles: This browser doesn't support adoptedStyleSheets");const r=e.ownerDocument.defaultView,{CSSStyleSheet:i}=r??{};if(!i)return process.env.NODE_ENV!=="production"&&console.error("Cannot inject styles: CSSStyleSheet constructor not available"),null;const s=new i;return s.replaceSync(n),e.adoptedStyleSheets.push(s),{refCount:0,cleanup:()=>{var a;if(Ai(e)&&((a=e.host)!=null&&a.isConnected)){const o=e.adoptedStyleSheets.indexOf(s);o!==-1&&e.adoptedStyleSheets.splice(o,1)}t.delete(n),t.size===0&&pi.delete(e)}}};ze(Be,4,"registeredRules",Tc,ut,$o);ze(Be,4,"additionalRoots",Dc,ut,Co);ze(Be,2,"sourceRoot",Oc,ut);ze(Be,2,"targetRoot",Ac,ut);ze(Be,2,"roots",Ec,ut);Ut(Be,ut);ut.configure=kr(ut);var Di=ut,Oh=class extends xe{constructor(e,t){super(e,t),this.manager=e;const{cursor:n="grabbing"}=t??{},r=e.registry.plugins.get(Di),i=r?.register(`* { cursor: ${n} !important; }`);if(i){const s=this.destroy.bind(this);this.destroy=()=>{i(),s()}}}},$r="data-dnd-",Cs=`${$r}dropping`,ve="--dnd-",Ze=`${$r}dragging`,fi=`${$r}placeholder`,Dh=[Ze,fi,"popover","aria-pressed","aria-grabbing"],Th=["view-transition-name"],Ih=`
9
+ :is(:root,:host) [${Ze}] {
10
+ position: fixed !important;
11
+ pointer-events: none !important;
12
+ touch-action: none;
13
+ z-index: calc(infinity);
14
+ will-change: translate;
15
+ top: var(${ve}top, 0px) !important;
16
+ left: var(${ve}left, 0px) !important;
17
+ right: unset !important;
18
+ bottom: unset !important;
19
+ width: var(${ve}width, auto);
20
+ max-width: var(${ve}width, auto);
21
+ height: var(${ve}height, auto);
22
+ max-height: var(${ve}height, auto);
23
+ transform: var(${ve}transform, none) !important;
24
+ transition: var(${ve}transition) !important;
25
+ }
26
+
27
+ :is(:root,:host) [${fi}] {
28
+ transition: none;
29
+ }
30
+
31
+ :is(:root,:host) [${fi}='hidden'] {
32
+ visibility: hidden;
33
+ }
34
+
35
+ [${Ze}] * {
36
+ pointer-events: none !important;
37
+ }
38
+
39
+ [${Ze}]:not([${Cs}]) {
40
+ translate: var(${ve}translate) !important;
41
+ }
42
+
43
+ [${Ze}][style*='${ve}scale'] {
44
+ scale: var(${ve}scale) !important;
45
+ transform-origin: var(${ve}transform-origin) !important;
46
+ }
47
+
48
+ @layer dnd-kit {
49
+ :where([${Ze}][popover]) {
50
+ overflow: visible;
51
+ background: unset;
52
+ border: unset;
53
+ margin: unset;
54
+ padding: unset;
55
+ color: inherit;
56
+
57
+ &:is(input, button) {
58
+ border: revert;
59
+ background: revert;
60
+ }
61
+ }
62
+ }
63
+ [${Ze}]::backdrop, [${$r}overlay]:not([${Ze}]) {
64
+ display: none;
65
+ visibility: hidden;
66
+ }
67
+ `.replace(/\n+/g," ").replace(/\s+/g," ").trim();function Rh(e,t="hidden"){return q(()=>{const{element:n,manager:r}=e;if(!n||!r)return;const i=Mh(n,r.registry.droppables),s=[],a=Cd(n),{remove:o}=a;return zh(i,a,s),Lh(a,t),a.remove=()=>{s.forEach(l=>l()),o.call(a)},a})}function Mh(e,t){const n=new Map;for(const r of t)if(r.element&&(e===r.element||e.contains(r.element))){const i=`${$r}${_s("dom-id")}`;r.element.setAttribute(i,""),n.set(r,i)}return n}function zh(e,t,n){for(const[r,i]of e){if(!r.element)continue;const s=`[${i}]`,a=t.matches(s)?t:t.querySelector(s);if(r.element.removeAttribute(i),!a)continue;const o=r.element;r.proxy=a,a.removeAttribute(i),ys.set(o,a),n.push(()=>{ys.delete(o),r.proxy=void 0})}}function Lh(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(fi,t)}function Lc(e,t){return e===t?!0:mn(e)===mn(t)}function ga(e){const{target:t}=e;"newState"in e&&e.newState==="closed"&&Ft(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>dn(t))}function Ps(e){return e.tagName==="TR"}function Wh(e,t,n){const r=new MutationObserver(i=>{let s=!1;for(const a of i){if(a.target!==e){s=!0;continue}if(a.type!=="attributes")continue;const o=a.attributeName;if(o.startsWith("aria-")||Dh.includes(o))continue;const l=e.getAttribute(o);if(o==="style"){if(ar(e)&&ar(t)){const c=e.style;for(const u of Array.from(t.style))c.getPropertyValue(u)===""&&t.style.removeProperty(u);for(const u of Array.from(c)){if(Th.includes(u)||u.startsWith(ve))continue;const h=c.getPropertyValue(u);t.style.setProperty(u,h)}}}else l!==null?t.setAttribute(o,l):t.removeAttribute(o)}s&&n&&t.replaceChildren(...e.cloneNode(!0).childNodes)});return r.observe(e,{attributes:!0,subtree:!0,childList:!0}),r}function jh(e,t,n){const r=new MutationObserver(i=>{for(const s of i)if(s.addedNodes.length!==0)for(const a of Array.from(s.addedNodes)){if(a.contains(e)&&e.nextElementSibling!==t){e.insertAdjacentElement("afterend",t),dn(n);return}if(a.contains(t)&&t.previousElementSibling!==e){t.insertAdjacentElement("beforebegin",e),dn(n);return}}e.isConnected&&t.isConnected&&e.nextElementSibling!==t&&(e.insertAdjacentElement("afterend",t),dn(n))});return r.observe(e.ownerDocument.body,{childList:!0,subtree:!0}),r}function Bh(e){return new ResizeObserver(()=>{var t,n,r;const i=new Qe(e.placeholder,{frameTransform:e.frameTransform,ignoreTransforms:!0}),s=(t=e.transformOrigin)!=null?t:{x:1,y:1},a=(e.width-i.width)*s.x+e.delta.x,o=(e.height-i.height)*s.y+e.delta.y,l=hc();if(e.styles.set({width:i.width-e.widthOffset,height:i.height-e.heightOffset,top:e.top+o+l.y,left:e.left+a+l.x},ve),(n=e.getElementMutationObserver())==null||n.takeRecords(),Ps(e.element)&&Ps(e.placeholder)){const b=Array.from(e.element.cells),y=Array.from(e.placeholder.cells);e.getSavedCellWidths()||e.setSavedCellWidths(b.map(x=>x.style.width));for(const[x,m]of b.entries()){const v=y[x];m.style.width=`${v.getBoundingClientRect().width}px`}}const c=(r=e.getTranslate())!=null?r:{x:0,y:0},u=e.left+a+l.x+c.x,h=e.top+o+l.y+c.y,p=i.width-e.widthOffset,f=i.height-e.heightOffset,g=e.frameTransform;e.dragOperation.shape=new Je(u*g.scaleX+g.x,h*g.scaleY+g.y,p*g.scaleX,f*g.scaleY)})}var Nh=250,Fh="ease";function qh(e){var t,n,r,i;const{animation:s}=e;if(typeof s=="function"){const m=s({source:e.source,element:e.element,feedbackElement:e.feedbackElement,placeholder:e.placeholder,translate:e.translate,moved:e.moved});Promise.resolve(m).then(()=>{e.cleanup(),requestAnimationFrame(e.restoreFocus)});return}const{duration:a=Nh,easing:o=Fh}=s??{};dn(e.feedbackElement);const[,l]=(t=uc(e.feedbackElement,m=>"translate"in m))!=null?t:[];l?.pause();const c=(n=e.placeholder)!=null?n:e.element,u={frameTransform:Lc(e.feedbackElement,c)?null:void 0},h=new Qe(e.feedbackElement,u),p=(r=fr(rt(e.feedbackElement).translate))!=null?r:e.translate,f=new Qe(c,u),g=Je.delta(h,f,e.alignment),b={x:p.x-g.x,y:p.y-g.y},y=Math.round(h.intrinsicHeight)!==Math.round(f.intrinsicHeight)?{minHeight:[`${h.intrinsicHeight}px`,`${f.intrinsicHeight}px`],maxHeight:[`${h.intrinsicHeight}px`,`${f.intrinsicHeight}px`]}:{},x=Math.round(h.intrinsicWidth)!==Math.round(f.intrinsicWidth)?{minWidth:[`${h.intrinsicWidth}px`,`${f.intrinsicWidth}px`],maxWidth:[`${h.intrinsicWidth}px`,`${f.intrinsicWidth}px`]}:{};e.styles.set({transition:e.transition},ve),e.feedbackElement.setAttribute(Cs,""),(i=e.getElementMutationObserver())==null||i.takeRecords(),wc({element:e.feedbackElement,keyframes:_o(vr(vr({},y),x),{translate:[`${p.x}px ${p.y}px 0`,`${b.x}px ${b.y}px 0`]}),options:{duration:yo(Me(e.feedbackElement))?0:e.moved||e.feedbackElement!==e.element?a:0,easing:o}}).then(()=>{e.feedbackElement.removeAttribute(Cs),l?.finish(),e.cleanup(),requestAnimationFrame(e.restoreFocus)})}var Wc,Es,mr,Po,ri,jc,Bc,xn=class extends(Es=xe,Wc=[U],Es){constructor(t,n){super(t,n),ne(this,ri),ne(this,Po,ce(mr,8,this)),ce(mr,11,this),this.state={initial:{},current:{}};const r=t.registry.plugins.get(Di),i=r?.register(Ih,{retain:!0});if(i){const s=this.destroy.bind(this);this.destroy=()=>{i(),s()}}this.registerEffect(qt(this,ri,jc).bind(this,r)),this.registerEffect(qt(this,ri,Bc))}};mr=En(Es);Po=new WeakMap;ri=new WeakSet;jc=function(e){const{overlay:t}=this;if(!t||!e)return;const n=li(t);if(n)return e.addRoot(n)};Bc=function(){var e,t,n,r,i,s,a;const{state:o,manager:l,options:c}=this,{dragOperation:u}=l,{position:h,source:p,status:f}=u;if(f.idle){o.current={},o.initial={};return}if(!p)return;const{element:g}=p,b=p.pluginConfig(xn),y=(t=(e=b?.feedback)!=null?e:c?.feedback)!=null?t:"default",x=typeof y=="function"?y(p,l):y;if(!g||x==="none"||!f.initialized||f.initializing)return;const{initial:m}=o,v=(n=this.overlay)!=null?n:g,w=bn(v),k=bn(g),$=!Lc(g,v),E=new Qe(g,{frameTransform:$?k:null,ignoreTransforms:!$}),O={x:k.scaleX/w.scaleX,y:k.scaleY/w.scaleY};let{width:V,height:B,top:P,left:Q}=E;$&&(V=V/O.x,B=B/O.y);const se=new sh(v),dt=rt(g),{transition:ht,translate:On,boxSizing:Yt,paddingBlockStart:Li,paddingBlockEnd:Wi,paddingInlineStart:ji,paddingInlineEnd:Fe,borderInlineStartWidth:Ke,borderInlineEndWidth:Dn,borderBlockStartWidth:Dr,borderBlockEndWidth:Bi}=dt,Gt=ht.split(",").filter(ee=>!/^\s*(transform|translate|scale)\b/.test(ee)).join(","),st=Oi(dt),Zt=dt.transform,Ye=x==="clone",ot=Yt==="content-box",Qt=ot?parseInt(ji)+parseInt(Fe)+parseInt(Ke)+parseInt(Dn):0,Tr=ot?parseInt(Li)+parseInt(Wi)+parseInt(Dr)+parseInt(Bi):0,be=x!=="move"&&!this.overlay?Rh(p,Ye?"clone":"hidden"):null,Tn=q(()=>gr(l.dragOperation.activatorEvent));if(!m.translate){if(this.overlay&&st)m.translate={x:st.x,y:st.y};else if(On!=="none"){const ee=fr(On);ee&&(m.translate=ee)}}if(!m.transformOrigin){const ee=q(()=>h.current),he=Q+((r=st?.x)!=null?r:0),Ee=P+((i=st?.y)!=null?i:0);m.transformOrigin={x:(ee.x-he*w.scaleX-w.x)/(V*w.scaleX),y:(ee.y-Ee*w.scaleY-w.y)/(B*w.scaleY)}}const{transformOrigin:Ge}=m,Ir=P*w.scaleY+w.y,In=Q*w.scaleX+w.x;if(!m.coordinates&&(m.coordinates={x:In,y:Ir},O.x!==1||O.y!==1)){const{scaleX:ee,scaleY:he}=k,{x:Ee,y:pt}=Ge;m.coordinates.x+=(V*ee-V)*Ee,m.coordinates.y+=(B*he-B)*pt}m.dimensions||(m.dimensions={width:V,height:B}),m.frameTransform||(m.frameTransform=w);const Rr={x:m.coordinates.x-In,y:m.coordinates.y-Ir},C={width:(m.dimensions.width*m.frameTransform.scaleX-V*w.scaleX)*Ge.x,height:(m.dimensions.height*m.frameTransform.scaleY-B*w.scaleY)*Ge.y},A={x:Rr.x/w.scaleX+C.width,y:Rr.y/w.scaleY+C.height},I={left:Q+A.x,top:P+A.y};v.setAttribute(Ze,"true");const L=q(()=>u.transform),J=(s=m.translate)!=null?s:{x:0,y:0},ue=L.x*w.scaleX+J.x,X=L.y*w.scaleY+J.y,R=hc();se.set({width:V-Qt,height:B-Tr,top:I.top+R.y,left:I.left+R.x,translate:`${ue}px ${X}px 0`,transform:this.overlay?"none":Zt,transition:Gt?`${Gt}, translate 0ms linear`:"translate 0ms linear",scale:$?`${O.x} ${O.y}`:"","transform-origin":`${Ge.x*100}% ${Ge.y*100}%`},ve),be&&(g.insertAdjacentElement("afterend",be),c?.rootElement&&(typeof c.rootElement=="function"?c.rootElement(p):c.rootElement).appendChild(g)),ws(v)&&(v.hasAttribute("popover")||v.setAttribute("popover","manual"),dn(v),v.addEventListener("beforetoggle",ga));let N,S,j;const re=Bh({placeholder:be,element:g,feedbackElement:v,frameTransform:w,transformOrigin:Ge,width:V,height:B,top:P,left:Q,widthOffset:Qt,heightOffset:Tr,delta:A,styles:se,dragOperation:u,getTranslate:()=>o.current.translate,getElementMutationObserver:()=>N,getSavedCellWidths:()=>j,setSavedCellWidths:ee=>{j=ee}}),F=new Qe(v);q(()=>u.shape=F);const D=Me(v),Y=ee=>{this.manager.actions.stop({event:ee})},oe=yo(D);Tn&&D.addEventListener("resize",Y),q(()=>p.status)==="idle"&&requestAnimationFrame(()=>p.status="dragging"),be&&(re.observe(be),N=Wh(g,be,Ye),S=jh(g,be,v));const de=(a=l.dragOperation.source)==null?void 0:a.id,Pe=()=>{var ee;if(!Tn||de==null)return;const he=l.registry.draggables.get(de),Ee=(ee=he?.handle)!=null?ee:he?.element;_t(Ee)&&Ee.focus()},Le=()=>{N?.disconnect(),S?.disconnect(),re.disconnect(),D.removeEventListener("resize",Y),ws(v)&&(v.removeEventListener("beforetoggle",ga),v.removeAttribute("popover")),v.removeAttribute(Ze),se.reset();const ee=()=>{var he;if(j&&Ps(g)){const Ni=Array.from(g.cells);for(const[zr,Jt]of Ni.entries())Jt.style.width=(he=j[zr])!=null?he:""}p.status="idle";const Ee=o.current.translate!=null,pt=u.status.dragging;be&&(!pt&&Ee||be.parentElement!==v.parentElement)&&v.isConnected&&be.replaceWith(v),be?.remove()};v===this.overlay?setTimeout(ee,0):ee()},at=c?.dropAnimation,Rn=this,Mr=xr(()=>{var ee,he,Ee;const{transform:pt,status:Ni}=u;if(!(!pt.x&&!pt.y&&!o.current.translate)&&Ni.dragging){const zr=(ee=m.translate)!=null?ee:{x:0,y:0},Jt={x:pt.x/w.scaleX+zr.x,y:pt.y/w.scaleY+zr.y},Go=o.current.translate,$u=q(()=>u.modifiers),Fi=q(()=>{var zn;return(zn=u.shape)==null?void 0:zn.current}),Mn=c?.keyboardTransition,Zo=Tn&&!oe&&Mn!==null?`${(he=Mn?.duration)!=null?he:250}ms ${(Ee=Mn?.easing)!=null?Ee:"cubic-bezier(0.25, 1, 0.5, 1)"}`:"0ms linear";if(se.set({transition:Gt?`${Gt}, translate ${Zo}`:`translate ${Zo}`,translate:`${Jt.x}px ${Jt.y}px 0`},ve),N?.takeRecords(),Fi&&Fi!==F&&Go&&!$u.length){const zn=je.delta(Jt,Go);u.shape=Je.from(Fi.boundingRectangle).translate(zn.x*w.scaleX,zn.y*w.scaleY)}else u.shape=new Qe(v);o.current.translate=Jt}},function(){if(u.status.dropped){this.dispose(),p.status="dropping";const ee=b?.dropAnimation!==void 0?b.dropAnimation:Rn.dropAnimation!==void 0?Rn.dropAnimation:at;let he=o.current.translate;const Ee=he!=null;if(!he&&g!==v&&(he={x:0,y:0}),!he||ee===null){Le();return}l.renderer.rendering.then(()=>{qh({source:p,element:g,feedbackElement:v,placeholder:be,translate:he,moved:Ee,transition:ht,alignment:p.alignment,styles:se,animation:ee??void 0,getElementMutationObserver:()=>N,cleanup:Le,restoreFocus:Pe})})}});return()=>{Le(),Mr()}};ze(mr,4,"overlay",Wc,xn,Po);Ut(mr,xn);xn.configure=kr(xn);var Eo=xn,Ln=!0,Vh=!1,Nc,Fc,qc,Vc,yt,Ao,Oo;Vc=(qc=[U],Ne.Forward),Fc=(Nc=[U],Ne.Reverse);var br=class{constructor(){ne(this,Ao,ce(yt,8,this,Ln)),ce(yt,11,this),ne(this,Oo,ce(yt,12,this,Ln)),ce(yt,15,this)}isLocked(e){return e===Ne.Idle?!1:e==null?this[Ne.Forward]===Ln&&this[Ne.Reverse]===Ln:this[e]===Ln}unlock(e){e!==Ne.Idle&&(this[e]=Vh)}};yt=En(null);Ao=new WeakMap;Oo=new WeakMap;ze(yt,4,Vc,qc,br,Ao);ze(yt,4,Fc,Nc,br,Oo);Ut(yt,br);var Xh=[Ne.Forward,Ne.Reverse],va=class{constructor(){this.x=new br,this.y=new br}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},Hh=class extends xe{constructor(e){super(e);const t=$t(new va);let n=null;this.signal=t,Re(()=>{const{status:r}=e.dragOperation;if(!r.initialized){n=null,t.value=new va;return}const{delta:i}=e.dragOperation.position;if(n){const s={x:ma(i.x,n.x),y:ma(i.y,n.y)},a=t.peek();ae(()=>{for(const o of yl)for(const l of Xh)s[o]===l&&a[o].unlock(l);t.value=a})}n=i})}get current(){return this.signal.peek()}};function ma(e,t){return Math.sign(e-t)}var Xc,As,yr,Do,vt,Os,Cr=class extends(As=_r,Xc=[U],As){constructor(e){super(e),ne(this,Do,ce(yr,8,this,!1)),ce(yr,11,this),ne(this,vt),ne(this,Os,()=>{if(!H(this,vt))return;const{element:s,by:a}=H(this,vt);a.y&&(s.scrollTop+=a.y),a.x&&(s.scrollLeft+=a.x)}),this.scroll=(s,a)=>{var o;if(this.disabled)return!1;const l=this.getScrollableElements();if(!l)return _e(this,vt,void 0),!1;const{position:c}=this.manager.dragOperation,u=c?.current;if(u){const{by:h}=s??{},p=h?{x:ba(h.x),y:ba(h.y)}:void 0,f=p?void 0:this.scrollIntentTracker.current;if(f?.isLocked())return!1;for(const g of l){const b=xo(g),y=jd(g,h,b);if(y.x||y.y){const{speed:x,direction:m}=Gd(g,u,p,a?.acceleration,a?.threshold,void 0,b);if(f)for(const v of yl)f[v].isLocked(m[v])&&(x[v]=0,m[v]=0);if(m.x||m.y){const{x:v,y:w}=h??m,k=v*x.x,$=w*x.y;if(k||$){const E=(o=H(this,vt))==null?void 0:o.by;if(this.autoScrolling&&E&&(E.x&&!k||E.y&&!$))continue;return _e(this,vt,{element:g,by:{x:k,y:$}}),pr.schedule(H(this,Os)),!0}}}}}return _e(this,vt,void 0),!1};let t=null,n=null;const r=is(()=>{const{position:s,source:a}=e.dragOperation;if(!s)return null;const o=pc(li(a?.element),s.current);return o&&(t=o),o??t}),i=is(()=>{const s=r.value,{documentElement:a}=Nt(s);if(!s||s===a){const{target:o}=e.dragOperation,l=o?.element;if(l){const c=ks(l,{excludeElement:!1});return n=c,c}}if(s){const o=ks(s,{excludeElement:!1});return this.autoScrolling&&n&&o.size<n?.size?n:(n=o,o)}return n=null,null},ss);this.getScrollableElements=()=>i.value,this.scrollIntentTracker=new Hh(e),this.destroy=e.monitor.addEventListener("dragmove",s=>{this.disabled||s.defaultPrevented||!gr(e.dragOperation.activatorEvent)||!s.by||this.scroll({by:s.by})&&s.preventDefault()})}};yr=En(As);Do=new WeakMap;vt=new WeakMap;Os=new WeakMap;ze(yr,4,"autoScrolling",Xc,Cr,Do);Ut(yr,Cr);function ba(e){return e>0?Ne.Forward:e<0?Ne.Reverse:Ne.Idle}var Uh=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:t,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const r of t)r();for(const r of n)r()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(t=>this.resolvers.add(t))}},Kh=new Uh(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),Yh=10,Ds=class extends xe{constructor(t,n){super(t,n);const r=t.registry.plugins.get(Cr);if(!r)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=Re(()=>{var i,s,a;if(this.disabled)return;const{position:o,status:l}=t.dragOperation;if(l.dragging){const c={acceleration:(i=this.options)==null?void 0:i.acceleration,threshold:typeof((s=this.options)==null?void 0:s.threshold)=="number"?{x:this.options.threshold,y:this.options.threshold}:(a=this.options)==null?void 0:a.threshold};if(r.scroll(void 0,c)){r.autoScrolling=!0;const h=setInterval(()=>Kh.schedule(()=>r.scroll(void 0,c)),Yh);return()=>{clearInterval(h)}}else r.autoScrolling=!1}})}};Ds.configure=kr(Ds);var Hc=Ds,ya={capture:!0,passive:!0},Gn,Gh=class extends _r{constructor(e){super(e),ne(this,Gn),this.handleScroll=()=>{H(this,Gn)==null&&_e(this,Gn,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),_e(this,Gn,void 0)},50))};const{dragOperation:t}=this.manager;this.destroy=Re(()=>{var n,r,i;if(t.status.dragging){const a=(i=(r=(n=t.source)==null?void 0:n.element)==null?void 0:r.ownerDocument)!=null?i:document;return a.addEventListener("scroll",this.handleScroll,ya),()=>{a.removeEventListener("scroll",this.handleScroll,ya)}}})}};Gn=new WeakMap;var Zh="* { user-select: none !important; -webkit-user-select: none !important; }",Qh=class extends xe{constructor(e){super(e),this.manager=e;const t=e.registry.plugins.get(Di),n=t?.register(Zh);if(this.destroy=Re(()=>{const{dragOperation:r}=this.manager;if(r.status.initialized)return Gi(),document.addEventListener("selectionchange",Gi,{capture:!0}),()=>{document.removeEventListener("selectionchange",Gi,{capture:!0})}}),n){const r=this.destroy.bind(this);this.destroy=()=>{n(),r()}}}};function Gi(){var e;(e=document.getSelection())==null||e.removeAllRanges()}function Pt(e,t){const n=xa(e.key);return t.some(r=>xa(r)===n)}var Jh=new Set(["alt","altgraph","backspace","capslock","control","delete","end","enter","escape","home","insert","meta","pagedown","pageup","pause","printscreen","shift","space","tab","arrowdown","arrowleft","arrowright","arrowup","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12"]);function xa(e){if(e===" "||e==="Spacebar")return"space";if(/^Key[A-Z]$/.test(e))return e.slice(3).toLowerCase();if(/^Digit[0-9]$/.test(e))return e.slice(5);if(e.length===1)return e.toLowerCase();const t=e.toLowerCase();return Jh.has(t)?t:e}var Zn=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(e,t){var n;const r=(n=t.handle)!=null?n:t.element;return e.target!==r}}),on,gi=class extends gn{constructor(t,n){super(t),this.manager=t,this.options=n,ne(this,on,[]),this.listeners=new fc,this.handleSourceKeyDown=(r,i,s)=>{if(this.disabled||r.defaultPrevented||!Ft(r.target)||i.disabled)return;const{keyboardCodes:a=Zn.keyboardCodes,preventActivation:o=Zn.preventActivation}=s??{};Pt(r,a.start)&&this.manager.dragOperation.status.idle&&(o?.(r,i)||this.handleStart(r,i,s))}}bind(t,n=this.options){return Re(()=>{var i;const s=(i=t.handle)!=null?i:t.element,a=o=>{gr(o)&&this.handleSourceKeyDown(o,t,n)};if(s)return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a)}})}handleStart(t,n,r){const{element:i}=n;if(!i)throw new Error("Source draggable does not have an associated element");t.preventDefault(),t.stopImmediatePropagation(),xc(i);const{center:s}=new Qe(i);if(this.manager.actions.start({event:t,coordinates:{x:s.x,y:s.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();const o=Nt(i),l=[this.listeners.bind(o,[{type:"keydown",listener:c=>this.handleKeyDown(c,n,r),options:{capture:!0}}])];H(this,on).push(...l)}handleKeyDown(t,n,r){const{keyboardCodes:i=Zn.keyboardCodes}=r??{};if(Pt(t,[...i.end,...i.cancel])){t.preventDefault();const s=Pt(t,i.cancel);this.handleEnd(t,s);return}Pt(t,i.up)?this.handleMove("up",t):Pt(t,i.down)&&this.handleMove("down",t),Pt(t,i.left)?this.handleMove("left",t):Pt(t,i.right)&&this.handleMove("right",t)}handleEnd(t,n){this.manager.actions.stop({event:t,canceled:n}),this.cleanup()}handleMove(t,n){var r,i;const{shape:s}=this.manager.dragOperation,a=n.shiftKey?5:1;let o={x:0,y:0},l=(i=(r=this.options)==null?void 0:r.offset)!=null?i:Zn.offset;if(typeof l=="number"&&(l={x:l,y:l}),!!s){switch(t){case"up":o={x:0,y:-l.y*a};break;case"down":o={x:0,y:l.y*a};break;case"left":o={x:-l.x*a,y:0};break;case"right":o={x:l.x*a,y:0};break}(o.x||o.y)&&(n.preventDefault(),this.manager.actions.move({event:n,by:o}))}}sideEffects(){const t=this.manager.registry.plugins.get(Hc);t?.disabled===!1&&(t.disable(),H(this,on).push(()=>{t.enable()}))}cleanup(){H(this,on).forEach(t=>t()),_e(this,on,[])}destroy(){this.cleanup(),this.listeners.clear()}};on=new WeakMap;gi.configure=kr(gi);gi.defaults=Zn;var ep=gi,Mt,tp=class extends Ql{constructor(){super(...arguments),ne(this,Mt)}onEvent(e){switch(e.type){case"pointerdown":_e(this,Mt,vn(e));break;case"pointermove":if(!H(this,Mt))return;const{x:t,y:n}=vn(e),r={x:t-H(this,Mt).x,y:n-H(this,Mt).y},{tolerance:i}=this.options;if(i&&fs(r,i)){this.abort();return}fs(r,this.options.value)&&this.activate(e);break;case"pointerup":this.abort();break}}abort(){_e(this,Mt,void 0)}};Mt=new WeakMap;var an,zt,np=class extends Ql{constructor(){super(...arguments),ne(this,an),ne(this,zt)}onEvent(e){switch(e.type){case"pointerdown":_e(this,zt,vn(e)),_e(this,an,setTimeout(()=>this.activate(e),this.options.value));break;case"pointermove":if(!H(this,zt))return;const{x:t,y:n}=vn(e),r={x:t-H(this,zt).x,y:n-H(this,zt).y};fs(r,this.options.tolerance)&&this.abort();break;case"pointerup":this.abort();break}}abort(){H(this,an)&&(clearTimeout(H(this,an)),_e(this,zt,void 0),_e(this,an,void 0))}};an=new WeakMap;zt=new WeakMap;var jt=class{};jt.Delay=np;jt.Distance=tp;var Ts=Object.freeze({activationConstraints(e,t){var n;const{pointerType:r,target:i}=e;if(!(r==="mouse"&&Ft(i)&&(t.handle===i||(n=t.handle)!=null&&n.contains(i))))return r==="touch"?[new jt.Delay({value:250,tolerance:5})]:ah(i)&&!e.defaultPrevented?[new jt.Delay({value:200,tolerance:0})]:[new jt.Delay({value:200,tolerance:10}),new jt.Distance({value:5})]},preventActivation(e,t){var n;const{target:r}=e;if(r===t.element||r===t.handle||!Ft(r)||(n=t.handle)!=null&&n.contains(r))return!1;const i=Ed(r);return i===t.element?!1:!!i}}),ln,vi=class extends gn{constructor(t,n){super(t),this.manager=t,this.options=n,ne(this,ln,new Set),this.listeners=new fc,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{const{event:r,coordinates:i}=this.latest;!r||!i||this.manager.actions.move({event:r,to:i})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(t,n,r=this.options){const{activationConstraints:i=Ts.activationConstraints}=r??{};return typeof i=="function"?i(t,n):i}bind(t,n=this.options){return Re(()=>{var i;const s=new AbortController,{signal:a}=s,o=c=>{oh(c)&&this.handlePointerDown(c,t,n)};let l=[(i=t.handle)!=null?i:t.element];n?.activatorElements&&(Array.isArray(n.activatorElements)?l=n.activatorElements:l=n.activatorElements(t));for(const c of l)c&&(sp(c.ownerDocument.defaultView),c.addEventListener("pointerdown",o,{signal:a}));return()=>s.abort()})}handlePointerDown(t,n,r){if(this.disabled||!t.isPrimary||t.button!==0||!Ft(t.target)||n.disabled||rp(t)||!this.manager.dragOperation.status.idle)return;const{preventActivation:i=Ts.preventActivation}=r??{};if(i?.(t,n))return;const{target:s}=t,a=_t(s)&&s.draggable&&s.getAttribute("draggable")==="true",o=bn(n.element),{x:l,y:c}=vn(t);this.initialCoordinates={x:l*o.scaleX+o.x,y:c*o.scaleY+o.y};const u=this.activationConstraints(t,n,r);t.sensor=this;const h=new bd(u,b=>this.handleStart(n,b));h.signal.onabort=()=>this.handleCancel(t),h.onEvent(t),this.controller=h;const p=bs(),f=this.listeners.bind(p,[{type:"pointermove",listener:b=>this.handlePointerMove(b,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:a?this.handleCancel:Br,options:{capture:!0}}]),g=()=>{f(),this.initialCoordinates=void 0};H(this,ln).add(g)}handlePointerMove(t,n){var r,i;((r=this.controller)==null?void 0:r.activated)===!1&&((i=this.controller)==null||i.onEvent(t));const{status:s}=this.manager.dragOperation;if(s.initializing||s.dragging){const a=vn(t),o=bn(n.element);a.x=a.x*o.scaleX+o.x,a.y=a.y*o.scaleY+o.y,t.preventDefault(),t.stopPropagation(),this.latest.event=t,this.latest.coordinates=a,s.dragging&&pr.schedule(this.handleMove)}}handlePointerUp(t){const{status:n}=this.manager.dragOperation;if(!n.idle){t.preventDefault(),t.stopPropagation();const r=!n.initialized,i=Nt(t.target),s=i.defaultView;if(!r&&s){const a=o=>{o.target===i.body&&o.detail>0&&(o.preventDefault(),o.stopImmediatePropagation())};s.addEventListener("click",a,!0),s.setTimeout(()=>{s.removeEventListener("click",a,!0)},0)}this.manager.actions.stop({event:t,canceled:r})}this.cleanup()}handleKeyDown(t){t.key==="Escape"&&(t.preventDefault(),this.handleCancel(t))}handleStart(t,n){const{manager:r,initialCoordinates:i}=this;if(!i||!r.dragOperation.status.idle||n.defaultPrevented)return;const s=r.actions.start({coordinates:i,event:n,source:t});if(s.signal.aborted)return this.cleanup();n.preventDefault();const o=Nt(n.target).body;try{o.setPointerCapture(n.pointerId)}catch{this.handleCancel(n);return}const l=Ft(n.target)?[n.target,o]:o,c=this.listeners.bind(l,[{type:"touchmove",listener:Br,options:{passive:!1}},{type:"click",listener:Br},{type:"contextmenu",listener:Br},{type:"keydown",listener:this.handleKeyDown}]);H(this,ln).add(c),r.renderer.rendering.then(()=>{!s.signal.aborted&&r.dragOperation.status.dragging&&pr.schedule(this.handleMove)})}handleCancel(t){const{dragOperation:n}=this.manager;n.status.initialized&&this.manager.actions.stop({event:t,canceled:!0}),this.cleanup()}cleanup(){const{controller:t}=this;this.controller=void 0,t&&!t.signal.aborted&&t.abort(),this.latest={event:void 0,coordinates:void 0},H(this,ln).forEach(n=>n()),H(this,ln).clear()}destroy(){this.cleanup(),this.listeners.clear()}};ln=new WeakMap;vi.configure=kr(vi);vi.defaults=Ts;var Uc=vi;function rp(e){return"sensor"in e}function Br(e){e.preventDefault()}function ip(){}var wa=new WeakSet;function sp(e){!e||wa.has(e)||(e.addEventListener("touchmove",ip,{capture:!1,passive:!1}),wa.add(e))}var pn={modifiers:[],plugins:[Ph,Hc,Oh,Eo,Qh],sensors:[Uc,ep]},op=class extends wd{constructor(e={}){const t=He(e.plugins,pn.plugins),n=He(e.sensors,pn.sensors),r=He(e.modifiers,pn.modifiers);super(_o(vr({},e),{plugins:[Gh,Cr,Di,...t],sensors:n,modifiers:r}))}},Kc,Yc,Is,xt,To,Io,Ti=class extends(Is=et,Yc=[U],Kc=[U],Is){constructor(e,t){var n=e,{element:r,effects:i=()=>[],handle:s}=n,a=Cc(n,["element","effects","handle"]);super(vr({effects:()=>[...i(),()=>{var o,l;const{manager:c}=this;if(!c)return;const h=((l=(o=this.sensors)==null?void 0:o.map(ur))!=null?l:[...c.sensors]).map(p=>{const f=p instanceof gn?p:c.registry.register(p.plugin),g=p instanceof gn?void 0:p.options;return f.bind(this,g)});return function(){h.forEach(f=>f())}}]},a),t),ne(this,To,ce(xt,8,this)),ce(xt,11,this),ne(this,Io,ce(xt,12,this)),ce(xt,15,this),this.element=r,this.handle=s}};xt=En(Is);To=new WeakMap;Io=new WeakMap;ze(xt,4,"handle",Yc,Ti,To);ze(xt,4,"element",Kc,Ti,Io);Ut(xt,Ti);var Gc,Zc,Rs,wt,Ro,Zi,Qc,Jc,lr,Mo,Ii=class extends(Rs=tt,Zc=[U],Gc=[U],Rs){constructor(e,t){var n=e,{element:r,effects:i=()=>[]}=n,s=Cc(n,["element","effects"]);const{collisionDetector:a=kc}=s,o=c=>{const{manager:u,element:h}=this;if(!h||c===null){this.shape=void 0;return}if(!u)return;const p=new Qe(h),f=q(()=>this.shape);return p&&f?.equals(p)?f:(this.shape=p,p)},l=$t(!1);super(_o(vr({},s),{collisionDetector:a,effects:()=>[...i(),()=>{const{element:c,manager:u}=this;if(!u)return;const{dragOperation:h}=u,{source:p}=h;l.value=!!(p&&h.status.initialized&&c&&!this.disabled&&this.accepts(p))},()=>{const{element:c}=this;if(l.value&&c){const u=new Wd(c,o);return()=>{u.disconnect(),this.shape=void 0}}},()=>{var c;if((c=this.manager)!=null&&c.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),ne(this,lr),ne(this,Ro,ce(wt,8,this)),ce(wt,11,this),ne(this,Mo,ce(wt,12,this)),ce(wt,15,this),this.element=r,this.refreshShape=()=>o()}set element(e){_e(this,lr,e,Jc)}get element(){var e;return(e=this.proxy)!=null?e:H(this,lr,Qc)}};wt=En(Rs);Ro=new WeakMap;lr=new WeakSet;Mo=new WeakMap;Zi=ze(wt,20,"#element",Zc,lr,Ro),Qc=Zi.get,Jc=Zi.set;ze(wt,4,"proxy",Gc,Ii,Mo);Ut(wt,Ii);var ap=Object.create,eu=Object.defineProperty,lp=Object.defineProperties,cp=Object.getOwnPropertyDescriptor,up=Object.getOwnPropertyDescriptors,mi=Object.getOwnPropertySymbols,tu=Object.prototype.hasOwnProperty,nu=Object.prototype.propertyIsEnumerable,dp=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Pr=e=>{throw TypeError(e)},Ms=(e,t,n)=>t in e?eu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cr=(e,t)=>{for(var n in t||(t={}))tu.call(t,n)&&Ms(e,n,t[n]);if(mi)for(var n of mi(t))nu.call(t,n)&&Ms(e,n,t[n]);return e},Qi=(e,t)=>lp(e,up(t)),hp=(e,t)=>{var n={};for(var r in e)tu.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mi)for(var r of mi(e))t.indexOf(r)<0&&nu.call(e,r)&&(n[r]=e[r]);return n},pp=e=>{var t;return[,,,ap((t=void 0)!=null?t:null)]},ru=["class","method","getter","setter","accessor","field","value","get","set"],Qn=e=>e!==void 0&&typeof e!="function"?Pr("Function expected"):e,fp=(e,t,n,r,i)=>({kind:ru[e],name:t,metadata:r,addInitializer:s=>n._?Pr("Already initialized"):i.push(Qn(s||null))}),gp=(e,t)=>Ms(t,dp("metadata"),e[3]),Nr=(e,t,n,r)=>{for(var i=0,s=e[t>>1],a=s&&s.length;i<a;i++)t&1?s[i].call(n):r=s[i].call(n,r);return r},iu=(e,t,n,r,i,s)=>{for(var a,o,l,c,u,h=t&7,p=!1,f=!1,g=e.length+1,b=ru[h+5],y=e[g-1]=[],x=e[g]||(e[g]=[]),m=(i=i.prototype,cp({get[n](){return Jn(this,s)},set[n](w){return Lt(this,s,w)}},n)),v=r.length-1;v>=0;v--)c=fp(h,n,l={},e[3],x),c.static=p,c.private=f,u=c.access={has:w=>n in w},u.get=w=>w[n],u.set=(w,k)=>w[n]=k,o=(0,r[v])({get:m.get,set:m.set},c),l._=1,o===void 0?Qn(o)&&(m[b]=o):typeof o!="object"||o===null?Pr("Object expected"):(Qn(a=o.get)&&(m.get=a),Qn(a=o.set)&&(m.set=a),Qn(a=o.init)&&y.unshift(a));return m&&eu(i,n,m),i},su=(e,t,n)=>t.has(e)||Pr("Cannot "+n),Jn=(e,t,n)=>(su(e,t,"read from private field"),t.get(e)),Wn=(e,t,n)=>t.has(e)?Pr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Lt=(e,t,n,r)=>(su(e,t,"write to private field"),t.set(e,n),n);function Te(e){return e instanceof Wo||e instanceof cu}var Fr=10,vp=class extends xe{constructor(e){super(e);const t=Re(()=>{const{dragOperation:r}=e;if(gr(r.activatorEvent)&&Te(r.source)&&r.status.initialized){const i=e.registry.plugins.get(Cr);if(i)return i.disable(),()=>i.enable()}}),n=e.monitor.addEventListener("dragmove",(r,i)=>{queueMicrotask(()=>{if(this.disabled||r.defaultPrevented||!r.nativeEvent)return;const{dragOperation:s}=i;if(!gr(r.nativeEvent)||!Te(s.source)||!s.shape)return;const{actions:a,collisionObserver:o,registry:l}=i,{by:c}=r;if(!c)return;const u=mp(c),{source:h,target:p}=s,{center:f}=s.shape.current,g=[],b=[];ae(()=>{for(const k of l.droppables){const{id:$}=k;if(!k.accepts(h)||$===p?.id&&Te(k)||!k.element)continue;let E=k.shape;const O=new Qe(k.element,{getBoundingClientRect:V=>hr(V,void 0,.2)});!O.height||!O.width||(u=="down"&&f.y+Fr<O.center.y||u=="up"&&f.y-Fr>O.center.y||u=="left"&&f.x-Fr>O.center.x||u=="right"&&f.x+Fr<O.center.x)&&(g.push(k),k.shape=O,b.push(()=>k.shape=E))}}),r.preventDefault(),o.disable();const y=o.computeCollisions(g,dh);ae(()=>b.forEach(k=>k()));const[x]=y;if(!x)return;const{id:m}=x,{index:v,group:w}=h.sortable;a.setDropTarget(m).then(()=>{const{source:k,target:$,shape:E}=s;if(!k||!Te(k)||!E)return;const{index:O,group:V,target:B}=k.sortable,P=v!==O||w!==V,Q=P?B:$?.element;if(!Q)return;xc(Q);const se=new Qe(Q);if(!se)return;const dt=Je.delta(se,Je.from(E.current.boundingRectangle),k.alignment);a.move({by:dt}),P?a.setDropTarget(k.id).then(()=>o.enable()):o.enable()})})});this.destroy=()=>{n(),t()}}};function mp(e){const{x:t,y:n}=e;if(t>0)return"right";if(t<0)return"left";if(n>0)return"down";if(n<0)return"up"}var bp=Object.defineProperty,yp=Object.defineProperties,xp=Object.getOwnPropertyDescriptors,ka=Object.getOwnPropertySymbols,wp=Object.prototype.hasOwnProperty,kp=Object.prototype.propertyIsEnumerable,_a=(e,t,n)=>t in e?bp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,en=(e,t)=>{for(var n in t||(t={}))wp.call(t,n)&&_a(e,n,t[n]);if(ka)for(var n of ka(t))kp.call(t,n)&&_a(e,n,t[n]);return e},tn=(e,t)=>yp(e,xp(t));function _p(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function qr(e,t){const n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?n:void 0}function Ji(e){return"initialIndex"in e&&typeof e.initialIndex=="number"&&"index"in e&&typeof e.index=="number"}function Sp(e,t,n){var r,i;const{source:s,target:a,canceled:o}=t.operation;if(!s||!a||o)return"preventDefault"in t&&t.preventDefault(),e;const l=(v,w)=>v===w||v!==null&&typeof v=="object"&&"id"in v&&v.id===w;if(Array.isArray(e)){const v=e.findIndex(k=>l(k,s.id)),w=e.findIndex(k=>l(k,a.id));if(v===-1||w===-1){if(Ji(s)){const k=s.initialIndex,$=s.index;return k===$||k<0||k>=e.length?("preventDefault"in t&&t.preventDefault(),e):n(e,k,$)}return e}if(!o&&"index"in s&&typeof s.index=="number"){const k=s.index;if(k!==v)return n(e,v,k)}return n(e,v,w)}const c=Object.entries(e);let u=-1,h,p=-1,f;for(const[v,w]of c)if(u===-1&&(u=w.findIndex(k=>l(k,s.id)),u!==-1&&(h=v)),p===-1&&(p=w.findIndex(k=>l(k,a.id)),p!==-1&&(f=v)),u!==-1&&p!==-1)break;if(u===-1&&Ji(s)){const v=s.initialGroup==null?void 0:qr(e,s.initialGroup),w=s.initialIndex,k=s.group==null?void 0:qr(e,s.group),$=s.index;if(v==null||k==null||v===k&&w===$)return"preventDefault"in t&&t.preventDefault(),e;if(v===k)return tn(en({},e),{[v]:n(e[v],w,$)});const E=e[v][w];return tn(en({},e),{[v]:[...e[v].slice(0,w),...e[v].slice(w+1)],[k]:[...e[k].slice(0,$),E,...e[k].slice($)]})}if(!s.manager)return e;const{dragOperation:g}=s.manager,b=(i=(r=g.shape)==null?void 0:r.current.center)!=null?i:g.position.current;if(f==null){const v=qr(e,a.id);if(v!=null){const w=a.shape&&b.y>a.shape.center.y?e[v].length:0;f=v,p=w}}if(h==null||f==null||h===f&&u===p){if(h!=null&&h===f&&u===p&&Ji(s)){const v=s.group==null?void 0:qr(e,s.group),w=s.group!=null&&v!==h,k=s.index!==u;if(w||k){const $=s.group==null?h:v;if($!=null){if(h===$)return tn(en({},e),{[h]:n(e[h],u,s.index)});const E=e[h][u];return tn(en({},e),{[h]:[...e[h].slice(0,u),...e[h].slice(u+1)],[$]:[...e[$].slice(0,s.index),E,...e[$].slice(s.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(h===f)return tn(en({},e),{[h]:n(e[h],u,p)});const x=a.shape&&Math.round(b.y)>Math.round(a.shape.center.y)?1:0,m=e[h][u];return tn(en({},e),{[h]:[...e[h].slice(0,u),...e[h].slice(u+1)],[f]:[...e[f].slice(0,p+x),m,...e[f].slice(p+x)]})}function $p(e,t){return Sp(e,t,_p)}function Sa(e){const t=new Map;for(const[,n]of e)for(const r of n)t.set(r.id,r.index);return t}function $a(e,t,n){var r;for(const[i,s]of t)for(const a of s){const o=e.get(a.id);if(a.index!==o||a.group!==i||!((r=n.get(i))!=null&&r.has(a)))return!0}return!1}var Ca="__default__",Cp=class extends xe{constructor(e){super(e);const t=()=>{const r=new Map;for(const i of e.registry.droppables)if(i instanceof Wo){const{sortable:s}=i,{group:a}=s;let o=r.get(a);o||(o=new Set,r.set(a,o)),o.add(s)}return r},n=[e.monitor.addEventListener("dragover",(r,i)=>{if(this.disabled)return;const{dragOperation:s}=i,{source:a,target:o}=s;if(!Te(a)||!Te(o)||a.sortable===o.sortable)return;const l=t(),c=Sa(l),u=a.sortable.group===o.sortable.group,h=l.get(a.sortable.group),p=u?h:l.get(o.sortable.group);!h||!p||queueMicrotask(()=>{r.defaultPrevented||i.renderer.rendering.then(()=>{var f,g;const b=t();if($a(c,l,b))return;const y=a.sortable.element,x=o.sortable.element;if(!x||!y||!u&&o.id===a.sortable.group)return;const m=Vr(h),v=u?m:Vr(p),w=(f=a.sortable.group)!=null?f:Ca,k=(g=o.sortable.group)!=null?g:Ca,$={[w]:m,[k]:v},E=$p($,r);if($===E)return;const O=E[k].indexOf(a.sortable),V=E[k].indexOf(o.sortable);i.collisionObserver.disable(),Pa(y,O,x,V),ae(()=>{for(const[B,P]of E[w].entries())P.index=B;if(!u)for(const[B,P]of E[k].entries())P.group=o.sortable.group,P.index=B}),i.actions.setDropTarget(a.id).then(()=>i.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(r,i)=>{if(!r.canceled)return;const{dragOperation:s}=i,{source:a}=s;Te(a)&&(a.sortable.initialIndex===a.sortable.index&&a.sortable.initialGroup===a.sortable.group||queueMicrotask(()=>{const o=t(),l=Sa(o),c=o.get(a.sortable.initialGroup);c&&i.renderer.rendering.then(()=>{const u=t();if($a(l,o,u))return;const h=Vr(c),p=Vr(c,Ep),f=a.sortable.element,g=p.indexOf(a.sortable),b=h[g],y=b?.element;!b||!y||!f||(Pa(f,b.index,y,a.index),ae(()=>{for(const x of o.values()){const m=Array.from(x).values();for(const v of m)v.index=v.initialIndex,v.group=v.initialGroup}}))})}))})];this.destroy=()=>{for(const r of n)r()}}};function Pa(e,t,n,r){const i=r<t?"afterend":"beforebegin";n.insertAdjacentElement(i,e)}function Pp(e,t){return e.index-t.index}function Ep(e,t){return e.initialIndex-t.initialIndex}function Vr(e,t=Pp){return Array.from(e).sort(t)}var Ea=[vp,Cp],ou={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1};function Aa(e){return e===null?null:cr(cr({},ou),e)}function Oa(e){var t,n;return typeof e=="boolean"?{draggable:e,droppable:e}:{draggable:(t=e?.draggable)!=null?t:!1,droppable:(n=e?.droppable)!=null?n:!1}}var Xr=new Hu,au,lu,kt,zo,er,tr,Lo,cn;lu=[U],au=[U];var Ri=class{constructor(e,t){Wn(this,zo,Nr(kt,8,this)),Nr(kt,11,this),Wn(this,er),Wn(this,tr),Wn(this,Lo,Nr(kt,12,this)),Nr(kt,15,this),Wn(this,cn),this.register=()=>(ae(()=>{var g,b;(g=this.manager)==null||g.registry.register(this.droppable),(b=this.manager)==null||b.registry.register(this.draggable)}),()=>this.unregister()),this.unregister=()=>{ae(()=>{var g,b;(g=this.manager)==null||g.registry.unregister(this.droppable),(b=this.manager)==null||b.registry.unregister(this.draggable)})},this.destroy=()=>{ae(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=e,{effects:r=()=>[],disabled:i,group:s,index:a,sensors:o,type:l,transition:c=ou,plugins:u}=n,h=hp(n,["effects","disabled","group","index","sensors","type","transition","plugins"]);const p=He(u,Ea),f=Oa(i);this.droppable=new Wo(Qi(cr({},h),{disabled:f.droppable}),t,this),this.draggable=new cu(Qi(cr({},h),{disabled:f.draggable,plugins:p,effects:()=>[()=>{var g,b,y;const x=(g=this.manager)==null?void 0:g.dragOperation.status;x?.initializationPending&&this.id===((y=(b=this.manager)==null?void 0:b.dragOperation.source)==null?void 0:y.id)&&Xr.clear(this.manager),x?.dragging&&Xr.set(this.manager,this.id,q(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{const{index:g,group:b,manager:y}=this,x=Jn(this,tr),m=Jn(this,er);(g!==x||b!==m)&&(Lt(this,tr,g),Lt(this,er,b),this.animate())},()=>{var g,b;const{target:y}=this,{isDragSource:x}=this.draggable;((b=(g=this.draggable.pluginConfig(Eo))==null?void 0:g.feedback)!=null?b:"default")==="move"&&x&&(this.droppable.disabled=!y)},...r()],type:l,sensors:o}),t,this),Lt(this,cn,h.element),this.manager=t,this.index=a,Lt(this,tr,a),this.group=s,Lt(this,er,s),this.type=l,this.transition=c}get initialIndex(){var e,t;return(t=(e=Xr.get(this.manager,this.id))==null?void 0:e.initialIndex)!=null?t:this.index}get initialGroup(){var e,t;return(t=(e=Xr.get(this.manager,this.id))==null?void 0:e.initialGroup)!=null?t:this.group}animate(){q(()=>{const{manager:e,transition:t}=this,{shape:n}=this.droppable;if(!e)return;const{idle:r}=e.dragOperation.status;!n||!t||r&&!t.idle||e.renderer.rendering.then(()=>{const{element:i}=this;if(!i)return;for(const u of i.getAnimations())"transitionProperty"in u&&(u.transitionProperty==="transform"||u.transitionProperty==="translate"||u.transitionProperty==="scale")&&u.cancel();const s=this.refreshShape();if(!s)return;const a={x:n.boundingRectangle.left-s.boundingRectangle.left,y:n.boundingRectangle.top-s.boundingRectangle.top},{translate:o}=rt(i),l=ha(i,o,!1),c=ha(i,o);if(a.x||a.y){const u=yo(Me(i))?Qi(cr({},t),{duration:0}):t;wc({element:i,keyframes:{translate:[`${l.x+a.x}px ${l.y+a.y}px ${l.z}`,`${c.x}px ${c.y}px ${c.z}`]},options:u}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})}})})}get manager(){return this.draggable.manager}set manager(e){ae(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){ae(()=>{const t=Jn(this,cn),n=this.droppable.element,r=this.draggable.element;(!n||n===t)&&(this.droppable.element=e),(!r||r===t)&&(this.draggable.element=e),Lt(this,cn,e)})}get element(){var e,t;const n=Jn(this,cn);if(n)return(t=(e=ys.get(n))!=null?e:n)!=null?t:this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){const{disabled:e}=this.draggable,{disabled:t}=this.droppable;return e===t?e:{draggable:e,droppable:t}}set plugins(e){this.draggable.plugins=He(e,Ea)}set disabled(e){const t=Oa(e);ae(()=>{this.droppable.disabled=t.droppable,this.draggable.disabled=t.draggable})}set data(e){ae(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){this.droppable.id=e,this.draggable.id=e}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=e??kc}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){ae(()=>{this.droppable.type=e,this.draggable.type=e})}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};kt=pp();zo=new WeakMap;er=new WeakMap;tr=new WeakMap;Lo=new WeakMap;cn=new WeakMap;iu(kt,4,"index",lu,Ri,zo);iu(kt,4,"group",au,Ri,Lo);gp(kt,Ri);var cu=class extends Ti{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},Wo=class extends Ii{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get group(){return this.sortable.group}},Ap=Object.defineProperty,Op=Object.defineProperties,Dp=Object.getOwnPropertyDescriptors,Da=Object.getOwnPropertySymbols,Tp=Object.prototype.hasOwnProperty,Ip=Object.prototype.propertyIsEnumerable,Ta=(e,t,n)=>t in e?Ap(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rp=(e,t)=>{for(var n in t||(t={}))Tp.call(t,n)&&Ta(e,n,t[n]);if(Da)for(var n of Da(t))Ip.call(t,n)&&Ta(e,n,t[n]);return e},Mp=(e,t)=>Op(e,Dp(t)),jo=_.createContext(null);function zp(){const[e,t]=_.createSignal(0);let n=null,r=null;return _.createEffect(_.on(e,()=>{r?.(),n=null})),{renderer:{get rendering(){return n??Promise.resolve()}},trackRendering(i){n||(n=new Promise(s=>{r=s})),_.batch(()=>{i(),t(s=>s+1)})}}}function Lp(){let e=null;return{savePosition:i=>{const s=i.element,a=i.id,o=s.previousElementSibling,l=s.nextElementSibling,c=s.parentElement;e={id:a,element:s,prevElement:o===s?null:o,nextElement:l===s?null:l,parentElement:c}},clearPosition:()=>{e=null},restorePosition:i=>{if(!e)return;const{prevElement:s,nextElement:a,parentElement:o}=e;s&&i.previousElementSibling!==s?s.insertAdjacentElement("afterend",i):a&&i.nextElementSibling!==a?a.insertAdjacentElement("beforebegin",i):!s&&!a&&o&&o.appendChild(i)}}}function Wp(e){const{savePosition:t,restorePosition:n,clearPosition:r}=Lp(),{renderer:i,trackRendering:s}=zp(),[,a]=_.splitProps(e,["children"]),o=_.createMemo(()=>{var l;return(l=e.manager)!=null?l:new op(a)});return _.onCleanup(()=>{e.manager||o().destroy()}),_.createEffect(()=>{const l=o();l.renderer=i,l.plugins=He(e.plugins,pn.plugins),l.sensors=He(e.sensors,pn.sensors),l.modifiers=He(e.modifiers,pn.modifiers)}),_.createEffect(()=>{const l=[],c=o().monitor;l.push(c.addEventListener("beforedragstart",(u,h)=>{Te(u.operation.source)&&t(u.operation.source);const p=e.onBeforeDragStart;p&&s(()=>p(u,h))}),c.addEventListener("dragstart",(u,h)=>{var p;(p=e.onDragStart)==null||p.call(e,u,h)}),c.addEventListener("dragover",(u,h)=>{const p=e.onDragOver;if(p&&(s(()=>p(u,h)),Te(u.operation.source))){const f=u.operation.source;queueMicrotask(()=>t(f))}}),c.addEventListener("dragmove",(u,h)=>{const p=e.onDragMove;p&&s(()=>p(u,h))}),c.addEventListener("dragend",(u,h)=>{Te(u.operation.source)&&n(u.operation.source.element);const p=e.onDragEnd;p&&s(()=>p(u,h)),r()}),c.addEventListener("collision",(u,h)=>{var p;(p=e.onCollision)==null||p.call(e,u,h)})),_.onCleanup(()=>{l.forEach(u=>u())})}),d.createComponent(jo.Provider,{get value(){return o()},get children(){return e.children}})}function uu(e){const[t,n]=_.createSignal(0),r=_.createMemo(()=>({target:e(),tracked:new Map,propertyCount:$t(0),active:!1,queued:!1}));return _.createEffect(()=>{const i=r(),{target:s,tracked:a,propertyCount:o}=i;if(!s)return;i.active=!0;const l=Re(()=>_.untrack(()=>{o.value;let c=!1;for(const[u,h]of a){const p=s[u];Object.is(h,p)||(c=!0,a.set(u,p))}c&&q(()=>n(u=>u+1))}));_.onCleanup(()=>{i.active=!1,l()})}),()=>{const i=r(),{target:s,tracked:a}=i;return t(),s&&new Proxy(s,{get(o,l){const c=o[l];return a.has(l)||(a.set(l,c),i.active&&!i.queued&&(i.queued=!0,queueMicrotask(()=>{i.queued=!1,i.active&&(i.propertyCount.value=a.size)}))),c}})}}function Bo(){return _.useContext(jo)}function du(e){var t;const n=(t=Bo())!=null?t:void 0,r=e(n);return _.createEffect(()=>{r.manager=n;const i=r.register();_.onCleanup(()=>i?.())}),r}function jp(){const e=Bo(),t=uu(()=>e?.dragOperation);return{source:()=>{var n;return(n=t())==null?void 0:n.source},target:()=>{var n;return(n=t())==null?void 0:n.target},status:()=>{var n;return(n=t())==null?void 0:n.status}}}function Bp(e){const[t,n]=_.createSignal(),r=Bo(),i=Np(()=>r),s=jp(),a=()=>s.source(),o=()=>{var l;return typeof e.disabled=="function"?e.disabled(a()):(l=e.disabled)!=null?l:!1};return _.createEffect(()=>{a()||n(void 0)}),_.createEffect(()=>{const l=r;if(!l||o())return;const c=l.plugins.find(u=>u instanceof Eo);c&&(c.overlay=t(),c.dropAnimation=e.dropAnimation,_.onCleanup(()=>{c.overlay=void 0,c.dropAnimation=void 0}))}),d.createComponent(jo.Provider,{get value(){return i()},get children(){return d.createComponent(_.Show,{get when(){return d.memo(()=>!o())()?a():void 0},children:l=>d.createComponent(d.Dynamic,{get component(){return e.tag||"div"},get class(){return e.class},get style(){return e.style},"data-dnd-overlay":!0,ref:n,get children(){return d.memo(()=>typeof e.children=="function")()?e.children(l()):e.children}})})}})}function Np(e){return _.createMemo(()=>{const t=e();if(!t)return null;const n=new Proxy(t.registry,{get(r,i){return i==="register"||i==="unregister"?Fp:r[i]}});return new Proxy(t,{get(r,i){return i==="registry"?n:r[i]}})})}function Fp(){return()=>{}}function qp(e){const t=du(s=>new Ii(Mp(Rp({},e),{register:!1,element:e.element}),s)),n=uu(()=>t),[r,i]=_.createSignal(e.element);return _.createEffect(()=>{var s;const a=r();a&&(t.element=a),t.id=e.id,t.accept=e.accept,t.type=e.type,t.disabled=(s=e.disabled)!=null?s:!1,e.collisionDetector&&(t.collisionDetector=e.collisionDetector),e.data&&(t.data=e.data)}),{get droppable(){return t},isDropTarget:()=>n().isDropTarget,ref:i}}function Vp(e){const[t,n]=_.createSignal(0),r=_.createMemo(()=>({target:e(),tracked:new Map,propertyCount:$t(0),active:!1,queued:!1}));return _.createEffect(()=>{const i=r(),{target:s,tracked:a,propertyCount:o}=i;if(!s)return;i.active=!0;const l=Re(()=>_.untrack(()=>{o.value;let c=!1;for(const[u,h]of a){const p=s[u];Object.is(h,p)||(c=!0,a.set(u,p))}c&&q(()=>n(u=>u+1))}));_.onCleanup(()=>{i.active=!1,l()})}),()=>{const i=r(),{target:s,tracked:a}=i;return t(),s&&new Proxy(s,{get(o,l){const c=o[l];return a.has(l)||(a.set(l,c),i.active&&!i.queued&&(i.queued=!0,queueMicrotask(()=>{i.queued=!1,i.active&&(i.propertyCount.value=a.size)}))),c}})}}var Xp=Object.defineProperty,Hp=Object.defineProperties,Up=Object.getOwnPropertyDescriptors,Ia=Object.getOwnPropertySymbols,Kp=Object.prototype.hasOwnProperty,Yp=Object.prototype.propertyIsEnumerable,Ra=(e,t,n)=>t in e?Xp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gp=(e,t)=>{for(var n in t||(t={}))Kp.call(t,n)&&Ra(e,n,t[n]);if(Ia)for(var n of Ia(t))Yp.call(t,n)&&Ra(e,n,t[n]);return e},Zp=(e,t)=>Hp(e,Up(t));function hu(e){const t=Aa(e.transition),n=du(p=>new Ri(Zp(Gp({},e),{register:!1,transition:t,element:e.element,handle:e.handle,target:e.target}),p)),r=Vp(()=>n),[i,s]=_.createSignal(e.element),[a,o]=_.createSignal(e.handle),[l,c]=_.createSignal(e.source),[u,h]=_.createSignal(e.target);return _.createEffect(()=>{var p;const f=i();f&&(n.element=f);const g=a();g&&(n.handle=g);const b=l();b&&(n.source=b);const y=u();y&&(n.target=y),n.id=e.id,n.disabled=(p=e.disabled)!=null?p:!1,n.alignment=e.alignment,n.plugins=e.plugins,n.modifiers=e.modifiers,n.sensors=e.sensors,n.accept=e.accept,n.type=e.type,n.collisionPriority=e.collisionPriority,n.transition=Aa(e.transition),e.collisionDetector&&(n.collisionDetector=e.collisionDetector),e.data&&(n.data=e.data)}),_.createEffect(_.on(()=>[e.group,e.index],()=>{ae(()=>{n.group=e.group,n.index=e.index})})),_.createEffect(_.on(()=>e.index,()=>{var p,f;(p=n.manager)!=null&&p.dragOperation.status.idle&&((f=n.transition)!=null&&f.idle)&&n.refreshShape()})),{get sortable(){return n},isDragging:()=>r().isDragging,isDropping:()=>r().isDropping,isDragSource:()=>r().isDragSource,isDropTarget:()=>r().isDropTarget,ref:s,handleRef:o,sourceRef:c,targetRef:h}}const Qp=[{id:"backlog",title:"Backlog",color:"var(--v2-icon-icon-muted)"},{id:"ready",title:"Ready",color:"var(--v2-state-fg-info)"},{id:"progress",title:"In progress",color:"var(--v2-state-fg-warning)"},{id:"review",title:"Review",color:"var(--v2-text-text-accent)"},{id:"done",title:"Done",color:"var(--v2-state-fg-success)"}],Jp=W.Schema.Struct({server:W.Schema.String,directory:W.Schema.String,name:W.Schema.optional(W.Schema.String)}),ef=W.Schema.Struct({server:W.Schema.String,id:W.Schema.String}),tf=W.Schema.Struct({id:W.Schema.String,title:W.Schema.String,description:W.Schema.String,labels:W.Schema.String,status:W.Schema.String,session:W.Schema.String,sessions:W.Schema.optional(W.Schema.Array(W.Schema.String)),links:W.Schema.optional(W.Schema.Array(ef)),project:W.Schema.optional(Jp),updatedAt:W.Schema.optional(W.Schema.Number)}),nf=W.Schema.Struct({id:W.Schema.String,title:W.Schema.String,color:W.Schema.String}),rf=W.Schema.Struct({cards:W.Schema.Array(tf),columns:W.Schema.Array(nf)});function sf(e){return[...new Set([e.session,...e.sessions??[]].filter(Boolean))]}function Mi(e,t){const n=[...e.links??[],...sf(e).map(r=>({id:r,server:e.project?.server??t}))];return n.filter((r,i)=>n.findIndex(s=>s.id===r.id&&s.server===r.server)===i)}function Bt(e){return JSON.stringify([e.server,e.directory])}function St(e){return e.name?.trim()||e.directory.replace(/[\\/]+$/,"").split(/[\\/]/).pop()||e.directory}function of(e,t,n,r=""){return n&&Mi(e,r).some(i=>t(i.id,i.server)==="running")}function af(){return{cards:[],columns:Qp.map(e=>({...e}))}}function Ma(e,t,n){const r=e.find(s=>s.id===t);if(!r)return[...e];const i=e.filter(s=>s.id!==t);return i.splice(Math.max(0,Math.min(i.length,n)),0,r),i}function lf(e,t,n){return!e.columns.some(i=>i.id===t)||e.columns.length<=1||e.cards.some(i=>i.status===t)&&(!n||n===t||!e.columns.some(i=>i.id===n))?e:{columns:e.columns.filter(i=>i.id!==t),cards:e.cards.map(i=>i.status===t?{...i,status:n}:i)}}const cf=W.Schema.Struct({collapsed:W.Schema.Array(W.Schema.String),mode:W.Schema.Literals(["overlay","split","full"]),splitWidth:W.Schema.optional(W.Schema.Number),overlayWidth:W.Schema.optional(W.Schema.Number)});function pu(e,t){const n=Math.max(0,e-(t==="split"?232:t==="overlay"?24:0));return{min:Math.min(280,n),max:n}}function Hr(e,t,n){const{min:r,max:i}=pu(t,n);return Math.round(Math.max(r,Math.min(i,Number.isFinite(e)?e:380)))}function zi(e){return[...new Set(e.split(",").map(t=>t.trim()).filter(Boolean))]}function uf(e,t,n,r=""){return(!n||zi(e.labels).includes(n))&&(!r||(e.project?Bt(e.project):"none")===r)&&`${e.title} ${e.description} ${e.labels}`.toLowerCase().includes(t.trim().toLowerCase())}function es(e,t,n,r){const i=e.find(c=>c.id===t);if(!i||i.status===n&&r===void 0)return[...e];const s=e.filter(c=>c.id!==t),a=s.filter(c=>c.status===n),o=r===void 0?void 0:a[Math.max(0,r)],l=o?s.findIndex(c=>c.id===o.id):s.length;return s.splice(l,0,{...i,status:n}),s}function df(e){return[e.title,e.description].filter(Boolean).join(`
68
+
69
+ `)}function No(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Kt=No();function fu(e){Kt=e}var Wt={exec:()=>null};function Et(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function T(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(ge.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,t)};return r}var hf=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),ge={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Et(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Et(e=>new RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Et(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Et(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:Et(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Et(e=>new RegExp(`^ {0,${e}}(?:</?(?:${Ar})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:Et(e=>new RegExp(`^ {0,${e}}>`))},pf=/^(?:[ \t]*(?:\n|$))+/,ff=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,gf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Er=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gu=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vu=T(gu).replace(/bull/g,Fo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),mf=T(gu).replace(/bull/g,Fo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,bf=/^[^\n]+/,Vo=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,yf=T(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Vo).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),xf=T(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Fo).getRegex(),Ar="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Xo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wf=T("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Xo).replace("tag",Ar).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),mu=e=>T(qo).replace("hr",Er).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Ar).getRegex(),kf=mu(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),_f=mu(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Sf=T(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph",_f).getRegex(),Ho={blockquote:Sf,code:ff,def:yf,fences:gf,heading:vf,hr:Er,html:wf,lheading:vu,list:xf,newline:pf,paragraph:kf,table:Wt,text:bf},za=T("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Er).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Ar).getRegex(),$f={...Ho,lheading:mf,table:za,paragraph:T(qo).replace("hr",Er).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",za).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Ar).getRegex()},Cf={...Ho,html:T(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Xo).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Wt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:T(qo).replace("hr",Er).replace("heading",` *#{1,6} *[^
70
+ ]`).replace("lheading",vu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Pf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ef=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bu=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Af=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,it=/[\p{P}\p{S}]/u,An=/[\s\p{P}\p{S}]/u,Or=/[^\s\p{P}\p{S}]/u,Of=T(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,An).getRegex(),Df=/[\p{Pi}\p{Ps}"']/u,yu=/(?!~)[\p{P}\p{S}]/u,Tf=/(?!~)[\s\p{P}\p{S}]/u,If=/(?:[^\s\p{P}\p{S}]|~)/u,Rf=T(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",hf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xu=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Mf=T(xu,"u").replace(/punct/g,it).getRegex(),zf=T(xu,"u").replace(/punct/g,yu).getRegex(),Lf=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Wf=T(Lf,"u").replace(/openQuote/g,Df).replace(/punct/g,it).getRegex(),wu="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",jf=T(wu,"gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,An).replace(/punct/g,it).getRegex(),Bf=T(wu,"gu").replace(/notPunctSpace/g,If).replace(/punctSpace/g,Tf).replace(/punct/g,yu).getRegex(),Nf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Ff=T(Nf,"gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,An).replace(/punct/g,it).getRegex(),qf=T("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,An).replace(/punct/g,it).getRegex(),Vf="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Xf=T(Vf,"gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,An).replace(/punct/g,it).getRegex(),Hf=T(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,it).getRegex(),Uf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Kf=T(Uf,"gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,An).replace(/punct/g,it).getRegex(),Yf=T(/\\(punct)/,"gu").replace(/punct/g,it).getRegex(),Gf=T(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,it).getRegex(),Zf=T(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Qf=T(Xo).replace("(?:-->|$)","-->").getRegex(),Jf=T("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Qf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ku=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,bi=T(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",ku).getRegex(),eg=T(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",bi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tg=T(/^!?\[(label)\]\[(ref)\]/).replace("label",bi).replace("ref",Vo).getRegex(),ng=T(/^!?\[(ref)\](?:\[\])?/).replace("ref",Vo).getRegex(),La=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,rg=T(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",ku).getRegex(),ig=T("reflink|nolink(?!\\()","g").replace("reflink",T(/^!?\[(label)\]\[(ref)\]/).replace("label",rg).replace("ref",La).getRegex()).replace("nolink",T(/^!?\[(ref)\](?:\[\])?/).replace("ref",La).getRegex()).getRegex(),Wa=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,sg=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,og=T(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,sg).getRegex(),Uo={_backpedal:Wt,anyPunctuation:Yf,anyPunctuationOutsideCode:Gf,autolink:Zf,blockSkip:Rf,br:bu,code:Ef,del:Wt,delLDelim:Wt,delRDelim:Wt,emStrongLDelim:Mf,emStrongRDelimAst:jf,emStrongRDelimUnd:qf,escape:Pf,link:eg,nolink:ng,punctuation:Of,reflink:tg,reflinkSearch:ig,tag:Jf,text:Af,url:Wt},ag={...Uo,emStrongLDelim:Wf,emStrongRDelimAst:Ff,emStrongRDelimUnd:Xf,link:T(/^!?\[(label)\]\((.*?)\)/).replace("label",bi).getRegex(),reflink:T(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",bi).getRegex()},zs={...Uo,emStrongRDelimAst:Bf,emStrongLDelim:zf,delLDelim:Hf,delRDelim:Kf,url:T(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",og).replace("protocol",Wa).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:T(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",Wa).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},lg={...zs,br:T(bu).replace("{2,}","*").getRegex(),text:T(zs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ur={normal:Ho,gfm:$f,pedantic:Cf},jn={normal:Uo,gfm:zs,breaks:lg,pedantic:ag},cg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ja=e=>cg[e];function Ae(e,t){if(t){if(ge.escapeTest.test(e))return e.replace(ge.escapeReplace,ja)}else if(ge.escapeTestNoEncode.test(e))return e.replace(ge.escapeReplaceNoEncode,ja);return e}function ug(e){return ge.numericCharacterReference.test(e)?e.replace(ge.numericCharacterReferenceOrAmpersand,(t,n,r)=>{if(n===void 0&&r===void 0)return"&amp;";let i=n===void 0?Number.parseInt(r,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"�":i===38?"&amp;":String.fromCodePoint(i)}):e}function Ba(e){try{e=encodeURI(e).replace(ge.percentDecode,"%")}catch{return null}return e}function Na(e,t){let n=e.replace(ge.findPipe,(s,a,o)=>{let l=!1,c=a;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(ge.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(ge.slashPipe,"|");return r}function ft(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function Fa(e){let t=e.split(`
71
+ `),n=t.length-1;for(;n>=0&&ge.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
72
+ `)}function yi(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function qa(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Kr(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=i,n++;return r}function Va(e,t,n,r,i){let s=t.href,a=t.title||null,o=e[1].replace(i.other.outputLinkReplace,"$1"),l=e[0].charAt(0)==="!",c=r.state.inLink,u=r.state.linkEmitted,h=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let p=r.inlineTokens(o),f=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=c,!l){if(f){r.state.inRawBlock=h;return}r.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:s,title:a,text:o,tokens:p}}function dg(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
73
+ `).map(s=>{let a=s.match(n.other.beginningSpace);if(a===null)return s;let[o]=a;return s.slice(Math.min(o.length,i.length))}).join(`
74
+ `)}function Xa(e,t,n,r){if(!t.includes("<"))return!1;for(let i=0;i<t.length;i++){if(t[i]==="\\"){i++;continue}if(t[i]==="`"){let o=r.inline.code.exec(t.slice(i));if(o){i+=o[0].length-1;continue}}if(t[i]!=="<")continue;let s=e.slice(n+i),a=r.inline.tag.exec(s)||r.inline.autolink.exec(s);if(a){if(a[0].length>t.length-i)return!0;i+=a[0].length-1}}return!1}var fn=class{options;rules;lexer;constructor(e){this.options=e||Kt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:Fa(t[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=dg(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=ft(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(n=r.trim())}return{type:"heading",raw:ft(t[0],`
75
+ `),depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ft(t[0],`
76
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=ft(t[0],`
77
+ `).split(`
78
+ `),r="",i="",s=[];for(;n.length>0;){let a=!1,o=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))o.push(n[l]),a=!0;else if(!a)o.push(n[l]);else break;n=n.slice(l);let c=o.join(`
79
+ `),u=c.replace(this.rules.other.blockquoteMarkerWhitespace,(f,g,b)=>g+Kr(b,g.length)).replace(this.rules.other.blockquoteSetextReplace,`
80
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
81
+ ${c}`:c,i=i?`${i}
82
+ ${u}`:u;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=h,n.length===0)break;let p=s.at(-1);if(p?.type==="code"||p?.type==="heading"||p?.type==="hr"||p?.type==="html")break;if(p?.type==="blockquote"){let f=p,g=n.join(`
83
+ `),b=f.raw+`
84
+ `+g.replace(this.rules.other.blockquoteSetextReplace2,""),y=this.blockquote(b);s[s.length-1]=y;let x=b.substring(y.raw.length).replace(/^\n/,""),m=x?x.split(`
85
+ `).length:0,v=m?n.slice(0,-m):n;v.length>0&&(r=`${r}
86
+ ${v.join(`
87
+ `)}`),i=i.substring(0,i.length-f.text.length)+y.text;break}else if(p?.type==="list"){let f=p,g=f.raw+`
88
+ `+n.join(`
89
+ `),b=this.list(g);s[s.length-1]=b;let y=b.raw.length>f.raw.length?g.slice(f.raw.length+1,b.raw.length).split(`
90
+ `).length:0;if(y>0){let x=n.slice(0,y).join(`
91
+ `);r=`${r}
92
+ ${x}`,i=`${i}
93
+ ${x}`}n=n.slice(y);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),s=i.length>1,a={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let o=this.rules.other.listItemRegex(i),l=!1;for(;e;){let u=!1,h="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;let p=r();e=e.substring(t[0].length);let f=t[2].split(`
94
+ `,1)[0],g=t[1].length,b=this.options.pedantic?Kr(f,g):f.replace(this.rules.other.leadingSpaceTab,w=>Kr(w,g)),y=e.split(`
95
+ `,1)[0],x=!b.trim(),m=0;if(this.options.pedantic?(m=2,h=b.trimStart()):x?m=g+1:(m=b.search(this.rules.other.nonSpaceChar),m=m>4?1:m,h=b.slice(m),m+=g),x&&this.rules.other.blankLine.test(y)&&(e=e.substring(y.length+1),u=!0),!u){let w=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),$=this.rules.other.fencesBeginRegex(m),E=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(m):this.rules.other.headingBeginRegex(m),O=this.rules.other.htmlBeginRegex(m),V=this.rules.other.blockquoteBeginRegex(m);for(;e;){let B=e.split(`
96
+ `,1)[0],P;if(y=B,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),P=y):P=y.replace(this.rules.other.leadingSpaceTab,Q=>Kr(Q)),$.test(y)||E.test(y)||O.test(y)||V.test(y)||w.test(y)||k.test(y))break;if(P.search(this.rules.other.nonSpaceChar)>=m||!y.trim())h+=`
97
+ `+P.slice(m);else{if(x||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(b)||E.test(b)||k.test(b))break;let Q=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(y)&&this.rules.block.lheading.test(`${b}
98
+ ${y}`)?` ${P.replace(/^ {0,3}/,"")}`:y;h+=`
99
+ `+Q}x=!y.trim(),e=e.substring(B.length+1),b=P.slice(m)}}let v=n.slice(p,r());a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(l=!0)),a.items.push({type:"list_item",raw:v,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]})}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=n.slice(0,r()).trimEnd();for(let u of a.items)if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),!a.loose){let h=u.tokens.filter(f=>f.type==="space"),p=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=p}for(let u of a.items){let h=u.tokens[0];if(u.task&&(h?.type==="text"||h?.type==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),h.raw=h.raw.replace(this.rules.other.listReplaceTask,""),h.text=h.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(u.raw);if(p){let f={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};u.checked=f.checked,a.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=f.raw+u.tokens[0].raw,u.tokens[0].text=f.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(f)):u.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):u.tokens.unshift(f)}}else u.task&&(u.task=!1)}if(a.loose)for(let u of a.items){u.loose=!0;for(let h of u.tokens)h.type==="text"&&(h.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=Fa(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&qa(t[2],"()")!==-1)return;let n=yi(t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:ft(t[0],`
100
+ `),href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Na(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
101
+ `):[],s={type:"table",raw:ft(t[0],`
102
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(Na(a,s.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[l]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:ft(t[0],`
103
+ `),depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
104
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Xa(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=ft(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=qa(t[2],"()");if(a===-2)return;if(a>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],s=a[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i=i.slice(1):i=i.slice(1,-1)),Va(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Xa(e,n[1],r,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[yi(i)];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Va(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],s=n===i,a=t.length-e.length,o=a;for(;!this.options.pedantic&&o>0&&t[o-1]===i;)o--;let l=[...t.slice(Math.max(0,o-2),o)].at(-1)??"",c=l==="*"||l==="_"||!!this.rules.inline.punctuation.exec(l);o<a&&(n=l);let u=o<a?c:!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let h=r[1]||r[3]||"";if(!h||!n||u){let p=[...r[0]].length-1,f,g,b=p,y=0,x=a-o+p,m=!this.options.pedantic&&!!l.trim()&&(!!h||i==="*"&&!c),v=i==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,t=t.slice(-1*e.length+p);(r=v.exec(t))!==null;){if(f=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!f)continue;if(g=[...f].length,r[3]||r[4]){b+=g;continue}else if(r[5]||r[6]||m){if(s&&(r[5]||r[6]))break;if(x%3&&!((x+g)%3)){y+=g;continue}}if(b-=g,b>0)continue;g=Math.min(g,g+b+y);let w=[...r[0]][0].length,k=e.slice(0,p+r.index+w+g);if(Math.min(p,g)%2){let E=k.slice(1,-1);return{type:"em",raw:k,text:E,tokens:this.lexer.inlineTokens(E)}}let $=k.slice(2,-2);return{type:"strong",raw:k,text:$,tokens:this.lexer.inlineTokens($)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,a,o=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+i);(r=l.exec(t))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(a=[...s].length,a!==i))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let c=[...r[0]][0].length,u=e.slice(0,i+r.index+c+a),h=u.slice(i,-i);return{type:"del",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:n?t[0]:ug(t[0]),escaped:n}}}},Ve=class Ls{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Kt,this.options.tokenizer=this.options.tokenizer||new fn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:ge,block:Ur.normal,inline:jn.normal};this.options.pedantic?(n.block=Ur.pedantic,n.inline=jn.pedantic):this.options.gfm&&(n.block=Ur.gfm,this.options.breaks?n.inline=jn.breaks:n.inline=jn.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ur,inline:jn}}static lex(t,n){return new Ls(n).lex(t)}static lexInline(t,n){return new Ls(n).inlineTokens(t)}lex(t){t=t.replace(ge.carriageReturn,`
105
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.state.inRawBlock=!1,this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(ge.tabCharGlobal," ").replace(ge.spaceLine,""));let i=1/0;for(;t;){if(t.length<i)i=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},t,n))?(t=t.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let o=n.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
106
+ `:n.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
107
+ `)?"":`
108
+ `)+s.raw,o.text+=`
109
+ `+s.text,this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
110
+ `)?"":`
111
+ `)+s.raw,o.text+=`
112
+ `+s.raw,this.inlineQueue.at(-1).src=o.text):(this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title}),n.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),n.push(s);continue}let a=t;if(this.options.extensions?.startBlock){let o=1/0,l=t.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(o=Math.min(o,c))}),o<1/0&&o>=0&&(a=t.substring(0,o+1))}if(this.state.top&&(s=this.tokenizer.paragraph(a))){let o=n.at(-1);r&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
113
+ `)?"":`
114
+ `)+s.raw,o.text+=`
115
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s),r=a.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
116
+ `)?"":`
117
+ `)+s.raw,o.text+=`
118
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}linkInText(t){if(!t.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let r of t.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(r[0])&&t.charAt(r.index-1)!=="!")return!0;for(let r of t.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=r[0],s=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,yi(i.slice(s+1,-1))))&&!(s>1&&this.linkInText(i.slice(1,s-1))))return!0}return!1}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=this.state.linkParenPossible;this.state.linkParenPossible=r&&t.includes(")");try{return this.#e(t,n)}finally{this.state.linkParenPossible=r}}#e(t,n){let r=t.includes("*")||t.includes("_")||t.includes("~")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==fn.prototype.emStrong||this.tokenizer.del!==fn.prototype.del?this.#t(t):t,i=!1,s="",a=1/0;for(;t;){if(t.length<a)a=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}i||(s=""),i=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let c=n.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(t,r,s)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(t,r,s)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),n.push(o);continue}let l=t;if(this.options.extensions?.startInline){let c=1/0,u=t.slice(1),h;this.options.extensions.startInline.forEach(p=>{h=p.call({lexer:this},u),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(o=this.tokenizer.inlineText(l)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(s=o.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):n.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return n}#t(t){let n=t;if(this.tokens.links&&t.includes("[")){let r=this.tokenizer.rules.inline.reflinkSearch,i=s=>{let a=s.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,yi(s.slice(a+1,-1))))return s;if(a>1&&s.charAt(0)!=="!"){let o=s.slice(1,a-1);if(this.linkInText(o))return"["+o.replace(r,i)+"]["+"a".repeat(s.length-a-2)+"]"}return"["+"a".repeat(s.length-2)+"]"};n=n.replace(r,i)}return n=n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(r,i,s)=>s?"+".repeat(r.length):i?i+r.slice(i.length,-i.length).replace(/`/g,"+")+i:r),n=n.replace(this.tokenizer.rules.inline.blockSkip,(r,i,s)=>{let a=s?s.length:0;return r.slice(0,a)+"["+"a".repeat(r.length-a-2)+"]"}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n,n}infiniteLoopError(t){let n="Infinite loop on byte: "+t;if(this.options.silent)console.error(n);else throw new Error(n)}},xi=class{options;parser;constructor(e){this.options=e||Kt}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(ge.notSpaceStart)?.[0],i=e?e.replace(ge.endingNewline,"")+`
119
+ `:"";return r?'<pre><code class="language-'+Ae(r)+'">'+(n?i:Ae(i,!0))+`</code></pre>
120
+ `:"<pre><code>"+(n?i:Ae(i,!0))+`</code></pre>
121
+ `}blockquote({tokens:e}){return`<blockquote>
122
+ ${this.parser.parse(e)}</blockquote>
123
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
124
+ `}hr(e){return`<hr>
125
+ `}list(e){let t=e.ordered,n=e.start,r="";for(let a=0;a<e.items.length;a++){let o=e.items[a];r+=this.listitem(o)}let i=t?"ol":"ul",s=t&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
126
+ `+r+"</"+i+`>
127
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
128
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
129
+ `}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r="";for(let i=0;i<e.rows.length;i++){let s=e.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
130
+ <thead>
131
+ `+t+`</thead>
132
+ `+r+`</table>
133
+ `}tablerow({text:e}){return`<tr>
134
+ ${e}</tr>
135
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
136
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ae(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let s=i?Ae(n,!0):this.parser.parseInline(r),a=Ba(e);if(a===null)return s;e=Ae(a,i);let o='<a href="'+e+'"';return t&&(o+=' title="'+Ae(t)+'"'),o+=">"+s+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ba(e);if(i===null)return Ae(n);e=i;let s=`<img src="${Ae(e)}" alt="${Ae(n)}"`;return t&&(s+=` title="${Ae(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ae(e.text)}},Ko=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return""}checkbox({raw:e}){return e}},Xe=class Ws{options;renderer;textRenderer;constructor(t){this.options=t||Kt,this.options.renderer=this.options.renderer||new xi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ko,this.textRenderer.parser=this}static parse(t,n){return new Ws(n).parse(t)}static parseInline(t,n){return new Ws(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let a=i,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(a.type)){n+=o||"";continue}}let s=i;switch(s.type){case"space":{n+=this.renderer.space(s);break}case"hr":{n+=this.renderer.hr(s);break}case"heading":{n+=this.renderer.heading(s);break}case"code":{n+=this.renderer.code(s);break}case"table":{n+=this.renderer.table(s);break}case"blockquote":{n+=this.renderer.blockquote(s);break}case"list":{n+=this.renderer.list(s);break}case"checkbox":{n+=this.renderer.checkbox(s);break}case"html":{n+=this.renderer.html(s);break}case"def":{n+=this.renderer.def(s);break}case"paragraph":{n+=this.renderer.paragraph(s);break}case"text":{n+=this.renderer.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(s.type)){r+=o||"";continue}}let a=s;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"checkbox":{r+=n.checkbox(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},nr=class{options;block;constructor(e){this.options=e||Kt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ve.lex:Ve.lexInline}provideParser(e=this.block){return e?Xe.parse:Xe.parseInline}};function At(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var hg=class{defaults=No();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Xe;Renderer=xi;TextRenderer=Ko;Lexer=Ve;Tokenizer=fn;Hooks=nr;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(At(n,t.call(this,r)),r.type){case"table":{let i=r;for(let s of i.header)At(n,this.walkTokens(s.tokens,t));for(let s of i.rows)for(let a of s)At(n,this.walkTokens(a.tokens,t));break}case"list":{let i=r;At(n,this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);At(n,this.walkTokens(a,t))}):i.tokens&&At(n,this.walkTokens(i.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new xi(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=n.renderer[a],l=i[a];i[a]=(...c)=>{let u=o.apply(i,c);return u===!1&&(u=l.apply(i,c)),u||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new fn(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=n.tokenizer[a],l=i[a];i[a]=(...c)=>{let u=o.apply(i,c);return u===!1&&(u=l.apply(i,c)),u}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new nr;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=n.hooks[a],l=i[a];nr.passThroughHooks.has(s)?i[a]=c=>{if(i.options.async&&nr.passThroughHooksRespectAsync.has(s))return(async()=>{let h=await o.call(i,c);return l.call(i,h)})();let u=o.call(i,c);return l.call(i,u)}:i[a]=(...c)=>{if(i.options.async)return(async()=>{let h=await o.apply(i,c);return h===!1&&(h=await l.apply(i,c)),h})();let u=o.apply(i,c);return u===!1&&(u=l.apply(i,c)),u}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&At(o,i.call(this,a)),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ve.lex(e,t??this.defaults)}parser(e,t){return Xe.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(t):t,o=await(i.hooks?await i.hooks.provideLexer(e):e?Ve.lex:Ve.lexInline)(a,i),l=i.hooks?await i.hooks.processAllTokens(o):o;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let c=await(i.hooks?await i.hooks.provideParser(e):e?Xe.parse:Xe.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(c):c})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let a=(i.hooks?i.hooks.provideLexer(e):e?Ve.lex:Ve.lexInline)(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let o=(i.hooks?i.hooks.provideParser(e):e?Xe.parse:Xe.parseInline)(a,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(a){return s(a)}}}onError(e,t){return n=>{if(n.message+=`
137
+ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Ae(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Vt=new hg;function G(e,t){return Vt.parse(e,t)}G.options=G.setOptions=function(e){return Vt.setOptions(e),G.defaults=Vt.defaults,fu(G.defaults),G};G.getDefaults=No;G.defaults=Kt;function pg(...e){return Vt.use(...e),G.defaults=Vt.defaults,fu(G.defaults),G}G.use=pg;G.walkTokens=function(e,t){return Vt.walkTokens(e,t)};G.parseInline=Vt.parseInline;G.Parser=Xe;G.parser=Xe.parse;G.Renderer=xi;G.TextRenderer=Ko;G.Lexer=Ve;G.lexer=Ve.lex;G.Tokenizer=fn;G.Hooks=nr;G.parse=G;G.options;G.setOptions;G.walkTokens;G.parseInline;Xe.parse;Ve.lex;function _u(e,t=140){const n=[],r=a=>a.map(o=>o.type==="html"?"":"tokens"in o&&Array.isArray(o.tokens)?r(o.tokens):"text"in o&&typeof o.text=="string"?o.text:" ").join(""),i=a=>{for(const o of a)if(o.type==="list")for(const l of o.items)i(l.tokens);else o.type==="blockquote"?i(o.tokens??[]):["heading","paragraph","text"].includes(o.type)&&"text"in o&&n.push(r("tokens"in o&&o.tokens?o.tokens:G.Lexer.lexInline(String(o.text))))};i(G.lexer(e));const s=n.join(" ").replace(/\s+/g," ").trim();return s.length>t?`${s.slice(0,t).trimEnd()}…`:s}function Yo(e){const t=[];let n="";for(let o=0;o<e.length;o++)e[o]==="\r"?(e[o+1]===`
138
+ `&&o++,n+=`
139
+ `):n+=e[o],t.push(o);const r=[];let i=0;for(const o of G.lexer(n)){const l=n.indexOf(o.raw,i);if(l<0)return[];if(i=l+o.raw.length,o.type!=="list"&&o.type!=="blockquote")continue;let c=0,u;for(const h of o.raw.split(new RegExp("(?<=\\n)"))){const p=h.replace(/\n$/,""),f=/^[ \t]*(?:>[ \t]*)*(?:[-+*]|\d+[.)])?[ \t]*(`{3,}|~{3,})/.exec(p);if(f){const g=f[1][0];u?g===u.marker&&f[1].length>=u.length&&(u=void 0):u={marker:g,length:f[1].length}}else if(!u){const g=/^([ \t]*(?:>[ \t]*)*(?:[-+*]|\d+[.)])[ \t]+)\[([ xX])\](?=[ \t]|$)(.*)/.exec(p);g&&r.push({offset:t[l+c+g[1].length+1],checked:g[2]!==" ",text:g[3].trim()})}c+=h.length}}const s=[],a=o=>{for(const l of o)if(l.type==="list")for(const c of l.items)c.task&&s.push(!!c.checked),a(c.tokens);else l.type==="blockquote"&&a(l.tokens??[])};return a(G.lexer(n)),s.length===r.length&&s.every((o,l)=>o===r[l].checked)?r:[]}function fg(e,t){const n=Yo(e)[t];return n?e.slice(0,n.offset)+(n.checked?" ":"x")+e.slice(n.offset+1):e}function gg(e,t){const n=Yo(e),r=new WeakMap,i=t.length===n.length&&t.every((s,a)=>s.checked===n[a].checked);for(const[s,a]of t.entries())a.disabled!==!i&&(a.disabled=!i),i&&(r.set(a,{source:e,index:s}),a.setAttribute("aria-label",_u(n[s].text,1/0)||`Checklist item ${s+1}`));return r}var vg=d.template("<div class=sc-task-markdown>");function mg(e){const t=Ce.usePlugin().ui;let n,r=new WeakMap;const i=()=>{const s=e.text,a=[...n.querySelectorAll('li input[type="checkbox"]')];r=gg(s,a)};return _.createEffect(()=>{e.text,r=new WeakMap,queueMicrotask(()=>{n?.isConnected&&i()})}),_.onMount(()=>{const s=new MutationObserver(i);s.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["checked","disabled"]}),i(),_.onCleanup(()=>s.disconnect())}),(()=>{var s=vg();s.addEventListener("change",o=>{const l=o.target;if(!(l instanceof HTMLInputElement))return;const c=r.get(l);if(!c||c.source!==e.text){i();return}e.update(fg(c.source,c.index))});var a=n;return typeof a=="function"?d.use(a,s):n=s,d.insert(s,d.createComponent(t.Markdown,{get text(){return e.text}})),s})()}var bg=d.template("<p>Updated "),yg=d.template("<aside tabindex=-1 class=sc-task-detail><header class=sc-detail-toolbar><span>Task details</span><div class=sc-actions></div></header><div class=sc-detail-body><div class=sc-detail-title><h2></h2><div class=sc-actions></div></div><div class=sc-detail-meta><div class=sc-task-labels></div></div><p></p><section class=sc-detail-section><h3>Description</h3></section><section class=sc-detail-section><h3>Linked sessions</h3><p>Start a new session with this task, or link the current session. Task status stays manual.</p><div class=sc-actions>"),xg=d.template("<span>"),wg=d.template("<p>No description yet. Edit the task to add context."),kg=d.template("<span class=sc-linked-session-title>"),_g=d.template("<div class=sc-linked-session>");function Sg(e){const t=Ce.usePlugin(),n=t.ui,[r,i]=_.createSignal(!1),s=()=>Mi(e.task,e.session.server.id),a=u=>t.servers.get(u.server)?.data.session.list().find(h=>h.id===u.id)?.title||`Session ${u.id}`,o=u=>e.update({session:"",sessions:[],links:u}),l=()=>s().some(u=>u.id===e.session.id&&u.server===e.session.server.id);let c;return _.onMount(()=>c?.focus()),(()=>{var u=yg(),h=u.firstChild,p=h.firstChild,f=p.nextSibling,g=h.nextSibling,b=g.firstChild,y=b.firstChild,x=y.nextSibling,m=b.nextSibling,v=m.firstChild,w=m.nextSibling,k=w.nextSibling;k.firstChild;var $=k.nextSibling,E=$.firstChild,O=E.nextSibling,V=O.nextSibling;u.$$keydown=P=>{P.key==="Escape"&&!P.defaultPrevented&&(P.stopPropagation(),e.close())};var B=c;return typeof B=="function"?d.use(B,u):c=u,d.insert(f,d.createComponent(n.Tooltip,{value:"Close task",get children(){return d.createComponent(n.IconButton,{icon:"close",label:"Close task",variant:"ghost",get onClick(){return e.close}})}})),d.insert(y,()=>e.task.title),d.insert(x,d.createComponent(n.Tooltip,{value:"Edit task",get children(){return d.createComponent(n.IconButton,{icon:"edit",label:"Edit task",variant:"ghost",get onClick(){return e.edit}})}}),null),d.insert(x,d.createComponent(n.Tooltip,{value:"Delete task",get children(){return d.createComponent(n.IconButton,{icon:"trash",label:"Delete task",variant:"ghost",get onClick(){return e.remove}})}}),null),d.insert(m,d.createComponent(n.Menu,{get label(){return e.columns.find(P=>P.id===e.task.status)?.title??"Choose column"},trigger:"button",get items(){return e.columns.map(P=>({label:P.title,disabled:P.id===e.task.status,onSelect:()=>e.move(P.id)}))}}),v),d.insert(v,d.createComponent(_.For,{get each(){return zi(e.task.labels)},children:P=>(()=>{var Q=xg();return d.insert(Q,P),Q})()})),d.insert(w,(()=>{var P=d.memo(()=>!!e.task.project);return()=>P()?`Project: ${St(e.task.project)}`:"No project · new sessions use the currently open project"})()),d.insert(g,d.createComponent(_.Show,{get when(){return e.task.updatedAt},get children(){var P=bg();return P.firstChild,d.insert(P,()=>new Date(e.task.updatedAt).toLocaleString(),null),P}}),k),d.insert(k,d.createComponent(_.Show,{get when(){return e.task.description},get fallback(){return wg()},get children(){return d.createComponent(mg,{get text(){return e.task.description},update:P=>e.update({description:P})})}}),null),d.insert($,d.createComponent(_.For,{get each(){return s()},children:P=>(()=>{var Q=_g();return d.insert(Q,d.createComponent(n.Tooltip,{get value(){return`Open session: ${a(P)}`},get children(){return d.createComponent(n.Button,{size:"small",icon:"arrow-up-right",get"aria-label"(){return`Open session: ${a(P)}`},onClick:()=>t.tabs.open(P,{focus:!0}),get children(){var se=kg();return d.insert(se,()=>a(P)),se}})}}),null),d.insert(Q,d.createComponent(n.Tooltip,{value:"Unlink session from task",get children(){return d.createComponent(n.IconButton,{icon:"close",get label(){return`Unlink ${a(P)} from task`},size:"small",variant:"ghost",onClick:()=>o(s().filter(se=>se.id!==P.id||se.server!==P.server))})}}),null),Q})()}),V),d.insert(V,d.createComponent(n.Button,{size:"small",icon:"new-session",get busy(){return r()},onClick:async()=>{i(!0);try{await e.start()}finally{i(!1)}},children:"Start session"}),null),d.insert(V,d.createComponent(n.Button,{size:"small",icon:"link",get disabled(){return l()},onClick:()=>{l()||o([...s(),{id:e.session.id,server:e.session.server.id}])},children:"Link current session"}),null),d.effect(P=>{var Q=`Task details: ${e.task.title}`,se=e.task.project?.directory;return Q!==P.e&&d.setAttribute(u,"aria-label",P.e=Q),se!==P.t&&d.setAttribute(w,"title",P.t=se),P},{e:void 0,t:void 0}),u})()}d.delegateEvents(["keydown"]);var $g=d.template('<div class=sc-detail-resizer role=separator tabindex=0 aria-label="Resize task details"aria-orientation=vertical><span>'),Cg=d.template("<div class=sc-detail-shell>");function Pg(e){const[t,n]=_.createSignal(0),[r,i]=_.createSignal(),[s,a]=_.createSignal(!1);let o,l;const c=()=>e.mode!=="full"&&!(e.mode==="split"&&t()<=700),u=()=>Hr(r()??e.width,t(),e.mode),h=()=>pu(t(),e.mode),p=()=>{l=void 0,i(void 0),a(!1)};_.onMount(()=>{const g=o?.parentElement;if(!g)return;const b=()=>n(g.getBoundingClientRect().width);b();const y=new ResizeObserver(b);y.observe(g),_.onCleanup(()=>y.disconnect())}),_.onCleanup(p);const f=g=>{const b=g.shiftKey?40:10;let y;if(g.key==="ArrowLeft")y=u()+b;else if(g.key==="ArrowRight")y=u()-b;else if(g.key==="Home")y=h().min;else if(g.key==="End")y=h().max;else return;g.preventDefault(),g.stopPropagation(),e.saveWidth(Hr(y,t(),e.mode))};return(()=>{var g=Cg(),b=o;return typeof b=="function"?d.use(b,g):o=g,d.insert(g,d.createComponent(_.Show,{get when(){return c()},get children(){var y=$g();return y.$$dblclick=()=>e.saveWidth(Hr(e.mode==="split"?380:460,t(),e.mode)),y.addEventListener("lostpointercapture",p),y.addEventListener("pointercancel",p),y.$$pointerup=x=>{!l||l.pointer!==x.pointerId||(x.preventDefault(),x.stopPropagation(),l.mode===e.mode&&c()&&e.saveWidth(u()),p(),x.currentTarget.releasePointerCapture(x.pointerId))},y.$$pointermove=x=>{if(!(!l||l.pointer!==x.pointerId)){if(l.mode!==e.mode||!c())return p();x.preventDefault(),x.stopPropagation(),i(Hr(l.width+l.x-x.clientX,t(),e.mode))}},y.$$pointerdown=x=>{x.button===0&&(x.preventDefault(),x.stopPropagation(),x.currentTarget.setPointerCapture(x.pointerId),l={x:x.clientX,width:u(),pointer:x.pointerId,mode:e.mode},a(!0))},y.$$keydown=f,d.effect(x=>{var m=h().min,v=h().max,w=u();return m!==x.e&&d.setAttribute(y,"aria-valuemin",x.e=m),v!==x.t&&d.setAttribute(y,"aria-valuemax",x.t=v),w!==x.a&&d.setAttribute(y,"aria-valuenow",x.a=w),x},{e:void 0,t:void 0,a:void 0}),y}}),null),d.insert(g,()=>e.children,null),d.effect(y=>{var x=s(),m=`${u()}px`;return x!==y.e&&d.setAttribute(g,"data-resizing",y.e=x),m!==y.t&&d.setStyleProperty(g,"--sc-detail-width",y.t=m),y},{e:void 0,t:void 0}),g})()}d.delegateEvents(["keydown","pointerdown","pointermove","pointerup","dblclick"]);function Su(e){const t=e.listedProject?.worktree==="/"?void 0:e.listedProject,n=e.project?.id==="global"||e.project?.worktree==="/"?void 0:e.project;return{server:e.server.id,directory:t?.worktree??n?.worktree??e.directory,name:t?.name??n?.name}}function Eg(e,t){const n=new Map;for(const i of e.sessions.list()){const s=i.location?.directory;if(!s||s==="/")continue;const a=e.servers.get(i.server.id)?.data.project.list()??[];if(a.some(c=>c.sandboxes.includes(s)))continue;const o=a.find(c=>c.id!=="global"&&c.canonical!=="/"&&s===c.canonical);if(!o)continue;const l={server:i.server.id,directory:o.canonical,name:o.name};n.set(Bt(l),l)}const r=Su(t);return r.directory!=="/"&&t.directory===r.directory&&n.set(Bt(r),r),[...n.values()].sort((i,s)=>St(i).localeCompare(St(s)))}var Ha=d.template('<div class="sc-root sc-inset sc-kanban-ui">'),Ag=d.template('<button type=button class=sc-detail-backdrop tabindex=-1 aria-label="Close task details">'),Og=d.template('<div class="sc-root sc-kanban sc-kanban-ui"><header class=sc-board-header><h2>Task board</h2><div class=sc-board-filter></div><span class=sc-board-new>'),Dg=d.template("<div class=sc-board-workspace><div class=sc-board-columns>"),Tg=d.template('<div class="sc-root sc-kanban-ui sc-column-overlay">'),Ig=d.template("<header><button type=button class=sc-column-drag><span class=sc-column-dot></span><span></span><span class=sc-column-count></span></button><span class=sc-column-actions>"),Rg=d.template("<div class=sc-empty-column>"),Mg=d.template("<div class=sc-column-cards>"),zg=d.template('<button type=button class="sc-column-rail sc-column-drag">'),Lg=d.template("<span class=sc-column-count>"),Wg=d.template("<section class=sc-task-detail><header class=sc-detail-toolbar><span></span></header><div class=sc-detail-body>"),jg=d.template('<div class="sc-root sc-kanban-ui"><article class="sc-task sc-task-overlay"><h4 class=sc-task-title>'),Bg=d.template("<section class=sc-board-column>"),Ng=d.template("<button type=button class=sc-task><span class=sc-task-title>"),Fg=d.template("<div class=sc-drop-slot aria-hidden=true>"),qg=d.template("<span class=sc-task-excerpt>"),Vg=d.template("<span>+"),Xg=d.template('<span title="Checklist progress">/'),Hg=d.template("<time>"),Ug=d.template("<span class=sc-card-footer><span class=sc-task-labels></span><span class=sc-card-meta>"),Kg=d.template("<span class=sc-task-project>"),Ua=d.template("<span>"),Yg=d.template("<div class=sc-markdown-preview>"),Gg=d.template("<form class=sc-task-editor><div class=sc-editor-field><span>Title</span></div><div class=sc-editor-field><span>Status</span></div><div class=sc-editor-field><span>Project</span></div><div class=sc-editor-field><div class=sc-description-heading><span>Description</span><div class=sc-actions></div></div></div><div class=sc-editor-field><span>Labels</span></div><div class=sc-editor-actions>"),Zg=d.template('<textarea aria-label=Description placeholder="Context, acceptance criteria… Markdown and - [ ] checklists supported.">'),Qg=d.template("<p>Nothing to preview yet."),Jg=d.template('<form class=sc-task-editor><div class=sc-editor-field><span>Name</span></div><div class=sc-editor-field><span>Color</span><div class=sc-column-colors role=group aria-label="Column color"></div></div><div class=sc-editor-actions>'),ev=d.template("<button type=button>"),tv=d.template("<div class=sc-editor-field><span>Move tasks to"),nv=d.template("<div class=sc-task-editor><p></p><div class=sc-editor-actions>");function rv(e){const t=Ce.usePlugin(),n=t.ui,r=()=>e.board,i=()=>r().value?.cards??[],s=C=>of(C,(A,I)=>{const L=t.servers.get(I);return L?.connected?L.data.session.status(A):void 0},!0,e.session.server.id),a=()=>r().value?.columns??[],o=_.createMemo(()=>t.storage.store("kanban-view-v2",{schema:cf,initial:{collapsed:[],mode:"overlay"},scope:"global",from:"plugin.opencode-desktop-showcase.kanban-view-v2"})),[l,c]=_.createSignal(),u=()=>l()?.scope===r()?i().find(C=>C.id===l()?.id):void 0,[h,p]=_.createSignal(),f=()=>h()?.scope===r()?h():void 0,g=()=>!!f()||!!u(),b=()=>{p(void 0),c(void 0)},[y,x]=_.createSignal(""),[m,v]=_.createSignal(""),w=()=>Su(e.session),k=_.createMemo(()=>Eg(t,e.session));_.createEffect(()=>{const C=m();C&&C!=="none"&&!k().some(A=>Bt(A)===C)&&v("")});const $=()=>[...new Set(i().flatMap(C=>zi(C.labels)))].sort(),E=()=>!!Dn().trim()||!!y()||!!m(),O=C=>!!o().value?.collapsed.includes(C)&&Fe()?.status!==C,V=C=>o().update(A=>{A.collapsed=A.collapsed.includes(C)?A.collapsed.filter(I=>I!==C):[...A.collapsed,C]}),[B,P]=_.createSignal(),[Q,se]=_.createSignal(),[dt,ht]=_.createSignal(),On=_.createMemo(()=>{const C=Q(),A=dt();return C&&A!==void 0?Ma(a(),C,A):a()}),[Yt,Li]=_.createSignal(100),[Wi,ji]=_.createSignal(0),[Fe,Ke]=_.createSignal(),[Dn,Dr]=_.createSignal(""),[Bi,Gt]=_.createSignal(8),st=C=>{const A=()=>Gt(C.offsetHeight-C.clientHeight+(parseFloat(getComputedStyle(C).paddingBottom)||0)),I=new ResizeObserver(A);I.observe(C),_.onCleanup(()=>I.disconnect())};let Zt,Ye,ot=0;const Qt=(C,A=C.position.current)=>{const{source:I,target:L}=C;if(I?.type==="column"){const S=Zt?.querySelector(".sc-board-columns"),j=S?.getBoundingClientRect();if(!S||!j||A.x<j.left||A.x>j.right||A.y<j.top||A.y>j.bottom)return ht(void 0);const re=[...S.querySelectorAll("[data-kanban-column]")],F=re.find(de=>de.dataset.kanbanColumn===I.data.columnID),D=Math.min(24,(F?.getBoundingClientRect().width??240)/4),Y=re.filter(de=>de!==F),oe=Y.findIndex(de=>{const Pe=de.getBoundingClientRect(),Le=F?F.compareDocumentPosition(de)&Node.DOCUMENT_POSITION_FOLLOWING?-D:D:0;return A.x<Pe.left+Pe.width/2+Le});ht(oe<0?Y.length:oe);return}if(I&&C.activatorEvent?.type!=="keydown"){const S=[...Zt?.querySelectorAll("[data-kanban-column]")??[]].find(Y=>{const oe=Y.getBoundingClientRect();return A.x>=oe.left&&A.x<=oe.right&&A.y>=oe.top&&A.y<=oe.bottom}),j=a().find(Y=>Y.id===S?.dataset.kanbanColumn)?.id;if(!S||!j)return Ke(void 0);const re=S.querySelector(".sc-drop-slot"),F=Math.min(24,Yt()/4),D=[...S.querySelectorAll("[data-task-id]")].find(Y=>{if(Y.dataset.taskId===String(I.id))return!1;const oe=Y.getBoundingClientRect(),de=re?re.compareDocumentPosition(Y)&Node.DOCUMENT_POSITION_FOLLOWING?-F:F:0;return A.y<oe.top+oe.height/2+de});return Ke({status:j,anchor:D?.dataset.taskId,after:!1})}if(I&&L&&I.id===L.id)return;if(!I||!L)return Ke(void 0);const J=a().find(S=>S.id===(Te(L)?L.group:L.data.status))?.id;if(!J)return Ke(void 0);const ue=i().find(S=>S.id===L.id),X=L.element?.getBoundingClientRect(),R=C.activatorEvent?.type==="keydown",N=ue&&X?R?Te(I)&&Te(L)&&I.group===L.group&&I.index<L.index:C.position.current.y>X.top+X.height/2:!1;Ke({status:J,anchor:ue?.id,after:!!N})},Tr=C=>{if(Qt(C.operation),Q()){const L=Q(),J=dt();!C.canceled&&Ye===r()&&J!==void 0&&r().update(ue=>{ue.columns=Ma(ue.columns,L,J)}),se(void 0),ht(void 0),Ye=void 0,ot=Date.now()+200;return}const A=Fe(),I=B();!C.canceled&&C.operation.target&&Ye===r()&&A&&I&&r().update(L=>{if(!L.columns.some(N=>N.id===A.status))return;const J=L.cards.filter(N=>N.id!==I&&N.status===A.status),ue=J.findIndex(N=>N.id===A.anchor),X=ue<0?J.length:ue+Number(A.after);L.cards=es(L.cards,I,A.status,X);const R=L.cards.find(N=>N.id===I);R&&(R.updatedAt=Date.now())}),Ye=void 0,ot=Date.now()+200,P(void 0),Ke(void 0)},be=()=>i().filter(C=>uf(C,Dn(),y(),m())),Tn=(C,A)=>{r().update(I=>{if(!I.columns.some(J=>J.id===A))return;I.cards=es(I.cards,C,A);const L=I.cards.find(J=>J.id===C);L&&(L.updatedAt=Date.now())})},Ge=(C,A=a()[0]?.id??"")=>{C||c(void 0),p({existing:C,status:A,scope:r()})},Ir=async C=>{const A=r();await t.dialogs.confirm({title:"Delete task?",description:`Delete “${C.title}”? Linked sessions will not be deleted.`})&&A.update(I=>{I.cards=I.cards.filter(L=>L.id!==C.id)})},In=C=>{const A=r();t.dialogs.open(I=>d.createComponent(n.Dialog,{title:C?"Edit column":"New column",get children(){var L=Ha();return d.insert(L,d.createComponent(av,{existing:C,get cancel(){return I.close},save:J=>{A.update(ue=>{if(C){const X=ue.columns.find(R=>R.id===C.id);X&&Object.assign(X,J)}else ue.columns.push({id:crypto.randomUUID(),...J})}),I.close()}})),L}}))},Rr=C=>{const A=r();t.dialogs.open(I=>d.createComponent(n.Dialog,{get title(){return`Delete ${C.title}?`},get children(){var L=Ha();return d.insert(L,d.createComponent(lv,{column:C,get columns(){return A.value?.columns??[]},get count(){return A.value?.cards.filter(J=>J.status===C.id).length??0},get cancel(){return I.close},remove:J=>{const ue=A.value;if(!ue)return;const X=lf(ue,C.id,J);if(X===ue){t.toast.show({variant:"error",title:"Column could not be deleted",description:"Keep at least one column and choose a destination for its tasks."});return}A.set(X),I.close()}})),L}}))};return(()=>{var C=Og(),A=C.firstChild,I=A.firstChild,L=I.nextSibling,J=L.nextSibling,ue=Zt;return typeof ue=="function"?d.use(ue,C):Zt=C,d.insert(C,d.createComponent(_.Show,{get when(){return d.memo(()=>!!g())()&&(o().value?.mode??"overlay")==="overlay"},get children(){var X=Ag();return X.$$click=R=>{R.stopPropagation(),b()},X.$$pointerdown=R=>{R.preventDefault(),R.stopPropagation()},X}}),A),d.insert(L,d.createComponent(n.TextInput,{class:"sc-kanban-input",label:"Filter tasks",type:"search",placeholder:"Search tasks…",get value(){return Dn()},onInput:Dr,get disabled(){return!!B()}})),d.insert(A,d.createComponent(n.Menu,{get label(){return y()||"All labels"},trigger:"button",get disabled(){return!!B()},get items(){return[{label:"All labels",onSelect:()=>x("")},...$().map(X=>({label:X,onSelect:()=>x(X)}))]}}),J),d.insert(A,d.createComponent(n.Menu,{get label(){return d.memo(()=>m()==="none")()?"No project":St(k().find(X=>Bt(X)===m())??{directory:"All projects"})},trigger:"button",get disabled(){return!!B()},get items(){return[{label:"All projects",onSelect:()=>v("")},{label:"No project",onSelect:()=>v("none")},...k().map(X=>({label:St(X),onSelect:()=>v(Bt(X))}))]}}),J),d.insert(A,d.createComponent(_.Show,{get when(){return E()},get children(){return d.createComponent(n.Tooltip,{value:"Clear filters",get children(){return d.createComponent(n.IconButton,{icon:"close",label:"Clear filters",variant:"ghost",size:"small",onClick:()=>{Dr(""),x(""),v("")}})}})}}),J),d.insert(A,d.createComponent(n.Tooltip,{value:"Task layout",get children(){return d.createComponent(n.Menu,{label:"Task layout",icon:"outline-dots",get disabled(){return!o().ready()},get items(){return[{mode:"overlay",label:"Overlay",icon:"layout-right-partial"},{mode:"split",label:"Split",icon:"layout-right"},{mode:"full",label:"Full",icon:"expand"}].map(X=>({label:`${(o().value?.mode??"overlay")===X.mode?"✓ ":""}${X.label}`,icon:X.icon,onSelect:()=>o().update(R=>{R.mode=X.mode})}))}})}}),J),d.insert(J,d.createComponent(n.Button,{variant:"contrast",icon:"plus",get disabled(){return!r().ready()},onClick:()=>Ge(),children:"New task"})),d.insert(A,d.createComponent(n.Tooltip,{value:"New column",get children(){return d.createComponent(n.IconButton,{icon:"grid-plus",label:"New column",get disabled(){return!r().ready()},variant:"ghost",onClick:()=>In()})}}),null),d.insert(C,d.createComponent(_.Show,{get when(){return r().ready()},get fallback(){return d.createComponent(n.Loader,{})},get children(){return d.createComponent(_.Show,{get when(){return r()},keyed:!0,children:X=>(_.onCleanup(()=>{Ye=void 0,ot=0,P(void 0),Ke(void 0),se(void 0),ht(void 0)}),d.createComponent(Wp,{get sensors(){return[Uc.configure({activationConstraints:[new jt.Distance({value:6})]})]},onDragStart:R=>{const N=R.operation.source;if(N?.type==="column"){Ye=X,ot=1/0,ht(a().findIndex(j=>j.id===N.data.columnID)),se(String(N.data.columnID));return}const S=i().find(j=>j.id===N?.id);!N||!S||(Li(N.element?.getBoundingClientRect().height??100),ji(N.element?.offsetTop??0),Ye=X,ot=1/0,Ke({status:S.status,anchor:S.id,after:!1}),P(S.id))},onDragOver:R=>{R.preventDefault(),Qt(R.operation)},onDragMove:R=>Qt(R.operation,R.to??R.operation.position.current),onDragEnd:Tr,get children(){return[(()=>{var R=Dg(),N=R.firstChild;return d.use(st,N),d.insert(N,d.createComponent(_.For,{get each(){return On()},children:(S,j)=>d.createComponent(iv,{get status(){return S.id},get index(){return j()},get disabled(){return E()},get active(){return Fe()?.status===S.id},get collapsed(){return O(S.id)},children:re=>d.createComponent(_.Show,{get when(){return!O(S.id)},get fallback(){return[d.createComponent(n.Tooltip,{get value(){return`Expand ${S.title}`},get children(){return d.createComponent(n.IconButton,{icon:"chevron-right",get label(){return`Expand ${S.title}`},variant:"ghost",size:"small",onClick:()=>V(S.id)})}}),(()=>{var F=zg(),D=re;return typeof D=="function"?d.use(D,F):re=F,d.insert(F,()=>S.title),d.effect(()=>d.setAttribute(F,"aria-label",`Drag ${S.title} column`)),F})(),(()=>{var F=Lg();return d.insert(F,()=>i().filter(D=>D.status===S.id).length),F})()]},get children(){return[(()=>{var F=Ig(),D=F.firstChild,Y=D.firstChild,oe=Y.nextSibling,de=oe.nextSibling,Pe=D.nextSibling,Le=re;return typeof Le=="function"?d.use(Le,D):re=D,d.insert(oe,()=>S.title),d.insert(de,()=>i().filter(at=>at.status===S.id).length),d.insert(Pe,d.createComponent(n.Tooltip,{get value(){return`Add task to ${S.title}`},get children(){return d.createComponent(n.IconButton,{icon:"plus",get label(){return`Add task to ${S.title}`},variant:"ghost",size:"small",onClick:()=>Ge(void 0,S.id)})}}),null),d.insert(Pe,d.createComponent(n.Menu,{get label(){return`${S.title} column options`},icon:"outline-dots",get items(){return[{label:"Edit column",icon:"edit",onSelect:()=>In(S)},{label:"Delete column",icon:"trash",disabled:a().length<=1,onSelect:()=>Rr(S)}]}}),null),d.insert(Pe,d.createComponent(n.Tooltip,{get value(){return`Collapse ${S.title}`},get children(){return d.createComponent(n.IconButton,{icon:"chevron-left",get label(){return`Collapse ${S.title}`},variant:"ghost",size:"small",get disabled(){return!o().ready()},onClick:()=>V(S.id)})}}),null),d.effect(at=>{var Rn=`Drag ${S.title} column`,Mr=S.color;return Rn!==at.e&&d.setAttribute(D,"aria-label",at.e=Rn),Mr!==at.t&&d.setStyleProperty(Y,"background",at.t=Mr),at},{e:void 0,t:void 0}),F})(),(()=>{var F=Mg();return d.insert(F,d.createComponent(_.For,{get each(){return be().filter(D=>D.status===S.id)},children:(D,Y)=>[d.createComponent(_.Show,{get when(){return d.memo(()=>Fe()?.anchor===D.id)()&&!Fe()?.after},get children(){return d.createComponent(ts,{get height(){return Yt()}})}}),d.createComponent(sv,{card:D,get index(){return Y()},get disabled(){return E()},get active(){return s(D)},get selected(){return u()?.id===D.id},get origin(){return B()===D.id},get originTop(){return Wi()},open:()=>{if(!(Date.now()<ot)){if(u()?.id===D.id)return b();p(void 0),c({id:D.id,scope:r()})}},get children(){return d.createComponent(Ka,{card:D})}}),d.createComponent(_.Show,{get when(){return d.memo(()=>Fe()?.anchor===D.id)()&&Fe()?.after},get children(){return d.createComponent(ts,{get height(){return Yt()}})}})]}),null),d.insert(F,d.createComponent(_.Show,{get when(){return d.memo(()=>Fe()?.status===S.id)()&&!Fe()?.anchor},get children(){return d.createComponent(ts,{get height(){return Yt()}})}}),null),d.insert(F,d.createComponent(_.Show,{get when(){return!be().some(D=>D.status===S.id)},get children(){var D=Rg();return d.insert(D,()=>E()?"No matching tasks":"No tasks yet"),D}}),null),F})()]}})})})),d.insert(R,d.createComponent(_.Show,{get when(){return g()},get children(){return d.createComponent(Pg,{get mode(){return o().value?.mode??"overlay"},get width(){return d.memo(()=>o().value?.mode==="split")()?o().value?.splitWidth??380:o().value?.overlayWidth??460},saveWidth:S=>o().update(j=>{j.mode==="split"?j.splitWidth=S:j.overlayWidth=S}),get children(){return d.createComponent(_.Show,{get when(){return f()},keyed:!0,get fallback(){return d.createComponent(_.Show,{get when(){return u()},children:S=>d.createComponent(Sg,{get task(){return S()},get session(){return e.session},get columns(){return a()},close:b,edit:()=>Ge(S()),remove:()=>{Ir(S())},move:j=>Tn(S().id,j),start:()=>e.start(S()),update:j=>r().update(re=>{const F=re.cards.find(D=>D.id===S().id);F&&Object.assign(F,j,{updatedAt:Date.now()})})})})},children:S=>(()=>{var j=Wg(),re=j.firstChild,F=re.firstChild,D=re.nextSibling;return j.$$keydown=Y=>{Y.key==="Escape"&&!Y.defaultPrevented&&(Y.stopPropagation(),p(void 0))},d.insert(F,()=>S.existing?"Edit task":"New task"),d.insert(re,d.createComponent(n.IconButton,{icon:"close",label:"Close task editor",variant:"ghost",onClick:b}),null),d.insert(D,d.createComponent(ov,{get existing(){return S.existing},get columns(){return a()},get projects(){return k()},get project(){return d.memo(()=>m()==="none")()?void 0:k().find(Y=>Bt(Y)===m())??w()},get status(){return S.status},cancel:()=>p(void 0),save:Y=>{const oe=S.existing?.id??crypto.randomUUID();S.scope.update(de=>{if(de.columns.some(Pe=>Pe.id===Y.status))if(S.existing){const Pe=de.cards.find(Le=>Le.id===oe);if(!Pe)return;Pe.status!==Y.status&&(de.cards=es(de.cards,oe,Y.status)),Object.assign(de.cards.find(Le=>Le.id===oe),Y,{updatedAt:Date.now()})}else de.cards.push({...Y,id:oe,session:"",sessions:[],updatedAt:Date.now()})}),p(void 0),c({id:oe,scope:S.scope})}})),d.effect(()=>d.setAttribute(j,"aria-label",S.existing?"Edit task":"New task")),j})()})}})}}),null),d.effect(S=>{var j=o().value?.mode??"overlay",re=g(),F=`${Bi()}px`,D=On().map(Y=>O(Y.id)?"44px":"minmax(240px, 1fr)").join(" ");return j!==S.e&&d.setAttribute(R,"data-mode",S.e=j),re!==S.t&&d.setAttribute(R,"data-detail",S.t=re),F!==S.a&&d.setStyleProperty(R,"--sc-board-bottom",S.a=F),D!==S.o&&d.setStyleProperty(N,"grid-template-columns",S.o=D),S},{e:void 0,t:void 0,a:void 0,o:void 0}),R})(),d.createComponent(Bp,{dropAnimation:null,get children(){return[d.createComponent(_.Show,{get when(){return i().find(R=>R.id===B())},keyed:!0,children:R=>(()=>{var N=jg(),S=N.firstChild,j=S.firstChild;return d.insert(j,()=>R.title),d.insert(S,d.createComponent(Ka,{card:R}),null),N})()}),d.createComponent(_.Show,{get when(){return Q()},get children(){var R=Tg();return d.insert(R,()=>a().find(N=>N.id===Q())?.title),R}})]}})]}}))})}}),null),C})()}function iv(e){const t=hu({get id(){return`column-sort:${e.status}`},get index(){return e.index},group:"columns",type:"column",accept:"column",get data(){return{columnID:e.status}}}),n=qp({get id(){return`column:${e.status}`},get disabled(){return e.disabled},data:{status:e.status},accept:"task",collisionPriority:-1});return(()=>{var r=Bg();return d.use(i=>{n.ref(i),t.ref(i)},r),d.insert(r,()=>e.children(t.handleRef)),d.effect(i=>{var s=t.isDragSource(),a=e.status,o=e.collapsed,l=e.active;return s!==i.e&&d.setAttribute(r,"data-column-dragging",i.e=s),a!==i.t&&d.setAttribute(r,"data-kanban-column",i.t=a),o!==i.a&&d.setAttribute(r,"data-collapsed",i.a=o),l!==i.o&&d.setAttribute(r,"data-over",i.o=l),i},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()}function sv(e){const t=hu({get id(){return e.card.id},get index(){return e.index},get group(){return e.card.status},get disabled(){return e.disabled},type:"task",accept:"task",collisionPriority:1});return(()=>{var n=Ng(),r=n.firstChild;return d.addEventListener(n,"click",e.open,!0),d.use(i=>{t.ref(i),t.handleRef(i)},n),d.insert(r,()=>e.card.title),d.insert(n,()=>e.children,null),d.effect(i=>{var s=e.card.id,a=e.origin,o=e.selected,l=e.active,c=`${e.originTop}px`,u=`Open ${e.card.title}`;return s!==i.e&&d.setAttribute(n,"data-task-id",i.e=s),a!==i.t&&d.setAttribute(n,"data-dragging",i.t=a),o!==i.a&&d.setAttribute(n,"data-selected",i.a=o),l!==i.o&&d.setAttribute(n,"data-active",i.o=l),c!==i.i&&d.setStyleProperty(n,"--sc-drag-top",i.i=c),u!==i.n&&d.setAttribute(n,"aria-label",i.n=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),n})()}function ts(e){return(()=>{var t=Fg();return d.effect(n=>d.setStyleProperty(t,"height",`${e.height}px`)),t})()}function Ka(e){const t=Ce.usePlugin().ui,n=_.createMemo(()=>Yo(e.card.description)),r=_.createMemo(()=>_u(e.card.description)),i=()=>zi(e.card.labels);return[d.createComponent(_.Show,{get when(){return e.card.project},children:s=>(()=>{var a=Kg();return d.insert(a,d.createComponent(t.Icon,{name:"folder",size:"small"}),null),d.insert(a,()=>St(s()),null),d.effect(()=>d.setAttribute(a,"title",s().directory)),a})()}),d.createComponent(_.Show,{get when(){return r()},get children(){var s=qg();return d.insert(s,r),s}}),(()=>{var s=Ug(),a=s.firstChild,o=a.nextSibling;return d.insert(a,d.createComponent(_.For,{get each(){return i().slice(0,2)},children:l=>(()=>{var c=Ua();return d.insert(c,l),c})()}),null),d.insert(a,d.createComponent(_.Show,{get when(){return i().length>2},get children(){var l=Vg();return l.firstChild,d.insert(l,()=>i().length-2,null),d.effect(()=>d.setAttribute(l,"title",i().slice(2).join(", "))),l}}),null),d.insert(o,d.createComponent(_.Show,{get when(){return n().length},get children(){var l=Xg(),c=l.firstChild;return d.insert(l,d.createComponent(t.Icon,{name:"checklist",size:"small"}),c),d.insert(l,()=>n().filter(u=>u.checked).length,c),d.insert(l,()=>n().length,null),l}}),null),d.insert(o,d.createComponent(_.Show,{get when(){return Mi(e.card,"").length},children:l=>(()=>{var c=Ua();return d.insert(c,d.createComponent(t.Icon,{name:"link",size:"small"}),null),d.insert(c,l,null),d.effect(u=>{var h=`${l()} linked ${l()===1?"session":"sessions"}`,p=`${l()} linked ${l()===1?"session":"sessions"}`;return h!==u.e&&d.setAttribute(c,"title",u.e=h),p!==u.t&&d.setAttribute(c,"aria-label",u.t=p),u},{e:void 0,t:void 0}),c})()}),null),d.insert(o,d.createComponent(_.Show,{get when(){return e.card.updatedAt},get children(){var l=Hg();return d.insert(l,()=>new Date(e.card.updatedAt).toLocaleDateString(void 0,{month:"short",day:"numeric"})),d.effect(()=>d.setAttribute(l,"title",new Date(e.card.updatedAt).toLocaleString())),l}}),null),s})()]}function ov(e){const t=Ce.usePlugin().ui,[n,r]=_.createSignal(e.existing?.title??""),[i,s]=_.createSignal(e.existing?.description??""),[a,o]=_.createSignal(e.existing?.labels??""),[l,c]=_.createSignal(e.existing?.status??e.status),[u,h]=_.createSignal(e.existing?e.existing.project:e.project),[p,f]=_.createSignal(!1);return(()=>{var g=Gg(),b=g.firstChild;b.firstChild;var y=b.nextSibling;y.firstChild;var x=y.nextSibling;x.firstChild;var m=x.nextSibling,v=m.firstChild,w=v.firstChild,k=w.nextSibling,$=m.nextSibling;$.firstChild;var E=$.nextSibling;return g.addEventListener("submit",O=>{O.preventDefault(),n().trim()&&e.save({title:n().trim(),description:i().trim(),labels:a().trim(),status:l(),project:u()})}),d.insert(b,d.createComponent(t.TextInput,{class:"sc-kanban-input",label:"Title",get value(){return n()},onInput:r,placeholder:"What needs to be done?",autofocus:!0}),null),d.insert(y,d.createComponent(t.Menu,{get label(){return e.columns.find(O=>O.id===l())?.title??"Choose column"},trigger:"button",get items(){return e.columns.map(O=>({label:O.title,onSelect:()=>c(O.id)}))}}),null),d.insert(x,d.createComponent(t.Menu,{get label(){return d.memo(()=>!!u())()?St(u()):"No project"},trigger:"button",get items(){return[{label:"No project",onSelect:()=>h(void 0)},...e.projects.map(O=>({label:St(O),onSelect:()=>h(O)}))]}}),null),d.insert(k,d.createComponent(t.Button,{size:"small",get variant(){return p()?"ghost-muted":"neutral"},onClick:()=>f(!1),children:"Write"}),null),d.insert(k,d.createComponent(t.Button,{size:"small",get variant(){return p()?"neutral":"ghost-muted"},onClick:()=>f(!0),children:"Preview"}),null),d.insert(m,d.createComponent(_.Show,{get when(){return p()},get fallback(){return(()=>{var O=Zg();return O.$$input=V=>s(V.currentTarget.value),d.effect(()=>O.value=i()),O})()},get children(){var O=Yg();return d.insert(O,d.createComponent(_.Show,{get when(){return i()},get fallback(){return Qg()},get children(){return d.createComponent(t.Markdown,{get text(){return i()}})}})),O}}),null),d.insert($,d.createComponent(t.TextInput,{class:"sc-kanban-input",label:"Labels",get value(){return a()},onInput:o,placeholder:"ui, bug, priority"}),null),d.insert(E,d.createComponent(t.Button,{type:"button",get onClick(){return e.cancel},children:"Cancel"}),null),d.insert(E,d.createComponent(t.Button,{type:"submit",variant:"contrast",get disabled(){return!n().trim()||!e.columns.some(O=>O.id===l())},children:"Save task"}),null),g})()}const Ya=[{name:"Neutral",value:"var(--v2-icon-icon-muted)"},{name:"Blue",value:"var(--v2-state-fg-info)"},{name:"Amber",value:"var(--v2-state-fg-warning)"},{name:"Accent",value:"var(--v2-text-text-accent)"},{name:"Green",value:"var(--v2-state-fg-success)"},{name:"Red",value:"var(--v2-state-fg-danger)"}];function av(e){const t=Ce.usePlugin().ui,[n,r]=_.createSignal(e.existing?.title??""),[i,s]=_.createSignal(e.existing?.color??Ya[0].value);return(()=>{var a=Jg(),o=a.firstChild;o.firstChild;var l=o.nextSibling,c=l.firstChild,u=c.nextSibling,h=l.nextSibling;return a.addEventListener("submit",p=>{p.preventDefault(),n().trim()&&e.save({title:n().trim(),color:i()})}),d.insert(o,d.createComponent(t.TextInput,{class:"sc-kanban-input",label:"Column name",get value(){return n()},onInput:r,autofocus:!0,placeholder:"e.g. Blocked"}),null),d.insert(u,d.createComponent(_.For,{each:Ya,children:p=>d.createComponent(t.Tooltip,{get value(){return p.name},get children(){var f=ev();return f.$$click=()=>s(p.value),d.effect(g=>{var b=p.name,y=i()===p.value,x=p.value;return b!==g.e&&d.setAttribute(f,"aria-label",g.e=b),y!==g.t&&d.setAttribute(f,"aria-pressed",g.t=y),x!==g.a&&d.setStyleProperty(f,"background",g.a=x),g},{e:void 0,t:void 0,a:void 0}),f}})})),d.insert(h,d.createComponent(t.Button,{get onClick(){return e.cancel},children:"Cancel"}),null),d.insert(h,d.createComponent(t.Button,{type:"submit",variant:"contrast",get disabled(){return!n().trim()},children:"Save column"}),null),a})()}function lv(e){const t=Ce.usePlugin().ui,n=()=>e.columns.filter(s=>s.id!==e.column.id),[r,i]=_.createSignal(n()[0]?.id);return(()=>{var s=nv(),a=s.firstChild,o=a.nextSibling;return d.insert(a,(()=>{var l=d.memo(()=>!!e.count);return()=>l()?`${e.count} task${e.count===1?"":"s"} will be moved to another column. No tasks will be deleted.`:"This column is empty. Tasks will not be deleted."})()),d.insert(s,d.createComponent(_.Show,{get when(){return e.count},get children(){var l=tv();return l.firstChild,d.insert(l,d.createComponent(t.Menu,{get label(){return n().find(c=>c.id===r())?.title??"Choose column"},trigger:"button",get items(){return n().map(c=>({label:c.title,onSelect:()=>i(c.id)}))}}),null),l}}),o),d.insert(o,d.createComponent(t.Button,{get onClick(){return e.cancel},children:"Cancel"}),null),d.insert(o,d.createComponent(t.Button,{variant:"danger",get disabled(){return!n().length||!!e.count&&!r()},onClick:()=>e.remove(r()),children:"Delete column"}),null),s})()}d.delegateEvents(["pointerdown","click","keydown","input"]);function cv(e,t){const n=new Set;return async(r,i)=>{const s=i.project?.server??r.server.id,a=i.project?.directory??r.directory,o=i.id,l=df(i),c=JSON.stringify([s,a,o]);if(!n.has(c)){n.add(c);try{const u=e.servers.get(s);if(!u?.connected)throw new Error("The workspace server is disconnected.");const p=await u.data.session.create({title:i.title,location:{directory:a}}).request;let f=!1;if(t.update(b=>{const y=b.cards.find(x=>x.id===o);y&&(y.links=[...Mi(y,s),{id:p.id,server:s}],y.session="",y.sessions=[],y.updatedAt=Date.now(),f=!0)}),!f)throw new Error("The task was deleted. The new session was not started.");e.tabs.open({server:s,id:p.id},{focus:!0});const g=e.servers.get(s);if(!g?.connected)throw new Error("The session was linked, but the server disconnected before the task could be sent.");await g.data.session.prompt({sessionID:p.id,text:l})}catch(u){e.toast.show({title:"Could not start session",description:u instanceof Error?u.message:String(u),variant:"error"})}finally{n.delete(c)}}}}function uv(e){return e.storage.store("kanban-v2",{schema:rf,initial:af(),scope:"global",from:"plugin.opencode-desktop-showcase.kanban-v2"})}const dv='.sc-root{color:inherit;font:inherit}.sc-root h2,.sc-root h3,.sc-root p{margin:0}.sc-root .sc-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.sc-root.sc-board-shortcut{display:inline-flex;align-items:center}.sc-root .sc-board-count{font-variant-numeric:tabular-nums}.sc-root.sc-kanban-ui{color:var(--v2-text-text-base);font-family:var(--v2-font-family-sans);font-size:13px;line-height:1.5}.sc-root.sc-kanban{position:relative;isolation:isolate;height:100%;min-height:0;display:flex;flex-direction:column;padding:16px;gap:16px;overflow:hidden;background:var(--v2-background-bg-base);container-type:inline-size}.sc-kanban-ui h2{font-size:14px;font-weight:500;line-height:20px;letter-spacing:normal}.sc-kanban-ui h3{font-size:12px;font-weight:500;line-height:20px}.sc-kanban-ui p,.sc-kanban-ui small{color:var(--v2-text-text-muted);opacity:1;font-size:12px;line-height:20px}.sc-kanban-ui .sc-kanban-input{width:100%;min-width:0}.sc-root .sc-board-header{display:flex;align-items:center;gap:8px;flex-shrink:0;min-width:0;overflow-x:auto;padding:2px}.sc-root .sc-board-header>:not(.sc-board-filter){flex-shrink:0}.sc-root .sc-board-header h2{margin:0 8px 0 0;white-space:nowrap}.sc-root .sc-board-new{margin-left:auto}.sc-root .sc-board-workspace{position:relative;display:flex;flex:1;min-height:200px;min-width:0;overflow:hidden}.sc-root .sc-board-columns{display:grid;gap:12px;flex:1;min-height:0;min-width:0;overflow-x:auto;padding-bottom:8px}.sc-root .sc-board-column{display:flex;flex-direction:column;gap:8px;background:var(--v2-background-bg-deep);border:1px solid var(--v2-border-border-muted);border-radius:8px;padding:8px;min-width:0;min-height:0;overflow:hidden}.sc-root .sc-board-column[data-collapsed=true]{align-items:center;padding-inline:4px}.sc-root .sc-column-rail{writing-mode:vertical-rl;font-weight:500;padding:8px 0}.sc-root .sc-column-drag{display:inline-flex;align-items:center;gap:8px;min-width:0;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;text-align:left;color:inherit;font-size:12px;font-weight:500}.sc-root .sc-column-drag:active{cursor:grabbing}.sc-root .sc-column-drag:focus-visible{outline:2px solid var(--v2-border-border-focus);outline-offset:2px;border-radius:4px}.sc-root .sc-board-column[data-column-dragging=true]{border:1px dashed var(--v2-border-border-focus);background:var(--v2-state-bg-info)}.sc-root .sc-board-column[data-column-dragging=true]>*{visibility:hidden;pointer-events:none}.sc-root.sc-column-overlay{background:var(--v2-background-bg-layer-01);border:1px solid var(--v2-border-border-focus);border-radius:8px;padding:16px}.sc-root .sc-column-colors{display:flex;gap:12px;padding:4px}.sc-root .sc-column-colors button{width:22px;height:22px;border-radius:50%;cursor:pointer}.sc-root .sc-column-colors button[aria-pressed=true],.sc-root .sc-column-colors button:focus-visible{outline:2px solid var(--v2-border-border-focus);outline-offset:3px}.sc-root .sc-board-column[data-over=true]{border-color:var(--v2-border-border-focus);background:var(--v2-background-bg-layer-01)}.sc-root .sc-board-column>header{display:flex;align-items:center;gap:8px;padding:0 4px 8px}.sc-root .sc-column-dot{width:7px;height:7px;border-radius:50%}.sc-root .sc-column-count{font-size:12px;font-variant-numeric:tabular-nums;color:var(--v2-text-text-faint)}.sc-root .sc-column-actions{margin-left:auto;display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.sc-root .sc-column-cards{position:relative;display:flex;flex-direction:column;gap:8px;flex:1;min-height:0;overflow-y:auto;padding:2px}.sc-root .sc-task{--sc-card-accent: var(--v2-text-text-accent);--sc-card-selection: color-mix(in srgb, var(--sc-card-accent) 18%, var(--v2-background-bg-layer-01));--sc-card-selection-border: var(--v2-border-border-focus);--sc-card-ring: color-mix(in srgb, var(--sc-card-accent) 20%, transparent);flex-shrink:0;position:relative;isolation:isolate;padding:12px;border:1px solid var(--v2-border-border-base);border-radius:9px;background:var(--v2-background-bg-base);display:flex;flex-direction:column;gap:10px}.sc-root button.sc-task{width:100%;text-align:left;color:inherit;font:inherit;cursor:pointer;touch-action:none;-webkit-user-select:none;user-select:none}.sc-root button.sc-task:active{cursor:grabbing}.sc-root button.sc-task:focus-visible{outline:2px solid var(--v2-border-border-focus);outline-offset:1px}.sc-root .sc-task[data-selected=true]{border-color:var(--sc-card-selection-border);background:var(--sc-card-selection);box-shadow:0 0 0 1px var(--sc-card-ring)}.sc-root .sc-task[data-active=true]{border-color:color-mix(in srgb,var(--sc-card-accent),var(--v2-border-border-base) 45%)}.sc-root .sc-task[data-active=true][data-selected=true]{border-color:var(--sc-card-selection-border);box-shadow:0 0 0 1px var(--sc-card-ring),0 0 16px color-mix(in srgb,var(--sc-card-accent),transparent 85%)}.sc-root .sc-task[data-active=true]:not([data-dragging=true]):before{content:"";position:absolute;z-index:1;inset:-1px;border-radius:inherit;padding:2px;pointer-events:none;background:conic-gradient(from var(--sc-kanban-beam-angle),transparent 0deg 250deg,var(--sc-card-accent) 285deg,color-mix(in srgb,var(--sc-card-accent) 35%,var(--v2-text-text-base)) 303deg,var(--sc-card-selection-border) 320deg,transparent 350deg);-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;filter:drop-shadow(0 0 5px color-mix(in srgb,var(--sc-card-accent) 65%,transparent));animation:sc-kanban-card-beam 4s linear infinite}@property --sc-kanban-beam-angle{syntax: "<angle>"; inherits: false; initial-value: 0deg;}@keyframes sc-kanban-card-beam{to{--sc-kanban-beam-angle: 360deg}}@media(prefers-reduced-motion:reduce){.sc-root .sc-task[data-active=true]:before{animation:none}}.sc-root .sc-drop-slot{flex-shrink:0;border:1px dashed var(--v2-border-border-focus);border-radius:6px;background:var(--v2-state-bg-info);opacity:.5}.sc-root .sc-task-overlay{box-shadow:var(--v2-elevation-floating);pointer-events:none}.sc-root .sc-task:not([data-selected=true]):not([data-active=true]):hover{border-color:var(--v2-border-border-strong);background:var(--v2-background-bg-layer-01)}.sc-root .sc-task[data-active=true]:hover{background:var(--v2-background-bg-layer-01)}.sc-root .sc-task[data-selected=true]:hover{background:color-mix(in srgb,var(--sc-card-selection) 94%,var(--sc-card-accent))}.sc-root .sc-task-editor{display:flex;flex-direction:column;gap:16px;width:100%;min-width:0}.sc-root .sc-task-editor textarea{width:100%;resize:vertical}.sc-root .sc-task-editor>label,.sc-root .sc-editor-field,.sc-root .sc-board-filter{display:flex;flex-direction:column;gap:8px;font-size:12px;color:var(--v2-text-text-muted)}.sc-root .sc-board-filter{flex:1 1 200px;min-width:120px;max-width:280px}.sc-root .sc-task-editor textarea{box-sizing:border-box;min-height:110px;max-height:220px;padding:8px;border:0;border-radius:6px;outline:1px solid transparent;outline-offset:0;color:var(--v2-text-text-base);font:inherit;font-size:13px;font-weight:440;line-height:20px;letter-spacing:-.04px;background:linear-gradient(180deg,var(--v2-alpha-light-6),var(--v2-alpha-light-2)),var(--v2-background-bg-base);box-shadow:var(--v2-elevation-button-neutral);transition:background 85ms ease-out,outline-color 85ms ease-out,box-shadow 85ms ease-out}.sc-root .sc-task-editor textarea::placeholder{color:var(--v2-text-text-faint)}.sc-root .sc-task-editor textarea:hover:not(:focus){background:linear-gradient(0deg,var(--v2-overlay-simple-overlay-hover),var(--v2-overlay-simple-overlay-hover)),linear-gradient(180deg,var(--v2-alpha-light-6),var(--v2-alpha-light-2)),var(--v2-background-bg-base)}.sc-root .sc-task-editor textarea:focus{outline:1px solid var(--v2-border-border-focus);outline-offset:0;box-shadow:none}.sc-root .sc-editor-actions{display:flex;justify-content:flex-end;gap:10px}.sc-root .sc-task[data-dragging=true]{position:absolute;top:var(--sc-drag-top);left:2px;right:2px;opacity:0;pointer-events:none}.sc-root .sc-task-title{margin:0;text-align:left;font-size:13px;font-weight:500;line-height:20px;overflow-wrap:anywhere}.sc-root .sc-task-project{display:flex;align-items:center;gap:4px;color:var(--v2-text-text-faint);font-size:11px;overflow-wrap:anywhere}.sc-root .sc-task-excerpt{color:var(--v2-text-text-muted);font-size:12px;line-height:20px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;overflow-wrap:anywhere}.sc-root .sc-card-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.sc-root .sc-card-meta{display:flex;align-items:center;gap:8px;color:var(--v2-text-text-faint);font-size:11px}.sc-root .sc-card-meta span{display:inline-flex;align-items:center;gap:4px}.sc-root .sc-task-labels{display:flex;flex-wrap:wrap;gap:5px}.sc-root .sc-task-labels:empty{display:none}.sc-root .sc-task-labels span{font-size:11px;line-height:16px;border:1px solid var(--v2-border-border-muted);padding:1px 6px;border-radius:4px;color:var(--v2-text-text-muted);background:var(--v2-background-bg-layer-01)}.sc-root .sc-empty-column{padding:16px 4px;font-size:12px;text-align:center;color:var(--v2-text-text-faint)}.sc-root .sc-task-detail{background:var(--v2-background-bg-base);border:1px solid var(--v2-border-border-base);border-radius:8px;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}.sc-root .sc-detail-shell{position:relative;display:flex;min-height:0;min-width:0;border-radius:8px}.sc-root .sc-detail-backdrop{position:absolute;inset:0;z-index:1;border:0;padding:0;background:color-mix(in srgb,var(--v2-background-bg-base) 28%,transparent);cursor:default}.sc-root .sc-detail-shell>.sc-task-detail{flex:1}.sc-root .sc-board-workspace[data-mode=overlay] .sc-detail-shell{position:absolute;top:0;bottom:var(--sc-board-bottom, 8px);right:0;width:var(--sc-detail-width);z-index:2}.sc-root .sc-board-workspace[data-mode=split][data-detail=true]{gap:0}.sc-root .sc-board-workspace[data-mode=split] .sc-detail-shell{flex:0 0 var(--sc-detail-width);margin-bottom:var(--sc-board-bottom, 8px)}.sc-root .sc-board-workspace[data-mode=full][data-detail=true] .sc-board-columns{display:none}.sc-root .sc-board-workspace[data-mode=full] .sc-detail-shell{flex:1}.sc-root .sc-detail-resizer{position:absolute;top:8px;bottom:8px;left:-5px;width:10px;z-index:3;display:flex;align-items:center;justify-content:center;cursor:col-resize;touch-action:none;outline:none}.sc-root .sc-detail-resizer>span{width:3px;height:32px;border-radius:999px;background:transparent;pointer-events:none;transition:background 85ms ease-out}.sc-root .sc-detail-resizer:hover>span,.sc-root .sc-detail-resizer:focus-visible>span,.sc-root .sc-detail-shell[data-resizing=true] .sc-detail-resizer>span{background:var(--v2-border-border-focus)}.sc-root .sc-detail-shell[data-resizing=true]{-webkit-user-select:none;user-select:none}.sc-root .sc-detail-toolbar{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;border-bottom:1px solid var(--v2-border-border-muted);color:var(--v2-text-text-muted);font-size:12px}.sc-root .sc-detail-body{overflow:auto;padding:20px;display:flex;flex-direction:column;gap:20px}.sc-root .sc-detail-title{display:flex;align-items:start;gap:12px}.sc-root .sc-detail-title h2{flex:1;font-size:18px;line-height:26px;overflow-wrap:anywhere}.sc-root .sc-detail-meta{display:flex;flex-wrap:wrap;align-items:center;gap:12px}.sc-root .sc-detail-section{display:flex;flex-direction:column;gap:12px;padding-top:16px;border-top:1px solid var(--v2-border-border-muted);overflow-wrap:anywhere}.sc-root .sc-task-markdown input[type=checkbox]{accent-color:var(--v2-text-text-accent)}.sc-root .sc-task-markdown input[type=checkbox]:enabled{cursor:pointer}.sc-root .sc-task-markdown input[type=checkbox]:focus-visible{outline:2px solid var(--v2-border-border-focus);outline-offset:2px}.sc-root .sc-linked-session{display:flex;align-items:center;gap:4px;min-width:0}.sc-root .sc-linked-session-title{display:block;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sc-root .sc-description-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.sc-root .sc-markdown-preview{min-height:110px;max-height:220px;overflow:auto;padding:8px;border:1px solid var(--v2-border-border-muted);border-radius:6px}@container (max-width: 700px){.sc-root .sc-board-workspace[data-mode=split] .sc-detail-shell{position:absolute;inset:0;z-index:2}}',hv=e=>{const t=uv(e),n=cv(e,t),r=()=>{const s=e.sessions.current();s&&e.layout.open(`${e.id}:kanban`,s,{tab:"select"})};e.add(Ce.Style,dv),e.add(Ce.Command,()=>({id:"kanban",title:"Kanban: Open task board",keywords:"tasks board project kanban global",featured:!0,enabled:!!e.sessions.current(),slash:{name:"kanban"},run:r}));const i={id:"kanban",title:"Task board",closable:"compact",fallback:!0};e.add(Ce.Panel,{id:"kanban",region:"side",wide:!0,list:s=>s.open.includes("kanban")?[i]:[],render:s=>d.createComponent(rv,{get session(){return s.session},board:t,start:a=>n(s.session,a)})}),e.add(Ce.MenuItem,()=>{const s=e.sessions.current();return{menu:"session.panel",id:"kanban",title:"Task board",icon:"layout-right",keybind:`${e.id}.kanban`,opened:!!s&&e.layout.state(`${e.id}:kanban`,s)!=="closed",run:r}}),e.add(Ce.Slot,{at:"session.header",render:s=>d.createComponent(Au,{get session(){return s.session},board:t})})},pv=Ce.Plugin.define({setup:hv});exports.default=pv;
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "opencode-board",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "A global Kanban task board for OpenCode Desktop",
5
+ "license": "MIT",
6
+ "author": "dbpolito",
7
+ "homepage": "https://github.com/dbpolito/opencode-board#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/dbpolito/opencode-board.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/dbpolito/opencode-board/issues"
14
+ },
15
+ "keywords": ["opencode", "opencode-plugin", "kanban", "tasks", "desktop"],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "type": "module",
20
+ "exports": {
21
+ "./gui-experimental": "./dist/gui-experimental.cjs"
22
+ },
23
+ "files": ["dist"],
24
+ "scripts": {
25
+ "build": "vite build",
26
+ "dev": "vite build --watch",
27
+ "typecheck": "tsc --noEmit",
28
+ "test": "bun run build && node --test tests/*.test.mjs",
29
+ "check": "bun run typecheck && bun run test",
30
+ "prepublishOnly": "bun run check"
31
+ },
32
+ "dependencies": {
33
+ "@dnd-kit/dom": "^0.5.1",
34
+ "@dnd-kit/solid": "^0.5.1",
35
+ "@opencode/plugin": "2.2.0",
36
+ "marked": "^18.1.2"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^24.0.0",
40
+ "effect": "4.0.1",
41
+ "solid-js": "^1.9.0",
42
+ "typescript": "^5.9.0",
43
+ "vite": "^7.0.0",
44
+ "vite-plugin-solid": "^2.11.0"
45
+ }
46
+ }