studiograph 1.3.44-next.20 → 1.3.44-next.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/web/_app/immutable/assets/4.B3dbj90y.css +1 -0
  2. package/dist/web/_app/immutable/chunks/{BC12QVnT.js → 1BE_eYuA.js} +1 -1
  3. package/dist/web/_app/immutable/chunks/{B0qTqRR8.js → B1c_qzmY.js} +1 -1
  4. package/dist/web/_app/immutable/chunks/{CieeblIr.js → BKHfe9E-.js} +1 -1
  5. package/dist/web/_app/immutable/chunks/{DxO4848T.js → BN6gr1HX.js} +1 -1
  6. package/dist/web/_app/immutable/chunks/{CDFdgZ9U.js → BVhp5b7F.js} +1 -1
  7. package/dist/web/_app/immutable/chunks/{DtsqpIgr.js → BZ2Q53D5.js} +1 -1
  8. package/dist/web/_app/immutable/chunks/{BoQu2xcr.js → BdNoKWAr.js} +2 -2
  9. package/dist/web/_app/immutable/chunks/{BjAmYrTY.js → BgRr0V7g.js} +1 -1
  10. package/dist/web/_app/immutable/chunks/{h2NtTN7K.js → BpdrS9kL.js} +1 -1
  11. package/dist/web/_app/immutable/chunks/{C3RWu-3l.js → BzjUB_Ym.js} +1 -1
  12. package/dist/web/_app/immutable/chunks/{D9gozPE-.js → C1S8fyYX.js} +1 -1
  13. package/dist/web/_app/immutable/chunks/{DwG0Us6L.js → C74mA5aC.js} +1 -1
  14. package/dist/web/_app/immutable/chunks/{BenpwI6m.js → CCA2E2CK.js} +1 -1
  15. package/dist/web/_app/immutable/chunks/{DgjlIhdd.js → Ca2kuiZq.js} +1 -1
  16. package/dist/web/_app/immutable/chunks/{DC1nGnOD.js → CwUXqlAx.js} +1 -1
  17. package/dist/web/_app/immutable/chunks/{BasUgd5N.js → CwnWYvfz.js} +1 -1
  18. package/dist/web/_app/immutable/chunks/{Bm1eIWxg.js → D-H9HeD_.js} +1 -1
  19. package/dist/web/_app/immutable/chunks/{DAD7hf2c.js → D8mTIH9Y.js} +1 -1
  20. package/dist/web/_app/immutable/chunks/{DN_2uSjw.js → DD3_vCgV.js} +1 -1
  21. package/dist/web/_app/immutable/chunks/{wWaI7EIw.js → DHholpIc.js} +1 -1
  22. package/dist/web/_app/immutable/chunks/{BSBiehHY.js → DIBaaeCL.js} +1 -1
  23. package/dist/web/_app/immutable/chunks/{owhS8Kw_.js → DLZAjAct.js} +1 -1
  24. package/dist/web/_app/immutable/chunks/{B17cx9Sm.js → DO03XMS-.js} +1 -1
  25. package/dist/web/_app/immutable/chunks/{DkyV2KO_.js → DYLAPjKD.js} +1 -1
  26. package/dist/web/_app/immutable/chunks/{D4U_ZqJF.js → DeyUjeaz.js} +1 -1
  27. package/dist/web/_app/immutable/chunks/{CLw5zKi0.js → Dgs7g6Xf.js} +1 -1
  28. package/dist/web/_app/immutable/chunks/{CStpN6HQ.js → DkuxRPZv.js} +1 -1
  29. package/dist/web/_app/immutable/chunks/{ujukzxos.js → Mtmwulo1.js} +1 -1
  30. package/dist/web/_app/immutable/chunks/{CbwDFpOn.js → NuvuAeCX.js} +1 -1
  31. package/dist/web/_app/immutable/chunks/{CJdAJOAi.js → csGnu8Rb.js} +1 -1
  32. package/dist/web/_app/immutable/chunks/e8QVPHqJ.js +5 -0
  33. package/dist/web/_app/immutable/chunks/{OFOivmhv.js → oz3vOf3Y.js} +1 -1
  34. package/dist/web/_app/immutable/chunks/{CyzLSh3b.js → pQmxOXKv.js} +1 -1
  35. package/dist/web/_app/immutable/chunks/{COik51fd.js → usxM-xOh.js} +1 -1
  36. package/dist/web/_app/immutable/chunks/{DUemNi3j.js → y7AXCX7T.js} +1 -1
  37. package/dist/web/_app/immutable/chunks/{Dvv4bkXH.js → yUs562n0.js} +1 -1
  38. package/dist/web/_app/immutable/entry/{app.CU7TLhrM.js → app.Ci1ytk_v.js} +2 -2
  39. package/dist/web/_app/immutable/entry/start.DNk71wbw.js +1 -0
  40. package/dist/web/_app/immutable/nodes/{0.BDvk9PGI.js → 0.D4NmzO9T.js} +2 -2
  41. package/dist/web/_app/immutable/nodes/{1.BIyCV821.js → 1.B49NrV3g.js} +1 -1
  42. package/dist/web/_app/immutable/nodes/{10.B1u2MAJO.js → 10.OXZpT8w9.js} +1 -1
  43. package/dist/web/_app/immutable/nodes/{2.BTUKEVj1.js → 2.DaqdIYKU.js} +2 -2
  44. package/dist/web/_app/immutable/nodes/{3.B_Uwqq0c.js → 3.Q_RC4D9P.js} +1 -1
  45. package/dist/web/_app/immutable/nodes/4.CIDSQYhF.js +11 -0
  46. package/dist/web/_app/immutable/nodes/{5.CexWzcG1.js → 5.U-zEu0Mw.js} +1 -1
  47. package/dist/web/_app/immutable/nodes/{6.BzUiTkSF.js → 6.SYsyu9GD.js} +1 -1
  48. package/dist/web/_app/immutable/nodes/{7.CGDU7sfE.js → 7.BLgQGI-C.js} +1 -1
  49. package/dist/web/_app/immutable/nodes/{8.Cd-elUzW.js → 8.67Laxdj-.js} +1 -1
  50. package/dist/web/_app/immutable/nodes/{9.5wb2zwiT.js → 9.D0aRCiZD.js} +1 -1
  51. package/dist/web/_app/version.json +1 -1
  52. package/dist/web/index.html +11 -11
  53. package/package.json +1 -1
  54. package/dist/web/_app/immutable/assets/4.BZP82sm4.css +0 -1
  55. package/dist/web/_app/immutable/chunks/DkilSMcP.js +0 -5
  56. package/dist/web/_app/immutable/entry/start.DgZDAZcw.js +0 -1
  57. package/dist/web/_app/immutable/nodes/4.BvQu9TFK.js +0 -11
