kanban-lite 1.2.13 → 1.2.16

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.
@@ -1,4 +1,4 @@
1
- var t1=Object.defineProperty;var r1=(e,t,r)=>t in e?t1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Pe=(e,t,r)=>r1(e,typeof t!="symbol"?t+"":t,r);import{r as x,R as U,F as n1,P as Gm,C as Dc,a as jt,b as Ll,c as Zr,M as s1,T as Kt,E as o1,d as Lc,e as a1,S as i1,Z as ga,L as l1,f as Fl,X as st,g as c1,h as u1,B as qm,I as Ym,Q as Jm,i as Zm,j as Qm,k as Xm,l as eg,m as Ze,n as d1,o as zo,p as Se,q as f1,s as tg,H as h1,t as p1,u as rg,v as Fc,U as va,w as ei,x as hf,D as m1,y as ng,z as g1,W as v1,A as y1,G as sg,J as og,K as b1,N as pf,O as x1,V as w1,Y as k1,_ as _1,$ as C1,a0 as $1,a1 as S1,a2 as j1}from"./icons-BBjcNiGI.js";import{r as ag}from"./react-vendor-CgdWStRY.js";var ig={exports:{}},ti={};/**
1
+ var t1=Object.defineProperty;var r1=(e,t,r)=>t in e?t1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Pe=(e,t,r)=>r1(e,typeof t!="symbol"?t+"":t,r);import{r as x,R as U,F as n1,P as Gm,C as Dc,a as jt,b as Ll,c as Zr,M as s1,T as Kt,E as o1,d as Lc,e as a1,S as i1,Z as ga,L as l1,f as Fl,X as st,g as c1,h as u1,B as qm,I as Ym,Q as Jm,i as Zm,j as Qm,k as Xm,l as eg,m as Ze,n as d1,o as zo,p as je,q as f1,s as tg,H as h1,t as p1,u as rg,v as Fc,U as va,w as ei,x as hf,D as m1,y as ng,z as g1,W as v1,A as y1,G as sg,J as og,K as b1,N as pf,O as x1,V as w1,Y as k1,_ as _1,$ as C1,a0 as $1,a1 as S1,a2 as j1}from"./icons-BBjcNiGI.js";import{r as ag}from"./react-vendor-CgdWStRY.js";var ig={exports:{}},ti={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@ var t1=Object.defineProperty;var r1=(e,t,r)=>t in e?t1(e,t,{enumerable:!0,config
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var E1=x,A1=Symbol.for("react.element"),N1=Symbol.for("react.fragment"),P1=Object.prototype.hasOwnProperty,R1=E1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T1={key:!0,ref:!0,__self:!0,__source:!0};function lg(e,t,r){var n,s={},o=null,a=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)P1.call(t,n)&&!T1.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:A1,type:e,key:o,ref:a,props:s,_owner:R1.current}}ti.Fragment=N1;ti.jsx=lg;ti.jsxs=lg;ig.exports=ti;var l=ig.exports;if(!("acquireVsCodeApi"in window)){let e=function(){return typeof navigator<"u"&&navigator.onLine===!1?"You are offline. Form submissions are unavailable until the standalone backend reconnects.":"Cannot submit while disconnected from the standalone backend. Wait for reconnection and try again."},t=function(E){const P={type:"connectionStatus",...E};window.postMessage(P,"*")},r=function(){M!==null&&(window.clearTimeout(M),M=null)},n=function(E){_&&E.send(JSON.stringify({type:"ready"})),w&&E.send(w),$&&E.send($)},s=function(E){for(const P of v)E.send(P);v.length=0},o=function(E){if(y=!1,!D||M!==null)return;if(R>=g){t({connected:!1,reconnecting:!1,fatal:!0,retryCount:R,maxRetries:g,reason:E});return}const P=h[R];R+=1,t({connected:!1,reconnecting:!0,fatal:!1,retryCount:R,maxRetries:g,retryDelayMs:P,reason:E}),M=window.setTimeout(()=>{M=null,a()},P)},a=function(){const E=new WebSocket(p);m=E,E.addEventListener("open",()=>{if(m!==E)return;y=!0;const P=!b;b=!0,r(),R=0,n(E),P&&s(E),t({connected:!0,reconnecting:!1,fatal:!1,retryCount:0,maxRetries:g})}),E.addEventListener("message",P=>{if(m===E)try{const W=JSON.parse(P.data);window.postMessage(W,"*")}catch{}}),E.addEventListener("error",()=>{m===E&&(E.readyState===WebSocket.CONNECTING||E.readyState===WebSocket.OPEN)&&E.close()}),E.addEventListener("close",()=>{m===E&&(m=null,o("socket-closed"))})},i=function(E){const P=document.createElement("input");P.type="file",P.multiple=!0,P.style.display="none",document.body.appendChild(P);const W=()=>{P.remove()};P.onchange=async()=>{if(!P.files||P.files.length===0){W();return}const G=[];for(const L of Array.from(P.files)){const V=await L.arrayBuffer(),O=new Uint8Array(V);let te="";for(let J=0;J<O.length;J++)te+=String.fromCharCode(O[J]);G.push({name:L.name,data:btoa(te)})}try{await fetch("/api/upload-attachment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cardId:E,files:G})})}catch(L){console.error("Failed to upload attachment:",L)}W()},P.click()},u=function(E,P){const W=`/api/attachment?cardId=${encodeURIComponent(E)}&filename=${encodeURIComponent(P)}`;window.open(W,"_blank")},c=function(E){document.body.classList.toggle("vscode-dark",E),document.body.classList.toggle("vscode-light",!E)},d=function(){const E=localStorage.getItem("kanban-standalone-theme");c(E!==null?E==="dark":S.matches)};const f=window.__KB_BASE__??"",p=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}${f}/ws`,h=[250,500,1e3,2e3,4e3],g=h.length;let m=null;const v=[];let y=!1,b=!1,_=!1,w=null,$=null,R=0,M=null,D=!0;window.addEventListener("beforeunload",()=>{D=!1,r(),m&&(m.readyState===WebSocket.CONNECTING||m.readyState===WebSocket.OPEN)&&m.close()}),a();let j=null;try{const E=sessionStorage.getItem("kanban-standalone-state");E&&(j=JSON.parse(E))}catch{}window.acquireVsCodeApi=()=>({postMessage(E){const P=E;if(P.type==="openFile"){const G=P.cardId;fetch(`/api/card-file?cardId=${encodeURIComponent(G)}`).then(L=>L.json()).then(L=>{var te;const V=(te=L==null?void 0:L.data)==null?void 0:te.path;if(!V){console.error("card-file: missing path in response",L);return}const O=document.createElement("a");O.href=`vscode://file/${V}`,document.body.appendChild(O),O.click(),document.body.removeChild(O)}).catch(L=>console.error("Failed to open card in VS Code:",L));return}if(P.type==="openMetadataFile"){const G=P.path;fetch(`/api/resolve-path?path=${encodeURIComponent(G)}`).then(L=>L.json()).then(L=>{var te;const V=(te=L==null?void 0:L.data)==null?void 0:te.path;if(!V){console.error("resolve-path: missing path in response",L);return}const O=document.createElement("a");O.href=`vscode://file/${V}`,document.body.appendChild(O),O.click(),document.body.removeChild(O)}).catch(L=>console.error("Failed to open metadata file in VS Code:",L));return}if(P.type==="addAttachment"){i(P.cardId);return}if(P.type==="openAttachment"){u(P.cardId,P.attachment);return}if(P.type==="toggleTheme"){const L=!document.body.classList.contains("vscode-dark");localStorage.setItem("kanban-standalone-theme",L?"dark":"light"),c(L);return}const W=JSON.stringify(E);if(P.type==="ready"){_=!0,y&&m&&m.readyState===WebSocket.OPEN&&m.send(W);return}if(P.type==="switchBoard"&&(w=W),P.type==="openCard"&&($=W),P.type==="closeCard"&&($=null),P.type==="switchBoard"||P.type==="openCard"||P.type==="closeCard"){y&&m&&m.readyState===WebSocket.OPEN&&m.send(W);return}if(P.type==="submitForm"&&(!y||!m||m.readyState!==WebSocket.OPEN)){window.postMessage({type:"submitFormResult",callbackKey:P.callbackKey,error:e()},"*");return}y&&m&&m.readyState===WebSocket.OPEN?m.send(W):b?console.warn("Dropping standalone message while disconnected",P.type):v.push(W)},getState(){return j},setState(E){j=E;try{sessionStorage.setItem("kanban-standalone-state",JSON.stringify(E))}catch{}}});const S=window.matchMedia("(prefers-color-scheme: dark)");S.addEventListener("change",E=>{localStorage.getItem("kanban-standalone-theme")===null&&c(E.matches)}),document.body?d():document.addEventListener("DOMContentLoaded",d)}var cg,mf=ag;cg=mf.createRoot,mf.hydrateRoot;var Le=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Le||{});function ug({update:e,notify:t,unwatched:r}){return{link:n,unlink:s,propagate:o,checkDirty:a,shallowPropagate:i};function n(c,d,f){const p=d.depsTail;if(p!==void 0&&p.dep===c)return;const h=p!==void 0?p.nextDep:d.deps;if(h!==void 0&&h.dep===c){h.version=f,d.depsTail=h;return}const g=c.subsTail;if(g!==void 0&&g.version===f&&g.sub===d)return;const m=d.depsTail=c.subsTail={version:f,dep:c,sub:d,prevDep:p,nextDep:h,prevSub:g,nextSub:void 0};h!==void 0&&(h.prevDep=m),p!==void 0?p.nextDep=m:d.deps=m,g!==void 0?g.nextSub=m:c.subs=m}function s(c,d=c.sub){const f=c.dep,p=c.prevDep,h=c.nextDep,g=c.nextSub,m=c.prevSub;return h!==void 0?h.prevDep=p:d.depsTail=p,p!==void 0?p.nextDep=h:d.deps=h,g!==void 0?g.prevSub=m:f.subsTail=m,m!==void 0?m.nextSub=g:(f.subs=g)===void 0&&r(f),h}function o(c){let d=c.nextSub,f;e:do{const p=c.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&u(c,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const g=p.subs;if(g!==void 0){const m=(c=g).nextSub;m!==void 0&&(f={value:d,prev:f},d=m);continue}}if((c=d)!==void 0){d=c.nextSub;continue}for(;f!==void 0;)if(c=f.value,f=f.prev,c!==void 0){d=c.nextSub;continue e}break}while(!0)}function a(c,d){let f,p=0,h=!1;e:do{const g=c.dep,m=g.flags;if(d.flags&16)h=!0;else if((m&17)===17){if(e(g)){const v=g.subs;v.nextSub!==void 0&&i(v),h=!0}}else if((m&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(f={value:c,prev:f}),c=g.deps,d=g,++p;continue}if(!h){const v=c.nextDep;if(v!==void 0){c=v;continue}}for(;p--;){const v=d.subs,y=v.nextSub!==void 0;if(y?(c=f.value,f=f.prev):c=v,h){if(e(d)){y&&i(v),d=c.sub;continue}h=!1}else d.flags&=-33;d=c.sub;const b=c.nextDep;if(b!==void 0){c=b;continue e}}return h}while(!0)}function i(c){do{const d=c.sub,f=d.flags;(f&48)===32&&(d.flags=f|16,(f&6)===2&&t(d))}while((c=c.nextSub)!==void 0)}function u(c,d){let f=d.depsTail;for(;f!==void 0;){if(f===c)return!0;f=f.prevDep}return!1}}let Bc=0,Or=0,Ds=0;const or=[],{link:NQ,unlink:dg,propagate:PQ,checkDirty:I1,shallowPropagate:RQ}=ug({update(e){return e.depsTail!==void 0?D1(e):L1(e)},notify(e){var n;let t=Ds,r=t;do if(or[t++]=e,e.flags&=-3,e=(n=e.subs)==null?void 0:n.sub,e===void 0||!(e.flags&2))break;while(!0);for(Ds=t;r<--t;){const s=or[r];or[r++]=or[t],or[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ri(e)):U1.call(e)}});function M1(){return Bc}function z1(){++Bc}function O1(){--Bc||B1()}function D1(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,ri(e)}}function L1(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function F1(e){const t=e.flags;if(t&16||t&32&&I1(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,ri(e)}}else e.flags=2}function B1(){try{for(;Or<Ds;){const e=or[Or];or[Or++]=void 0,F1(e)}}finally{for(;Or<Ds;){const e=or[Or];or[Or++]=void 0,e.flags|=10}Or=0,Ds=0}}function U1(){this.depsTail=void 0,this.flags=0,ri(this);const e=this.subs;e!==void 0&&dg(e)}function ri(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=dg(r,e)}function Uc(e,t,r){var o,a,i;const n=typeof e=="object",s=n?e:void 0;return{next:(o=n?e.next:e)==null?void 0:o.bind(s),error:(a=n?e.error:t)==null?void 0:a.bind(s),complete:(i=n?e.complete:r)==null?void 0:i.bind(s)}}const Bl=[];let ta=0;const{link:gf,unlink:V1,propagate:W1,checkDirty:fg,shallowPropagate:vf}=ug({update(e){return e._update()},notify(e){Bl[Ul++]=e,e.flags&=~Le.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Le.Mutable|Le.Dirty,ya(e))}});let Oo=0,Ul=0,Ft;function ya(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=V1(r,e)}function hg(){if(!(M1()>0)){for(;Oo<Ul;){const e=Bl[Oo];Bl[Oo++]=void 0,e.notify()}Oo=0,Ul=0}}function pg(e,t){const r=typeof e=="function",n=e,s={_snapshot:r?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:r?Le.None:Le.Mutable,get(){return Ft!==void 0&&gf(s,Ft,ta),s._snapshot},subscribe(o){const a=Uc(o),i={current:!1},u=K1(()=>{var c;s.get(),i.current?(c=a.next)==null||c.call(a,s._snapshot):i.current=!0});return{unsubscribe:()=>{u.stop()}}},_update(o){const a=Ft,i=Object.is;if(r)Ft=s,++ta,s.depsTail=void 0;else if(o===void 0)return!1;r&&(s.flags=Le.Mutable|Le.RecursedCheck);try{const u=s._snapshot,c=typeof o=="function"?o(u):o===void 0&&r?n(u):o;return u===void 0||!i(u,c)?(s._snapshot=c,!0):!1}finally{Ft=a,r&&(s.flags&=~Le.RecursedCheck),ya(s)}}};return r?(s.flags=Le.Mutable|Le.Dirty,s.get=function(){const o=s.flags;if(o&Le.Dirty||o&Le.Pending&&fg(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&vf(a)}}else o&Le.Pending&&(s.flags=o&~Le.Pending);return Ft!==void 0&&gf(s,Ft,ta),s._snapshot}):s.set=function(o){if(s._update(o)){const a=s.subs;a!==void 0&&(W1(a),vf(a),hg())}},s}function K1(e){const t=()=>{const n=Ft;Ft=r,++ta,r.depsTail=void 0,r.flags=Le.Watching|Le.RecursedCheck;try{return e()}finally{Ft=n,r.flags&=~Le.RecursedCheck,ya(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Le.Watching|Le.RecursedCheck,notify(){const n=this.flags;n&Le.Dirty||n&Le.Pending&&fg(this.deps,this)?t():this.flags=Le.Watching},stop(){this.flags=Le.None,this.depsTail=void 0,ya(this)}};return t(),r}class H1{constructor(t){this.atom=pg(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Uc(t))}}class G1{constructor(t){this.atom=pg(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Uc(t))}}function q1(e){return typeof e=="function"?new G1(e):new H1(e)}function Y1(e){try{z1(),e()}finally{O1(),hg()}}const Er="__TSR_index",yf="popstate",bf="beforeunload";function mg(e){let t=e.getLocation();const r=new Set,n=a=>{t=e.getLocation(),r.forEach(i=>i({location:t,action:a}))},s=a=>{e.notifyOnIndexChange??!0?n(a):t=e.getLocation()},o=async({task:a,navigateOpts:i,...u})=>{var p,h;if((i==null?void 0:i.ignoreBlocker)??!1){a();return}const d=((p=e.getBlockers)==null?void 0:p.call(e))??[],f=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&d.length&&f)for(const g of d){const m=Ys(u.path,u.state);if(await g.blockerFn({currentLocation:t,nextLocation:m,action:u.type})){(h=e.onBlocked)==null||h.call(e);return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:r,subscribe:a=>(r.add(a),()=>{r.delete(a)}),push:(a,i,u)=>{const c=t.state[Er];i=Vl(c+1,i),o({task:()=>{e.pushState(a,i),n({type:"PUSH"})},navigateOpts:u,type:"PUSH",path:a,state:i})},replace:(a,i,u)=>{const c=t.state[Er];i=Vl(c,i),o({task:()=>{e.replaceState(a,i),n({type:"REPLACE"})},navigateOpts:u,type:"REPLACE",path:a,state:i})},go:(a,i)=>{o({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{o({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{o({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Er]!==0,createHref:a=>e.createHref(a),block:a=>{var u;if(!e.setBlockers)return()=>{};const i=((u=e.getBlockers)==null?void 0:u.call(e))??[];return e.setBlockers([...i,a]),()=>{var d,f;const c=((d=e.getBlockers)==null?void 0:d.call(e))??[];(f=e.setBlockers)==null||f.call(e,c.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:n}}function Vl(e,t){t||(t={});const r=Vc();return{...t,key:r,__TSR_key:r,[Er]:e}}function J1(e){var D,j;const t=typeof document<"u"?window:void 0,r=t.history.pushState,n=t.history.replaceState;let s=[];const o=()=>s,a=S=>s=S,i=S=>S,u=()=>Ys(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((D=t.history.state)!=null&&D.__TSR_key)&&!((j=t.history.state)!=null&&j.key)){const S=Vc();t.history.replaceState({[Er]:0,key:S,__TSR_key:S},"")}let c=u(),d,f=!1,p=!1,h=!1,g=!1;const m=()=>c;let v,y;const b=()=>{v&&(M._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),M._ignoreSubscribers=!1,v=void 0,y=void 0,d=void 0)},_=(S,E,P)=>{const W=i(E);y||(d=c),c=Ys(E,P),v={href:W,state:P,isPush:(v==null?void 0:v.isPush)||S==="push"},y||(y=Promise.resolve().then(()=>b()))},w=S=>{c=u(),M.notify({type:S})},$=async()=>{if(p){p=!1;return}const S=u(),E=S.state[Er]-c.state[Er],P=E===1,W=E===-1,G=!P&&!W||f;f=!1;const L=G?"GO":W?"BACK":"FORWARD",V=G?{type:"GO",index:E}:{type:W?"BACK":"FORWARD"};if(h)h=!1;else{const O=o();if(typeof document<"u"&&O.length){for(const te of O)if(await te.blockerFn({currentLocation:c,nextLocation:S,action:L})){p=!0,t.history.go(1),M.notify(V);return}}}c=u(),M.notify(V)},R=S=>{if(g){g=!1;return}let E=!1;const P=o();if(typeof document<"u"&&P.length)for(const W of P){const G=W.enableBeforeUnload??!0;if(G===!0){E=!0;break}if(typeof G=="function"&&G()===!0){E=!0;break}}if(E)return S.preventDefault(),S.returnValue=""},M=mg({getLocation:m,getLength:()=>t.history.length,pushState:(S,E)=>_("push",S,E),replaceState:(S,E)=>_("replace",S,E),back:S=>(S&&(h=!0),g=!0,t.history.back()),forward:S=>{S&&(h=!0),g=!0,t.history.forward()},go:S=>{f=!0,t.history.go(S)},createHref:S=>i(S),flush:b,destroy:()=>{t.history.pushState=r,t.history.replaceState=n,t.removeEventListener(bf,R,{capture:!0}),t.removeEventListener(yf,$)},onBlocked:()=>{d&&c!==d&&(c=d)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(bf,R,{capture:!0}),t.addEventListener(yf,$),t.history.pushState=function(...S){const E=r.apply(t.history,S);return M._ignoreSubscribers||w("PUSH"),E},t.history.replaceState=function(...S){const E=n.apply(t.history,S);return M._ignoreSubscribers||w("REPLACE"),E},M}function Z1(e={initialEntries:["/"]}){const t=e.initialEntries;let r=e.initialIndex?Math.min(Math.max(e.initialIndex,0),t.length-1):t.length-1;const n=t.map((u,c)=>Vl(c,void 0)),s=()=>Ys(t[r],n[r]);let o=[];return mg({getLocation:s,getLength:()=>t.length,pushState:(u,c)=>{r<t.length-1&&(t.splice(r+1),n.splice(r+1)),n.push(c),t.push(u),r=Math.max(t.length-1,0)},replaceState:(u,c)=>{n[r]=c,t[r]=u},back:()=>{r=Math.max(r-1,0)},forward:()=>{r=Math.min(r+1,t.length-1)},go:u=>{r=Math.min(Math.max(r+u,0),t.length-1)},createHref:u=>u,getBlockers:()=>o,setBlockers:u=>o=u})}function Q1(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ys(e,t){const r=Q1(e),n=r.indexOf("#"),s=r.indexOf("?"),o=Vc();return{href:r,pathname:r.substring(0,n>0?s>0?Math.min(n,s):n:s>0?s:r.length),hash:n>-1?r.substring(n):"",search:s>-1?r.slice(s,n===-1?void 0:n):"",state:t||{[Er]:0,key:o,__TSR_key:o}}}function Vc(){return(Math.random()+1).toString(36).substring(7)}const X1=!1;function Ls(e){let t;return Y1(()=>{t=e()}),t}function Js(e){return e[e.length-1]}function ew(e){return typeof e=="function"}function $r(e,t){return ew(e)?e(t):e}const tw=Object.prototype.hasOwnProperty,xf=Object.prototype.propertyIsEnumerable;function gt(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=t,s=_f(e)&&_f(n);if(!s&&!(ba(e)&&ba(n)))return n;const o=s?e:wf(e);if(!o)return n;const a=s?n:wf(n);if(!a)return n;const i=o.length,u=a.length,c=s?new Array(u):{};let d=0;for(let f=0;f<u;f++){const p=s?f:a[f],h=e[p],g=n[p];if(h===g){c[p]=h,(s?f<i:tw.call(e,p))&&d++;continue}if(h===null||g===null||typeof h!="object"||typeof g!="object"){c[p]=g;continue}const m=gt(h,g,r+1);c[p]=m,m===h&&d++}return i===u&&d===i?e:c}function wf(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!xf.call(e,s))return!1;const r=Object.getOwnPropertySymbols(e);if(r.length===0)return t;const n=t;for(const s of r){if(!xf.call(e,s))return!1;n.push(s)}return n}function ba(e){if(!kf(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!kf(r)||!r.hasOwnProperty("isPrototypeOf"))}function kf(e){return Object.prototype.toString.call(e)==="[object Object]"}function _f(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qr(e,t,r){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;n++)if(!Qr(e[n],t[n],r))return!1;return!0}if(ba(e)&&ba(t)){const n=(r==null?void 0:r.ignoreUndefined)??!0;if(r!=null&&r.partial){for(const a in t)if((!n||t[a]!==void 0)&&!Qr(e[a],t[a],r))return!1;return!0}let s=0;if(!n)s=Object.keys(e).length;else for(const a in e)e[a]!==void 0&&s++;let o=0;for(const a in t)if((!n||t[a]!==void 0)&&(o++,o>s||!Qr(e[a],t[a],r)))return!1;return s===o}return!1}function Fn(e){let t,r;const n=new Promise((s,o)=>{t=s,r=o});return n.status="pending",n.resolve=s=>{n.status="resolved",n.value=s,t(s),e==null||e(s)},n.reject=s=>{n.status="rejected",r(s)},n}function Zs(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function rw(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Cf(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,r=>{try{return decodeURI(r)}catch{return r}})}return rw(t)}const nw=["http:","https:","mailto:","tel:"];function xa(e,t){if(!e)return!1;try{const r=new URL(e);return!t.has(r.protocol)}catch{return!1}}function ms(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let r=0,n="",s;for(;(s=t.exec(e))!==null;)n+=Cf(e.slice(r,s.index))+s[0],r=t.lastIndex;n=n+Cf(r?e.slice(r):e);let o=!1;return n.startsWith("//")&&(o=!0,n="/"+n.replace(/^\/+/,"")),{path:n,handledProtocolRelativeURL:o}}function sw(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var ow="Invariant failed";function Pr(e,t){if(!e)throw new Error(ow)}function wa(e){const t=new Map;let r,n;const s=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,n&&(n.next=o,o.prev=n)):(o.next.prev=void 0,r=o.next,o.next=void 0,n&&(o.prev=n,n.next=o)),n=o)};return{get(o){const a=t.get(o);if(a)return s(a),a.value},set(o,a){if(t.size>=e&&r){const u=r;t.delete(u.key),u.next&&(r=u.next,u.next.prev=void 0),u===n&&(n=void 0)}const i=t.get(o);if(i)i.value=a,s(i);else{const u={key:o,value:a,prev:n};n&&(n.next=u),n=u,r||(r=u),t.set(o,u)}},clear(){t.clear(),r=void 0,n=void 0}}}const Bn=0,tn=1,rn=2,Qs=3,qr=4,gg=5;function aw(e){const t=e.indexOf("{");if(t===-1)return null;const r=e.indexOf("}",t);return r===-1||t+1>=e.length?null:[t,r]}function Wc(e,t,r=new Uint16Array(6)){const n=e.indexOf("/",t),s=n===-1?e.length:n,o=e.substring(t,s);if(!o||!o.includes("$"))return r[0]=Bn,r[1]=t,r[2]=t,r[3]=s,r[4]=s,r[5]=s,r;if(o==="$"){const i=e.length;return r[0]=rn,r[1]=t,r[2]=t,r[3]=i,r[4]=i,r[5]=i,r}if(o.charCodeAt(0)===36)return r[0]=tn,r[1]=t,r[2]=t+1,r[3]=s,r[4]=s,r[5]=s,r;const a=aw(o);if(a){const[i,u]=a,c=o.charCodeAt(i+1);if(c===45){if(i+2<o.length&&o.charCodeAt(i+2)===36){const d=i+3,f=u;if(d<f)return r[0]=Qs,r[1]=t+i,r[2]=t+d,r[3]=t+f,r[4]=t+u+1,r[5]=s,r}}else if(c===36){const d=i+1,f=i+2;return f===u?(r[0]=rn,r[1]=t+i,r[2]=t+d,r[3]=t+f,r[4]=t+u+1,r[5]=e.length,r):(r[0]=tn,r[1]=t+i,r[2]=t+f,r[3]=t+u,r[4]=t+u+1,r[5]=s,r)}}return r[0]=Bn,r[1]=t,r[2]=t,r[3]=s,r[4]=s,r[5]=s,r}function ni(e,t,r,n,s,o,a){var u,c,d,f,p,h,g,m,v,y,b,_,w;a==null||a(r);let i=n;{const $=r.fullPath??r.from,R=$.length,M=((u=r.options)==null?void 0:u.caseSensitive)??e,D=!!((d=(c=r.options)==null?void 0:c.params)!=null&&d.parse&&((p=(f=r.options)==null?void 0:f.skipRouteOnParseError)!=null&&p.params));for(;i<R;){const S=Wc($,i,t);let E;const P=i,W=S[5];switch(i=W+1,o++,S[0]){case Bn:{const L=$.substring(S[2],S[3]);if(M){const V=(h=s.static)==null?void 0:h.get(L);if(V)E=V;else{s.static??(s.static=new Map);const O=Yr(r.fullPath??r.from);O.parent=s,O.depth=o,E=O,s.static.set(L,O)}}else{const V=L.toLowerCase(),O=(g=s.staticInsensitive)==null?void 0:g.get(V);if(O)E=O;else{s.staticInsensitive??(s.staticInsensitive=new Map);const te=Yr(r.fullPath??r.from);te.parent=s,te.depth=o,E=te,s.staticInsensitive.set(V,te)}}break}case tn:{const L=$.substring(P,S[1]),V=$.substring(S[4],W),O=M&&!!(L||V),te=L?O?L:L.toLowerCase():void 0,J=V?O?V:V.toLowerCase():void 0,H=!D&&((m=s.dynamic)==null?void 0:m.find(A=>!A.skipOnParamError&&A.caseSensitive===O&&A.prefix===te&&A.suffix===J));if(H)E=H;else{const A=Fi(tn,r.fullPath??r.from,O,te,J);E=A,A.depth=o,A.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(A)}break}case Qs:{const L=$.substring(P,S[1]),V=$.substring(S[4],W),O=M&&!!(L||V),te=L?O?L:L.toLowerCase():void 0,J=V?O?V:V.toLowerCase():void 0,H=!D&&((v=s.optional)==null?void 0:v.find(A=>!A.skipOnParamError&&A.caseSensitive===O&&A.prefix===te&&A.suffix===J));if(H)E=H;else{const A=Fi(Qs,r.fullPath??r.from,O,te,J);E=A,A.parent=s,A.depth=o,s.optional??(s.optional=[]),s.optional.push(A)}break}case rn:{const L=$.substring(P,S[1]),V=$.substring(S[4],W),O=M&&!!(L||V),te=L?O?L:L.toLowerCase():void 0,J=V?O?V:V.toLowerCase():void 0,H=Fi(rn,r.fullPath??r.from,O,te,J);E=H,H.parent=s,H.depth=o,s.wildcard??(s.wildcard=[]),s.wildcard.push(H)}}s=E}if(D&&r.children&&!r.isRoot&&r.id&&r.id.charCodeAt(r.id.lastIndexOf("/")+1)===95){const S=Yr(r.fullPath??r.from);S.kind=gg,S.parent=s,o++,S.depth=o,s.pathless??(s.pathless=[]),s.pathless.push(S),s=S}const j=(r.path||!r.children)&&!r.isRoot;if(j&&$.endsWith("/")){const S=Yr(r.fullPath??r.from);S.kind=qr,S.parent=s,o++,S.depth=o,s.index=S,s=S}s.parse=((b=(y=r.options)==null?void 0:y.params)==null?void 0:b.parse)??null,s.skipOnParamError=D,s.parsingPriority=((w=(_=r.options)==null?void 0:_.skipRouteOnParseError)==null?void 0:w.priority)??0,j&&!s.route&&(s.route=r,s.fullPath=r.fullPath??r.from)}if(r.children)for(const $ of r.children)ni(e,t,$,i,s,o,a)}function Li(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Cr(e){var t,r,n;if(e.pathless)for(const s of e.pathless)Cr(s);if(e.static)for(const s of e.static.values())Cr(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())Cr(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Li);for(const s of e.dynamic)Cr(s)}if((r=e.optional)!=null&&r.length){e.optional.sort(Li);for(const s of e.optional)Cr(s)}if((n=e.wildcard)!=null&&n.length){e.wildcard.sort(Li);for(const s of e.wildcard)Cr(s)}}function Yr(e){return{kind:Bn,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Fi(e,t,r,n,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:r,prefix:n,suffix:s}}function iw(e,t){const r=Yr("/"),n=new Uint16Array(6);for(const s of e)ni(!1,n,s,1,r,0);Cr(r),t.masksTree=r,t.flatCache=wa(1e3)}function lw(e,t){e||(e="/");const r=t.flatCache.get(e);if(r)return r;const n=Kc(e,t.masksTree);return t.flatCache.set(e,n),n}function cw(e,t,r,n,s){e||(e="/"),n||(n="/");const o=t?`case\0${e}`:e;let a=s.singleCache.get(o);if(!a){a=Yr("/");const i=new Uint16Array(6);ni(t,i,{from:e},1,a,0),s.singleCache.set(o,a)}return Kc(n,a,r)}function uw(e,t,r=!1){const n=r?e:`nofuzz\0${e}`,s=t.matchCache.get(n);if(s!==void 0)return s;e||(e="/");let o;try{o=Kc(e,t.segmentTree,r)}catch(a){if(a instanceof URIError)o=null;else throw a}return o&&(o.branch=hw(o.route)),t.matchCache.set(n,o),o}function dw(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fw(e,t=!1,r){const n=Yr(e.fullPath),s=new Uint16Array(6),o={},a={};let i=0;return ni(t,s,e,1,n,0,c=>{if(r==null||r(c,i),Pr(!(c.id in o),`Duplicate routes found with id: ${String(c.id)}`),o[c.id]=c,i!==0&&c.path){const d=dw(c.fullPath);(!a[d]||c.fullPath.endsWith("/"))&&(a[d]=c)}i++}),Cr(n),{processedTree:{segmentTree:n,singleCache:wa(1e3),matchCache:wa(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:a}}function Kc(e,t,r=!1){const n=e.split("/"),s=mw(e,n,t,r);if(!s)return null;const[o]=vg(e,n,s);return{route:s.node.route,rawParams:o,parsedParams:s.parsedParams}}function vg(e,t,r){var d,f,p,h,g,m,v,y,b,_;const n=pw(r.node);let s=null;const o={};let a=((d=r.extract)==null?void 0:d.part)??0,i=((f=r.extract)==null?void 0:f.node)??0,u=((p=r.extract)==null?void 0:p.path)??0,c=((h=r.extract)==null?void 0:h.segment)??0;for(;i<n.length;a++,i++,u++,c++){const w=n[i];if(w.kind===qr)break;if(w.kind===gg){c--,a--,u--;continue}const $=t[a],R=u;if($&&(u+=$.length),w.kind===tn){s??(s=r.node.fullPath.split("/"));const M=s[c],D=((g=w.prefix)==null?void 0:g.length)??0;if(M.charCodeAt(D)===123){const S=((m=w.suffix)==null?void 0:m.length)??0,E=M.substring(D+2,M.length-S-1),P=$.substring(D,$.length-S);o[E]=decodeURIComponent(P)}else{const S=M.substring(1);o[S]=decodeURIComponent($)}}else if(w.kind===Qs){if(r.skipped&1<<i){a--,u=R-1;continue}s??(s=r.node.fullPath.split("/"));const M=s[c],D=((v=w.prefix)==null?void 0:v.length)??0,j=((y=w.suffix)==null?void 0:y.length)??0,S=M.substring(D+3,M.length-j-1),E=w.suffix||w.prefix?$.substring(D,$.length-j):$;E&&(o[S]=decodeURIComponent(E))}else if(w.kind===rn){const M=w,D=e.substring(R+(((b=M.prefix)==null?void 0:b.length)??0),e.length-(((_=M.suffix)==null?void 0:_.length)??0)),j=decodeURIComponent(D);o["*"]=j,o._splat=j;break}}return r.rawParams&&Object.assign(o,r.rawParams),[o,{part:a,node:i,path:u,segment:c}]}function hw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function pw(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function mw(e,t,r,n){if(e==="/"&&r.index)return{node:r.index,skipped:0};const s=!Js(t),o=s&&e!=="/",a=t.length-(s?1:0),i=[{node:r,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let u=null,c=null,d=null;for(;i.length;){const f=i.pop(),{node:p,index:h,skipped:g,depth:m,statics:v,dynamics:y,optionals:b}=f;let{extract:_,rawParams:w,parsedParams:$}=f;if(p.skipOnParamError){if(!Bi(e,t,f))continue;w=f.rawParams,_=f.extract,$=f.parsedParams}n&&p.route&&p.kind!==qr&&gs(c,f)&&(c=f);const R=h===a;if(R&&(p.route&&!o&&gs(d,f)&&(d=f),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const M=R?void 0:t[h];let D;if(R&&p.index){const j={node:p.index,index:h,skipped:g,depth:m+1,statics:v,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$};let S=!0;if(p.index.skipOnParamError&&(Bi(e,t,j)||(S=!1)),S){if(v===a&&!y&&!b&&!g)return j;gs(d,j)&&(d=j)}}if(p.wildcard&&gs(u,f))for(const j of p.wildcard){const{prefix:S,suffix:E}=j;if(S&&(R||!(j.caseSensitive?M:D??(D=M.toLowerCase())).startsWith(S)))continue;if(E){if(R)continue;const W=t.slice(h).join("/").slice(-E.length);if((j.caseSensitive?W:W.toLowerCase())!==E)continue}const P={node:j,index:a,skipped:g,depth:m,statics:v,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$};if(!(j.skipOnParamError&&!Bi(e,t,P))){u=P;break}}if(p.optional){const j=g|1<<m,S=m+1;for(let E=p.optional.length-1;E>=0;E--){const P=p.optional[E];i.push({node:P,index:h,skipped:j,depth:S,statics:v,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$})}if(!R)for(let E=p.optional.length-1;E>=0;E--){const P=p.optional[E],{prefix:W,suffix:G}=P;if(W||G){const L=P.caseSensitive?M:D??(D=M.toLowerCase());if(W&&!L.startsWith(W)||G&&!L.endsWith(G))continue}i.push({node:P,index:h+1,skipped:g,depth:S,statics:v,dynamics:y,optionals:b+1,extract:_,rawParams:w,parsedParams:$})}}if(!R&&p.dynamic&&M)for(let j=p.dynamic.length-1;j>=0;j--){const S=p.dynamic[j],{prefix:E,suffix:P}=S;if(E||P){const W=S.caseSensitive?M:D??(D=M.toLowerCase());if(E&&!W.startsWith(E)||P&&!W.endsWith(P))continue}i.push({node:S,index:h+1,skipped:g,depth:m+1,statics:v,dynamics:y+1,optionals:b,extract:_,rawParams:w,parsedParams:$})}if(!R&&p.staticInsensitive){const j=p.staticInsensitive.get(D??(D=M.toLowerCase()));j&&i.push({node:j,index:h+1,skipped:g,depth:m+1,statics:v+1,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$})}if(!R&&p.static){const j=p.static.get(M);j&&i.push({node:j,index:h+1,skipped:g,depth:m+1,statics:v+1,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$})}if(p.pathless){const j=m+1;for(let S=p.pathless.length-1;S>=0;S--){const E=p.pathless[S];i.push({node:E,index:h,skipped:g,depth:j,statics:v,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$})}}}if(d&&u)return gs(u,d)?d:u;if(d)return d;if(u)return u;if(n&&c){let f=c.index;for(let h=0;h<c.index;h++)f+=t[h].length;const p=f===e.length?"/":e.slice(f);return c.rawParams??(c.rawParams={}),c.rawParams["**"]=decodeURIComponent(p),c}return null}function Bi(e,t,r){try{const[n,s]=vg(e,t,r);r.rawParams=n,r.extract=s;const o=r.node.parse(n);return r.parsedParams=Object.assign({},r.parsedParams,o),!0}catch{return null}}function gs(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===qr)>(e.node.kind===qr)||t.node.kind===qr==(e.node.kind===qr)&&t.depth>e.depth))):!0}function ra(e){return Hc(e.filter(t=>t!==void 0).join("/"))}function Hc(e){return e.replace(/\/{2,}/g,"/")}function yg(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ar(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function bg(e){return Ar(yg(e))}function ka(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function gw(e,t,r){return ka(e,r)===ka(t,r)}function vw({base:e,to:t,trailingSlash:r="never",cache:n}){const s=t.startsWith("/"),o=!s&&t===".";let a;if(n){a=s?t:o?e:e+"\0"+t;const f=n.get(a);if(f)return f}let i;if(o)i=e.split("/");else if(s)i=t.split("/");else{for(i=e.split("/");i.length>1&&Js(i)==="";)i.pop();const f=t.split("/");for(let p=0,h=f.length;p<h;p++){const g=f[p];g===""?p?p===h-1&&i.push(g):i=[g]:g===".."?i.pop():g==="."||i.push(g)}}i.length>1&&(Js(i)===""?r==="never"&&i.pop():r==="always"&&i.push(""));let u,c="";for(let f=0;f<i.length;f++){f>0&&(c+="/");const p=i[f];if(!p)continue;u=Wc(p,0,u);const h=u[0];if(h===Bn){c+=p;continue}const g=u[5],m=p.substring(0,u[1]),v=p.substring(u[4],g),y=p.substring(u[2],u[3]);h===tn?c+=m||v?`${m}{$${y}}${v}`:`$${y}`:h===rn?c+=m||v?`${m}{$}${v}`:"$":c+=`${m}{-$${y}}${v}`}c=Hc(c);const d=c||"/";return a&&n&&n.set(a,d),d}function yw(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),r=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),n=new RegExp(r,"g");return s=>s.replace(n,o=>t.get(o)??o)}function Ui(e,t,r){const n=t[e];return typeof n!="string"?n:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(n)?n:n.split("/").map(s=>Sf(s,r)).join("/"):Sf(n,r)}function $f({path:e,params:t,decoder:r,...n}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const a=e.length;let i=0,u,c="";for(;i<a;){const f=i;u=Wc(e,f,u);const p=u[5];if(i=p+1,f===p)continue;const h=u[0];if(h===Bn){c+="/"+e.substring(f,p);continue}if(h===rn){const g=t._splat;o._splat=g,o["*"]=g;const m=e.substring(f,u[1]),v=e.substring(u[4],p);if(!g){s=!0,(m||v)&&(c+="/"+m+v);continue}const y=Ui("_splat",t,r);c+="/"+m+y+v;continue}if(h===tn){const g=e.substring(u[2],u[3]);!s&&!(g in t)&&(s=!0),o[g]=t[g];const m=e.substring(f,u[1]),v=e.substring(u[4],p),y=Ui(g,t,r)??"undefined";c+="/"+m+y+v;continue}if(h===Qs){const g=e.substring(u[2],u[3]),m=t[g];if(m==null)continue;o[g]=m;const v=e.substring(f,u[1]),y=e.substring(u[4],p),b=Ui(g,t,r)??"";c+="/"+v+b+y;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:o,interpolatedPath:c||"/",isMissingParams:s}}function Sf(e,t){const r=encodeURIComponent(e);return(t==null?void 0:t(r))??r}function ht(e){return!!(e!=null&&e.isNotFound)}function bw(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Wl="tsr-scroll-restoration-v1_3",xw=(e,t)=>{let r;return(...n)=>{r||(r=setTimeout(()=>{e(...n),r=null},t))}};function ww(){const e=bw();if(!e)return null;const t=e.getItem(Wl);let r=t?JSON.parse(t):{};return{state:r,set:n=>{r=$r(n,r)||r;try{e.setItem(Wl,JSON.stringify(r))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Do=ww(),kw=e=>e.state.__TSR_key||e.href;function _w(e){const t=[];let r;for(;r=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(r.children,e)+1})`),e=r;return`${t.reverse().join(" > ")}`.toLowerCase()}let _a=!1;function Cw({storageKey:e,key:t,behavior:r,shouldScrollRestoration:n,scrollToTopSelectors:s,location:o}){var c,d;let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const i=t||((c=window.history.state)==null?void 0:c.__TSR_key),u=a[i];_a=!0;e:{if(n&&u&&Object.keys(u).length>0){for(const h in u){const g=u[h];if(h==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:r});else if(h){const m=document.querySelector(h);m&&(m.scrollLeft=g.scrollX,m.scrollTop=g.scrollY)}}break e}const f=(o??window.location).hash.split("#",2)[1];if(f){const h=((d=window.history.state)==null?void 0:d.__hashScrollIntoViewOptions)??!0;if(h){const g=document.getElementById(f);g&&g.scrollIntoView(h)}break e}const p={top:0,left:0,behavior:r};if(window.scrollTo(p),s)for(const h of s){if(h==="window")continue;const g=typeof h=="function"?h():document.querySelector(h);g&&g.scrollTo(p)}}_a=!1}function $w(e,t){if(!Do||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Do))return;e.isScrollRestorationSetup=!0,_a=!1;const n=e.options.getScrollRestorationKey||kw;window.history.scrollRestoration="manual";const s=o=>{if(_a||!e.isScrollRestoring)return;let a="";if(o.target===document||o.target===window)a="window";else{const u=o.target.getAttribute("data-scroll-restoration-id");u?a=`[data-scroll-restoration-id="${u}"]`:a=_w(o.target)}const i=n(e.state.location);Do.set(u=>{const c=u[i]||(u[i]={}),d=c[a]||(c[a]={});if(a==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(a){const f=document.querySelector(a);f&&(d.scrollX=f.scrollLeft||0,d.scrollY=f.scrollTop||0)}return u})};typeof document<"u"&&document.addEventListener("scroll",xw(s,100),!0),e.subscribe("onRendered",o=>{const a=n(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(Cw({storageKey:Wl,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Do.set(i=>(i[a]||(i[a]={}),i)))})}function Sw(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const r=document.getElementById(e.state.location.hash);r&&r.scrollIntoView(t)}}}function jw(e,t=String){const r=new URLSearchParams;for(const n in e){const s=e[n];s!==void 0&&r.set(n,t(s))}return r.toString()}function Vi(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Ew(e){const t=new URLSearchParams(e),r={};for(const[n,s]of t.entries()){const o=r[n];o==null?r[n]=Vi(s):Array.isArray(o)?o.push(Vi(s)):r[n]=[o,Vi(s)]}return r}const Aw=Pw(JSON.parse),Nw=Rw(JSON.stringify,JSON.parse);function Pw(e){return t=>{t[0]==="?"&&(t=t.substring(1));const r=Ew(t);for(const n in r){const s=r[n];if(typeof s=="string")try{r[n]=e(s)}catch{}}return r}}function Rw(e,t){const r=typeof t=="function";function n(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(r&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const o=jw(s,n);return o?`?${o}`:""}}const Ct="__root__";function Tw(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const r=new Response(null,{status:e.statusCode,headers:t});if(r.options=e,e.throw)throw r;return r}function yt(e){return e instanceof Response&&!!e.options}const Kl=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},si=(e,t)=>!!(e.preload&&!e.router.state.matches.some(r=>r.id===t)),zn=(e,t,r=!0)=>{const n={...e.router.options.context??{}},s=r?t:t-1;for(let o=0;o<=s;o++){const a=e.matches[o];if(!a)continue;const i=e.router.getMatch(a.id);i&&Object.assign(n,i.__routeContext,i.__beforeLoadContext)}return n},jf=(e,t)=>{if(!e.matches.length)return;const r=t.routeId,n=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),s=n>=0?n:0;let o=r?e.matches.findIndex(a=>a.routeId===r):e.firstBadMatchIndex??e.matches.length-1;o<0&&(o=s);for(let a=o;a>=0;a--){const i=e.matches[a];if(e.router.looseRoutesById[i.routeId].options.notFoundComponent)return a}return r?o:s},Sr=(e,t,r)=>{var n,s,o;if(!(!yt(r)&&!ht(r)))throw yt(r)&&r.redirectHandled&&!r.options.reloadDocument||(t&&((n=t._nonReactive.beforeLoadPromise)==null||n.resolve(),(s=t._nonReactive.loaderPromise)==null||s.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=r,e.updateMatch(t.id,a=>({...a,status:yt(r)?"redirected":a.status==="pending"?"success":a.status,context:zn(e,t.index),isFetching:!1,error:r})),ht(r)&&!r.routeId&&(r.routeId=t.routeId),(o=t._nonReactive.loadPromise)==null||o.resolve()),yt(r)&&(e.rendered=!0,r.options._fromLocation=e.location,r.redirectHandled=!0,r=e.router.resolveRedirect(r))),r},xg=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,vs=(e,t,r,n)=>{var i,u;const{id:s,routeId:o}=e.matches[t],a=e.router.looseRoutesById[o];if(r instanceof Promise)throw r;r.routerCode=n,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),Sr(e,e.router.getMatch(s),r);try{(u=(i=a.options).onError)==null||u.call(i,r)}catch(c){r=c,Sr(e,e.router.getMatch(s),r)}e.updateMatch(s,c=>{var d,f;return(d=c._nonReactive.beforeLoadPromise)==null||d.resolve(),c._nonReactive.beforeLoadPromise=void 0,(f=c._nonReactive.loadPromise)==null||f.resolve(),{...c,error:r,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!yt(r)&&!ht(r)&&(e.serialError??(e.serialError=r))},wg=(e,t,r,n)=>{var a;if(n._nonReactive.pendingTimeout!==void 0)return;const s=r.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!si(e,t)&&(r.options.loader||r.options.beforeLoad||_g(r))&&typeof s=="number"&&s!==1/0&&(r.options.pendingComponent??((a=e.router.options)==null?void 0:a.defaultPendingComponent)))){const i=setTimeout(()=>{Kl(e)},s);n._nonReactive.pendingTimeout=i}},Iw=(e,t,r)=>{const n=e.router.getMatch(t);if(!n._nonReactive.beforeLoadPromise&&!n._nonReactive.loaderPromise)return;wg(e,t,r,n);const s=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Sr(e,o,o.error)};return n._nonReactive.beforeLoadPromise?n._nonReactive.beforeLoadPromise.then(s):s()},Mw=(e,t,r,n)=>{const s=e.router.getMatch(t),o=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Fn(()=>{o==null||o.resolve()});const{paramsError:a,searchError:i}=s;a&&vs(e,r,a,"PARSE_PARAMS"),i&&vs(e,r,i,"VALIDATE_SEARCH"),wg(e,t,n,s);const u=new AbortController;let c=!1;const d=()=>{c||(c=!0,e.updateMatch(t,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:u})))},f=()=>{var w;(w=s._nonReactive.beforeLoadPromise)==null||w.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,$=>({...$,isFetching:!1}))};if(!n.options.beforeLoad){Ls(()=>{d(),f()});return}s._nonReactive.beforeLoadPromise=Fn();const p={...zn(e,r,!1),...s.__routeContext},{search:h,params:g,cause:m}=s,v=si(e,t),y={search:h,abortController:u,params:g,preload:v,context:p,location:e.location,navigate:w=>e.router.navigate({...w,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":m,matches:e.matches,routeId:n.id,...e.router.options.additionalContext},b=w=>{if(w===void 0){Ls(()=>{d(),f()});return}(yt(w)||ht(w))&&(d(),vs(e,r,w,"BEFORE_LOAD")),Ls(()=>{d(),e.updateMatch(t,$=>({...$,__beforeLoadContext:w})),f()})};let _;try{if(_=n.options.beforeLoad(y),Zs(_))return d(),_.catch(w=>{vs(e,r,w,"BEFORE_LOAD")}).then(b)}catch(w){d(),vs(e,r,w,"BEFORE_LOAD")}b(_)},zw=(e,t)=>{const{id:r,routeId:n}=e.matches[t],s=e.router.looseRoutesById[n],o=()=>i(),a=()=>Mw(e,r,t,s),i=()=>{if(xg(e,r))return;const u=Iw(e,r,s);return Zs(u)?u.then(a):a()};return o()},Ow=(e,t,r)=>{var o,a,i,u,c,d;const n=e.router.getMatch(t);if(!n||!r.options.head&&!r.options.scripts&&!r.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:n,params:n.params,loaderData:n.loaderData};return Promise.all([(a=(o=r.options).head)==null?void 0:a.call(o,s),(u=(i=r.options).scripts)==null?void 0:u.call(i,s),(d=(c=r.options).headers)==null?void 0:d.call(c,s)]).then(([f,p,h])=>{const g=f==null?void 0:f.meta,m=f==null?void 0:f.links,v=f==null?void 0:f.scripts,y=f==null?void 0:f.styles;return{meta:g,links:m,headScripts:v,headers:h,scripts:p,styles:y}})},kg=(e,t,r,n,s)=>{const o=t[n-1],{params:a,loaderDeps:i,abortController:u,cause:c}=e.router.getMatch(r),d=zn(e,n),f=si(e,r);return{params:a,deps:i,preload:!!f,parentMatchPromise:o,abortController:u,context:d,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:f?"preload":c,route:s,...e.router.options.additionalContext}},Ef=async(e,t,r,n,s)=>{var o,a,i,u,c,d,f;try{const p=e.router.getMatch(r);try{(!(X1??e.router.isServer)||p.ssr===!0)&&Ca(s);const h=(a=(o=s.options).loader)==null?void 0:a.call(o,kg(e,t,r,n,s)),g=s.options.loader&&Zs(h);if(!!(g||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||p._nonReactive.minPendingPromise)&&e.updateMatch(r,y=>({...y,isFetching:"loader"})),s.options.loader){const y=g?await h:h;Sr(e,e.router.getMatch(r),y),y!==void 0&&e.updateMatch(r,b=>({...b,loaderData:y}))}s._lazyPromise&&await s._lazyPromise;const v=p._nonReactive.minPendingPromise;v&&await v,s._componentsPromise&&await s._componentsPromise,e.updateMatch(r,y=>({...y,error:void 0,context:zn(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(h){let g=h;if((g==null?void 0:g.name)==="AbortError"){if(p.abortController.signal.aborted){(i=p._nonReactive.loaderPromise)==null||i.resolve(),p._nonReactive.loaderPromise=void 0;return}e.updateMatch(r,v=>({...v,status:v.status==="pending"?"success":v.status,isFetching:!1,context:zn(e,n)}));return}const m=p._nonReactive.minPendingPromise;m&&await m,ht(h)&&await((c=(u=s.options.notFoundComponent)==null?void 0:u.preload)==null?void 0:c.call(u)),Sr(e,e.router.getMatch(r),h);try{(f=(d=s.options).onError)==null||f.call(d,h)}catch(v){g=v,Sr(e,e.router.getMatch(r),v)}e.updateMatch(r,v=>({...v,error:g,context:zn(e,n),status:"error",isFetching:!1}))}}catch(p){const h=e.router.getMatch(r);h&&(h._nonReactive.loaderPromise=void 0),Sr(e,h,p)}},Dw=async(e,t,r)=>{var f,p;async function n(h,g,m,v){const y=Date.now()-g.updatedAt,b=h?v.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??e.router.options.defaultStaleTime??0,_=v.options.shouldReload,w=typeof _=="function"?_(kg(e,t,s,r,v)):_,{status:$,invalid:R}=m;a=$==="success"&&(R||(w??y>b)),h&&v.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{var M,D;try{await Ef(e,t,s,r,v);const j=e.router.getMatch(s);(M=j._nonReactive.loaderPromise)==null||M.resolve(),(D=j._nonReactive.loadPromise)==null||D.resolve(),j._nonReactive.loaderPromise=void 0}catch(j){yt(j)&&await e.router.navigate(j.options)}})()):($!=="success"||a&&e.sync)&&await Ef(e,t,s,r,v))}const{id:s,routeId:o}=e.matches[r];let a=!1,i=!1;const u=e.router.looseRoutesById[o];if(!xg(e,s)){const h=e.router.getMatch(s),g=si(e,s);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload)return h;await h._nonReactive.loaderPromise;const m=e.router.getMatch(s),v=m._nonReactive.error||m.error;v&&Sr(e,m,v),m.status==="pending"&&await n(g,h,m,u)}else{const m=g&&!e.router.state.matches.some(y=>y.id===s),v=e.router.getMatch(s);v._nonReactive.loaderPromise=Fn(),m!==v.preload&&e.updateMatch(s,y=>({...y,preload:m})),await n(g,h,v,u)}}const c=e.router.getMatch(s);i||((f=c._nonReactive.loaderPromise)==null||f.resolve(),(p=c._nonReactive.loadPromise)==null||p.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,i||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const d=i?c.isFetching:!1;return d!==c.isFetching||c.invalid!==!1?(e.updateMatch(s,h=>({...h,isFetching:d,invalid:!1})),e.router.getMatch(s)):c};async function Af(e){var p;const t=e,r=[];t.router.state.matches.some(h=>h._forcePending)&&Kl(t);let n;for(let h=0;h<t.matches.length;h++){try{const g=zw(t,h);Zs(g)&&await g}catch(g){if(yt(g))throw g;if(ht(g))n=g;else if(!t.preload)throw g;break}if(t.serialError)break}const s=t.firstBadMatchIndex??t.matches.length,o=n&&!t.preload?jf(t,n):void 0,a=n&&t.preload?0:o!==void 0?Math.min(o+1,s):s;let i,u;for(let h=0;h<a;h++)r.push(Dw(t,r,h));try{await Promise.all(r)}catch{const h=await Promise.allSettled(r);for(const g of h){if(g.status!=="rejected")continue;const m=g.reason;if(yt(m))throw m;ht(m)?i??(i=m):u??(u=m)}if(u!==void 0)throw u}const c=i??(n&&!t.preload?n:void 0);let d=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!c&&n&&t.preload)return t.matches;if(c){const h=jf(t,c);Pr(h!==void 0);const g=t.matches[h],m=t.router.looseRoutesById[g.routeId],v=(p=t.router.options)==null?void 0:p.defaultNotFoundComponent;!m.options.notFoundComponent&&v&&(m.options.notFoundComponent=v),c.routeId=g.routeId;const y=g.routeId===t.router.routeTree.id;t.updateMatch(g.id,b=>({...b,...y?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),d=h,await Ca(m)}else if(!t.preload){const h=t.matches[0];if(!h.globalNotFound){const g=t.router.getMatch(h.id);g!=null&&g.globalNotFound&&t.updateMatch(h.id,m=>({...m,globalNotFound:!1,error:void 0}))}}if(t.serialError&&t.firstBadMatchIndex!==void 0){const h=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ca(h)}for(let h=0;h<=d;h++){const g=t.matches[h],{id:m,routeId:v}=g,y=t.router.looseRoutesById[v];try{const b=Ow(t,m,y);if(b){const _=await b;t.updateMatch(m,w=>({...w,..._}))}}catch(b){console.error(`Error executing head for route ${v}:`,b)}}const f=Kl(t);if(Zs(f)&&await f,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function Ca(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:r,...n}=t.options;Object.assign(e.options,n),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{var n;const r=[];for(const s of Cg){const o=(n=e.options[s])==null?void 0:n.preload;o&&r.push(o())}if(r.length)return Promise.all(r).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function _g(e){var t;for(const r of Cg)if((t=e.options[r])!=null&&t.preload)return!0;return!1}const Cg=["component","errorComponent","pendingComponent","notFoundComponent"];function Lw(e){return{input:({url:t})=>{for(const r of e)t=Hl(r,t);return t},output:({url:t})=>{for(let r=e.length-1;r>=0;r--)t=$g(e[r],t);return t}}}function Fw(e){const t=bg(e.basepath),r=`/${t}`,n=`${r}/`,s=e.caseSensitive?r:r.toLowerCase(),o=e.caseSensitive?n:n.toLowerCase();return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===s?a.pathname="/":i.startsWith(o)&&(a.pathname=a.pathname.slice(r.length)),a},output:({url:a})=>(a.pathname=ra(["/",t,a.pathname]),a)}}function Hl(e,t){var n;const r=(n=e==null?void 0:e.input)==null?void 0:n.call(e,{url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function $g(e,t){var n;const r=(n=e==null?void 0:e.output)==null?void 0:n.call(e,{url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function Xr(e){const t=e.resolvedLocation,r=e.location,n=(t==null?void 0:t.pathname)!==r.pathname,s=(t==null?void 0:t.href)!==r.href,o=(t==null?void 0:t.hash)!==r.hash;return{fromLocation:t,toLocation:r,pathChanged:n,hrefChanged:s,hashChanged:o}}function Bw(e){const t=e.filter(r=>r.status!=="redirected");return t.length===e.length?e:t}class Uw{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=r=>r(),this.update=r=>{var p;const n=this.options,s=this.basepath??(n==null?void 0:n.basepath)??"/",o=this.basepath===void 0,a=n==null?void 0:n.rewrite;if(this.options={...n,...r},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=yw(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=J1()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=wa(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=q1(Ww(this.latestLocation)),$w(this));let i=!1;const u=this.options.basepath??"/",c=this.options.rewrite;if(o||s!==u||a!==c){this.basepath=u;const h=[],g=bg(u);g&&g!=="/"&&h.push(Fw({basepath:u})),c&&h.push(c),this.rewrite=h.length===0?void 0:h.length===1?h[0]:Lw(h),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(h=>({...h,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof((p=window.CSS)==null?void 0:p.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=fw(this.routeTree,this.options.caseSensitive,(n,s)=>{n.init({originalIndex:s})});return this.options.routeMasks&&iw(this.options.routeMasks,r.processedTree),r},this.subscribe=(r,n)=>{const s={eventType:r,fn:n};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=r=>{this.subscribers.forEach(n=>{n.eventType===r.type&&n.fn(r)})},this.parseLocation=(r,n)=>{const s=({pathname:u,search:c,hash:d,href:f,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const b=this.options.parseSearch(c),_=this.options.stringifySearch(b);return{href:u+_+d,publicHref:f,pathname:ms(u).path,external:!1,searchStr:_,search:gt(n==null?void 0:n.search,b),hash:ms(d.slice(1)).path,state:gt(n==null?void 0:n.state,p)}}const h=new URL(f,this.origin),g=Hl(this.rewrite,h),m=this.options.parseSearch(g.search),v=this.options.stringifySearch(m);return g.search=v,{href:g.href.replace(g.origin,""),publicHref:f,pathname:ms(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:v,search:gt(n==null?void 0:n.search,m),hash:ms(g.hash.slice(1)).path,state:gt(n==null?void 0:n.state,p)}},o=s(r),{__tempLocation:a,__tempKey:i}=o.state;if(a&&(!i||i===this.tempLocationKey)){const u=s(a);return u.state.key=o.state.key,u.state.__TSR_key=o.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:o}}return o},this.resolvePathWithBase=(r,n)=>vw({base:r,to:Hc(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(r,n,s)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:n},s):this.matchRoutesInternal(r,n),this.getMatchedRoutes=r=>Kw({pathname:r,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=r=>{const n=this.getMatch(r);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const r=this.state.matches.filter(o=>o.status==="pending"),n=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...r,...n]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=r=>{const n=(o={})=>{var E,P;const a=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);o.from;const u=o.unsafeRelative==="path"?a.pathname:o.from??i.fullPath,c=this.resolvePathWithBase(u,"."),d=i.search,f={...i.params},p=o.to?this.resolvePathWithBase(c,`${o.to}`):this.resolvePathWithBase(c,"."),h=o.params===!1||o.params===null?{}:(o.params??!0)===!0?f:Object.assign(f,$r(o.params,f)),g=this.getMatchedRoutes(p);let m=g.matchedRoutes;if((!g.foundRoute||g.foundRoute.path!=="/"&&g.routeParams["**"])&&this.options.notFoundRoute&&(m=[...m,this.options.notFoundRoute]),Object.keys(h).length>0)for(const W of m){const G=((E=W.options.params)==null?void 0:E.stringify)??W.options.stringifyParams;if(G)try{Object.assign(h,G(h))}catch{}}const y=r.leaveParams?p:ms($f({path:p,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let b=d;if(r._includeValidateSearch&&((P=this.options.search)!=null&&P.strict)){const W={};m.forEach(G=>{if(G.options.validateSearch)try{Object.assign(W,na(G.options.validateSearch,{...W,...b}))}catch{}}),b=W}b=Hw({search:b,dest:o,destRoutes:m,_includeValidateSearch:r._includeValidateSearch}),b=gt(d,b);const _=this.options.stringifySearch(b),w=o.hash===!0?a.hash:o.hash?$r(o.hash,a.hash):void 0,$=w?`#${w}`:"";let R=o.state===!0?a.state:o.state?$r(o.state,a.state):{};R=gt(a.state,R);const M=`${y}${_}${$}`;let D,j,S=!1;if(this.rewrite){const W=new URL(M,this.origin),G=$g(this.rewrite,W);D=W.href.replace(W.origin,""),G.origin!==this.origin?(j=G.href,S=!0):j=G.pathname+G.search+G.hash}else D=sw(M),j=D;return{publicHref:j,href:D,pathname:y,search:b,searchStr:_,state:R,hash:w??"",external:S,unmaskOnReload:o.unmaskOnReload}},s=(o={},a)=>{const i=n(o);let u=a?n(a):void 0;if(!u){const c={};if(this.options.routeMasks){const d=lw(i.pathname,this.processedTree);if(d){Object.assign(c,d.rawParams);const{from:f,params:p,...h}=d.route,g=p===!1||p===null?{}:(p??!0)===!0?c:Object.assign(c,$r(p,c));a={from:r.from,...h,params:g},u=n(a)}}}return u&&(i.maskedLocation=u),i};return r.mask?s(r,{from:r.from,...r.mask}):s(r)},this.commitLocation=async({viewTransition:r,ignoreBlocker:n,...s})=>{const o=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(d=>{s.state[d]=this.latestLocation.state[d]});const c=Qr(s.state,this.latestLocation.state);return u.forEach(d=>{delete s.state[d]}),c},a=Ar(this.latestLocation.href)===Ar(s.href),i=this.commitLocationPromise;if(this.commitLocationPromise=Fn(()=>{i==null||i.resolve()}),a&&o())this.load();else{let{maskedLocation:u,hashScrollIntoView:c,...d}=s;u&&(d={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),d.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=r,this.history[s.replace?"replace":"push"](d.publicHref,d.state,{ignoreBlocker:n})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:n,hashScrollIntoView:s,viewTransition:o,ignoreBlocker:a,href:i,...u}={})=>{if(i){const f=this.history.location.state.__TSR_index,p=Ys(i,{__TSR_index:r?f:f+1}),h=new URL(p.pathname,this.origin),g=Hl(this.rewrite,h);u.to=g.pathname,u.search=this.options.parseSearch(p.search),u.hash=p.hash.slice(1)}const c=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const d=this.commitLocation({...c,viewTransition:o,replace:r,resetScroll:n,hashScrollIntoView:s,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),d},this.navigate=async({to:r,reloadDocument:n,href:s,publicHref:o,...a})=>{var u;let i=!1;if(s)try{new URL(`${s}`),i=!0}catch{}if(i&&!n&&(n=!0),n){if(r!==void 0||!s){const d=this.buildLocation({to:r,...a});s=s??d.publicHref,o=o??d.publicHref}const c=!i&&o?o:s;if(xa(c,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history,f=((u=d.getBlockers)==null?void 0:u.call(d))??[];for(const p of f)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...a,href:s,to:r,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const r=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:r,cachedMatches:n.cachedMatches.filter(s=>!r.some(o=>o.id===s.id))}))},this.load=async r=>{let n,s,o;for(o=new Promise(i=>{this.startTransition(async()=>{var u;try{this.beforeLoad();const c=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Xr({resolvedLocation:d,location:c})}),this.emit({type:"onBeforeLoad",...Xr({resolvedLocation:d,location:c})}),await Af({router:this,sync:r==null?void 0:r.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=[],p=[],h=[],g=[];Ls(()=>{this.__store.setState(m=>{const v=m.matches,y=m.pendingMatches||m.matches;return f=v.filter(b=>!y.some(_=>_.id===b.id)),p=v.filter(b=>!y.some(_=>_.routeId===b.routeId)),h=y.filter(b=>!v.some(_=>_.routeId===b.routeId)),g=y.filter(b=>v.some(_=>_.routeId===b.routeId)),{...m,isLoading:!1,loadedAt:Date.now(),matches:y,pendingMatches:void 0,cachedMatches:[...m.cachedMatches,...f.filter(b=>b.status!=="error"&&b.status!=="notFound"&&b.status!=="redirected")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[h,"onEnter"],[g,"onStay"]].forEach(([m,v])=>{m.forEach(y=>{var b,_;(_=(b=this.looseRoutesById[y.routeId].options)[v])==null||_.call(b,y)})})})})}})}catch(c){yt(c)?(n=c,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):ht(c)&&(s=c),this.__store.setState(d=>({...d,statusCode:n?n.status:s?404:d.matches.some(f=>f.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===o&&((u=this.commitLocationPromise)==null||u.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(i=>i.status==="error")&&(a=500),a!==void 0&&this.__store.setState(i=>({...i,statusCode:a}))},this.startViewTransition=r=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,a=this.state.resolvedLocation,i=typeof n.types=="function"?n.types(Xr({resolvedLocation:a,location:o})):n.types;if(i===!1){r();return}s={update:r,types:i}}else s=r;document.startViewTransition(s)}else r()},this.updateMatch=(r,n)=>{this.startTransition(()=>{var o;const s=(o=this.state.pendingMatches)!=null&&o.some(a=>a.id===r)?"pendingMatches":this.state.matches.some(a=>a.id===r)?"matches":this.state.cachedMatches.some(a=>a.id===r)?"cachedMatches":"";s&&(s==="cachedMatches"?this.__store.setState(a=>({...a,cachedMatches:Bw(a.cachedMatches.map(i=>i.id===r?n(i):i))})):this.__store.setState(a=>{var i;return{...a,[s]:(i=a[s])==null?void 0:i.map(u=>u.id===r?n(u):u)}}))})},this.getMatch=r=>{var s;const n=o=>o.id===r;return this.state.cachedMatches.find(n)??((s=this.state.pendingMatches)==null?void 0:s.find(n))??this.state.matches.find(n)},this.invalidate=r=>{const n=s=>{var o;return((o=r==null?void 0:r.filter)==null?void 0:o.call(r,s))??!0?{...s,invalid:!0,...r!=null&&r.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.__store.setState(s=>{var o;return{...s,matches:s.matches.map(n),cachedMatches:s.cachedMatches.map(n),pendingMatches:(o=s.pendingMatches)==null?void 0:o.map(n)}}),this.shouldViewTransition=!1,this.load({sync:r==null?void 0:r.sync})},this.getParsedLocationHref=r=>r.publicHref||"/",this.resolveRedirect=r=>{const n=r.headers.get("Location");if(!r.options.href||r.options._builtLocation){const s=r.options._builtLocation??this.buildLocation(r.options),o=this.getParsedLocationHref(s);r.options.href=o,r.headers.set("Location",o)}else if(n)try{const s=new URL(n);if(this.origin&&s.origin===this.origin){const o=s.pathname+s.search+s.hash;r.options.href=o,r.headers.set("Location",o)}}catch{}if(r.options.href&&!r.options._builtLocation&&xa(r.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return r.headers.get("Location")||r.headers.set("Location",r.options.href),r},this.clearCache=r=>{const n=r==null?void 0:r.filter;n!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(o=>!n(o))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const r=n=>{const s=this.looseRoutesById[n.routeId];if(!s.options.loader)return!0;const o=(n.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??5*60*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=Ca,this.preloadRoute=async r=>{const n=r._builtLocation??this.buildLocation(r);let s=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:r});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(i=>i.id)),a=new Set([...o,...this.state.cachedMatches.map(i=>i.id)]);Ls(()=>{s.forEach(i=>{a.has(i.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,i]}))})});try{return s=await Af({router:this,matches:s,location:n,preload:!0,updateMatch:(i,u)=>{o.has(i)?s=s.map(c=>c.id===i?u(c):c):this.updateMatch(i,u)}}),s}catch(i){if(yt(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:n});ht(i)||console.error(i);return}},this.matchRoute=(r,n)=>{const s={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},o=this.buildLocation(s);if(n!=null&&n.pending&&this.state.status!=="pending")return!1;const i=((n==null?void 0:n.pending)===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,u=cw(o.pathname,(n==null?void 0:n.caseSensitive)??!1,(n==null?void 0:n.fuzzy)??!1,i.pathname,this.processedTree);return!u||r.params&&!Qr(u.rawParams,r.params,{partial:!0})?!1:(n==null?void 0:n.includeSearch)??!0?Qr(i.search,o.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(r=>r.status==="notFound"||r.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Nw,parseSearch:t.parseSearch??Aw,protocolAllowlist:t.protocolAllowlist??nw}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:r,processedTree:n}){this.routesById=t,this.routesByPath=r,this.processedTree=n;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}getParentContext(t){return(t==null?void 0:t.id)?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,r){var p,h;const n=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:o,parsedParams:a}=n;let{matchedRoutes:i}=n,u=!1;(s?s.path!=="/"&&o["**"]:Ar(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:u=!0);const c=u?qw(this.options.notFoundMode,i):void 0,d=new Array(i.length),f=new Map(this.state.matches.map(g=>[g.routeId,g]));for(let g=0;g<i.length;g++){const m=i[g],v=d[g-1];let y,b,_;{const V=(v==null?void 0:v.search)??t.search,O=(v==null?void 0:v._strictSearch)??void 0;try{const te=na(m.options.validateSearch,{...V})??void 0;y={...V,...te},b={...O,...te},_=void 0}catch(te){let J=te;if(te instanceof $a||(J=new $a(te.message,{cause:te})),r!=null&&r.throwOnError)throw J;y=V,b={},_=J}}const w=((h=(p=m.options).loaderDeps)==null?void 0:h.call(p,{search:y}))??"",$=w?JSON.stringify(w):"",{interpolatedPath:R,usedParams:M}=$f({path:m.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),D=m.id+R+$,j=this.getMatch(D),S=f.get(m.id),E=(j==null?void 0:j._strictParams)??M;let P;if(!j)try{Nf(m,M,a,E)}catch(V){if(ht(V)||yt(V)?P=V:P=new Vw(V.message,{cause:V}),r!=null&&r.throwOnError)throw P}Object.assign(o,E);const W=S?"stay":"enter";let G;if(j)G={...j,cause:W,params:(S==null?void 0:S.params)??o,_strictParams:E,search:gt(S?S.search:j.search,y),_strictSearch:b};else{const V=m.options.loader||m.options.beforeLoad||m.lazyFn||_g(m)?"pending":"success";G={id:D,ssr:m.options.ssr,index:g,routeId:m.id,params:(S==null?void 0:S.params)??o,_strictParams:E,pathname:R,updatedAt:Date.now(),search:S?gt(S.search,y):y,_strictSearch:b,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Fn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:W,loaderDeps:S?gt(S.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}r!=null&&r.preload||(G.globalNotFound=c===m.id),G.searchError=_;const L=this.getParentContext(v);G.context={...L,...G.__routeContext,...G.__beforeLoadContext},d[g]=G}for(let g=0;g<d.length;g++){const m=d[g],v=this.looseRoutesById[m.routeId],y=this.getMatch(m.id),b=f.get(m.routeId);if(m.params=b?gt(b.params,o):o,!y){const _=d[g-1],w=this.getParentContext(_);if(v.options.context){const $={deps:m.loaderDeps,params:m.params,context:w??{},location:t,navigate:R=>this.navigate({...R,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:v.id};m.__routeContext=v.options.context($)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(t){const{matchedRoutes:r,routeParams:n,parsedParams:s}=this.getMatchedRoutes(t.pathname),o=Js(r),a={...t.search};for(const d of r)try{Object.assign(a,na(d.options.validateSearch,a))}catch{}const i=Js(this.state.matches),u=i&&i.routeId===o.id&&t.pathname===this.state.location.pathname;let c;if(u)c=i.params;else{const d={...n};for(const f of r)try{Nf(f,n,s??{},d)}catch{}c=d}return{matchedRoutes:r,fullPath:o.fullPath,search:a,params:c}}}class $a extends Error{}class Vw extends Error{}function Ww(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function na(e,t){if(e==null)return{};if("~standard"in e){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new $a("Async validation not supported");if(r.issues)throw new $a(JSON.stringify(r.issues,void 0,2),{cause:r});return r.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Kw({pathname:e,routesById:t,processedTree:r}){const n={},s=Ar(e);let o,a;const i=uw(s,r,!0);return i&&(o=i.route,Object.assign(n,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:(i==null?void 0:i.branch)||[t[Ct]],routeParams:n,foundRoute:o,parsedParams:a}}function Hw({search:e,dest:t,destRoutes:r,_includeValidateSearch:n}){return Gw(r)(e,t,n??!1)}function Gw(e){var s;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)(s=o.options.search)!=null&&s.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const a=({search:i,next:u})=>{let c=i;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(c=o.options.preSearchFilters.reduce((f,p)=>p(f),i));const d=u(c);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((f,p)=>p(f),d):d};t.middlewares.push(a)}if(o.options.validateSearch){const a=({search:i,next:u})=>{const c=u(i);if(!t._includeValidateSearch)return c;try{return{...c,...na(o.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(a)}}const r=({search:o})=>{const a=t.dest;return a.search?a.search===!0?o:$r(a.search,o):{}};t.middlewares.push(r);const n=(o,a,i)=>{if(o>=i.length)return a;const u=i[o];return u({search:a,next:d=>n(o+1,d,i)})};return function(a,i,u){return t.dest=i,t._includeValidateSearch=u,n(0,a,t.middlewares)}}function qw(e,t){if(e!=="root")for(let r=t.length-1;r>=0;r--){const n=t[r];if(n.children)return n.id}return Ct}function Nf(e,t,r,n){var o;const s=((o=e.options.params)==null?void 0:o.parse)??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const a in t)a in r&&(n[a]=r[a]);else{const a=s(n);Object.assign(n,a)}}const Yw="Error preloading route! ☝️";class Sg{constructor(t){if(this.init=r=>{var c,d;this.originalIndex=r.originalIndex;const n=this.options,s=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(d=(c=this.options).getParentRoute)==null?void 0:d.call(c),s?this._path=Ct:this.parentRoute||Pr(!1);let o=s?Ct:n==null?void 0:n.path;o&&o!=="/"&&(o=yg(o));const a=(n==null?void 0:n.id)||o;let i=s?Ct:ra([this.parentRoute.id===Ct?"":this.parentRoute.id,a]);o===Ct&&(o="/"),i!==Ct&&(i=ra(["/",i]));const u=i===Ct?"/":ra([this.parentRoute.fullPath,o]);this._path=o,this._id=i,this._fullPath=u,this._to=Ar(u)},this.addChildren=r=>this._addFileChildren(r),this._addFileChildren=r=>(Array.isArray(r)&&(this.children=r),typeof r=="object"&&r!==null&&(this.children=Object.values(r)),this),this._addFileTypes=()=>this,this.updateLoader=r=>(Object.assign(this.options,r),this),this.update=r=>(Object.assign(this.options,r),this),this.lazy=r=>(this.lazyFn=r,this),this.redirect=r=>Tw({from:this.fullPath,...r}),this.options=t||{},this.isRoot=!(t!=null&&t.getParentRoute),t!=null&&t.id&&(t!=null&&t.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Jw extends Sg{constructor(t){super(t)}}const Lo=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Wi(e){const t=x.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function Zw(e,t,r={},n={}){x.useEffect(()=>{if(!e.current||n.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([o])=>{t(o)},r);return s.observe(e.current),()=>{s.disconnect()}},[t,r,n.disabled,e])}function Qw(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}function Gc(e){const t=e.errorComponent??qc;return l.jsx(Xw,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:n})=>r?x.createElement(t,{error:r,reset:n}):e.children})}class Xw extends x.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,r){r.error&&r.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,r){this.props.onCatch&&this.props.onCatch(t,r)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function qc({error:e}){const[t,r]=x.useState(!1);return l.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[l.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),l.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(n=>!n),children:t?"Hide Error":"Show Error"})]}),l.jsx("div",{style:{height:".25rem"}}),t?l.jsx("div",{children:l.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?l.jsx("code",{children:e.message}):null})}):null]})}function ek({children:e,fallback:t=null}){return jg()?l.jsx(U.Fragment,{children:e}):l.jsx(U.Fragment,{children:t})}function jg(){return U.useSyncExternalStore(tk,()=>!0,()=>!1)}function tk(){return()=>{}}var Eg={exports:{}},Ag={},Ng={exports:{}},Pg={};/**
9
+ */var E1=x,A1=Symbol.for("react.element"),N1=Symbol.for("react.fragment"),P1=Object.prototype.hasOwnProperty,R1=E1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T1={key:!0,ref:!0,__self:!0,__source:!0};function lg(e,t,r){var n,s={},o=null,a=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)P1.call(t,n)&&!T1.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:A1,type:e,key:o,ref:a,props:s,_owner:R1.current}}ti.Fragment=N1;ti.jsx=lg;ti.jsxs=lg;ig.exports=ti;var l=ig.exports;if(!("acquireVsCodeApi"in window)){let e=function(){return typeof navigator<"u"&&navigator.onLine===!1?"You are offline. Form submissions are unavailable until the standalone backend reconnects.":"Cannot submit while disconnected from the standalone backend. Wait for reconnection and try again."},t=function(E){const P={type:"connectionStatus",...E};window.postMessage(P,"*")},r=function(){M!==null&&(window.clearTimeout(M),M=null)},n=function(E){_&&E.send(JSON.stringify({type:"ready"})),w&&E.send(w),$&&E.send($)},s=function(E){for(const P of v)E.send(P);v.length=0},o=function(E){if(y=!1,!D||M!==null)return;if(R>=g){t({connected:!1,reconnecting:!1,fatal:!0,retryCount:R,maxRetries:g,reason:E});return}const P=h[R];R+=1,t({connected:!1,reconnecting:!0,fatal:!1,retryCount:R,maxRetries:g,retryDelayMs:P,reason:E}),M=window.setTimeout(()=>{M=null,a()},P)},a=function(){const E=new WebSocket(p);m=E,E.addEventListener("open",()=>{if(m!==E)return;y=!0;const P=!b;b=!0,r(),R=0,n(E),P&&s(E),t({connected:!0,reconnecting:!1,fatal:!1,retryCount:0,maxRetries:g})}),E.addEventListener("message",P=>{if(m===E)try{const W=JSON.parse(P.data);window.postMessage(W,"*")}catch{}}),E.addEventListener("error",()=>{m===E&&(E.readyState===WebSocket.CONNECTING||E.readyState===WebSocket.OPEN)&&E.close()}),E.addEventListener("close",()=>{m===E&&(m=null,o("socket-closed"))})},i=function(E){const P=document.createElement("input");P.type="file",P.multiple=!0,P.style.display="none",document.body.appendChild(P);const W=()=>{P.remove()};P.onchange=async()=>{if(!P.files||P.files.length===0){W();return}const G=[];for(const L of Array.from(P.files)){const V=await L.arrayBuffer(),O=new Uint8Array(V);let re="";for(let J=0;J<O.length;J++)re+=String.fromCharCode(O[J]);G.push({name:L.name,data:btoa(re)})}try{await fetch("/api/upload-attachment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cardId:E,files:G})})}catch(L){console.error("Failed to upload attachment:",L)}W()},P.click()},u=function(E,P){const W=`/api/attachment?cardId=${encodeURIComponent(E)}&filename=${encodeURIComponent(P)}`;window.open(W,"_blank")},c=function(E){document.body.classList.toggle("vscode-dark",E),document.body.classList.toggle("vscode-light",!E)},d=function(){const E=localStorage.getItem("kanban-standalone-theme");c(E!==null?E==="dark":S.matches)};const f=window.__KB_BASE__??"",p=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}${f}/ws`,h=[250,500,1e3,2e3,4e3],g=h.length;let m=null;const v=[];let y=!1,b=!1,_=!1,w=null,$=null,R=0,M=null,D=!0;window.addEventListener("beforeunload",()=>{D=!1,r(),m&&(m.readyState===WebSocket.CONNECTING||m.readyState===WebSocket.OPEN)&&m.close()}),a();let j=null;try{const E=sessionStorage.getItem("kanban-standalone-state");E&&(j=JSON.parse(E))}catch{}window.acquireVsCodeApi=()=>({postMessage(E){const P=E;if(P.type==="openFile"){const G=P.cardId;fetch(`/api/card-file?cardId=${encodeURIComponent(G)}`).then(L=>L.json()).then(L=>{var re;const V=(re=L==null?void 0:L.data)==null?void 0:re.path;if(!V){console.error("card-file: missing path in response",L);return}const O=document.createElement("a");O.href=`vscode://file/${V}`,document.body.appendChild(O),O.click(),document.body.removeChild(O)}).catch(L=>console.error("Failed to open card in VS Code:",L));return}if(P.type==="openMetadataFile"){const G=P.path;fetch(`/api/resolve-path?path=${encodeURIComponent(G)}`).then(L=>L.json()).then(L=>{var re;const V=(re=L==null?void 0:L.data)==null?void 0:re.path;if(!V){console.error("resolve-path: missing path in response",L);return}const O=document.createElement("a");O.href=`vscode://file/${V}`,document.body.appendChild(O),O.click(),document.body.removeChild(O)}).catch(L=>console.error("Failed to open metadata file in VS Code:",L));return}if(P.type==="addAttachment"){i(P.cardId);return}if(P.type==="openAttachment"){u(P.cardId,P.attachment);return}if(P.type==="toggleTheme"){const L=!document.body.classList.contains("vscode-dark");localStorage.setItem("kanban-standalone-theme",L?"dark":"light"),c(L);return}const W=JSON.stringify(E);if(P.type==="ready"){_=!0,y&&m&&m.readyState===WebSocket.OPEN&&m.send(W);return}if(P.type==="switchBoard"&&(w=W),P.type==="openCard"&&($=W),P.type==="closeCard"&&($=null),P.type==="switchBoard"||P.type==="openCard"||P.type==="closeCard"){y&&m&&m.readyState===WebSocket.OPEN&&m.send(W);return}if(P.type==="submitForm"&&(!y||!m||m.readyState!==WebSocket.OPEN)){window.postMessage({type:"submitFormResult",callbackKey:P.callbackKey,error:e()},"*");return}y&&m&&m.readyState===WebSocket.OPEN?m.send(W):b?console.warn("Dropping standalone message while disconnected",P.type):v.push(W)},getState(){return j},setState(E){j=E;try{sessionStorage.setItem("kanban-standalone-state",JSON.stringify(E))}catch{}}});const S=window.matchMedia("(prefers-color-scheme: dark)");S.addEventListener("change",E=>{localStorage.getItem("kanban-standalone-theme")===null&&c(E.matches)}),document.body?d():document.addEventListener("DOMContentLoaded",d)}var cg,mf=ag;cg=mf.createRoot,mf.hydrateRoot;var Le=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Le||{});function ug({update:e,notify:t,unwatched:r}){return{link:n,unlink:s,propagate:o,checkDirty:a,shallowPropagate:i};function n(c,d,f){const p=d.depsTail;if(p!==void 0&&p.dep===c)return;const h=p!==void 0?p.nextDep:d.deps;if(h!==void 0&&h.dep===c){h.version=f,d.depsTail=h;return}const g=c.subsTail;if(g!==void 0&&g.version===f&&g.sub===d)return;const m=d.depsTail=c.subsTail={version:f,dep:c,sub:d,prevDep:p,nextDep:h,prevSub:g,nextSub:void 0};h!==void 0&&(h.prevDep=m),p!==void 0?p.nextDep=m:d.deps=m,g!==void 0?g.nextSub=m:c.subs=m}function s(c,d=c.sub){const f=c.dep,p=c.prevDep,h=c.nextDep,g=c.nextSub,m=c.prevSub;return h!==void 0?h.prevDep=p:d.depsTail=p,p!==void 0?p.nextDep=h:d.deps=h,g!==void 0?g.prevSub=m:f.subsTail=m,m!==void 0?m.nextSub=g:(f.subs=g)===void 0&&r(f),h}function o(c){let d=c.nextSub,f;e:do{const p=c.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&u(c,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const g=p.subs;if(g!==void 0){const m=(c=g).nextSub;m!==void 0&&(f={value:d,prev:f},d=m);continue}}if((c=d)!==void 0){d=c.nextSub;continue}for(;f!==void 0;)if(c=f.value,f=f.prev,c!==void 0){d=c.nextSub;continue e}break}while(!0)}function a(c,d){let f,p=0,h=!1;e:do{const g=c.dep,m=g.flags;if(d.flags&16)h=!0;else if((m&17)===17){if(e(g)){const v=g.subs;v.nextSub!==void 0&&i(v),h=!0}}else if((m&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(f={value:c,prev:f}),c=g.deps,d=g,++p;continue}if(!h){const v=c.nextDep;if(v!==void 0){c=v;continue}}for(;p--;){const v=d.subs,y=v.nextSub!==void 0;if(y?(c=f.value,f=f.prev):c=v,h){if(e(d)){y&&i(v),d=c.sub;continue}h=!1}else d.flags&=-33;d=c.sub;const b=c.nextDep;if(b!==void 0){c=b;continue e}}return h}while(!0)}function i(c){do{const d=c.sub,f=d.flags;(f&48)===32&&(d.flags=f|16,(f&6)===2&&t(d))}while((c=c.nextSub)!==void 0)}function u(c,d){let f=d.depsTail;for(;f!==void 0;){if(f===c)return!0;f=f.prevDep}return!1}}let Bc=0,Or=0,Ds=0;const or=[],{link:NQ,unlink:dg,propagate:PQ,checkDirty:I1,shallowPropagate:RQ}=ug({update(e){return e.depsTail!==void 0?D1(e):L1(e)},notify(e){var n;let t=Ds,r=t;do if(or[t++]=e,e.flags&=-3,e=(n=e.subs)==null?void 0:n.sub,e===void 0||!(e.flags&2))break;while(!0);for(Ds=t;r<--t;){const s=or[r];or[r++]=or[t],or[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ri(e)):U1.call(e)}});function M1(){return Bc}function z1(){++Bc}function O1(){--Bc||B1()}function D1(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,ri(e)}}function L1(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function F1(e){const t=e.flags;if(t&16||t&32&&I1(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,ri(e)}}else e.flags=2}function B1(){try{for(;Or<Ds;){const e=or[Or];or[Or++]=void 0,F1(e)}}finally{for(;Or<Ds;){const e=or[Or];or[Or++]=void 0,e.flags|=10}Or=0,Ds=0}}function U1(){this.depsTail=void 0,this.flags=0,ri(this);const e=this.subs;e!==void 0&&dg(e)}function ri(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=dg(r,e)}function Uc(e,t,r){var o,a,i;const n=typeof e=="object",s=n?e:void 0;return{next:(o=n?e.next:e)==null?void 0:o.bind(s),error:(a=n?e.error:t)==null?void 0:a.bind(s),complete:(i=n?e.complete:r)==null?void 0:i.bind(s)}}const Bl=[];let ta=0;const{link:gf,unlink:V1,propagate:W1,checkDirty:fg,shallowPropagate:vf}=ug({update(e){return e._update()},notify(e){Bl[Ul++]=e,e.flags&=~Le.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Le.Mutable|Le.Dirty,ya(e))}});let Oo=0,Ul=0,Ft;function ya(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=V1(r,e)}function hg(){if(!(M1()>0)){for(;Oo<Ul;){const e=Bl[Oo];Bl[Oo++]=void 0,e.notify()}Oo=0,Ul=0}}function pg(e,t){const r=typeof e=="function",n=e,s={_snapshot:r?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:r?Le.None:Le.Mutable,get(){return Ft!==void 0&&gf(s,Ft,ta),s._snapshot},subscribe(o){const a=Uc(o),i={current:!1},u=K1(()=>{var c;s.get(),i.current?(c=a.next)==null||c.call(a,s._snapshot):i.current=!0});return{unsubscribe:()=>{u.stop()}}},_update(o){const a=Ft,i=Object.is;if(r)Ft=s,++ta,s.depsTail=void 0;else if(o===void 0)return!1;r&&(s.flags=Le.Mutable|Le.RecursedCheck);try{const u=s._snapshot,c=typeof o=="function"?o(u):o===void 0&&r?n(u):o;return u===void 0||!i(u,c)?(s._snapshot=c,!0):!1}finally{Ft=a,r&&(s.flags&=~Le.RecursedCheck),ya(s)}}};return r?(s.flags=Le.Mutable|Le.Dirty,s.get=function(){const o=s.flags;if(o&Le.Dirty||o&Le.Pending&&fg(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&vf(a)}}else o&Le.Pending&&(s.flags=o&~Le.Pending);return Ft!==void 0&&gf(s,Ft,ta),s._snapshot}):s.set=function(o){if(s._update(o)){const a=s.subs;a!==void 0&&(W1(a),vf(a),hg())}},s}function K1(e){const t=()=>{const n=Ft;Ft=r,++ta,r.depsTail=void 0,r.flags=Le.Watching|Le.RecursedCheck;try{return e()}finally{Ft=n,r.flags&=~Le.RecursedCheck,ya(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Le.Watching|Le.RecursedCheck,notify(){const n=this.flags;n&Le.Dirty||n&Le.Pending&&fg(this.deps,this)?t():this.flags=Le.Watching},stop(){this.flags=Le.None,this.depsTail=void 0,ya(this)}};return t(),r}class H1{constructor(t){this.atom=pg(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Uc(t))}}class G1{constructor(t){this.atom=pg(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Uc(t))}}function q1(e){return typeof e=="function"?new G1(e):new H1(e)}function Y1(e){try{z1(),e()}finally{O1(),hg()}}const Er="__TSR_index",yf="popstate",bf="beforeunload";function mg(e){let t=e.getLocation();const r=new Set,n=a=>{t=e.getLocation(),r.forEach(i=>i({location:t,action:a}))},s=a=>{e.notifyOnIndexChange??!0?n(a):t=e.getLocation()},o=async({task:a,navigateOpts:i,...u})=>{var p,h;if((i==null?void 0:i.ignoreBlocker)??!1){a();return}const d=((p=e.getBlockers)==null?void 0:p.call(e))??[],f=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&d.length&&f)for(const g of d){const m=Ys(u.path,u.state);if(await g.blockerFn({currentLocation:t,nextLocation:m,action:u.type})){(h=e.onBlocked)==null||h.call(e);return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:r,subscribe:a=>(r.add(a),()=>{r.delete(a)}),push:(a,i,u)=>{const c=t.state[Er];i=Vl(c+1,i),o({task:()=>{e.pushState(a,i),n({type:"PUSH"})},navigateOpts:u,type:"PUSH",path:a,state:i})},replace:(a,i,u)=>{const c=t.state[Er];i=Vl(c,i),o({task:()=>{e.replaceState(a,i),n({type:"REPLACE"})},navigateOpts:u,type:"REPLACE",path:a,state:i})},go:(a,i)=>{o({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{o({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{o({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Er]!==0,createHref:a=>e.createHref(a),block:a=>{var u;if(!e.setBlockers)return()=>{};const i=((u=e.getBlockers)==null?void 0:u.call(e))??[];return e.setBlockers([...i,a]),()=>{var d,f;const c=((d=e.getBlockers)==null?void 0:d.call(e))??[];(f=e.setBlockers)==null||f.call(e,c.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:n}}function Vl(e,t){t||(t={});const r=Vc();return{...t,key:r,__TSR_key:r,[Er]:e}}function J1(e){var D,j;const t=typeof document<"u"?window:void 0,r=t.history.pushState,n=t.history.replaceState;let s=[];const o=()=>s,a=S=>s=S,i=S=>S,u=()=>Ys(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((D=t.history.state)!=null&&D.__TSR_key)&&!((j=t.history.state)!=null&&j.key)){const S=Vc();t.history.replaceState({[Er]:0,key:S,__TSR_key:S},"")}let c=u(),d,f=!1,p=!1,h=!1,g=!1;const m=()=>c;let v,y;const b=()=>{v&&(M._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),M._ignoreSubscribers=!1,v=void 0,y=void 0,d=void 0)},_=(S,E,P)=>{const W=i(E);y||(d=c),c=Ys(E,P),v={href:W,state:P,isPush:(v==null?void 0:v.isPush)||S==="push"},y||(y=Promise.resolve().then(()=>b()))},w=S=>{c=u(),M.notify({type:S})},$=async()=>{if(p){p=!1;return}const S=u(),E=S.state[Er]-c.state[Er],P=E===1,W=E===-1,G=!P&&!W||f;f=!1;const L=G?"GO":W?"BACK":"FORWARD",V=G?{type:"GO",index:E}:{type:W?"BACK":"FORWARD"};if(h)h=!1;else{const O=o();if(typeof document<"u"&&O.length){for(const re of O)if(await re.blockerFn({currentLocation:c,nextLocation:S,action:L})){p=!0,t.history.go(1),M.notify(V);return}}}c=u(),M.notify(V)},R=S=>{if(g){g=!1;return}let E=!1;const P=o();if(typeof document<"u"&&P.length)for(const W of P){const G=W.enableBeforeUnload??!0;if(G===!0){E=!0;break}if(typeof G=="function"&&G()===!0){E=!0;break}}if(E)return S.preventDefault(),S.returnValue=""},M=mg({getLocation:m,getLength:()=>t.history.length,pushState:(S,E)=>_("push",S,E),replaceState:(S,E)=>_("replace",S,E),back:S=>(S&&(h=!0),g=!0,t.history.back()),forward:S=>{S&&(h=!0),g=!0,t.history.forward()},go:S=>{f=!0,t.history.go(S)},createHref:S=>i(S),flush:b,destroy:()=>{t.history.pushState=r,t.history.replaceState=n,t.removeEventListener(bf,R,{capture:!0}),t.removeEventListener(yf,$)},onBlocked:()=>{d&&c!==d&&(c=d)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(bf,R,{capture:!0}),t.addEventListener(yf,$),t.history.pushState=function(...S){const E=r.apply(t.history,S);return M._ignoreSubscribers||w("PUSH"),E},t.history.replaceState=function(...S){const E=n.apply(t.history,S);return M._ignoreSubscribers||w("REPLACE"),E},M}function Z1(e={initialEntries:["/"]}){const t=e.initialEntries;let r=e.initialIndex?Math.min(Math.max(e.initialIndex,0),t.length-1):t.length-1;const n=t.map((u,c)=>Vl(c,void 0)),s=()=>Ys(t[r],n[r]);let o=[];return mg({getLocation:s,getLength:()=>t.length,pushState:(u,c)=>{r<t.length-1&&(t.splice(r+1),n.splice(r+1)),n.push(c),t.push(u),r=Math.max(t.length-1,0)},replaceState:(u,c)=>{n[r]=c,t[r]=u},back:()=>{r=Math.max(r-1,0)},forward:()=>{r=Math.min(r+1,t.length-1)},go:u=>{r=Math.min(Math.max(r+u,0),t.length-1)},createHref:u=>u,getBlockers:()=>o,setBlockers:u=>o=u})}function Q1(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ys(e,t){const r=Q1(e),n=r.indexOf("#"),s=r.indexOf("?"),o=Vc();return{href:r,pathname:r.substring(0,n>0?s>0?Math.min(n,s):n:s>0?s:r.length),hash:n>-1?r.substring(n):"",search:s>-1?r.slice(s,n===-1?void 0:n):"",state:t||{[Er]:0,key:o,__TSR_key:o}}}function Vc(){return(Math.random()+1).toString(36).substring(7)}const X1=!1;function Ls(e){let t;return Y1(()=>{t=e()}),t}function Js(e){return e[e.length-1]}function ew(e){return typeof e=="function"}function $r(e,t){return ew(e)?e(t):e}const tw=Object.prototype.hasOwnProperty,xf=Object.prototype.propertyIsEnumerable;function gt(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=t,s=_f(e)&&_f(n);if(!s&&!(ba(e)&&ba(n)))return n;const o=s?e:wf(e);if(!o)return n;const a=s?n:wf(n);if(!a)return n;const i=o.length,u=a.length,c=s?new Array(u):{};let d=0;for(let f=0;f<u;f++){const p=s?f:a[f],h=e[p],g=n[p];if(h===g){c[p]=h,(s?f<i:tw.call(e,p))&&d++;continue}if(h===null||g===null||typeof h!="object"||typeof g!="object"){c[p]=g;continue}const m=gt(h,g,r+1);c[p]=m,m===h&&d++}return i===u&&d===i?e:c}function wf(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!xf.call(e,s))return!1;const r=Object.getOwnPropertySymbols(e);if(r.length===0)return t;const n=t;for(const s of r){if(!xf.call(e,s))return!1;n.push(s)}return n}function ba(e){if(!kf(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!kf(r)||!r.hasOwnProperty("isPrototypeOf"))}function kf(e){return Object.prototype.toString.call(e)==="[object Object]"}function _f(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qr(e,t,r){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;n++)if(!Qr(e[n],t[n],r))return!1;return!0}if(ba(e)&&ba(t)){const n=(r==null?void 0:r.ignoreUndefined)??!0;if(r!=null&&r.partial){for(const a in t)if((!n||t[a]!==void 0)&&!Qr(e[a],t[a],r))return!1;return!0}let s=0;if(!n)s=Object.keys(e).length;else for(const a in e)e[a]!==void 0&&s++;let o=0;for(const a in t)if((!n||t[a]!==void 0)&&(o++,o>s||!Qr(e[a],t[a],r)))return!1;return s===o}return!1}function Fn(e){let t,r;const n=new Promise((s,o)=>{t=s,r=o});return n.status="pending",n.resolve=s=>{n.status="resolved",n.value=s,t(s),e==null||e(s)},n.reject=s=>{n.status="rejected",r(s)},n}function Zs(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function rw(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Cf(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,r=>{try{return decodeURI(r)}catch{return r}})}return rw(t)}const nw=["http:","https:","mailto:","tel:"];function xa(e,t){if(!e)return!1;try{const r=new URL(e);return!t.has(r.protocol)}catch{return!1}}function ms(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let r=0,n="",s;for(;(s=t.exec(e))!==null;)n+=Cf(e.slice(r,s.index))+s[0],r=t.lastIndex;n=n+Cf(r?e.slice(r):e);let o=!1;return n.startsWith("//")&&(o=!0,n="/"+n.replace(/^\/+/,"")),{path:n,handledProtocolRelativeURL:o}}function sw(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var ow="Invariant failed";function Pr(e,t){if(!e)throw new Error(ow)}function wa(e){const t=new Map;let r,n;const s=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,n&&(n.next=o,o.prev=n)):(o.next.prev=void 0,r=o.next,o.next=void 0,n&&(o.prev=n,n.next=o)),n=o)};return{get(o){const a=t.get(o);if(a)return s(a),a.value},set(o,a){if(t.size>=e&&r){const u=r;t.delete(u.key),u.next&&(r=u.next,u.next.prev=void 0),u===n&&(n=void 0)}const i=t.get(o);if(i)i.value=a,s(i);else{const u={key:o,value:a,prev:n};n&&(n.next=u),n=u,r||(r=u),t.set(o,u)}},clear(){t.clear(),r=void 0,n=void 0}}}const Bn=0,tn=1,rn=2,Qs=3,qr=4,gg=5;function aw(e){const t=e.indexOf("{");if(t===-1)return null;const r=e.indexOf("}",t);return r===-1||t+1>=e.length?null:[t,r]}function Wc(e,t,r=new Uint16Array(6)){const n=e.indexOf("/",t),s=n===-1?e.length:n,o=e.substring(t,s);if(!o||!o.includes("$"))return r[0]=Bn,r[1]=t,r[2]=t,r[3]=s,r[4]=s,r[5]=s,r;if(o==="$"){const i=e.length;return r[0]=rn,r[1]=t,r[2]=t,r[3]=i,r[4]=i,r[5]=i,r}if(o.charCodeAt(0)===36)return r[0]=tn,r[1]=t,r[2]=t+1,r[3]=s,r[4]=s,r[5]=s,r;const a=aw(o);if(a){const[i,u]=a,c=o.charCodeAt(i+1);if(c===45){if(i+2<o.length&&o.charCodeAt(i+2)===36){const d=i+3,f=u;if(d<f)return r[0]=Qs,r[1]=t+i,r[2]=t+d,r[3]=t+f,r[4]=t+u+1,r[5]=s,r}}else if(c===36){const d=i+1,f=i+2;return f===u?(r[0]=rn,r[1]=t+i,r[2]=t+d,r[3]=t+f,r[4]=t+u+1,r[5]=e.length,r):(r[0]=tn,r[1]=t+i,r[2]=t+f,r[3]=t+u,r[4]=t+u+1,r[5]=s,r)}}return r[0]=Bn,r[1]=t,r[2]=t,r[3]=s,r[4]=s,r[5]=s,r}function ni(e,t,r,n,s,o,a){var u,c,d,f,p,h,g,m,v,y,b,_,w;a==null||a(r);let i=n;{const $=r.fullPath??r.from,R=$.length,M=((u=r.options)==null?void 0:u.caseSensitive)??e,D=!!((d=(c=r.options)==null?void 0:c.params)!=null&&d.parse&&((p=(f=r.options)==null?void 0:f.skipRouteOnParseError)!=null&&p.params));for(;i<R;){const S=Wc($,i,t);let E;const P=i,W=S[5];switch(i=W+1,o++,S[0]){case Bn:{const L=$.substring(S[2],S[3]);if(M){const V=(h=s.static)==null?void 0:h.get(L);if(V)E=V;else{s.static??(s.static=new Map);const O=Yr(r.fullPath??r.from);O.parent=s,O.depth=o,E=O,s.static.set(L,O)}}else{const V=L.toLowerCase(),O=(g=s.staticInsensitive)==null?void 0:g.get(V);if(O)E=O;else{s.staticInsensitive??(s.staticInsensitive=new Map);const re=Yr(r.fullPath??r.from);re.parent=s,re.depth=o,E=re,s.staticInsensitive.set(V,re)}}break}case tn:{const L=$.substring(P,S[1]),V=$.substring(S[4],W),O=M&&!!(L||V),re=L?O?L:L.toLowerCase():void 0,J=V?O?V:V.toLowerCase():void 0,K=!D&&((m=s.dynamic)==null?void 0:m.find(A=>!A.skipOnParamError&&A.caseSensitive===O&&A.prefix===re&&A.suffix===J));if(K)E=K;else{const A=Fi(tn,r.fullPath??r.from,O,re,J);E=A,A.depth=o,A.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(A)}break}case Qs:{const L=$.substring(P,S[1]),V=$.substring(S[4],W),O=M&&!!(L||V),re=L?O?L:L.toLowerCase():void 0,J=V?O?V:V.toLowerCase():void 0,K=!D&&((v=s.optional)==null?void 0:v.find(A=>!A.skipOnParamError&&A.caseSensitive===O&&A.prefix===re&&A.suffix===J));if(K)E=K;else{const A=Fi(Qs,r.fullPath??r.from,O,re,J);E=A,A.parent=s,A.depth=o,s.optional??(s.optional=[]),s.optional.push(A)}break}case rn:{const L=$.substring(P,S[1]),V=$.substring(S[4],W),O=M&&!!(L||V),re=L?O?L:L.toLowerCase():void 0,J=V?O?V:V.toLowerCase():void 0,K=Fi(rn,r.fullPath??r.from,O,re,J);E=K,K.parent=s,K.depth=o,s.wildcard??(s.wildcard=[]),s.wildcard.push(K)}}s=E}if(D&&r.children&&!r.isRoot&&r.id&&r.id.charCodeAt(r.id.lastIndexOf("/")+1)===95){const S=Yr(r.fullPath??r.from);S.kind=gg,S.parent=s,o++,S.depth=o,s.pathless??(s.pathless=[]),s.pathless.push(S),s=S}const j=(r.path||!r.children)&&!r.isRoot;if(j&&$.endsWith("/")){const S=Yr(r.fullPath??r.from);S.kind=qr,S.parent=s,o++,S.depth=o,s.index=S,s=S}s.parse=((b=(y=r.options)==null?void 0:y.params)==null?void 0:b.parse)??null,s.skipOnParamError=D,s.parsingPriority=((w=(_=r.options)==null?void 0:_.skipRouteOnParseError)==null?void 0:w.priority)??0,j&&!s.route&&(s.route=r,s.fullPath=r.fullPath??r.from)}if(r.children)for(const $ of r.children)ni(e,t,$,i,s,o,a)}function Li(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Cr(e){var t,r,n;if(e.pathless)for(const s of e.pathless)Cr(s);if(e.static)for(const s of e.static.values())Cr(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())Cr(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Li);for(const s of e.dynamic)Cr(s)}if((r=e.optional)!=null&&r.length){e.optional.sort(Li);for(const s of e.optional)Cr(s)}if((n=e.wildcard)!=null&&n.length){e.wildcard.sort(Li);for(const s of e.wildcard)Cr(s)}}function Yr(e){return{kind:Bn,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Fi(e,t,r,n,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:r,prefix:n,suffix:s}}function iw(e,t){const r=Yr("/"),n=new Uint16Array(6);for(const s of e)ni(!1,n,s,1,r,0);Cr(r),t.masksTree=r,t.flatCache=wa(1e3)}function lw(e,t){e||(e="/");const r=t.flatCache.get(e);if(r)return r;const n=Kc(e,t.masksTree);return t.flatCache.set(e,n),n}function cw(e,t,r,n,s){e||(e="/"),n||(n="/");const o=t?`case\0${e}`:e;let a=s.singleCache.get(o);if(!a){a=Yr("/");const i=new Uint16Array(6);ni(t,i,{from:e},1,a,0),s.singleCache.set(o,a)}return Kc(n,a,r)}function uw(e,t,r=!1){const n=r?e:`nofuzz\0${e}`,s=t.matchCache.get(n);if(s!==void 0)return s;e||(e="/");let o;try{o=Kc(e,t.segmentTree,r)}catch(a){if(a instanceof URIError)o=null;else throw a}return o&&(o.branch=hw(o.route)),t.matchCache.set(n,o),o}function dw(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fw(e,t=!1,r){const n=Yr(e.fullPath),s=new Uint16Array(6),o={},a={};let i=0;return ni(t,s,e,1,n,0,c=>{if(r==null||r(c,i),Pr(!(c.id in o),`Duplicate routes found with id: ${String(c.id)}`),o[c.id]=c,i!==0&&c.path){const d=dw(c.fullPath);(!a[d]||c.fullPath.endsWith("/"))&&(a[d]=c)}i++}),Cr(n),{processedTree:{segmentTree:n,singleCache:wa(1e3),matchCache:wa(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:a}}function Kc(e,t,r=!1){const n=e.split("/"),s=mw(e,n,t,r);if(!s)return null;const[o]=vg(e,n,s);return{route:s.node.route,rawParams:o,parsedParams:s.parsedParams}}function vg(e,t,r){var d,f,p,h,g,m,v,y,b,_;const n=pw(r.node);let s=null;const o={};let a=((d=r.extract)==null?void 0:d.part)??0,i=((f=r.extract)==null?void 0:f.node)??0,u=((p=r.extract)==null?void 0:p.path)??0,c=((h=r.extract)==null?void 0:h.segment)??0;for(;i<n.length;a++,i++,u++,c++){const w=n[i];if(w.kind===qr)break;if(w.kind===gg){c--,a--,u--;continue}const $=t[a],R=u;if($&&(u+=$.length),w.kind===tn){s??(s=r.node.fullPath.split("/"));const M=s[c],D=((g=w.prefix)==null?void 0:g.length)??0;if(M.charCodeAt(D)===123){const S=((m=w.suffix)==null?void 0:m.length)??0,E=M.substring(D+2,M.length-S-1),P=$.substring(D,$.length-S);o[E]=decodeURIComponent(P)}else{const S=M.substring(1);o[S]=decodeURIComponent($)}}else if(w.kind===Qs){if(r.skipped&1<<i){a--,u=R-1;continue}s??(s=r.node.fullPath.split("/"));const M=s[c],D=((v=w.prefix)==null?void 0:v.length)??0,j=((y=w.suffix)==null?void 0:y.length)??0,S=M.substring(D+3,M.length-j-1),E=w.suffix||w.prefix?$.substring(D,$.length-j):$;E&&(o[S]=decodeURIComponent(E))}else if(w.kind===rn){const M=w,D=e.substring(R+(((b=M.prefix)==null?void 0:b.length)??0),e.length-(((_=M.suffix)==null?void 0:_.length)??0)),j=decodeURIComponent(D);o["*"]=j,o._splat=j;break}}return r.rawParams&&Object.assign(o,r.rawParams),[o,{part:a,node:i,path:u,segment:c}]}function hw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function pw(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function mw(e,t,r,n){if(e==="/"&&r.index)return{node:r.index,skipped:0};const s=!Js(t),o=s&&e!=="/",a=t.length-(s?1:0),i=[{node:r,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let u=null,c=null,d=null;for(;i.length;){const f=i.pop(),{node:p,index:h,skipped:g,depth:m,statics:v,dynamics:y,optionals:b}=f;let{extract:_,rawParams:w,parsedParams:$}=f;if(p.skipOnParamError){if(!Bi(e,t,f))continue;w=f.rawParams,_=f.extract,$=f.parsedParams}n&&p.route&&p.kind!==qr&&gs(c,f)&&(c=f);const R=h===a;if(R&&(p.route&&!o&&gs(d,f)&&(d=f),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const M=R?void 0:t[h];let D;if(R&&p.index){const j={node:p.index,index:h,skipped:g,depth:m+1,statics:v,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$};let S=!0;if(p.index.skipOnParamError&&(Bi(e,t,j)||(S=!1)),S){if(v===a&&!y&&!b&&!g)return j;gs(d,j)&&(d=j)}}if(p.wildcard&&gs(u,f))for(const j of p.wildcard){const{prefix:S,suffix:E}=j;if(S&&(R||!(j.caseSensitive?M:D??(D=M.toLowerCase())).startsWith(S)))continue;if(E){if(R)continue;const W=t.slice(h).join("/").slice(-E.length);if((j.caseSensitive?W:W.toLowerCase())!==E)continue}const P={node:j,index:a,skipped:g,depth:m,statics:v,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$};if(!(j.skipOnParamError&&!Bi(e,t,P))){u=P;break}}if(p.optional){const j=g|1<<m,S=m+1;for(let E=p.optional.length-1;E>=0;E--){const P=p.optional[E];i.push({node:P,index:h,skipped:j,depth:S,statics:v,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$})}if(!R)for(let E=p.optional.length-1;E>=0;E--){const P=p.optional[E],{prefix:W,suffix:G}=P;if(W||G){const L=P.caseSensitive?M:D??(D=M.toLowerCase());if(W&&!L.startsWith(W)||G&&!L.endsWith(G))continue}i.push({node:P,index:h+1,skipped:g,depth:S,statics:v,dynamics:y,optionals:b+1,extract:_,rawParams:w,parsedParams:$})}}if(!R&&p.dynamic&&M)for(let j=p.dynamic.length-1;j>=0;j--){const S=p.dynamic[j],{prefix:E,suffix:P}=S;if(E||P){const W=S.caseSensitive?M:D??(D=M.toLowerCase());if(E&&!W.startsWith(E)||P&&!W.endsWith(P))continue}i.push({node:S,index:h+1,skipped:g,depth:m+1,statics:v,dynamics:y+1,optionals:b,extract:_,rawParams:w,parsedParams:$})}if(!R&&p.staticInsensitive){const j=p.staticInsensitive.get(D??(D=M.toLowerCase()));j&&i.push({node:j,index:h+1,skipped:g,depth:m+1,statics:v+1,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$})}if(!R&&p.static){const j=p.static.get(M);j&&i.push({node:j,index:h+1,skipped:g,depth:m+1,statics:v+1,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$})}if(p.pathless){const j=m+1;for(let S=p.pathless.length-1;S>=0;S--){const E=p.pathless[S];i.push({node:E,index:h,skipped:g,depth:j,statics:v,dynamics:y,optionals:b,extract:_,rawParams:w,parsedParams:$})}}}if(d&&u)return gs(u,d)?d:u;if(d)return d;if(u)return u;if(n&&c){let f=c.index;for(let h=0;h<c.index;h++)f+=t[h].length;const p=f===e.length?"/":e.slice(f);return c.rawParams??(c.rawParams={}),c.rawParams["**"]=decodeURIComponent(p),c}return null}function Bi(e,t,r){try{const[n,s]=vg(e,t,r);r.rawParams=n,r.extract=s;const o=r.node.parse(n);return r.parsedParams=Object.assign({},r.parsedParams,o),!0}catch{return null}}function gs(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===qr)>(e.node.kind===qr)||t.node.kind===qr==(e.node.kind===qr)&&t.depth>e.depth))):!0}function ra(e){return Hc(e.filter(t=>t!==void 0).join("/"))}function Hc(e){return e.replace(/\/{2,}/g,"/")}function yg(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ar(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function bg(e){return Ar(yg(e))}function ka(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function gw(e,t,r){return ka(e,r)===ka(t,r)}function vw({base:e,to:t,trailingSlash:r="never",cache:n}){const s=t.startsWith("/"),o=!s&&t===".";let a;if(n){a=s?t:o?e:e+"\0"+t;const f=n.get(a);if(f)return f}let i;if(o)i=e.split("/");else if(s)i=t.split("/");else{for(i=e.split("/");i.length>1&&Js(i)==="";)i.pop();const f=t.split("/");for(let p=0,h=f.length;p<h;p++){const g=f[p];g===""?p?p===h-1&&i.push(g):i=[g]:g===".."?i.pop():g==="."||i.push(g)}}i.length>1&&(Js(i)===""?r==="never"&&i.pop():r==="always"&&i.push(""));let u,c="";for(let f=0;f<i.length;f++){f>0&&(c+="/");const p=i[f];if(!p)continue;u=Wc(p,0,u);const h=u[0];if(h===Bn){c+=p;continue}const g=u[5],m=p.substring(0,u[1]),v=p.substring(u[4],g),y=p.substring(u[2],u[3]);h===tn?c+=m||v?`${m}{$${y}}${v}`:`$${y}`:h===rn?c+=m||v?`${m}{$}${v}`:"$":c+=`${m}{-$${y}}${v}`}c=Hc(c);const d=c||"/";return a&&n&&n.set(a,d),d}function yw(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),r=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),n=new RegExp(r,"g");return s=>s.replace(n,o=>t.get(o)??o)}function Ui(e,t,r){const n=t[e];return typeof n!="string"?n:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(n)?n:n.split("/").map(s=>Sf(s,r)).join("/"):Sf(n,r)}function $f({path:e,params:t,decoder:r,...n}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const a=e.length;let i=0,u,c="";for(;i<a;){const f=i;u=Wc(e,f,u);const p=u[5];if(i=p+1,f===p)continue;const h=u[0];if(h===Bn){c+="/"+e.substring(f,p);continue}if(h===rn){const g=t._splat;o._splat=g,o["*"]=g;const m=e.substring(f,u[1]),v=e.substring(u[4],p);if(!g){s=!0,(m||v)&&(c+="/"+m+v);continue}const y=Ui("_splat",t,r);c+="/"+m+y+v;continue}if(h===tn){const g=e.substring(u[2],u[3]);!s&&!(g in t)&&(s=!0),o[g]=t[g];const m=e.substring(f,u[1]),v=e.substring(u[4],p),y=Ui(g,t,r)??"undefined";c+="/"+m+y+v;continue}if(h===Qs){const g=e.substring(u[2],u[3]),m=t[g];if(m==null)continue;o[g]=m;const v=e.substring(f,u[1]),y=e.substring(u[4],p),b=Ui(g,t,r)??"";c+="/"+v+b+y;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:o,interpolatedPath:c||"/",isMissingParams:s}}function Sf(e,t){const r=encodeURIComponent(e);return(t==null?void 0:t(r))??r}function ht(e){return!!(e!=null&&e.isNotFound)}function bw(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Wl="tsr-scroll-restoration-v1_3",xw=(e,t)=>{let r;return(...n)=>{r||(r=setTimeout(()=>{e(...n),r=null},t))}};function ww(){const e=bw();if(!e)return null;const t=e.getItem(Wl);let r=t?JSON.parse(t):{};return{state:r,set:n=>{r=$r(n,r)||r;try{e.setItem(Wl,JSON.stringify(r))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Do=ww(),kw=e=>e.state.__TSR_key||e.href;function _w(e){const t=[];let r;for(;r=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(r.children,e)+1})`),e=r;return`${t.reverse().join(" > ")}`.toLowerCase()}let _a=!1;function Cw({storageKey:e,key:t,behavior:r,shouldScrollRestoration:n,scrollToTopSelectors:s,location:o}){var c,d;let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const i=t||((c=window.history.state)==null?void 0:c.__TSR_key),u=a[i];_a=!0;e:{if(n&&u&&Object.keys(u).length>0){for(const h in u){const g=u[h];if(h==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:r});else if(h){const m=document.querySelector(h);m&&(m.scrollLeft=g.scrollX,m.scrollTop=g.scrollY)}}break e}const f=(o??window.location).hash.split("#",2)[1];if(f){const h=((d=window.history.state)==null?void 0:d.__hashScrollIntoViewOptions)??!0;if(h){const g=document.getElementById(f);g&&g.scrollIntoView(h)}break e}const p={top:0,left:0,behavior:r};if(window.scrollTo(p),s)for(const h of s){if(h==="window")continue;const g=typeof h=="function"?h():document.querySelector(h);g&&g.scrollTo(p)}}_a=!1}function $w(e,t){if(!Do||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Do))return;e.isScrollRestorationSetup=!0,_a=!1;const n=e.options.getScrollRestorationKey||kw;window.history.scrollRestoration="manual";const s=o=>{if(_a||!e.isScrollRestoring)return;let a="";if(o.target===document||o.target===window)a="window";else{const u=o.target.getAttribute("data-scroll-restoration-id");u?a=`[data-scroll-restoration-id="${u}"]`:a=_w(o.target)}const i=n(e.state.location);Do.set(u=>{const c=u[i]||(u[i]={}),d=c[a]||(c[a]={});if(a==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(a){const f=document.querySelector(a);f&&(d.scrollX=f.scrollLeft||0,d.scrollY=f.scrollTop||0)}return u})};typeof document<"u"&&document.addEventListener("scroll",xw(s,100),!0),e.subscribe("onRendered",o=>{const a=n(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(Cw({storageKey:Wl,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Do.set(i=>(i[a]||(i[a]={}),i)))})}function Sw(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const r=document.getElementById(e.state.location.hash);r&&r.scrollIntoView(t)}}}function jw(e,t=String){const r=new URLSearchParams;for(const n in e){const s=e[n];s!==void 0&&r.set(n,t(s))}return r.toString()}function Vi(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Ew(e){const t=new URLSearchParams(e),r={};for(const[n,s]of t.entries()){const o=r[n];o==null?r[n]=Vi(s):Array.isArray(o)?o.push(Vi(s)):r[n]=[o,Vi(s)]}return r}const Aw=Pw(JSON.parse),Nw=Rw(JSON.stringify,JSON.parse);function Pw(e){return t=>{t[0]==="?"&&(t=t.substring(1));const r=Ew(t);for(const n in r){const s=r[n];if(typeof s=="string")try{r[n]=e(s)}catch{}}return r}}function Rw(e,t){const r=typeof t=="function";function n(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(r&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const o=jw(s,n);return o?`?${o}`:""}}const Ct="__root__";function Tw(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const r=new Response(null,{status:e.statusCode,headers:t});if(r.options=e,e.throw)throw r;return r}function yt(e){return e instanceof Response&&!!e.options}const Kl=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},si=(e,t)=>!!(e.preload&&!e.router.state.matches.some(r=>r.id===t)),zn=(e,t,r=!0)=>{const n={...e.router.options.context??{}},s=r?t:t-1;for(let o=0;o<=s;o++){const a=e.matches[o];if(!a)continue;const i=e.router.getMatch(a.id);i&&Object.assign(n,i.__routeContext,i.__beforeLoadContext)}return n},jf=(e,t)=>{if(!e.matches.length)return;const r=t.routeId,n=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),s=n>=0?n:0;let o=r?e.matches.findIndex(a=>a.routeId===r):e.firstBadMatchIndex??e.matches.length-1;o<0&&(o=s);for(let a=o;a>=0;a--){const i=e.matches[a];if(e.router.looseRoutesById[i.routeId].options.notFoundComponent)return a}return r?o:s},Sr=(e,t,r)=>{var n,s,o;if(!(!yt(r)&&!ht(r)))throw yt(r)&&r.redirectHandled&&!r.options.reloadDocument||(t&&((n=t._nonReactive.beforeLoadPromise)==null||n.resolve(),(s=t._nonReactive.loaderPromise)==null||s.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=r,e.updateMatch(t.id,a=>({...a,status:yt(r)?"redirected":a.status==="pending"?"success":a.status,context:zn(e,t.index),isFetching:!1,error:r})),ht(r)&&!r.routeId&&(r.routeId=t.routeId),(o=t._nonReactive.loadPromise)==null||o.resolve()),yt(r)&&(e.rendered=!0,r.options._fromLocation=e.location,r.redirectHandled=!0,r=e.router.resolveRedirect(r))),r},xg=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,vs=(e,t,r,n)=>{var i,u;const{id:s,routeId:o}=e.matches[t],a=e.router.looseRoutesById[o];if(r instanceof Promise)throw r;r.routerCode=n,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),Sr(e,e.router.getMatch(s),r);try{(u=(i=a.options).onError)==null||u.call(i,r)}catch(c){r=c,Sr(e,e.router.getMatch(s),r)}e.updateMatch(s,c=>{var d,f;return(d=c._nonReactive.beforeLoadPromise)==null||d.resolve(),c._nonReactive.beforeLoadPromise=void 0,(f=c._nonReactive.loadPromise)==null||f.resolve(),{...c,error:r,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!yt(r)&&!ht(r)&&(e.serialError??(e.serialError=r))},wg=(e,t,r,n)=>{var a;if(n._nonReactive.pendingTimeout!==void 0)return;const s=r.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!si(e,t)&&(r.options.loader||r.options.beforeLoad||_g(r))&&typeof s=="number"&&s!==1/0&&(r.options.pendingComponent??((a=e.router.options)==null?void 0:a.defaultPendingComponent)))){const i=setTimeout(()=>{Kl(e)},s);n._nonReactive.pendingTimeout=i}},Iw=(e,t,r)=>{const n=e.router.getMatch(t);if(!n._nonReactive.beforeLoadPromise&&!n._nonReactive.loaderPromise)return;wg(e,t,r,n);const s=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Sr(e,o,o.error)};return n._nonReactive.beforeLoadPromise?n._nonReactive.beforeLoadPromise.then(s):s()},Mw=(e,t,r,n)=>{const s=e.router.getMatch(t),o=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Fn(()=>{o==null||o.resolve()});const{paramsError:a,searchError:i}=s;a&&vs(e,r,a,"PARSE_PARAMS"),i&&vs(e,r,i,"VALIDATE_SEARCH"),wg(e,t,n,s);const u=new AbortController;let c=!1;const d=()=>{c||(c=!0,e.updateMatch(t,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:u})))},f=()=>{var w;(w=s._nonReactive.beforeLoadPromise)==null||w.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,$=>({...$,isFetching:!1}))};if(!n.options.beforeLoad){Ls(()=>{d(),f()});return}s._nonReactive.beforeLoadPromise=Fn();const p={...zn(e,r,!1),...s.__routeContext},{search:h,params:g,cause:m}=s,v=si(e,t),y={search:h,abortController:u,params:g,preload:v,context:p,location:e.location,navigate:w=>e.router.navigate({...w,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":m,matches:e.matches,routeId:n.id,...e.router.options.additionalContext},b=w=>{if(w===void 0){Ls(()=>{d(),f()});return}(yt(w)||ht(w))&&(d(),vs(e,r,w,"BEFORE_LOAD")),Ls(()=>{d(),e.updateMatch(t,$=>({...$,__beforeLoadContext:w})),f()})};let _;try{if(_=n.options.beforeLoad(y),Zs(_))return d(),_.catch(w=>{vs(e,r,w,"BEFORE_LOAD")}).then(b)}catch(w){d(),vs(e,r,w,"BEFORE_LOAD")}b(_)},zw=(e,t)=>{const{id:r,routeId:n}=e.matches[t],s=e.router.looseRoutesById[n],o=()=>i(),a=()=>Mw(e,r,t,s),i=()=>{if(xg(e,r))return;const u=Iw(e,r,s);return Zs(u)?u.then(a):a()};return o()},Ow=(e,t,r)=>{var o,a,i,u,c,d;const n=e.router.getMatch(t);if(!n||!r.options.head&&!r.options.scripts&&!r.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:n,params:n.params,loaderData:n.loaderData};return Promise.all([(a=(o=r.options).head)==null?void 0:a.call(o,s),(u=(i=r.options).scripts)==null?void 0:u.call(i,s),(d=(c=r.options).headers)==null?void 0:d.call(c,s)]).then(([f,p,h])=>{const g=f==null?void 0:f.meta,m=f==null?void 0:f.links,v=f==null?void 0:f.scripts,y=f==null?void 0:f.styles;return{meta:g,links:m,headScripts:v,headers:h,scripts:p,styles:y}})},kg=(e,t,r,n,s)=>{const o=t[n-1],{params:a,loaderDeps:i,abortController:u,cause:c}=e.router.getMatch(r),d=zn(e,n),f=si(e,r);return{params:a,deps:i,preload:!!f,parentMatchPromise:o,abortController:u,context:d,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:f?"preload":c,route:s,...e.router.options.additionalContext}},Ef=async(e,t,r,n,s)=>{var o,a,i,u,c,d,f;try{const p=e.router.getMatch(r);try{(!(X1??e.router.isServer)||p.ssr===!0)&&Ca(s);const h=(a=(o=s.options).loader)==null?void 0:a.call(o,kg(e,t,r,n,s)),g=s.options.loader&&Zs(h);if(!!(g||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||p._nonReactive.minPendingPromise)&&e.updateMatch(r,y=>({...y,isFetching:"loader"})),s.options.loader){const y=g?await h:h;Sr(e,e.router.getMatch(r),y),y!==void 0&&e.updateMatch(r,b=>({...b,loaderData:y}))}s._lazyPromise&&await s._lazyPromise;const v=p._nonReactive.minPendingPromise;v&&await v,s._componentsPromise&&await s._componentsPromise,e.updateMatch(r,y=>({...y,error:void 0,context:zn(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(h){let g=h;if((g==null?void 0:g.name)==="AbortError"){if(p.abortController.signal.aborted){(i=p._nonReactive.loaderPromise)==null||i.resolve(),p._nonReactive.loaderPromise=void 0;return}e.updateMatch(r,v=>({...v,status:v.status==="pending"?"success":v.status,isFetching:!1,context:zn(e,n)}));return}const m=p._nonReactive.minPendingPromise;m&&await m,ht(h)&&await((c=(u=s.options.notFoundComponent)==null?void 0:u.preload)==null?void 0:c.call(u)),Sr(e,e.router.getMatch(r),h);try{(f=(d=s.options).onError)==null||f.call(d,h)}catch(v){g=v,Sr(e,e.router.getMatch(r),v)}e.updateMatch(r,v=>({...v,error:g,context:zn(e,n),status:"error",isFetching:!1}))}}catch(p){const h=e.router.getMatch(r);h&&(h._nonReactive.loaderPromise=void 0),Sr(e,h,p)}},Dw=async(e,t,r)=>{var f,p;async function n(h,g,m,v){const y=Date.now()-g.updatedAt,b=h?v.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??e.router.options.defaultStaleTime??0,_=v.options.shouldReload,w=typeof _=="function"?_(kg(e,t,s,r,v)):_,{status:$,invalid:R}=m;a=$==="success"&&(R||(w??y>b)),h&&v.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{var M,D;try{await Ef(e,t,s,r,v);const j=e.router.getMatch(s);(M=j._nonReactive.loaderPromise)==null||M.resolve(),(D=j._nonReactive.loadPromise)==null||D.resolve(),j._nonReactive.loaderPromise=void 0}catch(j){yt(j)&&await e.router.navigate(j.options)}})()):($!=="success"||a&&e.sync)&&await Ef(e,t,s,r,v))}const{id:s,routeId:o}=e.matches[r];let a=!1,i=!1;const u=e.router.looseRoutesById[o];if(!xg(e,s)){const h=e.router.getMatch(s),g=si(e,s);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload)return h;await h._nonReactive.loaderPromise;const m=e.router.getMatch(s),v=m._nonReactive.error||m.error;v&&Sr(e,m,v),m.status==="pending"&&await n(g,h,m,u)}else{const m=g&&!e.router.state.matches.some(y=>y.id===s),v=e.router.getMatch(s);v._nonReactive.loaderPromise=Fn(),m!==v.preload&&e.updateMatch(s,y=>({...y,preload:m})),await n(g,h,v,u)}}const c=e.router.getMatch(s);i||((f=c._nonReactive.loaderPromise)==null||f.resolve(),(p=c._nonReactive.loadPromise)==null||p.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,i||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const d=i?c.isFetching:!1;return d!==c.isFetching||c.invalid!==!1?(e.updateMatch(s,h=>({...h,isFetching:d,invalid:!1})),e.router.getMatch(s)):c};async function Af(e){var p;const t=e,r=[];t.router.state.matches.some(h=>h._forcePending)&&Kl(t);let n;for(let h=0;h<t.matches.length;h++){try{const g=zw(t,h);Zs(g)&&await g}catch(g){if(yt(g))throw g;if(ht(g))n=g;else if(!t.preload)throw g;break}if(t.serialError)break}const s=t.firstBadMatchIndex??t.matches.length,o=n&&!t.preload?jf(t,n):void 0,a=n&&t.preload?0:o!==void 0?Math.min(o+1,s):s;let i,u;for(let h=0;h<a;h++)r.push(Dw(t,r,h));try{await Promise.all(r)}catch{const h=await Promise.allSettled(r);for(const g of h){if(g.status!=="rejected")continue;const m=g.reason;if(yt(m))throw m;ht(m)?i??(i=m):u??(u=m)}if(u!==void 0)throw u}const c=i??(n&&!t.preload?n:void 0);let d=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!c&&n&&t.preload)return t.matches;if(c){const h=jf(t,c);Pr(h!==void 0);const g=t.matches[h],m=t.router.looseRoutesById[g.routeId],v=(p=t.router.options)==null?void 0:p.defaultNotFoundComponent;!m.options.notFoundComponent&&v&&(m.options.notFoundComponent=v),c.routeId=g.routeId;const y=g.routeId===t.router.routeTree.id;t.updateMatch(g.id,b=>({...b,...y?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),d=h,await Ca(m)}else if(!t.preload){const h=t.matches[0];if(!h.globalNotFound){const g=t.router.getMatch(h.id);g!=null&&g.globalNotFound&&t.updateMatch(h.id,m=>({...m,globalNotFound:!1,error:void 0}))}}if(t.serialError&&t.firstBadMatchIndex!==void 0){const h=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ca(h)}for(let h=0;h<=d;h++){const g=t.matches[h],{id:m,routeId:v}=g,y=t.router.looseRoutesById[v];try{const b=Ow(t,m,y);if(b){const _=await b;t.updateMatch(m,w=>({...w,..._}))}}catch(b){console.error(`Error executing head for route ${v}:`,b)}}const f=Kl(t);if(Zs(f)&&await f,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function Ca(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:r,...n}=t.options;Object.assign(e.options,n),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{var n;const r=[];for(const s of Cg){const o=(n=e.options[s])==null?void 0:n.preload;o&&r.push(o())}if(r.length)return Promise.all(r).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function _g(e){var t;for(const r of Cg)if((t=e.options[r])!=null&&t.preload)return!0;return!1}const Cg=["component","errorComponent","pendingComponent","notFoundComponent"];function Lw(e){return{input:({url:t})=>{for(const r of e)t=Hl(r,t);return t},output:({url:t})=>{for(let r=e.length-1;r>=0;r--)t=$g(e[r],t);return t}}}function Fw(e){const t=bg(e.basepath),r=`/${t}`,n=`${r}/`,s=e.caseSensitive?r:r.toLowerCase(),o=e.caseSensitive?n:n.toLowerCase();return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===s?a.pathname="/":i.startsWith(o)&&(a.pathname=a.pathname.slice(r.length)),a},output:({url:a})=>(a.pathname=ra(["/",t,a.pathname]),a)}}function Hl(e,t){var n;const r=(n=e==null?void 0:e.input)==null?void 0:n.call(e,{url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function $g(e,t){var n;const r=(n=e==null?void 0:e.output)==null?void 0:n.call(e,{url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function Xr(e){const t=e.resolvedLocation,r=e.location,n=(t==null?void 0:t.pathname)!==r.pathname,s=(t==null?void 0:t.href)!==r.href,o=(t==null?void 0:t.hash)!==r.hash;return{fromLocation:t,toLocation:r,pathChanged:n,hrefChanged:s,hashChanged:o}}function Bw(e){const t=e.filter(r=>r.status!=="redirected");return t.length===e.length?e:t}class Uw{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=r=>r(),this.update=r=>{var p;const n=this.options,s=this.basepath??(n==null?void 0:n.basepath)??"/",o=this.basepath===void 0,a=n==null?void 0:n.rewrite;if(this.options={...n,...r},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=yw(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=J1()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=wa(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=q1(Ww(this.latestLocation)),$w(this));let i=!1;const u=this.options.basepath??"/",c=this.options.rewrite;if(o||s!==u||a!==c){this.basepath=u;const h=[],g=bg(u);g&&g!=="/"&&h.push(Fw({basepath:u})),c&&h.push(c),this.rewrite=h.length===0?void 0:h.length===1?h[0]:Lw(h),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(h=>({...h,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof((p=window.CSS)==null?void 0:p.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=fw(this.routeTree,this.options.caseSensitive,(n,s)=>{n.init({originalIndex:s})});return this.options.routeMasks&&iw(this.options.routeMasks,r.processedTree),r},this.subscribe=(r,n)=>{const s={eventType:r,fn:n};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=r=>{this.subscribers.forEach(n=>{n.eventType===r.type&&n.fn(r)})},this.parseLocation=(r,n)=>{const s=({pathname:u,search:c,hash:d,href:f,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const b=this.options.parseSearch(c),_=this.options.stringifySearch(b);return{href:u+_+d,publicHref:f,pathname:ms(u).path,external:!1,searchStr:_,search:gt(n==null?void 0:n.search,b),hash:ms(d.slice(1)).path,state:gt(n==null?void 0:n.state,p)}}const h=new URL(f,this.origin),g=Hl(this.rewrite,h),m=this.options.parseSearch(g.search),v=this.options.stringifySearch(m);return g.search=v,{href:g.href.replace(g.origin,""),publicHref:f,pathname:ms(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:v,search:gt(n==null?void 0:n.search,m),hash:ms(g.hash.slice(1)).path,state:gt(n==null?void 0:n.state,p)}},o=s(r),{__tempLocation:a,__tempKey:i}=o.state;if(a&&(!i||i===this.tempLocationKey)){const u=s(a);return u.state.key=o.state.key,u.state.__TSR_key=o.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:o}}return o},this.resolvePathWithBase=(r,n)=>vw({base:r,to:Hc(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(r,n,s)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:n},s):this.matchRoutesInternal(r,n),this.getMatchedRoutes=r=>Kw({pathname:r,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=r=>{const n=this.getMatch(r);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const r=this.state.matches.filter(o=>o.status==="pending"),n=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...r,...n]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=r=>{const n=(o={})=>{var E,P;const a=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);o.from;const u=o.unsafeRelative==="path"?a.pathname:o.from??i.fullPath,c=this.resolvePathWithBase(u,"."),d=i.search,f={...i.params},p=o.to?this.resolvePathWithBase(c,`${o.to}`):this.resolvePathWithBase(c,"."),h=o.params===!1||o.params===null?{}:(o.params??!0)===!0?f:Object.assign(f,$r(o.params,f)),g=this.getMatchedRoutes(p);let m=g.matchedRoutes;if((!g.foundRoute||g.foundRoute.path!=="/"&&g.routeParams["**"])&&this.options.notFoundRoute&&(m=[...m,this.options.notFoundRoute]),Object.keys(h).length>0)for(const W of m){const G=((E=W.options.params)==null?void 0:E.stringify)??W.options.stringifyParams;if(G)try{Object.assign(h,G(h))}catch{}}const y=r.leaveParams?p:ms($f({path:p,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let b=d;if(r._includeValidateSearch&&((P=this.options.search)!=null&&P.strict)){const W={};m.forEach(G=>{if(G.options.validateSearch)try{Object.assign(W,na(G.options.validateSearch,{...W,...b}))}catch{}}),b=W}b=Hw({search:b,dest:o,destRoutes:m,_includeValidateSearch:r._includeValidateSearch}),b=gt(d,b);const _=this.options.stringifySearch(b),w=o.hash===!0?a.hash:o.hash?$r(o.hash,a.hash):void 0,$=w?`#${w}`:"";let R=o.state===!0?a.state:o.state?$r(o.state,a.state):{};R=gt(a.state,R);const M=`${y}${_}${$}`;let D,j,S=!1;if(this.rewrite){const W=new URL(M,this.origin),G=$g(this.rewrite,W);D=W.href.replace(W.origin,""),G.origin!==this.origin?(j=G.href,S=!0):j=G.pathname+G.search+G.hash}else D=sw(M),j=D;return{publicHref:j,href:D,pathname:y,search:b,searchStr:_,state:R,hash:w??"",external:S,unmaskOnReload:o.unmaskOnReload}},s=(o={},a)=>{const i=n(o);let u=a?n(a):void 0;if(!u){const c={};if(this.options.routeMasks){const d=lw(i.pathname,this.processedTree);if(d){Object.assign(c,d.rawParams);const{from:f,params:p,...h}=d.route,g=p===!1||p===null?{}:(p??!0)===!0?c:Object.assign(c,$r(p,c));a={from:r.from,...h,params:g},u=n(a)}}}return u&&(i.maskedLocation=u),i};return r.mask?s(r,{from:r.from,...r.mask}):s(r)},this.commitLocation=async({viewTransition:r,ignoreBlocker:n,...s})=>{const o=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(d=>{s.state[d]=this.latestLocation.state[d]});const c=Qr(s.state,this.latestLocation.state);return u.forEach(d=>{delete s.state[d]}),c},a=Ar(this.latestLocation.href)===Ar(s.href),i=this.commitLocationPromise;if(this.commitLocationPromise=Fn(()=>{i==null||i.resolve()}),a&&o())this.load();else{let{maskedLocation:u,hashScrollIntoView:c,...d}=s;u&&(d={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),d.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=r,this.history[s.replace?"replace":"push"](d.publicHref,d.state,{ignoreBlocker:n})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:n,hashScrollIntoView:s,viewTransition:o,ignoreBlocker:a,href:i,...u}={})=>{if(i){const f=this.history.location.state.__TSR_index,p=Ys(i,{__TSR_index:r?f:f+1}),h=new URL(p.pathname,this.origin),g=Hl(this.rewrite,h);u.to=g.pathname,u.search=this.options.parseSearch(p.search),u.hash=p.hash.slice(1)}const c=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const d=this.commitLocation({...c,viewTransition:o,replace:r,resetScroll:n,hashScrollIntoView:s,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),d},this.navigate=async({to:r,reloadDocument:n,href:s,publicHref:o,...a})=>{var u;let i=!1;if(s)try{new URL(`${s}`),i=!0}catch{}if(i&&!n&&(n=!0),n){if(r!==void 0||!s){const d=this.buildLocation({to:r,...a});s=s??d.publicHref,o=o??d.publicHref}const c=!i&&o?o:s;if(xa(c,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history,f=((u=d.getBlockers)==null?void 0:u.call(d))??[];for(const p of f)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...a,href:s,to:r,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const r=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:r,cachedMatches:n.cachedMatches.filter(s=>!r.some(o=>o.id===s.id))}))},this.load=async r=>{let n,s,o;for(o=new Promise(i=>{this.startTransition(async()=>{var u;try{this.beforeLoad();const c=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Xr({resolvedLocation:d,location:c})}),this.emit({type:"onBeforeLoad",...Xr({resolvedLocation:d,location:c})}),await Af({router:this,sync:r==null?void 0:r.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=[],p=[],h=[],g=[];Ls(()=>{this.__store.setState(m=>{const v=m.matches,y=m.pendingMatches||m.matches;return f=v.filter(b=>!y.some(_=>_.id===b.id)),p=v.filter(b=>!y.some(_=>_.routeId===b.routeId)),h=y.filter(b=>!v.some(_=>_.routeId===b.routeId)),g=y.filter(b=>v.some(_=>_.routeId===b.routeId)),{...m,isLoading:!1,loadedAt:Date.now(),matches:y,pendingMatches:void 0,cachedMatches:[...m.cachedMatches,...f.filter(b=>b.status!=="error"&&b.status!=="notFound"&&b.status!=="redirected")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[h,"onEnter"],[g,"onStay"]].forEach(([m,v])=>{m.forEach(y=>{var b,_;(_=(b=this.looseRoutesById[y.routeId].options)[v])==null||_.call(b,y)})})})})}})}catch(c){yt(c)?(n=c,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):ht(c)&&(s=c),this.__store.setState(d=>({...d,statusCode:n?n.status:s?404:d.matches.some(f=>f.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===o&&((u=this.commitLocationPromise)==null||u.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(i=>i.status==="error")&&(a=500),a!==void 0&&this.__store.setState(i=>({...i,statusCode:a}))},this.startViewTransition=r=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,a=this.state.resolvedLocation,i=typeof n.types=="function"?n.types(Xr({resolvedLocation:a,location:o})):n.types;if(i===!1){r();return}s={update:r,types:i}}else s=r;document.startViewTransition(s)}else r()},this.updateMatch=(r,n)=>{this.startTransition(()=>{var o;const s=(o=this.state.pendingMatches)!=null&&o.some(a=>a.id===r)?"pendingMatches":this.state.matches.some(a=>a.id===r)?"matches":this.state.cachedMatches.some(a=>a.id===r)?"cachedMatches":"";s&&(s==="cachedMatches"?this.__store.setState(a=>({...a,cachedMatches:Bw(a.cachedMatches.map(i=>i.id===r?n(i):i))})):this.__store.setState(a=>{var i;return{...a,[s]:(i=a[s])==null?void 0:i.map(u=>u.id===r?n(u):u)}}))})},this.getMatch=r=>{var s;const n=o=>o.id===r;return this.state.cachedMatches.find(n)??((s=this.state.pendingMatches)==null?void 0:s.find(n))??this.state.matches.find(n)},this.invalidate=r=>{const n=s=>{var o;return((o=r==null?void 0:r.filter)==null?void 0:o.call(r,s))??!0?{...s,invalid:!0,...r!=null&&r.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.__store.setState(s=>{var o;return{...s,matches:s.matches.map(n),cachedMatches:s.cachedMatches.map(n),pendingMatches:(o=s.pendingMatches)==null?void 0:o.map(n)}}),this.shouldViewTransition=!1,this.load({sync:r==null?void 0:r.sync})},this.getParsedLocationHref=r=>r.publicHref||"/",this.resolveRedirect=r=>{const n=r.headers.get("Location");if(!r.options.href||r.options._builtLocation){const s=r.options._builtLocation??this.buildLocation(r.options),o=this.getParsedLocationHref(s);r.options.href=o,r.headers.set("Location",o)}else if(n)try{const s=new URL(n);if(this.origin&&s.origin===this.origin){const o=s.pathname+s.search+s.hash;r.options.href=o,r.headers.set("Location",o)}}catch{}if(r.options.href&&!r.options._builtLocation&&xa(r.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return r.headers.get("Location")||r.headers.set("Location",r.options.href),r},this.clearCache=r=>{const n=r==null?void 0:r.filter;n!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(o=>!n(o))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const r=n=>{const s=this.looseRoutesById[n.routeId];if(!s.options.loader)return!0;const o=(n.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??5*60*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=Ca,this.preloadRoute=async r=>{const n=r._builtLocation??this.buildLocation(r);let s=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:r});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(i=>i.id)),a=new Set([...o,...this.state.cachedMatches.map(i=>i.id)]);Ls(()=>{s.forEach(i=>{a.has(i.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,i]}))})});try{return s=await Af({router:this,matches:s,location:n,preload:!0,updateMatch:(i,u)=>{o.has(i)?s=s.map(c=>c.id===i?u(c):c):this.updateMatch(i,u)}}),s}catch(i){if(yt(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:n});ht(i)||console.error(i);return}},this.matchRoute=(r,n)=>{const s={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},o=this.buildLocation(s);if(n!=null&&n.pending&&this.state.status!=="pending")return!1;const i=((n==null?void 0:n.pending)===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,u=cw(o.pathname,(n==null?void 0:n.caseSensitive)??!1,(n==null?void 0:n.fuzzy)??!1,i.pathname,this.processedTree);return!u||r.params&&!Qr(u.rawParams,r.params,{partial:!0})?!1:(n==null?void 0:n.includeSearch)??!0?Qr(i.search,o.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(r=>r.status==="notFound"||r.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Nw,parseSearch:t.parseSearch??Aw,protocolAllowlist:t.protocolAllowlist??nw}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:r,processedTree:n}){this.routesById=t,this.routesByPath=r,this.processedTree=n;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}getParentContext(t){return(t==null?void 0:t.id)?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,r){var p,h;const n=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:o,parsedParams:a}=n;let{matchedRoutes:i}=n,u=!1;(s?s.path!=="/"&&o["**"]:Ar(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:u=!0);const c=u?qw(this.options.notFoundMode,i):void 0,d=new Array(i.length),f=new Map(this.state.matches.map(g=>[g.routeId,g]));for(let g=0;g<i.length;g++){const m=i[g],v=d[g-1];let y,b,_;{const V=(v==null?void 0:v.search)??t.search,O=(v==null?void 0:v._strictSearch)??void 0;try{const re=na(m.options.validateSearch,{...V})??void 0;y={...V,...re},b={...O,...re},_=void 0}catch(re){let J=re;if(re instanceof $a||(J=new $a(re.message,{cause:re})),r!=null&&r.throwOnError)throw J;y=V,b={},_=J}}const w=((h=(p=m.options).loaderDeps)==null?void 0:h.call(p,{search:y}))??"",$=w?JSON.stringify(w):"",{interpolatedPath:R,usedParams:M}=$f({path:m.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),D=m.id+R+$,j=this.getMatch(D),S=f.get(m.id),E=(j==null?void 0:j._strictParams)??M;let P;if(!j)try{Nf(m,M,a,E)}catch(V){if(ht(V)||yt(V)?P=V:P=new Vw(V.message,{cause:V}),r!=null&&r.throwOnError)throw P}Object.assign(o,E);const W=S?"stay":"enter";let G;if(j)G={...j,cause:W,params:(S==null?void 0:S.params)??o,_strictParams:E,search:gt(S?S.search:j.search,y),_strictSearch:b};else{const V=m.options.loader||m.options.beforeLoad||m.lazyFn||_g(m)?"pending":"success";G={id:D,ssr:m.options.ssr,index:g,routeId:m.id,params:(S==null?void 0:S.params)??o,_strictParams:E,pathname:R,updatedAt:Date.now(),search:S?gt(S.search,y):y,_strictSearch:b,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Fn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:W,loaderDeps:S?gt(S.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}r!=null&&r.preload||(G.globalNotFound=c===m.id),G.searchError=_;const L=this.getParentContext(v);G.context={...L,...G.__routeContext,...G.__beforeLoadContext},d[g]=G}for(let g=0;g<d.length;g++){const m=d[g],v=this.looseRoutesById[m.routeId],y=this.getMatch(m.id),b=f.get(m.routeId);if(m.params=b?gt(b.params,o):o,!y){const _=d[g-1],w=this.getParentContext(_);if(v.options.context){const $={deps:m.loaderDeps,params:m.params,context:w??{},location:t,navigate:R=>this.navigate({...R,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:v.id};m.__routeContext=v.options.context($)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(t){const{matchedRoutes:r,routeParams:n,parsedParams:s}=this.getMatchedRoutes(t.pathname),o=Js(r),a={...t.search};for(const d of r)try{Object.assign(a,na(d.options.validateSearch,a))}catch{}const i=Js(this.state.matches),u=i&&i.routeId===o.id&&t.pathname===this.state.location.pathname;let c;if(u)c=i.params;else{const d={...n};for(const f of r)try{Nf(f,n,s??{},d)}catch{}c=d}return{matchedRoutes:r,fullPath:o.fullPath,search:a,params:c}}}class $a extends Error{}class Vw extends Error{}function Ww(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function na(e,t){if(e==null)return{};if("~standard"in e){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new $a("Async validation not supported");if(r.issues)throw new $a(JSON.stringify(r.issues,void 0,2),{cause:r});return r.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Kw({pathname:e,routesById:t,processedTree:r}){const n={},s=Ar(e);let o,a;const i=uw(s,r,!0);return i&&(o=i.route,Object.assign(n,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:(i==null?void 0:i.branch)||[t[Ct]],routeParams:n,foundRoute:o,parsedParams:a}}function Hw({search:e,dest:t,destRoutes:r,_includeValidateSearch:n}){return Gw(r)(e,t,n??!1)}function Gw(e){var s;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)(s=o.options.search)!=null&&s.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const a=({search:i,next:u})=>{let c=i;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(c=o.options.preSearchFilters.reduce((f,p)=>p(f),i));const d=u(c);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((f,p)=>p(f),d):d};t.middlewares.push(a)}if(o.options.validateSearch){const a=({search:i,next:u})=>{const c=u(i);if(!t._includeValidateSearch)return c;try{return{...c,...na(o.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(a)}}const r=({search:o})=>{const a=t.dest;return a.search?a.search===!0?o:$r(a.search,o):{}};t.middlewares.push(r);const n=(o,a,i)=>{if(o>=i.length)return a;const u=i[o];return u({search:a,next:d=>n(o+1,d,i)})};return function(a,i,u){return t.dest=i,t._includeValidateSearch=u,n(0,a,t.middlewares)}}function qw(e,t){if(e!=="root")for(let r=t.length-1;r>=0;r--){const n=t[r];if(n.children)return n.id}return Ct}function Nf(e,t,r,n){var o;const s=((o=e.options.params)==null?void 0:o.parse)??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const a in t)a in r&&(n[a]=r[a]);else{const a=s(n);Object.assign(n,a)}}const Yw="Error preloading route! ☝️";class Sg{constructor(t){if(this.init=r=>{var c,d;this.originalIndex=r.originalIndex;const n=this.options,s=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(d=(c=this.options).getParentRoute)==null?void 0:d.call(c),s?this._path=Ct:this.parentRoute||Pr(!1);let o=s?Ct:n==null?void 0:n.path;o&&o!=="/"&&(o=yg(o));const a=(n==null?void 0:n.id)||o;let i=s?Ct:ra([this.parentRoute.id===Ct?"":this.parentRoute.id,a]);o===Ct&&(o="/"),i!==Ct&&(i=ra(["/",i]));const u=i===Ct?"/":ra([this.parentRoute.fullPath,o]);this._path=o,this._id=i,this._fullPath=u,this._to=Ar(u)},this.addChildren=r=>this._addFileChildren(r),this._addFileChildren=r=>(Array.isArray(r)&&(this.children=r),typeof r=="object"&&r!==null&&(this.children=Object.values(r)),this),this._addFileTypes=()=>this,this.updateLoader=r=>(Object.assign(this.options,r),this),this.update=r=>(Object.assign(this.options,r),this),this.lazy=r=>(this.lazyFn=r,this),this.redirect=r=>Tw({from:this.fullPath,...r}),this.options=t||{},this.isRoot=!(t!=null&&t.getParentRoute),t!=null&&t.id&&(t!=null&&t.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Jw extends Sg{constructor(t){super(t)}}const Lo=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Wi(e){const t=x.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function Zw(e,t,r={},n={}){x.useEffect(()=>{if(!e.current||n.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([o])=>{t(o)},r);return s.observe(e.current),()=>{s.disconnect()}},[t,r,n.disabled,e])}function Qw(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}function Gc(e){const t=e.errorComponent??qc;return l.jsx(Xw,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:n})=>r?x.createElement(t,{error:r,reset:n}):e.children})}class Xw extends x.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,r){r.error&&r.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,r){this.props.onCatch&&this.props.onCatch(t,r)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function qc({error:e}){const[t,r]=x.useState(!1);return l.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[l.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),l.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(n=>!n),children:t?"Hide Error":"Show Error"})]}),l.jsx("div",{style:{height:".25rem"}}),t?l.jsx("div",{children:l.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?l.jsx("code",{children:e.message}):null})}):null]})}function ek({children:e,fallback:t=null}){return jg()?l.jsx(U.Fragment,{children:e}):l.jsx(U.Fragment,{children:t})}function jg(){return U.useSyncExternalStore(tk,()=>!0,()=>!1)}function tk(){return()=>{}}var Eg={exports:{}},Ag={},Ng={exports:{}},Pg={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim.production.js
12
12
  *
@@ -22,14 +22,14 @@ var t1=Object.defineProperty;var r1=(e,t,r)=>t in e?t1(e,t,{enumerable:!0,config
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var oi=x,fk=dk;function hk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pk=typeof Object.is=="function"?Object.is:hk,mk=fk.useSyncExternalStore,gk=oi.useRef,vk=oi.useEffect,yk=oi.useMemo,bk=oi.useDebugValue;Ag.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var o=gk(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=yk(function(){function u(h){if(!c){if(c=!0,d=h,h=n(h),s!==void 0&&a.hasValue){var g=a.value;if(s(g,h))return f=g}return f=h}if(g=f,pk(d,h))return g;var m=n(h);return s!==void 0&&s(g,m)?(d=h,g):(d=h,f=m)}var c=!1,d,f,p=r===void 0?null:r;return[function(){return u(t())},p===null?void 0:function(){return u(p())}]},[t,r,n,s]);var i=mk(e,o[0],o[1]);return vk(function(){a.hasValue=!0,a.value=i},[i]),bk(i),i};Eg.exports=Ag;var xk=Eg.exports;function wk(e,t){return e===t}function kk(e,t,r=wk){const n=x.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:i}=e.subscribe(a);return i},[e]),s=x.useCallback(()=>e==null?void 0:e.get(),[e]);return xk.useSyncExternalStoreWithSelector(n,s,s,t,r)}const Rg=x.createContext(null);function Et(e){const t=x.useContext(Rg);return e==null||e.warn,t}function St(e){const t=Et({warn:(e==null?void 0:e.router)===void 0}),r=(e==null?void 0:e.router)||t,n=x.useRef(void 0);return kk(r.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??r.options.defaultStructuralSharing){const o=gt(n.current,e.select(s));return n.current=o,o}return e.select(s)}return s})}const ai=x.createContext(void 0),_k=x.createContext(void 0);function Ht(e){const t=x.useContext(e.from?_k:ai);return St({select:n=>{const s=n.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(Pr(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function Yc(e){return Ht({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Jc(e){const{select:t,...r}=e;return Ht({...r,select:n=>t?t(n.loaderDeps):n.loaderDeps})}function ii(e){return Ht({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function li(e){return Ht({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ci(e){const t=Et();return x.useCallback(r=>t.navigate({...r,from:r.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function Ck(e,t){const r=Et(),n=Qw(t),{activeProps:s,inactiveProps:o,activeOptions:a,to:i,preload:u,preloadDelay:c,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:h,viewTransition:g,children:m,target:v,disabled:y,style:b,className:_,onClick:w,onBlur:$,onFocus:R,onMouseEnter:M,onMouseLeave:D,onTouchStart:j,ignoreBlocker:S,params:E,search:P,hash:W,state:G,mask:L,reloadDocument:V,unsafeRelative:O,from:te,_fromLocation:J,...H}=e,A=jg(),Y=St({select:xe=>{const $e=xe.matches[xe.matches.length-1];return{search:$e==null?void 0:$e.search,hash:xe.location.hash,path:$e==null?void 0:$e.pathname}},structuralSharing:!0}),z=e.from,k=x.useMemo(()=>({...e,from:z}),[r,Y,z,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),C=x.useMemo(()=>r.buildLocation({...k}),[r,k]),N=C.maskedLocation?C.maskedLocation.publicHref:C.publicHref,B=C.maskedLocation?C.maskedLocation.external:C.external,K=x.useMemo(()=>Nk(N,B,r.history,y),[y,B,N,r.history]),ee=x.useMemo(()=>{if(K!=null&&K.external)return xa(K.href,r.protocolAllowlist)?void 0:K.href;if(!Pk(i)&&!(typeof i!="string"||i.indexOf(":")===-1))try{return new URL(i),xa(i,r.protocolAllowlist)?void 0:i}catch{}},[i,K,r.protocolAllowlist]),ne=St({select:xe=>{if(ee)return!1;if(a!=null&&a.exact){if(!gw(xe.location.pathname,C.pathname,r.basepath))return!1}else{const $e=ka(xe.location.pathname,r.basepath),We=ka(C.pathname,r.basepath);if(!($e.startsWith(We)&&($e.length===We.length||$e[We.length]==="/")))return!1}return((a==null?void 0:a.includeSearch)??!0)&&!Qr(xe.location.search,C.search,{partial:!(a!=null&&a.exact),ignoreUndefined:!(a!=null&&a.explicitUndefined)})?!1:a!=null&&a.includeHash?A&&xe.location.hash===C.hash:!0}}),le=ne?$r(s,{})??$k:Hi,me=ne?Hi:$r(o,{})??Hi,I=[_,le.className,me.className].filter(Boolean).join(" "),oe=(b||le.style||me.style)&&{...b,...le.style,...me.style},[ce,X]=x.useState(!1),de=x.useRef(!1),ge=e.reloadDocument||ee?!1:u??r.options.defaultPreload,je=c??r.options.defaultPreloadDelay??0,_e=x.useCallback(()=>{r.preloadRoute({...k,_builtLocation:C}).catch(xe=>{console.warn(xe),console.warn(Yw)})},[r,k,C]),Ie=x.useCallback(xe=>{xe!=null&&xe.isIntersecting&&_e()},[_e]);Zw(n,Ie,Ak,{disabled:!!y||ge!=="viewport"}),x.useEffect(()=>{de.current||!y&&ge==="render"&&(_e(),de.current=!0)},[y,_e,ge]);const Ge=xe=>{const $e=xe.currentTarget.getAttribute("target"),We=v!==void 0?v:$e;if(!y&&!Rk(xe)&&!xe.defaultPrevented&&(!We||We==="_self")&&xe.button===0){xe.preventDefault(),ag.flushSync(()=>{X(!0)});const pt=r.subscribe("onResolved",()=>{pt(),X(!1)});r.navigate({...k,replace:f,resetScroll:h,hashScrollIntoView:d,startTransition:p,viewTransition:g,ignoreBlocker:S})}};if(ee)return{...H,ref:n,href:ee,...m&&{children:m},...v&&{target:v},...y&&{disabled:y},...b&&{style:b},..._&&{className:_},...w&&{onClick:w},...$&&{onBlur:$},...R&&{onFocus:R},...M&&{onMouseEnter:M},...D&&{onMouseLeave:D},...j&&{onTouchStart:j}};const it=xe=>{if(y||ge!=="intent")return;if(!je){_e();return}const $e=xe.currentTarget;if(ys.has($e))return;const We=setTimeout(()=>{ys.delete($e),_e()},je);ys.set($e,We)},wt=xe=>{y||ge!=="intent"||_e()},kt=xe=>{if(y||!ge||!je)return;const $e=xe.currentTarget,We=ys.get($e);We&&(clearTimeout(We),ys.delete($e))};return{...H,...le,...me,href:K==null?void 0:K.href,ref:n,onClick:bn([w,Ge]),onBlur:bn([$,kt]),onFocus:bn([R,it]),onMouseEnter:bn([M,it]),onMouseLeave:bn([D,kt]),onTouchStart:bn([j,wt]),disabled:!!y,target:v,...oe&&{style:oe},...I&&{className:I},...y&&Sk,...ne&&jk,...A&&ce&&Ek}}const Hi={},$k={className:"active"},Sk={role:"link","aria-disabled":!0},jk={"data-status":"active","aria-current":"page"},Ek={"data-transitioning":"transitioning"},ys=new WeakMap,Ak={rootMargin:"100px"},bn=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function Nk(e,t,r,n){if(!n)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function Pk(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Tg=x.forwardRef((e,t)=>{const{_asChild:r,...n}=e,{type:s,...o}=Ck(n,t),a=typeof n.children=="function"?n.children({isActive:o["data-status"]==="active"}):n.children;if(!r){const{disabled:i,...u}=o;return x.createElement("a",u,a)}return x.createElement(r,o,a)});function Rk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class Tk extends Sg{constructor(t){super(t),this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({...r,from:this.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>li({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useParams=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Jc({...r,from:this.id}),this.useLoaderData=r=>Yc({...r,from:this.id}),this.useNavigate=()=>ci({from:this.fullPath}),this.Link=U.forwardRef((r,n)=>l.jsx(Tg,{ref:n,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}}function oo(e){return new Tk(e)}class Ik extends Jw{constructor(t){super(t),this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({...r,from:this.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>li({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useParams=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Jc({...r,from:this.id}),this.useLoaderData=r=>Yc({...r,from:this.id}),this.useNavigate=()=>ci({from:this.fullPath}),this.Link=U.forwardRef((r,n)=>l.jsx(Tg,{ref:n,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}}function Mk(e){return new Ik(e)}function Pf(e){return typeof e=="object"?new Rf(e,{silent:!0}).createRoute(e):new Rf(e,{silent:!0}).createRoute}class Rf{constructor(t,r){this.path=t,this.createRoute=n=>{const s=oo(n);return s.isRoot=!1,s},this.silent=r==null?void 0:r.silent}}class Tf{constructor(t){this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.options.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({from:this.options.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>li({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.options.id}),this.useParams=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.options.id}),this.useLoaderDeps=r=>Jc({...r,from:this.options.id}),this.useLoaderData=r=>Yc({...r,from:this.options.id}),this.useNavigate=()=>{const r=Et();return ci({from:r.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function If(e){return typeof e=="object"?new Tf(e):t=>new Tf({id:e,...t})}function zk(){const e=Et(),t=x.useRef({router:e,mounted:!1}),[r,n]=x.useState(!1),{hasPendingMatches:s,isLoading:o}=St({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(p=>p.status==="pending")}),structuralSharing:!0}),a=Wi(o),i=o||r||s,u=Wi(i),c=o||s,d=Wi(c);return e.startTransition=f=>{n(!0),x.startTransition(()=>{f(),n(!1)})},x.useEffect(()=>{const f=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ar(e.latestLocation.publicHref)!==Ar(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{f()}},[e,e.history]),Lo(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(p){console.error(p)}})()},[e]),Lo(()=>{a&&!o&&e.emit({type:"onLoad",...Xr(e.state)})},[a,e,o]),Lo(()=>{d&&!c&&e.emit({type:"onBeforeRouteMount",...Xr(e.state)})},[c,d,e]),Lo(()=>{if(u&&!i){const f=Xr(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),f.hrefChanged&&Sw(e)}},[i,u,e]),null}function Ok(e){const t=St({select:r=>`not-found-${r.location.pathname}-${r.status}`});return l.jsx(Gc,{getResetKey:()=>t,onCatch:(r,n)=>{var s;if(ht(r))(s=e.onCatch)==null||s.call(e,r,n);else throw r},errorComponent:({error:r})=>{var n;if(ht(r))return(n=e.fallback)==null?void 0:n.call(e,r);throw r},children:e.children})}function Dk(){return l.jsx("p",{children:"Not Found"})}function $n(e){return l.jsx(l.Fragment,{children:e.children})}function Ig(e,t,r){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...r}):l.jsx(Dk,{})}function Lk(){return Et().isScrollRestoring,null}const Mg=x.memo(function({matchId:t}){var m,v;const r=Et(),n=St({select:y=>{var w;const b=y.matches.findIndex($=>$.id===t),_=y.matches[b];return Pr(_),{routeId:_.routeId,ssr:_.ssr,_displayPending:_._displayPending,resetKey:y.loadedAt,parentRouteId:(w=y.matches[b-1])==null?void 0:w.routeId}},structuralSharing:!0}),s=r.routesById[n.routeId],o=s.options.pendingComponent??r.options.defaultPendingComponent,a=o?l.jsx(o,{}):null,i=s.options.errorComponent??r.options.defaultErrorComponent,u=s.options.onCatch??r.options.defaultOnCatch,c=s.isRoot?s.options.notFoundComponent??((m=r.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,d=n.ssr===!1||n.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||d)&&(s.options.wrapInSuspense??o??(((v=s.options.errorComponent)==null?void 0:v.preload)||d))?x.Suspense:$n,p=i?Gc:$n,h=c?Ok:$n,g=s.isRoot?s.options.shellComponent??$n:$n;return l.jsxs(g,{children:[l.jsx(ai.Provider,{value:t,children:l.jsx(f,{fallback:a,children:l.jsx(p,{getResetKey:()=>n.resetKey,errorComponent:i||qc,onCatch:(y,b)=>{if(ht(y))throw y;u==null||u(y,b)},children:l.jsx(h,{fallback:y=>{if(!c||y.routeId&&y.routeId!==n.routeId||!y.routeId&&!s.isRoot)throw y;return x.createElement(c,y)},children:d||n._displayPending?l.jsx(ek,{fallback:a,children:l.jsx(Mf,{matchId:t})}):l.jsx(Mf,{matchId:t})})})})}),n.parentRouteId===Ct&&r.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(Fk,{}),l.jsx(Lk,{})]}):null]})});function Fk(){const e=Et(),t=x.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:r=>{r&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Xr(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Mf=x.memo(function({matchId:t}){var u,c,d,f;const r=Et(),{match:n,key:s,routeId:o}=St({select:p=>{const h=p.matches.find(b=>b.id===t),g=h.routeId,m=r.routesById[g].options.remountDeps??r.options.defaultRemountDeps,v=m==null?void 0:m({routeId:g,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:g,match:{id:h.id,status:h.status,error:h.error,invalid:h.invalid,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),a=r.routesById[o],i=x.useMemo(()=>{const p=a.options.component??r.options.defaultComponent;return p?l.jsx(p,{},s):l.jsx(ui,{})},[s,a.options.component,r.options.defaultComponent]);if(n._displayPending)throw(u=r.getMatch(n.id))==null?void 0:u._nonReactive.displayPendingPromise;if(n._forcePending)throw(c=r.getMatch(n.id))==null?void 0:c._nonReactive.minPendingPromise;if(n.status==="pending"){const p=a.options.pendingMinMs??r.options.defaultPendingMinMs;if(p){const h=r.getMatch(n.id);if(h&&!h._nonReactive.minPendingPromise){const g=Fn();h._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),h._nonReactive.minPendingPromise=void 0},p)}}throw(d=r.getMatch(n.id))==null?void 0:d._nonReactive.loadPromise}if(n.status==="notFound")return Pr(ht(n.error)),Ig(r,a,n.error);if(n.status==="redirected")throw Pr(yt(n.error)),(f=r.getMatch(n.id))==null?void 0:f._nonReactive.loadPromise;if(n.status==="error")throw n.error;return i}),ui=x.memo(function(){const t=Et(),r=x.useContext(ai),n=St({select:c=>{var d;return(d=c.matches.find(f=>f.id===r))==null?void 0:d.routeId}}),s=t.routesById[n],o=St({select:c=>{const f=c.matches.find(p=>p.id===r);return Pr(f),f.globalNotFound}}),a=St({select:c=>{var p;const d=c.matches,f=d.findIndex(h=>h.id===r);return(p=d[f+1])==null?void 0:p.id}}),i=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(o)return Ig(t,s,void 0);if(!a)return null;const u=l.jsx(Mg,{matchId:a});return n===Ct?l.jsx(x.Suspense,{fallback:i,children:u}):u});function Bk(){const e=Et(),r=e.routesById[Ct].options.pendingComponent??e.options.defaultPendingComponent,n=r?l.jsx(r,{}):null,s=typeof document<"u"&&e.ssr?$n:x.Suspense,o=l.jsxs(s,{fallback:n,children:[l.jsx(zk,{}),l.jsx(Uk,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:o}):o}function Uk(){const e=Et(),t=St({select:s=>{var o;return(o=s.matches[0])==null?void 0:o.id}}),r=St({select:s=>s.loadedAt}),n=t?l.jsx(Mg,{matchId:t}):null;return l.jsx(ai.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?n:l.jsx(Gc,{getResetKey:()=>r,errorComponent:qc,onCatch:void 0,children:n})})}const Vk=e=>new Wk(e);class Wk extends Uw{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Pf,globalThis.createLazyFileRoute=If):typeof window<"u"&&(window.createFileRoute=Pf,window.createLazyFileRoute=If);function Kk({router:e,children:t,...r}){Object.keys(r).length>0&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const n=l.jsx(Rg.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:n}):n}function Hk({router:e,...t}){return l.jsx(Kk,{router:e,...t,children:l.jsx(Bk,{})})}const Gk="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Pn(e,t,r){const n=r[0];if(t!=null&&e>=t)throw new Error(e+" >= "+t);if(e.slice(-1)===n||t&&t.slice(-1)===n)throw new Error("trailing zero");if(t){let a=0;for(;(e[a]||n)===t[a];)a++;if(a>0)return t.slice(0,a)+Pn(e.slice(a),t.slice(a),r)}const s=e?r.indexOf(e[0]):0,o=t!=null?r.indexOf(t[0]):r.length;if(o-s>1){const a=Math.round(.5*(s+o));return r[a]}else return t&&t.length>1?t.slice(0,1):r[s]+Pn(e.slice(1),null,r)}function zg(e){if(e.length!==Og(e[0]))throw new Error("invalid integer part of order key: "+e)}function Og(e){if(e>="a"&&e<="z")return e.charCodeAt(0)-97+2;if(e>="A"&&e<="Z")return 90-e.charCodeAt(0)+2;throw new Error("invalid order key head: "+e)}function Ps(e){const t=Og(e[0]);if(t>e.length)throw new Error("invalid order key: "+e);return e.slice(0,t)}function zf(e,t){if(e==="A"+t[0].repeat(26))throw new Error("invalid order key: "+e);const r=Ps(e);if(e.slice(r.length).slice(-1)===t[0])throw new Error("invalid order key: "+e)}function Of(e,t){zg(e);const[r,...n]=e.split("");let s=!0;for(let o=n.length-1;s&&o>=0;o--){const a=t.indexOf(n[o])+1;a===t.length?n[o]=t[0]:(n[o]=t[a],s=!1)}if(s){if(r==="Z")return"a"+t[0];if(r==="z")return null;const o=String.fromCharCode(r.charCodeAt(0)+1);return o>"a"?n.push(t[0]):n.pop(),o+n.join("")}else return r+n.join("")}function qk(e,t){zg(e);const[r,...n]=e.split("");let s=!0;for(let o=n.length-1;s&&o>=0;o--){const a=t.indexOf(n[o])-1;a===-1?n[o]=t.slice(-1):(n[o]=t[a],s=!1)}if(s){if(r==="a")return"Z"+t.slice(-1);if(r==="A")return null;const o=String.fromCharCode(r.charCodeAt(0)-1);return o<"Z"?n.push(t.slice(-1)):n.pop(),o+n.join("")}else return r+n.join("")}function Yk(e,t,r=Gk){if(e!=null&&zf(e,r),t!=null&&zf(t,r),e!=null&&t!=null&&e>=t)throw new Error(e+" >= "+t);if(e==null){if(t==null)return"a"+r[0];const u=Ps(t),c=t.slice(u.length);if(u==="A"+r[0].repeat(26))return u+Pn("",c,r);if(u<t)return u;const d=qk(u,r);if(d==null)throw new Error("cannot decrement any more");return d}if(t==null){const u=Ps(e),c=e.slice(u.length),d=Of(u,r);return d??u+Pn(c,null,r)}const n=Ps(e),s=e.slice(n.length),o=Ps(t),a=t.slice(o.length);if(n===o)return n+Pn(s,a,r);const i=Of(n,r);if(i==null)throw new Error("cannot increment any more");return i<t?i:n+Pn(s,null,r)}const Df=e=>{let t;const r=new Set,n=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(h=>h(t,p))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>u,subscribe:c=>(r.add(c),()=>r.delete(c))},u=t=e(n,s,i);return i},Jk=e=>e?Df(e):Df,Zk=e=>e;function Qk(e,t=Zk){const r=U.useSyncExternalStore(e.subscribe,U.useCallback(()=>t(e.getState()),[e,t]),U.useCallback(()=>t(e.getInitialState()),[e,t]));return U.useDebugValue(r),r}const Lf=e=>{const t=Jk(e),r=n=>Qk(t,n);return Object.assign(r,t),r},Xk=e=>e?Lf(e):Lf;function ur(e){return Array.isArray?Array.isArray(e):Fg(e)==="[object Array]"}function e_(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function t_(e){return e==null?"":e_(e)}function Ut(e){return typeof e=="string"}function Dg(e){return typeof e=="number"}function r_(e){return e===!0||e===!1||n_(e)&&Fg(e)=="[object Boolean]"}function Lg(e){return typeof e=="object"}function n_(e){return Lg(e)&&e!==null}function vt(e){return e!=null}function Gi(e){return!e.trim().length}function Fg(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const s_="Incorrect 'index' type",o_=e=>`Invalid value for key ${e}`,a_=e=>`Pattern length exceeds max of ${e}.`,i_=e=>`Missing ${e} property in key`,l_=e=>`Property 'weight' in key '${e}' must be a positive integer`,Ff=Object.prototype.hasOwnProperty;class c_{constructor(t){this._keys=[],this._keyMap={};let r=0;t.forEach(n=>{let s=Bg(n);this._keys.push(s),this._keyMap[s.id]=s,r+=s.weight}),this._keys.forEach(n=>{n.weight/=r})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Bg(e){let t=null,r=null,n=null,s=1,o=null;if(Ut(e)||ur(e))n=e,t=Bf(e),r=Gl(e);else{if(!Ff.call(e,"name"))throw new Error(i_("name"));const a=e.name;if(n=a,Ff.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(l_(a));t=Bf(a),r=Gl(a),o=e.getFn}return{path:t,id:r,weight:s,src:n,getFn:o}}function Bf(e){return ur(e)?e:e.split(".")}function Gl(e){return ur(e)?e.join("."):e}function u_(e,t){let r=[],n=!1;const s=(o,a,i)=>{if(vt(o))if(!a[i])r.push(o);else{let u=a[i];const c=o[u];if(!vt(c))return;if(i===a.length-1&&(Ut(c)||Dg(c)||r_(c)))r.push(t_(c));else if(ur(c)){n=!0;for(let d=0,f=c.length;d<f;d+=1)s(c[d],a,i+1)}else a.length&&s(c,a,i+1)}};return s(e,Ut(t)?t.split("."):t,0),n?r:r[0]}const d_={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},f_={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},h_={location:0,threshold:.6,distance:100},p_={useExtendedSearch:!1,getFn:u_,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var fe={...f_,...d_,...h_,...p_};const m_=/[^ ]+/g;function g_(e=1,t=3){const r=new Map,n=Math.pow(10,t);return{get(s){const o=s.match(m_).length;if(r.has(o))return r.get(o);const a=1/Math.pow(o,.5*e),i=parseFloat(Math.round(a*n)/n);return r.set(o,i),i},clear(){r.clear()}}}class Zc{constructor({getFn:t=fe.getFn,fieldNormWeight:r=fe.fieldNormWeight}={}){this.norm=g_(r,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((r,n)=>{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ut(this.docs[0])?this.docs.forEach((t,r)=>{this._addString(t,r)}):this.docs.forEach((t,r)=>{this._addObject(t,r)}),this.norm.clear())}add(t){const r=this.size();Ut(t)?this._addString(t,r):this._addObject(t,r)}removeAt(t){this.records.splice(t,1);for(let r=t,n=this.size();r<n;r+=1)this.records[r].i-=1}getValueForItemAtKeyId(t,r){return t[this._keysMap[r]]}size(){return this.records.length}_addString(t,r){if(!vt(t)||Gi(t))return;let n={v:t,i:r,n:this.norm.get(t)};this.records.push(n)}_addObject(t,r){let n={i:r,$:{}};this.keys.forEach((s,o)=>{let a=s.getFn?s.getFn(t):this.getFn(t,s.path);if(vt(a)){if(ur(a)){let i=[];const u=[{nestedArrIndex:-1,value:a}];for(;u.length;){const{nestedArrIndex:c,value:d}=u.pop();if(vt(d))if(Ut(d)&&!Gi(d)){let f={v:d,i:c,n:this.norm.get(d)};i.push(f)}else ur(d)&&d.forEach((f,p)=>{u.push({nestedArrIndex:p,value:f})})}n.$[o]=i}else if(Ut(a)&&!Gi(a)){let i={v:a,n:this.norm.get(a)};n.$[o]=i}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Ug(e,t,{getFn:r=fe.getFn,fieldNormWeight:n=fe.fieldNormWeight}={}){const s=new Zc({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(Bg)),s.setSources(t),s.create(),s}function v_(e,{getFn:t=fe.getFn,fieldNormWeight:r=fe.fieldNormWeight}={}){const{keys:n,records:s}=e,o=new Zc({getFn:t,fieldNormWeight:r});return o.setKeys(n),o.setIndexRecords(s),o}function Fo(e,{errors:t=0,currentLocation:r=0,expectedLocation:n=0,distance:s=fe.distance,ignoreLocation:o=fe.ignoreLocation}={}){const a=t/e.length;if(o)return a;const i=Math.abs(n-r);return s?a+i/s:i?1:a}function y_(e=[],t=fe.minMatchCharLength){let r=[],n=-1,s=-1,o=0;for(let a=e.length;o<a;o+=1){let i=e[o];i&&n===-1?n=o:!i&&n!==-1&&(s=o-1,s-n+1>=t&&r.push([n,s]),n=-1)}return e[o-1]&&o-n>=t&&r.push([n,o-1]),r}const Vr=32;function b_(e,t,r,{location:n=fe.location,distance:s=fe.distance,threshold:o=fe.threshold,findAllMatches:a=fe.findAllMatches,minMatchCharLength:i=fe.minMatchCharLength,includeMatches:u=fe.includeMatches,ignoreLocation:c=fe.ignoreLocation}={}){if(t.length>Vr)throw new Error(a_(Vr));const d=t.length,f=e.length,p=Math.max(0,Math.min(n,f));let h=o,g=p;const m=i>1||u,v=m?Array(f):[];let y;for(;(y=e.indexOf(t,g))>-1;){let M=Fo(t,{currentLocation:y,expectedLocation:p,distance:s,ignoreLocation:c});if(h=Math.min(M,h),g=y+d,m){let D=0;for(;D<d;)v[y+D]=1,D+=1}}g=-1;let b=[],_=1,w=d+f;const $=1<<d-1;for(let M=0;M<d;M+=1){let D=0,j=w;for(;D<j;)Fo(t,{errors:M,currentLocation:p+j,expectedLocation:p,distance:s,ignoreLocation:c})<=h?D=j:w=j,j=Math.floor((w-D)/2+D);w=j;let S=Math.max(1,p-j+1),E=a?f:Math.min(p+j,f)+d,P=Array(E+2);P[E+1]=(1<<M)-1;for(let G=E;G>=S;G-=1){let L=G-1,V=r[e.charAt(L)];if(m&&(v[L]=+!!V),P[G]=(P[G+1]<<1|1)&V,M&&(P[G]|=(b[G+1]|b[G])<<1|1|b[G+1]),P[G]&$&&(_=Fo(t,{errors:M,currentLocation:L,expectedLocation:p,distance:s,ignoreLocation:c}),_<=h)){if(h=_,g=L,g<=p)break;S=Math.max(1,2*p-g)}}if(Fo(t,{errors:M+1,currentLocation:p,expectedLocation:p,distance:s,ignoreLocation:c})>h)break;b=P}const R={isMatch:g>=0,score:Math.max(.001,_)};if(m){const M=y_(v,i);M.length?u&&(R.indices=M):R.isMatch=!1}return R}function x_(e){let t={};for(let r=0,n=e.length;r<n;r+=1){const s=e.charAt(r);t[s]=(t[s]||0)|1<<n-r-1}return t}const Sa=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class Vg{constructor(t,{location:r=fe.location,threshold:n=fe.threshold,distance:s=fe.distance,includeMatches:o=fe.includeMatches,findAllMatches:a=fe.findAllMatches,minMatchCharLength:i=fe.minMatchCharLength,isCaseSensitive:u=fe.isCaseSensitive,ignoreDiacritics:c=fe.ignoreDiacritics,ignoreLocation:d=fe.ignoreLocation}={}){if(this.options={location:r,threshold:n,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:u,ignoreDiacritics:c,ignoreLocation:d},t=u?t:t.toLowerCase(),t=c?Sa(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const f=(h,g)=>{this.chunks.push({pattern:h,alphabet:x_(h),startIndex:g})},p=this.pattern.length;if(p>Vr){let h=0;const g=p%Vr,m=p-g;for(;h<m;)f(this.pattern.substr(h,Vr),h),h+=Vr;if(g){const v=p-Vr;f(this.pattern.substr(v),v)}}else f(this.pattern,0)}searchIn(t){const{isCaseSensitive:r,ignoreDiacritics:n,includeMatches:s}=this.options;if(t=r?t:t.toLowerCase(),t=n?Sa(t):t,this.pattern===t){let m={isMatch:!0,score:0};return s&&(m.indices=[[0,t.length-1]]),m}const{location:o,distance:a,threshold:i,findAllMatches:u,minMatchCharLength:c,ignoreLocation:d}=this.options;let f=[],p=0,h=!1;this.chunks.forEach(({pattern:m,alphabet:v,startIndex:y})=>{const{isMatch:b,score:_,indices:w}=b_(t,m,v,{location:o+y,distance:a,threshold:i,findAllMatches:u,minMatchCharLength:c,includeMatches:s,ignoreLocation:d});b&&(h=!0),p+=_,b&&w&&(f=[...f,...w])});let g={isMatch:h,score:h?p/this.chunks.length:1};return h&&s&&(g.indices=f),g}}class Tr{constructor(t){this.pattern=t}static isMultiMatch(t){return Uf(t,this.multiRegex)}static isSingleMatch(t){return Uf(t,this.singleRegex)}search(){}}function Uf(e,t){const r=e.match(t);return r?r[1]:null}class w_ extends Tr{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const r=t===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class k_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class __ extends Tr{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const r=t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class C_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const r=!t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class $_ extends Tr{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const r=t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class S_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const r=!t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class Wg extends Tr{constructor(t,{location:r=fe.location,threshold:n=fe.threshold,distance:s=fe.distance,includeMatches:o=fe.includeMatches,findAllMatches:a=fe.findAllMatches,minMatchCharLength:i=fe.minMatchCharLength,isCaseSensitive:u=fe.isCaseSensitive,ignoreDiacritics:c=fe.ignoreDiacritics,ignoreLocation:d=fe.ignoreLocation}={}){super(t),this._bitapSearch=new Vg(t,{location:r,threshold:n,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:u,ignoreDiacritics:c,ignoreLocation:d})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Kg extends Tr{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let r=0,n;const s=[],o=this.pattern.length;for(;(n=t.indexOf(this.pattern,r))>-1;)r=n+o,s.push([n,r-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}}const ql=[w_,Kg,__,C_,S_,$_,k_,Wg],Vf=ql.length,j_=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,E_="|";function A_(e,t={}){return e.split(E_).map(r=>{let n=r.trim().split(j_).filter(o=>o&&!!o.trim()),s=[];for(let o=0,a=n.length;o<a;o+=1){const i=n[o];let u=!1,c=-1;for(;!u&&++c<Vf;){const d=ql[c];let f=d.isMultiMatch(i);f&&(s.push(new d(f,t)),u=!0)}if(!u)for(c=-1;++c<Vf;){const d=ql[c];let f=d.isSingleMatch(i);if(f){s.push(new d(f,t));break}}}return s})}const N_=new Set([Wg.type,Kg.type]);class P_{constructor(t,{isCaseSensitive:r=fe.isCaseSensitive,ignoreDiacritics:n=fe.ignoreDiacritics,includeMatches:s=fe.includeMatches,minMatchCharLength:o=fe.minMatchCharLength,ignoreLocation:a=fe.ignoreLocation,findAllMatches:i=fe.findAllMatches,location:u=fe.location,threshold:c=fe.threshold,distance:d=fe.distance}={}){this.query=null,this.options={isCaseSensitive:r,ignoreDiacritics:n,includeMatches:s,minMatchCharLength:o,findAllMatches:i,ignoreLocation:a,location:u,threshold:c,distance:d},t=r?t:t.toLowerCase(),t=n?Sa(t):t,this.pattern=t,this.query=A_(this.pattern,this.options)}static condition(t,r){return r.useExtendedSearch}searchIn(t){const r=this.query;if(!r)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:o}=this.options;t=s?t:t.toLowerCase(),t=o?Sa(t):t;let a=0,i=[],u=0;for(let c=0,d=r.length;c<d;c+=1){const f=r[c];i.length=0,a=0;for(let p=0,h=f.length;p<h;p+=1){const g=f[p],{isMatch:m,indices:v,score:y}=g.search(t);if(m){if(a+=1,u+=y,n){const b=g.constructor.type;N_.has(b)?i=[...i,...v]:i.push(v)}}else{u=0,a=0,i.length=0;break}}if(a){let p={isMatch:!0,score:u/a};return n&&(p.indices=i),p}}return{isMatch:!1,score:1}}}const Yl=[];function R_(...e){Yl.push(...e)}function Jl(e,t){for(let r=0,n=Yl.length;r<n;r+=1){let s=Yl[r];if(s.condition(e,t))return new s(e,t)}return new Vg(e,t)}const ja={AND:"$and",OR:"$or"},Zl={PATH:"$path",PATTERN:"$val"},Ql=e=>!!(e[ja.AND]||e[ja.OR]),T_=e=>!!e[Zl.PATH],I_=e=>!ur(e)&&Lg(e)&&!Ql(e),Wf=e=>({[ja.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Hg(e,t,{auto:r=!0}={}){const n=s=>{let o=Object.keys(s);const a=T_(s);if(!a&&o.length>1&&!Ql(s))return n(Wf(s));if(I_(s)){const u=a?s[Zl.PATH]:o[0],c=a?s[Zl.PATTERN]:s[u];if(!Ut(c))throw new Error(o_(u));const d={keyId:Gl(u),pattern:c};return r&&(d.searcher=Jl(c,t)),d}let i={children:[],operator:o[0]};return o.forEach(u=>{const c=s[u];ur(c)&&c.forEach(d=>{i.children.push(n(d))})}),i};return Ql(e)||(e=Wf(e)),n(e)}function M_(e,{ignoreFieldNorm:t=fe.ignoreFieldNorm}){e.forEach(r=>{let n=1;r.matches.forEach(({key:s,norm:o,score:a})=>{const i=s?s.weight:null;n*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(t?1:o))}),r.score=n})}function z_(e,t){const r=e.matches;t.matches=[],vt(r)&&r.forEach(n=>{if(!vt(n.indices)||!n.indices.length)return;const{indices:s,value:o}=n;let a={indices:s,value:o};n.key&&(a.key=n.key.src),n.idx>-1&&(a.refIndex=n.idx),t.matches.push(a)})}function O_(e,t){t.score=e.score}function D_(e,t,{includeMatches:r=fe.includeMatches,includeScore:n=fe.includeScore}={}){const s=[];return r&&s.push(z_),n&&s.push(O_),e.map(o=>{const{idx:a}=o,i={item:t[a],refIndex:a};return s.length&&s.forEach(u=>{u(o,i)}),i})}class Hn{constructor(t,r={},n){this.options={...fe,...r},this.options.useExtendedSearch,this._keyStore=new c_(this.options.keys),this.setCollection(t,n)}setCollection(t,r){if(this._docs=t,r&&!(r instanceof Zc))throw new Error(s_);this._myIndex=r||Ug(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){vt(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const r=[];for(let n=0,s=this._docs.length;n<s;n+=1){const o=this._docs[n];t(o,n)&&(this.removeAt(n),n-=1,s-=1,r.push(o))}return r}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:r=-1}={}){const{includeMatches:n,includeScore:s,shouldSort:o,sortFn:a,ignoreFieldNorm:i}=this.options;let u=Ut(t)?Ut(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return M_(u,{ignoreFieldNorm:i}),o&&u.sort(a),Dg(r)&&r>-1&&(u=u.slice(0,r)),D_(u,this._docs,{includeMatches:n,includeScore:s})}_searchStringList(t){const r=Jl(t,this.options),{records:n}=this._myIndex,s=[];return n.forEach(({v:o,i:a,n:i})=>{if(!vt(o))return;const{isMatch:u,score:c,indices:d}=r.searchIn(o);u&&s.push({item:o,idx:a,matches:[{score:c,value:o,norm:i,indices:d}]})}),s}_searchLogical(t){const r=Hg(t,this.options),n=(i,u,c)=>{if(!i.children){const{keyId:f,searcher:p}=i,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(u,f),searcher:p});return h&&h.length?[{idx:c,item:u,matches:h}]:[]}const d=[];for(let f=0,p=i.children.length;f<p;f+=1){const h=i.children[f],g=n(h,u,c);if(g.length)d.push(...g);else if(i.operator===ja.AND)return[]}return d},s=this._myIndex.records,o={},a=[];return s.forEach(({$:i,i:u})=>{if(vt(i)){let c=n(r,i,u);c.length&&(o[u]||(o[u]={idx:u,item:i,matches:[]},a.push(o[u])),c.forEach(({matches:d})=>{o[u].matches.push(...d)}))}}),a}_searchObjectList(t){const r=Jl(t,this.options),{keys:n,records:s}=this._myIndex,o=[];return s.forEach(({$:a,i})=>{if(!vt(a))return;let u=[];n.forEach((c,d)=>{u.push(...this._findMatches({key:c,value:a[d],searcher:r}))}),u.length&&o.push({idx:i,item:a,matches:u})}),o}_findMatches({key:t,value:r,searcher:n}){if(!vt(r))return[];let s=[];if(ur(r))r.forEach(({v:o,i:a,n:i})=>{if(!vt(o))return;const{isMatch:u,score:c,indices:d}=n.searchIn(o);u&&s.push({score:c,key:t,value:o,idx:a,norm:i,indices:d})});else{const{v:o,n:a}=r,{isMatch:i,score:u,indices:c}=n.searchIn(o);i&&s.push({score:u,key:t,value:o,norm:a,indices:c})}return s}}Hn.version="7.1.0";Hn.createIndex=Ug;Hn.parseIndex=v_;Hn.config=fe;Hn.parseQuery=Hg;R_(P_);function L_(e,t){return t.split(".").reduce((r,n)=>r!=null&&typeof r=="object"?r[n]:void 0,e)}function F_(e){return e.replace(/\\([\\"'])/g,"$1")}function Fs(e){const t={},r=e.replace(/meta\.([a-zA-Z0-9_.]+):\s*(?:"((?:\\.|[^"])*)"|'((?:\\.|[^'])*)'|(\S+))/g,(n,s,o,a,i)=>{const u=o??a??i??"";return t[s]=F_(u),""}).replace(/\s{2,}/g," ").trim();return{metaFilter:t,plainText:r}}function Xl(e){return e==null?[]:Array.isArray(e)?e.flatMap(t=>Xl(t)):typeof e=="object"?Object.values(e).flatMap(t=>Xl(t)):[String(e)]}function Xs(e){return e.toLowerCase().trim()}function Kf(e){return Xs(e).replace(/[^a-z0-9]+/g,"")}function Gg(e,t){const r=Xs(e),n=Xs(t);if(!n||r.includes(n))return!0;const s=Kf(e),o=Kf(t);if(o&&s.includes(o))return!0;const a=new Hn([{value:r},{value:s}],{keys:["value"],threshold:.4,ignoreLocation:!0,minMatchCharLength:o.length===1?1:2});return a.search(n).length>0||o.length>0&&a.search(o).length>0}function qg(e){return[e.content,e.id,e.assignee,...e.labels].filter(t=>typeof t=="string"&&t.length>0).join(`
25
+ */var oi=x,fk=dk;function hk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pk=typeof Object.is=="function"?Object.is:hk,mk=fk.useSyncExternalStore,gk=oi.useRef,vk=oi.useEffect,yk=oi.useMemo,bk=oi.useDebugValue;Ag.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var o=gk(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=yk(function(){function u(h){if(!c){if(c=!0,d=h,h=n(h),s!==void 0&&a.hasValue){var g=a.value;if(s(g,h))return f=g}return f=h}if(g=f,pk(d,h))return g;var m=n(h);return s!==void 0&&s(g,m)?(d=h,g):(d=h,f=m)}var c=!1,d,f,p=r===void 0?null:r;return[function(){return u(t())},p===null?void 0:function(){return u(p())}]},[t,r,n,s]);var i=mk(e,o[0],o[1]);return vk(function(){a.hasValue=!0,a.value=i},[i]),bk(i),i};Eg.exports=Ag;var xk=Eg.exports;function wk(e,t){return e===t}function kk(e,t,r=wk){const n=x.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:i}=e.subscribe(a);return i},[e]),s=x.useCallback(()=>e==null?void 0:e.get(),[e]);return xk.useSyncExternalStoreWithSelector(n,s,s,t,r)}const Rg=x.createContext(null);function Et(e){const t=x.useContext(Rg);return e==null||e.warn,t}function St(e){const t=Et({warn:(e==null?void 0:e.router)===void 0}),r=(e==null?void 0:e.router)||t,n=x.useRef(void 0);return kk(r.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??r.options.defaultStructuralSharing){const o=gt(n.current,e.select(s));return n.current=o,o}return e.select(s)}return s})}const ai=x.createContext(void 0),_k=x.createContext(void 0);function Ht(e){const t=x.useContext(e.from?_k:ai);return St({select:n=>{const s=n.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(Pr(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function Yc(e){return Ht({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Jc(e){const{select:t,...r}=e;return Ht({...r,select:n=>t?t(n.loaderDeps):n.loaderDeps})}function ii(e){return Ht({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function li(e){return Ht({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ci(e){const t=Et();return x.useCallback(r=>t.navigate({...r,from:r.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function Ck(e,t){const r=Et(),n=Qw(t),{activeProps:s,inactiveProps:o,activeOptions:a,to:i,preload:u,preloadDelay:c,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:h,viewTransition:g,children:m,target:v,disabled:y,style:b,className:_,onClick:w,onBlur:$,onFocus:R,onMouseEnter:M,onMouseLeave:D,onTouchStart:j,ignoreBlocker:S,params:E,search:P,hash:W,state:G,mask:L,reloadDocument:V,unsafeRelative:O,from:re,_fromLocation:J,...K}=e,A=jg(),Y=St({select:xe=>{const Se=xe.matches[xe.matches.length-1];return{search:Se==null?void 0:Se.search,hash:xe.location.hash,path:Se==null?void 0:Se.pathname}},structuralSharing:!0}),z=e.from,k=x.useMemo(()=>({...e,from:z}),[r,Y,z,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),C=x.useMemo(()=>r.buildLocation({...k}),[r,k]),N=C.maskedLocation?C.maskedLocation.publicHref:C.publicHref,B=C.maskedLocation?C.maskedLocation.external:C.external,H=x.useMemo(()=>Nk(N,B,r.history,y),[y,B,N,r.history]),te=x.useMemo(()=>{if(H!=null&&H.external)return xa(H.href,r.protocolAllowlist)?void 0:H.href;if(!Pk(i)&&!(typeof i!="string"||i.indexOf(":")===-1))try{return new URL(i),xa(i,r.protocolAllowlist)?void 0:i}catch{}},[i,H,r.protocolAllowlist]),se=St({select:xe=>{if(te)return!1;if(a!=null&&a.exact){if(!gw(xe.location.pathname,C.pathname,r.basepath))return!1}else{const Se=ka(xe.location.pathname,r.basepath),We=ka(C.pathname,r.basepath);if(!(Se.startsWith(We)&&(Se.length===We.length||Se[We.length]==="/")))return!1}return((a==null?void 0:a.includeSearch)??!0)&&!Qr(xe.location.search,C.search,{partial:!(a!=null&&a.exact),ignoreUndefined:!(a!=null&&a.explicitUndefined)})?!1:a!=null&&a.includeHash?A&&xe.location.hash===C.hash:!0}}),le=se?$r(s,{})??$k:Hi,me=se?Hi:$r(o,{})??Hi,I=[_,le.className,me.className].filter(Boolean).join(" "),ae=(b||le.style||me.style)&&{...b,...le.style,...me.style},[ce,ee]=x.useState(!1),de=x.useRef(!1),ge=e.reloadDocument||te?!1:u??r.options.defaultPreload,Ee=c??r.options.defaultPreloadDelay??0,Ce=x.useCallback(()=>{r.preloadRoute({...k,_builtLocation:C}).catch(xe=>{console.warn(xe),console.warn(Yw)})},[r,k,C]),Ie=x.useCallback(xe=>{xe!=null&&xe.isIntersecting&&Ce()},[Ce]);Zw(n,Ie,Ak,{disabled:!!y||ge!=="viewport"}),x.useEffect(()=>{de.current||!y&&ge==="render"&&(Ce(),de.current=!0)},[y,Ce,ge]);const Ge=xe=>{const Se=xe.currentTarget.getAttribute("target"),We=v!==void 0?v:Se;if(!y&&!Rk(xe)&&!xe.defaultPrevented&&(!We||We==="_self")&&xe.button===0){xe.preventDefault(),ag.flushSync(()=>{ee(!0)});const pt=r.subscribe("onResolved",()=>{pt(),ee(!1)});r.navigate({...k,replace:f,resetScroll:h,hashScrollIntoView:d,startTransition:p,viewTransition:g,ignoreBlocker:S})}};if(te)return{...K,ref:n,href:te,...m&&{children:m},...v&&{target:v},...y&&{disabled:y},...b&&{style:b},..._&&{className:_},...w&&{onClick:w},...$&&{onBlur:$},...R&&{onFocus:R},...M&&{onMouseEnter:M},...D&&{onMouseLeave:D},...j&&{onTouchStart:j}};const it=xe=>{if(y||ge!=="intent")return;if(!Ee){Ce();return}const Se=xe.currentTarget;if(ys.has(Se))return;const We=setTimeout(()=>{ys.delete(Se),Ce()},Ee);ys.set(Se,We)},wt=xe=>{y||ge!=="intent"||Ce()},kt=xe=>{if(y||!ge||!Ee)return;const Se=xe.currentTarget,We=ys.get(Se);We&&(clearTimeout(We),ys.delete(Se))};return{...K,...le,...me,href:H==null?void 0:H.href,ref:n,onClick:bn([w,Ge]),onBlur:bn([$,kt]),onFocus:bn([R,it]),onMouseEnter:bn([M,it]),onMouseLeave:bn([D,kt]),onTouchStart:bn([j,wt]),disabled:!!y,target:v,...ae&&{style:ae},...I&&{className:I},...y&&Sk,...se&&jk,...A&&ce&&Ek}}const Hi={},$k={className:"active"},Sk={role:"link","aria-disabled":!0},jk={"data-status":"active","aria-current":"page"},Ek={"data-transitioning":"transitioning"},ys=new WeakMap,Ak={rootMargin:"100px"},bn=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function Nk(e,t,r,n){if(!n)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function Pk(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Tg=x.forwardRef((e,t)=>{const{_asChild:r,...n}=e,{type:s,...o}=Ck(n,t),a=typeof n.children=="function"?n.children({isActive:o["data-status"]==="active"}):n.children;if(!r){const{disabled:i,...u}=o;return x.createElement("a",u,a)}return x.createElement(r,o,a)});function Rk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class Tk extends Sg{constructor(t){super(t),this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({...r,from:this.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>li({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useParams=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Jc({...r,from:this.id}),this.useLoaderData=r=>Yc({...r,from:this.id}),this.useNavigate=()=>ci({from:this.fullPath}),this.Link=U.forwardRef((r,n)=>l.jsx(Tg,{ref:n,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}}function oo(e){return new Tk(e)}class Ik extends Jw{constructor(t){super(t),this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({...r,from:this.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>li({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useParams=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Jc({...r,from:this.id}),this.useLoaderData=r=>Yc({...r,from:this.id}),this.useNavigate=()=>ci({from:this.fullPath}),this.Link=U.forwardRef((r,n)=>l.jsx(Tg,{ref:n,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}}function Mk(e){return new Ik(e)}function Pf(e){return typeof e=="object"?new Rf(e,{silent:!0}).createRoute(e):new Rf(e,{silent:!0}).createRoute}class Rf{constructor(t,r){this.path=t,this.createRoute=n=>{const s=oo(n);return s.isRoot=!1,s},this.silent=r==null?void 0:r.silent}}class Tf{constructor(t){this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.options.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({from:this.options.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>li({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.options.id}),this.useParams=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.options.id}),this.useLoaderDeps=r=>Jc({...r,from:this.options.id}),this.useLoaderData=r=>Yc({...r,from:this.options.id}),this.useNavigate=()=>{const r=Et();return ci({from:r.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function If(e){return typeof e=="object"?new Tf(e):t=>new Tf({id:e,...t})}function zk(){const e=Et(),t=x.useRef({router:e,mounted:!1}),[r,n]=x.useState(!1),{hasPendingMatches:s,isLoading:o}=St({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(p=>p.status==="pending")}),structuralSharing:!0}),a=Wi(o),i=o||r||s,u=Wi(i),c=o||s,d=Wi(c);return e.startTransition=f=>{n(!0),x.startTransition(()=>{f(),n(!1)})},x.useEffect(()=>{const f=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ar(e.latestLocation.publicHref)!==Ar(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{f()}},[e,e.history]),Lo(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(p){console.error(p)}})()},[e]),Lo(()=>{a&&!o&&e.emit({type:"onLoad",...Xr(e.state)})},[a,e,o]),Lo(()=>{d&&!c&&e.emit({type:"onBeforeRouteMount",...Xr(e.state)})},[c,d,e]),Lo(()=>{if(u&&!i){const f=Xr(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),f.hrefChanged&&Sw(e)}},[i,u,e]),null}function Ok(e){const t=St({select:r=>`not-found-${r.location.pathname}-${r.status}`});return l.jsx(Gc,{getResetKey:()=>t,onCatch:(r,n)=>{var s;if(ht(r))(s=e.onCatch)==null||s.call(e,r,n);else throw r},errorComponent:({error:r})=>{var n;if(ht(r))return(n=e.fallback)==null?void 0:n.call(e,r);throw r},children:e.children})}function Dk(){return l.jsx("p",{children:"Not Found"})}function $n(e){return l.jsx(l.Fragment,{children:e.children})}function Ig(e,t,r){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...r}):l.jsx(Dk,{})}function Lk(){return Et().isScrollRestoring,null}const Mg=x.memo(function({matchId:t}){var m,v;const r=Et(),n=St({select:y=>{var w;const b=y.matches.findIndex($=>$.id===t),_=y.matches[b];return Pr(_),{routeId:_.routeId,ssr:_.ssr,_displayPending:_._displayPending,resetKey:y.loadedAt,parentRouteId:(w=y.matches[b-1])==null?void 0:w.routeId}},structuralSharing:!0}),s=r.routesById[n.routeId],o=s.options.pendingComponent??r.options.defaultPendingComponent,a=o?l.jsx(o,{}):null,i=s.options.errorComponent??r.options.defaultErrorComponent,u=s.options.onCatch??r.options.defaultOnCatch,c=s.isRoot?s.options.notFoundComponent??((m=r.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,d=n.ssr===!1||n.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||d)&&(s.options.wrapInSuspense??o??(((v=s.options.errorComponent)==null?void 0:v.preload)||d))?x.Suspense:$n,p=i?Gc:$n,h=c?Ok:$n,g=s.isRoot?s.options.shellComponent??$n:$n;return l.jsxs(g,{children:[l.jsx(ai.Provider,{value:t,children:l.jsx(f,{fallback:a,children:l.jsx(p,{getResetKey:()=>n.resetKey,errorComponent:i||qc,onCatch:(y,b)=>{if(ht(y))throw y;u==null||u(y,b)},children:l.jsx(h,{fallback:y=>{if(!c||y.routeId&&y.routeId!==n.routeId||!y.routeId&&!s.isRoot)throw y;return x.createElement(c,y)},children:d||n._displayPending?l.jsx(ek,{fallback:a,children:l.jsx(Mf,{matchId:t})}):l.jsx(Mf,{matchId:t})})})})}),n.parentRouteId===Ct&&r.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(Fk,{}),l.jsx(Lk,{})]}):null]})});function Fk(){const e=Et(),t=x.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:r=>{r&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Xr(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Mf=x.memo(function({matchId:t}){var u,c,d,f;const r=Et(),{match:n,key:s,routeId:o}=St({select:p=>{const h=p.matches.find(b=>b.id===t),g=h.routeId,m=r.routesById[g].options.remountDeps??r.options.defaultRemountDeps,v=m==null?void 0:m({routeId:g,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:g,match:{id:h.id,status:h.status,error:h.error,invalid:h.invalid,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),a=r.routesById[o],i=x.useMemo(()=>{const p=a.options.component??r.options.defaultComponent;return p?l.jsx(p,{},s):l.jsx(ui,{})},[s,a.options.component,r.options.defaultComponent]);if(n._displayPending)throw(u=r.getMatch(n.id))==null?void 0:u._nonReactive.displayPendingPromise;if(n._forcePending)throw(c=r.getMatch(n.id))==null?void 0:c._nonReactive.minPendingPromise;if(n.status==="pending"){const p=a.options.pendingMinMs??r.options.defaultPendingMinMs;if(p){const h=r.getMatch(n.id);if(h&&!h._nonReactive.minPendingPromise){const g=Fn();h._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),h._nonReactive.minPendingPromise=void 0},p)}}throw(d=r.getMatch(n.id))==null?void 0:d._nonReactive.loadPromise}if(n.status==="notFound")return Pr(ht(n.error)),Ig(r,a,n.error);if(n.status==="redirected")throw Pr(yt(n.error)),(f=r.getMatch(n.id))==null?void 0:f._nonReactive.loadPromise;if(n.status==="error")throw n.error;return i}),ui=x.memo(function(){const t=Et(),r=x.useContext(ai),n=St({select:c=>{var d;return(d=c.matches.find(f=>f.id===r))==null?void 0:d.routeId}}),s=t.routesById[n],o=St({select:c=>{const f=c.matches.find(p=>p.id===r);return Pr(f),f.globalNotFound}}),a=St({select:c=>{var p;const d=c.matches,f=d.findIndex(h=>h.id===r);return(p=d[f+1])==null?void 0:p.id}}),i=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(o)return Ig(t,s,void 0);if(!a)return null;const u=l.jsx(Mg,{matchId:a});return n===Ct?l.jsx(x.Suspense,{fallback:i,children:u}):u});function Bk(){const e=Et(),r=e.routesById[Ct].options.pendingComponent??e.options.defaultPendingComponent,n=r?l.jsx(r,{}):null,s=typeof document<"u"&&e.ssr?$n:x.Suspense,o=l.jsxs(s,{fallback:n,children:[l.jsx(zk,{}),l.jsx(Uk,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:o}):o}function Uk(){const e=Et(),t=St({select:s=>{var o;return(o=s.matches[0])==null?void 0:o.id}}),r=St({select:s=>s.loadedAt}),n=t?l.jsx(Mg,{matchId:t}):null;return l.jsx(ai.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?n:l.jsx(Gc,{getResetKey:()=>r,errorComponent:qc,onCatch:void 0,children:n})})}const Vk=e=>new Wk(e);class Wk extends Uw{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Pf,globalThis.createLazyFileRoute=If):typeof window<"u"&&(window.createFileRoute=Pf,window.createLazyFileRoute=If);function Kk({router:e,children:t,...r}){Object.keys(r).length>0&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const n=l.jsx(Rg.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:n}):n}function Hk({router:e,...t}){return l.jsx(Kk,{router:e,...t,children:l.jsx(Bk,{})})}const Gk="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Pn(e,t,r){const n=r[0];if(t!=null&&e>=t)throw new Error(e+" >= "+t);if(e.slice(-1)===n||t&&t.slice(-1)===n)throw new Error("trailing zero");if(t){let a=0;for(;(e[a]||n)===t[a];)a++;if(a>0)return t.slice(0,a)+Pn(e.slice(a),t.slice(a),r)}const s=e?r.indexOf(e[0]):0,o=t!=null?r.indexOf(t[0]):r.length;if(o-s>1){const a=Math.round(.5*(s+o));return r[a]}else return t&&t.length>1?t.slice(0,1):r[s]+Pn(e.slice(1),null,r)}function zg(e){if(e.length!==Og(e[0]))throw new Error("invalid integer part of order key: "+e)}function Og(e){if(e>="a"&&e<="z")return e.charCodeAt(0)-97+2;if(e>="A"&&e<="Z")return 90-e.charCodeAt(0)+2;throw new Error("invalid order key head: "+e)}function Ps(e){const t=Og(e[0]);if(t>e.length)throw new Error("invalid order key: "+e);return e.slice(0,t)}function zf(e,t){if(e==="A"+t[0].repeat(26))throw new Error("invalid order key: "+e);const r=Ps(e);if(e.slice(r.length).slice(-1)===t[0])throw new Error("invalid order key: "+e)}function Of(e,t){zg(e);const[r,...n]=e.split("");let s=!0;for(let o=n.length-1;s&&o>=0;o--){const a=t.indexOf(n[o])+1;a===t.length?n[o]=t[0]:(n[o]=t[a],s=!1)}if(s){if(r==="Z")return"a"+t[0];if(r==="z")return null;const o=String.fromCharCode(r.charCodeAt(0)+1);return o>"a"?n.push(t[0]):n.pop(),o+n.join("")}else return r+n.join("")}function qk(e,t){zg(e);const[r,...n]=e.split("");let s=!0;for(let o=n.length-1;s&&o>=0;o--){const a=t.indexOf(n[o])-1;a===-1?n[o]=t.slice(-1):(n[o]=t[a],s=!1)}if(s){if(r==="a")return"Z"+t.slice(-1);if(r==="A")return null;const o=String.fromCharCode(r.charCodeAt(0)-1);return o<"Z"?n.push(t.slice(-1)):n.pop(),o+n.join("")}else return r+n.join("")}function Yk(e,t,r=Gk){if(e!=null&&zf(e,r),t!=null&&zf(t,r),e!=null&&t!=null&&e>=t)throw new Error(e+" >= "+t);if(e==null){if(t==null)return"a"+r[0];const u=Ps(t),c=t.slice(u.length);if(u==="A"+r[0].repeat(26))return u+Pn("",c,r);if(u<t)return u;const d=qk(u,r);if(d==null)throw new Error("cannot decrement any more");return d}if(t==null){const u=Ps(e),c=e.slice(u.length),d=Of(u,r);return d??u+Pn(c,null,r)}const n=Ps(e),s=e.slice(n.length),o=Ps(t),a=t.slice(o.length);if(n===o)return n+Pn(s,a,r);const i=Of(n,r);if(i==null)throw new Error("cannot increment any more");return i<t?i:n+Pn(s,null,r)}const Df=e=>{let t;const r=new Set,n=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(h=>h(t,p))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>u,subscribe:c=>(r.add(c),()=>r.delete(c))},u=t=e(n,s,i);return i},Jk=e=>e?Df(e):Df,Zk=e=>e;function Qk(e,t=Zk){const r=U.useSyncExternalStore(e.subscribe,U.useCallback(()=>t(e.getState()),[e,t]),U.useCallback(()=>t(e.getInitialState()),[e,t]));return U.useDebugValue(r),r}const Lf=e=>{const t=Jk(e),r=n=>Qk(t,n);return Object.assign(r,t),r},Xk=e=>e?Lf(e):Lf;function ur(e){return Array.isArray?Array.isArray(e):Fg(e)==="[object Array]"}function e_(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function t_(e){return e==null?"":e_(e)}function Ut(e){return typeof e=="string"}function Dg(e){return typeof e=="number"}function r_(e){return e===!0||e===!1||n_(e)&&Fg(e)=="[object Boolean]"}function Lg(e){return typeof e=="object"}function n_(e){return Lg(e)&&e!==null}function vt(e){return e!=null}function Gi(e){return!e.trim().length}function Fg(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const s_="Incorrect 'index' type",o_=e=>`Invalid value for key ${e}`,a_=e=>`Pattern length exceeds max of ${e}.`,i_=e=>`Missing ${e} property in key`,l_=e=>`Property 'weight' in key '${e}' must be a positive integer`,Ff=Object.prototype.hasOwnProperty;class c_{constructor(t){this._keys=[],this._keyMap={};let r=0;t.forEach(n=>{let s=Bg(n);this._keys.push(s),this._keyMap[s.id]=s,r+=s.weight}),this._keys.forEach(n=>{n.weight/=r})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Bg(e){let t=null,r=null,n=null,s=1,o=null;if(Ut(e)||ur(e))n=e,t=Bf(e),r=Gl(e);else{if(!Ff.call(e,"name"))throw new Error(i_("name"));const a=e.name;if(n=a,Ff.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(l_(a));t=Bf(a),r=Gl(a),o=e.getFn}return{path:t,id:r,weight:s,src:n,getFn:o}}function Bf(e){return ur(e)?e:e.split(".")}function Gl(e){return ur(e)?e.join("."):e}function u_(e,t){let r=[],n=!1;const s=(o,a,i)=>{if(vt(o))if(!a[i])r.push(o);else{let u=a[i];const c=o[u];if(!vt(c))return;if(i===a.length-1&&(Ut(c)||Dg(c)||r_(c)))r.push(t_(c));else if(ur(c)){n=!0;for(let d=0,f=c.length;d<f;d+=1)s(c[d],a,i+1)}else a.length&&s(c,a,i+1)}};return s(e,Ut(t)?t.split("."):t,0),n?r:r[0]}const d_={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},f_={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},h_={location:0,threshold:.6,distance:100},p_={useExtendedSearch:!1,getFn:u_,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var fe={...f_,...d_,...h_,...p_};const m_=/[^ ]+/g;function g_(e=1,t=3){const r=new Map,n=Math.pow(10,t);return{get(s){const o=s.match(m_).length;if(r.has(o))return r.get(o);const a=1/Math.pow(o,.5*e),i=parseFloat(Math.round(a*n)/n);return r.set(o,i),i},clear(){r.clear()}}}class Zc{constructor({getFn:t=fe.getFn,fieldNormWeight:r=fe.fieldNormWeight}={}){this.norm=g_(r,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((r,n)=>{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ut(this.docs[0])?this.docs.forEach((t,r)=>{this._addString(t,r)}):this.docs.forEach((t,r)=>{this._addObject(t,r)}),this.norm.clear())}add(t){const r=this.size();Ut(t)?this._addString(t,r):this._addObject(t,r)}removeAt(t){this.records.splice(t,1);for(let r=t,n=this.size();r<n;r+=1)this.records[r].i-=1}getValueForItemAtKeyId(t,r){return t[this._keysMap[r]]}size(){return this.records.length}_addString(t,r){if(!vt(t)||Gi(t))return;let n={v:t,i:r,n:this.norm.get(t)};this.records.push(n)}_addObject(t,r){let n={i:r,$:{}};this.keys.forEach((s,o)=>{let a=s.getFn?s.getFn(t):this.getFn(t,s.path);if(vt(a)){if(ur(a)){let i=[];const u=[{nestedArrIndex:-1,value:a}];for(;u.length;){const{nestedArrIndex:c,value:d}=u.pop();if(vt(d))if(Ut(d)&&!Gi(d)){let f={v:d,i:c,n:this.norm.get(d)};i.push(f)}else ur(d)&&d.forEach((f,p)=>{u.push({nestedArrIndex:p,value:f})})}n.$[o]=i}else if(Ut(a)&&!Gi(a)){let i={v:a,n:this.norm.get(a)};n.$[o]=i}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Ug(e,t,{getFn:r=fe.getFn,fieldNormWeight:n=fe.fieldNormWeight}={}){const s=new Zc({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(Bg)),s.setSources(t),s.create(),s}function v_(e,{getFn:t=fe.getFn,fieldNormWeight:r=fe.fieldNormWeight}={}){const{keys:n,records:s}=e,o=new Zc({getFn:t,fieldNormWeight:r});return o.setKeys(n),o.setIndexRecords(s),o}function Fo(e,{errors:t=0,currentLocation:r=0,expectedLocation:n=0,distance:s=fe.distance,ignoreLocation:o=fe.ignoreLocation}={}){const a=t/e.length;if(o)return a;const i=Math.abs(n-r);return s?a+i/s:i?1:a}function y_(e=[],t=fe.minMatchCharLength){let r=[],n=-1,s=-1,o=0;for(let a=e.length;o<a;o+=1){let i=e[o];i&&n===-1?n=o:!i&&n!==-1&&(s=o-1,s-n+1>=t&&r.push([n,s]),n=-1)}return e[o-1]&&o-n>=t&&r.push([n,o-1]),r}const Vr=32;function b_(e,t,r,{location:n=fe.location,distance:s=fe.distance,threshold:o=fe.threshold,findAllMatches:a=fe.findAllMatches,minMatchCharLength:i=fe.minMatchCharLength,includeMatches:u=fe.includeMatches,ignoreLocation:c=fe.ignoreLocation}={}){if(t.length>Vr)throw new Error(a_(Vr));const d=t.length,f=e.length,p=Math.max(0,Math.min(n,f));let h=o,g=p;const m=i>1||u,v=m?Array(f):[];let y;for(;(y=e.indexOf(t,g))>-1;){let M=Fo(t,{currentLocation:y,expectedLocation:p,distance:s,ignoreLocation:c});if(h=Math.min(M,h),g=y+d,m){let D=0;for(;D<d;)v[y+D]=1,D+=1}}g=-1;let b=[],_=1,w=d+f;const $=1<<d-1;for(let M=0;M<d;M+=1){let D=0,j=w;for(;D<j;)Fo(t,{errors:M,currentLocation:p+j,expectedLocation:p,distance:s,ignoreLocation:c})<=h?D=j:w=j,j=Math.floor((w-D)/2+D);w=j;let S=Math.max(1,p-j+1),E=a?f:Math.min(p+j,f)+d,P=Array(E+2);P[E+1]=(1<<M)-1;for(let G=E;G>=S;G-=1){let L=G-1,V=r[e.charAt(L)];if(m&&(v[L]=+!!V),P[G]=(P[G+1]<<1|1)&V,M&&(P[G]|=(b[G+1]|b[G])<<1|1|b[G+1]),P[G]&$&&(_=Fo(t,{errors:M,currentLocation:L,expectedLocation:p,distance:s,ignoreLocation:c}),_<=h)){if(h=_,g=L,g<=p)break;S=Math.max(1,2*p-g)}}if(Fo(t,{errors:M+1,currentLocation:p,expectedLocation:p,distance:s,ignoreLocation:c})>h)break;b=P}const R={isMatch:g>=0,score:Math.max(.001,_)};if(m){const M=y_(v,i);M.length?u&&(R.indices=M):R.isMatch=!1}return R}function x_(e){let t={};for(let r=0,n=e.length;r<n;r+=1){const s=e.charAt(r);t[s]=(t[s]||0)|1<<n-r-1}return t}const Sa=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class Vg{constructor(t,{location:r=fe.location,threshold:n=fe.threshold,distance:s=fe.distance,includeMatches:o=fe.includeMatches,findAllMatches:a=fe.findAllMatches,minMatchCharLength:i=fe.minMatchCharLength,isCaseSensitive:u=fe.isCaseSensitive,ignoreDiacritics:c=fe.ignoreDiacritics,ignoreLocation:d=fe.ignoreLocation}={}){if(this.options={location:r,threshold:n,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:u,ignoreDiacritics:c,ignoreLocation:d},t=u?t:t.toLowerCase(),t=c?Sa(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const f=(h,g)=>{this.chunks.push({pattern:h,alphabet:x_(h),startIndex:g})},p=this.pattern.length;if(p>Vr){let h=0;const g=p%Vr,m=p-g;for(;h<m;)f(this.pattern.substr(h,Vr),h),h+=Vr;if(g){const v=p-Vr;f(this.pattern.substr(v),v)}}else f(this.pattern,0)}searchIn(t){const{isCaseSensitive:r,ignoreDiacritics:n,includeMatches:s}=this.options;if(t=r?t:t.toLowerCase(),t=n?Sa(t):t,this.pattern===t){let m={isMatch:!0,score:0};return s&&(m.indices=[[0,t.length-1]]),m}const{location:o,distance:a,threshold:i,findAllMatches:u,minMatchCharLength:c,ignoreLocation:d}=this.options;let f=[],p=0,h=!1;this.chunks.forEach(({pattern:m,alphabet:v,startIndex:y})=>{const{isMatch:b,score:_,indices:w}=b_(t,m,v,{location:o+y,distance:a,threshold:i,findAllMatches:u,minMatchCharLength:c,includeMatches:s,ignoreLocation:d});b&&(h=!0),p+=_,b&&w&&(f=[...f,...w])});let g={isMatch:h,score:h?p/this.chunks.length:1};return h&&s&&(g.indices=f),g}}class Tr{constructor(t){this.pattern=t}static isMultiMatch(t){return Uf(t,this.multiRegex)}static isSingleMatch(t){return Uf(t,this.singleRegex)}search(){}}function Uf(e,t){const r=e.match(t);return r?r[1]:null}class w_ extends Tr{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const r=t===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class k_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class __ extends Tr{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const r=t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class C_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const r=!t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class $_ extends Tr{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const r=t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class S_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const r=!t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class Wg extends Tr{constructor(t,{location:r=fe.location,threshold:n=fe.threshold,distance:s=fe.distance,includeMatches:o=fe.includeMatches,findAllMatches:a=fe.findAllMatches,minMatchCharLength:i=fe.minMatchCharLength,isCaseSensitive:u=fe.isCaseSensitive,ignoreDiacritics:c=fe.ignoreDiacritics,ignoreLocation:d=fe.ignoreLocation}={}){super(t),this._bitapSearch=new Vg(t,{location:r,threshold:n,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:u,ignoreDiacritics:c,ignoreLocation:d})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Kg extends Tr{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let r=0,n;const s=[],o=this.pattern.length;for(;(n=t.indexOf(this.pattern,r))>-1;)r=n+o,s.push([n,r-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}}const ql=[w_,Kg,__,C_,S_,$_,k_,Wg],Vf=ql.length,j_=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,E_="|";function A_(e,t={}){return e.split(E_).map(r=>{let n=r.trim().split(j_).filter(o=>o&&!!o.trim()),s=[];for(let o=0,a=n.length;o<a;o+=1){const i=n[o];let u=!1,c=-1;for(;!u&&++c<Vf;){const d=ql[c];let f=d.isMultiMatch(i);f&&(s.push(new d(f,t)),u=!0)}if(!u)for(c=-1;++c<Vf;){const d=ql[c];let f=d.isSingleMatch(i);if(f){s.push(new d(f,t));break}}}return s})}const N_=new Set([Wg.type,Kg.type]);class P_{constructor(t,{isCaseSensitive:r=fe.isCaseSensitive,ignoreDiacritics:n=fe.ignoreDiacritics,includeMatches:s=fe.includeMatches,minMatchCharLength:o=fe.minMatchCharLength,ignoreLocation:a=fe.ignoreLocation,findAllMatches:i=fe.findAllMatches,location:u=fe.location,threshold:c=fe.threshold,distance:d=fe.distance}={}){this.query=null,this.options={isCaseSensitive:r,ignoreDiacritics:n,includeMatches:s,minMatchCharLength:o,findAllMatches:i,ignoreLocation:a,location:u,threshold:c,distance:d},t=r?t:t.toLowerCase(),t=n?Sa(t):t,this.pattern=t,this.query=A_(this.pattern,this.options)}static condition(t,r){return r.useExtendedSearch}searchIn(t){const r=this.query;if(!r)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:o}=this.options;t=s?t:t.toLowerCase(),t=o?Sa(t):t;let a=0,i=[],u=0;for(let c=0,d=r.length;c<d;c+=1){const f=r[c];i.length=0,a=0;for(let p=0,h=f.length;p<h;p+=1){const g=f[p],{isMatch:m,indices:v,score:y}=g.search(t);if(m){if(a+=1,u+=y,n){const b=g.constructor.type;N_.has(b)?i=[...i,...v]:i.push(v)}}else{u=0,a=0,i.length=0;break}}if(a){let p={isMatch:!0,score:u/a};return n&&(p.indices=i),p}}return{isMatch:!1,score:1}}}const Yl=[];function R_(...e){Yl.push(...e)}function Jl(e,t){for(let r=0,n=Yl.length;r<n;r+=1){let s=Yl[r];if(s.condition(e,t))return new s(e,t)}return new Vg(e,t)}const ja={AND:"$and",OR:"$or"},Zl={PATH:"$path",PATTERN:"$val"},Ql=e=>!!(e[ja.AND]||e[ja.OR]),T_=e=>!!e[Zl.PATH],I_=e=>!ur(e)&&Lg(e)&&!Ql(e),Wf=e=>({[ja.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Hg(e,t,{auto:r=!0}={}){const n=s=>{let o=Object.keys(s);const a=T_(s);if(!a&&o.length>1&&!Ql(s))return n(Wf(s));if(I_(s)){const u=a?s[Zl.PATH]:o[0],c=a?s[Zl.PATTERN]:s[u];if(!Ut(c))throw new Error(o_(u));const d={keyId:Gl(u),pattern:c};return r&&(d.searcher=Jl(c,t)),d}let i={children:[],operator:o[0]};return o.forEach(u=>{const c=s[u];ur(c)&&c.forEach(d=>{i.children.push(n(d))})}),i};return Ql(e)||(e=Wf(e)),n(e)}function M_(e,{ignoreFieldNorm:t=fe.ignoreFieldNorm}){e.forEach(r=>{let n=1;r.matches.forEach(({key:s,norm:o,score:a})=>{const i=s?s.weight:null;n*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(t?1:o))}),r.score=n})}function z_(e,t){const r=e.matches;t.matches=[],vt(r)&&r.forEach(n=>{if(!vt(n.indices)||!n.indices.length)return;const{indices:s,value:o}=n;let a={indices:s,value:o};n.key&&(a.key=n.key.src),n.idx>-1&&(a.refIndex=n.idx),t.matches.push(a)})}function O_(e,t){t.score=e.score}function D_(e,t,{includeMatches:r=fe.includeMatches,includeScore:n=fe.includeScore}={}){const s=[];return r&&s.push(z_),n&&s.push(O_),e.map(o=>{const{idx:a}=o,i={item:t[a],refIndex:a};return s.length&&s.forEach(u=>{u(o,i)}),i})}class Hn{constructor(t,r={},n){this.options={...fe,...r},this.options.useExtendedSearch,this._keyStore=new c_(this.options.keys),this.setCollection(t,n)}setCollection(t,r){if(this._docs=t,r&&!(r instanceof Zc))throw new Error(s_);this._myIndex=r||Ug(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){vt(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const r=[];for(let n=0,s=this._docs.length;n<s;n+=1){const o=this._docs[n];t(o,n)&&(this.removeAt(n),n-=1,s-=1,r.push(o))}return r}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:r=-1}={}){const{includeMatches:n,includeScore:s,shouldSort:o,sortFn:a,ignoreFieldNorm:i}=this.options;let u=Ut(t)?Ut(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return M_(u,{ignoreFieldNorm:i}),o&&u.sort(a),Dg(r)&&r>-1&&(u=u.slice(0,r)),D_(u,this._docs,{includeMatches:n,includeScore:s})}_searchStringList(t){const r=Jl(t,this.options),{records:n}=this._myIndex,s=[];return n.forEach(({v:o,i:a,n:i})=>{if(!vt(o))return;const{isMatch:u,score:c,indices:d}=r.searchIn(o);u&&s.push({item:o,idx:a,matches:[{score:c,value:o,norm:i,indices:d}]})}),s}_searchLogical(t){const r=Hg(t,this.options),n=(i,u,c)=>{if(!i.children){const{keyId:f,searcher:p}=i,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(u,f),searcher:p});return h&&h.length?[{idx:c,item:u,matches:h}]:[]}const d=[];for(let f=0,p=i.children.length;f<p;f+=1){const h=i.children[f],g=n(h,u,c);if(g.length)d.push(...g);else if(i.operator===ja.AND)return[]}return d},s=this._myIndex.records,o={},a=[];return s.forEach(({$:i,i:u})=>{if(vt(i)){let c=n(r,i,u);c.length&&(o[u]||(o[u]={idx:u,item:i,matches:[]},a.push(o[u])),c.forEach(({matches:d})=>{o[u].matches.push(...d)}))}}),a}_searchObjectList(t){const r=Jl(t,this.options),{keys:n,records:s}=this._myIndex,o=[];return s.forEach(({$:a,i})=>{if(!vt(a))return;let u=[];n.forEach((c,d)=>{u.push(...this._findMatches({key:c,value:a[d],searcher:r}))}),u.length&&o.push({idx:i,item:a,matches:u})}),o}_findMatches({key:t,value:r,searcher:n}){if(!vt(r))return[];let s=[];if(ur(r))r.forEach(({v:o,i:a,n:i})=>{if(!vt(o))return;const{isMatch:u,score:c,indices:d}=n.searchIn(o);u&&s.push({score:c,key:t,value:o,idx:a,norm:i,indices:d})});else{const{v:o,n:a}=r,{isMatch:i,score:u,indices:c}=n.searchIn(o);i&&s.push({score:u,key:t,value:o,norm:a,indices:c})}return s}}Hn.version="7.1.0";Hn.createIndex=Ug;Hn.parseIndex=v_;Hn.config=fe;Hn.parseQuery=Hg;R_(P_);function L_(e,t){return t.split(".").reduce((r,n)=>r!=null&&typeof r=="object"?r[n]:void 0,e)}function F_(e){return e.replace(/\\([\\"'])/g,"$1")}function Fs(e){const t={},r=e.replace(/meta\.([a-zA-Z0-9_.]+):\s*(?:"((?:\\.|[^"])*)"|'((?:\\.|[^'])*)'|(\S+))/g,(n,s,o,a,i)=>{const u=o??a??i??"";return t[s]=F_(u),""}).replace(/\s{2,}/g," ").trim();return{metaFilter:t,plainText:r}}function Xl(e){return e==null?[]:Array.isArray(e)?e.flatMap(t=>Xl(t)):typeof e=="object"?Object.values(e).flatMap(t=>Xl(t)):[String(e)]}function Xs(e){return e.toLowerCase().trim()}function Kf(e){return Xs(e).replace(/[^a-z0-9]+/g,"")}function Gg(e,t){const r=Xs(e),n=Xs(t);if(!n||r.includes(n))return!0;const s=Kf(e),o=Kf(t);if(o&&s.includes(o))return!0;const a=new Hn([{value:r},{value:s}],{keys:["value"],threshold:.4,ignoreLocation:!0,minMatchCharLength:o.length===1?1:2});return a.search(n).length>0||o.length>0&&a.search(o).length>0}function qg(e){return[e.content,e.id,e.assignee,...e.labels].filter(t=>typeof t=="string"&&t.length>0).join(`
26
26
  `)}function B_(e){const t=Xl(e.metadata);return[qg(e),...t].filter(r=>r.length>0).join(`
27
27
  `)}function U_(e,t){const r=Xs(t);return r?qg(e).toLowerCase().includes(r):!0}function V_(e,t){return Xs(t)?Gg(B_(e),t):!0}function W_(e,t,r=!1){if(Object.keys(t).length===0)return!0;if(!e)return!1;for(const[n,s]of Object.entries(t)){const o=L_(e,n);if(o==null)return!1;const a=String(o);if(!a.toLowerCase().includes(s.toLowerCase())&&(!r||!Gg(a,s)))return!1}return!0}function K_(e,t,r={},n=!1){const{metaFilter:s,plainText:o}=Fs(t||""),a={...r,...s};return W_(e.metadata,a,n)?o?n?V_(e,o):U_(e,o):!0:!1}function Yg(e){const t=e.match(/^#\s+(.+)$/m);return t?t[1].trim():e.split(`
28
- `).map(n=>n.trim()).find(n=>n.length>0)||"Untitled"}function H_(e,t){if(!(!e||!t.trim()))return t.split(".").reduce((r,n)=>{if(!(r==null||typeof r!="object"))return r[n]},e)}function Jg(e){if(e==null)return null;if(typeof e=="string"){const t=e.trim();return t.length>0?t:null}if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);if(Array.isArray(e)){const t=e.map(r=>Jg(r)).filter(r=>!!r);return t.length>0?t.join(", "):null}if(typeof e=="object"){const t=JSON.stringify(e);return t&&t!=="{}"&&t!=="[]"?t:null}return null}function Zg(e,t,r){const n=Yg(e);if(!r||r.length===0)return n;const s=r.map(o=>Jg(H_(t,o))).filter(o=>!!o);return s.length>0?`${s.join(" ")} ${n}`:n}function G_(e){return e.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,50)||"card"}function Qg(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return t?t.split(/\s+/).filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" "):e}const Gn="deleted",bs={id:Gn,name:"Deleted",color:"#ef4444"},q_=["aurora","sunset","meadow","nebula","lagoon","candy","ember","violet"],Y_=["paper","mist","sand"],J_="fancy",Z_="aurora",Q_="paper";function X_(e){return e==="plain"?Q_:Z_}function eC(e,t){return e==="plain"?Y_.includes(t):q_.includes(t)}function Ea(e,t){const r=e??J_,n=t&&eC(r,t)?t:X_(r);return{boardBackgroundMode:r,boardBackgroundPreset:n}}const ec=[{name:"red",hex:"#e11d48"},{name:"orange",hex:"#ea580c"},{name:"amber",hex:"#d97706"},{name:"yellow",hex:"#ca8a04"},{name:"lime",hex:"#65a30d"},{name:"green",hex:"#16a34a"},{name:"teal",hex:"#0d9488"},{name:"cyan",hex:"#0891b2"},{name:"blue",hex:"#2563eb"},{name:"indigo",hex:"#4f46e5"},{name:"violet",hex:"#7c3aed"},{name:"pink",hex:"#db2777"}],tC=20,rC=80,Qc=50;function sa(e){return Number.isFinite(e)?Math.max(tC,Math.min(rC,e)):Qc}function nC(e,t){return!Number.isFinite(t)||t<=0?Qc:sa((t-e)/t*100)}function sC(e){let t=!1,r=Qc;const n=c=>(r=nC(c,e.getViewportWidth()),r),s=c=>{t&&e.onPreview(n(c.clientX))},o=()=>{e.eventTarget.removeEventListener("pointermove",s),e.eventTarget.removeEventListener("pointerup",i),e.eventTarget.removeEventListener("pointercancel",u)},a=()=>{t&&(t=!1,o())},i=c=>{if(!t)return;const d=n(c.clientX);a(),e.onCommit(d)},u=()=>{t&&(a(),e.onCancel())};return{start(c){return(e.getPanelMode()??"drawer")!=="drawer"?!1:(a(),t=!0,e.eventTarget.addEventListener("pointermove",s),e.eventTarget.addEventListener("pointerup",i),e.eventTarget.addEventListener("pointercancel",u),e.onPreview(n(c.clientX)),!0)},cancel(){u()},dispose(){u()},isActive(){return t}}}const oC=["write","preview","comments","logs"],Aa="preview",tc="form:";function rc(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Xg(e){return oC.includes(e)}function e0(e){return e.startsWith(tc)&&e.length>tc.length}function t0(e){return Xg(e)||e0(e)}function nc(e){return`${tc}${e}`}function aC(e){return t0(e)?e:Aa}function iC(e,t){var r;return rc(e.schema)?!0:!!(e.name&&(t!=null&&t.forms)&&rc((r=t.forms[e.name])==null?void 0:r.schema))}function lC(e,t){const r=(e==null?void 0:e.forms)??[];if(r.length===0)return[];const n=new Set;return r.flatMap((s,o)=>{if(!iC(s,t))return[];const a=rc(s.schema)?s.schema:void 0,i=s.name??(a&&typeof a.title=="string"&&a.title.trim().length>0?G_(a.title):`form-${o}`);let u=i||`form-${o}`,c=2;for(;n.has(u);)u=`${i}-${c++}`;return n.add(u),[nc(u)]})}function Sn(e,t,r){const n=aC(e);return!t||Xg(n)||e0(n)&&lC(t,r).includes(n)?n:Aa}function xs(e,t){return e.find(r=>r.id===t)}const cC={hiddenColumnIds:[],minimizedColumnIds:[]};function sc(e){const t=Array.from(new Set((e==null?void 0:e.hiddenColumnIds)??[])),r=new Set(t);return{hiddenColumnIds:t,minimizedColumnIds:Array.from(new Set((e==null?void 0:e.minimizedColumnIds)??[])).filter(n=>!r.has(n))}}function oc(e,t){const r=new Set(t);return sc({hiddenColumnIds:e.hiddenColumnIds.filter(n=>r.has(n)),minimizedColumnIds:e.minimizedColumnIds.filter(n=>r.has(n))})}function uC(e){return e.hiddenColumnIds.length>0||e.minimizedColumnIds.length>0}function jn(e,t){return e[t]??cC}function Rs(e,t,r){return uC(r)?{...e,[t]:r}:t in e?Object.fromEntries(Object.entries(e).filter(([n])=>n!==t)):e}function dC(e,t){return e.hiddenColumnIds.length===t.hiddenColumnIds.length&&e.minimizedColumnIds.length===t.minimizedColumnIds.length&&e.hiddenColumnIds.every((r,n)=>r===t.hiddenColumnIds[n])&&e.minimizedColumnIds.every((r,n)=>r===t.minimizedColumnIds[n])}function Hf(e,t,r){const n=jn(e,t),s=oc(n,r);return dC(n,s)?e:Rs(e,t,s)}const fC=()=>typeof document<"u"?document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast"):!1,hC=e=>{const t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},pC=e=>{const t=new Date,r=new Date(t);r.setDate(t.getDate()-t.getDay()),r.setHours(0,0,0,0);const n=new Date(r);return n.setDate(r.getDate()+7),e>=r&&e<n},mC=e=>{const t=new Date;return t.setHours(0,0,0,0),e<t};function gC(e){const t=e.trim().replace(/\s+/g," ");return t?/\s/.test(t)?JSON.stringify(t):t:""}function qi(e,t){const r=Object.entries(t).map(([n,s])=>[n.trim(),s.trim()]).filter(([n,s])=>n.length>0&&s.length>0).map(([n,s])=>`meta.${n}: ${gC(s)}`);return[e.trim(),...r].filter(Boolean).join(" ").trim()}const q=Xk((e,t)=>({cards:[],columns:[],boards:[],columnVisibilityByBoard:{},currentBoard:"default",isDarkMode:fC(),searchQuery:"",fuzzySearch:!1,priorityFilter:"all",assigneeFilter:"all",labelFilter:[],dueDateFilter:"all",columnSorts:{},layout:"horizontal",workspace:null,cardSettings:{showPriorityBadges:!0,showAssignee:!0,showDueDate:!0,showLabels:!0,showBuildWithAI:!0,showFileName:!1,compactMode:!1,markdownEditorMode:!1,showDeletedColumn:!1,defaultPriority:"medium",defaultStatus:"backlog",boardZoom:100,cardZoom:100,boardBackgroundMode:"fancy",boardBackgroundPreset:"aurora",panelMode:"drawer",drawerWidth:50},drawerWidthPreview:null,effectiveDrawerWidth:50,settingsOpen:!1,labelDefs:{},activeCardId:null,activeCardTab:Aa,selectedCardIds:[],lastClickedCardId:null,starredBoards:[],savedViews:[],toggleStarBoard:r=>e(n=>({starredBoards:n.starredBoards.includes(r)?n.starredBoards.filter(s=>s!==r):[...n.starredBoards,r]})),saveCurrentView:r=>e(n=>{const o={id:`view-${Date.now()}`,name:r,searchQuery:n.searchQuery,fuzzySearch:n.fuzzySearch,priorityFilter:n.priorityFilter,assigneeFilter:n.assigneeFilter,labelFilter:[...n.labelFilter],dueDateFilter:n.dueDateFilter};return{savedViews:[...n.savedViews,o]}}),removeView:r=>e(n=>({savedViews:n.savedViews.filter(s=>s.id!==r)})),setActiveCardId:r=>e(n=>{if(!r)return{activeCardId:null,activeCardTab:Aa};const s=xs(n.boards,n.currentBoard),o=n.cards.find(a=>a.id===r);return{activeCardId:r,activeCardTab:Sn(n.activeCardTab,o,s)}}),setActiveCardTab:r=>e(n=>({activeCardTab:Sn(r,n.activeCardId?n.cards.find(s=>s.id===n.activeCardId):void 0,xs(n.boards,n.currentBoard))})),setWorkspace:r=>e({workspace:r}),setLabelDefs:r=>e({labelDefs:r}),setCards:r=>e(n=>({cards:r,activeCardTab:n.activeCardId?Sn(n.activeCardTab,r.find(s=>s.id===n.activeCardId),xs(n.boards,n.currentBoard)):n.activeCardTab})),setColumns:r=>e(n=>({columns:r,columnVisibilityByBoard:Rs(n.columnVisibilityByBoard,n.currentBoard,oc(jn(n.columnVisibilityByBoard,n.currentBoard),r.map(s=>s.id)))})),setBoards:r=>e(n=>{const s=new Set(r.map(a=>a.id)),o=xs(r,n.currentBoard);return{boards:r,columnVisibilityByBoard:Object.fromEntries(Object.entries(n.columnVisibilityByBoard).filter(([a])=>s.has(a))),activeCardTab:n.activeCardId?Sn(n.activeCardTab,n.cards.find(a=>a.id===n.activeCardId),o):n.activeCardTab}}),setCurrentBoard:r=>e(n=>({currentBoard:r,activeCardTab:n.activeCardId?Sn(n.activeCardTab,n.cards.find(s=>s.id===n.activeCardId),xs(n.boards,r)):n.activeCardTab})),getColumnVisibility:r=>{const n=r??t().currentBoard;return jn(t().columnVisibilityByBoard,n)},getHiddenColumnIds:r=>t().getColumnVisibility(r).hiddenColumnIds,getMinimizedColumnIds:r=>t().getColumnVisibility(r).minimizedColumnIds,isColumnHidden:(r,n)=>t().getHiddenColumnIds(n).includes(r),isColumnMinimized:(r,n)=>t().getMinimizedColumnIds(n).includes(r),setColumnHidden:(r,n,s)=>e(o=>{const a=jn(o.columnVisibilityByBoard,r),i=s?[...a.hiddenColumnIds,n]:a.hiddenColumnIds.filter(u=>u!==n);return{columnVisibilityByBoard:Rs(o.columnVisibilityByBoard,r,sc({hiddenColumnIds:i,minimizedColumnIds:a.minimizedColumnIds.filter(u=>u!==n)}))}}),setColumnMinimized:(r,n,s)=>e(o=>{const a=jn(o.columnVisibilityByBoard,r),i=s?[...a.minimizedColumnIds,n]:a.minimizedColumnIds.filter(u=>u!==n);return{columnVisibilityByBoard:Rs(o.columnVisibilityByBoard,r,sc({hiddenColumnIds:a.hiddenColumnIds,minimizedColumnIds:i}))}}),toggleColumnMinimized:(r,n)=>{const s=t();s.setColumnMinimized(r,n,!s.isColumnMinimized(n,r))},sanitizeColumnVisibility:(r,n)=>e(s=>({columnVisibilityByBoard:Rs(s.columnVisibilityByBoard,r,oc(jn(s.columnVisibilityByBoard,r),n))})),setIsDarkMode:r=>e({isDarkMode:r}),setCardSettings:r=>e(n=>{const s=sa(r.drawerWidth??n.cardSettings.drawerWidth??50),o=Ea(r.boardBackgroundMode??n.cardSettings.boardBackgroundMode,r.boardBackgroundPreset??n.cardSettings.boardBackgroundPreset);return{cardSettings:{...r,boardZoom:r.boardZoom??n.cardSettings.boardZoom,cardZoom:r.cardZoom??n.cardSettings.cardZoom,boardBackgroundMode:o.boardBackgroundMode,boardBackgroundPreset:o.boardBackgroundPreset,panelMode:r.panelMode??n.cardSettings.panelMode,drawerWidth:s},effectiveDrawerWidth:n.drawerWidthPreview??s}}),setDrawerWidthPreview:r=>e(n=>{const s=sa(r);return{drawerWidthPreview:s,effectiveDrawerWidth:s}}),clearDrawerWidthPreview:()=>e(r=>({drawerWidthPreview:null,effectiveDrawerWidth:sa(r.cardSettings.drawerWidth??50)})),setSettingsOpen:r=>e({settingsOpen:r}),setSearchQuery:r=>e({searchQuery:r}),setFuzzySearch:r=>e({fuzzySearch:r}),clearPlainTextSearch:()=>e(r=>{const{metaFilter:n}=Fs(r.searchQuery);return{searchQuery:qi("",n)}}),applyMetadataFilterToken:(r,n)=>e(s=>{const o=r.trim(),a=n.trim().replace(/\s+/g," ");if(!o||!a)return{};const{metaFilter:i,plainText:u}=Fs(s.searchQuery);return i[o]=a,{searchQuery:qi(u,i)}}),removeMetadataFilterToken:r=>e(n=>{const s=r.trim();if(!s)return{};const{metaFilter:o,plainText:a}=Fs(n.searchQuery);return s in o?(delete o[s],{searchQuery:qi(a,o)}):{}}),applyLabelFilter:r=>e(()=>{const n=r.trim();return n?{labelFilter:[n]}:{}}),setPriorityFilter:r=>e({priorityFilter:r}),setAssigneeFilter:r=>e({assigneeFilter:r}),setLabelFilter:r=>e({labelFilter:r}),setDueDateFilter:r=>e({dueDateFilter:r}),setColumnSort:(r,n)=>e(s=>({columnSorts:n==="order"?Object.fromEntries(Object.entries(s.columnSorts).filter(([o])=>o!==r)):{...s.columnSorts,[r]:n}})),setLayout:r=>e({layout:r}),toggleLayout:()=>e(r=>({layout:r.layout==="horizontal"?"vertical":"horizontal"})),clearAllFilters:()=>e({searchQuery:"",fuzzySearch:!1,priorityFilter:"all",assigneeFilter:"all",labelFilter:[],dueDateFilter:"all",columnSorts:{}}),addCard:r=>e(n=>({cards:[...n.cards,r]})),updateCard:(r,n)=>e(s=>({cards:s.cards.map(o=>o.id===r?{...o,...n}:o)})),removeCard:r=>e(n=>({cards:n.cards.filter(s=>s.id!==r)})),getCardsByStatus:r=>{const{cards:n}=t();return n.filter(s=>s.status===r).sort((s,o)=>s.order<o.order?-1:s.order>o.order?1:0)},getFilteredCardsByStatus:r=>{const{cards:n,searchQuery:s,fuzzySearch:o,priorityFilter:a,assigneeFilter:i,labelFilter:u,dueDateFilter:c,columnSorts:d}=t(),f=d[r]||"order";return n.filter(p=>{if(p.status!==r||a!=="all"&&p.priority!==a)return!1;if(i!=="all"){if(i==="unassigned"){if(p.assignee)return!1}else if(p.assignee!==i)return!1}if(u.length>0&&!p.labels.some(h=>u.includes(h)))return!1;if(c!=="all")if(c==="no-date"){if(p.dueDate)return!1}else if(p.dueDate){const h=new Date(p.dueDate);if(c==="overdue"&&!mC(h)||c==="today"&&!hC(h)||c==="this-week"&&!pC(h))return!1}else return!1;return!(s&&!K_(p,s,{},o))}).sort((p,h)=>f==="created:asc"?p.created.localeCompare(h.created):f==="created:desc"?h.created.localeCompare(p.created):f==="modified:asc"?p.modified.localeCompare(h.modified):f==="modified:desc"?h.modified.localeCompare(p.modified):p.order<h.order?-1:p.order>h.order?1:0)},getUniqueAssignees:()=>{const{cards:r}=t(),n=new Set;return r.forEach(s=>{s.assignee&&n.add(s.assignee)}),Array.from(n).sort()},getUniqueLabels:()=>{const{cards:r}=t(),n=new Set;return r.forEach(s=>{s.labels.forEach(o=>n.add(o))}),Array.from(n).sort()},hasActiveFilters:()=>{const{searchQuery:r,fuzzySearch:n,priorityFilter:s,assigneeFilter:o,labelFilter:a,dueDateFilter:i,columnSorts:u}=t();return r!==""||n||s!=="all"||o!=="all"||a.length>0||i!=="all"||Object.keys(u).length>0},toggleSelectCard:r=>e(n=>({selectedCardIds:n.selectedCardIds.includes(r)?n.selectedCardIds.filter(a=>a!==r):[...n.selectedCardIds,r],lastClickedCardId:r})),selectCardRange:r=>e(n=>{if(!n.lastClickedCardId)return{selectedCardIds:[r],lastClickedCardId:r};const s=[];for(const d of n.columns)s.push(...t().getFilteredCardsByStatus(d.id));const o=s.findIndex(d=>d.id===n.lastClickedCardId),a=s.findIndex(d=>d.id===r);if(o===-1||a===-1)return{selectedCardIds:[r],lastClickedCardId:r};const i=Math.min(o,a),u=Math.max(o,a),c=new Set(n.selectedCardIds);for(let d=i;d<=u;d++)c.add(s[d].id);return{selectedCardIds:Array.from(c),lastClickedCardId:r}}),selectAllInColumn:r=>e(n=>{const s=t().getFilteredCardsByStatus(r),o=new Set(n.selectedCardIds);for(const a of s)o.add(a.id);return{selectedCardIds:Array.from(o)}}),clearSelection:()=>e({selectedCardIds:[],lastClickedCardId:null}),setSelectedCardIds:r=>e({selectedCardIds:r})}));function r0(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=r0(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function vC(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=r0(e))&&(n&&(n+=" "),n+=t);return n}const Xc="-",yC=e=>{const t=xC(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const i=a.split(Xc);return i[0]===""&&i.length!==1&&i.shift(),n0(i,t)||bC(a)},getConflictingClassGroupIds:(a,i)=>{const u=r[a]||[];return i&&n[a]?[...u,...n[a]]:u}}},n0=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?n0(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Xc);return(a=t.validators.find(({validator:i})=>i(o)))==null?void 0:a.classGroupId},Gf=/^\[(.+)\]$/,bC=e=>{if(Gf.test(e)){const t=Gf.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},xC=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return kC(Object.entries(e.classGroups),r).forEach(([o,a])=>{ac(a,n,o,t)}),n},ac=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:qf(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(wC(s)){ac(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,a])=>{ac(a,qf(t,o),r,n)})})},qf=(e,t)=>{let r=e;return t.split(Xc).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},wC=e=>e.isThemeGetter,kC=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,i])=>[t+a,i])):o);return[r,s]}):e,_C=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},s0="!",CC=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=i=>{const u=[];let c=0,d=0,f;for(let v=0;v<i.length;v++){let y=i[v];if(c===0){if(y===s&&(n||i.slice(v,v+o)===t)){u.push(i.slice(d,v)),d=v+o;continue}if(y==="/"){f=v;continue}}y==="["?c++:y==="]"&&c--}const p=u.length===0?i:i.substring(d),h=p.startsWith(s0),g=h?p.substring(1):p,m=f&&f>d?f-d:void 0;return{modifiers:u,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:m}};return r?i=>r({className:i,parseClassName:a}):a},$C=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},SC=e=>({cache:_C(e.cacheSize),parseClassName:CC(e),...yC(e)}),jC=/\s+/,EC=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(jC);let i="";for(let u=a.length-1;u>=0;u-=1){const c=a[u],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=r(c);let g=!!h,m=n(g?p.substring(0,h):p);if(!m){if(!g){i=c+(i.length>0?" "+i:i);continue}if(m=n(p),!m){i=c+(i.length>0?" "+i:i);continue}g=!1}const v=$C(d).join(":"),y=f?v+s0:v,b=y+m;if(o.includes(b))continue;o.push(b);const _=s(m,g);for(let w=0;w<_.length;++w){const $=_[w];o.push(y+$)}i=c+(i.length>0?" "+i:i)}return i};function AC(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=o0(t))&&(n&&(n+=" "),n+=r);return n}const o0=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=o0(e[n]))&&(r&&(r+=" "),r+=t);return r};function NC(e,...t){let r,n,s,o=a;function a(u){const c=t.reduce((d,f)=>f(d),e());return r=SC(c),n=r.cache.get,s=r.cache.set,o=i,i(u)}function i(u){const c=n(u);if(c)return c;const d=EC(u,r);return s(u,d),d}return function(){return o(AC.apply(null,arguments))}}const Me=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},a0=/^\[(?:([a-z-]+):)?(.+)\]$/i,PC=/^\d+\/\d+$/,RC=new Set(["px","full","screen"]),TC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,MC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=e=>On(e)||RC.has(e)||PC.test(e),yr=e=>qn(e,"length",KC),On=e=>!!e&&!Number.isNaN(Number(e)),Yi=e=>qn(e,"number",On),ws=e=>!!e&&Number.isInteger(Number(e)),DC=e=>e.endsWith("%")&&On(e.slice(0,-1)),ye=e=>a0.test(e),br=e=>TC.test(e),LC=new Set(["length","size","percentage"]),FC=e=>qn(e,LC,i0),BC=e=>qn(e,"position",i0),UC=new Set(["image","url"]),VC=e=>qn(e,UC,GC),WC=e=>qn(e,"",HC),ks=()=>!0,qn=(e,t,r)=>{const n=a0.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},KC=e=>IC.test(e)&&!MC.test(e),i0=()=>!1,HC=e=>zC.test(e),GC=e=>OC.test(e),qC=()=>{const e=Me("colors"),t=Me("spacing"),r=Me("blur"),n=Me("brightness"),s=Me("borderColor"),o=Me("borderRadius"),a=Me("borderSpacing"),i=Me("borderWidth"),u=Me("contrast"),c=Me("grayscale"),d=Me("hueRotate"),f=Me("invert"),p=Me("gap"),h=Me("gradientColorStops"),g=Me("gradientColorStopPositions"),m=Me("inset"),v=Me("margin"),y=Me("opacity"),b=Me("padding"),_=Me("saturate"),w=Me("scale"),$=Me("sepia"),R=Me("skew"),M=Me("space"),D=Me("translate"),j=()=>["auto","contain","none"],S=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",ye,t],P=()=>[ye,t],W=()=>["",nr,yr],G=()=>["auto",On,ye],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",ye],H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[On,ye];return{cacheSize:500,separator:":",theme:{colors:[ks],spacing:[nr,yr],blur:["none","",br,ye],brightness:A(),borderColor:[e],borderRadius:["none","","full",br,ye],borderSpacing:P(),borderWidth:W(),contrast:A(),grayscale:J(),hueRotate:A(),invert:J(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[DC,yr],inset:E(),margin:E(),opacity:A(),padding:P(),saturate:A(),scale:A(),sepia:J(),skew:A(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",ye]}],container:["container"],columns:[{columns:[br]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),ye]}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ws,ye]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ye]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",ws,ye]}],"grid-cols":[{"grid-cols":[ks]}],"col-start-end":[{col:["auto",{span:["full",ws,ye]},ye]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[ks]}],"row-start-end":[{row:["auto",{span:[ws,ye]},ye]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ye]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...te()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...te(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...te(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ye,t]}],"min-w":[{"min-w":[ye,t,"min","max","fit"]}],"max-w":[{"max-w":[ye,t,"none","full","min","max","fit","prose",{screen:[br]},br]}],h:[{h:[ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",br,yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yi]}],"font-family":[{font:[ks]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ye]}],"line-clamp":[{"line-clamp":["none",On,Yi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nr,ye]}],"list-image":[{"list-image":["none",ye]}],"list-style-type":[{list:["none","disc","decimal",ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nr,yr]}],"underline-offset":[{"underline-offset":["auto",nr,ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),BC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",FC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},VC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:V()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[nr,ye]}],"outline-w":[{outline:[nr,yr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[nr,yr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",br,WC]}],"shadow-color":[{shadow:[ks]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...O(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",br,ye]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[_]}],sepia:[{sepia:[$]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[$]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ye]}],duration:[{duration:A()}],ease:[{ease:["linear","in","out","in-out",ye]}],delay:[{delay:A()}],animate:[{animate:["none","spin","ping","pulse","bounce",ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[ws,ye]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nr,yr,Yi]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},YC=NC(qC);function Ae(...e){return YC(vC(e))}function oa(e){if(!e)return"";const t=Date.now(),r=new Date(e).getTime();if(Number.isNaN(r))return"";let n=Math.max(0,Math.floor((t-r)/1e3));const s=Math.floor(n/(365*24*3600));n%=365*24*3600;const o=Math.floor(n/(30*24*3600));n%=30*24*3600;const a=Math.floor(n/(7*24*3600));n%=7*24*3600;const i=Math.floor(n/(24*3600));n%=24*3600;const u=Math.floor(n/3600);n%=3600;const c=Math.floor(n/60),d=n%60;return s>0?o>0?`${s}y${o}mo`:`${s}y`:o>0?`${o}mo`:a>0?i>0?`${a}w${i}d`:`${a}w`:i>0?u>0?`${i}d${u}h`:`${i}d`:u>0?c>0?`${u}h${c}m`:`${u}h`:c>0?d>0?`${c}m${d}s`:`${c}m`:`${d}s`}function Na(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const r=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())} ${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`}function Bs(e){if(!e)return"";const t=Date.now(),r=new Date(e).getTime();if(Number.isNaN(r))return"";let n=Math.max(0,Math.floor((t-r)/1e3));const s=Math.floor(n/(365*24*3600));n%=365*24*3600;const o=Math.floor(n/(30*24*3600));n%=30*24*3600;const a=Math.floor(n/(24*3600));n%=24*3600;const i=Math.floor(n/3600);n%=3600;const u=Math.floor(n/60),c=n%60,d=[];return s>0&&d.push(`${s} ${s===1?"year":"years"}`),o>0&&d.push(`${o} ${o===1?"month":"months"}`),a>0&&d.push(`${a} ${a===1?"day":"days"}`),i>0&&d.push(`${i} ${i===1?"hour":"hours"}`),u>0&&d.push(`${u} ${u===1?"min":"mins"}`),d.length===0?c>0?`${c} ${c===1?"sec":"secs"} ago`:"just now":`${d.slice(0,2).join(" ")} ago`}function JC(e,t){const r=[];return e&&r.push(`Created at: ${Na(e)} (${Bs(e)})`),t&&r.push(`Modified at: ${Na(t)} (${Bs(t)})`),r.join(`
28
+ `).map(n=>n.trim()).find(n=>n.length>0)||"Untitled"}function H_(e,t){if(!(!e||!t.trim()))return t.split(".").reduce((r,n)=>{if(!(r==null||typeof r!="object"))return r[n]},e)}function Jg(e){if(e==null)return null;if(typeof e=="string"){const t=e.trim();return t.length>0?t:null}if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);if(Array.isArray(e)){const t=e.map(r=>Jg(r)).filter(r=>!!r);return t.length>0?t.join(", "):null}if(typeof e=="object"){const t=JSON.stringify(e);return t&&t!=="{}"&&t!=="[]"?t:null}return null}function Zg(e,t,r){const n=Yg(e);if(!r||r.length===0)return n;const s=r.map(o=>Jg(H_(t,o))).filter(o=>!!o);return s.length>0?`${s.join(" ")} ${n}`:n}function G_(e){return e.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,50)||"card"}function Qg(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return t?t.split(/\s+/).filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" "):e}const Gn="deleted",bs={id:Gn,name:"Deleted",color:"#ef4444"},q_=["aurora","sunset","meadow","nebula","lagoon","candy","ember","violet"],Y_=["paper","mist","sand"],J_="fancy",Z_="aurora",Q_="paper";function X_(e){return e==="plain"?Q_:Z_}function eC(e,t){return e==="plain"?Y_.includes(t):q_.includes(t)}function Ea(e,t){const r=e??J_,n=t&&eC(r,t)?t:X_(r);return{boardBackgroundMode:r,boardBackgroundPreset:n}}const ec=[{name:"red",hex:"#e11d48"},{name:"orange",hex:"#ea580c"},{name:"amber",hex:"#d97706"},{name:"yellow",hex:"#ca8a04"},{name:"lime",hex:"#65a30d"},{name:"green",hex:"#16a34a"},{name:"teal",hex:"#0d9488"},{name:"cyan",hex:"#0891b2"},{name:"blue",hex:"#2563eb"},{name:"indigo",hex:"#4f46e5"},{name:"violet",hex:"#7c3aed"},{name:"pink",hex:"#db2777"}],tC=20,rC=80,Qc=50;function sa(e){return Number.isFinite(e)?Math.max(tC,Math.min(rC,e)):Qc}function nC(e,t){return!Number.isFinite(t)||t<=0?Qc:sa((t-e)/t*100)}function sC(e){let t=!1,r=Qc;const n=c=>(r=nC(c,e.getViewportWidth()),r),s=c=>{t&&e.onPreview(n(c.clientX))},o=()=>{e.eventTarget.removeEventListener("pointermove",s),e.eventTarget.removeEventListener("pointerup",i),e.eventTarget.removeEventListener("pointercancel",u)},a=()=>{t&&(t=!1,o())},i=c=>{if(!t)return;const d=n(c.clientX);a(),e.onCommit(d)},u=()=>{t&&(a(),e.onCancel())};return{start(c){return(e.getPanelMode()??"drawer")!=="drawer"?!1:(a(),t=!0,e.eventTarget.addEventListener("pointermove",s),e.eventTarget.addEventListener("pointerup",i),e.eventTarget.addEventListener("pointercancel",u),e.onPreview(n(c.clientX)),!0)},cancel(){u()},dispose(){u()},isActive(){return t}}}const oC=["write","preview","comments","logs"],Aa="preview",tc="form:";function rc(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Xg(e){return oC.includes(e)}function e0(e){return e.startsWith(tc)&&e.length>tc.length}function t0(e){return Xg(e)||e0(e)}function nc(e){return`${tc}${e}`}function aC(e){return t0(e)?e:Aa}function iC(e,t){var r;return rc(e.schema)?!0:!!(e.name&&(t!=null&&t.forms)&&rc((r=t.forms[e.name])==null?void 0:r.schema))}function lC(e,t){const r=(e==null?void 0:e.forms)??[];if(r.length===0)return[];const n=new Set;return r.flatMap((s,o)=>{if(!iC(s,t))return[];const a=rc(s.schema)?s.schema:void 0,i=s.name??(a&&typeof a.title=="string"&&a.title.trim().length>0?G_(a.title):`form-${o}`);let u=i||`form-${o}`,c=2;for(;n.has(u);)u=`${i}-${c++}`;return n.add(u),[nc(u)]})}function Sn(e,t,r){const n=aC(e);return!t||Xg(n)||e0(n)&&lC(t,r).includes(n)?n:Aa}function xs(e,t){return e.find(r=>r.id===t)}const cC={hiddenColumnIds:[],minimizedColumnIds:[]};function sc(e){const t=Array.from(new Set((e==null?void 0:e.hiddenColumnIds)??[])),r=new Set(t);return{hiddenColumnIds:t,minimizedColumnIds:Array.from(new Set((e==null?void 0:e.minimizedColumnIds)??[])).filter(n=>!r.has(n))}}function oc(e,t){const r=new Set(t);return sc({hiddenColumnIds:e.hiddenColumnIds.filter(n=>r.has(n)),minimizedColumnIds:e.minimizedColumnIds.filter(n=>r.has(n))})}function uC(e){return e.hiddenColumnIds.length>0||e.minimizedColumnIds.length>0}function jn(e,t){return e[t]??cC}function Rs(e,t,r){return uC(r)?{...e,[t]:r}:t in e?Object.fromEntries(Object.entries(e).filter(([n])=>n!==t)):e}function dC(e,t){return e.hiddenColumnIds.length===t.hiddenColumnIds.length&&e.minimizedColumnIds.length===t.minimizedColumnIds.length&&e.hiddenColumnIds.every((r,n)=>r===t.hiddenColumnIds[n])&&e.minimizedColumnIds.every((r,n)=>r===t.minimizedColumnIds[n])}function Hf(e,t,r){const n=jn(e,t),s=oc(n,r);return dC(n,s)?e:Rs(e,t,s)}const fC=()=>typeof document<"u"?document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast"):!1,hC=e=>{const t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},pC=e=>{const t=new Date,r=new Date(t);r.setDate(t.getDate()-t.getDay()),r.setHours(0,0,0,0);const n=new Date(r);return n.setDate(r.getDate()+7),e>=r&&e<n},mC=e=>{const t=new Date;return t.setHours(0,0,0,0),e<t};function gC(e){const t=e.trim().replace(/\s+/g," ");return t?/\s/.test(t)?JSON.stringify(t):t:""}function qi(e,t){const r=Object.entries(t).map(([n,s])=>[n.trim(),s.trim()]).filter(([n,s])=>n.length>0&&s.length>0).map(([n,s])=>`meta.${n}: ${gC(s)}`);return[e.trim(),...r].filter(Boolean).join(" ").trim()}const q=Xk((e,t)=>({cards:[],columns:[],boards:[],columnVisibilityByBoard:{},currentBoard:"default",isDarkMode:fC(),searchQuery:"",fuzzySearch:!1,priorityFilter:"all",assigneeFilter:"all",labelFilter:[],dueDateFilter:"all",columnSorts:{},layout:"horizontal",workspace:null,cardSettings:{showPriorityBadges:!0,showAssignee:!0,showDueDate:!0,showLabels:!0,showBuildWithAI:!0,showFileName:!1,compactMode:!1,markdownEditorMode:!1,showDeletedColumn:!1,defaultPriority:"medium",defaultStatus:"backlog",boardZoom:100,cardZoom:100,boardBackgroundMode:"fancy",boardBackgroundPreset:"aurora",panelMode:"drawer",drawerWidth:50},drawerWidthPreview:null,effectiveDrawerWidth:50,settingsOpen:!1,labelDefs:{},activeCardId:null,activeCardTab:Aa,selectedCardIds:[],lastClickedCardId:null,starredBoards:[],savedViews:[],toggleStarBoard:r=>e(n=>({starredBoards:n.starredBoards.includes(r)?n.starredBoards.filter(s=>s!==r):[...n.starredBoards,r]})),saveCurrentView:r=>e(n=>{const o={id:`view-${Date.now()}`,name:r,searchQuery:n.searchQuery,fuzzySearch:n.fuzzySearch,priorityFilter:n.priorityFilter,assigneeFilter:n.assigneeFilter,labelFilter:[...n.labelFilter],dueDateFilter:n.dueDateFilter};return{savedViews:[...n.savedViews,o]}}),removeView:r=>e(n=>({savedViews:n.savedViews.filter(s=>s.id!==r)})),setActiveCardId:r=>e(n=>{if(!r)return{activeCardId:null,activeCardTab:Aa};const s=xs(n.boards,n.currentBoard),o=n.cards.find(a=>a.id===r);return{activeCardId:r,activeCardTab:Sn(n.activeCardTab,o,s)}}),setActiveCardTab:r=>e(n=>({activeCardTab:Sn(r,n.activeCardId?n.cards.find(s=>s.id===n.activeCardId):void 0,xs(n.boards,n.currentBoard))})),setWorkspace:r=>e({workspace:r}),setLabelDefs:r=>e({labelDefs:r}),setCards:r=>e(n=>({cards:r,activeCardTab:n.activeCardId?Sn(n.activeCardTab,r.find(s=>s.id===n.activeCardId),xs(n.boards,n.currentBoard)):n.activeCardTab})),setColumns:r=>e(n=>({columns:r,columnVisibilityByBoard:Rs(n.columnVisibilityByBoard,n.currentBoard,oc(jn(n.columnVisibilityByBoard,n.currentBoard),r.map(s=>s.id)))})),setBoards:r=>e(n=>{const s=new Set(r.map(a=>a.id)),o=xs(r,n.currentBoard);return{boards:r,columnVisibilityByBoard:Object.fromEntries(Object.entries(n.columnVisibilityByBoard).filter(([a])=>s.has(a))),activeCardTab:n.activeCardId?Sn(n.activeCardTab,n.cards.find(a=>a.id===n.activeCardId),o):n.activeCardTab}}),setCurrentBoard:r=>e(n=>({currentBoard:r,activeCardTab:n.activeCardId?Sn(n.activeCardTab,n.cards.find(s=>s.id===n.activeCardId),xs(n.boards,r)):n.activeCardTab})),getColumnVisibility:r=>{const n=r??t().currentBoard;return jn(t().columnVisibilityByBoard,n)},getHiddenColumnIds:r=>t().getColumnVisibility(r).hiddenColumnIds,getMinimizedColumnIds:r=>t().getColumnVisibility(r).minimizedColumnIds,isColumnHidden:(r,n)=>t().getHiddenColumnIds(n).includes(r),isColumnMinimized:(r,n)=>t().getMinimizedColumnIds(n).includes(r),setColumnHidden:(r,n,s)=>e(o=>{const a=jn(o.columnVisibilityByBoard,r),i=s?[...a.hiddenColumnIds,n]:a.hiddenColumnIds.filter(u=>u!==n);return{columnVisibilityByBoard:Rs(o.columnVisibilityByBoard,r,sc({hiddenColumnIds:i,minimizedColumnIds:a.minimizedColumnIds.filter(u=>u!==n)}))}}),setColumnMinimized:(r,n,s)=>e(o=>{const a=jn(o.columnVisibilityByBoard,r),i=s?[...a.minimizedColumnIds,n]:a.minimizedColumnIds.filter(u=>u!==n);return{columnVisibilityByBoard:Rs(o.columnVisibilityByBoard,r,sc({hiddenColumnIds:a.hiddenColumnIds,minimizedColumnIds:i}))}}),toggleColumnMinimized:(r,n)=>{const s=t();s.setColumnMinimized(r,n,!s.isColumnMinimized(n,r))},sanitizeColumnVisibility:(r,n)=>e(s=>({columnVisibilityByBoard:Rs(s.columnVisibilityByBoard,r,oc(jn(s.columnVisibilityByBoard,r),n))})),setIsDarkMode:r=>e({isDarkMode:r}),setCardSettings:r=>e(n=>{const s=sa(r.drawerWidth??n.cardSettings.drawerWidth??50),o=Ea(r.boardBackgroundMode??n.cardSettings.boardBackgroundMode,r.boardBackgroundPreset??n.cardSettings.boardBackgroundPreset);return{cardSettings:{...r,boardZoom:r.boardZoom??n.cardSettings.boardZoom,cardZoom:r.cardZoom??n.cardSettings.cardZoom,boardBackgroundMode:o.boardBackgroundMode,boardBackgroundPreset:o.boardBackgroundPreset,panelMode:r.panelMode??n.cardSettings.panelMode,drawerWidth:s},effectiveDrawerWidth:n.drawerWidthPreview??s}}),setDrawerWidthPreview:r=>e(n=>{const s=sa(r);return{drawerWidthPreview:s,effectiveDrawerWidth:s}}),clearDrawerWidthPreview:()=>e(r=>({drawerWidthPreview:null,effectiveDrawerWidth:sa(r.cardSettings.drawerWidth??50)})),setSettingsOpen:r=>e({settingsOpen:r}),setSearchQuery:r=>e({searchQuery:r}),setFuzzySearch:r=>e({fuzzySearch:r}),clearPlainTextSearch:()=>e(r=>{const{metaFilter:n}=Fs(r.searchQuery);return{searchQuery:qi("",n)}}),applyMetadataFilterToken:(r,n)=>e(s=>{const o=r.trim(),a=n.trim().replace(/\s+/g," ");if(!o||!a)return{};const{metaFilter:i,plainText:u}=Fs(s.searchQuery);return i[o]=a,{searchQuery:qi(u,i)}}),removeMetadataFilterToken:r=>e(n=>{const s=r.trim();if(!s)return{};const{metaFilter:o,plainText:a}=Fs(n.searchQuery);return s in o?(delete o[s],{searchQuery:qi(a,o)}):{}}),applyLabelFilter:r=>e(()=>{const n=r.trim();return n?{labelFilter:[n]}:{}}),setPriorityFilter:r=>e({priorityFilter:r}),setAssigneeFilter:r=>e({assigneeFilter:r}),setLabelFilter:r=>e({labelFilter:r}),setDueDateFilter:r=>e({dueDateFilter:r}),setColumnSort:(r,n)=>e(s=>({columnSorts:n==="order"?Object.fromEntries(Object.entries(s.columnSorts).filter(([o])=>o!==r)):{...s.columnSorts,[r]:n}})),setLayout:r=>e({layout:r}),toggleLayout:()=>e(r=>({layout:r.layout==="horizontal"?"vertical":"horizontal"})),clearAllFilters:()=>e({searchQuery:"",fuzzySearch:!1,priorityFilter:"all",assigneeFilter:"all",labelFilter:[],dueDateFilter:"all",columnSorts:{}}),addCard:r=>e(n=>({cards:[...n.cards,r]})),updateCard:(r,n)=>e(s=>({cards:s.cards.map(o=>o.id===r?{...o,...n}:o)})),removeCard:r=>e(n=>({cards:n.cards.filter(s=>s.id!==r)})),getCardsByStatus:r=>{const{cards:n}=t();return n.filter(s=>s.status===r).sort((s,o)=>s.order<o.order?-1:s.order>o.order?1:0)},getFilteredCardsByStatus:r=>{const{cards:n,searchQuery:s,fuzzySearch:o,priorityFilter:a,assigneeFilter:i,labelFilter:u,dueDateFilter:c,columnSorts:d}=t(),f=d[r]||"order";return n.filter(p=>{if(p.status!==r||a!=="all"&&p.priority!==a)return!1;if(i!=="all"){if(i==="unassigned"){if(p.assignee)return!1}else if(p.assignee!==i)return!1}if(u.length>0&&!p.labels.some(h=>u.includes(h)))return!1;if(c!=="all")if(c==="no-date"){if(p.dueDate)return!1}else if(p.dueDate){const h=new Date(p.dueDate);if(c==="overdue"&&!mC(h)||c==="today"&&!hC(h)||c==="this-week"&&!pC(h))return!1}else return!1;return!(s&&!K_(p,s,{},o))}).sort((p,h)=>f==="created:asc"?p.created.localeCompare(h.created):f==="created:desc"?h.created.localeCompare(p.created):f==="modified:asc"?p.modified.localeCompare(h.modified):f==="modified:desc"?h.modified.localeCompare(p.modified):p.order<h.order?-1:p.order>h.order?1:0)},getUniqueAssignees:()=>{const{cards:r}=t(),n=new Set;return r.forEach(s=>{s.assignee&&n.add(s.assignee)}),Array.from(n).sort()},getUniqueLabels:()=>{const{cards:r}=t(),n=new Set;return r.forEach(s=>{s.labels.forEach(o=>n.add(o))}),Array.from(n).sort()},hasActiveFilters:()=>{const{searchQuery:r,fuzzySearch:n,priorityFilter:s,assigneeFilter:o,labelFilter:a,dueDateFilter:i,columnSorts:u}=t();return r!==""||n||s!=="all"||o!=="all"||a.length>0||i!=="all"||Object.keys(u).length>0},toggleSelectCard:r=>e(n=>({selectedCardIds:n.selectedCardIds.includes(r)?n.selectedCardIds.filter(a=>a!==r):[...n.selectedCardIds,r],lastClickedCardId:r})),selectCardRange:r=>e(n=>{if(!n.lastClickedCardId)return{selectedCardIds:[r],lastClickedCardId:r};const s=[];for(const d of n.columns)s.push(...t().getFilteredCardsByStatus(d.id));const o=s.findIndex(d=>d.id===n.lastClickedCardId),a=s.findIndex(d=>d.id===r);if(o===-1||a===-1)return{selectedCardIds:[r],lastClickedCardId:r};const i=Math.min(o,a),u=Math.max(o,a),c=new Set(n.selectedCardIds);for(let d=i;d<=u;d++)c.add(s[d].id);return{selectedCardIds:Array.from(c),lastClickedCardId:r}}),selectAllInColumn:r=>e(n=>{const s=t().getFilteredCardsByStatus(r),o=new Set(n.selectedCardIds);for(const a of s)o.add(a.id);return{selectedCardIds:Array.from(o)}}),clearSelection:()=>e({selectedCardIds:[],lastClickedCardId:null}),setSelectedCardIds:r=>e({selectedCardIds:r})}));function r0(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=r0(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function vC(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=r0(e))&&(n&&(n+=" "),n+=t);return n}const Xc="-",yC=e=>{const t=xC(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const i=a.split(Xc);return i[0]===""&&i.length!==1&&i.shift(),n0(i,t)||bC(a)},getConflictingClassGroupIds:(a,i)=>{const u=r[a]||[];return i&&n[a]?[...u,...n[a]]:u}}},n0=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?n0(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Xc);return(a=t.validators.find(({validator:i})=>i(o)))==null?void 0:a.classGroupId},Gf=/^\[(.+)\]$/,bC=e=>{if(Gf.test(e)){const t=Gf.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},xC=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return kC(Object.entries(e.classGroups),r).forEach(([o,a])=>{ac(a,n,o,t)}),n},ac=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:qf(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(wC(s)){ac(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,a])=>{ac(a,qf(t,o),r,n)})})},qf=(e,t)=>{let r=e;return t.split(Xc).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},wC=e=>e.isThemeGetter,kC=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,i])=>[t+a,i])):o);return[r,s]}):e,_C=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},s0="!",CC=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=i=>{const u=[];let c=0,d=0,f;for(let v=0;v<i.length;v++){let y=i[v];if(c===0){if(y===s&&(n||i.slice(v,v+o)===t)){u.push(i.slice(d,v)),d=v+o;continue}if(y==="/"){f=v;continue}}y==="["?c++:y==="]"&&c--}const p=u.length===0?i:i.substring(d),h=p.startsWith(s0),g=h?p.substring(1):p,m=f&&f>d?f-d:void 0;return{modifiers:u,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:m}};return r?i=>r({className:i,parseClassName:a}):a},$C=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},SC=e=>({cache:_C(e.cacheSize),parseClassName:CC(e),...yC(e)}),jC=/\s+/,EC=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(jC);let i="";for(let u=a.length-1;u>=0;u-=1){const c=a[u],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=r(c);let g=!!h,m=n(g?p.substring(0,h):p);if(!m){if(!g){i=c+(i.length>0?" "+i:i);continue}if(m=n(p),!m){i=c+(i.length>0?" "+i:i);continue}g=!1}const v=$C(d).join(":"),y=f?v+s0:v,b=y+m;if(o.includes(b))continue;o.push(b);const _=s(m,g);for(let w=0;w<_.length;++w){const $=_[w];o.push(y+$)}i=c+(i.length>0?" "+i:i)}return i};function AC(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=o0(t))&&(n&&(n+=" "),n+=r);return n}const o0=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=o0(e[n]))&&(r&&(r+=" "),r+=t);return r};function NC(e,...t){let r,n,s,o=a;function a(u){const c=t.reduce((d,f)=>f(d),e());return r=SC(c),n=r.cache.get,s=r.cache.set,o=i,i(u)}function i(u){const c=n(u);if(c)return c;const d=EC(u,r);return s(u,d),d}return function(){return o(AC.apply(null,arguments))}}const Me=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},a0=/^\[(?:([a-z-]+):)?(.+)\]$/i,PC=/^\d+\/\d+$/,RC=new Set(["px","full","screen"]),TC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,MC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=e=>On(e)||RC.has(e)||PC.test(e),yr=e=>qn(e,"length",KC),On=e=>!!e&&!Number.isNaN(Number(e)),Yi=e=>qn(e,"number",On),ws=e=>!!e&&Number.isInteger(Number(e)),DC=e=>e.endsWith("%")&&On(e.slice(0,-1)),ye=e=>a0.test(e),br=e=>TC.test(e),LC=new Set(["length","size","percentage"]),FC=e=>qn(e,LC,i0),BC=e=>qn(e,"position",i0),UC=new Set(["image","url"]),VC=e=>qn(e,UC,GC),WC=e=>qn(e,"",HC),ks=()=>!0,qn=(e,t,r)=>{const n=a0.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},KC=e=>IC.test(e)&&!MC.test(e),i0=()=>!1,HC=e=>zC.test(e),GC=e=>OC.test(e),qC=()=>{const e=Me("colors"),t=Me("spacing"),r=Me("blur"),n=Me("brightness"),s=Me("borderColor"),o=Me("borderRadius"),a=Me("borderSpacing"),i=Me("borderWidth"),u=Me("contrast"),c=Me("grayscale"),d=Me("hueRotate"),f=Me("invert"),p=Me("gap"),h=Me("gradientColorStops"),g=Me("gradientColorStopPositions"),m=Me("inset"),v=Me("margin"),y=Me("opacity"),b=Me("padding"),_=Me("saturate"),w=Me("scale"),$=Me("sepia"),R=Me("skew"),M=Me("space"),D=Me("translate"),j=()=>["auto","contain","none"],S=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",ye,t],P=()=>[ye,t],W=()=>["",nr,yr],G=()=>["auto",On,ye],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",ye],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[On,ye];return{cacheSize:500,separator:":",theme:{colors:[ks],spacing:[nr,yr],blur:["none","",br,ye],brightness:A(),borderColor:[e],borderRadius:["none","","full",br,ye],borderSpacing:P(),borderWidth:W(),contrast:A(),grayscale:J(),hueRotate:A(),invert:J(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[DC,yr],inset:E(),margin:E(),opacity:A(),padding:P(),saturate:A(),scale:A(),sepia:J(),skew:A(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",ye]}],container:["container"],columns:[{columns:[br]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),ye]}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ws,ye]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ye]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",ws,ye]}],"grid-cols":[{"grid-cols":[ks]}],"col-start-end":[{col:["auto",{span:["full",ws,ye]},ye]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[ks]}],"row-start-end":[{row:["auto",{span:[ws,ye]},ye]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ye]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...re()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...re(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...re(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ye,t]}],"min-w":[{"min-w":[ye,t,"min","max","fit"]}],"max-w":[{"max-w":[ye,t,"none","full","min","max","fit","prose",{screen:[br]},br]}],h:[{h:[ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",br,yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yi]}],"font-family":[{font:[ks]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ye]}],"line-clamp":[{"line-clamp":["none",On,Yi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nr,ye]}],"list-image":[{"list-image":["none",ye]}],"list-style-type":[{list:["none","disc","decimal",ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nr,yr]}],"underline-offset":[{"underline-offset":["auto",nr,ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),BC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",FC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},VC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:V()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[nr,ye]}],"outline-w":[{outline:[nr,yr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[nr,yr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",br,WC]}],"shadow-color":[{shadow:[ks]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...O(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",br,ye]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[_]}],sepia:[{sepia:[$]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[$]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ye]}],duration:[{duration:A()}],ease:[{ease:["linear","in","out","in-out",ye]}],delay:[{delay:A()}],animate:[{animate:["none","spin","ping","pulse","bounce",ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[ws,ye]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nr,yr,Yi]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},YC=NC(qC);function Ae(...e){return YC(vC(e))}function oa(e){if(!e)return"";const t=Date.now(),r=new Date(e).getTime();if(Number.isNaN(r))return"";let n=Math.max(0,Math.floor((t-r)/1e3));const s=Math.floor(n/(365*24*3600));n%=365*24*3600;const o=Math.floor(n/(30*24*3600));n%=30*24*3600;const a=Math.floor(n/(7*24*3600));n%=7*24*3600;const i=Math.floor(n/(24*3600));n%=24*3600;const u=Math.floor(n/3600);n%=3600;const c=Math.floor(n/60),d=n%60;return s>0?o>0?`${s}y${o}mo`:`${s}y`:o>0?`${o}mo`:a>0?i>0?`${a}w${i}d`:`${a}w`:i>0?u>0?`${i}d${u}h`:`${i}d`:u>0?c>0?`${u}h${c}m`:`${u}h`:c>0?d>0?`${c}m${d}s`:`${c}m`:`${d}s`}function Na(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const r=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())} ${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`}function Bs(e){if(!e)return"";const t=Date.now(),r=new Date(e).getTime();if(Number.isNaN(r))return"";let n=Math.max(0,Math.floor((t-r)/1e3));const s=Math.floor(n/(365*24*3600));n%=365*24*3600;const o=Math.floor(n/(30*24*3600));n%=30*24*3600;const a=Math.floor(n/(24*3600));n%=24*3600;const i=Math.floor(n/3600);n%=3600;const u=Math.floor(n/60),c=n%60,d=[];return s>0&&d.push(`${s} ${s===1?"year":"years"}`),o>0&&d.push(`${o} ${o===1?"month":"months"}`),a>0&&d.push(`${a} ${a===1?"day":"days"}`),i>0&&d.push(`${i} ${i===1?"hour":"hours"}`),u>0&&d.push(`${u} ${u===1?"min":"mins"}`),d.length===0?c>0?`${c} ${c===1?"sec":"secs"} ago`:"just now":`${d.slice(0,2).join(" ")} ago`}function JC(e,t){const r=[];return e&&r.push(`Created at: ${Na(e)} (${Bs(e)})`),t&&r.push(`Modified at: ${Na(t)} (${Bs(t)})`),r.join(`
29
29
  `)}const Yf={critical:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",high:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",medium:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",low:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400"},Jf={critical:"Critical",high:"High",medium:"Med",low:"Low"};function ZC(e){const t=e.split(`
30
30
  `),r=t.findIndex(s=>/^#\s+/.test(s));return(r>=0?t.slice(r+1):t).join(`
31
- `).trim()}function QC(e){return e.replace(/```[\s\S]*?```/g,"[code]").replace(/`([^`]+)`/g,"$1").replace(/^#{1,6}\s+(.+)$/gm,"$1").replace(/^>\s*/gm,"").replace(/\*\*\*(.+?)\*\*\*/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/_(.+?)_/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^[-*+]\s+/gm,"").replace(/^\d+\.\s+/gm,"").replace(/\n+/g," ").trim()}function XC({card:e,onClick:t,isDragging:r,isSelected:n}){const s=q(g=>g.cardSettings),o=q(g=>g.labelDefs),a=Yg(e.content),i=ZC(e.content),u=e.filePath&&e.filePath.split("/").pop()||"",c=g=>{if(!g)return null;const m=new Date(g),v=new Date,y=m.getTime()-v.getTime(),b=Math.ceil(y/(1e3*60*60*24));return b<0?{text:"Overdue",className:"text-red-500"}:b===0?{text:"Today",className:"text-orange-500"}:b===1?{text:"Tomorrow",className:"text-yellow-600 dark:text-yellow-400"}:b<=7?{text:`${b}d`,className:"text-zinc-500 dark:text-zinc-400"}:{text:m.toLocaleDateString("en-US",{month:"short",day:"numeric"}),className:"text-zinc-500 dark:text-zinc-400"}},d=e.status==="done"?null:c(e.dueDate),f=g=>{if(!g)return null;const m=new Date(g),y=new Date().getTime()-m.getTime(),b=Math.floor(y/(1e3*60)),_=Math.floor(y/(1e3*60*60)),w=Math.floor(y/(1e3*60*60*24));return b<1?"Just now":b<60?`${b}m ago`:_<24?`${_}h ago`:w===1?"1d ago":w<30?`${w}d ago`:w<365?`${Math.floor(w/30)}mo ago`:`${Math.floor(w/365)}y ago`},p=e.status==="done"?f(e.completedAt):null,h=(()=>{var g,m,v,y,b,_,w;return((m=(g=e.cardState)==null?void 0:g.error)==null?void 0:m.availability)==="identity-unavailable"?{label:"Sign in",className:"kb-card-state-badge kb-card-state-badge--identity bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",title:e.cardState.error.message}:((y=(v=e.cardState)==null?void 0:v.error)==null?void 0:y.availability)==="unavailable"?{label:"State off",className:"kb-card-state-badge kb-card-state-badge--unavailable bg-zinc-200 text-zinc-700 dark:bg-zinc-700 dark:text-zinc-200",title:e.cardState.error.message}:(_=(b=e.cardState)==null?void 0:b.unread)!=null&&_.unread?{label:"Unread",className:"kb-card-state-badge kb-card-state-badge--unread bg-sky-100 text-sky-700 dark:bg-sky-900/30 dark:text-sky-300",title:"Unread activity is waiting on this card"}:(w=e.cardState)!=null&&w.open?{label:"Opened",className:"kb-card-state-badge kb-card-state-badge--opened bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300",title:`Last opened ${new Date(e.cardState.open.value.openedAt).toLocaleString()}`}:null})();return l.jsxs("div",{onClick:t,className:["group kb-card",`kb-card-priority--${e.priority}`,n?"kb-card--selected":"",r?"shadow-lg opacity-90":""].filter(Boolean).join(" "),children:[l.jsxs("div",{className:"flex-1",children:[s.showFileName&&u&&l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(n1,{size:10,className:"shrink-0 text-zinc-400 dark:text-zinc-400"}),l.jsx("span",{className:"text-[10px] font-mono text-zinc-400 dark:text-zinc-400 truncate flex-1",children:u}),s.showPriorityBadges&&l.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded shrink-0 ${Yf[e.priority]}`,children:Jf[e.priority]})]}),l.jsxs("div",{className:`flex items-start gap-2 ${i?"mb-1":"mb-2"}`,children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100 line-clamp-2 flex-1",children:a}),h&&l.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded shrink-0 ${h.className}`,title:h.title,children:h.label}),s.showPriorityBadges&&!(s.showFileName&&u)&&l.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded shrink-0 ${Yf[e.priority]}`,children:Jf[e.priority]})]}),i&&l.jsx("p",{className:`text-xs text-zinc-500 dark:text-zinc-400 ${s.compactMode?"line-clamp-1":"line-clamp-2"} mb-1.5`,children:QC(i)}),s.showLabels&&e.labels.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[(s.compactMode?e.labels.slice(0,2):e.labels.slice(0,4)).map(g=>{const m=o[g];return l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${m?"":"bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300"}`,style:m?{backgroundColor:`${m.color}20`,color:m.color}:void 0,children:g},g)}),(s.compactMode?e.labels.length>2:e.labels.length>4)&&l.jsxs("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400 px-0.5 py-0.5 leading-tight",children:["+",e.labels.length-(s.compactMode?2:4)]})]})]}),l.jsxs("div",{className:"flex items-center justify-between text-xs mt-auto",children:[l.jsx("div",{className:"flex items-center gap-1",children:s.showAssignee&&e.assignee&&e.assignee!=="null"&&l.jsxs("div",{className:"flex items-center gap-1.5 text-zinc-500 dark:text-zinc-400",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:e.assignee.split(/\s+/).map(g=>g[0]).join("").toUpperCase().slice(0,2)}),l.jsx("span",{children:e.assignee})]})}),e.attachments.length>0&&l.jsxs("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:[l.jsx(Gm,{size:12}),l.jsx("span",{children:e.attachments.length})]}),e.metadata&&Object.keys(e.metadata).length>0&&l.jsx("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:l.jsx("span",{className:"text-[10px] font-mono",children:`{${Object.keys(e.metadata).length}}`})}),s.showDueDate&&d&&l.jsxs("div",{className:`flex items-center gap-1 ${d.className}`,children:[l.jsx(Dc,{size:12}),l.jsx("span",{children:d.text})]}),p&&l.jsxs("div",{className:"flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(jt,{size:12}),l.jsx("span",{children:p})]}),l.jsxs("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",title:JC(e.created,e.modified),children:[l.jsx(Ll,{size:12}),l.jsx("span",{children:oa(e.modified)})]})]})]})}function e$({status:e,onAdd:t}){const{cardSettings:r}=q(),[n,s]=x.useState(!1),[o,a]=x.useState(""),i=x.useRef(null);x.useEffect(()=>{n&&i.current&&i.current.focus()},[n]);const u=()=>{const d=o.trim();if(d){const f=`# ${d}`;t({status:e,priority:r.defaultPriority,content:f}),a("")}s(!1)},c=d=>{d.key==="Enter"?(d.preventDefault(),u()):d.key==="Escape"&&(a(""),s(!1))};return n?l.jsx("input",{ref:i,type:"text",value:o,onChange:d=>a(d.target.value),onBlur:u,onKeyDown:c,placeholder:"Card title...",className:"kb-quick-add-input"}):l.jsxs("button",{onClick:()=>s(!0),className:"kb-quick-add-btn",children:[l.jsx(Zr,{size:13}),l.jsx("span",{children:"Add card"})]})}const t$=[{value:"order",label:"Board Order"},{value:"created:asc",label:"Created (oldest)"},{value:"created:desc",label:"Created (newest)"},{value:"modified:asc",label:"Modified (oldest)"},{value:"modified:desc",label:"Modified (newest)"}],r$="application/x-column-id",n$="kanban-column:";function s$(e,t){var n,s,o;const r=Array.from(((n=e.dataTransfer)==null?void 0:n.types)??[]);if(r.includes(r$))return!0;if(r.includes("text/plain"))try{if((((o=(s=e.dataTransfer)==null?void 0:s.getData)==null?void 0:o.call(s,"text/plain"))??"").startsWith(n$))return!0}catch{}return!!t}function Zf({column:e,columnIndex:t,cards:r,onCardClick:n,onAddCard:s,onEditColumn:o,onRemoveColumn:a,onCleanupColumn:i,onDragStart:u,onDragOver:c,onDragOverCard:d,onDrop:f,onDragEnd:p,draggedCard:h,dropTarget:g,draggedColumnId:m,dropColumnIndex:v,onColumnDragStart:y,onColumnDragOver:b,onColumnDrop:_,onColumnDragEnd:w,isMinimized:$=!1,onToggleMinimized:R,layout:M,isDeletedColumn:D,onPurgeColumn:j,selectedCardId:S,selectedCardIds:E,onSelectAll:P,sort:W,onSortChange:G,onQuickAdd:L,onTriggerAction:V}){const O=M==="vertical",te=I=>s$(I,m),J=g&&g.columnId===e.id,H=!D&&v===t&&m!==e.id,A=!D&&v===t+1&&m!==e.id,Y=m===e.id,z="0 1px 2px 0 rgb(0 0 0 / 0.05)",k=O?"border-t-2 border-blue-500":"border-l-2 border-blue-500",C=O?"border-b-2 border-blue-500":"border-r-2 border-blue-500",N={...H?O?{borderTopColor:"#3b82f6"}:{borderLeftColor:"#3b82f6"}:{},...A?O?{borderBottomColor:"#3b82f6"}:{borderRightColor:"#3b82f6"}:{},...H||A?{boxShadow:`${z}, ${O?H?"0 -8px 18px -14px rgba(59,130,246,0.65)":"0 8px 18px -14px rgba(59,130,246,0.65)":H?"-8px 0 18px -14px rgba(59,130,246,0.65)":"8px 0 18px -14px rgba(59,130,246,0.65)"}`}:{}},[B,K]=x.useState(!1),ee=x.useRef(null),ne=x.useMemo(()=>E.filter(I=>r.some(oe=>oe.id===I)),[E,r]),le=ne.length>0?r.filter(I=>ne.includes(I.id)):r,me=x.useMemo(()=>{const I={};for(const oe of le){if(!oe.actions)continue;const ce=Array.isArray(oe.actions)?oe.actions.map(X=>[X,X]):Object.entries(oe.actions);for(const[X,de]of ce)I[X]||(I[X]={label:de,cardIds:[]}),I[X].cardIds.push(oe.id)}return Object.entries(I)},[le]);return x.useEffect(()=>{if(!B)return;const I=oe=>{ee.current&&!ee.current.contains(oe.target)&&K(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[B]),$&&!D?l.jsx("div",{style:N,className:[O?"flex items-center gap-2 bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm px-2 py-1.5":"flex-shrink-0 w-10 h-full flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm",Y?"opacity-40":"",H?k:"",A?C:"",J&&h?"ring-2 ring-blue-400 dark:ring-blue-500":""].filter(Boolean).join(" "),onDragOver:I=>{te(I)?(I.preventDefault(),b(I,t)):c(I,e.id)},onDrop:I=>{te(I)?(I.stopPropagation(),_(I)):f(I,e.id)},children:l.jsxs("div",{className:O?"flex items-center gap-2 w-full cursor-grab active:cursor-grabbing":"flex flex-col items-center gap-1.5 px-1.5 py-1.5 cursor-grab active:cursor-grabbing h-full",draggable:!0,onDragStart:I=>y(I,e.id),onDragOver:I=>{te(I)&&(I.stopPropagation(),b(I,t))},onDrop:I=>{te(I)&&(I.stopPropagation(),_(I))},onDragEnd:w,children:[l.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),R()},className:"p-0.5 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors flex-shrink-0",title:`Expand ${e.name}`,children:l.jsx(s1,{size:12,className:"text-zinc-500"})}),O?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{backgroundColor:e.color}}),l.jsx("span",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100 truncate",title:e.name,children:e.name}),l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 font-medium tabular-nums",children:r.length})]}):l.jsxs("div",{className:"flex flex-col items-center gap-1.5 flex-1 justify-start min-h-0 overflow-hidden",children:[l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 font-medium tabular-nums",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:r.length}),l.jsx("span",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100 tracking-wide",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},title:e.name,children:e.name}),l.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0 mt-0.5",style:{backgroundColor:e.color}})]})]})}):l.jsxs("div",{style:N,className:[O?"flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm":"flex-shrink-0 w-72 h-full flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm",Y?"opacity-40":"",H?k:"",A?C:"",J&&h?"ring-2 ring-blue-400 dark:ring-blue-500":""].filter(Boolean).join(" "),onDragOver:I=>{te(I)?(I.preventDefault(),b(I,t)):c(I,e.id)},onDrop:I=>{te(I)?(I.stopPropagation(),_(I)):f(I,e.id)},children:[l.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between w-full px-3 py-2.5 border-b border-zinc-200 dark:border-zinc-700 cursor-grab active:cursor-grabbing bg-zinc-50 dark:bg-zinc-800 rounded-t-xl",draggable:!D,onDragStart:I=>{D||y(I,e.id)},onDragOver:I=>{D||!te(I)||(I.stopPropagation(),b(I,t))},onDrop:I=>{te(I)&&(I.stopPropagation(),_(I))},onDragEnd:w,children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),l.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:e.name}),l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full",children:r.length})]}),l.jsx("div",{className:"flex items-center gap-0.5",children:D?l.jsx("button",{type:"button",onClick:()=>{r.length!==0&&window.confirm(`Permanently delete all ${r.length} card${r.length===1?"":"s"} from disk?`)&&(j==null||j())},className:"p-1 rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors",title:"Permanently delete all cards",children:l.jsx(Kt,{size:16,className:"text-red-500"})}):l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>s(e.id),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:`Add to ${e.name}`,children:l.jsx(Zr,{size:16,className:"text-zinc-500"})}),l.jsxs("div",{className:"relative",ref:ee,children:[l.jsx("button",{type:"button",onClick:()=>K(!B),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:"Column options",children:l.jsx(o1,{size:16,className:"text-zinc-500"})}),B&&l.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[170px]",children:[l.jsx("div",{className:"px-3 py-1 text-xs font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Sort by"}),t$.map(I=>l.jsxs("button",{type:"button",onClick:()=>{G(I.value)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(jt,{size:14,className:W===I.value?"text-blue-500":"invisible"}),I.label]},I.value)),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{K(!1),o(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Lc,{size:14}),"Edit List"]}),l.jsxs("button",{type:"button",onClick:()=>{K(!1),a(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-red-600 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Kt,{size:14}),"Remove List"]}),l.jsxs("button",{type:"button",onClick:()=>{K(!1),i(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-orange-600 dark:text-orange-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Kt,{size:14}),"Cleanup List"]}),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{K(!1),R()},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(a1,{size:14}),"Minimize List"]}),l.jsxs("button",{type:"button",onClick:()=>{K(!1),P(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(i1,{size:14}),"Select All"]}),me.length>0&&V&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsx("div",{className:"px-3 py-1 text-xs font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Actions"}),me.map(([I,{label:oe,cardIds:ce}])=>l.jsxs("button",{type:"button",onClick:()=>{K(!1),ce.forEach(X=>V(X,I))},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(ga,{size:14,className:"text-amber-500 flex-shrink-0"}),l.jsx("span",{className:"flex-1 text-left truncate",children:oe}),l.jsx("span",{className:"text-xs text-zinc-400 dark:text-zinc-500 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full flex-shrink-0",children:ce.length})]},I))]})]})]})]})})]}),l.jsxs("div",{className:O?"flex-1 p-3 flex flex-wrap gap-2":"flex-1 overflow-y-auto p-3 space-y-2 min-h-[200px]",children:[r.map((I,oe)=>l.jsxs("div",{children:[J&&g.index===oe&&l.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1 mb-1"}),l.jsx("div",{draggable:!0,"data-card-id":I.id,onDragStart:ce=>u(ce,I),onDragOver:ce=>d(ce,e.id,oe),onDragEnd:p,className:`${O?"w-64":""} ${(h==null?void 0:h.id)===I.id?"opacity-40":""}`,children:l.jsx(XC,{card:I,onClick:ce=>n(I,ce),isSelected:E.includes(I.id)||I.id===S})})]},I.id)),J&&g.index===r.length&&r.length>0&&l.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1"}),r.length===0&&l.jsxs("div",{className:O?"flex items-center gap-2 py-4 px-1 text-zinc-400 dark:text-zinc-500":"flex flex-col items-center gap-1.5 py-8 text-zinc-400 dark:text-zinc-500",children:[l.jsx(l1,{size:O?14:20,className:"shrink-0 opacity-50"}),l.jsx("span",{className:O?"text-sm":"text-sm text-center",children:"No cards yet"}),!O&&l.jsx("span",{className:"text-[11px] text-center text-zinc-300 dark:text-zinc-600 max-w-[120px]",children:"Drag cards here or click + to add one"})]})]}),!D&&L&&l.jsx("div",{className:"px-2 pb-2",children:l.jsx(e$,{status:e.id,onAdd:L})})]})}const o$="application/x-column-id",a$="kanban-column:";function i$({onCardClick:e,onAddCard:t,onMoveCard:r,onMoveCards:n,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onPurgeDeletedCards:i,onReorderColumns:u,selectedCardId:c,selectedCardIds:d,onSelectAll:f,onQuickAdd:p,onTriggerAction:h}){const g=x.useRef(null),m=q(I=>I.cardSettings),v=q(I=>I.effectiveDrawerWidth),y=q(I=>I.columns),b=q(I=>I.currentBoard),_=q(I=>I.getFilteredCardsByStatus),w=q(I=>I.getCardsByStatus),$=q(I=>I.getHiddenColumnIds(b)),R=q(I=>I.getMinimizedColumnIds(b)),M=q(I=>I.toggleColumnMinimized),D=q(I=>I.layout),j=q(I=>I.columnSorts),S=q(I=>I.setColumnSort);x.useEffect(()=>{if(!c)return;const I=g.current;if(!I)return;const ce=setTimeout(()=>{const X=I.querySelector(`[data-card-id="${c}"]`);if(!X)return;const de=I.getBoundingClientRect(),ge=X.getBoundingClientRect();if(!(ge.left>=de.left&&ge.right<=de.right)){const _e=ge.right-de.right;I.scrollBy({left:_e+10,behavior:"smooth"})}X.scrollIntoView({behavior:"smooth",block:"nearest"})},50);return()=>clearTimeout(ce)},[m.panelMode,v,c]);const[E,P]=x.useState(null),[W,G]=x.useState(null),[L,V]=x.useState(null),O=x.useRef(null),[te,J]=x.useState(null),H=x.useCallback((I,oe)=>{P(oe),I.dataTransfer.effectAllowed="move",d.length>1&&d.includes(oe.id)?I.dataTransfer.setData("text/plain",JSON.stringify(d)):I.dataTransfer.setData("text/plain",oe.id)},[d]),A=x.useCallback((I,oe)=>{I.preventDefault(),I.dataTransfer.dropEffect="move",!O.current&&oe&&G(ce=>(ce==null?void 0:ce.columnId)===oe?ce:{columnId:oe,index:0})},[]),Y=x.useCallback((I,oe,ce)=>{if(I.preventDefault(),I.dataTransfer.dropEffect="move",O.current)return;const X=I.currentTarget.getBoundingClientRect(),de=X.top+X.height/2,ge=I.clientY<de?ce:ce+1;G(je=>je&&je.columnId===oe&&je.index===ge?je:{columnId:oe,index:ge})},[]),z=x.useCallback((I,oe)=>{if(I.preventDefault(),!E)return;if(d.length>1&&d.includes(E.id)){n([...d],oe),P(null),G(null);return}const ce=_(oe);let X;if(W&&W.columnId===oe?X=W.index:X=ce.length,E.status===oe){const _e=ce.findIndex(Ie=>Ie.id===E.id);if(_e!==-1&&X>_e&&X--,_e===X){P(null),G(null);return}}const de=w(oe).filter(_e=>_e.id!==E.id),ge=ce.filter(_e=>_e.id!==E.id);let je;if(ge.length===0)je=de.length;else if(X>=ge.length){const _e=ge[ge.length-1];je=de.findIndex(Ge=>Ge.id===_e.id)+1}else{const _e=ge[X];je=de.findIndex(Ie=>Ie.id===_e.id)}r(E.id,oe,je),P(null),G(null)},[E,W,d,_,w,r,n]),k=x.useCallback(()=>{P(null),G(null)},[]),C=x.useCallback((I,oe)=>{O.current=oe,V(oe),G(null),I.dataTransfer.effectAllowed="move",I.dataTransfer.setData(o$,oe),I.dataTransfer.setData("text/plain",`${a$}${oe}`)},[]),N=x.useCallback((I,oe)=>{I.preventDefault(),I.dataTransfer.dropEffect="move";const ce=I.currentTarget.getBoundingClientRect(),X=D==="vertical"?I.clientY<ce.top+ce.height/2?oe:oe+1:I.clientX<ce.left+ce.width/2?oe:oe+1;J(de=>de===X?de:X)},[D]),B=x.useCallback(I=>{I.preventDefault();const oe=O.current??L;if(!oe||te===null){O.current=null,V(null),J(null);return}const ce=new Set($),X=y.map(Ie=>Ie.id),de=X.filter(Ie=>!ce.has(Ie)),ge=de.indexOf(oe);if(ge===-1){O.current=null,V(null),J(null);return}const je=[...de];je.splice(ge,1);const _e=te>ge?te-1:te;if(je.splice(_e,0,oe),je.join()!==de.join()){let Ie=0;const Ge=X.map(it=>ce.has(it)?it:je[Ie++]);u(Ge)}O.current=null,V(null),J(null)},[y,L,te,$,u]),K=x.useCallback(()=>{O.current=null,V(null),J(null)},[]),ee=D==="vertical",ne=new Set($),le=new Set(R),me=y.filter(I=>!ne.has(I.id));return l.jsx("div",{ref:g,className:ee?"h-full overflow-y-auto px-5 py-4":"h-full overflow-x-auto px-5 py-4",children:l.jsxs("div",{className:ee?"flex flex-col gap-5":"flex gap-5 h-full min-w-max",children:[y.length===0&&l.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-zinc-400 dark:text-zinc-500",children:[l.jsx(Fl,{size:40,className:"opacity-30"}),l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-500 dark:text-zinc-400",children:"No lists yet"}),l.jsx("p",{className:"text-[12px] mt-1 text-zinc-400 dark:text-zinc-500",children:'Click "Add List" in the toolbar to create your first column'})]})]}),me.map((I,oe)=>l.jsx(Zf,{column:I,columnIndex:oe,cards:_(I.id),onCardClick:e,onAddCard:t,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onDragStart:H,onDragOver:A,onDragOverCard:Y,onDrop:z,onDragEnd:k,draggedCard:E,dropTarget:W,draggedColumnId:L,dropColumnIndex:te,onColumnDragStart:C,onColumnDragOver:N,onColumnDrop:B,onColumnDragEnd:K,isMinimized:le.has(I.id),onToggleMinimized:()=>M(b,I.id),layout:D,selectedCardId:c,selectedCardIds:d,onSelectAll:f,sort:j[I.id]||"order",onSortChange:ce=>S(I.id,ce),onQuickAdd:p,onTriggerAction:h},I.id)),m.showDeletedColumn&&l.jsx(Zf,{column:bs,columnIndex:y.length,cards:_(bs.id),onCardClick:e,onAddCard:t,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onDragStart:H,onDragOver:A,onDragOverCard:Y,onDrop:z,onDragEnd:k,draggedCard:E,dropTarget:W,draggedColumnId:L,dropColumnIndex:te,onColumnDragStart:C,onColumnDragOver:N,onColumnDrop:B,onColumnDragEnd:K,layout:D,isDeletedColumn:!0,onPurgeColumn:i,selectedCardId:c,selectedCardIds:d,onSelectAll:f,sort:j[bs.id]||"order",onSortChange:I=>S(bs.id,I)},bs.id)]})})}const l$=["Mo","Tu","We","Th","Fr","Sa","Su"],c$=["January","February","March","April","May","June","July","August","September","October","November","December"];function u$({value:e,onChange:t,placeholder:r="Due date"}){const[n,s]=x.useState(!1),o=new Date,a=e?new Date(e+"T00:00:00"):null,[i,u]=x.useState((a==null?void 0:a.getFullYear())??o.getFullYear()),[c,d]=x.useState((a==null?void 0:a.getMonth())??o.getMonth()),f=new Date(i,c+1,0).getDate(),p=(new Date(i,c,1).getDay()+6)%7,h=Array(p).fill(null);for(let w=1;w<=f;w++)h.push(w);const g=()=>{c===0?(d(11),u(w=>w-1)):d(w=>w-1)},m=()=>{c===11?(d(0),u(w=>w+1)):d(w=>w+1)},v=w=>{const $=String(c+1).padStart(2,"0"),R=String(w).padStart(2,"0");t(`${i}-${$}-${R}`),s(!1)},y=w=>w===o.getDate()&&c===o.getMonth()&&i===o.getFullYear(),b=w=>a!==null&&w===a.getDate()&&c===a.getMonth()&&i===a.getFullYear(),_=w=>new Date(w+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>s(!n),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:e?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:[l.jsx("span",{children:e?_(e):r}),e&&l.jsx("span",{role:"button",onClick:w=>{w.stopPropagation(),t(""),s(!1)},className:"ml-0.5 hover:text-red-500 transition-colors",children:l.jsx(st,{size:12})})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-3 w-[252px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("button",{type:"button",onClick:g,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:l.jsx(c1,{size:14})}),l.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:[c$[c]," ",i]}),l.jsx("button",{type:"button",onClick:m,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:l.jsx(u1,{size:14})})]}),l.jsx("div",{className:"grid grid-cols-7 mb-1",children:l$.map(w=>l.jsx("div",{className:"text-center text-[10px] font-medium py-1",style:{color:"var(--vscode-descriptionForeground)"},children:w},w))}),l.jsx("div",{className:"grid grid-cols-7",children:h.map((w,$)=>l.jsx("div",{className:"flex items-center justify-center",children:w?l.jsx("button",{type:"button",onClick:()=>v(w),className:Ae("w-7 h-7 rounded-md text-[11px] transition-colors font-medium"),style:{background:b(w)?"var(--vscode-focusBorder)":y(w)?"var(--vscode-editor-selectionBackground)":void 0,color:b(w)?"var(--vscode-editor-background)":(y(w),"var(--vscode-foreground)")},onMouseEnter:R=>{b(w)||(R.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:R=>{!b(w)&&!y(w)?R.currentTarget.style.background="transparent":y(w)&&!b(w)&&(R.currentTarget.style.background="var(--vscode-editor-selectionBackground)")},children:w}):l.jsx("div",{className:"w-7 h-7"})},$))}),l.jsx("div",{className:"mt-2 pt-2 flex justify-center",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:l.jsx("button",{type:"button",onClick:()=>{const w=String(o.getMonth()+1).padStart(2,"0"),$=String(o.getDate()).padStart(2,"0");t(`${o.getFullYear()}-${w}-${$}`),s(!1)},className:"text-[11px] font-medium transition-colors",style:{color:"var(--vscode-textLink-foreground)"},onMouseEnter:w=>w.currentTarget.style.color="var(--vscode-textLink-activeForeground)",onMouseLeave:w=>w.currentTarget.style.color="var(--vscode-textLink-foreground)",children:"Today"})})]})]})]})}function eu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var an=eu();function l0(e){an=e}var Wr={exec:()=>null};function Ce(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(s,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(ct.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,t)};return n}var d$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ct={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {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,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,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:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},f$=/^(?:[ \t]*(?:\n|$))+/,h$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,p$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,m$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tu=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,c0=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,u0=Ce(c0).replace(/bull/g,tu).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),g$=Ce(c0).replace(/bull/g,tu).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ru=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,v$=/^[^\n]+/,nu=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,y$=Ce(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",nu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),b$=Ce(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tu).getRegex(),di="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",su=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,x$=Ce("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",su).replace("tag",di).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),d0=Ce(ru).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",di).getRegex(),w$=Ce(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",d0).getRegex(),ou={blockquote:w$,code:h$,def:y$,fences:p$,heading:m$,hr:ao,html:x$,lheading:u0,list:b$,newline:f$,paragraph:d0,table:Wr,text:v$},Qf=Ce("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",di).getRegex(),k$={...ou,lheading:g$,table:Qf,paragraph:Ce(ru).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qf).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",di).getRegex()},_$={...ou,html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",su).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:Wr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ce(ru).replace("hr",ao).replace("heading",` *#{1,6} *[^
32
- ]`).replace("lheading",u0).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},C$=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$$=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,f0=/^( {2,}|\\)\n(?!\s*$)/,S$=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fi=/[\p{P}\p{S}]/u,au=/[\s\p{P}\p{S}]/u,h0=/[^\s\p{P}\p{S}]/u,j$=Ce(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,au).getRegex(),p0=/(?!~)[\p{P}\p{S}]/u,E$=/(?!~)[\s\p{P}\p{S}]/u,A$=/(?:[^\s\p{P}\p{S}]|~)/u,m0=/(?![*_])[\p{P}\p{S}]/u,N$=/(?![*_])[\s\p{P}\p{S}]/u,P$=/(?:[^\s\p{P}\p{S}]|[*_])/u,R$=Ce(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",d$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),g0=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,T$=Ce(g0,"u").replace(/punct/g,fi).getRegex(),I$=Ce(g0,"u").replace(/punct/g,p0).getRegex(),v0="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",M$=Ce(v0,"gu").replace(/notPunctSpace/g,h0).replace(/punctSpace/g,au).replace(/punct/g,fi).getRegex(),z$=Ce(v0,"gu").replace(/notPunctSpace/g,A$).replace(/punctSpace/g,E$).replace(/punct/g,p0).getRegex(),O$=Ce("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,h0).replace(/punctSpace/g,au).replace(/punct/g,fi).getRegex(),D$=Ce(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,m0).getRegex(),L$="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",F$=Ce(L$,"gu").replace(/notPunctSpace/g,P$).replace(/punctSpace/g,N$).replace(/punct/g,m0).getRegex(),B$=Ce(/\\(punct)/,"gu").replace(/punct/g,fi).getRegex(),U$=Ce(/^<(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(),V$=Ce(su).replace("(?:-->|$)","-->").getRegex(),W$=Ce("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",V$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Pa=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,K$=Ce(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Pa).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),y0=Ce(/^!?\[(label)\]\[(ref)\]/).replace("label",Pa).replace("ref",nu).getRegex(),b0=Ce(/^!?\[(ref)\](?:\[\])?/).replace("ref",nu).getRegex(),H$=Ce("reflink|nolink(?!\\()","g").replace("reflink",y0).replace("nolink",b0).getRegex(),Xf=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,iu={_backpedal:Wr,anyPunctuation:B$,autolink:U$,blockSkip:R$,br:f0,code:$$,del:Wr,delLDelim:Wr,delRDelim:Wr,emStrongLDelim:T$,emStrongRDelimAst:M$,emStrongRDelimUnd:O$,escape:C$,link:K$,nolink:b0,punctuation:j$,reflink:y0,reflinkSearch:H$,tag:W$,text:S$,url:Wr},G$={...iu,link:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",Pa).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Pa).getRegex()},ic={...iu,emStrongRDelimAst:z$,emStrongLDelim:I$,delLDelim:D$,delRDelim:F$,url:Ce(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Xf).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ce(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Xf).getRegex()},q$={...ic,br:Ce(f0).replace("{2,}","*").getRegex(),text:Ce(ic.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bo={normal:ou,gfm:k$,pedantic:_$},_s={normal:iu,gfm:ic,breaks:q$,pedantic:G$},Y$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},eh=e=>Y$[e];function Lt(e,t){if(t){if(ct.escapeTest.test(e))return e.replace(ct.escapeReplace,eh)}else if(ct.escapeTestNoEncode.test(e))return e.replace(ct.escapeReplaceNoEncode,eh);return e}function th(e){try{e=encodeURI(e).replace(ct.percentDecode,"%")}catch{return null}return e}function rh(e,t){var o;let r=e.replace(ct.findPipe,(a,i,u)=>{let c=!1,d=i;for(;--d>=0&&u[d]==="\\";)c=!c;return c?"|":" |"}),n=r.split(ct.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!((o=n.at(-1))!=null&&o.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(ct.slashPipe,"|");return n}function Cs(e,t,r){let n=e.length;if(n===0)return"";let s=0;for(;s<n&&e.charAt(n-s-1)===t;)s++;return e.slice(0,n-s)}function J$(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function Z$(e,t=0){let r=t,n="";for(let s of e)if(s===" "){let o=4-r%4;n+=" ".repeat(o),r+=o}else n+=s,r++;return n}function nh(e,t,r,n,s){let o=t.href,a=t.title||null,i=e[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:a,text:i,tokens:n.inlineTokens(i)};return n.state.inLink=!1,u}function Q$(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let s=n[1];return t.split(`
31
+ `).trim()}function QC(e){return e.replace(/```[\s\S]*?```/g,"[code]").replace(/`([^`]+)`/g,"$1").replace(/^#{1,6}\s+(.+)$/gm,"$1").replace(/^>\s*/gm,"").replace(/\*\*\*(.+?)\*\*\*/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/_(.+?)_/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^[-*+]\s+/gm,"").replace(/^\d+\.\s+/gm,"").replace(/\n+/g," ").trim()}function XC({card:e,onClick:t,isDragging:r,isSelected:n}){const s=q(g=>g.cardSettings),o=q(g=>g.labelDefs),a=Yg(e.content),i=ZC(e.content),u=e.filePath&&e.filePath.split("/").pop()||"",c=g=>{if(!g)return null;const m=new Date(g),v=new Date,y=m.getTime()-v.getTime(),b=Math.ceil(y/(1e3*60*60*24));return b<0?{text:"Overdue",className:"text-red-500"}:b===0?{text:"Today",className:"text-orange-500"}:b===1?{text:"Tomorrow",className:"text-yellow-600 dark:text-yellow-400"}:b<=7?{text:`${b}d`,className:"text-zinc-500 dark:text-zinc-400"}:{text:m.toLocaleDateString("en-US",{month:"short",day:"numeric"}),className:"text-zinc-500 dark:text-zinc-400"}},d=e.status==="done"?null:c(e.dueDate),f=g=>{if(!g)return null;const m=new Date(g),y=new Date().getTime()-m.getTime(),b=Math.floor(y/(1e3*60)),_=Math.floor(y/(1e3*60*60)),w=Math.floor(y/(1e3*60*60*24));return b<1?"Just now":b<60?`${b}m ago`:_<24?`${_}h ago`:w===1?"1d ago":w<30?`${w}d ago`:w<365?`${Math.floor(w/30)}mo ago`:`${Math.floor(w/365)}y ago`},p=e.status==="done"?f(e.completedAt):null,h=(()=>{var g,m,v,y,b,_,w;return((m=(g=e.cardState)==null?void 0:g.error)==null?void 0:m.availability)==="identity-unavailable"?{label:"Sign in",className:"kb-card-state-badge kb-card-state-badge--identity bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",title:e.cardState.error.message}:((y=(v=e.cardState)==null?void 0:v.error)==null?void 0:y.availability)==="unavailable"?{label:"State off",className:"kb-card-state-badge kb-card-state-badge--unavailable bg-zinc-200 text-zinc-700 dark:bg-zinc-700 dark:text-zinc-200",title:e.cardState.error.message}:(_=(b=e.cardState)==null?void 0:b.unread)!=null&&_.unread?{label:"Unread",className:"kb-card-state-badge kb-card-state-badge--unread bg-sky-100 text-sky-700 dark:bg-sky-900/30 dark:text-sky-300",title:"Unread activity is waiting on this card"}:(w=e.cardState)!=null&&w.open?{label:"Opened",className:"kb-card-state-badge kb-card-state-badge--opened bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300",title:`Last opened ${new Date(e.cardState.open.value.openedAt).toLocaleString()}`}:null})();return l.jsxs("div",{onClick:t,className:["group kb-card",`kb-card-priority--${e.priority}`,n?"kb-card--selected":"",r?"shadow-lg opacity-90":""].filter(Boolean).join(" "),children:[l.jsxs("div",{className:"flex-1",children:[s.showFileName&&u&&l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(n1,{size:10,className:"shrink-0 text-zinc-400 dark:text-zinc-400"}),l.jsx("span",{className:"text-[10px] font-mono text-zinc-400 dark:text-zinc-400 truncate flex-1",children:u}),s.showPriorityBadges&&l.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded shrink-0 ${Yf[e.priority]}`,children:Jf[e.priority]})]}),l.jsxs("div",{className:`flex items-start gap-2 ${i?"mb-1":"mb-2"}`,children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100 line-clamp-2 flex-1",children:a}),h&&l.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded shrink-0 ${h.className}`,title:h.title,children:h.label}),s.showPriorityBadges&&!(s.showFileName&&u)&&l.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded shrink-0 ${Yf[e.priority]}`,children:Jf[e.priority]})]}),i&&l.jsx("p",{className:`text-xs text-zinc-500 dark:text-zinc-400 ${s.compactMode?"line-clamp-1":"line-clamp-2"} mb-1.5`,children:QC(i)}),s.showLabels&&e.labels.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[(s.compactMode?e.labels.slice(0,2):e.labels.slice(0,4)).map(g=>{const m=o[g];return l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${m?"":"bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300"}`,style:m?{backgroundColor:`${m.color}20`,color:m.color}:void 0,children:g},g)}),(s.compactMode?e.labels.length>2:e.labels.length>4)&&l.jsxs("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400 px-0.5 py-0.5 leading-tight",children:["+",e.labels.length-(s.compactMode?2:4)]})]})]}),l.jsxs("div",{className:"flex items-center justify-between text-xs mt-auto",children:[l.jsx("div",{className:"flex items-center gap-1",children:s.showAssignee&&e.assignee&&e.assignee!=="null"&&l.jsxs("div",{className:"flex items-center gap-1.5 text-zinc-500 dark:text-zinc-400",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:e.assignee.split(/\s+/).map(g=>g[0]).join("").toUpperCase().slice(0,2)}),l.jsx("span",{children:e.assignee})]})}),e.attachments.length>0&&l.jsxs("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:[l.jsx(Gm,{size:12}),l.jsx("span",{children:e.attachments.length})]}),e.metadata&&Object.keys(e.metadata).length>0&&l.jsx("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:l.jsx("span",{className:"text-[10px] font-mono",children:`{${Object.keys(e.metadata).length}}`})}),s.showDueDate&&d&&l.jsxs("div",{className:`flex items-center gap-1 ${d.className}`,children:[l.jsx(Dc,{size:12}),l.jsx("span",{children:d.text})]}),p&&l.jsxs("div",{className:"flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(jt,{size:12}),l.jsx("span",{children:p})]}),l.jsxs("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",title:JC(e.created,e.modified),children:[l.jsx(Ll,{size:12}),l.jsx("span",{children:oa(e.modified)})]})]})]})}function e$({status:e,onAdd:t}){const{cardSettings:r}=q(),[n,s]=x.useState(!1),[o,a]=x.useState(""),i=x.useRef(null);x.useEffect(()=>{n&&i.current&&i.current.focus()},[n]);const u=()=>{const d=o.trim();if(d){const f=`# ${d}`;t({status:e,priority:r.defaultPriority,content:f}),a("")}s(!1)},c=d=>{d.key==="Enter"?(d.preventDefault(),u()):d.key==="Escape"&&(a(""),s(!1))};return n?l.jsx("input",{ref:i,type:"text",value:o,onChange:d=>a(d.target.value),onBlur:u,onKeyDown:c,placeholder:"Card title...",className:"kb-quick-add-input"}):l.jsxs("button",{onClick:()=>s(!0),className:"kb-quick-add-btn",children:[l.jsx(Zr,{size:13}),l.jsx("span",{children:"Add card"})]})}const t$=[{value:"order",label:"Board Order"},{value:"created:asc",label:"Created (oldest)"},{value:"created:desc",label:"Created (newest)"},{value:"modified:asc",label:"Modified (oldest)"},{value:"modified:desc",label:"Modified (newest)"}],r$="application/x-column-id",n$="kanban-column:";function s$(e,t){var n,s,o;const r=Array.from(((n=e.dataTransfer)==null?void 0:n.types)??[]);if(r.includes(r$))return!0;if(r.includes("text/plain"))try{if((((o=(s=e.dataTransfer)==null?void 0:s.getData)==null?void 0:o.call(s,"text/plain"))??"").startsWith(n$))return!0}catch{}return!!t}function Zf({column:e,columnIndex:t,cards:r,onCardClick:n,onAddCard:s,onEditColumn:o,onRemoveColumn:a,onCleanupColumn:i,onDragStart:u,onDragOver:c,onDragOverCard:d,onDrop:f,onDragEnd:p,draggedCard:h,dropTarget:g,draggedColumnId:m,dropColumnIndex:v,onColumnDragStart:y,onColumnDragOver:b,onColumnDrop:_,onColumnDragEnd:w,isMinimized:$=!1,onToggleMinimized:R,layout:M,isDeletedColumn:D,onPurgeColumn:j,selectedCardId:S,selectedCardIds:E,onSelectAll:P,sort:W,onSortChange:G,onQuickAdd:L,onTriggerAction:V}){const O=M==="vertical",re=I=>s$(I,m),J=g&&g.columnId===e.id,K=!D&&v===t&&m!==e.id,A=!D&&v===t+1&&m!==e.id,Y=m===e.id,z="0 1px 2px 0 rgb(0 0 0 / 0.05)",k=O?"border-t-2 border-blue-500":"border-l-2 border-blue-500",C=O?"border-b-2 border-blue-500":"border-r-2 border-blue-500",N={...K?O?{borderTopColor:"#3b82f6"}:{borderLeftColor:"#3b82f6"}:{},...A?O?{borderBottomColor:"#3b82f6"}:{borderRightColor:"#3b82f6"}:{},...K||A?{boxShadow:`${z}, ${O?K?"0 -8px 18px -14px rgba(59,130,246,0.65)":"0 8px 18px -14px rgba(59,130,246,0.65)":K?"-8px 0 18px -14px rgba(59,130,246,0.65)":"8px 0 18px -14px rgba(59,130,246,0.65)"}`}:{}},[B,H]=x.useState(!1),te=x.useRef(null),se=x.useMemo(()=>E.filter(I=>r.some(ae=>ae.id===I)),[E,r]),le=se.length>0?r.filter(I=>se.includes(I.id)):r,me=x.useMemo(()=>{const I={};for(const ae of le){if(!ae.actions)continue;const ce=Array.isArray(ae.actions)?ae.actions.map(ee=>[ee,ee]):Object.entries(ae.actions);for(const[ee,de]of ce)I[ee]||(I[ee]={label:de,cardIds:[]}),I[ee].cardIds.push(ae.id)}return Object.entries(I)},[le]);return x.useEffect(()=>{if(!B)return;const I=ae=>{te.current&&!te.current.contains(ae.target)&&H(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[B]),$&&!D?l.jsx("div",{style:N,className:[O?"flex items-center gap-2 bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm px-2 py-1.5":"flex-shrink-0 w-10 h-full flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm",Y?"opacity-40":"",K?k:"",A?C:"",J&&h?"ring-2 ring-blue-400 dark:ring-blue-500":""].filter(Boolean).join(" "),onDragOver:I=>{re(I)?(I.preventDefault(),b(I,t)):c(I,e.id)},onDrop:I=>{re(I)?(I.stopPropagation(),_(I)):f(I,e.id)},children:l.jsxs("div",{className:O?"flex items-center gap-2 w-full cursor-grab active:cursor-grabbing":"flex flex-col items-center gap-1.5 px-1.5 py-1.5 cursor-grab active:cursor-grabbing h-full",draggable:!0,onDragStart:I=>y(I,e.id),onDragOver:I=>{re(I)&&(I.stopPropagation(),b(I,t))},onDrop:I=>{re(I)&&(I.stopPropagation(),_(I))},onDragEnd:w,children:[l.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),R()},className:"p-0.5 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors flex-shrink-0",title:`Expand ${e.name}`,children:l.jsx(s1,{size:12,className:"text-zinc-500"})}),O?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{backgroundColor:e.color}}),l.jsx("span",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100 truncate",title:e.name,children:e.name}),l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 font-medium tabular-nums",children:r.length})]}):l.jsxs("div",{className:"flex flex-col items-center gap-1.5 flex-1 justify-start min-h-0 overflow-hidden",children:[l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 font-medium tabular-nums",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:r.length}),l.jsx("span",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100 tracking-wide",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},title:e.name,children:e.name}),l.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0 mt-0.5",style:{backgroundColor:e.color}})]})]})}):l.jsxs("div",{style:N,className:[O?"flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm":"flex-shrink-0 w-72 h-full flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm",Y?"opacity-40":"",K?k:"",A?C:"",J&&h?"ring-2 ring-blue-400 dark:ring-blue-500":""].filter(Boolean).join(" "),onDragOver:I=>{re(I)?(I.preventDefault(),b(I,t)):c(I,e.id)},onDrop:I=>{re(I)?(I.stopPropagation(),_(I)):f(I,e.id)},children:[l.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between w-full px-3 py-2.5 border-b border-zinc-200 dark:border-zinc-700 cursor-grab active:cursor-grabbing bg-zinc-50 dark:bg-zinc-800 rounded-t-xl",draggable:!D,onDragStart:I=>{D||y(I,e.id)},onDragOver:I=>{D||!re(I)||(I.stopPropagation(),b(I,t))},onDrop:I=>{re(I)&&(I.stopPropagation(),_(I))},onDragEnd:w,children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),l.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:e.name}),l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full",children:r.length})]}),l.jsx("div",{className:"flex items-center gap-0.5",children:D?l.jsx("button",{type:"button",onClick:()=>{r.length!==0&&window.confirm(`Permanently delete all ${r.length} card${r.length===1?"":"s"} from disk?`)&&(j==null||j())},className:"p-1 rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors",title:"Permanently delete all cards",children:l.jsx(Kt,{size:16,className:"text-red-500"})}):l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>s(e.id),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:`Add to ${e.name}`,children:l.jsx(Zr,{size:16,className:"text-zinc-500"})}),l.jsxs("div",{className:"relative",ref:te,children:[l.jsx("button",{type:"button",onClick:()=>H(!B),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:"Column options",children:l.jsx(o1,{size:16,className:"text-zinc-500"})}),B&&l.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[170px]",children:[l.jsx("div",{className:"px-3 py-1 text-xs font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Sort by"}),t$.map(I=>l.jsxs("button",{type:"button",onClick:()=>{G(I.value)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(jt,{size:14,className:W===I.value?"text-blue-500":"invisible"}),I.label]},I.value)),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),o(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Lc,{size:14}),"Edit List"]}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),a(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-red-600 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Kt,{size:14}),"Remove List"]}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),i(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-orange-600 dark:text-orange-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Kt,{size:14}),"Cleanup List"]}),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),R()},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(a1,{size:14}),"Minimize List"]}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),P(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(i1,{size:14}),"Select All"]}),me.length>0&&V&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsx("div",{className:"px-3 py-1 text-xs font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Actions"}),me.map(([I,{label:ae,cardIds:ce}])=>l.jsxs("button",{type:"button",onClick:()=>{H(!1),ce.forEach(ee=>V(ee,I))},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(ga,{size:14,className:"text-amber-500 flex-shrink-0"}),l.jsx("span",{className:"flex-1 text-left truncate",children:ae}),l.jsx("span",{className:"text-xs text-zinc-400 dark:text-zinc-500 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full flex-shrink-0",children:ce.length})]},I))]})]})]})]})})]}),l.jsxs("div",{className:O?"flex-1 p-3 flex flex-wrap gap-2":"flex-1 overflow-y-auto p-3 space-y-2 min-h-[200px]",children:[r.map((I,ae)=>l.jsxs("div",{children:[J&&g.index===ae&&l.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1 mb-1"}),l.jsx("div",{draggable:!0,"data-card-id":I.id,onDragStart:ce=>u(ce,I),onDragOver:ce=>d(ce,e.id,ae),onDragEnd:p,className:`${O?"w-64":""} ${(h==null?void 0:h.id)===I.id?"opacity-40":""}`,children:l.jsx(XC,{card:I,onClick:ce=>n(I,ce),isSelected:E.includes(I.id)||I.id===S})})]},I.id)),J&&g.index===r.length&&r.length>0&&l.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1"}),r.length===0&&l.jsxs("div",{className:O?"flex items-center gap-2 py-4 px-1 text-zinc-400 dark:text-zinc-500":"flex flex-col items-center gap-1.5 py-8 text-zinc-400 dark:text-zinc-500",children:[l.jsx(l1,{size:O?14:20,className:"shrink-0 opacity-50"}),l.jsx("span",{className:O?"text-sm":"text-sm text-center",children:"No cards yet"}),!O&&l.jsx("span",{className:"text-[11px] text-center text-zinc-300 dark:text-zinc-600 max-w-[120px]",children:"Drag cards here or click + to add one"})]})]}),!D&&L&&l.jsx("div",{className:"px-2 pb-2",children:l.jsx(e$,{status:e.id,onAdd:L})})]})}const o$="application/x-column-id",a$="kanban-column:";function i$({onCardClick:e,onAddCard:t,onMoveCard:r,onMoveCards:n,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onPurgeDeletedCards:i,onReorderColumns:u,selectedCardId:c,selectedCardIds:d,onSelectAll:f,onQuickAdd:p,onTriggerAction:h}){const g=x.useRef(null),m=q(I=>I.cardSettings),v=q(I=>I.effectiveDrawerWidth),y=q(I=>I.columns),b=q(I=>I.currentBoard),_=q(I=>I.getFilteredCardsByStatus),w=q(I=>I.getCardsByStatus),$=q(I=>I.getHiddenColumnIds(b)),R=q(I=>I.getMinimizedColumnIds(b)),M=q(I=>I.toggleColumnMinimized),D=q(I=>I.layout),j=q(I=>I.columnSorts),S=q(I=>I.setColumnSort);x.useEffect(()=>{if(!c)return;const I=g.current;if(!I)return;const ce=setTimeout(()=>{const ee=I.querySelector(`[data-card-id="${c}"]`);if(!ee)return;const de=I.getBoundingClientRect(),ge=ee.getBoundingClientRect();if(!(ge.left>=de.left&&ge.right<=de.right)){const Ce=ge.right-de.right;I.scrollBy({left:Ce+10,behavior:"smooth"})}ee.scrollIntoView({behavior:"smooth",block:"nearest"})},50);return()=>clearTimeout(ce)},[m.panelMode,v,c]);const[E,P]=x.useState(null),[W,G]=x.useState(null),[L,V]=x.useState(null),O=x.useRef(null),[re,J]=x.useState(null),K=x.useCallback((I,ae)=>{P(ae),I.dataTransfer.effectAllowed="move",d.length>1&&d.includes(ae.id)?I.dataTransfer.setData("text/plain",JSON.stringify(d)):I.dataTransfer.setData("text/plain",ae.id)},[d]),A=x.useCallback((I,ae)=>{I.preventDefault(),I.dataTransfer.dropEffect="move",!O.current&&ae&&G(ce=>(ce==null?void 0:ce.columnId)===ae?ce:{columnId:ae,index:0})},[]),Y=x.useCallback((I,ae,ce)=>{if(I.preventDefault(),I.dataTransfer.dropEffect="move",O.current)return;const ee=I.currentTarget.getBoundingClientRect(),de=ee.top+ee.height/2,ge=I.clientY<de?ce:ce+1;G(Ee=>Ee&&Ee.columnId===ae&&Ee.index===ge?Ee:{columnId:ae,index:ge})},[]),z=x.useCallback((I,ae)=>{if(I.preventDefault(),!E)return;if(d.length>1&&d.includes(E.id)){n([...d],ae),P(null),G(null);return}const ce=_(ae);let ee;if(W&&W.columnId===ae?ee=W.index:ee=ce.length,E.status===ae){const Ce=ce.findIndex(Ie=>Ie.id===E.id);if(Ce!==-1&&ee>Ce&&ee--,Ce===ee){P(null),G(null);return}}const de=w(ae).filter(Ce=>Ce.id!==E.id),ge=ce.filter(Ce=>Ce.id!==E.id);let Ee;if(ge.length===0)Ee=de.length;else if(ee>=ge.length){const Ce=ge[ge.length-1];Ee=de.findIndex(Ge=>Ge.id===Ce.id)+1}else{const Ce=ge[ee];Ee=de.findIndex(Ie=>Ie.id===Ce.id)}r(E.id,ae,Ee),P(null),G(null)},[E,W,d,_,w,r,n]),k=x.useCallback(()=>{P(null),G(null)},[]),C=x.useCallback((I,ae)=>{O.current=ae,V(ae),G(null),I.dataTransfer.effectAllowed="move",I.dataTransfer.setData(o$,ae),I.dataTransfer.setData("text/plain",`${a$}${ae}`)},[]),N=x.useCallback((I,ae)=>{I.preventDefault(),I.dataTransfer.dropEffect="move";const ce=I.currentTarget.getBoundingClientRect(),ee=D==="vertical"?I.clientY<ce.top+ce.height/2?ae:ae+1:I.clientX<ce.left+ce.width/2?ae:ae+1;J(de=>de===ee?de:ee)},[D]),B=x.useCallback(I=>{I.preventDefault();const ae=O.current??L;if(!ae||re===null){O.current=null,V(null),J(null);return}const ce=new Set($),ee=y.map(Ie=>Ie.id),de=ee.filter(Ie=>!ce.has(Ie)),ge=de.indexOf(ae);if(ge===-1){O.current=null,V(null),J(null);return}const Ee=[...de];Ee.splice(ge,1);const Ce=re>ge?re-1:re;if(Ee.splice(Ce,0,ae),Ee.join()!==de.join()){let Ie=0;const Ge=ee.map(it=>ce.has(it)?it:Ee[Ie++]);u(Ge)}O.current=null,V(null),J(null)},[y,L,re,$,u]),H=x.useCallback(()=>{O.current=null,V(null),J(null)},[]),te=D==="vertical",se=new Set($),le=new Set(R),me=y.filter(I=>!se.has(I.id));return l.jsx("div",{ref:g,className:te?"h-full overflow-y-auto px-5 py-4":"h-full overflow-x-auto px-5 py-4",children:l.jsxs("div",{className:te?"flex flex-col gap-5":"flex gap-5 h-full min-w-max",children:[y.length===0&&l.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-zinc-400 dark:text-zinc-500",children:[l.jsx(Fl,{size:40,className:"opacity-30"}),l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-500 dark:text-zinc-400",children:"No lists yet"}),l.jsx("p",{className:"text-[12px] mt-1 text-zinc-400 dark:text-zinc-500",children:'Click "Add List" in the toolbar to create your first column'})]})]}),me.map((I,ae)=>l.jsx(Zf,{column:I,columnIndex:ae,cards:_(I.id),onCardClick:e,onAddCard:t,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onDragStart:K,onDragOver:A,onDragOverCard:Y,onDrop:z,onDragEnd:k,draggedCard:E,dropTarget:W,draggedColumnId:L,dropColumnIndex:re,onColumnDragStart:C,onColumnDragOver:N,onColumnDrop:B,onColumnDragEnd:H,isMinimized:le.has(I.id),onToggleMinimized:()=>M(b,I.id),layout:D,selectedCardId:c,selectedCardIds:d,onSelectAll:f,sort:j[I.id]||"order",onSortChange:ce=>S(I.id,ce),onQuickAdd:p,onTriggerAction:h},I.id)),m.showDeletedColumn&&l.jsx(Zf,{column:bs,columnIndex:y.length,cards:_(bs.id),onCardClick:e,onAddCard:t,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onDragStart:K,onDragOver:A,onDragOverCard:Y,onDrop:z,onDragEnd:k,draggedCard:E,dropTarget:W,draggedColumnId:L,dropColumnIndex:re,onColumnDragStart:C,onColumnDragOver:N,onColumnDrop:B,onColumnDragEnd:H,layout:D,isDeletedColumn:!0,onPurgeColumn:i,selectedCardId:c,selectedCardIds:d,onSelectAll:f,sort:j[bs.id]||"order",onSortChange:I=>S(bs.id,I)},bs.id)]})})}const l$=["Mo","Tu","We","Th","Fr","Sa","Su"],c$=["January","February","March","April","May","June","July","August","September","October","November","December"];function u$({value:e,onChange:t,placeholder:r="Due date"}){const[n,s]=x.useState(!1),o=new Date,a=e?new Date(e+"T00:00:00"):null,[i,u]=x.useState((a==null?void 0:a.getFullYear())??o.getFullYear()),[c,d]=x.useState((a==null?void 0:a.getMonth())??o.getMonth()),f=new Date(i,c+1,0).getDate(),p=(new Date(i,c,1).getDay()+6)%7,h=Array(p).fill(null);for(let w=1;w<=f;w++)h.push(w);const g=()=>{c===0?(d(11),u(w=>w-1)):d(w=>w-1)},m=()=>{c===11?(d(0),u(w=>w+1)):d(w=>w+1)},v=w=>{const $=String(c+1).padStart(2,"0"),R=String(w).padStart(2,"0");t(`${i}-${$}-${R}`),s(!1)},y=w=>w===o.getDate()&&c===o.getMonth()&&i===o.getFullYear(),b=w=>a!==null&&w===a.getDate()&&c===a.getMonth()&&i===a.getFullYear(),_=w=>new Date(w+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>s(!n),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:e?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:[l.jsx("span",{children:e?_(e):r}),e&&l.jsx("span",{role:"button",onClick:w=>{w.stopPropagation(),t(""),s(!1)},className:"ml-0.5 hover:text-red-500 transition-colors",children:l.jsx(st,{size:12})})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-3 w-[252px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("button",{type:"button",onClick:g,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:l.jsx(c1,{size:14})}),l.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:[c$[c]," ",i]}),l.jsx("button",{type:"button",onClick:m,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:l.jsx(u1,{size:14})})]}),l.jsx("div",{className:"grid grid-cols-7 mb-1",children:l$.map(w=>l.jsx("div",{className:"text-center text-[10px] font-medium py-1",style:{color:"var(--vscode-descriptionForeground)"},children:w},w))}),l.jsx("div",{className:"grid grid-cols-7",children:h.map((w,$)=>l.jsx("div",{className:"flex items-center justify-center",children:w?l.jsx("button",{type:"button",onClick:()=>v(w),className:Ae("w-7 h-7 rounded-md text-[11px] transition-colors font-medium"),style:{background:b(w)?"var(--vscode-focusBorder)":y(w)?"var(--vscode-editor-selectionBackground)":void 0,color:b(w)?"var(--vscode-editor-background)":(y(w),"var(--vscode-foreground)")},onMouseEnter:R=>{b(w)||(R.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:R=>{!b(w)&&!y(w)?R.currentTarget.style.background="transparent":y(w)&&!b(w)&&(R.currentTarget.style.background="var(--vscode-editor-selectionBackground)")},children:w}):l.jsx("div",{className:"w-7 h-7"})},$))}),l.jsx("div",{className:"mt-2 pt-2 flex justify-center",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:l.jsx("button",{type:"button",onClick:()=>{const w=String(o.getMonth()+1).padStart(2,"0"),$=String(o.getDate()).padStart(2,"0");t(`${o.getFullYear()}-${w}-${$}`),s(!1)},className:"text-[11px] font-medium transition-colors",style:{color:"var(--vscode-textLink-foreground)"},onMouseEnter:w=>w.currentTarget.style.color="var(--vscode-textLink-activeForeground)",onMouseLeave:w=>w.currentTarget.style.color="var(--vscode-textLink-foreground)",children:"Today"})})]})]})]})}function eu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var an=eu();function l0(e){an=e}var Wr={exec:()=>null};function $e(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(s,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(ct.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,t)};return n}var d$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ct={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {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,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,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:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},f$=/^(?:[ \t]*(?:\n|$))+/,h$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,p$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,m$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tu=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,c0=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,u0=$e(c0).replace(/bull/g,tu).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),g$=$e(c0).replace(/bull/g,tu).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ru=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,v$=/^[^\n]+/,nu=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,y$=$e(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",nu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),b$=$e(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tu).getRegex(),di="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",su=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,x$=$e("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",su).replace("tag",di).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),d0=$e(ru).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",di).getRegex(),w$=$e(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",d0).getRegex(),ou={blockquote:w$,code:h$,def:y$,fences:p$,heading:m$,hr:ao,html:x$,lheading:u0,list:b$,newline:f$,paragraph:d0,table:Wr,text:v$},Qf=$e("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",di).getRegex(),k$={...ou,lheading:g$,table:Qf,paragraph:$e(ru).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qf).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",di).getRegex()},_$={...ou,html:$e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",su).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:Wr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$e(ru).replace("hr",ao).replace("heading",` *#{1,6} *[^
32
+ ]`).replace("lheading",u0).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},C$=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$$=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,f0=/^( {2,}|\\)\n(?!\s*$)/,S$=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fi=/[\p{P}\p{S}]/u,au=/[\s\p{P}\p{S}]/u,h0=/[^\s\p{P}\p{S}]/u,j$=$e(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,au).getRegex(),p0=/(?!~)[\p{P}\p{S}]/u,E$=/(?!~)[\s\p{P}\p{S}]/u,A$=/(?:[^\s\p{P}\p{S}]|~)/u,m0=/(?![*_])[\p{P}\p{S}]/u,N$=/(?![*_])[\s\p{P}\p{S}]/u,P$=/(?:[^\s\p{P}\p{S}]|[*_])/u,R$=$e(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",d$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),g0=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,T$=$e(g0,"u").replace(/punct/g,fi).getRegex(),I$=$e(g0,"u").replace(/punct/g,p0).getRegex(),v0="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",M$=$e(v0,"gu").replace(/notPunctSpace/g,h0).replace(/punctSpace/g,au).replace(/punct/g,fi).getRegex(),z$=$e(v0,"gu").replace(/notPunctSpace/g,A$).replace(/punctSpace/g,E$).replace(/punct/g,p0).getRegex(),O$=$e("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,h0).replace(/punctSpace/g,au).replace(/punct/g,fi).getRegex(),D$=$e(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,m0).getRegex(),L$="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",F$=$e(L$,"gu").replace(/notPunctSpace/g,P$).replace(/punctSpace/g,N$).replace(/punct/g,m0).getRegex(),B$=$e(/\\(punct)/,"gu").replace(/punct/g,fi).getRegex(),U$=$e(/^<(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(),V$=$e(su).replace("(?:-->|$)","-->").getRegex(),W$=$e("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",V$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Pa=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,K$=$e(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Pa).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),y0=$e(/^!?\[(label)\]\[(ref)\]/).replace("label",Pa).replace("ref",nu).getRegex(),b0=$e(/^!?\[(ref)\](?:\[\])?/).replace("ref",nu).getRegex(),H$=$e("reflink|nolink(?!\\()","g").replace("reflink",y0).replace("nolink",b0).getRegex(),Xf=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,iu={_backpedal:Wr,anyPunctuation:B$,autolink:U$,blockSkip:R$,br:f0,code:$$,del:Wr,delLDelim:Wr,delRDelim:Wr,emStrongLDelim:T$,emStrongRDelimAst:M$,emStrongRDelimUnd:O$,escape:C$,link:K$,nolink:b0,punctuation:j$,reflink:y0,reflinkSearch:H$,tag:W$,text:S$,url:Wr},G$={...iu,link:$e(/^!?\[(label)\]\((.*?)\)/).replace("label",Pa).getRegex(),reflink:$e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Pa).getRegex()},ic={...iu,emStrongRDelimAst:z$,emStrongLDelim:I$,delLDelim:D$,delRDelim:F$,url:$e(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Xf).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$e(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Xf).getRegex()},q$={...ic,br:$e(f0).replace("{2,}","*").getRegex(),text:$e(ic.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bo={normal:ou,gfm:k$,pedantic:_$},_s={normal:iu,gfm:ic,breaks:q$,pedantic:G$},Y$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},eh=e=>Y$[e];function Lt(e,t){if(t){if(ct.escapeTest.test(e))return e.replace(ct.escapeReplace,eh)}else if(ct.escapeTestNoEncode.test(e))return e.replace(ct.escapeReplaceNoEncode,eh);return e}function th(e){try{e=encodeURI(e).replace(ct.percentDecode,"%")}catch{return null}return e}function rh(e,t){var o;let r=e.replace(ct.findPipe,(a,i,u)=>{let c=!1,d=i;for(;--d>=0&&u[d]==="\\";)c=!c;return c?"|":" |"}),n=r.split(ct.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!((o=n.at(-1))!=null&&o.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(ct.slashPipe,"|");return n}function Cs(e,t,r){let n=e.length;if(n===0)return"";let s=0;for(;s<n&&e.charAt(n-s-1)===t;)s++;return e.slice(0,n-s)}function J$(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function Z$(e,t=0){let r=t,n="";for(let s of e)if(s===" "){let o=4-r%4;n+=" ".repeat(o),r+=o}else n+=s,r++;return n}function nh(e,t,r,n,s){let o=t.href,a=t.title||null,i=e[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:a,text:i,tokens:n.inlineTokens(i)};return n.state.inLink=!1,u}function Q$(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let s=n[1];return t.split(`
33
33
  `).map(o=>{let a=o.match(r.other.beginningSpace);if(a===null)return o;let[i]=a;return i.length>=s.length?o.slice(s.length):o}).join(`
34
34
  `)}var Ra=class{constructor(e){Pe(this,"options");Pe(this,"rules");Pe(this,"lexer");this.options=e||an}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 r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Cs(r,`
35
35
  `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=Q$(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let n=Cs(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Cs(t[0],`
@@ -98,7 +98,7 @@ ${a}
98
98
  `).map((h,g)=>`${g+1}. ${h}`).join(`
99
99
  `):"1. ",d=a?c.length-a.length:3;break}case"tasklist":{c=a?a.split(`
100
100
  `).map(h=>`- [ ] ${h}`).join(`
101
- `):"- [ ] ",d=a?c.length-a.length:6;break}}const f=i+c+u;r(f),requestAnimationFrame(()=>{e.focus();const p=s+(a?c.length:d);e.selectionStart=e.selectionEnd=p})}function rt({icon:e,title:t,onClick:r,separator:n}){return l.jsxs(l.Fragment,{children:[n&&l.jsx("div",{className:"w-px h-4 mx-1",style:{background:"var(--vscode-panel-border)"}}),l.jsx("button",{type:"button",onClick:r,title:t,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:e})]})}const X$=new x0({gfm:!0,breaks:!0,renderer:{link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),s=t?` title="${t}"`:"";return`<a href="${e}"${s} target="_blank" rel="noopener noreferrer">${n}</a>`}}});function cu(e){const t=e.replace(new RegExp(`(?<!\\]\\(|"|'|<)(https?:\\/\\/[^\\s<>\\])"']+)`,"g"),"<$1>");return X$.parse(t,{async:!1})}const sh="kanban-comment-author";function oh({initialContent:e="",onSubmit:t,onCancel:r,submitLabel:n="Comment"}){const[s,o]=x.useState(()=>localStorage.getItem(sh)??""),[a,i]=x.useState(e),[u,c]=x.useState("write"),d=x.useRef(null),f=x.useRef(!0);x.useEffect(()=>{var y;if(f.current){f.current=!1;return}u==="write"&&((y=d.current)==null||y.focus())},[u]);const p=x.useMemo(()=>a.trim()?cu(a):"",[a]),h=x.useCallback(y=>{d.current&&w0(d.current,a,i,y)},[a]),g=()=>{const y=s.trim(),b=a.trim();!y||!b||(localStorage.setItem(sh,y),t(y,b),e||(i(""),c("write")))},m=y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),g()),(y.metaKey||y.ctrlKey)&&y.key==="b"&&(y.preventDefault(),h("bold")),(y.metaKey||y.ctrlKey)&&y.key==="i"&&(y.preventDefault(),h("italic")),(y.metaKey||y.ctrlKey)&&y.key==="k"&&(y.preventDefault(),h("link"))},v=s.trim().length>0&&a.trim().length>0;return l.jsxs("div",{className:"comment-editor-shell",children:[l.jsx("input",{type:"text",value:s,onChange:y=>o(y.target.value),placeholder:"Your name","aria-label":"Comment author name",className:"comment-editor-author outline-none",style:{color:"var(--vscode-foreground)"}}),l.jsxs("div",{className:"comment-editor-frame",children:[l.jsx("div",{className:"comment-editor-tabs",children:["write","preview"].map(y=>l.jsx("button",{type:"button",onClick:()=>c(y),className:`comment-editor-tab${u===y?" is-active":""}`,children:y},y))}),u==="write"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"comment-editor-toolbar",children:[l.jsx(rt,{icon:l.jsx(qm,{size:12}),title:"Bold (Cmd+B)",onClick:()=>h("bold")}),l.jsx(rt,{icon:l.jsx(Ym,{size:12}),title:"Italic (Cmd+I)",onClick:()=>h("italic")}),l.jsx(rt,{icon:l.jsx(Jm,{size:12}),title:"Quote",onClick:()=>h("quote"),separator:!0}),l.jsx(rt,{icon:l.jsx(Zm,{size:12}),title:"Code",onClick:()=>h("code")}),l.jsx(rt,{icon:l.jsx(Qm,{size:12}),title:"Link (Cmd+K)",onClick:()=>h("link"),separator:!0}),l.jsx(rt,{icon:l.jsx(Xm,{size:12}),title:"Unordered list",onClick:()=>h("ul"),separator:!0}),l.jsx(rt,{icon:l.jsx(eg,{size:12}),title:"Ordered list",onClick:()=>h("ol")})]}),l.jsx("textarea",{ref:d,value:a,onChange:y=>i(y.target.value),onKeyDown:m,placeholder:"Add a comment... (Markdown supported)",className:"comment-editor-textarea text-xs outline-none",style:{color:"var(--vscode-foreground)"},rows:5})]}):p?l.jsx("div",{className:"comment-editor-preview text-xs comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:p}}):l.jsx("div",{className:"comment-editor-empty text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})]}),l.jsxs("div",{className:"comment-editor-actions",children:[r&&l.jsx("button",{type:"button",onClick:r,className:"px-2.5 py-1 text-xs rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:"Cancel"}),l.jsx("button",{type:"button",onClick:g,disabled:!v,className:"card-inline-action card-inline-action--solid disabled:opacity-30",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:`${n} (Cmd+Enter)`,children:n})]})]})}function eS({content:e}){const t=x.useMemo(()=>cu(e),[e]);return l.jsx("div",{className:"comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:t}})}function tS(e){const t=Date.now(),r=new Date(e).getTime(),n=Math.floor((t-r)/1e3);if(n<60)return"just now";const s=Math.floor(n/60);if(s<60)return`${s}m ago`;const o=Math.floor(s/60);if(o<24)return`${o}h ago`;const a=Math.floor(o/24);return a<30?`${a}d ago`:new Date(e).toLocaleDateString()}function rS({comments:e,onAddComment:t,onUpdateComment:r,onDeleteComment:n}){const[s,o]=x.useState(null);return l.jsxs("div",{className:"card-comments-shell",children:[e.length>0&&l.jsx("div",{className:"card-comment-list",children:e.map(a=>l.jsxs("div",{className:"card-comment-item",children:[l.jsx("span",{className:"card-comment-avatar",children:a.author.split(/\s+/).filter(Boolean).map(i=>i[0]).join("").toUpperCase().slice(0,2)}),l.jsxs("div",{className:"card-comment-bubble",children:[l.jsxs("div",{className:"card-comment-meta",children:[l.jsx("span",{className:"card-comment-author",children:a.author}),l.jsx("span",{className:"card-comment-time",children:tS(a.created)}),l.jsxs("div",{className:"card-comment-actions",children:[l.jsx("button",{onClick:()=>o(a.id),className:"p-1 rounded-full transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Edit",children:l.jsx(Lc,{size:11})}),l.jsx("button",{onClick:()=>n(a.id),className:"p-1 rounded-full transition-colors hover:text-red-500",style:{color:"var(--vscode-descriptionForeground)"},title:"Delete",children:l.jsx(Kt,{size:11})})]})]}),s===a.id?l.jsx("div",{className:"mt-1",children:l.jsx(oh,{initialContent:a.content,submitLabel:"Save",onSubmit:(i,u)=>{r(a.id,u),o(null)},onCancel:()=>o(null)})}):l.jsx(eS,{content:a.content})]})]},a.id))}),l.jsx("div",{className:"card-comments-composer",children:l.jsx(oh,{onSubmit:(a,i)=>t(a,i),submitLabel:"Comment"})})]})}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function k0(e){return typeof e>"u"||e===null}function nS(e){return typeof e=="object"&&e!==null}function sS(e){return Array.isArray(e)?e:k0(e)?[]:[e]}function oS(e,t){var r,n,s,o;if(t)for(o=Object.keys(t),r=0,n=o.length;r<n;r+=1)s=o[r],e[s]=t[s];return e}function aS(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function iS(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var lS=k0,cS=nS,uS=sS,dS=aS,fS=iS,hS=oS,ln={isNothing:lS,isObject:cS,toArray:uS,repeat:dS,isNegativeZero:fS,extend:hS};function _0(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
101
+ `):"- [ ] ",d=a?c.length-a.length:6;break}}const f=i+c+u;r(f),requestAnimationFrame(()=>{e.focus();const p=s+(a?c.length:d);e.selectionStart=e.selectionEnd=p})}function rt({icon:e,title:t,onClick:r,separator:n}){return l.jsxs(l.Fragment,{children:[n&&l.jsx("div",{className:"w-px h-4 mx-1",style:{background:"var(--vscode-panel-border)"}}),l.jsx("button",{type:"button",onClick:r,title:t,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:e})]})}const X$=new x0({gfm:!0,breaks:!0,renderer:{link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),s=t?` title="${t}"`:"";return`<a href="${e}"${s} target="_blank" rel="noopener noreferrer">${n}</a>`}}});function cu(e){const t=e.replace(new RegExp(`(?<!\\]\\(|"|'|<)(https?:\\/\\/[^\\s<>\\])"']+)`,"g"),"<$1>");return X$.parse(t,{async:!1})}const sh="kanban-comment-author";function oh({initialContent:e="",onSubmit:t,onCancel:r,submitLabel:n="Comment"}){const[s,o]=x.useState(()=>localStorage.getItem(sh)??""),[a,i]=x.useState(e),[u,c]=x.useState("write"),d=x.useRef(null),f=x.useRef(!0);x.useEffect(()=>{var y;if(f.current){f.current=!1;return}u==="write"&&((y=d.current)==null||y.focus())},[u]);const p=x.useMemo(()=>a.trim()?cu(a):"",[a]),h=x.useCallback(y=>{d.current&&w0(d.current,a,i,y)},[a]),g=()=>{const y=s.trim(),b=a.trim();!y||!b||(localStorage.setItem(sh,y),t(y,b),e||(i(""),c("write")))},m=y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),g()),(y.metaKey||y.ctrlKey)&&y.key==="b"&&(y.preventDefault(),h("bold")),(y.metaKey||y.ctrlKey)&&y.key==="i"&&(y.preventDefault(),h("italic")),(y.metaKey||y.ctrlKey)&&y.key==="k"&&(y.preventDefault(),h("link"))},v=s.trim().length>0&&a.trim().length>0;return l.jsxs("div",{className:"comment-editor-shell",children:[l.jsx("input",{type:"text",value:s,onChange:y=>o(y.target.value),placeholder:"Your name","aria-label":"Comment author name",className:"comment-editor-author outline-none",style:{color:"var(--vscode-foreground)"}}),l.jsxs("div",{className:"comment-editor-frame",children:[l.jsx("div",{className:"comment-editor-tabs",children:["write","preview"].map(y=>l.jsx("button",{type:"button",onClick:()=>c(y),className:`comment-editor-tab${u===y?" is-active":""}`,children:y},y))}),u==="write"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"comment-editor-toolbar",children:[l.jsx(rt,{icon:l.jsx(qm,{size:12}),title:"Bold (Cmd+B)",onClick:()=>h("bold")}),l.jsx(rt,{icon:l.jsx(Ym,{size:12}),title:"Italic (Cmd+I)",onClick:()=>h("italic")}),l.jsx(rt,{icon:l.jsx(Jm,{size:12}),title:"Quote",onClick:()=>h("quote"),separator:!0}),l.jsx(rt,{icon:l.jsx(Zm,{size:12}),title:"Code",onClick:()=>h("code")}),l.jsx(rt,{icon:l.jsx(Qm,{size:12}),title:"Link (Cmd+K)",onClick:()=>h("link"),separator:!0}),l.jsx(rt,{icon:l.jsx(Xm,{size:12}),title:"Unordered list",onClick:()=>h("ul"),separator:!0}),l.jsx(rt,{icon:l.jsx(eg,{size:12}),title:"Ordered list",onClick:()=>h("ol")})]}),l.jsx("textarea",{ref:d,value:a,onChange:y=>i(y.target.value),onKeyDown:m,placeholder:"Add a comment... (Markdown supported)",className:"comment-editor-textarea text-xs outline-none",style:{color:"var(--vscode-foreground)"},rows:5})]}):p?l.jsx("div",{className:"comment-editor-preview text-xs comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:p}}):l.jsx("div",{className:"comment-editor-empty text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})]}),l.jsxs("div",{className:"comment-editor-actions",children:[r&&l.jsx("button",{type:"button",onClick:r,className:"px-2.5 py-1 text-xs rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:"Cancel"}),l.jsx("button",{type:"button",onClick:g,disabled:!v,className:"card-inline-action card-inline-action--solid disabled:opacity-30",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:`${n} (Cmd+Enter)`,children:n})]})]})}function eS({content:e}){const t=x.useMemo(()=>cu(e),[e]);return l.jsx("div",{className:"comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:t}})}function tS(e){const t=Date.now(),r=new Date(e).getTime(),n=Math.floor((t-r)/1e3);if(n<60)return"just now";const s=Math.floor(n/60);if(s<60)return`${s}m ago`;const o=Math.floor(s/60);if(o<24)return`${o}h ago`;const a=Math.floor(o/24);return a<30?`${a}d ago`:new Date(e).toLocaleDateString()}function rS({comments:e,onAddComment:t,onUpdateComment:r,onDeleteComment:n}){const[s,o]=x.useState(null);return l.jsxs("div",{className:"card-comments-shell",children:[e.length>0&&l.jsx("div",{className:"card-comment-list",children:e.map(a=>l.jsxs("div",{className:`card-comment-item${a.streaming?" card-comment-streaming":""}`,children:[l.jsx("span",{className:"card-comment-avatar",children:a.author.split(/\s+/).filter(Boolean).map(i=>i[0]).join("").toUpperCase().slice(0,2)}),l.jsxs("div",{className:"card-comment-bubble",children:[l.jsxs("div",{className:"card-comment-meta",children:[l.jsx("span",{className:"card-comment-author",children:a.author}),a.streaming&&l.jsx("span",{className:"card-comment-streaming-badge",title:"Being written by an agent…",children:"streaming"}),l.jsx("span",{className:"card-comment-time",children:tS(a.created)}),!a.streaming&&l.jsxs("div",{className:"card-comment-actions",children:[l.jsx("button",{onClick:()=>o(a.id),className:"p-1 rounded-full transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Edit",children:l.jsx(Lc,{size:11})}),l.jsx("button",{onClick:()=>n(a.id),className:"p-1 rounded-full transition-colors hover:text-red-500",style:{color:"var(--vscode-descriptionForeground)"},title:"Delete",children:l.jsx(Kt,{size:11})})]})]}),s===a.id?l.jsx("div",{className:"mt-1",children:l.jsx(oh,{initialContent:a.content,submitLabel:"Save",onSubmit:(i,u)=>{r(a.id,u),o(null)},onCancel:()=>o(null)})}):l.jsxs("div",{className:"card-comment-content-wrap",children:[l.jsx(eS,{content:a.content}),a.streaming&&l.jsx("span",{className:"card-comment-cursor","aria-hidden":"true"})]})]})]},a.id))}),l.jsx("div",{className:"card-comments-composer",children:l.jsx(oh,{onSubmit:(a,i)=>t(a,i),submitLabel:"Comment"})})]})}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function k0(e){return typeof e>"u"||e===null}function nS(e){return typeof e=="object"&&e!==null}function sS(e){return Array.isArray(e)?e:k0(e)?[]:[e]}function oS(e,t){var r,n,s,o;if(t)for(o=Object.keys(t),r=0,n=o.length;r<n;r+=1)s=o[r],e[s]=t[s];return e}function aS(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function iS(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var lS=k0,cS=nS,uS=sS,dS=aS,fS=iS,hS=oS,ln={isNothing:lS,isObject:cS,toArray:uS,repeat:dS,isNegativeZero:fS,extend:hS};function _0(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
102
102
 
103
103
  `+e.mark.snippet),n+" "+r):n}function eo(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=_0(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}eo.prototype=Object.create(Error.prototype);eo.prototype.constructor=eo;eo.prototype.toString=function(t){return this.name+": "+_0(this,t)};var $t=eo,pS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],mS=["scalar","sequence","mapping"];function gS(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function vS(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(pS.indexOf(r)===-1)throw new $t('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=gS(t.styleAliases||null),mS.indexOf(this.kind)===-1)throw new $t('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ot=vS;function ah(e,t){var r=[];return e[t].forEach(function(n){var s=r.length;r.forEach(function(o,a){o.tag===n.tag&&o.kind===n.kind&&o.multi===n.multi&&(s=a)}),r[s]=n}),r}function yS(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(s){s.multi?(e.multi[s.kind].push(s),e.multi.fallback.push(s)):e[s.kind][s.tag]=e.fallback[s.tag]=s}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function uc(e){return this.extend(e)}uc.prototype.extend=function(t){var r=[],n=[];if(t instanceof ot)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new $t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(o){if(!(o instanceof ot))throw new $t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new $t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new $t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(o){if(!(o instanceof ot))throw new $t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var s=Object.create(uc.prototype);return s.implicit=(this.implicit||[]).concat(r),s.explicit=(this.explicit||[]).concat(n),s.compiledImplicit=ah(s,"implicit"),s.compiledExplicit=ah(s,"explicit"),s.compiledTypeMap=yS(s.compiledImplicit,s.compiledExplicit),s};var bS=uc,xS=new ot("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),wS=new ot("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),kS=new ot("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),_S=new bS({explicit:[xS,wS,kS]});function CS(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function $S(){return null}function SS(e){return e===null}var jS=new ot("tag:yaml.org,2002:null",{kind:"scalar",resolve:CS,construct:$S,predicate:SS,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function ES(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function AS(e){return e==="true"||e==="True"||e==="TRUE"}function NS(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var PS=new ot("tag:yaml.org,2002:bool",{kind:"scalar",resolve:ES,construct:AS,predicate:NS,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function RS(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function TS(e){return 48<=e&&e<=55}function IS(e){return 48<=e&&e<=57}function MS(e){if(e===null)return!1;var t=e.length,r=0,n=!1,s;if(!t)return!1;if(s=e[r],(s==="-"||s==="+")&&(s=e[++r]),s==="0"){if(r+1===t)return!0;if(s=e[++r],s==="b"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(s!=="0"&&s!=="1")return!1;n=!0}return n&&s!=="_"}if(s==="x"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!RS(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}if(s==="o"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!TS(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}}if(s==="_")return!1;for(;r<t;r++)if(s=e[r],s!=="_"){if(!IS(e.charCodeAt(r)))return!1;n=!0}return!(!n||s==="_")}function zS(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function OS(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ln.isNegativeZero(e)}var DS=new ot("tag:yaml.org,2002:int",{kind:"scalar",resolve:MS,construct:zS,predicate:OS,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),LS=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function FS(e){return!(e===null||!LS.test(e)||e[e.length-1]==="_")}function BS(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var US=/^[-+]?[0-9]+e/;function VS(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ln.isNegativeZero(e))return"-0.0";return r=e.toString(10),US.test(r)?r.replace("e",".e"):r}function WS(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ln.isNegativeZero(e))}var KS=new ot("tag:yaml.org,2002:float",{kind:"scalar",resolve:FS,construct:BS,predicate:WS,represent:VS,defaultStyle:"lowercase"}),HS=_S.extend({implicit:[jS,PS,DS,KS]}),GS=HS,C0=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),$0=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function qS(e){return e===null?!1:C0.exec(e)!==null||$0.exec(e)!==null}function YS(e){var t,r,n,s,o,a,i,u=0,c=null,d,f,p;if(t=C0.exec(e),t===null&&(t=$0.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(r,n,s));if(o=+t[4],a=+t[5],i=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(d=+t[10],f=+(t[11]||0),c=(d*60+f)*6e4,t[9]==="-"&&(c=-c)),p=new Date(Date.UTC(r,n,s,o,a,i,u)),c&&p.setTime(p.getTime()-c),p}function JS(e){return e.toISOString()}var ZS=new ot("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:qS,construct:YS,instanceOf:Date,represent:JS});function QS(e){return e==="<<"||e===null}var XS=new ot("tag:yaml.org,2002:merge",{kind:"scalar",resolve:QS}),uu=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
104
104
  \r`;function ej(e){if(e===null)return!1;var t,r,n=0,s=e.length,o=uu;for(r=0;r<s;r++)if(t=o.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function tj(e){var t,r,n=e.replace(/[\r\n=]/g,""),s=n.length,o=uu,a=0,i=[];for(t=0;t<s;t++)t%4===0&&t&&(i.push(a>>16&255),i.push(a>>8&255),i.push(a&255)),a=a<<6|o.indexOf(n.charAt(t));return r=s%4*6,r===0?(i.push(a>>16&255),i.push(a>>8&255),i.push(a&255)):r===18?(i.push(a>>10&255),i.push(a>>2&255)):r===12&&i.push(a>>4&255),new Uint8Array(i)}function rj(e){var t="",r=0,n,s,o=e.length,a=uu;for(n=0;n<o;n++)n%3===0&&n&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[n];return s=o%3,s===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):s===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):s===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function nj(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var sj=new ot("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ej,construct:tj,predicate:nj,represent:rj}),oj=Object.prototype.hasOwnProperty,aj=Object.prototype.toString;function ij(e){if(e===null)return!0;var t=[],r,n,s,o,a,i=e;for(r=0,n=i.length;r<n;r+=1){if(s=i[r],a=!1,aj.call(s)!=="[object Object]")return!1;for(o in s)if(oj.call(s,o))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function lj(e){return e!==null?e:[]}var cj=new ot("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ij,construct:lj}),uj=Object.prototype.toString;function dj(e){if(e===null)return!0;var t,r,n,s,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(n=a[t],uj.call(n)!=="[object Object]"||(s=Object.keys(n),s.length!==1))return!1;o[t]=[s[0],n[s[0]]]}return!0}function fj(e){if(e===null)return[];var t,r,n,s,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1)n=a[t],s=Object.keys(n),o[t]=[s[0],n[s[0]]];return o}var hj=new ot("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:dj,construct:fj}),pj=Object.prototype.hasOwnProperty;function mj(e){if(e===null)return!0;var t,r=e;for(t in r)if(pj.call(r,t)&&r[t]!==null)return!1;return!0}function gj(e){return e!==null?e:{}}var vj=new ot("tag:yaml.org,2002:set",{kind:"mapping",resolve:mj,construct:gj}),yj=GS.extend({implicit:[ZS,XS],explicit:[sj,cj,hj,vj]});function ih(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
@@ -117,17 +117,17 @@ ${a}
117
117
  `+e.slice(s,o),s=o+1),a=i;return u+=`
118
118
  `,e.length-s>t&&a>s?u+=e.slice(s,a)+`
119
119
  `+e.slice(a+1):u+=e.slice(s),u.slice(1)}function Yj(e){for(var t="",r=0,n,s=0;s<e.length;r>=65536?s+=2:s++)r=Is(e,s),n=at[r],!n&&no(r)?(t+=e[s],r>=65536&&(t+=e[s+1])):t+=n||Fj(r);return t}function Jj(e,t,r){var n="",s=e.tag,o,a,i;for(o=0,a=r.length;o<a;o+=1)i=r[o],e.replacer&&(i=e.replacer.call(r,String(o),i)),(dr(e,t,i,!1,!1)||typeof i>"u"&&dr(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=s,e.dump="["+n+"]"}function ph(e,t,r,n){var s="",o=e.tag,a,i,u;for(a=0,i=r.length;a<i;a+=1)u=r[a],e.replacer&&(u=e.replacer.call(r,String(a),u)),(dr(e,t+1,u,!0,!0,!1,!0)||typeof u>"u"&&dr(e,t+1,null,!0,!0,!1,!0))&&((!n||s!=="")&&(s+=fc(e,t)),e.dump&&to===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=o,e.dump=s||"[]"}function Zj(e,t,r){var n="",s=e.tag,o=Object.keys(r),a,i,u,c,d;for(a=0,i=o.length;a<i;a+=1)d="",n!==""&&(d+=", "),e.condenseFlow&&(d+='"'),u=o[a],c=r[u],e.replacer&&(c=e.replacer.call(r,u,c)),dr(e,t,u,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),dr(e,t,c,!1,!1)&&(d+=e.dump,n+=d));e.tag=s,e.dump="{"+n+"}"}function Qj(e,t,r,n){var s="",o=e.tag,a=Object.keys(r),i,u,c,d,f,p;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new $t("sortKeys must be a boolean or a function");for(i=0,u=a.length;i<u;i+=1)p="",(!n||s!=="")&&(p+=fc(e,t)),c=a[i],d=r[c],e.replacer&&(d=e.replacer.call(r,c,d)),dr(e,t+1,c,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&to===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,f&&(p+=fc(e,t)),dr(e,t+1,d,!0,f)&&(e.dump&&to===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,s+=p));e.tag=o,e.dump=s||"{}"}function mh(e,t,r){var n,s,o,a,i,u;for(s=r?e.explicitTypes:e.implicitTypes,o=0,a=s.length;o<a;o+=1)if(i=s[o],(i.instanceOf||i.predicate)&&(!i.instanceOf||typeof t=="object"&&t instanceof i.instanceOf)&&(!i.predicate||i.predicate(t))){if(r?i.multi&&i.representName?e.tag=i.representName(t):e.tag=i.tag:e.tag="?",i.represent){if(u=e.styleMap[i.tag]||i.defaultStyle,S0.call(i.represent)==="[object Function]")n=i.represent(t,u);else if(j0.call(i.represent,u))n=i.represent[u](t,u);else throw new $t("!<"+i.tag+'> tag resolver accepts not "'+u+'" style');e.dump=n}return!0}return!1}function dr(e,t,r,n,s,o,a){e.tag=null,e.dump=r,mh(e,r,!1)||mh(e,r,!0);var i=S0.call(e.dump),u=n,c;n&&(n=e.flowLevel<0||e.flowLevel>t);var d=i==="[object Object]"||i==="[object Array]",f,p;if(d&&(f=e.duplicates.indexOf(r),p=f!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(s=!1),p&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(d&&p&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),i==="[object Object]")n&&Object.keys(e.dump).length!==0?(Qj(e,t,e.dump,s),p&&(e.dump="&ref_"+f+e.dump)):(Zj(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(i==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?ph(e,t-1,e.dump,s):ph(e,t,e.dump,s),p&&(e.dump="&ref_"+f+e.dump)):(Jj(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(i==="[object String]")e.tag!=="?"&&Gj(e,e.dump,t,o,u);else{if(i==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new $t("unacceptable kind of an object to dump "+i)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Xj(e,t){var r=[],n=[],s,o;for(pc(e,r,n),s=0,o=n.length;s<o;s+=1)t.duplicates.push(r[n[s]]);t.usedDuplicates=new Array(o)}function pc(e,t,r){var n,s,o;if(e!==null&&typeof e=="object")if(s=t.indexOf(e),s!==-1)r.indexOf(s)===-1&&r.push(s);else if(t.push(e),Array.isArray(e))for(s=0,o=e.length;s<o;s+=1)pc(e[s],t,r);else for(n=Object.keys(e),s=0,o=n.length;s<o;s+=1)pc(e[n[s]],t,r)}function eE(e,t){t=t||{};var r=new Uj(t);r.noRefs||Xj(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),dr(r,0,n,!0,!0)?r.dump+`
120
- `:""}var tE=eE,rE={dump:tE},nE=rE.dump;function sE(e){const t=new Date(e),r=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())} ${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`}function oE({text:e}){const t=x.useMemo(()=>cu(e),[e]);return l.jsx("span",{className:"log-text [&_p]:inline [&_p]:m-0",dangerouslySetInnerHTML:{__html:t}})}function O0(e){try{return nE(e,{indent:2,lineWidth:80,noRefs:!0}).trimEnd()}catch{return JSON.stringify(e,null,2)}}function aE(e){const t=JSON.stringify(e);return t.length>60?t.slice(0,59)+"…}":t}function iE({obj:e}){const t=x.useMemo(()=>O0(e),[e]);return l.jsx("pre",{className:"mt-1 px-2 py-1.5 rounded text-[10px] font-mono leading-relaxed overflow-x-auto",style:{background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.1))",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-panel-border)"},children:t})}function lE({obj:e}){const[t,r]=x.useState(!1),n=x.useMemo(()=>O0(e),[e]),s=x.useMemo(()=>aE(e),[e]);return t?l.jsxs("div",{style:{flexBasis:"100%"},className:"mt-1 flex items-start gap-1",children:[l.jsx("button",{type:"button",onClick:()=>r(!1),className:"inline-flex items-center shrink-0 px-1 py-1 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Collapse",children:l.jsx(d1,{size:10})}),l.jsx("pre",{className:"flex-1 px-2 py-1.5 rounded text-[10px] font-mono leading-relaxed overflow-x-auto",style:{background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.1))",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-panel-border)"},children:n})]}):l.jsx("button",{type:"button",onClick:()=>r(!0),className:"font-mono text-[10px] ml-1 px-1 rounded transition-colors vscode-hover-bg cursor-pointer",style:{color:"var(--vscode-descriptionForeground)",background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.08))"},title:"Click to expand",children:s})}function Uo({label:e,children:t}){const[r,n]=x.useState(!1);return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>n(!r),className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:[e,l.jsx(Ze,{size:10})]}),r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),l.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 rounded shadow-lg py-1 min-w-[120px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},onClick:()=>n(!1),children:t})]})]})}function Ji({label:e,active:t,onClick:r}){return l.jsxs("button",{type:"button",onClick:r,className:"w-full text-left px-3 py-1 text-[10px] transition-colors vscode-hover-bg flex items-center gap-2",style:{color:t?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:[l.jsx("span",{className:"w-3",children:t&&l.jsx(jt,{size:10})}),e]})}function Vo({label:e,checked:t,onChange:r}){return l.jsxs("button",{type:"button",onClick:n=>{n.stopPropagation(),r(!t)},className:"w-full text-left px-3 py-1 text-[10px] transition-colors vscode-hover-bg flex items-center gap-2",style:{color:"var(--vscode-foreground)"},children:[l.jsx("span",{className:"w-3 h-3 rounded-sm border flex items-center justify-center shrink-0",style:{borderColor:t?"var(--vscode-focusBorder)":"var(--vscode-checkbox-border, var(--vscode-panel-border))",background:t?"var(--vscode-focusBorder)":"transparent"},children:t&&l.jsx(jt,{size:8,style:{color:"var(--vscode-checkbox-foreground, white)"}})}),e]})}function D0({logs:e,onClearLogs:t,logsFilter:r,onLogsFilterChange:n}){const[s,o]=x.useState(()=>(r==null?void 0:r.limit)??"all"),[a,i]=x.useState(()=>(r==null?void 0:r.order)??"desc"),[u,c]=x.useState(()=>new Set((r==null?void 0:r.disabledSources)??[])),[d,f]=x.useState(()=>(r==null?void 0:r.show)??{timestamp:!0,source:!0,objects:!1}),p=x.useMemo(()=>{const m=new Set;for(const v of e)m.add(v.source);return Array.from(m).sort()},[e]),h=x.useMemo(()=>{let m=e;return u.size>0&&(m=m.filter(v=>!u.has(v.source))),m=[...m],a==="desc"&&m.reverse(),s!=="all"&&(m=m.slice(0,s)),m},[e,u,a,s]),g=[10,25,50,100,"all"];return x.useEffect(()=>{n==null||n({limit:s,order:a,disabledSources:Array.from(u),show:d})},[s,a,u,d]),l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"card-log-toolbar shrink-0",children:[l.jsxs("button",{type:"button",onClick:t,disabled:e.length===0,className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] rounded transition-colors vscode-hover-bg disabled:opacity-40",style:{color:"var(--vscode-descriptionForeground)"},title:"Clear all logs",children:[l.jsx(Kt,{size:10}),"Clear"]}),l.jsx("span",{className:"w-px h-4 mx-0.5",style:{background:"var(--vscode-panel-border)"}}),l.jsx(Uo,{label:l.jsxs(l.Fragment,{children:["Limit: ",s]}),children:g.map(m=>l.jsx(Ji,{label:String(m),active:s===m,onClick:()=>o(m)},String(m)))}),l.jsxs(Uo,{label:l.jsxs(l.Fragment,{children:["Order: ",a==="desc"?"Newest":"Oldest"]}),children:[l.jsx(Ji,{label:"Newest first",active:a==="desc",onClick:()=>i("desc")}),l.jsx(Ji,{label:"Oldest first",active:a==="asc",onClick:()=>i("asc")})]}),p.length>0&&l.jsx(Uo,{label:`Sources (${p.filter(m=>!u.has(m)).length}/${p.length})`,children:l.jsx("div",{onClick:m=>m.stopPropagation(),children:p.map(m=>l.jsx(Vo,{label:m,checked:!u.has(m),onChange:v=>c(y=>{const b=new Set(y);return v?b.delete(m):b.add(m),b})},m))})}),l.jsx(Uo,{label:"Show",children:l.jsxs("div",{onClick:m=>m.stopPropagation(),children:[l.jsx(Vo,{label:"Timestamp",checked:d.timestamp,onChange:m=>f(v=>({...v,timestamp:m}))}),l.jsx(Vo,{label:"Source",checked:d.source,onChange:m=>f(v=>({...v,source:m}))}),l.jsx(Vo,{label:"Objects",checked:d.objects,onChange:m=>f(v=>({...v,objects:m}))})]})}),l.jsxs("span",{className:"card-log-count",children:[h.length,s!=="all"&&e.length>s?` / ${e.length}`:""," entries"]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:h.length===0?l.jsx("p",{className:"p-4 text-xs italic",style:{color:"var(--vscode-descriptionForeground)"},children:e.length===0?"No log entries yet.":"No entries match the current filters."}):l.jsx("div",{className:"flex flex-col",children:h.map((m,v)=>l.jsxs("div",{className:"card-log-entry px-4 py-2 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.timestamp&&l.jsx("span",{className:"font-mono text-[10px] shrink-0",style:{color:"var(--vscode-descriptionForeground)"},title:m.timestamp,children:sE(m.timestamp)}),d.source&&l.jsx("span",{className:"text-[10px] font-medium px-1 rounded shrink-0",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:m.source}),l.jsx("span",{className:"comment-markdown inline text-xs leading-normal [&_p]:inline [&_p]:m-0",style:{color:"var(--vscode-foreground)"},children:l.jsx(oE,{text:m.text})}),!d.objects&&m.object&&l.jsx(lE,{obj:m.object})]}),d.objects&&m.object&&l.jsx(iE,{obj:m.object})]},`${m.timestamp}-${v}`))})})]})}var cE=typeof zo=="object"&&zo&&zo.Object===Object&&zo,L0=cE,uE=L0,dE=typeof self=="object"&&self&&self.Object===Object&&self,fE=uE||dE||Function("return this")(),ut=fE,hE=ut,pE=hE.Symbol,Yn=pE,gh=Yn,F0=Object.prototype,mE=F0.hasOwnProperty,gE=F0.toString,$s=gh?gh.toStringTag:void 0;function vE(e){var t=mE.call(e,$s),r=e[$s];try{e[$s]=void 0;var n=!0}catch{}var s=gE.call(e);return n&&(t?e[$s]=r:delete e[$s]),s}var yE=vE,bE=Object.prototype,xE=bE.toString;function wE(e){return xE.call(e)}var kE=wE,vh=Yn,_E=yE,CE=kE,$E="[object Null]",SE="[object Undefined]",yh=vh?vh.toStringTag:void 0;function jE(e){return e==null?e===void 0?SE:$E:yh&&yh in Object(e)?_E(e):CE(e)}var Ir=jE;function EE(e){return e!=null&&typeof e=="object"}var bt=EE,AE=Ir,NE=bt,PE="[object Symbol]";function RE(e){return typeof e=="symbol"||NE(e)&&AE(e)==PE}var Jn=RE,TE=Jn;function IE(e,t,r){for(var n=-1,s=e.length;++n<s;){var o=e[n],a=t(o);if(a!=null&&(i===void 0?a===a&&!TE(a):r(a,i)))var i=a,u=o}return u}var ME=IE;function zE(e,t){return e>t}var OE=zE;function DE(){this.__data__=[],this.size=0}var LE=DE;function FE(e,t){return e===t||e!==e&&t!==t}var io=FE,BE=io;function UE(e,t){for(var r=e.length;r--;)if(BE(e[r][0],t))return r;return-1}var hi=UE,VE=hi,WE=Array.prototype,KE=WE.splice;function HE(e){var t=this.__data__,r=VE(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():KE.call(t,r,1),--this.size,!0}var GE=HE,qE=hi;function YE(e){var t=this.__data__,r=qE(t,e);return r<0?void 0:t[r][1]}var JE=YE,ZE=hi;function QE(e){return ZE(this.__data__,e)>-1}var XE=QE,eA=hi;function tA(e,t){var r=this.__data__,n=eA(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var rA=tA,nA=LE,sA=GE,oA=JE,aA=XE,iA=rA;function Zn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Zn.prototype.clear=nA;Zn.prototype.delete=sA;Zn.prototype.get=oA;Zn.prototype.has=aA;Zn.prototype.set=iA;var pi=Zn,lA=pi;function cA(){this.__data__=new lA,this.size=0}var uA=cA;function dA(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var fA=dA;function hA(e){return this.__data__.get(e)}var pA=hA;function mA(e){return this.__data__.has(e)}var gA=mA;function vA(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var xt=vA,yA=Ir,bA=xt,xA="[object AsyncFunction]",wA="[object Function]",kA="[object GeneratorFunction]",_A="[object Proxy]";function CA(e){if(!bA(e))return!1;var t=yA(e);return t==wA||t==kA||t==xA||t==_A}var lo=CA;const $A=Se(lo);var SA=ut,jA=SA["__core-js_shared__"],EA=jA,Zi=EA,bh=function(){var e=/[^.]+$/.exec(Zi&&Zi.keys&&Zi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function AA(e){return!!bh&&bh in e}var NA=AA,PA=Function.prototype,RA=PA.toString;function TA(e){if(e!=null){try{return RA.call(e)}catch{}try{return e+""}catch{}}return""}var B0=TA,IA=lo,MA=NA,zA=xt,OA=B0,DA=/[\\^$.*+?()[\]{}|]/g,LA=/^\[object .+?Constructor\]$/,FA=Function.prototype,BA=Object.prototype,UA=FA.toString,VA=BA.hasOwnProperty,WA=RegExp("^"+UA.call(VA).replace(DA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function KA(e){if(!zA(e)||MA(e))return!1;var t=IA(e)?WA:LA;return t.test(OA(e))}var HA=KA;function GA(e,t){return e==null?void 0:e[t]}var qA=GA,YA=HA,JA=qA;function ZA(e,t){var r=JA(e,t);return YA(r)?r:void 0}var cn=ZA,QA=cn,XA=ut,eN=QA(XA,"Map"),fu=eN,tN=cn,rN=tN(Object,"create"),mi=rN,xh=mi;function nN(){this.__data__=xh?xh(null):{},this.size=0}var sN=nN;function oN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var aN=oN,iN=mi,lN="__lodash_hash_undefined__",cN=Object.prototype,uN=cN.hasOwnProperty;function dN(e){var t=this.__data__;if(iN){var r=t[e];return r===lN?void 0:r}return uN.call(t,e)?t[e]:void 0}var fN=dN,hN=mi,pN=Object.prototype,mN=pN.hasOwnProperty;function gN(e){var t=this.__data__;return hN?t[e]!==void 0:mN.call(t,e)}var vN=gN,yN=mi,bN="__lodash_hash_undefined__";function xN(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=yN&&t===void 0?bN:t,this}var wN=xN,kN=sN,_N=aN,CN=fN,$N=vN,SN=wN;function Qn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qn.prototype.clear=kN;Qn.prototype.delete=_N;Qn.prototype.get=CN;Qn.prototype.has=$N;Qn.prototype.set=SN;var jN=Qn,wh=jN,EN=pi,AN=fu;function NN(){this.size=0,this.__data__={hash:new wh,map:new(AN||EN),string:new wh}}var PN=NN;function RN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var TN=RN,IN=TN;function MN(e,t){var r=e.__data__;return IN(t)?r[typeof t=="string"?"string":"hash"]:r.map}var gi=MN,zN=gi;function ON(e){var t=zN(this,e).delete(e);return this.size-=t?1:0,t}var DN=ON,LN=gi;function FN(e){return LN(this,e).get(e)}var BN=FN,UN=gi;function VN(e){return UN(this,e).has(e)}var WN=VN,KN=gi;function HN(e,t){var r=KN(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var GN=HN,qN=PN,YN=DN,JN=BN,ZN=WN,QN=GN;function Xn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xn.prototype.clear=qN;Xn.prototype.delete=YN;Xn.prototype.get=JN;Xn.prototype.has=ZN;Xn.prototype.set=QN;var hu=Xn,XN=pi,eP=fu,tP=hu,rP=200;function nP(e,t){var r=this.__data__;if(r instanceof XN){var n=r.__data__;if(!eP||n.length<rP-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new tP(n)}return r.set(e,t),this.size=r.size,this}var sP=nP,oP=pi,aP=uA,iP=fA,lP=pA,cP=gA,uP=sP;function es(e){var t=this.__data__=new oP(e);this.size=t.size}es.prototype.clear=aP;es.prototype.delete=iP;es.prototype.get=lP;es.prototype.has=cP;es.prototype.set=uP;var vi=es,dP="__lodash_hash_undefined__";function fP(e){return this.__data__.set(e,dP),this}var hP=fP;function pP(e){return this.__data__.has(e)}var mP=pP,gP=hu,vP=hP,yP=mP;function za(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new gP;++t<r;)this.add(e[t])}za.prototype.add=za.prototype.push=vP;za.prototype.has=yP;var bP=za;function xP(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var wP=xP;function kP(e,t){return e.has(t)}var _P=kP,CP=bP,$P=wP,SP=_P,jP=1,EP=2;function AP(e,t,r,n,s,o){var a=r&jP,i=e.length,u=t.length;if(i!=u&&!(a&&u>i))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var f=-1,p=!0,h=r&EP?new CP:void 0;for(o.set(e,t),o.set(t,e);++f<i;){var g=e[f],m=t[f];if(n)var v=a?n(m,g,f,t,e,o):n(g,m,f,e,t,o);if(v!==void 0){if(v)continue;p=!1;break}if(h){if(!$P(t,function(y,b){if(!SP(h,b)&&(g===y||s(g,y,r,n,o)))return h.push(b)})){p=!1;break}}else if(!(g===m||s(g,m,r,n,o))){p=!1;break}}return o.delete(e),o.delete(t),p}var U0=AP,NP=ut,PP=NP.Uint8Array,V0=PP;function RP(e){var t=-1,r=Array(e.size);return e.forEach(function(n,s){r[++t]=[s,n]}),r}var W0=RP;function TP(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var IP=TP,kh=Yn,_h=V0,MP=io,zP=U0,OP=W0,DP=IP,LP=1,FP=2,BP="[object Boolean]",UP="[object Date]",VP="[object Error]",WP="[object Map]",KP="[object Number]",HP="[object RegExp]",GP="[object Set]",qP="[object String]",YP="[object Symbol]",JP="[object ArrayBuffer]",ZP="[object DataView]",Ch=kh?kh.prototype:void 0,Qi=Ch?Ch.valueOf:void 0;function QP(e,t,r,n,s,o,a){switch(r){case ZP:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case JP:return!(e.byteLength!=t.byteLength||!o(new _h(e),new _h(t)));case BP:case UP:case KP:return MP(+e,+t);case VP:return e.name==t.name&&e.message==t.message;case HP:case qP:return e==t+"";case WP:var i=OP;case GP:var u=n&LP;if(i||(i=DP),e.size!=t.size&&!u)return!1;var c=a.get(e);if(c)return c==t;n|=FP,a.set(e,t);var d=zP(i(e),i(t),n,s,o,a);return a.delete(e),d;case YP:if(Qi)return Qi.call(e)==Qi.call(t)}return!1}var XP=QP;function eR(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}var pu=eR,tR=Array.isArray,Ue=tR;const K0=Se(Ue);var rR=pu,nR=Ue;function sR(e,t,r){var n=t(e);return nR(e)?n:rR(n,r(e))}var H0=sR;function oR(e,t){for(var r=-1,n=e==null?0:e.length,s=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[s++]=a)}return o}var G0=oR;function aR(){return[]}var q0=aR,iR=G0,lR=q0,cR=Object.prototype,uR=cR.propertyIsEnumerable,$h=Object.getOwnPropertySymbols,dR=$h?function(e){return e==null?[]:(e=Object(e),iR($h(e),function(t){return uR.call(e,t)}))}:lR,mu=dR;function fR(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var hR=fR,pR=Ir,mR=bt,gR="[object Arguments]";function vR(e){return mR(e)&&pR(e)==gR}var yR=vR,Sh=yR,bR=bt,Y0=Object.prototype,xR=Y0.hasOwnProperty,wR=Y0.propertyIsEnumerable,kR=Sh(function(){return arguments}())?Sh:function(e){return bR(e)&&xR.call(e,"callee")&&!wR.call(e,"callee")},co=kR,Oa={exports:{}};function _R(){return!1}var CR=_R;Oa.exports;(function(e,t){var r=ut,n=CR,s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,i=a?r.Buffer:void 0,u=i?i.isBuffer:void 0,c=u||n;e.exports=c})(Oa,Oa.exports);var uo=Oa.exports,$R=9007199254740991,SR=/^(?:0|[1-9]\d*)$/;function jR(e,t){var r=typeof e;return t=t??$R,!!t&&(r=="number"||r!="symbol"&&SR.test(e))&&e>-1&&e%1==0&&e<t}var fo=jR,ER=9007199254740991;function AR(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ER}var gu=AR,NR=Ir,PR=gu,RR=bt,TR="[object Arguments]",IR="[object Array]",MR="[object Boolean]",zR="[object Date]",OR="[object Error]",DR="[object Function]",LR="[object Map]",FR="[object Number]",BR="[object Object]",UR="[object RegExp]",VR="[object Set]",WR="[object String]",KR="[object WeakMap]",HR="[object ArrayBuffer]",GR="[object DataView]",qR="[object Float32Array]",YR="[object Float64Array]",JR="[object Int8Array]",ZR="[object Int16Array]",QR="[object Int32Array]",XR="[object Uint8Array]",eT="[object Uint8ClampedArray]",tT="[object Uint16Array]",rT="[object Uint32Array]",ze={};ze[qR]=ze[YR]=ze[JR]=ze[ZR]=ze[QR]=ze[XR]=ze[eT]=ze[tT]=ze[rT]=!0;ze[TR]=ze[IR]=ze[HR]=ze[MR]=ze[GR]=ze[zR]=ze[OR]=ze[DR]=ze[LR]=ze[FR]=ze[BR]=ze[UR]=ze[VR]=ze[WR]=ze[KR]=!1;function nT(e){return RR(e)&&PR(e.length)&&!!ze[NR(e)]}var sT=nT;function oT(e){return function(t){return e(t)}}var vu=oT,Da={exports:{}};Da.exports;(function(e,t){var r=L0,n=t&&!t.nodeType&&t,s=n&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===n,a=o&&r.process,i=function(){try{var u=s&&s.require&&s.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}}();e.exports=i})(Da,Da.exports);var yu=Da.exports,aT=sT,iT=vu,jh=yu,Eh=jh&&jh.isTypedArray,lT=Eh?iT(Eh):aT,yi=lT,cT=hR,uT=co,dT=Ue,fT=uo,hT=fo,pT=yi,mT=Object.prototype,gT=mT.hasOwnProperty;function vT(e,t){var r=dT(e),n=!r&&uT(e),s=!r&&!n&&fT(e),o=!r&&!n&&!s&&pT(e),a=r||n||s||o,i=a?cT(e.length,String):[],u=i.length;for(var c in e)(t||gT.call(e,c))&&!(a&&(c=="length"||s&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||hT(c,u)))&&i.push(c);return i}var J0=vT,yT=Object.prototype;function bT(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||yT;return e===r}var bi=bT;function xT(e,t){return function(r){return e(t(r))}}var Z0=xT,wT=Z0,kT=wT(Object.keys,Object),_T=kT,CT=bi,$T=_T,ST=Object.prototype,jT=ST.hasOwnProperty;function ET(e){if(!CT(e))return $T(e);var t=[];for(var r in Object(e))jT.call(e,r)&&r!="constructor"&&t.push(r);return t}var bu=ET,AT=lo,NT=gu;function PT(e){return e!=null&&NT(e.length)&&!AT(e)}var mr=PT,RT=J0,TT=bu,IT=mr;function MT(e){return IT(e)?RT(e):TT(e)}var Jt=MT;const zT=Se(Jt);var OT=H0,DT=mu,LT=Jt;function FT(e){return OT(e,LT,DT)}var Q0=FT,Ah=Q0,BT=1,UT=Object.prototype,VT=UT.hasOwnProperty;function WT(e,t,r,n,s,o){var a=r&BT,i=Ah(e),u=i.length,c=Ah(t),d=c.length;if(u!=d&&!a)return!1;for(var f=u;f--;){var p=i[f];if(!(a?p in t:VT.call(t,p)))return!1}var h=o.get(e),g=o.get(t);if(h&&g)return h==t&&g==e;var m=!0;o.set(e,t),o.set(t,e);for(var v=a;++f<u;){p=i[f];var y=e[p],b=t[p];if(n)var _=a?n(b,y,p,t,e,o):n(y,b,p,e,t,o);if(!(_===void 0?y===b||s(y,b,r,n,o):_)){m=!1;break}v||(v=p=="constructor")}if(m&&!v){var w=e.constructor,$=t.constructor;w!=$&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof $=="function"&&$ instanceof $)&&(m=!1)}return o.delete(e),o.delete(t),m}var KT=WT,HT=cn,GT=ut,qT=HT(GT,"DataView"),YT=qT,JT=cn,ZT=ut,QT=JT(ZT,"Promise"),XT=QT,eI=cn,tI=ut,rI=eI(tI,"Set"),nI=rI,sI=cn,oI=ut,aI=sI(oI,"WeakMap"),X0=aI,mc=YT,gc=fu,vc=XT,yc=nI,bc=X0,ev=Ir,ts=B0,Nh="[object Map]",iI="[object Object]",Ph="[object Promise]",Rh="[object Set]",Th="[object WeakMap]",Ih="[object DataView]",lI=ts(mc),cI=ts(gc),uI=ts(vc),dI=ts(yc),fI=ts(bc),Br=ev;(mc&&Br(new mc(new ArrayBuffer(1)))!=Ih||gc&&Br(new gc)!=Nh||vc&&Br(vc.resolve())!=Ph||yc&&Br(new yc)!=Rh||bc&&Br(new bc)!=Th)&&(Br=function(e){var t=ev(e),r=t==iI?e.constructor:void 0,n=r?ts(r):"";if(n)switch(n){case lI:return Ih;case cI:return Nh;case uI:return Ph;case dI:return Rh;case fI:return Th}return t});var un=Br,Xi=vi,hI=U0,pI=XP,mI=KT,Mh=un,zh=Ue,Oh=uo,gI=yi,vI=1,Dh="[object Arguments]",Lh="[object Array]",Wo="[object Object]",yI=Object.prototype,Fh=yI.hasOwnProperty;function bI(e,t,r,n,s,o){var a=zh(e),i=zh(t),u=a?Lh:Mh(e),c=i?Lh:Mh(t);u=u==Dh?Wo:u,c=c==Dh?Wo:c;var d=u==Wo,f=c==Wo,p=u==c;if(p&&Oh(e)){if(!Oh(t))return!1;a=!0,d=!1}if(p&&!d)return o||(o=new Xi),a||gI(e)?hI(e,t,r,n,s,o):pI(e,t,u,r,n,s,o);if(!(r&vI)){var h=d&&Fh.call(e,"__wrapped__"),g=f&&Fh.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,v=g?t.value():t;return o||(o=new Xi),s(m,v,r,n,o)}}return p?(o||(o=new Xi),mI(e,t,r,n,s,o)):!1}var xI=bI,wI=xI,Bh=bt;function tv(e,t,r,n,s){return e===t?!0:e==null||t==null||!Bh(e)&&!Bh(t)?e!==e&&t!==t:wI(e,t,r,n,tv,s)}var xu=tv,kI=vi,_I=xu,CI=1,$I=2;function SI(e,t,r,n){var s=r.length,o=s,a=!n;if(e==null)return!o;for(e=Object(e);s--;){var i=r[s];if(a&&i[2]?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++s<o;){i=r[s];var u=i[0],c=e[u],d=i[1];if(a&&i[2]){if(c===void 0&&!(u in e))return!1}else{var f=new kI;if(n)var p=n(c,d,u,e,t,f);if(!(p===void 0?_I(d,c,CI|$I,n,f):p))return!1}}return!0}var jI=SI,EI=xt;function AI(e){return e===e&&!EI(e)}var rv=AI,NI=rv,PI=Jt;function RI(e){for(var t=PI(e),r=t.length;r--;){var n=t[r],s=e[n];t[r]=[n,s,NI(s)]}return t}var TI=RI;function II(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var nv=II,MI=jI,zI=TI,OI=nv;function DI(e){var t=zI(e);return t.length==1&&t[0][2]?OI(t[0][0],t[0][1]):function(r){return r===e||MI(r,e,t)}}var LI=DI,FI=Ue,BI=Jn,UI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,VI=/^\w*$/;function WI(e,t){if(FI(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||BI(e)?!0:VI.test(e)||!UI.test(e)||t!=null&&e in Object(t)}var wu=WI,sv=hu,KI="Expected a function";function ku(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(KI);var r=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=r.cache;if(o.has(s))return o.get(s);var a=e.apply(this,n);return r.cache=o.set(s,a)||o,a};return r.cache=new(ku.Cache||sv),r}ku.Cache=sv;var HI=ku,GI=HI,qI=500;function YI(e){var t=GI(e,function(n){return r.size===qI&&r.clear(),n}),r=t.cache;return t}var JI=YI,ZI=JI,QI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,XI=/\\(\\)?/g,eM=ZI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(QI,function(r,n,s,o){t.push(s?o.replace(XI,"$1"):n||r)}),t}),ov=eM;function tM(e,t){for(var r=-1,n=e==null?0:e.length,s=Array(n);++r<n;)s[r]=t(e[r],r,e);return s}var ho=tM,Uh=Yn,rM=ho,nM=Ue,sM=Jn,Vh=Uh?Uh.prototype:void 0,Wh=Vh?Vh.toString:void 0;function av(e){if(typeof e=="string")return e;if(nM(e))return rM(e,av)+"";if(sM(e))return Wh?Wh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var iv=av,oM=iv;function aM(e){return e==null?"":oM(e)}var rs=aM,iM=Ue,lM=wu,cM=ov,uM=rs;function dM(e,t){return iM(e)?e:lM(e,t)?[e]:cM(uM(e))}var xi=dM,fM=Jn;function hM(e){if(typeof e=="string"||fM(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var dn=hM,pM=xi,mM=dn;function gM(e,t){t=pM(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[mM(t[r++])];return r&&r==n?e:void 0}var _u=gM,vM=_u;function yM(e,t,r){var n=e==null?void 0:vM(e,t);return n===void 0?r:n}var lv=yM;const Qe=Se(lv);function bM(e,t){return e!=null&&t in Object(e)}var xM=bM,wM=xi,kM=co,_M=Ue,CM=fo,$M=gu,SM=dn;function jM(e,t,r){t=wM(t,e);for(var n=-1,s=t.length,o=!1;++n<s;){var a=SM(t[n]);if(!(o=e!=null&&r(e,a)))break;e=e[a]}return o||++n!=s?o:(s=e==null?0:e.length,!!s&&$M(s)&&CM(a,s)&&(_M(e)||kM(e)))}var cv=jM,EM=xM,AM=cv;function NM(e,t){return e!=null&&AM(e,t,EM)}var PM=NM,RM=xu,TM=lv,IM=PM,MM=wu,zM=rv,OM=nv,DM=dn,LM=1,FM=2;function BM(e,t){return MM(e)&&zM(t)?OM(DM(e),t):function(r){var n=TM(r,e);return n===void 0&&n===t?IM(r,e):RM(t,n,LM|FM)}}var UM=BM;function VM(e){return e}var wi=VM;function WM(e){return function(t){return t==null?void 0:t[e]}}var KM=WM,HM=_u;function GM(e){return function(t){return HM(t,e)}}var qM=GM,YM=KM,JM=qM,ZM=wu,QM=dn;function XM(e){return ZM(e)?YM(QM(e)):JM(e)}var e2=XM,t2=LI,r2=UM,n2=wi,s2=Ue,o2=e2;function a2(e){return typeof e=="function"?e:e==null?n2:typeof e=="object"?s2(e)?r2(e[0],e[1]):t2(e):o2(e)}var fn=a2,i2=ME,l2=OE,c2=fn;function u2(e,t){return e&&e.length?i2(e,c2(t),l2):void 0}var d2=u2;const ki=Se(d2);var f2=bu,h2=un,p2=co,m2=Ue,g2=mr,v2=uo,y2=bi,b2=yi,x2="[object Map]",w2="[object Set]",k2=Object.prototype,_2=k2.hasOwnProperty;function C2(e){if(e==null)return!0;if(g2(e)&&(m2(e)||typeof e=="string"||typeof e.splice=="function"||v2(e)||b2(e)||p2(e)))return!e.length;var t=h2(e);if(t==x2||t==w2)return!e.size;if(y2(e))return!f2(e).length;for(var r in e)if(_2.call(e,r))return!1;return!0}var $2=C2;const pe=Se($2);function S2(e,t,r,n){var s=-1,o=e==null?0:e.length;for(n&&o&&(r=e[++s]);++s<o;)r=t(r,e[s],s,e);return r}var uv=S2;function j2(e){return function(t){return e==null?void 0:e[t]}}var E2=j2,A2=E2,N2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},P2=A2(N2),R2=P2,T2=R2,I2=rs,M2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,z2="\\u0300-\\u036f",O2="\\ufe20-\\ufe2f",D2="\\u20d0-\\u20ff",L2=z2+O2+D2,F2="["+L2+"]",B2=RegExp(F2,"g");function U2(e){return e=I2(e),e&&e.replace(M2,T2).replace(B2,"")}var V2=U2,W2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function K2(e){return e.match(W2)||[]}var H2=K2,G2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function q2(e){return G2.test(e)}var Y2=q2,dv="\\ud800-\\udfff",J2="\\u0300-\\u036f",Z2="\\ufe20-\\ufe2f",Q2="\\u20d0-\\u20ff",X2=J2+Z2+Q2,fv="\\u2700-\\u27bf",hv="a-z\\xdf-\\xf6\\xf8-\\xff",ez="\\xac\\xb1\\xd7\\xf7",tz="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rz="\\u2000-\\u206f",nz=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pv="A-Z\\xc0-\\xd6\\xd8-\\xde",sz="\\ufe0e\\ufe0f",mv=ez+tz+rz+nz,gv="['’]",Kh="["+mv+"]",oz="["+X2+"]",vv="\\d+",az="["+fv+"]",yv="["+hv+"]",bv="[^"+dv+mv+vv+fv+hv+pv+"]",iz="\\ud83c[\\udffb-\\udfff]",lz="(?:"+oz+"|"+iz+")",cz="[^"+dv+"]",xv="(?:\\ud83c[\\udde6-\\uddff]){2}",wv="[\\ud800-\\udbff][\\udc00-\\udfff]",An="["+pv+"]",uz="\\u200d",Hh="(?:"+yv+"|"+bv+")",dz="(?:"+An+"|"+bv+")",Gh="(?:"+gv+"(?:d|ll|m|re|s|t|ve))?",qh="(?:"+gv+"(?:D|LL|M|RE|S|T|VE))?",kv=lz+"?",_v="["+sz+"]?",fz="(?:"+uz+"(?:"+[cz,xv,wv].join("|")+")"+_v+kv+")*",hz="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pz="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mz=_v+kv+fz,gz="(?:"+[az,xv,wv].join("|")+")"+mz,vz=RegExp([An+"?"+yv+"+"+Gh+"(?="+[Kh,An,"$"].join("|")+")",dz+"+"+qh+"(?="+[Kh,An+Hh,"$"].join("|")+")",An+"?"+Hh+"+"+Gh,An+"+"+qh,pz,hz,vv,gz].join("|"),"g");function yz(e){return e.match(vz)||[]}var bz=yz,xz=H2,wz=Y2,kz=rs,_z=bz;function Cz(e,t,r){return e=kz(e),t=r?void 0:t,t===void 0?wz(e)?_z(e):xz(e):e.match(t)||[]}var $z=Cz,Sz=uv,jz=V2,Ez=$z,Az="['’]",Nz=RegExp(Az,"g");function Pz(e){return function(t){return Sz(Ez(jz(t).replace(Nz,"")),e,"")}}var Rz=Pz;function Tz(e,t,r){var n=-1,s=e.length;t<0&&(t=-t>s?0:s+t),r=r>s?s:r,r<0&&(r+=s),s=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(s);++n<s;)o[n]=e[n+t];return o}var Cv=Tz,Iz=Cv;function Mz(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:Iz(e,t,r)}var zz=Mz,Oz="\\ud800-\\udfff",Dz="\\u0300-\\u036f",Lz="\\ufe20-\\ufe2f",Fz="\\u20d0-\\u20ff",Bz=Dz+Lz+Fz,Uz="\\ufe0e\\ufe0f",Vz="\\u200d",Wz=RegExp("["+Vz+Oz+Bz+Uz+"]");function Kz(e){return Wz.test(e)}var $v=Kz;function Hz(e){return e.split("")}var Gz=Hz,Sv="\\ud800-\\udfff",qz="\\u0300-\\u036f",Yz="\\ufe20-\\ufe2f",Jz="\\u20d0-\\u20ff",Zz=qz+Yz+Jz,Qz="\\ufe0e\\ufe0f",Xz="["+Sv+"]",xc="["+Zz+"]",wc="\\ud83c[\\udffb-\\udfff]",eO="(?:"+xc+"|"+wc+")",jv="[^"+Sv+"]",Ev="(?:\\ud83c[\\udde6-\\uddff]){2}",Av="[\\ud800-\\udbff][\\udc00-\\udfff]",tO="\\u200d",Nv=eO+"?",Pv="["+Qz+"]?",rO="(?:"+tO+"(?:"+[jv,Ev,Av].join("|")+")"+Pv+Nv+")*",nO=Pv+Nv+rO,sO="(?:"+[jv+xc+"?",xc,Ev,Av,Xz].join("|")+")",oO=RegExp(wc+"(?="+wc+")|"+sO+nO,"g");function aO(e){return e.match(oO)||[]}var iO=aO,lO=Gz,cO=$v,uO=iO;function dO(e){return cO(e)?uO(e):lO(e)}var fO=dO,hO=zz,pO=$v,mO=fO,gO=rs;function vO(e){return function(t){t=gO(t);var r=pO(t)?mO(t):void 0,n=r?r[0]:t.charAt(0),s=r?hO(r,1).join(""):t.slice(1);return n[e]()+s}}var yO=vO,bO=yO,xO=bO("toUpperCase"),wO=xO,kO=Rz,_O=wO,CO=kO(function(e,t,r){return e+(r?" ":"")+_O(t)}),Rv=CO;const Tv=Se(Rv);var $O=Math.ceil,SO=Math.max;function jO(e,t,r,n){for(var s=-1,o=SO($O((t-e)/(r||1)),0),a=Array(o);o--;)a[n?o:++s]=e,e+=r;return a}var EO=jO,AO=io,NO=mr,PO=fo,RO=xt;function TO(e,t,r){if(!RO(r))return!1;var n=typeof t;return(n=="number"?NO(r)&&PO(t,r.length):n=="string"&&t in r)?AO(r[t],e):!1}var Iv=TO,IO=/\s/;function MO(e){for(var t=e.length;t--&&IO.test(e.charAt(t)););return t}var zO=MO,OO=zO,DO=/^\s+/;function LO(e){return e&&e.slice(0,OO(e)+1).replace(DO,"")}var FO=LO,BO=FO,Yh=xt,UO=Jn,Jh=NaN,VO=/^[-+]0x[0-9a-f]+$/i,WO=/^0b[01]+$/i,KO=/^0o[0-7]+$/i,HO=parseInt;function GO(e){if(typeof e=="number")return e;if(UO(e))return Jh;if(Yh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Yh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=BO(e);var r=WO.test(e);return r||KO.test(e)?HO(e.slice(2),r?2:8):VO.test(e)?Jh:+e}var Mv=GO,qO=Mv,Zh=1/0,YO=17976931348623157e292;function JO(e){if(!e)return e===0?e:0;if(e=qO(e),e===Zh||e===-Zh){var t=e<0?-1:1;return t*YO}return e===e?e:0}var zv=JO,ZO=EO,QO=Iv,el=zv;function XO(e){return function(t,r,n){return n&&typeof n!="number"&&QO(t,r,n)&&(r=n=void 0),t=el(t),r===void 0?(r=t,t=0):r=el(r),n=n===void 0?t<r?1:-1:el(n),ZO(t,r,n,e)}}var eD=XO,tD=eD,rD=tD(),nD=rD;const Ov=Se(nD);var sD=Object.prototype,oD=sD.hasOwnProperty;function aD(e,t){return e!=null&&oD.call(e,t)}var iD=aD,lD=iD,cD=cv;function uD(e,t){return e!=null&&cD(e,t,lD)}var dD=uD;const Dv=Se(dD);var fD=fn,hD=mr,pD=Jt;function mD(e){return function(t,r,n){var s=Object(t);if(!hD(t)){var o=fD(r);t=pD(t),r=function(i){return o(s[i],i,s)}}var a=e(t,r,n);return a>-1?s[o?t[a]:a]:void 0}}var gD=mD;function vD(e,t,r,n){for(var s=e.length,o=r+(n?1:-1);n?o--:++o<s;)if(t(e[o],o,e))return o;return-1}var Lv=vD,yD=zv;function bD(e){var t=yD(e),r=t%1;return t===t?r?t-r:t:0}var po=bD,xD=Lv,wD=fn,kD=po,_D=Math.max;function CD(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var s=r==null?0:kD(r);return s<0&&(s=_D(n+s,0)),xD(e,wD(t),s)}var $D=CD,SD=gD,jD=$D,ED=SD(jD),AD=ED;const ND=Se(AD);function PD(e){return e!==e}var RD=PD;function TD(e,t,r){for(var n=r-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}var ID=TD,MD=Lv,zD=RD,OD=ID;function DD(e,t,r){return t===t?OD(e,t,r):MD(e,zD,r)}var Fv=DD,LD=Ir,FD=Ue,BD=bt,UD="[object String]";function VD(e){return typeof e=="string"||!FD(e)&&BD(e)&&LD(e)==UD}var WD=VD,KD=ho;function HD(e,t){return KD(t,function(r){return e[r]})}var GD=HD,qD=GD,YD=Jt;function JD(e){return e==null?[]:qD(e,YD(e))}var ZD=JD,QD=Fv,XD=mr,eL=WD,tL=po,rL=ZD,nL=Math.max;function sL(e,t,r,n){e=XD(e)?e:rL(e),r=r&&!n?tL(r):0;var s=e.length;return r<0&&(r=nL(s+r,0)),eL(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&QD(e,t,r)>-1}var oL=sL;const Bv=Se(oL);var kc={exports:{}},Uv={},Mt={},Vn={},mo={},we={},so={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(b){if(super(),!e.IDENTIFIER.test(b))throw new Error("CodeGen: name must be a valid identifier");this.str=b}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(b){super(),this._items=typeof b=="string"?[b]:b}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const b=this._items[0];return b===""||b==='""'}get str(){var b;return(b=this._str)!==null&&b!==void 0?b:this._str=this._items.reduce((_,w)=>`${_}${w}`,"")}get names(){var b;return(b=this._names)!==null&&b!==void 0?b:this._names=this._items.reduce((_,w)=>(w instanceof r&&(_[w.str]=(_[w.str]||0)+1),_),{})}}e._Code=n,e.nil=new n("");function s(y,...b){const _=[y[0]];let w=0;for(;w<b.length;)i(_,b[w]),_.push(y[++w]);return new n(_)}e._=s;const o=new n("+");function a(y,...b){const _=[h(y[0])];let w=0;for(;w<b.length;)_.push(o),i(_,b[w]),_.push(o,h(y[++w]));return u(_),new n(_)}e.str=a;function i(y,b){b instanceof n?y.push(...b._items):b instanceof r?y.push(b):y.push(f(b))}e.addCodeArg=i;function u(y){let b=1;for(;b<y.length-1;){if(y[b]===o){const _=c(y[b-1],y[b+1]);if(_!==void 0){y.splice(b-1,3,_);continue}y[b++]="+"}b++}}function c(y,b){if(b==='""')return y;if(y==='""')return b;if(typeof y=="string")return b instanceof r||y[y.length-1]!=='"'?void 0:typeof b!="string"?`${y.slice(0,-1)}${b}"`:b[0]==='"'?y.slice(0,-1)+b.slice(1):void 0;if(typeof b=="string"&&b[0]==='"'&&!(y instanceof r))return`"${y}${b.slice(1)}`}function d(y,b){return b.emptyStr()?y:y.emptyStr()?b:a`${y}${b}`}e.strConcat=d;function f(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:h(Array.isArray(y)?y.join(","):y)}function p(y){return new n(h(y))}e.stringify=p;function h(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function g(y){return typeof y=="string"&&e.IDENTIFIER.test(y)?new n(`.${y}`):s`[${y}]`}e.getProperty=g;function m(y){if(typeof y=="string"&&e.IDENTIFIER.test(y))return new n(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}e.getEsmExportName=m;function v(y){return new n(y.toString())}e.regexpCode=v})(so);var _c={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=so;class r extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:c,parent:d}={}){this._names={},this._prefixes=c,this._parent=d}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){const d=this._names[c]||this._nameGroup(c);return`${c}${d.index++}`}_nameGroup(c){var d,f;if(!((f=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||f===void 0)&&f.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}e.Scope=s;class o extends t.Name{constructor(c,d){super(d),this.prefix=c}setValue(c,{property:d,itemIndex:f}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(d)}[${f}]`}}e.ValueScopeName=o;const a=(0,t._)`\n`;class i extends s{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?a:t.nil}}get(){return this._scope}name(c){return new o(c,this._newName(c))}value(c,d){var f;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const p=this.toName(c),{prefix:h}=p,g=(f=d.key)!==null&&f!==void 0?f:d.ref;let m=this._values[h];if(m){const b=m.get(g);if(b)return b}else m=this._values[h]=new Map;m.set(g,p);const v=this._scope[h]||(this._scope[h]=[]),y=v.length;return v[y]=d.ref,p.setValue(d,{property:h,itemIndex:y}),p}getValue(c,d){const f=this._values[c];if(f)return f.get(d)}scopeRefs(c,d=this._values){return this._reduceValues(d,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${c}${f.scopePath}`})}scopeCode(c=this._values,d,f){return this._reduceValues(c,p=>{if(p.value===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return p.value.code},d,f)}_reduceValues(c,d,f={},p){let h=t.nil;for(const g in c){const m=c[g];if(!m)continue;const v=f[g]=f[g]||new Map;m.forEach(y=>{if(v.has(y))return;v.set(y,n.Started);let b=d(y);if(b){const _=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${_} ${y} = ${b};${this.opts._n}`}else if(b=p==null?void 0:p(y))h=(0,t._)`${h}${b}${this.opts._n}`;else throw new r(y);v.set(y,n.Completed)})}return h}}e.ValueScope=i})(_c);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=so,r=_c;var n=so;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=_c;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(k,C){return this}}class a extends o{constructor(k,C,N){super(),this.varKind=k,this.name=C,this.rhs=N}render({es5:k,_n:C}){const N=k?r.varKinds.var:this.varKind,B=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${B};`+C}optimizeNames(k,C){if(k[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,k,C)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends o{constructor(k,C,N){super(),this.lhs=k,this.rhs=C,this.sideEffects=N}render({_n:k}){return`${this.lhs} = ${this.rhs};`+k}optimizeNames(k,C){if(!(this.lhs instanceof t.Name&&!k[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,k,C),this}get names(){const k=this.lhs instanceof t.Name?{}:{...this.lhs.names};return W(k,this.rhs)}}class u extends i{constructor(k,C,N,B){super(k,N,B),this.op=C}render({_n:k}){return`${this.lhs} ${this.op}= ${this.rhs};`+k}}class c extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`${this.label}:`+k}}class d extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`break${this.label?` ${this.label}`:""};`+k}}class f extends o{constructor(k){super(),this.error=k}render({_n:k}){return`throw ${this.error};`+k}get names(){return this.error.names}}class p extends o{constructor(k){super(),this.code=k}render({_n:k}){return`${this.code};`+k}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(k,C){return this.code=G(this.code,k,C),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(k=[]){super(),this.nodes=k}render(k){return this.nodes.reduce((C,N)=>C+N.render(k),"")}optimizeNodes(){const{nodes:k}=this;let C=k.length;for(;C--;){const N=k[C].optimizeNodes();Array.isArray(N)?k.splice(C,1,...N):N?k[C]=N:k.splice(C,1)}return k.length>0?this:void 0}optimizeNames(k,C){const{nodes:N}=this;let B=N.length;for(;B--;){const K=N[B];K.optimizeNames(k,C)||(L(k,K.names),N.splice(B,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((k,C)=>P(k,C.names),{})}}class g extends h{render(k){return"{"+k._n+super.render(k)+"}"+k._n}}class m extends h{}class v extends g{}v.kind="else";class y extends g{constructor(k,C){super(C),this.condition=k}render(k){let C=`if(${this.condition})`+super.render(k);return this.else&&(C+="else "+this.else.render(k)),C}optimizeNodes(){super.optimizeNodes();const k=this.condition;if(k===!0)return this.nodes;let C=this.else;if(C){const N=C.optimizeNodes();C=this.else=Array.isArray(N)?new v(N):N}if(C)return k===!1?C instanceof y?C:C.nodes:this.nodes.length?this:new y(V(k),C instanceof y?[C]:C.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,C){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(k,C),!!(super.optimizeNames(k,C)||this.else))return this.condition=G(this.condition,k,C),this}get names(){const k=super.names;return W(k,this.condition),this.else&&P(k,this.else.names),k}}y.kind="if";class b extends g{}b.kind="for";class _ extends b{constructor(k){super(),this.iteration=k}render(k){return`for(${this.iteration})`+super.render(k)}optimizeNames(k,C){if(super.optimizeNames(k,C))return this.iteration=G(this.iteration,k,C),this}get names(){return P(super.names,this.iteration.names)}}class w extends b{constructor(k,C,N,B){super(),this.varKind=k,this.name=C,this.from=N,this.to=B}render(k){const C=k.es5?r.varKinds.var:this.varKind,{name:N,from:B,to:K}=this;return`for(${C} ${N}=${B}; ${N}<${K}; ${N}++)`+super.render(k)}get names(){const k=W(super.names,this.from);return W(k,this.to)}}class $ extends b{constructor(k,C,N,B){super(),this.loop=k,this.varKind=C,this.name=N,this.iterable=B}render(k){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(k)}optimizeNames(k,C){if(super.optimizeNames(k,C))return this.iterable=G(this.iterable,k,C),this}get names(){return P(super.names,this.iterable.names)}}class R extends g{constructor(k,C,N){super(),this.name=k,this.args=C,this.async=N}render(k){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(k)}}R.kind="func";class M extends h{render(k){return"return "+super.render(k)}}M.kind="return";class D extends g{render(k){let C="try"+super.render(k);return this.catch&&(C+=this.catch.render(k)),this.finally&&(C+=this.finally.render(k)),C}optimizeNodes(){var k,C;return super.optimizeNodes(),(k=this.catch)===null||k===void 0||k.optimizeNodes(),(C=this.finally)===null||C===void 0||C.optimizeNodes(),this}optimizeNames(k,C){var N,B;return super.optimizeNames(k,C),(N=this.catch)===null||N===void 0||N.optimizeNames(k,C),(B=this.finally)===null||B===void 0||B.optimizeNames(k,C),this}get names(){const k=super.names;return this.catch&&P(k,this.catch.names),this.finally&&P(k,this.finally.names),k}}class j extends g{constructor(k){super(),this.error=k}render(k){return`catch(${this.error})`+super.render(k)}}j.kind="catch";class S extends g{render(k){return"finally"+super.render(k)}}S.kind="finally";class E{constructor(k,C={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...C,_n:C.lines?`
121
- `:""},this._extScope=k,this._scope=new r.Scope({parent:k}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(k){return this._scope.name(k)}scopeName(k){return this._extScope.name(k)}scopeValue(k,C){const N=this._extScope.value(k,C);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(k,C){return this._extScope.getValue(k,C)}scopeRefs(k){return this._extScope.scopeRefs(k,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(k,C,N,B){const K=this._scope.toName(C);return N!==void 0&&B&&(this._constants[K.str]=N),this._leafNode(new a(k,K,N)),K}const(k,C,N){return this._def(r.varKinds.const,k,C,N)}let(k,C,N){return this._def(r.varKinds.let,k,C,N)}var(k,C,N){return this._def(r.varKinds.var,k,C,N)}assign(k,C,N){return this._leafNode(new i(k,C,N))}add(k,C){return this._leafNode(new u(k,e.operators.ADD,C))}code(k){return typeof k=="function"?k():k!==t.nil&&this._leafNode(new p(k)),this}object(...k){const C=["{"];for(const[N,B]of k)C.length>1&&C.push(","),C.push(N),(N!==B||this.opts.es5)&&(C.push(":"),(0,t.addCodeArg)(C,B));return C.push("}"),new t._Code(C)}if(k,C,N){if(this._blockNode(new y(k)),C&&N)this.code(C).else().code(N).endIf();else if(C)this.code(C).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(k){return this._elseNode(new y(k))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(k,C){return this._blockNode(k),C&&this.code(C).endFor(),this}for(k,C){return this._for(new _(k),C)}forRange(k,C,N,B,K=this.opts.es5?r.varKinds.var:r.varKinds.let){const ee=this._scope.toName(k);return this._for(new w(K,ee,C,N),()=>B(ee))}forOf(k,C,N,B=r.varKinds.const){const K=this._scope.toName(k);if(this.opts.es5){const ee=C instanceof t.Name?C:this.var("_arr",C);return this.forRange("_i",0,(0,t._)`${ee}.length`,ne=>{this.var(K,(0,t._)`${ee}[${ne}]`),N(K)})}return this._for(new $("of",B,K,C),()=>N(K))}forIn(k,C,N,B=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(k,(0,t._)`Object.keys(${C})`,N);const K=this._scope.toName(k);return this._for(new $("in",B,K,C),()=>N(K))}endFor(){return this._endBlockNode(b)}label(k){return this._leafNode(new c(k))}break(k){return this._leafNode(new d(k))}return(k){const C=new M;if(this._blockNode(C),this.code(k),C.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(M)}try(k,C,N){if(!C&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const B=new D;if(this._blockNode(B),this.code(k),C){const K=this.name("e");this._currNode=B.catch=new j(K),C(K)}return N&&(this._currNode=B.finally=new S,this.code(N)),this._endBlockNode(j,S)}throw(k){return this._leafNode(new f(k))}block(k,C){return this._blockStarts.push(this._nodes.length),k&&this.code(k).endBlock(C),this}endBlock(k){const C=this._blockStarts.pop();if(C===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-C;if(N<0||k!==void 0&&N!==k)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${k} expected`);return this._nodes.length=C,this}func(k,C=t.nil,N,B){return this._blockNode(new R(k,C,N)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(k=1){for(;k-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(k){return this._currNode.nodes.push(k),this}_blockNode(k){this._currNode.nodes.push(k),this._nodes.push(k)}_endBlockNode(k,C){const N=this._currNode;if(N instanceof k||C&&N instanceof C)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${C?`${k.kind}/${C.kind}`:k.kind}"`)}_elseNode(k){const C=this._currNode;if(!(C instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=C.else=k,this}get _root(){return this._nodes[0]}get _currNode(){const k=this._nodes;return k[k.length-1]}set _currNode(k){const C=this._nodes;C[C.length-1]=k}}e.CodeGen=E;function P(z,k){for(const C in k)z[C]=(z[C]||0)+(k[C]||0);return z}function W(z,k){return k instanceof t._CodeOrName?P(z,k.names):z}function G(z,k,C){if(z instanceof t.Name)return N(z);if(!B(z))return z;return new t._Code(z._items.reduce((K,ee)=>(ee instanceof t.Name&&(ee=N(ee)),ee instanceof t._Code?K.push(...ee._items):K.push(ee),K),[]));function N(K){const ee=C[K.str];return ee===void 0||k[K.str]!==1?K:(delete k[K.str],ee)}function B(K){return K instanceof t._Code&&K._items.some(ee=>ee instanceof t.Name&&k[ee.str]===1&&C[ee.str]!==void 0)}}function L(z,k){for(const C in k)z[C]=(z[C]||0)-(k[C]||0)}function V(z){return typeof z=="boolean"||typeof z=="number"||z===null?!z:(0,t._)`!${Y(z)}`}e.not=V;const O=A(e.operators.AND);function te(...z){return z.reduce(O)}e.and=te;const J=A(e.operators.OR);function H(...z){return z.reduce(J)}e.or=H;function A(z){return(k,C)=>k===t.nil?C:C===t.nil?k:(0,t._)`${Y(k)} ${z} ${Y(C)}`}function Y(z){return z instanceof t.Name?z:(0,t._)`(${z})`}})(we);var se={};Object.defineProperty(se,"__esModule",{value:!0});se.checkStrictMode=se.getErrorPath=se.Type=se.useFunc=se.setEvaluated=se.evaluatedPropsToName=se.mergeEvaluated=se.eachItem=se.unescapeJsonPointer=se.escapeJsonPointer=se.escapeFragment=se.unescapeFragment=se.schemaRefOrVal=se.schemaHasRulesButRef=se.schemaHasRules=se.checkUnknownRules=se.alwaysValidSchema=se.toHash=void 0;const Re=we,aL=so;function iL(e){const t={};for(const r of e)t[r]=!0;return t}se.toHash=iL;function lL(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Vv(e,t),!Wv(t,e.self.RULES.all))}se.alwaysValidSchema=lL;function Vv(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;const s=n.RULES.keywords;for(const o in t)s[o]||Gv(e,`unknown keyword: "${o}"`)}se.checkUnknownRules=Vv;function Wv(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return!0;return!1}se.schemaHasRules=Wv;function cL(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}se.schemaHasRulesButRef=cL;function uL({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Re._)`${r}`}return(0,Re._)`${e}${t}${(0,Re.getProperty)(n)}`}se.schemaRefOrVal=uL;function dL(e){return Kv(decodeURIComponent(e))}se.unescapeFragment=dL;function fL(e){return encodeURIComponent(Cu(e))}se.escapeFragment=fL;function Cu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}se.escapeJsonPointer=Cu;function Kv(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}se.unescapeJsonPointer=Kv;function hL(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)}se.eachItem=hL;function Qh({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{const u=a===void 0?o:a instanceof Re.Name?(o instanceof Re.Name?e(s,o,a):t(s,o,a),a):o instanceof Re.Name?(t(s,a,o),o):r(o,a);return i===Re.Name&&!(u instanceof Re.Name)?n(s,u):u}}se.mergeEvaluated={props:Qh({mergeNames:(e,t,r)=>e.if((0,Re._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Re._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Re._)`${r} || {}`).code((0,Re._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Re._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Re._)`${r} || {}`),$u(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Hv}),items:Qh({mergeNames:(e,t,r)=>e.if((0,Re._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Re._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Re._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Re._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Hv(e,t){if(t===!0)return e.var("props",!0);const r=e.var("props",(0,Re._)`{}`);return t!==void 0&&$u(e,r,t),r}se.evaluatedPropsToName=Hv;function $u(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Re._)`${t}${(0,Re.getProperty)(n)}`,!0))}se.setEvaluated=$u;const Xh={};function pL(e,t){return e.scopeValue("func",{ref:t,code:Xh[t.code]||(Xh[t.code]=new aL._Code(t.code))})}se.useFunc=pL;var Cc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Cc||(se.Type=Cc={}));function mL(e,t,r){if(e instanceof Re.Name){const n=t===Cc.Num;return r?n?(0,Re._)`"[" + ${e} + "]"`:(0,Re._)`"['" + ${e} + "']"`:n?(0,Re._)`"/" + ${e}`:(0,Re._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Re.getProperty)(e).toString():"/"+Cu(e)}se.getErrorPath=mL;function Gv(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}se.checkStrictMode=Gv;var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});const et=we,gL={data:new et.Name("data"),valCxt:new et.Name("valCxt"),instancePath:new et.Name("instancePath"),parentData:new et.Name("parentData"),parentDataProperty:new et.Name("parentDataProperty"),rootData:new et.Name("rootData"),dynamicAnchors:new et.Name("dynamicAnchors"),vErrors:new et.Name("vErrors"),errors:new et.Name("errors"),this:new et.Name("this"),self:new et.Name("self"),scope:new et.Name("scope"),json:new et.Name("json"),jsonPos:new et.Name("jsonPos"),jsonLen:new et.Name("jsonLen"),jsonPart:new et.Name("jsonPart")};Zt.default=gL;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=we,r=se,n=Zt;e.keywordError={message:({keyword:v})=>(0,t.str)`must pass "${v}" keyword validation`},e.keyword$DataError={message:({keyword:v,schemaType:y})=>y?(0,t.str)`"${v}" keyword must be ${y} ($data)`:(0,t.str)`"${v}" keyword is invalid ($data)`};function s(v,y=e.keywordError,b,_){const{it:w}=v,{gen:$,compositeRule:R,allErrors:M}=w,D=f(v,y,b);_??(R||M)?u($,D):c(w,(0,t._)`[${D}]`)}e.reportError=s;function o(v,y=e.keywordError,b){const{it:_}=v,{gen:w,compositeRule:$,allErrors:R}=_,M=f(v,y,b);u(w,M),$||R||c(_,n.default.vErrors)}e.reportExtraError=o;function a(v,y){v.assign(n.default.errors,y),v.if((0,t._)`${n.default.vErrors} !== null`,()=>v.if(y,()=>v.assign((0,t._)`${n.default.vErrors}.length`,y),()=>v.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function i({gen:v,keyword:y,schemaValue:b,data:_,errsCount:w,it:$}){if(w===void 0)throw new Error("ajv implementation error");const R=v.name("err");v.forRange("i",w,n.default.errors,M=>{v.const(R,(0,t._)`${n.default.vErrors}[${M}]`),v.if((0,t._)`${R}.instancePath === undefined`,()=>v.assign((0,t._)`${R}.instancePath`,(0,t.strConcat)(n.default.instancePath,$.errorPath))),v.assign((0,t._)`${R}.schemaPath`,(0,t.str)`${$.errSchemaPath}/${y}`),$.opts.verbose&&(v.assign((0,t._)`${R}.schema`,b),v.assign((0,t._)`${R}.data`,_))})}e.extendErrors=i;function u(v,y){const b=v.const("err",y);v.if((0,t._)`${n.default.vErrors} === null`,()=>v.assign(n.default.vErrors,(0,t._)`[${b}]`),(0,t._)`${n.default.vErrors}.push(${b})`),v.code((0,t._)`${n.default.errors}++`)}function c(v,y){const{gen:b,validateName:_,schemaEnv:w}=v;w.$async?b.throw((0,t._)`new ${v.ValidationError}(${y})`):(b.assign((0,t._)`${_}.errors`,y),b.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function f(v,y,b){const{createErrors:_}=v.it;return _===!1?(0,t._)`{}`:p(v,y,b)}function p(v,y,b={}){const{gen:_,it:w}=v,$=[h(w,b),g(v,b)];return m(v,y,$),_.object(...$)}function h({errorPath:v},{instancePath:y}){const b=y?(0,t.str)`${v}${(0,r.getErrorPath)(y,r.Type.Str)}`:v;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,b)]}function g({keyword:v,it:{errSchemaPath:y}},{schemaPath:b,parentSchema:_}){let w=_?y:(0,t.str)`${y}/${v}`;return b&&(w=(0,t.str)`${w}${(0,r.getErrorPath)(b,r.Type.Str)}`),[d.schemaPath,w]}function m(v,{params:y,message:b},_){const{keyword:w,data:$,schemaValue:R,it:M}=v,{opts:D,propertyName:j,topSchemaRef:S,schemaPath:E}=M;_.push([d.keyword,w],[d.params,typeof y=="function"?y(v):y||(0,t._)`{}`]),D.messages&&_.push([d.message,typeof b=="function"?b(v):b]),D.verbose&&_.push([d.schema,R],[d.parentSchema,(0,t._)`${S}${E}`],[n.default.data,$]),j&&_.push([d.propertyName,j])}})(mo);Object.defineProperty(Vn,"__esModule",{value:!0});Vn.boolOrEmptySchema=Vn.topBoolOrEmptySchema=void 0;const vL=mo,yL=we,bL=Zt,xL={message:"boolean schema is false"};function wL(e){const{gen:t,schema:r,validateName:n}=e;r===!1?qv(e,!1):typeof r=="object"&&r.$async===!0?t.return(bL.default.data):(t.assign((0,yL._)`${n}.errors`,null),t.return(!0))}Vn.topBoolOrEmptySchema=wL;function kL(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),qv(e)):r.var(t,!0)}Vn.boolOrEmptySchema=kL;function qv(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,vL.reportError)(s,xL,void 0,t)}var He={},sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.getRules=sn.isJSONType=void 0;const _L=["string","number","integer","boolean","null","object","array"],CL=new Set(_L);function $L(e){return typeof e=="string"&&CL.has(e)}sn.isJSONType=$L;function SL(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}sn.getRules=SL;var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.shouldUseRule=ir.shouldUseGroup=ir.schemaHasRulesForType=void 0;function jL({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&Yv(e,n)}ir.schemaHasRulesForType=jL;function Yv(e,t){return t.rules.some(r=>Jv(e,r))}ir.shouldUseGroup=Yv;function Jv(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}ir.shouldUseRule=Jv;Object.defineProperty(He,"__esModule",{value:!0});He.reportTypeError=He.checkDataTypes=He.checkDataType=He.coerceAndCheckDataType=He.getJSONTypes=He.getSchemaTypes=He.DataType=void 0;const EL=sn,AL=ir,NL=mo,be=we,Zv=se;var Dn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Dn||(He.DataType=Dn={}));function PL(e){const t=Qv(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}He.getSchemaTypes=PL;function Qv(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(EL.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}He.getJSONTypes=Qv;function RL(e,t){const{gen:r,data:n,opts:s}=e,o=TL(t,s.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,AL.schemaHasRulesForType)(e,t[0]));if(a){const i=Su(t,n,s.strictNumbers,Dn.Wrong);r.if(i,()=>{o.length?IL(e,t,o):ju(e)})}return a}He.coerceAndCheckDataType=RL;const Xv=new Set(["string","number","integer","boolean","null"]);function TL(e,t){return t?e.filter(r=>Xv.has(r)||t==="array"&&r==="array"):[]}function IL(e,t,r){const{gen:n,data:s,opts:o}=e,a=n.let("dataType",(0,be._)`typeof ${s}`),i=n.let("coerced",(0,be._)`undefined`);o.coerceTypes==="array"&&n.if((0,be._)`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,be._)`${s}[0]`).assign(a,(0,be._)`typeof ${s}`).if(Su(t,s,o.strictNumbers),()=>n.assign(i,s))),n.if((0,be._)`${i} !== undefined`);for(const c of r)(Xv.has(c)||c==="array"&&o.coerceTypes==="array")&&u(c);n.else(),ju(e),n.endIf(),n.if((0,be._)`${i} !== undefined`,()=>{n.assign(s,i),ML(e,i)});function u(c){switch(c){case"string":n.elseIf((0,be._)`${a} == "number" || ${a} == "boolean"`).assign(i,(0,be._)`"" + ${s}`).elseIf((0,be._)`${s} === null`).assign(i,(0,be._)`""`);return;case"number":n.elseIf((0,be._)`${a} == "boolean" || ${s} === null
120
+ `:""}var tE=eE,rE={dump:tE},nE=rE.dump;function sE(e){const t=new Date(e),r=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())} ${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`}function oE({text:e}){const t=x.useMemo(()=>cu(e),[e]);return l.jsx("span",{className:"log-text [&_p]:inline [&_p]:m-0",dangerouslySetInnerHTML:{__html:t}})}function O0(e){try{return nE(e,{indent:2,lineWidth:80,noRefs:!0}).trimEnd()}catch{return JSON.stringify(e,null,2)}}function aE(e){const t=JSON.stringify(e);return t.length>60?t.slice(0,59)+"…}":t}function iE({obj:e}){const t=x.useMemo(()=>O0(e),[e]);return l.jsx("pre",{className:"mt-1 px-2 py-1.5 rounded text-[10px] font-mono leading-relaxed overflow-x-auto",style:{background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.1))",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-panel-border)"},children:t})}function lE({obj:e}){const[t,r]=x.useState(!1),n=x.useMemo(()=>O0(e),[e]),s=x.useMemo(()=>aE(e),[e]);return t?l.jsxs("div",{style:{flexBasis:"100%"},className:"mt-1 flex items-start gap-1",children:[l.jsx("button",{type:"button",onClick:()=>r(!1),className:"inline-flex items-center shrink-0 px-1 py-1 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Collapse",children:l.jsx(d1,{size:10})}),l.jsx("pre",{className:"flex-1 px-2 py-1.5 rounded text-[10px] font-mono leading-relaxed overflow-x-auto",style:{background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.1))",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-panel-border)"},children:n})]}):l.jsx("button",{type:"button",onClick:()=>r(!0),className:"font-mono text-[10px] ml-1 px-1 rounded transition-colors vscode-hover-bg cursor-pointer",style:{color:"var(--vscode-descriptionForeground)",background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.08))"},title:"Click to expand",children:s})}function Uo({label:e,children:t}){const[r,n]=x.useState(!1);return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>n(!r),className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:[e,l.jsx(Ze,{size:10})]}),r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),l.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 rounded shadow-lg py-1 min-w-[120px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},onClick:()=>n(!1),children:t})]})]})}function Ji({label:e,active:t,onClick:r}){return l.jsxs("button",{type:"button",onClick:r,className:"w-full text-left px-3 py-1 text-[10px] transition-colors vscode-hover-bg flex items-center gap-2",style:{color:t?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:[l.jsx("span",{className:"w-3",children:t&&l.jsx(jt,{size:10})}),e]})}function Vo({label:e,checked:t,onChange:r}){return l.jsxs("button",{type:"button",onClick:n=>{n.stopPropagation(),r(!t)},className:"w-full text-left px-3 py-1 text-[10px] transition-colors vscode-hover-bg flex items-center gap-2",style:{color:"var(--vscode-foreground)"},children:[l.jsx("span",{className:"w-3 h-3 rounded-sm border flex items-center justify-center shrink-0",style:{borderColor:t?"var(--vscode-focusBorder)":"var(--vscode-checkbox-border, var(--vscode-panel-border))",background:t?"var(--vscode-focusBorder)":"transparent"},children:t&&l.jsx(jt,{size:8,style:{color:"var(--vscode-checkbox-foreground, white)"}})}),e]})}function D0({logs:e,onClearLogs:t,logsFilter:r,onLogsFilterChange:n}){const[s,o]=x.useState(()=>(r==null?void 0:r.limit)??"all"),[a,i]=x.useState(()=>(r==null?void 0:r.order)??"desc"),[u,c]=x.useState(()=>new Set((r==null?void 0:r.disabledSources)??[])),[d,f]=x.useState(()=>(r==null?void 0:r.show)??{timestamp:!0,source:!0,objects:!1}),p=x.useMemo(()=>{const m=new Set;for(const v of e)m.add(v.source);return Array.from(m).sort()},[e]),h=x.useMemo(()=>{let m=e;return u.size>0&&(m=m.filter(v=>!u.has(v.source))),m=[...m],a==="desc"&&m.reverse(),s!=="all"&&(m=m.slice(0,s)),m},[e,u,a,s]),g=[10,25,50,100,"all"];return x.useEffect(()=>{n==null||n({limit:s,order:a,disabledSources:Array.from(u),show:d})},[s,a,u,d]),l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"card-log-toolbar shrink-0",children:[l.jsxs("button",{type:"button",onClick:t,disabled:e.length===0,className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] rounded transition-colors vscode-hover-bg disabled:opacity-40",style:{color:"var(--vscode-descriptionForeground)"},title:"Clear all logs",children:[l.jsx(Kt,{size:10}),"Clear"]}),l.jsx("span",{className:"w-px h-4 mx-0.5",style:{background:"var(--vscode-panel-border)"}}),l.jsx(Uo,{label:l.jsxs(l.Fragment,{children:["Limit: ",s]}),children:g.map(m=>l.jsx(Ji,{label:String(m),active:s===m,onClick:()=>o(m)},String(m)))}),l.jsxs(Uo,{label:l.jsxs(l.Fragment,{children:["Order: ",a==="desc"?"Newest":"Oldest"]}),children:[l.jsx(Ji,{label:"Newest first",active:a==="desc",onClick:()=>i("desc")}),l.jsx(Ji,{label:"Oldest first",active:a==="asc",onClick:()=>i("asc")})]}),p.length>0&&l.jsx(Uo,{label:`Sources (${p.filter(m=>!u.has(m)).length}/${p.length})`,children:l.jsx("div",{onClick:m=>m.stopPropagation(),children:p.map(m=>l.jsx(Vo,{label:m,checked:!u.has(m),onChange:v=>c(y=>{const b=new Set(y);return v?b.delete(m):b.add(m),b})},m))})}),l.jsx(Uo,{label:"Show",children:l.jsxs("div",{onClick:m=>m.stopPropagation(),children:[l.jsx(Vo,{label:"Timestamp",checked:d.timestamp,onChange:m=>f(v=>({...v,timestamp:m}))}),l.jsx(Vo,{label:"Source",checked:d.source,onChange:m=>f(v=>({...v,source:m}))}),l.jsx(Vo,{label:"Objects",checked:d.objects,onChange:m=>f(v=>({...v,objects:m}))})]})}),l.jsxs("span",{className:"card-log-count",children:[h.length,s!=="all"&&e.length>s?` / ${e.length}`:""," entries"]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:h.length===0?l.jsx("p",{className:"p-4 text-xs italic",style:{color:"var(--vscode-descriptionForeground)"},children:e.length===0?"No log entries yet.":"No entries match the current filters."}):l.jsx("div",{className:"flex flex-col",children:h.map((m,v)=>l.jsxs("div",{className:"card-log-entry px-4 py-2 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.timestamp&&l.jsx("span",{className:"font-mono text-[10px] shrink-0",style:{color:"var(--vscode-descriptionForeground)"},title:m.timestamp,children:sE(m.timestamp)}),d.source&&l.jsx("span",{className:"text-[10px] font-medium px-1 rounded shrink-0",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:m.source}),l.jsx("span",{className:"comment-markdown inline text-xs leading-normal [&_p]:inline [&_p]:m-0",style:{color:"var(--vscode-foreground)"},children:l.jsx(oE,{text:m.text})}),!d.objects&&m.object&&l.jsx(lE,{obj:m.object})]}),d.objects&&m.object&&l.jsx(iE,{obj:m.object})]},`${m.timestamp}-${v}`))})})]})}var cE=typeof zo=="object"&&zo&&zo.Object===Object&&zo,L0=cE,uE=L0,dE=typeof self=="object"&&self&&self.Object===Object&&self,fE=uE||dE||Function("return this")(),ut=fE,hE=ut,pE=hE.Symbol,Yn=pE,gh=Yn,F0=Object.prototype,mE=F0.hasOwnProperty,gE=F0.toString,$s=gh?gh.toStringTag:void 0;function vE(e){var t=mE.call(e,$s),r=e[$s];try{e[$s]=void 0;var n=!0}catch{}var s=gE.call(e);return n&&(t?e[$s]=r:delete e[$s]),s}var yE=vE,bE=Object.prototype,xE=bE.toString;function wE(e){return xE.call(e)}var kE=wE,vh=Yn,_E=yE,CE=kE,$E="[object Null]",SE="[object Undefined]",yh=vh?vh.toStringTag:void 0;function jE(e){return e==null?e===void 0?SE:$E:yh&&yh in Object(e)?_E(e):CE(e)}var Ir=jE;function EE(e){return e!=null&&typeof e=="object"}var bt=EE,AE=Ir,NE=bt,PE="[object Symbol]";function RE(e){return typeof e=="symbol"||NE(e)&&AE(e)==PE}var Jn=RE,TE=Jn;function IE(e,t,r){for(var n=-1,s=e.length;++n<s;){var o=e[n],a=t(o);if(a!=null&&(i===void 0?a===a&&!TE(a):r(a,i)))var i=a,u=o}return u}var ME=IE;function zE(e,t){return e>t}var OE=zE;function DE(){this.__data__=[],this.size=0}var LE=DE;function FE(e,t){return e===t||e!==e&&t!==t}var io=FE,BE=io;function UE(e,t){for(var r=e.length;r--;)if(BE(e[r][0],t))return r;return-1}var hi=UE,VE=hi,WE=Array.prototype,KE=WE.splice;function HE(e){var t=this.__data__,r=VE(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():KE.call(t,r,1),--this.size,!0}var GE=HE,qE=hi;function YE(e){var t=this.__data__,r=qE(t,e);return r<0?void 0:t[r][1]}var JE=YE,ZE=hi;function QE(e){return ZE(this.__data__,e)>-1}var XE=QE,eA=hi;function tA(e,t){var r=this.__data__,n=eA(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var rA=tA,nA=LE,sA=GE,oA=JE,aA=XE,iA=rA;function Zn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Zn.prototype.clear=nA;Zn.prototype.delete=sA;Zn.prototype.get=oA;Zn.prototype.has=aA;Zn.prototype.set=iA;var pi=Zn,lA=pi;function cA(){this.__data__=new lA,this.size=0}var uA=cA;function dA(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var fA=dA;function hA(e){return this.__data__.get(e)}var pA=hA;function mA(e){return this.__data__.has(e)}var gA=mA;function vA(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var xt=vA,yA=Ir,bA=xt,xA="[object AsyncFunction]",wA="[object Function]",kA="[object GeneratorFunction]",_A="[object Proxy]";function CA(e){if(!bA(e))return!1;var t=yA(e);return t==wA||t==kA||t==xA||t==_A}var lo=CA;const $A=je(lo);var SA=ut,jA=SA["__core-js_shared__"],EA=jA,Zi=EA,bh=function(){var e=/[^.]+$/.exec(Zi&&Zi.keys&&Zi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function AA(e){return!!bh&&bh in e}var NA=AA,PA=Function.prototype,RA=PA.toString;function TA(e){if(e!=null){try{return RA.call(e)}catch{}try{return e+""}catch{}}return""}var B0=TA,IA=lo,MA=NA,zA=xt,OA=B0,DA=/[\\^$.*+?()[\]{}|]/g,LA=/^\[object .+?Constructor\]$/,FA=Function.prototype,BA=Object.prototype,UA=FA.toString,VA=BA.hasOwnProperty,WA=RegExp("^"+UA.call(VA).replace(DA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function KA(e){if(!zA(e)||MA(e))return!1;var t=IA(e)?WA:LA;return t.test(OA(e))}var HA=KA;function GA(e,t){return e==null?void 0:e[t]}var qA=GA,YA=HA,JA=qA;function ZA(e,t){var r=JA(e,t);return YA(r)?r:void 0}var cn=ZA,QA=cn,XA=ut,eN=QA(XA,"Map"),fu=eN,tN=cn,rN=tN(Object,"create"),mi=rN,xh=mi;function nN(){this.__data__=xh?xh(null):{},this.size=0}var sN=nN;function oN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var aN=oN,iN=mi,lN="__lodash_hash_undefined__",cN=Object.prototype,uN=cN.hasOwnProperty;function dN(e){var t=this.__data__;if(iN){var r=t[e];return r===lN?void 0:r}return uN.call(t,e)?t[e]:void 0}var fN=dN,hN=mi,pN=Object.prototype,mN=pN.hasOwnProperty;function gN(e){var t=this.__data__;return hN?t[e]!==void 0:mN.call(t,e)}var vN=gN,yN=mi,bN="__lodash_hash_undefined__";function xN(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=yN&&t===void 0?bN:t,this}var wN=xN,kN=sN,_N=aN,CN=fN,$N=vN,SN=wN;function Qn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qn.prototype.clear=kN;Qn.prototype.delete=_N;Qn.prototype.get=CN;Qn.prototype.has=$N;Qn.prototype.set=SN;var jN=Qn,wh=jN,EN=pi,AN=fu;function NN(){this.size=0,this.__data__={hash:new wh,map:new(AN||EN),string:new wh}}var PN=NN;function RN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var TN=RN,IN=TN;function MN(e,t){var r=e.__data__;return IN(t)?r[typeof t=="string"?"string":"hash"]:r.map}var gi=MN,zN=gi;function ON(e){var t=zN(this,e).delete(e);return this.size-=t?1:0,t}var DN=ON,LN=gi;function FN(e){return LN(this,e).get(e)}var BN=FN,UN=gi;function VN(e){return UN(this,e).has(e)}var WN=VN,KN=gi;function HN(e,t){var r=KN(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var GN=HN,qN=PN,YN=DN,JN=BN,ZN=WN,QN=GN;function Xn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xn.prototype.clear=qN;Xn.prototype.delete=YN;Xn.prototype.get=JN;Xn.prototype.has=ZN;Xn.prototype.set=QN;var hu=Xn,XN=pi,eP=fu,tP=hu,rP=200;function nP(e,t){var r=this.__data__;if(r instanceof XN){var n=r.__data__;if(!eP||n.length<rP-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new tP(n)}return r.set(e,t),this.size=r.size,this}var sP=nP,oP=pi,aP=uA,iP=fA,lP=pA,cP=gA,uP=sP;function es(e){var t=this.__data__=new oP(e);this.size=t.size}es.prototype.clear=aP;es.prototype.delete=iP;es.prototype.get=lP;es.prototype.has=cP;es.prototype.set=uP;var vi=es,dP="__lodash_hash_undefined__";function fP(e){return this.__data__.set(e,dP),this}var hP=fP;function pP(e){return this.__data__.has(e)}var mP=pP,gP=hu,vP=hP,yP=mP;function za(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new gP;++t<r;)this.add(e[t])}za.prototype.add=za.prototype.push=vP;za.prototype.has=yP;var bP=za;function xP(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var wP=xP;function kP(e,t){return e.has(t)}var _P=kP,CP=bP,$P=wP,SP=_P,jP=1,EP=2;function AP(e,t,r,n,s,o){var a=r&jP,i=e.length,u=t.length;if(i!=u&&!(a&&u>i))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var f=-1,p=!0,h=r&EP?new CP:void 0;for(o.set(e,t),o.set(t,e);++f<i;){var g=e[f],m=t[f];if(n)var v=a?n(m,g,f,t,e,o):n(g,m,f,e,t,o);if(v!==void 0){if(v)continue;p=!1;break}if(h){if(!$P(t,function(y,b){if(!SP(h,b)&&(g===y||s(g,y,r,n,o)))return h.push(b)})){p=!1;break}}else if(!(g===m||s(g,m,r,n,o))){p=!1;break}}return o.delete(e),o.delete(t),p}var U0=AP,NP=ut,PP=NP.Uint8Array,V0=PP;function RP(e){var t=-1,r=Array(e.size);return e.forEach(function(n,s){r[++t]=[s,n]}),r}var W0=RP;function TP(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var IP=TP,kh=Yn,_h=V0,MP=io,zP=U0,OP=W0,DP=IP,LP=1,FP=2,BP="[object Boolean]",UP="[object Date]",VP="[object Error]",WP="[object Map]",KP="[object Number]",HP="[object RegExp]",GP="[object Set]",qP="[object String]",YP="[object Symbol]",JP="[object ArrayBuffer]",ZP="[object DataView]",Ch=kh?kh.prototype:void 0,Qi=Ch?Ch.valueOf:void 0;function QP(e,t,r,n,s,o,a){switch(r){case ZP:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case JP:return!(e.byteLength!=t.byteLength||!o(new _h(e),new _h(t)));case BP:case UP:case KP:return MP(+e,+t);case VP:return e.name==t.name&&e.message==t.message;case HP:case qP:return e==t+"";case WP:var i=OP;case GP:var u=n&LP;if(i||(i=DP),e.size!=t.size&&!u)return!1;var c=a.get(e);if(c)return c==t;n|=FP,a.set(e,t);var d=zP(i(e),i(t),n,s,o,a);return a.delete(e),d;case YP:if(Qi)return Qi.call(e)==Qi.call(t)}return!1}var XP=QP;function eR(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}var pu=eR,tR=Array.isArray,Ue=tR;const K0=je(Ue);var rR=pu,nR=Ue;function sR(e,t,r){var n=t(e);return nR(e)?n:rR(n,r(e))}var H0=sR;function oR(e,t){for(var r=-1,n=e==null?0:e.length,s=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[s++]=a)}return o}var G0=oR;function aR(){return[]}var q0=aR,iR=G0,lR=q0,cR=Object.prototype,uR=cR.propertyIsEnumerable,$h=Object.getOwnPropertySymbols,dR=$h?function(e){return e==null?[]:(e=Object(e),iR($h(e),function(t){return uR.call(e,t)}))}:lR,mu=dR;function fR(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var hR=fR,pR=Ir,mR=bt,gR="[object Arguments]";function vR(e){return mR(e)&&pR(e)==gR}var yR=vR,Sh=yR,bR=bt,Y0=Object.prototype,xR=Y0.hasOwnProperty,wR=Y0.propertyIsEnumerable,kR=Sh(function(){return arguments}())?Sh:function(e){return bR(e)&&xR.call(e,"callee")&&!wR.call(e,"callee")},co=kR,Oa={exports:{}};function _R(){return!1}var CR=_R;Oa.exports;(function(e,t){var r=ut,n=CR,s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,i=a?r.Buffer:void 0,u=i?i.isBuffer:void 0,c=u||n;e.exports=c})(Oa,Oa.exports);var uo=Oa.exports,$R=9007199254740991,SR=/^(?:0|[1-9]\d*)$/;function jR(e,t){var r=typeof e;return t=t??$R,!!t&&(r=="number"||r!="symbol"&&SR.test(e))&&e>-1&&e%1==0&&e<t}var fo=jR,ER=9007199254740991;function AR(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ER}var gu=AR,NR=Ir,PR=gu,RR=bt,TR="[object Arguments]",IR="[object Array]",MR="[object Boolean]",zR="[object Date]",OR="[object Error]",DR="[object Function]",LR="[object Map]",FR="[object Number]",BR="[object Object]",UR="[object RegExp]",VR="[object Set]",WR="[object String]",KR="[object WeakMap]",HR="[object ArrayBuffer]",GR="[object DataView]",qR="[object Float32Array]",YR="[object Float64Array]",JR="[object Int8Array]",ZR="[object Int16Array]",QR="[object Int32Array]",XR="[object Uint8Array]",eT="[object Uint8ClampedArray]",tT="[object Uint16Array]",rT="[object Uint32Array]",ze={};ze[qR]=ze[YR]=ze[JR]=ze[ZR]=ze[QR]=ze[XR]=ze[eT]=ze[tT]=ze[rT]=!0;ze[TR]=ze[IR]=ze[HR]=ze[MR]=ze[GR]=ze[zR]=ze[OR]=ze[DR]=ze[LR]=ze[FR]=ze[BR]=ze[UR]=ze[VR]=ze[WR]=ze[KR]=!1;function nT(e){return RR(e)&&PR(e.length)&&!!ze[NR(e)]}var sT=nT;function oT(e){return function(t){return e(t)}}var vu=oT,Da={exports:{}};Da.exports;(function(e,t){var r=L0,n=t&&!t.nodeType&&t,s=n&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===n,a=o&&r.process,i=function(){try{var u=s&&s.require&&s.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}}();e.exports=i})(Da,Da.exports);var yu=Da.exports,aT=sT,iT=vu,jh=yu,Eh=jh&&jh.isTypedArray,lT=Eh?iT(Eh):aT,yi=lT,cT=hR,uT=co,dT=Ue,fT=uo,hT=fo,pT=yi,mT=Object.prototype,gT=mT.hasOwnProperty;function vT(e,t){var r=dT(e),n=!r&&uT(e),s=!r&&!n&&fT(e),o=!r&&!n&&!s&&pT(e),a=r||n||s||o,i=a?cT(e.length,String):[],u=i.length;for(var c in e)(t||gT.call(e,c))&&!(a&&(c=="length"||s&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||hT(c,u)))&&i.push(c);return i}var J0=vT,yT=Object.prototype;function bT(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||yT;return e===r}var bi=bT;function xT(e,t){return function(r){return e(t(r))}}var Z0=xT,wT=Z0,kT=wT(Object.keys,Object),_T=kT,CT=bi,$T=_T,ST=Object.prototype,jT=ST.hasOwnProperty;function ET(e){if(!CT(e))return $T(e);var t=[];for(var r in Object(e))jT.call(e,r)&&r!="constructor"&&t.push(r);return t}var bu=ET,AT=lo,NT=gu;function PT(e){return e!=null&&NT(e.length)&&!AT(e)}var mr=PT,RT=J0,TT=bu,IT=mr;function MT(e){return IT(e)?RT(e):TT(e)}var Jt=MT;const zT=je(Jt);var OT=H0,DT=mu,LT=Jt;function FT(e){return OT(e,LT,DT)}var Q0=FT,Ah=Q0,BT=1,UT=Object.prototype,VT=UT.hasOwnProperty;function WT(e,t,r,n,s,o){var a=r&BT,i=Ah(e),u=i.length,c=Ah(t),d=c.length;if(u!=d&&!a)return!1;for(var f=u;f--;){var p=i[f];if(!(a?p in t:VT.call(t,p)))return!1}var h=o.get(e),g=o.get(t);if(h&&g)return h==t&&g==e;var m=!0;o.set(e,t),o.set(t,e);for(var v=a;++f<u;){p=i[f];var y=e[p],b=t[p];if(n)var _=a?n(b,y,p,t,e,o):n(y,b,p,e,t,o);if(!(_===void 0?y===b||s(y,b,r,n,o):_)){m=!1;break}v||(v=p=="constructor")}if(m&&!v){var w=e.constructor,$=t.constructor;w!=$&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof $=="function"&&$ instanceof $)&&(m=!1)}return o.delete(e),o.delete(t),m}var KT=WT,HT=cn,GT=ut,qT=HT(GT,"DataView"),YT=qT,JT=cn,ZT=ut,QT=JT(ZT,"Promise"),XT=QT,eI=cn,tI=ut,rI=eI(tI,"Set"),nI=rI,sI=cn,oI=ut,aI=sI(oI,"WeakMap"),X0=aI,mc=YT,gc=fu,vc=XT,yc=nI,bc=X0,ev=Ir,ts=B0,Nh="[object Map]",iI="[object Object]",Ph="[object Promise]",Rh="[object Set]",Th="[object WeakMap]",Ih="[object DataView]",lI=ts(mc),cI=ts(gc),uI=ts(vc),dI=ts(yc),fI=ts(bc),Br=ev;(mc&&Br(new mc(new ArrayBuffer(1)))!=Ih||gc&&Br(new gc)!=Nh||vc&&Br(vc.resolve())!=Ph||yc&&Br(new yc)!=Rh||bc&&Br(new bc)!=Th)&&(Br=function(e){var t=ev(e),r=t==iI?e.constructor:void 0,n=r?ts(r):"";if(n)switch(n){case lI:return Ih;case cI:return Nh;case uI:return Ph;case dI:return Rh;case fI:return Th}return t});var un=Br,Xi=vi,hI=U0,pI=XP,mI=KT,Mh=un,zh=Ue,Oh=uo,gI=yi,vI=1,Dh="[object Arguments]",Lh="[object Array]",Wo="[object Object]",yI=Object.prototype,Fh=yI.hasOwnProperty;function bI(e,t,r,n,s,o){var a=zh(e),i=zh(t),u=a?Lh:Mh(e),c=i?Lh:Mh(t);u=u==Dh?Wo:u,c=c==Dh?Wo:c;var d=u==Wo,f=c==Wo,p=u==c;if(p&&Oh(e)){if(!Oh(t))return!1;a=!0,d=!1}if(p&&!d)return o||(o=new Xi),a||gI(e)?hI(e,t,r,n,s,o):pI(e,t,u,r,n,s,o);if(!(r&vI)){var h=d&&Fh.call(e,"__wrapped__"),g=f&&Fh.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,v=g?t.value():t;return o||(o=new Xi),s(m,v,r,n,o)}}return p?(o||(o=new Xi),mI(e,t,r,n,s,o)):!1}var xI=bI,wI=xI,Bh=bt;function tv(e,t,r,n,s){return e===t?!0:e==null||t==null||!Bh(e)&&!Bh(t)?e!==e&&t!==t:wI(e,t,r,n,tv,s)}var xu=tv,kI=vi,_I=xu,CI=1,$I=2;function SI(e,t,r,n){var s=r.length,o=s,a=!n;if(e==null)return!o;for(e=Object(e);s--;){var i=r[s];if(a&&i[2]?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++s<o;){i=r[s];var u=i[0],c=e[u],d=i[1];if(a&&i[2]){if(c===void 0&&!(u in e))return!1}else{var f=new kI;if(n)var p=n(c,d,u,e,t,f);if(!(p===void 0?_I(d,c,CI|$I,n,f):p))return!1}}return!0}var jI=SI,EI=xt;function AI(e){return e===e&&!EI(e)}var rv=AI,NI=rv,PI=Jt;function RI(e){for(var t=PI(e),r=t.length;r--;){var n=t[r],s=e[n];t[r]=[n,s,NI(s)]}return t}var TI=RI;function II(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var nv=II,MI=jI,zI=TI,OI=nv;function DI(e){var t=zI(e);return t.length==1&&t[0][2]?OI(t[0][0],t[0][1]):function(r){return r===e||MI(r,e,t)}}var LI=DI,FI=Ue,BI=Jn,UI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,VI=/^\w*$/;function WI(e,t){if(FI(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||BI(e)?!0:VI.test(e)||!UI.test(e)||t!=null&&e in Object(t)}var wu=WI,sv=hu,KI="Expected a function";function ku(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(KI);var r=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=r.cache;if(o.has(s))return o.get(s);var a=e.apply(this,n);return r.cache=o.set(s,a)||o,a};return r.cache=new(ku.Cache||sv),r}ku.Cache=sv;var HI=ku,GI=HI,qI=500;function YI(e){var t=GI(e,function(n){return r.size===qI&&r.clear(),n}),r=t.cache;return t}var JI=YI,ZI=JI,QI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,XI=/\\(\\)?/g,eM=ZI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(QI,function(r,n,s,o){t.push(s?o.replace(XI,"$1"):n||r)}),t}),ov=eM;function tM(e,t){for(var r=-1,n=e==null?0:e.length,s=Array(n);++r<n;)s[r]=t(e[r],r,e);return s}var ho=tM,Uh=Yn,rM=ho,nM=Ue,sM=Jn,Vh=Uh?Uh.prototype:void 0,Wh=Vh?Vh.toString:void 0;function av(e){if(typeof e=="string")return e;if(nM(e))return rM(e,av)+"";if(sM(e))return Wh?Wh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var iv=av,oM=iv;function aM(e){return e==null?"":oM(e)}var rs=aM,iM=Ue,lM=wu,cM=ov,uM=rs;function dM(e,t){return iM(e)?e:lM(e,t)?[e]:cM(uM(e))}var xi=dM,fM=Jn;function hM(e){if(typeof e=="string"||fM(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var dn=hM,pM=xi,mM=dn;function gM(e,t){t=pM(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[mM(t[r++])];return r&&r==n?e:void 0}var _u=gM,vM=_u;function yM(e,t,r){var n=e==null?void 0:vM(e,t);return n===void 0?r:n}var lv=yM;const Qe=je(lv);function bM(e,t){return e!=null&&t in Object(e)}var xM=bM,wM=xi,kM=co,_M=Ue,CM=fo,$M=gu,SM=dn;function jM(e,t,r){t=wM(t,e);for(var n=-1,s=t.length,o=!1;++n<s;){var a=SM(t[n]);if(!(o=e!=null&&r(e,a)))break;e=e[a]}return o||++n!=s?o:(s=e==null?0:e.length,!!s&&$M(s)&&CM(a,s)&&(_M(e)||kM(e)))}var cv=jM,EM=xM,AM=cv;function NM(e,t){return e!=null&&AM(e,t,EM)}var PM=NM,RM=xu,TM=lv,IM=PM,MM=wu,zM=rv,OM=nv,DM=dn,LM=1,FM=2;function BM(e,t){return MM(e)&&zM(t)?OM(DM(e),t):function(r){var n=TM(r,e);return n===void 0&&n===t?IM(r,e):RM(t,n,LM|FM)}}var UM=BM;function VM(e){return e}var wi=VM;function WM(e){return function(t){return t==null?void 0:t[e]}}var KM=WM,HM=_u;function GM(e){return function(t){return HM(t,e)}}var qM=GM,YM=KM,JM=qM,ZM=wu,QM=dn;function XM(e){return ZM(e)?YM(QM(e)):JM(e)}var e2=XM,t2=LI,r2=UM,n2=wi,s2=Ue,o2=e2;function a2(e){return typeof e=="function"?e:e==null?n2:typeof e=="object"?s2(e)?r2(e[0],e[1]):t2(e):o2(e)}var fn=a2,i2=ME,l2=OE,c2=fn;function u2(e,t){return e&&e.length?i2(e,c2(t),l2):void 0}var d2=u2;const ki=je(d2);var f2=bu,h2=un,p2=co,m2=Ue,g2=mr,v2=uo,y2=bi,b2=yi,x2="[object Map]",w2="[object Set]",k2=Object.prototype,_2=k2.hasOwnProperty;function C2(e){if(e==null)return!0;if(g2(e)&&(m2(e)||typeof e=="string"||typeof e.splice=="function"||v2(e)||b2(e)||p2(e)))return!e.length;var t=h2(e);if(t==x2||t==w2)return!e.size;if(y2(e))return!f2(e).length;for(var r in e)if(_2.call(e,r))return!1;return!0}var $2=C2;const pe=je($2);function S2(e,t,r,n){var s=-1,o=e==null?0:e.length;for(n&&o&&(r=e[++s]);++s<o;)r=t(r,e[s],s,e);return r}var uv=S2;function j2(e){return function(t){return e==null?void 0:e[t]}}var E2=j2,A2=E2,N2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},P2=A2(N2),R2=P2,T2=R2,I2=rs,M2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,z2="\\u0300-\\u036f",O2="\\ufe20-\\ufe2f",D2="\\u20d0-\\u20ff",L2=z2+O2+D2,F2="["+L2+"]",B2=RegExp(F2,"g");function U2(e){return e=I2(e),e&&e.replace(M2,T2).replace(B2,"")}var V2=U2,W2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function K2(e){return e.match(W2)||[]}var H2=K2,G2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function q2(e){return G2.test(e)}var Y2=q2,dv="\\ud800-\\udfff",J2="\\u0300-\\u036f",Z2="\\ufe20-\\ufe2f",Q2="\\u20d0-\\u20ff",X2=J2+Z2+Q2,fv="\\u2700-\\u27bf",hv="a-z\\xdf-\\xf6\\xf8-\\xff",ez="\\xac\\xb1\\xd7\\xf7",tz="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rz="\\u2000-\\u206f",nz=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pv="A-Z\\xc0-\\xd6\\xd8-\\xde",sz="\\ufe0e\\ufe0f",mv=ez+tz+rz+nz,gv="['’]",Kh="["+mv+"]",oz="["+X2+"]",vv="\\d+",az="["+fv+"]",yv="["+hv+"]",bv="[^"+dv+mv+vv+fv+hv+pv+"]",iz="\\ud83c[\\udffb-\\udfff]",lz="(?:"+oz+"|"+iz+")",cz="[^"+dv+"]",xv="(?:\\ud83c[\\udde6-\\uddff]){2}",wv="[\\ud800-\\udbff][\\udc00-\\udfff]",An="["+pv+"]",uz="\\u200d",Hh="(?:"+yv+"|"+bv+")",dz="(?:"+An+"|"+bv+")",Gh="(?:"+gv+"(?:d|ll|m|re|s|t|ve))?",qh="(?:"+gv+"(?:D|LL|M|RE|S|T|VE))?",kv=lz+"?",_v="["+sz+"]?",fz="(?:"+uz+"(?:"+[cz,xv,wv].join("|")+")"+_v+kv+")*",hz="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pz="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mz=_v+kv+fz,gz="(?:"+[az,xv,wv].join("|")+")"+mz,vz=RegExp([An+"?"+yv+"+"+Gh+"(?="+[Kh,An,"$"].join("|")+")",dz+"+"+qh+"(?="+[Kh,An+Hh,"$"].join("|")+")",An+"?"+Hh+"+"+Gh,An+"+"+qh,pz,hz,vv,gz].join("|"),"g");function yz(e){return e.match(vz)||[]}var bz=yz,xz=H2,wz=Y2,kz=rs,_z=bz;function Cz(e,t,r){return e=kz(e),t=r?void 0:t,t===void 0?wz(e)?_z(e):xz(e):e.match(t)||[]}var $z=Cz,Sz=uv,jz=V2,Ez=$z,Az="['’]",Nz=RegExp(Az,"g");function Pz(e){return function(t){return Sz(Ez(jz(t).replace(Nz,"")),e,"")}}var Rz=Pz;function Tz(e,t,r){var n=-1,s=e.length;t<0&&(t=-t>s?0:s+t),r=r>s?s:r,r<0&&(r+=s),s=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(s);++n<s;)o[n]=e[n+t];return o}var Cv=Tz,Iz=Cv;function Mz(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:Iz(e,t,r)}var zz=Mz,Oz="\\ud800-\\udfff",Dz="\\u0300-\\u036f",Lz="\\ufe20-\\ufe2f",Fz="\\u20d0-\\u20ff",Bz=Dz+Lz+Fz,Uz="\\ufe0e\\ufe0f",Vz="\\u200d",Wz=RegExp("["+Vz+Oz+Bz+Uz+"]");function Kz(e){return Wz.test(e)}var $v=Kz;function Hz(e){return e.split("")}var Gz=Hz,Sv="\\ud800-\\udfff",qz="\\u0300-\\u036f",Yz="\\ufe20-\\ufe2f",Jz="\\u20d0-\\u20ff",Zz=qz+Yz+Jz,Qz="\\ufe0e\\ufe0f",Xz="["+Sv+"]",xc="["+Zz+"]",wc="\\ud83c[\\udffb-\\udfff]",eO="(?:"+xc+"|"+wc+")",jv="[^"+Sv+"]",Ev="(?:\\ud83c[\\udde6-\\uddff]){2}",Av="[\\ud800-\\udbff][\\udc00-\\udfff]",tO="\\u200d",Nv=eO+"?",Pv="["+Qz+"]?",rO="(?:"+tO+"(?:"+[jv,Ev,Av].join("|")+")"+Pv+Nv+")*",nO=Pv+Nv+rO,sO="(?:"+[jv+xc+"?",xc,Ev,Av,Xz].join("|")+")",oO=RegExp(wc+"(?="+wc+")|"+sO+nO,"g");function aO(e){return e.match(oO)||[]}var iO=aO,lO=Gz,cO=$v,uO=iO;function dO(e){return cO(e)?uO(e):lO(e)}var fO=dO,hO=zz,pO=$v,mO=fO,gO=rs;function vO(e){return function(t){t=gO(t);var r=pO(t)?mO(t):void 0,n=r?r[0]:t.charAt(0),s=r?hO(r,1).join(""):t.slice(1);return n[e]()+s}}var yO=vO,bO=yO,xO=bO("toUpperCase"),wO=xO,kO=Rz,_O=wO,CO=kO(function(e,t,r){return e+(r?" ":"")+_O(t)}),Rv=CO;const Tv=je(Rv);var $O=Math.ceil,SO=Math.max;function jO(e,t,r,n){for(var s=-1,o=SO($O((t-e)/(r||1)),0),a=Array(o);o--;)a[n?o:++s]=e,e+=r;return a}var EO=jO,AO=io,NO=mr,PO=fo,RO=xt;function TO(e,t,r){if(!RO(r))return!1;var n=typeof t;return(n=="number"?NO(r)&&PO(t,r.length):n=="string"&&t in r)?AO(r[t],e):!1}var Iv=TO,IO=/\s/;function MO(e){for(var t=e.length;t--&&IO.test(e.charAt(t)););return t}var zO=MO,OO=zO,DO=/^\s+/;function LO(e){return e&&e.slice(0,OO(e)+1).replace(DO,"")}var FO=LO,BO=FO,Yh=xt,UO=Jn,Jh=NaN,VO=/^[-+]0x[0-9a-f]+$/i,WO=/^0b[01]+$/i,KO=/^0o[0-7]+$/i,HO=parseInt;function GO(e){if(typeof e=="number")return e;if(UO(e))return Jh;if(Yh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Yh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=BO(e);var r=WO.test(e);return r||KO.test(e)?HO(e.slice(2),r?2:8):VO.test(e)?Jh:+e}var Mv=GO,qO=Mv,Zh=1/0,YO=17976931348623157e292;function JO(e){if(!e)return e===0?e:0;if(e=qO(e),e===Zh||e===-Zh){var t=e<0?-1:1;return t*YO}return e===e?e:0}var zv=JO,ZO=EO,QO=Iv,el=zv;function XO(e){return function(t,r,n){return n&&typeof n!="number"&&QO(t,r,n)&&(r=n=void 0),t=el(t),r===void 0?(r=t,t=0):r=el(r),n=n===void 0?t<r?1:-1:el(n),ZO(t,r,n,e)}}var eD=XO,tD=eD,rD=tD(),nD=rD;const Ov=je(nD);var sD=Object.prototype,oD=sD.hasOwnProperty;function aD(e,t){return e!=null&&oD.call(e,t)}var iD=aD,lD=iD,cD=cv;function uD(e,t){return e!=null&&cD(e,t,lD)}var dD=uD;const Dv=je(dD);var fD=fn,hD=mr,pD=Jt;function mD(e){return function(t,r,n){var s=Object(t);if(!hD(t)){var o=fD(r);t=pD(t),r=function(i){return o(s[i],i,s)}}var a=e(t,r,n);return a>-1?s[o?t[a]:a]:void 0}}var gD=mD;function vD(e,t,r,n){for(var s=e.length,o=r+(n?1:-1);n?o--:++o<s;)if(t(e[o],o,e))return o;return-1}var Lv=vD,yD=zv;function bD(e){var t=yD(e),r=t%1;return t===t?r?t-r:t:0}var po=bD,xD=Lv,wD=fn,kD=po,_D=Math.max;function CD(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var s=r==null?0:kD(r);return s<0&&(s=_D(n+s,0)),xD(e,wD(t),s)}var $D=CD,SD=gD,jD=$D,ED=SD(jD),AD=ED;const ND=je(AD);function PD(e){return e!==e}var RD=PD;function TD(e,t,r){for(var n=r-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}var ID=TD,MD=Lv,zD=RD,OD=ID;function DD(e,t,r){return t===t?OD(e,t,r):MD(e,zD,r)}var Fv=DD,LD=Ir,FD=Ue,BD=bt,UD="[object String]";function VD(e){return typeof e=="string"||!FD(e)&&BD(e)&&LD(e)==UD}var WD=VD,KD=ho;function HD(e,t){return KD(t,function(r){return e[r]})}var GD=HD,qD=GD,YD=Jt;function JD(e){return e==null?[]:qD(e,YD(e))}var ZD=JD,QD=Fv,XD=mr,eL=WD,tL=po,rL=ZD,nL=Math.max;function sL(e,t,r,n){e=XD(e)?e:rL(e),r=r&&!n?tL(r):0;var s=e.length;return r<0&&(r=nL(s+r,0)),eL(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&QD(e,t,r)>-1}var oL=sL;const Bv=je(oL);var kc={exports:{}},Uv={},Mt={},Vn={},mo={},we={},so={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(b){if(super(),!e.IDENTIFIER.test(b))throw new Error("CodeGen: name must be a valid identifier");this.str=b}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(b){super(),this._items=typeof b=="string"?[b]:b}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const b=this._items[0];return b===""||b==='""'}get str(){var b;return(b=this._str)!==null&&b!==void 0?b:this._str=this._items.reduce((_,w)=>`${_}${w}`,"")}get names(){var b;return(b=this._names)!==null&&b!==void 0?b:this._names=this._items.reduce((_,w)=>(w instanceof r&&(_[w.str]=(_[w.str]||0)+1),_),{})}}e._Code=n,e.nil=new n("");function s(y,...b){const _=[y[0]];let w=0;for(;w<b.length;)i(_,b[w]),_.push(y[++w]);return new n(_)}e._=s;const o=new n("+");function a(y,...b){const _=[h(y[0])];let w=0;for(;w<b.length;)_.push(o),i(_,b[w]),_.push(o,h(y[++w]));return u(_),new n(_)}e.str=a;function i(y,b){b instanceof n?y.push(...b._items):b instanceof r?y.push(b):y.push(f(b))}e.addCodeArg=i;function u(y){let b=1;for(;b<y.length-1;){if(y[b]===o){const _=c(y[b-1],y[b+1]);if(_!==void 0){y.splice(b-1,3,_);continue}y[b++]="+"}b++}}function c(y,b){if(b==='""')return y;if(y==='""')return b;if(typeof y=="string")return b instanceof r||y[y.length-1]!=='"'?void 0:typeof b!="string"?`${y.slice(0,-1)}${b}"`:b[0]==='"'?y.slice(0,-1)+b.slice(1):void 0;if(typeof b=="string"&&b[0]==='"'&&!(y instanceof r))return`"${y}${b.slice(1)}`}function d(y,b){return b.emptyStr()?y:y.emptyStr()?b:a`${y}${b}`}e.strConcat=d;function f(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:h(Array.isArray(y)?y.join(","):y)}function p(y){return new n(h(y))}e.stringify=p;function h(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function g(y){return typeof y=="string"&&e.IDENTIFIER.test(y)?new n(`.${y}`):s`[${y}]`}e.getProperty=g;function m(y){if(typeof y=="string"&&e.IDENTIFIER.test(y))return new n(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}e.getEsmExportName=m;function v(y){return new n(y.toString())}e.regexpCode=v})(so);var _c={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=so;class r extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:c,parent:d}={}){this._names={},this._prefixes=c,this._parent=d}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){const d=this._names[c]||this._nameGroup(c);return`${c}${d.index++}`}_nameGroup(c){var d,f;if(!((f=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||f===void 0)&&f.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}e.Scope=s;class o extends t.Name{constructor(c,d){super(d),this.prefix=c}setValue(c,{property:d,itemIndex:f}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(d)}[${f}]`}}e.ValueScopeName=o;const a=(0,t._)`\n`;class i extends s{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?a:t.nil}}get(){return this._scope}name(c){return new o(c,this._newName(c))}value(c,d){var f;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const p=this.toName(c),{prefix:h}=p,g=(f=d.key)!==null&&f!==void 0?f:d.ref;let m=this._values[h];if(m){const b=m.get(g);if(b)return b}else m=this._values[h]=new Map;m.set(g,p);const v=this._scope[h]||(this._scope[h]=[]),y=v.length;return v[y]=d.ref,p.setValue(d,{property:h,itemIndex:y}),p}getValue(c,d){const f=this._values[c];if(f)return f.get(d)}scopeRefs(c,d=this._values){return this._reduceValues(d,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${c}${f.scopePath}`})}scopeCode(c=this._values,d,f){return this._reduceValues(c,p=>{if(p.value===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return p.value.code},d,f)}_reduceValues(c,d,f={},p){let h=t.nil;for(const g in c){const m=c[g];if(!m)continue;const v=f[g]=f[g]||new Map;m.forEach(y=>{if(v.has(y))return;v.set(y,n.Started);let b=d(y);if(b){const _=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${_} ${y} = ${b};${this.opts._n}`}else if(b=p==null?void 0:p(y))h=(0,t._)`${h}${b}${this.opts._n}`;else throw new r(y);v.set(y,n.Completed)})}return h}}e.ValueScope=i})(_c);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=so,r=_c;var n=so;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=_c;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(k,C){return this}}class a extends o{constructor(k,C,N){super(),this.varKind=k,this.name=C,this.rhs=N}render({es5:k,_n:C}){const N=k?r.varKinds.var:this.varKind,B=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${B};`+C}optimizeNames(k,C){if(k[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,k,C)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends o{constructor(k,C,N){super(),this.lhs=k,this.rhs=C,this.sideEffects=N}render({_n:k}){return`${this.lhs} = ${this.rhs};`+k}optimizeNames(k,C){if(!(this.lhs instanceof t.Name&&!k[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,k,C),this}get names(){const k=this.lhs instanceof t.Name?{}:{...this.lhs.names};return W(k,this.rhs)}}class u extends i{constructor(k,C,N,B){super(k,N,B),this.op=C}render({_n:k}){return`${this.lhs} ${this.op}= ${this.rhs};`+k}}class c extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`${this.label}:`+k}}class d extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`break${this.label?` ${this.label}`:""};`+k}}class f extends o{constructor(k){super(),this.error=k}render({_n:k}){return`throw ${this.error};`+k}get names(){return this.error.names}}class p extends o{constructor(k){super(),this.code=k}render({_n:k}){return`${this.code};`+k}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(k,C){return this.code=G(this.code,k,C),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(k=[]){super(),this.nodes=k}render(k){return this.nodes.reduce((C,N)=>C+N.render(k),"")}optimizeNodes(){const{nodes:k}=this;let C=k.length;for(;C--;){const N=k[C].optimizeNodes();Array.isArray(N)?k.splice(C,1,...N):N?k[C]=N:k.splice(C,1)}return k.length>0?this:void 0}optimizeNames(k,C){const{nodes:N}=this;let B=N.length;for(;B--;){const H=N[B];H.optimizeNames(k,C)||(L(k,H.names),N.splice(B,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((k,C)=>P(k,C.names),{})}}class g extends h{render(k){return"{"+k._n+super.render(k)+"}"+k._n}}class m extends h{}class v extends g{}v.kind="else";class y extends g{constructor(k,C){super(C),this.condition=k}render(k){let C=`if(${this.condition})`+super.render(k);return this.else&&(C+="else "+this.else.render(k)),C}optimizeNodes(){super.optimizeNodes();const k=this.condition;if(k===!0)return this.nodes;let C=this.else;if(C){const N=C.optimizeNodes();C=this.else=Array.isArray(N)?new v(N):N}if(C)return k===!1?C instanceof y?C:C.nodes:this.nodes.length?this:new y(V(k),C instanceof y?[C]:C.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,C){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(k,C),!!(super.optimizeNames(k,C)||this.else))return this.condition=G(this.condition,k,C),this}get names(){const k=super.names;return W(k,this.condition),this.else&&P(k,this.else.names),k}}y.kind="if";class b extends g{}b.kind="for";class _ extends b{constructor(k){super(),this.iteration=k}render(k){return`for(${this.iteration})`+super.render(k)}optimizeNames(k,C){if(super.optimizeNames(k,C))return this.iteration=G(this.iteration,k,C),this}get names(){return P(super.names,this.iteration.names)}}class w extends b{constructor(k,C,N,B){super(),this.varKind=k,this.name=C,this.from=N,this.to=B}render(k){const C=k.es5?r.varKinds.var:this.varKind,{name:N,from:B,to:H}=this;return`for(${C} ${N}=${B}; ${N}<${H}; ${N}++)`+super.render(k)}get names(){const k=W(super.names,this.from);return W(k,this.to)}}class $ extends b{constructor(k,C,N,B){super(),this.loop=k,this.varKind=C,this.name=N,this.iterable=B}render(k){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(k)}optimizeNames(k,C){if(super.optimizeNames(k,C))return this.iterable=G(this.iterable,k,C),this}get names(){return P(super.names,this.iterable.names)}}class R extends g{constructor(k,C,N){super(),this.name=k,this.args=C,this.async=N}render(k){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(k)}}R.kind="func";class M extends h{render(k){return"return "+super.render(k)}}M.kind="return";class D extends g{render(k){let C="try"+super.render(k);return this.catch&&(C+=this.catch.render(k)),this.finally&&(C+=this.finally.render(k)),C}optimizeNodes(){var k,C;return super.optimizeNodes(),(k=this.catch)===null||k===void 0||k.optimizeNodes(),(C=this.finally)===null||C===void 0||C.optimizeNodes(),this}optimizeNames(k,C){var N,B;return super.optimizeNames(k,C),(N=this.catch)===null||N===void 0||N.optimizeNames(k,C),(B=this.finally)===null||B===void 0||B.optimizeNames(k,C),this}get names(){const k=super.names;return this.catch&&P(k,this.catch.names),this.finally&&P(k,this.finally.names),k}}class j extends g{constructor(k){super(),this.error=k}render(k){return`catch(${this.error})`+super.render(k)}}j.kind="catch";class S extends g{render(k){return"finally"+super.render(k)}}S.kind="finally";class E{constructor(k,C={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...C,_n:C.lines?`
121
+ `:""},this._extScope=k,this._scope=new r.Scope({parent:k}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(k){return this._scope.name(k)}scopeName(k){return this._extScope.name(k)}scopeValue(k,C){const N=this._extScope.value(k,C);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(k,C){return this._extScope.getValue(k,C)}scopeRefs(k){return this._extScope.scopeRefs(k,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(k,C,N,B){const H=this._scope.toName(C);return N!==void 0&&B&&(this._constants[H.str]=N),this._leafNode(new a(k,H,N)),H}const(k,C,N){return this._def(r.varKinds.const,k,C,N)}let(k,C,N){return this._def(r.varKinds.let,k,C,N)}var(k,C,N){return this._def(r.varKinds.var,k,C,N)}assign(k,C,N){return this._leafNode(new i(k,C,N))}add(k,C){return this._leafNode(new u(k,e.operators.ADD,C))}code(k){return typeof k=="function"?k():k!==t.nil&&this._leafNode(new p(k)),this}object(...k){const C=["{"];for(const[N,B]of k)C.length>1&&C.push(","),C.push(N),(N!==B||this.opts.es5)&&(C.push(":"),(0,t.addCodeArg)(C,B));return C.push("}"),new t._Code(C)}if(k,C,N){if(this._blockNode(new y(k)),C&&N)this.code(C).else().code(N).endIf();else if(C)this.code(C).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(k){return this._elseNode(new y(k))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(k,C){return this._blockNode(k),C&&this.code(C).endFor(),this}for(k,C){return this._for(new _(k),C)}forRange(k,C,N,B,H=this.opts.es5?r.varKinds.var:r.varKinds.let){const te=this._scope.toName(k);return this._for(new w(H,te,C,N),()=>B(te))}forOf(k,C,N,B=r.varKinds.const){const H=this._scope.toName(k);if(this.opts.es5){const te=C instanceof t.Name?C:this.var("_arr",C);return this.forRange("_i",0,(0,t._)`${te}.length`,se=>{this.var(H,(0,t._)`${te}[${se}]`),N(H)})}return this._for(new $("of",B,H,C),()=>N(H))}forIn(k,C,N,B=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(k,(0,t._)`Object.keys(${C})`,N);const H=this._scope.toName(k);return this._for(new $("in",B,H,C),()=>N(H))}endFor(){return this._endBlockNode(b)}label(k){return this._leafNode(new c(k))}break(k){return this._leafNode(new d(k))}return(k){const C=new M;if(this._blockNode(C),this.code(k),C.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(M)}try(k,C,N){if(!C&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const B=new D;if(this._blockNode(B),this.code(k),C){const H=this.name("e");this._currNode=B.catch=new j(H),C(H)}return N&&(this._currNode=B.finally=new S,this.code(N)),this._endBlockNode(j,S)}throw(k){return this._leafNode(new f(k))}block(k,C){return this._blockStarts.push(this._nodes.length),k&&this.code(k).endBlock(C),this}endBlock(k){const C=this._blockStarts.pop();if(C===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-C;if(N<0||k!==void 0&&N!==k)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${k} expected`);return this._nodes.length=C,this}func(k,C=t.nil,N,B){return this._blockNode(new R(k,C,N)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(k=1){for(;k-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(k){return this._currNode.nodes.push(k),this}_blockNode(k){this._currNode.nodes.push(k),this._nodes.push(k)}_endBlockNode(k,C){const N=this._currNode;if(N instanceof k||C&&N instanceof C)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${C?`${k.kind}/${C.kind}`:k.kind}"`)}_elseNode(k){const C=this._currNode;if(!(C instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=C.else=k,this}get _root(){return this._nodes[0]}get _currNode(){const k=this._nodes;return k[k.length-1]}set _currNode(k){const C=this._nodes;C[C.length-1]=k}}e.CodeGen=E;function P(z,k){for(const C in k)z[C]=(z[C]||0)+(k[C]||0);return z}function W(z,k){return k instanceof t._CodeOrName?P(z,k.names):z}function G(z,k,C){if(z instanceof t.Name)return N(z);if(!B(z))return z;return new t._Code(z._items.reduce((H,te)=>(te instanceof t.Name&&(te=N(te)),te instanceof t._Code?H.push(...te._items):H.push(te),H),[]));function N(H){const te=C[H.str];return te===void 0||k[H.str]!==1?H:(delete k[H.str],te)}function B(H){return H instanceof t._Code&&H._items.some(te=>te instanceof t.Name&&k[te.str]===1&&C[te.str]!==void 0)}}function L(z,k){for(const C in k)z[C]=(z[C]||0)-(k[C]||0)}function V(z){return typeof z=="boolean"||typeof z=="number"||z===null?!z:(0,t._)`!${Y(z)}`}e.not=V;const O=A(e.operators.AND);function re(...z){return z.reduce(O)}e.and=re;const J=A(e.operators.OR);function K(...z){return z.reduce(J)}e.or=K;function A(z){return(k,C)=>k===t.nil?C:C===t.nil?k:(0,t._)`${Y(k)} ${z} ${Y(C)}`}function Y(z){return z instanceof t.Name?z:(0,t._)`(${z})`}})(we);var oe={};Object.defineProperty(oe,"__esModule",{value:!0});oe.checkStrictMode=oe.getErrorPath=oe.Type=oe.useFunc=oe.setEvaluated=oe.evaluatedPropsToName=oe.mergeEvaluated=oe.eachItem=oe.unescapeJsonPointer=oe.escapeJsonPointer=oe.escapeFragment=oe.unescapeFragment=oe.schemaRefOrVal=oe.schemaHasRulesButRef=oe.schemaHasRules=oe.checkUnknownRules=oe.alwaysValidSchema=oe.toHash=void 0;const Re=we,aL=so;function iL(e){const t={};for(const r of e)t[r]=!0;return t}oe.toHash=iL;function lL(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Vv(e,t),!Wv(t,e.self.RULES.all))}oe.alwaysValidSchema=lL;function Vv(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;const s=n.RULES.keywords;for(const o in t)s[o]||Gv(e,`unknown keyword: "${o}"`)}oe.checkUnknownRules=Vv;function Wv(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return!0;return!1}oe.schemaHasRules=Wv;function cL(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}oe.schemaHasRulesButRef=cL;function uL({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Re._)`${r}`}return(0,Re._)`${e}${t}${(0,Re.getProperty)(n)}`}oe.schemaRefOrVal=uL;function dL(e){return Kv(decodeURIComponent(e))}oe.unescapeFragment=dL;function fL(e){return encodeURIComponent(Cu(e))}oe.escapeFragment=fL;function Cu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}oe.escapeJsonPointer=Cu;function Kv(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}oe.unescapeJsonPointer=Kv;function hL(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)}oe.eachItem=hL;function Qh({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{const u=a===void 0?o:a instanceof Re.Name?(o instanceof Re.Name?e(s,o,a):t(s,o,a),a):o instanceof Re.Name?(t(s,a,o),o):r(o,a);return i===Re.Name&&!(u instanceof Re.Name)?n(s,u):u}}oe.mergeEvaluated={props:Qh({mergeNames:(e,t,r)=>e.if((0,Re._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Re._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Re._)`${r} || {}`).code((0,Re._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Re._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Re._)`${r} || {}`),$u(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Hv}),items:Qh({mergeNames:(e,t,r)=>e.if((0,Re._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Re._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Re._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Re._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Hv(e,t){if(t===!0)return e.var("props",!0);const r=e.var("props",(0,Re._)`{}`);return t!==void 0&&$u(e,r,t),r}oe.evaluatedPropsToName=Hv;function $u(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Re._)`${t}${(0,Re.getProperty)(n)}`,!0))}oe.setEvaluated=$u;const Xh={};function pL(e,t){return e.scopeValue("func",{ref:t,code:Xh[t.code]||(Xh[t.code]=new aL._Code(t.code))})}oe.useFunc=pL;var Cc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Cc||(oe.Type=Cc={}));function mL(e,t,r){if(e instanceof Re.Name){const n=t===Cc.Num;return r?n?(0,Re._)`"[" + ${e} + "]"`:(0,Re._)`"['" + ${e} + "']"`:n?(0,Re._)`"/" + ${e}`:(0,Re._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Re.getProperty)(e).toString():"/"+Cu(e)}oe.getErrorPath=mL;function Gv(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}oe.checkStrictMode=Gv;var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});const et=we,gL={data:new et.Name("data"),valCxt:new et.Name("valCxt"),instancePath:new et.Name("instancePath"),parentData:new et.Name("parentData"),parentDataProperty:new et.Name("parentDataProperty"),rootData:new et.Name("rootData"),dynamicAnchors:new et.Name("dynamicAnchors"),vErrors:new et.Name("vErrors"),errors:new et.Name("errors"),this:new et.Name("this"),self:new et.Name("self"),scope:new et.Name("scope"),json:new et.Name("json"),jsonPos:new et.Name("jsonPos"),jsonLen:new et.Name("jsonLen"),jsonPart:new et.Name("jsonPart")};Zt.default=gL;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=we,r=oe,n=Zt;e.keywordError={message:({keyword:v})=>(0,t.str)`must pass "${v}" keyword validation`},e.keyword$DataError={message:({keyword:v,schemaType:y})=>y?(0,t.str)`"${v}" keyword must be ${y} ($data)`:(0,t.str)`"${v}" keyword is invalid ($data)`};function s(v,y=e.keywordError,b,_){const{it:w}=v,{gen:$,compositeRule:R,allErrors:M}=w,D=f(v,y,b);_??(R||M)?u($,D):c(w,(0,t._)`[${D}]`)}e.reportError=s;function o(v,y=e.keywordError,b){const{it:_}=v,{gen:w,compositeRule:$,allErrors:R}=_,M=f(v,y,b);u(w,M),$||R||c(_,n.default.vErrors)}e.reportExtraError=o;function a(v,y){v.assign(n.default.errors,y),v.if((0,t._)`${n.default.vErrors} !== null`,()=>v.if(y,()=>v.assign((0,t._)`${n.default.vErrors}.length`,y),()=>v.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function i({gen:v,keyword:y,schemaValue:b,data:_,errsCount:w,it:$}){if(w===void 0)throw new Error("ajv implementation error");const R=v.name("err");v.forRange("i",w,n.default.errors,M=>{v.const(R,(0,t._)`${n.default.vErrors}[${M}]`),v.if((0,t._)`${R}.instancePath === undefined`,()=>v.assign((0,t._)`${R}.instancePath`,(0,t.strConcat)(n.default.instancePath,$.errorPath))),v.assign((0,t._)`${R}.schemaPath`,(0,t.str)`${$.errSchemaPath}/${y}`),$.opts.verbose&&(v.assign((0,t._)`${R}.schema`,b),v.assign((0,t._)`${R}.data`,_))})}e.extendErrors=i;function u(v,y){const b=v.const("err",y);v.if((0,t._)`${n.default.vErrors} === null`,()=>v.assign(n.default.vErrors,(0,t._)`[${b}]`),(0,t._)`${n.default.vErrors}.push(${b})`),v.code((0,t._)`${n.default.errors}++`)}function c(v,y){const{gen:b,validateName:_,schemaEnv:w}=v;w.$async?b.throw((0,t._)`new ${v.ValidationError}(${y})`):(b.assign((0,t._)`${_}.errors`,y),b.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function f(v,y,b){const{createErrors:_}=v.it;return _===!1?(0,t._)`{}`:p(v,y,b)}function p(v,y,b={}){const{gen:_,it:w}=v,$=[h(w,b),g(v,b)];return m(v,y,$),_.object(...$)}function h({errorPath:v},{instancePath:y}){const b=y?(0,t.str)`${v}${(0,r.getErrorPath)(y,r.Type.Str)}`:v;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,b)]}function g({keyword:v,it:{errSchemaPath:y}},{schemaPath:b,parentSchema:_}){let w=_?y:(0,t.str)`${y}/${v}`;return b&&(w=(0,t.str)`${w}${(0,r.getErrorPath)(b,r.Type.Str)}`),[d.schemaPath,w]}function m(v,{params:y,message:b},_){const{keyword:w,data:$,schemaValue:R,it:M}=v,{opts:D,propertyName:j,topSchemaRef:S,schemaPath:E}=M;_.push([d.keyword,w],[d.params,typeof y=="function"?y(v):y||(0,t._)`{}`]),D.messages&&_.push([d.message,typeof b=="function"?b(v):b]),D.verbose&&_.push([d.schema,R],[d.parentSchema,(0,t._)`${S}${E}`],[n.default.data,$]),j&&_.push([d.propertyName,j])}})(mo);Object.defineProperty(Vn,"__esModule",{value:!0});Vn.boolOrEmptySchema=Vn.topBoolOrEmptySchema=void 0;const vL=mo,yL=we,bL=Zt,xL={message:"boolean schema is false"};function wL(e){const{gen:t,schema:r,validateName:n}=e;r===!1?qv(e,!1):typeof r=="object"&&r.$async===!0?t.return(bL.default.data):(t.assign((0,yL._)`${n}.errors`,null),t.return(!0))}Vn.topBoolOrEmptySchema=wL;function kL(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),qv(e)):r.var(t,!0)}Vn.boolOrEmptySchema=kL;function qv(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,vL.reportError)(s,xL,void 0,t)}var He={},sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.getRules=sn.isJSONType=void 0;const _L=["string","number","integer","boolean","null","object","array"],CL=new Set(_L);function $L(e){return typeof e=="string"&&CL.has(e)}sn.isJSONType=$L;function SL(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}sn.getRules=SL;var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.shouldUseRule=ir.shouldUseGroup=ir.schemaHasRulesForType=void 0;function jL({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&Yv(e,n)}ir.schemaHasRulesForType=jL;function Yv(e,t){return t.rules.some(r=>Jv(e,r))}ir.shouldUseGroup=Yv;function Jv(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}ir.shouldUseRule=Jv;Object.defineProperty(He,"__esModule",{value:!0});He.reportTypeError=He.checkDataTypes=He.checkDataType=He.coerceAndCheckDataType=He.getJSONTypes=He.getSchemaTypes=He.DataType=void 0;const EL=sn,AL=ir,NL=mo,be=we,Zv=oe;var Dn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Dn||(He.DataType=Dn={}));function PL(e){const t=Qv(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}He.getSchemaTypes=PL;function Qv(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(EL.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}He.getJSONTypes=Qv;function RL(e,t){const{gen:r,data:n,opts:s}=e,o=TL(t,s.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,AL.schemaHasRulesForType)(e,t[0]));if(a){const i=Su(t,n,s.strictNumbers,Dn.Wrong);r.if(i,()=>{o.length?IL(e,t,o):ju(e)})}return a}He.coerceAndCheckDataType=RL;const Xv=new Set(["string","number","integer","boolean","null"]);function TL(e,t){return t?e.filter(r=>Xv.has(r)||t==="array"&&r==="array"):[]}function IL(e,t,r){const{gen:n,data:s,opts:o}=e,a=n.let("dataType",(0,be._)`typeof ${s}`),i=n.let("coerced",(0,be._)`undefined`);o.coerceTypes==="array"&&n.if((0,be._)`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,be._)`${s}[0]`).assign(a,(0,be._)`typeof ${s}`).if(Su(t,s,o.strictNumbers),()=>n.assign(i,s))),n.if((0,be._)`${i} !== undefined`);for(const c of r)(Xv.has(c)||c==="array"&&o.coerceTypes==="array")&&u(c);n.else(),ju(e),n.endIf(),n.if((0,be._)`${i} !== undefined`,()=>{n.assign(s,i),ML(e,i)});function u(c){switch(c){case"string":n.elseIf((0,be._)`${a} == "number" || ${a} == "boolean"`).assign(i,(0,be._)`"" + ${s}`).elseIf((0,be._)`${s} === null`).assign(i,(0,be._)`""`);return;case"number":n.elseIf((0,be._)`${a} == "boolean" || ${s} === null
122
122
  || (${a} == "string" && ${s} && ${s} == +${s})`).assign(i,(0,be._)`+${s}`);return;case"integer":n.elseIf((0,be._)`${a} === "boolean" || ${s} === null
123
123
  || (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(i,(0,be._)`+${s}`);return;case"boolean":n.elseIf((0,be._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(i,!1).elseIf((0,be._)`${s} === "true" || ${s} === 1`).assign(i,!0);return;case"null":n.elseIf((0,be._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(i,null);return;case"array":n.elseIf((0,be._)`${a} === "string" || ${a} === "number"
124
- || ${a} === "boolean" || ${s} === null`).assign(i,(0,be._)`[${s}]`)}}}function ML({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,be._)`${t} !== undefined`,()=>e.assign((0,be._)`${t}[${r}]`,n))}function $c(e,t,r,n=Dn.Correct){const s=n===Dn.Correct?be.operators.EQ:be.operators.NEQ;let o;switch(e){case"null":return(0,be._)`${t} ${s} null`;case"array":o=(0,be._)`Array.isArray(${t})`;break;case"object":o=(0,be._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,be._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,be._)`typeof ${t} ${s} ${e}`}return n===Dn.Correct?o:(0,be.not)(o);function a(i=be.nil){return(0,be.and)((0,be._)`typeof ${t} == "number"`,i,r?(0,be._)`isFinite(${t})`:be.nil)}}He.checkDataType=$c;function Su(e,t,r,n){if(e.length===1)return $c(e[0],t,r,n);let s;const o=(0,Zv.toHash)(e);if(o.array&&o.object){const a=(0,be._)`typeof ${t} != "object"`;s=o.null?a:(0,be._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else s=be.nil;o.number&&delete o.integer;for(const a in o)s=(0,be.and)(s,$c(a,t,r,n));return s}He.checkDataTypes=Su;const zL={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,be._)`{type: ${e}}`:(0,be._)`{type: ${t}}`};function ju(e){const t=OL(e);(0,NL.reportError)(t,zL)}He.reportTypeError=ju;function OL(e){const{gen:t,data:r,schema:n}=e,s=(0,Zv.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}var _i={};Object.defineProperty(_i,"__esModule",{value:!0});_i.assignDefaults=void 0;const wn=we,DL=se;function LL(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)ep(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,o)=>ep(e,o,s.default))}_i.assignDefaults=LL;function ep(e,t,r){const{gen:n,compositeRule:s,data:o,opts:a}=e;if(r===void 0)return;const i=(0,wn._)`${o}${(0,wn.getProperty)(t)}`;if(s){(0,DL.checkStrictMode)(e,`default is ignored for: ${i}`);return}let u=(0,wn._)`${i} === undefined`;a.useDefaults==="empty"&&(u=(0,wn._)`${u} || ${i} === null || ${i} === ""`),n.if(u,(0,wn._)`${i} = ${(0,wn.stringify)(r)}`)}var Vt={},ke={};Object.defineProperty(ke,"__esModule",{value:!0});ke.validateUnion=ke.validateArray=ke.usePattern=ke.callValidateCode=ke.schemaProperties=ke.allSchemaProperties=ke.noPropertyInData=ke.propertyInData=ke.isOwnProperty=ke.hasPropFunc=ke.reportMissingProp=ke.checkMissingProp=ke.checkReportMissingProp=void 0;const Oe=we,Eu=se,xr=Zt,FL=se;function BL(e,t){const{gen:r,data:n,it:s}=e;r.if(Nu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Oe._)`${t}`},!0),e.error()})}ke.checkReportMissingProp=BL;function UL({gen:e,data:t,it:{opts:r}},n,s){return(0,Oe.or)(...n.map(o=>(0,Oe.and)(Nu(e,t,o,r.ownProperties),(0,Oe._)`${s} = ${o}`)))}ke.checkMissingProp=UL;function VL(e,t){e.setParams({missingProperty:t},!0),e.error()}ke.reportMissingProp=VL;function ey(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Oe._)`Object.prototype.hasOwnProperty`})}ke.hasPropFunc=ey;function Au(e,t,r){return(0,Oe._)`${ey(e)}.call(${t}, ${r})`}ke.isOwnProperty=Au;function WL(e,t,r,n){const s=(0,Oe._)`${t}${(0,Oe.getProperty)(r)} !== undefined`;return n?(0,Oe._)`${s} && ${Au(e,t,r)}`:s}ke.propertyInData=WL;function Nu(e,t,r,n){const s=(0,Oe._)`${t}${(0,Oe.getProperty)(r)} === undefined`;return n?(0,Oe.or)(s,(0,Oe.not)(Au(e,t,r))):s}ke.noPropertyInData=Nu;function ty(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ke.allSchemaProperties=ty;function KL(e,t){return ty(t).filter(r=>!(0,Eu.alwaysValidSchema)(e,t[r]))}ke.schemaProperties=KL;function HL({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,u,c){const d=c?(0,Oe._)`${e}, ${t}, ${n}${s}`:t,f=[[xr.default.instancePath,(0,Oe.strConcat)(xr.default.instancePath,o)],[xr.default.parentData,a.parentData],[xr.default.parentDataProperty,a.parentDataProperty],[xr.default.rootData,xr.default.rootData]];a.opts.dynamicRef&&f.push([xr.default.dynamicAnchors,xr.default.dynamicAnchors]);const p=(0,Oe._)`${d}, ${r.object(...f)}`;return u!==Oe.nil?(0,Oe._)`${i}.call(${u}, ${p})`:(0,Oe._)`${i}(${p})`}ke.callValidateCode=HL;const GL=(0,Oe._)`new RegExp`;function qL({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Oe._)`${s.code==="new RegExp"?GL:(0,FL.useFunc)(e,s)}(${r}, ${n})`})}ke.usePattern=qL;function YL(e){const{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){const i=t.let("valid",!0);return a(()=>t.assign(i,!1)),i}return t.var(o,!0),a(()=>t.break()),o;function a(i){const u=t.const("len",(0,Oe._)`${r}.length`);t.forRange("i",0,u,c=>{e.subschema({keyword:n,dataProp:c,dataPropType:Eu.Type.Num},o),t.if((0,Oe.not)(o),i)})}}ke.validateArray=YL;function JL(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Eu.alwaysValidSchema)(s,u))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),i=t.name("_valid");t.block(()=>r.forEach((u,c)=>{const d=e.subschema({keyword:n,schemaProp:c,compositeRule:!0},i);t.assign(a,(0,Oe._)`${a} || ${i}`),e.mergeValidEvaluated(d,i)||t.if((0,Oe.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}ke.validateUnion=JL;Object.defineProperty(Vt,"__esModule",{value:!0});Vt.validateKeywordUsage=Vt.validSchemaType=Vt.funcKeywordCode=Vt.macroKeywordCode=void 0;const lt=we,Kr=Zt,ZL=ke,QL=mo;function XL(e,t){const{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,i=t.macro.call(a.self,s,o,a),u=ry(r,n,i);a.opts.validateSchema!==!1&&a.self.validateSchema(i,!0);const c=r.name("valid");e.subschema({schema:i,schemaPath:lt.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},c),e.pass(c,()=>e.error(!0))}Vt.macroKeywordCode=XL;function eF(e,t){var r;const{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:u}=e;rF(u,t);const c=!i&&t.compile?t.compile.call(u.self,o,a,u):t.validate,d=ry(n,s,c),f=n.let("valid");e.block$data(f,p),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function p(){if(t.errors===!1)m(),t.modifying&&tp(e),v(()=>e.error());else{const y=t.async?h():g();t.modifying&&tp(e),v(()=>tF(e,y))}}function h(){const y=n.let("ruleErrs",null);return n.try(()=>m((0,lt._)`await `),b=>n.assign(f,!1).if((0,lt._)`${b} instanceof ${u.ValidationError}`,()=>n.assign(y,(0,lt._)`${b}.errors`),()=>n.throw(b))),y}function g(){const y=(0,lt._)`${d}.errors`;return n.assign(y,null),m(lt.nil),y}function m(y=t.async?(0,lt._)`await `:lt.nil){const b=u.opts.passContext?Kr.default.this:Kr.default.self,_=!("compile"in t&&!i||t.schema===!1);n.assign(f,(0,lt._)`${y}${(0,ZL.callValidateCode)(e,d,b,_)}`,t.modifying)}function v(y){var b;n.if((0,lt.not)((b=t.valid)!==null&&b!==void 0?b:f),y)}}Vt.funcKeywordCode=eF;function tp(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,lt._)`${n.parentData}[${n.parentDataProperty}]`))}function tF(e,t){const{gen:r}=e;r.if((0,lt._)`Array.isArray(${t})`,()=>{r.assign(Kr.default.vErrors,(0,lt._)`${Kr.default.vErrors} === null ? ${t} : ${Kr.default.vErrors}.concat(${t})`).assign(Kr.default.errors,(0,lt._)`${Kr.default.vErrors}.length`),(0,QL.extendErrors)(e)},()=>e.error())}function rF({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function ry(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,lt.stringify)(r)})}function nF(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Vt.validSchemaType=nF;function sF({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");const a=s.dependencies;if(a!=null&&a.some(i=>!Object.prototype.hasOwnProperty.call(e,i)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[o])){const u=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}Vt.validateKeywordUsage=sF;var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.extendSubschemaMode=Nr.extendSubschemaData=Nr.getSubschema=void 0;const Bt=we,ny=se;function oF(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const i=e.schema[t];return r===void 0?{schema:i,schemaPath:(0,Bt._)`${e.schemaPath}${(0,Bt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:(0,Bt._)`${e.schemaPath}${(0,Bt.getProperty)(t)}${(0,Bt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,ny.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Nr.getSubschema=oF;function aF(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:i}=t;if(r!==void 0){const{errorPath:c,dataPathArr:d,opts:f}=t,p=i.let("data",(0,Bt._)`${t.data}${(0,Bt.getProperty)(r)}`,!0);u(p),e.errorPath=(0,Bt.str)`${c}${(0,ny.getErrorPath)(r,n,f.jsPropertySyntax)}`,e.parentDataProperty=(0,Bt._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){const c=s instanceof Bt.Name?s:i.let("data",s,!0);u(c),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function u(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,c]}}Nr.extendSubschemaData=aF;function iF(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}Nr.extendSubschemaMode=iF;var Je={},sy=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},oy={exports:{}},jr=oy.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};aa(t,n,s,e,"",e)};jr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};jr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};jr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};jr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function aa(e,t,r,n,s,o,a,i,u,c){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,a,i,u,c);for(var d in n){var f=n[d];if(Array.isArray(f)){if(d in jr.arrayKeywords)for(var p=0;p<f.length;p++)aa(e,t,r,f[p],s+"/"+d+"/"+p,o,s,d,n,p)}else if(d in jr.propsKeywords){if(f&&typeof f=="object")for(var h in f)aa(e,t,r,f[h],s+"/"+d+"/"+lF(h),o,s,d,n,h)}else(d in jr.keywords||e.allKeys&&!(d in jr.skipKeywords))&&aa(e,t,r,f,s+"/"+d,o,s,d,n)}r(n,s,o,a,i,u,c)}}function lF(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var cF=oy.exports;Object.defineProperty(Je,"__esModule",{value:!0});Je.getSchemaRefs=Je.resolveUrl=Je.normalizeId=Je._getFullPath=Je.getFullPath=Je.inlineRef=void 0;const uF=se,dF=sy,fF=cF,hF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function pF(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Sc(e):t?ay(e)<=t:!1}Je.inlineRef=pF;const mF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Sc(e){for(const t in e){if(mF.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Sc)||typeof r=="object"&&Sc(r))return!0}return!1}function ay(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!hF.has(r)&&(typeof e[r]=="object"&&(0,uF.eachItem)(e[r],n=>t+=ay(n)),t===1/0))return 1/0}return t}function iy(e,t="",r){r!==!1&&(t=Ln(t));const n=e.parse(t);return ly(e,n)}Je.getFullPath=iy;function ly(e,t){return e.serialize(t).split("#")[0]+"#"}Je._getFullPath=ly;const gF=/#\/?$/;function Ln(e){return e?e.replace(gF,""):""}Je.normalizeId=Ln;function vF(e,t,r){return r=Ln(r),e.resolve(t,r)}Je.resolveUrl=vF;const yF=/^[a-z_][-a-z0-9._]*$/i;function bF(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Ln(e[r]||t),o={"":s},a=iy(n,s,!1),i={},u=new Set;return fF(e,{allKeys:!0},(f,p,h,g)=>{if(g===void 0)return;const m=a+p;let v=o[g];typeof f[r]=="string"&&(v=y.call(this,f[r])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),o[p]=v;function y(_){const w=this.opts.uriResolver.resolve;if(_=Ln(v?w(v,_):_),u.has(_))throw d(_);u.add(_);let $=this.refs[_];return typeof $=="string"&&($=this.refs[$]),typeof $=="object"?c(f,$.schema,_):_!==Ln(m)&&(_[0]==="#"?(c(f,i[_],_),i[_]=f):this.refs[_]=m),_}function b(_){if(typeof _=="string"){if(!yF.test(_))throw new Error(`invalid anchor "${_}"`);y.call(this,`#${_}`)}}}),i;function c(f,p,h){if(p!==void 0&&!dF(f,p))throw d(h)}function d(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Je.getSchemaRefs=bF;Object.defineProperty(Mt,"__esModule",{value:!0});Mt.getData=Mt.KeywordCxt=Mt.validateFunctionCode=void 0;const cy=Vn,rp=He,Pu=ir,La=He,xF=_i,Us=Vt,tl=Nr,ie=we,he=Zt,wF=Je,lr=se,Ss=mo;function kF(e){if(fy(e)&&(hy(e),dy(e))){$F(e);return}uy(e,()=>(0,cy.topBoolOrEmptySchema)(e))}Mt.validateFunctionCode=kF;function uy({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){s.code.es5?e.func(t,(0,ie._)`${he.default.data}, ${he.default.valCxt}`,n.$async,()=>{e.code((0,ie._)`"use strict"; ${np(r,s)}`),CF(e,s),e.code(o)}):e.func(t,(0,ie._)`${he.default.data}, ${_F(s)}`,n.$async,()=>e.code(np(r,s)).code(o))}function _F(e){return(0,ie._)`{${he.default.instancePath}="", ${he.default.parentData}, ${he.default.parentDataProperty}, ${he.default.rootData}=${he.default.data}${e.dynamicRef?(0,ie._)`, ${he.default.dynamicAnchors}={}`:ie.nil}}={}`}function CF(e,t){e.if(he.default.valCxt,()=>{e.var(he.default.instancePath,(0,ie._)`${he.default.valCxt}.${he.default.instancePath}`),e.var(he.default.parentData,(0,ie._)`${he.default.valCxt}.${he.default.parentData}`),e.var(he.default.parentDataProperty,(0,ie._)`${he.default.valCxt}.${he.default.parentDataProperty}`),e.var(he.default.rootData,(0,ie._)`${he.default.valCxt}.${he.default.rootData}`),t.dynamicRef&&e.var(he.default.dynamicAnchors,(0,ie._)`${he.default.valCxt}.${he.default.dynamicAnchors}`)},()=>{e.var(he.default.instancePath,(0,ie._)`""`),e.var(he.default.parentData,(0,ie._)`undefined`),e.var(he.default.parentDataProperty,(0,ie._)`undefined`),e.var(he.default.rootData,he.default.data),t.dynamicRef&&e.var(he.default.dynamicAnchors,(0,ie._)`{}`)})}function $F(e){const{schema:t,opts:r,gen:n}=e;uy(e,()=>{r.$comment&&t.$comment&&my(e),NF(e),n.let(he.default.vErrors,null),n.let(he.default.errors,0),r.unevaluated&&SF(e),py(e),TF(e)})}function SF(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,ie._)`${r}.evaluated`),t.if((0,ie._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,ie._)`${e.evaluated}.props`,(0,ie._)`undefined`)),t.if((0,ie._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,ie._)`${e.evaluated}.items`,(0,ie._)`undefined`))}function np(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,ie._)`/*# sourceURL=${r} */`:ie.nil}function jF(e,t){if(fy(e)&&(hy(e),dy(e))){EF(e,t);return}(0,cy.boolOrEmptySchema)(e,t)}function dy({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function fy(e){return typeof e.schema!="boolean"}function EF(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&my(e),PF(e),RF(e);const o=n.const("_errs",he.default.errors);py(e,o),n.var(t,(0,ie._)`${o} === ${he.default.errors}`)}function hy(e){(0,lr.checkUnknownRules)(e),AF(e)}function py(e,t){if(e.opts.jtd)return sp(e,[],!1,t);const r=(0,rp.getSchemaTypes)(e.schema),n=(0,rp.coerceAndCheckDataType)(e,r);sp(e,r,!n,t)}function AF(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,lr.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function NF(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,lr.checkStrictMode)(e,"default is ignored in the schema root")}function PF(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,wF.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function RF(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function my({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const o=r.$comment;if(s.$comment===!0)e.code((0,ie._)`${he.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){const a=(0,ie.str)`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code((0,ie._)`${he.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function TF(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;r.$async?t.if((0,ie._)`${he.default.errors} === 0`,()=>t.return(he.default.data),()=>t.throw((0,ie._)`new ${s}(${he.default.vErrors})`)):(t.assign((0,ie._)`${n}.errors`,he.default.vErrors),o.unevaluated&&IF(e),t.return((0,ie._)`${he.default.errors} === 0`))}function IF({gen:e,evaluated:t,props:r,items:n}){r instanceof ie.Name&&e.assign((0,ie._)`${t}.props`,r),n instanceof ie.Name&&e.assign((0,ie._)`${t}.items`,n)}function sp(e,t,r,n){const{gen:s,schema:o,data:a,allErrors:i,opts:u,self:c}=e,{RULES:d}=c;if(o.$ref&&(u.ignoreKeywordsWithRef||!(0,lr.schemaHasRulesButRef)(o,d))){s.block(()=>yy(e,"$ref",d.all.$ref.definition));return}u.jtd||MF(e,t),s.block(()=>{for(const p of d.rules)f(p);f(d.post)});function f(p){(0,Pu.shouldUseGroup)(o,p)&&(p.type?(s.if((0,La.checkDataType)(p.type,a,u.strictNumbers)),op(e,p),t.length===1&&t[0]===p.type&&r&&(s.else(),(0,La.reportTypeError)(e)),s.endIf()):op(e,p),i||s.if((0,ie._)`${he.default.errors} === ${n||0}`))}}function op(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,xF.assignDefaults)(e,t.type),r.block(()=>{for(const o of t.rules)(0,Pu.shouldUseRule)(n,o)&&yy(e,o.keyword,o.definition,t.type)})}function MF(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(zF(e,t),e.opts.allowUnionTypes||OF(e,t),DF(e,e.dataTypes))}function zF(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{gy(e.dataTypes,r)||Ru(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),FF(e,t)}}function OF(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Ru(e,"use allowUnionTypes to allow union type keyword")}function DF(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Pu.shouldUseRule)(e.schema,s)){const{type:o}=s.definition;o.length&&!o.some(a=>LF(t,a))&&Ru(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function LF(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function gy(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function FF(e,t){const r=[];for(const n of e.dataTypes)gy(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Ru(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,lr.checkStrictMode)(e,t,e.opts.strictTypes)}class vy{constructor(t,r,n){if((0,Us.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,lr.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",by(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Us.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",he.default.errors))}result(t,r,n){this.failResult((0,ie.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,ie.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,ie._)`${r} !== undefined && (${(0,ie.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Ss.reportExtraError:Ss.reportError)(this,this.def.error,r)}$dataError(){(0,Ss.reportError)(this,this.def.$dataError||Ss.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ss.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=ie.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=ie.nil,r=ie.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:o,def:a}=this;n.if((0,ie.or)((0,ie._)`${s} === undefined`,r)),t!==ie.nil&&n.assign(t,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==ie.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:o}=this;return(0,ie.or)(a(),i());function a(){if(n.length){if(!(r instanceof ie.Name))throw new Error("ajv implementation error");const u=Array.isArray(n)?n:[n];return(0,ie._)`${(0,La.checkDataTypes)(u,r,o.opts.strictNumbers,La.DataType.Wrong)}`}return ie.nil}function i(){if(s.validateSchema){const u=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,ie._)`!${u}(${r})`}return ie.nil}}subschema(t,r){const n=(0,tl.getSubschema)(this.it,t);(0,tl.extendSubschemaData)(n,this.it,t),(0,tl.extendSubschemaMode)(n,t);const s={...this.it,...n,items:void 0,props:void 0};return jF(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=lr.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=lr.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,ie.Name)),!0}}Mt.KeywordCxt=vy;function yy(e,t,r,n){const s=new vy(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Us.funcKeywordCode)(s,r):"macro"in r?(0,Us.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Us.funcKeywordCode)(s,r)}const BF=/^\/(?:[^~]|~0|~1)*$/,UF=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function by(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return he.default.rootData;if(e[0]==="/"){if(!BF.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,o=he.default.rootData}else{const c=UF.exec(e);if(!c)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+c[1];if(s=c[2],s==="#"){if(d>=t)throw new Error(u("property/index",d));return n[t-d]}if(d>t)throw new Error(u("data",d));if(o=r[t-d],!s)return o}let a=o;const i=s.split("/");for(const c of i)c&&(o=(0,ie._)`${o}${(0,ie.getProperty)((0,lr.unescapeJsonPointer)(c))}`,a=(0,ie._)`${a} && ${o}`);return a;function u(c,d){return`Cannot access ${c} ${d} levels up, current level is ${t}`}}Mt.getData=by;var go={};Object.defineProperty(go,"__esModule",{value:!0});class VF extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}go.default=VF;var ns={};Object.defineProperty(ns,"__esModule",{value:!0});const rl=Je;class WF extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,rl.resolveUrl)(t,r,n),this.missingSchema=(0,rl.normalizeId)((0,rl.getFullPath)(t,this.missingRef))}}ns.default=WF;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.resolveSchema=ft.getCompilingSchema=ft.resolveRef=ft.compileSchema=ft.SchemaEnv=void 0;const At=we,KF=go,Dr=Zt,Tt=Je,ap=se,HF=Mt;class Ci{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Tt.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}ft.SchemaEnv=Ci;function Tu(e){const t=xy.call(this,e);if(t)return t;const r=(0,Tt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new At.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o});let i;e.$async&&(i=a.scopeValue("Error",{ref:KF.default,code:(0,At._)`require("ajv/dist/runtime/validation_error").default`}));const u=a.scopeName("validate");e.validateName=u;const c={gen:a,allErrors:this.opts.allErrors,data:Dr.default.data,parentData:Dr.default.parentData,parentDataProperty:Dr.default.parentDataProperty,dataNames:[Dr.default.data],dataPathArr:[At.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,At.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:At.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,At._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,HF.validateFunctionCode)(c),a.optimize(this.opts.code.optimize);const f=a.toString();d=`${a.scopeRefs(Dr.default.scope)}return ${f}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const h=new Function(`${Dr.default.self}`,`${Dr.default.scope}`,d)(this,this.scope.get());if(this.scope.value(u,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:u,validateCode:f,scopeValues:a._values}),this.opts.unevaluated){const{props:g,items:m}=c;h.evaluated={props:g instanceof At.Name?void 0:g,items:m instanceof At.Name?void 0:m,dynamicProps:g instanceof At.Name,dynamicItems:m instanceof At.Name},h.source&&(h.source.evaluated=(0,At.stringify)(h.evaluated))}return e.validate=h,e}catch(f){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),f}finally{this._compilations.delete(e)}}ft.compileSchema=Tu;function GF(e,t,r){var n;r=(0,Tt.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let o=JF.call(this,e,r);if(o===void 0){const a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;a&&(o=new Ci({schema:a,schemaId:i,root:e,baseId:t}))}if(o!==void 0)return e.refs[r]=qF.call(this,o)}ft.resolveRef=GF;function qF(e){return(0,Tt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Tu.call(this,e)}function xy(e){for(const t of this._compilations)if(YF(t,e))return t}ft.getCompilingSchema=xy;function YF(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function JF(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||$i.call(this,e,t)}function $i(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Tt._getFullPath)(this.opts.uriResolver,r);let s=(0,Tt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return nl.call(this,r,e);const o=(0,Tt.normalizeId)(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){const i=$i.call(this,e,a);return typeof(i==null?void 0:i.schema)!="object"?void 0:nl.call(this,r,i)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||Tu.call(this,a),o===(0,Tt.normalizeId)(t)){const{schema:i}=a,{schemaId:u}=this.opts,c=i[u];return c&&(s=(0,Tt.resolveUrl)(this.opts.uriResolver,s,c)),new Ci({schema:i,schemaId:u,root:e,baseId:s})}return nl.call(this,r,a)}}ft.resolveSchema=$i;const ZF=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function nl(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const i of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const u=r[(0,ap.unescapeFragment)(i)];if(u===void 0)return;r=u;const c=typeof r=="object"&&r[this.opts.schemaId];!ZF.has(i)&&c&&(t=(0,Tt.resolveUrl)(this.opts.uriResolver,t,c))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,ap.schemaHasRulesButRef)(r,this.RULES)){const i=(0,Tt.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=$i.call(this,n,i)}const{schemaId:a}=this.opts;if(o=o||new Ci({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o}const QF="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",XF="Meta-schema for $data reference (JSON AnySchema extension proposal)",eB="object",tB=["$data"],rB={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},nB=!1,sB={$id:QF,description:XF,type:eB,required:tB,properties:rB,additionalProperties:nB};var Iu={},Si={exports:{}};const oB=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),wy=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function ky(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}const aB=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function ip(e){return e.length=0,!0}function iB(e,t,r){if(e.length){const n=ky(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function lB(e){let t=0;const r={error:!1,address:"",zone:""},n=[],s=[];let o=!1,a=!1,i=iB;for(let u=0;u<e.length;u++){const c=e[u];if(!(c==="["||c==="]"))if(c===":"){if(o===!0&&(a=!0),!i(s,n,r))break;if(++t>7){r.error=!0;break}u>0&&e[u-1]===":"&&(o=!0),n.push(":");continue}else if(c==="%"){if(!i(s,n,r))break;i=ip}else{s.push(c);continue}}return s.length&&(i===ip?r.zone=s.join(""):a?n.push(s.join("")):n.push(ky(s))),r.address=n.join(""),r}function _y(e){if(cB(e,":")<2)return{host:e,isIPV6:!1};const t=lB(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function cB(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function uB(e){let t=e;const r=[];let n=-1,s=0;for(;s=t.length;){if(s===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(s===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(s===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function dB(e,t){const r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function fB(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!wy(r)){const n=_y(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var Cy={nonSimpleDomain:aB,recomposeAuthority:fB,normalizeComponentEncoding:dB,removeDotSegments:uB,isIPv4:wy,isUUID:oB,normalizeIPv6:_y};const{isUUID:hB}=Cy,pB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function $y(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function Sy(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function jy(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function mB(e){return e.secure=$y(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function gB(e){if((e.port===($y(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function vB(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(pB);if(r){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const s=`${n}:${t.nid||e.nid}`,o=Mu(s);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function yB(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,o=Mu(s);o&&(e=o.serialize(e,t));const a=e,i=e.nss;return a.path=`${n||t.nid}:${i}`,t.skipEscape=!0,a}function bB(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!hB(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function xB(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const Ey={scheme:"http",domainHost:!0,parse:Sy,serialize:jy},wB={scheme:"https",domainHost:Ey.domainHost,parse:Sy,serialize:jy},ia={scheme:"ws",domainHost:!0,parse:mB,serialize:gB},kB={scheme:"wss",domainHost:ia.domainHost,parse:ia.parse,serialize:ia.serialize},_B={scheme:"urn",parse:vB,serialize:yB,skipNormalize:!0},CB={scheme:"urn:uuid",parse:bB,serialize:xB,skipNormalize:!0},Fa={http:Ey,https:wB,ws:ia,wss:kB,urn:_B,"urn:uuid":CB};Object.setPrototypeOf(Fa,null);function Mu(e){return e&&(Fa[e]||Fa[e.toLowerCase()])||void 0}var $B={SCHEMES:Fa,getSchemeHandler:Mu};const{normalizeIPv6:SB,removeDotSegments:Ms,recomposeAuthority:jB,normalizeComponentEncoding:Ko,isIPv4:EB,nonSimpleDomain:AB}=Cy,{SCHEMES:NB,getSchemeHandler:Ay}=$B;function PB(e,t){return typeof e=="string"?e=Wt(fr(e,t),t):typeof e=="object"&&(e=fr(Wt(e,t),t)),e}function RB(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=Ny(fr(e,n),fr(t,n),n,!0);return n.skipEscape=!0,Wt(s,n)}function Ny(e,t,r,n){const s={};return n||(e=fr(Wt(e,r),r),t=fr(Wt(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Ms(t.path||""),s.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Ms(t.path||""),s.query=t.query):(t.path?(t.path[0]==="/"?s.path=Ms(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?s.path="/"+t.path:e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path,s.path=Ms(s.path)),s.query=t.query):(s.path=e.path,t.query!==void 0?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function TB(e,t,r){return typeof e=="string"?(e=unescape(e),e=Wt(Ko(fr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Wt(Ko(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Wt(Ko(fr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Wt(Ko(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Wt(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],o=Ay(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");const a=jB(r);if(a!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(a),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let i=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(i=Ms(i)),a===void 0&&i[0]==="/"&&i[1]==="/"&&(i="/%2F"+i.slice(2)),s.push(i)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}const IB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function fr(e,t){const r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let s=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);const o=e.match(IB);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host)if(EB(n.host)===!1){const u=SB(n.host);n.host=u.host.toLowerCase(),s=u.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");const a=Ay(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&AB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII: "+i}(!a||a&&!a.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}const zu={SCHEMES:NB,normalize:PB,resolve:RB,resolveComponent:Ny,equal:TB,serialize:Wt,parse:fr};Si.exports=zu;Si.exports.default=zu;Si.exports.fastUri=zu;var MB=Si.exports;Object.defineProperty(Iu,"__esModule",{value:!0});const Py=MB;Py.code='require("ajv/dist/runtime/uri").default';Iu.default=Py;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Mt;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=we;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=go,s=ns,o=sn,a=ft,i=we,u=Je,c=He,d=se,f=sB,p=Iu,h=(H,A)=>new RegExp(H,A);h.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},b=200;function _(H){var A,Y,z,k,C,N,B,K,ee,ne,le,me,I,oe,ce,X,de,ge,je,_e,Ie,Ge,it,wt,kt;const xe=H.strict,$e=(A=H.code)===null||A===void 0?void 0:A.optimize,We=$e===!0||$e===void 0?1:$e||0,pt=(z=(Y=H.code)===null||Y===void 0?void 0:Y.regExp)!==null&&z!==void 0?z:h,is=(k=H.uriResolver)!==null&&k!==void 0?k:p.default;return{strictSchema:(N=(C=H.strictSchema)!==null&&C!==void 0?C:xe)!==null&&N!==void 0?N:!0,strictNumbers:(K=(B=H.strictNumbers)!==null&&B!==void 0?B:xe)!==null&&K!==void 0?K:!0,strictTypes:(ne=(ee=H.strictTypes)!==null&&ee!==void 0?ee:xe)!==null&&ne!==void 0?ne:"log",strictTuples:(me=(le=H.strictTuples)!==null&&le!==void 0?le:xe)!==null&&me!==void 0?me:"log",strictRequired:(oe=(I=H.strictRequired)!==null&&I!==void 0?I:xe)!==null&&oe!==void 0?oe:!1,code:H.code?{...H.code,optimize:We,regExp:pt}:{optimize:We,regExp:pt},loopRequired:(ce=H.loopRequired)!==null&&ce!==void 0?ce:b,loopEnum:(X=H.loopEnum)!==null&&X!==void 0?X:b,meta:(de=H.meta)!==null&&de!==void 0?de:!0,messages:(ge=H.messages)!==null&&ge!==void 0?ge:!0,inlineRefs:(je=H.inlineRefs)!==null&&je!==void 0?je:!0,schemaId:(_e=H.schemaId)!==null&&_e!==void 0?_e:"$id",addUsedSchema:(Ie=H.addUsedSchema)!==null&&Ie!==void 0?Ie:!0,validateSchema:(Ge=H.validateSchema)!==null&&Ge!==void 0?Ge:!0,validateFormats:(it=H.validateFormats)!==null&&it!==void 0?it:!0,unicodeRegExp:(wt=H.unicodeRegExp)!==null&&wt!==void 0?wt:!0,int32range:(kt=H.int32range)!==null&&kt!==void 0?kt:!0,uriResolver:is}}class w{constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts={...A,..._(A)};const{es5:Y,lines:z}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:m,es5:Y,lines:z}),this.logger=P(A.logger);const k=A.validateFormats;A.validateFormats=!1,this.RULES=(0,o.getRules)(),$.call(this,v,A,"NOT SUPPORTED"),$.call(this,y,A,"DEPRECATED","warn"),this._metaOpts=S.call(this),A.formats&&D.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords&&j.call(this,A.keywords),typeof A.meta=="object"&&this.addMetaSchema(A.meta),M.call(this),A.validateFormats=k}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:A,meta:Y,schemaId:z}=this.opts;let k=f;z==="id"&&(k={...f},k.id=k.$id,delete k.$id),Y&&A&&this.addMetaSchema(k,k[z],!1)}defaultMeta(){const{meta:A,schemaId:Y}=this.opts;return this.opts.defaultMeta=typeof A=="object"?A[Y]||A:void 0}validate(A,Y){let z;if(typeof A=="string"){if(z=this.getSchema(A),!z)throw new Error(`no schema with key or ref "${A}"`)}else z=this.compile(A);const k=z(Y);return"$async"in z||(this.errors=z.errors),k}compile(A,Y){const z=this._addSchema(A,Y);return z.validate||this._compileSchemaEnv(z)}compileAsync(A,Y){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:z}=this.opts;return k.call(this,A,Y);async function k(ne,le){await C.call(this,ne.$schema);const me=this._addSchema(ne,le);return me.validate||N.call(this,me)}async function C(ne){ne&&!this.getSchema(ne)&&await k.call(this,{$ref:ne},!0)}async function N(ne){try{return this._compileSchemaEnv(ne)}catch(le){if(!(le instanceof s.default))throw le;return B.call(this,le),await K.call(this,le.missingSchema),N.call(this,ne)}}function B({missingSchema:ne,missingRef:le}){if(this.refs[ne])throw new Error(`AnySchema ${ne} is loaded but ${le} cannot be resolved`)}async function K(ne){const le=await ee.call(this,ne);this.refs[ne]||await C.call(this,le.$schema),this.refs[ne]||this.addSchema(le,ne,Y)}async function ee(ne){const le=this._loading[ne];if(le)return le;try{return await(this._loading[ne]=z(ne))}finally{delete this._loading[ne]}}}addSchema(A,Y,z,k=this.opts.validateSchema){if(Array.isArray(A)){for(const N of A)this.addSchema(N,void 0,z,k);return this}let C;if(typeof A=="object"){const{schemaId:N}=this.opts;if(C=A[N],C!==void 0&&typeof C!="string")throw new Error(`schema ${N} must be string`)}return Y=(0,u.normalizeId)(Y||C),this._checkUnique(Y),this.schemas[Y]=this._addSchema(A,z,Y,k,!0),this}addMetaSchema(A,Y,z=this.opts.validateSchema){return this.addSchema(A,Y,!0,z),this}validateSchema(A,Y){if(typeof A=="boolean")return!0;let z;if(z=A.$schema,z!==void 0&&typeof z!="string")throw new Error("$schema must be a string");if(z=z||this.opts.defaultMeta||this.defaultMeta(),!z)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const k=this.validate(z,A);if(!k&&Y){const C="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(C);else throw new Error(C)}return k}getSchema(A){let Y;for(;typeof(Y=R.call(this,A))=="string";)A=Y;if(Y===void 0){const{schemaId:z}=this.opts,k=new a.SchemaEnv({schema:{},schemaId:z});if(Y=a.resolveSchema.call(this,k,A),!Y)return;this.refs[A]=Y}return Y.validate||this._compileSchemaEnv(Y)}removeSchema(A){if(A instanceof RegExp)return this._removeAllSchemas(this.schemas,A),this._removeAllSchemas(this.refs,A),this;switch(typeof A){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const Y=R.call(this,A);return typeof Y=="object"&&this._cache.delete(Y.schema),delete this.schemas[A],delete this.refs[A],this}case"object":{const Y=A;this._cache.delete(Y);let z=A[this.opts.schemaId];return z&&(z=(0,u.normalizeId)(z),delete this.schemas[z],delete this.refs[z]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(A){for(const Y of A)this.addKeyword(Y);return this}addKeyword(A,Y){let z;if(typeof A=="string")z=A,typeof Y=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Y.keyword=z);else if(typeof A=="object"&&Y===void 0){if(Y=A,z=Y.keyword,Array.isArray(z)&&!z.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,z,Y),!Y)return(0,d.eachItem)(z,C=>L.call(this,C)),this;O.call(this,Y);const k={...Y,type:(0,c.getJSONTypes)(Y.type),schemaType:(0,c.getJSONTypes)(Y.schemaType)};return(0,d.eachItem)(z,k.type.length===0?C=>L.call(this,C,k):C=>k.type.forEach(N=>L.call(this,C,k,N))),this}getKeyword(A){const Y=this.RULES.all[A];return typeof Y=="object"?Y.definition:!!Y}removeKeyword(A){const{RULES:Y}=this;delete Y.keywords[A],delete Y.all[A];for(const z of Y.rules){const k=z.rules.findIndex(C=>C.keyword===A);k>=0&&z.rules.splice(k,1)}return this}addFormat(A,Y){return typeof Y=="string"&&(Y=new RegExp(Y)),this.formats[A]=Y,this}errorsText(A=this.errors,{separator:Y=", ",dataVar:z="data"}={}){return!A||A.length===0?"No errors":A.map(k=>`${z}${k.instancePath} ${k.message}`).reduce((k,C)=>k+Y+C)}$dataMetaSchema(A,Y){const z=this.RULES.all;A=JSON.parse(JSON.stringify(A));for(const k of Y){const C=k.split("/").slice(1);let N=A;for(const B of C)N=N[B];for(const B in z){const K=z[B];if(typeof K!="object")continue;const{$data:ee}=K.definition,ne=N[B];ee&&ne&&(N[B]=J(ne))}}return A}_removeAllSchemas(A,Y){for(const z in A){const k=A[z];(!Y||Y.test(z))&&(typeof k=="string"?delete A[z]:k&&!k.meta&&(this._cache.delete(k.schema),delete A[z]))}}_addSchema(A,Y,z,k=this.opts.validateSchema,C=this.opts.addUsedSchema){let N;const{schemaId:B}=this.opts;if(typeof A=="object")N=A[B];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let K=this._cache.get(A);if(K!==void 0)return K;z=(0,u.normalizeId)(N||z);const ee=u.getSchemaRefs.call(this,A,z);return K=new a.SchemaEnv({schema:A,schemaId:B,meta:Y,baseId:z,localRefs:ee}),this._cache.set(K.schema,K),C&&!z.startsWith("#")&&(z&&this._checkUnique(z),this.refs[z]=K),k&&this.validateSchema(A,!0),K}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw new Error(`schema with key or id "${A}" already exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):a.compileSchema.call(this,A),!A.validate)throw new Error("ajv implementation error");return A.validate}_compileMetaSchema(A){const Y=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,A)}finally{this.opts=Y}}}w.ValidationError=n.default,w.MissingRefError=s.default,e.default=w;function $(H,A,Y,z="error"){for(const k in H){const C=k;C in A&&this.logger[z](`${Y}: option ${k}. ${H[C]}`)}}function R(H){return H=(0,u.normalizeId)(H),this.schemas[H]||this.refs[H]}function M(){const H=this.opts.schemas;if(H)if(Array.isArray(H))this.addSchema(H);else for(const A in H)this.addSchema(H[A],A)}function D(){for(const H in this.opts.formats){const A=this.opts.formats[H];A&&this.addFormat(H,A)}}function j(H){if(Array.isArray(H)){this.addVocabulary(H);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const A in H){const Y=H[A];Y.keyword||(Y.keyword=A),this.addKeyword(Y)}}function S(){const H={...this.opts};for(const A of g)delete H[A];return H}const E={log(){},warn(){},error(){}};function P(H){if(H===!1)return E;if(H===void 0)return console;if(H.log&&H.warn&&H.error)return H;throw new Error("logger must implement log, warn and error methods")}const W=/^[a-z_$][a-z0-9_$:-]*$/i;function G(H,A){const{RULES:Y}=this;if((0,d.eachItem)(H,z=>{if(Y.keywords[z])throw new Error(`Keyword ${z} is already defined`);if(!W.test(z))throw new Error(`Keyword ${z} has invalid name`)}),!!A&&A.$data&&!("code"in A||"validate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function L(H,A,Y){var z;const k=A==null?void 0:A.post;if(Y&&k)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:C}=this;let N=k?C.post:C.rules.find(({type:K})=>K===Y);if(N||(N={type:Y,rules:[]},C.rules.push(N)),C.keywords[H]=!0,!A)return;const B={keyword:H,definition:{...A,type:(0,c.getJSONTypes)(A.type),schemaType:(0,c.getJSONTypes)(A.schemaType)}};A.before?V.call(this,N,B,A.before):N.rules.push(B),C.all[H]=B,(z=A.implements)===null||z===void 0||z.forEach(K=>this.addKeyword(K))}function V(H,A,Y){const z=H.rules.findIndex(k=>k.keyword===Y);z>=0?H.rules.splice(z,0,A):(H.rules.push(A),this.logger.warn(`rule ${Y} is not defined`))}function O(H){let{metaSchema:A}=H;A!==void 0&&(H.$data&&this.opts.$data&&(A=J(A)),H.validateSchema=this.compile(A,!0))}const te={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function J(H){return{anyOf:[H,te]}}})(Uv);var Ou={},Du={},Lu={};Object.defineProperty(Lu,"__esModule",{value:!0});const zB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Lu.default=zB;var on={};Object.defineProperty(on,"__esModule",{value:!0});on.callRef=on.getValidate=void 0;const OB=ns,lp=ke,dt=we,kn=Zt,cp=ft,Ho=se,DB={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:u}=n,{root:c}=o;if((r==="#"||r==="#/")&&s===c.baseId)return f();const d=cp.resolveRef.call(u,c,s,r);if(d===void 0)throw new OB.default(n.opts.uriResolver,s,r);if(d instanceof cp.SchemaEnv)return p(d);return h(d);function f(){if(o===c)return la(e,a,o,o.$async);const g=t.scopeValue("root",{ref:c});return la(e,(0,dt._)`${g}.validate`,c,c.$async)}function p(g){const m=Ry(e,g);la(e,m,g,g.$async)}function h(g){const m=t.scopeValue("schema",i.code.source===!0?{ref:g,code:(0,dt.stringify)(g)}:{ref:g}),v=t.name("valid"),y=e.subschema({schema:g,dataTypes:[],schemaPath:dt.nil,topSchemaRef:m,errSchemaPath:r},v);e.mergeEvaluated(y),e.ok(v)}}};function Ry(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,dt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}on.getValidate=Ry;function la(e,t,r,n){const{gen:s,it:o}=e,{allErrors:a,schemaEnv:i,opts:u}=o,c=u.passContext?kn.default.this:dt.nil;n?d():f();function d(){if(!i.$async)throw new Error("async schema referenced by sync schema");const g=s.let("valid");s.try(()=>{s.code((0,dt._)`await ${(0,lp.callValidateCode)(e,t,c)}`),h(t),a||s.assign(g,!0)},m=>{s.if((0,dt._)`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),a||s.assign(g,!1)}),e.ok(g)}function f(){e.result((0,lp.callValidateCode)(e,t,c),()=>h(t),()=>p(t))}function p(g){const m=(0,dt._)`${g}.errors`;s.assign(kn.default.vErrors,(0,dt._)`${kn.default.vErrors} === null ? ${m} : ${kn.default.vErrors}.concat(${m})`),s.assign(kn.default.errors,(0,dt._)`${kn.default.vErrors}.length`)}function h(g){var m;if(!o.opts.unevaluated)return;const v=(m=r==null?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=Ho.mergeEvaluated.props(s,v.props,o.props));else{const y=s.var("props",(0,dt._)`${g}.evaluated.props`);o.props=Ho.mergeEvaluated.props(s,y,o.props,dt.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=Ho.mergeEvaluated.items(s,v.items,o.items));else{const y=s.var("items",(0,dt._)`${g}.evaluated.items`);o.items=Ho.mergeEvaluated.items(s,y,o.items,dt.Name)}}}on.callRef=la;on.default=DB;Object.defineProperty(Du,"__esModule",{value:!0});const LB=Lu,FB=on,BB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",LB.default,FB.default];Du.default=BB;var Fu={},Bu={};Object.defineProperty(Bu,"__esModule",{value:!0});const Ba=we,wr=Ba.operators,Ua={maximum:{okStr:"<=",ok:wr.LTE,fail:wr.GT},minimum:{okStr:">=",ok:wr.GTE,fail:wr.LT},exclusiveMaximum:{okStr:"<",ok:wr.LT,fail:wr.GTE},exclusiveMinimum:{okStr:">",ok:wr.GT,fail:wr.LTE}},UB={message:({keyword:e,schemaCode:t})=>(0,Ba.str)`must be ${Ua[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ba._)`{comparison: ${Ua[e].okStr}, limit: ${t}}`},VB={keyword:Object.keys(Ua),type:"number",schemaType:"number",$data:!0,error:UB,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Ba._)`${r} ${Ua[t].fail} ${n} || isNaN(${r})`)}};Bu.default=VB;var Uu={};Object.defineProperty(Uu,"__esModule",{value:!0});const Vs=we,WB={message:({schemaCode:e})=>(0,Vs.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Vs._)`{multipleOf: ${e}}`},KB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:WB,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),i=o?(0,Vs._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,Vs._)`${a} !== parseInt(${a})`;e.fail$data((0,Vs._)`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Uu.default=KB;var Vu={},Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});function Ty(e){const t=e.length;let r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}Wu.default=Ty;Ty.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(Vu,"__esModule",{value:!0});const Hr=we,HB=se,GB=Wu,qB={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,Hr.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Hr._)`{limit: ${e}}`},YB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qB,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?Hr.operators.GT:Hr.operators.LT,a=s.opts.unicode===!1?(0,Hr._)`${r}.length`:(0,Hr._)`${(0,HB.useFunc)(e.gen,GB.default)}(${r})`;e.fail$data((0,Hr._)`${a} ${o} ${n}`)}};Vu.default=YB;var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});const JB=ke,ZB=se,Rn=we,QB={message:({schemaCode:e})=>(0,Rn.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Rn._)`{pattern: ${e}}`},XB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QB,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e,i=a.opts.unicodeRegExp?"u":"";if(n){const{regExp:u}=a.opts.code,c=u.code==="new RegExp"?(0,Rn._)`new RegExp`:(0,ZB.useFunc)(t,u),d=t.let("valid");t.try(()=>t.assign(d,(0,Rn._)`${c}(${o}, ${i}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,Rn._)`!${d}`)}else{const u=(0,JB.usePattern)(e,s);e.fail$data((0,Rn._)`!${u}.test(${r})`)}}};Ku.default=XB;var Hu={};Object.defineProperty(Hu,"__esModule",{value:!0});const Ws=we,e5={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,Ws.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Ws._)`{limit: ${e}}`},t5={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:e5,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Ws.operators.GT:Ws.operators.LT;e.fail$data((0,Ws._)`Object.keys(${r}).length ${s} ${n}`)}};Hu.default=t5;var Gu={};Object.defineProperty(Gu,"__esModule",{value:!0});const js=ke,Ks=we,r5=se,n5={message:({params:{missingProperty:e}})=>(0,Ks.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Ks._)`{missingProperty: ${e}}`},s5={keyword:"required",type:"object",schemaType:"array",$data:!0,error:n5,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:a}=e,{opts:i}=a;if(!o&&r.length===0)return;const u=r.length>=i.loopRequired;if(a.allErrors?c():d(),i.strictRequired){const h=e.parentSchema.properties,{definedProperties:g}=e.it;for(const m of r)if((h==null?void 0:h[m])===void 0&&!g.has(m)){const v=a.schemaEnv.baseId+a.errSchemaPath,y=`required property "${m}" is not defined at "${v}" (strictRequired)`;(0,r5.checkStrictMode)(a,y,a.opts.strictRequired)}}function c(){if(u||o)e.block$data(Ks.nil,f);else for(const h of r)(0,js.checkReportMissingProp)(e,h)}function d(){const h=t.let("missing");if(u||o){const g=t.let("valid",!0);e.block$data(g,()=>p(h,g)),e.ok(g)}else t.if((0,js.checkMissingProp)(e,r,h)),(0,js.reportMissingProp)(e,h),t.else()}function f(){t.forOf("prop",n,h=>{e.setParams({missingProperty:h}),t.if((0,js.noPropertyInData)(t,s,h,i.ownProperties),()=>e.error())})}function p(h,g){e.setParams({missingProperty:h}),t.forOf(h,n,()=>{t.assign(g,(0,js.propertyInData)(t,s,h,i.ownProperties)),t.if((0,Ks.not)(g),()=>{e.error(),t.break()})},Ks.nil)}}};Gu.default=s5;var qu={};Object.defineProperty(qu,"__esModule",{value:!0});const Hs=we,o5={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Hs.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Hs._)`{limit: ${e}}`},a5={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:o5,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Hs.operators.GT:Hs.operators.LT;e.fail$data((0,Hs._)`${r}.length ${s} ${n}`)}};qu.default=a5;var Yu={},vo={};Object.defineProperty(vo,"__esModule",{value:!0});const Iy=sy;Iy.code='require("ajv/dist/runtime/equal").default';vo.default=Iy;Object.defineProperty(Yu,"__esModule",{value:!0});const sl=He,Ye=we,i5=se,l5=vo,c5={message:({params:{i:e,j:t}})=>(0,Ye.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ye._)`{i: ${e}, j: ${t}}`},u5={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:c5,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=e;if(!n&&!s)return;const u=t.let("valid"),c=o.items?(0,sl.getSchemaTypes)(o.items):[];e.block$data(u,d,(0,Ye._)`${a} === false`),e.ok(u);function d(){const g=t.let("i",(0,Ye._)`${r}.length`),m=t.let("j");e.setParams({i:g,j:m}),t.assign(u,!0),t.if((0,Ye._)`${g} > 1`,()=>(f()?p:h)(g,m))}function f(){return c.length>0&&!c.some(g=>g==="object"||g==="array")}function p(g,m){const v=t.name("item"),y=(0,sl.checkDataTypes)(c,v,i.opts.strictNumbers,sl.DataType.Wrong),b=t.const("indices",(0,Ye._)`{}`);t.for((0,Ye._)`;${g}--;`,()=>{t.let(v,(0,Ye._)`${r}[${g}]`),t.if(y,(0,Ye._)`continue`),c.length>1&&t.if((0,Ye._)`typeof ${v} == "string"`,(0,Ye._)`${v} += "_"`),t.if((0,Ye._)`typeof ${b}[${v}] == "number"`,()=>{t.assign(m,(0,Ye._)`${b}[${v}]`),e.error(),t.assign(u,!1).break()}).code((0,Ye._)`${b}[${v}] = ${g}`)})}function h(g,m){const v=(0,i5.useFunc)(t,l5.default),y=t.name("outer");t.label(y).for((0,Ye._)`;${g}--;`,()=>t.for((0,Ye._)`${m} = ${g}; ${m}--;`,()=>t.if((0,Ye._)`${v}(${r}[${g}], ${r}[${m}])`,()=>{e.error(),t.assign(u,!1).break(y)})))}}};Yu.default=u5;var Ju={};Object.defineProperty(Ju,"__esModule",{value:!0});const jc=we,d5=se,f5=vo,h5={message:"must be equal to constant",params:({schemaCode:e})=>(0,jc._)`{allowedValue: ${e}}`},p5={keyword:"const",$data:!0,error:h5,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;n||o&&typeof o=="object"?e.fail$data((0,jc._)`!${(0,d5.useFunc)(t,f5.default)}(${r}, ${s})`):e.fail((0,jc._)`${o} !== ${r}`)}};Ju.default=p5;var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0});const zs=we,m5=se,g5=vo,v5={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,zs._)`{allowedValues: ${e}}`},y5={keyword:"enum",schemaType:"array",$data:!0,error:v5,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const i=s.length>=a.opts.loopEnum;let u;const c=()=>u??(u=(0,m5.useFunc)(t,g5.default));let d;if(i||n)d=t.let("valid"),e.block$data(d,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const h=t.const("vSchema",o);d=(0,zs.or)(...s.map((g,m)=>p(h,m)))}e.pass(d);function f(){t.assign(d,!1),t.forOf("v",o,h=>t.if((0,zs._)`${c()}(${r}, ${h})`,()=>t.assign(d,!0).break()))}function p(h,g){const m=s[g];return typeof m=="object"&&m!==null?(0,zs._)`${c()}(${r}, ${h}[${g}])`:(0,zs._)`${r} === ${m}`}}};Zu.default=y5;Object.defineProperty(Fu,"__esModule",{value:!0});const b5=Bu,x5=Uu,w5=Vu,k5=Ku,_5=Hu,C5=Gu,$5=qu,S5=Yu,j5=Ju,E5=Zu,A5=[b5.default,x5.default,w5.default,k5.default,_5.default,C5.default,$5.default,S5.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},j5.default,E5.default];Fu.default=A5;var Qu={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.validateAdditionalItems=void 0;const Gr=we,Ec=se,N5={message:({params:{len:e}})=>(0,Gr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Gr._)`{limit: ${e}}`},P5={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:N5,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Ec.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}My(e,n)}};function My(e,t){const{gen:r,schema:n,data:s,keyword:o,it:a}=e;a.items=!0;const i=r.const("len",(0,Gr._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Gr._)`${i} <= ${t.length}`);else if(typeof n=="object"&&!(0,Ec.alwaysValidSchema)(a,n)){const c=r.var("valid",(0,Gr._)`${i} <= ${t.length}`);r.if((0,Gr.not)(c),()=>u(c)),e.ok(c)}function u(c){r.forRange("i",t.length,i,d=>{e.subschema({keyword:o,dataProp:d,dataPropType:Ec.Type.Num},c),a.allErrors||r.if((0,Gr.not)(c),()=>r.break())})}}ss.validateAdditionalItems=My;ss.default=P5;var Xu={},os={};Object.defineProperty(os,"__esModule",{value:!0});os.validateTuple=void 0;const up=we,ca=se,R5=ke,T5={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return zy(e,"additionalItems",t);r.items=!0,!(0,ca.alwaysValidSchema)(r,t)&&e.ok((0,R5.validateArray)(e))}};function zy(e,t,r=e.schema){const{gen:n,parentSchema:s,data:o,keyword:a,it:i}=e;d(s),i.opts.unevaluated&&r.length&&i.items!==!0&&(i.items=ca.mergeEvaluated.items(n,r.length,i.items));const u=n.name("valid"),c=n.const("len",(0,up._)`${o}.length`);r.forEach((f,p)=>{(0,ca.alwaysValidSchema)(i,f)||(n.if((0,up._)`${c} > ${p}`,()=>e.subschema({keyword:a,schemaProp:p,dataProp:p},u)),e.ok(u))});function d(f){const{opts:p,errSchemaPath:h}=i,g=r.length,m=g===f.minItems&&(g===f.maxItems||f[t]===!1);if(p.strictTuples&&!m){const v=`"${a}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,ca.checkStrictMode)(i,v,p.strictTuples)}}}os.validateTuple=zy;os.default=T5;Object.defineProperty(Xu,"__esModule",{value:!0});const I5=os,M5={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,I5.validateTuple)(e,"items")};Xu.default=M5;var ed={};Object.defineProperty(ed,"__esModule",{value:!0});const dp=we,z5=se,O5=ke,D5=ss,L5={message:({params:{len:e}})=>(0,dp.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,dp._)`{limit: ${e}}`},F5={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:L5,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,z5.alwaysValidSchema)(n,t)&&(s?(0,D5.validateAdditionalItems)(e,s):e.ok((0,O5.validateArray)(e)))}};ed.default=F5;var td={};Object.defineProperty(td,"__esModule",{value:!0});const _t=we,Go=se,B5={message:({params:{min:e,max:t}})=>t===void 0?(0,_t.str)`must contain at least ${e} valid item(s)`:(0,_t.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,_t._)`{minContains: ${e}}`:(0,_t._)`{minContains: ${e}, maxContains: ${t}}`},U5={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:B5,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;let a,i;const{minContains:u,maxContains:c}=n;o.opts.next?(a=u===void 0?1:u,i=c):a=1;const d=t.const("len",(0,_t._)`${s}.length`);if(e.setParams({min:a,max:i}),i===void 0&&a===0){(0,Go.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){(0,Go.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Go.alwaysValidSchema)(o,r)){let m=(0,_t._)`${d} >= ${a}`;i!==void 0&&(m=(0,_t._)`${m} && ${d} <= ${i}`),e.pass(m);return}o.items=!0;const f=t.name("valid");i===void 0&&a===1?h(f,()=>t.if(f,()=>t.break())):a===0?(t.let(f,!0),i!==void 0&&t.if((0,_t._)`${s}.length > 0`,p)):(t.let(f,!1),p()),e.result(f,()=>e.reset());function p(){const m=t.name("_valid"),v=t.let("count",0);h(m,()=>t.if(m,()=>g(v)))}function h(m,v){t.forRange("i",0,d,y=>{e.subschema({keyword:"contains",dataProp:y,dataPropType:Go.Type.Num,compositeRule:!0},m),v()})}function g(m){t.code((0,_t._)`${m}++`),i===void 0?t.if((0,_t._)`${m} >= ${a}`,()=>t.assign(f,!0).break()):(t.if((0,_t._)`${m} > ${i}`,()=>t.assign(f,!1).break()),a===1?t.assign(f,!0):t.if((0,_t._)`${m} >= ${a}`,()=>t.assign(f,!0)))}}};td.default=U5;var Oy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=we,r=se,n=ke;e.error={message:({params:{property:u,depsCount:c,deps:d}})=>{const f=c===1?"property":"properties";return(0,t.str)`must have ${f} ${d} when property ${u} is present`},params:({params:{property:u,depsCount:c,deps:d,missingProperty:f}})=>(0,t._)`{property: ${u},
124
+ || ${a} === "boolean" || ${s} === null`).assign(i,(0,be._)`[${s}]`)}}}function ML({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,be._)`${t} !== undefined`,()=>e.assign((0,be._)`${t}[${r}]`,n))}function $c(e,t,r,n=Dn.Correct){const s=n===Dn.Correct?be.operators.EQ:be.operators.NEQ;let o;switch(e){case"null":return(0,be._)`${t} ${s} null`;case"array":o=(0,be._)`Array.isArray(${t})`;break;case"object":o=(0,be._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,be._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,be._)`typeof ${t} ${s} ${e}`}return n===Dn.Correct?o:(0,be.not)(o);function a(i=be.nil){return(0,be.and)((0,be._)`typeof ${t} == "number"`,i,r?(0,be._)`isFinite(${t})`:be.nil)}}He.checkDataType=$c;function Su(e,t,r,n){if(e.length===1)return $c(e[0],t,r,n);let s;const o=(0,Zv.toHash)(e);if(o.array&&o.object){const a=(0,be._)`typeof ${t} != "object"`;s=o.null?a:(0,be._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else s=be.nil;o.number&&delete o.integer;for(const a in o)s=(0,be.and)(s,$c(a,t,r,n));return s}He.checkDataTypes=Su;const zL={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,be._)`{type: ${e}}`:(0,be._)`{type: ${t}}`};function ju(e){const t=OL(e);(0,NL.reportError)(t,zL)}He.reportTypeError=ju;function OL(e){const{gen:t,data:r,schema:n}=e,s=(0,Zv.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}var _i={};Object.defineProperty(_i,"__esModule",{value:!0});_i.assignDefaults=void 0;const wn=we,DL=oe;function LL(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)ep(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,o)=>ep(e,o,s.default))}_i.assignDefaults=LL;function ep(e,t,r){const{gen:n,compositeRule:s,data:o,opts:a}=e;if(r===void 0)return;const i=(0,wn._)`${o}${(0,wn.getProperty)(t)}`;if(s){(0,DL.checkStrictMode)(e,`default is ignored for: ${i}`);return}let u=(0,wn._)`${i} === undefined`;a.useDefaults==="empty"&&(u=(0,wn._)`${u} || ${i} === null || ${i} === ""`),n.if(u,(0,wn._)`${i} = ${(0,wn.stringify)(r)}`)}var Vt={},ke={};Object.defineProperty(ke,"__esModule",{value:!0});ke.validateUnion=ke.validateArray=ke.usePattern=ke.callValidateCode=ke.schemaProperties=ke.allSchemaProperties=ke.noPropertyInData=ke.propertyInData=ke.isOwnProperty=ke.hasPropFunc=ke.reportMissingProp=ke.checkMissingProp=ke.checkReportMissingProp=void 0;const Oe=we,Eu=oe,xr=Zt,FL=oe;function BL(e,t){const{gen:r,data:n,it:s}=e;r.if(Nu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Oe._)`${t}`},!0),e.error()})}ke.checkReportMissingProp=BL;function UL({gen:e,data:t,it:{opts:r}},n,s){return(0,Oe.or)(...n.map(o=>(0,Oe.and)(Nu(e,t,o,r.ownProperties),(0,Oe._)`${s} = ${o}`)))}ke.checkMissingProp=UL;function VL(e,t){e.setParams({missingProperty:t},!0),e.error()}ke.reportMissingProp=VL;function ey(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Oe._)`Object.prototype.hasOwnProperty`})}ke.hasPropFunc=ey;function Au(e,t,r){return(0,Oe._)`${ey(e)}.call(${t}, ${r})`}ke.isOwnProperty=Au;function WL(e,t,r,n){const s=(0,Oe._)`${t}${(0,Oe.getProperty)(r)} !== undefined`;return n?(0,Oe._)`${s} && ${Au(e,t,r)}`:s}ke.propertyInData=WL;function Nu(e,t,r,n){const s=(0,Oe._)`${t}${(0,Oe.getProperty)(r)} === undefined`;return n?(0,Oe.or)(s,(0,Oe.not)(Au(e,t,r))):s}ke.noPropertyInData=Nu;function ty(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ke.allSchemaProperties=ty;function KL(e,t){return ty(t).filter(r=>!(0,Eu.alwaysValidSchema)(e,t[r]))}ke.schemaProperties=KL;function HL({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,u,c){const d=c?(0,Oe._)`${e}, ${t}, ${n}${s}`:t,f=[[xr.default.instancePath,(0,Oe.strConcat)(xr.default.instancePath,o)],[xr.default.parentData,a.parentData],[xr.default.parentDataProperty,a.parentDataProperty],[xr.default.rootData,xr.default.rootData]];a.opts.dynamicRef&&f.push([xr.default.dynamicAnchors,xr.default.dynamicAnchors]);const p=(0,Oe._)`${d}, ${r.object(...f)}`;return u!==Oe.nil?(0,Oe._)`${i}.call(${u}, ${p})`:(0,Oe._)`${i}(${p})`}ke.callValidateCode=HL;const GL=(0,Oe._)`new RegExp`;function qL({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Oe._)`${s.code==="new RegExp"?GL:(0,FL.useFunc)(e,s)}(${r}, ${n})`})}ke.usePattern=qL;function YL(e){const{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){const i=t.let("valid",!0);return a(()=>t.assign(i,!1)),i}return t.var(o,!0),a(()=>t.break()),o;function a(i){const u=t.const("len",(0,Oe._)`${r}.length`);t.forRange("i",0,u,c=>{e.subschema({keyword:n,dataProp:c,dataPropType:Eu.Type.Num},o),t.if((0,Oe.not)(o),i)})}}ke.validateArray=YL;function JL(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Eu.alwaysValidSchema)(s,u))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),i=t.name("_valid");t.block(()=>r.forEach((u,c)=>{const d=e.subschema({keyword:n,schemaProp:c,compositeRule:!0},i);t.assign(a,(0,Oe._)`${a} || ${i}`),e.mergeValidEvaluated(d,i)||t.if((0,Oe.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}ke.validateUnion=JL;Object.defineProperty(Vt,"__esModule",{value:!0});Vt.validateKeywordUsage=Vt.validSchemaType=Vt.funcKeywordCode=Vt.macroKeywordCode=void 0;const lt=we,Kr=Zt,ZL=ke,QL=mo;function XL(e,t){const{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,i=t.macro.call(a.self,s,o,a),u=ry(r,n,i);a.opts.validateSchema!==!1&&a.self.validateSchema(i,!0);const c=r.name("valid");e.subschema({schema:i,schemaPath:lt.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},c),e.pass(c,()=>e.error(!0))}Vt.macroKeywordCode=XL;function eF(e,t){var r;const{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:u}=e;rF(u,t);const c=!i&&t.compile?t.compile.call(u.self,o,a,u):t.validate,d=ry(n,s,c),f=n.let("valid");e.block$data(f,p),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function p(){if(t.errors===!1)m(),t.modifying&&tp(e),v(()=>e.error());else{const y=t.async?h():g();t.modifying&&tp(e),v(()=>tF(e,y))}}function h(){const y=n.let("ruleErrs",null);return n.try(()=>m((0,lt._)`await `),b=>n.assign(f,!1).if((0,lt._)`${b} instanceof ${u.ValidationError}`,()=>n.assign(y,(0,lt._)`${b}.errors`),()=>n.throw(b))),y}function g(){const y=(0,lt._)`${d}.errors`;return n.assign(y,null),m(lt.nil),y}function m(y=t.async?(0,lt._)`await `:lt.nil){const b=u.opts.passContext?Kr.default.this:Kr.default.self,_=!("compile"in t&&!i||t.schema===!1);n.assign(f,(0,lt._)`${y}${(0,ZL.callValidateCode)(e,d,b,_)}`,t.modifying)}function v(y){var b;n.if((0,lt.not)((b=t.valid)!==null&&b!==void 0?b:f),y)}}Vt.funcKeywordCode=eF;function tp(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,lt._)`${n.parentData}[${n.parentDataProperty}]`))}function tF(e,t){const{gen:r}=e;r.if((0,lt._)`Array.isArray(${t})`,()=>{r.assign(Kr.default.vErrors,(0,lt._)`${Kr.default.vErrors} === null ? ${t} : ${Kr.default.vErrors}.concat(${t})`).assign(Kr.default.errors,(0,lt._)`${Kr.default.vErrors}.length`),(0,QL.extendErrors)(e)},()=>e.error())}function rF({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function ry(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,lt.stringify)(r)})}function nF(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Vt.validSchemaType=nF;function sF({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");const a=s.dependencies;if(a!=null&&a.some(i=>!Object.prototype.hasOwnProperty.call(e,i)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[o])){const u=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}Vt.validateKeywordUsage=sF;var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.extendSubschemaMode=Nr.extendSubschemaData=Nr.getSubschema=void 0;const Bt=we,ny=oe;function oF(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const i=e.schema[t];return r===void 0?{schema:i,schemaPath:(0,Bt._)`${e.schemaPath}${(0,Bt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:(0,Bt._)`${e.schemaPath}${(0,Bt.getProperty)(t)}${(0,Bt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,ny.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Nr.getSubschema=oF;function aF(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:i}=t;if(r!==void 0){const{errorPath:c,dataPathArr:d,opts:f}=t,p=i.let("data",(0,Bt._)`${t.data}${(0,Bt.getProperty)(r)}`,!0);u(p),e.errorPath=(0,Bt.str)`${c}${(0,ny.getErrorPath)(r,n,f.jsPropertySyntax)}`,e.parentDataProperty=(0,Bt._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){const c=s instanceof Bt.Name?s:i.let("data",s,!0);u(c),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function u(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,c]}}Nr.extendSubschemaData=aF;function iF(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}Nr.extendSubschemaMode=iF;var Je={},sy=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},oy={exports:{}},jr=oy.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};aa(t,n,s,e,"",e)};jr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};jr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};jr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};jr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function aa(e,t,r,n,s,o,a,i,u,c){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,a,i,u,c);for(var d in n){var f=n[d];if(Array.isArray(f)){if(d in jr.arrayKeywords)for(var p=0;p<f.length;p++)aa(e,t,r,f[p],s+"/"+d+"/"+p,o,s,d,n,p)}else if(d in jr.propsKeywords){if(f&&typeof f=="object")for(var h in f)aa(e,t,r,f[h],s+"/"+d+"/"+lF(h),o,s,d,n,h)}else(d in jr.keywords||e.allKeys&&!(d in jr.skipKeywords))&&aa(e,t,r,f,s+"/"+d,o,s,d,n)}r(n,s,o,a,i,u,c)}}function lF(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var cF=oy.exports;Object.defineProperty(Je,"__esModule",{value:!0});Je.getSchemaRefs=Je.resolveUrl=Je.normalizeId=Je._getFullPath=Je.getFullPath=Je.inlineRef=void 0;const uF=oe,dF=sy,fF=cF,hF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function pF(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Sc(e):t?ay(e)<=t:!1}Je.inlineRef=pF;const mF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Sc(e){for(const t in e){if(mF.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Sc)||typeof r=="object"&&Sc(r))return!0}return!1}function ay(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!hF.has(r)&&(typeof e[r]=="object"&&(0,uF.eachItem)(e[r],n=>t+=ay(n)),t===1/0))return 1/0}return t}function iy(e,t="",r){r!==!1&&(t=Ln(t));const n=e.parse(t);return ly(e,n)}Je.getFullPath=iy;function ly(e,t){return e.serialize(t).split("#")[0]+"#"}Je._getFullPath=ly;const gF=/#\/?$/;function Ln(e){return e?e.replace(gF,""):""}Je.normalizeId=Ln;function vF(e,t,r){return r=Ln(r),e.resolve(t,r)}Je.resolveUrl=vF;const yF=/^[a-z_][-a-z0-9._]*$/i;function bF(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Ln(e[r]||t),o={"":s},a=iy(n,s,!1),i={},u=new Set;return fF(e,{allKeys:!0},(f,p,h,g)=>{if(g===void 0)return;const m=a+p;let v=o[g];typeof f[r]=="string"&&(v=y.call(this,f[r])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),o[p]=v;function y(_){const w=this.opts.uriResolver.resolve;if(_=Ln(v?w(v,_):_),u.has(_))throw d(_);u.add(_);let $=this.refs[_];return typeof $=="string"&&($=this.refs[$]),typeof $=="object"?c(f,$.schema,_):_!==Ln(m)&&(_[0]==="#"?(c(f,i[_],_),i[_]=f):this.refs[_]=m),_}function b(_){if(typeof _=="string"){if(!yF.test(_))throw new Error(`invalid anchor "${_}"`);y.call(this,`#${_}`)}}}),i;function c(f,p,h){if(p!==void 0&&!dF(f,p))throw d(h)}function d(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Je.getSchemaRefs=bF;Object.defineProperty(Mt,"__esModule",{value:!0});Mt.getData=Mt.KeywordCxt=Mt.validateFunctionCode=void 0;const cy=Vn,rp=He,Pu=ir,La=He,xF=_i,Us=Vt,tl=Nr,ie=we,he=Zt,wF=Je,lr=oe,Ss=mo;function kF(e){if(fy(e)&&(hy(e),dy(e))){$F(e);return}uy(e,()=>(0,cy.topBoolOrEmptySchema)(e))}Mt.validateFunctionCode=kF;function uy({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){s.code.es5?e.func(t,(0,ie._)`${he.default.data}, ${he.default.valCxt}`,n.$async,()=>{e.code((0,ie._)`"use strict"; ${np(r,s)}`),CF(e,s),e.code(o)}):e.func(t,(0,ie._)`${he.default.data}, ${_F(s)}`,n.$async,()=>e.code(np(r,s)).code(o))}function _F(e){return(0,ie._)`{${he.default.instancePath}="", ${he.default.parentData}, ${he.default.parentDataProperty}, ${he.default.rootData}=${he.default.data}${e.dynamicRef?(0,ie._)`, ${he.default.dynamicAnchors}={}`:ie.nil}}={}`}function CF(e,t){e.if(he.default.valCxt,()=>{e.var(he.default.instancePath,(0,ie._)`${he.default.valCxt}.${he.default.instancePath}`),e.var(he.default.parentData,(0,ie._)`${he.default.valCxt}.${he.default.parentData}`),e.var(he.default.parentDataProperty,(0,ie._)`${he.default.valCxt}.${he.default.parentDataProperty}`),e.var(he.default.rootData,(0,ie._)`${he.default.valCxt}.${he.default.rootData}`),t.dynamicRef&&e.var(he.default.dynamicAnchors,(0,ie._)`${he.default.valCxt}.${he.default.dynamicAnchors}`)},()=>{e.var(he.default.instancePath,(0,ie._)`""`),e.var(he.default.parentData,(0,ie._)`undefined`),e.var(he.default.parentDataProperty,(0,ie._)`undefined`),e.var(he.default.rootData,he.default.data),t.dynamicRef&&e.var(he.default.dynamicAnchors,(0,ie._)`{}`)})}function $F(e){const{schema:t,opts:r,gen:n}=e;uy(e,()=>{r.$comment&&t.$comment&&my(e),NF(e),n.let(he.default.vErrors,null),n.let(he.default.errors,0),r.unevaluated&&SF(e),py(e),TF(e)})}function SF(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,ie._)`${r}.evaluated`),t.if((0,ie._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,ie._)`${e.evaluated}.props`,(0,ie._)`undefined`)),t.if((0,ie._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,ie._)`${e.evaluated}.items`,(0,ie._)`undefined`))}function np(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,ie._)`/*# sourceURL=${r} */`:ie.nil}function jF(e,t){if(fy(e)&&(hy(e),dy(e))){EF(e,t);return}(0,cy.boolOrEmptySchema)(e,t)}function dy({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function fy(e){return typeof e.schema!="boolean"}function EF(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&my(e),PF(e),RF(e);const o=n.const("_errs",he.default.errors);py(e,o),n.var(t,(0,ie._)`${o} === ${he.default.errors}`)}function hy(e){(0,lr.checkUnknownRules)(e),AF(e)}function py(e,t){if(e.opts.jtd)return sp(e,[],!1,t);const r=(0,rp.getSchemaTypes)(e.schema),n=(0,rp.coerceAndCheckDataType)(e,r);sp(e,r,!n,t)}function AF(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,lr.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function NF(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,lr.checkStrictMode)(e,"default is ignored in the schema root")}function PF(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,wF.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function RF(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function my({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const o=r.$comment;if(s.$comment===!0)e.code((0,ie._)`${he.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){const a=(0,ie.str)`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code((0,ie._)`${he.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function TF(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;r.$async?t.if((0,ie._)`${he.default.errors} === 0`,()=>t.return(he.default.data),()=>t.throw((0,ie._)`new ${s}(${he.default.vErrors})`)):(t.assign((0,ie._)`${n}.errors`,he.default.vErrors),o.unevaluated&&IF(e),t.return((0,ie._)`${he.default.errors} === 0`))}function IF({gen:e,evaluated:t,props:r,items:n}){r instanceof ie.Name&&e.assign((0,ie._)`${t}.props`,r),n instanceof ie.Name&&e.assign((0,ie._)`${t}.items`,n)}function sp(e,t,r,n){const{gen:s,schema:o,data:a,allErrors:i,opts:u,self:c}=e,{RULES:d}=c;if(o.$ref&&(u.ignoreKeywordsWithRef||!(0,lr.schemaHasRulesButRef)(o,d))){s.block(()=>yy(e,"$ref",d.all.$ref.definition));return}u.jtd||MF(e,t),s.block(()=>{for(const p of d.rules)f(p);f(d.post)});function f(p){(0,Pu.shouldUseGroup)(o,p)&&(p.type?(s.if((0,La.checkDataType)(p.type,a,u.strictNumbers)),op(e,p),t.length===1&&t[0]===p.type&&r&&(s.else(),(0,La.reportTypeError)(e)),s.endIf()):op(e,p),i||s.if((0,ie._)`${he.default.errors} === ${n||0}`))}}function op(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,xF.assignDefaults)(e,t.type),r.block(()=>{for(const o of t.rules)(0,Pu.shouldUseRule)(n,o)&&yy(e,o.keyword,o.definition,t.type)})}function MF(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(zF(e,t),e.opts.allowUnionTypes||OF(e,t),DF(e,e.dataTypes))}function zF(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{gy(e.dataTypes,r)||Ru(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),FF(e,t)}}function OF(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Ru(e,"use allowUnionTypes to allow union type keyword")}function DF(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Pu.shouldUseRule)(e.schema,s)){const{type:o}=s.definition;o.length&&!o.some(a=>LF(t,a))&&Ru(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function LF(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function gy(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function FF(e,t){const r=[];for(const n of e.dataTypes)gy(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Ru(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,lr.checkStrictMode)(e,t,e.opts.strictTypes)}class vy{constructor(t,r,n){if((0,Us.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,lr.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",by(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Us.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",he.default.errors))}result(t,r,n){this.failResult((0,ie.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,ie.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,ie._)`${r} !== undefined && (${(0,ie.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Ss.reportExtraError:Ss.reportError)(this,this.def.error,r)}$dataError(){(0,Ss.reportError)(this,this.def.$dataError||Ss.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ss.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=ie.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=ie.nil,r=ie.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:o,def:a}=this;n.if((0,ie.or)((0,ie._)`${s} === undefined`,r)),t!==ie.nil&&n.assign(t,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==ie.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:o}=this;return(0,ie.or)(a(),i());function a(){if(n.length){if(!(r instanceof ie.Name))throw new Error("ajv implementation error");const u=Array.isArray(n)?n:[n];return(0,ie._)`${(0,La.checkDataTypes)(u,r,o.opts.strictNumbers,La.DataType.Wrong)}`}return ie.nil}function i(){if(s.validateSchema){const u=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,ie._)`!${u}(${r})`}return ie.nil}}subschema(t,r){const n=(0,tl.getSubschema)(this.it,t);(0,tl.extendSubschemaData)(n,this.it,t),(0,tl.extendSubschemaMode)(n,t);const s={...this.it,...n,items:void 0,props:void 0};return jF(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=lr.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=lr.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,ie.Name)),!0}}Mt.KeywordCxt=vy;function yy(e,t,r,n){const s=new vy(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Us.funcKeywordCode)(s,r):"macro"in r?(0,Us.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Us.funcKeywordCode)(s,r)}const BF=/^\/(?:[^~]|~0|~1)*$/,UF=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function by(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return he.default.rootData;if(e[0]==="/"){if(!BF.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,o=he.default.rootData}else{const c=UF.exec(e);if(!c)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+c[1];if(s=c[2],s==="#"){if(d>=t)throw new Error(u("property/index",d));return n[t-d]}if(d>t)throw new Error(u("data",d));if(o=r[t-d],!s)return o}let a=o;const i=s.split("/");for(const c of i)c&&(o=(0,ie._)`${o}${(0,ie.getProperty)((0,lr.unescapeJsonPointer)(c))}`,a=(0,ie._)`${a} && ${o}`);return a;function u(c,d){return`Cannot access ${c} ${d} levels up, current level is ${t}`}}Mt.getData=by;var go={};Object.defineProperty(go,"__esModule",{value:!0});class VF extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}go.default=VF;var ns={};Object.defineProperty(ns,"__esModule",{value:!0});const rl=Je;class WF extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,rl.resolveUrl)(t,r,n),this.missingSchema=(0,rl.normalizeId)((0,rl.getFullPath)(t,this.missingRef))}}ns.default=WF;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.resolveSchema=ft.getCompilingSchema=ft.resolveRef=ft.compileSchema=ft.SchemaEnv=void 0;const At=we,KF=go,Dr=Zt,Tt=Je,ap=oe,HF=Mt;class Ci{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Tt.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}ft.SchemaEnv=Ci;function Tu(e){const t=xy.call(this,e);if(t)return t;const r=(0,Tt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new At.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o});let i;e.$async&&(i=a.scopeValue("Error",{ref:KF.default,code:(0,At._)`require("ajv/dist/runtime/validation_error").default`}));const u=a.scopeName("validate");e.validateName=u;const c={gen:a,allErrors:this.opts.allErrors,data:Dr.default.data,parentData:Dr.default.parentData,parentDataProperty:Dr.default.parentDataProperty,dataNames:[Dr.default.data],dataPathArr:[At.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,At.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:At.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,At._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,HF.validateFunctionCode)(c),a.optimize(this.opts.code.optimize);const f=a.toString();d=`${a.scopeRefs(Dr.default.scope)}return ${f}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const h=new Function(`${Dr.default.self}`,`${Dr.default.scope}`,d)(this,this.scope.get());if(this.scope.value(u,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:u,validateCode:f,scopeValues:a._values}),this.opts.unevaluated){const{props:g,items:m}=c;h.evaluated={props:g instanceof At.Name?void 0:g,items:m instanceof At.Name?void 0:m,dynamicProps:g instanceof At.Name,dynamicItems:m instanceof At.Name},h.source&&(h.source.evaluated=(0,At.stringify)(h.evaluated))}return e.validate=h,e}catch(f){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),f}finally{this._compilations.delete(e)}}ft.compileSchema=Tu;function GF(e,t,r){var n;r=(0,Tt.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let o=JF.call(this,e,r);if(o===void 0){const a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;a&&(o=new Ci({schema:a,schemaId:i,root:e,baseId:t}))}if(o!==void 0)return e.refs[r]=qF.call(this,o)}ft.resolveRef=GF;function qF(e){return(0,Tt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Tu.call(this,e)}function xy(e){for(const t of this._compilations)if(YF(t,e))return t}ft.getCompilingSchema=xy;function YF(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function JF(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||$i.call(this,e,t)}function $i(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Tt._getFullPath)(this.opts.uriResolver,r);let s=(0,Tt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return nl.call(this,r,e);const o=(0,Tt.normalizeId)(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){const i=$i.call(this,e,a);return typeof(i==null?void 0:i.schema)!="object"?void 0:nl.call(this,r,i)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||Tu.call(this,a),o===(0,Tt.normalizeId)(t)){const{schema:i}=a,{schemaId:u}=this.opts,c=i[u];return c&&(s=(0,Tt.resolveUrl)(this.opts.uriResolver,s,c)),new Ci({schema:i,schemaId:u,root:e,baseId:s})}return nl.call(this,r,a)}}ft.resolveSchema=$i;const ZF=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function nl(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const i of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const u=r[(0,ap.unescapeFragment)(i)];if(u===void 0)return;r=u;const c=typeof r=="object"&&r[this.opts.schemaId];!ZF.has(i)&&c&&(t=(0,Tt.resolveUrl)(this.opts.uriResolver,t,c))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,ap.schemaHasRulesButRef)(r,this.RULES)){const i=(0,Tt.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=$i.call(this,n,i)}const{schemaId:a}=this.opts;if(o=o||new Ci({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o}const QF="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",XF="Meta-schema for $data reference (JSON AnySchema extension proposal)",eB="object",tB=["$data"],rB={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},nB=!1,sB={$id:QF,description:XF,type:eB,required:tB,properties:rB,additionalProperties:nB};var Iu={},Si={exports:{}};const oB=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),wy=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function ky(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}const aB=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function ip(e){return e.length=0,!0}function iB(e,t,r){if(e.length){const n=ky(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function lB(e){let t=0;const r={error:!1,address:"",zone:""},n=[],s=[];let o=!1,a=!1,i=iB;for(let u=0;u<e.length;u++){const c=e[u];if(!(c==="["||c==="]"))if(c===":"){if(o===!0&&(a=!0),!i(s,n,r))break;if(++t>7){r.error=!0;break}u>0&&e[u-1]===":"&&(o=!0),n.push(":");continue}else if(c==="%"){if(!i(s,n,r))break;i=ip}else{s.push(c);continue}}return s.length&&(i===ip?r.zone=s.join(""):a?n.push(s.join("")):n.push(ky(s))),r.address=n.join(""),r}function _y(e){if(cB(e,":")<2)return{host:e,isIPV6:!1};const t=lB(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function cB(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function uB(e){let t=e;const r=[];let n=-1,s=0;for(;s=t.length;){if(s===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(s===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(s===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function dB(e,t){const r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function fB(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!wy(r)){const n=_y(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var Cy={nonSimpleDomain:aB,recomposeAuthority:fB,normalizeComponentEncoding:dB,removeDotSegments:uB,isIPv4:wy,isUUID:oB,normalizeIPv6:_y};const{isUUID:hB}=Cy,pB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function $y(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function Sy(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function jy(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function mB(e){return e.secure=$y(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function gB(e){if((e.port===($y(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function vB(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(pB);if(r){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const s=`${n}:${t.nid||e.nid}`,o=Mu(s);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function yB(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,o=Mu(s);o&&(e=o.serialize(e,t));const a=e,i=e.nss;return a.path=`${n||t.nid}:${i}`,t.skipEscape=!0,a}function bB(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!hB(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function xB(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const Ey={scheme:"http",domainHost:!0,parse:Sy,serialize:jy},wB={scheme:"https",domainHost:Ey.domainHost,parse:Sy,serialize:jy},ia={scheme:"ws",domainHost:!0,parse:mB,serialize:gB},kB={scheme:"wss",domainHost:ia.domainHost,parse:ia.parse,serialize:ia.serialize},_B={scheme:"urn",parse:vB,serialize:yB,skipNormalize:!0},CB={scheme:"urn:uuid",parse:bB,serialize:xB,skipNormalize:!0},Fa={http:Ey,https:wB,ws:ia,wss:kB,urn:_B,"urn:uuid":CB};Object.setPrototypeOf(Fa,null);function Mu(e){return e&&(Fa[e]||Fa[e.toLowerCase()])||void 0}var $B={SCHEMES:Fa,getSchemeHandler:Mu};const{normalizeIPv6:SB,removeDotSegments:Ms,recomposeAuthority:jB,normalizeComponentEncoding:Ko,isIPv4:EB,nonSimpleDomain:AB}=Cy,{SCHEMES:NB,getSchemeHandler:Ay}=$B;function PB(e,t){return typeof e=="string"?e=Wt(fr(e,t),t):typeof e=="object"&&(e=fr(Wt(e,t),t)),e}function RB(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=Ny(fr(e,n),fr(t,n),n,!0);return n.skipEscape=!0,Wt(s,n)}function Ny(e,t,r,n){const s={};return n||(e=fr(Wt(e,r),r),t=fr(Wt(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Ms(t.path||""),s.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Ms(t.path||""),s.query=t.query):(t.path?(t.path[0]==="/"?s.path=Ms(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?s.path="/"+t.path:e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path,s.path=Ms(s.path)),s.query=t.query):(s.path=e.path,t.query!==void 0?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function TB(e,t,r){return typeof e=="string"?(e=unescape(e),e=Wt(Ko(fr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Wt(Ko(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Wt(Ko(fr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Wt(Ko(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Wt(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],o=Ay(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");const a=jB(r);if(a!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(a),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let i=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(i=Ms(i)),a===void 0&&i[0]==="/"&&i[1]==="/"&&(i="/%2F"+i.slice(2)),s.push(i)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}const IB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function fr(e,t){const r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let s=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);const o=e.match(IB);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host)if(EB(n.host)===!1){const u=SB(n.host);n.host=u.host.toLowerCase(),s=u.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");const a=Ay(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&AB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII: "+i}(!a||a&&!a.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}const zu={SCHEMES:NB,normalize:PB,resolve:RB,resolveComponent:Ny,equal:TB,serialize:Wt,parse:fr};Si.exports=zu;Si.exports.default=zu;Si.exports.fastUri=zu;var MB=Si.exports;Object.defineProperty(Iu,"__esModule",{value:!0});const Py=MB;Py.code='require("ajv/dist/runtime/uri").default';Iu.default=Py;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Mt;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=we;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=go,s=ns,o=sn,a=ft,i=we,u=Je,c=He,d=oe,f=sB,p=Iu,h=(K,A)=>new RegExp(K,A);h.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},b=200;function _(K){var A,Y,z,k,C,N,B,H,te,se,le,me,I,ae,ce,ee,de,ge,Ee,Ce,Ie,Ge,it,wt,kt;const xe=K.strict,Se=(A=K.code)===null||A===void 0?void 0:A.optimize,We=Se===!0||Se===void 0?1:Se||0,pt=(z=(Y=K.code)===null||Y===void 0?void 0:Y.regExp)!==null&&z!==void 0?z:h,is=(k=K.uriResolver)!==null&&k!==void 0?k:p.default;return{strictSchema:(N=(C=K.strictSchema)!==null&&C!==void 0?C:xe)!==null&&N!==void 0?N:!0,strictNumbers:(H=(B=K.strictNumbers)!==null&&B!==void 0?B:xe)!==null&&H!==void 0?H:!0,strictTypes:(se=(te=K.strictTypes)!==null&&te!==void 0?te:xe)!==null&&se!==void 0?se:"log",strictTuples:(me=(le=K.strictTuples)!==null&&le!==void 0?le:xe)!==null&&me!==void 0?me:"log",strictRequired:(ae=(I=K.strictRequired)!==null&&I!==void 0?I:xe)!==null&&ae!==void 0?ae:!1,code:K.code?{...K.code,optimize:We,regExp:pt}:{optimize:We,regExp:pt},loopRequired:(ce=K.loopRequired)!==null&&ce!==void 0?ce:b,loopEnum:(ee=K.loopEnum)!==null&&ee!==void 0?ee:b,meta:(de=K.meta)!==null&&de!==void 0?de:!0,messages:(ge=K.messages)!==null&&ge!==void 0?ge:!0,inlineRefs:(Ee=K.inlineRefs)!==null&&Ee!==void 0?Ee:!0,schemaId:(Ce=K.schemaId)!==null&&Ce!==void 0?Ce:"$id",addUsedSchema:(Ie=K.addUsedSchema)!==null&&Ie!==void 0?Ie:!0,validateSchema:(Ge=K.validateSchema)!==null&&Ge!==void 0?Ge:!0,validateFormats:(it=K.validateFormats)!==null&&it!==void 0?it:!0,unicodeRegExp:(wt=K.unicodeRegExp)!==null&&wt!==void 0?wt:!0,int32range:(kt=K.int32range)!==null&&kt!==void 0?kt:!0,uriResolver:is}}class w{constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts={...A,..._(A)};const{es5:Y,lines:z}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:m,es5:Y,lines:z}),this.logger=P(A.logger);const k=A.validateFormats;A.validateFormats=!1,this.RULES=(0,o.getRules)(),$.call(this,v,A,"NOT SUPPORTED"),$.call(this,y,A,"DEPRECATED","warn"),this._metaOpts=S.call(this),A.formats&&D.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords&&j.call(this,A.keywords),typeof A.meta=="object"&&this.addMetaSchema(A.meta),M.call(this),A.validateFormats=k}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:A,meta:Y,schemaId:z}=this.opts;let k=f;z==="id"&&(k={...f},k.id=k.$id,delete k.$id),Y&&A&&this.addMetaSchema(k,k[z],!1)}defaultMeta(){const{meta:A,schemaId:Y}=this.opts;return this.opts.defaultMeta=typeof A=="object"?A[Y]||A:void 0}validate(A,Y){let z;if(typeof A=="string"){if(z=this.getSchema(A),!z)throw new Error(`no schema with key or ref "${A}"`)}else z=this.compile(A);const k=z(Y);return"$async"in z||(this.errors=z.errors),k}compile(A,Y){const z=this._addSchema(A,Y);return z.validate||this._compileSchemaEnv(z)}compileAsync(A,Y){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:z}=this.opts;return k.call(this,A,Y);async function k(se,le){await C.call(this,se.$schema);const me=this._addSchema(se,le);return me.validate||N.call(this,me)}async function C(se){se&&!this.getSchema(se)&&await k.call(this,{$ref:se},!0)}async function N(se){try{return this._compileSchemaEnv(se)}catch(le){if(!(le instanceof s.default))throw le;return B.call(this,le),await H.call(this,le.missingSchema),N.call(this,se)}}function B({missingSchema:se,missingRef:le}){if(this.refs[se])throw new Error(`AnySchema ${se} is loaded but ${le} cannot be resolved`)}async function H(se){const le=await te.call(this,se);this.refs[se]||await C.call(this,le.$schema),this.refs[se]||this.addSchema(le,se,Y)}async function te(se){const le=this._loading[se];if(le)return le;try{return await(this._loading[se]=z(se))}finally{delete this._loading[se]}}}addSchema(A,Y,z,k=this.opts.validateSchema){if(Array.isArray(A)){for(const N of A)this.addSchema(N,void 0,z,k);return this}let C;if(typeof A=="object"){const{schemaId:N}=this.opts;if(C=A[N],C!==void 0&&typeof C!="string")throw new Error(`schema ${N} must be string`)}return Y=(0,u.normalizeId)(Y||C),this._checkUnique(Y),this.schemas[Y]=this._addSchema(A,z,Y,k,!0),this}addMetaSchema(A,Y,z=this.opts.validateSchema){return this.addSchema(A,Y,!0,z),this}validateSchema(A,Y){if(typeof A=="boolean")return!0;let z;if(z=A.$schema,z!==void 0&&typeof z!="string")throw new Error("$schema must be a string");if(z=z||this.opts.defaultMeta||this.defaultMeta(),!z)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const k=this.validate(z,A);if(!k&&Y){const C="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(C);else throw new Error(C)}return k}getSchema(A){let Y;for(;typeof(Y=R.call(this,A))=="string";)A=Y;if(Y===void 0){const{schemaId:z}=this.opts,k=new a.SchemaEnv({schema:{},schemaId:z});if(Y=a.resolveSchema.call(this,k,A),!Y)return;this.refs[A]=Y}return Y.validate||this._compileSchemaEnv(Y)}removeSchema(A){if(A instanceof RegExp)return this._removeAllSchemas(this.schemas,A),this._removeAllSchemas(this.refs,A),this;switch(typeof A){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const Y=R.call(this,A);return typeof Y=="object"&&this._cache.delete(Y.schema),delete this.schemas[A],delete this.refs[A],this}case"object":{const Y=A;this._cache.delete(Y);let z=A[this.opts.schemaId];return z&&(z=(0,u.normalizeId)(z),delete this.schemas[z],delete this.refs[z]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(A){for(const Y of A)this.addKeyword(Y);return this}addKeyword(A,Y){let z;if(typeof A=="string")z=A,typeof Y=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Y.keyword=z);else if(typeof A=="object"&&Y===void 0){if(Y=A,z=Y.keyword,Array.isArray(z)&&!z.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,z,Y),!Y)return(0,d.eachItem)(z,C=>L.call(this,C)),this;O.call(this,Y);const k={...Y,type:(0,c.getJSONTypes)(Y.type),schemaType:(0,c.getJSONTypes)(Y.schemaType)};return(0,d.eachItem)(z,k.type.length===0?C=>L.call(this,C,k):C=>k.type.forEach(N=>L.call(this,C,k,N))),this}getKeyword(A){const Y=this.RULES.all[A];return typeof Y=="object"?Y.definition:!!Y}removeKeyword(A){const{RULES:Y}=this;delete Y.keywords[A],delete Y.all[A];for(const z of Y.rules){const k=z.rules.findIndex(C=>C.keyword===A);k>=0&&z.rules.splice(k,1)}return this}addFormat(A,Y){return typeof Y=="string"&&(Y=new RegExp(Y)),this.formats[A]=Y,this}errorsText(A=this.errors,{separator:Y=", ",dataVar:z="data"}={}){return!A||A.length===0?"No errors":A.map(k=>`${z}${k.instancePath} ${k.message}`).reduce((k,C)=>k+Y+C)}$dataMetaSchema(A,Y){const z=this.RULES.all;A=JSON.parse(JSON.stringify(A));for(const k of Y){const C=k.split("/").slice(1);let N=A;for(const B of C)N=N[B];for(const B in z){const H=z[B];if(typeof H!="object")continue;const{$data:te}=H.definition,se=N[B];te&&se&&(N[B]=J(se))}}return A}_removeAllSchemas(A,Y){for(const z in A){const k=A[z];(!Y||Y.test(z))&&(typeof k=="string"?delete A[z]:k&&!k.meta&&(this._cache.delete(k.schema),delete A[z]))}}_addSchema(A,Y,z,k=this.opts.validateSchema,C=this.opts.addUsedSchema){let N;const{schemaId:B}=this.opts;if(typeof A=="object")N=A[B];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(A);if(H!==void 0)return H;z=(0,u.normalizeId)(N||z);const te=u.getSchemaRefs.call(this,A,z);return H=new a.SchemaEnv({schema:A,schemaId:B,meta:Y,baseId:z,localRefs:te}),this._cache.set(H.schema,H),C&&!z.startsWith("#")&&(z&&this._checkUnique(z),this.refs[z]=H),k&&this.validateSchema(A,!0),H}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw new Error(`schema with key or id "${A}" already exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):a.compileSchema.call(this,A),!A.validate)throw new Error("ajv implementation error");return A.validate}_compileMetaSchema(A){const Y=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,A)}finally{this.opts=Y}}}w.ValidationError=n.default,w.MissingRefError=s.default,e.default=w;function $(K,A,Y,z="error"){for(const k in K){const C=k;C in A&&this.logger[z](`${Y}: option ${k}. ${K[C]}`)}}function R(K){return K=(0,u.normalizeId)(K),this.schemas[K]||this.refs[K]}function M(){const K=this.opts.schemas;if(K)if(Array.isArray(K))this.addSchema(K);else for(const A in K)this.addSchema(K[A],A)}function D(){for(const K in this.opts.formats){const A=this.opts.formats[K];A&&this.addFormat(K,A)}}function j(K){if(Array.isArray(K)){this.addVocabulary(K);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const A in K){const Y=K[A];Y.keyword||(Y.keyword=A),this.addKeyword(Y)}}function S(){const K={...this.opts};for(const A of g)delete K[A];return K}const E={log(){},warn(){},error(){}};function P(K){if(K===!1)return E;if(K===void 0)return console;if(K.log&&K.warn&&K.error)return K;throw new Error("logger must implement log, warn and error methods")}const W=/^[a-z_$][a-z0-9_$:-]*$/i;function G(K,A){const{RULES:Y}=this;if((0,d.eachItem)(K,z=>{if(Y.keywords[z])throw new Error(`Keyword ${z} is already defined`);if(!W.test(z))throw new Error(`Keyword ${z} has invalid name`)}),!!A&&A.$data&&!("code"in A||"validate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function L(K,A,Y){var z;const k=A==null?void 0:A.post;if(Y&&k)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:C}=this;let N=k?C.post:C.rules.find(({type:H})=>H===Y);if(N||(N={type:Y,rules:[]},C.rules.push(N)),C.keywords[K]=!0,!A)return;const B={keyword:K,definition:{...A,type:(0,c.getJSONTypes)(A.type),schemaType:(0,c.getJSONTypes)(A.schemaType)}};A.before?V.call(this,N,B,A.before):N.rules.push(B),C.all[K]=B,(z=A.implements)===null||z===void 0||z.forEach(H=>this.addKeyword(H))}function V(K,A,Y){const z=K.rules.findIndex(k=>k.keyword===Y);z>=0?K.rules.splice(z,0,A):(K.rules.push(A),this.logger.warn(`rule ${Y} is not defined`))}function O(K){let{metaSchema:A}=K;A!==void 0&&(K.$data&&this.opts.$data&&(A=J(A)),K.validateSchema=this.compile(A,!0))}const re={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function J(K){return{anyOf:[K,re]}}})(Uv);var Ou={},Du={},Lu={};Object.defineProperty(Lu,"__esModule",{value:!0});const zB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Lu.default=zB;var on={};Object.defineProperty(on,"__esModule",{value:!0});on.callRef=on.getValidate=void 0;const OB=ns,lp=ke,dt=we,kn=Zt,cp=ft,Ho=oe,DB={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:u}=n,{root:c}=o;if((r==="#"||r==="#/")&&s===c.baseId)return f();const d=cp.resolveRef.call(u,c,s,r);if(d===void 0)throw new OB.default(n.opts.uriResolver,s,r);if(d instanceof cp.SchemaEnv)return p(d);return h(d);function f(){if(o===c)return la(e,a,o,o.$async);const g=t.scopeValue("root",{ref:c});return la(e,(0,dt._)`${g}.validate`,c,c.$async)}function p(g){const m=Ry(e,g);la(e,m,g,g.$async)}function h(g){const m=t.scopeValue("schema",i.code.source===!0?{ref:g,code:(0,dt.stringify)(g)}:{ref:g}),v=t.name("valid"),y=e.subschema({schema:g,dataTypes:[],schemaPath:dt.nil,topSchemaRef:m,errSchemaPath:r},v);e.mergeEvaluated(y),e.ok(v)}}};function Ry(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,dt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}on.getValidate=Ry;function la(e,t,r,n){const{gen:s,it:o}=e,{allErrors:a,schemaEnv:i,opts:u}=o,c=u.passContext?kn.default.this:dt.nil;n?d():f();function d(){if(!i.$async)throw new Error("async schema referenced by sync schema");const g=s.let("valid");s.try(()=>{s.code((0,dt._)`await ${(0,lp.callValidateCode)(e,t,c)}`),h(t),a||s.assign(g,!0)},m=>{s.if((0,dt._)`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),a||s.assign(g,!1)}),e.ok(g)}function f(){e.result((0,lp.callValidateCode)(e,t,c),()=>h(t),()=>p(t))}function p(g){const m=(0,dt._)`${g}.errors`;s.assign(kn.default.vErrors,(0,dt._)`${kn.default.vErrors} === null ? ${m} : ${kn.default.vErrors}.concat(${m})`),s.assign(kn.default.errors,(0,dt._)`${kn.default.vErrors}.length`)}function h(g){var m;if(!o.opts.unevaluated)return;const v=(m=r==null?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=Ho.mergeEvaluated.props(s,v.props,o.props));else{const y=s.var("props",(0,dt._)`${g}.evaluated.props`);o.props=Ho.mergeEvaluated.props(s,y,o.props,dt.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=Ho.mergeEvaluated.items(s,v.items,o.items));else{const y=s.var("items",(0,dt._)`${g}.evaluated.items`);o.items=Ho.mergeEvaluated.items(s,y,o.items,dt.Name)}}}on.callRef=la;on.default=DB;Object.defineProperty(Du,"__esModule",{value:!0});const LB=Lu,FB=on,BB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",LB.default,FB.default];Du.default=BB;var Fu={},Bu={};Object.defineProperty(Bu,"__esModule",{value:!0});const Ba=we,wr=Ba.operators,Ua={maximum:{okStr:"<=",ok:wr.LTE,fail:wr.GT},minimum:{okStr:">=",ok:wr.GTE,fail:wr.LT},exclusiveMaximum:{okStr:"<",ok:wr.LT,fail:wr.GTE},exclusiveMinimum:{okStr:">",ok:wr.GT,fail:wr.LTE}},UB={message:({keyword:e,schemaCode:t})=>(0,Ba.str)`must be ${Ua[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ba._)`{comparison: ${Ua[e].okStr}, limit: ${t}}`},VB={keyword:Object.keys(Ua),type:"number",schemaType:"number",$data:!0,error:UB,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Ba._)`${r} ${Ua[t].fail} ${n} || isNaN(${r})`)}};Bu.default=VB;var Uu={};Object.defineProperty(Uu,"__esModule",{value:!0});const Vs=we,WB={message:({schemaCode:e})=>(0,Vs.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Vs._)`{multipleOf: ${e}}`},KB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:WB,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),i=o?(0,Vs._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,Vs._)`${a} !== parseInt(${a})`;e.fail$data((0,Vs._)`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Uu.default=KB;var Vu={},Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});function Ty(e){const t=e.length;let r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}Wu.default=Ty;Ty.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(Vu,"__esModule",{value:!0});const Hr=we,HB=oe,GB=Wu,qB={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,Hr.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Hr._)`{limit: ${e}}`},YB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qB,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?Hr.operators.GT:Hr.operators.LT,a=s.opts.unicode===!1?(0,Hr._)`${r}.length`:(0,Hr._)`${(0,HB.useFunc)(e.gen,GB.default)}(${r})`;e.fail$data((0,Hr._)`${a} ${o} ${n}`)}};Vu.default=YB;var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});const JB=ke,ZB=oe,Rn=we,QB={message:({schemaCode:e})=>(0,Rn.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Rn._)`{pattern: ${e}}`},XB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QB,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e,i=a.opts.unicodeRegExp?"u":"";if(n){const{regExp:u}=a.opts.code,c=u.code==="new RegExp"?(0,Rn._)`new RegExp`:(0,ZB.useFunc)(t,u),d=t.let("valid");t.try(()=>t.assign(d,(0,Rn._)`${c}(${o}, ${i}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,Rn._)`!${d}`)}else{const u=(0,JB.usePattern)(e,s);e.fail$data((0,Rn._)`!${u}.test(${r})`)}}};Ku.default=XB;var Hu={};Object.defineProperty(Hu,"__esModule",{value:!0});const Ws=we,e5={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,Ws.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Ws._)`{limit: ${e}}`},t5={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:e5,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Ws.operators.GT:Ws.operators.LT;e.fail$data((0,Ws._)`Object.keys(${r}).length ${s} ${n}`)}};Hu.default=t5;var Gu={};Object.defineProperty(Gu,"__esModule",{value:!0});const js=ke,Ks=we,r5=oe,n5={message:({params:{missingProperty:e}})=>(0,Ks.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Ks._)`{missingProperty: ${e}}`},s5={keyword:"required",type:"object",schemaType:"array",$data:!0,error:n5,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:a}=e,{opts:i}=a;if(!o&&r.length===0)return;const u=r.length>=i.loopRequired;if(a.allErrors?c():d(),i.strictRequired){const h=e.parentSchema.properties,{definedProperties:g}=e.it;for(const m of r)if((h==null?void 0:h[m])===void 0&&!g.has(m)){const v=a.schemaEnv.baseId+a.errSchemaPath,y=`required property "${m}" is not defined at "${v}" (strictRequired)`;(0,r5.checkStrictMode)(a,y,a.opts.strictRequired)}}function c(){if(u||o)e.block$data(Ks.nil,f);else for(const h of r)(0,js.checkReportMissingProp)(e,h)}function d(){const h=t.let("missing");if(u||o){const g=t.let("valid",!0);e.block$data(g,()=>p(h,g)),e.ok(g)}else t.if((0,js.checkMissingProp)(e,r,h)),(0,js.reportMissingProp)(e,h),t.else()}function f(){t.forOf("prop",n,h=>{e.setParams({missingProperty:h}),t.if((0,js.noPropertyInData)(t,s,h,i.ownProperties),()=>e.error())})}function p(h,g){e.setParams({missingProperty:h}),t.forOf(h,n,()=>{t.assign(g,(0,js.propertyInData)(t,s,h,i.ownProperties)),t.if((0,Ks.not)(g),()=>{e.error(),t.break()})},Ks.nil)}}};Gu.default=s5;var qu={};Object.defineProperty(qu,"__esModule",{value:!0});const Hs=we,o5={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Hs.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Hs._)`{limit: ${e}}`},a5={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:o5,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Hs.operators.GT:Hs.operators.LT;e.fail$data((0,Hs._)`${r}.length ${s} ${n}`)}};qu.default=a5;var Yu={},vo={};Object.defineProperty(vo,"__esModule",{value:!0});const Iy=sy;Iy.code='require("ajv/dist/runtime/equal").default';vo.default=Iy;Object.defineProperty(Yu,"__esModule",{value:!0});const sl=He,Ye=we,i5=oe,l5=vo,c5={message:({params:{i:e,j:t}})=>(0,Ye.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ye._)`{i: ${e}, j: ${t}}`},u5={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:c5,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=e;if(!n&&!s)return;const u=t.let("valid"),c=o.items?(0,sl.getSchemaTypes)(o.items):[];e.block$data(u,d,(0,Ye._)`${a} === false`),e.ok(u);function d(){const g=t.let("i",(0,Ye._)`${r}.length`),m=t.let("j");e.setParams({i:g,j:m}),t.assign(u,!0),t.if((0,Ye._)`${g} > 1`,()=>(f()?p:h)(g,m))}function f(){return c.length>0&&!c.some(g=>g==="object"||g==="array")}function p(g,m){const v=t.name("item"),y=(0,sl.checkDataTypes)(c,v,i.opts.strictNumbers,sl.DataType.Wrong),b=t.const("indices",(0,Ye._)`{}`);t.for((0,Ye._)`;${g}--;`,()=>{t.let(v,(0,Ye._)`${r}[${g}]`),t.if(y,(0,Ye._)`continue`),c.length>1&&t.if((0,Ye._)`typeof ${v} == "string"`,(0,Ye._)`${v} += "_"`),t.if((0,Ye._)`typeof ${b}[${v}] == "number"`,()=>{t.assign(m,(0,Ye._)`${b}[${v}]`),e.error(),t.assign(u,!1).break()}).code((0,Ye._)`${b}[${v}] = ${g}`)})}function h(g,m){const v=(0,i5.useFunc)(t,l5.default),y=t.name("outer");t.label(y).for((0,Ye._)`;${g}--;`,()=>t.for((0,Ye._)`${m} = ${g}; ${m}--;`,()=>t.if((0,Ye._)`${v}(${r}[${g}], ${r}[${m}])`,()=>{e.error(),t.assign(u,!1).break(y)})))}}};Yu.default=u5;var Ju={};Object.defineProperty(Ju,"__esModule",{value:!0});const jc=we,d5=oe,f5=vo,h5={message:"must be equal to constant",params:({schemaCode:e})=>(0,jc._)`{allowedValue: ${e}}`},p5={keyword:"const",$data:!0,error:h5,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;n||o&&typeof o=="object"?e.fail$data((0,jc._)`!${(0,d5.useFunc)(t,f5.default)}(${r}, ${s})`):e.fail((0,jc._)`${o} !== ${r}`)}};Ju.default=p5;var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0});const zs=we,m5=oe,g5=vo,v5={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,zs._)`{allowedValues: ${e}}`},y5={keyword:"enum",schemaType:"array",$data:!0,error:v5,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const i=s.length>=a.opts.loopEnum;let u;const c=()=>u??(u=(0,m5.useFunc)(t,g5.default));let d;if(i||n)d=t.let("valid"),e.block$data(d,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const h=t.const("vSchema",o);d=(0,zs.or)(...s.map((g,m)=>p(h,m)))}e.pass(d);function f(){t.assign(d,!1),t.forOf("v",o,h=>t.if((0,zs._)`${c()}(${r}, ${h})`,()=>t.assign(d,!0).break()))}function p(h,g){const m=s[g];return typeof m=="object"&&m!==null?(0,zs._)`${c()}(${r}, ${h}[${g}])`:(0,zs._)`${r} === ${m}`}}};Zu.default=y5;Object.defineProperty(Fu,"__esModule",{value:!0});const b5=Bu,x5=Uu,w5=Vu,k5=Ku,_5=Hu,C5=Gu,$5=qu,S5=Yu,j5=Ju,E5=Zu,A5=[b5.default,x5.default,w5.default,k5.default,_5.default,C5.default,$5.default,S5.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},j5.default,E5.default];Fu.default=A5;var Qu={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.validateAdditionalItems=void 0;const Gr=we,Ec=oe,N5={message:({params:{len:e}})=>(0,Gr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Gr._)`{limit: ${e}}`},P5={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:N5,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Ec.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}My(e,n)}};function My(e,t){const{gen:r,schema:n,data:s,keyword:o,it:a}=e;a.items=!0;const i=r.const("len",(0,Gr._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Gr._)`${i} <= ${t.length}`);else if(typeof n=="object"&&!(0,Ec.alwaysValidSchema)(a,n)){const c=r.var("valid",(0,Gr._)`${i} <= ${t.length}`);r.if((0,Gr.not)(c),()=>u(c)),e.ok(c)}function u(c){r.forRange("i",t.length,i,d=>{e.subschema({keyword:o,dataProp:d,dataPropType:Ec.Type.Num},c),a.allErrors||r.if((0,Gr.not)(c),()=>r.break())})}}ss.validateAdditionalItems=My;ss.default=P5;var Xu={},os={};Object.defineProperty(os,"__esModule",{value:!0});os.validateTuple=void 0;const up=we,ca=oe,R5=ke,T5={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return zy(e,"additionalItems",t);r.items=!0,!(0,ca.alwaysValidSchema)(r,t)&&e.ok((0,R5.validateArray)(e))}};function zy(e,t,r=e.schema){const{gen:n,parentSchema:s,data:o,keyword:a,it:i}=e;d(s),i.opts.unevaluated&&r.length&&i.items!==!0&&(i.items=ca.mergeEvaluated.items(n,r.length,i.items));const u=n.name("valid"),c=n.const("len",(0,up._)`${o}.length`);r.forEach((f,p)=>{(0,ca.alwaysValidSchema)(i,f)||(n.if((0,up._)`${c} > ${p}`,()=>e.subschema({keyword:a,schemaProp:p,dataProp:p},u)),e.ok(u))});function d(f){const{opts:p,errSchemaPath:h}=i,g=r.length,m=g===f.minItems&&(g===f.maxItems||f[t]===!1);if(p.strictTuples&&!m){const v=`"${a}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,ca.checkStrictMode)(i,v,p.strictTuples)}}}os.validateTuple=zy;os.default=T5;Object.defineProperty(Xu,"__esModule",{value:!0});const I5=os,M5={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,I5.validateTuple)(e,"items")};Xu.default=M5;var ed={};Object.defineProperty(ed,"__esModule",{value:!0});const dp=we,z5=oe,O5=ke,D5=ss,L5={message:({params:{len:e}})=>(0,dp.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,dp._)`{limit: ${e}}`},F5={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:L5,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,z5.alwaysValidSchema)(n,t)&&(s?(0,D5.validateAdditionalItems)(e,s):e.ok((0,O5.validateArray)(e)))}};ed.default=F5;var td={};Object.defineProperty(td,"__esModule",{value:!0});const _t=we,Go=oe,B5={message:({params:{min:e,max:t}})=>t===void 0?(0,_t.str)`must contain at least ${e} valid item(s)`:(0,_t.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,_t._)`{minContains: ${e}}`:(0,_t._)`{minContains: ${e}, maxContains: ${t}}`},U5={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:B5,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;let a,i;const{minContains:u,maxContains:c}=n;o.opts.next?(a=u===void 0?1:u,i=c):a=1;const d=t.const("len",(0,_t._)`${s}.length`);if(e.setParams({min:a,max:i}),i===void 0&&a===0){(0,Go.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){(0,Go.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Go.alwaysValidSchema)(o,r)){let m=(0,_t._)`${d} >= ${a}`;i!==void 0&&(m=(0,_t._)`${m} && ${d} <= ${i}`),e.pass(m);return}o.items=!0;const f=t.name("valid");i===void 0&&a===1?h(f,()=>t.if(f,()=>t.break())):a===0?(t.let(f,!0),i!==void 0&&t.if((0,_t._)`${s}.length > 0`,p)):(t.let(f,!1),p()),e.result(f,()=>e.reset());function p(){const m=t.name("_valid"),v=t.let("count",0);h(m,()=>t.if(m,()=>g(v)))}function h(m,v){t.forRange("i",0,d,y=>{e.subschema({keyword:"contains",dataProp:y,dataPropType:Go.Type.Num,compositeRule:!0},m),v()})}function g(m){t.code((0,_t._)`${m}++`),i===void 0?t.if((0,_t._)`${m} >= ${a}`,()=>t.assign(f,!0).break()):(t.if((0,_t._)`${m} > ${i}`,()=>t.assign(f,!1).break()),a===1?t.assign(f,!0):t.if((0,_t._)`${m} >= ${a}`,()=>t.assign(f,!0)))}}};td.default=U5;var Oy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=we,r=oe,n=ke;e.error={message:({params:{property:u,depsCount:c,deps:d}})=>{const f=c===1?"property":"properties";return(0,t.str)`must have ${f} ${d} when property ${u} is present`},params:({params:{property:u,depsCount:c,deps:d,missingProperty:f}})=>(0,t._)`{property: ${u},
125
125
  missingProperty: ${f},
126
126
  depsCount: ${c},
127
- deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[c,d]=o(u);a(u,c),i(u,d)}};function o({schema:u}){const c={},d={};for(const f in u){if(f==="__proto__")continue;const p=Array.isArray(u[f])?c:d;p[f]=u[f]}return[c,d]}function a(u,c=u.schema){const{gen:d,data:f,it:p}=u;if(Object.keys(c).length===0)return;const h=d.let("missing");for(const g in c){const m=c[g];if(m.length===0)continue;const v=(0,n.propertyInData)(d,f,g,p.opts.ownProperties);u.setParams({property:g,depsCount:m.length,deps:m.join(", ")}),p.allErrors?d.if(v,()=>{for(const y of m)(0,n.checkReportMissingProp)(u,y)}):(d.if((0,t._)`${v} && (${(0,n.checkMissingProp)(u,m,h)})`),(0,n.reportMissingProp)(u,h),d.else())}}e.validatePropertyDeps=a;function i(u,c=u.schema){const{gen:d,data:f,keyword:p,it:h}=u,g=d.name("valid");for(const m in c)(0,r.alwaysValidSchema)(h,c[m])||(d.if((0,n.propertyInData)(d,f,m,h.opts.ownProperties),()=>{const v=u.subschema({keyword:p,schemaProp:m},g);u.mergeValidEvaluated(v,g)},()=>d.var(g,!0)),u.ok(g))}e.validateSchemaDeps=i,e.default=s})(Oy);var rd={};Object.defineProperty(rd,"__esModule",{value:!0});const Dy=we,V5=se,W5={message:"property name must be valid",params:({params:e})=>(0,Dy._)`{propertyName: ${e.propertyName}}`},K5={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:W5,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,V5.alwaysValidSchema)(s,r))return;const o=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,Dy.not)(o),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(o)}};rd.default=K5;var ji={};Object.defineProperty(ji,"__esModule",{value:!0});const qo=ke,Nt=we,H5=Zt,Yo=se,G5={message:"must NOT have additional properties",params:({params:e})=>(0,Nt._)`{additionalProperty: ${e.additionalProperty}}`},q5={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:G5,code(e){const{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:i,opts:u}=a;if(a.props=!0,u.removeAdditional!=="all"&&(0,Yo.alwaysValidSchema)(a,r))return;const c=(0,qo.allSchemaProperties)(n.properties),d=(0,qo.allSchemaProperties)(n.patternProperties);f(),e.ok((0,Nt._)`${o} === ${H5.default.errors}`);function f(){t.forIn("key",s,v=>{!c.length&&!d.length?g(v):t.if(p(v),()=>g(v))})}function p(v){let y;if(c.length>8){const b=(0,Yo.schemaRefOrVal)(a,n.properties,"properties");y=(0,qo.isOwnProperty)(t,b,v)}else c.length?y=(0,Nt.or)(...c.map(b=>(0,Nt._)`${v} === ${b}`)):y=Nt.nil;return d.length&&(y=(0,Nt.or)(y,...d.map(b=>(0,Nt._)`${(0,qo.usePattern)(e,b)}.test(${v})`))),(0,Nt.not)(y)}function h(v){t.code((0,Nt._)`delete ${s}[${v}]`)}function g(v){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){h(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),i||t.break();return}if(typeof r=="object"&&!(0,Yo.alwaysValidSchema)(a,r)){const y=t.name("valid");u.removeAdditional==="failing"?(m(v,y,!1),t.if((0,Nt.not)(y),()=>{e.reset(),h(v)})):(m(v,y),i||t.if((0,Nt.not)(y),()=>t.break()))}}function m(v,y,b){const _={keyword:"additionalProperties",dataProp:v,dataPropType:Yo.Type.Str};b===!1&&Object.assign(_,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(_,y)}}};ji.default=q5;var nd={};Object.defineProperty(nd,"__esModule",{value:!0});const Y5=Mt,fp=ke,ol=se,hp=ji,J5={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&hp.default.code(new Y5.KeywordCxt(o,hp.default,"additionalProperties"));const a=(0,fp.allSchemaProperties)(r);for(const f of a)o.definedProperties.add(f);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=ol.mergeEvaluated.props(t,(0,ol.toHash)(a),o.props));const i=a.filter(f=>!(0,ol.alwaysValidSchema)(o,r[f]));if(i.length===0)return;const u=t.name("valid");for(const f of i)c(f)?d(f):(t.if((0,fp.propertyInData)(t,s,f,o.opts.ownProperties)),d(f),o.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(u);function c(f){return o.opts.useDefaults&&!o.compositeRule&&r[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},u)}}};nd.default=J5;var sd={};Object.defineProperty(sd,"__esModule",{value:!0});const pp=ke,Jo=we,mp=se,gp=se,Z5={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:a}=o,i=(0,pp.allSchemaProperties)(r),u=i.filter(m=>(0,mp.alwaysValidSchema)(o,r[m]));if(i.length===0||u.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;const c=a.strictSchema&&!a.allowMatchingProperties&&s.properties,d=t.name("valid");o.props!==!0&&!(o.props instanceof Jo.Name)&&(o.props=(0,gp.evaluatedPropsToName)(t,o.props));const{props:f}=o;p();function p(){for(const m of i)c&&h(m),o.allErrors?g(m):(t.var(d,!0),g(m),t.if(d))}function h(m){for(const v in c)new RegExp(m).test(v)&&(0,mp.checkStrictMode)(o,`property ${v} matches pattern ${m} (use allowMatchingProperties)`)}function g(m){t.forIn("key",n,v=>{t.if((0,Jo._)`${(0,pp.usePattern)(e,m)}.test(${v})`,()=>{const y=u.includes(m);y||e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:v,dataPropType:gp.Type.Str},d),o.opts.unevaluated&&f!==!0?t.assign((0,Jo._)`${f}[${v}]`,!0):!y&&!o.allErrors&&t.if((0,Jo.not)(d),()=>t.break())})})}}};sd.default=Z5;var od={};Object.defineProperty(od,"__esModule",{value:!0});const Q5=se,X5={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,Q5.alwaysValidSchema)(n,r)){e.fail();return}const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};od.default=X5;var ad={};Object.defineProperty(ad,"__esModule",{value:!0});const e3=ke,t3={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e3.validateUnion,error:{message:"must match a schema in anyOf"}};ad.default=t3;var id={};Object.defineProperty(id,"__esModule",{value:!0});const ua=we,r3=se,n3={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,ua._)`{passingSchemas: ${e.passing}}`},s3={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n3,code(e){const{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const o=r,a=t.let("valid",!1),i=t.let("passing",null),u=t.name("_valid");e.setParams({passing:i}),t.block(c),e.result(a,()=>e.reset(),()=>e.error(!0));function c(){o.forEach((d,f)=>{let p;(0,r3.alwaysValidSchema)(s,d)?t.var(u,!0):p=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},u),f>0&&t.if((0,ua._)`${u} && ${a}`).assign(a,!1).assign(i,(0,ua._)`[${i}, ${f}]`).else(),t.if(u,()=>{t.assign(a,!0),t.assign(i,f),p&&e.mergeEvaluated(p,ua.Name)})})}}};id.default=s3;var ld={};Object.defineProperty(ld,"__esModule",{value:!0});const o3=se,a3={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach((o,a)=>{if((0,o3.alwaysValidSchema)(n,o))return;const i=e.subschema({keyword:"allOf",schemaProp:a},s);e.ok(s),e.mergeEvaluated(i)})}};ld.default=a3;var cd={};Object.defineProperty(cd,"__esModule",{value:!0});const Va=we,Ly=se,i3={message:({params:e})=>(0,Va.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Va._)`{failingKeyword: ${e.ifClause}}`},l3={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:i3,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,Ly.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=vp(n,"then"),o=vp(n,"else");if(!s&&!o)return;const a=t.let("valid",!0),i=t.name("_valid");if(u(),e.reset(),s&&o){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(i,c("then",d),c("else",d))}else s?t.if(i,c("then")):t.if((0,Va.not)(i),c("else"));e.pass(a,()=>e.error(!0));function u(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(d)}function c(d,f){return()=>{const p=e.subschema({keyword:d},i);t.assign(a,i),e.mergeValidEvaluated(p,a),f?t.assign(f,(0,Va._)`${d}`):e.setParams({ifClause:d})}}}};function vp(e,t){const r=e.schema[t];return r!==void 0&&!(0,Ly.alwaysValidSchema)(e,r)}cd.default=l3;var ud={};Object.defineProperty(ud,"__esModule",{value:!0});const c3=se,u3={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,c3.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};ud.default=u3;Object.defineProperty(Qu,"__esModule",{value:!0});const d3=ss,f3=Xu,h3=os,p3=ed,m3=td,g3=Oy,v3=rd,y3=ji,b3=nd,x3=sd,w3=od,k3=ad,_3=id,C3=ld,$3=cd,S3=ud;function j3(e=!1){const t=[w3.default,k3.default,_3.default,C3.default,$3.default,S3.default,v3.default,y3.default,g3.default,b3.default,x3.default];return e?t.push(f3.default,p3.default):t.push(d3.default,h3.default),t.push(m3.default),t}Qu.default=j3;var dd={},fd={};Object.defineProperty(fd,"__esModule",{value:!0});const Be=we,E3={message:({schemaCode:e})=>(0,Be.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Be._)`{format: ${e}}`},A3={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:E3,code(e,t){const{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=e,{opts:u,errSchemaPath:c,schemaEnv:d,self:f}=i;if(!u.validateFormats)return;s?p():h();function p(){const g=r.scopeValue("formats",{ref:f.formats,code:u.code.formats}),m=r.const("fDef",(0,Be._)`${g}[${a}]`),v=r.let("fType"),y=r.let("format");r.if((0,Be._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(v,(0,Be._)`${m}.type || "string"`).assign(y,(0,Be._)`${m}.validate`),()=>r.assign(v,(0,Be._)`"string"`).assign(y,m)),e.fail$data((0,Be.or)(b(),_()));function b(){return u.strictSchema===!1?Be.nil:(0,Be._)`${a} && !${y}`}function _(){const w=d.$async?(0,Be._)`(${m}.async ? await ${y}(${n}) : ${y}(${n}))`:(0,Be._)`${y}(${n})`,$=(0,Be._)`(typeof ${y} == "function" ? ${w} : ${y}.test(${n}))`;return(0,Be._)`${y} && ${y} !== true && ${v} === ${t} && !${$}`}}function h(){const g=f.formats[o];if(!g){b();return}if(g===!0)return;const[m,v,y]=_(g);m===t&&e.pass(w());function b(){if(u.strictSchema===!1){f.logger.warn($());return}throw new Error($());function $(){return`unknown format "${o}" ignored in schema at path "${c}"`}}function _($){const R=$ instanceof RegExp?(0,Be.regexpCode)($):u.code.formats?(0,Be._)`${u.code.formats}${(0,Be.getProperty)(o)}`:void 0,M=r.scopeValue("formats",{key:o,ref:$,code:R});return typeof $=="object"&&!($ instanceof RegExp)?[$.type||"string",$.validate,(0,Be._)`${M}.validate`]:["string",$,M]}function w(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Be._)`await ${y}(${n})`}return typeof v=="function"?(0,Be._)`${y}(${n})`:(0,Be._)`${y}.test(${n})`}}}};fd.default=A3;Object.defineProperty(dd,"__esModule",{value:!0});const N3=fd,P3=[N3.default];dd.default=P3;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.contentVocabulary=Wn.metadataVocabulary=void 0;Wn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Wn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Ou,"__esModule",{value:!0});const R3=Du,T3=Fu,I3=Qu,M3=dd,yp=Wn,z3=[R3.default,T3.default,(0,I3.default)(),M3.default,yp.metadataVocabulary,yp.contentVocabulary];Ou.default=z3;var hd={},Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.DiscrError=void 0;var bp;(function(e){e.Tag="tag",e.Mapping="mapping"})(bp||(Ei.DiscrError=bp={}));Object.defineProperty(hd,"__esModule",{value:!0});const Nn=we,Ac=Ei,xp=ft,O3=ns,D3=se,L3={message:({params:{discrError:e,tagName:t}})=>e===Ac.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Nn._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},F3={keyword:"discriminator",type:"object",schemaType:"object",error:L3,code(e){const{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:a}=s;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const i=n.propertyName;if(typeof i!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),c=t.const("tag",(0,Nn._)`${r}${(0,Nn.getProperty)(i)}`);t.if((0,Nn._)`typeof ${c} == "string"`,()=>d(),()=>e.error(!1,{discrError:Ac.DiscrError.Tag,tag:c,tagName:i})),e.ok(u);function d(){const h=p();t.if(!1);for(const g in h)t.elseIf((0,Nn._)`${c} === ${g}`),t.assign(u,f(h[g]));t.else(),e.error(!1,{discrError:Ac.DiscrError.Mapping,tag:c,tagName:i}),t.endIf()}function f(h){const g=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:h},g);return e.mergeEvaluated(m,Nn.Name),g}function p(){var h;const g={},m=y(s);let v=!0;for(let w=0;w<a.length;w++){let $=a[w];if($!=null&&$.$ref&&!(0,D3.schemaHasRulesButRef)($,o.self.RULES)){const M=$.$ref;if($=xp.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,M),$ instanceof xp.SchemaEnv&&($=$.schema),$===void 0)throw new O3.default(o.opts.uriResolver,o.baseId,M)}const R=(h=$==null?void 0:$.properties)===null||h===void 0?void 0:h[i];if(typeof R!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);v=v&&(m||y($)),b(R,w)}if(!v)throw new Error(`discriminator: "${i}" must be required`);return g;function y({required:w}){return Array.isArray(w)&&w.includes(i)}function b(w,$){if(w.const)_(w.const,$);else if(w.enum)for(const R of w.enum)_(R,$);else throw new Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function _(w,$){if(typeof w!="string"||w in g)throw new Error(`discriminator: "${i}" values must be unique strings`);g[w]=$}}}};hd.default=F3;const B3="http://json-schema.org/draft-07/schema#",U3="http://json-schema.org/draft-07/schema#",V3="Core schema meta-schema",W3={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},K3=["object","boolean"],H3={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},G3={$schema:B3,$id:U3,title:V3,definitions:W3,type:K3,properties:H3,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=Uv,n=Ou,s=hd,o=G3,a=["/properties"],i="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(g,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var c=Mt;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var d=we;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=go;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=ns;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})(kc,kc.exports);var Fy=kc.exports;const q3=Se(Fy);var Nc={exports:{}},By={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,S){return{validate:j,compare:S}}e.fullFormats={date:t(o,a),time:t(u,c),"date-time":t(f,p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:m,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:D,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:w},int64:{type:"number",validate:$},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(j){return j%4===0&&(j%100!==0||j%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(j){const S=n.exec(j);if(!S)return!1;const E=+S[1],P=+S[2],W=+S[3];return P>=1&&P<=12&&W>=1&&W<=(P===2&&r(E)?29:s[P])}function a(j,S){if(j&&S)return j>S?1:j<S?-1:0}const i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function u(j,S){const E=i.exec(j);if(!E)return!1;const P=+E[1],W=+E[2],G=+E[3],L=E[5];return(P<=23&&W<=59&&G<=59||P===23&&W===59&&G===60)&&(!S||L!=="")}function c(j,S){if(!(j&&S))return;const E=i.exec(j),P=i.exec(S);if(E&&P)return j=E[1]+E[2]+E[3]+(E[4]||""),S=P[1]+P[2]+P[3]+(P[4]||""),j>S?1:j<S?-1:0}const d=/t|\s/i;function f(j){const S=j.split(d);return S.length===2&&o(S[0])&&u(S[1],!0)}function p(j,S){if(!(j&&S))return;const[E,P]=j.split(d),[W,G]=S.split(d),L=a(E,W);if(L!==void 0)return L||c(P,G)}const h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function m(j){return h.test(j)&&g.test(j)}const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(j){return v.lastIndex=0,v.test(j)}const b=-2147483648,_=2**31-1;function w(j){return Number.isInteger(j)&&j<=_&&j>=b}function $(j){return Number.isInteger(j)}function R(){return!0}const M=/[^\\]\\Z/;function D(j){if(M.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(By);var Uy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Fy,r=we,n=r.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:i,schemaCode:u})=>r.str`should be ${s[i].okStr} ${u}`,params:({keyword:i,schemaCode:u})=>r._`{comparison: ${s[i].okStr}, limit: ${u}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:o,code(i){const{gen:u,data:c,schemaCode:d,keyword:f,it:p}=i,{opts:h,self:g}=p;if(!h.validateFormats)return;const m=new t.KeywordCxt(p,g.RULES.all.format.definition,"format");m.$data?v():y();function v(){const _=u.scopeValue("formats",{ref:g.formats,code:h.code.formats}),w=u.const("fmt",r._`${_}[${m.schemaCode}]`);i.fail$data(r.or(r._`typeof ${w} != "object"`,r._`${w} instanceof RegExp`,r._`typeof ${w}.compare != "function"`,b(w)))}function y(){const _=m.schema,w=g.formats[_];if(!w||w===!0)return;if(typeof w!="object"||w instanceof RegExp||typeof w.compare!="function")throw new Error(`"${f}": format "${_}" does not define "compare" function`);const $=u.scopeValue("formats",{key:_,ref:w,code:h.code.formats?r._`${h.code.formats}${r.getProperty(_)}`:void 0});i.fail$data(b($))}function b(_){return r._`${_}.compare(${c}, ${d}) ${s[f].fail} 0`}},dependencies:["format"]};const a=i=>(i.addKeyword(e.formatLimitDefinition),i);e.default=a})(Uy);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=By,n=Uy,s=we,o=new s.Name("fullFormats"),a=new s.Name("fastFormats"),i=(c,d={keywords:!0})=>{if(Array.isArray(d))return u(c,d,r.fullFormats,o),c;const[f,p]=d.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,o],h=d.formats||r.formatNames;return u(c,h,f,p),d.keywords&&n.default(c),c};i.get=(c,d="full")=>{const p=(d==="fast"?r.fastFormats:r.fullFormats)[c];if(!p)throw new Error(`Unknown format "${c}"`);return p};function u(c,d,f,p){var h,g;(h=(g=c.opts.code).formats)!==null&&h!==void 0||(g.formats=s._`require("ajv-formats/dist/formats").${p}`);for(const m of d)c.addFormat(m,f[m])}e.exports=t=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i})(Nc,Nc.exports);var Y3=Nc.exports;const J3=Se(Y3);function Z3(e){return function(t,r,n){for(var s=-1,o=Object(t),a=n(t),i=a.length;i--;){var u=a[e?i:++s];if(r(o[u],u,o)===!1)break}return t}}var Q3=Z3,X3=Q3,e4=X3(),Vy=e4,t4=Vy,r4=Jt;function n4(e,t){return e&&t4(e,t,r4)}var s4=n4,o4=mr;function a4(e,t){return function(r,n){if(r==null)return r;if(!o4(r))return e(r,n);for(var s=r.length,o=t?s:-1,a=Object(r);(t?o--:++o<s)&&n(a[o],o,a)!==!1;);return r}}var i4=a4,l4=s4,c4=i4,u4=c4(l4),pd=u4,d4=pd;function f4(e,t){var r=[];return d4(e,function(n,s,o){t(n,s,o)&&r.push(n)}),r}var h4=f4,p4=G0,m4=h4,g4=fn,v4=Ue;function y4(e,t){var r=v4(e)?p4:m4;return r(e,g4(t))}var Wy=y4;const Wa=Se(Wy);var b4=xu;function x4(e,t){return b4(e,t)}var w4=x4;const Ky=Se(w4);var k4=cn,_4=function(){try{var e=k4(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Hy=_4,wp=Hy;function C4(e,t,r){t=="__proto__"&&wp?wp(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var md=C4,$4=md,S4=io;function j4(e,t,r){(r!==void 0&&!S4(e[t],r)||r===void 0&&!(t in e))&&$4(e,t,r)}var Gy=j4,Ka={exports:{}};Ka.exports;(function(e,t){var r=ut,n=t&&!t.nodeType&&t,s=n&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===n,a=o?r.Buffer:void 0,i=a?a.allocUnsafe:void 0;function u(c,d){if(d)return c.slice();var f=c.length,p=i?i(f):new c.constructor(f);return c.copy(p),p}e.exports=u})(Ka,Ka.exports);var qy=Ka.exports,kp=V0;function E4(e){var t=new e.constructor(e.byteLength);return new kp(t).set(new kp(e)),t}var gd=E4,A4=gd;function N4(e,t){var r=t?A4(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Yy=N4;function P4(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var yo=P4,R4=xt,_p=Object.create,T4=function(){function e(){}return function(t){if(!R4(t))return{};if(_p)return _p(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Ai=T4,I4=Z0,M4=I4(Object.getPrototypeOf,Object),vd=M4,z4=Ai,O4=vd,D4=bi;function L4(e){return typeof e.constructor=="function"&&!D4(e)?z4(O4(e)):{}}var Jy=L4,F4=mr,B4=bt;function U4(e){return B4(e)&&F4(e)}var V4=U4,W4=Ir,K4=vd,H4=bt,G4="[object Object]",q4=Function.prototype,Y4=Object.prototype,Zy=q4.toString,J4=Y4.hasOwnProperty,Z4=Zy.call(Object);function Q4(e){if(!H4(e)||W4(e)!=G4)return!1;var t=K4(e);if(t===null)return!0;var r=J4.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Zy.call(r)==Z4}var Qy=Q4;function X4(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Xy=X4,e9=md,t9=io,r9=Object.prototype,n9=r9.hasOwnProperty;function s9(e,t,r){var n=e[t];(!(n9.call(e,t)&&t9(n,r))||r===void 0&&!(t in e))&&e9(e,t,r)}var yd=s9,o9=yd,a9=md;function i9(e,t,r,n){var s=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var i=t[o],u=n?n(r[i],e[i],i,r,e):void 0;u===void 0&&(u=e[i]),s?a9(r,i,u):o9(r,i,u)}return r}var bo=i9;function l9(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var c9=l9,u9=xt,d9=bi,f9=c9,h9=Object.prototype,p9=h9.hasOwnProperty;function m9(e){if(!u9(e))return f9(e);var t=d9(e),r=[];for(var n in e)n=="constructor"&&(t||!p9.call(e,n))||r.push(n);return r}var g9=m9,v9=J0,y9=g9,b9=mr;function x9(e){return b9(e)?v9(e,!0):y9(e)}var xo=x9,w9=bo,k9=xo;function _9(e){return w9(e,k9(e))}var C9=_9,Cp=Gy,$9=qy,S9=Yy,j9=yo,E9=Jy,$p=co,Sp=Ue,A9=V4,N9=uo,P9=lo,R9=xt,T9=Qy,I9=yi,jp=Xy,M9=C9;function z9(e,t,r,n,s,o,a){var i=jp(e,r),u=jp(t,r),c=a.get(u);if(c){Cp(e,r,c);return}var d=o?o(i,u,r+"",e,t,a):void 0,f=d===void 0;if(f){var p=Sp(u),h=!p&&N9(u),g=!p&&!h&&I9(u);d=u,p||h||g?Sp(i)?d=i:A9(i)?d=j9(i):h?(f=!1,d=$9(u,!0)):g?(f=!1,d=S9(u,!0)):d=[]:T9(u)||$p(u)?(d=i,$p(i)?d=M9(i):(!R9(i)||P9(i))&&(d=E9(u))):f=!1}f&&(a.set(u,d),s(d,u,n,o,a),a.delete(u)),Cp(e,r,d)}var O9=z9,D9=vi,L9=Gy,F9=Vy,B9=O9,U9=xt,V9=xo,W9=Xy;function eb(e,t,r,n,s){e!==t&&F9(t,function(o,a){if(s||(s=new D9),U9(o))B9(e,t,a,r,eb,n,s);else{var i=n?n(W9(e,a),o,a+"",e,t,s):void 0;i===void 0&&(i=o),L9(e,a,i)}},V9)}var K9=eb;function H9(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var bd=H9,G9=bd,Ep=Math.max;function q9(e,t,r){return t=Ep(t===void 0?e.length-1:t,0),function(){for(var n=arguments,s=-1,o=Ep(n.length-t,0),a=Array(o);++s<o;)a[s]=n[t+s];s=-1;for(var i=Array(t+1);++s<t;)i[s]=n[s];return i[t]=r(a),G9(e,this,i)}}var tb=q9;function Y9(e){return function(){return e}}var J9=Y9,Z9=J9,Ap=Hy,Q9=wi,X9=Ap?function(e,t){return Ap(e,"toString",{configurable:!0,enumerable:!1,value:Z9(t),writable:!0})}:Q9,e6=X9,t6=800,r6=16,n6=Date.now;function s6(e){var t=0,r=0;return function(){var n=n6(),s=r6-(n-r);if(r=n,s>0){if(++t>=t6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var rb=s6,o6=e6,a6=rb,i6=a6(o6),xd=i6,l6=wi,c6=tb,u6=xd;function d6(e,t){return u6(c6(e,t,l6),e+"")}var f6=d6,h6=f6,p6=Iv;function m6(e){return h6(function(t,r){var n=-1,s=r.length,o=s>1?r[s-1]:void 0,a=s>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(s--,o):void 0,a&&p6(r[0],r[1],a)&&(o=s<3?void 0:o,s=1),t=Object(t);++n<s;){var i=r[n];i&&e(t,i,n,o)}return t})}var g6=m6,v6=K9,y6=g6,b6=y6(function(e,t,r){v6(e,t,r)}),x6=b6;const wo=Se(x6);function w6(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var wd=w6,k6=bo,_6=Jt;function C6(e,t){return e&&k6(t,_6(t),e)}var nb=C6,$6=bo,S6=xo;function j6(e,t){return e&&$6(t,S6(t),e)}var E6=j6,A6=bo,N6=mu;function P6(e,t){return A6(e,N6(e),t)}var R6=P6,T6=pu,I6=vd,M6=mu,z6=q0,O6=Object.getOwnPropertySymbols,D6=O6?function(e){for(var t=[];e;)T6(t,M6(e)),e=I6(e);return t}:z6,sb=D6,L6=bo,F6=sb;function B6(e,t){return L6(e,F6(e),t)}var U6=B6,V6=H0,W6=sb,K6=xo;function H6(e){return V6(e,K6,W6)}var G6=H6,q6=Object.prototype,Y6=q6.hasOwnProperty;function J6(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&Y6.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Z6=J6,Q6=gd;function X6(e,t){var r=t?Q6(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var eU=X6,tU=/\w*$/;function rU(e){var t=new e.constructor(e.source,tU.exec(e));return t.lastIndex=e.lastIndex,t}var nU=rU,Np=Yn,Pp=Np?Np.prototype:void 0,Rp=Pp?Pp.valueOf:void 0;function sU(e){return Rp?Object(Rp.call(e)):{}}var oU=sU,aU=gd,iU=eU,lU=nU,cU=oU,uU=Yy,dU="[object Boolean]",fU="[object Date]",hU="[object Map]",pU="[object Number]",mU="[object RegExp]",gU="[object Set]",vU="[object String]",yU="[object Symbol]",bU="[object ArrayBuffer]",xU="[object DataView]",wU="[object Float32Array]",kU="[object Float64Array]",_U="[object Int8Array]",CU="[object Int16Array]",$U="[object Int32Array]",SU="[object Uint8Array]",jU="[object Uint8ClampedArray]",EU="[object Uint16Array]",AU="[object Uint32Array]";function NU(e,t,r){var n=e.constructor;switch(t){case bU:return aU(e);case dU:case fU:return new n(+e);case xU:return iU(e,r);case wU:case kU:case _U:case CU:case $U:case SU:case jU:case EU:case AU:return uU(e,r);case hU:return new n;case pU:case vU:return new n(e);case mU:return lU(e);case gU:return new n;case yU:return cU(e)}}var PU=NU,RU=un,TU=bt,IU="[object Map]";function MU(e){return TU(e)&&RU(e)==IU}var zU=MU,OU=zU,DU=vu,Tp=yu,Ip=Tp&&Tp.isMap,LU=Ip?DU(Ip):OU,FU=LU,BU=un,UU=bt,VU="[object Set]";function WU(e){return UU(e)&&BU(e)==VU}var KU=WU,HU=KU,GU=vu,Mp=yu,zp=Mp&&Mp.isSet,qU=zp?GU(zp):HU,YU=qU,JU=vi,ZU=wd,QU=yd,XU=nb,eV=E6,tV=qy,rV=yo,nV=R6,sV=U6,oV=Q0,aV=G6,iV=un,lV=Z6,cV=PU,uV=Jy,dV=Ue,fV=uo,hV=FU,pV=xt,mV=YU,gV=Jt,vV=xo,yV=1,bV=2,xV=4,ob="[object Arguments]",wV="[object Array]",kV="[object Boolean]",_V="[object Date]",CV="[object Error]",ab="[object Function]",$V="[object GeneratorFunction]",SV="[object Map]",jV="[object Number]",ib="[object Object]",EV="[object RegExp]",AV="[object Set]",NV="[object String]",PV="[object Symbol]",RV="[object WeakMap]",TV="[object ArrayBuffer]",IV="[object DataView]",MV="[object Float32Array]",zV="[object Float64Array]",OV="[object Int8Array]",DV="[object Int16Array]",LV="[object Int32Array]",FV="[object Uint8Array]",BV="[object Uint8ClampedArray]",UV="[object Uint16Array]",VV="[object Uint32Array]",Te={};Te[ob]=Te[wV]=Te[TV]=Te[IV]=Te[kV]=Te[_V]=Te[MV]=Te[zV]=Te[OV]=Te[DV]=Te[LV]=Te[SV]=Te[jV]=Te[ib]=Te[EV]=Te[AV]=Te[NV]=Te[PV]=Te[FV]=Te[BV]=Te[UV]=Te[VV]=!0;Te[CV]=Te[ab]=Te[RV]=!1;function da(e,t,r,n,s,o){var a,i=t&yV,u=t&bV,c=t&xV;if(r&&(a=s?r(e,n,s,o):r(e)),a!==void 0)return a;if(!pV(e))return e;var d=dV(e);if(d){if(a=lV(e),!i)return rV(e,a)}else{var f=iV(e),p=f==ab||f==$V;if(fV(e))return tV(e,i);if(f==ib||f==ob||p&&!s){if(a=u||p?{}:uV(e),!i)return u?sV(e,eV(a,e)):nV(e,XU(a,e))}else{if(!Te[f])return s?e:{};a=cV(e,f,i)}}o||(o=new JU);var h=o.get(e);if(h)return h;o.set(e,a),mV(e)?e.forEach(function(v){a.add(da(v,t,r,v,e,o))}):hV(e)&&e.forEach(function(v,y){a.set(y,da(v,t,r,y,e,o))});var g=c?u?aV:oV:u?vV:gV,m=d?void 0:g(e);return ZU(m||e,function(v,y){m&&(y=v,v=e[y]),QU(a,y,da(v,t,r,y,e,o))}),a}var kd=da,WV=kd,KV=1,HV=4;function GV(e){return WV(e,KV|HV)}var qV=GV;const Gs=Se(qV);var lb={};(function(e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,r=e.aliasToReal,n={};for(var s in r){var o=r[s];t.call(n,o)?n[o].push(s):n[o]=[s]}return n}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}})(lb);var al,Op;function Mr(){return Op||(Op=1,al={}),al}var Ke=lb,YV=Mr(),Dp=Array.prototype.push;function JV(e,t){return t==2?function(r,n){return e.apply(void 0,arguments)}:function(r){return e.apply(void 0,arguments)}}function il(e,t){return t==2?function(r,n){return e(r,n)}:function(r){return e(r)}}function Lp(e){for(var t=e?e.length:0,r=Array(t);t--;)r[t]=e[t];return r}function ZV(e){return function(t){return e({},t)}}function QV(e,t){return function(){for(var r=arguments.length,n=r-1,s=Array(r);r--;)s[r]=arguments[r];var o=s[t],a=s.slice(0,t);return o&&Dp.apply(a,o),t!=n&&Dp.apply(a,s.slice(t+1)),e.apply(this,a)}}function ll(e,t){return function(){var r=arguments.length;if(r){for(var n=Array(r);r--;)n[r]=arguments[r];var s=n[0]=t.apply(void 0,n);return e.apply(void 0,n),s}}}function Pc(e,t,r,n){var s=typeof t=="function",o=t===Object(t);if(o&&(n=r,r=t,t=void 0),r==null)throw new TypeError;n||(n={});var a={cap:"cap"in n?n.cap:!0,curry:"curry"in n?n.curry:!0,fixed:"fixed"in n?n.fixed:!0,immutable:"immutable"in n?n.immutable:!0,rearg:"rearg"in n?n.rearg:!0},i=s?r:YV,u="curry"in n&&n.curry,c="fixed"in n&&n.fixed,d="rearg"in n&&n.rearg,f=s?r.runInContext():void 0,p=s?r:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isError:e.isError,isFunction:e.isFunction,isWeakMap:e.isWeakMap,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},h=p.ary,g=p.assign,m=p.clone,v=p.curry,y=p.forEach,b=p.isArray,_=p.isError,w=p.isFunction,$=p.isWeakMap,R=p.keys,M=p.rearg,D=p.toInteger,j=p.toPath,S=R(Ke.aryMethod),E={castArray:function(C){return function(){var N=arguments[0];return b(N)?C(Lp(N)):C.apply(void 0,arguments)}},iteratee:function(C){return function(){var N=arguments[0],B=arguments[1],K=C(N,B),ee=K.length;return a.cap&&typeof B=="number"?(B=B>2?B-2:1,ee&&ee<=B?K:il(K,B)):K}},mixin:function(C){return function(N){var B=this;if(!w(B))return C(B,Object(N));var K=[];return y(R(N),function(ee){w(N[ee])&&K.push([ee,B.prototype[ee]])}),C(B,Object(N)),y(K,function(ee){var ne=ee[1];w(ne)?B.prototype[ee[0]]=ne:delete B.prototype[ee[0]]}),B}},nthArg:function(C){return function(N){var B=N<0?1:D(N)+1;return v(C(N),B)}},rearg:function(C){return function(N,B){var K=B?B.length:0;return v(C(N,B),K)}},runInContext:function(C){return function(N){return Pc(e,C(N),n)}}};function P(C,N){if(a.cap){var B=Ke.iterateeRearg[C];if(B)return H(N,B);var K=!s&&Ke.iterateeAry[C];if(K)return J(N,K)}return N}function W(C,N,B){return u||a.curry&&B>1?v(N,B):N}function G(C,N,B){if(a.fixed&&(c||!Ke.skipFixed[C])){var K=Ke.methodSpread[C],ee=K&&K.start;return ee===void 0?h(N,B):QV(N,ee)}return N}function L(C,N,B){return a.rearg&&B>1&&(d||!Ke.skipRearg[C])?M(N,Ke.methodRearg[C]||Ke.aryRearg[B]):N}function V(C,N){N=j(N);for(var B=-1,K=N.length,ee=K-1,ne=m(Object(C)),le=ne;le!=null&&++B<K;){var me=N[B],I=le[me];I!=null&&!(w(I)||_(I)||$(I))&&(le[me]=m(B==ee?I:Object(I))),le=le[me]}return ne}function O(C){return z.runInContext.convert(C)(void 0)}function te(C,N){var B=Ke.aliasToReal[C]||C,K=Ke.remap[B]||B,ee=n;return function(ne){var le=s?f:p,me=s?f[K]:N,I=g(g({},ee),ne);return Pc(le,B,me,I)}}function J(C,N){return A(C,function(B){return typeof B=="function"?il(B,N):B})}function H(C,N){return A(C,function(B){var K=N.length;return JV(M(il(B,K),N),K)})}function A(C,N){return function(){var B=arguments.length;if(!B)return C();for(var K=Array(B);B--;)K[B]=arguments[B];var ee=a.rearg?0:B-1;return K[ee]=N(K[ee]),C.apply(void 0,K)}}function Y(C,N,B){var K,ee=Ke.aliasToReal[C]||C,ne=N,le=E[ee];return le?ne=le(N):a.immutable&&(Ke.mutate.array[ee]?ne=ll(N,Lp):Ke.mutate.object[ee]?ne=ll(N,ZV(N)):Ke.mutate.set[ee]&&(ne=ll(N,V))),y(S,function(me){return y(Ke.aryMethod[me],function(I){if(ee==I){var oe=Ke.methodSpread[ee],ce=oe&&oe.afterRearg;return K=ce?G(ee,L(ee,ne,me),me):L(ee,G(ee,ne,me),me),K=P(ee,K),K=W(ee,K,me),!1}}),!K}),K||(K=ne),K==N&&(K=u?v(K,1):function(){return N.apply(this,arguments)}),K.convert=te(ee,N),K.placeholder=N.placeholder=B,K}if(!o)return Y(t,r,i);var z=r,k=[];return y(S,function(C){y(Ke.aryMethod[C],function(N){var B=z[Ke.remap[N]||N];B&&k.push([N,Y(N,B,z)])})}),y(R(z),function(C){var N=z[C];if(typeof N=="function"){for(var B=k.length;B--;)if(k[B][0]==C)return;N.convert=te(C,N),k.push([C,N])}}),y(k,function(C){z[C[0]]=C[1]}),z.convert=O,z.placeholder=z,y(R(z),function(C){y(Ke.realToAlias[C]||[],function(N){z[N]=z[C]})}),z}var XV=Pc,cl,Fp;function cb(){if(Fp)return cl;Fp=1;var e=X0,t=e&&new e;return cl=t,cl}var eW=wi,Bp=cb(),tW=Bp?function(e,t){return Bp.set(e,t),e}:eW,ub=tW,rW=Ai,nW=xt;function sW(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=rW(e.prototype),n=e.apply(r,t);return nW(n)?n:r}}var Ni=sW,oW=Ni,aW=ut,iW=1;function lW(e,t,r){var n=t&iW,s=oW(e);function o(){var a=this&&this!==aW&&this instanceof o?s:e;return a.apply(n?r:this,arguments)}return o}var cW=lW,uW=Math.max;function dW(e,t,r,n){for(var s=-1,o=e.length,a=r.length,i=-1,u=t.length,c=uW(o-a,0),d=Array(u+c),f=!n;++i<u;)d[i]=t[i];for(;++s<a;)(f||s<o)&&(d[r[s]]=e[s]);for(;c--;)d[i++]=e[s++];return d}var db=dW,fW=Math.max;function hW(e,t,r,n){for(var s=-1,o=e.length,a=-1,i=r.length,u=-1,c=t.length,d=fW(o-i,0),f=Array(d+c),p=!n;++s<d;)f[s]=e[s];for(var h=s;++u<c;)f[h+u]=t[u];for(;++a<i;)(p||s<o)&&(f[h+r[a]]=e[s++]);return f}var fb=hW;function pW(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var mW=pW,ul,Up;function _d(){if(Up)return ul;Up=1;function e(){}return ul=e,ul}var dl,Vp;function Cd(){if(Vp)return dl;Vp=1;var e=Ai,t=_d(),r=4294967295;function n(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=r,this.__views__=[]}return n.prototype=e(t.prototype),n.prototype.constructor=n,dl=n,dl}var fl,Wp;function gW(){if(Wp)return fl;Wp=1;function e(){}return fl=e,fl}var hl,Kp;function $d(){if(Kp)return hl;Kp=1;var e=cb(),t=gW(),r=e?function(n){return e.get(n)}:t;return hl=r,hl}var pl,Hp;function vW(){if(Hp)return pl;Hp=1;var e={};return pl=e,pl}var ml,Gp;function hb(){if(Gp)return ml;Gp=1;var e=vW(),t=Object.prototype,r=t.hasOwnProperty;function n(s){for(var o=s.name+"",a=e[o],i=r.call(e,o)?a.length:0;i--;){var u=a[i],c=u.func;if(c==null||c==s)return u.name}return o}return ml=n,ml}var gl,qp;function Sd(){if(qp)return gl;qp=1;var e=Ai,t=_d();function r(n,s){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!s,this.__index__=0,this.__values__=void 0}return r.prototype=e(t.prototype),r.prototype.constructor=r,gl=r,gl}var vl,Yp;function yW(){if(Yp)return vl;Yp=1;var e=Cd(),t=Sd(),r=yo;function n(s){if(s instanceof e)return s.clone();var o=new t(s.__wrapped__,s.__chain__);return o.__actions__=r(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}return vl=n,vl}var yl,Jp;function bW(){if(Jp)return yl;Jp=1;var e=Cd(),t=Sd(),r=_d(),n=Ue,s=bt,o=yW(),a=Object.prototype,i=a.hasOwnProperty;function u(c){if(s(c)&&!n(c)&&!(c instanceof e)){if(c instanceof t)return c;if(i.call(c,"__wrapped__"))return o(c)}return new t(c)}return u.prototype=r.prototype,u.prototype.constructor=u,yl=u,yl}var bl,Zp;function pb(){if(Zp)return bl;Zp=1;var e=Cd(),t=$d(),r=hb(),n=bW();function s(o){var a=r(o),i=n[a];if(typeof i!="function"||!(a in e.prototype))return!1;if(o===i)return!0;var u=t(i);return!!u&&o===u[0]}return bl=s,bl}var xW=ub,wW=rb,kW=wW(xW),mb=kW,_W=/\{\n\/\* \[wrapped with (.+)\] \*/,CW=/,? & /;function $W(e){var t=e.match(_W);return t?t[1].split(CW):[]}var SW=$W,jW=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function EW(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(jW,`{
127
+ deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[c,d]=o(u);a(u,c),i(u,d)}};function o({schema:u}){const c={},d={};for(const f in u){if(f==="__proto__")continue;const p=Array.isArray(u[f])?c:d;p[f]=u[f]}return[c,d]}function a(u,c=u.schema){const{gen:d,data:f,it:p}=u;if(Object.keys(c).length===0)return;const h=d.let("missing");for(const g in c){const m=c[g];if(m.length===0)continue;const v=(0,n.propertyInData)(d,f,g,p.opts.ownProperties);u.setParams({property:g,depsCount:m.length,deps:m.join(", ")}),p.allErrors?d.if(v,()=>{for(const y of m)(0,n.checkReportMissingProp)(u,y)}):(d.if((0,t._)`${v} && (${(0,n.checkMissingProp)(u,m,h)})`),(0,n.reportMissingProp)(u,h),d.else())}}e.validatePropertyDeps=a;function i(u,c=u.schema){const{gen:d,data:f,keyword:p,it:h}=u,g=d.name("valid");for(const m in c)(0,r.alwaysValidSchema)(h,c[m])||(d.if((0,n.propertyInData)(d,f,m,h.opts.ownProperties),()=>{const v=u.subschema({keyword:p,schemaProp:m},g);u.mergeValidEvaluated(v,g)},()=>d.var(g,!0)),u.ok(g))}e.validateSchemaDeps=i,e.default=s})(Oy);var rd={};Object.defineProperty(rd,"__esModule",{value:!0});const Dy=we,V5=oe,W5={message:"property name must be valid",params:({params:e})=>(0,Dy._)`{propertyName: ${e.propertyName}}`},K5={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:W5,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,V5.alwaysValidSchema)(s,r))return;const o=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,Dy.not)(o),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(o)}};rd.default=K5;var ji={};Object.defineProperty(ji,"__esModule",{value:!0});const qo=ke,Nt=we,H5=Zt,Yo=oe,G5={message:"must NOT have additional properties",params:({params:e})=>(0,Nt._)`{additionalProperty: ${e.additionalProperty}}`},q5={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:G5,code(e){const{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:i,opts:u}=a;if(a.props=!0,u.removeAdditional!=="all"&&(0,Yo.alwaysValidSchema)(a,r))return;const c=(0,qo.allSchemaProperties)(n.properties),d=(0,qo.allSchemaProperties)(n.patternProperties);f(),e.ok((0,Nt._)`${o} === ${H5.default.errors}`);function f(){t.forIn("key",s,v=>{!c.length&&!d.length?g(v):t.if(p(v),()=>g(v))})}function p(v){let y;if(c.length>8){const b=(0,Yo.schemaRefOrVal)(a,n.properties,"properties");y=(0,qo.isOwnProperty)(t,b,v)}else c.length?y=(0,Nt.or)(...c.map(b=>(0,Nt._)`${v} === ${b}`)):y=Nt.nil;return d.length&&(y=(0,Nt.or)(y,...d.map(b=>(0,Nt._)`${(0,qo.usePattern)(e,b)}.test(${v})`))),(0,Nt.not)(y)}function h(v){t.code((0,Nt._)`delete ${s}[${v}]`)}function g(v){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){h(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),i||t.break();return}if(typeof r=="object"&&!(0,Yo.alwaysValidSchema)(a,r)){const y=t.name("valid");u.removeAdditional==="failing"?(m(v,y,!1),t.if((0,Nt.not)(y),()=>{e.reset(),h(v)})):(m(v,y),i||t.if((0,Nt.not)(y),()=>t.break()))}}function m(v,y,b){const _={keyword:"additionalProperties",dataProp:v,dataPropType:Yo.Type.Str};b===!1&&Object.assign(_,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(_,y)}}};ji.default=q5;var nd={};Object.defineProperty(nd,"__esModule",{value:!0});const Y5=Mt,fp=ke,ol=oe,hp=ji,J5={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&hp.default.code(new Y5.KeywordCxt(o,hp.default,"additionalProperties"));const a=(0,fp.allSchemaProperties)(r);for(const f of a)o.definedProperties.add(f);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=ol.mergeEvaluated.props(t,(0,ol.toHash)(a),o.props));const i=a.filter(f=>!(0,ol.alwaysValidSchema)(o,r[f]));if(i.length===0)return;const u=t.name("valid");for(const f of i)c(f)?d(f):(t.if((0,fp.propertyInData)(t,s,f,o.opts.ownProperties)),d(f),o.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(u);function c(f){return o.opts.useDefaults&&!o.compositeRule&&r[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},u)}}};nd.default=J5;var sd={};Object.defineProperty(sd,"__esModule",{value:!0});const pp=ke,Jo=we,mp=oe,gp=oe,Z5={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:a}=o,i=(0,pp.allSchemaProperties)(r),u=i.filter(m=>(0,mp.alwaysValidSchema)(o,r[m]));if(i.length===0||u.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;const c=a.strictSchema&&!a.allowMatchingProperties&&s.properties,d=t.name("valid");o.props!==!0&&!(o.props instanceof Jo.Name)&&(o.props=(0,gp.evaluatedPropsToName)(t,o.props));const{props:f}=o;p();function p(){for(const m of i)c&&h(m),o.allErrors?g(m):(t.var(d,!0),g(m),t.if(d))}function h(m){for(const v in c)new RegExp(m).test(v)&&(0,mp.checkStrictMode)(o,`property ${v} matches pattern ${m} (use allowMatchingProperties)`)}function g(m){t.forIn("key",n,v=>{t.if((0,Jo._)`${(0,pp.usePattern)(e,m)}.test(${v})`,()=>{const y=u.includes(m);y||e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:v,dataPropType:gp.Type.Str},d),o.opts.unevaluated&&f!==!0?t.assign((0,Jo._)`${f}[${v}]`,!0):!y&&!o.allErrors&&t.if((0,Jo.not)(d),()=>t.break())})})}}};sd.default=Z5;var od={};Object.defineProperty(od,"__esModule",{value:!0});const Q5=oe,X5={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,Q5.alwaysValidSchema)(n,r)){e.fail();return}const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};od.default=X5;var ad={};Object.defineProperty(ad,"__esModule",{value:!0});const e3=ke,t3={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e3.validateUnion,error:{message:"must match a schema in anyOf"}};ad.default=t3;var id={};Object.defineProperty(id,"__esModule",{value:!0});const ua=we,r3=oe,n3={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,ua._)`{passingSchemas: ${e.passing}}`},s3={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n3,code(e){const{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const o=r,a=t.let("valid",!1),i=t.let("passing",null),u=t.name("_valid");e.setParams({passing:i}),t.block(c),e.result(a,()=>e.reset(),()=>e.error(!0));function c(){o.forEach((d,f)=>{let p;(0,r3.alwaysValidSchema)(s,d)?t.var(u,!0):p=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},u),f>0&&t.if((0,ua._)`${u} && ${a}`).assign(a,!1).assign(i,(0,ua._)`[${i}, ${f}]`).else(),t.if(u,()=>{t.assign(a,!0),t.assign(i,f),p&&e.mergeEvaluated(p,ua.Name)})})}}};id.default=s3;var ld={};Object.defineProperty(ld,"__esModule",{value:!0});const o3=oe,a3={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach((o,a)=>{if((0,o3.alwaysValidSchema)(n,o))return;const i=e.subschema({keyword:"allOf",schemaProp:a},s);e.ok(s),e.mergeEvaluated(i)})}};ld.default=a3;var cd={};Object.defineProperty(cd,"__esModule",{value:!0});const Va=we,Ly=oe,i3={message:({params:e})=>(0,Va.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Va._)`{failingKeyword: ${e.ifClause}}`},l3={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:i3,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,Ly.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=vp(n,"then"),o=vp(n,"else");if(!s&&!o)return;const a=t.let("valid",!0),i=t.name("_valid");if(u(),e.reset(),s&&o){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(i,c("then",d),c("else",d))}else s?t.if(i,c("then")):t.if((0,Va.not)(i),c("else"));e.pass(a,()=>e.error(!0));function u(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(d)}function c(d,f){return()=>{const p=e.subschema({keyword:d},i);t.assign(a,i),e.mergeValidEvaluated(p,a),f?t.assign(f,(0,Va._)`${d}`):e.setParams({ifClause:d})}}}};function vp(e,t){const r=e.schema[t];return r!==void 0&&!(0,Ly.alwaysValidSchema)(e,r)}cd.default=l3;var ud={};Object.defineProperty(ud,"__esModule",{value:!0});const c3=oe,u3={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,c3.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};ud.default=u3;Object.defineProperty(Qu,"__esModule",{value:!0});const d3=ss,f3=Xu,h3=os,p3=ed,m3=td,g3=Oy,v3=rd,y3=ji,b3=nd,x3=sd,w3=od,k3=ad,_3=id,C3=ld,$3=cd,S3=ud;function j3(e=!1){const t=[w3.default,k3.default,_3.default,C3.default,$3.default,S3.default,v3.default,y3.default,g3.default,b3.default,x3.default];return e?t.push(f3.default,p3.default):t.push(d3.default,h3.default),t.push(m3.default),t}Qu.default=j3;var dd={},fd={};Object.defineProperty(fd,"__esModule",{value:!0});const Be=we,E3={message:({schemaCode:e})=>(0,Be.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Be._)`{format: ${e}}`},A3={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:E3,code(e,t){const{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=e,{opts:u,errSchemaPath:c,schemaEnv:d,self:f}=i;if(!u.validateFormats)return;s?p():h();function p(){const g=r.scopeValue("formats",{ref:f.formats,code:u.code.formats}),m=r.const("fDef",(0,Be._)`${g}[${a}]`),v=r.let("fType"),y=r.let("format");r.if((0,Be._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(v,(0,Be._)`${m}.type || "string"`).assign(y,(0,Be._)`${m}.validate`),()=>r.assign(v,(0,Be._)`"string"`).assign(y,m)),e.fail$data((0,Be.or)(b(),_()));function b(){return u.strictSchema===!1?Be.nil:(0,Be._)`${a} && !${y}`}function _(){const w=d.$async?(0,Be._)`(${m}.async ? await ${y}(${n}) : ${y}(${n}))`:(0,Be._)`${y}(${n})`,$=(0,Be._)`(typeof ${y} == "function" ? ${w} : ${y}.test(${n}))`;return(0,Be._)`${y} && ${y} !== true && ${v} === ${t} && !${$}`}}function h(){const g=f.formats[o];if(!g){b();return}if(g===!0)return;const[m,v,y]=_(g);m===t&&e.pass(w());function b(){if(u.strictSchema===!1){f.logger.warn($());return}throw new Error($());function $(){return`unknown format "${o}" ignored in schema at path "${c}"`}}function _($){const R=$ instanceof RegExp?(0,Be.regexpCode)($):u.code.formats?(0,Be._)`${u.code.formats}${(0,Be.getProperty)(o)}`:void 0,M=r.scopeValue("formats",{key:o,ref:$,code:R});return typeof $=="object"&&!($ instanceof RegExp)?[$.type||"string",$.validate,(0,Be._)`${M}.validate`]:["string",$,M]}function w(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Be._)`await ${y}(${n})`}return typeof v=="function"?(0,Be._)`${y}(${n})`:(0,Be._)`${y}.test(${n})`}}}};fd.default=A3;Object.defineProperty(dd,"__esModule",{value:!0});const N3=fd,P3=[N3.default];dd.default=P3;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.contentVocabulary=Wn.metadataVocabulary=void 0;Wn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Wn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Ou,"__esModule",{value:!0});const R3=Du,T3=Fu,I3=Qu,M3=dd,yp=Wn,z3=[R3.default,T3.default,(0,I3.default)(),M3.default,yp.metadataVocabulary,yp.contentVocabulary];Ou.default=z3;var hd={},Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.DiscrError=void 0;var bp;(function(e){e.Tag="tag",e.Mapping="mapping"})(bp||(Ei.DiscrError=bp={}));Object.defineProperty(hd,"__esModule",{value:!0});const Nn=we,Ac=Ei,xp=ft,O3=ns,D3=oe,L3={message:({params:{discrError:e,tagName:t}})=>e===Ac.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Nn._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},F3={keyword:"discriminator",type:"object",schemaType:"object",error:L3,code(e){const{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:a}=s;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const i=n.propertyName;if(typeof i!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),c=t.const("tag",(0,Nn._)`${r}${(0,Nn.getProperty)(i)}`);t.if((0,Nn._)`typeof ${c} == "string"`,()=>d(),()=>e.error(!1,{discrError:Ac.DiscrError.Tag,tag:c,tagName:i})),e.ok(u);function d(){const h=p();t.if(!1);for(const g in h)t.elseIf((0,Nn._)`${c} === ${g}`),t.assign(u,f(h[g]));t.else(),e.error(!1,{discrError:Ac.DiscrError.Mapping,tag:c,tagName:i}),t.endIf()}function f(h){const g=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:h},g);return e.mergeEvaluated(m,Nn.Name),g}function p(){var h;const g={},m=y(s);let v=!0;for(let w=0;w<a.length;w++){let $=a[w];if($!=null&&$.$ref&&!(0,D3.schemaHasRulesButRef)($,o.self.RULES)){const M=$.$ref;if($=xp.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,M),$ instanceof xp.SchemaEnv&&($=$.schema),$===void 0)throw new O3.default(o.opts.uriResolver,o.baseId,M)}const R=(h=$==null?void 0:$.properties)===null||h===void 0?void 0:h[i];if(typeof R!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);v=v&&(m||y($)),b(R,w)}if(!v)throw new Error(`discriminator: "${i}" must be required`);return g;function y({required:w}){return Array.isArray(w)&&w.includes(i)}function b(w,$){if(w.const)_(w.const,$);else if(w.enum)for(const R of w.enum)_(R,$);else throw new Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function _(w,$){if(typeof w!="string"||w in g)throw new Error(`discriminator: "${i}" values must be unique strings`);g[w]=$}}}};hd.default=F3;const B3="http://json-schema.org/draft-07/schema#",U3="http://json-schema.org/draft-07/schema#",V3="Core schema meta-schema",W3={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},K3=["object","boolean"],H3={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},G3={$schema:B3,$id:U3,title:V3,definitions:W3,type:K3,properties:H3,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=Uv,n=Ou,s=hd,o=G3,a=["/properties"],i="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(g,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var c=Mt;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var d=we;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=go;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=ns;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})(kc,kc.exports);var Fy=kc.exports;const q3=je(Fy);var Nc={exports:{}},By={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,S){return{validate:j,compare:S}}e.fullFormats={date:t(o,a),time:t(u,c),"date-time":t(f,p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:m,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:D,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:w},int64:{type:"number",validate:$},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(j){return j%4===0&&(j%100!==0||j%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(j){const S=n.exec(j);if(!S)return!1;const E=+S[1],P=+S[2],W=+S[3];return P>=1&&P<=12&&W>=1&&W<=(P===2&&r(E)?29:s[P])}function a(j,S){if(j&&S)return j>S?1:j<S?-1:0}const i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function u(j,S){const E=i.exec(j);if(!E)return!1;const P=+E[1],W=+E[2],G=+E[3],L=E[5];return(P<=23&&W<=59&&G<=59||P===23&&W===59&&G===60)&&(!S||L!=="")}function c(j,S){if(!(j&&S))return;const E=i.exec(j),P=i.exec(S);if(E&&P)return j=E[1]+E[2]+E[3]+(E[4]||""),S=P[1]+P[2]+P[3]+(P[4]||""),j>S?1:j<S?-1:0}const d=/t|\s/i;function f(j){const S=j.split(d);return S.length===2&&o(S[0])&&u(S[1],!0)}function p(j,S){if(!(j&&S))return;const[E,P]=j.split(d),[W,G]=S.split(d),L=a(E,W);if(L!==void 0)return L||c(P,G)}const h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function m(j){return h.test(j)&&g.test(j)}const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(j){return v.lastIndex=0,v.test(j)}const b=-2147483648,_=2**31-1;function w(j){return Number.isInteger(j)&&j<=_&&j>=b}function $(j){return Number.isInteger(j)}function R(){return!0}const M=/[^\\]\\Z/;function D(j){if(M.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(By);var Uy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Fy,r=we,n=r.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:i,schemaCode:u})=>r.str`should be ${s[i].okStr} ${u}`,params:({keyword:i,schemaCode:u})=>r._`{comparison: ${s[i].okStr}, limit: ${u}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:o,code(i){const{gen:u,data:c,schemaCode:d,keyword:f,it:p}=i,{opts:h,self:g}=p;if(!h.validateFormats)return;const m=new t.KeywordCxt(p,g.RULES.all.format.definition,"format");m.$data?v():y();function v(){const _=u.scopeValue("formats",{ref:g.formats,code:h.code.formats}),w=u.const("fmt",r._`${_}[${m.schemaCode}]`);i.fail$data(r.or(r._`typeof ${w} != "object"`,r._`${w} instanceof RegExp`,r._`typeof ${w}.compare != "function"`,b(w)))}function y(){const _=m.schema,w=g.formats[_];if(!w||w===!0)return;if(typeof w!="object"||w instanceof RegExp||typeof w.compare!="function")throw new Error(`"${f}": format "${_}" does not define "compare" function`);const $=u.scopeValue("formats",{key:_,ref:w,code:h.code.formats?r._`${h.code.formats}${r.getProperty(_)}`:void 0});i.fail$data(b($))}function b(_){return r._`${_}.compare(${c}, ${d}) ${s[f].fail} 0`}},dependencies:["format"]};const a=i=>(i.addKeyword(e.formatLimitDefinition),i);e.default=a})(Uy);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=By,n=Uy,s=we,o=new s.Name("fullFormats"),a=new s.Name("fastFormats"),i=(c,d={keywords:!0})=>{if(Array.isArray(d))return u(c,d,r.fullFormats,o),c;const[f,p]=d.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,o],h=d.formats||r.formatNames;return u(c,h,f,p),d.keywords&&n.default(c),c};i.get=(c,d="full")=>{const p=(d==="fast"?r.fastFormats:r.fullFormats)[c];if(!p)throw new Error(`Unknown format "${c}"`);return p};function u(c,d,f,p){var h,g;(h=(g=c.opts.code).formats)!==null&&h!==void 0||(g.formats=s._`require("ajv-formats/dist/formats").${p}`);for(const m of d)c.addFormat(m,f[m])}e.exports=t=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i})(Nc,Nc.exports);var Y3=Nc.exports;const J3=je(Y3);function Z3(e){return function(t,r,n){for(var s=-1,o=Object(t),a=n(t),i=a.length;i--;){var u=a[e?i:++s];if(r(o[u],u,o)===!1)break}return t}}var Q3=Z3,X3=Q3,e4=X3(),Vy=e4,t4=Vy,r4=Jt;function n4(e,t){return e&&t4(e,t,r4)}var s4=n4,o4=mr;function a4(e,t){return function(r,n){if(r==null)return r;if(!o4(r))return e(r,n);for(var s=r.length,o=t?s:-1,a=Object(r);(t?o--:++o<s)&&n(a[o],o,a)!==!1;);return r}}var i4=a4,l4=s4,c4=i4,u4=c4(l4),pd=u4,d4=pd;function f4(e,t){var r=[];return d4(e,function(n,s,o){t(n,s,o)&&r.push(n)}),r}var h4=f4,p4=G0,m4=h4,g4=fn,v4=Ue;function y4(e,t){var r=v4(e)?p4:m4;return r(e,g4(t))}var Wy=y4;const Wa=je(Wy);var b4=xu;function x4(e,t){return b4(e,t)}var w4=x4;const Ky=je(w4);var k4=cn,_4=function(){try{var e=k4(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Hy=_4,wp=Hy;function C4(e,t,r){t=="__proto__"&&wp?wp(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var md=C4,$4=md,S4=io;function j4(e,t,r){(r!==void 0&&!S4(e[t],r)||r===void 0&&!(t in e))&&$4(e,t,r)}var Gy=j4,Ka={exports:{}};Ka.exports;(function(e,t){var r=ut,n=t&&!t.nodeType&&t,s=n&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===n,a=o?r.Buffer:void 0,i=a?a.allocUnsafe:void 0;function u(c,d){if(d)return c.slice();var f=c.length,p=i?i(f):new c.constructor(f);return c.copy(p),p}e.exports=u})(Ka,Ka.exports);var qy=Ka.exports,kp=V0;function E4(e){var t=new e.constructor(e.byteLength);return new kp(t).set(new kp(e)),t}var gd=E4,A4=gd;function N4(e,t){var r=t?A4(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Yy=N4;function P4(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var yo=P4,R4=xt,_p=Object.create,T4=function(){function e(){}return function(t){if(!R4(t))return{};if(_p)return _p(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Ai=T4,I4=Z0,M4=I4(Object.getPrototypeOf,Object),vd=M4,z4=Ai,O4=vd,D4=bi;function L4(e){return typeof e.constructor=="function"&&!D4(e)?z4(O4(e)):{}}var Jy=L4,F4=mr,B4=bt;function U4(e){return B4(e)&&F4(e)}var V4=U4,W4=Ir,K4=vd,H4=bt,G4="[object Object]",q4=Function.prototype,Y4=Object.prototype,Zy=q4.toString,J4=Y4.hasOwnProperty,Z4=Zy.call(Object);function Q4(e){if(!H4(e)||W4(e)!=G4)return!1;var t=K4(e);if(t===null)return!0;var r=J4.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Zy.call(r)==Z4}var Qy=Q4;function X4(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Xy=X4,e9=md,t9=io,r9=Object.prototype,n9=r9.hasOwnProperty;function s9(e,t,r){var n=e[t];(!(n9.call(e,t)&&t9(n,r))||r===void 0&&!(t in e))&&e9(e,t,r)}var yd=s9,o9=yd,a9=md;function i9(e,t,r,n){var s=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var i=t[o],u=n?n(r[i],e[i],i,r,e):void 0;u===void 0&&(u=e[i]),s?a9(r,i,u):o9(r,i,u)}return r}var bo=i9;function l9(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var c9=l9,u9=xt,d9=bi,f9=c9,h9=Object.prototype,p9=h9.hasOwnProperty;function m9(e){if(!u9(e))return f9(e);var t=d9(e),r=[];for(var n in e)n=="constructor"&&(t||!p9.call(e,n))||r.push(n);return r}var g9=m9,v9=J0,y9=g9,b9=mr;function x9(e){return b9(e)?v9(e,!0):y9(e)}var xo=x9,w9=bo,k9=xo;function _9(e){return w9(e,k9(e))}var C9=_9,Cp=Gy,$9=qy,S9=Yy,j9=yo,E9=Jy,$p=co,Sp=Ue,A9=V4,N9=uo,P9=lo,R9=xt,T9=Qy,I9=yi,jp=Xy,M9=C9;function z9(e,t,r,n,s,o,a){var i=jp(e,r),u=jp(t,r),c=a.get(u);if(c){Cp(e,r,c);return}var d=o?o(i,u,r+"",e,t,a):void 0,f=d===void 0;if(f){var p=Sp(u),h=!p&&N9(u),g=!p&&!h&&I9(u);d=u,p||h||g?Sp(i)?d=i:A9(i)?d=j9(i):h?(f=!1,d=$9(u,!0)):g?(f=!1,d=S9(u,!0)):d=[]:T9(u)||$p(u)?(d=i,$p(i)?d=M9(i):(!R9(i)||P9(i))&&(d=E9(u))):f=!1}f&&(a.set(u,d),s(d,u,n,o,a),a.delete(u)),Cp(e,r,d)}var O9=z9,D9=vi,L9=Gy,F9=Vy,B9=O9,U9=xt,V9=xo,W9=Xy;function eb(e,t,r,n,s){e!==t&&F9(t,function(o,a){if(s||(s=new D9),U9(o))B9(e,t,a,r,eb,n,s);else{var i=n?n(W9(e,a),o,a+"",e,t,s):void 0;i===void 0&&(i=o),L9(e,a,i)}},V9)}var K9=eb;function H9(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var bd=H9,G9=bd,Ep=Math.max;function q9(e,t,r){return t=Ep(t===void 0?e.length-1:t,0),function(){for(var n=arguments,s=-1,o=Ep(n.length-t,0),a=Array(o);++s<o;)a[s]=n[t+s];s=-1;for(var i=Array(t+1);++s<t;)i[s]=n[s];return i[t]=r(a),G9(e,this,i)}}var tb=q9;function Y9(e){return function(){return e}}var J9=Y9,Z9=J9,Ap=Hy,Q9=wi,X9=Ap?function(e,t){return Ap(e,"toString",{configurable:!0,enumerable:!1,value:Z9(t),writable:!0})}:Q9,e6=X9,t6=800,r6=16,n6=Date.now;function s6(e){var t=0,r=0;return function(){var n=n6(),s=r6-(n-r);if(r=n,s>0){if(++t>=t6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var rb=s6,o6=e6,a6=rb,i6=a6(o6),xd=i6,l6=wi,c6=tb,u6=xd;function d6(e,t){return u6(c6(e,t,l6),e+"")}var f6=d6,h6=f6,p6=Iv;function m6(e){return h6(function(t,r){var n=-1,s=r.length,o=s>1?r[s-1]:void 0,a=s>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(s--,o):void 0,a&&p6(r[0],r[1],a)&&(o=s<3?void 0:o,s=1),t=Object(t);++n<s;){var i=r[n];i&&e(t,i,n,o)}return t})}var g6=m6,v6=K9,y6=g6,b6=y6(function(e,t,r){v6(e,t,r)}),x6=b6;const wo=je(x6);function w6(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var wd=w6,k6=bo,_6=Jt;function C6(e,t){return e&&k6(t,_6(t),e)}var nb=C6,$6=bo,S6=xo;function j6(e,t){return e&&$6(t,S6(t),e)}var E6=j6,A6=bo,N6=mu;function P6(e,t){return A6(e,N6(e),t)}var R6=P6,T6=pu,I6=vd,M6=mu,z6=q0,O6=Object.getOwnPropertySymbols,D6=O6?function(e){for(var t=[];e;)T6(t,M6(e)),e=I6(e);return t}:z6,sb=D6,L6=bo,F6=sb;function B6(e,t){return L6(e,F6(e),t)}var U6=B6,V6=H0,W6=sb,K6=xo;function H6(e){return V6(e,K6,W6)}var G6=H6,q6=Object.prototype,Y6=q6.hasOwnProperty;function J6(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&Y6.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Z6=J6,Q6=gd;function X6(e,t){var r=t?Q6(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var eU=X6,tU=/\w*$/;function rU(e){var t=new e.constructor(e.source,tU.exec(e));return t.lastIndex=e.lastIndex,t}var nU=rU,Np=Yn,Pp=Np?Np.prototype:void 0,Rp=Pp?Pp.valueOf:void 0;function sU(e){return Rp?Object(Rp.call(e)):{}}var oU=sU,aU=gd,iU=eU,lU=nU,cU=oU,uU=Yy,dU="[object Boolean]",fU="[object Date]",hU="[object Map]",pU="[object Number]",mU="[object RegExp]",gU="[object Set]",vU="[object String]",yU="[object Symbol]",bU="[object ArrayBuffer]",xU="[object DataView]",wU="[object Float32Array]",kU="[object Float64Array]",_U="[object Int8Array]",CU="[object Int16Array]",$U="[object Int32Array]",SU="[object Uint8Array]",jU="[object Uint8ClampedArray]",EU="[object Uint16Array]",AU="[object Uint32Array]";function NU(e,t,r){var n=e.constructor;switch(t){case bU:return aU(e);case dU:case fU:return new n(+e);case xU:return iU(e,r);case wU:case kU:case _U:case CU:case $U:case SU:case jU:case EU:case AU:return uU(e,r);case hU:return new n;case pU:case vU:return new n(e);case mU:return lU(e);case gU:return new n;case yU:return cU(e)}}var PU=NU,RU=un,TU=bt,IU="[object Map]";function MU(e){return TU(e)&&RU(e)==IU}var zU=MU,OU=zU,DU=vu,Tp=yu,Ip=Tp&&Tp.isMap,LU=Ip?DU(Ip):OU,FU=LU,BU=un,UU=bt,VU="[object Set]";function WU(e){return UU(e)&&BU(e)==VU}var KU=WU,HU=KU,GU=vu,Mp=yu,zp=Mp&&Mp.isSet,qU=zp?GU(zp):HU,YU=qU,JU=vi,ZU=wd,QU=yd,XU=nb,eV=E6,tV=qy,rV=yo,nV=R6,sV=U6,oV=Q0,aV=G6,iV=un,lV=Z6,cV=PU,uV=Jy,dV=Ue,fV=uo,hV=FU,pV=xt,mV=YU,gV=Jt,vV=xo,yV=1,bV=2,xV=4,ob="[object Arguments]",wV="[object Array]",kV="[object Boolean]",_V="[object Date]",CV="[object Error]",ab="[object Function]",$V="[object GeneratorFunction]",SV="[object Map]",jV="[object Number]",ib="[object Object]",EV="[object RegExp]",AV="[object Set]",NV="[object String]",PV="[object Symbol]",RV="[object WeakMap]",TV="[object ArrayBuffer]",IV="[object DataView]",MV="[object Float32Array]",zV="[object Float64Array]",OV="[object Int8Array]",DV="[object Int16Array]",LV="[object Int32Array]",FV="[object Uint8Array]",BV="[object Uint8ClampedArray]",UV="[object Uint16Array]",VV="[object Uint32Array]",Te={};Te[ob]=Te[wV]=Te[TV]=Te[IV]=Te[kV]=Te[_V]=Te[MV]=Te[zV]=Te[OV]=Te[DV]=Te[LV]=Te[SV]=Te[jV]=Te[ib]=Te[EV]=Te[AV]=Te[NV]=Te[PV]=Te[FV]=Te[BV]=Te[UV]=Te[VV]=!0;Te[CV]=Te[ab]=Te[RV]=!1;function da(e,t,r,n,s,o){var a,i=t&yV,u=t&bV,c=t&xV;if(r&&(a=s?r(e,n,s,o):r(e)),a!==void 0)return a;if(!pV(e))return e;var d=dV(e);if(d){if(a=lV(e),!i)return rV(e,a)}else{var f=iV(e),p=f==ab||f==$V;if(fV(e))return tV(e,i);if(f==ib||f==ob||p&&!s){if(a=u||p?{}:uV(e),!i)return u?sV(e,eV(a,e)):nV(e,XU(a,e))}else{if(!Te[f])return s?e:{};a=cV(e,f,i)}}o||(o=new JU);var h=o.get(e);if(h)return h;o.set(e,a),mV(e)?e.forEach(function(v){a.add(da(v,t,r,v,e,o))}):hV(e)&&e.forEach(function(v,y){a.set(y,da(v,t,r,y,e,o))});var g=c?u?aV:oV:u?vV:gV,m=d?void 0:g(e);return ZU(m||e,function(v,y){m&&(y=v,v=e[y]),QU(a,y,da(v,t,r,y,e,o))}),a}var kd=da,WV=kd,KV=1,HV=4;function GV(e){return WV(e,KV|HV)}var qV=GV;const Gs=je(qV);var lb={};(function(e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,r=e.aliasToReal,n={};for(var s in r){var o=r[s];t.call(n,o)?n[o].push(s):n[o]=[s]}return n}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}})(lb);var al,Op;function Mr(){return Op||(Op=1,al={}),al}var Ke=lb,YV=Mr(),Dp=Array.prototype.push;function JV(e,t){return t==2?function(r,n){return e.apply(void 0,arguments)}:function(r){return e.apply(void 0,arguments)}}function il(e,t){return t==2?function(r,n){return e(r,n)}:function(r){return e(r)}}function Lp(e){for(var t=e?e.length:0,r=Array(t);t--;)r[t]=e[t];return r}function ZV(e){return function(t){return e({},t)}}function QV(e,t){return function(){for(var r=arguments.length,n=r-1,s=Array(r);r--;)s[r]=arguments[r];var o=s[t],a=s.slice(0,t);return o&&Dp.apply(a,o),t!=n&&Dp.apply(a,s.slice(t+1)),e.apply(this,a)}}function ll(e,t){return function(){var r=arguments.length;if(r){for(var n=Array(r);r--;)n[r]=arguments[r];var s=n[0]=t.apply(void 0,n);return e.apply(void 0,n),s}}}function Pc(e,t,r,n){var s=typeof t=="function",o=t===Object(t);if(o&&(n=r,r=t,t=void 0),r==null)throw new TypeError;n||(n={});var a={cap:"cap"in n?n.cap:!0,curry:"curry"in n?n.curry:!0,fixed:"fixed"in n?n.fixed:!0,immutable:"immutable"in n?n.immutable:!0,rearg:"rearg"in n?n.rearg:!0},i=s?r:YV,u="curry"in n&&n.curry,c="fixed"in n&&n.fixed,d="rearg"in n&&n.rearg,f=s?r.runInContext():void 0,p=s?r:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isError:e.isError,isFunction:e.isFunction,isWeakMap:e.isWeakMap,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},h=p.ary,g=p.assign,m=p.clone,v=p.curry,y=p.forEach,b=p.isArray,_=p.isError,w=p.isFunction,$=p.isWeakMap,R=p.keys,M=p.rearg,D=p.toInteger,j=p.toPath,S=R(Ke.aryMethod),E={castArray:function(C){return function(){var N=arguments[0];return b(N)?C(Lp(N)):C.apply(void 0,arguments)}},iteratee:function(C){return function(){var N=arguments[0],B=arguments[1],H=C(N,B),te=H.length;return a.cap&&typeof B=="number"?(B=B>2?B-2:1,te&&te<=B?H:il(H,B)):H}},mixin:function(C){return function(N){var B=this;if(!w(B))return C(B,Object(N));var H=[];return y(R(N),function(te){w(N[te])&&H.push([te,B.prototype[te]])}),C(B,Object(N)),y(H,function(te){var se=te[1];w(se)?B.prototype[te[0]]=se:delete B.prototype[te[0]]}),B}},nthArg:function(C){return function(N){var B=N<0?1:D(N)+1;return v(C(N),B)}},rearg:function(C){return function(N,B){var H=B?B.length:0;return v(C(N,B),H)}},runInContext:function(C){return function(N){return Pc(e,C(N),n)}}};function P(C,N){if(a.cap){var B=Ke.iterateeRearg[C];if(B)return K(N,B);var H=!s&&Ke.iterateeAry[C];if(H)return J(N,H)}return N}function W(C,N,B){return u||a.curry&&B>1?v(N,B):N}function G(C,N,B){if(a.fixed&&(c||!Ke.skipFixed[C])){var H=Ke.methodSpread[C],te=H&&H.start;return te===void 0?h(N,B):QV(N,te)}return N}function L(C,N,B){return a.rearg&&B>1&&(d||!Ke.skipRearg[C])?M(N,Ke.methodRearg[C]||Ke.aryRearg[B]):N}function V(C,N){N=j(N);for(var B=-1,H=N.length,te=H-1,se=m(Object(C)),le=se;le!=null&&++B<H;){var me=N[B],I=le[me];I!=null&&!(w(I)||_(I)||$(I))&&(le[me]=m(B==te?I:Object(I))),le=le[me]}return se}function O(C){return z.runInContext.convert(C)(void 0)}function re(C,N){var B=Ke.aliasToReal[C]||C,H=Ke.remap[B]||B,te=n;return function(se){var le=s?f:p,me=s?f[H]:N,I=g(g({},te),se);return Pc(le,B,me,I)}}function J(C,N){return A(C,function(B){return typeof B=="function"?il(B,N):B})}function K(C,N){return A(C,function(B){var H=N.length;return JV(M(il(B,H),N),H)})}function A(C,N){return function(){var B=arguments.length;if(!B)return C();for(var H=Array(B);B--;)H[B]=arguments[B];var te=a.rearg?0:B-1;return H[te]=N(H[te]),C.apply(void 0,H)}}function Y(C,N,B){var H,te=Ke.aliasToReal[C]||C,se=N,le=E[te];return le?se=le(N):a.immutable&&(Ke.mutate.array[te]?se=ll(N,Lp):Ke.mutate.object[te]?se=ll(N,ZV(N)):Ke.mutate.set[te]&&(se=ll(N,V))),y(S,function(me){return y(Ke.aryMethod[me],function(I){if(te==I){var ae=Ke.methodSpread[te],ce=ae&&ae.afterRearg;return H=ce?G(te,L(te,se,me),me):L(te,G(te,se,me),me),H=P(te,H),H=W(te,H,me),!1}}),!H}),H||(H=se),H==N&&(H=u?v(H,1):function(){return N.apply(this,arguments)}),H.convert=re(te,N),H.placeholder=N.placeholder=B,H}if(!o)return Y(t,r,i);var z=r,k=[];return y(S,function(C){y(Ke.aryMethod[C],function(N){var B=z[Ke.remap[N]||N];B&&k.push([N,Y(N,B,z)])})}),y(R(z),function(C){var N=z[C];if(typeof N=="function"){for(var B=k.length;B--;)if(k[B][0]==C)return;N.convert=re(C,N),k.push([C,N])}}),y(k,function(C){z[C[0]]=C[1]}),z.convert=O,z.placeholder=z,y(R(z),function(C){y(Ke.realToAlias[C]||[],function(N){z[N]=z[C]})}),z}var XV=Pc,cl,Fp;function cb(){if(Fp)return cl;Fp=1;var e=X0,t=e&&new e;return cl=t,cl}var eW=wi,Bp=cb(),tW=Bp?function(e,t){return Bp.set(e,t),e}:eW,ub=tW,rW=Ai,nW=xt;function sW(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=rW(e.prototype),n=e.apply(r,t);return nW(n)?n:r}}var Ni=sW,oW=Ni,aW=ut,iW=1;function lW(e,t,r){var n=t&iW,s=oW(e);function o(){var a=this&&this!==aW&&this instanceof o?s:e;return a.apply(n?r:this,arguments)}return o}var cW=lW,uW=Math.max;function dW(e,t,r,n){for(var s=-1,o=e.length,a=r.length,i=-1,u=t.length,c=uW(o-a,0),d=Array(u+c),f=!n;++i<u;)d[i]=t[i];for(;++s<a;)(f||s<o)&&(d[r[s]]=e[s]);for(;c--;)d[i++]=e[s++];return d}var db=dW,fW=Math.max;function hW(e,t,r,n){for(var s=-1,o=e.length,a=-1,i=r.length,u=-1,c=t.length,d=fW(o-i,0),f=Array(d+c),p=!n;++s<d;)f[s]=e[s];for(var h=s;++u<c;)f[h+u]=t[u];for(;++a<i;)(p||s<o)&&(f[h+r[a]]=e[s++]);return f}var fb=hW;function pW(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var mW=pW,ul,Up;function _d(){if(Up)return ul;Up=1;function e(){}return ul=e,ul}var dl,Vp;function Cd(){if(Vp)return dl;Vp=1;var e=Ai,t=_d(),r=4294967295;function n(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=r,this.__views__=[]}return n.prototype=e(t.prototype),n.prototype.constructor=n,dl=n,dl}var fl,Wp;function gW(){if(Wp)return fl;Wp=1;function e(){}return fl=e,fl}var hl,Kp;function $d(){if(Kp)return hl;Kp=1;var e=cb(),t=gW(),r=e?function(n){return e.get(n)}:t;return hl=r,hl}var pl,Hp;function vW(){if(Hp)return pl;Hp=1;var e={};return pl=e,pl}var ml,Gp;function hb(){if(Gp)return ml;Gp=1;var e=vW(),t=Object.prototype,r=t.hasOwnProperty;function n(s){for(var o=s.name+"",a=e[o],i=r.call(e,o)?a.length:0;i--;){var u=a[i],c=u.func;if(c==null||c==s)return u.name}return o}return ml=n,ml}var gl,qp;function Sd(){if(qp)return gl;qp=1;var e=Ai,t=_d();function r(n,s){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!s,this.__index__=0,this.__values__=void 0}return r.prototype=e(t.prototype),r.prototype.constructor=r,gl=r,gl}var vl,Yp;function yW(){if(Yp)return vl;Yp=1;var e=Cd(),t=Sd(),r=yo;function n(s){if(s instanceof e)return s.clone();var o=new t(s.__wrapped__,s.__chain__);return o.__actions__=r(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}return vl=n,vl}var yl,Jp;function bW(){if(Jp)return yl;Jp=1;var e=Cd(),t=Sd(),r=_d(),n=Ue,s=bt,o=yW(),a=Object.prototype,i=a.hasOwnProperty;function u(c){if(s(c)&&!n(c)&&!(c instanceof e)){if(c instanceof t)return c;if(i.call(c,"__wrapped__"))return o(c)}return new t(c)}return u.prototype=r.prototype,u.prototype.constructor=u,yl=u,yl}var bl,Zp;function pb(){if(Zp)return bl;Zp=1;var e=Cd(),t=$d(),r=hb(),n=bW();function s(o){var a=r(o),i=n[a];if(typeof i!="function"||!(a in e.prototype))return!1;if(o===i)return!0;var u=t(i);return!!u&&o===u[0]}return bl=s,bl}var xW=ub,wW=rb,kW=wW(xW),mb=kW,_W=/\{\n\/\* \[wrapped with (.+)\] \*/,CW=/,? & /;function $W(e){var t=e.match(_W);return t?t[1].split(CW):[]}var SW=$W,jW=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function EW(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(jW,`{
128
128
  /* [wrapped with `+t+`] */
129
- `)}var AW=EW,NW=Fv;function PW(e,t){var r=e==null?0:e.length;return!!r&&NW(e,t,0)>-1}var RW=PW,TW=wd,IW=RW,MW=1,zW=2,OW=8,DW=16,LW=32,FW=64,BW=128,UW=256,VW=512,WW=[["ary",BW],["bind",MW],["bindKey",zW],["curry",OW],["curryRight",DW],["flip",VW],["partial",LW],["partialRight",FW],["rearg",UW]];function KW(e,t){return TW(WW,function(r){var n="_."+r[0];t&r[1]&&!IW(e,n)&&e.push(n)}),e.sort()}var HW=KW,GW=SW,qW=AW,YW=xd,JW=HW;function ZW(e,t,r){var n=t+"";return YW(e,qW(n,JW(GW(n),r)))}var gb=ZW,QW=pb(),XW=mb,e8=gb,t8=4,r8=8,Qp=32,Xp=64;function n8(e,t,r,n,s,o,a,i,u,c){var d=t&r8,f=d?a:void 0,p=d?void 0:a,h=d?o:void 0,g=d?void 0:o;t|=d?Qp:Xp,t&=~(d?Xp:Qp),t&t8||(t&=-4);var m=[e,t,s,h,f,g,p,i,u,c],v=r.apply(void 0,m);return QW(e)&&XW(v,m),v.placeholder=n,e8(v,e,t)}var vb=n8;function s8(e){var t=e;return t.placeholder}var yb=s8,o8=yo,a8=fo,i8=Math.min;function l8(e,t){for(var r=e.length,n=i8(t.length,r),s=o8(e);n--;){var o=t[n];e[n]=a8(o,r)?s[o]:void 0}return e}var c8=l8,em="__lodash_placeholder__";function u8(e,t){for(var r=-1,n=e.length,s=0,o=[];++r<n;){var a=e[r];(a===t||a===em)&&(e[r]=em,o[s++]=r)}return o}var jd=u8,d8=db,f8=fb,h8=mW,tm=Ni,p8=vb,m8=yb,g8=c8,v8=jd,y8=ut,b8=1,x8=2,w8=8,k8=16,_8=128,C8=512;function bb(e,t,r,n,s,o,a,i,u,c){var d=t&_8,f=t&b8,p=t&x8,h=t&(w8|k8),g=t&C8,m=p?void 0:tm(e);function v(){for(var y=arguments.length,b=Array(y),_=y;_--;)b[_]=arguments[_];if(h)var w=m8(v),$=h8(b,w);if(n&&(b=d8(b,n,s,h)),o&&(b=f8(b,o,a,h)),y-=$,h&&y<c){var R=v8(b,w);return p8(e,t,bb,v.placeholder,r,b,R,i,u,c-y)}var M=f?r:this,D=p?M[e]:e;return y=b.length,i?b=g8(b,i):g&&y>1&&b.reverse(),d&&u<y&&(b.length=u),this&&this!==y8&&this instanceof v&&(D=m||tm(D)),D.apply(M,b)}return v}var xb=bb,$8=bd,S8=Ni,j8=xb,E8=vb,A8=yb,N8=jd,P8=ut;function R8(e,t,r){var n=S8(e);function s(){for(var o=arguments.length,a=Array(o),i=o,u=A8(s);i--;)a[i]=arguments[i];var c=o<3&&a[0]!==u&&a[o-1]!==u?[]:N8(a,u);if(o-=c.length,o<r)return E8(e,t,j8,s.placeholder,void 0,a,c,void 0,void 0,r-o);var d=this&&this!==P8&&this instanceof s?n:e;return $8(d,this,a)}return s}var T8=R8,I8=bd,M8=Ni,z8=ut,O8=1;function D8(e,t,r,n){var s=t&O8,o=M8(e);function a(){for(var i=-1,u=arguments.length,c=-1,d=n.length,f=Array(d+u),p=this&&this!==z8&&this instanceof a?o:e;++c<d;)f[c]=n[c];for(;u--;)f[c++]=arguments[++i];return I8(p,s?r:this,f)}return a}var L8=D8,F8=db,B8=fb,rm=jd,nm="__lodash_placeholder__",xl=1,U8=2,V8=4,sm=8,Es=128,om=256,W8=Math.min;function K8(e,t){var r=e[1],n=t[1],s=r|n,o=s<(xl|U8|Es),a=n==Es&&r==sm||n==Es&&r==om&&e[7].length<=t[8]||n==(Es|om)&&t[7].length<=t[8]&&r==sm;if(!(o||a))return e;n&xl&&(e[2]=t[2],s|=r&xl?0:V8);var i=t[3];if(i){var u=e[3];e[3]=u?F8(u,i,t[4]):i,e[4]=u?rm(e[3],nm):t[4]}return i=t[5],i&&(u=e[5],e[5]=u?B8(u,i,t[6]):i,e[6]=u?rm(e[5],nm):t[6]),i=t[7],i&&(e[7]=i),n&Es&&(e[8]=e[8]==null?t[8]:W8(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=s,e}var H8=K8,G8=ub,q8=cW,Y8=T8,J8=xb,Z8=L8,Q8=$d(),X8=H8,e7=mb,t7=gb,am=po,r7="Expected a function",im=1,n7=2,lm=8,cm=16,um=32,s7=64,dm=Math.max;function o7(e,t,r,n,s,o,a,i){var u=t&n7;if(!u&&typeof e!="function")throw new TypeError(r7);var c=n?n.length:0;if(c||(t&=-97,n=s=void 0),a=a===void 0?a:dm(am(a),0),i=i===void 0?i:am(i),c-=s?s.length:0,t&s7){var d=n,f=s;n=s=void 0}var p=u?void 0:Q8(e),h=[e,t,r,n,s,d,f,o,a,i];if(p&&X8(h,p),e=h[0],t=h[1],r=h[2],n=h[3],s=h[4],i=h[9]=h[9]===void 0?u?0:e.length:dm(h[9]-c,0),!i&&t&(lm|cm)&&(t&=-25),!t||t==im)var g=q8(e,t,r);else t==lm||t==cm?g=Y8(e,t,i):(t==um||t==(im|um))&&!s.length?g=Z8(e,t,r,n):g=J8.apply(void 0,h);var m=p?G8:e7;return t7(m(g,h),e,t)}var Ed=o7,a7=Ed,i7=128;function l7(e,t,r){return t=r?void 0:t,t=e&&t==null?e.length:t,a7(e,i7,void 0,void 0,void 0,void 0,t)}var c7=l7,u7=kd,d7=4;function f7(e){return u7(e,d7)}var h7=f7,p7=Ed,m7=8;function Ad(e,t,r){t=r?void 0:t;var n=p7(e,m7,void 0,void 0,void 0,void 0,void 0,t);return n.placeholder=Ad.placeholder,n}Ad.placeholder={};var g7=Ad,v7=Ir,y7=bt,b7=Qy,x7="[object DOMException]",w7="[object Error]";function k7(e){if(!y7(e))return!1;var t=v7(e);return t==w7||t==x7||typeof e.message=="string"&&typeof e.name=="string"&&!b7(e)}var _7=k7,C7=un,$7=bt,S7="[object WeakMap]";function j7(e){return $7(e)&&C7(e)==S7}var E7=j7,A7=kd,N7=fn,P7=1;function R7(e){return N7(typeof e=="function"?e:A7(e,P7))}var T7=R7,fm=Yn,I7=co,M7=Ue,hm=fm?fm.isConcatSpreadable:void 0;function z7(e){return M7(e)||I7(e)||!!(hm&&e&&e[hm])}var O7=z7,D7=pu,L7=O7;function wb(e,t,r,n,s){var o=-1,a=e.length;for(r||(r=L7),s||(s=[]);++o<a;){var i=e[o];t>0&&r(i)?t>1?wb(i,t-1,r,n,s):D7(s,i):n||(s[s.length]=i)}return s}var F7=wb,B7=F7;function U7(e){var t=e==null?0:e.length;return t?B7(e,1):[]}var V7=U7,W7=V7,K7=tb,H7=xd;function G7(e){return H7(K7(e,void 0,W7),e+"")}var kb=G7,q7=Ed,Y7=kb,J7=256,Z7=Y7(function(e,t){return q7(e,J7,void 0,void 0,void 0,t)}),Q7=Z7,X7=ho,eK=yo,tK=Ue,rK=Jn,nK=ov,sK=dn,oK=rs;function aK(e){return tK(e)?X7(e,sK):rK(e)?[e]:eK(nK(oK(e)))}var iK=aK,lK={ary:c7,assign:nb,clone:h7,curry:g7,forEach:wd,isArray:Ue,isError:_7,isFunction:lo,isWeakMap:E7,iteratee:T7,keys:bu,rearg:Q7,toInteger:po,toPath:iK},cK=XV,uK=lK;function dK(e,t,r){return cK(uK,e,t,r)}var hn=dK,wl,pm;function fK(){if(pm)return wl;pm=1;var e=yd,t=xi,r=fo,n=xt,s=dn;function o(a,i,u,c){if(!n(a))return a;i=t(i,a);for(var d=-1,f=i.length,p=f-1,h=a;h!=null&&++d<f;){var g=s(i[d]),m=u;if(g==="__proto__"||g==="constructor"||g==="prototype")return a;if(d!=p){var v=h[g];m=c?c(v,g,h):void 0,m===void 0&&(m=n(v)?v:r(i[d+1])?[]:{})}e(h,g,m),h=h[g]}return a}return wl=o,wl}var kl,mm;function hK(){if(mm)return kl;mm=1;var e=fK();function t(r,n,s){return r==null?r:e(r,n,s)}return kl=t,kl}var pK=hn,_b=pK("set",hK());_b.placeholder=Mr();var mK=_b;const gK=Se(mK);function vK(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Cb=vK;const yK=Se(Cb);var bK=_u,xK=Cv;function wK(e,t){return t.length<2?e:bK(e,xK(t,0,-1))}var kK=wK,_K=xi,CK=Cb,$K=kK,SK=dn,jK=Object.prototype,EK=jK.hasOwnProperty;function AK(e,t){t=_K(t,e);var r=-1,n=t.length;if(!n)return!0;for(var s=e==null||typeof e!="object"&&typeof e!="function";++r<n;){var o=t[r];if(typeof o=="string"){if(o==="__proto__"&&!EK.call(e,"__proto__"))return!1;if(o==="constructor"&&r+1<n&&typeof t[r+1]=="string"&&t[r+1]==="prototype"){if(s&&r===0)continue;return!1}}}var a=$K(e,t);return a==null||delete a[SK(CK(t))]}var NK=AK,_l,gm;function PK(){if(gm)return _l;gm=1;var e=NK;function t(r,n){return r==null?!0:e(r,n)}return _l=t,_l}var RK=hn,$b=RK("unset",PK());$b.placeholder=Mr();var TK=$b;const IK=Se(TK);function MK(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}var zK=MK,OK=zK,DK=iv,LK=po,FK=rs;function BK(e,t,r){e=FK(e),t=DK(t);var n=e.length;r=r===void 0?n:OK(LK(r),0,n);var s=r;return r-=t.length,r>=0&&e.slice(r,s)==t}var UK=BK;const VK=Se(UK);function WK(e,t,r,n,s){return s(e,function(o,a,i){r=n?(n=!1,o):t(r,o,a,i)}),r}var KK=WK,HK=uv,GK=pd,qK=fn,YK=KK,JK=Ue;function ZK(e,t,r){var n=JK(e)?HK:YK,s=arguments.length<3;return n(e,qK(t),r,s,GK)}var QK=ZK;const Rc=Se(QK);var XK=ho;function eH(e,t){return XK(t,function(r){return[r,e[r]]})}var tH=eH;function rH(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=[n,n]}),r}var nH=rH,sH=tH,oH=un,aH=W0,iH=nH,lH="[object Map]",cH="[object Set]";function uH(e){return function(t){var r=oH(t);return r==lH?aH(t):r==cH?iH(t):sH(t,e(t))}}var dH=uH,fH=dH,hH=Jt,pH=fH(hH),mH=pH;const gH=Se(mH);function vH(e){return e===void 0}var yH=vH;const bH=Se(yH),fa="additionalProperties",ha="required",xH=(e,t)=>{const r={};return e.filter(n=>{const s=t(n);return Object.prototype.hasOwnProperty.call(r,s)?!1:(r[s]=!0,!0)})};class wH{constructor(t){this.findOption=t,this.schemaObject=r=>{const n=this.properties(r),s={type:"object",properties:n,additionalProperties:this.findOption(n)(fa)},o=this.findOption(n)(ha);return o.length>0&&(s.required=o),s},this.properties=r=>{const n={};return Object.keys(r).reduce((s,o)=>(s[o]=this.property(r[o]),s),n)},this.property=r=>{switch(typeof r){case"string":return{type:"string"};case"boolean":return{type:"boolean"};case"number":return Number.isInteger(r)?{type:"integer"}:{type:"number"};case"object":return r==null?{type:"null"}:this.schemaObjectOrArray(r);default:return{}}},this.schemaObjectOrArray=r=>r instanceof Array?this.schemaArray(r):this.schemaObject(r),this.schemaArray=r=>{if(r.length>0){const n=r.map(this.property),s=xH(n,o=>JSON.stringify(o));return s.length===1?{type:"array",items:s[0]}:{type:"array",items:{oneOf:s}}}else return{type:"array",items:{}}}}}const Sb=(e,t={})=>{const r=s=>o=>{switch(o){case fa:return Object.prototype.hasOwnProperty.call(t,fa)?t[fa]:!0;case ha:return Object.prototype.hasOwnProperty.call(t,ha)?t[ha](s):Object.keys(s);default:return}};return new wH(r).schemaObject(e)},Nd=new Set,jb=(e,t)=>t<=1?e:e+t.toString(),kH=(e,t)=>{const r=jb(e,t);return!Nd.has(r)},vm=e=>{e===void 0&&(e="undefined");let t=0;for(;!kH(e,t);)t++;const r=jb(e,t);return Nd.add(r),r},ym=e=>Nd.delete(e),Pd=(e,t)=>{let r=e;return!pe(e)&&!pe(t)&&!t.startsWith("[")&&(r=e+"."),pe(r)?t:pe(t)?r:`${r}${t}`},Eb=e=>{const n=e.replace(/(anyOf|allOf|oneOf)\/[\d]+\//g,"").replace(/(then|else)\//g,"").split("/").map(ko),o=n[0]==="#"||n[0]===""?2:1;return Ov(o,n.length,2).map(a=>n[a])},Tc=e=>e==null?void 0:e.replace(/~/g,"~0").replace(/\//g,"~1"),ko=e=>e==null?void 0:e.replace(/~1/g,"/").replace(/~0/,"~"),Cl=(e,t)=>{if(t&&typeof t.title=="string")return t.title;if(typeof e.scope=="string"){const r=e.scope,n=ko(r.substr(r.lastIndexOf("/")+1));return Tv(n)}return""},Ab=(e,t)=>{const r=e.label;if(typeof r=="boolean")return Zo(Cl(e,t),r);if(typeof r=="string")return Zo(r,!0);if(typeof r=="object"){const n=typeof r.text=="string"?r.text:Cl(e,t),s=typeof r.show=="boolean"?r.show:!0;return Zo(n,s)}return Zo(Cl(e,t),!0)},Zo=(e,t)=>({text:e,show:t}),pa=(e,t)=>pe(t)?e:t.split(".").reduce((n,s)=>{if(!(!n||!Object.prototype.hasOwnProperty.call(n,s)))return n[s]},e),_H=e=>e==="#"||e===void 0||e==="",zt=(e,t,r)=>Rd(e,t,{rootSchema:r,resolutionMap:new Map}),Rd=(e,t,r)=>{let n;if(e&&typeof e.$ref=="string"){const s=$l(r.rootSchema,e.$ref,r);s!==void 0&&(n=$l(s,t,r))}return n===void 0&&(n=$l(e,t,r)),n},$l=(e,t,r)=>{let n=r.resolutionMap.get(e);if(n||(n=new Set,r.resolutionMap.set(e,n)),n.has(t))return;n.add(t);const s=Td(e,t==null?void 0:t.split("/").map(ko),r);return n.delete(t),s},Td=(e,t,r)=>{if(!t||t.length===0)return e;if(pe(e))return;const n=CH(e,t,r);if(n!==void 0)return n;const s=[].concat(e.oneOf??[],e.allOf??[],e.anyOf??[],e.then??[],e.else??[]);for(const o of s){let a=o;o&&typeof o.$ref=="string"&&(a=Rd(r.rootSchema,o.$ref,r));const i=Td(a,t,r);if(i)return i}},CH=(e,t,r)=>{if(!t||t.length===0)return e;if(pe(e))return;const n=Nb(e,t);return n.schema&&typeof n.schema.$ref=="string"&&(n.schema=Rd(r.rootSchema,n.schema.$ref,r)),Td(n.schema,n.remainingPathSegments,r)},Nb=(e,t)=>{if(!t||t.length===0)return{schema:e,remainingPathSegments:[]};if(pe(e))return{schema:void 0,remainingPathSegments:t};const[r,...n]=t;return _H(r)?Nb(e,n):{schema:Qe(e,r),remainingPathSegments:n,resolvedSegment:r}};var Gt;(function(e){e.HIDE="HIDE",e.SHOW="SHOW",e.ENABLE="ENABLE",e.DISABLE="DISABLE"})(Gt||(Gt={}));const Pb=(e,t)=>{if(!EH(e))return t??"";const r=Eb(e.scope);return pe(r)?t??"":Pd(t,r.join("."))},Rb=e=>typeof e=="object"&&e!==null&&typeof e.i18n=="string",$H=e=>e.type==="Group",SH=e=>e.elements!==void 0,jH=e=>!!e&&typeof e=="object",EH=e=>jH(e)&&typeof e.scope=="string",AH=e=>!!e&&typeof e=="object",NH=e=>e.type==="OR",PH=e=>e.type==="AND",RH=e=>e.type==="LEAF",TH=e=>Dv(e,"schema"),IH=e=>Dv(e,"validate")&&typeof e.validate=="function",Sl=(e,t)=>Pb(e,t),Ic=(e,t,r,n,s,o)=>{if(PH(r))return r.conditions.reduce((a,i)=>a&&Ic(e,t,i,n,s,o),!0);if(NH(r))return r.conditions.reduce((a,i)=>a||Ic(e,t,i,n,s,o),!1);if(RH(r))return pa(e,Sl(r,n))===r.expectedValue;if(TH(r)){const a=pa(e,Sl(r,n));return r.failWhenUndefined&&a===void 0?!1:s.validate(r.schema,a)}else if(IH(r)){const i={data:pa(e,Sl(r,n)),fullData:e,path:n,uischemaElement:t,config:o};return r.validate(i)}else return!0},Tb=(e,t,r,n,s)=>{const o=e.rule.condition;return Ic(t,e,o,r,n,s)},MH=(e,t,r=void 0,n,s)=>{const o=Tb(e,t,r,n,s);switch(e.rule.effect){case Gt.HIDE:return!o;case Gt.SHOW:return o;default:return!0}},zH=(e,t,r=void 0,n,s)=>{const o=Tb(e,t,r,n,s);switch(e.rule.effect){case Gt.DISABLE:return!o;case Gt.ENABLE:return o;default:return!0}},Id=e=>!!(e.rule&&(e.rule.effect===Gt.SHOW||e.rule.effect===Gt.HIDE)),OH=e=>!!(e.rule&&(e.rule.effect===Gt.ENABLE||e.rule.effect===Gt.DISABLE)),_o=(e,t,r=void 0,n,s)=>e.rule?MH(e,t,r,n,s):!0,DH=(e,t,r=void 0,n,s)=>e.rule?zH(e,t,r,n,s):!0,Ha=e=>!!e&&Object.prototype.hasOwnProperty.call(e,"oneOf")&&e.oneOf&&e.oneOf.every(t=>t.const!==void 0),LH=e=>!!e&&typeof e=="object"&&(Object.prototype.hasOwnProperty.call(e,"enum")||Object.prototype.hasOwnProperty.call(e,"const")),FH=(e,t)=>{const r=e.toISOString();return t==="date-time"?r:t==="date"?r.split("T")[0]:t==="time"?r.split("T")[1].split(".")[0]:r},Ib=e=>e.replace("#","root").replace(new RegExp("/","g"),"_"),nt=(e,t)=>Bv(en(e),t),en=e=>{if(pe(e))return[];if(!pe(e.type)&&typeof e.type=="string")return[e.type];if(K0(e.type))return e.type;if(!pe(e.properties)||!pe(e.additionalProperties))return["object"];if(!pe(e.items))return["array"];if(!pe(e.enum)){const t=new Set;return e.enum.forEach(r=>{typeof r=="string"?t.add("string"):en(r).forEach(n=>t.add(n))}),Array.from(t)}if(!pe(e.allOf)){const t=ND(e.allOf,r=>en(r).length!==0);if(t)return en(t)}return[]},qt={schema:zt,data:pa},BH=e=>Eb(e.scope).join("."),jl={compose:Pd,fromScoped:BH},Mb=e=>{const t=new q3({allErrors:!0,verbose:!0,strict:!1,addUsedSchema:!1,...e});return J3(t),t},sr=(e,t)=>e===void 0?[]:e(t)?[]:e.errors,UH=e=>{switch(e.keyword){case"required":case"dependencies":return e.params.missingProperty;case"additionalProperties":return e.params.additionalProperty;default:return}},Ga=e=>{let t=e.dataPath||e.instancePath||"";t=t.replace(/\//g,".");const r=UH(e);return r!==void 0&&!t.endsWith(r)&&(t=`${t}.${r}`),t=t.replace(/^./,""),t=ko(t),t},VH=(e,t,r)=>n=>{const s=Wa(n,o=>o.keyword==="oneOf"||o.keyword==="anyOf").map(o=>Ga(o));return Wa(n,o=>{if(KH.indexOf(o.keyword)!==-1&&!Ha(o.parentSchema))return!1;const a=Ga(o);let i=r(a);const u=o.parentSchema;return i&&!WH(u)&&!Ha(u)&&s.findIndex(c=>e.startsWith(c))!==-1&&(i=i&&Ky(u,t)),i})},WH=e=>(e==null?void 0:e.type)==="object"||!!(e!=null&&e.properties),KH=["additionalProperties","allOf","anyOf","oneOf"],HH=e=>e==null?"":e.join(`
130
- `),qa={createLabelDescriptionFrom:Ab,convertToValidClassName:Ib},zb=e=>({type:e,elements:[]}),ma=e=>({type:"Control",scope:e}),GH=(e,t)=>{if(!pe(e)&&!SH(e)){const r=zb(t);return r.elements.push(e),r}return e},qH=(e,t)=>{if(!pe(t)){const r=Tv(t);if($H(e))e.label=r;else{const n={type:"Label",text:r};e.elements.push(n)}}},YH=e=>!pe(e)&&(!pe(e.oneOf)||!pe(e.anyOf)||!pe(e.allOf)),Mc=(e,t,r,n,s,o)=>{if(!pe(e)&&e.$ref!==void 0)return Mc(zt(o,e.$ref,o),t,r,n,s,o);if(YH(e)){const i=ma(r);return t.push(i),i}const a=en(e);if(a.length===0)return null;if(a.length>1){const i=ma(r);return t.push(i),i}if(r==="#"&&a[0]==="object"){const i=zb(s);if(t.push(i),e.properties&&zT(e.properties).length>1&&qH(i,n),!pe(e.properties)){const u=r+"/properties";Object.keys(e.properties).map(c=>{let d=e.properties[c];const f=`${u}/${Tc(c)}`;d.$ref!==void 0&&(d=zt(o,d.$ref,o)),Mc(d,i.elements,f,c,s,o)})}return i}switch(a[0]){case"object":case"array":case"string":case"number":case"integer":case"null":case"boolean":{const i=ma(r);return t.push(i),i}default:throw new Error("Unknown type: "+JSON.stringify(e))}},Ob=(e,t="VerticalLayout",r="#",n=e)=>GH(Mc(e,[],r,"",t,n),t),Ya={jsonSchema:Sb,uiSchema:Ob,controlElement:ma},Md="jsonforms/INIT",zd="jsonforms/UPDATE_CORE",Od="jsonforms/SET_AJV",Dd="jsonforms/UPDATE",Ld="jsonforms/UPDATE_ERRORS",JH="jsonforms/VALIDATE",Db="jsonforms/ADD_RENDERER",Lb="jsonforms/REMOVE_RENDERER",Fb="jsonforms/ADD_CELL",Bb="jsonforms/REMOVE_CELL",Fd="jsonforms/SET_CONFIG",Ub="jsonforms/ADD_UI_SCHEMA",Vb="jsonforms/REMOVE_UI_SCHEMA",Bd="jsonforms/SET_SCHEMA",Ud="jsonforms/SET_UISCHEMA",Vd="jsonforms/SET_VALIDATION_MODE",Wd="jsonforms/SET_LOCALE",Kd="jsonforms/SET_TRANSLATOR",Hd="jsonforms/UPDATE_I18N",Wb="jsonforms/ADD_DEFAULT_DATA",Kb="jsonforms/REMOVE_DEFAULT_DATA",ZH=e=>{if(!("type"in e)||typeof e.type!="string")return!1;switch(e.type){case"ADD":return"values"in e&&Array.isArray(e.values)&&e.values.length>0;case"REMOVE":return"indices"in e&&Array.isArray(e.indices)&&e.indices.length>0&&e.indices.every(t=>typeof t=="number");case"MOVE":return"moves"in e&&Array.isArray(e.moves)&&e.moves.length>0&&e.moves.every(t=>typeof t=="object"&&t!==null&&"from"in t&&"to"in t&&typeof t.from=="number"&&typeof t.to=="number");default:return!1}},QH=(e,t=Sb(e),r,n)=>({type:Md,data:e,schema:t,uischema:typeof r=="object"?r:Ob(t),options:n}),XH=(e,t,r,n)=>({type:zd,data:e,schema:t,uischema:r,options:n}),eG=(e,t)=>({type:Wb,schemaPath:e,data:t}),tG=e=>({type:Kb,schemaPath:e}),rG=e=>({type:Od,ajv:e}),Tn=(e,t,r)=>({type:Dd,path:e,updater:t,context:r}),nG=e=>({type:Ld,errors:e}),sG=(e,t)=>({type:Db,tester:e,renderer:t}),oG=(e,t)=>({type:Fb,tester:e,cell:t}),aG=(e,t)=>({type:Bb,tester:e,cell:t}),iG=(e,t)=>({type:Lb,tester:e,renderer:t}),lG=e=>({type:Fd,config:e}),cG=e=>({type:Vd,validationMode:e}),uG=(e,t)=>({type:Ub,tester:e,uischema:t}),dG=e=>({type:Vb,tester:e}),fG=e=>({type:Wd,locale:e}),hG=e=>({type:Bd,schema:e}),pG=(e,t)=>({type:Kd,translator:e,errorTranslator:t}),mG=(e,t,r)=>({type:Hd,locale:e,translator:t,errorTranslator:r}),gG=e=>({type:Ud,uischema:e});var _n=Object.freeze({__proto__:null,INIT:Md,UPDATE_CORE:zd,SET_AJV:Od,UPDATE_DATA:Dd,UPDATE_ERRORS:Ld,VALIDATE:JH,ADD_RENDERER:Db,REMOVE_RENDERER:Lb,ADD_CELL:Fb,REMOVE_CELL:Bb,SET_CONFIG:Fd,ADD_UI_SCHEMA:Ub,REMOVE_UI_SCHEMA:Vb,SET_SCHEMA:Bd,SET_UISCHEMA:Ud,SET_VALIDATION_MODE:Vd,SET_LOCALE:Wd,SET_TRANSLATOR:Kd,UPDATE_I18N:Hd,ADD_DEFAULT_DATA:Wb,REMOVE_DEFAULT_DATA:Kb,isUpdateArrayContext:ZH,init:QH,updateCore:XH,registerDefaultData:eG,unregisterDefaultData:tG,setAjv:rG,update:Tn,updateErrors:nG,registerRenderer:sG,registerCell:oG,unregisterCell:aG,unregisterRenderer:iG,setConfig:lG,setValidationMode:cG,registerUISchema:uG,unregisterUISchema:dG,setLocale:fG,setSchema:hG,setTranslator:pG,updateI18n:mG,setUISchema:gG});const vG={restrict:!1,trim:!1,showUnfocusedDescription:!1,hideRequiredAsterisk:!1},bm=(e={})=>wo({},vG,e),xm=(e=bm(),t)=>{switch(t.type){case Fd:return bm(t.config);default:return e}},yG={data:{},schema:{},uischema:void 0,errors:[],validator:void 0,ajv:void 0,validationMode:"ValidateAndShow",additionalErrors:[]},wm=(e,t)=>t&&bG(t.options)?t.options.validationMode:e.validationMode,bG=e=>e?e.validationMode!==void 0:!1,xG=e=>e?e.additionalErrors!==void 0:!1,km=(e,t)=>t&&xG(t.options)?t.options.additionalErrors:e.additionalErrors,_m=(e,t)=>{if(t){if(wG(t.options))return t.options.ajv;if(t.options!==void 0&&$A(t.options.compile))return t.options}return e.ajv?e.ajv:Mb()},wG=e=>e?e.ajv!==void 0:!1,El=(e=yG,t)=>{switch(t.type){case Md:{const r=_m(e,t),n=wm(e,t),s=n==="NoValidation"?void 0:r.compile(t.schema),o=sr(s,t.data),a=km(e,t);return{...e,data:t.data,schema:t.schema,uischema:t.uischema,additionalErrors:a,errors:o,validator:s,ajv:r,validationMode:n}}case zd:{const r=_m(e,t),n=wm(e,t);let s=e.validator,o=e.errors;e.schema!==t.schema||e.validationMode!==n||e.ajv!==r?(s=n==="NoValidation"?void 0:r.compile(t.schema),o=sr(s,t.data)):e.data!==t.data&&(o=sr(s,t.data));const a=km(e,t);return e.data!==t.data||e.schema!==t.schema||e.uischema!==t.uischema||e.ajv!==r||e.errors!==o||e.validator!==s||e.validationMode!==n||e.additionalErrors!==a?{...e,data:t.data,schema:t.schema,uischema:t.uischema,ajv:r,errors:Ky(o,e.errors)?e.errors:o,validator:s,validationMode:n,additionalErrors:a}:e}case Od:{const r=t.ajv,n=e.validationMode==="NoValidation"?void 0:r.compile(e.schema),s=sr(n,e.data);return{...e,validator:n,errors:s}}case Bd:{const n=t.schema&&e.ajv&&e.validationMode!=="NoValidation"?e.ajv.compile(t.schema):e.validator,s=sr(n,e.data);return{...e,validator:n,schema:t.schema,errors:s}}case Ud:return{...e,uischema:t.uischema};case Dd:{if(t.path===void 0||t.path===null)return e;if(t.path===""){const r=t.updater(Gs(e.data)),n=sr(e.validator,r);return{...e,data:r,errors:n}}else{const r=Qe(e.data,t.path),n=t.updater(Gs(r));let s;n!==void 0?s=gK(t.path,n,e.data===void 0?{}:e.data):s=IK(t.path,e.data===void 0?{}:e.data);const o=sr(e.validator,s);return{...e,data:s,errors:o}}}case Ld:return{...e,errors:t.errors};case Vd:{if(e.validationMode===t.validationMode)return e;if(t.validationMode==="NoValidation"){const r=sr(void 0,e.data);return{...e,errors:r,validationMode:t.validationMode}}if(e.validationMode==="NoValidation"){const r=e.ajv.compile(e.schema),n=sr(r,e.data);return{...e,validator:r,errors:n,validationMode:t.validationMode}}return{...e,validationMode:t.validationMode}}default:return e}};var tt;(function(e){e.addTooltip="addTooltip",e.addAriaLabel="addAriaLabel",e.removeTooltip="removeTooltip",e.upAriaLabel="upAriaLabel",e.downAriaLabel="downAriaLabel",e.noSelection="noSelection",e.removeAriaLabel="removeAriaLabel",e.noDataMessage="noDataMessage",e.deleteDialogTitle="deleteDialogTitle",e.deleteDialogMessage="deleteDialogMessage",e.deleteDialogAccept="deleteDialogAccept",e.deleteDialogDecline="deleteDialogDecline",e.up="up",e.down="down"})(tt||(tt={}));const kG=[{key:tt.addTooltip,default:e=>e?`Add to ${e}`:"Add"},{key:tt.addAriaLabel,default:e=>e?`Add to ${e} button`:"Add button"},{key:tt.removeTooltip,default:()=>"Delete"},{key:tt.removeAriaLabel,default:()=>"Delete button"},{key:tt.upAriaLabel,default:()=>"Move item up"},{key:tt.up,default:()=>"Up"},{key:tt.down,default:()=>"Down"},{key:tt.downAriaLabel,default:()=>"Move item down"},{key:tt.noDataMessage,default:()=>"No data"},{key:tt.noSelection,default:()=>"No selection"},{key:tt.deleteDialogTitle,default:()=>"Confirm Deletion"},{key:tt.deleteDialogMessage,default:()=>"Are you sure you want to delete the selected entry?"},{key:tt.deleteDialogAccept,default:()=>"Yes"},{key:tt.deleteDialogDecline,default:()=>"No"}];var In;(function(e){e.clearDialogTitle="clearDialogTitle",e.clearDialogMessage="clearDialogMessage",e.clearDialogAccept="clearDialogAccept",e.clearDialogDecline="clearDialogDecline"})(In||(In={}));In.clearDialogTitle,In.clearDialogMessage,In.clearDialogAccept,In.clearDialogDecline;const Gd=(e,t)=>Rb(t)?t.i18n:(e==null?void 0:e.i18n)??void 0,_G=e=>(e==null?void 0:e.split(".").filter(t=>!/^\d+$/.test(t)).join("."))||"root",Rr=(e,t,r)=>Gd(e,t)??_G(r),Ja=(e,t,r,n)=>`${Rr(e,t,r)}.${n}`,CG=(e,t)=>`${e}.${t}`,qd=(e,t)=>t,Yd=(e,t,r)=>{var i;const n=Ja(e.parentSchema,r,Ga(e),`error.${e.keyword}`),s=t(n,void 0,{error:e});if(s!==void 0)return s;const o=t(`error.${e.keyword}`,void 0,{error:e});if(o!==void 0)return o;const a=t(e.message,void 0,{error:e});return a!==void 0?a:e.keyword==="required"&&((i=e.message)!=null&&i.startsWith("must have required property"))?t("is a required property","is a required property",{error:e}):e.message},Hb=(e,t,r,n,s,o)=>{if(e.length>0&&r){const a=Ja(n,s,o,"error.custom"),i=r(a,void 0,{schema:n,uischema:s,path:o,errors:e});if(i!==void 0)return i}return HH(e.map(a=>t(a,r,s)))},Gb=(e,t)=>{if(e.label===!1||(e.label===void 0||e.label===null||e.label===!0)&&!Rb(e))return;const r=typeof e.label=="string"?e.label:JSON.stringify(e.label),n=Gd(void 0,e),s=typeof n=="string"?`${n}.label`:r;return t(s,r,{uischema:e})},$G=(e,t,r,n)=>{const s={};return t.forEach(o=>{const a=CG(r,o.key);s[o.key]=e(a,o.default(n))}),s},SG=e=>e===void 0?qd:e.translate,jG=e=>e===void 0?Yd:e.translateError,Yt=()=>e=>SG(Qe(e,"jsonforms.i18n")),qb=()=>e=>jG(Qe(e,"jsonforms.i18n")),Mn={locale:"en",translate:qd,translateError:Yd},Cm=(e=Mn,t)=>{switch(t.type){case Hd:{const r=t.locale??Mn.locale,n=t.translator??Mn.translate,s=t.errorTranslator??Mn.translateError;return r!==e.locale||n!==e.translate||s!==e.translateError?{...e,locale:r,translate:n,translateError:s}:e}case Kd:return{...e,translate:t.translator??qd,translateError:t.errorTranslator??Yd};case Wd:return{...e,locale:t.locale??navigator.languages[0]};default:return e}},Kn=-1,cr=e=>!pe(e)&&e.scope!==void 0,Ot=e=>(t,r,n)=>{if(pe(t)||!cr(t)||pe(r))return!1;const s=t.scope;if(pe(s))return!1;let o=r;return nt(r,"object")&&(o=zt(r,s,n==null?void 0:n.rootSchema)),o===void 0?!1:e(o,n==null?void 0:n.rootSchema)},Jd=(e,t)=>(r,n,s)=>{if(pe(r)||!cr(r))return!1;const o=r.scope;let a=n;return nt(n,"object")&&(a=zt(n,o,s==null?void 0:s.rootSchema)),a=Qe(a,e),a===void 0?!1:t(a,s==null?void 0:s.rootSchema)},hr=e=>Ot(t=>!pe(t)&&nt(t,e)),Pi=e=>Ot(t=>!pe(t)&&t.format===e&&nt(t,"string")),De=e=>t=>!pe(t)&&t.type===e,gr=(e,t)=>r=>{if(pe(r))return!1;const n=r.options;return!pe(n)&&n[e]===t},EG=e=>t=>{if(pe(t))return!1;const r=t.options;return!pe(r)&&!bH(r[e])},AG=e=>t=>pe(e)||!cr(t)?!1:VK(t.scope,e),NG=e=>t=>{if(pe(e)||!cr(t))return!1;const r=t.scope;return!pe(r)&&yK(r.split("/"))===e},Fe=(...e)=>(t,r,n)=>e.reduce((s,o)=>s&&o(t,r,n),!0),Co=(...e)=>(t,r,n)=>e.reduce((s,o)=>s||o(t,r,n),!1),Ve=(e,t)=>(r,n,s)=>t(r,n,s)?e:Kn,PG=(e,t)=>(r,n,s)=>{const o=t(r,n,s);return o===Kn?Kn:o+e},Yb=Fe(De("Control"),hr("boolean")),RG=Fe(De("Control"),hr("object")),TG=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"allOf"))),IG=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"anyOf"))),MG=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"oneOf"))),Zd=Fe(De("Control"),Ot(e=>LH(e))),Qd=Fe(De("Control"),Ot(e=>Ha(e))),Jb=Fe(De("Control"),hr("integer")),Zb=Fe(De("Control"),hr("number")),Qb=Fe(De("Control"),hr("string")),Xb=Fe(De("Control"),gr("multi",!0)),ex=Fe(De("Control"),Co(Pi("date"),gr("format","date"))),tx=Fe(De("Control"),Co(Pi("time"),gr("format","time"))),rx=Fe(De("Control"),Co(Pi("date-time"),gr("format","date-time"))),nx=Fe(Ot((e,t)=>nt(e,"array")&&!Array.isArray(zt(e,"items",t))),Jd("items",(e,t)=>{const r=e.$ref?zt(t,e.$ref,t):e;return nt(r,"object")})),sx=Fe(De("Control"),nx),Os=(e,t,r)=>{if(K0(e))return Rc(e,(n,s)=>n||Os(s,t,r),!1);if(t(e))return!0;if(e.$ref){const n=zt(r,e.$ref,r);if(n&&!n.$ref)return Os(n,t,r)}return e.items?Os(e.items,t,r):e.properties?Rc(gH(e.properties),(n,[s,o])=>n||Os(o,t,r),!1):!1},ox=(e,t,r)=>{if(!De("Control")(e,t,r))return!1;const n=e.scope,s=zt(t,n,(r==null?void 0:r.rootSchema)??t);let o=0;if(s!==void 0&&s.items!==void 0){if(Os(s.items,a=>a===t||a.$ref!==void 0?!1:!!(a.anyOf||a.allOf||a.oneOf&&!Ha(a)||nt(a,"object")&&(o++,o===2)||nt(a,"array")),r==null?void 0:r.rootSchema))return!0;if(e.options&&e.options.detail){if(typeof e.options.detail=="string")return e.options.detail.toUpperCase()!=="DEFAULT";if(typeof e.options.detail=="object"&&e.options.detail.type)return!0}}return!1},zG=sx,OG=Fe(De("Control"),Ot((e,t)=>en(e).length!==0&&!Array.isArray(zt(e,"items",t))),Jd("items",(e,t)=>{const r=e.$ref?zt(t,e.$ref,t):e,n=en(r);return n.length===1&&Bv(["integer","number","boolean","string"],n[0])})),ax=Fe(De("Control"),Co(hr("number"),hr("integer")),Ot(e=>Object.prototype.hasOwnProperty.call(e,"maximum")&&Object.prototype.hasOwnProperty.call(e,"minimum")&&Object.prototype.hasOwnProperty.call(e,"default")),gr("slider",!0)),DG=Fe(De("Control"),hr("integer"),gr("format",!0)),ix=e=>e.type==="Categorization",lx=e=>e.type==="Category",Xd=e=>pe(e.elements)?!1:e.elements.map(t=>ix(t)?Xd(t):lx(t)).reduce((t,r)=>t&&r,!0),LG=e=>Xd(e),FG=e=>(t,r,n)=>!e(t,r,n);var BG=Object.freeze({__proto__:null,NOT_APPLICABLE:Kn,isControl:cr,schemaMatches:Ot,schemaSubPathMatches:Jd,schemaTypeIs:hr,formatIs:Pi,uiTypeIs:De,optionIs:gr,hasOption:EG,scopeEndsWith:AG,scopeEndIs:NG,and:Fe,or:Co,rankWith:Ve,withIncreasedRank:PG,isBooleanControl:Yb,isObjectControl:RG,isAllOfControl:TG,isAnyOfControl:IG,isOneOfControl:MG,isEnumControl:Zd,isOneOfEnumControl:Qd,isIntegerControl:Jb,isNumberControl:Zb,isStringControl:Qb,isMultiLineControl:Xb,isDateControl:ex,isTimeControl:tx,isDateTimeControl:rx,isObjectArray:nx,isObjectArrayControl:sx,isObjectArrayWithNesting:ox,isArrayObjectControl:zG,isPrimitiveArrayControl:OG,isRangeControl:ax,isNumberFormatControl:DG,isCategorization:ix,isCategory:lx,hasCategory:Xd,categorizationHasCategory:LG,not:FG});const UG=e=>(t,r,n)=>{const s=ki(e,o=>o.tester(t,r,n));if(s!==void 0&&s.tester(t,r,n)!==Kn)return s.uischema},VG=(e,t,r,n,s="VerticalLayout",o,a)=>{if(o&&o.options&&o.options.detail){if(typeof o.options.detail=="string"){if(o.options.detail.toUpperCase()==="GENERATE")return typeof s=="function"?s():Ya.uiSchema(t,s,void 0,a)}else if(typeof o.options.detail=="object"&&o.options.detail.type&&typeof o.options.detail.type=="string")return o.options.detail}const i=UG(e)(t,r,n);return i===void 0?typeof s=="function"?s():Ya.uiSchema(t,s,"#",a):i},$m=(e,t,r)=>r(e,t),cx=(e,t,r)=>n=>{const s=n.errors??[],o=n.additionalErrors??[];return VH(e,t,r)(n.validationMode==="ValidateAndHide"?o:[...s,...o])},WG=(e,t)=>cx(e,t,r=>r===e),KG=(e,t)=>cx(e,t,r=>r.startsWith(e+".")),ux=(e,t)=>r=>WG(e,t)(r.jsonforms.core),HG=(e,t)=>r=>KG(e,t)(r.jsonforms.core),Ri=e=>qG(Qe(e,"jsonforms.core")),Za=e=>YG(Qe(e,"jsonforms.core")),GG=e=>JG(Qe(e,"jsonforms.core")),as=e=>ZG(Qe(e,"jsonforms.core")),ef=e=>Qe(e,"jsonforms.renderers"),tf=e=>Qe(e,"jsonforms.cells"),qG=e=>Qe(e,"data"),YG=e=>Qe(e,"schema"),JG=e=>Qe(e,"uischema"),ZG=e=>Qe(e,"ajv"),pr=e=>e.jsonforms.config,rf=(e,t,r,n,s,o)=>{var a,i,u;return(a=e==null?void 0:e.jsonforms)!=null&&a.readonly?!1:r&&OH(r)?DH(r,s,t==null?void 0:t.path,as(e),o):typeof((i=r==null?void 0:r.options)==null?void 0:i.readonly)=="boolean"?!r.options.readonly:typeof((u=r==null?void 0:r.options)==null?void 0:u.readOnly)=="boolean"?!r.options.readOnly:typeof(o==null?void 0:o.readonly)=="boolean"?!o.readonly:typeof(o==null?void 0:o.readOnly)=="boolean"?!o.readOnly:(n==null?void 0:n.readOnly)===!0?!1:typeof(t==null?void 0:t.enabled)=="boolean"?t.enabled:!0},dx=(e,t,r)=>{const n=t+r;if(n<0||n>=e.length)return;const s=[t,n].sort((o,a)=>o-a);e.splice(s[0],2,e[s[1]],e[s[0]])},QG=(e,t)=>{dx(e,t,-1)},XG=(e,t)=>{dx(e,t,1)},eq=(e,t,r)=>{const n=t.split("/"),s=ko(n[n.length-1]),a=n.slice(0,n.length-2).join("/"),i=qt.schema(e,a,r);return i!==void 0&&i.required!==void 0&&i.required.indexOf(s)!==-1},fx=(e,t,r)=>`${e??""}${t&&!r?"*":""}`,hx=(e,t)=>{const r=px(e,t);return r===void 0?{}:r},px=(e,t)=>{const r=typeof e.$ref=="string"?qt.schema(t,e.$ref,t):e;if(r.default!==void 0)return Sm(r,t);if(nt(r,"string"))return r.format==="date-time"||r.format==="date"||r.format==="time"?FH(new Date,r.format):"";if(nt(r,"integer")||nt(r,"number"))return 0;if(nt(r,"boolean"))return!1;if(nt(r,"array"))return[];if(nt(r,"object"))return Sm(r,t);if(nt(r,"null"))return null;const n=["oneOf","anyOf","allOf"];for(const s of n)if(e[s]&&Array.isArray(e[s])){const o=tq(e[s],t);if(o!==void 0)return o}},tq=(e,t)=>{if(e.length>0)for(const r of e){const n=px(r,t);if(n!==void 0)return n}},Sm=(e,t)=>{if(nt(e,"object")&&e.default===void 0){const r={};for(const n in e.properties){const s=e.properties[n],o=s.$ref?qt.schema(t,s.$ref,t):s;o&&o.default!==void 0&&(r[n]=Gs(o.default))}return e.allOf&&Array.isArray(e.allOf)&&e.allOf.forEach(n=>{if(n&&n.properties)for(const s in n.properties){const o=n.properties[s],a=o.$ref?qt.schema(t,o.$ref,t):o;a&&a.default!==void 0&&(r[s]=Gs(a.default))}}),r}return Gs(e.default)},mx=(e,t,r,n)=>t===void 0||t!==void 0&&!e||!n&&!r,Qa=(e,t,r)=>{let n=typeof e=="string"?e:JSON.stringify(e);return t&&(r?n=t(`${r}.${n}`,n):n=t(n,n)),{label:n,value:e}},gx=(e,t,r)=>{let n=e.title??(typeof e.const=="string"?e.const:JSON.stringify(e.const));return t&&(e.i18n?n=t(e.i18n,n):r?n=t(`${r}.${n}`,n):n=t(n,n)),{label:n,value:e.const}},Ti=(e,t)=>{const{uischema:r}=t,n=Ri(e),s=Pb(r,t.path),o=pr(e),a=t.visible===void 0||Id(r)?_o(r,n,t.path,as(e),o):t.visible,i=r,u=t.id,c=Za(e),d=i.scope!==void 0&&eq(t.schema,i.scope,c),f=qt.schema(t.schema||c,i.scope,c),p=ux(s,f)(e),h=f!==void 0?f.description:"",g=qt.data(n,s),m=Ab(r,f),v=m.show?m.text:"",y=rf(e,t,r,f||c,n,o),b=f??c,_=Yt()(e),w=qb()(e),$=Rr(b,r,s),R=_(Ja(b,r,s,"label"),v,{schema:b,uischema:r,path:s,errors:p}),M=_(Ja(b,r,s,"description"),h,{schema:b,uischema:r,path:s,errors:p}),D=Hb(p,w,_,b,r,s);return{data:g,description:M,errors:D,label:R,visible:a,enabled:y,id:u,path:s,required:d,uischema:r,schema:b,config:pr(e),cells:t.cells||e.jsonforms.cells,rootSchema:c,i18nKeyPrefix:$}},rq=e=>({handleChange(t,r){e(Tn(t,()=>r))}}),nq=(e,t)=>{var s;const r=Ti(e,t),n=t.options||((s=r.schema.enum)==null?void 0:s.map(o=>Qa(o,Yt()(e),Rr(r.schema,r.uischema,r.path))))||r.schema.const&&[Qa(r.schema.const,Yt()(e),Rr(r.schema,r.uischema,r.path))];return{...r,options:n}},sq=(e,t)=>{var s;const r=Ti(e,t),n=t.options||((s=r.schema.oneOf)==null?void 0:s.map(o=>gx(o,Yt()(e),Rr(r.schema,r.uischema,r.path))));return{...r,options:n}},oq=(e,t)=>{const{...r}=Ti(e,t);return{...r,uischemas:e.jsonforms.uischemas}},aq=(e,t)=>{const{path:r,schema:n,uischema:s,label:o,...a}=oq(e,t),i=qt.schema(n,"items",a.rootSchema),u=HG(r,i)(e);return{...a,label:o,path:r,uischema:s,schema:i,arraySchema:n,childErrors:u,renderers:t.renderers||ef(e),cells:t.cells||tf(e)}},iq=e=>({addItem:(t,r)=>()=>{e(Tn(t,n=>n==null?[r]:(n.push(r),n),{type:"ADD",values:[r]}))},removeItems:(t,r)=>()=>{e(Tn(t,n=>(r.sort((s,o)=>s-o).reverse().forEach(s=>n.splice(s,1)),n),{type:"REMOVE",indices:r}))},moveUp:(t,r)=>()=>{e(Tn(t,n=>(QG(n,r),n),{type:"MOVE",moves:[{from:r,to:r-1}]}))},moveDown:(t,r)=>()=>{e(Tn(t,n=>(XG(n,r),n),{type:"MOVE",moves:[{from:r,to:r+1}]}))}}),vx={visible:!0,enabled:!0,path:"",direction:"column"},lq=e=>e.type==="HorizontalLayout"?"row":e.type==="VerticalLayout"?"column":vx.direction,cq=(e,t)=>{const r=Ri(e),{uischema:n}=t,s=t.visible===void 0||Id(n)?_o(t.uischema,r,t.path,as(e),pr(e)):t.visible,o=qt.data(r,t.path),a=pr(e),i=rf(e,t,n,void 0,r,a),u=Yt()(e),c=AH(n)?Gb(n,u):void 0;return{...vx,renderers:t.renderers||ef(e),cells:t.cells||tf(e),visible:s,enabled:i,path:t.path,data:o,uischema:t.uischema,schema:t.schema,direction:t.direction??lq(n),config:a,label:c}},uq=(e,t)=>({renderers:t.renderers||Qe(e.jsonforms,"renderers"),cells:t.cells||Qe(e.jsonforms,"cells"),schema:t.schema||Za(e),rootSchema:Za(e),uischema:t.uischema||GG(e),path:t.path,enabled:t.enabled,config:pr(e)}),dq=(e,t)=>{const{uischema:r}=t,n=t.visible===void 0||Id(r)?_o(t.uischema,Ri(e),t.path,as(e),pr(e)):t.visible,s=r.text,o=Yt()(e),a=Gd(void 0,r),i=a?`${a}.text`:s??"";return{text:o(i,s,{uischema:r}),visible:n,config:pr(e),renderers:t.renderers||ef(e),cells:t.cells||tf(e),uischema:r}},Ii=(e,t)=>{const{id:r,schema:n,path:s,uischema:o,renderers:a,cells:i}=t,u=Ri(e),c=pr(e),d=t.visible!==void 0?t.visible:_o(o,u,void 0,as(e),c),f=Za(e);let p;e.jsonforms.readonly===!0?p=!1:typeof t.enabled=="boolean"?p=t.enabled:p=rf(e,t,o,n||f,u,c);const h=Yt()(e),g=qb()(e),m=Hb(ux(s,n)(e),g,h,n,o,s),v=pe(m);return{data:qt.data(u,s),visible:d,enabled:p,id:r,path:s,errors:m,isValid:v,schema:n,uischema:o,config:pr(e),rootSchema:f,renderers:a,cells:i}},fq=(e,t)=>{const r=Ii(e,t),{renderers:n,cells:s,...o}=t;return{...r,...o,cells:s||e.jsonforms.cells||[]}},hq=(e,t)=>{var s;const r=Ii(e,t),n=t.options||((s=r.schema.enum)==null?void 0:s.map(o=>Qa(o,Yt()(e),Rr(r.schema,r.uischema,r.path))))||r.schema.const&&[Qa(r.schema.const,Yt()(e),Rr(r.schema,r.uischema,r.path))];return{...r,options:n}},pq=(e,t)=>{var s;const r=Ii(e,t),n=t.options||((s=r.schema.oneOf)==null?void 0:s.map(o=>gx(o,Yt()(e),Rr(r.schema,r.uischema,r.path))));return{...r,options:n}};var mq=ut,gq=function(){return mq.Date.now()},vq=gq,yq=xt,Al=vq,jm=Mv,bq="Expected a function",xq=Math.max,wq=Math.min;function kq(e,t,r){var n,s,o,a,i,u,c=0,d=!1,f=!1,p=!0;if(typeof e!="function")throw new TypeError(bq);t=jm(t)||0,yq(r)&&(d=!!r.leading,f="maxWait"in r,o=f?xq(jm(r.maxWait)||0,t):o,p="trailing"in r?!!r.trailing:p);function h(R){var M=n,D=s;return n=s=void 0,c=R,a=e.apply(D,M),a}function g(R){return c=R,i=setTimeout(y,t),d?h(R):a}function m(R){var M=R-u,D=R-c,j=t-M;return f?wq(j,o-D):j}function v(R){var M=R-u,D=R-c;return u===void 0||M>=t||M<0||f&&D>=o}function y(){var R=Al();if(v(R))return b(R);i=setTimeout(y,m(R))}function b(R){return i=void 0,p&&n?h(R):(n=s=void 0,a)}function _(){i!==void 0&&clearTimeout(i),c=0,n=u=s=i=void 0}function w(){return i===void 0?a:b(Al())}function $(){var R=Al(),M=v(R);if(n=arguments,s=this,u=R,M){if(i===void 0)return g(u);if(f)return clearTimeout(i),i=setTimeout(y,t),h(u)}return i===void 0&&(i=setTimeout(y,t)),a}return $.cancel=_,$.flush=w,$}var _q=kq;const Cq=Se(_q);class $q extends U.Component{constructor(t){super(t)}}class Sq extends $q{constructor(t){super(t),this.handleChange=r=>{this.setState({value:r}),this.updateData(r)},this.onFocus=()=>{this.setState({isFocused:!0})},this.onBlur=()=>{this.setState({isFocused:!1})},this.updateData=r=>{this.props.handleChange(this.props.path,r)},this.state={value:t.data?t.data:"",isFocused:!1}}}class yx extends x.Component{render(){return U.createElement("div",{style:{color:"red"}},"No applicable ",this.props.type," found.")}}const jq={data:{},schema:{},uischema:void 0,errors:[],additionalErrors:[],validator:void 0,ajv:void 0},bx=U.createContext({core:jq,renderers:[]}),Eq=(e,t)=>{const r=x.useRef(!0);x.useEffect(()=>{if(r.current){r.current=!1;return}e()},t)},Aq=({children:e,initState:t,onChange:r,middleware:n})=>{var $,R,M;const{data:s,schema:o,uischema:a,ajv:i,validationMode:u,additionalErrors:c}=t.core,d=x.useRef(n??$m);d.current=n??$m;const[f,p]=x.useState(()=>d.current(t.core,_n.init(s,o,a,{ajv:i,validationMode:u,additionalErrors:c}),El));x.useEffect(()=>p(D=>d.current(D,_n.updateCore(s,o,a,{ajv:i,validationMode:u,additionalErrors:c}),El)),[s,o,a,i,u,c]);const[h,g]=x.useReducer(xm,void 0,()=>xm(void 0,_n.setConfig(t.config)));Eq(()=>{g(_n.setConfig(t.config))},[t.config]);const[m,v]=x.useReducer(Cm,void 0,()=>{var D,j,S;return Cm(t.i18n,_n.updateI18n((D=t.i18n)==null?void 0:D.locale,(j=t.i18n)==null?void 0:j.translate,(S=t.i18n)==null?void 0:S.translateError))});x.useEffect(()=>{var D,j,S;v(_n.updateI18n((D=t.i18n)==null?void 0:D.locale,(j=t.i18n)==null?void 0:j.translate,(S=t.i18n)==null?void 0:S.translateError))},[($=t.i18n)==null?void 0:$.locale,(R=t.i18n)==null?void 0:R.translate,(M=t.i18n)==null?void 0:M.translateError]);const y=x.useCallback(D=>{p(j=>d.current(j,D,El))},[]),b=x.useMemo(()=>({core:f,renderers:t.renderers,cells:t.cells,config:h,uischemas:t.uischemas,readonly:t.readonly,i18n:m,dispatch:y}),[f,t.renderers,t.cells,h,t.uischemas,t.readonly,m]),_=x.useRef(r);x.useEffect(()=>{_.current=r},[r]);const w=x.useCallback(Cq((...D)=>{var j;return(j=_.current)==null?void 0:j.call(_,...D)},10),[]);return x.useEffect(()=>{w({data:f.data,errors:f.errors})},[f.data,f.errors]),U.createElement(bx.Provider,{value:b},e)},$o=()=>x.useContext(bx),Nq=(e,t)=>aq({jsonforms:{...e}},t),Pq=(e,t)=>cq({jsonforms:{...e}},t),Rq=(e,t)=>Ti({jsonforms:{...e}},t),Tq=(e,t)=>{var s;const r=nq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},Iq=(e,t)=>{var s;const r=sq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},zr=e=>x.useMemo(()=>rq(e),[e]),Mq=(e,t)=>uq({jsonforms:{...e}},t),zq=e=>({...zr(e),...x.useMemo(()=>iq(e),[e])}),Oq=(e,t)=>Ii({jsonforms:{...e}},t),Dq=(e,t)=>{var s;const r=hq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},Lq=(e,t)=>{var s;const r=pq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},Fq=(e,t)=>fq({jsonforms:{...e}},t),Bq=(e,t)=>dq({jsonforms:{...e}},t),Dt=e=>function(r){const n=$o();return U.createElement(e,{ctx:n,props:r})},Uq=e=>function({ctx:r,props:n}){const s=Mq(r,n);return U.createElement(e,{...n,...s})},Vq=e=>function({ctx:r,props:n}){const s=Rq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...s,...o})},Wq=e=>function({ctx:r,props:n}){const s=Pq(r,n);return U.createElement(e,{...n,...s})},Kq=e=>function({ctx:r,props:n}){const s=Nq(r,n),o=zq(r.dispatch);return U.createElement(e,{...n,...s,...o})},Hq=e=>function({ctx:r,props:n}){const s=Oq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},Gq=e=>function({ctx:r,props:n}){const s=Fq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},qq=e=>function({ctx:r,props:n}){const s=Dq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},Yq=e=>function({ctx:r,props:n}){const s=Tq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},Jq=e=>function({ctx:r,props:n}){const s=Lq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},Zq=e=>function({ctx:r,props:n}){const s=Iq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},Qq=e=>function({ctx:r,props:n}){const s=Bq(r,n);return U.createElement(e,{...n,...s})},xx=(e,t=!0)=>Dt(Uq(t?U.memo(e):e)),Xq=(e,t=!0)=>Dt(Vq(t?U.memo(e):e)),Mi=(e,t=!0)=>Dt(Wq(t?U.memo(e):e)),wx=(e,t=!0)=>Dt(Kq(t?U.memo(e):e)),Qt=(e,t=!0)=>Dt(Hq(t?U.memo(e):e)),eY=(e,t=!0)=>Dt(Gq(t?U.memo(e):e)),tY=(e,t=!0)=>Dt(qq(t?U.memo(e):e)),rY=(e,t=!0)=>Dt(Yq(t?U.memo(e):e)),nY=(e,t=!0)=>Dt(Jq(t?U.memo(e):e)),sY=(e,t=!0)=>Dt(Zq(t?U.memo(e):e)),oY=(e,t=!0)=>Dt(Qq(t?U.memo(e):e)),So=e=>function(r){var a,i;const n=$o(),s=((a=n.i18n)==null?void 0:a.locale)??Mn.locale,o=((i=n.i18n)==null?void 0:i.translate)??Mn.translate;return U.createElement(e,{...r,locale:s,t:o})},kx=e=>function(r){const n=x.useMemo(()=>$G(r.t,kG,r.i18nKeyPrefix,r.label),[r.t,r.i18nKeyPrefix,r.label]);return U.createElement(e,{...r,translations:n})};class _x extends U.Component{constructor(t){super(t),this.state={id:cr(t.uischema)?vm(t.uischema.scope):void 0}}componentWillUnmount(){cr(this.props.uischema)&&ym(this.state.id)}componentDidUpdate(t){t.schema!==this.props.schema&&(ym(this.state.id),this.setState({id:cr(this.props.uischema)?vm(this.props.uischema.scope):void 0}))}render(){const{schema:t,rootSchema:r,uischema:n,path:s,enabled:o,renderers:a,cells:i,config:u}=this.props;return U.createElement(aY,{uischema:n,schema:t,rootSchema:r,path:s,enabled:o,renderers:a,cells:i,id:this.state.id,config:u})}}const aY=U.memo(function(t){const r=x.useMemo(()=>({rootSchema:t.rootSchema,config:t.config}),[t.rootSchema,t.config]),n=x.useMemo(()=>ki(t.renderers,s=>s.tester(t.uischema,t.schema,r)),[t.renderers,t.uischema,t.schema,r]);if(n===void 0||n.tester(t.uischema,t.schema,r)===-1)return U.createElement(yx,{type:"renderer"});{const s=n.renderer;return U.createElement(s,{uischema:t.uischema,schema:t.schema,path:t.path,enabled:t.enabled,renderers:t.renderers,cells:t.cells,id:t.id})}});class iY extends _x{constructor(t){super(t)}}const zi=xx(_x);xx(iY);const lY=e=>{const{ajv:t,data:r,schema:n,uischema:s,renderers:o,cells:a,onChange:i,config:u,uischemas:c,readonly:d,validationMode:f,i18n:p,additionalErrors:h,middleware:g}=e,m=x.useMemo(()=>n!==void 0?n:Ya.jsonSchema(r),[n,r]),v=x.useMemo(()=>typeof s=="object"?s:Ya.uiSchema(m,void 0,void 0,m),[s,m]);return U.createElement(Aq,{initState:{core:{ajv:t,data:r,schema:m,uischema:v,validationMode:f,additionalErrors:h},config:u,uischemas:c,renderers:o,cells:a,readonly:d,i18n:p},onChange:i,middleware:g},U.createElement(zi,null))},cY=({uischema:e,schema:t,rootSchema:r,path:n,cells:s,id:o,enabled:a,renderers:i,config:u})=>{const c=x.useMemo(()=>({rootSchema:r,config:u}),[r,u]),d=x.useMemo(()=>ki(s,f=>f.tester(e,t,c)),[s,e,t,c]);if(d===void 0||d.tester(e,t,c)===-1)return U.createElement(yx,{type:"cell"});{const f=d.cell;return U.createElement(f,{uischema:e,schema:t,enabled:a,path:n,id:o,renderers:i,cells:s})}},zc=eY(cY);var uY=Array.prototype,dY=uY.join;function fY(e,t){return e==null?"":dY.call(e,t)}var hY=fY;const Cx=Se(hY);var pY=hn,$x=pY("filter",Wy);$x.placeholder=Mr();var mY=$x;const Em=Se(mY);var Nl,Am;function gY(){if(Am)return Nl;Am=1;var e=pd,t=mr;function r(n,s){var o=-1,a=t(n)?Array(n.length):[];return e(n,function(i,u,c){a[++o]=s(i,u,c)}),a}return Nl=r,Nl}var Pl,Nm;function vY(){if(Nm)return Pl;Nm=1;var e=ho,t=fn,r=gY(),n=Ue;function s(o,a){var i=n(o)?e:r;return i(o,t(a))}return Pl=s,Pl}var yY=hn,Sx=yY("map",vY());Sx.placeholder=Mr();var bY=Sx;const Pm=Se(bY);var Rl,Rm;function xY(){if(Rm)return Rl;Rm=1;var e=Sd(),t=kb,r=$d(),n=hb(),s=Ue,o=pb(),a="Expected a function",i=8,u=32,c=128,d=256;function f(p){return t(function(h){var g=h.length,m=g,v=e.prototype.thru;for(p&&h.reverse();m--;){var y=h[m];if(typeof y!="function")throw new TypeError(a);if(v&&!b&&n(y)=="wrapper")var b=new e([],!0)}for(m=b?m:g;++m<g;){y=h[m];var _=n(y),w=_=="wrapper"?r(y):void 0;w&&o(w[0])&&w[1]==(c|i|u|d)&&!w[4].length&&w[9]==1?b=b[n(w[0])].apply(b,w[3]):b=y.length==1&&o(y)?b[_]():b.thru(y)}return function(){var $=arguments,R=$[0];if(b&&$.length==1&&s(R))return b.plant(R).value();for(var M=0,D=g?h[M].apply(this,$):R;++M<g;)D=h[M].call(this,D);return D}})}return Rl=f,Rl}var Tl,Tm;function wY(){if(Tm)return Tl;Tm=1;var e=xY(),t=e();return Tl=t,Tl}var kY=hn,jx=kY("flow",wY());jx.placeholder=Mr();var _Y=jx;const Im=Se(_Y);var Il,Mm;function Ex(){return Mm||(Mm=1,Il={cap:!1,curry:!1,fixed:!1,immutable:!1,rearg:!1}),Il}var CY=hn,Ax=CY("keys",Jt,Ex());Ax.placeholder=Mr();var $Y=Ax;const zm=Se($Y);var SY=hn,Nx=SY("startCase",Rv,Ex());Nx.placeholder=Mr();var jY=Nx;const EY=Se(jY),Px={"enum.none":"None"},qs=e=>(t,...r)=>{const n=Wa(e,s=>s.name===t);return Rc(n,(s,o)=>typeof o.classNames=="function"?s.concat(o.classNames(r)):s.concat(o.classNames),[])},It=e=>(t,...r)=>Cx(qs(e)(t,r)," "),AY=[{name:"control",classNames:["control"]},{name:"control.trim",classNames:["trim"]},{name:"control.input",classNames:["input"]},{name:"control.select",classNames:["select"]},{name:"control.checkbox",classNames:["checkbox"]},{name:"control.radio",classNames:["radio"]},{name:"control.radio.option",classNames:["radio-option"]},{name:"control.radio.input",classNames:["radio-input"]},{name:"control.radio.label",classNames:["radio-label"]},{name:"control.validation.error",classNames:["validation_error"]},{name:"control.validation",classNames:["validation"]},{name:"categorization",classNames:["categorization"]},{name:"categorization.master",classNames:["categorization-master"]},{name:"categorization.detail",classNames:["categorization-detail"]},{name:"category.group",classNames:["category-group"]},{name:"category.subcategories",classNames:["category-subcategories"]},{name:"array.layout",classNames:["array-layout"]},{name:"array.children",classNames:["children"]},{name:"group.layout",classNames:["group-layout"]},{name:"horizontal.layout",classNames:["horizontal-layout"]},{name:"horizontal.layout.item",classNames:([e])=>[`horizontal-layout-${e}`]},{name:"vertical.layout",classNames:["vertical-layout"]},{name:"array.table.validation.error",classNames:["validation_error"]},{name:"array.table.validation",classNames:["validation"]},{name:"array.table",classNames:["array-table-layout","control"]},{name:"array.control.validation.error",classNames:["validation_error"]},{name:"array.control.validation",classNames:["validation"]},{name:"array.control.add",classNames:["button-add"]},{name:"array.child.controls",classNames:["child-controls"]},{name:"array.child.controls.up",classNames:["button-up"]},{name:"array.child.controls.down",classNames:["button-down"]},{name:"array.child.controls.delete",classNames:["button-delete"]},{name:"array.control",classNames:["array-control-layout","control"]},{name:"input.description",classNames:["input-description"]}],NY={styles:AY},PY=U.createContext(NY),RY=()=>x.useContext(PY),nf=()=>{const{styles:e}=RY();return e},Xt=e=>function(r){const n=$o(),s=nf(),o=r.uischema,a=n.config,i=a&&a.trim,u=x.useMemo(()=>qs(s)("control"),[s]);let c=pe(o.scope)?[""]:u.concat([`${Ib(o.scope)}`]);i&&(c=c.concat(qs(s)("control.trim")));const d=pe(r.errors),f=x.useMemo(()=>It(s)("control.label"),[s]),p=x.useMemo(()=>It(s)("input.description"),[s]),h=x.useMemo(()=>It(s)("control.validation"),[s]),g=x.useMemo(()=>It(s)("control.validation.error"),[s]),m=["validate"].concat(d?"valid":"invalid"),v=x.useMemo(()=>It(s),[s]),y=x.useMemo(()=>qs(s),[s]),b=c.join(" "),_=m.join(" "),w=x.useMemo(()=>({wrapper:b,input:_,label:f,description:p,validation:h,validationError:g}),[b,_,f,p,h,g]);return U.createElement(e,{...r,getStyleAsClassName:v,getStyle:y,classNames:w})},sf=e=>t=>function(n){const s=["validate"].concat(n.isValid?"valid":"invalid"),o=nf(),a=It(o)(e);return a&&s.push(a),U.createElement(t,{...n,getStyleAsClassName:It(o),getStyle:qs(o),className:s.join(" ")})},TY=e=>function(r){const n=$o(),s=as({jsonforms:{...n}});return U.createElement(e,{...r,ajv:s})},vr=sf("control.input"),Rx=sf("control.select"),IY=sf("control.checkbox");class MY extends Sq{render(){const{classNames:t,description:r,id:n,errors:s,label:o,uischema:a,schema:i,rootSchema:u,visible:c,enabled:d,required:f,path:p,cells:h,config:g}=this.props,m=s.length===0,v=[t.validation].concat(m?t.description:t.validationError).join(" "),y=wo({},g,a.options),b=!mx(c,r,this.state.isFocused,y.showUnfocusedDescription),_={rootSchema:u,config:g},w=ki(h,$=>$.tester(a,i,_));return w===void 0||w.tester(a,i,_)===Kn?(console.warn("No applicable cell found.",a,i),null):U.createElement("div",{className:t.wrapper,hidden:!c,onFocus:this.onFocus,onBlur:this.onBlur,id:n},U.createElement("label",{htmlFor:n+"-input",className:t.label},fx(o,f,y.hideRequiredAsterisk)),U.createElement(zc,{uischema:a,schema:i,path:p,id:n+"-input",enabled:d}),U.createElement("div",{className:v},m?b?r:null:s))}}const zY=Ve(1,cr);var OY=Xt(Xq(MY));const Tx=({classNames:e,id:t,label:r,options:n,required:s,description:o,errors:a,data:i,uischema:u,visible:c,config:d,enabled:f,path:p,handleChange:h})=>{const g=nf(),[m,v]=x.useState(!1),y=x.useMemo(()=>It(g)("control.radio"),[g]),b=x.useMemo(()=>It(g)("control.radio.option"),[g]),_=x.useMemo(()=>It(g)("control.radio.input"),[g]),w=x.useMemo(()=>It(g)("control.radio.label"),[g]),$=a.length===0,R=[e.validation].concat($?e.description:e.validationError).join(" "),M=wo({},d,u.options),D=!mx(c,o,m,M.showUnfocusedDescription),j=!y||y==="radio";let S={};return j&&(S={display:"flex",flexDirection:M.orientation==="vertical"?"column":"row"}),U.createElement("div",{className:e.wrapper,hidden:!c,onFocus:()=>v(!0),onBlur:()=>v(!1)},U.createElement("label",{htmlFor:t,className:e.label},fx(r,s,M.hideRequiredAsterisk)),U.createElement("div",{className:y,style:S},n.map(E=>U.createElement("div",{key:E.label,className:b},U.createElement("input",{type:"radio",value:E.value,id:E.value,name:t,checked:i===E.value,onChange:P=>h(p,E.value),disabled:!f,className:_}),U.createElement("label",{htmlFor:E.value,className:w},E.label)))),U.createElement("div",{className:R},$?D?o:null:a))},DY=e=>U.createElement(Tx,{...e}),LY=Ve(3,Fe(Zd,gr("format","radio")));var FY=Xt(rY(DY));const BY=e=>U.createElement(Tx,{...e}),UY=Ve(3,Fe(Qd,gr("format","radio")));var VY=Xt(sY(BY));const{convertToValidClassName:WY}=qa,KY=({classNames:e,data:t,label:r,path:n,schema:s,errors:o,addItem:a,removeItems:i,moveUp:u,moveDown:c,uischema:d,uischemas:f,getStyleAsClassName:p,renderers:h,rootSchema:g,translations:m,enabled:v})=>{const y=d,b=x.useMemo(()=>VG(f,s,d.scope,n,void 0,d,g),[f,s,d.scope,n,d,g]),_=o.length===0,$=[p("array.control.validation")].concat(_?"":p("array.control.validation.error")).join(" "),R=p("array.control.add"),M=p("array.control.label"),D=p("array.child.controls"),j=p("array.child.controls.up"),S=p("array.child.controls.down"),E=p("array.child.controls.delete"),P=[p("array.control"),WY(y.scope)].join(" ");return U.createElement("div",{className:P},U.createElement("header",null,U.createElement("label",{className:M},r),U.createElement("button",{type:"button",className:R,disabled:!v,onClick:a(n,hx(s,g))},"Add to ",r)),U.createElement("div",{className:$},o),U.createElement("div",{className:e.children},t?Ov(0,t.length).map(W=>{const G=Pd(n,`${W}`);return U.createElement("div",{key:W},U.createElement(zi,{schema:s,uischema:b||d,path:G,key:G,renderers:h}),U.createElement("div",{className:D},U.createElement("button",{type:"button",className:j,disabled:!v,"aria-label":m.upAriaLabel,onClick:()=>{u(n,W)()}},m.up),U.createElement("button",{type:"button",className:S,disabled:!v,"aria-label":m.downAriaLabel,onClick:()=>{c(n,W)()}},m.down),U.createElement("button",{type:"button",className:E,disabled:!v,"aria-label":m.removeAriaLabel,onClick:()=>{window.confirm("Are you sure you wish to delete this item?")&&i(n,[W])()}},m.removeTooltip)))}):U.createElement("p",null,m.noDataMessage)))},HY=({schema:e,uischema:t,data:r,path:n,rootSchema:s,uischemas:o,addItem:a,getStyle:i,getStyleAsClassName:u,removeItems:c,moveUp:d,moveDown:f,id:p,visible:h,enabled:g,errors:m,translations:v,arraySchema:y})=>{const b=t,_=qa.createLabelDescriptionFrom(b,e),w=_.show?_.text:"",$=`control ${qa.convertToValidClassName(b.scope)}`,R=u("array.layout"),M=u("array.button"),D=u("array.children"),j={wrapper:$,fieldSet:R,button:M,children:D};return U.createElement(KY,{classNames:j,data:r,label:w,path:n,schema:e,arraySchema:y,errors:m,addItem:a,removeItems:c,moveUp:d,moveDown:f,uischema:t,uischemas:o,getStyleAsClassName:u,rootSchema:s,id:p,visible:h,enabled:g,getStyle:i,translations:v})};var GY=Xt(wx(So(kx(HY))));const qY=Ve(4,ox),Ix=e=>e.type==="Categorization",YY=Ve(1,Fe(De("Categorization"),e=>{const t=r=>pe(r.elements)?!1:r.elements.map(n=>Ix(n)?t(n):n.type==="Category").reduce((n,s)=>n&&s,!0);return t(e)})),JY=(e,t)=>t===e?"selected":"",Mx=({selectedCategory:e,elements:t,data:r,depth:n,onSelect:s,subcategoriesClassName:o,groupClassName:a,t:i,ajv:u,config:c})=>{const d=x.useMemo(()=>t.filter(p=>_o(p,r,void 0,u,c)),[t,r,u,c]),f=x.useMemo(()=>d.map(p=>Gb(p,i)),[d,i]);return U.createElement("ul",{className:o},d.map((p,h)=>Ix(p)?U.createElement("li",{key:f[h],className:a},U.createElement("span",null,f[h]),U.createElement(Mx,{selectedCategory:e,elements:p.elements,data:r,ajv:u,config:c,depth:n+1,onSelect:s,subcategoriesClassName:o,groupClassName:a,t:i})):U.createElement("li",{key:f[h],onClick:s(h),className:JY(p,e)},U.createElement("span",null,f[h]))))},ZY=({category:e,schema:t,path:r})=>U.createElement("div",{id:"categorization.detail"},(e.elements||[]).map((n,s)=>U.createElement(zi,{key:`${r}-${s}`,uischema:n,schema:t,path:r}))),QY=({data:e,uischema:t,schema:r,path:n,selected:s,t:o,visible:a,getStyleAsClassName:i,onChange:u,ajv:c,config:d})=>{const f=t,p=f.elements,h=i("categorization"),g=i("categorization.master"),m=i("categorization.detail"),v=i("category.subcategories"),y=i("category.group"),[b,_]=x.useState(t),[w,$]=x.useState(s??0),R=w>=f.elements.length?0:w;f!==b&&($(0),_(f));const M=D=>()=>u?u(D,R):$(D);return U.createElement("div",{className:h,hidden:a==null?!1:!a},U.createElement("div",{className:g},U.createElement(Mx,{elements:p,selectedCategory:p[R],data:e,ajv:c,config:d,depth:0,onSelect:M,subcategoriesClassName:v,groupClassName:y,t:o})),U.createElement("div",{className:m},U.createElement(ZY,{category:p[R],schema:r,path:n,key:R})))};var XY=TY(Xt(So(Mi(QY))));const eJ=Ve(1,De("Label")),tJ=({text:e,visible:t,getStyleAsClassName:r})=>{const n=r("label-control"),s=!t;return U.createElement("label",{hidden:s,className:n},e)};var rJ=Xt(oY(tJ));const{convertToValidClassName:nJ}=qa,{or:sJ,isObjectArrayControl:oJ,isPrimitiveArrayControl:aJ,rankWith:iJ}=BG,lJ=iJ(3,sJ(oJ,aJ));class cJ extends U.Component{constructor(){super(...arguments),this.confirmDelete=(t,r)=>{const n=t.substring(0,t.lastIndexOf("."));this.props.removeItems(n,[r])()}}render(){const{addItem:t,uischema:r,schema:n,rootSchema:s,path:o,data:a,visible:i,errors:u,label:c,getStyleAsClassName:d,childErrors:f,translations:p,enabled:h}=this.props,g=r,m=d("array.table.table"),v=d("array.table.label"),y=d("array.table.button"),b=d("array.table.validation"),_=[d("array.table"),nJ(g.scope)].join(" "),w=M=>({type:"Control",label:!1,scope:n.type==="object"?`#/properties/${M}`:"#"}),$=u.length===0,R=[b].concat($?"":d("array.table.validation.error")).join(" ");return U.createElement("div",{className:_,hidden:!i},U.createElement("header",null,U.createElement("label",{className:v},c),U.createElement("button",{type:"button",disabled:!h,className:y,onClick:t(o,hx(n,s))},p.addTooltip)),U.createElement("div",{className:R},$?"":u),U.createElement("table",{className:m},U.createElement("thead",null,U.createElement("tr",null,n.properties?Im(zm,Em(M=>n.properties[M].type!=="array"),Pm(M=>U.createElement("th",{key:M},n.properties[M].title??EY(M))))(n.properties):U.createElement("th",null,"Items"),U.createElement("th",null,"Valid"),U.createElement("th",null," "))),U.createElement("tbody",null,!a||!Array.isArray(a)||a.length===0?U.createElement("tr",null,U.createElement("td",null,p.noDataMessage)):a.map((M,D)=>{const j=jl.compose(o,`${D}`),S=Wa(f,G=>Ga(G).startsWith(j)),E=d("array.validation"),P=d("array.validation.error"),W=S?[E].concat(P).join(" "):E;return U.createElement("tr",{key:j},n.properties?Im(zm,Em(G=>n.properties[G].type!=="array"),Pm(G=>{const L=jl.compose(j,G.toString());return U.createElement("td",{key:L},U.createElement(zc,{schema:qt.schema(n,`#/properties/${Tc(G)}`,s),uischema:w(Tc(G)),path:j+"."+G}))}))(n.properties):U.createElement("td",{key:jl.compose(j,D.toString())},U.createElement(zc,{schema:n,uischema:w(),path:j})),U.createElement("td",null,S?U.createElement("span",{className:W},Cx(S.map(G=>G.message)," and ")):U.createElement("span",{className:W},"OK")),U.createElement("td",null,U.createElement("button",{type:"button",disabled:!h,"aria-label":p.removeAriaLabel,onClick:()=>{window.confirm(p.deleteDialogMessage)&&this.confirmDelete(j,D)}},p.removeTooltip)))}))))}}var uJ=Xt(wx(So(kx(cJ))));const dJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return U.createElement("input",{type:"checkbox",checked:!!t,onChange:u=>i(a,u.target.checked),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},fJ=Ve(2,Yb);var hJ=Qt(IY(dJ));const pJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return U.createElement("input",{type:"date",value:t||"",onChange:u=>i(a,u.target.value),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},mJ=Ve(2,ex);var gJ=Qt(vr(pJ));const vJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e,u=c=>c===""?"":c+":00.000Z";return U.createElement("input",{type:"datetime-local",value:(t||"").substr(0,16),onChange:c=>i(a,u(c.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},yJ=Ve(2,rx);var bJ=Qt(vr(vJ));const xJ=e=>{const{data:t,className:r,id:n,enabled:s,schema:o,uischema:a,path:i,handleChange:u,options:c,t:d}=e,f=x.useMemo(()=>d("enum.none",Px["enum.none"],{schema:o,uischema:a,path:i}),[d,o,a,i]);return U.createElement("select",{className:r,id:n,disabled:!s,autoFocus:a.options&&a.options.focus,value:t||"",onChange:p=>u(i,p.target.selectedIndex===0?void 0:p.target.value)},[U.createElement("option",{value:"",key:"jsonforms.enum.none"},f)].concat(c.map(p=>U.createElement("option",{value:p.value,label:p.label,key:p.value}))))},wJ=Ve(2,Zd);var kJ=tY(So(Rx(xJ)));const _J=e=>e===""?void 0:parseInt(e,10),CJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return U.createElement("input",{type:"number",step:"1",value:t??"",onChange:u=>i(a,_J(u.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},$J=Ve(2,Jb);var SJ=Qt(vr(CJ));const jJ=e=>e===""?void 0:Number(e),EJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return U.createElement("input",{type:"number",step:"0.1",value:t??"",onChange:u=>i(a,jJ(u.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},AJ=Ve(2,Zb);var NJ=Qt(vr(EJ));const PJ=e=>{const{className:t,id:r,enabled:n,uischema:s,path:o,handleChange:a,schema:i}=e,u=i.maxLength,c=e.toFormatted(e.data),d=f=>{const p=e.fromFormatted(f.currentTarget.value);a(o,p)};return U.createElement("input",{type:"text",value:c,onChange:d,className:t,id:r,disabled:!n,autoFocus:s.options&&s.options.focus,maxLength:s.options&&s.options.restrict?u:void 0,size:s.options&&s.options.trim?u:void 0})};Qt(vr(PJ));const RJ=e=>{var h;const{data:t,className:r,id:n,enabled:s,schema:o,uischema:a,path:i,handleChange:u,options:c,t:d}=e,f=x.useMemo(()=>d("enum.none",Px["enum.none"],{schema:o,uischema:a,path:i}),[d,o,a,i]),p=U.createElement("option",{value:"",key:"jsonforms.enum.none"},f);return U.createElement("select",{className:r,id:n,disabled:!s,autoFocus:a.options&&a.options.focus,value:t||"",onChange:g=>u(i,g.target.selectedIndex===0?void 0:g.target.value)},(((h=a.options)==null?void 0:h.hideEmptyOption)===!0?[]:[p]).concat(c.map(g=>U.createElement("option",{value:g.value,label:g.label,key:g.value}))))},TJ=Ve(2,Qd);var IJ=nY(So(Rx(RJ)));const MJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,schema:a,path:i,handleChange:u}=e;return U.createElement("div",{style:{display:"flex"}},U.createElement("input",{type:"range",max:a.maximum,min:a.minimum,value:t||a.default,onChange:c=>u(i,Number(c.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus,style:{flex:"1"}}),U.createElement("label",{style:{marginLeft:"0.5em"}},t||a.default))},zJ=Ve(4,ax);var OJ=Qt(vr(MJ));const DJ=e=>{const{config:t,data:r,className:n,id:s,enabled:o,uischema:a,schema:i,path:u,handleChange:c}=e,d=i.maxLength,f=wo({},t,a.options);return U.createElement("input",{type:f.format==="password"?"password":"text",value:r||"",onChange:p=>c(u,p.target.value===""?void 0:p.target.value),className:n,id:s,disabled:!o,autoFocus:f.focus,placeholder:f.placeholder,maxLength:f.restrict?d:void 0,size:f.trim?d:void 0})},LJ=Ve(1,Qb);var FJ=Qt(vr(DJ));const BJ=e=>{const{data:t,className:r,id:n,enabled:s,config:o,uischema:a,path:i,handleChange:u}=e,c=wo({},o,a.options);return U.createElement("textarea",{value:t||"",onChange:d=>u(i,d.target.value===""?void 0:d.target.value),className:r,id:n,disabled:!s,autoFocus:c.focus,placeholder:c.placeholder})},UJ=Ve(2,Xb);var VJ=Qt(vr(BJ));const WJ=e=>{if(typeof e=="string"){const t=e.split(":");return t.length===2&&t.push("00"),t.join(":")}return e},KJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return U.createElement("input",{type:"time",value:t||"",onChange:u=>i(a,WJ(u.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},HJ=Ve(2,tx);var GJ=Qt(vr(KJ));const of=(e,t,r,n,s)=>{if(pe(e.elements))return[];const{renderers:o,cells:a}=$o();return e.elements.map((i,u)=>U.createElement("div",{className:r,key:`${n}-${u}`},U.createElement(zi,{renderers:o,cells:a,uischema:i,schema:t,path:n,enabled:s})))},qJ=Ve(1,De("Group")),YJ=e=>{const{data:t,...r}=e;return U.createElement(JJ,{...r})},JJ=U.memo(function({schema:t,uischema:r,path:n,enabled:s,visible:o,label:a,getStyle:i,getStyleAsClassName:u}){const c=r,d=c.elements?c.elements.length:0,f=u("group.layout"),p=["group-layout-item"].concat(i("group.layout.item",d)).join(" ");return U.createElement("fieldset",{className:f,hidden:o==null?!1:!o},pe(a)?"":U.createElement("legend",{className:u("group.label")},a),of(c,t,p,n,s))});var ZJ=Xt(Mi(YJ));const zx=({className:e,children:t,visible:r})=>U.createElement("div",{className:e,hidden:r==null?!1:!r},t),QJ=Ve(1,De("HorizontalLayout")),XJ=e=>{const{data:t,...r}=e;return U.createElement(eZ,{...r})},eZ=U.memo(function({schema:t,uischema:r,getStyle:n,getStyleAsClassName:s,enabled:o,visible:a,path:i}){const u=r,c=u.elements?u.elements.length:0,d=s("horizontal.layout"),f=["horizontal-layout-item"].concat(n("horizontal.layout.item",c)).join(" ");return U.createElement(zx,{className:d,visible:a,enabled:o,path:i,uischema:r,schema:t,getStyle:n,getStyleAsClassName:s},of(u,t,f,i,o))});var tZ=Xt(Mi(XJ,!1));const rZ=Ve(1,De("VerticalLayout")),nZ=e=>{const{data:t,...r}=e;return U.createElement(sZ,{...r})},sZ=U.memo(function({schema:t,uischema:r,path:n,visible:s,enabled:o,getStyle:a,getStyleAsClassName:i}){const u=r,c=u.elements?u.elements.length:0,d=i("vertical.layout"),f=["vertical-layout-item"].concat(a("vertical.layout.item",c)).join(" ");return U.createElement(zx,{className:d,uischema:r,schema:t,visible:s,enabled:o,path:n,getStyle:a,getStyleAsClassName:i},of(u,t,f,n,o))});var oZ=Xt(Mi(nZ,!1));const aZ=[{tester:zY,renderer:OY},{tester:LY,renderer:FY},{tester:UY,renderer:VY},{tester:qY,renderer:GY},{tester:eJ,renderer:rJ},{tester:YY,renderer:XY},{tester:lJ,renderer:uJ},{tester:qJ,renderer:ZJ},{tester:rZ,renderer:oZ},{tester:QJ,renderer:tZ}],iZ=[{tester:fJ,cell:hJ},{tester:mJ,cell:gJ},{tester:yJ,cell:bJ},{tester:wJ,cell:kJ},{tester:$J,cell:SJ},{tester:AJ,cell:NJ},{tester:TJ,cell:IJ},{tester:zJ,cell:OJ},{tester:UJ,cell:VJ},{tester:LJ,cell:FJ},{tester:HJ,cell:GJ}];function lZ(e,t){return e.split(".").reduce((r,n)=>{if(r!=null&&typeof r=="object"&&!Array.isArray(r))return r[n]},t)}function cZ(e,t){return e.replace(/\$\{([^}]+)\}/g,(r,n)=>{const s=lZ(n.trim(),t);return s==null?"":String(s)})}function Ox(e,t){return typeof e=="string"?cZ(e,t):Array.isArray(e)?e.map(r=>Ox(r,t)):e!==null&&typeof e=="object"?Dx(e,t):e}function Dx(e,t){const r={};for(const[n,s]of Object.entries(e))r[n]=Ox(s,t);return r}function uZ(e,t){return{id:e.id,boardId:t,status:e.status,priority:e.priority,assignee:e.assignee,dueDate:e.dueDate,created:e.created,modified:e.modified,completedAt:e.completedAt,labels:e.labels,attachments:e.attachments,order:e.order,content:e.content,actions:e.actions,forms:e.forms,formData:e.formData,metadata:e.metadata}}let Ml=null;function af(){return Ml||(Ml=acquireVsCodeApi()),Ml}const dZ=af(),Lx=Mb({allErrors:!0,strict:!1});function ar(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Jr(e){return e?{...e}:{}}function fZ(e){return ar(e.properties)?new Set(Object.keys(e.properties)):new Set}function hZ(e,t){if(!ar(e.metadata))return{};const r=fZ(t);return r.size===0?{}:Object.fromEntries(Object.entries(e.metadata).filter(([n])=>r.has(n)))}function pZ(e,t){return typeof e.title=="string"&&e.title.trim().length>0?e.title.trim():t}function mZ(e,t){return typeof(t==null?void 0:t.name)=="string"&&t.name.trim().length>0?t.name.trim():Qg(e)}function gZ(e){return typeof(e==null?void 0:e.description)=="string"?e.description.trim():""}function vZ(){const e=new Set;return(t,r,n)=>{const o=(typeof(r==null?void 0:r.title)=="string"&&r.title.trim().length>0?r.title.trim():`form-${n}`).toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,50),a=t??(o||`form-${n}`);let i=a,u=2;for(;e.has(i);)i=`${a}-${u++}`;return e.add(i),i}}function yZ(e,t){const r=e.forms??[],n=(t==null?void 0:t.forms)??{},s=vZ(),o=uZ(e,e.boardId??(t==null?void 0:t.id)??"");return r.flatMap((a,i)=>{var g;const u=a.name?n[a.name]:void 0,c=ar(a.schema)?a.schema:ar(u==null?void 0:u.schema)?u.schema:void 0;if(!c)return[];const d=s(a.name,c,i),f=a.name?mZ(a.name,u):pZ(c,Qg(d)),p=a.name?gZ(u):"",h={...Jr(u==null?void 0:u.data),...Jr(ar(a.data)?a.data:void 0),...Jr((g=e.formData)==null?void 0:g[d])};return[{id:d,name:f,description:p,label:f,schema:c,...ar(a.ui)?{ui:a.ui}:ar(u==null?void 0:u.ui)?{ui:u.ui}:{},initialData:{...Dx(h,o),...hZ(e,c)},fromConfig:!!(a.name&&u)}]})}function Qo(e,t){const r=Lx.compile(e);return r(t)?[]:r.errors??[]}function bZ(e){var s;const r=(typeof((s=e.params)==null?void 0:s.missingProperty)=="string"?e.params.missingProperty:"")||e.instancePath||"/",n=e.message||"is invalid";return`${r} ${n}`.trim()}function xZ(e,t,r){return(r==null?void 0:r.formId)===e&&r.dataSignature===t}function wZ({cardId:e,boardId:t,form:r,className:n,onSubmitted:s}){const o=x.useMemo(()=>JSON.stringify(r.initialData),[r.initialData]),[a,i]=x.useState(()=>Jr(r.initialData)),[u,c]=x.useState(()=>Qo(r.schema,Jr(r.initialData))),[d,f]=x.useState(!1),[p,h]=x.useState(null),[g,m]=x.useState(null),v=x.useRef(null),y=x.useRef(null);x.useEffect(()=>{const w=Jr(r.initialData);i(w),c(Qo(r.schema,w)),h(null),m($=>xZ(r.id,o,y.current)?$??`Saved ${r.name}`:null)},[r.id,r.name,r.schema,r.initialData,o]),x.useEffect(()=>()=>{v.current&&(window.removeEventListener("message",v.current),v.current=null)},[]);const b=async()=>{var R,M;const w=Qo(r.schema,a);if(c(w),h(null),m(null),w.length>0||d)return;const $=`submit-form-${e}-${r.id}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;f(!0);try{const D=await new Promise((E,P)=>{const W=G=>{const L=G.data;if(!(!L||L.type!=="submitFormResult"||L.callbackKey!==$)){if(window.removeEventListener("message",W),v.current=null,L.error){P(new Error(L.error));return}if(!L.result){P(new Error("Form submission failed without a result payload"));return}E(L.result)}};v.current=W,window.addEventListener("message",W),dZ.postMessage({type:"submitForm",cardId:e,formId:r.id,data:a,callbackKey:$,...t?{boardId:t}:{}})}),j=ar((R=D.card.formData)==null?void 0:R[r.id])?(M=D.card.formData)==null?void 0:M[r.id]:D.data,S=Jr(j);y.current={formId:r.id,dataSignature:JSON.stringify(S)},i(S),c(Qo(r.schema,S)),m(`Saved ${r.name}`),s==null||s(D)}catch(D){y.current=null,h(D instanceof Error?D.message:String(D))}finally{f(!1)}},_=u.length>0;return l.jsxs("div",{className:Ae("flex h-full flex-col",n),children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"truncate text-sm font-semibold",style:{color:"var(--vscode-foreground)"},children:r.name}),r.fromConfig&&l.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:"Shared"})]}),r.description&&l.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:r.description}),_&&l.jsx("p",{className:"mt-1 text-xs font-medium",style:{color:"var(--vscode-errorForeground)"},children:`Fix ${u.length} validation error${u.length===1?"":"s"} before submitting.`})]}),l.jsx("button",{type:"button",onClick:b,disabled:_||d,className:"rounded px-3 py-1.5 text-xs font-medium transition-opacity disabled:cursor-not-allowed disabled:opacity-50",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:_?"Resolve validation errors before submitting":void 0,children:d?"Submitting…":"Submit"})]}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[l.jsx("div",{className:"card-jsonforms p-4",children:l.jsx(lY,{schema:r.schema,uischema:r.ui,data:a,renderers:aZ,cells:iZ,ajv:Lx,validationMode:"ValidateAndShow",onChange:({data:w,errors:$})=>{const R=ar(w)?w:{};y.current=null,i(R),c($??[]),h(null),m(null)}})}),(p||g||_)&&l.jsxs("div",{className:"space-y-2 px-4 pb-4",children:[p&&l.jsx("div",{className:"rounded px-3 py-2 text-xs",style:{background:"color-mix(in srgb, var(--vscode-errorForeground) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--vscode-errorForeground) 40%, transparent)",color:"var(--vscode-errorForeground)"},children:p}),g&&!p&&l.jsx("div",{className:"rounded px-3 py-2 text-xs",style:{background:"color-mix(in srgb, var(--vscode-testing-iconPassed) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--vscode-testing-iconPassed) 40%, transparent)",color:"var(--vscode-testing-iconPassed)"},children:g}),_&&l.jsxs("div",{className:"rounded px-3 py-2",style:{background:"var(--vscode-inputValidation-warningBackground, color-mix(in srgb, var(--vscode-editorWarning-foreground, #d7ba7d) 10%, transparent))",border:"1px solid var(--vscode-inputValidation-warningBorder, var(--vscode-editorWarning-foreground, #d7ba7d))"},children:[l.jsx("p",{className:"mb-2 text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:"Validation issues"}),l.jsx("ul",{className:"space-y-1 pl-4 text-xs",style:{color:"var(--vscode-foreground)"},children:u.map((w,$)=>l.jsx("li",{className:"list-disc",children:bZ(w)},`${w.instancePath??"/"}-${w.message??"invalid"}-${$}`))})]})]})]})]})}function Fx({value:e,onChange:t,placeholder:r="Write markdown...",className:n,autoFocus:s,mode:o="create",comments:a,onAddComment:i,onUpdateComment:u,onDeleteComment:c,logs:d,onClearLogs:f,logsFilter:p,onLogsFilterChange:h,cardId:g,frontmatter:m,onFormSubmitSuccess:v}){const y=o==="edit",b=y?"Edit":"Write",_=q(O=>O.activeCardTab),w=q(O=>O.setActiveCardTab),$=q(O=>O.boards),R=q(O=>O.currentBoard),[M,D]=x.useState("write"),j=y?_:M,S=O=>{y?w(O):D(O)},E=x.useRef(null),P=x.useMemo(()=>$.find(O=>O.id===R),[$,R]),W=x.useMemo(()=>y&&m?yZ({...m,content:e},P):[],[P,m,y,e]),G=x.useMemo(()=>e.trim()?Ne.parse(e,{async:!1,gfm:!0,breaks:!0}):"",[e]);x.useEffect(()=>{j==="write"&&E.current&&E.current.focus()},[j]),x.useEffect(()=>{s&&E.current&&E.current.focus()},[s]);const L=x.useCallback(O=>{E.current&&w0(E.current,e,t,O)},[e,t]),V=O=>{if(O.key==="Tab"){O.preventDefault();const te=O.currentTarget,J=te.selectionStart,H=te.selectionEnd,A=e.substring(0,J)+" "+e.substring(H);t(A),requestAnimationFrame(()=>{te.selectionStart=te.selectionEnd=J+2})}(O.metaKey||O.ctrlKey)&&O.key==="b"&&(O.preventDefault(),O.stopPropagation(),L("bold")),(O.metaKey||O.ctrlKey)&&O.key==="i"&&(O.preventDefault(),L("italic")),(O.metaKey||O.ctrlKey)&&O.key==="k"&&(O.preventDefault(),L("link"))};return l.jsxs("div",{className:Ae("card-markdown-shell h-full",n),children:[l.jsxs("div",{className:"card-markdown-header shrink-0",children:[l.jsxs("div",{className:"card-markdown-tabs",children:[(y?["preview","write"]:["write","preview"]).map(O=>l.jsx("button",{type:"button",onClick:()=>S(O),className:Ae("card-markdown-tab",j===O&&"is-active"),children:O==="write"?b:"Preview"},O)),W.map(O=>{const te=nc(O.id);return l.jsx("button",{type:"button",onClick:()=>S(te),className:Ae("card-markdown-tab",j===te&&"is-active"),children:`form: ${O.name}`},te)}),a&&l.jsxs("button",{type:"button",onClick:()=>S("comments"),className:Ae("card-markdown-tab",j==="comments"&&"is-active"),children:[l.jsx(f1,{size:12}),"Comments",a.length>0&&l.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:a.length})]}),d&&l.jsxs("button",{type:"button",onClick:()=>S("logs"),className:Ae("card-markdown-tab",j==="logs"&&"is-active"),children:[l.jsx(tg,{size:12}),"Logs",d.length>0&&l.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d.length})]})]}),j==="write"&&l.jsxs("div",{className:"card-markdown-toolbar",children:[l.jsx(rt,{icon:l.jsx(h1,{size:14}),title:"Heading",onClick:()=>L("heading")}),l.jsx(rt,{icon:l.jsx(qm,{size:14}),title:"Bold (⌘B)",onClick:()=>L("bold")}),l.jsx(rt,{icon:l.jsx(Ym,{size:14}),title:"Italic (⌘I)",onClick:()=>L("italic")}),l.jsx(rt,{icon:l.jsx(Jm,{size:14}),title:"Quote",onClick:()=>L("quote"),separator:!0}),l.jsx(rt,{icon:l.jsx(Zm,{size:14}),title:"Code",onClick:()=>L("code")}),l.jsx(rt,{icon:l.jsx(Qm,{size:14}),title:"Link (⌘K)",onClick:()=>L("link")}),l.jsx(rt,{icon:l.jsx(Xm,{size:14}),title:"Bulleted list",onClick:()=>L("ul"),separator:!0}),l.jsx(rt,{icon:l.jsx(eg,{size:14}),title:"Numbered list",onClick:()=>L("ol")}),l.jsx(rt,{icon:l.jsx(p1,{size:14}),title:"Task list",onClick:()=>L("tasklist")})]})]}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[j==="write"&&l.jsx("textarea",{ref:E,value:e,onChange:O=>t(O.target.value),onKeyDown:V,placeholder:r,className:"markdown-editor-textarea",spellCheck:!1}),j==="preview"&&l.jsx("div",{className:"min-h-[200px]",children:G?l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-4",dangerouslySetInnerHTML:{__html:G}}):l.jsx("p",{className:"p-4 text-sm italic",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})}),W.map(O=>{const te=nc(O.id);return g?l.jsx("div",{className:Ae("h-full",j===te?"block":"hidden"),children:l.jsx(wZ,{cardId:g,boardId:P==null?void 0:P.id,form:O,onSubmitted:v})},te):null}),j==="comments"&&a&&i&&u&&c&&l.jsx(rS,{comments:a,onAddComment:i,onUpdateComment:u,onDeleteComment:c}),j==="logs"&&d&&f&&l.jsx(D0,{logs:d,onClearLogs:f,logsFilter:p,onLogsFilterChange:h})]})]})}function Xa({panelMode:e,onPreview:t,onCommit:r,onCancel:n}){const s=x.useRef(null),o=x.useRef(t),a=x.useRef(r),i=x.useRef(n);return o.current=t,a.current=r,i.current=n,x.useEffect(()=>{if(typeof window>"u")return;const u=sC({eventTarget:window,getPanelMode:()=>e,getViewportWidth:()=>window.innerWidth,onPreview:c=>o.current(c),onCommit:c=>a.current(c),onCancel:()=>i.current()});return s.current=u,()=>{u.dispose(),s.current=null}},[e]),e!=="drawer"?null:l.jsx("button",{type:"button","aria-label":"Resize drawer",title:"Drag to resize drawer","data-panel-resize-handle":"",className:"absolute inset-y-0 left-0 z-10 w-3 cursor-ew-resize touch-none pointer-events-auto",onPointerDown:u=>{var c,d,f;u.preventDefault(),(d=(c=u.currentTarget).setPointerCapture)==null||d.call(c,u.pointerId),(f=s.current)==null||f.start({clientX:u.clientX})},children:l.jsx("span",{"aria-hidden":"true",className:"absolute inset-y-0 left-1/2 w-px -translate-x-1/2",style:{background:"var(--vscode-panel-border)"}})})}const kZ=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}];function Om({value:e,options:t,onChange:r,className:n}){const[s,o]=x.useState(!1),a=t.find(i=>i.value===e);return l.jsxs("div",{className:Ae("relative",n),children:[l.jsxs("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},onMouseEnter:i=>i.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:i=>i.currentTarget.style.background="transparent",children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",a.dot)}),!(a!=null&&a.dot)&&(a==null?void 0:a.dotColor)&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.dotColor}}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(i=>l.jsxs("button",{type:"button",onClick:()=>{r(i.value),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:u=>{i.value!==e&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{i.value!==e&&(u.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",i.dot)}),!i.dot&&i.dotColor&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:i.dotColor}}),l.jsx("span",{className:"flex-1 text-left",children:i.label}),i.value===e&&l.jsx(jt,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},i.value))})]})]})}function _Z({value:e,onChange:t}){const[r,n]=x.useState(!1),s=x.useRef(null),o=x.useRef(null),a=q(f=>f.cards),i=x.useMemo(()=>{const f=new Set;return a.forEach(p=>{p.assignee&&f.add(p.assignee)}),Array.from(f).sort()},[a]),u=x.useMemo(()=>e.trim()?i.filter(f=>f.toLowerCase().includes(e.toLowerCase())&&f!==e):i,[e,i]),c=r&&u.length>0,d=e.trim()?e.trim().split(/\s+/).map(f=>f[0]).join("").toUpperCase().slice(0,2):null;return l.jsxs("div",{ref:o,className:"relative flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 cursor-text",onClick:()=>{var f;return(f=s.current)==null?void 0:f.focus()},children:[d&&l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d}),l.jsx("input",{ref:s,type:"text",value:e,onChange:f=>t(f.target.value),onFocus:()=>n(!0),onBlur:()=>setTimeout(()=>n(!1),150),placeholder:"No assignee",className:"flex-1 bg-transparent border-none outline-none text-xs",style:{color:e?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]}),c&&l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:u.map(f=>l.jsxs("button",{type:"button",onMouseDown:p=>{p.preventDefault(),t(f)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:p=>p.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:f.split(/\s+/).map(p=>p[0]).join("").toUpperCase().slice(0,2)}),l.jsx("span",{children:f})]},f))})]})}function CZ({labels:e,onChange:t}){const[r,n]=x.useState(""),[s,o]=x.useState(!1),a=x.useRef(null),i=q(h=>h.cards),u=q(h=>h.labelDefs),c=x.useMemo(()=>{const h=new Set;return i.forEach(g=>g.labels.forEach(m=>h.add(m))),Array.from(h).sort()},[i]),d=x.useMemo(()=>{const h=c.filter(g=>!e.includes(g));return r.trim()?h.filter(g=>g.toLowerCase().includes(r.toLowerCase())):h},[r,c,e]),f=s&&d.length>0,p=h=>{const g=(h||r).trim();g&&!e.includes(g)&&t([...e,g]),n("")};return l.jsxs("div",{className:"relative flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap cursor-text",onClick:()=>{var h;return(h=a.current)==null?void 0:h.focus()},children:[e.map(h=>{const g=u[h];return l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:g?{backgroundColor:`${g.color}20`,color:g.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[h,l.jsx("button",{type:"button",onClick:m=>{m.stopPropagation(),t(e.filter(v=>v!==h))},className:"hover:text-red-500 transition-colors",children:l.jsx(st,{size:9})})]},h)}),l.jsx("input",{ref:a,type:"text",value:r,onChange:h=>n(h.target.value),onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),150),onKeyDown:h=>{var g;h.key==="Enter"&&(h.preventDefault(),p()),h.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),h.key==="Escape"&&(n(""),(g=a.current)==null||g.blur())},placeholder:e.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]}),f&&l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:d.map(h=>{const g=u[h];return l.jsx("button",{type:"button",onMouseDown:m=>{m.preventDefault(),p(h)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:m=>m.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:m=>m.currentTarget.style.background="transparent",children:l.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:g?{backgroundColor:`${g.color}20`,color:g.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:h})},h)})})]})}function $Z({actions:e,onChange:t}){const[r,n]=x.useState(""),s=x.useRef(null),o=a=>{const i=r.trim();i&&!e.includes(i)&&t([...e,i]),n("")};return l.jsx("div",{className:"relative flex-1",children:l.jsxs("label",{className:"flex items-center gap-1.5 flex-wrap cursor-text",children:[e.map(a=>l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[a,l.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),t(e.filter(u=>u!==a))},className:"hover:text-red-500 transition-colors",children:l.jsx(st,{size:9})})]},a)),l.jsx("input",{ref:s,type:"text",value:r,onChange:a=>n(a.target.value),onKeyDown:a=>{var i;(a.key==="Enter"||a.key===",")&&(a.preventDefault(),o()),a.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),a.key==="Escape"&&(n(""),(i=s.current)==null||i.blur())},placeholder:e.length===0?"Add actions...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]})})}function Cn({label:e,icon:t,children:r}){return l.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors",onMouseEnter:n=>n.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:n=>n.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[l.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:t}),l.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),l.jsx("div",{className:"flex-1 min-w-0",children:r})]})}function SZ({isOpen:e,...t}){return e?l.jsx(jZ,{isOpen:e,...t}):null}function jZ({isOpen:e,onClose:t,onCreate:r,onSaveSettings:n,initialStatus:s}){const o=q(V=>V.cardSettings),a=q(V=>V.effectiveDrawerWidth),i=q(V=>V.setDrawerWidthPreview),u=q(V=>V.clearDrawerWidthPreview),c=q(V=>V.setCardSettings),d=q(V=>V.columns),f=x.useMemo(()=>d.filter(V=>V.id!==Gn).map(V=>({value:V.id,label:V.name,dotColor:V.color})),[d]),[p,h]=x.useState(""),[g,m]=x.useState(s??o.defaultStatus),[v,y]=x.useState(o.defaultPriority),[b,_]=x.useState(""),[w,$]=x.useState(""),[R,M]=x.useState([]),[D,j]=x.useState([]),[S,E]=x.useState(""),P=x.useRef(null);x.useEffect(()=>{const V=setTimeout(()=>{var O;return(O=P.current)==null?void 0:O.focus()},50);return()=>clearTimeout(V)},[]);const W=()=>{const V=S.trim(),O=p.trim(),te=O?`# ${O}${V?`
129
+ `)}var AW=EW,NW=Fv;function PW(e,t){var r=e==null?0:e.length;return!!r&&NW(e,t,0)>-1}var RW=PW,TW=wd,IW=RW,MW=1,zW=2,OW=8,DW=16,LW=32,FW=64,BW=128,UW=256,VW=512,WW=[["ary",BW],["bind",MW],["bindKey",zW],["curry",OW],["curryRight",DW],["flip",VW],["partial",LW],["partialRight",FW],["rearg",UW]];function KW(e,t){return TW(WW,function(r){var n="_."+r[0];t&r[1]&&!IW(e,n)&&e.push(n)}),e.sort()}var HW=KW,GW=SW,qW=AW,YW=xd,JW=HW;function ZW(e,t,r){var n=t+"";return YW(e,qW(n,JW(GW(n),r)))}var gb=ZW,QW=pb(),XW=mb,e8=gb,t8=4,r8=8,Qp=32,Xp=64;function n8(e,t,r,n,s,o,a,i,u,c){var d=t&r8,f=d?a:void 0,p=d?void 0:a,h=d?o:void 0,g=d?void 0:o;t|=d?Qp:Xp,t&=~(d?Xp:Qp),t&t8||(t&=-4);var m=[e,t,s,h,f,g,p,i,u,c],v=r.apply(void 0,m);return QW(e)&&XW(v,m),v.placeholder=n,e8(v,e,t)}var vb=n8;function s8(e){var t=e;return t.placeholder}var yb=s8,o8=yo,a8=fo,i8=Math.min;function l8(e,t){for(var r=e.length,n=i8(t.length,r),s=o8(e);n--;){var o=t[n];e[n]=a8(o,r)?s[o]:void 0}return e}var c8=l8,em="__lodash_placeholder__";function u8(e,t){for(var r=-1,n=e.length,s=0,o=[];++r<n;){var a=e[r];(a===t||a===em)&&(e[r]=em,o[s++]=r)}return o}var jd=u8,d8=db,f8=fb,h8=mW,tm=Ni,p8=vb,m8=yb,g8=c8,v8=jd,y8=ut,b8=1,x8=2,w8=8,k8=16,_8=128,C8=512;function bb(e,t,r,n,s,o,a,i,u,c){var d=t&_8,f=t&b8,p=t&x8,h=t&(w8|k8),g=t&C8,m=p?void 0:tm(e);function v(){for(var y=arguments.length,b=Array(y),_=y;_--;)b[_]=arguments[_];if(h)var w=m8(v),$=h8(b,w);if(n&&(b=d8(b,n,s,h)),o&&(b=f8(b,o,a,h)),y-=$,h&&y<c){var R=v8(b,w);return p8(e,t,bb,v.placeholder,r,b,R,i,u,c-y)}var M=f?r:this,D=p?M[e]:e;return y=b.length,i?b=g8(b,i):g&&y>1&&b.reverse(),d&&u<y&&(b.length=u),this&&this!==y8&&this instanceof v&&(D=m||tm(D)),D.apply(M,b)}return v}var xb=bb,$8=bd,S8=Ni,j8=xb,E8=vb,A8=yb,N8=jd,P8=ut;function R8(e,t,r){var n=S8(e);function s(){for(var o=arguments.length,a=Array(o),i=o,u=A8(s);i--;)a[i]=arguments[i];var c=o<3&&a[0]!==u&&a[o-1]!==u?[]:N8(a,u);if(o-=c.length,o<r)return E8(e,t,j8,s.placeholder,void 0,a,c,void 0,void 0,r-o);var d=this&&this!==P8&&this instanceof s?n:e;return $8(d,this,a)}return s}var T8=R8,I8=bd,M8=Ni,z8=ut,O8=1;function D8(e,t,r,n){var s=t&O8,o=M8(e);function a(){for(var i=-1,u=arguments.length,c=-1,d=n.length,f=Array(d+u),p=this&&this!==z8&&this instanceof a?o:e;++c<d;)f[c]=n[c];for(;u--;)f[c++]=arguments[++i];return I8(p,s?r:this,f)}return a}var L8=D8,F8=db,B8=fb,rm=jd,nm="__lodash_placeholder__",xl=1,U8=2,V8=4,sm=8,Es=128,om=256,W8=Math.min;function K8(e,t){var r=e[1],n=t[1],s=r|n,o=s<(xl|U8|Es),a=n==Es&&r==sm||n==Es&&r==om&&e[7].length<=t[8]||n==(Es|om)&&t[7].length<=t[8]&&r==sm;if(!(o||a))return e;n&xl&&(e[2]=t[2],s|=r&xl?0:V8);var i=t[3];if(i){var u=e[3];e[3]=u?F8(u,i,t[4]):i,e[4]=u?rm(e[3],nm):t[4]}return i=t[5],i&&(u=e[5],e[5]=u?B8(u,i,t[6]):i,e[6]=u?rm(e[5],nm):t[6]),i=t[7],i&&(e[7]=i),n&Es&&(e[8]=e[8]==null?t[8]:W8(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=s,e}var H8=K8,G8=ub,q8=cW,Y8=T8,J8=xb,Z8=L8,Q8=$d(),X8=H8,e7=mb,t7=gb,am=po,r7="Expected a function",im=1,n7=2,lm=8,cm=16,um=32,s7=64,dm=Math.max;function o7(e,t,r,n,s,o,a,i){var u=t&n7;if(!u&&typeof e!="function")throw new TypeError(r7);var c=n?n.length:0;if(c||(t&=-97,n=s=void 0),a=a===void 0?a:dm(am(a),0),i=i===void 0?i:am(i),c-=s?s.length:0,t&s7){var d=n,f=s;n=s=void 0}var p=u?void 0:Q8(e),h=[e,t,r,n,s,d,f,o,a,i];if(p&&X8(h,p),e=h[0],t=h[1],r=h[2],n=h[3],s=h[4],i=h[9]=h[9]===void 0?u?0:e.length:dm(h[9]-c,0),!i&&t&(lm|cm)&&(t&=-25),!t||t==im)var g=q8(e,t,r);else t==lm||t==cm?g=Y8(e,t,i):(t==um||t==(im|um))&&!s.length?g=Z8(e,t,r,n):g=J8.apply(void 0,h);var m=p?G8:e7;return t7(m(g,h),e,t)}var Ed=o7,a7=Ed,i7=128;function l7(e,t,r){return t=r?void 0:t,t=e&&t==null?e.length:t,a7(e,i7,void 0,void 0,void 0,void 0,t)}var c7=l7,u7=kd,d7=4;function f7(e){return u7(e,d7)}var h7=f7,p7=Ed,m7=8;function Ad(e,t,r){t=r?void 0:t;var n=p7(e,m7,void 0,void 0,void 0,void 0,void 0,t);return n.placeholder=Ad.placeholder,n}Ad.placeholder={};var g7=Ad,v7=Ir,y7=bt,b7=Qy,x7="[object DOMException]",w7="[object Error]";function k7(e){if(!y7(e))return!1;var t=v7(e);return t==w7||t==x7||typeof e.message=="string"&&typeof e.name=="string"&&!b7(e)}var _7=k7,C7=un,$7=bt,S7="[object WeakMap]";function j7(e){return $7(e)&&C7(e)==S7}var E7=j7,A7=kd,N7=fn,P7=1;function R7(e){return N7(typeof e=="function"?e:A7(e,P7))}var T7=R7,fm=Yn,I7=co,M7=Ue,hm=fm?fm.isConcatSpreadable:void 0;function z7(e){return M7(e)||I7(e)||!!(hm&&e&&e[hm])}var O7=z7,D7=pu,L7=O7;function wb(e,t,r,n,s){var o=-1,a=e.length;for(r||(r=L7),s||(s=[]);++o<a;){var i=e[o];t>0&&r(i)?t>1?wb(i,t-1,r,n,s):D7(s,i):n||(s[s.length]=i)}return s}var F7=wb,B7=F7;function U7(e){var t=e==null?0:e.length;return t?B7(e,1):[]}var V7=U7,W7=V7,K7=tb,H7=xd;function G7(e){return H7(K7(e,void 0,W7),e+"")}var kb=G7,q7=Ed,Y7=kb,J7=256,Z7=Y7(function(e,t){return q7(e,J7,void 0,void 0,void 0,t)}),Q7=Z7,X7=ho,eK=yo,tK=Ue,rK=Jn,nK=ov,sK=dn,oK=rs;function aK(e){return tK(e)?X7(e,sK):rK(e)?[e]:eK(nK(oK(e)))}var iK=aK,lK={ary:c7,assign:nb,clone:h7,curry:g7,forEach:wd,isArray:Ue,isError:_7,isFunction:lo,isWeakMap:E7,iteratee:T7,keys:bu,rearg:Q7,toInteger:po,toPath:iK},cK=XV,uK=lK;function dK(e,t,r){return cK(uK,e,t,r)}var hn=dK,wl,pm;function fK(){if(pm)return wl;pm=1;var e=yd,t=xi,r=fo,n=xt,s=dn;function o(a,i,u,c){if(!n(a))return a;i=t(i,a);for(var d=-1,f=i.length,p=f-1,h=a;h!=null&&++d<f;){var g=s(i[d]),m=u;if(g==="__proto__"||g==="constructor"||g==="prototype")return a;if(d!=p){var v=h[g];m=c?c(v,g,h):void 0,m===void 0&&(m=n(v)?v:r(i[d+1])?[]:{})}e(h,g,m),h=h[g]}return a}return wl=o,wl}var kl,mm;function hK(){if(mm)return kl;mm=1;var e=fK();function t(r,n,s){return r==null?r:e(r,n,s)}return kl=t,kl}var pK=hn,_b=pK("set",hK());_b.placeholder=Mr();var mK=_b;const gK=je(mK);function vK(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Cb=vK;const yK=je(Cb);var bK=_u,xK=Cv;function wK(e,t){return t.length<2?e:bK(e,xK(t,0,-1))}var kK=wK,_K=xi,CK=Cb,$K=kK,SK=dn,jK=Object.prototype,EK=jK.hasOwnProperty;function AK(e,t){t=_K(t,e);var r=-1,n=t.length;if(!n)return!0;for(var s=e==null||typeof e!="object"&&typeof e!="function";++r<n;){var o=t[r];if(typeof o=="string"){if(o==="__proto__"&&!EK.call(e,"__proto__"))return!1;if(o==="constructor"&&r+1<n&&typeof t[r+1]=="string"&&t[r+1]==="prototype"){if(s&&r===0)continue;return!1}}}var a=$K(e,t);return a==null||delete a[SK(CK(t))]}var NK=AK,_l,gm;function PK(){if(gm)return _l;gm=1;var e=NK;function t(r,n){return r==null?!0:e(r,n)}return _l=t,_l}var RK=hn,$b=RK("unset",PK());$b.placeholder=Mr();var TK=$b;const IK=je(TK);function MK(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}var zK=MK,OK=zK,DK=iv,LK=po,FK=rs;function BK(e,t,r){e=FK(e),t=DK(t);var n=e.length;r=r===void 0?n:OK(LK(r),0,n);var s=r;return r-=t.length,r>=0&&e.slice(r,s)==t}var UK=BK;const VK=je(UK);function WK(e,t,r,n,s){return s(e,function(o,a,i){r=n?(n=!1,o):t(r,o,a,i)}),r}var KK=WK,HK=uv,GK=pd,qK=fn,YK=KK,JK=Ue;function ZK(e,t,r){var n=JK(e)?HK:YK,s=arguments.length<3;return n(e,qK(t),r,s,GK)}var QK=ZK;const Rc=je(QK);var XK=ho;function eH(e,t){return XK(t,function(r){return[r,e[r]]})}var tH=eH;function rH(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=[n,n]}),r}var nH=rH,sH=tH,oH=un,aH=W0,iH=nH,lH="[object Map]",cH="[object Set]";function uH(e){return function(t){var r=oH(t);return r==lH?aH(t):r==cH?iH(t):sH(t,e(t))}}var dH=uH,fH=dH,hH=Jt,pH=fH(hH),mH=pH;const gH=je(mH);function vH(e){return e===void 0}var yH=vH;const bH=je(yH),fa="additionalProperties",ha="required",xH=(e,t)=>{const r={};return e.filter(n=>{const s=t(n);return Object.prototype.hasOwnProperty.call(r,s)?!1:(r[s]=!0,!0)})};class wH{constructor(t){this.findOption=t,this.schemaObject=r=>{const n=this.properties(r),s={type:"object",properties:n,additionalProperties:this.findOption(n)(fa)},o=this.findOption(n)(ha);return o.length>0&&(s.required=o),s},this.properties=r=>{const n={};return Object.keys(r).reduce((s,o)=>(s[o]=this.property(r[o]),s),n)},this.property=r=>{switch(typeof r){case"string":return{type:"string"};case"boolean":return{type:"boolean"};case"number":return Number.isInteger(r)?{type:"integer"}:{type:"number"};case"object":return r==null?{type:"null"}:this.schemaObjectOrArray(r);default:return{}}},this.schemaObjectOrArray=r=>r instanceof Array?this.schemaArray(r):this.schemaObject(r),this.schemaArray=r=>{if(r.length>0){const n=r.map(this.property),s=xH(n,o=>JSON.stringify(o));return s.length===1?{type:"array",items:s[0]}:{type:"array",items:{oneOf:s}}}else return{type:"array",items:{}}}}}const Sb=(e,t={})=>{const r=s=>o=>{switch(o){case fa:return Object.prototype.hasOwnProperty.call(t,fa)?t[fa]:!0;case ha:return Object.prototype.hasOwnProperty.call(t,ha)?t[ha](s):Object.keys(s);default:return}};return new wH(r).schemaObject(e)},Nd=new Set,jb=(e,t)=>t<=1?e:e+t.toString(),kH=(e,t)=>{const r=jb(e,t);return!Nd.has(r)},vm=e=>{e===void 0&&(e="undefined");let t=0;for(;!kH(e,t);)t++;const r=jb(e,t);return Nd.add(r),r},ym=e=>Nd.delete(e),Pd=(e,t)=>{let r=e;return!pe(e)&&!pe(t)&&!t.startsWith("[")&&(r=e+"."),pe(r)?t:pe(t)?r:`${r}${t}`},Eb=e=>{const n=e.replace(/(anyOf|allOf|oneOf)\/[\d]+\//g,"").replace(/(then|else)\//g,"").split("/").map(ko),o=n[0]==="#"||n[0]===""?2:1;return Ov(o,n.length,2).map(a=>n[a])},Tc=e=>e==null?void 0:e.replace(/~/g,"~0").replace(/\//g,"~1"),ko=e=>e==null?void 0:e.replace(/~1/g,"/").replace(/~0/,"~"),Cl=(e,t)=>{if(t&&typeof t.title=="string")return t.title;if(typeof e.scope=="string"){const r=e.scope,n=ko(r.substr(r.lastIndexOf("/")+1));return Tv(n)}return""},Ab=(e,t)=>{const r=e.label;if(typeof r=="boolean")return Zo(Cl(e,t),r);if(typeof r=="string")return Zo(r,!0);if(typeof r=="object"){const n=typeof r.text=="string"?r.text:Cl(e,t),s=typeof r.show=="boolean"?r.show:!0;return Zo(n,s)}return Zo(Cl(e,t),!0)},Zo=(e,t)=>({text:e,show:t}),pa=(e,t)=>pe(t)?e:t.split(".").reduce((n,s)=>{if(!(!n||!Object.prototype.hasOwnProperty.call(n,s)))return n[s]},e),_H=e=>e==="#"||e===void 0||e==="",zt=(e,t,r)=>Rd(e,t,{rootSchema:r,resolutionMap:new Map}),Rd=(e,t,r)=>{let n;if(e&&typeof e.$ref=="string"){const s=$l(r.rootSchema,e.$ref,r);s!==void 0&&(n=$l(s,t,r))}return n===void 0&&(n=$l(e,t,r)),n},$l=(e,t,r)=>{let n=r.resolutionMap.get(e);if(n||(n=new Set,r.resolutionMap.set(e,n)),n.has(t))return;n.add(t);const s=Td(e,t==null?void 0:t.split("/").map(ko),r);return n.delete(t),s},Td=(e,t,r)=>{if(!t||t.length===0)return e;if(pe(e))return;const n=CH(e,t,r);if(n!==void 0)return n;const s=[].concat(e.oneOf??[],e.allOf??[],e.anyOf??[],e.then??[],e.else??[]);for(const o of s){let a=o;o&&typeof o.$ref=="string"&&(a=Rd(r.rootSchema,o.$ref,r));const i=Td(a,t,r);if(i)return i}},CH=(e,t,r)=>{if(!t||t.length===0)return e;if(pe(e))return;const n=Nb(e,t);return n.schema&&typeof n.schema.$ref=="string"&&(n.schema=Rd(r.rootSchema,n.schema.$ref,r)),Td(n.schema,n.remainingPathSegments,r)},Nb=(e,t)=>{if(!t||t.length===0)return{schema:e,remainingPathSegments:[]};if(pe(e))return{schema:void 0,remainingPathSegments:t};const[r,...n]=t;return _H(r)?Nb(e,n):{schema:Qe(e,r),remainingPathSegments:n,resolvedSegment:r}};var Gt;(function(e){e.HIDE="HIDE",e.SHOW="SHOW",e.ENABLE="ENABLE",e.DISABLE="DISABLE"})(Gt||(Gt={}));const Pb=(e,t)=>{if(!EH(e))return t??"";const r=Eb(e.scope);return pe(r)?t??"":Pd(t,r.join("."))},Rb=e=>typeof e=="object"&&e!==null&&typeof e.i18n=="string",$H=e=>e.type==="Group",SH=e=>e.elements!==void 0,jH=e=>!!e&&typeof e=="object",EH=e=>jH(e)&&typeof e.scope=="string",AH=e=>!!e&&typeof e=="object",NH=e=>e.type==="OR",PH=e=>e.type==="AND",RH=e=>e.type==="LEAF",TH=e=>Dv(e,"schema"),IH=e=>Dv(e,"validate")&&typeof e.validate=="function",Sl=(e,t)=>Pb(e,t),Ic=(e,t,r,n,s,o)=>{if(PH(r))return r.conditions.reduce((a,i)=>a&&Ic(e,t,i,n,s,o),!0);if(NH(r))return r.conditions.reduce((a,i)=>a||Ic(e,t,i,n,s,o),!1);if(RH(r))return pa(e,Sl(r,n))===r.expectedValue;if(TH(r)){const a=pa(e,Sl(r,n));return r.failWhenUndefined&&a===void 0?!1:s.validate(r.schema,a)}else if(IH(r)){const i={data:pa(e,Sl(r,n)),fullData:e,path:n,uischemaElement:t,config:o};return r.validate(i)}else return!0},Tb=(e,t,r,n,s)=>{const o=e.rule.condition;return Ic(t,e,o,r,n,s)},MH=(e,t,r=void 0,n,s)=>{const o=Tb(e,t,r,n,s);switch(e.rule.effect){case Gt.HIDE:return!o;case Gt.SHOW:return o;default:return!0}},zH=(e,t,r=void 0,n,s)=>{const o=Tb(e,t,r,n,s);switch(e.rule.effect){case Gt.DISABLE:return!o;case Gt.ENABLE:return o;default:return!0}},Id=e=>!!(e.rule&&(e.rule.effect===Gt.SHOW||e.rule.effect===Gt.HIDE)),OH=e=>!!(e.rule&&(e.rule.effect===Gt.ENABLE||e.rule.effect===Gt.DISABLE)),_o=(e,t,r=void 0,n,s)=>e.rule?MH(e,t,r,n,s):!0,DH=(e,t,r=void 0,n,s)=>e.rule?zH(e,t,r,n,s):!0,Ha=e=>!!e&&Object.prototype.hasOwnProperty.call(e,"oneOf")&&e.oneOf&&e.oneOf.every(t=>t.const!==void 0),LH=e=>!!e&&typeof e=="object"&&(Object.prototype.hasOwnProperty.call(e,"enum")||Object.prototype.hasOwnProperty.call(e,"const")),FH=(e,t)=>{const r=e.toISOString();return t==="date-time"?r:t==="date"?r.split("T")[0]:t==="time"?r.split("T")[1].split(".")[0]:r},Ib=e=>e.replace("#","root").replace(new RegExp("/","g"),"_"),nt=(e,t)=>Bv(en(e),t),en=e=>{if(pe(e))return[];if(!pe(e.type)&&typeof e.type=="string")return[e.type];if(K0(e.type))return e.type;if(!pe(e.properties)||!pe(e.additionalProperties))return["object"];if(!pe(e.items))return["array"];if(!pe(e.enum)){const t=new Set;return e.enum.forEach(r=>{typeof r=="string"?t.add("string"):en(r).forEach(n=>t.add(n))}),Array.from(t)}if(!pe(e.allOf)){const t=ND(e.allOf,r=>en(r).length!==0);if(t)return en(t)}return[]},qt={schema:zt,data:pa},BH=e=>Eb(e.scope).join("."),jl={compose:Pd,fromScoped:BH},Mb=e=>{const t=new q3({allErrors:!0,verbose:!0,strict:!1,addUsedSchema:!1,...e});return J3(t),t},sr=(e,t)=>e===void 0?[]:e(t)?[]:e.errors,UH=e=>{switch(e.keyword){case"required":case"dependencies":return e.params.missingProperty;case"additionalProperties":return e.params.additionalProperty;default:return}},Ga=e=>{let t=e.dataPath||e.instancePath||"";t=t.replace(/\//g,".");const r=UH(e);return r!==void 0&&!t.endsWith(r)&&(t=`${t}.${r}`),t=t.replace(/^./,""),t=ko(t),t},VH=(e,t,r)=>n=>{const s=Wa(n,o=>o.keyword==="oneOf"||o.keyword==="anyOf").map(o=>Ga(o));return Wa(n,o=>{if(KH.indexOf(o.keyword)!==-1&&!Ha(o.parentSchema))return!1;const a=Ga(o);let i=r(a);const u=o.parentSchema;return i&&!WH(u)&&!Ha(u)&&s.findIndex(c=>e.startsWith(c))!==-1&&(i=i&&Ky(u,t)),i})},WH=e=>(e==null?void 0:e.type)==="object"||!!(e!=null&&e.properties),KH=["additionalProperties","allOf","anyOf","oneOf"],HH=e=>e==null?"":e.join(`
130
+ `),qa={createLabelDescriptionFrom:Ab,convertToValidClassName:Ib},zb=e=>({type:e,elements:[]}),ma=e=>({type:"Control",scope:e}),GH=(e,t)=>{if(!pe(e)&&!SH(e)){const r=zb(t);return r.elements.push(e),r}return e},qH=(e,t)=>{if(!pe(t)){const r=Tv(t);if($H(e))e.label=r;else{const n={type:"Label",text:r};e.elements.push(n)}}},YH=e=>!pe(e)&&(!pe(e.oneOf)||!pe(e.anyOf)||!pe(e.allOf)),Mc=(e,t,r,n,s,o)=>{if(!pe(e)&&e.$ref!==void 0)return Mc(zt(o,e.$ref,o),t,r,n,s,o);if(YH(e)){const i=ma(r);return t.push(i),i}const a=en(e);if(a.length===0)return null;if(a.length>1){const i=ma(r);return t.push(i),i}if(r==="#"&&a[0]==="object"){const i=zb(s);if(t.push(i),e.properties&&zT(e.properties).length>1&&qH(i,n),!pe(e.properties)){const u=r+"/properties";Object.keys(e.properties).map(c=>{let d=e.properties[c];const f=`${u}/${Tc(c)}`;d.$ref!==void 0&&(d=zt(o,d.$ref,o)),Mc(d,i.elements,f,c,s,o)})}return i}switch(a[0]){case"object":case"array":case"string":case"number":case"integer":case"null":case"boolean":{const i=ma(r);return t.push(i),i}default:throw new Error("Unknown type: "+JSON.stringify(e))}},Ob=(e,t="VerticalLayout",r="#",n=e)=>GH(Mc(e,[],r,"",t,n),t),Ya={jsonSchema:Sb,uiSchema:Ob,controlElement:ma},Md="jsonforms/INIT",zd="jsonforms/UPDATE_CORE",Od="jsonforms/SET_AJV",Dd="jsonforms/UPDATE",Ld="jsonforms/UPDATE_ERRORS",JH="jsonforms/VALIDATE",Db="jsonforms/ADD_RENDERER",Lb="jsonforms/REMOVE_RENDERER",Fb="jsonforms/ADD_CELL",Bb="jsonforms/REMOVE_CELL",Fd="jsonforms/SET_CONFIG",Ub="jsonforms/ADD_UI_SCHEMA",Vb="jsonforms/REMOVE_UI_SCHEMA",Bd="jsonforms/SET_SCHEMA",Ud="jsonforms/SET_UISCHEMA",Vd="jsonforms/SET_VALIDATION_MODE",Wd="jsonforms/SET_LOCALE",Kd="jsonforms/SET_TRANSLATOR",Hd="jsonforms/UPDATE_I18N",Wb="jsonforms/ADD_DEFAULT_DATA",Kb="jsonforms/REMOVE_DEFAULT_DATA",ZH=e=>{if(!("type"in e)||typeof e.type!="string")return!1;switch(e.type){case"ADD":return"values"in e&&Array.isArray(e.values)&&e.values.length>0;case"REMOVE":return"indices"in e&&Array.isArray(e.indices)&&e.indices.length>0&&e.indices.every(t=>typeof t=="number");case"MOVE":return"moves"in e&&Array.isArray(e.moves)&&e.moves.length>0&&e.moves.every(t=>typeof t=="object"&&t!==null&&"from"in t&&"to"in t&&typeof t.from=="number"&&typeof t.to=="number");default:return!1}},QH=(e,t=Sb(e),r,n)=>({type:Md,data:e,schema:t,uischema:typeof r=="object"?r:Ob(t),options:n}),XH=(e,t,r,n)=>({type:zd,data:e,schema:t,uischema:r,options:n}),eG=(e,t)=>({type:Wb,schemaPath:e,data:t}),tG=e=>({type:Kb,schemaPath:e}),rG=e=>({type:Od,ajv:e}),Tn=(e,t,r)=>({type:Dd,path:e,updater:t,context:r}),nG=e=>({type:Ld,errors:e}),sG=(e,t)=>({type:Db,tester:e,renderer:t}),oG=(e,t)=>({type:Fb,tester:e,cell:t}),aG=(e,t)=>({type:Bb,tester:e,cell:t}),iG=(e,t)=>({type:Lb,tester:e,renderer:t}),lG=e=>({type:Fd,config:e}),cG=e=>({type:Vd,validationMode:e}),uG=(e,t)=>({type:Ub,tester:e,uischema:t}),dG=e=>({type:Vb,tester:e}),fG=e=>({type:Wd,locale:e}),hG=e=>({type:Bd,schema:e}),pG=(e,t)=>({type:Kd,translator:e,errorTranslator:t}),mG=(e,t,r)=>({type:Hd,locale:e,translator:t,errorTranslator:r}),gG=e=>({type:Ud,uischema:e});var _n=Object.freeze({__proto__:null,INIT:Md,UPDATE_CORE:zd,SET_AJV:Od,UPDATE_DATA:Dd,UPDATE_ERRORS:Ld,VALIDATE:JH,ADD_RENDERER:Db,REMOVE_RENDERER:Lb,ADD_CELL:Fb,REMOVE_CELL:Bb,SET_CONFIG:Fd,ADD_UI_SCHEMA:Ub,REMOVE_UI_SCHEMA:Vb,SET_SCHEMA:Bd,SET_UISCHEMA:Ud,SET_VALIDATION_MODE:Vd,SET_LOCALE:Wd,SET_TRANSLATOR:Kd,UPDATE_I18N:Hd,ADD_DEFAULT_DATA:Wb,REMOVE_DEFAULT_DATA:Kb,isUpdateArrayContext:ZH,init:QH,updateCore:XH,registerDefaultData:eG,unregisterDefaultData:tG,setAjv:rG,update:Tn,updateErrors:nG,registerRenderer:sG,registerCell:oG,unregisterCell:aG,unregisterRenderer:iG,setConfig:lG,setValidationMode:cG,registerUISchema:uG,unregisterUISchema:dG,setLocale:fG,setSchema:hG,setTranslator:pG,updateI18n:mG,setUISchema:gG});const vG={restrict:!1,trim:!1,showUnfocusedDescription:!1,hideRequiredAsterisk:!1},bm=(e={})=>wo({},vG,e),xm=(e=bm(),t)=>{switch(t.type){case Fd:return bm(t.config);default:return e}},yG={data:{},schema:{},uischema:void 0,errors:[],validator:void 0,ajv:void 0,validationMode:"ValidateAndShow",additionalErrors:[]},wm=(e,t)=>t&&bG(t.options)?t.options.validationMode:e.validationMode,bG=e=>e?e.validationMode!==void 0:!1,xG=e=>e?e.additionalErrors!==void 0:!1,km=(e,t)=>t&&xG(t.options)?t.options.additionalErrors:e.additionalErrors,_m=(e,t)=>{if(t){if(wG(t.options))return t.options.ajv;if(t.options!==void 0&&$A(t.options.compile))return t.options}return e.ajv?e.ajv:Mb()},wG=e=>e?e.ajv!==void 0:!1,El=(e=yG,t)=>{switch(t.type){case Md:{const r=_m(e,t),n=wm(e,t),s=n==="NoValidation"?void 0:r.compile(t.schema),o=sr(s,t.data),a=km(e,t);return{...e,data:t.data,schema:t.schema,uischema:t.uischema,additionalErrors:a,errors:o,validator:s,ajv:r,validationMode:n}}case zd:{const r=_m(e,t),n=wm(e,t);let s=e.validator,o=e.errors;e.schema!==t.schema||e.validationMode!==n||e.ajv!==r?(s=n==="NoValidation"?void 0:r.compile(t.schema),o=sr(s,t.data)):e.data!==t.data&&(o=sr(s,t.data));const a=km(e,t);return e.data!==t.data||e.schema!==t.schema||e.uischema!==t.uischema||e.ajv!==r||e.errors!==o||e.validator!==s||e.validationMode!==n||e.additionalErrors!==a?{...e,data:t.data,schema:t.schema,uischema:t.uischema,ajv:r,errors:Ky(o,e.errors)?e.errors:o,validator:s,validationMode:n,additionalErrors:a}:e}case Od:{const r=t.ajv,n=e.validationMode==="NoValidation"?void 0:r.compile(e.schema),s=sr(n,e.data);return{...e,validator:n,errors:s}}case Bd:{const n=t.schema&&e.ajv&&e.validationMode!=="NoValidation"?e.ajv.compile(t.schema):e.validator,s=sr(n,e.data);return{...e,validator:n,schema:t.schema,errors:s}}case Ud:return{...e,uischema:t.uischema};case Dd:{if(t.path===void 0||t.path===null)return e;if(t.path===""){const r=t.updater(Gs(e.data)),n=sr(e.validator,r);return{...e,data:r,errors:n}}else{const r=Qe(e.data,t.path),n=t.updater(Gs(r));let s;n!==void 0?s=gK(t.path,n,e.data===void 0?{}:e.data):s=IK(t.path,e.data===void 0?{}:e.data);const o=sr(e.validator,s);return{...e,data:s,errors:o}}}case Ld:return{...e,errors:t.errors};case Vd:{if(e.validationMode===t.validationMode)return e;if(t.validationMode==="NoValidation"){const r=sr(void 0,e.data);return{...e,errors:r,validationMode:t.validationMode}}if(e.validationMode==="NoValidation"){const r=e.ajv.compile(e.schema),n=sr(r,e.data);return{...e,validator:r,errors:n,validationMode:t.validationMode}}return{...e,validationMode:t.validationMode}}default:return e}};var tt;(function(e){e.addTooltip="addTooltip",e.addAriaLabel="addAriaLabel",e.removeTooltip="removeTooltip",e.upAriaLabel="upAriaLabel",e.downAriaLabel="downAriaLabel",e.noSelection="noSelection",e.removeAriaLabel="removeAriaLabel",e.noDataMessage="noDataMessage",e.deleteDialogTitle="deleteDialogTitle",e.deleteDialogMessage="deleteDialogMessage",e.deleteDialogAccept="deleteDialogAccept",e.deleteDialogDecline="deleteDialogDecline",e.up="up",e.down="down"})(tt||(tt={}));const kG=[{key:tt.addTooltip,default:e=>e?`Add to ${e}`:"Add"},{key:tt.addAriaLabel,default:e=>e?`Add to ${e} button`:"Add button"},{key:tt.removeTooltip,default:()=>"Delete"},{key:tt.removeAriaLabel,default:()=>"Delete button"},{key:tt.upAriaLabel,default:()=>"Move item up"},{key:tt.up,default:()=>"Up"},{key:tt.down,default:()=>"Down"},{key:tt.downAriaLabel,default:()=>"Move item down"},{key:tt.noDataMessage,default:()=>"No data"},{key:tt.noSelection,default:()=>"No selection"},{key:tt.deleteDialogTitle,default:()=>"Confirm Deletion"},{key:tt.deleteDialogMessage,default:()=>"Are you sure you want to delete the selected entry?"},{key:tt.deleteDialogAccept,default:()=>"Yes"},{key:tt.deleteDialogDecline,default:()=>"No"}];var In;(function(e){e.clearDialogTitle="clearDialogTitle",e.clearDialogMessage="clearDialogMessage",e.clearDialogAccept="clearDialogAccept",e.clearDialogDecline="clearDialogDecline"})(In||(In={}));In.clearDialogTitle,In.clearDialogMessage,In.clearDialogAccept,In.clearDialogDecline;const Gd=(e,t)=>Rb(t)?t.i18n:(e==null?void 0:e.i18n)??void 0,_G=e=>(e==null?void 0:e.split(".").filter(t=>!/^\d+$/.test(t)).join("."))||"root",Rr=(e,t,r)=>Gd(e,t)??_G(r),Ja=(e,t,r,n)=>`${Rr(e,t,r)}.${n}`,CG=(e,t)=>`${e}.${t}`,qd=(e,t)=>t,Yd=(e,t,r)=>{var i;const n=Ja(e.parentSchema,r,Ga(e),`error.${e.keyword}`),s=t(n,void 0,{error:e});if(s!==void 0)return s;const o=t(`error.${e.keyword}`,void 0,{error:e});if(o!==void 0)return o;const a=t(e.message,void 0,{error:e});return a!==void 0?a:e.keyword==="required"&&((i=e.message)!=null&&i.startsWith("must have required property"))?t("is a required property","is a required property",{error:e}):e.message},Hb=(e,t,r,n,s,o)=>{if(e.length>0&&r){const a=Ja(n,s,o,"error.custom"),i=r(a,void 0,{schema:n,uischema:s,path:o,errors:e});if(i!==void 0)return i}return HH(e.map(a=>t(a,r,s)))},Gb=(e,t)=>{if(e.label===!1||(e.label===void 0||e.label===null||e.label===!0)&&!Rb(e))return;const r=typeof e.label=="string"?e.label:JSON.stringify(e.label),n=Gd(void 0,e),s=typeof n=="string"?`${n}.label`:r;return t(s,r,{uischema:e})},$G=(e,t,r,n)=>{const s={};return t.forEach(o=>{const a=CG(r,o.key);s[o.key]=e(a,o.default(n))}),s},SG=e=>e===void 0?qd:e.translate,jG=e=>e===void 0?Yd:e.translateError,Yt=()=>e=>SG(Qe(e,"jsonforms.i18n")),qb=()=>e=>jG(Qe(e,"jsonforms.i18n")),Mn={locale:"en",translate:qd,translateError:Yd},Cm=(e=Mn,t)=>{switch(t.type){case Hd:{const r=t.locale??Mn.locale,n=t.translator??Mn.translate,s=t.errorTranslator??Mn.translateError;return r!==e.locale||n!==e.translate||s!==e.translateError?{...e,locale:r,translate:n,translateError:s}:e}case Kd:return{...e,translate:t.translator??qd,translateError:t.errorTranslator??Yd};case Wd:return{...e,locale:t.locale??navigator.languages[0]};default:return e}},Kn=-1,cr=e=>!pe(e)&&e.scope!==void 0,Ot=e=>(t,r,n)=>{if(pe(t)||!cr(t)||pe(r))return!1;const s=t.scope;if(pe(s))return!1;let o=r;return nt(r,"object")&&(o=zt(r,s,n==null?void 0:n.rootSchema)),o===void 0?!1:e(o,n==null?void 0:n.rootSchema)},Jd=(e,t)=>(r,n,s)=>{if(pe(r)||!cr(r))return!1;const o=r.scope;let a=n;return nt(n,"object")&&(a=zt(n,o,s==null?void 0:s.rootSchema)),a=Qe(a,e),a===void 0?!1:t(a,s==null?void 0:s.rootSchema)},hr=e=>Ot(t=>!pe(t)&&nt(t,e)),Pi=e=>Ot(t=>!pe(t)&&t.format===e&&nt(t,"string")),De=e=>t=>!pe(t)&&t.type===e,gr=(e,t)=>r=>{if(pe(r))return!1;const n=r.options;return!pe(n)&&n[e]===t},EG=e=>t=>{if(pe(t))return!1;const r=t.options;return!pe(r)&&!bH(r[e])},AG=e=>t=>pe(e)||!cr(t)?!1:VK(t.scope,e),NG=e=>t=>{if(pe(e)||!cr(t))return!1;const r=t.scope;return!pe(r)&&yK(r.split("/"))===e},Fe=(...e)=>(t,r,n)=>e.reduce((s,o)=>s&&o(t,r,n),!0),Co=(...e)=>(t,r,n)=>e.reduce((s,o)=>s||o(t,r,n),!1),Ve=(e,t)=>(r,n,s)=>t(r,n,s)?e:Kn,PG=(e,t)=>(r,n,s)=>{const o=t(r,n,s);return o===Kn?Kn:o+e},Yb=Fe(De("Control"),hr("boolean")),RG=Fe(De("Control"),hr("object")),TG=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"allOf"))),IG=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"anyOf"))),MG=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"oneOf"))),Zd=Fe(De("Control"),Ot(e=>LH(e))),Qd=Fe(De("Control"),Ot(e=>Ha(e))),Jb=Fe(De("Control"),hr("integer")),Zb=Fe(De("Control"),hr("number")),Qb=Fe(De("Control"),hr("string")),Xb=Fe(De("Control"),gr("multi",!0)),ex=Fe(De("Control"),Co(Pi("date"),gr("format","date"))),tx=Fe(De("Control"),Co(Pi("time"),gr("format","time"))),rx=Fe(De("Control"),Co(Pi("date-time"),gr("format","date-time"))),nx=Fe(Ot((e,t)=>nt(e,"array")&&!Array.isArray(zt(e,"items",t))),Jd("items",(e,t)=>{const r=e.$ref?zt(t,e.$ref,t):e;return nt(r,"object")})),sx=Fe(De("Control"),nx),Os=(e,t,r)=>{if(K0(e))return Rc(e,(n,s)=>n||Os(s,t,r),!1);if(t(e))return!0;if(e.$ref){const n=zt(r,e.$ref,r);if(n&&!n.$ref)return Os(n,t,r)}return e.items?Os(e.items,t,r):e.properties?Rc(gH(e.properties),(n,[s,o])=>n||Os(o,t,r),!1):!1},ox=(e,t,r)=>{if(!De("Control")(e,t,r))return!1;const n=e.scope,s=zt(t,n,(r==null?void 0:r.rootSchema)??t);let o=0;if(s!==void 0&&s.items!==void 0){if(Os(s.items,a=>a===t||a.$ref!==void 0?!1:!!(a.anyOf||a.allOf||a.oneOf&&!Ha(a)||nt(a,"object")&&(o++,o===2)||nt(a,"array")),r==null?void 0:r.rootSchema))return!0;if(e.options&&e.options.detail){if(typeof e.options.detail=="string")return e.options.detail.toUpperCase()!=="DEFAULT";if(typeof e.options.detail=="object"&&e.options.detail.type)return!0}}return!1},zG=sx,OG=Fe(De("Control"),Ot((e,t)=>en(e).length!==0&&!Array.isArray(zt(e,"items",t))),Jd("items",(e,t)=>{const r=e.$ref?zt(t,e.$ref,t):e,n=en(r);return n.length===1&&Bv(["integer","number","boolean","string"],n[0])})),ax=Fe(De("Control"),Co(hr("number"),hr("integer")),Ot(e=>Object.prototype.hasOwnProperty.call(e,"maximum")&&Object.prototype.hasOwnProperty.call(e,"minimum")&&Object.prototype.hasOwnProperty.call(e,"default")),gr("slider",!0)),DG=Fe(De("Control"),hr("integer"),gr("format",!0)),ix=e=>e.type==="Categorization",lx=e=>e.type==="Category",Xd=e=>pe(e.elements)?!1:e.elements.map(t=>ix(t)?Xd(t):lx(t)).reduce((t,r)=>t&&r,!0),LG=e=>Xd(e),FG=e=>(t,r,n)=>!e(t,r,n);var BG=Object.freeze({__proto__:null,NOT_APPLICABLE:Kn,isControl:cr,schemaMatches:Ot,schemaSubPathMatches:Jd,schemaTypeIs:hr,formatIs:Pi,uiTypeIs:De,optionIs:gr,hasOption:EG,scopeEndsWith:AG,scopeEndIs:NG,and:Fe,or:Co,rankWith:Ve,withIncreasedRank:PG,isBooleanControl:Yb,isObjectControl:RG,isAllOfControl:TG,isAnyOfControl:IG,isOneOfControl:MG,isEnumControl:Zd,isOneOfEnumControl:Qd,isIntegerControl:Jb,isNumberControl:Zb,isStringControl:Qb,isMultiLineControl:Xb,isDateControl:ex,isTimeControl:tx,isDateTimeControl:rx,isObjectArray:nx,isObjectArrayControl:sx,isObjectArrayWithNesting:ox,isArrayObjectControl:zG,isPrimitiveArrayControl:OG,isRangeControl:ax,isNumberFormatControl:DG,isCategorization:ix,isCategory:lx,hasCategory:Xd,categorizationHasCategory:LG,not:FG});const UG=e=>(t,r,n)=>{const s=ki(e,o=>o.tester(t,r,n));if(s!==void 0&&s.tester(t,r,n)!==Kn)return s.uischema},VG=(e,t,r,n,s="VerticalLayout",o,a)=>{if(o&&o.options&&o.options.detail){if(typeof o.options.detail=="string"){if(o.options.detail.toUpperCase()==="GENERATE")return typeof s=="function"?s():Ya.uiSchema(t,s,void 0,a)}else if(typeof o.options.detail=="object"&&o.options.detail.type&&typeof o.options.detail.type=="string")return o.options.detail}const i=UG(e)(t,r,n);return i===void 0?typeof s=="function"?s():Ya.uiSchema(t,s,"#",a):i},$m=(e,t,r)=>r(e,t),cx=(e,t,r)=>n=>{const s=n.errors??[],o=n.additionalErrors??[];return VH(e,t,r)(n.validationMode==="ValidateAndHide"?o:[...s,...o])},WG=(e,t)=>cx(e,t,r=>r===e),KG=(e,t)=>cx(e,t,r=>r.startsWith(e+".")),ux=(e,t)=>r=>WG(e,t)(r.jsonforms.core),HG=(e,t)=>r=>KG(e,t)(r.jsonforms.core),Ri=e=>qG(Qe(e,"jsonforms.core")),Za=e=>YG(Qe(e,"jsonforms.core")),GG=e=>JG(Qe(e,"jsonforms.core")),as=e=>ZG(Qe(e,"jsonforms.core")),ef=e=>Qe(e,"jsonforms.renderers"),tf=e=>Qe(e,"jsonforms.cells"),qG=e=>Qe(e,"data"),YG=e=>Qe(e,"schema"),JG=e=>Qe(e,"uischema"),ZG=e=>Qe(e,"ajv"),pr=e=>e.jsonforms.config,rf=(e,t,r,n,s,o)=>{var a,i,u;return(a=e==null?void 0:e.jsonforms)!=null&&a.readonly?!1:r&&OH(r)?DH(r,s,t==null?void 0:t.path,as(e),o):typeof((i=r==null?void 0:r.options)==null?void 0:i.readonly)=="boolean"?!r.options.readonly:typeof((u=r==null?void 0:r.options)==null?void 0:u.readOnly)=="boolean"?!r.options.readOnly:typeof(o==null?void 0:o.readonly)=="boolean"?!o.readonly:typeof(o==null?void 0:o.readOnly)=="boolean"?!o.readOnly:(n==null?void 0:n.readOnly)===!0?!1:typeof(t==null?void 0:t.enabled)=="boolean"?t.enabled:!0},dx=(e,t,r)=>{const n=t+r;if(n<0||n>=e.length)return;const s=[t,n].sort((o,a)=>o-a);e.splice(s[0],2,e[s[1]],e[s[0]])},QG=(e,t)=>{dx(e,t,-1)},XG=(e,t)=>{dx(e,t,1)},eq=(e,t,r)=>{const n=t.split("/"),s=ko(n[n.length-1]),a=n.slice(0,n.length-2).join("/"),i=qt.schema(e,a,r);return i!==void 0&&i.required!==void 0&&i.required.indexOf(s)!==-1},fx=(e,t,r)=>`${e??""}${t&&!r?"*":""}`,hx=(e,t)=>{const r=px(e,t);return r===void 0?{}:r},px=(e,t)=>{const r=typeof e.$ref=="string"?qt.schema(t,e.$ref,t):e;if(r.default!==void 0)return Sm(r,t);if(nt(r,"string"))return r.format==="date-time"||r.format==="date"||r.format==="time"?FH(new Date,r.format):"";if(nt(r,"integer")||nt(r,"number"))return 0;if(nt(r,"boolean"))return!1;if(nt(r,"array"))return[];if(nt(r,"object"))return Sm(r,t);if(nt(r,"null"))return null;const n=["oneOf","anyOf","allOf"];for(const s of n)if(e[s]&&Array.isArray(e[s])){const o=tq(e[s],t);if(o!==void 0)return o}},tq=(e,t)=>{if(e.length>0)for(const r of e){const n=px(r,t);if(n!==void 0)return n}},Sm=(e,t)=>{if(nt(e,"object")&&e.default===void 0){const r={};for(const n in e.properties){const s=e.properties[n],o=s.$ref?qt.schema(t,s.$ref,t):s;o&&o.default!==void 0&&(r[n]=Gs(o.default))}return e.allOf&&Array.isArray(e.allOf)&&e.allOf.forEach(n=>{if(n&&n.properties)for(const s in n.properties){const o=n.properties[s],a=o.$ref?qt.schema(t,o.$ref,t):o;a&&a.default!==void 0&&(r[s]=Gs(a.default))}}),r}return Gs(e.default)},mx=(e,t,r,n)=>t===void 0||t!==void 0&&!e||!n&&!r,Qa=(e,t,r)=>{let n=typeof e=="string"?e:JSON.stringify(e);return t&&(r?n=t(`${r}.${n}`,n):n=t(n,n)),{label:n,value:e}},gx=(e,t,r)=>{let n=e.title??(typeof e.const=="string"?e.const:JSON.stringify(e.const));return t&&(e.i18n?n=t(e.i18n,n):r?n=t(`${r}.${n}`,n):n=t(n,n)),{label:n,value:e.const}},Ti=(e,t)=>{const{uischema:r}=t,n=Ri(e),s=Pb(r,t.path),o=pr(e),a=t.visible===void 0||Id(r)?_o(r,n,t.path,as(e),o):t.visible,i=r,u=t.id,c=Za(e),d=i.scope!==void 0&&eq(t.schema,i.scope,c),f=qt.schema(t.schema||c,i.scope,c),p=ux(s,f)(e),h=f!==void 0?f.description:"",g=qt.data(n,s),m=Ab(r,f),v=m.show?m.text:"",y=rf(e,t,r,f||c,n,o),b=f??c,_=Yt()(e),w=qb()(e),$=Rr(b,r,s),R=_(Ja(b,r,s,"label"),v,{schema:b,uischema:r,path:s,errors:p}),M=_(Ja(b,r,s,"description"),h,{schema:b,uischema:r,path:s,errors:p}),D=Hb(p,w,_,b,r,s);return{data:g,description:M,errors:D,label:R,visible:a,enabled:y,id:u,path:s,required:d,uischema:r,schema:b,config:pr(e),cells:t.cells||e.jsonforms.cells,rootSchema:c,i18nKeyPrefix:$}},rq=e=>({handleChange(t,r){e(Tn(t,()=>r))}}),nq=(e,t)=>{var s;const r=Ti(e,t),n=t.options||((s=r.schema.enum)==null?void 0:s.map(o=>Qa(o,Yt()(e),Rr(r.schema,r.uischema,r.path))))||r.schema.const&&[Qa(r.schema.const,Yt()(e),Rr(r.schema,r.uischema,r.path))];return{...r,options:n}},sq=(e,t)=>{var s;const r=Ti(e,t),n=t.options||((s=r.schema.oneOf)==null?void 0:s.map(o=>gx(o,Yt()(e),Rr(r.schema,r.uischema,r.path))));return{...r,options:n}},oq=(e,t)=>{const{...r}=Ti(e,t);return{...r,uischemas:e.jsonforms.uischemas}},aq=(e,t)=>{const{path:r,schema:n,uischema:s,label:o,...a}=oq(e,t),i=qt.schema(n,"items",a.rootSchema),u=HG(r,i)(e);return{...a,label:o,path:r,uischema:s,schema:i,arraySchema:n,childErrors:u,renderers:t.renderers||ef(e),cells:t.cells||tf(e)}},iq=e=>({addItem:(t,r)=>()=>{e(Tn(t,n=>n==null?[r]:(n.push(r),n),{type:"ADD",values:[r]}))},removeItems:(t,r)=>()=>{e(Tn(t,n=>(r.sort((s,o)=>s-o).reverse().forEach(s=>n.splice(s,1)),n),{type:"REMOVE",indices:r}))},moveUp:(t,r)=>()=>{e(Tn(t,n=>(QG(n,r),n),{type:"MOVE",moves:[{from:r,to:r-1}]}))},moveDown:(t,r)=>()=>{e(Tn(t,n=>(XG(n,r),n),{type:"MOVE",moves:[{from:r,to:r+1}]}))}}),vx={visible:!0,enabled:!0,path:"",direction:"column"},lq=e=>e.type==="HorizontalLayout"?"row":e.type==="VerticalLayout"?"column":vx.direction,cq=(e,t)=>{const r=Ri(e),{uischema:n}=t,s=t.visible===void 0||Id(n)?_o(t.uischema,r,t.path,as(e),pr(e)):t.visible,o=qt.data(r,t.path),a=pr(e),i=rf(e,t,n,void 0,r,a),u=Yt()(e),c=AH(n)?Gb(n,u):void 0;return{...vx,renderers:t.renderers||ef(e),cells:t.cells||tf(e),visible:s,enabled:i,path:t.path,data:o,uischema:t.uischema,schema:t.schema,direction:t.direction??lq(n),config:a,label:c}},uq=(e,t)=>({renderers:t.renderers||Qe(e.jsonforms,"renderers"),cells:t.cells||Qe(e.jsonforms,"cells"),schema:t.schema||Za(e),rootSchema:Za(e),uischema:t.uischema||GG(e),path:t.path,enabled:t.enabled,config:pr(e)}),dq=(e,t)=>{const{uischema:r}=t,n=t.visible===void 0||Id(r)?_o(t.uischema,Ri(e),t.path,as(e),pr(e)):t.visible,s=r.text,o=Yt()(e),a=Gd(void 0,r),i=a?`${a}.text`:s??"";return{text:o(i,s,{uischema:r}),visible:n,config:pr(e),renderers:t.renderers||ef(e),cells:t.cells||tf(e),uischema:r}},Ii=(e,t)=>{const{id:r,schema:n,path:s,uischema:o,renderers:a,cells:i}=t,u=Ri(e),c=pr(e),d=t.visible!==void 0?t.visible:_o(o,u,void 0,as(e),c),f=Za(e);let p;e.jsonforms.readonly===!0?p=!1:typeof t.enabled=="boolean"?p=t.enabled:p=rf(e,t,o,n||f,u,c);const h=Yt()(e),g=qb()(e),m=Hb(ux(s,n)(e),g,h,n,o,s),v=pe(m);return{data:qt.data(u,s),visible:d,enabled:p,id:r,path:s,errors:m,isValid:v,schema:n,uischema:o,config:pr(e),rootSchema:f,renderers:a,cells:i}},fq=(e,t)=>{const r=Ii(e,t),{renderers:n,cells:s,...o}=t;return{...r,...o,cells:s||e.jsonforms.cells||[]}},hq=(e,t)=>{var s;const r=Ii(e,t),n=t.options||((s=r.schema.enum)==null?void 0:s.map(o=>Qa(o,Yt()(e),Rr(r.schema,r.uischema,r.path))))||r.schema.const&&[Qa(r.schema.const,Yt()(e),Rr(r.schema,r.uischema,r.path))];return{...r,options:n}},pq=(e,t)=>{var s;const r=Ii(e,t),n=t.options||((s=r.schema.oneOf)==null?void 0:s.map(o=>gx(o,Yt()(e),Rr(r.schema,r.uischema,r.path))));return{...r,options:n}};var mq=ut,gq=function(){return mq.Date.now()},vq=gq,yq=xt,Al=vq,jm=Mv,bq="Expected a function",xq=Math.max,wq=Math.min;function kq(e,t,r){var n,s,o,a,i,u,c=0,d=!1,f=!1,p=!0;if(typeof e!="function")throw new TypeError(bq);t=jm(t)||0,yq(r)&&(d=!!r.leading,f="maxWait"in r,o=f?xq(jm(r.maxWait)||0,t):o,p="trailing"in r?!!r.trailing:p);function h(R){var M=n,D=s;return n=s=void 0,c=R,a=e.apply(D,M),a}function g(R){return c=R,i=setTimeout(y,t),d?h(R):a}function m(R){var M=R-u,D=R-c,j=t-M;return f?wq(j,o-D):j}function v(R){var M=R-u,D=R-c;return u===void 0||M>=t||M<0||f&&D>=o}function y(){var R=Al();if(v(R))return b(R);i=setTimeout(y,m(R))}function b(R){return i=void 0,p&&n?h(R):(n=s=void 0,a)}function _(){i!==void 0&&clearTimeout(i),c=0,n=u=s=i=void 0}function w(){return i===void 0?a:b(Al())}function $(){var R=Al(),M=v(R);if(n=arguments,s=this,u=R,M){if(i===void 0)return g(u);if(f)return clearTimeout(i),i=setTimeout(y,t),h(u)}return i===void 0&&(i=setTimeout(y,t)),a}return $.cancel=_,$.flush=w,$}var _q=kq;const Cq=je(_q);class $q extends U.Component{constructor(t){super(t)}}class Sq extends $q{constructor(t){super(t),this.handleChange=r=>{this.setState({value:r}),this.updateData(r)},this.onFocus=()=>{this.setState({isFocused:!0})},this.onBlur=()=>{this.setState({isFocused:!1})},this.updateData=r=>{this.props.handleChange(this.props.path,r)},this.state={value:t.data?t.data:"",isFocused:!1}}}class yx extends x.Component{render(){return U.createElement("div",{style:{color:"red"}},"No applicable ",this.props.type," found.")}}const jq={data:{},schema:{},uischema:void 0,errors:[],additionalErrors:[],validator:void 0,ajv:void 0},bx=U.createContext({core:jq,renderers:[]}),Eq=(e,t)=>{const r=x.useRef(!0);x.useEffect(()=>{if(r.current){r.current=!1;return}e()},t)},Aq=({children:e,initState:t,onChange:r,middleware:n})=>{var $,R,M;const{data:s,schema:o,uischema:a,ajv:i,validationMode:u,additionalErrors:c}=t.core,d=x.useRef(n??$m);d.current=n??$m;const[f,p]=x.useState(()=>d.current(t.core,_n.init(s,o,a,{ajv:i,validationMode:u,additionalErrors:c}),El));x.useEffect(()=>p(D=>d.current(D,_n.updateCore(s,o,a,{ajv:i,validationMode:u,additionalErrors:c}),El)),[s,o,a,i,u,c]);const[h,g]=x.useReducer(xm,void 0,()=>xm(void 0,_n.setConfig(t.config)));Eq(()=>{g(_n.setConfig(t.config))},[t.config]);const[m,v]=x.useReducer(Cm,void 0,()=>{var D,j,S;return Cm(t.i18n,_n.updateI18n((D=t.i18n)==null?void 0:D.locale,(j=t.i18n)==null?void 0:j.translate,(S=t.i18n)==null?void 0:S.translateError))});x.useEffect(()=>{var D,j,S;v(_n.updateI18n((D=t.i18n)==null?void 0:D.locale,(j=t.i18n)==null?void 0:j.translate,(S=t.i18n)==null?void 0:S.translateError))},[($=t.i18n)==null?void 0:$.locale,(R=t.i18n)==null?void 0:R.translate,(M=t.i18n)==null?void 0:M.translateError]);const y=x.useCallback(D=>{p(j=>d.current(j,D,El))},[]),b=x.useMemo(()=>({core:f,renderers:t.renderers,cells:t.cells,config:h,uischemas:t.uischemas,readonly:t.readonly,i18n:m,dispatch:y}),[f,t.renderers,t.cells,h,t.uischemas,t.readonly,m]),_=x.useRef(r);x.useEffect(()=>{_.current=r},[r]);const w=x.useCallback(Cq((...D)=>{var j;return(j=_.current)==null?void 0:j.call(_,...D)},10),[]);return x.useEffect(()=>{w({data:f.data,errors:f.errors})},[f.data,f.errors]),U.createElement(bx.Provider,{value:b},e)},$o=()=>x.useContext(bx),Nq=(e,t)=>aq({jsonforms:{...e}},t),Pq=(e,t)=>cq({jsonforms:{...e}},t),Rq=(e,t)=>Ti({jsonforms:{...e}},t),Tq=(e,t)=>{var s;const r=nq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},Iq=(e,t)=>{var s;const r=sq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},zr=e=>x.useMemo(()=>rq(e),[e]),Mq=(e,t)=>uq({jsonforms:{...e}},t),zq=e=>({...zr(e),...x.useMemo(()=>iq(e),[e])}),Oq=(e,t)=>Ii({jsonforms:{...e}},t),Dq=(e,t)=>{var s;const r=hq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},Lq=(e,t)=>{var s;const r=pq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},Fq=(e,t)=>fq({jsonforms:{...e}},t),Bq=(e,t)=>dq({jsonforms:{...e}},t),Dt=e=>function(r){const n=$o();return U.createElement(e,{ctx:n,props:r})},Uq=e=>function({ctx:r,props:n}){const s=Mq(r,n);return U.createElement(e,{...n,...s})},Vq=e=>function({ctx:r,props:n}){const s=Rq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...s,...o})},Wq=e=>function({ctx:r,props:n}){const s=Pq(r,n);return U.createElement(e,{...n,...s})},Kq=e=>function({ctx:r,props:n}){const s=Nq(r,n),o=zq(r.dispatch);return U.createElement(e,{...n,...s,...o})},Hq=e=>function({ctx:r,props:n}){const s=Oq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},Gq=e=>function({ctx:r,props:n}){const s=Fq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},qq=e=>function({ctx:r,props:n}){const s=Dq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},Yq=e=>function({ctx:r,props:n}){const s=Tq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},Jq=e=>function({ctx:r,props:n}){const s=Lq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},Zq=e=>function({ctx:r,props:n}){const s=Iq(r,n),o=zr(r.dispatch);return U.createElement(e,{...n,...o,...s})},Qq=e=>function({ctx:r,props:n}){const s=Bq(r,n);return U.createElement(e,{...n,...s})},xx=(e,t=!0)=>Dt(Uq(t?U.memo(e):e)),Xq=(e,t=!0)=>Dt(Vq(t?U.memo(e):e)),Mi=(e,t=!0)=>Dt(Wq(t?U.memo(e):e)),wx=(e,t=!0)=>Dt(Kq(t?U.memo(e):e)),Qt=(e,t=!0)=>Dt(Hq(t?U.memo(e):e)),eY=(e,t=!0)=>Dt(Gq(t?U.memo(e):e)),tY=(e,t=!0)=>Dt(qq(t?U.memo(e):e)),rY=(e,t=!0)=>Dt(Yq(t?U.memo(e):e)),nY=(e,t=!0)=>Dt(Jq(t?U.memo(e):e)),sY=(e,t=!0)=>Dt(Zq(t?U.memo(e):e)),oY=(e,t=!0)=>Dt(Qq(t?U.memo(e):e)),So=e=>function(r){var a,i;const n=$o(),s=((a=n.i18n)==null?void 0:a.locale)??Mn.locale,o=((i=n.i18n)==null?void 0:i.translate)??Mn.translate;return U.createElement(e,{...r,locale:s,t:o})},kx=e=>function(r){const n=x.useMemo(()=>$G(r.t,kG,r.i18nKeyPrefix,r.label),[r.t,r.i18nKeyPrefix,r.label]);return U.createElement(e,{...r,translations:n})};class _x extends U.Component{constructor(t){super(t),this.state={id:cr(t.uischema)?vm(t.uischema.scope):void 0}}componentWillUnmount(){cr(this.props.uischema)&&ym(this.state.id)}componentDidUpdate(t){t.schema!==this.props.schema&&(ym(this.state.id),this.setState({id:cr(this.props.uischema)?vm(this.props.uischema.scope):void 0}))}render(){const{schema:t,rootSchema:r,uischema:n,path:s,enabled:o,renderers:a,cells:i,config:u}=this.props;return U.createElement(aY,{uischema:n,schema:t,rootSchema:r,path:s,enabled:o,renderers:a,cells:i,id:this.state.id,config:u})}}const aY=U.memo(function(t){const r=x.useMemo(()=>({rootSchema:t.rootSchema,config:t.config}),[t.rootSchema,t.config]),n=x.useMemo(()=>ki(t.renderers,s=>s.tester(t.uischema,t.schema,r)),[t.renderers,t.uischema,t.schema,r]);if(n===void 0||n.tester(t.uischema,t.schema,r)===-1)return U.createElement(yx,{type:"renderer"});{const s=n.renderer;return U.createElement(s,{uischema:t.uischema,schema:t.schema,path:t.path,enabled:t.enabled,renderers:t.renderers,cells:t.cells,id:t.id})}});class iY extends _x{constructor(t){super(t)}}const zi=xx(_x);xx(iY);const lY=e=>{const{ajv:t,data:r,schema:n,uischema:s,renderers:o,cells:a,onChange:i,config:u,uischemas:c,readonly:d,validationMode:f,i18n:p,additionalErrors:h,middleware:g}=e,m=x.useMemo(()=>n!==void 0?n:Ya.jsonSchema(r),[n,r]),v=x.useMemo(()=>typeof s=="object"?s:Ya.uiSchema(m,void 0,void 0,m),[s,m]);return U.createElement(Aq,{initState:{core:{ajv:t,data:r,schema:m,uischema:v,validationMode:f,additionalErrors:h},config:u,uischemas:c,renderers:o,cells:a,readonly:d,i18n:p},onChange:i,middleware:g},U.createElement(zi,null))},cY=({uischema:e,schema:t,rootSchema:r,path:n,cells:s,id:o,enabled:a,renderers:i,config:u})=>{const c=x.useMemo(()=>({rootSchema:r,config:u}),[r,u]),d=x.useMemo(()=>ki(s,f=>f.tester(e,t,c)),[s,e,t,c]);if(d===void 0||d.tester(e,t,c)===-1)return U.createElement(yx,{type:"cell"});{const f=d.cell;return U.createElement(f,{uischema:e,schema:t,enabled:a,path:n,id:o,renderers:i,cells:s})}},zc=eY(cY);var uY=Array.prototype,dY=uY.join;function fY(e,t){return e==null?"":dY.call(e,t)}var hY=fY;const Cx=je(hY);var pY=hn,$x=pY("filter",Wy);$x.placeholder=Mr();var mY=$x;const Em=je(mY);var Nl,Am;function gY(){if(Am)return Nl;Am=1;var e=pd,t=mr;function r(n,s){var o=-1,a=t(n)?Array(n.length):[];return e(n,function(i,u,c){a[++o]=s(i,u,c)}),a}return Nl=r,Nl}var Pl,Nm;function vY(){if(Nm)return Pl;Nm=1;var e=ho,t=fn,r=gY(),n=Ue;function s(o,a){var i=n(o)?e:r;return i(o,t(a))}return Pl=s,Pl}var yY=hn,Sx=yY("map",vY());Sx.placeholder=Mr();var bY=Sx;const Pm=je(bY);var Rl,Rm;function xY(){if(Rm)return Rl;Rm=1;var e=Sd(),t=kb,r=$d(),n=hb(),s=Ue,o=pb(),a="Expected a function",i=8,u=32,c=128,d=256;function f(p){return t(function(h){var g=h.length,m=g,v=e.prototype.thru;for(p&&h.reverse();m--;){var y=h[m];if(typeof y!="function")throw new TypeError(a);if(v&&!b&&n(y)=="wrapper")var b=new e([],!0)}for(m=b?m:g;++m<g;){y=h[m];var _=n(y),w=_=="wrapper"?r(y):void 0;w&&o(w[0])&&w[1]==(c|i|u|d)&&!w[4].length&&w[9]==1?b=b[n(w[0])].apply(b,w[3]):b=y.length==1&&o(y)?b[_]():b.thru(y)}return function(){var $=arguments,R=$[0];if(b&&$.length==1&&s(R))return b.plant(R).value();for(var M=0,D=g?h[M].apply(this,$):R;++M<g;)D=h[M].call(this,D);return D}})}return Rl=f,Rl}var Tl,Tm;function wY(){if(Tm)return Tl;Tm=1;var e=xY(),t=e();return Tl=t,Tl}var kY=hn,jx=kY("flow",wY());jx.placeholder=Mr();var _Y=jx;const Im=je(_Y);var Il,Mm;function Ex(){return Mm||(Mm=1,Il={cap:!1,curry:!1,fixed:!1,immutable:!1,rearg:!1}),Il}var CY=hn,Ax=CY("keys",Jt,Ex());Ax.placeholder=Mr();var $Y=Ax;const zm=je($Y);var SY=hn,Nx=SY("startCase",Rv,Ex());Nx.placeholder=Mr();var jY=Nx;const EY=je(jY),Px={"enum.none":"None"},qs=e=>(t,...r)=>{const n=Wa(e,s=>s.name===t);return Rc(n,(s,o)=>typeof o.classNames=="function"?s.concat(o.classNames(r)):s.concat(o.classNames),[])},It=e=>(t,...r)=>Cx(qs(e)(t,r)," "),AY=[{name:"control",classNames:["control"]},{name:"control.trim",classNames:["trim"]},{name:"control.input",classNames:["input"]},{name:"control.select",classNames:["select"]},{name:"control.checkbox",classNames:["checkbox"]},{name:"control.radio",classNames:["radio"]},{name:"control.radio.option",classNames:["radio-option"]},{name:"control.radio.input",classNames:["radio-input"]},{name:"control.radio.label",classNames:["radio-label"]},{name:"control.validation.error",classNames:["validation_error"]},{name:"control.validation",classNames:["validation"]},{name:"categorization",classNames:["categorization"]},{name:"categorization.master",classNames:["categorization-master"]},{name:"categorization.detail",classNames:["categorization-detail"]},{name:"category.group",classNames:["category-group"]},{name:"category.subcategories",classNames:["category-subcategories"]},{name:"array.layout",classNames:["array-layout"]},{name:"array.children",classNames:["children"]},{name:"group.layout",classNames:["group-layout"]},{name:"horizontal.layout",classNames:["horizontal-layout"]},{name:"horizontal.layout.item",classNames:([e])=>[`horizontal-layout-${e}`]},{name:"vertical.layout",classNames:["vertical-layout"]},{name:"array.table.validation.error",classNames:["validation_error"]},{name:"array.table.validation",classNames:["validation"]},{name:"array.table",classNames:["array-table-layout","control"]},{name:"array.control.validation.error",classNames:["validation_error"]},{name:"array.control.validation",classNames:["validation"]},{name:"array.control.add",classNames:["button-add"]},{name:"array.child.controls",classNames:["child-controls"]},{name:"array.child.controls.up",classNames:["button-up"]},{name:"array.child.controls.down",classNames:["button-down"]},{name:"array.child.controls.delete",classNames:["button-delete"]},{name:"array.control",classNames:["array-control-layout","control"]},{name:"input.description",classNames:["input-description"]}],NY={styles:AY},PY=U.createContext(NY),RY=()=>x.useContext(PY),nf=()=>{const{styles:e}=RY();return e},Xt=e=>function(r){const n=$o(),s=nf(),o=r.uischema,a=n.config,i=a&&a.trim,u=x.useMemo(()=>qs(s)("control"),[s]);let c=pe(o.scope)?[""]:u.concat([`${Ib(o.scope)}`]);i&&(c=c.concat(qs(s)("control.trim")));const d=pe(r.errors),f=x.useMemo(()=>It(s)("control.label"),[s]),p=x.useMemo(()=>It(s)("input.description"),[s]),h=x.useMemo(()=>It(s)("control.validation"),[s]),g=x.useMemo(()=>It(s)("control.validation.error"),[s]),m=["validate"].concat(d?"valid":"invalid"),v=x.useMemo(()=>It(s),[s]),y=x.useMemo(()=>qs(s),[s]),b=c.join(" "),_=m.join(" "),w=x.useMemo(()=>({wrapper:b,input:_,label:f,description:p,validation:h,validationError:g}),[b,_,f,p,h,g]);return U.createElement(e,{...r,getStyleAsClassName:v,getStyle:y,classNames:w})},sf=e=>t=>function(n){const s=["validate"].concat(n.isValid?"valid":"invalid"),o=nf(),a=It(o)(e);return a&&s.push(a),U.createElement(t,{...n,getStyleAsClassName:It(o),getStyle:qs(o),className:s.join(" ")})},TY=e=>function(r){const n=$o(),s=as({jsonforms:{...n}});return U.createElement(e,{...r,ajv:s})},vr=sf("control.input"),Rx=sf("control.select"),IY=sf("control.checkbox");class MY extends Sq{render(){const{classNames:t,description:r,id:n,errors:s,label:o,uischema:a,schema:i,rootSchema:u,visible:c,enabled:d,required:f,path:p,cells:h,config:g}=this.props,m=s.length===0,v=[t.validation].concat(m?t.description:t.validationError).join(" "),y=wo({},g,a.options),b=!mx(c,r,this.state.isFocused,y.showUnfocusedDescription),_={rootSchema:u,config:g},w=ki(h,$=>$.tester(a,i,_));return w===void 0||w.tester(a,i,_)===Kn?(console.warn("No applicable cell found.",a,i),null):U.createElement("div",{className:t.wrapper,hidden:!c,onFocus:this.onFocus,onBlur:this.onBlur,id:n},U.createElement("label",{htmlFor:n+"-input",className:t.label},fx(o,f,y.hideRequiredAsterisk)),U.createElement(zc,{uischema:a,schema:i,path:p,id:n+"-input",enabled:d}),U.createElement("div",{className:v},m?b?r:null:s))}}const zY=Ve(1,cr);var OY=Xt(Xq(MY));const Tx=({classNames:e,id:t,label:r,options:n,required:s,description:o,errors:a,data:i,uischema:u,visible:c,config:d,enabled:f,path:p,handleChange:h})=>{const g=nf(),[m,v]=x.useState(!1),y=x.useMemo(()=>It(g)("control.radio"),[g]),b=x.useMemo(()=>It(g)("control.radio.option"),[g]),_=x.useMemo(()=>It(g)("control.radio.input"),[g]),w=x.useMemo(()=>It(g)("control.radio.label"),[g]),$=a.length===0,R=[e.validation].concat($?e.description:e.validationError).join(" "),M=wo({},d,u.options),D=!mx(c,o,m,M.showUnfocusedDescription),j=!y||y==="radio";let S={};return j&&(S={display:"flex",flexDirection:M.orientation==="vertical"?"column":"row"}),U.createElement("div",{className:e.wrapper,hidden:!c,onFocus:()=>v(!0),onBlur:()=>v(!1)},U.createElement("label",{htmlFor:t,className:e.label},fx(r,s,M.hideRequiredAsterisk)),U.createElement("div",{className:y,style:S},n.map(E=>U.createElement("div",{key:E.label,className:b},U.createElement("input",{type:"radio",value:E.value,id:E.value,name:t,checked:i===E.value,onChange:P=>h(p,E.value),disabled:!f,className:_}),U.createElement("label",{htmlFor:E.value,className:w},E.label)))),U.createElement("div",{className:R},$?D?o:null:a))},DY=e=>U.createElement(Tx,{...e}),LY=Ve(3,Fe(Zd,gr("format","radio")));var FY=Xt(rY(DY));const BY=e=>U.createElement(Tx,{...e}),UY=Ve(3,Fe(Qd,gr("format","radio")));var VY=Xt(sY(BY));const{convertToValidClassName:WY}=qa,KY=({classNames:e,data:t,label:r,path:n,schema:s,errors:o,addItem:a,removeItems:i,moveUp:u,moveDown:c,uischema:d,uischemas:f,getStyleAsClassName:p,renderers:h,rootSchema:g,translations:m,enabled:v})=>{const y=d,b=x.useMemo(()=>VG(f,s,d.scope,n,void 0,d,g),[f,s,d.scope,n,d,g]),_=o.length===0,$=[p("array.control.validation")].concat(_?"":p("array.control.validation.error")).join(" "),R=p("array.control.add"),M=p("array.control.label"),D=p("array.child.controls"),j=p("array.child.controls.up"),S=p("array.child.controls.down"),E=p("array.child.controls.delete"),P=[p("array.control"),WY(y.scope)].join(" ");return U.createElement("div",{className:P},U.createElement("header",null,U.createElement("label",{className:M},r),U.createElement("button",{type:"button",className:R,disabled:!v,onClick:a(n,hx(s,g))},"Add to ",r)),U.createElement("div",{className:$},o),U.createElement("div",{className:e.children},t?Ov(0,t.length).map(W=>{const G=Pd(n,`${W}`);return U.createElement("div",{key:W},U.createElement(zi,{schema:s,uischema:b||d,path:G,key:G,renderers:h}),U.createElement("div",{className:D},U.createElement("button",{type:"button",className:j,disabled:!v,"aria-label":m.upAriaLabel,onClick:()=>{u(n,W)()}},m.up),U.createElement("button",{type:"button",className:S,disabled:!v,"aria-label":m.downAriaLabel,onClick:()=>{c(n,W)()}},m.down),U.createElement("button",{type:"button",className:E,disabled:!v,"aria-label":m.removeAriaLabel,onClick:()=>{window.confirm("Are you sure you wish to delete this item?")&&i(n,[W])()}},m.removeTooltip)))}):U.createElement("p",null,m.noDataMessage)))},HY=({schema:e,uischema:t,data:r,path:n,rootSchema:s,uischemas:o,addItem:a,getStyle:i,getStyleAsClassName:u,removeItems:c,moveUp:d,moveDown:f,id:p,visible:h,enabled:g,errors:m,translations:v,arraySchema:y})=>{const b=t,_=qa.createLabelDescriptionFrom(b,e),w=_.show?_.text:"",$=`control ${qa.convertToValidClassName(b.scope)}`,R=u("array.layout"),M=u("array.button"),D=u("array.children"),j={wrapper:$,fieldSet:R,button:M,children:D};return U.createElement(KY,{classNames:j,data:r,label:w,path:n,schema:e,arraySchema:y,errors:m,addItem:a,removeItems:c,moveUp:d,moveDown:f,uischema:t,uischemas:o,getStyleAsClassName:u,rootSchema:s,id:p,visible:h,enabled:g,getStyle:i,translations:v})};var GY=Xt(wx(So(kx(HY))));const qY=Ve(4,ox),Ix=e=>e.type==="Categorization",YY=Ve(1,Fe(De("Categorization"),e=>{const t=r=>pe(r.elements)?!1:r.elements.map(n=>Ix(n)?t(n):n.type==="Category").reduce((n,s)=>n&&s,!0);return t(e)})),JY=(e,t)=>t===e?"selected":"",Mx=({selectedCategory:e,elements:t,data:r,depth:n,onSelect:s,subcategoriesClassName:o,groupClassName:a,t:i,ajv:u,config:c})=>{const d=x.useMemo(()=>t.filter(p=>_o(p,r,void 0,u,c)),[t,r,u,c]),f=x.useMemo(()=>d.map(p=>Gb(p,i)),[d,i]);return U.createElement("ul",{className:o},d.map((p,h)=>Ix(p)?U.createElement("li",{key:f[h],className:a},U.createElement("span",null,f[h]),U.createElement(Mx,{selectedCategory:e,elements:p.elements,data:r,ajv:u,config:c,depth:n+1,onSelect:s,subcategoriesClassName:o,groupClassName:a,t:i})):U.createElement("li",{key:f[h],onClick:s(h),className:JY(p,e)},U.createElement("span",null,f[h]))))},ZY=({category:e,schema:t,path:r})=>U.createElement("div",{id:"categorization.detail"},(e.elements||[]).map((n,s)=>U.createElement(zi,{key:`${r}-${s}`,uischema:n,schema:t,path:r}))),QY=({data:e,uischema:t,schema:r,path:n,selected:s,t:o,visible:a,getStyleAsClassName:i,onChange:u,ajv:c,config:d})=>{const f=t,p=f.elements,h=i("categorization"),g=i("categorization.master"),m=i("categorization.detail"),v=i("category.subcategories"),y=i("category.group"),[b,_]=x.useState(t),[w,$]=x.useState(s??0),R=w>=f.elements.length?0:w;f!==b&&($(0),_(f));const M=D=>()=>u?u(D,R):$(D);return U.createElement("div",{className:h,hidden:a==null?!1:!a},U.createElement("div",{className:g},U.createElement(Mx,{elements:p,selectedCategory:p[R],data:e,ajv:c,config:d,depth:0,onSelect:M,subcategoriesClassName:v,groupClassName:y,t:o})),U.createElement("div",{className:m},U.createElement(ZY,{category:p[R],schema:r,path:n,key:R})))};var XY=TY(Xt(So(Mi(QY))));const eJ=Ve(1,De("Label")),tJ=({text:e,visible:t,getStyleAsClassName:r})=>{const n=r("label-control"),s=!t;return U.createElement("label",{hidden:s,className:n},e)};var rJ=Xt(oY(tJ));const{convertToValidClassName:nJ}=qa,{or:sJ,isObjectArrayControl:oJ,isPrimitiveArrayControl:aJ,rankWith:iJ}=BG,lJ=iJ(3,sJ(oJ,aJ));class cJ extends U.Component{constructor(){super(...arguments),this.confirmDelete=(t,r)=>{const n=t.substring(0,t.lastIndexOf("."));this.props.removeItems(n,[r])()}}render(){const{addItem:t,uischema:r,schema:n,rootSchema:s,path:o,data:a,visible:i,errors:u,label:c,getStyleAsClassName:d,childErrors:f,translations:p,enabled:h}=this.props,g=r,m=d("array.table.table"),v=d("array.table.label"),y=d("array.table.button"),b=d("array.table.validation"),_=[d("array.table"),nJ(g.scope)].join(" "),w=M=>({type:"Control",label:!1,scope:n.type==="object"?`#/properties/${M}`:"#"}),$=u.length===0,R=[b].concat($?"":d("array.table.validation.error")).join(" ");return U.createElement("div",{className:_,hidden:!i},U.createElement("header",null,U.createElement("label",{className:v},c),U.createElement("button",{type:"button",disabled:!h,className:y,onClick:t(o,hx(n,s))},p.addTooltip)),U.createElement("div",{className:R},$?"":u),U.createElement("table",{className:m},U.createElement("thead",null,U.createElement("tr",null,n.properties?Im(zm,Em(M=>n.properties[M].type!=="array"),Pm(M=>U.createElement("th",{key:M},n.properties[M].title??EY(M))))(n.properties):U.createElement("th",null,"Items"),U.createElement("th",null,"Valid"),U.createElement("th",null," "))),U.createElement("tbody",null,!a||!Array.isArray(a)||a.length===0?U.createElement("tr",null,U.createElement("td",null,p.noDataMessage)):a.map((M,D)=>{const j=jl.compose(o,`${D}`),S=Wa(f,G=>Ga(G).startsWith(j)),E=d("array.validation"),P=d("array.validation.error"),W=S?[E].concat(P).join(" "):E;return U.createElement("tr",{key:j},n.properties?Im(zm,Em(G=>n.properties[G].type!=="array"),Pm(G=>{const L=jl.compose(j,G.toString());return U.createElement("td",{key:L},U.createElement(zc,{schema:qt.schema(n,`#/properties/${Tc(G)}`,s),uischema:w(Tc(G)),path:j+"."+G}))}))(n.properties):U.createElement("td",{key:jl.compose(j,D.toString())},U.createElement(zc,{schema:n,uischema:w(),path:j})),U.createElement("td",null,S?U.createElement("span",{className:W},Cx(S.map(G=>G.message)," and ")):U.createElement("span",{className:W},"OK")),U.createElement("td",null,U.createElement("button",{type:"button",disabled:!h,"aria-label":p.removeAriaLabel,onClick:()=>{window.confirm(p.deleteDialogMessage)&&this.confirmDelete(j,D)}},p.removeTooltip)))}))))}}var uJ=Xt(wx(So(kx(cJ))));const dJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return U.createElement("input",{type:"checkbox",checked:!!t,onChange:u=>i(a,u.target.checked),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},fJ=Ve(2,Yb);var hJ=Qt(IY(dJ));const pJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return U.createElement("input",{type:"date",value:t||"",onChange:u=>i(a,u.target.value),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},mJ=Ve(2,ex);var gJ=Qt(vr(pJ));const vJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e,u=c=>c===""?"":c+":00.000Z";return U.createElement("input",{type:"datetime-local",value:(t||"").substr(0,16),onChange:c=>i(a,u(c.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},yJ=Ve(2,rx);var bJ=Qt(vr(vJ));const xJ=e=>{const{data:t,className:r,id:n,enabled:s,schema:o,uischema:a,path:i,handleChange:u,options:c,t:d}=e,f=x.useMemo(()=>d("enum.none",Px["enum.none"],{schema:o,uischema:a,path:i}),[d,o,a,i]);return U.createElement("select",{className:r,id:n,disabled:!s,autoFocus:a.options&&a.options.focus,value:t||"",onChange:p=>u(i,p.target.selectedIndex===0?void 0:p.target.value)},[U.createElement("option",{value:"",key:"jsonforms.enum.none"},f)].concat(c.map(p=>U.createElement("option",{value:p.value,label:p.label,key:p.value}))))},wJ=Ve(2,Zd);var kJ=tY(So(Rx(xJ)));const _J=e=>e===""?void 0:parseInt(e,10),CJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return U.createElement("input",{type:"number",step:"1",value:t??"",onChange:u=>i(a,_J(u.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},$J=Ve(2,Jb);var SJ=Qt(vr(CJ));const jJ=e=>e===""?void 0:Number(e),EJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return U.createElement("input",{type:"number",step:"0.1",value:t??"",onChange:u=>i(a,jJ(u.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},AJ=Ve(2,Zb);var NJ=Qt(vr(EJ));const PJ=e=>{const{className:t,id:r,enabled:n,uischema:s,path:o,handleChange:a,schema:i}=e,u=i.maxLength,c=e.toFormatted(e.data),d=f=>{const p=e.fromFormatted(f.currentTarget.value);a(o,p)};return U.createElement("input",{type:"text",value:c,onChange:d,className:t,id:r,disabled:!n,autoFocus:s.options&&s.options.focus,maxLength:s.options&&s.options.restrict?u:void 0,size:s.options&&s.options.trim?u:void 0})};Qt(vr(PJ));const RJ=e=>{var h;const{data:t,className:r,id:n,enabled:s,schema:o,uischema:a,path:i,handleChange:u,options:c,t:d}=e,f=x.useMemo(()=>d("enum.none",Px["enum.none"],{schema:o,uischema:a,path:i}),[d,o,a,i]),p=U.createElement("option",{value:"",key:"jsonforms.enum.none"},f);return U.createElement("select",{className:r,id:n,disabled:!s,autoFocus:a.options&&a.options.focus,value:t||"",onChange:g=>u(i,g.target.selectedIndex===0?void 0:g.target.value)},(((h=a.options)==null?void 0:h.hideEmptyOption)===!0?[]:[p]).concat(c.map(g=>U.createElement("option",{value:g.value,label:g.label,key:g.value}))))},TJ=Ve(2,Qd);var IJ=nY(So(Rx(RJ)));const MJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,schema:a,path:i,handleChange:u}=e;return U.createElement("div",{style:{display:"flex"}},U.createElement("input",{type:"range",max:a.maximum,min:a.minimum,value:t||a.default,onChange:c=>u(i,Number(c.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus,style:{flex:"1"}}),U.createElement("label",{style:{marginLeft:"0.5em"}},t||a.default))},zJ=Ve(4,ax);var OJ=Qt(vr(MJ));const DJ=e=>{const{config:t,data:r,className:n,id:s,enabled:o,uischema:a,schema:i,path:u,handleChange:c}=e,d=i.maxLength,f=wo({},t,a.options);return U.createElement("input",{type:f.format==="password"?"password":"text",value:r||"",onChange:p=>c(u,p.target.value===""?void 0:p.target.value),className:n,id:s,disabled:!o,autoFocus:f.focus,placeholder:f.placeholder,maxLength:f.restrict?d:void 0,size:f.trim?d:void 0})},LJ=Ve(1,Qb);var FJ=Qt(vr(DJ));const BJ=e=>{const{data:t,className:r,id:n,enabled:s,config:o,uischema:a,path:i,handleChange:u}=e,c=wo({},o,a.options);return U.createElement("textarea",{value:t||"",onChange:d=>u(i,d.target.value===""?void 0:d.target.value),className:r,id:n,disabled:!s,autoFocus:c.focus,placeholder:c.placeholder})},UJ=Ve(2,Xb);var VJ=Qt(vr(BJ));const WJ=e=>{if(typeof e=="string"){const t=e.split(":");return t.length===2&&t.push("00"),t.join(":")}return e},KJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return U.createElement("input",{type:"time",value:t||"",onChange:u=>i(a,WJ(u.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},HJ=Ve(2,tx);var GJ=Qt(vr(KJ));const of=(e,t,r,n,s)=>{if(pe(e.elements))return[];const{renderers:o,cells:a}=$o();return e.elements.map((i,u)=>U.createElement("div",{className:r,key:`${n}-${u}`},U.createElement(zi,{renderers:o,cells:a,uischema:i,schema:t,path:n,enabled:s})))},qJ=Ve(1,De("Group")),YJ=e=>{const{data:t,...r}=e;return U.createElement(JJ,{...r})},JJ=U.memo(function({schema:t,uischema:r,path:n,enabled:s,visible:o,label:a,getStyle:i,getStyleAsClassName:u}){const c=r,d=c.elements?c.elements.length:0,f=u("group.layout"),p=["group-layout-item"].concat(i("group.layout.item",d)).join(" ");return U.createElement("fieldset",{className:f,hidden:o==null?!1:!o},pe(a)?"":U.createElement("legend",{className:u("group.label")},a),of(c,t,p,n,s))});var ZJ=Xt(Mi(YJ));const zx=({className:e,children:t,visible:r})=>U.createElement("div",{className:e,hidden:r==null?!1:!r},t),QJ=Ve(1,De("HorizontalLayout")),XJ=e=>{const{data:t,...r}=e;return U.createElement(eZ,{...r})},eZ=U.memo(function({schema:t,uischema:r,getStyle:n,getStyleAsClassName:s,enabled:o,visible:a,path:i}){const u=r,c=u.elements?u.elements.length:0,d=s("horizontal.layout"),f=["horizontal-layout-item"].concat(n("horizontal.layout.item",c)).join(" ");return U.createElement(zx,{className:d,visible:a,enabled:o,path:i,uischema:r,schema:t,getStyle:n,getStyleAsClassName:s},of(u,t,f,i,o))});var tZ=Xt(Mi(XJ,!1));const rZ=Ve(1,De("VerticalLayout")),nZ=e=>{const{data:t,...r}=e;return U.createElement(sZ,{...r})},sZ=U.memo(function({schema:t,uischema:r,path:n,visible:s,enabled:o,getStyle:a,getStyleAsClassName:i}){const u=r,c=u.elements?u.elements.length:0,d=i("vertical.layout"),f=["vertical-layout-item"].concat(a("vertical.layout.item",c)).join(" ");return U.createElement(zx,{className:d,uischema:r,schema:t,visible:s,enabled:o,path:n,getStyle:a,getStyleAsClassName:i},of(u,t,f,n,o))});var oZ=Xt(Mi(nZ,!1));const aZ=[{tester:zY,renderer:OY},{tester:LY,renderer:FY},{tester:UY,renderer:VY},{tester:qY,renderer:GY},{tester:eJ,renderer:rJ},{tester:YY,renderer:XY},{tester:lJ,renderer:uJ},{tester:qJ,renderer:ZJ},{tester:rZ,renderer:oZ},{tester:QJ,renderer:tZ}],iZ=[{tester:fJ,cell:hJ},{tester:mJ,cell:gJ},{tester:yJ,cell:bJ},{tester:wJ,cell:kJ},{tester:$J,cell:SJ},{tester:AJ,cell:NJ},{tester:TJ,cell:IJ},{tester:zJ,cell:OJ},{tester:UJ,cell:VJ},{tester:LJ,cell:FJ},{tester:HJ,cell:GJ}];function lZ(e,t){return e.split(".").reduce((r,n)=>{if(r!=null&&typeof r=="object"&&!Array.isArray(r))return r[n]},t)}function cZ(e,t){return e.replace(/\$\{([^}]+)\}/g,(r,n)=>{const s=lZ(n.trim(),t);return s==null?"":String(s)})}function Ox(e,t){return typeof e=="string"?cZ(e,t):Array.isArray(e)?e.map(r=>Ox(r,t)):e!==null&&typeof e=="object"?Dx(e,t):e}function Dx(e,t){const r={};for(const[n,s]of Object.entries(e))r[n]=Ox(s,t);return r}function uZ(e,t){return{id:e.id,boardId:t,status:e.status,priority:e.priority,assignee:e.assignee,dueDate:e.dueDate,created:e.created,modified:e.modified,completedAt:e.completedAt,labels:e.labels,attachments:e.attachments,order:e.order,content:e.content,actions:e.actions,forms:e.forms,formData:e.formData,metadata:e.metadata}}let Ml=null;function af(){return Ml||(Ml=acquireVsCodeApi()),Ml}const dZ=af(),Lx=Mb({allErrors:!0,strict:!1});function ar(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Jr(e){return e?{...e}:{}}function fZ(e){return ar(e.properties)?new Set(Object.keys(e.properties)):new Set}function hZ(e,t){if(!ar(e.metadata))return{};const r=fZ(t);return r.size===0?{}:Object.fromEntries(Object.entries(e.metadata).filter(([n])=>r.has(n)))}function pZ(e,t){return typeof e.title=="string"&&e.title.trim().length>0?e.title.trim():t}function mZ(e,t){return typeof(t==null?void 0:t.name)=="string"&&t.name.trim().length>0?t.name.trim():Qg(e)}function gZ(e){return typeof(e==null?void 0:e.description)=="string"?e.description.trim():""}function vZ(){const e=new Set;return(t,r,n)=>{const o=(typeof(r==null?void 0:r.title)=="string"&&r.title.trim().length>0?r.title.trim():`form-${n}`).toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,50),a=t??(o||`form-${n}`);let i=a,u=2;for(;e.has(i);)i=`${a}-${u++}`;return e.add(i),i}}function yZ(e,t){const r=e.forms??[],n=(t==null?void 0:t.forms)??{},s=vZ(),o=uZ(e,e.boardId??(t==null?void 0:t.id)??"");return r.flatMap((a,i)=>{var g;const u=a.name?n[a.name]:void 0,c=ar(a.schema)?a.schema:ar(u==null?void 0:u.schema)?u.schema:void 0;if(!c)return[];const d=s(a.name,c,i),f=a.name?mZ(a.name,u):pZ(c,Qg(d)),p=a.name?gZ(u):"",h={...Jr(u==null?void 0:u.data),...Jr(ar(a.data)?a.data:void 0),...Jr((g=e.formData)==null?void 0:g[d])};return[{id:d,name:f,description:p,label:f,schema:c,...ar(a.ui)?{ui:a.ui}:ar(u==null?void 0:u.ui)?{ui:u.ui}:{},initialData:{...Dx(h,o),...hZ(e,c)},fromConfig:!!(a.name&&u)}]})}function Qo(e,t){const r=Lx.compile(e);return r(t)?[]:r.errors??[]}function bZ(e){var s;const r=(typeof((s=e.params)==null?void 0:s.missingProperty)=="string"?e.params.missingProperty:"")||e.instancePath||"/",n=e.message||"is invalid";return`${r} ${n}`.trim()}function xZ(e,t,r){return(r==null?void 0:r.formId)===e&&r.dataSignature===t}function wZ({cardId:e,boardId:t,form:r,className:n,onSubmitted:s}){const o=x.useMemo(()=>JSON.stringify(r.initialData),[r.initialData]),[a,i]=x.useState(()=>Jr(r.initialData)),[u,c]=x.useState(()=>Qo(r.schema,Jr(r.initialData))),[d,f]=x.useState(!1),[p,h]=x.useState(null),[g,m]=x.useState(null),v=x.useRef(null),y=x.useRef(null);x.useEffect(()=>{const w=Jr(r.initialData);i(w),c(Qo(r.schema,w)),h(null),m($=>xZ(r.id,o,y.current)?$??`Saved ${r.name}`:null)},[r.id,r.name,r.schema,r.initialData,o]),x.useEffect(()=>()=>{v.current&&(window.removeEventListener("message",v.current),v.current=null)},[]);const b=async()=>{var R,M;const w=Qo(r.schema,a);if(c(w),h(null),m(null),w.length>0||d)return;const $=`submit-form-${e}-${r.id}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;f(!0);try{const D=await new Promise((E,P)=>{const W=G=>{const L=G.data;if(!(!L||L.type!=="submitFormResult"||L.callbackKey!==$)){if(window.removeEventListener("message",W),v.current=null,L.error){P(new Error(L.error));return}if(!L.result){P(new Error("Form submission failed without a result payload"));return}E(L.result)}};v.current=W,window.addEventListener("message",W),dZ.postMessage({type:"submitForm",cardId:e,formId:r.id,data:a,callbackKey:$,...t?{boardId:t}:{}})}),j=ar((R=D.card.formData)==null?void 0:R[r.id])?(M=D.card.formData)==null?void 0:M[r.id]:D.data,S=Jr(j);y.current={formId:r.id,dataSignature:JSON.stringify(S)},i(S),c(Qo(r.schema,S)),m(`Saved ${r.name}`),s==null||s(D)}catch(D){y.current=null,h(D instanceof Error?D.message:String(D))}finally{f(!1)}},_=u.length>0;return l.jsxs("div",{className:Ae("flex h-full flex-col",n),children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"truncate text-sm font-semibold",style:{color:"var(--vscode-foreground)"},children:r.name}),r.fromConfig&&l.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:"Shared"})]}),r.description&&l.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:r.description}),_&&l.jsx("p",{className:"mt-1 text-xs font-medium",style:{color:"var(--vscode-errorForeground)"},children:`Fix ${u.length} validation error${u.length===1?"":"s"} before submitting.`})]}),l.jsx("button",{type:"button",onClick:b,disabled:_||d,className:"rounded px-3 py-1.5 text-xs font-medium transition-opacity disabled:cursor-not-allowed disabled:opacity-50",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:_?"Resolve validation errors before submitting":void 0,children:d?"Submitting…":"Submit"})]}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[l.jsx("div",{className:"card-jsonforms p-4",children:l.jsx(lY,{schema:r.schema,uischema:r.ui,data:a,renderers:aZ,cells:iZ,ajv:Lx,validationMode:"ValidateAndShow",onChange:({data:w,errors:$})=>{const R=ar(w)?w:{};y.current=null,i(R),c($??[]),h(null),m(null)}})}),(p||g||_)&&l.jsxs("div",{className:"space-y-2 px-4 pb-4",children:[p&&l.jsx("div",{className:"rounded px-3 py-2 text-xs",style:{background:"color-mix(in srgb, var(--vscode-errorForeground) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--vscode-errorForeground) 40%, transparent)",color:"var(--vscode-errorForeground)"},children:p}),g&&!p&&l.jsx("div",{className:"rounded px-3 py-2 text-xs",style:{background:"color-mix(in srgb, var(--vscode-testing-iconPassed) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--vscode-testing-iconPassed) 40%, transparent)",color:"var(--vscode-testing-iconPassed)"},children:g}),_&&l.jsxs("div",{className:"rounded px-3 py-2",style:{background:"var(--vscode-inputValidation-warningBackground, color-mix(in srgb, var(--vscode-editorWarning-foreground, #d7ba7d) 10%, transparent))",border:"1px solid var(--vscode-inputValidation-warningBorder, var(--vscode-editorWarning-foreground, #d7ba7d))"},children:[l.jsx("p",{className:"mb-2 text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:"Validation issues"}),l.jsx("ul",{className:"space-y-1 pl-4 text-xs",style:{color:"var(--vscode-foreground)"},children:u.map((w,$)=>l.jsx("li",{className:"list-disc",children:bZ(w)},`${w.instancePath??"/"}-${w.message??"invalid"}-${$}`))})]})]})]})]})}function Fx({value:e,onChange:t,placeholder:r="Write markdown...",className:n,autoFocus:s,mode:o="create",comments:a,onAddComment:i,onUpdateComment:u,onDeleteComment:c,logs:d,onClearLogs:f,logsFilter:p,onLogsFilterChange:h,cardId:g,frontmatter:m,onFormSubmitSuccess:v}){const y=o==="edit",b=y?"Edit":"Write",_=q(O=>O.activeCardTab),w=q(O=>O.setActiveCardTab),$=q(O=>O.boards),R=q(O=>O.currentBoard),[M,D]=x.useState("write"),j=y?_:M,S=O=>{y?w(O):D(O)},E=x.useRef(null),P=x.useMemo(()=>$.find(O=>O.id===R),[$,R]),W=x.useMemo(()=>y&&m?yZ({...m,content:e},P):[],[P,m,y,e]),G=x.useMemo(()=>e.trim()?Ne.parse(e,{async:!1,gfm:!0,breaks:!0}):"",[e]);x.useEffect(()=>{j==="write"&&E.current&&E.current.focus()},[j]),x.useEffect(()=>{s&&E.current&&E.current.focus()},[s]);const L=x.useCallback(O=>{E.current&&w0(E.current,e,t,O)},[e,t]),V=O=>{if(O.key==="Tab"){O.preventDefault();const re=O.currentTarget,J=re.selectionStart,K=re.selectionEnd,A=e.substring(0,J)+" "+e.substring(K);t(A),requestAnimationFrame(()=>{re.selectionStart=re.selectionEnd=J+2})}(O.metaKey||O.ctrlKey)&&O.key==="b"&&(O.preventDefault(),O.stopPropagation(),L("bold")),(O.metaKey||O.ctrlKey)&&O.key==="i"&&(O.preventDefault(),L("italic")),(O.metaKey||O.ctrlKey)&&O.key==="k"&&(O.preventDefault(),L("link"))};return l.jsxs("div",{className:Ae("card-markdown-shell h-full",n),children:[l.jsxs("div",{className:"card-markdown-header shrink-0",children:[l.jsxs("div",{className:"card-markdown-tabs",children:[(y?["preview","write"]:["write","preview"]).map(O=>l.jsx("button",{type:"button",onClick:()=>S(O),className:Ae("card-markdown-tab",j===O&&"is-active"),children:O==="write"?b:"Preview"},O)),W.map(O=>{const re=nc(O.id);return l.jsx("button",{type:"button",onClick:()=>S(re),className:Ae("card-markdown-tab",j===re&&"is-active"),children:`form: ${O.name}`},re)}),a&&l.jsxs("button",{type:"button",onClick:()=>S("comments"),className:Ae("card-markdown-tab",j==="comments"&&"is-active"),children:[l.jsx(f1,{size:12}),"Comments",a.length>0&&l.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:a.length})]}),d&&l.jsxs("button",{type:"button",onClick:()=>S("logs"),className:Ae("card-markdown-tab",j==="logs"&&"is-active"),children:[l.jsx(tg,{size:12}),"Logs",d.length>0&&l.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d.length})]})]}),j==="write"&&l.jsxs("div",{className:"card-markdown-toolbar",children:[l.jsx(rt,{icon:l.jsx(h1,{size:14}),title:"Heading",onClick:()=>L("heading")}),l.jsx(rt,{icon:l.jsx(qm,{size:14}),title:"Bold (⌘B)",onClick:()=>L("bold")}),l.jsx(rt,{icon:l.jsx(Ym,{size:14}),title:"Italic (⌘I)",onClick:()=>L("italic")}),l.jsx(rt,{icon:l.jsx(Jm,{size:14}),title:"Quote",onClick:()=>L("quote"),separator:!0}),l.jsx(rt,{icon:l.jsx(Zm,{size:14}),title:"Code",onClick:()=>L("code")}),l.jsx(rt,{icon:l.jsx(Qm,{size:14}),title:"Link (⌘K)",onClick:()=>L("link")}),l.jsx(rt,{icon:l.jsx(Xm,{size:14}),title:"Bulleted list",onClick:()=>L("ul"),separator:!0}),l.jsx(rt,{icon:l.jsx(eg,{size:14}),title:"Numbered list",onClick:()=>L("ol")}),l.jsx(rt,{icon:l.jsx(p1,{size:14}),title:"Task list",onClick:()=>L("tasklist")})]})]}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[j==="write"&&l.jsx("textarea",{ref:E,value:e,onChange:O=>t(O.target.value),onKeyDown:V,placeholder:r,className:"markdown-editor-textarea",spellCheck:!1}),j==="preview"&&l.jsx("div",{className:"min-h-[200px]",children:G?l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-4",dangerouslySetInnerHTML:{__html:G}}):l.jsx("p",{className:"p-4 text-sm italic",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})}),W.map(O=>{const re=nc(O.id);return g?l.jsx("div",{className:Ae("h-full",j===re?"block":"hidden"),children:l.jsx(wZ,{cardId:g,boardId:P==null?void 0:P.id,form:O,onSubmitted:v})},re):null}),j==="comments"&&a&&i&&u&&c&&l.jsx(rS,{comments:a,onAddComment:i,onUpdateComment:u,onDeleteComment:c}),j==="logs"&&d&&f&&l.jsx(D0,{logs:d,onClearLogs:f,logsFilter:p,onLogsFilterChange:h})]})]})}function Xa({panelMode:e,onPreview:t,onCommit:r,onCancel:n}){const s=x.useRef(null),o=x.useRef(t),a=x.useRef(r),i=x.useRef(n);return o.current=t,a.current=r,i.current=n,x.useEffect(()=>{if(typeof window>"u")return;const u=sC({eventTarget:window,getPanelMode:()=>e,getViewportWidth:()=>window.innerWidth,onPreview:c=>o.current(c),onCommit:c=>a.current(c),onCancel:()=>i.current()});return s.current=u,()=>{u.dispose(),s.current=null}},[e]),e!=="drawer"?null:l.jsx("button",{type:"button","aria-label":"Resize drawer",title:"Drag to resize drawer","data-panel-resize-handle":"",className:"absolute inset-y-0 left-0 z-10 w-3 cursor-ew-resize touch-none pointer-events-auto",onPointerDown:u=>{var c,d,f;u.preventDefault(),(d=(c=u.currentTarget).setPointerCapture)==null||d.call(c,u.pointerId),(f=s.current)==null||f.start({clientX:u.clientX})},children:l.jsx("span",{"aria-hidden":"true",className:"absolute inset-y-0 left-1/2 w-px -translate-x-1/2",style:{background:"var(--vscode-panel-border)"}})})}const kZ=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}];function Om({value:e,options:t,onChange:r,className:n}){const[s,o]=x.useState(!1),a=t.find(i=>i.value===e);return l.jsxs("div",{className:Ae("relative",n),children:[l.jsxs("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},onMouseEnter:i=>i.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:i=>i.currentTarget.style.background="transparent",children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",a.dot)}),!(a!=null&&a.dot)&&(a==null?void 0:a.dotColor)&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.dotColor}}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(i=>l.jsxs("button",{type:"button",onClick:()=>{r(i.value),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:u=>{i.value!==e&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{i.value!==e&&(u.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",i.dot)}),!i.dot&&i.dotColor&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:i.dotColor}}),l.jsx("span",{className:"flex-1 text-left",children:i.label}),i.value===e&&l.jsx(jt,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},i.value))})]})]})}function _Z({value:e,onChange:t}){const[r,n]=x.useState(!1),s=x.useRef(null),o=x.useRef(null),a=q(f=>f.cards),i=x.useMemo(()=>{const f=new Set;return a.forEach(p=>{p.assignee&&f.add(p.assignee)}),Array.from(f).sort()},[a]),u=x.useMemo(()=>e.trim()?i.filter(f=>f.toLowerCase().includes(e.toLowerCase())&&f!==e):i,[e,i]),c=r&&u.length>0,d=e.trim()?e.trim().split(/\s+/).map(f=>f[0]).join("").toUpperCase().slice(0,2):null;return l.jsxs("div",{ref:o,className:"relative flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 cursor-text",onClick:()=>{var f;return(f=s.current)==null?void 0:f.focus()},children:[d&&l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d}),l.jsx("input",{ref:s,type:"text",value:e,onChange:f=>t(f.target.value),onFocus:()=>n(!0),onBlur:()=>setTimeout(()=>n(!1),150),placeholder:"No assignee",className:"flex-1 bg-transparent border-none outline-none text-xs",style:{color:e?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]}),c&&l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:u.map(f=>l.jsxs("button",{type:"button",onMouseDown:p=>{p.preventDefault(),t(f)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:p=>p.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:f.split(/\s+/).map(p=>p[0]).join("").toUpperCase().slice(0,2)}),l.jsx("span",{children:f})]},f))})]})}function CZ({labels:e,onChange:t}){const[r,n]=x.useState(""),[s,o]=x.useState(!1),a=x.useRef(null),i=q(h=>h.cards),u=q(h=>h.labelDefs),c=x.useMemo(()=>{const h=new Set;return i.forEach(g=>g.labels.forEach(m=>h.add(m))),Array.from(h).sort()},[i]),d=x.useMemo(()=>{const h=c.filter(g=>!e.includes(g));return r.trim()?h.filter(g=>g.toLowerCase().includes(r.toLowerCase())):h},[r,c,e]),f=s&&d.length>0,p=h=>{const g=(h||r).trim();g&&!e.includes(g)&&t([...e,g]),n("")};return l.jsxs("div",{className:"relative flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap cursor-text",onClick:()=>{var h;return(h=a.current)==null?void 0:h.focus()},children:[e.map(h=>{const g=u[h];return l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:g?{backgroundColor:`${g.color}20`,color:g.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[h,l.jsx("button",{type:"button",onClick:m=>{m.stopPropagation(),t(e.filter(v=>v!==h))},className:"hover:text-red-500 transition-colors",children:l.jsx(st,{size:9})})]},h)}),l.jsx("input",{ref:a,type:"text",value:r,onChange:h=>n(h.target.value),onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),150),onKeyDown:h=>{var g;h.key==="Enter"&&(h.preventDefault(),p()),h.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),h.key==="Escape"&&(n(""),(g=a.current)==null||g.blur())},placeholder:e.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]}),f&&l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:d.map(h=>{const g=u[h];return l.jsx("button",{type:"button",onMouseDown:m=>{m.preventDefault(),p(h)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:m=>m.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:m=>m.currentTarget.style.background="transparent",children:l.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:g?{backgroundColor:`${g.color}20`,color:g.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:h})},h)})})]})}function $Z({actions:e,onChange:t}){const[r,n]=x.useState(""),s=x.useRef(null),o=a=>{const i=r.trim();i&&!e.includes(i)&&t([...e,i]),n("")};return l.jsx("div",{className:"relative flex-1",children:l.jsxs("label",{className:"flex items-center gap-1.5 flex-wrap cursor-text",children:[e.map(a=>l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[a,l.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),t(e.filter(u=>u!==a))},className:"hover:text-red-500 transition-colors",children:l.jsx(st,{size:9})})]},a)),l.jsx("input",{ref:s,type:"text",value:r,onChange:a=>n(a.target.value),onKeyDown:a=>{var i;(a.key==="Enter"||a.key===",")&&(a.preventDefault(),o()),a.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),a.key==="Escape"&&(n(""),(i=s.current)==null||i.blur())},placeholder:e.length===0?"Add actions...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]})})}function Cn({label:e,icon:t,children:r}){return l.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors",onMouseEnter:n=>n.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:n=>n.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[l.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:t}),l.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),l.jsx("div",{className:"flex-1 min-w-0",children:r})]})}function SZ({isOpen:e,...t}){return e?l.jsx(jZ,{isOpen:e,...t}):null}function jZ({isOpen:e,onClose:t,onCreate:r,onSaveSettings:n,initialStatus:s}){const o=q(V=>V.cardSettings),a=q(V=>V.effectiveDrawerWidth),i=q(V=>V.setDrawerWidthPreview),u=q(V=>V.clearDrawerWidthPreview),c=q(V=>V.setCardSettings),d=q(V=>V.columns),f=x.useMemo(()=>d.filter(V=>V.id!==Gn).map(V=>({value:V.id,label:V.name,dotColor:V.color})),[d]),[p,h]=x.useState(""),[g,m]=x.useState(s??o.defaultStatus),[v,y]=x.useState(o.defaultPriority),[b,_]=x.useState(""),[w,$]=x.useState(""),[R,M]=x.useState([]),[D,j]=x.useState([]),[S,E]=x.useState(""),P=x.useRef(null);x.useEffect(()=>{const V=setTimeout(()=>{var O;return(O=P.current)==null?void 0:O.focus()},50);return()=>clearTimeout(V)},[]);const W=()=>{const V=S.trim(),O=p.trim(),re=O?`# ${O}${V?`
131
131
 
132
- ${V}`:""}`:V;r({status:g,priority:v,content:te,assignee:b.trim()||null,dueDate:w||null,labels:R,actions:D})},G=()=>{W(),t()},L=()=>{t()};return x.useEffect(()=>{const V=O=>{O.key==="Escape"&&L(),(O.metaKey||O.ctrlKey)&&O.key==="Enter"&&G(),(O.metaKey||O.ctrlKey)&&O.key==="s"&&(O.preventDefault(),G())};if(e)return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)}),l.jsxs("div",{className:`fixed inset-0 z-50 flex ${(o.panelMode??"drawer")==="drawer"?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[(o.panelMode??"drawer")!=="drawer"&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:L}),l.jsxs("div",{className:(o.panelMode??"drawer")==="drawer"?"relative h-full shadow-xl flex flex-col animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] shadow-xl flex flex-col rounded-xl animate-in zoom-in-95 fade-in duration-200",style:{background:"var(--vscode-editor-background)",...(o.panelMode??"drawer")==="drawer"?{width:`${a}%`,borderLeft:"1px solid var(--vscode-panel-border)"}:{border:"1px solid var(--vscode-panel-border)"}},...(o.panelMode??"drawer")==="drawer"?{"data-panel-drawer":""}:{},children:[l.jsx(Xa,{panelMode:(o.panelMode??"drawer")==="drawer"?"drawer":"popup",onPreview:i,onCommit:V=>{u();const O={...q.getState().cardSettings,drawerWidth:V};c(O),n(O)},onCancel:u}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Create Card"})}),l.jsx("button",{onClick:L,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="transparent",children:l.jsx(st,{size:18})})]}),l.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx(Cn,{label:"Status",icon:l.jsx(rg,{size:13}),children:l.jsx(Om,{value:g,options:f,onChange:V=>m(V)})}),o.showPriorityBadges&&l.jsx(Cn,{label:"Priority",icon:l.jsx(Fc,{size:13}),children:l.jsx(Om,{value:v,options:kZ.map(V=>({value:V.value,label:V.label,dot:V.dot})),onChange:V=>y(V)})}),o.showAssignee&&l.jsx(Cn,{label:"Assignee",icon:l.jsx(va,{size:13}),children:l.jsx(_Z,{value:b,onChange:_})}),o.showDueDate&&l.jsx(Cn,{label:"Due date",icon:l.jsx(Dc,{size:13}),children:l.jsx(u$,{value:w,onChange:$})}),o.showLabels&&l.jsx(Cn,{label:"Labels",icon:l.jsx(ei,{size:13}),children:l.jsx(CZ,{labels:R,onChange:M})}),l.jsx(Cn,{label:"Actions",icon:l.jsx(ga,{size:13}),children:l.jsx($Z,{actions:D,onChange:j})})]}),l.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[l.jsx("textarea",{ref:P,value:p,onChange:V=>h(V.target.value),placeholder:"Card title...",className:"w-full text-lg font-medium bg-transparent border-none outline-none resize-none mb-4",style:{color:"var(--vscode-foreground)"},rows:1,onInput:V=>{const O=V.target;O.style.height="auto",O.style.height=O.scrollHeight+"px"},onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&V.preventDefault()}}),l.jsx(Fx,{value:S,onChange:E,placeholder:"Add a description..."})]}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderTop:"1px solid var(--vscode-panel-border)",background:"var(--vscode-sideBar-background, var(--vscode-editor-background))"},children:[l.jsxs("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"Esc"})," ","cancel ·"," ",l.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"⌘S"})," ","save"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:L,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)",background:"transparent",border:"1px solid var(--vscode-panel-border)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="transparent",children:"Cancel"}),l.jsx("button",{type:"button",onClick:G,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-button-foreground)",background:"var(--vscode-button-background)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="var(--vscode-button-background)",children:"Save"})]})]})]})]})}function Dm({value:e}){const[t,r]=x.useState(!1),n=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1 cursor-pointer",onClick:n,title:"Click to copy",children:[l.jsx("span",{className:"text-zinc-700 dark:text-zinc-300",children:e}),l.jsx("span",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity",children:t?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}const EZ={critical:"Critical",high:"High",medium:"Medium",low:"Low"},AZ=["critical","high","medium","low"],NZ={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"},PZ=[{agent:"claude",label:"Claude",color:"hover:bg-amber-100 dark:hover:bg-amber-900/30",activeColor:"bg-amber-700 text-white"},{agent:"codex",label:"Codex",color:"hover:bg-emerald-100 dark:hover:bg-emerald-900/30",activeColor:"bg-emerald-500 text-white"},{agent:"opencode",label:"OpenCode",color:"hover:bg-slate-100 dark:hover:bg-slate-700/30",activeColor:"bg-slate-500 text-white"}],RZ={claude:{bg:"bg-amber-700",hover:"hover:bg-amber-800",shadow:"shadow-sm",border:"border border-amber-800/50"},codex:{bg:"bg-emerald-600",hover:"hover:bg-emerald-700",shadow:"shadow-sm",border:"border border-emerald-700/50"},opencode:{bg:"bg-slate-600",hover:"hover:bg-slate-700",shadow:"shadow-sm",border:"border border-slate-700/50"}},TZ={claude:[{permissionMode:"default",label:"Default",description:"With confirmations"},{permissionMode:"plan",label:"Plan",description:"Creates a plan first"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts file edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Bypasses all prompts"}],codex:[{permissionMode:"default",label:"Suggest",description:"Suggests changes"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Full automation"}],opencode:[{permissionMode:"default",label:"Default",description:"Standard mode"}]};function IZ({value:e,options:t,onChange:r,className:n}){const[s,o]=x.useState(!1),a=t.find(i=>i.value===e);return l.jsxs("div",{className:Ae("relative",s&&"z-30",n),children:[l.jsxs("button",{onClick:()=>o(!s),className:"card-select-trigger",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",a.dot)}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>o(!1)}),l.jsx("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 min-w-[172px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(i=>l.jsxs("button",{onClick:()=>{r(i.value),o(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:u=>{i.value!==e&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{i.value!==e&&(u.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",i.dot)}),l.jsx("span",{className:"flex-1 text-left",children:i.label}),i.value===e&&l.jsx(jt,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},i.value))})]})]})}function MZ({value:e,onChange:t,onTransferToBoard:r}){const[n,s]=x.useState(!1),o=q(c=>c.columns),a=q(c=>c.boards),i=q(c=>c.currentBoard),u=a.filter(c=>c.id!==i);return l.jsxs("div",{className:Ae("relative",n&&"z-30"),children:[l.jsxs("button",{onClick:()=>s(!n),className:"card-select-trigger",style:{color:"var(--vscode-foreground)"},children:[(()=>{const c=o.find(d=>d.id===e);return c?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:c.color}}),l.jsx("span",{children:c.name})]}):l.jsx("span",{children:e})})(),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>s(!1)}),l.jsxs("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 min-w-[204px] max-h-[320px] overflow-y-auto",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[o.map(c=>l.jsxs("button",{onClick:()=>{t(c.id),s(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:c.id===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:d=>{c.id!==e&&(d.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:d=>{c.id!==e&&(d.currentTarget.style.background="transparent")},children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:c.color}}),l.jsx("span",{className:"flex-1 text-left",children:c.name}),c.id===e&&l.jsx(jt,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},c.id)),u.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mx-2 my-1",style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:"Move to..."}),u.map(c=>l.jsxs("div",{children:[l.jsx("div",{className:"px-4 py-1 text-[10px] font-semibold",style:{color:"var(--vscode-descriptionForeground)"},children:c.name}),(c.columns||[]).map(d=>l.jsxs("button",{onClick:()=>{r(c.id,d.id),s(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 pl-5 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:f=>{f.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:f=>{f.currentTarget.style.background="transparent"},children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d.color}}),l.jsx("span",{className:"flex-1 text-left",children:d.name})]},`${c.id}-${d.id}`))]},c.id))]})]})]})]})}function kr({label:e,icon:t,children:r}){return l.jsxs("div",{className:"card-property-row",children:[l.jsxs("div",{className:"card-property-label-group",children:[l.jsx("span",{className:"card-property-icon",style:{color:"var(--vscode-descriptionForeground)"},children:t}),l.jsx("span",{className:"card-property-label",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),l.jsx("div",{className:"card-property-value",children:r})]})}function Bx(e){return Array.isArray(e)?e.map(t=>String(t)).join(","):String(e)}function Oc({path:e,value:t}){const r=q(n=>n.applyMetadataFilterToken);return l.jsx("button",{type:"button",onClick:n=>{n.preventDefault(),n.stopPropagation(),r(e,t)},className:"shrink-0 rounded p-0.5 opacity-60 transition-opacity hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-1 focus:ring-blue-500",style:{color:"var(--vscode-descriptionForeground)"},title:`Filter cards by ${e}`,"aria-label":`Filter cards by metadata ${e} = ${t}`,children:l.jsx(y1,{size:11})})}function zZ({onSelect:e}){const[t,r]=x.useState(!1),[n,s]=x.useState("claude"),o=TZ[n],a=RZ[n];return l.jsxs("div",{className:Ae("relative",t&&"z-30"),children:[l.jsxs("button",{onClick:()=>r(!t),className:Ae("card-inline-action card-inline-action--solid",a.bg,a.hover,a.shadow,a.border),children:[l.jsx(v1,{size:13}),l.jsx("span",{children:"Build with AI"}),l.jsx("kbd",{className:"ml-0.5 text-[9px] opacity-60 font-mono",children:"⌘B"}),l.jsx(Ze,{size:11,className:Ae("ml-0.5 opacity-60 transition-transform",t&&"rotate-180")})]}),t&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>r(!1)}),l.jsxs("div",{className:"card-floating-menu absolute top-full right-0 mt-1 min-w-[240px] overflow-hidden bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700",children:[l.jsx("div",{className:"flex",children:PZ.map(i=>l.jsx("button",{onClick:()=>s(i.agent),className:Ae("flex-1 px-3 py-2 text-[11px] font-medium transition-all",n===i.agent?i.activeColor:Ae("text-zinc-600 dark:text-zinc-400",i.color)),children:i.label},i.agent))}),l.jsx("div",{className:"p-1 space-y-1",children:o.map(i=>l.jsxs("button",{onClick:()=>{e(n,i.permissionMode),r(!1)},className:"w-full text-left px-2.5 py-1.5 rounded-[8px] hover:bg-zinc-100 dark:hover:bg-zinc-700/50 transition-colors",children:[l.jsx("div",{className:"text-[11px] font-medium text-zinc-900 dark:text-zinc-100",children:i.label}),l.jsx("div",{className:"text-[10px] text-zinc-500 dark:text-zinc-400 mt-0.5",children:i.description})]},i.permissionMode))})]})]})]})}function OZ({actions:e,onTriggerAction:t}){const[r,n]=x.useState(!1),s=Array.isArray(e)?e.map(o=>({key:o,label:o})):Object.entries(e).map(([o,a])=>({key:o,label:a}));return l.jsxs("div",{className:Ae("relative",r&&"z-30"),children:[l.jsxs("button",{onClick:()=>n(!r),className:"card-inline-action",style:{color:"var(--vscode-foreground)",border:"1px solid var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},children:[l.jsx("span",{children:"Run Action"}),l.jsx(Ze,{size:11,className:Ae("opacity-60 transition-transform",r&&"rotate-180")})]}),r&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button","aria-label":"Close actions menu",className:"card-floating-dismiss cursor-default",onClick:()=>n(!1)}),l.jsx("div",{className:"card-floating-menu absolute top-full right-0 mt-1",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:s.map(({key:o,label:a})=>l.jsx("button",{type:"button",onClick:()=>{n(!1),t(o)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors whitespace-nowrap",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:i=>{i.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:i=>{i.currentTarget.style.background="transparent"},children:a},o))})]})]})}function Ux({size:e=16}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 19.88V4.12a1.5 1.5 0 0 0-.85-1.533zm-5.146 14.861L10.826 12l7.178-5.448v10.896z"})})}function _r({title:e,icon:t,onClick:r,variant:n="default",label:s}){return l.jsxs("button",{type:"button",onClick:r,className:Ae("card-action-button",n!=="default"&&`card-action-button--${n}`),title:e,"aria-label":e,children:[l.jsx("span",{className:"card-action-button__icon",children:t}),s&&l.jsx("span",{className:"card-action-button__label",children:s})]})}function Vx(e){return/^https?:\/\//i.test(e)}function DZ(e){return/^(\/|~\/|\.{1,2}\/|[A-Za-z]:[/\\])/i.test(e)}function LZ({value:e}){const[t,r]=x.useState(!1),n=s=>{s.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1",children:[l.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300 hover:underline",title:e,onClick:s=>s.stopPropagation(),children:[l.jsx(ng,{size:10,className:"shrink-0"}),l.jsx("span",{className:"break-all",children:e})]}),l.jsx("button",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity cursor-pointer",onClick:n,title:"Copy URL",children:t?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function FZ({value:e,onOpenFile:t}){const[r,n]=x.useState(!1),s=o=>{o.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1",children:[t&&l.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100 transition-opacity cursor-pointer",onClick:o=>{o.stopPropagation(),t(e)},title:"Open in VS Code",children:l.jsx(Ux,{size:11})}),l.jsx("span",{className:"text-zinc-700 dark:text-zinc-300 break-all",children:e}),l.jsx("button",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity cursor-pointer",onClick:s,title:"Copy path",children:r?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function BZ({metadata:e,onOpenMetadataFile:t}){if(!e||Object.keys(e).length===0)return null;const r=Object.keys(e);return l.jsxs("div",{className:"card-metadata-section",children:[l.jsxs("div",{className:"card-metadata-section__header",children:[l.jsx("span",{children:"Metadata"}),l.jsx("span",{className:"card-metadata-section__count",children:r.length})]}),l.jsx("div",{className:"card-metadata-tree-shell",children:l.jsx(Wx,{data:e,depth:0,onOpenMetadataFile:t})})]})}function Wx({data:e,depth:t,pathPrefix:r="",onOpenMetadataFile:n}){return l.jsx("div",{style:{paddingLeft:t>0?12:0},children:Object.entries(e).map(([s,o])=>{const a=r?`${r}.${s}`:s,i=Bx(o);return l.jsx("div",{className:"py-0.5",children:o&&typeof o=="object"&&!Array.isArray(o)?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,":"]}),l.jsx(Wx,{data:o,depth:t+1,pathPrefix:a,onOpenMetadataFile:n})]}):Array.isArray(o)?l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),l.jsx(Dm,{value:`[${o.join(", ")}]`}),l.jsx(Oc,{path:a,value:i})]}):l.jsxs("div",{className:"flex items-baseline gap-1 flex-wrap",children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),Vx(String(o))?l.jsx(LZ,{value:String(o)}):DZ(String(o))?l.jsx(FZ,{value:String(o),onOpenFile:n}):l.jsx(Dm,{value:String(o)}),l.jsx(Oc,{path:a,value:i})]})},s)})})}function UZ({labels:e,onChange:t}){const[r,n]=x.useState(""),[s,o]=x.useState(!1),a=x.useRef(null),i=q(m=>m.cards),u=q(m=>m.labelDefs),c=q(m=>m.applyLabelFilter),d=x.useMemo(()=>{const m=new Set;return i.forEach(v=>v.labels.forEach(y=>m.add(y))),Array.from(m).sort()},[i]),f=x.useMemo(()=>{const m=d.filter(v=>!e.includes(v));return r.trim()?m.filter(v=>v.toLowerCase().includes(r.toLowerCase())):m},[r,d,e]),p=s&&f.length>0,h=m=>{const v=(m||r).trim();v&&!e.includes(v)&&t([...e,v]),n("")},g=m=>{t(e.filter(v=>v!==m))};return l.jsxs("div",{className:Ae("relative flex items-center gap-2 flex-wrap",p&&"z-30"),children:[e.map(m=>{const v=u[m];return l.jsxs("span",{className:"card-label-pill",style:v?{backgroundColor:`${v.color}20`,color:v.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[l.jsx("button",{type:"button",onClick:()=>c(m),className:"hover:underline",title:`Filter cards by label ${m}`,"aria-label":`Filter cards by label ${m}`,children:m}),l.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),g(m)},className:"hover:text-red-500 transition-colors","aria-label":`Remove label ${m}`,children:l.jsx(st,{size:9})})]},m)}),l.jsxs("button",{onClick:()=>{o(!0),setTimeout(()=>{var m;return(m=a.current)==null?void 0:m.focus()},0)},className:"card-label-add",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(Zr,{size:10}),l.jsx("span",{children:"Add label"})]}),l.jsx("input",{ref:a,type:"text",value:r,onChange:m=>n(m.target.value),onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),150),onKeyDown:m=>{var v;m.key==="Enter"&&(m.preventDefault(),h()),m.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),m.key==="Escape"&&(n(""),(v=a.current)==null||v.blur())},placeholder:e.length===0?"Add labels...":"",className:"card-label-input",style:{color:"var(--vscode-foreground)",display:s||r?"block":"none"}}),p&&l.jsx("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 max-h-[200px] overflow-auto min-w-[220px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:f.map(m=>{const v=u[m];return l.jsx("button",{type:"button",onMouseDown:y=>{y.preventDefault(),h(m)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:l.jsx("span",{className:"card-label-pill",style:v?{backgroundColor:`${v.color}20`,color:v.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:m})},m)})})]})}function VZ({cardId:e,content:t,frontmatter:r,comments:n,contentVersion:s,onSave:o,onClose:a,onDelete:i,onPermanentDelete:u,onRestore:c,onOpenFile:d,onOpenMetadataFile:f,onDownloadCard:p,onStartWithAI:h,onAddAttachment:g,onOpenAttachment:m,onRemoveAttachment:v,onAddComment:y,onUpdateComment:b,onDeleteComment:_,onTransferToBoard:w,onTriggerAction:$,logs:R,onClearLogs:M,logsFilter:D,onLogsFilterChange:j}){var oe,ce;const{cardSettings:S,boards:E,currentBoard:P}=q(),W=((oe=E.find(X=>X.id===P))==null?void 0:oe.metadata)??[],G=(ce=E.find(X=>X.id===P))==null?void 0:ce.title,[L,V]=x.useState(r),[O,te]=x.useState(t),[J,H]=x.useState(!1),[A,Y]=x.useState(!1),z=L.status===Gn,k=Zg(O,L.metadata,G),C=L.metadata??{},N=x.useMemo(()=>W.map(X=>({key:X,value:C[X]})).filter(({value:X})=>X!=null&&String(X).trim()!==""),[C,W]),B=x.useRef(null),K=x.useRef(L),ee=x.useRef(O);K.current=L,ee.current=O;const ne=x.useCallback(()=>{o(ee.current,K.current)},[o]);x.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]),x.useEffect(()=>{te(t)},[e,s]),x.useEffect(()=>{V(r)},[r]);const le=x.useCallback(X=>{te(X),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{o(X,K.current)},800)},[o]),me=x.useCallback(X=>{V(de=>{const ge={...de,...X};return B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{o(ee.current,ge)},800),ge})},[o]),I=x.useCallback(X=>{V(de=>({...de,formData:X.card.formData,modified:X.card.modified}))},[]);return x.useEffect(()=>{const X=de=>{(de.metaKey||de.ctrlKey)&&de.key==="s"&&(de.preventDefault(),B.current&&clearTimeout(B.current),ne()),(de.metaKey||de.ctrlKey)&&de.key==="b"&&S.showBuildWithAI&&(de.preventDefault(),h("claude","default")),de.key==="Escape"&&(B.current&&(clearTimeout(B.current),ne()),a())};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[ne,a,h,S.showBuildWithAI]),l.jsx("div",{className:"card-editor-shell h-full flex flex-col",children:l.jsx("div",{className:"card-editor-content flex-1 min-h-0 overflow-auto",children:l.jsxs("div",{className:"card-editor-stack",children:[l.jsxs("header",{className:"card-editor-hero",children:[l.jsxs("div",{className:"card-editor-hero-copy",children:[l.jsxs("div",{className:"card-editor-hero-meta",children:[l.jsx("span",{className:"card-editor-card-id",children:e}),l.jsx("span",{className:"card-editor-hero-separator","aria-hidden":"true"}),l.jsx("span",{title:Bs(L.modified),children:oa(L.modified)})]}),l.jsx("h1",{className:"card-editor-title",children:k})]}),l.jsxs("div",{className:"card-editor-hero-actions",children:[L.actions&&(Array.isArray(L.actions)?L.actions.length>0:Object.keys(L.actions).length>0)&&$&&l.jsx(OZ,{actions:L.actions,onTriggerAction:$}),S.showBuildWithAI&&l.jsx(zZ,{onSelect:h}),z?J?l.jsxs("div",{className:"card-delete-confirmation",children:[l.jsx("span",{className:"card-delete-confirmation__text",children:"Delete this card from disk?"}),l.jsx(_r,{title:"Confirm permanent delete",icon:l.jsx(Kt,{size:15}),label:"Delete",onClick:()=>{H(!1),u()},variant:"danger"}),l.jsx(_r,{title:"Cancel permanent delete",icon:l.jsx(hf,{size:15}),label:"Keep",onClick:()=>H(!1)})]}):l.jsxs(l.Fragment,{children:[l.jsx(_r,{title:"Restore card",icon:l.jsx(hf,{size:15}),label:"Restore",onClick:c,variant:"primary"}),l.jsx(_r,{title:"Permanently delete from disk",icon:l.jsx(Kt,{size:15}),label:"Delete forever",onClick:()=>H(!0),variant:"danger"})]}):l.jsxs(l.Fragment,{children:[l.jsx(_r,{title:"Open in VS Code",icon:l.jsx(Ux,{size:15}),onClick:d}),l.jsx(_r,{title:"Download card as Markdown",icon:l.jsx(m1,{size:15}),onClick:p}),l.jsx(_r,{title:"Move to deleted",icon:l.jsx(Kt,{size:15}),onClick:i,variant:"danger"})]}),l.jsx(_r,{title:"Close card",icon:l.jsx(st,{size:16}),onClick:a})]})]}),l.jsxs("div",{className:Ae("card-editor-desktop-columns",S.compactMode&&"is-compact"),children:[l.jsxs("div",{className:"card-editor-top-row",children:[l.jsxs("section",{className:"card-surface card-surface--details",children:[l.jsx("div",{className:"card-surface-header",children:l.jsxs("div",{children:[l.jsx("span",{className:"card-surface-kicker",children:"Overview"}),l.jsx("h2",{className:"card-surface-title",children:"Details"})]})}),l.jsxs("div",{className:"card-property-list",children:[l.jsx(kr,{label:"Status",icon:l.jsx(rg,{size:13}),children:l.jsx(MZ,{value:L.status,onChange:X=>me({status:X}),onTransferToBoard:w})}),S.showPriorityBadges&&l.jsx(kr,{label:"Priority",icon:l.jsx(Fc,{size:13}),children:l.jsx(IZ,{value:L.priority,options:AZ.map(X=>({value:X,label:EZ[X],dot:NZ[X]})),onChange:X=>me({priority:X})})}),S.showAssignee&&l.jsx(kr,{label:"Assignee",icon:l.jsx(va,{size:13}),children:l.jsxs("div",{className:"card-property-chip card-property-chip--input",children:[l.jsx("span",{className:"card-property-avatar",style:{background:L.assignee?"var(--vscode-badge-background)":"rgba(148, 163, 184, 0.18)",color:L.assignee?"var(--vscode-badge-foreground)":"var(--vscode-descriptionForeground)"},children:L.assignee?L.assignee.split(/\s+/).filter(Boolean).map(X=>X[0]).join("").toUpperCase().slice(0,2):l.jsx(va,{size:12})}),l.jsx("input",{type:"text",value:L.assignee||"",onChange:X=>me({assignee:X.target.value||null}),placeholder:"No assignee",className:"card-property-text-input",style:{color:L.assignee?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]})}),S.showDueDate&&l.jsx(kr,{label:"Due date",icon:l.jsx(Dc,{size:13}),children:l.jsx("input",{type:"date",value:L.dueDate||"",onChange:X=>me({dueDate:X.target.value||null}),className:"card-date-input",style:{color:L.dueDate?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})}),S.showLabels&&l.jsx(kr,{label:"Labels",icon:l.jsx(ei,{size:13}),children:l.jsx(UZ,{labels:L.labels,onChange:X=>me({labels:X})})}),N.map(({key:X,value:de})=>{const ge=String(de);return l.jsx(kr,{label:X,icon:l.jsx(ng,{size:13}),children:l.jsxs("div",{className:"card-metadata-highlight min-w-0",children:[Vx(ge)?l.jsx("a",{href:ge,target:"_blank",rel:"noopener noreferrer",className:"card-metadata-highlight__link truncate",style:{color:"var(--vscode-textLink-foreground)"},children:ge}):l.jsx("span",{className:"card-metadata-highlight__value",style:{color:"var(--vscode-foreground)"},children:ge}),l.jsx(Oc,{path:X,value:Bx(de)})]})},X)}),l.jsxs("button",{type:"button",onClick:()=>Y(X=>!X),className:"card-advanced-toggle",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(Ze,{size:11,className:`opacity-60 transition-transform ${A?"":"-rotate-90"}`}),l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",children:"Advanced"})]}),A&&l.jsxs(l.Fragment,{children:[l.jsx(kr,{label:"Created",icon:l.jsx(Ll,{size:13}),children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:Na(L.created)}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:Bs(L.created),children:oa(L.created)})]})}),l.jsx(kr,{label:"Modified",icon:l.jsx(Ll,{size:13}),children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:Na(L.modified)}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:Bs(L.modified),children:oa(L.modified)})]})}),l.jsx("div",{className:"px-4 pb-2",children:l.jsx(BZ,{metadata:C,onOpenMetadataFile:f})})]})]})]}),l.jsxs("section",{className:Ae("card-surface card-surface--attachments",S.compactMode&&"card-surface--attachments-compact"),children:[l.jsxs("div",{className:"card-surface-header",children:[l.jsxs("div",{children:[l.jsx("span",{className:"card-surface-kicker",children:"Files"}),l.jsx("h2",{className:"card-surface-title",children:"Attachments"})]}),l.jsxs("button",{type:"button",onClick:g,className:"card-inline-action",children:[l.jsx(g1,{size:14}),l.jsx("span",{children:"Add attachment"})]})]}),L.attachments.length>0?l.jsx("div",{className:"card-attachment-tags",children:L.attachments.map(X=>l.jsxs("div",{className:"card-attachment-tag",children:[l.jsxs("button",{type:"button",onClick:()=>m(X),className:"card-attachment-tag__link",title:X,children:[l.jsx(Gm,{size:12}),l.jsx("span",{children:X})]}),l.jsx("button",{type:"button",onClick:()=>v(X),className:"card-attachment-tag__remove","aria-label":`Remove ${X}`,children:l.jsx(st,{size:12})})]},X))}):l.jsx("p",{className:"card-empty-state",children:"No attachments yet."})]})]}),l.jsx("section",{className:"card-surface card-surface--editor card-editor-main-surface",children:l.jsx(Fx,{value:O,onChange:le,placeholder:"Start writing...",className:"flex-1 min-h-[26rem]",mode:"edit",comments:n,onAddComment:y,onUpdateComment:b,onDeleteComment:_,logs:R,onClearLogs:M,logsFilter:D,onLogsFilterChange:j,cardId:e,frontmatter:L,onFormSubmitSuccess:I})})]})]})})})}function WZ({labels:e,labelDefs:t,selected:r,onChange:n,showAllOption:s=!1,position:o="below"}){const[a,i]=x.useState(""),u=x.useMemo(()=>{const p={};return e.forEach(h=>{const g=t[h],m=(g==null?void 0:g.group)||"Other";p[m]||(p[m]=[]),p[m].push(h)}),p},[e,t]),c=x.useMemo(()=>{if(!a)return u;const p=a.toLowerCase(),h={};return Object.entries(u).forEach(([g,m])=>{const v=m.filter(y=>y.toLowerCase().includes(p));v.length>0&&(h[g]=v)}),h},[u,a]),d=p=>{r.includes(p)?n(r.filter(h=>h!==p)):n([...r,p])},f=o==="above"?"bottom-full mb-1":"top-full mt-1";return l.jsxs("div",{className:`absolute ${f} left-0 min-w-[200px] max-h-72 overflow-y-auto bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1`,children:[l.jsx("div",{className:"px-2 pb-1",children:l.jsx("input",{type:"text",value:a,onChange:p=>i(p.target.value),placeholder:"Filter labels...",autoFocus:!0,className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}),s&&!a&&l.jsxs("button",{type:"button",onClick:()=>n([]),className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors ${r.length===0?"text-blue-600 dark:text-blue-400 font-medium":"text-zinc-900 dark:text-zinc-100"}`,children:[l.jsx("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${r.length===0?"border-blue-500 bg-blue-500":"border-zinc-300 dark:border-zinc-500"}`,children:r.length===0&&l.jsx(jt,{size:10,className:"text-white"})}),l.jsx("span",{children:"All Labels"})]}),Object.entries(c).map(([p,h])=>l.jsxs("div",{children:[Object.keys(c).length>1&&l.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-xs font-semibold text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:p}),h.map(g=>{const m=t[g],v=r.includes(g);return l.jsxs("button",{type:"button",onClick:()=>d(g),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${v?"border-blue-500 bg-blue-500":"border-zinc-300 dark:border-zinc-500"}`,children:v&&l.jsx(jt,{size:10,className:"text-white"})}),(m==null?void 0:m.color)&&l.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:m.color}}),l.jsx("span",{className:"truncate",children:g})]},g)})]},p)),Object.keys(c).length===0&&l.jsx("div",{className:"px-3 py-2 text-sm text-zinc-400 dark:text-zinc-500",children:"No labels found"})]})}function KZ({boards:e,currentBoard:t,starredBoards:r,onSelect:n,onClose:s}){const[o,a]=x.useState(""),[i,u]=x.useState(0),c=x.useRef(null),d=x.useMemo(()=>{const g=o.toLowerCase();return(g?e.filter(v=>v.name.toLowerCase().includes(g)||v.id.toLowerCase().includes(g)):e).slice().sort((v,y)=>{const b=r.includes(v.id),_=r.includes(y.id);return b&&!_?-1:!b&&_?1:0})},[e,o,r]);x.useEffect(()=>{setTimeout(()=>{var g;return(g=c.current)==null?void 0:g.focus()},0)},[]),x.useEffect(()=>{u(0)},[o]),x.useEffect(()=>{const g=m=>{if(m.key==="Escape"){m.stopPropagation(),s();return}if(m.key==="ArrowDown"){m.preventDefault(),u(v=>Math.min(v+1,d.length-1));return}if(m.key==="ArrowUp"){m.preventDefault(),u(v=>Math.max(v-1,0));return}m.key==="Enter"&&d[i]&&(n(d[i].id),s())};return document.addEventListener("keydown",g,!0),()=>document.removeEventListener("keydown",g,!0)},[d,i,n,s]);const f=d.filter(g=>r.includes(g.id)),p=d.filter(g=>!r.includes(g.id)),h=f.length>0;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:s}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-50 w-72 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-lg shadow-xl overflow-hidden",children:[l.jsx("div",{className:"p-2 border-b border-zinc-200 dark:border-zinc-700",children:l.jsxs("div",{className:"relative",children:[l.jsx(sg,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),l.jsx("input",{ref:c,type:"text",value:o,onChange:g=>a(g.target.value),placeholder:"Search boards...",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-zinc-50 dark:bg-zinc-700 rounded-md border border-zinc-200 dark:border-zinc-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]})}),l.jsxs("div",{className:"py-1 max-h-72 overflow-y-auto",children:[d.length===0&&l.jsx("div",{className:"px-4 py-3 text-sm text-zinc-400 dark:text-zinc-500 text-center",children:"No boards found"}),h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"px-3 pt-1 pb-0.5 flex items-center gap-1.5",children:[l.jsx(og,{size:11,className:"text-amber-400 fill-amber-400"}),l.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Starred"})]}),f.map(g=>{const m=d.indexOf(g);return l.jsx(Lm,{board:g,isActive:m===i,isCurrent:g.id===t,onSelect:()=>{n(g.id),s()}},g.id)}),p.length>0&&l.jsx("div",{className:"px-3 pt-2 pb-0.5",children:l.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"All boards"})})]}),p.map(g=>{const m=d.indexOf(g);return l.jsx(Lm,{board:g,isActive:m===i,isCurrent:g.id===t,onSelect:()=>{n(g.id),s()}},g.id)})]}),l.jsx("div",{className:"px-3 py-1.5 border-t border-zinc-200 dark:border-zinc-700",children:l.jsx("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:"↑↓ navigate · Enter select · Esc close"})})]})]})}function Lm({board:e,isActive:t,isCurrent:r,onSelect:n}){return l.jsxs("button",{type:"button",onClick:n,className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors ${t?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-zinc-900 dark:text-zinc-100 hover:bg-zinc-100 dark:hover:bg-zinc-700"}`,children:[l.jsx(jt,{size:14,className:r?"text-blue-500 shrink-0":"invisible shrink-0"}),l.jsx("span",{className:"truncate",children:e.name})]})}const Fm=[{value:"all",label:"All Priorities"},{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],Bm=[{value:"all",label:"All Dates"},{value:"overdue",label:"Overdue"},{value:"today",label:"Due Today"},{value:"this-week",label:"Due This Week"},{value:"no-date",label:"No Due Date"}],zl="text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100";function Lr({label:e,onRemove:t}){return l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-700 rounded-full",children:[l.jsx("span",{className:"max-w-[180px] truncate",children:e}),l.jsx("button",{type:"button",onClick:t,className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-200 flex-shrink-0","aria-label":`Remove ${e} filter`,children:l.jsx(st,{size:12})})]})}function HZ({label:e,checked:t,onChange:r}){return l.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":t,onClick:n=>{n.stopPropagation(),r(!t)},className:"w-full text-left px-3 py-2 text-sm transition-colors hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 flex items-center gap-2",children:[l.jsx("span",{className:"w-4 h-4 rounded-sm border flex items-center justify-center shrink-0",style:{borderColor:t?"var(--vscode-focusBorder)":"var(--vscode-checkbox-border, var(--vscode-panel-border))",background:t?"var(--vscode-focusBorder)":"transparent"},children:t&&l.jsx(jt,{size:10,style:{color:"var(--vscode-checkbox-foreground, white)"}})}),l.jsx("span",{className:"truncate",children:e})]})}function GZ({onOpenSettings:e,onAddColumn:t,onCreateCard:r,onToggleTheme:n,onSwitchBoard:s,onCreateBoard:o,onOpenBoardLogs:a,boardLogsOpen:i,onTriggerBoardAction:u,onOpenShortcutHelp:c}){var To,Io,Mo;const d=q(T=>T.searchQuery),f=q(T=>T.setSearchQuery),p=q(T=>T.fuzzySearch),h=q(T=>T.setFuzzySearch),g=q(T=>T.clearPlainTextSearch),m=q(T=>T.removeMetadataFilterToken),v=q(T=>T.priorityFilter),y=q(T=>T.setPriorityFilter),b=q(T=>T.assigneeFilter),_=q(T=>T.setAssigneeFilter),w=q(T=>T.labelFilter),$=q(T=>T.setLabelFilter),R=q(T=>T.dueDateFilter),M=q(T=>T.setDueDateFilter),D=q(T=>T.clearAllFilters),j=q(T=>T.layout),S=q(T=>T.toggleLayout),E=q(T=>T.isDarkMode),P=q(T=>T.cardSettings),W=q(T=>T.boards),G=q(T=>T.currentBoard),L=q(T=>T.columns),V=q(T=>T.labelDefs),O=q(T=>T.cards),te=q(T=>T.starredBoards),J=q(T=>T.toggleStarBoard),H=q(T=>T.savedViews),A=q(T=>T.saveCurrentView),Y=q(T=>T.removeView),z=q(T=>T.getHiddenColumnIds()),k=q(T=>T.setColumnHidden),C=x.useMemo(()=>{const T=new Set;return O.forEach(ve=>{ve.assignee&&T.add(ve.assignee)}),Array.from(T).sort()},[O]),N=x.useMemo(()=>{const T=new Set;return O.forEach(ve=>ve.labels.forEach(er=>T.add(er))),Array.from(T).sort()},[O]),B=x.useMemo(()=>Fs(d),[d]),K=x.useMemo(()=>Object.entries(B.metaFilter),[B]),ee=x.useMemo(()=>{const T=q.getState().columnSorts;return d!==""||p||v!=="all"||b!=="all"||w.length>0||R!=="all"||Object.values(T).some(ve=>ve!=="order")},[d,p,v,b,w,R]),[ne,le]=x.useState(!1),[me,I]=x.useState(!1),[oe,ce]=x.useState(""),X=x.useRef(null),de=x.useRef(null),[ge,je]=x.useState(!1),_e=x.useRef(null),[Ie,Ge]=x.useState(!1),[it,wt]=x.useState(!1),kt=x.useRef(null),[xe,$e]=x.useState(!1),We=x.useRef(null),[pt,is]=x.useState(!1),[pn,mn]=x.useState(!1),ls=x.useRef(null),[cs,gn]=x.useState(!1),[us,vn]=x.useState(""),ds=x.useRef(null),jo=x.useMemo(()=>{var T;return((T=W.find(ve=>ve.id===G))==null?void 0:T.actions)??{}},[W,G]),Eo=x.useMemo(()=>Object.entries(jo),[jo]),Ao=x.useMemo(()=>L.filter(T=>T.id!==Gn),[L]),fs=x.useMemo(()=>new Set(z),[z]),yn=x.useMemo(()=>{let T=0;return v!=="all"&&(T+=1),b!=="all"&&(T+=1),w.length>0&&(T+=1),R!=="all"&&(T+=1),T},[v,b,w,R]);x.useEffect(()=>{const T=ve=>{X.current&&!X.current.contains(ve.target)&&(le(!1),I(!1),ce(""))};return(ne||me)&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[ne,me]),x.useEffect(()=>{const T=ve=>{_e.current&&!_e.current.contains(ve.target)&&je(!1)};return ge&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[ge]),x.useEffect(()=>{const T=ve=>{kt.current&&!kt.current.contains(ve.target)&&(Ge(!1),wt(!1))};return Ie&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[Ie]),x.useEffect(()=>{Ie||wt(!1)},[Ie]),x.useEffect(()=>{const T=ve=>{We.current&&!We.current.contains(ve.target)&&$e(!1)};return xe&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[xe]),x.useEffect(()=>{const T=ve=>{ls.current&&!ls.current.contains(ve.target)&&mn(!1)};return pn&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[pn]),x.useEffect(()=>{cs&&ds.current&&ds.current.focus()},[cs]),x.useEffect(()=>{me&&de.current&&de.current.focus()},[me]);const No=((To=W.find(T=>T.id===G))==null?void 0:To.name)||G,hs=te.includes(G),Po=x.useCallback(()=>{const T=us.trim();T&&(A(T),vn(""),gn(!1),mn(!1))},[us,A]),Oi=x.useCallback(T=>{const ve=q.getState();ve.setSearchQuery(T.searchQuery),ve.setFuzzySearch(T.fuzzySearch),ve.setPriorityFilter(T.priorityFilter),ve.setAssigneeFilter(T.assigneeFilter),ve.setLabelFilter(T.labelFilter),ve.setDueDateFilter(T.dueDateFilter)},[]),Ro=()=>{const T=oe.trim();T&&(o(T),ce(""),I(!1))};return x.useEffect(()=>{const T=ve=>{const er=ve.target;er.tagName==="INPUT"||er.tagName==="TEXTAREA"||er.isContentEditable||(ve.key==="b"||ve.key==="B")&&(ve.preventDefault(),le(Di=>!Di))};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[]),l.jsxs("div",{className:"flex flex-col border-b border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50",children:[l.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 flex-wrap",children:[l.jsxs("div",{className:"relative flex items-center gap-0.5",ref:X,children:[l.jsxs("button",{type:"button",onClick:()=>le(!ne),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",title:"Switch board (b)",children:[l.jsx("span",{className:"max-w-[120px] truncate",children:No}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${ne?"rotate-180":""}`})]}),l.jsx("button",{type:"button",onClick:()=>J(G),className:"p-1.5 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:hs?"Unstar board":"Star board",children:l.jsx(og,{size:14,className:hs?"fill-amber-400 text-amber-400":"text-zinc-400"})}),me?l.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[l.jsx("input",{ref:de,type:"text",value:oe,onChange:T=>ce(T.target.value),onKeyDown:T=>{T.key==="Enter"&&Ro(),T.key==="Escape"&&(I(!1),ce(""))},placeholder:"Board name...",className:"w-28 px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"}),l.jsx("button",{type:"button",onClick:Ro,className:"px-2 py-1 text-xs font-medium text-white bg-blue-600 hover:bg-blue-700 rounded transition-colors",children:"Create"}),l.jsx("button",{type:"button",onClick:()=>{I(!1),ce("")},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:l.jsx(st,{size:14})})]}):l.jsx("button",{type:"button",onClick:()=>I(!0),className:"p-1.5 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:"Create new board",children:l.jsx(Zr,{size:14,className:"text-zinc-400"})}),ne&&l.jsx(KZ,{boards:W,currentBoard:G,starredBoards:te,onSelect:T=>{s(T),le(!1)},onClose:()=>le(!1)})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[220px] max-w-md",children:[l.jsxs("div",{className:"relative flex-1 min-w-[180px] max-w-xs",children:[l.jsx(sg,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),l.jsx("input",{type:"text",value:d,onChange:T=>f(T.target.value),placeholder:"Search cards, people, labels...",title:"Search cards by text. Advanced metadata search also works with meta.field: value",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),l.jsxs("label",{className:"inline-flex items-center gap-1.5 px-2 py-1.5 text-xs text-zinc-600 dark:text-zinc-300 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md select-none whitespace-nowrap",children:[l.jsx("input",{type:"checkbox",checked:p,onChange:T=>h(T.target.checked),className:"h-3.5 w-3.5 rounded border-zinc-300 text-blue-600 focus:ring-blue-500"}),l.jsx("span",{children:"Fuzzy"})]})]}),l.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors shadow-sm",title:"Create a new card",children:[l.jsx(Zr,{size:16}),l.jsx("span",{children:"New Card"})]}),l.jsxs("button",{type:"button",onClick:()=>is(T=>!T),className:`flex items-center gap-1.5 px-2 py-1.5 text-sm border rounded-md transition-colors ${pt||yn>0?"text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/30":"text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 border-zinc-200 dark:border-zinc-600 bg-white dark:bg-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-700"}`,title:"Show or hide filters",children:[l.jsx(b1,{size:14}),l.jsx("span",{children:yn>0?`Filters (${yn})`:"Filters"})]}),pt&&P.showPriorityBadges&&l.jsx("select",{value:v,onChange:T=>y(T.target.value),className:zl,children:Fm.map(T=>l.jsx("option",{value:T.value,children:T.label},T.value))}),pt&&P.showAssignee&&l.jsxs("select",{value:b,onChange:T=>_(T.target.value),className:zl,children:[l.jsx("option",{value:"all",children:"All Assignees"}),l.jsx("option",{value:"unassigned",children:"Unassigned"}),C.map(T=>l.jsx("option",{value:T,children:T},T))]}),pt&&P.showLabels&&l.jsxs("div",{className:"relative",ref:_e,children:[l.jsxs("button",{type:"button",onClick:()=>je(!ge),className:`flex items-center gap-1.5 text-sm bg-white dark:bg-zinc-800 border rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 transition-colors ${w.length>0?"border-blue-500 dark:border-blue-400":"border-zinc-200 dark:border-zinc-600"}`,children:[l.jsx(ei,{size:14,className:"text-zinc-400 shrink-0"}),l.jsx("span",{className:"max-w-[100px] truncate",children:w.length===0?"All Labels":w.length===1?w[0]:`${w.length} Labels`}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${ge?"rotate-180":""}`})]}),ge&&l.jsx(WZ,{labels:N,labelDefs:V,selected:w,onChange:$,showAllOption:!0})]}),pt&&P.showDueDate&&l.jsx("select",{value:R,onChange:T=>M(T.target.value),className:zl,children:Bm.map(T=>l.jsx("option",{value:T.value,children:T.label},T.value))}),ee&&l.jsxs("button",{onClick:D,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Clear all filters",children:[l.jsx(st,{size:14}),l.jsx("span",{children:"Clear"})]}),l.jsxs("div",{className:"relative",ref:ls,children:[l.jsxs("button",{type:"button",onClick:()=>mn(!pn),className:`flex items-center gap-1.5 px-2 py-1.5 text-sm border rounded-md transition-colors ${H.length>0?"text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/30":"text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 border-zinc-200 dark:border-zinc-600 bg-white dark:bg-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-700"}`,title:"Saved views",children:[l.jsx(pf,{size:14}),l.jsxs("span",{children:["Views",H.length>0?` (${H.length})`:""]})]}),pn&&l.jsxs("div",{className:"absolute top-full left-0 mt-1 min-w-[220px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[H.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"px-3 py-1 text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Saved views"}),H.map(T=>l.jsxs("div",{className:"flex items-center gap-1 px-2",children:[l.jsx("button",{type:"button",onClick:()=>{Oi(T),mn(!1)},className:"flex-1 text-sm text-left py-1.5 px-1 text-zinc-900 dark:text-zinc-100 hover:text-blue-600 dark:hover:text-blue-400 truncate transition-colors",children:T.name}),l.jsx("button",{type:"button",onClick:()=>Y(T.id),className:"p-1 text-zinc-400 hover:text-red-500 transition-colors shrink-0",title:"Remove view",children:l.jsx(st,{size:12})})]},T.id)),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"})]}),cs?l.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-1",children:[l.jsx("input",{ref:ds,type:"text",value:us,onChange:T=>vn(T.target.value),onKeyDown:T=>{T.key==="Enter"&&Po(),T.key==="Escape"&&(gn(!1),vn(""))},placeholder:"View name...",className:"flex-1 px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"}),l.jsx("button",{type:"button",onClick:Po,className:"px-2 py-1 text-xs font-medium text-white bg-blue-600 hover:bg-blue-700 rounded transition-colors",children:"Save"}),l.jsx("button",{type:"button",onClick:()=>{gn(!1),vn("")},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:l.jsx(st,{size:12})})]}):l.jsxs("button",{type:"button",onClick:()=>gn(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left text-blue-600 dark:text-blue-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(pf,{size:14}),l.jsx("span",{children:"Save current filters"})]})]})]}),l.jsxs("button",{onClick:t,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Add new list",children:[l.jsx(Zr,{size:16}),l.jsx("span",{children:"Add List"})]}),c&&l.jsx("button",{type:"button",onClick:c,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Keyboard shortcuts (?)",children:l.jsx(x1,{size:16})}),l.jsx("button",{type:"button",onClick:S,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:j==="horizontal"?"Switch to row layout":"Switch to column layout",children:j==="horizontal"?l.jsx(w1,{size:16}):l.jsx(Fl,{size:16})}),l.jsxs("div",{className:"relative",ref:kt,children:[l.jsx("button",{type:"button",onClick:()=>Ge(!Ie),className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Board options",children:l.jsx(k1,{size:16})}),Ie&&l.jsxs("div",{className:"absolute top-full right-0 mt-1 min-w-[200px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[Ao.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"px-1",onClick:T=>T.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:T=>{T.stopPropagation(),wt(ve=>!ve)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors rounded-sm","aria-expanded":it,children:[l.jsx(Fl,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{className:"flex-1",children:"Columns"}),l.jsx(Ze,{size:14,className:`shrink-0 text-zinc-400 transition-transform ${it?"rotate-180":""}`})]}),it&&l.jsx("div",{className:"mt-1 mb-1 rounded-md border border-zinc-200 dark:border-zinc-700 bg-zinc-50/80 dark:bg-zinc-900/50 py-1",onClick:T=>T.stopPropagation(),children:Ao.map(T=>{const ve=!fs.has(T.id);return l.jsx(HZ,{label:T.name,checked:ve,onChange:er=>k(G,T.id,!er)},T.id)})})]}),l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"})]}),l.jsxs("button",{type:"button",onClick:()=>{n(),Ge(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[E?l.jsx(_1,{size:14,className:"shrink-0 text-zinc-400"}):l.jsx(C1,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{children:E?"Light Theme":"Dark Theme"})]}),l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{e(),Ge(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx($1,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{children:"Settings"})]}),a&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{a(),Ge(!1)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors ${i?"text-blue-600 dark:text-blue-400":"text-zinc-900 dark:text-zinc-100"}`,children:[l.jsx(tg,{size:14,className:`shrink-0 ${i?"text-blue-500":"text-zinc-400"}`}),l.jsx("span",{children:"Board Logs"})]})]})]})]}),Eo.length>0&&u&&l.jsxs("div",{className:"relative ml-auto",ref:We,children:[l.jsxs("button",{type:"button",onClick:()=>$e(!xe),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",title:"Board actions",children:[l.jsx(ga,{size:14,className:"text-amber-500"}),l.jsx("span",{children:"Actions"}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${xe?"rotate-180":""}`})]}),xe&&l.jsx("div",{className:"absolute top-full right-0 mt-1 min-w-[180px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:Eo.map(([T,ve])=>l.jsxs("button",{type:"button",onClick:()=>{$e(!1),u(G,T)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx(ga,{size:12,className:"text-amber-500 shrink-0"}),l.jsx("span",{className:"truncate",children:ve})]},T))})]})]}),ee&&l.jsxs("div",{className:"flex flex-wrap gap-1.5 px-4 pb-2",children:[B.plainText&&l.jsx(Lr,{label:`Search: "${B.plainText}"`,onRemove:g}),K.map(([T,ve])=>l.jsx(Lr,{label:`meta.${T}: ${ve}`,onRemove:()=>m(T)},T)),p&&l.jsx(Lr,{label:"Fuzzy",onRemove:()=>h(!1)}),v!=="all"&&l.jsx(Lr,{label:`Priority: ${((Io=Fm.find(T=>T.value===v))==null?void 0:Io.label)??v}`,onRemove:()=>y("all")}),b!=="all"&&l.jsx(Lr,{label:`Assignee: ${b==="unassigned"?"Unassigned":b}`,onRemove:()=>_("all")}),w.map(T=>l.jsx(Lr,{label:`Label: ${T}`,onRemove:()=>$(w.filter(ve=>ve!==T))},T)),R!=="all"&&l.jsx(Lr,{label:`Due: ${((Mo=Bm.find(T=>T.value===R))==null?void 0:Mo.label)??R}`,onRemove:()=>M("all")})]})]})}function Um({title:e,message:t,onUndo:r,onExpire:n,duration:s,index:o,actionLabel:a="Undo",persistent:i=!1,tone:u="default"}){const[c,d]=x.useState(100),f=!i&&typeof s=="number"&&typeof n=="function",p=u==="error"?"var(--vscode-errorForeground, #f14c4c)":u==="info"?"var(--vscode-progressBar-background)":void 0;return x.useEffect(()=>{if(!f||!s){d(100);return}const h=50,g=h/s*100,m=setInterval(()=>{d(v=>{const y=v-g;return y<=0?(clearInterval(m),0):y})},h);return()=>clearInterval(m)},[s,f]),x.useEffect(()=>{f&&c<=0&&n&&n()},[c,n,f]),l.jsxs("div",{className:"fixed right-4 z-50 flex flex-col min-w-[320px] max-w-[420px] shadow-[0_4px_16px_rgba(0,0,0,0.4)] transition-[bottom] duration-200 ease-out",style:{bottom:`${24+o*52}px`,background:"var(--vscode-notifications-background)",color:"var(--vscode-notifications-foreground)",border:"1px solid var(--vscode-notifications-border, var(--vscode-widget-border))",borderLeft:p?`3px solid ${p}`:void 0},children:[l.jsxs("div",{className:"flex items-start gap-3 px-3 py-2.5",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[e&&l.jsx("div",{className:"mb-0.5 text-[12px] font-semibold",children:e}),l.jsx("span",{className:`text-[13px] leading-snug ${e?"block":"truncate"}`,children:t})]}),r&&l.jsx("button",{onClick:r,className:"text-[13px] px-2 py-0.5 shrink-0",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},onMouseEnter:h=>h.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:h=>h.currentTarget.style.background="var(--vscode-button-background)",children:a})]}),f&&l.jsx("div",{className:"h-[2px] w-full",style:{background:"var(--vscode-widget-border)"},children:l.jsx("div",{className:"h-full transition-none",style:{width:`${c}%`,background:"var(--vscode-progressBar-background)"}})})]})}const qZ=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],YZ=[{value:"fancy",label:"Fancy"},{value:"plain",label:"Plain"}],JZ=[{value:"aurora",label:"Aurora Glow"},{value:"sunset",label:"Sunset Blend"},{value:"meadow",label:"Meadow Mist"},{value:"nebula",label:"Nebula Bloom"},{value:"lagoon",label:"Lagoon Light"},{value:"candy",label:"Candy Pop"},{value:"ember",label:"Ember Sky"},{value:"violet",label:"Violet Pulse"}],ZZ=[{value:"paper",label:"Paper White"},{value:"mist",label:"Mist Blue"},{value:"sand",label:"Soft Sand"}];function QZ({isOpen:e,settings:t,workspace:r,onClose:n,onSave:s,onSetLabel:o,onRenameLabel:a,onDeleteLabel:i}){return e?l.jsx(tQ,{settings:t,workspace:r,onClose:n,onSave:s,onSetLabel:o,onRenameLabel:a,onDeleteLabel:i}):null}function XZ({checked:e,onChange:t}){return l.jsx("button",{type:"button",onClick:()=>t(!e),className:Ae("relative inline-flex h-5 w-9 items-center rounded-full transition-colors shrink-0"),style:{background:e?"var(--vscode-button-background)":"var(--vscode-badge-background, #6b7280)"},children:l.jsx("span",{className:"inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",style:{transform:e?"translateX(18px)":"translateX(3px)"}})})}function As({title:e,children:t}){return l.jsxs("div",{className:"py-3",children:[l.jsx("h3",{className:"px-4 pb-2 text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:e}),l.jsx("div",{children:t})]})}function Fr({label:e,description:t,checked:r,onChange:n}){return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors cursor-pointer",onClick:()=>n(!r),onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),t&&l.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),l.jsx(XZ,{checked:r,onChange:n})]})}function Xo({label:e,value:t}){return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-1.5",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-descriptionForeground)"},children:e}),l.jsx("div",{className:"text-xs font-mono truncate max-w-[60%] text-right",style:{color:"var(--vscode-foreground)",opacity:.7},title:t,children:t})]})}function Ns({label:e,value:t,options:r,onChange:n}){const[s,o]=x.useState(!1),a=r.find(i=>i.value===t);return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:i=>i.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:i=>i.currentTarget.style.background="transparent",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",a.dot)}),!(a!=null&&a.dot)&&(a==null?void 0:a.dotColor)&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.dotColor}}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"}})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),l.jsx("div",{className:"absolute top-full right-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:r.map(i=>l.jsxs("button",{type:"button",onClick:()=>{n(i.value),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:u=>{i.value!==t&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{i.value!==t&&(u.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",i.dot)}),!i.dot&&i.dotColor&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:i.dotColor}}),l.jsx("span",{className:"flex-1 text-left",children:i.label})]},i.value))})]})]})]})}function Ol({label:e,description:t,value:r,min:n,max:s,step:o,unit:a,onChange:i}){const u=(r-n)/(s-n)*100;return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:c=>c.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:c=>c.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),t&&l.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx("input",{type:"range",min:n,max:s,step:o,value:r,onChange:c=>i(Number(c.target.value)),className:"settings-slider",style:{background:`linear-gradient(to right, var(--vscode-button-background) ${u}%, var(--vscode-badge-background, #6b7280) ${u}%)`}}),l.jsxs("span",{className:"text-xs font-mono w-12 text-right tabular-nums",style:{color:"var(--vscode-foreground)"},children:[r,a||"%"]})]})]})}function Vm({value:e,onChange:t}){const[r,n]=x.useState(!1),[s,o]=x.useState("");return l.jsxs("div",{className:"relative",children:[l.jsx("button",{type:"button",onClick:()=>n(!r),className:"w-5 h-5 rounded-full border border-white/20 cursor-pointer shrink-0",style:{backgroundColor:e}}),r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>n(!1)}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-2 min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[l.jsx("div",{className:"grid grid-cols-6 gap-1.5 mb-2",children:ec.map(a=>l.jsx("button",{type:"button",onClick:()=>{t(a.hex),n(!1)},className:"w-6 h-6 rounded-full border-2 transition-transform hover:scale-110",style:{backgroundColor:a.hex,borderColor:e===a.hex?"white":"transparent"},title:a.name},a.name))}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("input",{type:"text",placeholder:"#hex",value:s,onChange:a=>o(a.target.value),className:"flex-1 px-2 py-1 text-xs rounded",style:{background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"}}),l.jsx("button",{type:"button",onClick:()=>{/^#[0-9a-fA-F]{6}$/.test(s)&&(t(s),n(!1),o(""))},className:"px-2 py-1 text-xs rounded",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:"OK"})]})]})]})]})}function eQ({onSetLabel:e,onRenameLabel:t,onDeleteLabel:r}){const n=q(j=>j.labelDefs),s=q(j=>j.cards),[o,a]=x.useState(""),[i,u]=x.useState(ec[0].hex),[c,d]=x.useState(""),[f,p]=x.useState(null),[h,g]=x.useState(""),[m,v]=x.useState(null),y=x.useMemo(()=>{const j=new Map;for(const[S,E]of Object.entries(n))j.set(S,E);for(const S of s)for(const E of S.labels)j.has(E)||j.set(E,void 0);return j},[n,s]),b=x.useMemo(()=>{const j={};return y.forEach((E,P)=>{const W=(E==null?void 0:E.group)||"Other";j[W]||(j[W]=[]),j[W].push({name:P,def:E})}),Object.entries(j).sort(([E],[P])=>E==="Other"?1:P==="Other"?-1:E.localeCompare(P))},[y]),_=x.useMemo(()=>{const j=new Set;return Object.values(n).forEach(S=>{S.group&&j.add(S.group)}),Array.from(j).sort()},[n]),w=j=>s.filter(S=>S.labels.includes(j)).length,$=()=>{const j=o.trim();j&&(e==null||e(j,{color:i,group:c||void 0}),a(""),u(ec[0].hex),d(""))},R=j=>{const S=h.trim();S&&S!==j&&(t==null||t(j,S)),p(null),g("")},M=j=>{r==null||r(j),v(null)},D={background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"};return l.jsxs("div",{className:"px-4 space-y-3",children:[b.map(([j,S])=>l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--vscode-descriptionForeground)"},children:j}),l.jsx("div",{className:"space-y-1",children:S.map(({name:E,def:P})=>l.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded group/label transition-colors",onMouseEnter:W=>W.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:W=>W.currentTarget.style.background="transparent",children:[l.jsx(Vm,{value:(P==null?void 0:P.color)||"#6b7280",onChange:W=>e==null?void 0:e(E,{...P,color:W,group:P==null?void 0:P.group})}),f===E?l.jsx("input",{type:"text",value:h,onChange:W=>g(W.target.value),onKeyDown:W=>{W.key==="Enter"&&R(E),W.key==="Escape"&&(p(null),g(""))},onBlur:()=>R(E),autoFocus:!0,className:"flex-1 px-1.5 py-0.5 text-xs rounded min-w-0",style:D}):l.jsx("span",{className:"flex-1 text-xs truncate",style:{color:"var(--vscode-foreground)"},children:E}),(P==null?void 0:P.group)&&f!==E&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full shrink-0",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:P.group}),m===E?l.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[l.jsxs("span",{className:"text-[10px]",style:{color:"var(--vscode-errorForeground, #f44)"},children:[w(E)," card",w(E)!==1?"s":""]}),l.jsx("button",{type:"button",onClick:()=>M(E),className:"px-1.5 py-0.5 text-[10px] rounded",style:{background:"var(--vscode-inputValidation-errorBackground, #5a1d1d)",color:"var(--vscode-errorForeground, #f44)"},children:"Delete"}),l.jsx("button",{type:"button",onClick:()=>v(null),className:"px-1.5 py-0.5 text-[10px] rounded",style:{color:"var(--vscode-descriptionForeground)"},children:"Cancel"})]}):l.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 opacity-0 group-hover/label:opacity-100 transition-opacity",children:[l.jsx("button",{type:"button",onClick:()=>{p(E),g(E)},className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:W=>W.currentTarget.style.color="var(--vscode-foreground)",onMouseLeave:W=>W.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Rename label",children:l.jsx(Lc,{size:12})}),l.jsx("button",{type:"button",onClick:()=>v(E),className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:W=>W.currentTarget.style.color="var(--vscode-errorForeground, #f44)",onMouseLeave:W=>W.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Delete label",children:l.jsx(Kt,{size:12})})]})]},E))})]},j)),l.jsxs("div",{className:"rounded-lg p-2 space-y-2",style:{background:"var(--vscode-input-background)",border:"1px solid var(--vscode-input-border, transparent)"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Vm,{value:i,onChange:u}),l.jsx("input",{type:"text",placeholder:"New label name...",value:o,onChange:j=>a(j.target.value),onKeyDown:j=>{j.key==="Enter"&&$()},className:"flex-1 px-1.5 py-1 text-xs rounded bg-transparent min-w-0",style:{color:"var(--vscode-input-foreground)",outline:"none"}})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",placeholder:"Group (optional)",value:c,onChange:j=>d(j.target.value),onKeyDown:j=>{j.key==="Enter"&&$()},list:"label-groups",className:"flex-1 px-1.5 py-1 text-xs rounded",style:D}),l.jsx("datalist",{id:"label-groups",children:_.map(j=>l.jsx("option",{value:j},j))}),l.jsxs("button",{type:"button",onClick:$,disabled:!o.trim(),className:"flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors disabled:opacity-40",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:[l.jsx(Zr,{size:12}),"Add"]})]})]})]})}function tQ({settings:e,workspace:t,onClose:r,onSave:n,onSetLabel:s,onRenameLabel:o,onDeleteLabel:a}){const[i,u]=x.useState(e),[c,d]=x.useState("general"),[f,p]=x.useState(!1),h=q($=>$.columns),g=q($=>$.effectiveDrawerWidth),m=q($=>$.setDrawerWidthPreview),v=q($=>$.clearDrawerWidthPreview),y=x.useMemo(()=>h.filter($=>$.id!==Gn).map($=>({value:$.id,label:$.name,dotColor:$.color})),[h]),b=x.useMemo(()=>i.boardBackgroundMode==="plain"?ZZ:JZ,[i.boardBackgroundMode]);x.useEffect(()=>{u(e)},[e]);const _=$=>{const R={...i,...$};u(R),n(R)};x.useEffect(()=>{const $=R=>{R.key==="Escape"&&(R.stopPropagation(),r())};return document.addEventListener("keydown",$,!0),()=>document.removeEventListener("keydown",$,!0)},[r]);const w=(i.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-50 flex ${w?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!w&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r}),l.jsxs("div",{className:w?"relative h-full shadow-xl flex flex-col animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] shadow-xl flex flex-col rounded-xl animate-in zoom-in-95 fade-in duration-200",style:w?{width:`${g}%`,background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"}:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},...w?{"data-panel-drawer":""}:{},children:[l.jsx(Xa,{panelMode:w?"drawer":"popup",onPreview:m,onCommit:$=>{v();const R={...i,drawerWidth:$};u(R),n(R)},onCancel:v}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Settings"}),l.jsx("button",{onClick:r,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:$=>$.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:$=>$.currentTarget.style.background="transparent",children:l.jsx(st,{size:18})})]}),l.jsx("div",{className:"flex",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:["general","defaults","labels"].map($=>l.jsxs("button",{type:"button",onClick:()=>d($),className:"px-4 py-2.5 text-xs font-medium transition-colors relative",style:{color:c===$?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)",background:"transparent"},children:[$.charAt(0).toUpperCase()+$.slice(1),c===$&&l.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5",style:{background:"var(--vscode-button-background)"}})]},$))}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[c==="general"&&l.jsxs(l.Fragment,{children:[l.jsxs(As,{title:"Card Display",children:[l.jsx(Fr,{label:"Show Priority Badges",description:"Display priority indicators on card cards",checked:i.showPriorityBadges,onChange:$=>_({showPriorityBadges:$})}),l.jsx(Fr,{label:"Show Assignee",description:"Display assigned person on card cards",checked:i.showAssignee,onChange:$=>_({showAssignee:$})}),l.jsx(Fr,{label:"Show Due Date",description:"Display due dates on card cards",checked:i.showDueDate,onChange:$=>_({showDueDate:$})}),l.jsx(Fr,{label:"Show Labels",description:"Display labels on card cards and in editors",checked:i.showLabels,onChange:$=>_({showLabels:$})}),l.jsx(Fr,{label:"Show Filename",description:"Display the source markdown filename on cards",checked:i.showFileName,onChange:$=>_({showFileName:$})}),l.jsx(Fr,{label:"Compact Mode",description:"Use compact card layout to show more cards",checked:i.compactMode,onChange:$=>_({compactMode:$})}),l.jsx(Fr,{label:"Show Deleted Column",description:"Display the Deleted column to manage soft-deleted cards",checked:i.showDeletedColumn,onChange:$=>_({showDeletedColumn:$})})]}),l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs(As,{title:"Layout",children:[l.jsx(Ns,{label:"Panel Style",value:i.panelMode??"drawer",options:[{value:"drawer",label:"Right-side Drawer"},{value:"popup",label:"Centered Popup"}],onChange:$=>_({panelMode:$})}),(i.panelMode??"drawer")==="drawer"&&l.jsx(Ol,{label:"Drawer Width",description:"Width of the right-side drawer as a percentage of the viewport",value:i.drawerWidth??50,min:20,max:80,step:5,onChange:$=>_({drawerWidth:$})}),l.jsx(Ns,{label:"Background Style",value:i.boardBackgroundMode,options:YZ,onChange:$=>{const R=Ea($);_(R)}}),l.jsx(Ns,{label:"Background Preset",value:i.boardBackgroundPreset,options:b,onChange:$=>{const R=Ea(i.boardBackgroundMode,$);_(R)}})]}),l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs(As,{title:"Zoom",children:[l.jsx(Ol,{label:"Board Zoom",description:"Scale text size on the board view",value:i.boardZoom,min:75,max:150,step:5,onChange:$=>_({boardZoom:$})}),l.jsx(Ol,{label:"Card Detail Zoom",description:"Scale text size in the card detail panel",value:i.cardZoom,min:75,max:150,step:5,onChange:$=>_({cardZoom:$})})]}),t&&l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 cursor-pointer",onClick:()=>p($=>!$),onMouseEnter:$=>$.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:$=>$.currentTarget.style.background="transparent",children:[l.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:"Advanced"}),l.jsx(Ze,{size:14,className:`transition-transform ${f?"rotate-180":""}`,style:{color:"var(--vscode-descriptionForeground)"}})]}),f&&l.jsxs(l.Fragment,{children:[l.jsx(Xo,{label:"Project Path",value:t.projectPath}),l.jsx(Xo,{label:"Kanban Directory",value:t.kanbanDirectory}),l.jsx(Xo,{label:"Server Port",value:String(t.port)}),l.jsx(Xo,{label:"Config Version",value:String(t.configVersion)})]})]})]}),c==="defaults"&&l.jsxs(As,{title:"Defaults",children:[l.jsx(Ns,{label:"Default Priority",value:i.defaultPriority,options:qZ,onChange:$=>_({defaultPriority:$})}),l.jsx(Ns,{label:"Default Status",value:i.defaultStatus,options:y,onChange:$=>_({defaultStatus:$})})]}),c==="labels"&&l.jsx(As,{title:"Labels",children:l.jsx(eQ,{onSetLabel:s,onRenameLabel:o,onDeleteLabel:a})})]}),l.jsx("div",{className:"px-4 py-2",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:l.jsx("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Settings are saved automatically and apply to all connected clients."})})]})]})}const rQ=["#6b7280","#3b82f6","#f59e0b","#8b5cf6","#22c55e","#ef4444","#ec4899","#14b8a6","#f97316","#06b6d4"];function nQ({isOpen:e,onClose:t,onSave:r,initial:n,title:s}){const[o,a]=x.useState((n==null?void 0:n.name)??""),[i,u]=x.useState((n==null?void 0:n.color)??"#3b82f6"),c=x.useRef(null);return x.useEffect(()=>{e&&(a((n==null?void 0:n.name)??""),u((n==null?void 0:n.color)??"#3b82f6"),setTimeout(()=>{var d;return(d=c.current)==null?void 0:d.focus()},50))},[e,n]),x.useEffect(()=>{if(!e)return;const d=f=>{f.key==="Escape"&&t(),f.key==="Enter"&&(f.ctrlKey||f.metaKey)&&o.trim()&&r({name:o.trim(),color:i})};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,t,r,o,i]),e?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),l.jsxs("div",{className:"relative bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-sm mx-4 border border-zinc-200 dark:border-zinc-600",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[l.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:s}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:l.jsx(st,{size:16,className:"text-zinc-500"})})]}),l.jsxs("div",{className:"px-4 py-4 space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Name"}),l.jsx("input",{ref:c,type:"text",value:o,onChange:d=>a(d.target.value),placeholder:"List name...",className:"w-full px-3 py-1.5 text-sm bg-white dark:bg-zinc-700 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Color"}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[rQ.map(d=>l.jsx("button",{type:"button",onClick:()=>u(d),className:`w-6 h-6 rounded-full border-2 transition-all ${i===d?"border-zinc-900 dark:border-white scale-110":"border-transparent hover:scale-110"}`,style:{backgroundColor:d},title:d},d)),l.jsx("input",{type:"color",value:i,onChange:d=>u(d.target.value),className:"w-6 h-6 rounded cursor-pointer border-0 p-0 bg-transparent",title:"Custom color"})]})]})]}),l.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[l.jsx("button",{type:"button",onClick:t,className:"px-3 py-1.5 text-sm rounded-md text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:"Cancel"}),l.jsx("button",{type:"button",onClick:()=>{o.trim()&&r({name:o.trim(),color:i})},disabled:!o.trim(),className:"px-3 py-1.5 text-sm rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Save"})]})]})]}):null}const sQ=["critical","high","medium","low"],oQ={critical:"Critical",high:"High",medium:"Medium",low:"Low"},aQ={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"};function iQ({selectedCount:e,onClearSelection:t,onMoveToColumn:r,onSetPriority:n,onSetAssignee:s,onApplyLabels:o,onDelete:a}){const i=q(b=>b.columns),u=q(b=>b.cards),c=q(b=>b.labelDefs),d=q(b=>b.selectedCardIds),f=x.useMemo(()=>{const b=new Set;return u.forEach(_=>{_.assignee&&b.add(_.assignee)}),Array.from(b).sort()},[u]),p=x.useMemo(()=>{const b=new Set;return u.forEach(_=>_.labels.forEach(w=>b.add(w))),Array.from(b).sort()},[u]),h=x.useMemo(()=>u.filter(b=>d.includes(b.id)),[u,d]),[g,m]=x.useState(null),v=x.useRef(null);x.useEffect(()=>{const b=_=>{v.current&&!v.current.contains(_.target)&&m(null)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]);const y=b=>{m(g===b?null:b)};return l.jsxs("div",{ref:v,className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-white dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-600 rounded-lg shadow-xl px-3 py-2",children:[l.jsxs("span",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-200 whitespace-nowrap",children:[e," selected"]}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:"Clear selection",children:l.jsx(st,{size:14,className:"text-zinc-500"})}),l.jsx("div",{className:"w-px h-5 bg-zinc-300 dark:bg-zinc-600"}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("moveTo"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(S1,{size:14}),"Move to",l.jsx(Ze,{size:12})]}),g==="moveTo"&&l.jsx(Dl,{children:i.map(b=>l.jsxs("button",{type:"button",onClick:()=>{r(b.id),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:b.color}}),b.name]},b.id))})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("priority"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(Fc,{size:14}),"Priority",l.jsx(Ze,{size:12})]}),g==="priority"&&l.jsx(Dl,{children:sQ.map(b=>l.jsxs("button",{type:"button",onClick:()=>{n(b),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${aQ[b]}`}),oQ[b]]},b))})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("assignee"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(va,{size:14}),"Assign",l.jsx(Ze,{size:12})]}),g==="assignee"&&l.jsxs(Dl,{children:[l.jsx("button",{type:"button",onClick:()=>{s(null),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors italic",children:"Unassign"}),f.map(b=>l.jsxs("button",{type:"button",onClick:()=>{s(b),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:b.split(/\s+/).map(_=>_[0]).join("").toUpperCase().slice(0,2)}),b]},b))]})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("labels"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(ei,{size:14}),"Labels",l.jsx(Ze,{size:12})]}),g==="labels"&&l.jsx(lQ,{allLabels:p,labelDefs:c,selectedCards:h,onApply:(b,_)=>{o(b,_),m(null)}})]}),l.jsx("div",{className:"w-px h-5 bg-zinc-300 dark:bg-zinc-600"}),l.jsxs("button",{type:"button",onClick:()=>{a()},className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors text-red-600 dark:text-red-400",children:[l.jsx(Kt,{size:14}),"Delete"]})]})}function Dl({children:e}){return l.jsx("div",{className:"absolute bottom-full mb-1 left-0 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[160px] max-h-64 overflow-y-auto",children:e})}function lQ({allLabels:e,labelDefs:t,selectedCards:r,onApply:n}){const[s,o]=x.useState(new Map),[a,i]=x.useState(""),u=x.useMemo(()=>{const v=new Map;if(r.length===0)return v;for(const y of e){const b=r.filter(_=>_.labels.includes(y)).length;v.set(y,b===0?"none":b===r.length?"all":"some")}return v},[e,r]),c=v=>{const y=s.get(v);if(y==="add")return"checked";if(y==="remove")return"unchecked";const b=u.get(v)??"none";return b==="all"?"checked":b==="some"?"indeterminate":"unchecked"},d=v=>{const y=u.get(v)??"none",b=c(v),_=new Map(s);b==="unchecked"||b==="indeterminate"?_.set(v,"add"):y==="all"?s.get(v)==="remove"?_.delete(v):_.set(v,"remove"):_.delete(v),o(_)},f=x.useMemo(()=>{if(!a)return e;const v=a.toLowerCase();return e.filter(y=>y.toLowerCase().includes(v))},[e,a]),p=Array.from(s.entries()).filter(([,v])=>v==="add").map(([v])=>v),h=Array.from(s.entries()).filter(([,v])=>v==="remove").map(([v])=>v),g=p.length>0||h.length>0,m=p.length>0&&h.length>0?`Apply changes (+${p.length} −${h.length})`:p.length>0?`Add ${p.length} label${p.length!==1?"s":""}`:`Remove ${h.length} label${h.length!==1?"s":""}`;return l.jsxs("div",{className:"absolute bottom-full mb-1 left-0 z-50 min-w-[200px]",children:[l.jsxs("div",{className:"max-h-72 overflow-y-auto bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1",children:[l.jsx("div",{className:"px-2 pb-1",children:l.jsx("input",{type:"text",value:a,onChange:v=>i(v.target.value),placeholder:"Filter labels...",autoFocus:!0,className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}),f.map(v=>{const y=t[v],b=c(v);return l.jsxs("button",{type:"button",onClick:()=>d(v),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsxs("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${b==="checked"?"border-blue-500 bg-blue-500":b==="indeterminate"?"border-zinc-400 bg-zinc-200 dark:border-zinc-400 dark:bg-zinc-600":"border-zinc-300 dark:border-zinc-500"}`,children:[b==="checked"&&l.jsx(jt,{size:10,className:"text-white"}),b==="indeterminate"&&l.jsx(j1,{size:10,className:"text-zinc-600 dark:text-zinc-300"})]}),(y==null?void 0:y.color)&&l.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:y.color}}),l.jsx("span",{className:"truncate",children:v})]},v)}),f.length===0&&l.jsx("div",{className:"px-3 py-2 text-sm text-zinc-400 dark:text-zinc-500",children:"No labels found"})]}),g&&l.jsx("div",{className:"bg-white dark:bg-zinc-800 border border-t-0 border-zinc-200 dark:border-zinc-600 rounded-b-md shadow-lg px-1 py-1",children:l.jsx("button",{type:"button",onClick:()=>n(p,h),className:"flex items-center justify-center gap-1 w-full px-3 py-1.5 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 rounded transition-colors",children:m})})]})}const cQ=[{keys:["n"],description:"Create a new card"},{keys:["?"],description:"Show / hide this shortcut reference"},{keys:["Ctrl","Z"],description:"Undo last card deletion"},{keys:["Ctrl","+"],description:"Increase board zoom"},{keys:["Ctrl","-"],description:"Decrease board zoom"},{keys:["Ctrl","Shift","+"],description:"Increase card detail zoom"},{keys:["Ctrl","Shift","-"],description:"Decrease card detail zoom"},{keys:["Esc"],description:"Close dialog / clear selection"},{keys:["Ctrl","Enter"],description:"Save and close card (in create dialog)"},{keys:["Ctrl","S"],description:"Save card (in create dialog)"},{keys:["Enter"],description:"Add card (in inline quick-add)"}];function uQ({isOpen:e,onClose:t}){return x.useEffect(()=>{if(!e)return;const r=n=>{n.key==="Escape"&&(n.stopPropagation(),t())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[e,t]),e?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:t}),l.jsxs("div",{className:"relative w-full max-w-md rounded-xl shadow-2xl flex flex-col overflow-hidden",style:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("span",{className:"font-semibold text-sm",style:{color:"var(--vscode-foreground)"},children:"Keyboard Shortcuts"}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:r=>r.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:r=>r.currentTarget.style.background="transparent",title:"Close",children:l.jsx(st,{size:16})})]}),l.jsx("div",{className:"overflow-y-auto max-h-[60vh]",children:cQ.map((r,n)=>l.jsxs("div",{className:"flex items-center justify-between px-5 py-2",style:{borderBottom:"1px solid var(--vscode-panel-border)",opacity:.95},onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:[l.jsx("span",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:r.description}),l.jsx("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:r.keys.map((s,o)=>l.jsxs("span",{className:"flex items-center gap-1",children:[o>0&&l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"+"}),l.jsx("kbd",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:s})]},o))})]},n))}),l.jsxs("div",{className:"px-5 py-2 text-xs",style:{borderTop:"1px solid var(--vscode-panel-border)",color:"var(--vscode-descriptionForeground)"},children:["Press ",l.jsx("kbd",{className:"inline-flex items-center px-1 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:"?"})," or ",l.jsx("kbd",{className:"inline-flex items-center px-1 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:"Esc"})," to close"]})]})]}):null}function dQ(e){if(!e||e<=0)return"";if(e<1e3)return` Next retry in ${e}ms.`;const t=e/1e3;return` Next retry in ${Number.isInteger(t)?String(t):t.toFixed(1)}s.`}function Wm(e){return e?e==="socket-closed"?" The previous socket closed unexpectedly.":` Last signal: ${e}.`:""}function fQ(e){if(e.type==="init"||e.connected||!e.reconnecting&&!e.fatal)return null;if(e.fatal)return{title:"Connection lost",message:`The standalone backend is unavailable and automatic reconnect has stopped.${Wm(e.reason)} Form submissions are unavailable until the backend is reachable again. Refresh or reopen this page after the backend is available again.`,tone:"error"};const t=e.retryCount??1,r=e.maxRetries??t;return{title:"Reconnecting…",message:`Trying to reconnect to the standalone backend (attempt ${t} of ${r}).${dQ(e.retryDelayMs)}${Wm(e.reason)} Form submissions pause until the backend reconnects.`,tone:"info"}}const ue=af();function hQ(e){return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).flatMap(([t,r])=>{if(!r||typeof r!="object"||Array.isArray(r))return[];const n=Array.isArray(r.hiddenColumnIds)?r.hiddenColumnIds.filter(o=>typeof o=="string"):[],s=Array.isArray(r.minimizedColumnIds)?r.minimizedColumnIds.filter(o=>typeof o=="string"):[];return[[t,{hiddenColumnIds:n,minimizedColumnIds:s}]]}))}function pQ(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function mQ(e){return{version:e.version,id:e.id,...e.boardId!==void 0?{boardId:e.boardId}:{},status:e.status,priority:e.priority,assignee:e.assignee,dueDate:e.dueDate,created:e.created,modified:e.modified,completedAt:e.completedAt,labels:e.labels,attachments:e.attachments,order:e.order,metadata:e.metadata,actions:e.actions,forms:e.forms,formData:e.formData}}function gQ(){var df;const{columns:e,boards:t,currentBoard:r,columnVisibilityByBoard:n,workspace:s,cardSettings:o,effectiveDrawerWidth:a,settingsOpen:i,selectedCardIds:u,setCards:c,setColumns:d,setBoards:f,setIsDarkMode:p,setWorkspace:h,setCardSettings:g,setDrawerWidthPreview:m,clearDrawerWidthPreview:v,setSettingsOpen:y,setLabelDefs:b,toggleSelectCard:_,selectCardRange:w,selectAllInColumn:$,clearSelection:R,setActiveCardId:M}=q(),[D,j]=x.useState(!1),[S,E]=x.useState("backlog"),[P,W]=x.useState(!1),[G,L]=x.useState(!1),[V,O]=x.useState(null),te=x.useRef(0),[J,H]=x.useState(null),[A,Y]=x.useState(!1),[z,k]=x.useState([]),[C,N]=x.useState(!1),B=x.useRef(hQ(ue.getState())),K=x.useRef(null);x.useEffect(()=>{M((J==null?void 0:J.id)??null)},[J==null?void 0:J.id,M]);const[ee,ne]=x.useState([]),[le,me]=x.useState(null),I=x.useRef(ee),oe=(df=t.find(F=>F.id===r))==null?void 0:df.title;x.useEffect(()=>{I.current=ee},[ee]);const ce=x.useRef(0),X=x.useCallback(F=>{H(Z=>{if(!Z)return Z;const Q=F.find(mt=>mt.id===Z.id);if(!Q)return Z;const re=mQ(Q),Ee=Q.comments||[],ae=Z.content!==Q.content,qe=JSON.stringify(Z.frontmatter)!==JSON.stringify(re),Xe=JSON.stringify(Z.comments)!==JSON.stringify(Ee);return!ae&&!qe&&!Xe?Z:(ae&&(te.current+=1),{...Z,content:Q.content,frontmatter:re,comments:Ee,contentVersion:ae?te.current:Z.contentVersion})})},[]),de=x.useCallback(F=>{const{cards:Z}=q.getState(),Q=Z.find(ae=>ae.id===F);if(!Q)return;const re=Q.status;c(Z.map(ae=>ae.id===F?{...ae,status:Gn}:ae)),(J==null?void 0:J.id)===F&&(H(null),M(null));const Ee=String(ce.current++);ne(ae=>[...ae,{id:Ee,card:Q,originalStatus:re}])},[J,c]),ge=x.useCallback(F=>{const Z=I.current.find(Q=>Q.id===F);Z&&(ue.postMessage({type:"deleteCard",cardId:Z.card.id}),ne(Q=>Q.filter(re=>re.id!==F)))},[]),je=x.useCallback(F=>{const Z=I.current.find(re=>re.id===F);if(!Z)return;const{cards:Q}=q.getState();c(Q.map(re=>re.id===Z.card.id?{...re,status:Z.originalStatus}:re)),ne(re=>re.filter(Ee=>Ee.id!==F))},[c]),_e=x.useCallback(()=>{const F=I.current;F.length!==0&&je(F[F.length-1].id)},[je]);x.useEffect(()=>{let F=!1,Z=null;const Q=ae=>{if(ae.key==="Alt"){F=!0,Z&&clearTimeout(Z),Z=setTimeout(()=>{F=!1},1e3);return}if(ae.altKey&&(F=!1,Z&&(clearTimeout(Z),Z=null)),ae.key==="z"&&(ae.ctrlKey||ae.metaKey)&&!ae.shiftKey&&I.current.length>0){ae.preventDefault(),_e();return}if((ae.key==="="||ae.key==="+"||ae.key==="-")&&(ae.ctrlKey||ae.metaKey)){ae.preventDefault();const qe=ae.key==="-"?-5:5,{cardSettings:Xe}=q.getState();if(ae.shiftKey){const mt=Math.max(75,Math.min(150,Xe.cardZoom+qe));if(mt!==Xe.cardZoom){const tr={...Xe,cardZoom:mt};g(tr),ue.postMessage({type:"saveSettings",settings:tr})}}else{const mt=Math.max(75,Math.min(150,Xe.boardZoom+qe));if(mt!==Xe.boardZoom){const tr={...Xe,boardZoom:mt};g(tr),ue.postMessage({type:"saveSettings",settings:tr})}}return}if(!(ae.target instanceof HTMLInputElement||ae.target instanceof HTMLTextAreaElement||ae.target instanceof HTMLSelectElement||ae.target instanceof HTMLElement&&ae.target.isContentEditable))switch(ae.key){case"n":if(ae.ctrlKey||ae.metaKey||ae.altKey||ae.shiftKey)return;ae.preventDefault(),E("backlog"),j(!0);break;case"?":if(ae.ctrlKey||ae.metaKey||ae.altKey)return;ae.preventDefault(),W(qe=>!qe);break;case"Escape":P?W(!1):D?j(!1):q.getState().selectedCardIds.length>0&&R();break}},re=ae=>{ae.key==="Alt"&&F&&(F=!1,Z&&(clearTimeout(Z),Z=null),ue.postMessage({type:"focusMenuBar"}))},Ee=()=>{F=!1};return window.addEventListener("keydown",Q),window.addEventListener("keyup",re),window.addEventListener("mousedown",Ee),()=>{window.removeEventListener("keydown",Q),window.removeEventListener("keyup",re),window.removeEventListener("mousedown",Ee),Z&&clearTimeout(Z)}},[D,P,_e,g,R]),x.useEffect(()=>{const F=()=>{const Q=document.documentElement,re=document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast");p(re),Q.dataset.kbTheme=re?"dark":"light",re?Q.classList.add("dark"):Q.classList.remove("dark")};F();const Z=new MutationObserver(F);return Z.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>Z.disconnect()},[p]),x.useEffect(()=>{const F=document.documentElement;F.style.setProperty("--board-zoom",String(o.boardZoom/100)),F.style.setProperty("--card-zoom",String(o.cardZoom/100))},[o.boardZoom,o.cardZoom]),x.useEffect(()=>{const F=document.documentElement,Z=Ea(o.boardBackgroundMode,o.boardBackgroundPreset);F.dataset.kbBoardMode=Z.boardBackgroundMode,F.dataset.kbBoardPreset=Z.boardBackgroundPreset},[o.boardBackgroundMode,o.boardBackgroundPreset]),x.useEffect(()=>{const F=Z=>{const Q=Z.data;if(!(!Q||typeof Q.type!="string"))switch(Q.type){case"init":{const re=Q.cards??[];{const Ee=Q.columns??[],ae=Q.currentBoard??q.getState().currentBoard,qe=Ee.map(ps=>ps.id),Xe=q.getState().columnVisibilityByBoard,mt={...B.current,...Xe};if(Q.minimizedColumnIds!==void 0){const ps=mt[ae]??{hiddenColumnIds:[],minimizedColumnIds:[]};mt[ae]={...ps,minimizedColumnIds:Q.minimizedColumnIds},K.current={boardId:ae,columnIds:Q.minimizedColumnIds}}const tr=Hf(mt,ae,qe);q.setState({currentBoard:ae,columnVisibilityByBoard:tr})}me(null),c(re),X(re),d(Q.columns??[]),Q.boards&&f(Q.boards),Q.workspace&&h(Q.workspace),Q.settings&&(Q.settings.markdownEditorMode&&J&&H(null),g(Q.settings)),Q.labels&&b(Q.labels),N(!0);break}case"connectionStatus":me(fQ(Q));break;case"cardsUpdated":c(Q.cards),X(Q.cards);break;case"triggerCreateDialog":E("backlog"),j(!0);break;case"labelsUpdated":b(Q.labels);break;case"showSettings":g(Q.settings),y(!0);break;case"cardContent":{const{cardSettings:re}=q.getState();if(re.markdownEditorMode)break;M(Q.cardId),te.current+=1,H(Ee=>({id:Q.cardId,content:Q.content,frontmatter:Q.frontmatter,comments:Q.comments||[],logs:Q.logs!==void 0?Q.logs:(Ee==null?void 0:Ee.id)===Q.cardId?Ee.logs:[],contentVersion:te.current}));break}case"actionResult":break;case"boardActionResult":break;case"logsUpdated":{H(re=>re&&re.id===Q.cardId?{...re,logs:Q.logs}:re);break}case"boardLogsUpdated":{k(Q.logs);break}}};return window.addEventListener("message",F),ue.postMessage({type:"ready"}),()=>window.removeEventListener("message",F)},[J,c,d,f,h,g,y,b,X]),x.useEffect(()=>{var re;if(!C)return;const F=Hf(n,r,e.map(Ee=>Ee.id));if(F!==n){q.setState({columnVisibilityByBoard:F});return}B.current=F,ue.setState(F);const Z=((re=F[r])==null?void 0:re.minimizedColumnIds)??[],Q=K.current;(!Q||Q.boardId!==r||!pQ(Q.columnIds,Z))&&(ue.postMessage({type:"setMinimizedColumns",boardId:r,columnIds:Z}),K.current={boardId:r,columnIds:Z})},[n,e,r,C]);const Ie=(F,Z)=>{if(Z.metaKey||Z.ctrlKey){const re=[...q.getState().selectedCardIds];J&&!re.includes(J.id)&&re.push(J.id);const Ee=re.indexOf(F.id);Ee>=0?re.splice(Ee,1):re.push(F.id),q.setState({selectedCardIds:re,lastClickedCardId:F.id}),J&&H(null);return}if(Z.shiftKey){if(J&&!q.getState().lastClickedCardId){const Q=q.getState().selectedCardIds,re=Q.includes(J.id)?[...Q]:[...Q,J.id];q.setState({selectedCardIds:re,lastClickedCardId:J.id})}w(F.id),J&&H(null);return}R(),ue.postMessage({type:"openCard",cardId:F.id})},Ge=(F,Z)=>{J&&ue.postMessage({type:"saveCardContent",cardId:J.id,content:F,frontmatter:Z})},it=(F,Z)=>{J&&(ue.postMessage({type:"transferCard",cardId:J.id,toBoard:F,targetStatus:Z}),H(null),M(null))},wt=()=>{H(null),M(null),ue.postMessage({type:"closeCard"})},kt=()=>{J&&de(J.id)},xe=()=>{J&&(ue.postMessage({type:"permanentDeleteCard",cardId:J.id}),H(null),M(null))},$e=()=>{J&&(ue.postMessage({type:"restoreCard",cardId:J.id}),H(null),M(null))},We=()=>{ue.postMessage({type:"purgeDeletedCards"})},pt=()=>{J&&ue.postMessage({type:"openFile",cardId:J.id})},is=F=>{ue.postMessage({type:"openMetadataFile",path:F})},pn=()=>{J&&ue.postMessage({type:"downloadCard",cardId:J.id})},mn=(F,Z)=>{ue.postMessage({type:"startWithAI",agent:F,permissionMode:Z})},ls=()=>{J&&ue.postMessage({type:"addAttachment",cardId:J.id})},cs=F=>{J&&ue.postMessage({type:"openAttachment",cardId:J.id,attachment:F})},gn=F=>{J&&ue.postMessage({type:"removeAttachment",cardId:J.id,attachment:F})},us=(F,Z)=>{J&&ue.postMessage({type:"addComment",cardId:J.id,author:F,content:Z})},vn=(F,Z)=>{J&&ue.postMessage({type:"updateComment",cardId:J.id,commentId:F,content:Z})},ds=F=>{J&&ue.postMessage({type:"deleteComment",cardId:J.id,commentId:F})},jo=()=>{J&&ue.postMessage({type:"clearLogs",cardId:J.id})},Eo=()=>{A?Y(!1):(Y(!0),ue.postMessage({type:"getBoardLogs"}))},Ao=()=>{ue.postMessage({type:"clearBoardLogs"})},fs=F=>{ue.postMessage({type:"saveSettings",settings:F})},yn=x.useCallback(F=>{m(F)},[m]),No=x.useCallback(F=>{v();const Z={...q.getState().cardSettings,drawerWidth:F};g(Z),fs(Z)},[v,g]),hs=x.useCallback(()=>{v()},[v]),Po=()=>{O(null),L(!0)},Oi=F=>{const Z=e.find(Q=>Q.id===F);Z&&(O(Z),L(!0))},Ro=F=>{!e.find(re=>re.id===F)||q.getState().cards.filter(re=>re.status===F).length>0||ue.postMessage({type:"removeColumn",columnId:F})},To=F=>{!e.find(re=>re.id===F)||q.getState().cards.filter(re=>re.status===F).length===0||ue.postMessage({type:"cleanupColumn",columnId:F})},Io=x.useCallback(F=>{const Z=q.getState().columns;d(F.map(Q=>Z.find(re=>re.id===Q)).filter(Q=>Q!=null)),ue.postMessage({type:"reorderColumns",columnIds:F})},[d]),Mo=F=>{V?ue.postMessage({type:"editColumn",columnId:V.id,updates:F}):ue.postMessage({type:"addColumn",column:F}),L(!1),O(null)},T=F=>{E(F),j(!0)},ve=x.useCallback(F=>{const Z=Array.from(q.getState().selectedCardIds);for(const re of Z)ue.postMessage({type:"moveCard",cardId:re,newStatus:F,newOrder:-1});const{cards:Q}=q.getState();c(Q.map(re=>Z.includes(re.id)?{...re,status:F}:re)),R()},[c,R]),er=x.useCallback(F=>{const Z=Array.from(q.getState().selectedCardIds);for(const re of Z)ue.postMessage({type:"bulkUpdateCard",cardId:re,updates:{priority:F}});const{cards:Q}=q.getState();c(Q.map(re=>Z.includes(re.id)?{...re,priority:F}:re)),R()},[c,R]),Di=x.useCallback(F=>{const Z=Array.from(q.getState().selectedCardIds);for(const re of Z)ue.postMessage({type:"bulkUpdateCard",cardId:re,updates:{assignee:F}});const{cards:Q}=q.getState();c(Q.map(re=>Z.includes(re.id)?{...re,assignee:F}:re)),R()},[c,R]),Gx=x.useCallback((F,Z)=>{const Q=Array.from(q.getState().selectedCardIds),{cards:re}=q.getState();for(const Ee of Q){const ae=re.find(Xe=>Xe.id===Ee);if(!ae)continue;const qe=Array.from(new Set([...ae.labels,...F])).filter(Xe=>!Z.includes(Xe));ue.postMessage({type:"bulkUpdateCard",cardId:Ee,updates:{labels:qe}})}c(re.map(Ee=>{if(!Q.includes(Ee.id))return Ee;const ae=Array.from(new Set([...Ee.labels,...F])).filter(qe=>!Z.includes(qe));return{...Ee,labels:ae}})),R()},[c,R]),qx=x.useCallback(()=>{const F=Array.from(q.getState().selectedCardIds);for(const Z of F)de(Z);R()},[de,R]),Yx=x.useCallback((F,Z)=>{for(const re of F)ue.postMessage({type:"moveCard",cardId:re,newStatus:Z,newOrder:-1});const{cards:Q}=q.getState();c(Q.map(re=>F.includes(re.id)?{...re,status:Z}:re)),R()},[c,R]),uf=F=>{ue.postMessage({type:"createCard",data:F})},Jx=x.useCallback(F=>{if(!J)return;const Z=`action-${Date.now()}`;ue.postMessage({type:"triggerAction",cardId:J.id,action:F,callbackKey:Z})},[J]),Zx=x.useCallback((F,Z)=>{const Q=`action-${Date.now()}`;ue.postMessage({type:"triggerAction",cardId:F,action:Z,callbackKey:Q})},[]),Qx=x.useCallback((F,Z)=>{const Q=`board-action-${Date.now()}`;ue.postMessage({type:"triggerBoardAction",boardId:F,actionKey:Z,callbackKey:Q})},[]),Xx=(F,Z,Q)=>{const{cards:re}=q.getState();if(re.find(ae=>ae.id===F)){const ae=re.filter(rr=>rr.status===Z&&rr.id!==F).sort((rr,ff)=>rr.order<ff.order?-1:rr.order>ff.order?1:0),qe=Math.max(0,Math.min(Q,ae.length)),Xe=qe>0?ae[qe-1].order:null,mt=qe<ae.length?ae[qe].order:null,tr=Yk(Xe,mt),ps=re.map(rr=>rr.id===F?{...rr,status:Z,order:tr}:rr);c(ps)}ue.postMessage({type:"moveCard",cardId:F,newStatus:Z,newOrder:Q})},e1=x.useCallback(F=>{uf({...F,assignee:null,dueDate:null,labels:[],actions:[]})},[]);return e.length===0?l.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--vscode-editor-background)]",children:l.jsx("div",{className:"text-[var(--vscode-foreground)] opacity-60",children:"Loading..."})}):l.jsxs("div",{className:"h-full w-full flex flex-col bg-[var(--vscode-editor-background)]",children:[l.jsx(GZ,{onOpenSettings:()=>ue.postMessage({type:"openSettings"}),onAddColumn:Po,onCreateCard:()=>{E(o.defaultStatus||"backlog"),j(!0)},onToggleTheme:()=>ue.postMessage({type:"toggleTheme"}),onSwitchBoard:F=>ue.postMessage({type:"switchBoard",boardId:F}),onCreateBoard:F=>ue.postMessage({type:"createBoard",name:F}),onOpenBoardLogs:Eo,boardLogsOpen:A,onTriggerBoardAction:Qx,onOpenShortcutHelp:()=>W(F=>!F)}),l.jsxs("div",{className:"kb-board-stage flex-1 flex overflow-hidden",children:[l.jsx("div",{className:"board-zoom-scope w-full min-w-0",style:(o.panelMode??"drawer")==="drawer"&&u.length===0&&(J!==null||A)?{width:`${100-a}%`}:void 0,children:l.jsx(i$,{onCardClick:Ie,onAddCard:T,onMoveCard:Xx,onMoveCards:Yx,onEditColumn:Oi,onRemoveColumn:Ro,onCleanupColumn:To,onReorderColumns:Io,onPurgeDeletedCards:We,selectedCardId:J==null?void 0:J.id,selectedCardIds:u,onSelectAll:$,onQuickAdd:e1,onTriggerAction:Zx})}),A&&u.length===0&&!J&&(()=>{const F=(o.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-40 flex ${F?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!F&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>Y(!1)}),l.jsxs("div",{className:F?"relative h-full flex flex-col shadow-xl animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] flex flex-col rounded-xl shadow-xl animate-in zoom-in-95 fade-in duration-200",style:F?{width:`${a}%`,background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"}:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},...F?{"data-panel-drawer":""}:{},children:[l.jsx(Xa,{panelMode:F?"drawer":"popup",onPreview:yn,onCommit:No,onCancel:hs}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-2",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("span",{className:"text-sm font-medium",style:{color:"var(--vscode-foreground)"},children:"Board Logs"}),l.jsx("button",{onClick:()=>Y(!1),className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:Z=>Z.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:Z=>Z.currentTarget.style.background="transparent",title:"Close board logs",children:"✕"})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:l.jsx(D0,{logs:z,onClearLogs:Ao})})]})]})})(),J&&u.length===0&&(()=>{const F=(o.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-40 flex ${F?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!F&&l.jsx("div",{className:"absolute inset-0 card-view-modal-backdrop",onClick:wt}),l.jsxs("div",{className:F?"relative h-full flex flex-col shadow-xl overflow-hidden animate-in slide-in-from-right duration-200 pointer-events-auto card-view-shell card-view-shell--drawer":"relative w-full max-w-none h-[90vh] flex flex-col rounded-xl shadow-xl overflow-hidden animate-in zoom-in-95 fade-in duration-200 card-view-shell card-view-shell--popup",style:{fontSize:"calc(1em * var(--card-zoom, 1))",...F?{width:`${a}%`}:{}},...F?{"data-panel-drawer":""}:{},children:[l.jsx(Xa,{panelMode:F?"drawer":"popup",onPreview:yn,onCommit:No,onCancel:hs}),l.jsx(VZ,{cardId:J.id,content:J.content,frontmatter:J.frontmatter,comments:J.comments,contentVersion:J.contentVersion,onSave:Ge,onClose:wt,onDelete:kt,onPermanentDelete:xe,onRestore:$e,onOpenFile:pt,onOpenMetadataFile:is,onDownloadCard:pn,onStartWithAI:mn,onAddAttachment:ls,onOpenAttachment:cs,onRemoveAttachment:gn,onAddComment:us,onUpdateComment:vn,onDeleteComment:ds,onTransferToBoard:it,onTriggerAction:Jx,logs:J.logs,onClearLogs:jo,logsFilter:o.logsFilter,onLogsFilterChange:Z=>{const Q={...o,logsFilter:Z};g(Q),ue.postMessage({type:"saveSettings",settings:Q})}})]})]})})()]}),u.length>1&&l.jsx(iQ,{selectedCount:u.length,onClearSelection:R,onMoveToColumn:ve,onSetPriority:er,onSetAssignee:Di,onApplyLabels:Gx,onDelete:qx}),l.jsx(SZ,{isOpen:D,onClose:()=>j(!1),onCreate:uf,initialStatus:S,onSaveSettings:fs}),l.jsx(QZ,{isOpen:i,settings:o,workspace:s,onClose:()=>y(!1),onSave:fs,onSetLabel:(F,Z)=>ue.postMessage({type:"setLabel",name:F,definition:Z}),onRenameLabel:(F,Z)=>ue.postMessage({type:"renameLabel",oldName:F,newName:Z}),onDeleteLabel:F=>ue.postMessage({type:"deleteLabel",name:F})}),l.jsx(nQ,{isOpen:G,onClose:()=>{L(!1),O(null)},onSave:Mo,initial:V?{name:V.name,color:V.color}:void 0,title:V?"Edit List":"Add List"}),le&&l.jsx(Um,{title:le.title,message:le.message,persistent:!0,tone:le.tone,index:0}),ee.map((F,Z)=>l.jsx(Um,{message:`Deleted "${Zg(F.card.content,F.card.metadata,oe)}"`,onUndo:()=>je(F.id),onExpire:()=>ge(F.id),duration:5e3,index:le?Z+1:Z},F.id)),l.jsx(uQ,{isOpen:P,onClose:()=>W(!1)})]})}function vQ(e){return e!=="http:"&&e!=="https:"}function Ur(e){if(typeof e=="string")return e;if(typeof e=="boolean")return String(e)}function yQ(e){var r;const t=(r=Ur(e))==null?void 0:r.trim().replace(/^"(.*)"$/,"$1").toLowerCase();if(t==="true")return!0;if(t==="false")return!1}function lf(e){return{priority:Ur(e.priority),labels:Ur(e.labels),assignee:Ur(e.assignee),dueDate:Ur(e.dueDate),q:Ur(e.q),fuzzy:Ur(e.fuzzy)}}function Km(e){return JSON.stringify({...e.priority&&{priority:e.priority},...e.labels&&{labels:e.labels},...e.assignee&&{assignee:e.assignee},...e.dueDate&&{dueDate:e.dueDate},...e.q&&{q:e.q},...e.fuzzy&&{fuzzy:e.fuzzy}})}const Hm=af(),bQ=["critical","high","medium","low"],xQ=["overdue","today","this-week","no-date"];function wQ(){const e=ci(),t=ii({strict:!1}),r=li({strict:!1}),{setPriorityFilter:n,setAssigneeFilter:s,setLabelFilter:o,setDueDateFilter:a,setSearchQuery:i,setFuzzySearch:u,setActiveCardTab:c}=q.getState(),d=q(S=>S.columns),f=q(S=>S.currentBoard),p=q(S=>S.activeCardId),h=q(S=>S.activeCardTab),g=q(S=>S.priorityFilter),m=q(S=>S.assigneeFilter),v=q(S=>S.labelFilter),y=q(S=>S.dueDateFilter),b=q(S=>S.searchQuery),_=q(S=>S.fuzzySearch),w=q.getState(),$=x.useRef({board:t.boardId??w.currentBoard,cardId:"",tab:Sn(t.tabId??w.activeCardTab),searchStr:Km(r)}),R=x.useRef(!1),M=x.useRef(t.cardId??null);x.useEffect(()=>{if(R.current)return;R.current=!0,r.priority&&bQ.includes(r.priority)&&n(r.priority),r.labels&&o(r.labels.split(",").filter(Boolean)),r.assignee&&s(r.assignee),r.dueDate&&xQ.includes(r.dueDate)&&a(r.dueDate),r.q&&i(decodeURIComponent(r.q));const S=yQ(r.fuzzy);S!==void 0&&u(S),t.tabId&&t0(t.tabId)&&c(t.tabId),t.boardId&&Hm.postMessage({type:"switchBoard",boardId:t.boardId})},[]);const D=x.useRef(!1);x.useEffect(()=>{D.current||d.length===0||(D.current=!0,M.current&&(Hm.postMessage({type:"openCard",cardId:M.current}),M.current=null))},[d]);const j=x.useRef(!0);return x.useEffect(()=>{if(d.length===0)return;const S={};g!=="all"&&(S.priority=g),v.length>0&&(S.labels=v.join(",")),m!=="all"&&(S.assignee=m),y!=="all"&&(S.dueDate=y),b&&(S.q=b),_&&(S.fuzzy="true");const E=Km(S),P=$.current,W=P.board!==f,G=P.cardId!==(p??""),L=!!p&&P.tab!==h,V=P.searchStr!==E;if(!W&&!G&&!L&&!V)return;$.current={board:f,cardId:p??"",tab:h,searchStr:E};const O=j.current||!W&&!G&&!L&&V;j.current=!1,e(p?{to:"/$boardId/$cardId/$tabId",params:{boardId:f,cardId:p,tabId:h},search:S,replace:O}:{to:"/$boardId",params:{boardId:f},search:S,replace:O})},[d.length,f,p,h,g,m,v,y,b,_,e]),null}function kQ(){return l.jsxs(l.Fragment,{children:[l.jsx(gQ,{}),l.jsx(wQ,{}),l.jsx(ui,{})]})}const cf=Mk({component:kQ,notFoundComponent:()=>null}),_Q=oo({getParentRoute:()=>cf,path:"/",component:()=>null}),Kx=oo({getParentRoute:()=>cf,path:"$boardId",validateSearch:lf,component:()=>l.jsx(ui,{})}),Hx=oo({getParentRoute:()=>Kx,path:"$cardId",validateSearch:lf,component:()=>l.jsx(ui,{})}),CQ=oo({getParentRoute:()=>Hx,path:"$tabId",validateSearch:lf,component:()=>null}),$Q=cf.addChildren([_Q,Kx.addChildren([Hx.addChildren([CQ])])]),SQ=Vk({routeTree:$Q,history:vQ(window.location.protocol)?Z1({initialEntries:["/"]}):void 0,defaultPreload:"intent"});cg(document.getElementById("root")).render(l.jsx(x.StrictMode,{children:l.jsx(Hk,{router:SQ})}));
132
+ ${V}`:""}`:V;r({status:g,priority:v,content:re,assignee:b.trim()||null,dueDate:w||null,labels:R,actions:D})},G=()=>{W(),t()},L=()=>{t()};return x.useEffect(()=>{const V=O=>{O.key==="Escape"&&L(),(O.metaKey||O.ctrlKey)&&O.key==="Enter"&&G(),(O.metaKey||O.ctrlKey)&&O.key==="s"&&(O.preventDefault(),G())};if(e)return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)}),l.jsxs("div",{className:`fixed inset-0 z-50 flex ${(o.panelMode??"drawer")==="drawer"?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[(o.panelMode??"drawer")!=="drawer"&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:L}),l.jsxs("div",{className:(o.panelMode??"drawer")==="drawer"?"relative h-full shadow-xl flex flex-col animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] shadow-xl flex flex-col rounded-xl animate-in zoom-in-95 fade-in duration-200",style:{background:"var(--vscode-editor-background)",...(o.panelMode??"drawer")==="drawer"?{width:`${a}%`,borderLeft:"1px solid var(--vscode-panel-border)"}:{border:"1px solid var(--vscode-panel-border)"}},...(o.panelMode??"drawer")==="drawer"?{"data-panel-drawer":""}:{},children:[l.jsx(Xa,{panelMode:(o.panelMode??"drawer")==="drawer"?"drawer":"popup",onPreview:i,onCommit:V=>{u();const O={...q.getState().cardSettings,drawerWidth:V};c(O),n(O)},onCancel:u}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Create Card"})}),l.jsx("button",{onClick:L,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="transparent",children:l.jsx(st,{size:18})})]}),l.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx(Cn,{label:"Status",icon:l.jsx(rg,{size:13}),children:l.jsx(Om,{value:g,options:f,onChange:V=>m(V)})}),o.showPriorityBadges&&l.jsx(Cn,{label:"Priority",icon:l.jsx(Fc,{size:13}),children:l.jsx(Om,{value:v,options:kZ.map(V=>({value:V.value,label:V.label,dot:V.dot})),onChange:V=>y(V)})}),o.showAssignee&&l.jsx(Cn,{label:"Assignee",icon:l.jsx(va,{size:13}),children:l.jsx(_Z,{value:b,onChange:_})}),o.showDueDate&&l.jsx(Cn,{label:"Due date",icon:l.jsx(Dc,{size:13}),children:l.jsx(u$,{value:w,onChange:$})}),o.showLabels&&l.jsx(Cn,{label:"Labels",icon:l.jsx(ei,{size:13}),children:l.jsx(CZ,{labels:R,onChange:M})}),l.jsx(Cn,{label:"Actions",icon:l.jsx(ga,{size:13}),children:l.jsx($Z,{actions:D,onChange:j})})]}),l.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[l.jsx("textarea",{ref:P,value:p,onChange:V=>h(V.target.value),placeholder:"Card title...",className:"w-full text-lg font-medium bg-transparent border-none outline-none resize-none mb-4",style:{color:"var(--vscode-foreground)"},rows:1,onInput:V=>{const O=V.target;O.style.height="auto",O.style.height=O.scrollHeight+"px"},onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&V.preventDefault()}}),l.jsx(Fx,{value:S,onChange:E,placeholder:"Add a description..."})]}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderTop:"1px solid var(--vscode-panel-border)",background:"var(--vscode-sideBar-background, var(--vscode-editor-background))"},children:[l.jsxs("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"Esc"})," ","cancel ·"," ",l.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"⌘S"})," ","save"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:L,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)",background:"transparent",border:"1px solid var(--vscode-panel-border)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="transparent",children:"Cancel"}),l.jsx("button",{type:"button",onClick:G,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-button-foreground)",background:"var(--vscode-button-background)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="var(--vscode-button-background)",children:"Save"})]})]})]})]})}function Dm({value:e}){const[t,r]=x.useState(!1),n=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1 cursor-pointer",onClick:n,title:"Click to copy",children:[l.jsx("span",{className:"text-zinc-700 dark:text-zinc-300",children:e}),l.jsx("span",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity",children:t?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}const EZ={critical:"Critical",high:"High",medium:"Medium",low:"Low"},AZ=["critical","high","medium","low"],NZ={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"},PZ=[{agent:"claude",label:"Claude",color:"hover:bg-amber-100 dark:hover:bg-amber-900/30",activeColor:"bg-amber-700 text-white"},{agent:"codex",label:"Codex",color:"hover:bg-emerald-100 dark:hover:bg-emerald-900/30",activeColor:"bg-emerald-500 text-white"},{agent:"opencode",label:"OpenCode",color:"hover:bg-slate-100 dark:hover:bg-slate-700/30",activeColor:"bg-slate-500 text-white"}],RZ={claude:{bg:"bg-amber-700",hover:"hover:bg-amber-800",shadow:"shadow-sm",border:"border border-amber-800/50"},codex:{bg:"bg-emerald-600",hover:"hover:bg-emerald-700",shadow:"shadow-sm",border:"border border-emerald-700/50"},opencode:{bg:"bg-slate-600",hover:"hover:bg-slate-700",shadow:"shadow-sm",border:"border border-slate-700/50"}},TZ={claude:[{permissionMode:"default",label:"Default",description:"With confirmations"},{permissionMode:"plan",label:"Plan",description:"Creates a plan first"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts file edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Bypasses all prompts"}],codex:[{permissionMode:"default",label:"Suggest",description:"Suggests changes"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Full automation"}],opencode:[{permissionMode:"default",label:"Default",description:"Standard mode"}]};function IZ({value:e,options:t,onChange:r,className:n}){const[s,o]=x.useState(!1),a=t.find(i=>i.value===e);return l.jsxs("div",{className:Ae("relative",s&&"z-30",n),children:[l.jsxs("button",{onClick:()=>o(!s),className:"card-select-trigger",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",a.dot)}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>o(!1)}),l.jsx("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 min-w-[172px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(i=>l.jsxs("button",{onClick:()=>{r(i.value),o(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:u=>{i.value!==e&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{i.value!==e&&(u.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",i.dot)}),l.jsx("span",{className:"flex-1 text-left",children:i.label}),i.value===e&&l.jsx(jt,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},i.value))})]})]})}function MZ({value:e,onChange:t,onTransferToBoard:r}){const[n,s]=x.useState(!1),o=q(c=>c.columns),a=q(c=>c.boards),i=q(c=>c.currentBoard),u=a.filter(c=>c.id!==i);return l.jsxs("div",{className:Ae("relative",n&&"z-30"),children:[l.jsxs("button",{onClick:()=>s(!n),className:"card-select-trigger",style:{color:"var(--vscode-foreground)"},children:[(()=>{const c=o.find(d=>d.id===e);return c?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:c.color}}),l.jsx("span",{children:c.name})]}):l.jsx("span",{children:e})})(),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>s(!1)}),l.jsxs("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 min-w-[204px] max-h-[320px] overflow-y-auto",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[o.map(c=>l.jsxs("button",{onClick:()=>{t(c.id),s(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:c.id===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:d=>{c.id!==e&&(d.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:d=>{c.id!==e&&(d.currentTarget.style.background="transparent")},children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:c.color}}),l.jsx("span",{className:"flex-1 text-left",children:c.name}),c.id===e&&l.jsx(jt,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},c.id)),u.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mx-2 my-1",style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:"Move to..."}),u.map(c=>l.jsxs("div",{children:[l.jsx("div",{className:"px-4 py-1 text-[10px] font-semibold",style:{color:"var(--vscode-descriptionForeground)"},children:c.name}),(c.columns||[]).map(d=>l.jsxs("button",{onClick:()=>{r(c.id,d.id),s(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 pl-5 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:f=>{f.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:f=>{f.currentTarget.style.background="transparent"},children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d.color}}),l.jsx("span",{className:"flex-1 text-left",children:d.name})]},`${c.id}-${d.id}`))]},c.id))]})]})]})]})}function kr({label:e,icon:t,children:r}){return l.jsxs("div",{className:"card-property-row",children:[l.jsxs("div",{className:"card-property-label-group",children:[l.jsx("span",{className:"card-property-icon",style:{color:"var(--vscode-descriptionForeground)"},children:t}),l.jsx("span",{className:"card-property-label",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),l.jsx("div",{className:"card-property-value",children:r})]})}function Bx(e){return Array.isArray(e)?e.map(t=>String(t)).join(","):String(e)}function Oc({path:e,value:t}){const r=q(n=>n.applyMetadataFilterToken);return l.jsx("button",{type:"button",onClick:n=>{n.preventDefault(),n.stopPropagation(),r(e,t)},className:"shrink-0 rounded p-0.5 opacity-60 transition-opacity hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-1 focus:ring-blue-500",style:{color:"var(--vscode-descriptionForeground)"},title:`Filter cards by ${e}`,"aria-label":`Filter cards by metadata ${e} = ${t}`,children:l.jsx(y1,{size:11})})}function zZ({onSelect:e}){const[t,r]=x.useState(!1),[n,s]=x.useState("claude"),o=TZ[n],a=RZ[n];return l.jsxs("div",{className:Ae("relative",t&&"z-30"),children:[l.jsxs("button",{onClick:()=>r(!t),className:Ae("card-inline-action card-inline-action--solid",a.bg,a.hover,a.shadow,a.border),children:[l.jsx(v1,{size:13}),l.jsx("span",{children:"Build with AI"}),l.jsx("kbd",{className:"ml-0.5 text-[9px] opacity-60 font-mono",children:"⌘B"}),l.jsx(Ze,{size:11,className:Ae("ml-0.5 opacity-60 transition-transform",t&&"rotate-180")})]}),t&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>r(!1)}),l.jsxs("div",{className:"card-floating-menu absolute top-full right-0 mt-1 min-w-[240px] overflow-hidden bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700",children:[l.jsx("div",{className:"flex",children:PZ.map(i=>l.jsx("button",{onClick:()=>s(i.agent),className:Ae("flex-1 px-3 py-2 text-[11px] font-medium transition-all",n===i.agent?i.activeColor:Ae("text-zinc-600 dark:text-zinc-400",i.color)),children:i.label},i.agent))}),l.jsx("div",{className:"p-1 space-y-1",children:o.map(i=>l.jsxs("button",{onClick:()=>{e(n,i.permissionMode),r(!1)},className:"w-full text-left px-2.5 py-1.5 rounded-[8px] hover:bg-zinc-100 dark:hover:bg-zinc-700/50 transition-colors",children:[l.jsx("div",{className:"text-[11px] font-medium text-zinc-900 dark:text-zinc-100",children:i.label}),l.jsx("div",{className:"text-[10px] text-zinc-500 dark:text-zinc-400 mt-0.5",children:i.description})]},i.permissionMode))})]})]})]})}function OZ({actions:e,onTriggerAction:t}){const[r,n]=x.useState(!1),s=Array.isArray(e)?e.map(o=>({key:o,label:o})):Object.entries(e).map(([o,a])=>({key:o,label:a}));return l.jsxs("div",{className:Ae("relative",r&&"z-30"),children:[l.jsxs("button",{onClick:()=>n(!r),className:"card-inline-action",style:{color:"var(--vscode-foreground)",border:"1px solid var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},children:[l.jsx("span",{children:"Run Action"}),l.jsx(Ze,{size:11,className:Ae("opacity-60 transition-transform",r&&"rotate-180")})]}),r&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button","aria-label":"Close actions menu",className:"card-floating-dismiss",onClick:()=>n(!1)}),l.jsx("div",{className:"card-floating-menu absolute top-full right-0 mt-1",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:s.map(({key:o,label:a})=>l.jsx("button",{type:"button",onClick:()=>{n(!1),t(o)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors whitespace-nowrap",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:i=>{i.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:i=>{i.currentTarget.style.background="transparent"},children:a},o))})]})]})}function Ux({size:e=16}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 19.88V4.12a1.5 1.5 0 0 0-.85-1.533zm-5.146 14.861L10.826 12l7.178-5.448v10.896z"})})}function _r({title:e,icon:t,onClick:r,variant:n="default",label:s}){return l.jsxs("button",{type:"button",onClick:r,className:Ae("card-action-button",n!=="default"&&`card-action-button--${n}`),title:e,"aria-label":e,children:[l.jsx("span",{className:"card-action-button__icon",children:t}),s&&l.jsx("span",{className:"card-action-button__label",children:s})]})}function Vx(e){return/^https?:\/\//i.test(e)}function DZ(e){return/^(\/|~\/|\.{1,2}\/|[A-Za-z]:[/\\])/i.test(e)}function LZ({value:e}){const[t,r]=x.useState(!1),n=s=>{s.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1",children:[l.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300 hover:underline",title:e,onClick:s=>s.stopPropagation(),children:[l.jsx(ng,{size:10,className:"shrink-0"}),l.jsx("span",{className:"break-all",children:e})]}),l.jsx("button",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity cursor-pointer",onClick:n,title:"Copy URL",children:t?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function FZ({value:e,onOpenFile:t}){const[r,n]=x.useState(!1),s=o=>{o.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1",children:[t&&l.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100 transition-opacity cursor-pointer",onClick:o=>{o.stopPropagation(),t(e)},title:"Open in VS Code",children:l.jsx(Ux,{size:11})}),l.jsx("span",{className:"text-zinc-700 dark:text-zinc-300 break-all",children:e}),l.jsx("button",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity cursor-pointer",onClick:s,title:"Copy path",children:r?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function BZ({metadata:e,onOpenMetadataFile:t}){if(!e||Object.keys(e).length===0)return null;const r=Object.keys(e);return l.jsxs("div",{className:"card-metadata-section",children:[l.jsxs("div",{className:"card-metadata-section__header",children:[l.jsx("span",{children:"Metadata"}),l.jsx("span",{className:"card-metadata-section__count",children:r.length})]}),l.jsx("div",{className:"card-metadata-tree-shell",children:l.jsx(Wx,{data:e,depth:0,onOpenMetadataFile:t})})]})}function Wx({data:e,depth:t,pathPrefix:r="",onOpenMetadataFile:n}){return l.jsx("div",{style:{paddingLeft:t>0?12:0},children:Object.entries(e).map(([s,o])=>{const a=r?`${r}.${s}`:s,i=Bx(o);return l.jsx("div",{className:"py-0.5",children:o&&typeof o=="object"&&!Array.isArray(o)?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,":"]}),l.jsx(Wx,{data:o,depth:t+1,pathPrefix:a,onOpenMetadataFile:n})]}):Array.isArray(o)?l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),l.jsx(Dm,{value:`[${o.join(", ")}]`}),l.jsx(Oc,{path:a,value:i})]}):l.jsxs("div",{className:"flex items-baseline gap-1 flex-wrap",children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),Vx(String(o))?l.jsx(LZ,{value:String(o)}):DZ(String(o))?l.jsx(FZ,{value:String(o),onOpenFile:n}):l.jsx(Dm,{value:String(o)}),l.jsx(Oc,{path:a,value:i})]})},s)})})}function UZ({labels:e,onChange:t}){const[r,n]=x.useState(""),[s,o]=x.useState(!1),a=x.useRef(null),i=q(m=>m.cards),u=q(m=>m.labelDefs),c=q(m=>m.applyLabelFilter),d=x.useMemo(()=>{const m=new Set;return i.forEach(v=>v.labels.forEach(y=>m.add(y))),Array.from(m).sort()},[i]),f=x.useMemo(()=>{const m=d.filter(v=>!e.includes(v));return r.trim()?m.filter(v=>v.toLowerCase().includes(r.toLowerCase())):m},[r,d,e]),p=s&&f.length>0,h=m=>{const v=(m||r).trim();v&&!e.includes(v)&&t([...e,v]),n("")},g=m=>{t(e.filter(v=>v!==m))};return l.jsxs("div",{className:Ae("relative flex items-center gap-2 flex-wrap",p&&"z-30"),children:[e.map(m=>{const v=u[m];return l.jsxs("span",{className:"card-label-pill",style:v?{backgroundColor:`${v.color}20`,color:v.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[l.jsx("button",{type:"button",onClick:()=>c(m),className:"hover:underline",title:`Filter cards by label ${m}`,"aria-label":`Filter cards by label ${m}`,children:m}),l.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),g(m)},className:"hover:text-red-500 transition-colors","aria-label":`Remove label ${m}`,children:l.jsx(st,{size:9})})]},m)}),l.jsxs("button",{onClick:()=>{o(!0),setTimeout(()=>{var m;return(m=a.current)==null?void 0:m.focus()},0)},className:"card-label-add",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(Zr,{size:10}),l.jsx("span",{children:"Add label"})]}),l.jsx("input",{ref:a,type:"text",value:r,onChange:m=>n(m.target.value),onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),150),onKeyDown:m=>{var v;m.key==="Enter"&&(m.preventDefault(),h()),m.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),m.key==="Escape"&&(n(""),(v=a.current)==null||v.blur())},placeholder:e.length===0?"Add labels...":"",className:"card-label-input",style:{color:"var(--vscode-foreground)",display:s||r?"block":"none"}}),p&&l.jsx("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 max-h-[200px] overflow-auto min-w-[220px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:f.map(m=>{const v=u[m];return l.jsx("button",{type:"button",onMouseDown:y=>{y.preventDefault(),h(m)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:l.jsx("span",{className:"card-label-pill",style:v?{backgroundColor:`${v.color}20`,color:v.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:m})},m)})})]})}function VZ({cardId:e,content:t,frontmatter:r,comments:n,contentVersion:s,onSave:o,onClose:a,onDelete:i,onPermanentDelete:u,onRestore:c,onOpenFile:d,onOpenMetadataFile:f,onDownloadCard:p,onStartWithAI:h,onAddAttachment:g,onOpenAttachment:m,onRemoveAttachment:v,onAddComment:y,onUpdateComment:b,onDeleteComment:_,onTransferToBoard:w,onTriggerAction:$,logs:R,onClearLogs:M,logsFilter:D,onLogsFilterChange:j}){var ae,ce;const{cardSettings:S,boards:E,currentBoard:P}=q(),W=((ae=E.find(ee=>ee.id===P))==null?void 0:ae.metadata)??[],G=(ce=E.find(ee=>ee.id===P))==null?void 0:ce.title,[L,V]=x.useState(r),[O,re]=x.useState(t),[J,K]=x.useState(!1),[A,Y]=x.useState(!1),z=L.status===Gn,k=Zg(O,L.metadata,G),C=L.metadata??{},N=x.useMemo(()=>W.map(ee=>({key:ee,value:C[ee]})).filter(({value:ee})=>ee!=null&&String(ee).trim()!==""),[C,W]),B=x.useRef(null),H=x.useRef(L),te=x.useRef(O);H.current=L,te.current=O;const se=x.useCallback(()=>{o(te.current,H.current)},[o]);x.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]),x.useEffect(()=>{re(t)},[e,s]),x.useEffect(()=>{V(r)},[r]);const le=x.useCallback(ee=>{re(ee),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{o(ee,H.current)},800)},[o]),me=x.useCallback(ee=>{V(de=>{const ge={...de,...ee};return B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{o(te.current,ge)},800),ge})},[o]),I=x.useCallback(ee=>{V(de=>({...de,formData:ee.card.formData,modified:ee.card.modified}))},[]);return x.useEffect(()=>{const ee=de=>{(de.metaKey||de.ctrlKey)&&de.key==="s"&&(de.preventDefault(),B.current&&clearTimeout(B.current),se()),(de.metaKey||de.ctrlKey)&&de.key==="b"&&S.showBuildWithAI&&(de.preventDefault(),h("claude","default")),de.key==="Escape"&&(B.current&&(clearTimeout(B.current),se()),a())};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[se,a,h,S.showBuildWithAI]),l.jsx("div",{className:"card-editor-shell h-full flex flex-col",children:l.jsx("div",{className:"card-editor-content flex-1 min-h-0 overflow-auto",children:l.jsxs("div",{className:"card-editor-stack",children:[l.jsxs("header",{className:"card-editor-hero",children:[l.jsxs("div",{className:"card-editor-hero-copy",children:[l.jsxs("div",{className:"card-editor-hero-meta",children:[l.jsx("span",{className:"card-editor-card-id",children:e}),l.jsx("span",{className:"card-editor-hero-separator","aria-hidden":"true"}),l.jsx("span",{title:Bs(L.modified),children:oa(L.modified)})]}),l.jsx("h1",{className:"card-editor-title",children:k})]}),l.jsxs("div",{className:"card-editor-hero-actions",children:[L.actions&&(Array.isArray(L.actions)?L.actions.length>0:Object.keys(L.actions).length>0)&&$&&l.jsx(OZ,{actions:L.actions,onTriggerAction:$}),S.showBuildWithAI&&l.jsx(zZ,{onSelect:h}),z?J?l.jsxs("div",{className:"card-delete-confirmation",children:[l.jsx("span",{className:"card-delete-confirmation__text",children:"Delete this card from disk?"}),l.jsx(_r,{title:"Confirm permanent delete",icon:l.jsx(Kt,{size:15}),label:"Delete",onClick:()=>{K(!1),u()},variant:"danger"}),l.jsx(_r,{title:"Cancel permanent delete",icon:l.jsx(hf,{size:15}),label:"Keep",onClick:()=>K(!1)})]}):l.jsxs(l.Fragment,{children:[l.jsx(_r,{title:"Restore card",icon:l.jsx(hf,{size:15}),label:"Restore",onClick:c,variant:"primary"}),l.jsx(_r,{title:"Permanently delete from disk",icon:l.jsx(Kt,{size:15}),label:"Delete forever",onClick:()=>K(!0),variant:"danger"})]}):l.jsxs(l.Fragment,{children:[l.jsx(_r,{title:"Open in VS Code",icon:l.jsx(Ux,{size:15}),onClick:d}),l.jsx(_r,{title:"Download card as Markdown",icon:l.jsx(m1,{size:15}),onClick:p}),l.jsx(_r,{title:"Move to deleted",icon:l.jsx(Kt,{size:15}),onClick:i,variant:"danger"})]}),l.jsx(_r,{title:"Close card",icon:l.jsx(st,{size:16}),onClick:a})]})]}),l.jsxs("div",{className:Ae("card-editor-desktop-columns",S.compactMode&&"is-compact"),children:[l.jsxs("div",{className:"card-editor-top-row",children:[l.jsxs("section",{className:"card-surface card-surface--details",children:[l.jsx("div",{className:"card-surface-header",children:l.jsxs("div",{children:[l.jsx("span",{className:"card-surface-kicker",children:"Overview"}),l.jsx("h2",{className:"card-surface-title",children:"Details"})]})}),l.jsxs("div",{className:"card-property-list",children:[l.jsx(kr,{label:"Status",icon:l.jsx(rg,{size:13}),children:l.jsx(MZ,{value:L.status,onChange:ee=>me({status:ee}),onTransferToBoard:w})}),S.showPriorityBadges&&l.jsx(kr,{label:"Priority",icon:l.jsx(Fc,{size:13}),children:l.jsx(IZ,{value:L.priority,options:AZ.map(ee=>({value:ee,label:EZ[ee],dot:NZ[ee]})),onChange:ee=>me({priority:ee})})}),S.showAssignee&&l.jsx(kr,{label:"Assignee",icon:l.jsx(va,{size:13}),children:l.jsxs("div",{className:"card-property-chip card-property-chip--input",children:[l.jsx("span",{className:"card-property-avatar",style:{background:L.assignee?"var(--vscode-badge-background)":"rgba(148, 163, 184, 0.18)",color:L.assignee?"var(--vscode-badge-foreground)":"var(--vscode-descriptionForeground)"},children:L.assignee?L.assignee.split(/\s+/).filter(Boolean).map(ee=>ee[0]).join("").toUpperCase().slice(0,2):l.jsx(va,{size:12})}),l.jsx("input",{type:"text",value:L.assignee||"",onChange:ee=>me({assignee:ee.target.value||null}),placeholder:"No assignee",className:"card-property-text-input",style:{color:L.assignee?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]})}),S.showDueDate&&l.jsx(kr,{label:"Due date",icon:l.jsx(Dc,{size:13}),children:l.jsx("input",{type:"date",value:L.dueDate||"",onChange:ee=>me({dueDate:ee.target.value||null}),className:"card-date-input",style:{color:L.dueDate?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})}),S.showLabels&&l.jsx(kr,{label:"Labels",icon:l.jsx(ei,{size:13}),children:l.jsx(UZ,{labels:L.labels,onChange:ee=>me({labels:ee})})}),N.map(({key:ee,value:de})=>{const ge=String(de);return l.jsx(kr,{label:ee,icon:l.jsx(ng,{size:13}),children:l.jsxs("div",{className:"card-metadata-highlight min-w-0",children:[Vx(ge)?l.jsx("a",{href:ge,target:"_blank",rel:"noopener noreferrer",className:"card-metadata-highlight__link truncate",style:{color:"var(--vscode-textLink-foreground)"},children:ge}):l.jsx("span",{className:"card-metadata-highlight__value",style:{color:"var(--vscode-foreground)"},children:ge}),l.jsx(Oc,{path:ee,value:Bx(de)})]})},ee)}),l.jsxs("button",{type:"button",onClick:()=>Y(ee=>!ee),className:"card-advanced-toggle",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(Ze,{size:11,className:`opacity-60 transition-transform ${A?"":"-rotate-90"}`}),l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",children:"Advanced"})]}),A&&l.jsxs(l.Fragment,{children:[l.jsx(kr,{label:"Created",icon:l.jsx(Ll,{size:13}),children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:Na(L.created)}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:Bs(L.created),children:oa(L.created)})]})}),l.jsx(kr,{label:"Modified",icon:l.jsx(Ll,{size:13}),children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:Na(L.modified)}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:Bs(L.modified),children:oa(L.modified)})]})}),l.jsx("div",{className:"px-4 pb-2",children:l.jsx(BZ,{metadata:C,onOpenMetadataFile:f})})]})]})]}),l.jsxs("section",{className:Ae("card-surface card-surface--attachments",S.compactMode&&"card-surface--attachments-compact"),children:[l.jsxs("div",{className:"card-surface-header",children:[l.jsxs("div",{children:[l.jsx("span",{className:"card-surface-kicker",children:"Files"}),l.jsx("h2",{className:"card-surface-title",children:"Attachments"})]}),l.jsxs("button",{type:"button",onClick:g,className:"card-inline-action",children:[l.jsx(g1,{size:14}),l.jsx("span",{children:"Add attachment"})]})]}),L.attachments.length>0?l.jsx("div",{className:"card-attachment-tags",children:L.attachments.map(ee=>l.jsxs("div",{className:"card-attachment-tag",children:[l.jsxs("button",{type:"button",onClick:()=>m(ee),className:"card-attachment-tag__link",title:ee,children:[l.jsx(Gm,{size:12}),l.jsx("span",{children:ee})]}),l.jsx("button",{type:"button",onClick:()=>v(ee),className:"card-attachment-tag__remove","aria-label":`Remove ${ee}`,children:l.jsx(st,{size:12})})]},ee))}):l.jsx("p",{className:"card-empty-state",children:"No attachments yet."})]})]}),l.jsx("section",{className:"card-surface card-surface--editor card-editor-main-surface",children:l.jsx(Fx,{value:O,onChange:le,placeholder:"Start writing...",className:"flex-1 min-h-[26rem]",mode:"edit",comments:n,onAddComment:y,onUpdateComment:b,onDeleteComment:_,logs:R,onClearLogs:M,logsFilter:D,onLogsFilterChange:j,cardId:e,frontmatter:L,onFormSubmitSuccess:I})})]})]})})})}function WZ({labels:e,labelDefs:t,selected:r,onChange:n,showAllOption:s=!1,position:o="below"}){const[a,i]=x.useState(""),u=x.useMemo(()=>{const p={};return e.forEach(h=>{const g=t[h],m=(g==null?void 0:g.group)||"Other";p[m]||(p[m]=[]),p[m].push(h)}),p},[e,t]),c=x.useMemo(()=>{if(!a)return u;const p=a.toLowerCase(),h={};return Object.entries(u).forEach(([g,m])=>{const v=m.filter(y=>y.toLowerCase().includes(p));v.length>0&&(h[g]=v)}),h},[u,a]),d=p=>{r.includes(p)?n(r.filter(h=>h!==p)):n([...r,p])},f=o==="above"?"bottom-full mb-1":"top-full mt-1";return l.jsxs("div",{className:`absolute ${f} left-0 min-w-[200px] max-h-72 overflow-y-auto bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1`,children:[l.jsx("div",{className:"px-2 pb-1",children:l.jsx("input",{type:"text",value:a,onChange:p=>i(p.target.value),placeholder:"Filter labels...",autoFocus:!0,className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}),s&&!a&&l.jsxs("button",{type:"button",onClick:()=>n([]),className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors ${r.length===0?"text-blue-600 dark:text-blue-400 font-medium":"text-zinc-900 dark:text-zinc-100"}`,children:[l.jsx("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${r.length===0?"border-blue-500 bg-blue-500":"border-zinc-300 dark:border-zinc-500"}`,children:r.length===0&&l.jsx(jt,{size:10,className:"text-white"})}),l.jsx("span",{children:"All Labels"})]}),Object.entries(c).map(([p,h])=>l.jsxs("div",{children:[Object.keys(c).length>1&&l.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-xs font-semibold text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:p}),h.map(g=>{const m=t[g],v=r.includes(g);return l.jsxs("button",{type:"button",onClick:()=>d(g),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${v?"border-blue-500 bg-blue-500":"border-zinc-300 dark:border-zinc-500"}`,children:v&&l.jsx(jt,{size:10,className:"text-white"})}),(m==null?void 0:m.color)&&l.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:m.color}}),l.jsx("span",{className:"truncate",children:g})]},g)})]},p)),Object.keys(c).length===0&&l.jsx("div",{className:"px-3 py-2 text-sm text-zinc-400 dark:text-zinc-500",children:"No labels found"})]})}function KZ({boards:e,currentBoard:t,starredBoards:r,onSelect:n,onClose:s}){const[o,a]=x.useState(""),[i,u]=x.useState(0),c=x.useRef(null),d=x.useMemo(()=>{const g=o.toLowerCase();return(g?e.filter(v=>v.name.toLowerCase().includes(g)||v.id.toLowerCase().includes(g)):e).slice().sort((v,y)=>{const b=r.includes(v.id),_=r.includes(y.id);return b&&!_?-1:!b&&_?1:0})},[e,o,r]);x.useEffect(()=>{setTimeout(()=>{var g;return(g=c.current)==null?void 0:g.focus()},0)},[]),x.useEffect(()=>{u(0)},[o]),x.useEffect(()=>{const g=m=>{if(m.key==="Escape"){m.stopPropagation(),s();return}if(m.key==="ArrowDown"){m.preventDefault(),u(v=>Math.min(v+1,d.length-1));return}if(m.key==="ArrowUp"){m.preventDefault(),u(v=>Math.max(v-1,0));return}m.key==="Enter"&&d[i]&&(n(d[i].id),s())};return document.addEventListener("keydown",g,!0),()=>document.removeEventListener("keydown",g,!0)},[d,i,n,s]);const f=d.filter(g=>r.includes(g.id)),p=d.filter(g=>!r.includes(g.id)),h=f.length>0;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:s}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-50 w-72 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-lg shadow-xl overflow-hidden",children:[l.jsx("div",{className:"p-2 border-b border-zinc-200 dark:border-zinc-700",children:l.jsxs("div",{className:"relative",children:[l.jsx(sg,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),l.jsx("input",{ref:c,type:"text",value:o,onChange:g=>a(g.target.value),placeholder:"Search boards...",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-zinc-50 dark:bg-zinc-700 rounded-md border border-zinc-200 dark:border-zinc-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]})}),l.jsxs("div",{className:"py-1 max-h-72 overflow-y-auto",children:[d.length===0&&l.jsx("div",{className:"px-4 py-3 text-sm text-zinc-400 dark:text-zinc-500 text-center",children:"No boards found"}),h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"px-3 pt-1 pb-0.5 flex items-center gap-1.5",children:[l.jsx(og,{size:11,className:"text-amber-400 fill-amber-400"}),l.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Starred"})]}),f.map(g=>{const m=d.indexOf(g);return l.jsx(Lm,{board:g,isActive:m===i,isCurrent:g.id===t,onSelect:()=>{n(g.id),s()}},g.id)}),p.length>0&&l.jsx("div",{className:"px-3 pt-2 pb-0.5",children:l.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"All boards"})})]}),p.map(g=>{const m=d.indexOf(g);return l.jsx(Lm,{board:g,isActive:m===i,isCurrent:g.id===t,onSelect:()=>{n(g.id),s()}},g.id)})]}),l.jsx("div",{className:"px-3 py-1.5 border-t border-zinc-200 dark:border-zinc-700",children:l.jsx("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:"↑↓ navigate · Enter select · Esc close"})})]})]})}function Lm({board:e,isActive:t,isCurrent:r,onSelect:n}){return l.jsxs("button",{type:"button",onClick:n,className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors ${t?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-zinc-900 dark:text-zinc-100 hover:bg-zinc-100 dark:hover:bg-zinc-700"}`,children:[l.jsx(jt,{size:14,className:r?"text-blue-500 shrink-0":"invisible shrink-0"}),l.jsx("span",{className:"truncate",children:e.name})]})}const Fm=[{value:"all",label:"All Priorities"},{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],Bm=[{value:"all",label:"All Dates"},{value:"overdue",label:"Overdue"},{value:"today",label:"Due Today"},{value:"this-week",label:"Due This Week"},{value:"no-date",label:"No Due Date"}],zl="text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100";function Lr({label:e,onRemove:t}){return l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-700 rounded-full",children:[l.jsx("span",{className:"max-w-[180px] truncate",children:e}),l.jsx("button",{type:"button",onClick:t,className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-200 flex-shrink-0","aria-label":`Remove ${e} filter`,children:l.jsx(st,{size:12})})]})}function HZ({label:e,checked:t,onChange:r}){return l.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":t,onClick:n=>{n.stopPropagation(),r(!t)},className:"w-full text-left px-3 py-2 text-sm transition-colors hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 flex items-center gap-2",children:[l.jsx("span",{className:"w-4 h-4 rounded-sm border flex items-center justify-center shrink-0",style:{borderColor:t?"var(--vscode-focusBorder)":"var(--vscode-checkbox-border, var(--vscode-panel-border))",background:t?"var(--vscode-focusBorder)":"transparent"},children:t&&l.jsx(jt,{size:10,style:{color:"var(--vscode-checkbox-foreground, white)"}})}),l.jsx("span",{className:"truncate",children:e})]})}function GZ({onOpenSettings:e,onAddColumn:t,onCreateCard:r,onToggleTheme:n,onSwitchBoard:s,onCreateBoard:o,onOpenBoardLogs:a,boardLogsOpen:i,onTriggerBoardAction:u,onOpenShortcutHelp:c}){var To,Io,Mo;const d=q(T=>T.searchQuery),f=q(T=>T.setSearchQuery),p=q(T=>T.fuzzySearch),h=q(T=>T.setFuzzySearch),g=q(T=>T.clearPlainTextSearch),m=q(T=>T.removeMetadataFilterToken),v=q(T=>T.priorityFilter),y=q(T=>T.setPriorityFilter),b=q(T=>T.assigneeFilter),_=q(T=>T.setAssigneeFilter),w=q(T=>T.labelFilter),$=q(T=>T.setLabelFilter),R=q(T=>T.dueDateFilter),M=q(T=>T.setDueDateFilter),D=q(T=>T.clearAllFilters),j=q(T=>T.layout),S=q(T=>T.toggleLayout),E=q(T=>T.isDarkMode),P=q(T=>T.cardSettings),W=q(T=>T.boards),G=q(T=>T.currentBoard),L=q(T=>T.columns),V=q(T=>T.labelDefs),O=q(T=>T.cards),re=q(T=>T.starredBoards),J=q(T=>T.toggleStarBoard),K=q(T=>T.savedViews),A=q(T=>T.saveCurrentView),Y=q(T=>T.removeView),z=q(T=>T.getHiddenColumnIds()),k=q(T=>T.setColumnHidden),C=x.useMemo(()=>{const T=new Set;return O.forEach(ve=>{ve.assignee&&T.add(ve.assignee)}),Array.from(T).sort()},[O]),N=x.useMemo(()=>{const T=new Set;return O.forEach(ve=>ve.labels.forEach(er=>T.add(er))),Array.from(T).sort()},[O]),B=x.useMemo(()=>Fs(d),[d]),H=x.useMemo(()=>Object.entries(B.metaFilter),[B]),te=x.useMemo(()=>{const T=q.getState().columnSorts;return d!==""||p||v!=="all"||b!=="all"||w.length>0||R!=="all"||Object.values(T).some(ve=>ve!=="order")},[d,p,v,b,w,R]),[se,le]=x.useState(!1),[me,I]=x.useState(!1),[ae,ce]=x.useState(""),ee=x.useRef(null),de=x.useRef(null),[ge,Ee]=x.useState(!1),Ce=x.useRef(null),[Ie,Ge]=x.useState(!1),[it,wt]=x.useState(!1),kt=x.useRef(null),[xe,Se]=x.useState(!1),We=x.useRef(null),[pt,is]=x.useState(!1),[pn,mn]=x.useState(!1),ls=x.useRef(null),[cs,gn]=x.useState(!1),[us,vn]=x.useState(""),ds=x.useRef(null),jo=x.useMemo(()=>{var T;return((T=W.find(ve=>ve.id===G))==null?void 0:T.actions)??{}},[W,G]),Eo=x.useMemo(()=>Object.entries(jo),[jo]),Ao=x.useMemo(()=>L.filter(T=>T.id!==Gn),[L]),fs=x.useMemo(()=>new Set(z),[z]),yn=x.useMemo(()=>{let T=0;return v!=="all"&&(T+=1),b!=="all"&&(T+=1),w.length>0&&(T+=1),R!=="all"&&(T+=1),T},[v,b,w,R]);x.useEffect(()=>{const T=ve=>{ee.current&&!ee.current.contains(ve.target)&&(le(!1),I(!1),ce(""))};return(se||me)&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[se,me]),x.useEffect(()=>{const T=ve=>{Ce.current&&!Ce.current.contains(ve.target)&&Ee(!1)};return ge&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[ge]),x.useEffect(()=>{const T=ve=>{kt.current&&!kt.current.contains(ve.target)&&(Ge(!1),wt(!1))};return Ie&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[Ie]),x.useEffect(()=>{Ie||wt(!1)},[Ie]),x.useEffect(()=>{const T=ve=>{We.current&&!We.current.contains(ve.target)&&Se(!1)};return xe&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[xe]),x.useEffect(()=>{const T=ve=>{ls.current&&!ls.current.contains(ve.target)&&mn(!1)};return pn&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[pn]),x.useEffect(()=>{cs&&ds.current&&ds.current.focus()},[cs]),x.useEffect(()=>{me&&de.current&&de.current.focus()},[me]);const No=((To=W.find(T=>T.id===G))==null?void 0:To.name)||G,hs=re.includes(G),Po=x.useCallback(()=>{const T=us.trim();T&&(A(T),vn(""),gn(!1),mn(!1))},[us,A]),Oi=x.useCallback(T=>{const ve=q.getState();ve.setSearchQuery(T.searchQuery),ve.setFuzzySearch(T.fuzzySearch),ve.setPriorityFilter(T.priorityFilter),ve.setAssigneeFilter(T.assigneeFilter),ve.setLabelFilter(T.labelFilter),ve.setDueDateFilter(T.dueDateFilter)},[]),Ro=()=>{const T=ae.trim();T&&(o(T),ce(""),I(!1))};return x.useEffect(()=>{const T=ve=>{const er=ve.target;er.tagName==="INPUT"||er.tagName==="TEXTAREA"||er.isContentEditable||(ve.key==="b"||ve.key==="B")&&(ve.preventDefault(),le(Di=>!Di))};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[]),l.jsxs("div",{className:"flex flex-col border-b border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50",children:[l.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 flex-wrap",children:[l.jsxs("div",{className:"relative flex items-center gap-0.5",ref:ee,children:[l.jsxs("button",{type:"button",onClick:()=>le(!se),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",title:"Switch board (b)",children:[l.jsx("span",{className:"max-w-[120px] truncate",children:No}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${se?"rotate-180":""}`})]}),l.jsx("button",{type:"button",onClick:()=>J(G),className:"p-1.5 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:hs?"Unstar board":"Star board",children:l.jsx(og,{size:14,className:hs?"fill-amber-400 text-amber-400":"text-zinc-400"})}),me?l.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[l.jsx("input",{ref:de,type:"text",value:ae,onChange:T=>ce(T.target.value),onKeyDown:T=>{T.key==="Enter"&&Ro(),T.key==="Escape"&&(I(!1),ce(""))},placeholder:"Board name...",className:"w-28 px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"}),l.jsx("button",{type:"button",onClick:Ro,className:"px-2 py-1 text-xs font-medium text-white bg-blue-600 hover:bg-blue-700 rounded transition-colors",children:"Create"}),l.jsx("button",{type:"button",onClick:()=>{I(!1),ce("")},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:l.jsx(st,{size:14})})]}):l.jsx("button",{type:"button",onClick:()=>I(!0),className:"p-1.5 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:"Create new board",children:l.jsx(Zr,{size:14,className:"text-zinc-400"})}),se&&l.jsx(KZ,{boards:W,currentBoard:G,starredBoards:re,onSelect:T=>{s(T),le(!1)},onClose:()=>le(!1)})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[220px] max-w-md",children:[l.jsxs("div",{className:"relative flex-1 min-w-[180px] max-w-xs",children:[l.jsx(sg,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),l.jsx("input",{type:"text",value:d,onChange:T=>f(T.target.value),placeholder:"Search cards, people, labels...",title:"Search cards by text. Advanced metadata search also works with meta.field: value",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),l.jsxs("label",{className:"inline-flex items-center gap-1.5 px-2 py-1.5 text-xs text-zinc-600 dark:text-zinc-300 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md select-none whitespace-nowrap",children:[l.jsx("input",{type:"checkbox",checked:p,onChange:T=>h(T.target.checked),className:"h-3.5 w-3.5 rounded border-zinc-300 text-blue-600 focus:ring-blue-500"}),l.jsx("span",{children:"Fuzzy"})]})]}),l.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors shadow-sm",title:"Create a new card",children:[l.jsx(Zr,{size:16}),l.jsx("span",{children:"New Card"})]}),l.jsxs("button",{type:"button",onClick:()=>is(T=>!T),className:`flex items-center gap-1.5 px-2 py-1.5 text-sm border rounded-md transition-colors ${pt||yn>0?"text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/30":"text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 border-zinc-200 dark:border-zinc-600 bg-white dark:bg-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-700"}`,title:"Show or hide filters",children:[l.jsx(b1,{size:14}),l.jsx("span",{children:yn>0?`Filters (${yn})`:"Filters"})]}),pt&&P.showPriorityBadges&&l.jsx("select",{value:v,onChange:T=>y(T.target.value),className:zl,children:Fm.map(T=>l.jsx("option",{value:T.value,children:T.label},T.value))}),pt&&P.showAssignee&&l.jsxs("select",{value:b,onChange:T=>_(T.target.value),className:zl,children:[l.jsx("option",{value:"all",children:"All Assignees"}),l.jsx("option",{value:"unassigned",children:"Unassigned"}),C.map(T=>l.jsx("option",{value:T,children:T},T))]}),pt&&P.showLabels&&l.jsxs("div",{className:"relative",ref:Ce,children:[l.jsxs("button",{type:"button",onClick:()=>Ee(!ge),className:`flex items-center gap-1.5 text-sm bg-white dark:bg-zinc-800 border rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 transition-colors ${w.length>0?"border-blue-500 dark:border-blue-400":"border-zinc-200 dark:border-zinc-600"}`,children:[l.jsx(ei,{size:14,className:"text-zinc-400 shrink-0"}),l.jsx("span",{className:"max-w-[100px] truncate",children:w.length===0?"All Labels":w.length===1?w[0]:`${w.length} Labels`}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${ge?"rotate-180":""}`})]}),ge&&l.jsx(WZ,{labels:N,labelDefs:V,selected:w,onChange:$,showAllOption:!0})]}),pt&&P.showDueDate&&l.jsx("select",{value:R,onChange:T=>M(T.target.value),className:zl,children:Bm.map(T=>l.jsx("option",{value:T.value,children:T.label},T.value))}),te&&l.jsxs("button",{onClick:D,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Clear all filters",children:[l.jsx(st,{size:14}),l.jsx("span",{children:"Clear"})]}),l.jsxs("div",{className:"relative",ref:ls,children:[l.jsxs("button",{type:"button",onClick:()=>mn(!pn),className:`flex items-center gap-1.5 px-2 py-1.5 text-sm border rounded-md transition-colors ${K.length>0?"text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/30":"text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 border-zinc-200 dark:border-zinc-600 bg-white dark:bg-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-700"}`,title:"Saved views",children:[l.jsx(pf,{size:14}),l.jsxs("span",{children:["Views",K.length>0?` (${K.length})`:""]})]}),pn&&l.jsxs("div",{className:"absolute top-full left-0 mt-1 min-w-[220px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[K.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"px-3 py-1 text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Saved views"}),K.map(T=>l.jsxs("div",{className:"flex items-center gap-1 px-2",children:[l.jsx("button",{type:"button",onClick:()=>{Oi(T),mn(!1)},className:"flex-1 text-sm text-left py-1.5 px-1 text-zinc-900 dark:text-zinc-100 hover:text-blue-600 dark:hover:text-blue-400 truncate transition-colors",children:T.name}),l.jsx("button",{type:"button",onClick:()=>Y(T.id),className:"p-1 text-zinc-400 hover:text-red-500 transition-colors shrink-0",title:"Remove view",children:l.jsx(st,{size:12})})]},T.id)),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"})]}),cs?l.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-1",children:[l.jsx("input",{ref:ds,type:"text",value:us,onChange:T=>vn(T.target.value),onKeyDown:T=>{T.key==="Enter"&&Po(),T.key==="Escape"&&(gn(!1),vn(""))},placeholder:"View name...",className:"flex-1 px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"}),l.jsx("button",{type:"button",onClick:Po,className:"px-2 py-1 text-xs font-medium text-white bg-blue-600 hover:bg-blue-700 rounded transition-colors",children:"Save"}),l.jsx("button",{type:"button",onClick:()=>{gn(!1),vn("")},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:l.jsx(st,{size:12})})]}):l.jsxs("button",{type:"button",onClick:()=>gn(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left text-blue-600 dark:text-blue-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(pf,{size:14}),l.jsx("span",{children:"Save current filters"})]})]})]}),l.jsxs("button",{onClick:t,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Add new list",children:[l.jsx(Zr,{size:16}),l.jsx("span",{children:"Add List"})]}),c&&l.jsx("button",{type:"button",onClick:c,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Keyboard shortcuts (?)",children:l.jsx(x1,{size:16})}),l.jsx("button",{type:"button",onClick:S,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:j==="horizontal"?"Switch to row layout":"Switch to column layout",children:j==="horizontal"?l.jsx(w1,{size:16}):l.jsx(Fl,{size:16})}),l.jsxs("div",{className:"relative",ref:kt,children:[l.jsx("button",{type:"button",onClick:()=>Ge(!Ie),className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Board options",children:l.jsx(k1,{size:16})}),Ie&&l.jsxs("div",{className:"absolute top-full right-0 mt-1 min-w-[200px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[Ao.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"px-1",onClick:T=>T.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:T=>{T.stopPropagation(),wt(ve=>!ve)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors rounded-sm","aria-expanded":it,children:[l.jsx(Fl,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{className:"flex-1",children:"Columns"}),l.jsx(Ze,{size:14,className:`shrink-0 text-zinc-400 transition-transform ${it?"rotate-180":""}`})]}),it&&l.jsx("div",{className:"mt-1 mb-1 rounded-md border border-zinc-200 dark:border-zinc-700 bg-zinc-50/80 dark:bg-zinc-900/50 py-1",onClick:T=>T.stopPropagation(),children:Ao.map(T=>{const ve=!fs.has(T.id);return l.jsx(HZ,{label:T.name,checked:ve,onChange:er=>k(G,T.id,!er)},T.id)})})]}),l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"})]}),l.jsxs("button",{type:"button",onClick:()=>{n(),Ge(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[E?l.jsx(_1,{size:14,className:"shrink-0 text-zinc-400"}):l.jsx(C1,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{children:E?"Light Theme":"Dark Theme"})]}),l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{e(),Ge(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx($1,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{children:"Settings"})]}),a&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{a(),Ge(!1)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors ${i?"text-blue-600 dark:text-blue-400":"text-zinc-900 dark:text-zinc-100"}`,children:[l.jsx(tg,{size:14,className:`shrink-0 ${i?"text-blue-500":"text-zinc-400"}`}),l.jsx("span",{children:"Board Logs"})]})]})]})]}),Eo.length>0&&u&&l.jsxs("div",{className:"relative ml-auto",ref:We,children:[l.jsxs("button",{type:"button",onClick:()=>Se(!xe),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",title:"Board actions",children:[l.jsx(ga,{size:14,className:"text-amber-500"}),l.jsx("span",{children:"Actions"}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${xe?"rotate-180":""}`})]}),xe&&l.jsx("div",{className:"absolute top-full right-0 mt-1 min-w-[180px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:Eo.map(([T,ve])=>l.jsxs("button",{type:"button",onClick:()=>{Se(!1),u(G,T)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx(ga,{size:12,className:"text-amber-500 shrink-0"}),l.jsx("span",{className:"truncate",children:ve})]},T))})]})]}),te&&l.jsxs("div",{className:"flex flex-wrap gap-1.5 px-4 pb-2",children:[B.plainText&&l.jsx(Lr,{label:`Search: "${B.plainText}"`,onRemove:g}),H.map(([T,ve])=>l.jsx(Lr,{label:`meta.${T}: ${ve}`,onRemove:()=>m(T)},T)),p&&l.jsx(Lr,{label:"Fuzzy",onRemove:()=>h(!1)}),v!=="all"&&l.jsx(Lr,{label:`Priority: ${((Io=Fm.find(T=>T.value===v))==null?void 0:Io.label)??v}`,onRemove:()=>y("all")}),b!=="all"&&l.jsx(Lr,{label:`Assignee: ${b==="unassigned"?"Unassigned":b}`,onRemove:()=>_("all")}),w.map(T=>l.jsx(Lr,{label:`Label: ${T}`,onRemove:()=>$(w.filter(ve=>ve!==T))},T)),R!=="all"&&l.jsx(Lr,{label:`Due: ${((Mo=Bm.find(T=>T.value===R))==null?void 0:Mo.label)??R}`,onRemove:()=>M("all")})]})]})}function Um({title:e,message:t,onUndo:r,onExpire:n,duration:s,index:o,actionLabel:a="Undo",persistent:i=!1,tone:u="default"}){const[c,d]=x.useState(100),f=!i&&typeof s=="number"&&typeof n=="function",p=u==="error"?"var(--vscode-errorForeground, #f14c4c)":u==="info"?"var(--vscode-progressBar-background)":void 0;return x.useEffect(()=>{if(!f||!s){d(100);return}const h=50,g=h/s*100,m=setInterval(()=>{d(v=>{const y=v-g;return y<=0?(clearInterval(m),0):y})},h);return()=>clearInterval(m)},[s,f]),x.useEffect(()=>{f&&c<=0&&n&&n()},[c,n,f]),l.jsxs("div",{className:"fixed right-4 z-50 flex flex-col min-w-[320px] max-w-[420px] shadow-[0_4px_16px_rgba(0,0,0,0.4)] transition-[bottom] duration-200 ease-out",style:{bottom:`${24+o*52}px`,background:"var(--vscode-notifications-background)",color:"var(--vscode-notifications-foreground)",border:"1px solid var(--vscode-notifications-border, var(--vscode-widget-border))",borderLeft:p?`3px solid ${p}`:void 0},children:[l.jsxs("div",{className:"flex items-start gap-3 px-3 py-2.5",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[e&&l.jsx("div",{className:"mb-0.5 text-[12px] font-semibold",children:e}),l.jsx("span",{className:`text-[13px] leading-snug ${e?"block":"truncate"}`,children:t})]}),r&&l.jsx("button",{onClick:r,className:"text-[13px] px-2 py-0.5 shrink-0",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},onMouseEnter:h=>h.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:h=>h.currentTarget.style.background="var(--vscode-button-background)",children:a})]}),f&&l.jsx("div",{className:"h-[2px] w-full",style:{background:"var(--vscode-widget-border)"},children:l.jsx("div",{className:"h-full transition-none",style:{width:`${c}%`,background:"var(--vscode-progressBar-background)"}})})]})}const qZ=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],YZ=[{value:"fancy",label:"Fancy"},{value:"plain",label:"Plain"}],JZ=[{value:"aurora",label:"Aurora Glow"},{value:"sunset",label:"Sunset Blend"},{value:"meadow",label:"Meadow Mist"},{value:"nebula",label:"Nebula Bloom"},{value:"lagoon",label:"Lagoon Light"},{value:"candy",label:"Candy Pop"},{value:"ember",label:"Ember Sky"},{value:"violet",label:"Violet Pulse"}],ZZ=[{value:"paper",label:"Paper White"},{value:"mist",label:"Mist Blue"},{value:"sand",label:"Soft Sand"}];function QZ({isOpen:e,settings:t,workspace:r,onClose:n,onSave:s,onSetLabel:o,onRenameLabel:a,onDeleteLabel:i}){return e?l.jsx(tQ,{settings:t,workspace:r,onClose:n,onSave:s,onSetLabel:o,onRenameLabel:a,onDeleteLabel:i}):null}function XZ({checked:e,onChange:t}){return l.jsx("button",{type:"button",onClick:()=>t(!e),className:Ae("relative inline-flex h-5 w-9 items-center rounded-full transition-colors shrink-0"),style:{background:e?"var(--vscode-button-background)":"var(--vscode-badge-background, #6b7280)"},children:l.jsx("span",{className:"inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",style:{transform:e?"translateX(18px)":"translateX(3px)"}})})}function As({title:e,children:t}){return l.jsxs("div",{className:"py-3",children:[l.jsx("h3",{className:"px-4 pb-2 text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:e}),l.jsx("div",{children:t})]})}function Fr({label:e,description:t,checked:r,onChange:n}){return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors cursor-pointer",onClick:()=>n(!r),onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),t&&l.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),l.jsx(XZ,{checked:r,onChange:n})]})}function Xo({label:e,value:t}){return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-1.5",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-descriptionForeground)"},children:e}),l.jsx("div",{className:"text-xs font-mono truncate max-w-[60%] text-right",style:{color:"var(--vscode-foreground)",opacity:.7},title:t,children:t})]})}function Ns({label:e,value:t,options:r,onChange:n}){const[s,o]=x.useState(!1),a=r.find(i=>i.value===t);return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:i=>i.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:i=>i.currentTarget.style.background="transparent",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",a.dot)}),!(a!=null&&a.dot)&&(a==null?void 0:a.dotColor)&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.dotColor}}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"}})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),l.jsx("div",{className:"absolute top-full right-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:r.map(i=>l.jsxs("button",{type:"button",onClick:()=>{n(i.value),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:u=>{i.value!==t&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{i.value!==t&&(u.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ae("w-2 h-2 rounded-full shrink-0",i.dot)}),!i.dot&&i.dotColor&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:i.dotColor}}),l.jsx("span",{className:"flex-1 text-left",children:i.label})]},i.value))})]})]})]})}function Ol({label:e,description:t,value:r,min:n,max:s,step:o,unit:a,onChange:i}){const u=(r-n)/(s-n)*100;return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:c=>c.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:c=>c.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),t&&l.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx("input",{type:"range",min:n,max:s,step:o,value:r,onChange:c=>i(Number(c.target.value)),className:"settings-slider",style:{background:`linear-gradient(to right, var(--vscode-button-background) ${u}%, var(--vscode-badge-background, #6b7280) ${u}%)`}}),l.jsxs("span",{className:"text-xs font-mono w-12 text-right tabular-nums",style:{color:"var(--vscode-foreground)"},children:[r,a||"%"]})]})]})}function Vm({value:e,onChange:t}){const[r,n]=x.useState(!1),[s,o]=x.useState("");return l.jsxs("div",{className:"relative",children:[l.jsx("button",{type:"button",onClick:()=>n(!r),className:"w-5 h-5 rounded-full border border-white/20 cursor-pointer shrink-0",style:{backgroundColor:e}}),r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>n(!1)}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-2 min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[l.jsx("div",{className:"grid grid-cols-6 gap-1.5 mb-2",children:ec.map(a=>l.jsx("button",{type:"button",onClick:()=>{t(a.hex),n(!1)},className:"w-6 h-6 rounded-full border-2 transition-transform hover:scale-110",style:{backgroundColor:a.hex,borderColor:e===a.hex?"white":"transparent"},title:a.name},a.name))}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("input",{type:"text",placeholder:"#hex",value:s,onChange:a=>o(a.target.value),className:"flex-1 px-2 py-1 text-xs rounded",style:{background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"}}),l.jsx("button",{type:"button",onClick:()=>{/^#[0-9a-fA-F]{6}$/.test(s)&&(t(s),n(!1),o(""))},className:"px-2 py-1 text-xs rounded",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:"OK"})]})]})]})]})}function eQ({onSetLabel:e,onRenameLabel:t,onDeleteLabel:r}){const n=q(j=>j.labelDefs),s=q(j=>j.cards),[o,a]=x.useState(""),[i,u]=x.useState(ec[0].hex),[c,d]=x.useState(""),[f,p]=x.useState(null),[h,g]=x.useState(""),[m,v]=x.useState(null),y=x.useMemo(()=>{const j=new Map;for(const[S,E]of Object.entries(n))j.set(S,E);for(const S of s)for(const E of S.labels)j.has(E)||j.set(E,void 0);return j},[n,s]),b=x.useMemo(()=>{const j={};return y.forEach((E,P)=>{const W=(E==null?void 0:E.group)||"Other";j[W]||(j[W]=[]),j[W].push({name:P,def:E})}),Object.entries(j).sort(([E],[P])=>E==="Other"?1:P==="Other"?-1:E.localeCompare(P))},[y]),_=x.useMemo(()=>{const j=new Set;return Object.values(n).forEach(S=>{S.group&&j.add(S.group)}),Array.from(j).sort()},[n]),w=j=>s.filter(S=>S.labels.includes(j)).length,$=()=>{const j=o.trim();j&&(e==null||e(j,{color:i,group:c||void 0}),a(""),u(ec[0].hex),d(""))},R=j=>{const S=h.trim();S&&S!==j&&(t==null||t(j,S)),p(null),g("")},M=j=>{r==null||r(j),v(null)},D={background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"};return l.jsxs("div",{className:"px-4 space-y-3",children:[b.map(([j,S])=>l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--vscode-descriptionForeground)"},children:j}),l.jsx("div",{className:"space-y-1",children:S.map(({name:E,def:P})=>l.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded group/label transition-colors",onMouseEnter:W=>W.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:W=>W.currentTarget.style.background="transparent",children:[l.jsx(Vm,{value:(P==null?void 0:P.color)||"#6b7280",onChange:W=>e==null?void 0:e(E,{...P,color:W,group:P==null?void 0:P.group})}),f===E?l.jsx("input",{type:"text",value:h,onChange:W=>g(W.target.value),onKeyDown:W=>{W.key==="Enter"&&R(E),W.key==="Escape"&&(p(null),g(""))},onBlur:()=>R(E),autoFocus:!0,className:"flex-1 px-1.5 py-0.5 text-xs rounded min-w-0",style:D}):l.jsx("span",{className:"flex-1 text-xs truncate",style:{color:"var(--vscode-foreground)"},children:E}),(P==null?void 0:P.group)&&f!==E&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full shrink-0",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:P.group}),m===E?l.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[l.jsxs("span",{className:"text-[10px]",style:{color:"var(--vscode-errorForeground, #f44)"},children:[w(E)," card",w(E)!==1?"s":""]}),l.jsx("button",{type:"button",onClick:()=>M(E),className:"px-1.5 py-0.5 text-[10px] rounded",style:{background:"var(--vscode-inputValidation-errorBackground, #5a1d1d)",color:"var(--vscode-errorForeground, #f44)"},children:"Delete"}),l.jsx("button",{type:"button",onClick:()=>v(null),className:"px-1.5 py-0.5 text-[10px] rounded",style:{color:"var(--vscode-descriptionForeground)"},children:"Cancel"})]}):l.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 opacity-0 group-hover/label:opacity-100 transition-opacity",children:[l.jsx("button",{type:"button",onClick:()=>{p(E),g(E)},className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:W=>W.currentTarget.style.color="var(--vscode-foreground)",onMouseLeave:W=>W.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Rename label",children:l.jsx(Lc,{size:12})}),l.jsx("button",{type:"button",onClick:()=>v(E),className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:W=>W.currentTarget.style.color="var(--vscode-errorForeground, #f44)",onMouseLeave:W=>W.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Delete label",children:l.jsx(Kt,{size:12})})]})]},E))})]},j)),l.jsxs("div",{className:"rounded-lg p-2 space-y-2",style:{background:"var(--vscode-input-background)",border:"1px solid var(--vscode-input-border, transparent)"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Vm,{value:i,onChange:u}),l.jsx("input",{type:"text",placeholder:"New label name...",value:o,onChange:j=>a(j.target.value),onKeyDown:j=>{j.key==="Enter"&&$()},className:"flex-1 px-1.5 py-1 text-xs rounded bg-transparent min-w-0",style:{color:"var(--vscode-input-foreground)",outline:"none"}})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",placeholder:"Group (optional)",value:c,onChange:j=>d(j.target.value),onKeyDown:j=>{j.key==="Enter"&&$()},list:"label-groups",className:"flex-1 px-1.5 py-1 text-xs rounded",style:D}),l.jsx("datalist",{id:"label-groups",children:_.map(j=>l.jsx("option",{value:j},j))}),l.jsxs("button",{type:"button",onClick:$,disabled:!o.trim(),className:"flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors disabled:opacity-40",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:[l.jsx(Zr,{size:12}),"Add"]})]})]})]})}function tQ({settings:e,workspace:t,onClose:r,onSave:n,onSetLabel:s,onRenameLabel:o,onDeleteLabel:a}){const[i,u]=x.useState(e),[c,d]=x.useState("general"),[f,p]=x.useState(!1),h=q($=>$.columns),g=q($=>$.effectiveDrawerWidth),m=q($=>$.setDrawerWidthPreview),v=q($=>$.clearDrawerWidthPreview),y=x.useMemo(()=>h.filter($=>$.id!==Gn).map($=>({value:$.id,label:$.name,dotColor:$.color})),[h]),b=x.useMemo(()=>i.boardBackgroundMode==="plain"?ZZ:JZ,[i.boardBackgroundMode]);x.useEffect(()=>{u(e)},[e]);const _=$=>{const R={...i,...$};u(R),n(R)};x.useEffect(()=>{const $=R=>{R.key==="Escape"&&(R.stopPropagation(),r())};return document.addEventListener("keydown",$,!0),()=>document.removeEventListener("keydown",$,!0)},[r]);const w=(i.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-50 flex ${w?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!w&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r}),l.jsxs("div",{className:w?"relative h-full shadow-xl flex flex-col animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] shadow-xl flex flex-col rounded-xl animate-in zoom-in-95 fade-in duration-200",style:w?{width:`${g}%`,background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"}:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},...w?{"data-panel-drawer":""}:{},children:[l.jsx(Xa,{panelMode:w?"drawer":"popup",onPreview:m,onCommit:$=>{v();const R={...i,drawerWidth:$};u(R),n(R)},onCancel:v}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Settings"}),l.jsx("button",{onClick:r,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:$=>$.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:$=>$.currentTarget.style.background="transparent",children:l.jsx(st,{size:18})})]}),l.jsx("div",{className:"flex",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:["general","defaults","labels"].map($=>l.jsxs("button",{type:"button",onClick:()=>d($),className:"px-4 py-2.5 text-xs font-medium transition-colors relative",style:{color:c===$?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)",background:"transparent"},children:[$.charAt(0).toUpperCase()+$.slice(1),c===$&&l.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5",style:{background:"var(--vscode-button-background)"}})]},$))}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[c==="general"&&l.jsxs(l.Fragment,{children:[l.jsxs(As,{title:"Card Display",children:[l.jsx(Fr,{label:"Show Priority Badges",description:"Display priority indicators on card cards",checked:i.showPriorityBadges,onChange:$=>_({showPriorityBadges:$})}),l.jsx(Fr,{label:"Show Assignee",description:"Display assigned person on card cards",checked:i.showAssignee,onChange:$=>_({showAssignee:$})}),l.jsx(Fr,{label:"Show Due Date",description:"Display due dates on card cards",checked:i.showDueDate,onChange:$=>_({showDueDate:$})}),l.jsx(Fr,{label:"Show Labels",description:"Display labels on card cards and in editors",checked:i.showLabels,onChange:$=>_({showLabels:$})}),l.jsx(Fr,{label:"Show Filename",description:"Display the source markdown filename on cards",checked:i.showFileName,onChange:$=>_({showFileName:$})}),l.jsx(Fr,{label:"Compact Mode",description:"Use compact card layout to show more cards",checked:i.compactMode,onChange:$=>_({compactMode:$})}),l.jsx(Fr,{label:"Show Deleted Column",description:"Display the Deleted column to manage soft-deleted cards",checked:i.showDeletedColumn,onChange:$=>_({showDeletedColumn:$})})]}),l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs(As,{title:"Layout",children:[l.jsx(Ns,{label:"Panel Style",value:i.panelMode??"drawer",options:[{value:"drawer",label:"Right-side Drawer"},{value:"popup",label:"Centered Popup"}],onChange:$=>_({panelMode:$})}),(i.panelMode??"drawer")==="drawer"&&l.jsx(Ol,{label:"Drawer Width",description:"Width of the right-side drawer as a percentage of the viewport",value:i.drawerWidth??50,min:20,max:80,step:5,onChange:$=>_({drawerWidth:$})}),l.jsx(Ns,{label:"Background Style",value:i.boardBackgroundMode,options:YZ,onChange:$=>{const R=Ea($);_(R)}}),l.jsx(Ns,{label:"Background Preset",value:i.boardBackgroundPreset,options:b,onChange:$=>{const R=Ea(i.boardBackgroundMode,$);_(R)}})]}),l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs(As,{title:"Zoom",children:[l.jsx(Ol,{label:"Board Zoom",description:"Scale text size on the board view",value:i.boardZoom,min:75,max:150,step:5,onChange:$=>_({boardZoom:$})}),l.jsx(Ol,{label:"Card Detail Zoom",description:"Scale text size in the card detail panel",value:i.cardZoom,min:75,max:150,step:5,onChange:$=>_({cardZoom:$})})]}),t&&l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 cursor-pointer",onClick:()=>p($=>!$),onMouseEnter:$=>$.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:$=>$.currentTarget.style.background="transparent",children:[l.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:"Advanced"}),l.jsx(Ze,{size:14,className:`transition-transform ${f?"rotate-180":""}`,style:{color:"var(--vscode-descriptionForeground)"}})]}),f&&l.jsxs(l.Fragment,{children:[l.jsx(Xo,{label:"Project Path",value:t.projectPath}),l.jsx(Xo,{label:"Kanban Directory",value:t.kanbanDirectory}),l.jsx(Xo,{label:"Server Port",value:String(t.port)}),l.jsx(Xo,{label:"Config Version",value:String(t.configVersion)})]})]})]}),c==="defaults"&&l.jsxs(As,{title:"Defaults",children:[l.jsx(Ns,{label:"Default Priority",value:i.defaultPriority,options:qZ,onChange:$=>_({defaultPriority:$})}),l.jsx(Ns,{label:"Default Status",value:i.defaultStatus,options:y,onChange:$=>_({defaultStatus:$})})]}),c==="labels"&&l.jsx(As,{title:"Labels",children:l.jsx(eQ,{onSetLabel:s,onRenameLabel:o,onDeleteLabel:a})})]}),l.jsx("div",{className:"px-4 py-2",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:l.jsx("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Settings are saved automatically and apply to all connected clients."})})]})]})}const rQ=["#6b7280","#3b82f6","#f59e0b","#8b5cf6","#22c55e","#ef4444","#ec4899","#14b8a6","#f97316","#06b6d4"];function nQ({isOpen:e,onClose:t,onSave:r,initial:n,title:s}){const[o,a]=x.useState((n==null?void 0:n.name)??""),[i,u]=x.useState((n==null?void 0:n.color)??"#3b82f6"),c=x.useRef(null);return x.useEffect(()=>{e&&(a((n==null?void 0:n.name)??""),u((n==null?void 0:n.color)??"#3b82f6"),setTimeout(()=>{var d;return(d=c.current)==null?void 0:d.focus()},50))},[e,n]),x.useEffect(()=>{if(!e)return;const d=f=>{f.key==="Escape"&&t(),f.key==="Enter"&&(f.ctrlKey||f.metaKey)&&o.trim()&&r({name:o.trim(),color:i})};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,t,r,o,i]),e?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),l.jsxs("div",{className:"relative bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-sm mx-4 border border-zinc-200 dark:border-zinc-600",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[l.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:s}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:l.jsx(st,{size:16,className:"text-zinc-500"})})]}),l.jsxs("div",{className:"px-4 py-4 space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Name"}),l.jsx("input",{ref:c,type:"text",value:o,onChange:d=>a(d.target.value),placeholder:"List name...",className:"w-full px-3 py-1.5 text-sm bg-white dark:bg-zinc-700 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Color"}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[rQ.map(d=>l.jsx("button",{type:"button",onClick:()=>u(d),className:`w-6 h-6 rounded-full border-2 transition-all ${i===d?"border-zinc-900 dark:border-white scale-110":"border-transparent hover:scale-110"}`,style:{backgroundColor:d},title:d},d)),l.jsx("input",{type:"color",value:i,onChange:d=>u(d.target.value),className:"w-6 h-6 rounded cursor-pointer border-0 p-0 bg-transparent",title:"Custom color"})]})]})]}),l.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[l.jsx("button",{type:"button",onClick:t,className:"px-3 py-1.5 text-sm rounded-md text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:"Cancel"}),l.jsx("button",{type:"button",onClick:()=>{o.trim()&&r({name:o.trim(),color:i})},disabled:!o.trim(),className:"px-3 py-1.5 text-sm rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Save"})]})]})]}):null}const sQ=["critical","high","medium","low"],oQ={critical:"Critical",high:"High",medium:"Medium",low:"Low"},aQ={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"};function iQ({selectedCount:e,onClearSelection:t,onMoveToColumn:r,onSetPriority:n,onSetAssignee:s,onApplyLabels:o,onDelete:a}){const i=q(b=>b.columns),u=q(b=>b.cards),c=q(b=>b.labelDefs),d=q(b=>b.selectedCardIds),f=x.useMemo(()=>{const b=new Set;return u.forEach(_=>{_.assignee&&b.add(_.assignee)}),Array.from(b).sort()},[u]),p=x.useMemo(()=>{const b=new Set;return u.forEach(_=>_.labels.forEach(w=>b.add(w))),Array.from(b).sort()},[u]),h=x.useMemo(()=>u.filter(b=>d.includes(b.id)),[u,d]),[g,m]=x.useState(null),v=x.useRef(null);x.useEffect(()=>{const b=_=>{v.current&&!v.current.contains(_.target)&&m(null)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]);const y=b=>{m(g===b?null:b)};return l.jsxs("div",{ref:v,className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-white dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-600 rounded-lg shadow-xl px-3 py-2",children:[l.jsxs("span",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-200 whitespace-nowrap",children:[e," selected"]}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:"Clear selection",children:l.jsx(st,{size:14,className:"text-zinc-500"})}),l.jsx("div",{className:"w-px h-5 bg-zinc-300 dark:bg-zinc-600"}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("moveTo"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(S1,{size:14}),"Move to",l.jsx(Ze,{size:12})]}),g==="moveTo"&&l.jsx(Dl,{children:i.map(b=>l.jsxs("button",{type:"button",onClick:()=>{r(b.id),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:b.color}}),b.name]},b.id))})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("priority"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(Fc,{size:14}),"Priority",l.jsx(Ze,{size:12})]}),g==="priority"&&l.jsx(Dl,{children:sQ.map(b=>l.jsxs("button",{type:"button",onClick:()=>{n(b),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${aQ[b]}`}),oQ[b]]},b))})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("assignee"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(va,{size:14}),"Assign",l.jsx(Ze,{size:12})]}),g==="assignee"&&l.jsxs(Dl,{children:[l.jsx("button",{type:"button",onClick:()=>{s(null),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors italic",children:"Unassign"}),f.map(b=>l.jsxs("button",{type:"button",onClick:()=>{s(b),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:b.split(/\s+/).map(_=>_[0]).join("").toUpperCase().slice(0,2)}),b]},b))]})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("labels"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(ei,{size:14}),"Labels",l.jsx(Ze,{size:12})]}),g==="labels"&&l.jsx(lQ,{allLabels:p,labelDefs:c,selectedCards:h,onApply:(b,_)=>{o(b,_),m(null)}})]}),l.jsx("div",{className:"w-px h-5 bg-zinc-300 dark:bg-zinc-600"}),l.jsxs("button",{type:"button",onClick:()=>{a()},className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors text-red-600 dark:text-red-400",children:[l.jsx(Kt,{size:14}),"Delete"]})]})}function Dl({children:e}){return l.jsx("div",{className:"absolute bottom-full mb-1 left-0 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[160px] max-h-64 overflow-y-auto",children:e})}function lQ({allLabels:e,labelDefs:t,selectedCards:r,onApply:n}){const[s,o]=x.useState(new Map),[a,i]=x.useState(""),u=x.useMemo(()=>{const v=new Map;if(r.length===0)return v;for(const y of e){const b=r.filter(_=>_.labels.includes(y)).length;v.set(y,b===0?"none":b===r.length?"all":"some")}return v},[e,r]),c=v=>{const y=s.get(v);if(y==="add")return"checked";if(y==="remove")return"unchecked";const b=u.get(v)??"none";return b==="all"?"checked":b==="some"?"indeterminate":"unchecked"},d=v=>{const y=u.get(v)??"none",b=c(v),_=new Map(s);b==="unchecked"||b==="indeterminate"?_.set(v,"add"):y==="all"?s.get(v)==="remove"?_.delete(v):_.set(v,"remove"):_.delete(v),o(_)},f=x.useMemo(()=>{if(!a)return e;const v=a.toLowerCase();return e.filter(y=>y.toLowerCase().includes(v))},[e,a]),p=Array.from(s.entries()).filter(([,v])=>v==="add").map(([v])=>v),h=Array.from(s.entries()).filter(([,v])=>v==="remove").map(([v])=>v),g=p.length>0||h.length>0,m=p.length>0&&h.length>0?`Apply changes (+${p.length} −${h.length})`:p.length>0?`Add ${p.length} label${p.length!==1?"s":""}`:`Remove ${h.length} label${h.length!==1?"s":""}`;return l.jsxs("div",{className:"absolute bottom-full mb-1 left-0 z-50 min-w-[200px]",children:[l.jsxs("div",{className:"max-h-72 overflow-y-auto bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1",children:[l.jsx("div",{className:"px-2 pb-1",children:l.jsx("input",{type:"text",value:a,onChange:v=>i(v.target.value),placeholder:"Filter labels...",autoFocus:!0,className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}),f.map(v=>{const y=t[v],b=c(v);return l.jsxs("button",{type:"button",onClick:()=>d(v),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsxs("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${b==="checked"?"border-blue-500 bg-blue-500":b==="indeterminate"?"border-zinc-400 bg-zinc-200 dark:border-zinc-400 dark:bg-zinc-600":"border-zinc-300 dark:border-zinc-500"}`,children:[b==="checked"&&l.jsx(jt,{size:10,className:"text-white"}),b==="indeterminate"&&l.jsx(j1,{size:10,className:"text-zinc-600 dark:text-zinc-300"})]}),(y==null?void 0:y.color)&&l.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:y.color}}),l.jsx("span",{className:"truncate",children:v})]},v)}),f.length===0&&l.jsx("div",{className:"px-3 py-2 text-sm text-zinc-400 dark:text-zinc-500",children:"No labels found"})]}),g&&l.jsx("div",{className:"bg-white dark:bg-zinc-800 border border-t-0 border-zinc-200 dark:border-zinc-600 rounded-b-md shadow-lg px-1 py-1",children:l.jsx("button",{type:"button",onClick:()=>n(p,h),className:"flex items-center justify-center gap-1 w-full px-3 py-1.5 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 rounded transition-colors",children:m})})]})}const cQ=[{keys:["n"],description:"Create a new card"},{keys:["?"],description:"Show / hide this shortcut reference"},{keys:["Ctrl","Z"],description:"Undo last card deletion"},{keys:["Ctrl","+"],description:"Increase board zoom"},{keys:["Ctrl","-"],description:"Decrease board zoom"},{keys:["Ctrl","Shift","+"],description:"Increase card detail zoom"},{keys:["Ctrl","Shift","-"],description:"Decrease card detail zoom"},{keys:["Esc"],description:"Close dialog / clear selection"},{keys:["Ctrl","Enter"],description:"Save and close card (in create dialog)"},{keys:["Ctrl","S"],description:"Save card (in create dialog)"},{keys:["Enter"],description:"Add card (in inline quick-add)"}];function uQ({isOpen:e,onClose:t}){return x.useEffect(()=>{if(!e)return;const r=n=>{n.key==="Escape"&&(n.stopPropagation(),t())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[e,t]),e?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:t}),l.jsxs("div",{className:"relative w-full max-w-md rounded-xl shadow-2xl flex flex-col overflow-hidden",style:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("span",{className:"font-semibold text-sm",style:{color:"var(--vscode-foreground)"},children:"Keyboard Shortcuts"}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:r=>r.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:r=>r.currentTarget.style.background="transparent",title:"Close",children:l.jsx(st,{size:16})})]}),l.jsx("div",{className:"overflow-y-auto max-h-[60vh]",children:cQ.map((r,n)=>l.jsxs("div",{className:"flex items-center justify-between px-5 py-2",style:{borderBottom:"1px solid var(--vscode-panel-border)",opacity:.95},onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:[l.jsx("span",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:r.description}),l.jsx("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:r.keys.map((s,o)=>l.jsxs("span",{className:"flex items-center gap-1",children:[o>0&&l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"+"}),l.jsx("kbd",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:s})]},o))})]},n))}),l.jsxs("div",{className:"px-5 py-2 text-xs",style:{borderTop:"1px solid var(--vscode-panel-border)",color:"var(--vscode-descriptionForeground)"},children:["Press ",l.jsx("kbd",{className:"inline-flex items-center px-1 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:"?"})," or ",l.jsx("kbd",{className:"inline-flex items-center px-1 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:"Esc"})," to close"]})]})]}):null}function dQ(e){if(!e||e<=0)return"";if(e<1e3)return` Next retry in ${e}ms.`;const t=e/1e3;return` Next retry in ${Number.isInteger(t)?String(t):t.toFixed(1)}s.`}function Wm(e){return e?e==="socket-closed"?" The previous socket closed unexpectedly.":` Last signal: ${e}.`:""}function fQ(e){if(e.type==="init"||e.connected||!e.reconnecting&&!e.fatal)return null;if(e.fatal)return{title:"Connection lost",message:`The standalone backend is unavailable and automatic reconnect has stopped.${Wm(e.reason)} Form submissions are unavailable until the backend is reachable again. Refresh or reopen this page after the backend is available again.`,tone:"error"};const t=e.retryCount??1,r=e.maxRetries??t;return{title:"Reconnecting…",message:`Trying to reconnect to the standalone backend (attempt ${t} of ${r}).${dQ(e.retryDelayMs)}${Wm(e.reason)} Form submissions pause until the backend reconnects.`,tone:"info"}}const ue=af();function hQ(e){return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).flatMap(([t,r])=>{if(!r||typeof r!="object"||Array.isArray(r))return[];const n=Array.isArray(r.hiddenColumnIds)?r.hiddenColumnIds.filter(o=>typeof o=="string"):[],s=Array.isArray(r.minimizedColumnIds)?r.minimizedColumnIds.filter(o=>typeof o=="string"):[];return[[t,{hiddenColumnIds:n,minimizedColumnIds:s}]]}))}function pQ(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function mQ(e){return{version:e.version,id:e.id,...e.boardId!==void 0?{boardId:e.boardId}:{},status:e.status,priority:e.priority,assignee:e.assignee,dueDate:e.dueDate,created:e.created,modified:e.modified,completedAt:e.completedAt,labels:e.labels,attachments:e.attachments,order:e.order,metadata:e.metadata,actions:e.actions,forms:e.forms,formData:e.formData}}function gQ(){var df;const{columns:e,boards:t,currentBoard:r,columnVisibilityByBoard:n,workspace:s,cardSettings:o,effectiveDrawerWidth:a,settingsOpen:i,selectedCardIds:u,setCards:c,setColumns:d,setBoards:f,setIsDarkMode:p,setWorkspace:h,setCardSettings:g,setDrawerWidthPreview:m,clearDrawerWidthPreview:v,setSettingsOpen:y,setLabelDefs:b,toggleSelectCard:_,selectCardRange:w,selectAllInColumn:$,clearSelection:R,setActiveCardId:M}=q(),[D,j]=x.useState(!1),[S,E]=x.useState("backlog"),[P,W]=x.useState(!1),[G,L]=x.useState(!1),[V,O]=x.useState(null),re=x.useRef(0),[J,K]=x.useState(null),[A,Y]=x.useState(!1),[z,k]=x.useState([]),[C,N]=x.useState(!1),B=x.useRef(hQ(ue.getState())),H=x.useRef(null);x.useEffect(()=>{M((J==null?void 0:J.id)??null)},[J==null?void 0:J.id,M]);const[te,se]=x.useState([]),[le,me]=x.useState(null),I=x.useRef(te),ae=(df=t.find(F=>F.id===r))==null?void 0:df.title;x.useEffect(()=>{I.current=te},[te]);const ce=x.useRef(0),ee=x.useCallback(F=>{K(Z=>{if(!Z)return Z;const Q=F.find(mt=>mt.id===Z.id);if(!Q)return Z;const X=mQ(Q),_e=Q.comments||[],ne=Z.content!==Q.content,qe=JSON.stringify(Z.frontmatter)!==JSON.stringify(X),Xe=JSON.stringify(Z.comments)!==JSON.stringify(_e);return!ne&&!qe&&!Xe?Z:(ne&&(re.current+=1),{...Z,content:Q.content,frontmatter:X,comments:_e,contentVersion:ne?re.current:Z.contentVersion})})},[]),de=x.useCallback(F=>{const{cards:Z}=q.getState(),Q=Z.find(ne=>ne.id===F);if(!Q)return;const X=Q.status;c(Z.map(ne=>ne.id===F?{...ne,status:Gn}:ne)),(J==null?void 0:J.id)===F&&(K(null),M(null));const _e=String(ce.current++);se(ne=>[...ne,{id:_e,card:Q,originalStatus:X}])},[J,c]),ge=x.useCallback(F=>{const Z=I.current.find(Q=>Q.id===F);Z&&(ue.postMessage({type:"deleteCard",cardId:Z.card.id}),se(Q=>Q.filter(X=>X.id!==F)))},[]),Ee=x.useCallback(F=>{const Z=I.current.find(X=>X.id===F);if(!Z)return;const{cards:Q}=q.getState();c(Q.map(X=>X.id===Z.card.id?{...X,status:Z.originalStatus}:X)),se(X=>X.filter(_e=>_e.id!==F))},[c]),Ce=x.useCallback(()=>{const F=I.current;F.length!==0&&Ee(F[F.length-1].id)},[Ee]);x.useEffect(()=>{let F=!1,Z=null;const Q=ne=>{if(ne.key==="Alt"){F=!0,Z&&clearTimeout(Z),Z=setTimeout(()=>{F=!1},1e3);return}if(ne.altKey&&(F=!1,Z&&(clearTimeout(Z),Z=null)),ne.key==="z"&&(ne.ctrlKey||ne.metaKey)&&!ne.shiftKey&&I.current.length>0){ne.preventDefault(),Ce();return}if((ne.key==="="||ne.key==="+"||ne.key==="-")&&(ne.ctrlKey||ne.metaKey)){ne.preventDefault();const qe=ne.key==="-"?-5:5,{cardSettings:Xe}=q.getState();if(ne.shiftKey){const mt=Math.max(75,Math.min(150,Xe.cardZoom+qe));if(mt!==Xe.cardZoom){const tr={...Xe,cardZoom:mt};g(tr),ue.postMessage({type:"saveSettings",settings:tr})}}else{const mt=Math.max(75,Math.min(150,Xe.boardZoom+qe));if(mt!==Xe.boardZoom){const tr={...Xe,boardZoom:mt};g(tr),ue.postMessage({type:"saveSettings",settings:tr})}}return}if(!(ne.target instanceof HTMLInputElement||ne.target instanceof HTMLTextAreaElement||ne.target instanceof HTMLSelectElement||ne.target instanceof HTMLElement&&ne.target.isContentEditable))switch(ne.key){case"n":if(ne.ctrlKey||ne.metaKey||ne.altKey||ne.shiftKey)return;ne.preventDefault(),E("backlog"),j(!0);break;case"?":if(ne.ctrlKey||ne.metaKey||ne.altKey)return;ne.preventDefault(),W(qe=>!qe);break;case"Escape":P?W(!1):D?j(!1):q.getState().selectedCardIds.length>0&&R();break}},X=ne=>{ne.key==="Alt"&&F&&(F=!1,Z&&(clearTimeout(Z),Z=null),ue.postMessage({type:"focusMenuBar"}))},_e=()=>{F=!1};return window.addEventListener("keydown",Q),window.addEventListener("keyup",X),window.addEventListener("mousedown",_e),()=>{window.removeEventListener("keydown",Q),window.removeEventListener("keyup",X),window.removeEventListener("mousedown",_e),Z&&clearTimeout(Z)}},[D,P,Ce,g,R]),x.useEffect(()=>{const F=()=>{const Q=document.documentElement,X=document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast");p(X),Q.dataset.kbTheme=X?"dark":"light",X?Q.classList.add("dark"):Q.classList.remove("dark")};F();const Z=new MutationObserver(F);return Z.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>Z.disconnect()},[p]),x.useEffect(()=>{const F=document.documentElement;F.style.setProperty("--board-zoom",String(o.boardZoom/100)),F.style.setProperty("--card-zoom",String(o.cardZoom/100))},[o.boardZoom,o.cardZoom]),x.useEffect(()=>{const F=document.documentElement,Z=Ea(o.boardBackgroundMode,o.boardBackgroundPreset);F.dataset.kbBoardMode=Z.boardBackgroundMode,F.dataset.kbBoardPreset=Z.boardBackgroundPreset},[o.boardBackgroundMode,o.boardBackgroundPreset]),x.useEffect(()=>{const F=Z=>{const Q=Z.data;if(!(!Q||typeof Q.type!="string"))switch(Q.type){case"init":{const X=Q.cards??[];{const _e=Q.columns??[],ne=Q.currentBoard??q.getState().currentBoard,qe=_e.map(ps=>ps.id),Xe=q.getState().columnVisibilityByBoard,mt={...B.current,...Xe};if(Q.minimizedColumnIds!==void 0){const ps=mt[ne]??{hiddenColumnIds:[],minimizedColumnIds:[]};mt[ne]={...ps,minimizedColumnIds:Q.minimizedColumnIds},H.current={boardId:ne,columnIds:Q.minimizedColumnIds}}const tr=Hf(mt,ne,qe);q.setState({currentBoard:ne,columnVisibilityByBoard:tr})}me(null),c(X),ee(X),d(Q.columns??[]),Q.boards&&f(Q.boards),Q.workspace&&h(Q.workspace),Q.settings&&(Q.settings.markdownEditorMode&&J&&K(null),g(Q.settings)),Q.labels&&b(Q.labels),N(!0);break}case"connectionStatus":me(fQ(Q));break;case"cardsUpdated":c(Q.cards),ee(Q.cards);break;case"triggerCreateDialog":E("backlog"),j(!0);break;case"labelsUpdated":b(Q.labels);break;case"showSettings":g(Q.settings),y(!0);break;case"cardContent":{const{cardSettings:X}=q.getState();if(X.markdownEditorMode)break;M(Q.cardId),re.current+=1,K(_e=>({id:Q.cardId,content:Q.content,frontmatter:Q.frontmatter,comments:Q.comments||[],logs:Q.logs!==void 0?Q.logs:(_e==null?void 0:_e.id)===Q.cardId?_e.logs:[],contentVersion:re.current}));break}case"actionResult":break;case"boardActionResult":break;case"logsUpdated":{K(X=>X&&X.id===Q.cardId?{...X,logs:Q.logs}:X);break}case"boardLogsUpdated":{k(Q.logs);break}case"commentStreamStart":{K(X=>{if(!X||X.id!==Q.cardId)return X;const _e={id:Q.commentId,author:Q.author,created:Q.created,content:"",streaming:!0};return{...X,comments:[...X.comments||[],_e]}});break}case"commentChunk":{K(X=>{if(!X||X.id!==Q.cardId)return X;const _e=(X.comments||[]).map(ne=>ne.id===Q.commentId?{...ne,content:ne.content+Q.chunk}:ne);return{...X,comments:_e}});break}case"commentStreamDone":{K(X=>{if(!X||X.id!==Q.cardId)return X;const _e=(X.comments||[]).map(ne=>ne.id===Q.commentId?{...ne,streaming:!1}:ne);return{...X,comments:_e}});break}}};return window.addEventListener("message",F),ue.postMessage({type:"ready"}),()=>window.removeEventListener("message",F)},[J,c,d,f,h,g,y,b,ee]),x.useEffect(()=>{var X;if(!C)return;const F=Hf(n,r,e.map(_e=>_e.id));if(F!==n){q.setState({columnVisibilityByBoard:F});return}B.current=F,ue.setState(F);const Z=((X=F[r])==null?void 0:X.minimizedColumnIds)??[],Q=H.current;(!Q||Q.boardId!==r||!pQ(Q.columnIds,Z))&&(ue.postMessage({type:"setMinimizedColumns",boardId:r,columnIds:Z}),H.current={boardId:r,columnIds:Z})},[n,e,r,C]);const Ie=(F,Z)=>{if(Z.metaKey||Z.ctrlKey){const X=[...q.getState().selectedCardIds];J&&!X.includes(J.id)&&X.push(J.id);const _e=X.indexOf(F.id);_e>=0?X.splice(_e,1):X.push(F.id),q.setState({selectedCardIds:X,lastClickedCardId:F.id}),J&&K(null);return}if(Z.shiftKey){if(J&&!q.getState().lastClickedCardId){const Q=q.getState().selectedCardIds,X=Q.includes(J.id)?[...Q]:[...Q,J.id];q.setState({selectedCardIds:X,lastClickedCardId:J.id})}w(F.id),J&&K(null);return}R(),ue.postMessage({type:"openCard",cardId:F.id})},Ge=(F,Z)=>{J&&ue.postMessage({type:"saveCardContent",cardId:J.id,content:F,frontmatter:Z})},it=(F,Z)=>{J&&(ue.postMessage({type:"transferCard",cardId:J.id,toBoard:F,targetStatus:Z}),K(null),M(null))},wt=()=>{K(null),M(null),ue.postMessage({type:"closeCard"})},kt=()=>{J&&de(J.id)},xe=()=>{J&&(ue.postMessage({type:"permanentDeleteCard",cardId:J.id}),K(null),M(null))},Se=()=>{J&&(ue.postMessage({type:"restoreCard",cardId:J.id}),K(null),M(null))},We=()=>{ue.postMessage({type:"purgeDeletedCards"})},pt=()=>{J&&ue.postMessage({type:"openFile",cardId:J.id})},is=F=>{ue.postMessage({type:"openMetadataFile",path:F})},pn=()=>{J&&ue.postMessage({type:"downloadCard",cardId:J.id})},mn=(F,Z)=>{ue.postMessage({type:"startWithAI",agent:F,permissionMode:Z})},ls=()=>{J&&ue.postMessage({type:"addAttachment",cardId:J.id})},cs=F=>{J&&ue.postMessage({type:"openAttachment",cardId:J.id,attachment:F})},gn=F=>{J&&ue.postMessage({type:"removeAttachment",cardId:J.id,attachment:F})},us=(F,Z)=>{J&&ue.postMessage({type:"addComment",cardId:J.id,author:F,content:Z})},vn=(F,Z)=>{J&&ue.postMessage({type:"updateComment",cardId:J.id,commentId:F,content:Z})},ds=F=>{J&&ue.postMessage({type:"deleteComment",cardId:J.id,commentId:F})},jo=()=>{J&&ue.postMessage({type:"clearLogs",cardId:J.id})},Eo=()=>{A?Y(!1):(Y(!0),ue.postMessage({type:"getBoardLogs"}))},Ao=()=>{ue.postMessage({type:"clearBoardLogs"})},fs=F=>{ue.postMessage({type:"saveSettings",settings:F})},yn=x.useCallback(F=>{m(F)},[m]),No=x.useCallback(F=>{v();const Z={...q.getState().cardSettings,drawerWidth:F};g(Z),fs(Z)},[v,g]),hs=x.useCallback(()=>{v()},[v]),Po=()=>{O(null),L(!0)},Oi=F=>{const Z=e.find(Q=>Q.id===F);Z&&(O(Z),L(!0))},Ro=F=>{!e.find(X=>X.id===F)||q.getState().cards.filter(X=>X.status===F).length>0||ue.postMessage({type:"removeColumn",columnId:F})},To=F=>{!e.find(X=>X.id===F)||q.getState().cards.filter(X=>X.status===F).length===0||ue.postMessage({type:"cleanupColumn",columnId:F})},Io=x.useCallback(F=>{const Z=q.getState().columns;d(F.map(Q=>Z.find(X=>X.id===Q)).filter(Q=>Q!=null)),ue.postMessage({type:"reorderColumns",columnIds:F})},[d]),Mo=F=>{V?ue.postMessage({type:"editColumn",columnId:V.id,updates:F}):ue.postMessage({type:"addColumn",column:F}),L(!1),O(null)},T=F=>{E(F),j(!0)},ve=x.useCallback(F=>{const Z=Array.from(q.getState().selectedCardIds);for(const X of Z)ue.postMessage({type:"moveCard",cardId:X,newStatus:F,newOrder:-1});const{cards:Q}=q.getState();c(Q.map(X=>Z.includes(X.id)?{...X,status:F}:X)),R()},[c,R]),er=x.useCallback(F=>{const Z=Array.from(q.getState().selectedCardIds);for(const X of Z)ue.postMessage({type:"bulkUpdateCard",cardId:X,updates:{priority:F}});const{cards:Q}=q.getState();c(Q.map(X=>Z.includes(X.id)?{...X,priority:F}:X)),R()},[c,R]),Di=x.useCallback(F=>{const Z=Array.from(q.getState().selectedCardIds);for(const X of Z)ue.postMessage({type:"bulkUpdateCard",cardId:X,updates:{assignee:F}});const{cards:Q}=q.getState();c(Q.map(X=>Z.includes(X.id)?{...X,assignee:F}:X)),R()},[c,R]),Gx=x.useCallback((F,Z)=>{const Q=Array.from(q.getState().selectedCardIds),{cards:X}=q.getState();for(const _e of Q){const ne=X.find(Xe=>Xe.id===_e);if(!ne)continue;const qe=Array.from(new Set([...ne.labels,...F])).filter(Xe=>!Z.includes(Xe));ue.postMessage({type:"bulkUpdateCard",cardId:_e,updates:{labels:qe}})}c(X.map(_e=>{if(!Q.includes(_e.id))return _e;const ne=Array.from(new Set([..._e.labels,...F])).filter(qe=>!Z.includes(qe));return{..._e,labels:ne}})),R()},[c,R]),qx=x.useCallback(()=>{const F=Array.from(q.getState().selectedCardIds);for(const Z of F)de(Z);R()},[de,R]),Yx=x.useCallback((F,Z)=>{for(const X of F)ue.postMessage({type:"moveCard",cardId:X,newStatus:Z,newOrder:-1});const{cards:Q}=q.getState();c(Q.map(X=>F.includes(X.id)?{...X,status:Z}:X)),R()},[c,R]),uf=F=>{ue.postMessage({type:"createCard",data:F})},Jx=x.useCallback(F=>{if(!J)return;const Z=`action-${Date.now()}`;ue.postMessage({type:"triggerAction",cardId:J.id,action:F,callbackKey:Z})},[J]),Zx=x.useCallback((F,Z)=>{const Q=`action-${Date.now()}`;ue.postMessage({type:"triggerAction",cardId:F,action:Z,callbackKey:Q})},[]),Qx=x.useCallback((F,Z)=>{const Q=`board-action-${Date.now()}`;ue.postMessage({type:"triggerBoardAction",boardId:F,actionKey:Z,callbackKey:Q})},[]),Xx=(F,Z,Q)=>{const{cards:X}=q.getState();if(X.find(ne=>ne.id===F)){const ne=X.filter(rr=>rr.status===Z&&rr.id!==F).sort((rr,ff)=>rr.order<ff.order?-1:rr.order>ff.order?1:0),qe=Math.max(0,Math.min(Q,ne.length)),Xe=qe>0?ne[qe-1].order:null,mt=qe<ne.length?ne[qe].order:null,tr=Yk(Xe,mt),ps=X.map(rr=>rr.id===F?{...rr,status:Z,order:tr}:rr);c(ps)}ue.postMessage({type:"moveCard",cardId:F,newStatus:Z,newOrder:Q})},e1=x.useCallback(F=>{uf({...F,assignee:null,dueDate:null,labels:[],actions:[]})},[]);return e.length===0?l.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--vscode-editor-background)]",children:l.jsx("div",{className:"text-[var(--vscode-foreground)] opacity-60",children:"Loading..."})}):l.jsxs("div",{className:"h-full w-full flex flex-col bg-[var(--vscode-editor-background)]",children:[l.jsx(GZ,{onOpenSettings:()=>ue.postMessage({type:"openSettings"}),onAddColumn:Po,onCreateCard:()=>{E(o.defaultStatus||"backlog"),j(!0)},onToggleTheme:()=>ue.postMessage({type:"toggleTheme"}),onSwitchBoard:F=>ue.postMessage({type:"switchBoard",boardId:F}),onCreateBoard:F=>ue.postMessage({type:"createBoard",name:F}),onOpenBoardLogs:Eo,boardLogsOpen:A,onTriggerBoardAction:Qx,onOpenShortcutHelp:()=>W(F=>!F)}),l.jsxs("div",{className:"kb-board-stage flex-1 flex overflow-hidden",children:[l.jsx("div",{className:"board-zoom-scope w-full min-w-0",style:(o.panelMode??"drawer")==="drawer"&&u.length===0&&(J!==null||A)?{width:`${100-a}%`}:void 0,children:l.jsx(i$,{onCardClick:Ie,onAddCard:T,onMoveCard:Xx,onMoveCards:Yx,onEditColumn:Oi,onRemoveColumn:Ro,onCleanupColumn:To,onReorderColumns:Io,onPurgeDeletedCards:We,selectedCardId:J==null?void 0:J.id,selectedCardIds:u,onSelectAll:$,onQuickAdd:e1,onTriggerAction:Zx})}),A&&u.length===0&&!J&&(()=>{const F=(o.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-40 flex ${F?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!F&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>Y(!1)}),l.jsxs("div",{className:F?"relative h-full flex flex-col shadow-xl animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] flex flex-col rounded-xl shadow-xl animate-in zoom-in-95 fade-in duration-200",style:F?{width:`${a}%`,background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"}:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},...F?{"data-panel-drawer":""}:{},children:[l.jsx(Xa,{panelMode:F?"drawer":"popup",onPreview:yn,onCommit:No,onCancel:hs}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-2",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("span",{className:"text-sm font-medium",style:{color:"var(--vscode-foreground)"},children:"Board Logs"}),l.jsx("button",{onClick:()=>Y(!1),className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:Z=>Z.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:Z=>Z.currentTarget.style.background="transparent",title:"Close board logs",children:"✕"})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:l.jsx(D0,{logs:z,onClearLogs:Ao})})]})]})})(),J&&u.length===0&&(()=>{const F=(o.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-40 flex ${F?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!F&&l.jsx("div",{className:"absolute inset-0 card-view-modal-backdrop",onClick:wt}),l.jsxs("div",{className:F?"relative h-full flex flex-col shadow-xl overflow-hidden animate-in slide-in-from-right duration-200 pointer-events-auto card-view-shell card-view-shell--drawer":"relative w-full max-w-none h-[90vh] flex flex-col rounded-xl shadow-xl overflow-hidden animate-in zoom-in-95 fade-in duration-200 card-view-shell card-view-shell--popup",style:{fontSize:"calc(1em * var(--card-zoom, 1))",...F?{width:`${a}%`}:{}},...F?{"data-panel-drawer":""}:{},children:[l.jsx(Xa,{panelMode:F?"drawer":"popup",onPreview:yn,onCommit:No,onCancel:hs}),l.jsx(VZ,{cardId:J.id,content:J.content,frontmatter:J.frontmatter,comments:J.comments,contentVersion:J.contentVersion,onSave:Ge,onClose:wt,onDelete:kt,onPermanentDelete:xe,onRestore:Se,onOpenFile:pt,onOpenMetadataFile:is,onDownloadCard:pn,onStartWithAI:mn,onAddAttachment:ls,onOpenAttachment:cs,onRemoveAttachment:gn,onAddComment:us,onUpdateComment:vn,onDeleteComment:ds,onTransferToBoard:it,onTriggerAction:Jx,logs:J.logs,onClearLogs:jo,logsFilter:o.logsFilter,onLogsFilterChange:Z=>{const Q={...o,logsFilter:Z};g(Q),ue.postMessage({type:"saveSettings",settings:Q})}})]})]})})()]}),u.length>1&&l.jsx(iQ,{selectedCount:u.length,onClearSelection:R,onMoveToColumn:ve,onSetPriority:er,onSetAssignee:Di,onApplyLabels:Gx,onDelete:qx}),l.jsx(SZ,{isOpen:D,onClose:()=>j(!1),onCreate:uf,initialStatus:S,onSaveSettings:fs}),l.jsx(QZ,{isOpen:i,settings:o,workspace:s,onClose:()=>y(!1),onSave:fs,onSetLabel:(F,Z)=>ue.postMessage({type:"setLabel",name:F,definition:Z}),onRenameLabel:(F,Z)=>ue.postMessage({type:"renameLabel",oldName:F,newName:Z}),onDeleteLabel:F=>ue.postMessage({type:"deleteLabel",name:F})}),l.jsx(nQ,{isOpen:G,onClose:()=>{L(!1),O(null)},onSave:Mo,initial:V?{name:V.name,color:V.color}:void 0,title:V?"Edit List":"Add List"}),le&&l.jsx(Um,{title:le.title,message:le.message,persistent:!0,tone:le.tone,index:0}),te.map((F,Z)=>l.jsx(Um,{message:`Deleted "${Zg(F.card.content,F.card.metadata,ae)}"`,onUndo:()=>Ee(F.id),onExpire:()=>ge(F.id),duration:5e3,index:le?Z+1:Z},F.id)),l.jsx(uQ,{isOpen:P,onClose:()=>W(!1)})]})}function vQ(e){return e!=="http:"&&e!=="https:"}function Ur(e){if(typeof e=="string")return e;if(typeof e=="boolean")return String(e)}function yQ(e){var r;const t=(r=Ur(e))==null?void 0:r.trim().replace(/^"(.*)"$/,"$1").toLowerCase();if(t==="true")return!0;if(t==="false")return!1}function lf(e){return{priority:Ur(e.priority),labels:Ur(e.labels),assignee:Ur(e.assignee),dueDate:Ur(e.dueDate),q:Ur(e.q),fuzzy:Ur(e.fuzzy)}}function Km(e){return JSON.stringify({...e.priority&&{priority:e.priority},...e.labels&&{labels:e.labels},...e.assignee&&{assignee:e.assignee},...e.dueDate&&{dueDate:e.dueDate},...e.q&&{q:e.q},...e.fuzzy&&{fuzzy:e.fuzzy}})}const Hm=af(),bQ=["critical","high","medium","low"],xQ=["overdue","today","this-week","no-date"];function wQ(){const e=ci(),t=ii({strict:!1}),r=li({strict:!1}),{setPriorityFilter:n,setAssigneeFilter:s,setLabelFilter:o,setDueDateFilter:a,setSearchQuery:i,setFuzzySearch:u,setActiveCardTab:c}=q.getState(),d=q(S=>S.columns),f=q(S=>S.currentBoard),p=q(S=>S.activeCardId),h=q(S=>S.activeCardTab),g=q(S=>S.priorityFilter),m=q(S=>S.assigneeFilter),v=q(S=>S.labelFilter),y=q(S=>S.dueDateFilter),b=q(S=>S.searchQuery),_=q(S=>S.fuzzySearch),w=q.getState(),$=x.useRef({board:t.boardId??w.currentBoard,cardId:"",tab:Sn(t.tabId??w.activeCardTab),searchStr:Km(r)}),R=x.useRef(!1),M=x.useRef(t.cardId??null);x.useEffect(()=>{if(R.current)return;R.current=!0,r.priority&&bQ.includes(r.priority)&&n(r.priority),r.labels&&o(r.labels.split(",").filter(Boolean)),r.assignee&&s(r.assignee),r.dueDate&&xQ.includes(r.dueDate)&&a(r.dueDate),r.q&&i(decodeURIComponent(r.q));const S=yQ(r.fuzzy);S!==void 0&&u(S),t.tabId&&t0(t.tabId)&&c(t.tabId),t.boardId&&Hm.postMessage({type:"switchBoard",boardId:t.boardId})},[]);const D=x.useRef(!1);x.useEffect(()=>{D.current||d.length===0||(D.current=!0,M.current&&(Hm.postMessage({type:"openCard",cardId:M.current}),M.current=null))},[d]);const j=x.useRef(!0);return x.useEffect(()=>{if(d.length===0)return;const S={};g!=="all"&&(S.priority=g),v.length>0&&(S.labels=v.join(",")),m!=="all"&&(S.assignee=m),y!=="all"&&(S.dueDate=y),b&&(S.q=b),_&&(S.fuzzy="true");const E=Km(S),P=$.current,W=P.board!==f,G=P.cardId!==(p??""),L=!!p&&P.tab!==h,V=P.searchStr!==E;if(!W&&!G&&!L&&!V)return;$.current={board:f,cardId:p??"",tab:h,searchStr:E};const O=j.current||!W&&!G&&!L&&V;j.current=!1,e(p?{to:"/$boardId/$cardId/$tabId",params:{boardId:f,cardId:p,tabId:h},search:S,replace:O}:{to:"/$boardId",params:{boardId:f},search:S,replace:O})},[d.length,f,p,h,g,m,v,y,b,_,e]),null}function kQ(){return l.jsxs(l.Fragment,{children:[l.jsx(gQ,{}),l.jsx(wQ,{}),l.jsx(ui,{})]})}const cf=Mk({component:kQ,notFoundComponent:()=>null}),_Q=oo({getParentRoute:()=>cf,path:"/",component:()=>null}),Kx=oo({getParentRoute:()=>cf,path:"$boardId",validateSearch:lf,component:()=>l.jsx(ui,{})}),Hx=oo({getParentRoute:()=>Kx,path:"$cardId",validateSearch:lf,component:()=>l.jsx(ui,{})}),CQ=oo({getParentRoute:()=>Hx,path:"$tabId",validateSearch:lf,component:()=>null}),$Q=cf.addChildren([_Q,Kx.addChildren([Hx.addChildren([CQ])])]),SQ=Vk({routeTree:$Q,history:vQ(window.location.protocol)?Z1({initialEntries:["/"]}):void 0,defaultPreload:"intent"});cg(document.getElementById("root")).render(l.jsx(x.StrictMode,{children:l.jsx(Hk,{router:SQ})}));
133
133
  //# sourceMappingURL=index.js.map