@@ -1,5 +0,0 @@
1
- import{l as Qn,o as V,c as M,a as C,p as Ht,b as ct,m as io,u as so}from"./COik51fd.js";import{aM as ao,j as co,q as uo,bx as lo,i as fo,e as T,by as Pn,N as ho,g as l,s as y,aZ as Zt,a4 as x,f as Bt,aX as go,a1 as Tn,aW as po,a6 as mo,a2 as Z,a7 as Ve,aE as vo,p as k,a0 as P,b as N,ae as L,c as St,r as At,bz as yo,bA as $n,a3 as ge,aD as bo}from"./BenpwI6m.js";import{s as D,a as Ot}from"./CStpN6HQ.js";import{p as v,r as W,s as J}from"./wWaI7EIw.js";import{B as wo,i as nt,b as tr}from"./Dvv4bkXH.js";import{c as Et}from"./CbwDFpOn.js";import{c as Ct,a as er}from"./DAD7hf2c.js";import{b as Be}from"./CieeblIr.js";function xo(){return Symbol(ao)}const So=Symbol("NaN");function Ao(e,t,n){co&&uo();var r=new wo(e),o=!lo();fo(()=>{var s=t();s!==s&&(s=So),o&&s!==null&&typeof s=="object"&&(s={}),r.ensure(s,n)})}class Oo extends Map{#t=new Map;#e=T(0);#n=T(0);#r=Pn||-1;constructor(t){if(super(),t){for(var[n,r]of t)super.set(n,r);this.#n.v=super.size}}#o(t){return Pn===this.#r?T(t):ho(t)}has(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#o(0),n.set(t,r);else return l(this.#e),!1;return l(r),!0}forEach(t,n){this.#i(),super.forEach(t,n)}get(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#o(0),n.set(t,r);else{l(this.#e);return}return l(r),super.get(t)}set(t,n){var r=this.#t,o=r.get(t),s=super.get(t),i=super.set(t,n),a=this.#e;if(o===void 0)o=this.#o(0),r.set(t,o),y(this.#n,super.size),Zt(a);else if(s!==n){Zt(o);var c=a.reactions===null?null:new Set(a.reactions),u=c===null||!o.reactions?.every(h=>c.has(h));u&&Zt(a)}return i}delete(t){var n=this.#t,r=n.get(t),o=super.delete(t);return r!==void 0&&(n.delete(t),y(r,-1)),o&&(y(this.#n,super.size),Zt(this.#e)),o}clear(){if(super.size!==0){super.clear();var t=this.#t;y(this.#n,0);for(var n of t.values())y(n,-1);Zt(this.#e),t.clear()}}#i(){l(this.#e);var t=this.#t;if(this.#n.v!==t.size){for(var n of super.keys())if(!t.has(n)){var r=this.#o(0);t.set(n,r)}}for([,r]of this.#t)l(r)}keys(){return l(this.#e),super.keys()}values(){return this.#i(),super.values()}entries(){return this.#i(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return l(this.#n),super.size}}function Eo(e){return typeof e=="function"}function oe(e){return e!==null&&typeof e=="object"}const Co=["string","number","bigint","boolean"];function ze(e){return e==null||Co.includes(typeof e)?!0:Array.isArray(e)?e.every(t=>ze(t)):typeof e=="object"?Object.getPrototypeOf(e)===Object.prototype:!1}const Wt=Symbol("box"),Me=Symbol("is-writable");function w(e,t){const n=x(e);return t?{[Wt]:!0,[Me]:!0,get current(){return l(n)},set current(r){t(r)}}:{[Wt]:!0,get current(){return e()}}}function ie(e){return oe(e)&&Wt in e}function Je(e){return ie(e)&&Me in e}function nr(e){return ie(e)?e:Eo(e)?w(e):ut(e)}function Po(e){return Object.entries(e).reduce((t,[n,r])=>ie(r)?(Je(r)?Object.defineProperty(t,n,{get(){return r.current},set(o){r.current=o}}):Object.defineProperty(t,n,{get(){return r.current}}),t):Object.assign(t,{[n]:r}),{})}function To(e){return Je(e)?{[Wt]:!0,get current(){return e.current}}:e}function ut(e){let t=T(Bt(e));return{[Wt]:!0,[Me]:!0,get current(){return l(t)},set current(n){y(t,n,!0)}}}function Dt(e){let t=T(Bt(e));return{[Wt]:!0,[Me]:!0,get current(){return l(t)},set current(n){y(t,n,!0)}}}Dt.from=nr;Dt.with=w;Dt.flatten=Po;Dt.readonly=To;Dt.isBox=ie;Dt.isWritableBox=Je;function rr(...e){return function(t){for(const n of e)if(n){if(t.defaultPrevented)return;typeof n=="function"?n.call(this,t):n.current?.call(this,t)}}}var Mn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Mo=/\n/g,Fo=/^\s*/,Io=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ro=/^:\s*/,ko=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,No=/^[;\s]*/,Do=/^\s+|\s+$/g,_o=`
2
- `,Fn="/",In="*",It="",Bo="comment",Lo="declaration";function Wo(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(g){var p=g.match(Mo);p&&(n+=p.length);var b=g.lastIndexOf(_o);r=~b?g.length-b:r+g.length}function s(){var g={line:n,column:r};return function(p){return p.position=new i(g),u(),p}}function i(g){this.start=g,this.end={line:n,column:r},this.source=t.source}i.prototype.content=e;function a(g){var p=new Error(t.source+":"+n+":"+r+": "+g);if(p.reason=g,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function c(g){var p=g.exec(e);if(p){var b=p[0];return o(b),e=e.slice(b.length),p}}function u(){c(Fo)}function h(g){var p;for(g=g||[];p=d();)p!==!1&&g.push(p);return g}function d(){var g=s();if(!(Fn!=e.charAt(0)||In!=e.charAt(1))){for(var p=2;It!=e.charAt(p)&&(In!=e.charAt(p)||Fn!=e.charAt(p+1));)++p;if(p+=2,It===e.charAt(p-1))return a("End of comment missing");var b=e.slice(2,p-2);return r+=2,o(b),e=e.slice(p),r+=2,g({type:Bo,comment:b})}}function m(){var g=s(),p=c(Io);if(p){if(d(),!c(Ro))return a("property missing ':'");var b=c(ko),S=g({type:Lo,property:Rn(p[0].replace(Mn,It)),value:b?Rn(b[0].replace(Mn,It)):It});return c(No),S}}function f(){var g=[];h(g);for(var p;p=m();)p!==!1&&(g.push(p),h(g));return g}return u(),f()}function Rn(e){return e?e.replace(Do,It):It}function Ko(e,t){let n=null;if(!e||typeof e!="string")return n;const r=Wo(e),o=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:i,value:a}=s;o?t(i,a,s):a&&(n=n||{},n[i]=a)}),n}const Vo=/\d/,zo=["-","_","/","."];function Ho(e=""){if(!Vo.test(e))return e!==e.toLowerCase()}function jo(e){const t=[];let n="",r,o;for(const s of e){const i=zo.includes(s);if(i===!0){t.push(n),n="",r=void 0;continue}const a=Ho(s);if(o===!1){if(r===!1&&a===!0){t.push(n),n=s,r=a;continue}if(r===!0&&a===!1&&n.length>1){const c=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=c+s,r=a;continue}}n+=s,r=a,o=i}return t.push(n),t}function or(e){return e?jo(e).map(t=>Go(t)).join(""):""}function Uo(e){return Yo(or(e||""))}function Go(e){return e?e[0].toUpperCase()+e.slice(1):""}function Yo(e){return e?e[0].toLowerCase()+e.slice(1):""}function te(e){if(!e)return{};const t={};function n(r,o){if(r.startsWith("-moz-")||r.startsWith("-webkit-")||r.startsWith("-ms-")||r.startsWith("-o-")){t[or(r)]=o;return}if(r.startsWith("--")){t[r]=o;return}t[Uo(r)]=o}return Ko(e,n),t}function Rt(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}function Xo(e,t){const n=RegExp(e,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(n)?r.replace(n,t):r}}const qo=Xo(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Zo(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${qo(t)}: ${e[t]};`).join(`
3
- `)}function ir(e={}){return Zo(e).replace(`
4
- `," ")}const Jo=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],Qo=new Set(Jo);function $o(e){return Qo.has(e)}function tt(...e){const t={...e[0]};for(let n=1;n<e.length;n++){const r=e[n];if(r){for(const o of Object.keys(r)){const s=t[o],i=r[o],a=typeof s=="function",c=typeof i=="function";if(a&&$o(o)){const u=s,h=i;t[o]=rr(u,h)}else if(a&&c)t[o]=Rt(s,i);else if(o==="class"){const u=ze(s),h=ze(i);u&&h?t[o]=Be(s,i):u?t[o]=Be(s):h&&(t[o]=Be(i))}else if(o==="style"){const u=typeof s=="object",h=typeof i=="object",d=typeof s=="string",m=typeof i=="string";if(u&&h)t[o]={...s,...i};else if(u&&m){const f=te(i);t[o]={...s,...f}}else if(d&&h){const f=te(s);t[o]={...f,...i}}else if(d&&m){const f=te(s),g=te(i);t[o]={...f,...g}}else u?t[o]=s:h?t[o]=i:d?t[o]=s:m&&(t[o]=i)}else t[o]=i!==void 0?i:s}for(const o of Object.getOwnPropertySymbols(r)){const s=t[o],i=r[o];t[o]=i!==void 0?i:s}}}return typeof t.style=="object"&&(t.style=ir(t.style).replaceAll(`
5
- `," ")),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}const sr=typeof window<"u"?window:void 0;function ti(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class ei{#t;#e;constructor(t={}){const{window:n=sr,document:r=n?.document}=t;n!==void 0&&(this.#t=r,this.#e=Qn(o=>{const s=V(n,"focusin",o),i=V(n,"focusout",o);return()=>{s(),i()}}))}get current(){return this.#e?.(),this.#t?ti(this.#t):null}}new ei;function ni(e){return typeof e=="function"}class Pt{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return go(this.#e)}get(){const t=Tn(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const n=Tn(this.#e);return n===void 0?t:n}set(t){return po(this.#e,t)}}function ri(e,t){switch(e){case"post":Z(t);break;case"pre":mo(t);break}}function ar(e,t,n,r={}){const{lazy:o=!1}=r;let s=!o,i=Array.isArray(e)?[]:void 0;ri(t,()=>{const a=Array.isArray(e)?e.map(u=>u()):e();if(!s){s=!0,i=a;return}const c=Ve(()=>n(a,i));return i=a,c})}function H(e,t,n){ar(e,"post",t,n)}function oi(e,t,n){ar(e,"pre",t,n)}H.pre=oi;function kn(e){return ni(e)?e():e}class ii{#t={width:0,height:0};#e=!1;#n;#r;#o;#i=x(()=>(l(this.#s)?.(),this.getSize().width));#a=x(()=>(l(this.#s)?.(),this.getSize().height));#s=x(()=>{const t=kn(this.#r);if(t)return Qn(n=>{if(!this.#o)return;const r=new this.#o.ResizeObserver(o=>{this.#e=!0;for(const s of o){const i=this.#n.box==="content-box"?s.contentBoxSize:s.borderBoxSize,a=Array.isArray(i)?i:[i];this.#t.width=a.reduce((c,u)=>Math.max(c,u.inlineSize),0),this.#t.height=a.reduce((c,u)=>Math.max(c,u.blockSize),0)}n()});return r.observe(t),()=>{this.#e=!1,r.disconnect()}})});constructor(t,n={box:"border-box"}){this.#o=n.window??sr,this.#n=n,this.#r=t,this.#t={width:0,height:0}}calculateSize(){const t=kn(this.#r);if(!t||!this.#o)return;const n=t.offsetWidth,r=t.offsetHeight;if(this.#n.box==="border-box")return{width:n,height:r};const o=this.#o.getComputedStyle(t),s=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),i=parseFloat(o.paddingTop)+parseFloat(o.paddingBottom),a=parseFloat(o.borderLeftWidth)+parseFloat(o.borderRightWidth),c=parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth),u=n-s-a,h=r-i-c;return{width:u,height:h}}getSize(){return this.#e?this.#t:this.calculateSize()??this.#t}get current(){return l(this.#s)?.(),this.getSize()}get width(){return l(this.#i)}get height(){return l(this.#a)}}function _t(e){Z(()=>()=>{e()})}function cr(e,t){return setTimeout(t,e)}function lt(e){vo().then(e)}const si=1,ai=9,ci=11;function He(e){return oe(e)&&e.nodeType===si&&typeof e.nodeName=="string"}function ur(e){return oe(e)&&e.nodeType===ai}function ui(e){return oe(e)&&e.constructor?.name==="VisualViewport"}function li(e){return oe(e)&&e.nodeType!==void 0}function lr(e){return li(e)&&e.nodeType===ci&&"host"in e}function di(e,t){if(!e||!t||!He(e)||!He(t))return!1;const n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&lr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function se(e){return ur(e)?e:ui(e)?e.document:e?.ownerDocument??document}function Qe(e){return lr(e)?Qe(e.host):ur(e)?e.defaultView??window:He(e)?e.ownerDocument?.defaultView??window:window}function fi(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class $e{element;#t=x(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return l(this.#t)}set root(t){y(this.#t,t)}constructor(t){typeof t=="function"?this.element=w(t):this.element=t}getDocument=()=>se(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>fi(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,n)=>this.getWindow().setTimeout(t,n);clearTimeout=t=>this.getWindow().clearTimeout(t)}function Q(e,t){return{[xo()]:n=>ie(e)?(e.current=n,Ve(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),Ve(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e(null),t?.(null))})}}function tn(e){return e?"true":"false"}function Kt(e){return e?"":void 0}function fc(e){return e?!0:void 0}function Fe(e){return e?"open":"closed"}function hc(e,t){return t?"mixed":e?"true":"false"}class hi{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(n=>[n,this.getAttr(n)]))}getAttr(t,n){return n?`data-${n}-${t}`:`${this.#e}${t}`}selector(t,n){return`[${this.getAttr(t,n)}]`}}function dr(e){const t=new hi(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const ne="ArrowDown",ae="ArrowLeft",ce="ArrowRight",pe="ArrowUp",fr="End",Ie="Enter",gi="Escape",hr="Home",pi="PageDown",mi="PageUp",jt=" ",vi="Tab";function yi(e){return window.getComputedStyle(e).getPropertyValue("direction")}function bi(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?ae:ce,vertical:ne}[t]}function wi(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?ce:ae,vertical:pe}[t]}function xi(e="ltr",t="horizontal"){return["ltr","rtl"].includes(e)||(e="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:bi(e,t),prevKey:wi(e,t)}}const gr=typeof document<"u",Nn=Si();function Si(){return gr&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function ht(e){return e instanceof HTMLElement}function je(e){return e instanceof Element}function pr(e){return e instanceof Element||e instanceof SVGElement}function gc(e){return e.pointerType==="touch"}function Ai(e){return e!==null}function Oi(e){return e instanceof HTMLInputElement&&"select"in e}class Ei{#t;#e=Dt(null);constructor(t){this.#t=t}getCandidateNodes(){return this.#t.rootNode.current?this.#t.candidateSelector?Array.from(this.#t.rootNode.current.querySelectorAll(this.#t.candidateSelector)):this.#t.candidateAttr?Array.from(this.#t.rootNode.current.querySelectorAll(`[${this.#t.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const t=this.getCandidateNodes();t.length&&t[0]?.focus()}handleKeydown(t,n,r=!1){const o=this.#t.rootNode.current;if(!o||!t)return;const s=this.getCandidateNodes();if(!s.length)return;const i=s.indexOf(t),a=yi(o),{nextKey:c,prevKey:u}=xi(a,this.#t.orientation.current),h=this.#t.loop.current,d={[c]:i+1,[u]:i-1,[hr]:0,[fr]:s.length-1};if(r){const g=c===ne?ce:ne,p=u===pe?ae:pe;d[g]=i+1,d[p]=i-1}let m=d[n.key];if(m===void 0)return;n.preventDefault(),m<0&&h?m=s.length-1:m===s.length&&h&&(m=0);const f=s[m];if(f)return f.focus(),this.#e.current=f.id,this.#t.onCandidateFocus?.(f),f}getTabIndex(t){const n=this.getCandidateNodes(),r=this.#e.current!==null;return t&&!r&&n[0]===t?(this.#e.current=t.id,0):t?.id===this.#e.current?0:-1}setCurrentTabStopId(t){this.#e.current=t}focusCurrentTabStop(){const t=this.#e.current;if(!t)return;const n=this.#t.rootNode.current?.querySelector(`#${t}`);!n||!ht(n)||n.focus()}}class Ci{#t;#e=null;constructor(t){this.#t=t,_t(()=>this.#n())}#n(){this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null)}run(t){this.#n();const n=this.#t.ref.current;if(n){if(typeof n.getAnimations!="function"){this.#r(t);return}this.#e=window.requestAnimationFrame(()=>{const r=n.getAnimations();if(r.length===0){this.#r(t);return}Promise.allSettled(r.map(o=>o.finished)).then(()=>{this.#r(t)})})}}#r(t){const n=()=>{t()};this.#t.afterTick?lt(n):n()}}class Ue{#t;#e;#n;#r=T(!1);constructor(t){this.#t=t,y(this.#r,t.open.current,!0),this.#e=t.enabled??!0,this.#n=new Ci({ref:this.#t.ref,afterTick:this.#t.open}),H(()=>this.#t.open.current,n=>{n&&y(this.#r,!0),this.#e&&this.#n.run(()=>{n===this.#t.open.current&&(this.#t.open.current||y(this.#r,!1),this.#t.onComplete?.())})})}get shouldRender(){return l(this.#r)}}function B(){}function Ut(e,t){return`bits-${e}`}const Pi=dr({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),mt=new Pt("Dialog.Root | AlertDialog.Root");class en{static create(t){const n=mt.getOr(null);return mt.set(new en(t,n))}opts;#t=T(null);get triggerNode(){return l(this.#t)}set triggerNode(t){y(this.#t,t,!0)}#e=T(null);get contentNode(){return l(this.#e)}set contentNode(t){y(this.#e,t,!0)}#n=T(null);get overlayNode(){return l(this.#n)}set overlayNode(t){y(this.#n,t,!0)}#r=T(null);get descriptionNode(){return l(this.#r)}set descriptionNode(t){y(this.#r,t,!0)}#o=T(void 0);get contentId(){return l(this.#o)}set contentId(t){y(this.#o,t,!0)}#i=T(void 0);get titleId(){return l(this.#i)}set titleId(t){y(this.#i,t,!0)}#a=T(void 0);get triggerId(){return l(this.#a)}set triggerId(t){y(this.#a,t,!0)}#s=T(void 0);get descriptionId(){return l(this.#s)}set descriptionId(t){y(this.#s,t,!0)}#c=T(null);get cancelNode(){return l(this.#c)}set cancelNode(t){y(this.#c,t,!0)}#l=T(0);get nestedOpenCount(){return l(this.#l)}set nestedOpenCount(t){y(this.#l,t,!0)}depth;parent;contentPresence;overlayPresence;constructor(t,n){this.opts=t,this.parent=n,this.depth=n?n.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new Ue({ref:w(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Ue({ref:w(()=>this.overlayNode),open:this.opts.open,enabled:!0}),H(()=>this.opts.open.current,r=>{this.parent&&(r?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),_t(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=t=>Pi.getAttr(t,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=x(()=>({"data-state":Fe(this.opts.open.current)}));get sharedProps(){return l(this.#u)}set sharedProps(t){y(this.#u,t)}}class mr{static create(t){return new mr(t,mt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=Q(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(t){this.opts.disabled.current||t.button>0||this.root.handleClose()}onkeydown(t){this.opts.disabled.current||(t.key===jt||t.key===Ie)&&(t.preventDefault(),this.root.handleClose())}#t=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return l(this.#t)}set props(t){y(this.#t,t)}}class nn{static create(t){return new nn(t,mt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=Q(this.opts.ref)}#t=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("action")]:"",...this.root.sharedProps,...this.attachment}));get props(){return l(this.#t)}set props(t){y(this.#t,t)}}class rn{static create(t){return new rn(t,mt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.root.titleId=this.opts.id.current,this.attachment=Q(this.opts.ref),H.pre(()=>this.opts.id.current,r=>{this.root.titleId=r})}#t=x(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment}));get props(){return l(this.#t)}set props(t){y(this.#t,t)}}class on{static create(t){return new on(t,mt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.root.descriptionId=this.opts.id.current,this.attachment=Q(this.opts.ref,r=>{this.root.descriptionNode=r}),H.pre(()=>this.opts.id.current,r=>{this.root.descriptionId=r})}#t=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment}));get props(){return l(this.#t)}set props(t){y(this.#t,t)}}class sn{static create(t){return new sn(t,mt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=Q(this.opts.ref,r=>{this.root.contentNode=r,this.root.contentId=r?.id})}#t=x(()=>({open:this.root.opts.open.current}));get snippetProps(){return l(this.#t)}set snippetProps(t){y(this.#t,t)}#e=x(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":Kt(this.root.nestedOpenCount>0),"data-nested":Kt(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return l(this.#e)}set props(t){y(this.#e,t)}get shouldRender(){return this.root.contentPresence.shouldRender}}class an{static create(t){return new an(t,mt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=Q(this.opts.ref,r=>this.root.overlayNode=r)}#t=x(()=>({open:this.root.opts.open.current}));get snippetProps(){return l(this.#t)}set snippetProps(t){y(this.#t,t)}#e=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":Kt(this.root.nestedOpenCount>0),"data-nested":Kt(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return l(this.#e)}set props(t){y(this.#e,t)}get shouldRender(){return this.root.overlayPresence.shouldRender}}class cn{static create(t){return new cn(t,mt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=Q(this.opts.ref,r=>this.root.cancelNode=r),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(t){this.opts.disabled.current||t.button>0||this.root.handleClose()}onkeydown(t){this.opts.disabled.current||(t.key===jt||t.key===Ie)&&(t.preventDefault(),this.root.handleClose())}#t=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("cancel")]:"",onclick:this.onclick,onkeydown:this.onkeydown,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return l(this.#t)}set props(t){y(this.#t,t)}}function Ti(e,t){k(t,!0);let n=v(t,"open",15,!1),r=v(t,"onOpenChange",3,B),o=v(t,"onOpenChangeComplete",3,B);en.create({variant:w(()=>"alert-dialog"),open:w(()=>n(),a=>{n(a),r()(a)}),onOpenChangeComplete:w(()=>o())});var s=M(),i=P(s);D(i,()=>t.children??L),C(e,s),N()}var Mi=ct("<div><!></div>");function Fi(e,t){const n=Ht();k(t,!0);let r=v(t,"id",19,()=>Ut(n)),o=v(t,"ref",15,null),s=v(t,"level",3,2),i=W(t,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const a=rn.create({id:w(()=>r()),level:w(()=>s()),ref:w(()=>o(),f=>o(f))}),c=x(()=>tt(i,a.props));var u=M(),h=P(u);{var d=f=>{var g=M(),p=P(g);D(p,()=>t.child,()=>({props:l(c)})),C(f,g)},m=f=>{var g=Mi();Ot(g,()=>({...l(c)}));var p=St(g);D(p,()=>t.children??L),At(g),C(f,g)};nt(h,f=>{t.child?f(d):f(m,!1)})}C(e,u),N()}var Ii=ct("<button><!></button>");function Ri(e,t){const n=Ht();k(t,!0);let r=v(t,"id",19,()=>Ut(n)),o=v(t,"ref",15,null),s=W(t,["$$slots","$$events","$$legacy","children","child","id","ref"]);const i=nn.create({id:w(()=>r()),ref:w(()=>o(),m=>o(m))}),a=x(()=>tt(s,i.props));var c=M(),u=P(c);{var h=m=>{var f=M(),g=P(f);D(g,()=>t.child,()=>({props:l(a)})),C(m,f)},d=m=>{var f=Ii();Ot(f,()=>({...l(a)}));var g=St(f);D(g,()=>t.children??L),At(f),C(m,f)};nt(u,m=>{t.child?m(h):m(d,!1)})}C(e,c),N()}var ki=ct("<button><!></button>");function Ni(e,t){const n=Ht();k(t,!0);let r=v(t,"id",19,()=>Ut(n)),o=v(t,"ref",15,null),s=v(t,"disabled",3,!1),i=W(t,["$$slots","$$events","$$legacy","id","ref","children","child","disabled"]);const a=cn.create({id:w(()=>r()),ref:w(()=>o(),f=>o(f)),disabled:w(()=>!!s())}),c=x(()=>tt(i,a.props));var u=M(),h=P(u);{var d=f=>{var g=M(),p=P(g);D(p,()=>t.child,()=>({props:l(c)})),C(f,g)},m=f=>{var g=ki();Ot(g,()=>({...l(c)}));var p=St(g);D(p,()=>t.children??L),At(g),C(f,g)};nt(h,f=>{t.child?f(d):f(m,!1)})}C(e,u),N()}function Di(e,t){var n=M(),r=P(n);Ao(r,()=>t.children,o=>{var s=M(),i=P(s);D(i,()=>t.children??L),C(o,s)}),C(e,n)}const _i=new Pt("BitsConfig");function Bi(){const e=new Li(null,{});return _i.getOr(e).opts}class Li{opts;constructor(t,n){const r=Wi(t,n);this.opts={defaultPortalTo:r(o=>o.defaultPortalTo),defaultLocale:r(o=>o.defaultLocale)}}}function Wi(e,t){return n=>w(()=>{const o=n(t)?.current;if(o!==void 0)return o;if(e!==null)return n(e.opts)?.current})}function Ki(e,t){return n=>{const r=Bi();return w(()=>{const o=n();if(o!==void 0)return o;const s=e(r).current;return s!==void 0?s:t})}}const Vi=Ki(e=>e.defaultPortalTo,"body");function zi(e,t){k(t,!0);const n=Vi(()=>t.to),r=yo();let o=x(s);function s(){if(!gr||t.disabled)return null;let d=null;return typeof n.current=="string"?d=document.querySelector(n.current):d=n.current,d}let i;function a(){i&&(so(i),i=null)}H([()=>l(o),()=>t.disabled],([d,m])=>{if(!d||m){a();return}return i=io(Di,{target:d,props:{children:t.children},context:r}),()=>{a()}});var c=M(),u=P(c);{var h=d=>{var m=M(),f=P(m);D(f,()=>t.children??L),C(d,m)};nt(u,d=>{t.disabled&&d(h)})}C(e,c),N()}class Hi{eventName;options;constructor(t,n={bubbles:!0,cancelable:!0}){this.eventName=t,this.options=n}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,n){const r=this.createEvent(n);return t.dispatchEvent(r),r}listen(t,n,r){const o=s=>{n(s)};return V(t,this.eventName,o,r)}}function Dn(e,t=500){let n=null;const r=(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function vr(e,t){return e===t||e.contains(t)}function yr(e){return e?.ownerDocument??document}function ji(e,t){const{clientX:n,clientY:r}=e,o=t.getBoundingClientRect();return n<o.left||n>o.right||r<o.top||r>o.bottom}const Ge=[Ie,jt],Ui=[ne,mi,hr],br=[pe,pi,fr],Gi=[...Ui,...br],Yi={ltr:[...Ge,ce],rtl:[...Ge,ae]},pc={ltr:[ae],rtl:[ce]};function me(e){return e.pointerType==="mouse"}function Xi(e,{select:t=!1}={}){if(!e||!e.focus)return;const n=se(e);if(n.activeElement===e)return;const r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&Oi(e)&&t&&e.select()}function qi(e,{select:t=!1}={},n){const r=n();for(const o of e)if(Xi(o,{select:t}),n()!==r)return!0}let Jt=T(!1);class bt{static _refs=0;static _cleanup;constructor(){Z(()=>(bt._refs===0&&(bt._cleanup=$n(()=>{const t=[],n=o=>{y(Jt,!1)},r=o=>{y(Jt,!0)};return t.push(V(document,"pointerdown",n,{capture:!0}),V(document,"pointermove",n,{capture:!0}),V(document,"keydown",r,{capture:!0})),Rt(...t)})),bt._refs++,()=>{bt._refs--,bt._refs===0&&(y(Jt,!1),bt._cleanup?.())}))}get current(){return l(Jt)}set current(t){y(Jt,t,!0)}}var wr=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ve=wr.join(","),xr=typeof Element>"u",kt=xr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ye=!xr&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},be=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):be(t.parentNode));return i},Zi=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Sr=function(t,n,r){if(be(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ve));return n&&kt.call(t,ve)&&o.unshift(t),o=o.filter(r),o},we=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!be(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,u=we(c,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{var h=kt.call(i,ve);h&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),m=!be(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&m){var f=we(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else s.unshift.apply(s,i.children)}}return o},Ar=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Or=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Zi(t))&&!Ar(t)?0:t.tabIndex},Ji=function(t,n){var r=Or(t);return r<0&&n&&!Ar(t)?0:r},Qi=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Er=function(t){return t.tagName==="INPUT"},$i=function(t){return Er(t)&&t.type==="hidden"},ts=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},es=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},ns=function(t){if(!t.name)return!0;var n=t.form||ye(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=es(o,t.form);return!s||s===t},rs=function(t){return Er(t)&&t.type==="radio"},os=function(t){return rs(t)&&!ns(t)},is=function(t){var n,r=t&&ye(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,c;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&o;){var u,h,d;r=ye(o),o=(u=r)===null||u===void 0?void 0:u.host,s=!!((h=o)!==null&&h!==void 0&&(d=h.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},_n=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},ss=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=kt.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(kt.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var c=t;t;){var u=t.parentElement,h=ye(t);if(u&&!u.shadowRoot&&o(u)===!0)return _n(t);t.assignedSlot?t=t.assignedSlot:!u&&h!==t.ownerDocument?t=h.host:t=u}t=c}if(is(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _n(t);return!1},as=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return kt.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},xe=function(t,n){return!(n.disabled||$i(n)||ss(n,t)||ts(n)||as(n))},Ye=function(t,n){return!(os(n)||Or(n)<0||!xe(t,n))},cs=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Cr=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,c=Ji(a,i),u=i?Cr(o.candidates):a;c===0?i?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:c,item:o,isScope:i,content:u})}),r.sort(Qi).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Pr=function(t,n){n=n||{};var r;return n.getShadowRoot?r=we([t],n.includeContainer,{filter:Ye.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:cs}):r=Sr(t,n.includeContainer,Ye.bind(null,n)),Cr(r)},Tr=function(t,n){n=n||{};var r;return n.getShadowRoot?r=we([t],n.includeContainer,{filter:xe.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Sr(t,n.includeContainer,xe.bind(null,n)),r},un=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return kt.call(t,ve)===!1?!1:Ye(n,t)},us=wr.concat("iframe:not([inert]):not([inert] *)").join(","),Mr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return kt.call(t,us)===!1?!1:xe(n,t)};function ee(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function ls(e,t){if(!un(e,ee()))return ds(e,t);const n=se(e),r=Pr(n.body,ee());t==="prev"&&r.reverse();const o=r.indexOf(e);return o===-1?n.body:r.slice(o+1)[0]}function ds(e,t){const n=se(e);if(!Mr(e,ee()))return n.body;const r=Tr(n.body,ee());t==="prev"&&r.reverse();const o=r.indexOf(e);return o===-1?n.body:r.slice(o+1).find(i=>un(i,ee()))??n.body}function fs(e,t){return e.length!==t.length?!1:e.every((n,r)=>Fr(n,t[r]))}function Fr(e,t){return Number.isNaN(e)&&Number.isNaN(t)?!0:Array.isArray(e)&&Array.isArray(t)?fs(e,t):typeof e=="object"&&typeof t=="object"?hs(e,t):Object.is(e,t)}function hs(e,t){if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o)||!Fr(e[o],t[o]))return!1;return!0}function mc(e,t,n=!0){if(!(e.length===0||t<0||t>=e.length))return e.length===1&&t===0?e[0]:t===e.length-1?n?e[0]:void 0:e[t+1]}function vc(e,t,n=!0){if(!(e.length===0||t<0||t>=e.length))return e.length===1&&t===0?e[0]:t===0?n?e[e.length-1]:void 0:e[t-1]}function yc(e,t,n,r=!0){if(e.length===0||t<0||t>=e.length)return;let o=t+n;return r?o=(o%e.length+e.length)%e.length:o=Math.max(0,Math.min(o,e.length-1)),e[o]}function bc(e,t,n,r=!0){if(e.length===0||t<0||t>=e.length)return;let o=t-n;return r?o=(o%e.length+e.length)%e.length:o=Math.max(0,Math.min(o,e.length-1)),e[o]}function Ir(e,t,n){const r=t.toLowerCase();if(r.endsWith(" ")){const d=r.slice(0,-1);if(e.filter(p=>p.toLowerCase().startsWith(d)).length<=1)return Ir(e,d,n);const f=n?.toLowerCase();if(f&&f.startsWith(d)&&f.charAt(d.length)===" "&&t.trim()===d)return n;const g=e.filter(p=>p.toLowerCase().startsWith(r));if(g.length>0){const p=n?e.indexOf(n):-1;return Bn(g,Math.max(p,0)).find(O=>O!==n)||n}}const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=s.toLowerCase(),a=n?e.indexOf(n):-1;let c=Bn(e,Math.max(a,0));s.length===1&&(c=c.filter(d=>d!==n));const h=c.find(d=>d?.toLowerCase().startsWith(i));return h!==n?h:void 0}function Bn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const gs={afterMs:1e4,onChange:B};function Rr(e,t){const{afterMs:n,onChange:r,getWindow:o}={...gs,...t};let s=null,i=T(Bt(e));function a(){return o().setTimeout(()=>{y(i,e,!0),r?.(e)},n)}return Z(()=>()=>{s&&o().clearTimeout(s)}),w(()=>l(i),c=>{y(i,c,!0),r?.(c),s&&o().clearTimeout(s),s=a()})}class ps{#t;#e;#n=x(()=>this.#t.onMatch?this.#t.onMatch:t=>t.focus());#r=x(()=>this.#t.getCurrentItem?this.#t.getCurrentItem:this.#t.getActiveElement);constructor(t){this.#t=t,this.#e=Rr("",{afterMs:1e3,getWindow:t.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,n){if(!n.length)return;this.#e.current=this.#e.current+t;const r=l(this.#r)(),o=n.find(c=>c===r)?.textContent?.trim()??"",s=n.map(c=>c.textContent?.trim()??""),i=Ir(s,this.#e.current,o),a=n.find(c=>c.textContent?.trim()===i);return a&&l(this.#n)(a),a}resetTypeahead(){this.#e.current=""}get search(){return this.#e.current}}class ms{#t;#e;#n;#r=T(null);constructor(t){this.#t=t,this.#e=x(()=>this.#t.enabled()),this.#n=Rr(!1,{afterMs:t.transitTimeout??300,onChange:n=>{l(this.#e)&&this.#t.setIsPointerInTransit?.(n)},getWindow:()=>Qe(this.#t.triggerNode())}),H([t.triggerNode,t.contentNode,t.enabled],([n,r,o])=>{if(!n||!r||!o)return;const s=a=>{this.#i(a,r)},i=a=>{this.#i(a,n)};return Rt(V(n,"pointerleave",s),V(r,"pointerleave",i))}),H(()=>l(this.#r),()=>{const n=o=>{if(!l(this.#r))return;const s=o.target;if(!je(s))return;const i={x:o.clientX,y:o.clientY},a=t.triggerNode()?.contains(s)||t.contentNode()?.contains(s),c=!ws(i,l(this.#r));a?this.#o():c&&(this.#o(),t.onPointerExit())},r=se(t.triggerNode()??t.contentNode());if(r)return V(r,"pointermove",n)})}#o(){y(this.#r,null),this.#n.current=!1}#i(t,n){const r=t.currentTarget;if(!ht(r))return;const o={x:t.clientX,y:t.clientY},s=vs(o,r.getBoundingClientRect()),i=ys(o,s),a=bs(n.getBoundingClientRect()),c=xs([...i,...a]);y(this.#r,c,!0),this.#n.current=!0}}function vs(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ys(e,t,n=5){const r=n*1.5;switch(t){case"top":return[{x:e.x-n,y:e.y+n},{x:e.x,y:e.y-r},{x:e.x+n,y:e.y+n}];case"bottom":return[{x:e.x-n,y:e.y-n},{x:e.x,y:e.y+r},{x:e.x+n,y:e.y-n}];case"left":return[{x:e.x+n,y:e.y-n},{x:e.x-r,y:e.y},{x:e.x+n,y:e.y+n}];case"right":return[{x:e.x-n,y:e.y-n},{x:e.x+r,y:e.y},{x:e.x-n,y:e.y+n}]}}function bs(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function ws(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,c=t[s].y,u=t[i].x,h=t[i].y;c>r!=h>r&&n<(u-a)*(r-c)/(h-c)+a&&(o=!o)}return o}function xs(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Ss(t)}function Ss(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const As="data-context-menu-trigger",Os="data-context-menu-content",kr=new Pt("Menu.Root"),Vt=new Pt("Menu.Root | Menu.Sub"),ln=new Pt("Menu.Content"),Nr=new Hi("bitsmenuopen",{bubbles:!1,cancelable:!0}),Es=dr({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class Dr{static create(t){const n=new Dr(t);return kr.set(n)}opts;isUsingKeyboard=new bt;#t=T(!1);get ignoreCloseAutoFocus(){return l(this.#t)}set ignoreCloseAutoFocus(t){y(this.#t,t,!0)}#e=T(!1);get isPointerInTransit(){return l(this.#e)}set isPointerInTransit(t){y(this.#e,t,!0)}constructor(t){this.opts=t}getBitsAttr=t=>Es.getAttr(t,this.opts.variant.current)}class dn{static create(t,n){return Vt.set(new dn(t,n,null))}opts;root;parentMenu;contentId=w(()=>"");#t=T(null);get contentNode(){return l(this.#t)}set contentNode(t){y(this.#t,t,!0)}contentPresence;#e=T(null);get triggerNode(){return l(this.#e)}set triggerNode(t){y(this.#e,t,!0)}constructor(t,n,r){this.opts=t,this.root=n,this.parentMenu=r,this.contentPresence=new Ue({ref:w(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),r&&H(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class _r{static create(t){return ln.set(new _r(t,Vt.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#t=T("");get search(){return l(this.#t)}set search(t){y(this.#t,t,!0)}#e=0;#n;#r=T(!1);get mounted(){return l(this.#r)}set mounted(t){y(this.#r,t,!0)}#o;constructor(t,n){this.opts=t,this.parentMenu=n,this.domContext=new $e(t.ref),this.attachment=Q(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),n.contentId=t.id,this.#o=t.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new ms({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),this.#n=new ps({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new Ei({rootNode:w(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:w(()=>"vertical")}),H(()=>this.parentMenu.contentNode,r=>{if(!r)return;const o=()=>{lt(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return Nr.listen(r,o)}),Z(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#e)})}#i(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#a(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=t=>{this.opts.onCloseAutoFocus.current?.(t),!(t.defaultPrevented||this.#o)&&this.parentMenu.triggerNode&&un(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())};handleTabKeyDown(t){let n=this.parentMenu;for(;n.parentMenu!==null;)n=n.parentMenu;if(!n.triggerNode)return;t.preventDefault();const r=ls(n.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,n.onClose(),lt(()=>{r.focus(),lt(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){if(t.defaultPrevented)return;if(t.key===vi){this.handleTabKeyDown(t);return}const n=t.target,r=t.currentTarget;if(!ht(n)||!ht(r))return;const o=n.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,s=t.ctrlKey||t.altKey||t.metaKey,i=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(n,t)||t.code==="Space")return;const c=this.#i();o&&!s&&i&&this.#n(t.key,c),t.target?.id===this.parentMenu.contentId.current&&Gi.includes(t.key)&&(t.preventDefault(),br.includes(t.key)&&c.reverse(),qi(c,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){je(t.currentTarget)&&je(t.target)&&(t.currentTarget.contains?.(t.target)||(this.domContext.getWindow().clearTimeout(this.#e),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&lt(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#a()}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#a()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#a()}handleInteractOutside(t){if(!pr(t.target))return;const n=this.parentMenu.triggerNode?.id;if(t.target.id===n){t.preventDefault();return}t.target.closest(`#${n}`)&&t.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#s=x(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return l(this.#s)}set snippetProps(t){y(this.#s,t)}#c=x(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":Fe(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return l(this.#c)}set props(t){y(this.#c,t)}popperProps={onCloseAutoFocus:t=>this.onCloseAutoFocus(t)}}class Br{opts;content;attachment;#t=T(!1);constructor(t,n){this.opts=t,this.content=n,this.attachment=Q(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&me(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!ht(r))return;r.focus()}}onpointerleave(t){t.defaultPrevented||me(t)&&this.content.onItemLeave(t)}onfocus(t){lt(()=>{t.defaultPrevented||this.opts.disabled.current||y(this.#t,!0)})}onblur(t){lt(()=>{t.defaultPrevented||y(this.#t,!1)})}#e=x(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":tn(this.opts.disabled.current),"data-disabled":Kt(this.opts.disabled.current),"data-highlighted":l(this.#t)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return l(this.#e)}set props(t){y(this.#e,t)}}class Lr{static create(t){const n=new Br(t,ln.get());return new Lr(t,n)}opts;item;root;#t=!1;constructor(t,n){this.opts=t,this.item=n,this.root=n.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#e(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(t){const n=this.item.content.search!=="";if(!(this.item.opts.disabled.current||n&&t.key===jt)&&Ge.includes(t.key)){if(!ht(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||this.#e()}onpointerup(t){if(!t.defaultPrevented&&!this.#t){if(!ht(t.currentTarget))return;t.currentTarget?.click()}}onpointerdown(t){this.#t=!0}#n=x(()=>tt(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return l(this.#n)}set props(t){y(this.#n,t)}}class Wr{static create(t){const n=ln.get(),r=new Br(t,n),o=Vt.get();return new Wr(t,r,n,o)}opts;item;content;submenu;attachment;#t=null;constructor(t,n,r,o){this.opts=t,this.item=n,this.content=r,this.submenu=o,this.attachment=Q(this.opts.ref,s=>this.submenu.triggerNode=s),this.onpointerleave=this.onpointerleave.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),_t(()=>{this.#e()})}#e(){this.#t!==null&&(this.content.domContext.getWindow().clearTimeout(this.#t),this.#t=null)}onpointermove(t){me(t)&&!this.item.opts.disabled.current&&!this.submenu.opts.open.current&&!this.#t&&!this.content.parentMenu.root.isPointerInTransit&&(this.#t=this.content.domContext.setTimeout(()=>{this.submenu.onOpen(),this.#e()},this.opts.openDelay.current))}onpointerleave(t){me(t)&&this.#e()}onkeydown(t){const n=this.content.search!=="";this.item.opts.disabled.current||n&&t.key===jt||Yi[this.submenu.root.opts.dir.current].includes(t.key)&&(t.currentTarget.click(),t.preventDefault())}onclick(t){if(this.item.opts.disabled.current||!ht(t.currentTarget))return;t.currentTarget.focus();const n=new CustomEvent("menusubtriggerselect",{bubbles:!0,cancelable:!0});this.opts.onSelect.current(n),this.submenu.opts.open.current||(this.submenu.onOpen(),lt(()=>{const r=this.submenu.contentNode;r&&Nr.dispatch(r)}))}#n=x(()=>tt({"aria-haspopup":"menu","aria-expanded":tn(this.submenu.opts.open.current),"data-state":Fe(this.submenu.opts.open.current),"aria-controls":this.submenu.opts.open.current?this.submenu.contentId.current:void 0,[this.submenu.root.getBitsAttr("sub-trigger")]:"",onclick:this.onclick,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onkeydown:this.onkeydown,...this.attachment},this.item.props));get props(){return l(this.#n)}set props(t){y(this.#n,t)}}class Kr{static create(t){return new Kr(t,kr.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=Q(this.opts.ref)}#t=x(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return l(this.#t)}set props(t){y(this.#t,t)}}class Vr{static create(t){return new Vr(t,Vt.get())}opts;parentMenu;attachment;constructor(t,n){this.opts=t,this.parentMenu=n,this.attachment=Q(this.opts.ref,r=>this.parentMenu.triggerNode=r)}onclick=t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())};onpointerdown=t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}};onpointerup=t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=t=>{if(!this.opts.disabled.current){if(t.key===jt||t.key===Ie){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===ne&&(this.parentMenu.onOpen(),t.preventDefault())}};#t=x(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#e=x(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":tn(this.parentMenu.opts.open.current),"aria-controls":l(this.#t),"data-disabled":Kt(this.opts.disabled.current),"data-state":Fe(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return l(this.#e)}set props(t){y(this.#e,t)}}class wc{static create(t){const n=Vt.get();return Vt.set(new dn(t,n.root,n))}}globalThis.bitsDismissableLayers??=new Map;class fn{static create(t){return new fn(t)}opts;#t;#e;#n={pointerdown:!1};#r=!1;#o=!1;#i=void 0;#a;#s=B;constructor(t){this.opts=t,this.#e=t.interactOutsideBehavior,this.#t=t.onInteractOutside,this.#a=t.onFocusOutside,Z(()=>{this.#i=yr(this.opts.ref.current)});let n=B;const r=()=>{this.#f(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),n()};H([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return cr(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#e),n(),n=this.#l())}),r}),_t(()=>{this.#f.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),n()})}#c=t=>{t.defaultPrevented||this.opts.ref.current&&lt(()=>{!this.opts.ref.current||this.#m(t.target)||t.target&&!this.#o&&this.#a.current?.(t)})};#l(){return Rt(V(this.#i,"pointerdown",Rt(this.#h,this.#p),{capture:!0}),V(this.#i,"pointerdown",Rt(this.#g,this.#d)),V(this.#i,"focusin",this.#c))}#u=t=>{let n=t;n.defaultPrevented&&(n=Ln(t)),this.#t.current(t)};#d=Dn(t=>{if(!this.opts.ref.current){this.#s();return}const n=this.opts.isValidEvent.current(t,this.opts.ref.current)||Ts(t,this.opts.ref.current);if(!this.#r||this.#v()||!n){this.#s();return}let r=t;if(r.defaultPrevented&&(r=Ln(r)),this.#e.current!=="close"&&this.#e.current!=="defer-otherwise-close"){this.#s();return}t.pointerType==="touch"?(this.#s(),this.#s=V(this.#i,"click",this.#u,{once:!0})):this.#t.current(r)},10);#h=t=>{this.#n[t.type]=!0};#g=t=>{this.#n[t.type]=!1};#p=()=>{this.opts.ref.current&&(this.#r=Ps(this.opts.ref.current))};#m=t=>this.opts.ref.current?vr(this.opts.ref.current,t):!1;#f=Dn(()=>{for(const t in this.#n)this.#n[t]=!1;this.#r=!1},20);#v(){return Object.values(this.#n).some(Boolean)}#y=()=>{this.#o=!0};#b=()=>{this.#o=!1};props={onfocuscapture:this.#y,onblurcapture:this.#b}}function Cs(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([t,{current:n}])=>n==="close"||n==="ignore")}function Ps(e){const t=[...globalThis.bitsDismissableLayers],n=Cs(t);if(n)return n[0].opts.ref.current===e;const[r]=t[0];return r.opts.ref.current===e}function Ts(e,t){const n=e.target;if(!pr(n))return!1;const r=!!n.closest(`[${As}]`);if("button"in e&&e.button>0&&!r)return!1;if("button"in e&&e.button===0&&r)return!0;const o=!!t.closest(`[${Os}]`);return r&&o?!1:yr(n).documentElement.contains(n)&&!vr(t,n)&&ji(e,t)}function Ln(e){const t=e.currentTarget,n=e.target;let r;e instanceof PointerEvent?r=new PointerEvent(e.type,e):r=new PointerEvent("pointerdown",e);let o=!1;return new Proxy(r,{get:(i,a)=>a==="currentTarget"?t:a==="target"?n:a==="preventDefault"?()=>{o=!0,typeof i.preventDefault=="function"&&i.preventDefault()}:a==="defaultPrevented"?o:a in i?i[a]:e[a]})}function zr(e,t){k(t,!0);let n=v(t,"interactOutsideBehavior",3,"close"),r=v(t,"onInteractOutside",3,B),o=v(t,"onFocusOutside",3,B),s=v(t,"isValidEvent",3,()=>!1);const i=fn.create({id:w(()=>t.id),interactOutsideBehavior:w(()=>n()),onInteractOutside:w(()=>r()),enabled:w(()=>t.enabled),onFocusOutside:w(()=>o()),isValidEvent:w(()=>s()),ref:t.ref});var a=M(),c=P(a);D(c,()=>t.children??L,()=>({props:i.props})),C(e,a),N()}globalThis.bitsEscapeLayers??=new Map;class hn{static create(t){return new hn(t)}opts;domContext;constructor(t){this.opts=t,this.domContext=new $e(this.opts.ref);let n=B;H(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),n=this.#t()),()=>{n(),globalThis.bitsEscapeLayers.delete(this)}))}#t=()=>V(this.domContext.getDocument(),"keydown",this.#e,{passive:!1});#e=t=>{if(t.key!==gi||!Ms(this))return;const n=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(n)}}function Ms(e){const t=[...globalThis.bitsEscapeLayers],n=t.findLast(([o,{current:s}])=>s==="close"||s==="ignore");if(n)return n[0]===e;const[r]=t[0];return r===e}function Hr(e,t){k(t,!0);let n=v(t,"escapeKeydownBehavior",3,"close"),r=v(t,"onEscapeKeydown",3,B);hn.create({escapeKeydownBehavior:w(()=>n()),onEscapeKeydown:w(()=>r()),enabled:w(()=>t.enabled),ref:t.ref});var o=M(),s=P(o);D(s,()=>t.children??L),C(e,o),N()}class gn{static instance;#t=ut([]);#e=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new gn),this.instance}register(t){const n=this.getActive();n&&n!==t&&n.pause();const r=document.activeElement;r&&r!==document.body&&this.#n.set(t,r),this.#t.current=this.#t.current.filter(o=>o!==t),this.#t.current.unshift(t)}unregister(t){this.#t.current=this.#t.current.filter(r=>r!==t);const n=this.getActive();n&&n.resume()}getActive(){return this.#t.current[0]}setFocusMemory(t,n){this.#e.set(t,n)}getFocusMemory(t){return this.#e.get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,n){this.#n.set(t,n)}getPreFocusMemory(t){return this.#n.get(t)}clearPreFocusMemory(t){this.#n.delete(t)}}class pn{#t=!1;#e=null;#n=gn.getInstance();#r=[];#o;constructor(t){this.#o=t}get paused(){return this.#t}pause(){this.#t=!0}resume(){this.#t=!1}#i(){for(const t of this.#r)t();this.#r=[]}mount(t){this.#e&&this.unmount(),this.#e=t,this.#n.register(this),this.#c(),this.#a()}unmount(){this.#e&&(this.#i(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#e=null)}#a(){if(!this.#e)return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#o.onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!this.#e)return;const n=this.#u();n?(n.focus(),this.#n.setFocusMemory(this,n)):this.#e.focus()})}#s(){const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#o.onCloseAutoFocus.current?.(t),!t.defaultPrevented){const n=this.#n.getPreFocusMemory(this);if(n&&document.contains(n))try{n.focus()}catch{document.body.focus()}}}#c(){if(!this.#e||!this.#o.trap.current)return;const t=this.#e,n=t.ownerDocument,r=i=>{if(this.#t||!this.#n.isActiveScope(this))return;const a=i.target;if(!a)return;if(t.contains(a))this.#n.setFocusMemory(this,a);else{const u=this.#n.getFocusMemory(this);if(u&&t.contains(u)&&Mr(u))i.preventDefault(),u.focus();else{const h=this.#u(),d=this.#d()[0];(h||d||t).focus()}}},o=i=>{if(!this.#o.loop||this.#t||i.key!=="Tab"||!this.#n.isActiveScope(this))return;const a=this.#l();if(a.length===0)return;const c=a[0],u=a[a.length-1];!i.shiftKey&&n.activeElement===u?(i.preventDefault(),c.focus()):i.shiftKey&&n.activeElement===c&&(i.preventDefault(),u.focus())};this.#r.push(V(n,"focusin",r,{capture:!0}),V(t,"keydown",o));const s=new MutationObserver(()=>{const i=this.#n.getFocusMemory(this);if(i&&!t.contains(i)){const a=this.#u(),c=this.#d()[0],u=a||c;u?(u.focus(),this.#n.setFocusMemory(this,u)):t.focus()}});s.observe(t,{childList:!0,subtree:!0}),this.#r.push(()=>s.disconnect())}#l(){return this.#e?Pr(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#e?Tr(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return H([()=>t.ref.current,()=>t.enabled.current],([r,o])=>{r&&o?(n||(n=new pn(t)),n.mount(r)):n&&(n.unmount(),n=null)}),_t(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}}function jr(e,t){k(t,!0);let n=v(t,"enabled",3,!1),r=v(t,"trapFocus",3,!1),o=v(t,"loop",3,!1),s=v(t,"onCloseAutoFocus",3,B),i=v(t,"onOpenAutoFocus",3,B);const a=pn.use({enabled:w(()=>n()),trap:w(()=>r()),loop:o(),onCloseAutoFocus:w(()=>s()),onOpenAutoFocus:w(()=>i()),ref:t.ref});var c=M(),u=P(c);D(u,()=>t.focusScope??L,()=>({props:a.props})),C(e,c),N()}globalThis.bitsTextSelectionLayers??=new Map;class mn{static create(t){return new mn(t)}opts;domContext;#t=B;constructor(t){this.opts=t,this.domContext=new $e(t.ref);let n=B;H(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),n(),n=this.#e()),()=>{n(),this.#r(),globalThis.bitsTextSelectionLayers.delete(this)}))}#e(){return Rt(V(this.domContext.getDocument(),"pointerdown",this.#n),V(this.domContext.getDocument(),"pointerup",rr(this.#r,this.opts.onPointerUp.current)))}#n=t=>{const n=this.opts.ref.current,r=t.target;!ht(n)||!ht(r)||!this.opts.enabled.current||!Is(this)||!di(n,r)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&(this.#t=Fs(n,this.domContext.getDocument().body)))};#r=()=>{this.#t(),this.#t=B}}const Wn=e=>e.style.userSelect||e.style.webkitUserSelect;function Fs(e,t){const n=Wn(t),r=Wn(e);return le(t,"none"),le(e,"text"),()=>{le(t,n),le(e,r)}}function le(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function Is(e){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const n=t.at(-1);return n?n[0]===e:!1}function Ur(e,t){k(t,!0);let n=v(t,"preventOverflowTextSelection",3,!0),r=v(t,"onPointerDown",3,B),o=v(t,"onPointerUp",3,B);mn.create({id:w(()=>t.id),onPointerDown:w(()=>r()),onPointerUp:w(()=>o()),enabled:w(()=>t.enabled&&n()),ref:t.ref});var s=M(),i=P(s);D(i,()=>t.children??L),C(e,s),N()}globalThis.bitsIdCounter??={current:0};function vn(e="bits"){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}class Rs{#t;#e=0;#n=T();#r;constructor(t){this.#t=t}#o(){this.#e-=1,this.#r&&this.#e<=0&&(this.#r(),y(this.#n,void 0),this.#r=void 0)}get(...t){return this.#e+=1,l(this.#n)===void 0&&(this.#r=$n(()=>{y(this.#n,this.#t(...t),!0)})),Z(()=>()=>{this.#o()}),l(this.#n)}}const he=new Oo;let de=T(null),Le=null,Qt=null,$t=!1;const Kn=w(()=>{for(const e of he.values())if(e)return!0;return!1});let We=null;const ks=new Rs(()=>{function e(){document.body.setAttribute("style",l(de)??""),document.body.style.removeProperty("--scrollbar-width"),Nn&&Le?.(),y(de,null)}function t(){Qt!==null&&(window.clearTimeout(Qt),Qt=null)}function n(o,s){t(),$t=!0,We=Date.now();const i=We,a=()=>{Qt=null,We===i&&(Gr(he)?$t=!1:($t=!1,s()))},c=o===null?24:o;Qt=window.setTimeout(a,c)}function r(){l(de)===null&&he.size===0&&!$t&&y(de,document.body.getAttribute("style"),!0)}return H(()=>Kn.current,()=>{if(!Kn.current)return;r(),$t=!1;const o=getComputedStyle(document.documentElement),s=getComputedStyle(document.body),i=o.scrollbarGutter?.includes("stable")||s.scrollbarGutter?.includes("stable"),a=window.innerWidth-document.documentElement.clientWidth,u={padding:Number.parseInt(s.paddingRight??"0",10)+a,margin:Number.parseInt(s.marginRight??"0",10)};a>0&&!i&&(document.body.style.paddingRight=`${u.padding}px`,document.body.style.marginRight=`${u.margin}px`,document.body.style.setProperty("--scrollbar-width",`${a}px`)),document.body.style.overflow="hidden",Nn&&(Le=V(document,"touchmove",h=>{h.target===document.documentElement&&(h.touches.length>1||h.preventDefault())},{passive:!1})),lt(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),_t(()=>()=>{Le?.()}),{get lockMap(){return he},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});class Ns{#t=vn();#e;#n=()=>null;#r;locked;constructor(t,n=()=>null){this.#e=t,this.#n=n,this.#r=ks.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#t,this.#e??!1),this.locked=w(()=>this.#r.lockMap.get(this.#t)??!1,r=>this.#r.lockMap.set(this.#t,r)),_t(()=>{if(this.#r.lockMap.delete(this.#t),Gr(this.#r.lockMap))return;const r=this.#n();this.#r.scheduleCleanupIfNoNewLocks(r,()=>{this.#r.resetBodyStyle()})}))}}function Gr(e){for(const[t,n]of e)if(n)return!0;return!1}function Se(e,t){k(t,!0);let n=v(t,"preventScroll",3,!0),r=v(t,"restoreScrollDelay",3,null);n()&&new Ns(n(),()=>r()),N()}var Ds=ct("<!> <!>",1),_s=ct("<!> <div><!></div>",1);function Bs(e,t){const n=Ht();k(t,!0);let r=v(t,"id",19,()=>Ut(n)),o=v(t,"ref",15,null),s=v(t,"forceMount",3,!1),i=v(t,"interactOutsideBehavior",3,"ignore"),a=v(t,"onCloseAutoFocus",3,B),c=v(t,"onEscapeKeydown",3,B),u=v(t,"onOpenAutoFocus",3,B),h=v(t,"onInteractOutside",3,B),d=v(t,"preventScroll",3,!0),m=v(t,"trapFocus",3,!0),f=v(t,"restoreScrollDelay",3,null),g=W(t,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","interactOutsideBehavior","onCloseAutoFocus","onEscapeKeydown","onOpenAutoFocus","onInteractOutside","preventScroll","trapFocus","restoreScrollDelay"]);const p=sn.create({id:w(()=>r()),ref:w(()=>o(),A=>o(A))}),b=x(()=>tt(g,p.props));var S=M(),O=P(S);{var E=A=>{jr(A,{get ref(){return p.opts.ref},loop:!0,get trapFocus(){return m()},get enabled(){return p.root.opts.open.current},get onCloseAutoFocus(){return a()},onOpenAutoFocus:F=>{u()(F),!F.defaultPrevented&&(F.preventDefault(),cr(0,()=>p.opts.ref.current?.focus()))},focusScope:(F,_)=>{let j=()=>_?.().props;Hr(F,J(()=>l(b),{get enabled(){return p.root.opts.open.current},get ref(){return p.opts.ref},onEscapeKeydown:R=>{c()(R),!R.defaultPrevented&&p.root.handleClose()},children:(R,K)=>{zr(R,J(()=>l(b),{get ref(){return p.opts.ref},get enabled(){return p.root.opts.open.current},get interactOutsideBehavior(){return i()},onInteractOutside:U=>{h()(U),!U.defaultPrevented&&p.root.handleClose()},children:(U,G)=>{Ur(U,J(()=>l(b),{get ref(){return p.opts.ref},get enabled(){return p.root.opts.open.current},children:(ot,z)=>{var it=M(),$=P(it);{var Y=q=>{var Tt=Ds(),Xt=P(Tt);{var qt=Mt=>{Se(Mt,{get preventScroll(){return d()},get restoreScrollDelay(){return f()}})};nt(Xt,Mt=>{p.root.opts.open.current&&Mt(qt)})}var _e=ge(Xt,2);{let Mt=x(()=>({props:tt(l(b),j()),...p.snippetProps}));D(_e,()=>t.child,()=>l(Mt))}C(q,Tt)},X=q=>{var Tt=_s(),Xt=P(Tt);Se(Xt,{get preventScroll(){return d()}});var qt=ge(Xt,2);Ot(qt,Mt=>({...Mt}),[()=>tt(l(b),j())]);var _e=St(qt);D(_e,()=>t.children??L),At(qt),C(q,Tt)};nt($,q=>{t.child?q(Y):q(X,!1)})}C(ot,it)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};nt(O,A=>{(p.shouldRender||s())&&A(E)})}C(e,S),N()}var Ls=ct("<div><!></div>");function Ws(e,t){const n=Ht();k(t,!0);let r=v(t,"id",19,()=>Ut(n)),o=v(t,"forceMount",3,!1),s=v(t,"ref",15,null),i=W(t,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const a=an.create({id:w(()=>r()),ref:w(()=>s(),m=>s(m))}),c=x(()=>tt(i,a.props));var u=M(),h=P(u);{var d=m=>{var f=M(),g=P(f);{var p=S=>{var O=M(),E=P(O);{let A=x(()=>({props:tt(l(c)),...a.snippetProps}));D(E,()=>t.child,()=>l(A))}C(S,O)},b=S=>{var O=Ls();Ot(O,A=>({...A}),[()=>tt(l(c))]);var E=St(O);D(E,()=>t.children??L,()=>a.snippetProps),At(O),C(S,O)};nt(g,S=>{t.child?S(p):S(b,!1)})}C(m,f)};nt(h,m=>{(a.shouldRender||o())&&m(d)})}C(e,u),N()}var Ks=ct("<div><!></div>");function Vs(e,t){const n=Ht();k(t,!0);let r=v(t,"id",19,()=>Ut(n)),o=v(t,"ref",15,null),s=W(t,["$$slots","$$events","$$legacy","id","children","child","ref"]);const i=on.create({id:w(()=>r()),ref:w(()=>o(),m=>o(m))}),a=x(()=>tt(s,i.props));var c=M(),u=P(c);{var h=m=>{var f=M(),g=P(f);D(g,()=>t.child,()=>({props:l(a)})),C(m,f)},d=m=>{var f=Ks();Ot(f,()=>({...l(a)}));var g=St(f);D(g,()=>t.children??L),At(f),C(m,f)};nt(u,m=>{t.child?m(h):m(d,!1)})}C(e,c),N()}const zs=["top","right","bottom","left"],wt=Math.min,et=Math.max,Ae=Math.round,fe=Math.floor,ft=e=>({x:e,y:e}),Hs={left:"right",right:"left",bottom:"top",top:"bottom"},js={start:"end",end:"start"};function Xe(e,t,n){return et(e,wt(t,n))}function vt(e,t){return typeof e=="function"?e(t):e}function yt(e){return e.split("-")[0]}function Gt(e){return e.split("-")[1]}function yn(e){return e==="x"?"y":"x"}function bn(e){return e==="y"?"height":"width"}const Us=new Set(["top","bottom"]);function dt(e){return Us.has(yt(e))?"y":"x"}function wn(e){return yn(dt(e))}function Gs(e,t,n){n===void 0&&(n=!1);const r=Gt(e),o=wn(e),s=bn(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Oe(i)),[i,Oe(i)]}function Ys(e){const t=Oe(e);return[qe(e),t,qe(t)]}function qe(e){return e.replace(/start|end/g,t=>js[t])}const Vn=["left","right"],zn=["right","left"],Xs=["top","bottom"],qs=["bottom","top"];function Zs(e,t,n){switch(e){case"top":case"bottom":return n?t?zn:Vn:t?Vn:zn;case"left":case"right":return t?Xs:qs;default:return[]}}function Js(e,t,n,r){const o=Gt(e);let s=Zs(yt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(qe)))),s}function Oe(e){return e.replace(/left|right|bottom|top/g,t=>Hs[t])}function Qs(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yr(e){return typeof e!="number"?Qs(e):{top:e,right:e,bottom:e,left:e}}function Ee(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Hn(e,t,n){let{reference:r,floating:o}=e;const s=dt(t),i=wn(t),a=bn(i),c=yt(t),u=s==="y",h=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let f;switch(c){case"top":f={x:h,y:r.y-o.height};break;case"bottom":f={x:h,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Gt(t)){case"start":f[i]-=m*(n&&u?-1:1);break;case"end":f[i]+=m*(n&&u?-1:1);break}return f}async function $s(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=vt(t,e),g=Yr(f),b=a[m?d==="floating"?"reference":"floating":d],S=Ee(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:h,strategy:c})),O=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),A=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},I=Ee(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:O,offsetParent:E,strategy:c}):O);return{top:(S.top-I.top+g.top)/A.y,bottom:(I.bottom-S.bottom+g.bottom)/A.y,left:(S.left-I.left+g.left)/A.x,right:(I.right-S.right+g.right)/A.x}}const ta=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:d}=Hn(u,r,c),m=r,f={},g=0;for(let b=0;b<a.length;b++){var p;const{name:S,fn:O}=a[b],{x:E,y:A,data:I,reset:F}=await O({x:h,y:d,initialPlacement:r,placement:m,strategy:o,middlewareData:f,rects:u,platform:{...i,detectOverflow:(p=i.detectOverflow)!=null?p:$s},elements:{reference:e,floating:t}});h=E??h,d=A??d,f={...f,[S]:{...f[S],...I}},F&&g<=50&&(g++,typeof F=="object"&&(F.placement&&(m=F.placement),F.rects&&(u=F.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):F.rects),{x:h,y:d}=Hn(u,m,c)),b=-1)}return{x:h,y:d,placement:m,strategy:o,middlewareData:f}},ea=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:h=0}=vt(e,t)||{};if(u==null)return{};const d=Yr(h),m={x:n,y:r},f=wn(o),g=bn(f),p=await i.getDimensions(u),b=f==="y",S=b?"top":"left",O=b?"bottom":"right",E=b?"clientHeight":"clientWidth",A=s.reference[g]+s.reference[f]-m[f]-s.floating[g],I=m[f]-s.reference[f],F=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let _=F?F[E]:0;(!_||!await(i.isElement==null?void 0:i.isElement(F)))&&(_=a.floating[E]||s.floating[g]);const j=A/2-I/2,R=_/2-p[g]/2-1,K=wt(d[S],R),U=wt(d[O],R),G=K,ot=_-p[g]-U,z=_/2-p[g]/2+j,it=Xe(G,z,ot),$=!c.arrow&&Gt(o)!=null&&z!==it&&s.reference[g]/2-(z<G?K:U)-p[g]/2<0,Y=$?z<G?z-G:z-ot:0;return{[f]:m[f]+Y,data:{[f]:it,centerOffset:z-it-Y,...$&&{alignmentOffset:Y}},reset:$}}}),na=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...b}=vt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=yt(o),O=dt(a),E=yt(a)===a,A=await(c.isRTL==null?void 0:c.isRTL(u.floating)),I=m||(E||!p?[Oe(a)]:Ys(a)),F=g!=="none";!m&&F&&I.push(...Js(a,p,g,A));const _=[a,...I],j=await c.detectOverflow(t,b),R=[];let K=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&R.push(j[S]),d){const z=Gs(o,i,A);R.push(j[z[0]],j[z[1]])}if(K=[...K,{placement:o,overflows:R}],!R.every(z=>z<=0)){var U,G;const z=(((U=s.flip)==null?void 0:U.index)||0)+1,it=_[z];if(it&&(!(d==="alignment"?O!==dt(it):!1)||K.every(X=>dt(X.placement)===O?X.overflows[0]>0:!0)))return{data:{index:z,overflows:K},reset:{placement:it}};let $=(G=K.filter(Y=>Y.overflows[0]<=0).sort((Y,X)=>Y.overflows[1]-X.overflows[1])[0])==null?void 0:G.placement;if(!$)switch(f){case"bestFit":{var ot;const Y=(ot=K.filter(X=>{if(F){const q=dt(X.placement);return q===O||q==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(q=>q>0).reduce((q,Tt)=>q+Tt,0)]).sort((X,q)=>X[1]-q[1])[0])==null?void 0:ot[0];Y&&($=Y);break}case"initialPlacement":$=a;break}if(o!==$)return{reset:{placement:$}}}return{}}}};function jn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Un(e){return zs.some(t=>e[t]>=0)}const ra=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=vt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=jn(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Un(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=jn(i,n.floating);return{data:{escapedOffsets:a,escaped:Un(a)}}}default:return{}}}}},Xr=new Set(["left","top"]);async function oa(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=yt(n),a=Gt(n),c=dt(n)==="y",u=Xr.has(i)?-1:1,h=s&&c?-1:1,d=vt(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(f=a==="end"?g*-1:g),c?{x:f*h,y:m*u}:{x:m*u,y:f*h}}const ia=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await oa(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},sa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:S=>{let{x:O,y:E}=S;return{x:O,y:E}}},...u}=vt(e,t),h={x:n,y:r},d=await s.detectOverflow(t,u),m=dt(yt(o)),f=yn(m);let g=h[f],p=h[m];if(i){const S=f==="y"?"top":"left",O=f==="y"?"bottom":"right",E=g+d[S],A=g-d[O];g=Xe(E,g,A)}if(a){const S=m==="y"?"top":"left",O=m==="y"?"bottom":"right",E=p+d[S],A=p-d[O];p=Xe(E,p,A)}const b=c.fn({...t,[f]:g,[m]:p});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[f]:i,[m]:a}}}}}},aa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=vt(e,t),h={x:n,y:r},d=dt(o),m=yn(d);let f=h[m],g=h[d];const p=vt(a,t),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const E=m==="y"?"height":"width",A=s.reference[m]-s.floating[E]+b.mainAxis,I=s.reference[m]+s.reference[E]-b.mainAxis;f<A?f=A:f>I&&(f=I)}if(u){var S,O;const E=m==="y"?"width":"height",A=Xr.has(yt(o)),I=s.reference[d]-s.floating[E]+(A&&((S=i.offset)==null?void 0:S[d])||0)+(A?0:b.crossAxis),F=s.reference[d]+s.reference[E]+(A?0:((O=i.offset)==null?void 0:O[d])||0)-(A?b.crossAxis:0);g<I?g=I:g>F&&(g=F)}return{[m]:f,[d]:g}}}},ca=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=vt(e,t),h=await i.detectOverflow(t,u),d=yt(o),m=Gt(o),f=dt(o)==="y",{width:g,height:p}=s.floating;let b,S;d==="top"||d==="bottom"?(b=d,S=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(S=d,b=m==="end"?"top":"bottom");const O=p-h.top-h.bottom,E=g-h.left-h.right,A=wt(p-h[b],O),I=wt(g-h[S],E),F=!t.middlewareData.shift;let _=A,j=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=O),F&&!m){const K=et(h.left,0),U=et(h.right,0),G=et(h.top,0),ot=et(h.bottom,0);f?j=g-2*(K!==0||U!==0?K+U:et(h.left,h.right)):_=p-2*(G!==0||ot!==0?G+ot:et(h.top,h.bottom))}await c({...t,availableWidth:j,availableHeight:_});const R=await i.getDimensions(a.floating);return g!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function Re(){return typeof window<"u"}function Yt(e){return qr(e)?(e.nodeName||"").toLowerCase():"#document"}function rt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pt(e){var t;return(t=(qr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qr(e){return Re()?e instanceof Node||e instanceof rt(e).Node:!1}function st(e){return Re()?e instanceof Element||e instanceof rt(e).Element:!1}function gt(e){return Re()?e instanceof HTMLElement||e instanceof rt(e).HTMLElement:!1}function Gn(e){return!Re()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof rt(e).ShadowRoot}const ua=new Set(["inline","contents"]);function ue(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=at(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ua.has(o)}const la=new Set(["table","td","th"]);function da(e){return la.has(Yt(e))}const fa=[":popover-open",":modal"];function ke(e){return fa.some(t=>{try{return e.matches(t)}catch{return!1}})}const ha=["transform","translate","scale","rotate","perspective"],ga=["transform","translate","scale","rotate","perspective","filter"],pa=["paint","layout","strict","content"];function xn(e){const t=Sn(),n=st(e)?at(e):e;return ha.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ga.some(r=>(n.willChange||"").includes(r))||pa.some(r=>(n.contain||"").includes(r))}function ma(e){let t=xt(e);for(;gt(t)&&!zt(t);){if(xn(t))return t;if(ke(t))return null;t=xt(t)}return null}function Sn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const va=new Set(["html","body","#document"]);function zt(e){return va.has(Yt(e))}function at(e){return rt(e).getComputedStyle(e)}function Ne(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xt(e){if(Yt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gn(e)&&e.host||pt(e);return Gn(t)?t.host:t}function Zr(e){const t=xt(e);return zt(t)?e.ownerDocument?e.ownerDocument.body:e.body:gt(t)&&ue(t)?t:Zr(t)}function re(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Zr(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=rt(o);if(s){const a=Ze(i);return t.concat(i,i.visualViewport||[],ue(o)?o:[],a&&n?re(a):[])}return t.concat(o,re(o,[],n))}function Ze(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jr(e){const t=at(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=gt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ae(n)!==s||Ae(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function An(e){return st(e)?e:e.contextElement}function Lt(e){const t=An(e);if(!gt(t))return ft(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Jr(t);let i=(s?Ae(n.width):n.width)/r,a=(s?Ae(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const ya=ft(0);function Qr(e){const t=rt(e);return!Sn()||!t.visualViewport?ya:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ba(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==rt(e)?!1:t}function Nt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=An(e);let i=ft(1);t&&(r?st(r)&&(i=Lt(r)):i=Lt(e));const a=ba(s,n,r)?Qr(s):ft(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,h=o.width/i.x,d=o.height/i.y;if(s){const m=rt(s),f=r&&st(r)?rt(r):r;let g=m,p=Ze(g);for(;p&&r&&f!==g;){const b=Lt(p),S=p.getBoundingClientRect(),O=at(p),E=S.left+(p.clientLeft+parseFloat(O.paddingLeft))*b.x,A=S.top+(p.clientTop+parseFloat(O.paddingTop))*b.y;c*=b.x,u*=b.y,h*=b.x,d*=b.y,c+=E,u+=A,g=rt(p),p=Ze(g)}}return Ee({width:h,height:d,x:c,y:u})}function De(e,t){const n=Ne(e).scrollLeft;return t?t.left+n:Nt(pt(e)).left+n}function $r(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-De(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function wa(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=pt(r),a=t?ke(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=ft(1);const h=ft(0),d=gt(r);if((d||!d&&!s)&&((Yt(r)!=="body"||ue(i))&&(c=Ne(r)),gt(r))){const f=Nt(r);u=Lt(r),h.x=f.x+r.clientLeft,h.y=f.y+r.clientTop}const m=i&&!d&&!s?$r(i,c):ft(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+h.x+m.x,y:n.y*u.y-c.scrollTop*u.y+h.y+m.y}}function xa(e){return Array.from(e.getClientRects())}function Sa(e){const t=pt(e),n=Ne(e),r=e.ownerDocument.body,o=et(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=et(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+De(e);const a=-n.scrollTop;return at(r).direction==="rtl"&&(i+=et(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Yn=25;function Aa(e,t){const n=rt(e),r=pt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const h=Sn();(!h||h&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=De(r);if(u<=0){const h=r.ownerDocument,d=h.body,m=getComputedStyle(d),f=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-f);g<=Yn&&(s-=g)}else u<=Yn&&(s+=u);return{width:s,height:i,x:a,y:c}}const Oa=new Set(["absolute","fixed"]);function Ea(e,t){const n=Nt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=gt(e)?Lt(e):ft(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function Xn(e,t,n){let r;if(t==="viewport")r=Aa(e,n);else if(t==="document")r=Sa(pt(e));else if(st(t))r=Ea(t,n);else{const o=Qr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ee(r)}function to(e,t){const n=xt(e);return n===t||!st(n)||zt(n)?!1:at(n).position==="fixed"||to(n,t)}function Ca(e,t){const n=t.get(e);if(n)return n;let r=re(e,[],!1).filter(a=>st(a)&&Yt(a)!=="body"),o=null;const s=at(e).position==="fixed";let i=s?xt(e):e;for(;st(i)&&!zt(i);){const a=at(i),c=xn(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Oa.has(o.position)||ue(i)&&!c&&to(e,i))?r=r.filter(h=>h!==i):o=a,i=xt(i)}return t.set(e,r),r}function Pa(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?ke(t)?[]:Ca(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((u,h)=>{const d=Xn(t,h,o);return u.top=et(d.top,u.top),u.right=wt(d.right,u.right),u.bottom=wt(d.bottom,u.bottom),u.left=et(d.left,u.left),u},Xn(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ta(e){const{width:t,height:n}=Jr(e);return{width:t,height:n}}function Ma(e,t,n){const r=gt(t),o=pt(t),s=n==="fixed",i=Nt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=ft(0);function u(){c.x=De(o)}if(r||!r&&!s)if((Yt(t)!=="body"||ue(o))&&(a=Ne(t)),r){const f=Nt(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&u();s&&!r&&o&&u();const h=o&&!r&&!s?$r(o,a):ft(0),d=i.left+a.scrollLeft-c.x-h.x,m=i.top+a.scrollTop-c.y-h.y;return{x:d,y:m,width:i.width,height:i.height}}function Ke(e){return at(e).position==="static"}function qn(e,t){if(!gt(e)||at(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return pt(e)===n&&(n=n.ownerDocument.body),n}function eo(e,t){const n=rt(e);if(ke(e))return n;if(!gt(e)){let o=xt(e);for(;o&&!zt(o);){if(st(o)&&!Ke(o))return o;o=xt(o)}return n}let r=qn(e,t);for(;r&&da(r)&&Ke(r);)r=qn(r,t);return r&&zt(r)&&Ke(r)&&!xn(r)?n:r||ma(e)||n}const Fa=async function(e){const t=this.getOffsetParent||eo,n=this.getDimensions,r=await n(e.floating);return{reference:Ma(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ia(e){return at(e).direction==="rtl"}const Ra={convertOffsetParentRelativeRectToViewportRelativeRect:wa,getDocumentElement:pt,getClippingRect:Pa,getOffsetParent:eo,getElementRects:Fa,getClientRects:xa,getDimensions:Ta,getScale:Lt,isElement:st,isRTL:Ia};function no(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ka(e,t){let n=null,r;const o=pt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:h,top:d,width:m,height:f}=u;if(a||t(),!m||!f)return;const g=fe(d),p=fe(o.clientWidth-(h+m)),b=fe(o.clientHeight-(d+f)),S=fe(h),E={rootMargin:-g+"px "+-p+"px "+-b+"px "+-S+"px",threshold:et(0,wt(1,c))||1};let A=!0;function I(F){const _=F[0].intersectionRatio;if(_!==c){if(!A)return i();_?i(!1,_):r=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!no(u,e.getBoundingClientRect())&&i(),A=!1}try{n=new IntersectionObserver(I,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(I,E)}n.observe(e)}return i(!0),s}function Na(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=An(e),h=o||s?[...u?re(u):[],...re(t)]:[];h.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),s&&S.addEventListener("resize",n)});const d=u&&a?ka(u,n):null;let m=-1,f=null;i&&(f=new ResizeObserver(S=>{let[O]=S;O&&O.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=f)==null||E.observe(t)})),n()}),u&&!c&&f.observe(u),f.observe(t));let g,p=c?Nt(e):null;c&&b();function b(){const S=Nt(e);p&&!no(p,S)&&n(),p=S,g=requestAnimationFrame(b)}return n(),()=>{var S;h.forEach(O=>{o&&O.removeEventListener("scroll",n),s&&O.removeEventListener("resize",n)}),d?.(),(S=f)==null||S.disconnect(),f=null,c&&cancelAnimationFrame(g)}}const Da=ia,_a=sa,Ba=na,La=ca,Wa=ra,Ka=ea,Va=aa,za=(e,t,n)=>{const r=new Map,o={platform:Ra,...n},s={...o.platform,_c:r};return ta(e,t,{...o,platform:s})};function Ft(e){return typeof e=="function"?e():e}function ro(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zn(e,t){const n=ro(e);return Math.round(t*n)/n}function xc(e){return{[`--bits-${e}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${e}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${e}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${e}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${e}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function Ha(e){const t=e.whileElementsMounted,n=x(()=>Ft(e.open)??!0),r=x(()=>Ft(e.middleware)),o=x(()=>Ft(e.transform)??!0),s=x(()=>Ft(e.placement)??"bottom"),i=x(()=>Ft(e.strategy)??"absolute"),a=x(()=>Ft(e.sideOffset)??0),c=x(()=>Ft(e.alignOffset)??0),u=e.reference;let h=T(0),d=T(0);const m=ut(null);let f=T(Bt(l(i))),g=T(Bt(l(s))),p=T(Bt({})),b=T(!1),S=!1;const O=x(()=>{const R=m.current?Zn(m.current,l(h)):l(h),K=m.current?Zn(m.current,l(d)):l(d);return l(o)?{position:l(f),left:"0",top:"0",transform:`translate(${R}px, ${K}px)`,...m.current&&ro(m.current)>=1.5&&{willChange:"transform"}}:{position:l(f),left:`${R}px`,top:`${K}px`}});let E;function A(){u.current===null||m.current===null||za(u.current,m.current,{middleware:l(r),placement:l(s),strategy:l(i)}).then(R=>{const K=u.current;if(ja(K)){y(p,{...l(p),hide:{...l(p).hide,referenceHidden:!0}},!0);return}if(!l(n)&&l(h)!==0&&l(d)!==0){const G=Math.max(Math.abs(l(a)),Math.abs(l(c)),15);if(R.x<=G&&R.y<=G)return}y(h,R.x,!0),y(d,R.y,!0),y(f,R.strategy,!0),y(g,R.placement,!0),y(p,R.middlewareData,!0),y(b,!0)})}function I(){typeof E=="function"&&(E(),E=void 0)}function F(){if(I(),t===void 0){A();return}l(n)&&(u.current===null||m.current===null||(E=t(u.current,m.current,A)))}function _(){l(n)||y(b,!1)}function j(){return[l(r),l(s),l(i),l(a),l(c),l(n)]}return Z(()=>{t===void 0&&l(n)&&A()}),Z(F),Z(()=>{if(t!==void 0){if(j(),!l(n)){S=!1;return}if(!l(b)){S=!1;return}if(!S){S=!0;return}A()}}),Z(_),Z(()=>I),{floating:m,reference:u,get strategy(){return l(f)},get placement(){return l(g)},get middlewareData(){return l(p)},get isPositioned(){return l(b)},get floatingStyles(){return l(O)},get update(){return A}}}function ja(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}const Ua={top:"bottom",right:"left",bottom:"top",left:"right"},On=new Pt("Floating.Root"),Jn=new Pt("Floating.Content"),En=new Pt("Floating.Root");class Ce{static create(t=!1){return t?En.set(new Ce):On.set(new Ce)}anchorNode=ut(null);customAnchorNode=ut(null);triggerNode=ut(null);constructor(){Z(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class Pe{static create(t,n=!1){return n?Jn.set(new Pe(t,En.get())):Jn.set(new Pe(t,On.get()))}opts;root;contentRef=ut(null);wrapperRef=ut(null);arrowRef=ut(null);contentAttachment=Q(this.contentRef);wrapperAttachment=Q(this.wrapperRef);arrowAttachment=Q(this.arrowRef);arrowId=ut(vn());#t=x(()=>{if(typeof this.opts.style=="string")return te(this.opts.style);if(!this.opts.style)return{}});#e=void 0;#n=new ii(()=>this.arrowRef.current??void 0);#r=x(()=>this.#n?.width??0);#o=x(()=>this.#n?.height??0);#i=x(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#a=x(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=x(()=>l(this.#a).length>0);get hasExplicitBoundaries(){return l(this.#s)}set hasExplicitBoundaries(t){y(this.#s,t)}#c=x(()=>({padding:this.opts.collisionPadding.current,boundary:l(this.#a).filter(Ai),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return l(this.#c)}set detectOverflowOptions(t){y(this.#c,t)}#l=T(void 0);#u=T(void 0);#d=T(void 0);#h=T(void 0);#g=x(()=>[Da({mainAxis:this.opts.sideOffset.current+l(this.#o),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&_a({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?Va():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&Ba({...this.detectOverflowOptions}),La({...this.detectOverflowOptions,apply:({rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:s}=t.reference;y(this.#l,n,!0),y(this.#u,r,!0),y(this.#d,o,!0),y(this.#h,s,!0)}}),this.arrowRef.current&&Ka({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),Ga({arrowWidth:l(this.#r),arrowHeight:l(this.#o)}),this.opts.hideWhenDetached.current&&Wa({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return l(this.#g)}set middleware(t){y(this.#g,t)}floating;#p=x(()=>Ya(this.floating.placement));get placedSide(){return l(this.#p)}set placedSide(t){y(this.#p,t)}#m=x(()=>Xa(this.floating.placement));get placedAlign(){return l(this.#m)}set placedAlign(t){y(this.#m,t)}#f=x(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return l(this.#f)}set arrowX(t){y(this.#f,t)}#v=x(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return l(this.#v)}set arrowY(t){y(this.#v,t)}#y=x(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return l(this.#y)}set cannotCenterArrow(t){y(this.#y,t)}#b=T();get contentZIndex(){return l(this.#b)}set contentZIndex(t){y(this.#b,t,!0)}#w=x(()=>Ua[this.placedSide]);get arrowBaseSide(){return l(this.#w)}set arrowBaseSide(t){y(this.#w,t)}#x=x(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${l(this.#l)}px`,"--bits-floating-available-height":`${l(this.#u)}px`,"--bits-floating-anchor-width":`${l(this.#d)}px`,"--bits-floating-anchor-height":`${l(this.#h)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...l(this.#t)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return l(this.#x)}set wrapperProps(t){y(this.#x,t)}#S=x(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:ir({...l(this.#t)}),...this.contentAttachment}));get props(){return l(this.#S)}set props(t){y(this.#S,t)}#A=x(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return l(this.#A)}set arrowStyle(t){y(this.#A,t)}constructor(t,n){this.opts=t,this.root=n,this.#e=t.updatePositionStrategy,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),H(()=>t.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=Ha({strategy:()=>this.opts.strategy.current,placement:()=>l(this.#i),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>Na(...r,{animationFrame:this.#e?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),Z(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),H(()=>this.contentRef.current,r=>{if(!r||!this.opts.enabled.current)return;const o=Qe(r),s=o.requestAnimationFrame(()=>{if(this.contentRef.current!==r||!this.opts.enabled.current)return;const i=o.getComputedStyle(r).zIndex;i!==this.contentZIndex&&(this.contentZIndex=i)});return()=>{o.cancelAnimationFrame(s)}}),Z(()=>{this.floating.floating.current=this.wrapperRef.current})}}class Te{static create(t,n=!1){return n?new Te(t,En.get()):new Te(t,On.get())}opts;root;constructor(t,n){this.opts=t,this.root=n,t.virtualEl&&t.virtualEl.current?n.triggerNode=nr(t.virtualEl.current):n.triggerNode=t.ref}}function Ga(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,h]=Cn(n),d={start:"0%",center:"50%",end:"100%"}[h],m=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+c/2;let g="",p="";return u==="bottom"?(g=i?d:`${m}px`,p=`${-c}px`):u==="top"?(g=i?d:`${m}px`,p=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,p=i?d:`${f}px`):u==="left"&&(g=`${r.floating.width+c}px`,p=i?d:`${f}px`),{data:{x:g,y:p}}}}}function Cn(e){const[t,n="center"]=e.split("-");return[t,n]}function Ya(e){return Cn(e)[0]}function Xa(e){return Cn(e)[1]}function Sc(e,t){k(t,!0);let n=v(t,"tooltip",3,!1);Ce.create(n());var r=M(),o=P(r);D(o,()=>t.children??L),C(e,r),N()}function Ac(e,t){k(t,!0);let n=v(t,"tooltip",3,!1);Te.create({id:w(()=>t.id),virtualEl:w(()=>t.virtualEl),ref:t.ref},n());var r=M(),o=P(r);D(o,()=>t.children??L),C(e,r),N()}function qa(e,t){k(t,!0);let n=v(t,"side",3,"bottom"),r=v(t,"sideOffset",3,0),o=v(t,"align",3,"center"),s=v(t,"alignOffset",3,0),i=v(t,"arrowPadding",3,0),a=v(t,"avoidCollisions",3,!0),c=v(t,"collisionBoundary",19,()=>[]),u=v(t,"collisionPadding",3,0),h=v(t,"hideWhenDetached",3,!1),d=v(t,"onPlaced",3,()=>{}),m=v(t,"sticky",3,"partial"),f=v(t,"updatePositionStrategy",3,"optimized"),g=v(t,"strategy",3,"fixed"),p=v(t,"dir",3,"ltr"),b=v(t,"style",19,()=>({})),S=v(t,"wrapperId",19,vn),O=v(t,"customAnchor",3,null),E=v(t,"tooltip",3,!1);const A=Pe.create({side:w(()=>n()),sideOffset:w(()=>r()),align:w(()=>o()),alignOffset:w(()=>s()),id:w(()=>t.id),arrowPadding:w(()=>i()),avoidCollisions:w(()=>a()),collisionBoundary:w(()=>c()),collisionPadding:w(()=>u()),hideWhenDetached:w(()=>h()),onPlaced:w(()=>d()),sticky:w(()=>m()),updatePositionStrategy:w(()=>f()),strategy:w(()=>g()),dir:w(()=>p()),style:w(()=>b()),enabled:w(()=>t.enabled),wrapperId:w(()=>S()),customAnchor:w(()=>O())},E()),I=x(()=>tt(A.wrapperProps,{style:{pointerEvents:"auto"}}));var F=M(),_=P(F);D(_,()=>t.content??L,()=>({props:A.props,wrapperProps:l(I)})),C(e,F),N()}function Za(e,t){k(t,!0),bo(()=>{t.onPlaced?.()});var n=M(),r=P(n);D(r,()=>t.content??L,()=>({props:{},wrapperProps:{}})),C(e,n),N()}function Ja(e,t){let n=v(t,"isStatic",3,!1),r=W(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var o=M(),s=P(o);{var i=c=>{Za(c,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},a=c=>{qa(c,J({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};nt(s,c=>{n()?c(i):c(a,!1)})}C(e,o)}var Qa=ct("<!> <!>",1);function oo(e,t){k(t,!0);let n=v(t,"interactOutsideBehavior",3,"close"),r=v(t,"trapFocus",3,!0),o=v(t,"isValidEvent",3,()=>!1),s=v(t,"customAnchor",3,null),i=v(t,"isStatic",3,!1),a=v(t,"tooltip",3,!1),c=v(t,"contentPointerEvents",3,"auto"),u=W(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);Ja(e,{get isStatic(){return i()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get enabled(){return t.enabled},get tooltip(){return a()},content:(d,m)=>{let f=()=>m?.().props,g=()=>m?.().wrapperProps;var p=Qa(),b=P(p);{var S=A=>{Se(A,{get preventScroll(){return t.preventScroll}})},O=A=>{Se(A,{get preventScroll(){return t.preventScroll}})};nt(b,A=>{t.forceMount&&t.enabled?A(S):t.forceMount||A(O,1)})}var E=ge(b,2);jr(E,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(I,F)=>{let _=()=>F?.().props;Hr(I,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(j,R)=>{zr(j,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return n()},get isValidEvent(){return o()},get enabled(){return t.enabled},get ref(){return t.ref},children:(U,G)=>{let ot=()=>G?.().props;Ur(U,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(z,it)=>{var $=M(),Y=P($);{let X=x(()=>({props:tt(u,f(),ot(),_(),{style:{pointerEvents:c()}}),wrapperProps:g()}));D(Y,()=>t.popper??L,()=>l(X))}C(z,$)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),C(d,p)},$$slots:{content:!0}}),N()}function Oc(e,t){let n=v(t,"interactOutsideBehavior",3,"close"),r=v(t,"trapFocus",3,!0),o=v(t,"isValidEvent",3,()=>!1),s=v(t,"customAnchor",3,null),i=v(t,"isStatic",3,!1),a=W(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var c=M(),u=P(c);{var h=d=>{oo(d,J({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return i()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>a))};nt(u,d=>{t.shouldRender&&d(h)})}C(e,c)}function Ec(e,t){let n=v(t,"interactOutsideBehavior",3,"close"),r=v(t,"trapFocus",3,!0),o=v(t,"isValidEvent",3,()=>!1),s=v(t,"customAnchor",3,null),i=v(t,"isStatic",3,!1),a=W(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);oo(e,J({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return i()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside}},()=>a,{forceMount:!0}))}function Cc(e,t){k(t,!0);let n=v(t,"open",15,!1),r=W(t,["$$slots","$$events","$$legacy","open"]);var o=M(),s=P(o);Et(s,()=>Ti,(i,a)=>{a(i,J(()=>r,{get open(){return n()},set open(c){n(c)}}))}),C(e,o),N()}function $a(e,t){let n=W(t,["$$slots","$$events","$$legacy"]);var r=M(),o=P(r);Et(o,()=>zi,(s,i)=>{i(s,J(()=>n))}),C(e,r)}function Pc(e,t){k(t,!0);let n=v(t,"ref",15,null),r=W(t,["$$slots","$$events","$$legacy","ref","class"]);var o=M(),s=P(o);{let i=x(()=>Ct("text-lg font-semibold",t.class));Et(s,()=>Fi,(a,c)=>{c(a,J({"data-slot":"alert-dialog-title",get class(){return l(i)}},()=>r,{get ref(){return n()},set ref(u){n(u)}}))})}C(e,o),N()}function Tc(e,t){k(t,!0);let n=v(t,"ref",15,null),r=W(t,["$$slots","$$events","$$legacy","ref","class"]);var o=M(),s=P(o);{let i=x(()=>t.class||Ct(er()));Et(s,()=>Ri,(a,c)=>{c(a,J({"data-slot":"alert-dialog-action",get class(){return l(i)}},()=>r,{get ref(){return n()},set ref(u){n(u)}}))})}C(e,o),N()}function Mc(e,t){k(t,!0);let n=v(t,"ref",15,null),r=W(t,["$$slots","$$events","$$legacy","ref","class"]);var o=M(),s=P(o);{let i=x(()=>t.class||Ct(er({variant:"ghost"})));Et(s,()=>Ni,(a,c)=>{c(a,J({"data-slot":"alert-dialog-cancel",get class(){return l(i)}},()=>r,{get ref(){return n()},set ref(u){n(u)}}))})}C(e,o),N()}var tc=ct("<div><!></div>");function Fc(e,t){k(t,!0);let n=v(t,"ref",15,null),r=W(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=tc();Ot(o,i=>({"data-slot":"alert-dialog-footer",class:i,...r}),[()=>Ct("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t.class)]);var s=St(o);D(s,()=>t.children??L),At(o),tr(o,i=>n(i),()=>n()),C(e,o),N()}var ec=ct("<div><!></div>");function Ic(e,t){k(t,!0);let n=v(t,"ref",15,null),r=W(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=ec();Ot(o,i=>({"data-slot":"alert-dialog-header",class:i,...r}),[()=>Ct("flex flex-col gap-2 text-center sm:text-start",t.class)]);var s=St(o);D(s,()=>t.children??L),At(o),tr(o,i=>n(i),()=>n()),C(e,o),N()}function nc(e,t){k(t,!0);let n=v(t,"ref",15,null),r=W(t,["$$slots","$$events","$$legacy","ref","class"]);var o=M(),s=P(o);{let i=x(()=>Ct("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t.class));Et(s,()=>Ws,(a,c)=>{c(a,J({"data-slot":"alert-dialog-overlay",get class(){return l(i)}},()=>r,{get ref(){return n()},set ref(u){n(u)}}))})}C(e,o),N()}var rc=ct("<!> <!>",1);function Rc(e,t){k(t,!0);let n=v(t,"ref",15,null),r=W(t,["$$slots","$$events","$$legacy","ref","class","portalProps"]);$a(e,J(()=>t.portalProps,{children:(o,s)=>{var i=rc(),a=P(i);nc(a,{});var c=ge(a,2);{let u=x(()=>Ct("bg-[var(--color-bg-elevated)] border-[var(--color-border)] text-[var(--color-text-primary)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t.class));Et(c,()=>Bs,(h,d)=>{d(h,J({"data-slot":"alert-dialog-content",get class(){return l(u)}},()=>r,{get ref(){return n()},set ref(m){n(m)}}))})}C(o,i)},$$slots:{default:!0}})),N()}function kc(e,t){k(t,!0);let n=v(t,"ref",15,null),r=W(t,["$$slots","$$events","$$legacy","ref","class"]);var o=M(),s=P(o);{let i=x(()=>Ct("text-[var(--color-text-secondary)] text-sm",t.class));Et(s,()=>Vs,(a,c)=>{c(a,J({"data-slot":"alert-dialog-description",get class(){return l(i)}},()=>r,{get ref(){return n()},set ref(u){n(u)}}))})}C(e,o),N()}export{Ws as $,Rc as A,Tc as B,Pt as C,$e as D,Ie as E,Ac as F,Cc as G,Lr as H,Kr as I,_r as J,Nr as K,pc as L,wc as M,Wr as N,Dr as O,Ue as P,dn as Q,Vr as R,jt as S,zi as T,en as U,sn as V,jr as W,Hr as X,zr as Y,Ur as Z,Se as _,Q as a,Fi as a0,ir as a1,Rr as a2,Ir as a3,ps as a4,pe as a5,ne as a6,vi as a7,mi as a8,hr as a9,pi as aa,fr as ab,mc as ac,vc as ad,yc as ae,bc as af,_t as ag,Nn as ah,fc as ai,lt as aj,Ei as ak,Ao as al,mr as am,Oo as an,Vs as ao,Kt as b,tn as c,dr as d,fs as e,Ut as f,hc as g,w as h,ht as i,se as j,je as k,gc as l,tt as m,Fe as n,un as o,B as p,Ec as q,Oc as r,xc as s,Sc as t,Ic as u,Pc as v,H as w,kc as x,Fc as y,Mc as z};
@@ -1 +0,0 @@
1
- import{l as o,a as r}from"../chunks/CJdAJOAi.js";export{o as load_css,r as start};
@@ -1,11 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DnL9f0lc.js","../chunks/CX_61fY8.js","../chunks/CscoF-YL.js","../chunks/D7ZqAKi9.js","../chunks/C7VoTosa.js","../chunks/CrdV0ttd.js","../chunks/CWQRQXxy.js","../chunks/B340SUKR.js","../chunks/C3RWu-3l.js","../chunks/CLFba8FK.js","../chunks/BoQu2xcr.js","../chunks/PPVm8Dsz.js","../chunks/BenpwI6m.js","../chunks/CJdAJOAi.js","../chunks/BjAmYrTY.js","../chunks/CieeblIr.js","../chunks/B0qTqRR8.js","../chunks/CDFdgZ9U.js","../chunks/COik51fd.js","../chunks/i9c_RUF6.js"])))=>i.map(i=>d[i]);
2
- import{h as Bt,w as ut,k as Ht}from"../chunks/BjAmYrTY.js";import{_ as qe}from"../chunks/PPVm8Dsz.js";import{d as vt,e as ze,g as Ze,a as h,c as Re,t as ot,s as pe,b as j,f as $e}from"../chunks/COik51fd.js";import{p as He,e as Ee,f as it,a2 as rt,aE as Yt,c as A,a3 as W,r as w,g as t,s as E,b as Ye,a0 as he,n as je,t as de,a4 as ke,l as Ge,d as Ne,a as ht,m as Qe,a1 as Zt,aD as Jt,aF as Vt,ax as Gt,a7 as Qt,bt as Xt}from"../chunks/BenpwI6m.js";import{i as ce,b as ct}from"../chunks/Dvv4bkXH.js";import{e as Ue,i as Be}from"../chunks/h2NtTN7K.js";import{c as Te}from"../chunks/CbwDFpOn.js";import{s as lt,c as $t}from"../chunks/CieeblIr.js";import{p as Oe,l as Xe,a as ea,b as ta}from"../chunks/wWaI7EIw.js";import{g as ft,i as aa}from"../chunks/CJdAJOAi.js";import{A as St,p as ra}from"../chunks/DgjlIhdd.js";import{a as xt,V as na}from"../chunks/ujukzxos.js";import{r as nt,a as pt,c as We,d as dt,b as At}from"../chunks/CStpN6HQ.js";import{b as qt,B as Je}from"../chunks/DAD7hf2c.js";import{e as mt,f as at,A as ia}from"../chunks/CdeYcEuU.js";import{a as Pt,b as Rt,S as Tt,R as Dt}from"../chunks/B17cx9Sm.js";import{T as sa,P as oa,C as la,I as zt,S as ua,a as Et,R as da,p as Lt,b as ca}from"../chunks/D4U_ZqJF.js";import{i as _t}from"../chunks/BSBiehHY.js";import{T as fa,j as va,r as ha}from"../chunks/BC12QVnT.js";import{C as wt,a as Wt}from"../chunks/DtsqpIgr.js";import{A as pa,C as Ot}from"../chunks/CLw5zKi0.js";import{g as _a}from"../chunks/CqkleIqs.js";import{n as kt}from"../chunks/CDFdgZ9U.js";import{e as Ke,r as ga}from"../chunks/BoQu2xcr.js";import{chatStore as ma}from"../chunks/D9gozPE-.js";import{A as ya,u as ba,v as wa,x as ka,y as xa,z as Ea,G as Ca}from"../chunks/DkilSMcP.js";import{a as Ft}from"../chunks/B0qTqRR8.js";const Sa=async({params:J,fetch:e})=>{const{repo:i,type:s,id:p}=J,R=await Bt(i,s,p);return{repo:i,type:s,id:p,entity:R}},Zn=Object.freeze(Object.defineProperty({__proto__:null,load:Sa},Symbol.toStringTag,{value:"Module"}));var Aa=j('<span class="chip svelte-84vb17"> <!></span>'),Pa=j('<div><span class="entity-title svelte-84vb17"> </span> <span class="entity-meta svelte-84vb17"><span class="entity-type-badge svelte-84vb17"> </span> <span class="entity-repo svelte-84vb17"> </span></span></div>'),Ra=j('<div class="dropdown svelte-84vb17"></div>'),Ta=j('<div class="autocomplete svelte-84vb17"><div class="input-row svelte-84vb17"><!> <input class="ac-input svelte-84vb17" type="text" placeholder="Search entities..."/></div> <!></div>');function Da(J,e){He(e,!0);let i=Oe(e,"multi",3,!1),s=Ee(""),p=Ee(0),R;const _=ke(()=>ut.repos.flatMap(P=>P.entities.map(k=>({id:k.id,title:k.title,entityType:k.entityType,repo:P.name})))),C=ke(()=>()=>{const P=t(s).toLowerCase().trim();return P?t(_).filter(k=>k.title.toLowerCase().includes(P)||k.id.toLowerCase().includes(P)).slice(0,20):t(_).slice(0,20)}),x=Array.isArray(e.value)?[...e.value]:e.value?[e.value]:[];let c=Ee(it(x));rt(()=>{Yt().then(()=>R?.focus())});function L(P){i()?(t(c).includes(P)||E(c,[...t(c),P],!0),E(s,""),E(p,0),R?.focus()):e.onselect(P)}function N(P){E(c,t(c).filter(k=>k!==P),!0)}function S(){t(c).length===x.length&&t(c).every((k,a)=>k===x[a])?e.oncancel():e.onselect(t(c))}function M(P){const k=t(C)();P.key==="ArrowDown"?(P.preventDefault(),E(p,Math.min(t(p)+1,k.length-1),!0)):P.key==="ArrowUp"?(P.preventDefault(),E(p,Math.max(t(p)-1,0),!0)):P.key==="Enter"?(P.preventDefault(),k.length>0?L(k[t(p)].id):i()&&S()):P.key==="Escape"?i()&&t(c).length>0?S():e.oncancel():P.key==="Backspace"&&!t(s)&&i()&&t(c).length>0&&E(c,t(c).slice(0,-1),!0)}var me=Ta(),G=A(me),ne=A(G);{var ye=P=>{var k=Re(),a=he(k);Ue(a,17,()=>t(c),Be,(r,o)=>{var f=Aa(),g=A(f),K=W(g);Je(K,{variant:"ghost",size:"icon",class:"chip-remove",onclick:()=>N(t(o)),children:(ve,be)=>{je();var b=ot("×");h(ve,b)},$$slots:{default:!0}}),w(f),de(()=>pe(g,`${t(o)??""} `)),h(r,f)}),h(P,k)};ce(ne,P=>{i()&&P(ye)})}var oe=W(ne,2);nt(oe),ct(oe,P=>R=P,()=>R),w(G);var le=W(G,2);{var _e=P=>{var k=Ra();Ue(k,21,()=>t(C)(),Be,(a,r,o)=>{var f=Pa();let g;var K=A(f),ve=A(K,!0);w(K);var be=W(K,2),b=A(be),l=A(b,!0);w(b);var d=W(b,2),F=A(d,!0);w(d),w(be),w(f),de(()=>{g=lt(f,1,"dropdown-item svelte-84vb17",null,g,{highlighted:o===t(p)}),pe(ve,t(r).title),pe(l,t(r).entityType),pe(F,t(r).repo)}),ze("mousedown",f,X=>{X.preventDefault(),L(t(r).id)}),Ze("mouseenter",f,()=>E(p,o,!0)),h(a,f)}),w(k),h(P,k)},se=ke(()=>t(C)().length>0);ce(le,P=>{t(se)&&P(_e)})}w(me),ze("keydown",oe,M),Ze("blur",oe,()=>{setTimeout(()=>{i()&&t(c).length>0?S():i()||e.oncancel()},150)}),qt(oe,()=>t(s),P=>E(s,P)),h(J,me),Ye()}vt(["keydown","mousedown"]);var za=$e("<title> </title>"),La=$e('<svg><!><circle cx="16" cy="16" r="10"></circle><path d="M16,30A14,14,0,1,1,30,16,14.0158,14.0158,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12.0137,12.0137,0,0,0,16,4Z"></path></svg>');function yt(J,e){const i=Xe(e,["children","$$slots","$$events","$$legacy"]),s=Xe(i,["size","title"]);He(e,!1);const p=Qe(),R=Qe();let _=Oe(e,"size",8,16),C=Oe(e,"title",8,void 0);Ge(()=>(Ne(i),Ne(C())),()=>{E(p,i["aria-label"]||i["aria-labelledby"]||C())}),Ge(()=>(t(p),Ne(i)),()=>{E(R,{"aria-hidden":t(p)?void 0:!0,role:t(p)?"img":void 0,focusable:Number(i.tabindex)===0?!0:void 0})}),ht(),_t();var x=La();pt(x,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:_(),height:_(),...t(R),...s}));var c=A(x);{var L=N=>{var S=za(),M=A(S,!0);w(S),de(()=>pe(M,C())),h(N,S)};ce(c,N=>{C()&&N(L)})}je(2),w(x),h(J,x),Ye()}var Oa=$e("<title> </title>"),Fa=$e('<svg><!><path d="M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"></path><path d="M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"></path></svg>');function Ct(J,e){const i=Xe(e,["children","$$slots","$$events","$$legacy"]),s=Xe(i,["size","title"]);He(e,!1);const p=Qe(),R=Qe();let _=Oe(e,"size",8,16),C=Oe(e,"title",8,void 0);Ge(()=>(Ne(i),Ne(C())),()=>{E(p,i["aria-label"]||i["aria-labelledby"]||C())}),Ge(()=>(t(p),Ne(i)),()=>{E(R,{"aria-hidden":t(p)?void 0:!0,role:t(p)?"img":void 0,focusable:Number(i.tabindex)===0?!0:void 0})}),ht(),_t();var x=Fa();pt(x,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:_(),height:_(),...t(R),...s}));var c=A(x);{var L=N=>{var S=Oa(),M=A(S,!0);w(S),de(()=>pe(M,C())),h(N,S)};ce(c,N=>{C()&&N(L)})}je(2),w(x),h(J,x),Ye()}var Ma=$e("<title> </title>"),Ia=$e('<svg><!><path d="M26,28H6a2.0027,2.0027,0,0,1-2-2V6A2.0027,2.0027,0,0,1,6,4H16V6H6V26H26V16h2V26A2.0027,2.0027,0,0,1,26,28Z"></path><path d="M20 2 20 4 26.586 4 18 12.586 19.414 14 28 5.414 28 12 30 12 30 2 20 2z"></path></svg>');function Mt(J,e){const i=Xe(e,["children","$$slots","$$events","$$legacy"]),s=Xe(i,["size","title"]);He(e,!1);const p=Qe(),R=Qe();let _=Oe(e,"size",8,16),C=Oe(e,"title",8,void 0);Ge(()=>(Ne(i),Ne(C())),()=>{E(p,i["aria-label"]||i["aria-labelledby"]||C())}),Ge(()=>(t(p),Ne(i)),()=>{E(R,{"aria-hidden":t(p)?void 0:!0,role:t(p)?"img":void 0,focusable:Number(i.tabindex)===0?!0:void 0})}),ht(),_t();var x=Ia();pt(x,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:_(),height:_(),...t(R),...s}));var c=A(x);{var L=N=>{var S=Ma(),M=A(S,!0);w(S),de(()=>pe(M,C())),h(N,S)};ce(c,N=>{C()&&N(L)})}je(2),w(x),h(J,x),Ye()}var ja=j(" <!>",1),Ka=j("<!> Remove",1),Ua=j("<!> <!> <!>",1),Na=j("<!> <!>",1),Va=j('<span class="dot svelte-eh8ho9"></span> <span> </span>',1),qa=j('<span class="dot svelte-eh8ho9"></span> <span> </span> <!>',1),Wa=j("<!> <!>",1),Ba=j('<span class="dot svelte-eh8ho9"></span> ',1),Ha=j('<span class="dot svelte-eh8ho9"></span> <span> </span>',1),Ya=j('<span class="dot svelte-eh8ho9"></span> <span> </span> <!>',1),Za=j("<!> <!>",1),Ja=j('<span class="dot svelte-eh8ho9"></span> ',1),Ga=j('<span class="date-display svelte-eh8ho9"> </span>'),Qa=j('<div class="date-edit svelte-eh8ho9"><input class="edit-input date-input svelte-eh8ho9" type="date"/> <!></div>'),Xa=j('<span class="date-value svelte-eh8ho9"> </span>'),$a=j('<input class="wikilink-input svelte-eh8ho9" type="text" readonly=""/>'),er=j('<div class="wikilink-display svelte-eh8ho9"><!> <!></div>'),tr=j('<input class="edit-input svelte-eh8ho9" type="url" placeholder="https://..."/>'),ar=j('<a class="url-link svelte-eh8ho9" target="_blank" rel="noopener noreferrer"> </a>'),rr=j('<span class="empty-hint svelte-eh8ho9">Empty</span>'),nr=j('<span class="url-display svelte-eh8ho9"><!></span>'),ir=j('<span class="badge-value svelte-eh8ho9"> </span>'),sr=j('<input class="edit-input svelte-eh8ho9" type="text" placeholder="Empty"/>'),or=j('<span class="text-value svelte-eh8ho9"> </span>'),lr=j('<div class="property-row svelte-eh8ho9"><div class="prop-icon svelte-eh8ho9"><!></div> <span class="prop-key svelte-eh8ho9"> </span> <div class="prop-value svelte-eh8ho9"><!></div></div>');function ur(J,e){He(e,!0);let i=Oe(e,"editable",3,!1),s=Oe(e,"protectedKeys",19,()=>new Set);const p=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"},{type:"url",label:"URL"}],R=["open","in-progress","done","cancelled","active","inactive","completed","draft","archived","current","former","won","lost","closed"];function _(){return typeof e.prop.value=="string"?e.prop.value:e.prop.value[0]??""}function C(v){switch(v.toLowerCase()){case"active":case"current":case"won":case"done":case"completed":return"#3ecf8e";case"in-progress":case"open":case"draft":return"#f0c246";case"inactive":case"lost":case"closed":case"former":case"cancelled":return"#e54d4d";default:return"#5c5c66"}}function x(v){return v.replace(/[-_]/g," ").replace(/\b\w/g,u=>u.toUpperCase())}function c(v){return v.replace(/_/g," ").replace(/\b\w/g,u=>u.toUpperCase())}function L(v){if(!v)return"";try{return new Date(v).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return v}}function N(v){for(const u of ut.repos){const O=u.entities.find(Q=>Q.id===v);if(O){ft(`/${u.name}/${O.entityType}/${O.id}`);return}}}let S=Ee(!1),M=Ee(null);function me(v){v!==_()&&e.onedit?.(e.prop.key,v),E(S,!1)}let G=Ee(!1);var ne=lr(),ye=A(ne),oe=A(ye);{var le=v=>{yt(v,{size:14})},_e=v=>{var u=Re(),O=he(u);Te(O,()=>da,(Q,V)=>{V(Q,{children:(T,m)=>{var y=Na(),te=he(y);Te(te,()=>sa,($,I)=>{I($,{class:"icon-trigger",children:(H,fe)=>{var B=Re(),Ae=he(B);{var n=q=>{xt(q,{size:14})},D=q=>{yt(q,{size:14})},ie=q=>{Ct(q,{size:14})},Y=q=>{Mt(q,{size:14})},ue=q=>{Et(q,{size:14})};ce(Ae,q=>{e.prop.type==="date"?q(n):e.prop.type==="status"?q(D,1):e.prop.type==="wikilink"?q(ie,2):e.prop.type==="url"?q(Y,3):q(ue,!1)})}h(H,B)},$$slots:{default:!0}})});var z=W(te,2);Te(z,()=>oa,($,I)=>{I($,{children:(H,fe)=>{var B=Re(),Ae=he(B);Te(Ae,()=>la,(n,D)=>{D(n,{class:"type-menu-content",sideOffset:4,align:"start",children:(ie,Y)=>{var ue=Ua(),q=he(ue);Ue(q,17,()=>p,Be,(U,ee)=>{var we=Re(),ge=he(we);Te(ge,()=>zt,(Ce,Pe)=>{Pe(Ce,{class:"type-menu-item",onSelect:()=>e.ontypechange?.(e.prop.key,t(ee).type),children:(xe,Se)=>{je();var Le=ja(),Fe=he(Le),De=W(Fe);{var Me=Ve=>{wt(Ve,{size:12})};ce(De,Ve=>{e.prop.type===t(ee).type&&Ve(Me)})}de(()=>pe(Fe,`${t(ee).label??""} `)),h(xe,Le)},$$slots:{default:!0}})}),h(U,we)});var ae=W(q,2);Te(ae,()=>ua,(U,ee)=>{ee(U,{})});var re=W(ae,2);Te(re,()=>zt,(U,ee)=>{ee(U,{class:"type-menu-item type-menu-danger",onSelect:()=>e.onremove?.(e.prop.key),children:(we,ge)=>{var Ce=Ka(),Pe=he(Ce);fa(Pe,{size:12}),je(),h(we,Ce)},$$slots:{default:!0}})}),h(ie,ue)},$$slots:{default:!0}})}),h(H,B)},$$slots:{default:!0}})}),h(T,y)},$$slots:{default:!0}})}),h(v,u)},se=ke(()=>i()&&e.prop.type!=="badge"&&!s().has(e.prop.key)),P=v=>{xt(v,{size:14})},k=v=>{yt(v,{size:14})},a=v=>{Ct(v,{size:14})},r=v=>{Mt(v,{size:14})},o=v=>{Et(v,{size:14})};ce(oe,v=>{e.prop.type==="entity-type"?v(le):t(se)?v(_e,1):e.prop.type==="date"?v(P,2):e.prop.type==="status"?v(k,3):e.prop.type==="wikilink"?v(a,4):e.prop.type==="url"?v(r,5):v(o,!1)})}w(ye);var f=W(ye,2),g=A(f,!0);w(f);var K=W(f,2),ve=A(K);{var be=v=>{var u=Re(),O=he(u);{var Q=T=>{var m=Re(),y=he(m);{let te=ke(_);Te(y,()=>Dt,(z,$)=>{$(z,{type:"single",get value(){return t(te)},onValueChange:I=>{I&&I!==_()&&e.onentitytypechange?.(I)},children:(I,H)=>{var fe=Wa(),B=he(fe);{let n=ke(()=>at(_()));Te(B,()=>Pt,(D,ie)=>{ie(D,{class:"status-trigger",get value(){return t(n)},children:(Y,ue)=>{var q=Va(),ae=he(q);let re;var U=W(ae,2),ee=A(U,!0);w(U),de((we,ge)=>{re=We(ae,"",re,we),pe(ee,ge)},[()=>({background:mt(_())}),()=>at(_())]),h(Y,q)},$$slots:{default:!0}})})}var Ae=W(B,2);Te(Ae,()=>Rt,(n,D)=>{D(n,{children:(ie,Y)=>{var ue=Re(),q=he(ue);Ue(q,17,()=>ia,Be,(ae,re)=>{var U=Re(),ee=he(U);{let we=ke(()=>at(t(re)));Te(ee,()=>Tt,(ge,Ce)=>{Ce(ge,{get value(){return t(re)},get label(){return t(we)},class:"dotted-item",children:(Pe,xe)=>{var Se=qa(),Le=he(Se);let Fe;var De=W(Le,2),Me=A(De,!0);w(De);var Ve=W(De,2);{var et=Ie=>{wt(Ie,{size:12,class:"item-check"})},tt=ke(()=>_()===t(re));ce(Ve,Ie=>{t(tt)&&Ie(et)})}de((Ie,st)=>{Fe=We(Le,"",Fe,Ie),pe(Me,st)},[()=>({background:mt(t(re))}),()=>at(t(re))]),h(Pe,Se)},$$slots:{default:!0}})})}h(ae,U)}),h(ie,ue)},$$slots:{default:!0}})}),h(I,fe)},$$slots:{default:!0}})})}h(T,m)},V=T=>{var m=Ba(),y=he(m);let te;var z=W(y);de(($,I)=>{te=We(y,"",te,$),pe(z,` ${I??""}`)},[()=>({background:mt(_())}),()=>at(_())]),h(T,m)};ce(O,T=>{i()?T(Q):T(V,!1)})}h(v,u)},b=v=>{var u=Re(),O=he(u);{var Q=T=>{var m=Re(),y=he(m);{let te=ke(_);Te(y,()=>Dt,(z,$)=>{$(z,{type:"single",get value(){return t(te)},onValueChange:I=>{I&&e.onedit?.(e.prop.key,I)},children:(I,H)=>{var fe=Za(),B=he(fe);{let n=ke(()=>x(_()));Te(B,()=>Pt,(D,ie)=>{ie(D,{class:"status-trigger",get value(){return t(n)},children:(Y,ue)=>{var q=Ha(),ae=he(q);let re;var U=W(ae,2),ee=A(U,!0);w(U),de((we,ge)=>{re=We(ae,"",re,we),pe(ee,ge)},[()=>({background:C(_())}),()=>x(_())]),h(Y,q)},$$slots:{default:!0}})})}var Ae=W(B,2);Te(Ae,()=>Rt,(n,D)=>{D(n,{children:(ie,Y)=>{var ue=Re(),q=he(ue);Ue(q,17,()=>R,Be,(ae,re)=>{var U=Re(),ee=he(U);{let we=ke(()=>x(t(re)));Te(ee,()=>Tt,(ge,Ce)=>{Ce(ge,{get value(){return t(re)},get label(){return t(we)},class:"dotted-item",children:(Pe,xe)=>{var Se=Ya(),Le=he(Se);let Fe;var De=W(Le,2),Me=A(De,!0);w(De);var Ve=W(De,2);{var et=Ie=>{wt(Ie,{size:12,class:"item-check"})},tt=ke(()=>_()===t(re));ce(Ve,Ie=>{t(tt)&&Ie(et)})}de((Ie,st)=>{Fe=We(Le,"",Fe,Ie),pe(Me,st)},[()=>({background:C(t(re))}),()=>x(t(re))]),h(Pe,Se)},$$slots:{default:!0}})})}h(ae,U)}),h(ie,ue)},$$slots:{default:!0}})}),h(I,fe)},$$slots:{default:!0}})})}h(T,m)},V=T=>{var m=Ja(),y=he(m);let te;var z=W(y);de(($,I)=>{te=We(y,"",te,$),pe(z,` ${I??""}`)},[()=>({background:C(_())}),()=>x(_())]),h(T,m)};ce(O,T=>{i()?T(Q):T(V,!1)})}h(v,u)},l=v=>{var u=Re(),O=he(u);{var Q=T=>{var m=Qa(),y=A(m);nt(y);var te=W(y,2);{var z=I=>{var H=Ga(),fe=A(H,!0);w(H),de(B=>pe(fe,B),[()=>L(_())]),h(I,H)},$=ke(()=>_());ce(te,I=>{t($)&&I(z)})}w(m),de(I=>dt(y,I),[_]),ze("change",y,I=>{e.onedit?.(e.prop.key,I.currentTarget.value)}),h(T,m)},V=T=>{var m=Xa(),y=A(m,!0);w(m),de(te=>pe(y,te),[()=>L(_())||"No date"]),h(T,m)};ce(O,T=>{i()?T(Q):T(V,!1)})}h(v,u)},d=v=>{var u=Re(),O=he(u);{var Q=T=>{{let m=ke(()=>Array.isArray(e.prop.value));Da(T,{get value(){return e.prop.value},get multi(){return t(m)},onselect:y=>{e.onedit?.(e.prop.key,y),E(G,!1)},oncancel:()=>{E(G,!1)}})}},V=T=>{var m=er(),y=A(m);Ue(y,17,()=>(Array.isArray(e.prop.value)?e.prop.value:[e.prop.value]).filter(Boolean),Be,($,I)=>{Je($,{variant:"ghost",class:"wikilink-chip",onclick:H=>{H.stopPropagation(),N(t(I))},children:(H,fe)=>{je();var B=ot();de(()=>pe(B,t(I))),h(H,B)},$$slots:{default:!0}})});var te=W(y,2);{var z=$=>{var I=$a();de(H=>At(I,"placeholder",H),[()=>_()?"":"Empty"]),Ze("focus",I,()=>{E(G,!0)}),h($,I)};ce(te,$=>{i()&&$(z)})}w(m),h(T,m)};ce(O,T=>{t(G)&&i()?T(Q):T(V,!1)})}h(v,u)},F=v=>{var u=Re(),O=he(u);{var Q=T=>{var m=tr();nt(m),ct(m,y=>E(M,y),()=>t(M)),de(y=>dt(m,y),[_]),Ze("blur",m,y=>{me(y.currentTarget.value)}),ze("keydown",m,y=>{y.key==="Enter"&&y.currentTarget.blur(),y.key==="Escape"&&E(S,!1)}),h(T,m)},V=T=>{var m=nr(),y=A(m);{var te=I=>{var H=ar(),fe=A(H,!0);w(H),de((B,Ae)=>{At(H,"href",B),pe(fe,Ae)},[_,_]),ze("click",H,B=>B.stopPropagation()),h(I,H)},z=ke(()=>_()),$=I=>{var H=rr();h(I,H)};ce(y,I=>{t(z)?I(te):i()&&I($,1)})}w(m),ze("click",m,()=>{i()&&(E(S,!0),requestAnimationFrame(()=>t(M)?.focus()))}),h(T,m)};ce(O,T=>{t(S)&&i()?T(Q):T(V,!1)})}h(v,u)},X=v=>{var u=ir(),O=A(u,!0);w(u),de(Q=>pe(O,Q),[_]),h(v,u)},Z=v=>{var u=Re(),O=he(u);{var Q=T=>{var m=sr();nt(m),de(y=>dt(m,y),[_]),Ze("focus",m,()=>{E(S,!0)}),Ze("blur",m,y=>{me(y.currentTarget.value)}),ze("keydown",m,y=>{y.key==="Enter"&&y.currentTarget.blur(),y.key==="Escape"&&(y.currentTarget.value=_(),y.currentTarget.blur())}),h(T,m)},V=T=>{var m=or(),y=A(m,!0);w(m),de(te=>pe(y,te),[_]),h(T,m)};ce(O,T=>{i()?T(Q):T(V,!1)})}h(v,u)};ce(ve,v=>{e.prop.type==="entity-type"?v(be):e.prop.type==="status"?v(b,1):e.prop.type==="date"?v(l,2):e.prop.type==="wikilink"?v(d,3):e.prop.type==="url"?v(F,4):e.prop.type==="badge"?v(X,5):v(Z,!1)})}w(K),w(ne),de(v=>pe(g,v),[()=>c(e.prop.key)]),ze("click",ye,v=>v.stopPropagation()),h(J,ne),Ye()}vt(["click","change","keydown"]);var dr=j('<input class="name-input svelte-1a2lez6" type="text"/>'),cr=j('<span class="name-text svelte-1a2lez6"> </span>'),fr=j('<div class="name-headline svelte-1a2lez6"><!></div>'),vr=j('<button class="fields-toggle svelte-1a2lez6"><span><!></span> <span class="fields-label svelte-1a2lez6">Fields</span> <span class="fields-count svelte-1a2lez6"> </span></button>'),hr=j('<div class="add-field-row svelte-1a2lez6"><input class="add-field-input svelte-1a2lez6" type="text" placeholder="Field name"/></div>'),pr=j("<!> <span>Add field</span>",1),_r=j('<div class="fields-list svelte-1a2lez6"><!> <!></div>'),gr=j('<div class="entity-properties svelte-1a2lez6"><!> <!> <!></div>');function mr(J,e){He(e,!0);let i=Oe(e,"editable",3,!1),s=Oe(e,"autofocusKey",3,null),p=Oe(e,"protectedKeys",19,()=>new Set);const R=ke(()=>e.properties.find(f=>f.key==="name")),_=ke(()=>e.properties.filter(f=>f.key!=="name"));let C=Ee(!1),x=Ee(null);const c=ke(()=>t(R)?typeof t(R).value=="string"?t(R).value:t(R).value[0]:"");function L(){i()&&(E(C,!0),requestAnimationFrame(()=>t(x)?.focus()))}function N(f){f!==t(c)&&e.onedit?.("name",f),E(C,!1)}rt(()=>{s()==="name"&&!t(C)&&L()});const S="sg-properties-expanded";let M=Ee(it(typeof localStorage<"u"?localStorage.getItem(S)==="true":!1));function me(){E(M,!t(M)),localStorage.setItem(S,t(M)?"true":"false")}let G=Ee(!1),ne=Ee(""),ye=Ee(null);function oe(){E(G,!0),E(ne,""),requestAnimationFrame(()=>t(ye)?.focus())}function le(){const f=t(ne).trim().toLowerCase().replace(/\s+/g,"_");f&&!e.properties.some(g=>g.key===f)&&e.onadd?.(f,""),E(G,!1),E(ne,"")}var _e=gr(),se=A(_e);{var P=f=>{var g=fr(),K=A(g);{var ve=b=>{var l=dr();nt(l),ct(l,d=>E(x,d),()=>t(x)),de(()=>dt(l,t(c))),Ze("blur",l,d=>N(d.currentTarget.value)),ze("keydown",l,d=>{d.key==="Enter"&&(N(d.currentTarget.value),e.onfocuseditor?.()),d.key==="Escape"&&E(C,!1)}),h(b,l)},be=b=>{var l=cr(),d=A(l,!0);w(l),de(()=>pe(d,t(c)||"Untitled")),h(b,l)};ce(K,b=>{t(C)?b(ve):b(be,!1)})}w(g),ze("click",g,L),h(f,g)};ce(se,f=>{t(R)&&f(P)})}var k=W(se,2);{var a=f=>{var g=vr(),K=A(g);let ve;var be=A(K);Wt(be,{size:14}),w(K);var b=W(K,4),l=A(b,!0);w(b),w(g),de(()=>{ve=lt(K,1,"fields-chevron svelte-1a2lez6",null,ve,{expanded:t(M)}),pe(l,t(_).length)}),ze("mousedown",g,d=>d.preventDefault()),ze("click",g,me),h(f,g)};ce(k,f=>{t(_).length>0&&f(a)})}var r=W(k,2);{var o=f=>{var g=_r(),K=A(g);Ue(K,17,()=>t(_),l=>l.key,(l,d)=>{ur(l,{get prop(){return t(d)},get editable(){return i()},get protectedKeys(){return p()},get onedit(){return e.onedit},get onremove(){return e.onremove},get ontypechange(){return e.ontypechange},get onentitytypechange(){return e.onentitytypechange}})});var ve=W(K,2);{var be=l=>{var d=hr(),F=A(d);nt(F),ct(F,X=>E(ye,X),()=>t(ye)),w(d),ze("keydown",F,X=>{X.key==="Enter"&&le(),X.key==="Escape"&&E(G,!1)}),Ze("blur",F,()=>{E(G,!1)}),qt(F,()=>t(ne),X=>E(ne,X)),h(l,d)},b=l=>{Je(l,{variant:"ghost",class:"add-field-btn",onclick:d=>{d.stopPropagation(),oe()},children:(d,F)=>{var X=pr(),Z=he(X);pa(Z,{size:16}),je(2),h(d,X)},$$slots:{default:!0}})};ce(ve,l=>{t(G)?l(be):i()&&l(b,1)})}w(g),h(f,g)};ce(r,f=>{t(M)&&f(o)})}w(_e),h(J,_e),Ye()}vt(["click","keydown","mousedown"]);var yr=j('<button class="connection-chip svelte-16xienp"><span class="chip-dot svelte-16xienp"></span> <span class="chip-name svelte-16xienp"> </span> <span class="chip-type svelte-16xienp"> </span></button>'),br=j('<div class="connections-body svelte-16xienp"></div>'),wr=j('<div class="connections-panel svelte-16xienp"><button class="connections-header svelte-16xienp"><span><!></span> <span class="header-label svelte-16xienp">Linked entities</span> <span class="header-count svelte-16xienp"> </span></button> <!></div>');function kr(J,e){He(e,!0);const i="sg-linked-entities-expanded";let s=Ee(it(typeof localStorage<"u"?localStorage.getItem(i)!=="true":!0));function p(){E(s,!t(s)),localStorage.setItem(i,t(s)?"false":"true")}const R=ke(()=>{const L=[],N=e.entityId.toLowerCase();for(const S of ut.repos)for(const M of S.entities)if(!(M.id===e.entityId&&M.repo===e.entityRepo)){for(const me of M.wikilinks)if(me.replace(/\[\[|\]\]/g,"").trim().toLowerCase()===N){L.push(M);break}}return L});function _(L){ft(`/${L.repo}/${L.entityType}/${L.id}`)}var C=Re(),x=he(C);{var c=L=>{var N=wr(),S=A(N),M=A(S);let me;var G=A(M);Wt(G,{size:14}),w(M);var ne=W(M,4),ye=A(ne,!0);w(ne),w(S);var oe=W(S,2);{var le=_e=>{var se=br();Ue(se,21,()=>t(R),Be,(P,k)=>{const a=ke(()=>mt(t(k).entityType));var r=yr(),o=A(r);let f;var g=W(o,2),K=A(g,!0);w(g);var ve=W(g,2),be=A(ve,!0);w(ve),w(r),de(b=>{f=We(o,"",f,{background:t(a)}),pe(K,t(k).title),pe(be,b)},[()=>at(t(k).entityType)]),ze("click",r,()=>_(t(k))),h(P,r)}),w(se),h(_e,se)};ce(oe,_e=>{t(s)||_e(le)})}w(N),de(()=>{me=lt(M,1,"header-chevron svelte-16xienp",null,me,{collapsed:t(s)}),pe(ye,t(R).length)}),ze("mousedown",S,_e=>_e.preventDefault()),ze("click",S,p),h(L,N)};ce(x,L=>{t(R).length>0&&L(c)})}h(J,C),Ye()}vt(["mousedown","click"]);var xr=j('<div class="remote-cursor svelte-ok7wy5"><span class="remote-cursor-label svelte-ok7wy5"> </span></div>'),Er=j('<div class="cursor-overlay svelte-ok7wy5"></div>'),Cr=j('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div> <!></div>');function Sr(J,e){He(e,!0);let i=Oe(e,"readonly",3,!0),s=Oe(e,"resetKey",3,0);const p=Zt("theme");let R,_=null,C=null,x=Ee(""),c=null,L=Ee(it([])),N=null,S=e.content;function M(le,_e){return le.theme({"&":{backgroundColor:"transparent",color:"var(--color-text-primary)",fontSize:"15px",fontFamily:"var(--font-sans)"},".cm-content":{padding:"32px 40px",fontFamily:"var(--font-sans)",caretColor:"var(--color-accent)",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:_e?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:_e?"rgba(110,110,232,0.3)":"rgba(110,110,232,0.2)"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-line":{padding:"0"},".cm-header-1":{fontSize:"22px",fontWeight:"600"},".cm-header-2":{fontSize:"16px",fontWeight:"600"},".cm-header-3":{fontSize:"15px",fontWeight:"600"},".cm-formatting":{color:"var(--color-text-tertiary)",opacity:"0.5"},".cm-link":{color:"var(--color-link)",textDecoration:"none"}},{dark:_e})}async function me(){_&&(_.destroy(),_=null),C&&(C.destroy(),C=null),E(L,[],!0);const{EditorState:le,Transaction:_e}=await qe(async()=>{const{EditorState:u,Transaction:O}=await import("../chunks/CX_61fY8.js");return{EditorState:u,Transaction:O}},[],import.meta.url);c=_e;const{EditorView:se,keymap:P,ViewPlugin:k}=await qe(async()=>{const{EditorView:u,keymap:O,ViewPlugin:Q}=await import("../chunks/DnL9f0lc.js").then(V=>V.i);return{EditorView:u,keymap:O,ViewPlugin:Q}},__vite__mapDeps([0,1]),import.meta.url),{markdown:a}=await qe(async()=>{const{markdown:u}=await import("../chunks/CscoF-YL.js");return{markdown:u}},__vite__mapDeps([2,1,0,3,4,5]),import.meta.url),{syntaxHighlighting:r,HighlightStyle:o}=await qe(async()=>{const{syntaxHighlighting:u,HighlightStyle:O}=await import("../chunks/D7ZqAKi9.js");return{syntaxHighlighting:u,HighlightStyle:O}},__vite__mapDeps([3,4,1,0]),import.meta.url),{history:f,defaultKeymap:g,historyKeymap:K}=await qe(async()=>{const{history:u,defaultKeymap:O,historyKeymap:Q}=await import("../chunks/CWQRQXxy.js");return{history:u,defaultKeymap:O,historyKeymap:Q}},__vite__mapDeps([6,1,0,3,4]),import.meta.url),{tags:ve}=await qe(async()=>{const{tags:u}=await import("../chunks/C7VoTosa.js").then(O=>O.i);return{tags:u}},[],import.meta.url),{livePreviewPlugin:be,livePreviewTheme:b}=await qe(async()=>{const{livePreviewPlugin:u,livePreviewTheme:O}=await import("../chunks/B340SUKR.js");return{livePreviewPlugin:u,livePreviewTheme:O}},__vite__mapDeps([7,0,1,3,4]),import.meta.url),l=p.current==="dark",d=M(se,l),F=o.define([{tag:ve.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),X=[a(),d,r(F),be,b,se.lineWrapping];i()&&X.push(le.readOnly.of(!0));let Z=!1;if(e.cursorDocName&&!i())try{let n=function(){if(!_||!z){E(L,[],!0);return}const Y=z.awareness,ue=z.ytext,q=ue.doc;if(!q){E(L,[],!0);return}const ae=[],re=_.dom.getBoundingClientRect();Y.getStates().forEach((U,ee)=>{if(ee===Ae)return;const we=U.cursor;if(!we?.head)return;const{name:ge="Anonymous",color:Ce="#e05050"}=U.user||{};let Pe;try{Pe=y.createRelativePositionFromJSON(we.head)}catch{return}const xe=y.createAbsolutePositionFromRelativePosition(Pe,q);if(!xe||xe.type!==ue)return;const Se=_.coordsAtPos(Math.min(xe.index,_.state.doc.length));Se&&ae.push({id:ee,name:ge,color:Ce,top:Se.top-re.top,left:Se.left-re.left,height:Se.bottom-Se.top})}),E(L,ae,!0)},D=function(){N&&cancelAnimationFrame(N),N=requestAnimationFrame(()=>{N=null,n()})},ie=function({added:Y,updated:ue,removed:q}){[...Y,...ue,...q].some(re=>re!==Ae)&&D()};const{createCollabSession:u}=await qe(async()=>{const{createCollabSession:Y}=await import("../chunks/C3RWu-3l.js");return{createCollabSession:Y}},__vite__mapDeps([8,9,10,11,12,13,14,15,16,17,18]),import.meta.url),{ySync:O,ySyncFacet:Q,YSyncConfig:V,yUndoManagerKeymap:T}=await qe(async()=>{const{ySync:Y,ySyncFacet:ue,YSyncConfig:q,yUndoManagerKeymap:ae}=await import("../chunks/i9c_RUF6.js");return{ySync:Y,ySyncFacet:ue,YSyncConfig:q,yUndoManagerKeymap:ae}},__vite__mapDeps([19,9,0,1]),import.meta.url),{auth:m}=await qe(async()=>{const{auth:Y}=await import("../chunks/B0qTqRR8.js").then(ue=>ue.b);return{auth:Y}},__vite__mapDeps([16,12,15]),import.meta.url),y=await qe(()=>import("../chunks/CLFba8FK.js").then(Y=>Y.A),[],import.meta.url),te=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",z=u(e.cursorDocName,{name:m.user?.displayName??"Anonymous",color:te,colorLight:te+"33"}),$=new y.UndoManager(z.ytext,{captureTimeout:500}),{yUndoManagerFacet:I,yUndoManager:H,YUndoManagerConfig:fe}=await qe(async()=>{const{yUndoManagerFacet:Y,yUndoManager:ue,YUndoManagerConfig:q}=await import("../chunks/i9c_RUF6.js");return{yUndoManagerFacet:Y,yUndoManager:ue,YUndoManagerConfig:q}},__vite__mapDeps([19,9,0,1]),import.meta.url),B=new V(z.ytext,z.awareness);X.push(Q.of(B),O,I.of(new fe($)),H,P.of(T)),X.push(k.define(Y=>{function ue(){const q=Y.state.selection.main,ae=z.ytext,re=y.createRelativePositionFromTypeIndex(ae,q.anchor),U=y.createRelativePositionFromTypeIndex(ae,q.head);z.awareness.setLocalStateField("cursor",{anchor:y.relativePositionToJSON(re),head:y.relativePositionToJSON(U)})}return ue(),{update(q){(q.selectionSet||q.docChanged)&&ue()}}}));const Ae=z.ydoc.clientID;z.awareness.on("change",ie),X.push(k.define(()=>({update(Y){(Y.docChanged||Y.geometryChanged||Y.viewportChanged)&&D()},destroy(){z.awareness.off("change",ie)}}))),C=z,Z=!0}catch(u){console.warn("Yjs collab setup failed, falling back to solo editing:",u)}if(!i()&&!Z?(X.push(f({newGroupDelay:500})),X.push(P.of([...g,...K]))):!i()&&Z&&X.push(P.of(g)),e.onchange)if(Z){const u=Date.now();X.push(se.updateListener.of(O=>{if(O.docChanged&&Date.now()-u>1e3&&O.transactions.some(V=>V.isUserEvent("input")||V.isUserEvent("delete")||V.isUserEvent("move")||V.isUserEvent("undo")||V.isUserEvent("redo"))){const V=O.state.doc.toString();S=V,e.onchange(V)}}))}else X.push(se.updateListener.of(u=>{if(u.docChanged){const O=u.state.doc.toString();S=O,e.onchange(O)}}));X.push(se.domEventHandlers({click(u){const O=u.target;if(e.onwikilinkclick){const V=O.closest(".cm-live-wikilink");if(V){u.preventDefault();const T=V.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return T&&e.onwikilinkclick(T),!0}}const Q=O.closest(".cm-live-link");if(Q){const V=Q.getAttribute("data-href");if(V)return u.preventDefault(),window.open(V,"_blank","noopener,noreferrer"),!0}return!1}})),e.onsave&&X.push(P.of([{key:"Mod-s",run:()=>(e.onsave(),!0)}]));const v=le.create({doc:Z?"":e.content,extensions:X});_=new se({state:v,parent:R}),S=Z?"":e.content,E(x,e.cursorDocName??"",!0)}Jt(()=>{me()}),rt(()=>{e.cursorDocName&&t(x)&&e.cursorDocName!==t(x)&&me()}),rt(()=>{if(s(),_&&!C&&e.content!==S){S=e.content;const le=R.closest(".document-scroll"),_e=le?.scrollTop??0;_.dispatch({changes:{from:0,to:_.state.doc.length,insert:e.content},...c?{annotations:c.addToHistory.of(!1)}:{}}),le&&requestAnimationFrame(()=>{le.scrollTop=_e})}}),Vt(()=>{N&&cancelAnimationFrame(N),C?.destroy(),C=null,_?.destroy()});var G=Cr(),ne=A(G);ct(ne,le=>R=le,()=>R);var ye=W(ne,2);{var oe=le=>{var _e=Er();Ue(_e,21,()=>t(L),se=>se.id,(se,P)=>{var k=xr(),a=A(k),r=A(a,!0);w(a),w(k),de(()=>{We(k,`top: ${t(P).top??""}px; left: ${t(P).left??""}px; height: ${t(P).height??""}px; --cursor-color: ${t(P).color??""};`),We(a,`background-color: ${t(P).color??""};`),pe(r,t(P).name)}),h(se,k)}),w(_e),h(le,_e)};ce(ye,le=>{t(L).length>0&&le(oe)})}w(G),h(J,G),Ye()}var bt={exports:{}};var Ar=bt.exports,It;function Pr(){return It||(It=1,(function(J,e){((i,s)=>{J.exports=s()})(Ar,function i(){var s=typeof self<"u"?self:typeof window<"u"?window:s!==void 0?s:{},p,R=!s.document&&!!s.postMessage,_=s.IS_PAPA_WORKER||!1,C={},x=0,c={};function L(a){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(r){var o=se(r);o.chunkSize=parseInt(o.chunkSize),r.step||r.chunk||(o.chunkSize=null),this._handle=new G(o),(this._handle.streamer=this)._config=o}).call(this,a),this.parseChunk=function(r,o){var f=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<f){let K=this._config.newline;K||(g=this._config.quoteChar||'"',K=this._handle.guessLineEndings(r,g)),r=[...r.split(K).slice(f)].join(K)}this.isFirstChunk&&k(this._config.beforeFirstChunk)&&(g=this._config.beforeFirstChunk(r))!==void 0&&(r=g),this.isFirstChunk=!1,this._halted=!1;var f=this._partialLine+r,g=(this._partialLine="",this._handle.parse(f,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(r=g.meta.cursor,f=(this._finished||(this._partialLine=f.substring(r-this._baseIndex),this._baseIndex=r),g&&g.data&&(this._rowCount+=g.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),_)s.postMessage({results:g,workerId:c.WORKER_ID,finished:f});else if(k(this._config.chunk)&&!o){if(this._config.chunk(g,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=g=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(g.data),this._completeResults.errors=this._completeResults.errors.concat(g.errors),this._completeResults.meta=g.meta),this._completed||!f||!k(this._config.complete)||g&&g.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),f||g&&g.meta.paused||this._nextChunk(),g}this._halted=!0},this._sendError=function(r){k(this._config.error)?this._config.error(r):_&&this._config.error&&s.postMessage({workerId:c.WORKER_ID,error:r,finished:!1})}}function N(a){var r;(a=a||{}).chunkSize||(a.chunkSize=c.RemoteChunkSize),L.call(this,a),this._nextChunk=R?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(o){this._input=o,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),R||(r.onload=P(this._chunkLoaded,this),r.onerror=P(this._chunkError,this)),r.open(this._config.downloadRequestBody?"POST":"GET",this._input,!R),this._config.downloadRequestHeaders){var o,f=this._config.downloadRequestHeaders;for(o in f)r.setRequestHeader(o,f[o])}var g;this._config.chunkSize&&(g=this._start+this._config.chunkSize-1,r.setRequestHeader("Range","bytes="+this._start+"-"+g));try{r.send(this._config.downloadRequestBody)}catch(K){this._chunkError(K.message)}R&&r.status===0&&this._chunkError()}},this._chunkLoaded=function(){r.readyState===4&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize||r.responseText.length,this._finished=!this._config.chunkSize||this._start>=(o=>(o=o.getResponseHeader("Content-Range"))!==null?parseInt(o.substring(o.lastIndexOf("/")+1)):-1)(r),this.parseChunk(r.responseText)))},this._chunkError=function(o){o=r.statusText||o,this._sendError(new Error(o))}}function S(a){(a=a||{}).chunkSize||(a.chunkSize=c.LocalChunkSize),L.call(this,a);var r,o,f=typeof FileReader<"u";this.stream=function(g){this._input=g,o=g.slice||g.webkitSlice||g.mozSlice,f?((r=new FileReader).onload=P(this._chunkLoaded,this),r.onerror=P(this._chunkError,this)):r=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var g=this._input,K=(this._config.chunkSize&&(K=Math.min(this._start+this._config.chunkSize,this._input.size),g=o.call(g,this._start,K)),r.readAsText(g,this._config.encoding));f||this._chunkLoaded({target:{result:K}})},this._chunkLoaded=function(g){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(g.target.result)},this._chunkError=function(){this._sendError(r.error)}}function M(a){var r;L.call(this,a=a||{}),this.stream=function(o){return r=o,this._nextChunk()},this._nextChunk=function(){var o,f;if(!this._finished)return o=this._config.chunkSize,r=o?(f=r.substring(0,o),r.substring(o)):(f=r,""),this._finished=!r,this.parseChunk(f)}}function me(a){L.call(this,a=a||{});var r=[],o=!0,f=!1;this.pause=function(){L.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){L.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(g){this._input=g,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){f&&r.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),r.length?this.parseChunk(r.shift()):o=!0},this._streamData=P(function(g){try{r.push(typeof g=="string"?g:g.toString(this._config.encoding)),o&&(o=!1,this._checkIsFinished(),this.parseChunk(r.shift()))}catch(K){this._streamError(K)}},this),this._streamError=P(function(g){this._streamCleanUp(),this._sendError(g)},this),this._streamEnd=P(function(){this._streamCleanUp(),f=!0,this._streamData("")},this),this._streamCleanUp=P(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function G(a){var r,o,f,g,K=Math.pow(2,53),ve=-K,be=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,b=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,l=this,d=0,F=0,X=!1,Z=!1,v=[],u={data:[],errors:[],meta:{}};function O(m){return a.skipEmptyLines==="greedy"?m.join("").trim()==="":m.length===1&&m[0].length===0}function Q(){if(u&&f&&(T("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),f=!1),a.skipEmptyLines&&(u.data=u.data.filter(function(z){return!O(z)})),V()){let z=function($,I){k(a.transformHeader)&&($=a.transformHeader($,I)),v.push($)};if(u)if(Array.isArray(u.data[0])){for(var m=0;V()&&m<u.data.length;m++)u.data[m].forEach(z);u.data.splice(0,1)}else u.data.forEach(z)}function y(z,$){for(var I=a.header?{}:[],H=0;H<z.length;H++){var fe=H,B=z[H],B=((Ae,n)=>(D=>(a.dynamicTypingFunction&&a.dynamicTyping[D]===void 0&&(a.dynamicTyping[D]=a.dynamicTypingFunction(D)),(a.dynamicTyping[D]||a.dynamicTyping)===!0))(Ae)?n==="true"||n==="TRUE"||n!=="false"&&n!=="FALSE"&&((D=>{if(be.test(D)&&(D=parseFloat(D),ve<D&&D<K))return 1})(n)?parseFloat(n):b.test(n)?new Date(n):n===""?null:n):n)(fe=a.header?H>=v.length?"__parsed_extra":v[H]:fe,B=a.transform?a.transform(B,fe):B);fe==="__parsed_extra"?(I[fe]=I[fe]||[],I[fe].push(B)):I[fe]=B}return a.header&&(H>v.length?T("FieldMismatch","TooManyFields","Too many fields: expected "+v.length+" fields but parsed "+H,F+$):H<v.length&&T("FieldMismatch","TooFewFields","Too few fields: expected "+v.length+" fields but parsed "+H,F+$)),I}var te;u&&(a.header||a.dynamicTyping||a.transform)&&(te=1,!u.data.length||Array.isArray(u.data[0])?(u.data=u.data.map(y),te=u.data.length):u.data=y(u.data,0),a.header&&u.meta&&(u.meta.fields=v),F+=te)}function V(){return a.header&&v.length===0}function T(m,y,te,z){m={type:m,code:y,message:te},z!==void 0&&(m.row=z),u.errors.push(m)}k(a.step)&&(g=a.step,a.step=function(m){u=m,V()?Q():(Q(),u.data.length!==0&&(d+=m.data.length,a.preview&&d>a.preview?o.abort():(u.data=u.data[0],g(u,l))))}),this.parse=function(m,y,te){var z=a.quoteChar||'"',z=(a.newline||(a.newline=this.guessLineEndings(m,z)),f=!1,a.delimiter?k(a.delimiter)&&(a.delimiter=a.delimiter(m),u.meta.delimiter=a.delimiter):((z=(($,I,H,fe,B)=>{var Ae,n,D,ie;B=B||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var Y=0;Y<B.length;Y++){for(var ue,q=B[Y],ae=0,re=0,U=0,ee=(D=void 0,new ye({comments:fe,delimiter:q,newline:I,preview:10}).parse($)),we=0;we<ee.data.length;we++)H&&O(ee.data[we])?U++:(ue=ee.data[we].length,re+=ue,D===void 0?D=ue:0<ue&&(ae+=Math.abs(ue-D),D=ue));0<ee.data.length&&(re/=ee.data.length-U),(n===void 0||ae<=n)&&(ie===void 0||ie<re)&&1.99<re&&(n=ae,Ae=q,ie=re)}return{successful:!!(a.delimiter=Ae),bestDelimiter:Ae}})(m,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=z.bestDelimiter:(f=!0,a.delimiter=c.DefaultDelimiter),u.meta.delimiter=a.delimiter),se(a));return a.preview&&a.header&&z.preview++,r=m,o=new ye(z),u=o.parse(r,y,te),Q(),X?{meta:{paused:!0}}:u||{meta:{paused:!1}}},this.paused=function(){return X},this.pause=function(){X=!0,o.abort(),r=k(a.chunk)?"":r.substring(o.getCharIndex())},this.resume=function(){l.streamer._halted?(X=!1,l.streamer.parseChunk(r,!0)):setTimeout(l.resume,3)},this.aborted=function(){return Z},this.abort=function(){Z=!0,o.abort(),u.meta.aborted=!0,k(a.complete)&&a.complete(u),r=""},this.guessLineEndings=function($,z){$=$.substring(0,1048576);var z=new RegExp(ne(z)+"([^]*?)"+ne(z),"gm"),te=($=$.replace(z,"")).split("\r"),z=$.split(`
3
- `),$=1<z.length&&z[0].length<te[0].length;if(te.length===1||$)return`
4
- `;for(var I=0,H=0;H<te.length;H++)te[H][0]===`
5
- `&&I++;return I>=te.length/2?`\r
6
- `:"\r"}}function ne(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(a){var r=(a=a||{}).delimiter,o=a.newline,f=a.comments,g=a.step,K=a.preview,ve=a.fastMode,be=null,b=!1,l=a.quoteChar==null?'"':a.quoteChar,d=l;if(a.escapeChar!==void 0&&(d=a.escapeChar),(typeof r!="string"||-1<c.BAD_DELIMITERS.indexOf(r))&&(r=","),f===r)throw new Error("Comment character same as delimiter");f===!0?f="#":(typeof f!="string"||-1<c.BAD_DELIMITERS.indexOf(f))&&(f=!1),o!==`
7
- `&&o!=="\r"&&o!==`\r
8
- `&&(o=`
9
- `);var F=0,X=!1;this.parse=function(Z,v,u){if(typeof Z!="string")throw new Error("Input must be a string");var O=Z.length,Q=r.length,V=o.length,T=f.length,m=k(g),y=[],te=[],z=[],$=F=0;if(!Z)return ae();if(ve||ve!==!1&&Z.indexOf(l)===-1){for(var I=Z.split(o),H=0;H<I.length;H++){if(z=I[H],F+=z.length,H!==I.length-1)F+=o.length;else if(u)return ae();if(!f||z.substring(0,T)!==f){if(m){if(y=[],ie(z.split(r)),re(),X)return ae()}else ie(z.split(r));if(K&&K<=H)return y=y.slice(0,K),ae(!0)}}return ae()}for(var fe=Z.indexOf(r,F),B=Z.indexOf(o,F),Ae=new RegExp(ne(d)+ne(l),"g"),n=Z.indexOf(l,F);;)if(Z[F]===l)for(n=F,F++;;){if((n=Z.indexOf(l,n+1))===-1)return u||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:y.length,index:F}),ue();if(n===O-1)return ue(Z.substring(F,n).replace(Ae,l));if(l===d&&Z[n+1]===d)n++;else if(l===d||n===0||Z[n-1]!==d){fe!==-1&&fe<n+1&&(fe=Z.indexOf(r,n+1));var D=Y((B=B!==-1&&B<n+1?Z.indexOf(o,n+1):B)===-1?fe:Math.min(fe,B));if(Z.substr(n+1+D,Q)===r){z.push(Z.substring(F,n).replace(Ae,l)),Z[F=n+1+D+Q]!==l&&(n=Z.indexOf(l,F)),fe=Z.indexOf(r,F),B=Z.indexOf(o,F);break}if(D=Y(B),Z.substring(n+1+D,n+1+D+V)===o){if(z.push(Z.substring(F,n).replace(Ae,l)),q(n+1+D+V),fe=Z.indexOf(r,F),n=Z.indexOf(l,F),m&&(re(),X))return ae();if(K&&y.length>=K)return ae(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:y.length,index:F}),n++}}else if(f&&z.length===0&&Z.substring(F,F+T)===f){if(B===-1)return ae();F=B+V,B=Z.indexOf(o,F),fe=Z.indexOf(r,F)}else if(fe!==-1&&(fe<B||B===-1))z.push(Z.substring(F,fe)),F=fe+Q,fe=Z.indexOf(r,F);else{if(B===-1)break;if(z.push(Z.substring(F,B)),q(B+V),m&&(re(),X))return ae();if(K&&y.length>=K)return ae(!0)}return ue();function ie(U){y.push(U),$=F}function Y(U){var ee=0;return ee=U!==-1&&(U=Z.substring(n+1,U))&&U.trim()===""?U.length:ee}function ue(U){return u||(U===void 0&&(U=Z.substring(F)),z.push(U),F=O,ie(z),m&&re()),ae()}function q(U){F=U,ie(z),z=[],B=Z.indexOf(o,F)}function ae(U){if(a.header&&!v&&y.length&&!b){var ee=y[0],we=Object.create(null),ge=new Set(ee);let Ce=!1;for(let Pe=0;Pe<ee.length;Pe++){let xe=ee[Pe];if(we[xe=k(a.transformHeader)?a.transformHeader(xe,Pe):xe]){let Se,Le=we[xe];for(;Se=xe+"_"+Le,Le++,ge.has(Se););ge.add(Se),ee[Pe]=Se,we[xe]++,Ce=!0,(be=be===null?{}:be)[Se]=xe}else we[xe]=1,ee[Pe]=xe;ge.add(xe)}Ce&&console.warn("Duplicate headers found and renamed."),b=!0}return{data:y,errors:te,meta:{delimiter:r,linebreak:o,aborted:X,truncated:!!U,cursor:$+(v||0),renamedHeaders:be}}}function re(){g(ae()),y=[],te=[]}},this.abort=function(){X=!0},this.getCharIndex=function(){return F}}function oe(a){var r=a.data,o=C[r.workerId],f=!1;if(r.error)o.userError(r.error,r.file);else if(r.results&&r.results.data){var g={abort:function(){f=!0,le(r.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:_e,resume:_e};if(k(o.userStep)){for(var K=0;K<r.results.data.length&&(o.userStep({data:r.results.data[K],errors:r.results.errors,meta:r.results.meta},g),!f);K++);delete r.results}else k(o.userChunk)&&(o.userChunk(r.results,g,r.file),delete r.results)}r.finished&&!f&&le(r.workerId,r.results)}function le(a,r){var o=C[a];k(o.userComplete)&&o.userComplete(r),o.terminate(),delete C[a]}function _e(){throw new Error("Not implemented.")}function se(a){if(typeof a!="object"||a===null)return a;var r,o=Array.isArray(a)?[]:{};for(r in a)o[r]=se(a[r]);return o}function P(a,r){return function(){a.apply(r,arguments)}}function k(a){return typeof a=="function"}return c.parse=function(a,r){var o=(r=r||{}).dynamicTyping||!1;if(k(o)&&(r.dynamicTypingFunction=o,o={}),r.dynamicTyping=o,r.transform=!!k(r.transform)&&r.transform,!r.worker||!c.WORKERS_SUPPORTED)return o=null,c.NODE_STREAM_INPUT,typeof a=="string"?(a=(f=>f.charCodeAt(0)!==65279?f:f.slice(1))(a),o=new(r.download?N:M)(r)):a.readable===!0&&k(a.read)&&k(a.on)?o=new me(r):(s.File&&a instanceof File||a instanceof Object)&&(o=new S(r)),o.stream(a);(o=(()=>{var f;return!!c.WORKERS_SUPPORTED&&(f=(()=>{var g=s.URL||s.webkitURL||null,K=i.toString();return c.BLOB_URL||(c.BLOB_URL=g.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",K,")();"],{type:"text/javascript"})))})(),(f=new s.Worker(f)).onmessage=oe,f.id=x++,C[f.id]=f)})()).userStep=r.step,o.userChunk=r.chunk,o.userComplete=r.complete,o.userError=r.error,r.step=k(r.step),r.chunk=k(r.chunk),r.complete=k(r.complete),r.error=k(r.error),delete r.worker,o.postMessage({input:a,config:r,workerId:o.id})},c.unparse=function(a,r){var o=!1,f=!0,g=",",K=`\r
10
- `,ve='"',be=ve+ve,b=!1,l=null,d=!1,F=((()=>{if(typeof r=="object"){if(typeof r.delimiter!="string"||c.BAD_DELIMITERS.filter(function(v){return r.delimiter.indexOf(v)!==-1}).length||(g=r.delimiter),typeof r.quotes!="boolean"&&typeof r.quotes!="function"&&!Array.isArray(r.quotes)||(o=r.quotes),typeof r.skipEmptyLines!="boolean"&&typeof r.skipEmptyLines!="string"||(b=r.skipEmptyLines),typeof r.newline=="string"&&(K=r.newline),typeof r.quoteChar=="string"&&(ve=r.quoteChar),typeof r.header=="boolean"&&(f=r.header),Array.isArray(r.columns)){if(r.columns.length===0)throw new Error("Option columns is empty");l=r.columns}r.escapeChar!==void 0&&(be=r.escapeChar+ve),r.escapeFormulae instanceof RegExp?d=r.escapeFormulae:typeof r.escapeFormulae=="boolean"&&r.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),new RegExp(ne(ve),"g"));if(typeof a=="string"&&(a=JSON.parse(a)),Array.isArray(a)){if(!a.length||Array.isArray(a[0]))return X(null,a,b);if(typeof a[0]=="object")return X(l||Object.keys(a[0]),a,b)}else if(typeof a=="object")return typeof a.data=="string"&&(a.data=JSON.parse(a.data)),Array.isArray(a.data)&&(a.fields||(a.fields=a.meta&&a.meta.fields||l),a.fields||(a.fields=Array.isArray(a.data[0])?a.fields:typeof a.data[0]=="object"?Object.keys(a.data[0]):[]),Array.isArray(a.data[0])||typeof a.data[0]=="object"||(a.data=[a.data])),X(a.fields||[],a.data||[],b);throw new Error("Unable to serialize unrecognized input");function X(v,u,O){var Q="",V=(typeof v=="string"&&(v=JSON.parse(v)),typeof u=="string"&&(u=JSON.parse(u)),Array.isArray(v)&&0<v.length),T=!Array.isArray(u[0]);if(V&&f){for(var m=0;m<v.length;m++)0<m&&(Q+=g),Q+=Z(v[m],m);0<u.length&&(Q+=K)}for(var y=0;y<u.length;y++){var te=(V?v:u[y]).length,z=!1,$=V?Object.keys(u[y]).length===0:u[y].length===0;if(O&&!V&&(z=O==="greedy"?u[y].join("").trim()==="":u[y].length===1&&u[y][0].length===0),O==="greedy"&&V){for(var I=[],H=0;H<te;H++){var fe=T?v[H]:H;I.push(u[y][fe])}z=I.join("").trim()===""}if(!z){for(var B=0;B<te;B++){0<B&&!$&&(Q+=g);var Ae=V&&T?v[B]:B;Q+=Z(u[y][Ae],B)}y<u.length-1&&(!O||0<te&&!$)&&(Q+=K)}}return Q}function Z(v,u){var O,Q;return v==null?"":v.constructor===Date?JSON.stringify(v).slice(1,25):(Q=!1,d&&typeof v=="string"&&d.test(v)&&(v="'"+v,Q=!0),O=v.toString().replace(F,be),(Q=Q||o===!0||typeof o=="function"&&o(v,u)||Array.isArray(o)&&o[u]||((V,T)=>{for(var m=0;m<T.length;m++)if(-1<V.indexOf(T[m]))return!0;return!1})(O,c.BAD_DELIMITERS)||-1<O.indexOf(g)||O.charAt(0)===" "||O.charAt(O.length-1)===" ")?ve+O+ve:O)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
11
- `,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!R&&!!s.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=ye,c.ParserHandle=G,c.NetworkStreamer=N,c.FileStreamer=S,c.StringStreamer=M,c.ReadableStreamStreamer=me,s.jQuery&&((p=s.jQuery).fn.parse=function(a){var r=a.config||{},o=[];return this.each(function(K){if(!(p(this).prop("tagName").toUpperCase()==="INPUT"&&p(this).attr("type").toLowerCase()==="file"&&s.FileReader)||!this.files||this.files.length===0)return!0;for(var ve=0;ve<this.files.length;ve++)o.push({file:this.files[ve],inputElem:this,instanceConfig:p.extend({},r)})}),f(),this;function f(){if(o.length===0)k(a.complete)&&a.complete();else{var K,ve,be,b,l=o[0];if(k(a.before)){var d=a.before(l.file,l.inputElem);if(typeof d=="object"){if(d.action==="abort")return K="AbortError",ve=l.file,be=l.inputElem,b=d.reason,void(k(a.error)&&a.error({name:K},ve,be,b));if(d.action==="skip")return void g();typeof d.config=="object"&&(l.instanceConfig=p.extend(l.instanceConfig,d.config))}else if(d==="skip")return void g()}var F=l.instanceConfig.complete;l.instanceConfig.complete=function(X){k(F)&&F(X,l.file,l.inputElem),g()},c.parse(l.file,l.instanceConfig)}}function g(){o.splice(0,1),f()}}),_&&(s.onmessage=function(a){a=a.data,c.WORKER_ID===void 0&&a&&(c.WORKER_ID=a.workerId),typeof a.input=="string"?s.postMessage({workerId:c.WORKER_ID,results:c.parse(a.input,a.config),finished:!0}):(s.File&&a.input instanceof File||a.input instanceof Object)&&(a=c.parse(a.input,a.config))&&s.postMessage({workerId:c.WORKER_ID,results:a,finished:!0})}),(N.prototype=Object.create(L.prototype)).constructor=N,(S.prototype=Object.create(L.prototype)).constructor=S,(M.prototype=Object.create(M.prototype)).constructor=M,(me.prototype=Object.create(L.prototype)).constructor=me,c})})(bt)),bt.exports}var Rr=Pr();const jt=_a(Rr);var Tr=j('<span class="remote-cell-label svelte-63hltt"> </span>'),Dr=j('<th><!> <input class="cell-input header-input svelte-63hltt"/> <!></th>'),zr=j('<span class="remote-cell-label svelte-63hltt"> </span>'),Lr=j('<td><!> <input class="cell-input svelte-63hltt"/></td>'),Or=j('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),Fr=j("<!> <span>Add row</span>",1),Mr=j('<div class="csv-editor svelte-63hltt"><div class="table-scroll svelte-63hltt"><table class="svelte-63hltt"><thead><tr class="svelte-63hltt"><th class="row-num svelte-63hltt"></th><!><th class="col-add svelte-63hltt"><!></th></tr></thead><tbody></tbody></table></div> <div class="csv-footer svelte-63hltt"><!></div></div>');function Ir(J,e){He(e,!0);let i=Oe(e,"remoteCursors",19,()=>[]),s=Ee(it([])),p=Ee(it([])),R=Ee(void 0);function _(b){const l=jt.parse(b.trim(),{header:!1,skipEmptyLines:!0});l.data.length>0?(E(s,l.data[0],!0),E(p,l.data.slice(1),!0)):(E(s,[],!0),E(p,[],!0))}_(e.content),rt(()=>{_(e.content)});function C(){return jt.unparse([t(s),...t(p)])}function x(){const b=C();e.onchange?.(b)}function c(b,l,d){t(p)[b][l]=d,E(p,[...t(p)],!0),x()}function L(b,l){t(s)[b]=l,E(s,[...t(s)],!0),x()}function N(){E(p,[...t(p),t(s).map(()=>"")],!0),x(),G(t(p).length-1,0)}function S(b){E(p,t(p).filter((l,d)=>d!==b),!0),x()}function M(){const b=`col${t(s).length+1}`;E(s,[...t(s),b],!0),E(p,t(p).map(l=>[...l,""]),!0),x(),requestAnimationFrame(()=>{const l=t(R)?.querySelector(`thead th:nth-child(${t(s).length+1}) input`);l&&(l.focus(),l.select())})}function me(b){t(s).length<=1||(E(s,t(s).filter((l,d)=>d!==b),!0),E(p,t(p).map(l=>l.filter((d,F)=>F!==b)),!0),x())}function G(b,l){requestAnimationFrame(()=>{if(!t(R))return;let d=null;b<0?d=t(R).querySelector(`thead th:nth-child(${l+2}) input`):d=t(R).querySelector(`tbody tr:nth-child(${b+1}) td:nth-child(${l+2}) input`),d&&(d.focus(),d.select())})}function ne(b,l,d){if(b.key==="Tab"){b.preventDefault(),b.shiftKey?d>0?G(l,d-1):l>0?G(l-1,t(s).length-1):l===0&&G(-1,t(s).length-1):d<t(s).length-1?G(l,d+1):l<t(p).length-1?G(l+1,0):l===t(p).length-1&&N();return}if(b.key==="Enter"){b.preventDefault(),b.shiftKey?l>0?G(l-1,d):G(-1,d):l<t(p).length-1?G(l+1,d):N();return}if(b.key==="Escape"){b.target.blur();return}}function ye(b,l){if(b.key==="Tab"){b.preventDefault(),b.shiftKey?l>0&&G(-1,l-1):l<t(s).length-1?G(-1,l+1):t(p).length>0&&G(0,0);return}if(b.key==="Enter"){b.preventDefault(),t(p).length>0?G(0,l):N();return}if(b.key==="Escape"){b.target.blur();return}}function oe(b,l){return i().find(d=>d.row===b&&d.col===l)}function le(b,l){e.oncellselect?.(b,l)}function _e(b){(b.metaKey||b.ctrlKey)&&b.key==="s"&&(b.preventDefault(),e.onsave?.())}var se=Mr(),P=A(se),k=A(P),a=A(k),r=A(a),o=W(A(r));Ue(o,17,()=>t(s),Be,(b,l,d)=>{const F=ke(()=>oe(-1,d));var X=Dr();let Z;var v=A(X);{var u=T=>{var m=Tr(),y=A(m,!0);w(m),de(()=>{We(m,`background-color: ${t(F).color??""}`),pe(y,t(F).name)}),h(T,m)};ce(v,T=>{t(F)&&T(u)})}var O=W(v,2);nt(O);var Q=W(O,2);{var V=T=>{Je(T,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>me(d),children:(m,y)=>{Ot(m,{size:12})},$$slots:{default:!0}})};ce(Q,T=>{t(s).length>1&&T(V)})}w(X),de(()=>{We(X,t(F)?`--rc-color: ${t(F).color}`:""),Z=lt(X,1,"svelte-63hltt",null,Z,{"remote-active":!!t(F)}),dt(O,t(l))}),ze("input",O,T=>L(d,T.currentTarget.value)),ze("keydown",O,T=>ye(T,d)),Ze("focus",O,()=>le(-1,d)),h(b,X)});var f=W(o),g=A(f);Je(g,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:M,children:(b,l)=>{St(b,{size:14})},$$slots:{default:!0}}),w(f),w(r),w(a);var K=W(a);Ue(K,21,()=>t(p),Be,(b,l,d)=>{var F=Or(),X=A(F);X.textContent=d+1;var Z=W(X);Ue(Z,17,()=>t(l),Be,(O,Q,V)=>{const T=ke(()=>oe(d,V));var m=Lr();let y;var te=A(m);{var z=I=>{var H=zr(),fe=A(H,!0);w(H),de(()=>{We(H,`background-color: ${t(T).color??""}`),pe(fe,t(T).name)}),h(I,H)};ce(te,I=>{t(T)&&I(z)})}var $=W(te,2);nt($),w(m),de(()=>{We(m,t(T)?`--rc-color: ${t(T).color}`:""),y=lt(m,1,"svelte-63hltt",null,y,{"remote-active":!!t(T)}),dt($,t(Q))}),ze("input",$,I=>c(d,V,I.currentTarget.value)),ze("keydown",$,I=>ne(I,d,V)),Ze("focus",$,()=>le(d,V)),h(O,m)});var v=W(Z),u=A(v);Je(u,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>S(d),children:(O,Q)=>{Ot(O,{size:12})},$$slots:{default:!0}}),w(v),w(F),h(b,F)}),w(K),w(k),ct(k,b=>E(R,b),()=>t(R)),w(P);var ve=W(P,2),be=A(ve);Je(be,{variant:"ghost",class:"add-row-btn",onclick:N,children:(b,l)=>{var d=Fr(),F=he(d);St(F,{size:14}),je(2),h(b,d)},$$slots:{default:!0}}),w(ve),w(se),ze("keydown",se,_e),h(J,se),Ye()}vt(["keydown","input"]);const jr=/^\d{4}-\d{2}-\d{2}/,Kr=new Set(["active","inactive","in-progress","completed","done","cancelled","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),Ur=new Set(["format"]),Nr=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function Vr(J,e){const i=[];for(const[p,R]of Object.entries(J)){if(Nr.has(p)||R==null)continue;const _=qr(p,R);_&&i.push(_)}const s=["entity_type","name","date"];return i.sort((p,R)=>{const _=s.indexOf(p.key),C=s.indexOf(R.key);return _!==-1&&C!==-1?_-C:_!==-1?-1:C!==-1?1:p.key.localeCompare(R.key)}),i}function qr(J,e){if(J==="entity_type")return{key:J,value:String(e),type:"entity-type"};if(Ur.has(J))return{key:J,value:String(e).toUpperCase(),type:"badge"};if(J==="status")return{key:J,value:String(e),type:"status"};if(Array.isArray(e)){if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const C=e.map(x=>Object.entries(x).map(([L,N])=>`${L}: ${N}`).join(", "));return{key:J,value:C.join(" | "),type:"text"}}const p=e.map(String),R=p.some(C=>/^\[\[.+?\]\]$/.test(C)),_=p.map(C=>{const x=C.match(/^\[\[(.+?)\]\]$/);return x?x[1]:C});return R||_.every(C=>Kt(C))?{key:J,value:_,type:"wikilink"}:{key:J,value:p.join(", "),type:"text"}}const i=String(e),s=i.match(/^\[\[(.+?)\]\]$/);return s?{key:J,value:s[1],type:"wikilink"}:jr.test(i)?{key:J,value:i,type:"date"}:Kr.has(i.toLowerCase())?{key:J,value:i,type:"status"}:/^https?:\/\//.test(i)||J==="url"||J==="website"?{key:J,value:i,type:"url"}:Kt(i)&&!i.includes(" ")?{key:J,value:i,type:"wikilink"}:{key:J,value:i,type:"text"}}function Kt(J){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(J)&&J.includes("-")}var Wr=$e("<title> </title>"),Br=$e('<svg><!><path d="M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm0,26A12,12,0,0,1,16,4V16l8.4812,8.4814A11.9625,11.9625,0,0,1,16,28Z"></path></svg>');function Ut(J,e){const i=Xe(e,["children","$$slots","$$events","$$legacy"]),s=Xe(i,["size","title"]);He(e,!1);const p=Qe(),R=Qe();let _=Oe(e,"size",8,16),C=Oe(e,"title",8,void 0);Ge(()=>(Ne(i),Ne(C())),()=>{E(p,i["aria-label"]||i["aria-labelledby"]||C())}),Ge(()=>(t(p),Ne(i)),()=>{E(R,{"aria-hidden":t(p)?void 0:!0,role:t(p)?"img":void 0,focusable:Number(i.tabindex)===0?!0:void 0})}),ht(),_t();var x=Br();pt(x,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:_(),height:_(),...t(R),...s}));var c=A(x);{var L=N=>{var S=Wr(),M=A(S,!0);w(S),de(()=>pe(M,C())),h(N,S)};ce(c,N=>{C()&&N(L)})}je(),w(x),h(J,x),Ye()}class Hr{diff(e,i,s={}){let p;typeof s=="function"?(p=s,s={}):"callback"in s&&(p=s.callback);const R=this.castInput(e,s),_=this.castInput(i,s),C=this.removeEmpty(this.tokenize(R,s)),x=this.removeEmpty(this.tokenize(_,s));return this.diffWithOptionsObj(C,x,s,p)}diffWithOptionsObj(e,i,s,p){var R;const _=oe=>{if(oe=this.postProcess(oe,s),p){setTimeout(function(){p(oe)},0);return}else return oe},C=i.length,x=e.length;let c=1,L=C+x;s.maxEditLength!=null&&(L=Math.min(L,s.maxEditLength));const N=(R=s.timeout)!==null&&R!==void 0?R:1/0,S=Date.now()+N,M=[{oldPos:-1,lastComponent:void 0}];let me=this.extractCommon(M[0],i,e,0,s);if(M[0].oldPos+1>=x&&me+1>=C)return _(this.buildValues(M[0].lastComponent,i,e));let G=-1/0,ne=1/0;const ye=()=>{for(let oe=Math.max(G,-c);oe<=Math.min(ne,c);oe+=2){let le;const _e=M[oe-1],se=M[oe+1];_e&&(M[oe-1]=void 0);let P=!1;if(se){const a=se.oldPos-oe;P=se&&0<=a&&a<C}const k=_e&&_e.oldPos+1<x;if(!P&&!k){M[oe]=void 0;continue}if(!k||P&&_e.oldPos<se.oldPos?le=this.addToPath(se,!0,!1,0,s):le=this.addToPath(_e,!1,!0,1,s),me=this.extractCommon(le,i,e,oe,s),le.oldPos+1>=x&&me+1>=C)return _(this.buildValues(le.lastComponent,i,e))||!0;M[oe]=le,le.oldPos+1>=x&&(ne=Math.min(ne,oe-1)),me+1>=C&&(G=Math.max(G,oe+1))}c++};if(p)(function oe(){setTimeout(function(){if(c>L||Date.now()>S)return p(void 0);ye()||oe()},0)})();else for(;c<=L&&Date.now()<=S;){const oe=ye();if(oe)return oe}}addToPath(e,i,s,p,R){const _=e.lastComponent;return _&&!R.oneChangePerToken&&_.added===i&&_.removed===s?{oldPos:e.oldPos+p,lastComponent:{count:_.count+1,added:i,removed:s,previousComponent:_.previousComponent}}:{oldPos:e.oldPos+p,lastComponent:{count:1,added:i,removed:s,previousComponent:_}}}extractCommon(e,i,s,p,R){const _=i.length,C=s.length;let x=e.oldPos,c=x-p,L=0;for(;c+1<_&&x+1<C&&this.equals(s[x+1],i[c+1],R);)c++,x++,L++,R.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return L&&!R.oneChangePerToken&&(e.lastComponent={count:L,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=x,c}equals(e,i,s){return s.comparator?s.comparator(e,i):e===i||!!s.ignoreCase&&e.toLowerCase()===i.toLowerCase()}removeEmpty(e){const i=[];for(let s=0;s<e.length;s++)e[s]&&i.push(e[s]);return i}castInput(e,i){return e}tokenize(e,i){return Array.from(e)}join(e){return e.join("")}postProcess(e,i){return e}get useLongestToken(){return!1}buildValues(e,i,s){const p=[];let R;for(;e;)p.push(e),R=e.previousComponent,delete e.previousComponent,e=R;p.reverse();const _=p.length;let C=0,x=0,c=0;for(;C<_;C++){const L=p[C];if(L.removed)L.value=this.join(s.slice(c,c+L.count)),c+=L.count;else{if(!L.added&&this.useLongestToken){let N=i.slice(x,x+L.count);N=N.map(function(S,M){const me=s[c+M];return me.length>S.length?me:S}),L.value=this.join(N)}else L.value=this.join(i.slice(x,x+L.count));x+=L.count,L.added||(c+=L.count)}}return p}}const Nt="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Yr extends Hr{tokenize(e){const i=new RegExp(`(\\r?\\n)|[${Nt}]+|[^\\S\\n\\r]+|[^${Nt}]`,"ug");return e.match(i)||[]}}const Zr=new Yr;function Jr(J,e,i){return Zr.diff(J,e,i)}var Gr=$e("<title> </title>"),Qr=$e('<svg><!><path d="M10,14a4,4,0,1,1,4-4A4.0045,4.0045,0,0,1,10,14Zm0-6a2,2,0,1,0,1.998,2.0044A2.002,2.002,0,0,0,10,8Z"></path><path d="M16.6436,29.4145,2.5858,15.3555A2,2,0,0,1,2,13.9414V4A2,2,0,0,1,4,2h9.9413a2,2,0,0,1,1.4142.5858L29.4144,16.6436a2.0005,2.0005,0,0,1,0,2.8285l-9.9424,9.9425a2.0008,2.0008,0,0,1-2.8285,0ZM4,4v9.9417L18.0578,28,28,18.0579,13.9416,4Z"></path></svg>');function Xr(J,e){const i=Xe(e,["children","$$slots","$$events","$$legacy"]),s=Xe(i,["size","title"]);He(e,!1);const p=Qe(),R=Qe();let _=Oe(e,"size",8,16),C=Oe(e,"title",8,void 0);Ge(()=>(Ne(i),Ne(C())),()=>{E(p,i["aria-label"]||i["aria-labelledby"]||C())}),Ge(()=>(t(p),Ne(i)),()=>{E(R,{"aria-hidden":t(p)?void 0:!0,role:t(p)?"img":void 0,focusable:Number(i.tabindex)===0?!0:void 0})}),ht(),_t();var x=Qr();pt(x,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:_(),height:_(),...t(R),...s}));var c=A(x);{var L=N=>{var S=Gr(),M=A(S,!0);w(S),de(()=>pe(M,C())),h(N,S)};ce(c,N=>{C()&&N(L)})}je(2),w(x),h(J,x),Ye()}var $r=j('<div class="dp-row svelte-1g4tvol"><div class="dp-icon svelte-1g4tvol"><!></div> <div class="dp-key svelte-1g4tvol"> </div> <div class="dp-value svelte-1g4tvol"><div class="dp-diff-old svelte-1g4tvol"><span> </span></div> <div class="dp-diff-new svelte-1g4tvol"><span> </span></div></div></div>'),en=j('<div class="diff-properties svelte-1g4tvol"></div>'),tn=j('<span class="db-added"> </span>'),an=j('<span class="db-removed"> </span>'),rn=j("<span> </span>"),nn=j("<span> </span>"),sn=j('<div class="diff-view svelte-1g4tvol"><!> <div class="diff-body svelte-1g4tvol"><!></div></div>');function on(J,e){He(e,!0);function i(S){if(S==null)return"";if(typeof S!="object")return String(S);const M=S;return String(M.name??M.title??M.label??M.id??JSON.stringify(M))}function s(S){return S==null?"":Array.isArray(S)?S.map(i).join(", "):typeof S=="object"?i(S):String(S)}const p=ke(()=>e.refreshResult.body_changed&&e.refreshResult.body_diff?Jr(e.refreshResult.body_diff.old,e.refreshResult.body_diff.new):null);var R=sn(),_=A(R);{var C=S=>{var M=en();Ue(M,21,()=>e.refreshResult.diffs,Be,(me,G)=>{const ne=ke(()=>e.properties.find(d=>d.key===t(G).field));var ye=$r(),oe=A(ye),le=A(oe);{var _e=d=>{xt(d,{size:14})},se=d=>{yt(d,{size:14})},P=d=>{Ct(d,{size:14})},k=d=>{Xr(d,{size:14})},a=d=>{Et(d,{size:14})};ce(le,d=>{t(ne)?.type==="date"?d(_e):t(ne)?.type==="status"?d(se,1):t(ne)?.type==="wikilink"?d(P,2):t(ne)?.type==="badge"?d(k,3):d(a,!1)})}w(oe);var r=W(oe,2),o=A(r,!0);w(r);var f=W(r,2),g=A(f),K=A(g),ve=A(K,!0);w(K),w(g);var be=W(g,2),b=A(be),l=A(b,!0);w(b),w(be),w(f),w(ye),de((d,F)=>{pe(o,t(G).field),pe(ve,d),pe(l,F)},[()=>s(t(G).old_value),()=>s(t(G).new_value)]),h(me,ye)}),w(M),h(S,M)};ce(_,S=>{e.refreshResult.diffs.length>0&&S(C)})}var x=W(_,2),c=A(x);{var L=S=>{var M=Re(),me=he(M);Ue(me,17,()=>t(p),Be,(G,ne)=>{var ye=Re(),oe=he(ye);{var le=P=>{var k=tn(),a=A(k,!0);w(k),de(()=>pe(a,t(ne).value)),h(P,k)},_e=P=>{var k=an(),a=A(k,!0);w(k),de(()=>pe(a,t(ne).value)),h(P,k)},se=P=>{var k=rn(),a=A(k,!0);w(k),de(()=>pe(a,t(ne).value)),h(P,k)};ce(oe,P=>{t(ne).added?P(le):t(ne).removed?P(_e,1):P(se,!1)})}h(G,ye)}),h(S,M)},N=S=>{var M=nn(),me=A(M,!0);w(M),de(()=>pe(me,e.bodyContent)),h(S,M)};ce(c,S=>{t(p)?S(L):S(N,!1)})}w(x),w(R),h(J,R),Ye()}var ln=j("<!> ",1),un=j('<span class="diff-action-title svelte-udj3er">Changes from source</span> <div class="diff-action-buttons svelte-udj3er"><!> <!></div>',1),dn=j('<span class="bc-sep svelte-udj3er">/</span>'),cn=j("<!><span> </span>",1),fn=j('<span class="status-text saving svelte-udj3er">Saving...</span>'),vn=j('<span class="status-text error svelte-udj3er"> </span>'),hn=j("<!> ",1),pn=j('<div class="breadcrumb-path svelte-udj3er"></div> <div class="editor-actions svelte-udj3er"><!> <!> <!></div>',1),_n=j('<div class="refresh-panel svelte-udj3er"><div class="refresh-uptodate svelte-udj3er">Entity is up to date with source.</div></div>'),gn=j('<div class="document-scroll svelte-udj3er"><div class="document-well svelte-udj3er"><!> <!> <!></div></div>'),mn=j("<!> <!>",1),yn=j("<!> <!>",1),bn=j("<!> <div><!></div> <!> <!> <!> <!>",1);function Jn(J,e){He(e,!0);const i=()=>ea(ra,"$page",s),[s,p]=ta(),R=ke(()=>e.data.type==="dataset"||e.data.entity.document?.frontmatter?.entity_type==="dataset"),_=ke(()=>ut.getAppForEntityType(e.data.entity.document?.frontmatter?.entity_type??e.data.type)),C=ke(()=>()=>{const n=e.data.entity.path;if(n){const D=n.lastIndexOf(`/${e.data.repo}/`);if(D>=0)return n.substring(D+1).split("/")}return[e.data.repo,e.data.id,"main.md"]});let x=Ee(""),c=Ee(it({})),L=Ee(0);const N=ke(()=>Vr(t(c))),S=new Set(["name","date"]);let M=Ee(null);rt(()=>{if(i().url.searchParams.has("new")){E(M,"name");const n=new URL(i().url);n.searchParams.delete("new"),history.replaceState({},"",n.pathname)}else E(M,null)});const me=ke(()=>!!e.data.entity.data?.source_ref);let G=Ee(!1),ne=Ee(null),ye=Ee(null);async function oe(){if(!t(G)){E(G,!0),E(ne,null),E(ye,null);try{const{result:n}=await ha(e.data.repo,e.data.type,e.data.id);E(ne,n,!0)}catch(n){E(ye,n.message||"Refresh failed",!0)}finally{E(G,!1)}}}let le=Ee(!1);async function _e(){if(!t(le)){E(le,!0);try{await va(e.data.repo,e.data.type,e.data.id),E(ne,null),await aa()}catch(n){E(ye,n.message||"Apply changes failed",!0)}finally{E(le,!1)}}}let se=null,P=Ee(""),k=!1,a=Ee(it([]));function r(n){o(),qe(async()=>{const{createCollabSession:D}=await import("../chunks/C3RWu-3l.js");return{createCollabSession:D}},__vite__mapDeps([8,9,10,11,12,13,14,15,16,17,18]),import.meta.url).then(({createCollabSession:D})=>{const ie=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",Y=D(n,{name:Ft.user?.displayName??"Anonymous",color:ie,colorLight:ie+"33"});Y.ytext.observe(()=>{const ae=Y.ytext.toString();ae!==t(x)&&(k=!0,E(x,ae,!0),requestAnimationFrame(()=>{k=!1}))});const ue=Y.ydoc.clientID;function q(){const ae=[];Y.awareness.getStates().forEach((re,U)=>{if(U===ue)return;const ee=re.cell;if(ee==null||ee.row==null||ee.col==null)return;const{name:we="Anonymous",color:ge="#e05050"}=re.user||{};ae.push({row:ee.row,col:ee.col,name:we,color:ge})}),E(a,ae,!0)}Y.awareness.on("change",q),se=Y,E(P,n,!0)})}function o(){se&&(se.destroy(),se=null,E(P,""),E(a,[],!0))}Vt(()=>o());let f=Ee(""),g=Ee(0);rt(()=>{const n=`${e.data.repo}/${e.data.type}/${e.data.id}`,D=ma.mutationCount;if(n!==t(f)||D!==t(g)){t(f)&&n!==t(f)&&Ke.flush(),E(f,n),E(g,D,!0);const ie=e.data.entity.document?.content??"";E(x,ie.trim()===""?"":ie,!0),E(c,{...e.data.entity.document?.frontmatter??e.data.entity.data??{}},!0),Gt(L),Ke.reset();const Y=`${e.data.repo}/${e.data.type}/${e.data.id}`;t(R)&&Y!==t(P)?r(Y):t(R)||o()}}),rt(()=>{const n=e.data.repo,D=e.data.type,ie=e.data.id;Qt(()=>{kt.select(n,D,ie),kt.showEntity()})});function K(n){if(!k){if(E(x,n,!0),se){const D=se.ytext,ie=D.toString();n!==ie&&se.ydoc.transact(()=>{D.delete(0,D.length),D.insert(0,n)})}Ke.scheduleAutoSave(e.data.repo,e.data.type,e.data.id,{content:n})}}function ve(n,D){E(c,{...t(c),[n]:D},!0),Ke.scheduleAutoSave(e.data.repo,e.data.type,e.data.id,{data:t(c)})}function be(n){const{[n]:D,...ie}=t(c);E(c,ie,!0),Ke.scheduleAutoSave(e.data.repo,e.data.type,e.data.id,{data:t(c)})}function b(n,D){E(c,{...t(c),[n]:D},!0),Ke.scheduleAutoSave(e.data.repo,e.data.type,e.data.id,{data:t(c)})}function l(n,D){Ke.scheduleAutoSave(e.data.repo,e.data.type,e.data.id,{data:t(c)})}let d=Ee(null);function F(n){n!==e.data.type&&E(d,n,!0)}async function X(){const n=t(d);if(E(d,null),!!n){Ke.reset();try{await Ht(e.data.repo,e.data.type,e.data.id,n),await ut.refreshEntities(e.data.repo),await ft(`/${e.data.repo}/${n}/${e.data.id}`,{invalidateAll:!0})}catch(D){console.error("Failed to change entity type:",D)}}}function Z(n){for(const D of ut.repos){const ie=D.entities.find(Y=>Y.id===n);if(ie){ft(`/${D.name}/${ie.entityType}/${ie.id}`);return}}ga.showToast(`"${n}" is in a collection you don't have access to`)}rt(()=>(Lt.enter(e.data.repo,e.data.type,e.data.id),()=>Lt.leave()));const v=ke(()=>t(ne)!==null&&(t(ne).diffs.length>0||t(ne).body_changed));function u(n){(n.metaKey||n.ctrlKey)&&n.key==="s"&&(n.preventDefault(),Ke.flush()),n.key==="Escape"&&!(n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement)&&(Ke.flush(),kt.deselect(),ft("/"))}var O=bn();Ze("keydown",Xt,u);var Q=he(O);na(Q,{activeView:"entity"});var V=W(Q,2);let T;var m=A(V);{var y=n=>{var D=un(),ie=W(he(D),2),Y=A(ie);Je(Y,{variant:"outline",size:"default",onclick:()=>E(ne,null),get disabled(){return t(le)},children:(q,ae)=>{je();var re=ot("Dismiss");h(q,re)},$$slots:{default:!0}});var ue=W(Y,2);Je(ue,{variant:"accent",size:"default",onclick:_e,get disabled(){return t(le)},children:(q,ae)=>{var re=ln(),U=he(re);{var ee=ge=>{Ut(ge,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};ce(U,ge=>{t(le)&&ge(ee)})}var we=W(U,1,!0);de(()=>pe(we,t(le)?"Applying...":"Apply changes")),h(q,re)},$$slots:{default:!0}}),w(ie),h(n,D)},te=n=>{var D=pn(),ie=he(D);Ue(ie,21,()=>t(C)(),Be,(ge,Ce,Pe)=>{var xe=cn(),Se=he(xe);{var Le=Me=>{var Ve=dn();h(Me,Ve)};ce(Se,Me=>{Pe>0&&Me(Le)})}var Fe=W(Se),De=A(Fe,!0);w(Fe),de(Me=>{lt(Fe,1,Me,"svelte-udj3er"),pe(De,t(Ce))},[()=>$t(Pe===t(C)().length-1?"bc-current":"bc-segment")]),h(ge,xe)}),w(ie);var Y=W(ie,2),ue=A(Y);{var q=ge=>{var Ce=fn();h(ge,Ce)},ae=ge=>{var Ce=vn(),Pe=A(Ce,!0);w(Ce),de(()=>pe(Pe,Ke.error)),h(ge,Ce)};ce(ue,ge=>{Ke.saving?ge(q):Ke.error&&ge(ae,1)})}var re=W(ue,2);{var U=ge=>{Je(ge,{variant:"outline",size:"sm",class:"refresh-btn",onclick:oe,get disabled(){return t(G)},children:(Ce,Pe)=>{var xe=hn(),Se=he(xe);{var Le=De=>{Ut(De,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};ce(Se,De=>{t(G)&&De(Le)})}var Fe=W(Se,1,!0);de(()=>pe(Fe,t(G)?"Refreshing...":"Refresh from source")),h(Ce,xe)},$$slots:{default:!0}})};ce(re,ge=>{t(me)&&Ft.user?.role==="admin"&&ge(U)})}var ee=W(re,2);{var we=ge=>{Je(ge,{variant:"link",size:"sm",class:"open-app",get href(){return`/${e.data.repo??""}/${e.data.type??""}/${e.data.id??""}/edit`},children:(Ce,Pe)=>{je();var xe=ot();de(()=>pe(xe,`Open in ${t(_).name??""} →`)),h(Ce,xe)},$$slots:{default:!0}})};ce(ee,ge=>{t(_)&&ge(we)})}w(Y),h(n,D)};ce(m,n=>{t(v)?n(y):n(te,!1)})}w(V);var z=W(V,2);{var $=n=>{var D=_n();h(n,D)};ce(z,n=>{t(ne)&&!t(v)&&n($)})}var I=W(z,2);{var H=n=>{on(n,{get properties(){return t(N)},get refreshResult(){return t(ne)},get bodyContent(){return t(x)}})},fe=n=>{var D=gn(),ie=A(D),Y=A(ie);mr(Y,{get properties(){return t(N)},editable:!0,get autofocusKey(){return t(M)},get protectedKeys(){return S},onedit:ve,onremove:be,onadd:b,ontypechange:l,onentitytypechange:F,onfocuseditor:()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>{const U=document.querySelector(".cm-content");if(U){U.focus();const ee=window.getSelection();ee&&U.firstChild?ee.collapse(U.firstChild,0):ee&&ee.collapse(U,0)}}))}});var ue=W(Y,2);{var q=U=>{Ir(U,{get content(){return t(x)},onchange:K,onsave:()=>Ke.flush(),oncellselect:(ee,we)=>{se?.awareness.setLocalStateField("cell",{row:ee,col:we})},get remoteCursors(){return t(a)}})},ae=U=>{{let ee=ke(()=>`${e.data.repo}/${e.data.type}/${e.data.id}`);Sr(U,{get content(){return t(x)},readonly:!1,onchange:K,onsave:()=>Ke.flush(),onwikilinkclick:Z,get resetKey(){return t(L)},get cursorDocName(){return t(ee)}})}};ce(ue,U=>{t(R)?U(q):U(ae,!1)})}var re=W(ue,2);kr(re,{get entityId(){return e.data.id},get entityRepo(){return e.data.repo}}),w(ie),w(D),h(n,D)};ce(I,n=>{t(v)?n(H):n(fe,!1)})}var B=W(I,2);{let n=ke(()=>!!t(ye));Te(B,()=>Ca,(D,ie)=>{ie(D,{get open(){return t(n)},onOpenChange:Y=>{Y||E(ye,null)},children:(Y,ue)=>{var q=Re(),ae=he(q);Te(ae,()=>ya,(re,U)=>{U(re,{children:(ee,we)=>{var ge=yn(),Ce=he(ge);Te(Ce,()=>ba,(xe,Se)=>{Se(xe,{children:(Le,Fe)=>{var De=mn(),Me=he(De);Te(Me,()=>wa,(et,tt)=>{tt(et,{children:(Ie,st)=>{je();var gt=ot("Refresh failed");h(Ie,gt)},$$slots:{default:!0}})});var Ve=W(Me,2);Te(Ve,()=>ka,(et,tt)=>{tt(et,{children:(Ie,st)=>{je();var gt=ot();de(()=>pe(gt,t(ye))),h(Ie,gt)},$$slots:{default:!0}})}),h(Le,De)},$$slots:{default:!0}})});var Pe=W(Ce,2);Te(Pe,()=>xa,(xe,Se)=>{Se(xe,{children:(Le,Fe)=>{var De=Re(),Me=he(De);Te(Me,()=>Ea,(Ve,et)=>{et(Ve,{children:(tt,Ie)=>{je();var st=ot("OK");h(tt,st)},$$slots:{default:!0}})}),h(Le,De)},$$slots:{default:!0}})}),h(ee,ge)},$$slots:{default:!0}})}),h(Y,q)},$$slots:{default:!0}})})}var Ae=W(B,2);{let n=ke(()=>t(d)!==null),D=ke(()=>`Change this entity from ${at(e.data.type)} to ${at(t(d)??"")}? Fields specific to ${at(e.data.type)} will be removed.`);ca(Ae,{get open(){return t(n)},title:"Change entity type",get message(){return t(D)},confirmLabel:"Change type",onconfirm:X,oncancel:()=>{E(d,null)}})}de(()=>T=lt(V,1,"editor-bar svelte-udj3er",null,T,{"editor-bar-diff":t(v)})),h(J,O),Ye(),p()}export{Jn as component,Zn as universal};