@agent-deck/backend 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/playbooks/apply-patch-ops.d.ts.map +1 -1
- package/dist/playbooks/apply-patch-ops.js +15 -5
- package/dist/playbooks/apply-patch-ops.js.map +1 -1
- package/package.json +2 -2
- package/static-ui/assets/{index-C_Ay3I86.js → index-B6-CAuNl.js} +3 -3
- package/static-ui/assets/index-BAxWCa-X.css +1 -0
- package/static-ui/index.html +2 -2
- package/static-ui/assets/index-CAdo-cZe.css +0 -1
|
@@ -34,10 +34,16 @@ function serializeSections(preamble, sections) {
|
|
|
34
34
|
parts.push(trimmedPreamble);
|
|
35
35
|
for (const section of sections) {
|
|
36
36
|
parts.push(`## ${section.name}`);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
// Trim blank edges: parsed lines keep the blank line after the heading and
|
|
38
|
+
// before the next one, and the '\n\n' join below re-adds spacing — without
|
|
39
|
+
// trimming, every apply inflates the body by one blank line per section.
|
|
40
|
+
const lines = [...section.lines];
|
|
41
|
+
while (lines.length > 0 && lines[0].trim() === '')
|
|
42
|
+
lines.shift();
|
|
43
|
+
while (lines.length > 0 && lines[lines.length - 1].trim() === '')
|
|
44
|
+
lines.pop();
|
|
45
|
+
if (lines.length > 0)
|
|
46
|
+
parts.push(lines.join('\n'));
|
|
41
47
|
}
|
|
42
48
|
return parts.join('\n\n') + (parts.length > 0 ? '\n' : '');
|
|
43
49
|
}
|
|
@@ -69,7 +75,11 @@ function applyBodyOp(state, op) {
|
|
|
69
75
|
section = { name: op.section, lines: [] };
|
|
70
76
|
sections.push(section);
|
|
71
77
|
}
|
|
72
|
-
|
|
78
|
+
// Insert before any trailing blank lines so the new item stays adjacent to the list.
|
|
79
|
+
let insertAt = section.lines.length;
|
|
80
|
+
while (insertAt > 0 && section.lines[insertAt - 1].trim() === '')
|
|
81
|
+
insertAt -= 1;
|
|
82
|
+
section.lines.splice(insertAt, 0, formatListItem(op.text));
|
|
73
83
|
return {
|
|
74
84
|
ok: true,
|
|
75
85
|
value: { ...state, body: serializeSections(parsed.preamble, sections) },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-patch-ops.js","sourceRoot":"","sources":["../../src/playbooks/apply-patch-ops.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"apply-patch-ops.js","sourceRoot":"","sources":["../../src/playbooks/apply-patch-ops.ts"],"names":[],"mappings":";;AA0IA,sCAWC;AArID,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAc,EAAE,CAAC;IAC/B,IAAI,QAAQ,GAAa,EAAE,CAAC;IAC5B,IAAI,OAAO,GAAmB,IAAI,CAAC;IACnC,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,WAAW,EAAE,CAAC;YAChB,UAAU,GAAG,KAAK,CAAC;YACnB,IAAI,OAAO;gBAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACpC,OAAO,GAAG,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;YAC9C,SAAS;QACX,CAAC;QACD,IAAI,UAAU,EAAE,CAAC;YACf,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;aAAM,IAAI,OAAO,EAAE,CAAC;YACnB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,IAAI,OAAO;QAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;AACrD,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAgB,EAAE,QAAmB;IAC9D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC3C,IAAI,eAAe;QAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAEjD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACjC,2EAA2E;QAC3E,2EAA2E;QAC3E,yEAAyE;QACzE,MAAM,KAAK,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QACjE,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,KAAK,CAAC,GAAG,EAAE,CAAC;QAC9E,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,WAAW,CAAC,QAAmB,EAAE,IAAY;IACpD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC7C,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IAClC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IACjD,OAAO,KAAK,OAAO,EAAE,CAAC;AACxB,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,WAAW,CAAC,KAAyB,EAAE,EAAW;IACzD,IAAI,EAAE,CAAC,EAAE,KAAK,cAAc,EAAE,CAAC;QAC7B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;IAC1D,CAAC;IACD,IAAI,EAAE,CAAC,EAAE,KAAK,cAAc,EAAE,CAAC;QAC7B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;IACvE,CAAC;IAED,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IAErF,IAAI,EAAE,CAAC,EAAE,KAAK,UAAU,EAAE,CAAC;QACzB,IAAI,OAAO,GAAG,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;YAC1C,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;QACD,qFAAqF;QACrF,IAAI,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;QACpC,OAAO,QAAQ,GAAG,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,QAAQ,IAAI,CAAC,CAAC;QAChF,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3D,OAAO;YACL,EAAE,EAAE,IAAI;YACR,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE;SACxE,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,OAAO,aAAa,EAAE,CAAC;IACtE,CAAC;IAED,IAAI,EAAE,CAAC,EAAE,KAAK,YAAY,IAAI,EAAE,CAAC,EAAE,KAAK,aAAa,EAAE,CAAC;QACtD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC;QACpE,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,QAAQ,EAAE,gCAAgC,EAAE,CAAC,OAAO,MAAM,EAAE,CAAC,MAAM,0IAA0I;aAC9M,CAAC;QACJ,CAAC;QACD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7B,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,QAAQ,EAAE,sBAAsB,EAAE,CAAC,OAAO,mIAAmI;aAC9K,CAAC;QACJ,CAAC;QACD,IAAI,EAAE,CAAC,EAAE,KAAK,YAAY,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QACjD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACjC,CAAC;QACD,OAAO;YACL,EAAE,EAAE,IAAI;YACR,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE;SACxE,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,mBAAoB,EAAc,CAAC,EAAE,EAAE,EAAE,CAAC;AAC1E,CAAC;AAED,2DAA2D;AAC3D,SAAgB,aAAa,CAC3B,OAA2B,EAC3B,GAAc;IAEd,IAAI,KAAK,GAAG,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC5D,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,EAAE;YAAE,OAAO,MAAM,CAAC;QAC9B,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-deck/backend",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Agent Deck backend API, MCP server, and vault",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"prepublishOnly": "node ../../scripts/pre-publish-check.mjs && npm run build"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@agent-deck/shared": "^1.4.
|
|
41
|
+
"@agent-deck/shared": "^1.4.2",
|
|
42
42
|
"@fastify/cors": "^10.0.0",
|
|
43
43
|
"@fastify/static": "^8.0.0",
|
|
44
44
|
"@fastify/websocket": "^11.2.0",
|
|
@@ -255,7 +255,7 @@ Error generating stack: `+s.message+`
|
|
|
255
255
|
*
|
|
256
256
|
* This source code is licensed under the ISC license.
|
|
257
257
|
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
-
*/const xf=Le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Zv="-",c4=e=>{const t=d4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Zv);return a[0]===""&&a.length!==1&&a.shift(),VE(a,t)||u4(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},VE=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?VE(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Zv);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Ub=/^\[(.+)\]$/,u4=e=>{if(Ub.test(e)){const t=Ub.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},d4=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return h4(Object.entries(e.classGroups),n).forEach(([s,i])=>{Og(i,r,s,t)}),r},Og=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:qb(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(f4(o)){Og(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Og(i,qb(t,s),n,r)})})},qb=(e,t)=>{let n=e;return t.split(Zv).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},f4=e=>e.isThemeGetter,h4=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,p4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},HE="!",m4=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let u=0,d=0,f;for(let x=0;x<a.length;x++){let g=a[x];if(u===0){if(g===o&&(r||a.slice(x,x+s)===t)){l.push(a.slice(d,x)),d=x+s;continue}if(g==="/"){f=x;continue}}g==="["?u++:g==="]"&&u--}const p=l.length===0?a:a.substring(d),h=p.startsWith(HE),v=h?p.substring(1):p,m=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:i}):i},g4=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},y4=e=>({cache:p4(e.cacheSize),parseClassName:m4(e),...c4(e)}),v4=/\s+/,x4=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(v4);let a="";for(let l=i.length-1;l>=0;l-=1){const u=i[l],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let v=!!h,m=r(v?p.substring(0,h):p);if(!m){if(!v){a=u+(a.length>0?" "+a:a);continue}if(m=r(p),!m){a=u+(a.length>0?" "+a:a);continue}v=!1}const x=g4(d).join(":"),g=f?x+HE:x,y=g+m;if(s.includes(y))continue;s.push(y);const w=o(m,v);for(let k=0;k<w.length;++k){const C=w[k];s.push(g+C)}a=u+(a.length>0?" "+a:a)}return a};function w4(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=BE(t))&&(r&&(r+=" "),r+=n);return r}const BE=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=BE(e[r]))&&(n&&(n+=" "),n+=t);return n};function b4(e,...t){let n,r,o,s=i;function i(l){const u=t.reduce((d,f)=>f(d),e());return n=y4(u),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=x4(l,n);return o(l,d),d}return function(){return s(w4.apply(null,arguments))}}const lt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},WE=/^\[(?:([a-z-]+):)?(.+)\]$/i,k4=/^\d+\/\d+$/,_4=new Set(["px","full","screen"]),S4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,E4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,N4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mo=e=>_a(e)||_4.has(e)||k4.test(e),Bo=e=>fl(e,"length",M4),_a=e=>!!e&&!Number.isNaN(Number(e)),Ap=e=>fl(e,"number",_a),Rl=e=>!!e&&Number.isInteger(Number(e)),P4=e=>e.endsWith("%")&&_a(e.slice(0,-1)),$e=e=>WE.test(e),Wo=e=>S4.test(e),T4=new Set(["length","size","percentage"]),$4=e=>fl(e,T4,KE),R4=e=>fl(e,"position",KE),I4=new Set(["image","url"]),A4=e=>fl(e,I4,L4),O4=e=>fl(e,"",D4),Il=()=>!0,fl=(e,t,n)=>{const r=WE.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},M4=e=>C4.test(e)&&!E4.test(e),KE=()=>!1,D4=e=>N4.test(e),L4=e=>j4.test(e),z4=()=>{const e=lt("colors"),t=lt("spacing"),n=lt("blur"),r=lt("brightness"),o=lt("borderColor"),s=lt("borderRadius"),i=lt("borderSpacing"),a=lt("borderWidth"),l=lt("contrast"),u=lt("grayscale"),d=lt("hueRotate"),f=lt("invert"),p=lt("gap"),h=lt("gradientColorStops"),v=lt("gradientColorStopPositions"),m=lt("inset"),x=lt("margin"),g=lt("opacity"),y=lt("padding"),w=lt("saturate"),k=lt("scale"),C=lt("sepia"),j=lt("skew"),S=lt("space"),A=lt("translate"),P=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",$e,t],I=()=>[$e,t],F=()=>["",mo,Bo],L=()=>["auto",_a,$e],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",$e],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[_a,$e];return{cacheSize:500,separator:":",theme:{colors:[Il],spacing:[mo,Bo],blur:["none","",Wo,$e],brightness:O(),borderColor:[e],borderRadius:["none","","full",Wo,$e],borderSpacing:I(),borderWidth:F(),contrast:O(),grayscale:H(),hueRotate:O(),invert:H(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[P4,Bo],inset:T(),margin:T(),opacity:O(),padding:I(),saturate:O(),scale:O(),sepia:H(),skew:O(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[Wo]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),$e]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Rl,$e]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Rl,$e]}],"grid-cols":[{"grid-cols":[Il]}],"col-start-end":[{col:["auto",{span:["full",Rl,$e]},$e]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Il]}],"row-start-end":[{row:["auto",{span:[Rl,$e]},$e]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[Wo]},Wo]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Wo,Bo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ap]}],"font-family":[{font:[Il]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$e]}],"line-clamp":[{"line-clamp":["none",_a,Ap]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mo,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mo,Bo]}],"underline-offset":[{"underline-offset":["auto",mo,$e]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),R4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},A4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Z()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[mo,$e]}],"outline-w":[{outline:[mo,Bo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[mo,Bo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Wo,O4]}],"shadow-color":[{shadow:[Il]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Wo,$e]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Rl,$e]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[mo,Bo,Ap]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},F4=b4(z4);function Ee(...e){return F4(OE(e))}const U4=HM,ZE=b.forwardRef(({className:e,...t},n)=>c.jsx(jE,{ref:n,className:Ee("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));ZE.displayName=jE.displayName;const q4=yh("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),QE=b.forwardRef(({className:e,variant:t,...n},r)=>c.jsx(PE,{ref:r,className:Ee(q4({variant:t}),e),...n}));QE.displayName=PE.displayName;const V4=b.forwardRef(({className:e,...t},n)=>c.jsx(RE,{ref:n,className:Ee("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));V4.displayName=RE.displayName;const GE=b.forwardRef(({className:e,...t},n)=>c.jsx(IE,{ref:n,className:Ee("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:c.jsx(xf,{className:"h-4 w-4"})}));GE.displayName=IE.displayName;const JE=b.forwardRef(({className:e,...t},n)=>c.jsx(TE,{ref:n,className:Ee("text-sm font-semibold",e),...t}));JE.displayName=TE.displayName;const YE=b.forwardRef(({className:e,...t},n)=>c.jsx($E,{ref:n,className:Ee("text-sm opacity-90",e),...t}));YE.displayName=$E.displayName;function H4(){const{toasts:e}=Zt();return c.jsxs(U4,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return c.jsxs(QE,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(JE,{children:n}),r&&c.jsx(YE,{children:r})]}),o,c.jsx(GE,{})]},t)}),c.jsx(ZE,{})]})}var B4=By[" useId ".trim().toString()]||(()=>{}),W4=0;function jo(e){const[t,n]=b.useState(B4());return rn(()=>{n(r=>r??String(W4++))},[e]),t?`radix-${t}`:""}const K4=["top","right","bottom","left"],Rs=Math.min,Bn=Math.max,wf=Math.round,Bu=Math.floor,io=e=>({x:e,y:e}),Z4={left:"right",right:"left",bottom:"top",top:"bottom"},Q4={start:"end",end:"start"};function Mg(e,t,n){return Bn(e,Rs(t,n))}function Mo(e,t){return typeof e=="function"?e(t):e}function Do(e){return e.split("-")[0]}function hl(e){return e.split("-")[1]}function Qv(e){return e==="x"?"y":"x"}function Gv(e){return e==="y"?"height":"width"}const G4=new Set(["top","bottom"]);function to(e){return G4.has(Do(e))?"y":"x"}function Jv(e){return Qv(to(e))}function J4(e,t,n){n===void 0&&(n=!1);const r=hl(e),o=Jv(e),s=Gv(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=bf(i)),[i,bf(i)]}function Y4(e){const t=bf(e);return[Dg(e),t,Dg(t)]}function Dg(e){return e.replace(/start|end/g,t=>Q4[t])}const Vb=["left","right"],Hb=["right","left"],X4=["top","bottom"],eD=["bottom","top"];function tD(e,t,n){switch(e){case"top":case"bottom":return n?t?Hb:Vb:t?Vb:Hb;case"left":case"right":return t?X4:eD;default:return[]}}function nD(e,t,n,r){const o=hl(e);let s=tD(Do(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Dg)))),s}function bf(e){return e.replace(/left|right|bottom|top/g,t=>Z4[t])}function rD(e){return{top:0,right:0,bottom:0,left:0,...e}}function XE(e){return typeof e!="number"?rD(e):{top:e,right:e,bottom:e,left:e}}function kf(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 Bb(e,t,n){let{reference:r,floating:o}=e;const s=to(t),i=Jv(t),a=Gv(i),l=Do(t),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(hl(t)){case"start":h[i]-=p*(n&&u?-1:1);break;case"end":h[i]+=p*(n&&u?-1:1);break}return h}const oD=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=Bb(u,r,l),p=r,h={},v=0;for(let m=0;m<a.length;m++){const{name:x,fn:g}=a[m],{x:y,y:w,data:k,reset:C}=await g({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:i,elements:{reference:e,floating:t}});d=y??d,f=w??f,h={...h,[x]:{...h[x],...k}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(u=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:d,y:f}=Bb(u,p,l)),m=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}};async function Dc(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Mo(t,e),v=XE(h),x=a[p?f==="floating"?"reference":"floating":f],g=kf(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),y=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),k=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=kf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:l}):y);return{top:(g.top-C.top+v.top)/k.y,bottom:(C.bottom-g.bottom+v.bottom)/k.y,left:(g.left-C.left+v.left)/k.x,right:(C.right-g.right+v.right)/k.x}}const sD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=Mo(e,t)||{};if(u==null)return{};const f=XE(d),p={x:n,y:r},h=Jv(o),v=Gv(h),m=await i.getDimensions(u),x=h==="y",g=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",k=s.reference[v]+s.reference[h]-p[h]-s.floating[v],C=p[h]-s.reference[h],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let S=j?j[w]:0;(!S||!await(i.isElement==null?void 0:i.isElement(j)))&&(S=a.floating[w]||s.floating[v]);const A=k/2-C/2,P=S/2-m[v]/2-1,R=Rs(f[g],P),T=Rs(f[y],P),I=R,F=S-m[v]-T,L=S/2-m[v]/2+A,V=Mg(I,L,F),Z=!l.arrow&&hl(o)!=null&&L!==V&&s.reference[v]/2-(L<I?R:T)-m[v]/2<0,K=Z?L<I?L-I:L-F:0;return{[h]:p[h]+K,data:{[h]:V,centerOffset:L-V-K,...Z&&{alignmentOffset:K}},reset:Z}}}),iD=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:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...x}=Mo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=Do(o),y=to(a),w=Do(a)===a,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=p||(w||!m?[bf(a)]:Y4(a)),j=v!=="none";!p&&j&&C.push(...nD(a,m,v,k));const S=[a,...C],A=await Dc(t,x),P=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&P.push(A[g]),f){const L=J4(o,i,k);P.push(A[L[0]],A[L[1]])}if(R=[...R,{placement:o,overflows:P}],!P.every(L=>L<=0)){var T,I;const L=(((T=s.flip)==null?void 0:T.index)||0)+1,V=S[L];if(V&&(!(f==="alignment"?y!==to(V):!1)||R.every(q=>to(q.placement)===y?q.overflows[0]>0:!0)))return{data:{index:L,overflows:R},reset:{placement:V}};let Z=(I=R.filter(K=>K.overflows[0]<=0).sort((K,q)=>K.overflows[1]-q.overflows[1])[0])==null?void 0:I.placement;if(!Z)switch(h){case"bestFit":{var F;const K=(F=R.filter(q=>{if(j){const H=to(q.placement);return H===y||H==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(H=>H>0).reduce((H,N)=>H+N,0)]).sort((q,H)=>q[1]-H[1])[0])==null?void 0:F[0];K&&(Z=K);break}case"initialPlacement":Z=a;break}if(o!==Z)return{reset:{placement:Z}}}return{}}}};function Wb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kb(e){return K4.some(t=>e[t]>=0)}const aD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Mo(e,t);switch(r){case"referenceHidden":{const s=await Dc(t,{...o,elementContext:"reference"}),i=Wb(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Kb(i)}}}case"escaped":{const s=await Dc(t,{...o,altBoundary:!0}),i=Wb(s,n.floating);return{data:{escapedOffsets:i,escaped:Kb(i)}}}default:return{}}}}},eN=new Set(["left","top"]);async function lD(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Do(n),a=hl(n),l=to(n)==="y",u=eN.has(i)?-1:1,d=s&&l?-1:1,f=Mo(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(h=a==="end"?v*-1:v),l?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const cD=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,l=await lD(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},uD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:x=>{let{x:g,y}=x;return{x:g,y}}},...l}=Mo(e,t),u={x:n,y:r},d=await Dc(t,l),f=to(Do(o)),p=Qv(f);let h=u[p],v=u[f];if(s){const x=p==="y"?"top":"left",g=p==="y"?"bottom":"right",y=h+d[x],w=h-d[g];h=Mg(y,h,w)}if(i){const x=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=v+d[x],w=v-d[g];v=Mg(y,v,w)}const m=a.fn({...t,[p]:h,[f]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:s,[f]:i}}}}}},dD=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:l=!0,crossAxis:u=!0}=Mo(e,t),d={x:n,y:r},f=to(o),p=Qv(f);let h=d[p],v=d[f];const m=Mo(a,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const w=p==="y"?"height":"width",k=s.reference[p]-s.floating[w]+x.mainAxis,C=s.reference[p]+s.reference[w]-x.mainAxis;h<k?h=k:h>C&&(h=C)}if(u){var g,y;const w=p==="y"?"width":"height",k=eN.has(Do(o)),C=s.reference[f]-s.floating[w]+(k&&((g=i.offset)==null?void 0:g[f])||0)+(k?0:x.crossAxis),j=s.reference[f]+s.reference[w]+(k?0:((y=i.offset)==null?void 0:y[f])||0)-(k?x.crossAxis:0);v<C?v=C:v>j&&(v=j)}return{[p]:h,[f]:v}}}},fD=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:l=()=>{},...u}=Mo(e,t),d=await Dc(t,u),f=Do(o),p=hl(o),h=to(o)==="y",{width:v,height:m}=s.floating;let x,g;f==="top"||f==="bottom"?(x=f,g=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,x=p==="end"?"top":"bottom");const y=m-d.top-d.bottom,w=v-d.left-d.right,k=Rs(m-d[x],y),C=Rs(v-d[g],w),j=!t.middlewareData.shift;let S=k,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=y),j&&!p){const R=Bn(d.left,0),T=Bn(d.right,0),I=Bn(d.top,0),F=Bn(d.bottom,0);h?A=v-2*(R!==0||T!==0?R+T:Bn(d.left,d.right)):S=m-2*(I!==0||F!==0?I+F:Bn(d.top,d.bottom))}await l({...t,availableWidth:A,availableHeight:S});const P=await i.getDimensions(a.floating);return v!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function wh(){return typeof window<"u"}function pl(e){return tN(e)?(e.nodeName||"").toLowerCase():"#document"}function Qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function uo(e){var t;return(t=(tN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function tN(e){return wh()?e instanceof Node||e instanceof Qn(e).Node:!1}function Lr(e){return wh()?e instanceof Element||e instanceof Qn(e).Element:!1}function ao(e){return wh()?e instanceof HTMLElement||e instanceof Qn(e).HTMLElement:!1}function Zb(e){return!wh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qn(e).ShadowRoot}const hD=new Set(["inline","contents"]);function ou(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=zr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!hD.has(o)}const pD=new Set(["table","td","th"]);function mD(e){return pD.has(pl(e))}const gD=[":popover-open",":modal"];function bh(e){return gD.some(t=>{try{return e.matches(t)}catch{return!1}})}const yD=["transform","translate","scale","rotate","perspective"],vD=["transform","translate","scale","rotate","perspective","filter"],xD=["paint","layout","strict","content"];function Yv(e){const t=Xv(),n=Lr(e)?zr(e):e;return yD.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)||vD.some(r=>(n.willChange||"").includes(r))||xD.some(r=>(n.contain||"").includes(r))}function wD(e){let t=Is(e);for(;ao(t)&&!Ja(t);){if(Yv(t))return t;if(bh(t))return null;t=Is(t)}return null}function Xv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const bD=new Set(["html","body","#document"]);function Ja(e){return bD.has(pl(e))}function zr(e){return Qn(e).getComputedStyle(e)}function kh(e){return Lr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Is(e){if(pl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zb(e)&&e.host||uo(e);return Zb(t)?t.host:t}function nN(e){const t=Is(e);return Ja(t)?e.ownerDocument?e.ownerDocument.body:e.body:ao(t)&&ou(t)?t:nN(t)}function Lc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=nN(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Qn(o);if(s){const a=Lg(i);return t.concat(i,i.visualViewport||[],ou(o)?o:[],a&&n?Lc(a):[])}return t.concat(o,Lc(o,[],n))}function Lg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rN(e){const t=zr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ao(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=wf(n)!==s||wf(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function e0(e){return Lr(e)?e:e.contextElement}function Sa(e){const t=e0(e);if(!ao(t))return io(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=rN(t);let i=(s?wf(n.width):n.width)/r,a=(s?wf(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const kD=io(0);function oN(e){const t=Qn(e);return!Xv()||!t.visualViewport?kD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _D(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qn(e)?!1:t}function ji(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=e0(e);let i=io(1);t&&(r?Lr(r)&&(i=Sa(r)):i=Sa(e));const a=_D(s,n,r)?oN(s):io(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const p=Qn(s),h=r&&Lr(r)?Qn(r):r;let v=p,m=Lg(v);for(;m&&r&&h!==v;){const x=Sa(m),g=m.getBoundingClientRect(),y=zr(m),w=g.left+(m.clientLeft+parseFloat(y.paddingLeft))*x.x,k=g.top+(m.clientTop+parseFloat(y.paddingTop))*x.y;l*=x.x,u*=x.y,d*=x.x,f*=x.y,l+=w,u+=k,v=Qn(m),m=Lg(v)}}return kf({width:d,height:f,x:l,y:u})}function _h(e,t){const n=kh(e).scrollLeft;return t?t.left+n:ji(uo(e)).left+n}function sN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-_h(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function SD(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=uo(r),a=t?bh(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=io(1);const d=io(0),f=ao(r);if((f||!f&&!s)&&((pl(r)!=="body"||ou(i))&&(l=kh(r)),ao(r))){const h=ji(r);u=Sa(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=i&&!f&&!s?sN(i,l):io(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function CD(e){return Array.from(e.getClientRects())}function ED(e){const t=uo(e),n=kh(e),r=e.ownerDocument.body,o=Bn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Bn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+_h(e);const a=-n.scrollTop;return zr(r).direction==="rtl"&&(i+=Bn(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Qb=25;function ND(e,t){const n=Qn(e),r=uo(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const d=Xv();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=_h(r);if(u<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-h);v<=Qb&&(s-=v)}else u<=Qb&&(s+=u);return{width:s,height:i,x:a,y:l}}const jD=new Set(["absolute","fixed"]);function PD(e,t){const n=ji(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ao(e)?Sa(e):io(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function Gb(e,t,n){let r;if(t==="viewport")r=ND(e,n);else if(t==="document")r=ED(uo(e));else if(Lr(t))r=PD(t,n);else{const o=oN(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return kf(r)}function iN(e,t){const n=Is(e);return n===t||!Lr(n)||Ja(n)?!1:zr(n).position==="fixed"||iN(n,t)}function TD(e,t){const n=t.get(e);if(n)return n;let r=Lc(e,[],!1).filter(a=>Lr(a)&&pl(a)!=="body"),o=null;const s=zr(e).position==="fixed";let i=s?Is(e):e;for(;Lr(i)&&!Ja(i);){const a=zr(i),l=Yv(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&jD.has(o.position)||ou(i)&&!l&&iN(e,i))?r=r.filter(d=>d!==i):o=a,i=Is(i)}return t.set(e,r),r}function $D(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?bh(t)?[]:TD(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,d)=>{const f=Gb(t,d,o);return u.top=Bn(f.top,u.top),u.right=Rs(f.right,u.right),u.bottom=Rs(f.bottom,u.bottom),u.left=Bn(f.left,u.left),u},Gb(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function RD(e){const{width:t,height:n}=rN(e);return{width:t,height:n}}function ID(e,t,n){const r=ao(t),o=uo(t),s=n==="fixed",i=ji(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=io(0);function u(){l.x=_h(o)}if(r||!r&&!s)if((pl(t)!=="body"||ou(o))&&(a=kh(t)),r){const h=ji(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?sN(o,a):io(0),f=i.left+a.scrollLeft-l.x-d.x,p=i.top+a.scrollTop-l.y-d.y;return{x:f,y:p,width:i.width,height:i.height}}function Op(e){return zr(e).position==="static"}function Jb(e,t){if(!ao(e)||zr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return uo(e)===n&&(n=n.ownerDocument.body),n}function aN(e,t){const n=Qn(e);if(bh(e))return n;if(!ao(e)){let o=Is(e);for(;o&&!Ja(o);){if(Lr(o)&&!Op(o))return o;o=Is(o)}return n}let r=Jb(e,t);for(;r&&mD(r)&&Op(r);)r=Jb(r,t);return r&&Ja(r)&&Op(r)&&!Yv(r)?n:r||wD(e)||n}const AD=async function(e){const t=this.getOffsetParent||aN,n=this.getDimensions,r=await n(e.floating);return{reference:ID(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OD(e){return zr(e).direction==="rtl"}const MD={convertOffsetParentRelativeRectToViewportRelativeRect:SD,getDocumentElement:uo,getClippingRect:$D,getOffsetParent:aN,getElementRects:AD,getClientRects:CD,getDimensions:RD,getScale:Sa,isElement:Lr,isRTL:OD};function lN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DD(e,t){let n=null,r;const o=uo(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=u;if(a||t(),!p||!h)return;const v=Bu(f),m=Bu(o.clientWidth-(d+p)),x=Bu(o.clientHeight-(f+h)),g=Bu(d),w={rootMargin:-v+"px "+-m+"px "+-x+"px "+-g+"px",threshold:Bn(0,Rs(1,l))||1};let k=!0;function C(j){const S=j[0].intersectionRatio;if(S!==l){if(!k)return i();S?i(!1,S):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!lN(u,e.getBoundingClientRect())&&i(),k=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return i(!0),s}function LD(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:l=!1}=r,u=e0(e),d=o||s?[...u?Lc(u):[],...Lc(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const f=u&&a?DD(u,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let v,m=l?ji(e):null;l&&x();function x(){const g=ji(e);m&&!lN(m,g)&&n(),m=g,v=requestAnimationFrame(x)}return n(),()=>{var g;d.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(v)}}const zD=cD,FD=uD,UD=iD,qD=fD,VD=aD,Yb=sD,HD=dD,BD=(e,t,n)=>{const r=new Map,o={platform:MD,...n},s={...o.platform,_c:r};return oD(e,t,{...o,platform:s})};var WD=typeof document<"u",KD=function(){},Nd=WD?b.useLayoutEffect:KD;function _f(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_f(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!_f(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function cN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xb(e,t){const n=cN(e);return Math.round(t*n)/n}function Mp(e){const t=b.useRef(e);return Nd(()=>{t.current=e}),t}function ZD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,f]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=b.useState(r);_f(p,r)||h(r);const[v,m]=b.useState(null),[x,g]=b.useState(null),y=b.useCallback(q=>{q!==j.current&&(j.current=q,m(q))},[]),w=b.useCallback(q=>{q!==S.current&&(S.current=q,g(q))},[]),k=s||v,C=i||x,j=b.useRef(null),S=b.useRef(null),A=b.useRef(d),P=l!=null,R=Mp(l),T=Mp(o),I=Mp(u),F=b.useCallback(()=>{if(!j.current||!S.current)return;const q={placement:t,strategy:n,middleware:p};T.current&&(q.platform=T.current),BD(j.current,S.current,q).then(H=>{const N={...H,isPositioned:I.current!==!1};L.current&&!_f(A.current,N)&&(A.current=N,Di.flushSync(()=>{f(N)}))})},[p,t,n,T,I]);Nd(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[u]);const L=b.useRef(!1);Nd(()=>(L.current=!0,()=>{L.current=!1}),[]),Nd(()=>{if(k&&(j.current=k),C&&(S.current=C),k&&C){if(R.current)return R.current(k,C,F);F()}},[k,C,F,R,P]);const V=b.useMemo(()=>({reference:j,floating:S,setReference:y,setFloating:w}),[y,w]),Z=b.useMemo(()=>({reference:k,floating:C}),[k,C]),K=b.useMemo(()=>{const q={position:n,left:0,top:0};if(!Z.floating)return q;const H=Xb(Z.floating,d.x),N=Xb(Z.floating,d.y);return a?{...q,transform:"translate("+H+"px, "+N+"px)",...cN(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:N}},[n,a,Z.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:F,refs:V,elements:Z,floatingStyles:K}),[d,F,V,Z,K])}const QD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Yb({element:r.current,padding:o}).fn(n):{}:r?Yb({element:r,padding:o}).fn(n):{}}}},GD=(e,t)=>({...zD(e),options:[e,t]}),JD=(e,t)=>({...FD(e),options:[e,t]}),YD=(e,t)=>({...HD(e),options:[e,t]}),XD=(e,t)=>({...UD(e),options:[e,t]}),eL=(e,t)=>({...qD(e),options:[e,t]}),tL=(e,t)=>({...VD(e),options:[e,t]}),nL=(e,t)=>({...QD(e),options:[e,t]});var rL="Arrow",uN=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(je.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});uN.displayName=rL;var oL=uN;function dN(e){const[t,n]=b.useState(void 0);return rn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var t0="Popper",[fN,ml]=lo(t0),[sL,hN]=fN(t0),pN=e=>{const{__scopePopper:t,children:n}=e,[r,o]=b.useState(null);return c.jsx(sL,{scope:t,anchor:r,onAnchorChange:o,children:n})};pN.displayName=t0;var mN="PopperAnchor",gN=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=hN(mN,n),i=b.useRef(null),a=Je(t,i),l=b.useRef(null);return b.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||i.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:c.jsx(je.div,{...o,ref:a})});gN.displayName=mN;var n0="PopperContent",[iL,aL]=fN(n0),yN=b.forwardRef((e,t)=>{var B,Q,ue,oe,fe,be;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:v,...m}=e,x=hN(n0,n),[g,y]=b.useState(null),w=Je(t,ot=>y(ot)),[k,C]=b.useState(null),j=dN(k),S=(j==null?void 0:j.width)??0,A=(j==null?void 0:j.height)??0,P=r+(s!=="center"?"-"+s:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(u)?u:[u],I=T.length>0,F={padding:R,boundary:T.filter(cL),altBoundary:I},{refs:L,floatingStyles:V,placement:Z,isPositioned:K,middlewareData:q}=ZD({strategy:"fixed",placement:P,whileElementsMounted:(...ot)=>LD(...ot,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[GD({mainAxis:o+A,alignmentAxis:i}),l&&JD({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?YD():void 0,...F}),l&&XD({...F}),eL({...F,apply:({elements:ot,rects:et,availableWidth:te,availableHeight:pe})=>{const{width:ne,height:Ve}=et.reference,se=ot.floating.style;se.setProperty("--radix-popper-available-width",`${te}px`),se.setProperty("--radix-popper-available-height",`${pe}px`),se.setProperty("--radix-popper-anchor-width",`${ne}px`),se.setProperty("--radix-popper-anchor-height",`${Ve}px`)}}),k&&nL({element:k,padding:a}),uL({arrowWidth:S,arrowHeight:A}),p&&tL({strategy:"referenceHidden",...F})]}),[H,N]=wN(Z),O=mr(v);rn(()=>{K&&(O==null||O())},[K,O]);const U=(B=q.arrow)==null?void 0:B.x,_=(Q=q.arrow)==null?void 0:Q.y,E=((ue=q.arrow)==null?void 0:ue.centerOffset)!==0,[$,M]=b.useState();return rn(()=>{g&&M(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:K?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$,"--radix-popper-transform-origin":[(oe=q.transformOrigin)==null?void 0:oe.x,(fe=q.transformOrigin)==null?void 0:fe.y].join(" "),...((be=q.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(iL,{scope:n,placedSide:H,onArrowChange:C,arrowX:U,arrowY:_,shouldHideArrow:E,children:c.jsx(je.div,{"data-side":H,"data-align":N,...m,ref:w,style:{...m.style,animation:K?void 0:"none"}})})})});yN.displayName=n0;var vN="PopperArrow",lL={top:"bottom",right:"left",bottom:"top",left:"right"},xN=b.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=aL(vN,r),i=lL[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(oL,{...o,ref:n,style:{...o.style,display:"block"}})})});xN.displayName=vN;function cL(e){return e!==null}var uL=e=>({name:"transformOrigin",options:e,fn(t){var x,g,y;const{placement:n,rects:r,middlewareData:o}=t,i=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,d]=wN(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,h=(((y=o.arrow)==null?void 0:y.y)??0)+l/2;let v="",m="";return u==="bottom"?(v=i?f:`${p}px`,m=`${-l}px`):u==="top"?(v=i?f:`${p}px`,m=`${r.floating.height+l}px`):u==="right"?(v=`${-l}px`,m=i?f:`${h}px`):u==="left"&&(v=`${r.floating.width+l}px`,m=i?f:`${h}px`),{data:{x:v,y:m}}}});function wN(e){const[t,n="center"]=e.split("-");return[t,n]}var bN=pN,Sh=gN,r0=yN,o0=xN,[Ch,Xee]=lo("Tooltip",[ml]),s0=ml(),kN="TooltipProvider",dL=700,ek="tooltip.open",[fL,_N]=Ch(kN),SN=e=>{const{__scopeTooltip:t,delayDuration:n=dL,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=b.useRef(!0),a=b.useRef(!1),l=b.useRef(0);return b.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(fL,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:b.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};SN.displayName=kN;var CN="Tooltip",[ete,Eh]=Ch(CN),zg="TooltipTrigger",hL=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Eh(zg,n),s=_N(zg,n),i=s0(n),a=b.useRef(null),l=Je(t,a,o.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),f=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(Sh,{asChild:!0,...i,children:c.jsx(je.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:xe(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:xe(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:xe(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:xe(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:xe(e.onBlur,o.onClose),onClick:xe(e.onClick,o.onClose)})})});hL.displayName=zg;var pL="TooltipPortal",[tte,mL]=Ch(pL,{forceMount:void 0}),Ya="TooltipContent",EN=b.forwardRef((e,t)=>{const n=mL(Ya,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Eh(Ya,e.__scopeTooltip);return c.jsx(co,{present:r||i.open,children:i.disableHoverableContent?c.jsx(NN,{side:o,...s,ref:t}):c.jsx(gL,{side:o,...s,ref:t})})}),gL=b.forwardRef((e,t)=>{const n=Eh(Ya,e.__scopeTooltip),r=_N(Ya,e.__scopeTooltip),o=b.useRef(null),s=Je(t,o),[i,a]=b.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=b.useCallback(()=>{a(null),f(!1)},[f]),h=b.useCallback((v,m)=>{const x=v.currentTarget,g={x:v.clientX,y:v.clientY},y=bL(g,x.getBoundingClientRect()),w=kL(g,y),k=_L(m.getBoundingClientRect()),C=CL([...w,...k]);a(C),f(!0)},[f]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(l&&d){const v=x=>h(x,d),m=x=>h(x,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",m)}}},[l,d,h,p]),b.useEffect(()=>{if(i){const v=m=>{const x=m.target,g={x:m.clientX,y:m.clientY},y=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),w=!SL(g,i);y?p():w&&(p(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,i,u,p]),c.jsx(NN,{...e,ref:s})}),[yL,vL]=Ch(CN,{isInside:!1}),xL=oM("TooltipContent"),NN=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=Eh(Ya,n),u=s0(n),{onClose:d}=l;return b.useEffect(()=>(document.addEventListener(ek,d),()=>document.removeEventListener(ek,d)),[d]),b.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),c.jsx(dl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:c.jsxs(r0,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(xL,{children:r}),c.jsx(yL,{scope:n,isInside:!0,children:c.jsx(EM,{id:l.contentId,role:"tooltip",children:o||r})})]})})});EN.displayName=Ya;var jN="TooltipArrow",wL=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=s0(n);return vL(jN,n).isInside?null:c.jsx(o0,{...o,...r,ref:t})});wL.displayName=jN;function bL(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 kL(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function _L(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 SL(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],l=t[i],u=a.x,d=a.y,f=l.x,p=l.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function CL(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),EL(t)}function EL(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)}var NL=SN,PN=EN;const jL=NL,PL=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(PN,{ref:r,sideOffset:t,className:Ee("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n}));PL.displayName=PN.displayName;const TL={total:0,byKind:{oauth_required:0,oauth_expired:0,service_unhealthy:0,credential_missing_secret:0,playbook_missing_deps:0},serviceWarnings:new Map,credentialWarnings:new Map,playbookWarnings:new Map};function $L(e){return e?{total:e.total,byKind:e.byKind,serviceWarnings:new Map(Object.entries(e.services)),credentialWarnings:new Map(Object.entries(e.credentials)),playbookWarnings:new Map(Object.entries(e.playbooks))}:TL}const wn="#92E4DD",Rn="#F9386D",Cr="#FFFFFF",Jr="bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900";function Hr(e){return wn}function Yr(e){return{borderColor:e,color:e,boxShadow:`0 0 20px ${e}20`}}const RL=yh("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ae=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?nM:"button";return c.jsx(i,{className:Ee(RL({variant:t,size:n,className:e})),ref:s,...o})});ae.displayName="Button";function Ca({warnings:e}){if(!(e!=null&&e.length))return null;const t=e.find(r=>r.severity==="error")??e[0],n=t.severity==="error";return c.jsxs("div",{className:`absolute left-1/2 -translate-x-1/2 top-8 z-20 flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[7px] font-semibold uppercase tracking-wide shadow-lg ${n?"bg-red-500/90 text-white border border-red-300/60":"bg-amber-500/90 text-black border border-amber-200/60"}`,title:e.map(r=>r.message).join(" · "),"data-testid":"card-warning-badge",children:[c.jsx(Tr,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"max-w-[72px] truncate",children:t.message})]})}const tk="data:image/svg+xml,%3csvg%20id='eSEM9z84vJh1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20300%20300'%20shape-rendering='geometricPrecision'%20text-rendering='geometricPrecision'%20project-id='c9405aa1bbb44eb388e44d7178ee1932'%20export-id='327eb6bfd5a543cb88b86ffe07ce0c92'%20cached='false'%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='translate(71.928217%20125.25355)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='matrix(2.570356%200%200%202.449277%2067.884163%2017.275854)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='translate(163.184592%20125.25355)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='matrix(3.42849%200%200%200.403818%2040.469132%20102.975708)'%20stroke-width='0'/%3e%3cpolygon%20points='0,-42.01893%2030.924539,20.531677%2024.698107,33.994028%20-24.698107,33.994028%20-33.20748,20.12246%200,-42.01893'%20transform='matrix(-.687913%200.002106-.00101-.33%20149.995947%20212.592699)'%20stroke-width='0'/%3e%3cpolygon%20points='0,-42.01893%2036.327051,-24.945112%2016.852287,34.058016%20-19.029679,34.002758%20-36.534138,-25.057317%200,-42.01893'%20transform='matrix(-.466366%200.001428-.002837-.926983%20149.84238%20249.643929)'%20stroke-width='0'/%3e%3c/svg%3e";function IL(e){return e.iconUrl?e.iconUrl:null}function TN({service:e}){const t=Hr(),n=IL(e),[r,o]=b.useState(!1);return n&&!r?c.jsx("img",{src:n,alt:"",className:"w-7 h-7 object-contain rounded-sm",draggable:!1,onError:()=>o(!0)}):c.jsx("div",{style:{width:28,height:28,backgroundColor:t,WebkitMask:`url(${tk}) no-repeat center / contain`,mask:`url(${tk}) no-repeat center / contain`},"aria-hidden":!0})}function i0(e){return e?"ring-2 ring-inset ring-yellow-400/90 shadow-[0_0_10px_rgba(250,204,21,0.2)]":""}function a0(){return c.jsx("span",{className:"absolute top-1.5 left-1/2 z-20 -translate-x-1/2 rounded bg-yellow-500 px-1 py-px text-[7px] font-bold uppercase tracking-wide text-black shadow",children:"In deck"})}function AL({service:e,onDragStart:t,onDragEnd:n,isInActiveDeck:r,onCardClick:o,isInCollection:s=!1,onMouseEnter:i,onMouseLeave:a,activeDeck:l,warnings:u}){const d=on(),{toast:f}=Zt(),p=Hr(),h=vt({mutationFn:async()=>{if(!l)throw new Error("No active deck found");return Se("POST",`/api/decks/${l.id}/services`,{serviceId:e.id,position:0})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Service added to deck",description:`${e.name} has been added to your active deck.`})},onError:g=>{f({title:"Failed to add service",description:g.message,variant:"destructive"})}}),v=vt({mutationFn:async()=>Se("DELETE",`/api/services/${e.id}`,{}),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/services"]}),d.invalidateQueries({queryKey:["/api/collection/warnings"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Service deleted",description:`${e.name} has been deleted successfully.`})},onError:g=>{f({title:"Failed to delete service",description:g.message,variant:"destructive"})}}),m=g=>{g.stopPropagation(),h.mutate()},x=g=>{g.stopPropagation(),window.confirm(`Are you sure you want to delete ${e.name}? This action cannot be undone.`)&&v.mutate()};return c.jsx("div",{className:"relative group cursor-pointer",draggable:!r,onDragStart:g=>t(g,e),onDragEnd:n,onClick:()=>o==null?void 0:o(e),"data-testid":`card-${e.id}`,onMouseEnter:i,onMouseLeave:a,children:c.jsxs("div",{className:`
|
|
258
|
+
*/const xf=Le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Zv="-",c4=e=>{const t=d4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Zv);return a[0]===""&&a.length!==1&&a.shift(),VE(a,t)||u4(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},VE=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?VE(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Zv);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Ub=/^\[(.+)\]$/,u4=e=>{if(Ub.test(e)){const t=Ub.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},d4=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return h4(Object.entries(e.classGroups),n).forEach(([s,i])=>{Og(i,r,s,t)}),r},Og=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:qb(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(f4(o)){Og(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Og(i,qb(t,s),n,r)})})},qb=(e,t)=>{let n=e;return t.split(Zv).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},f4=e=>e.isThemeGetter,h4=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,p4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},HE="!",m4=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let u=0,d=0,f;for(let x=0;x<a.length;x++){let g=a[x];if(u===0){if(g===o&&(r||a.slice(x,x+s)===t)){l.push(a.slice(d,x)),d=x+s;continue}if(g==="/"){f=x;continue}}g==="["?u++:g==="]"&&u--}const p=l.length===0?a:a.substring(d),h=p.startsWith(HE),v=h?p.substring(1):p,m=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:i}):i},g4=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},y4=e=>({cache:p4(e.cacheSize),parseClassName:m4(e),...c4(e)}),v4=/\s+/,x4=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(v4);let a="";for(let l=i.length-1;l>=0;l-=1){const u=i[l],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let v=!!h,m=r(v?p.substring(0,h):p);if(!m){if(!v){a=u+(a.length>0?" "+a:a);continue}if(m=r(p),!m){a=u+(a.length>0?" "+a:a);continue}v=!1}const x=g4(d).join(":"),g=f?x+HE:x,y=g+m;if(s.includes(y))continue;s.push(y);const w=o(m,v);for(let k=0;k<w.length;++k){const C=w[k];s.push(g+C)}a=u+(a.length>0?" "+a:a)}return a};function w4(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=BE(t))&&(r&&(r+=" "),r+=n);return r}const BE=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=BE(e[r]))&&(n&&(n+=" "),n+=t);return n};function b4(e,...t){let n,r,o,s=i;function i(l){const u=t.reduce((d,f)=>f(d),e());return n=y4(u),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=x4(l,n);return o(l,d),d}return function(){return s(w4.apply(null,arguments))}}const lt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},WE=/^\[(?:([a-z-]+):)?(.+)\]$/i,k4=/^\d+\/\d+$/,_4=new Set(["px","full","screen"]),S4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,E4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,N4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mo=e=>_a(e)||_4.has(e)||k4.test(e),Bo=e=>fl(e,"length",M4),_a=e=>!!e&&!Number.isNaN(Number(e)),Ap=e=>fl(e,"number",_a),Rl=e=>!!e&&Number.isInteger(Number(e)),P4=e=>e.endsWith("%")&&_a(e.slice(0,-1)),$e=e=>WE.test(e),Wo=e=>S4.test(e),T4=new Set(["length","size","percentage"]),$4=e=>fl(e,T4,KE),R4=e=>fl(e,"position",KE),I4=new Set(["image","url"]),A4=e=>fl(e,I4,L4),O4=e=>fl(e,"",D4),Il=()=>!0,fl=(e,t,n)=>{const r=WE.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},M4=e=>C4.test(e)&&!E4.test(e),KE=()=>!1,D4=e=>N4.test(e),L4=e=>j4.test(e),z4=()=>{const e=lt("colors"),t=lt("spacing"),n=lt("blur"),r=lt("brightness"),o=lt("borderColor"),s=lt("borderRadius"),i=lt("borderSpacing"),a=lt("borderWidth"),l=lt("contrast"),u=lt("grayscale"),d=lt("hueRotate"),f=lt("invert"),p=lt("gap"),h=lt("gradientColorStops"),v=lt("gradientColorStopPositions"),m=lt("inset"),x=lt("margin"),g=lt("opacity"),y=lt("padding"),w=lt("saturate"),k=lt("scale"),C=lt("sepia"),j=lt("skew"),S=lt("space"),A=lt("translate"),P=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",$e,t],I=()=>[$e,t],F=()=>["",mo,Bo],L=()=>["auto",_a,$e],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",$e],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[_a,$e];return{cacheSize:500,separator:":",theme:{colors:[Il],spacing:[mo,Bo],blur:["none","",Wo,$e],brightness:O(),borderColor:[e],borderRadius:["none","","full",Wo,$e],borderSpacing:I(),borderWidth:F(),contrast:O(),grayscale:H(),hueRotate:O(),invert:H(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[P4,Bo],inset:T(),margin:T(),opacity:O(),padding:I(),saturate:O(),scale:O(),sepia:H(),skew:O(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[Wo]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),$e]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Rl,$e]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Rl,$e]}],"grid-cols":[{"grid-cols":[Il]}],"col-start-end":[{col:["auto",{span:["full",Rl,$e]},$e]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Il]}],"row-start-end":[{row:["auto",{span:[Rl,$e]},$e]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[Wo]},Wo]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Wo,Bo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ap]}],"font-family":[{font:[Il]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$e]}],"line-clamp":[{"line-clamp":["none",_a,Ap]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mo,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mo,Bo]}],"underline-offset":[{"underline-offset":["auto",mo,$e]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),R4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},A4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Z()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[mo,$e]}],"outline-w":[{outline:[mo,Bo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[mo,Bo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Wo,O4]}],"shadow-color":[{shadow:[Il]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Wo,$e]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Rl,$e]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[mo,Bo,Ap]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},F4=b4(z4);function Ee(...e){return F4(OE(e))}const U4=HM,ZE=b.forwardRef(({className:e,...t},n)=>c.jsx(jE,{ref:n,className:Ee("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));ZE.displayName=jE.displayName;const q4=yh("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),QE=b.forwardRef(({className:e,variant:t,...n},r)=>c.jsx(PE,{ref:r,className:Ee(q4({variant:t}),e),...n}));QE.displayName=PE.displayName;const V4=b.forwardRef(({className:e,...t},n)=>c.jsx(RE,{ref:n,className:Ee("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));V4.displayName=RE.displayName;const GE=b.forwardRef(({className:e,...t},n)=>c.jsx(IE,{ref:n,className:Ee("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:c.jsx(xf,{className:"h-4 w-4"})}));GE.displayName=IE.displayName;const JE=b.forwardRef(({className:e,...t},n)=>c.jsx(TE,{ref:n,className:Ee("text-sm font-semibold",e),...t}));JE.displayName=TE.displayName;const YE=b.forwardRef(({className:e,...t},n)=>c.jsx($E,{ref:n,className:Ee("text-sm opacity-90",e),...t}));YE.displayName=$E.displayName;function H4(){const{toasts:e}=Zt();return c.jsxs(U4,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return c.jsxs(QE,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(JE,{children:n}),r&&c.jsx(YE,{children:r})]}),o,c.jsx(GE,{})]},t)}),c.jsx(ZE,{})]})}var B4=By[" useId ".trim().toString()]||(()=>{}),W4=0;function jo(e){const[t,n]=b.useState(B4());return rn(()=>{n(r=>r??String(W4++))},[e]),t?`radix-${t}`:""}const K4=["top","right","bottom","left"],Rs=Math.min,Bn=Math.max,wf=Math.round,Bu=Math.floor,io=e=>({x:e,y:e}),Z4={left:"right",right:"left",bottom:"top",top:"bottom"},Q4={start:"end",end:"start"};function Mg(e,t,n){return Bn(e,Rs(t,n))}function Mo(e,t){return typeof e=="function"?e(t):e}function Do(e){return e.split("-")[0]}function hl(e){return e.split("-")[1]}function Qv(e){return e==="x"?"y":"x"}function Gv(e){return e==="y"?"height":"width"}const G4=new Set(["top","bottom"]);function to(e){return G4.has(Do(e))?"y":"x"}function Jv(e){return Qv(to(e))}function J4(e,t,n){n===void 0&&(n=!1);const r=hl(e),o=Jv(e),s=Gv(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=bf(i)),[i,bf(i)]}function Y4(e){const t=bf(e);return[Dg(e),t,Dg(t)]}function Dg(e){return e.replace(/start|end/g,t=>Q4[t])}const Vb=["left","right"],Hb=["right","left"],X4=["top","bottom"],eD=["bottom","top"];function tD(e,t,n){switch(e){case"top":case"bottom":return n?t?Hb:Vb:t?Vb:Hb;case"left":case"right":return t?X4:eD;default:return[]}}function nD(e,t,n,r){const o=hl(e);let s=tD(Do(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Dg)))),s}function bf(e){return e.replace(/left|right|bottom|top/g,t=>Z4[t])}function rD(e){return{top:0,right:0,bottom:0,left:0,...e}}function XE(e){return typeof e!="number"?rD(e):{top:e,right:e,bottom:e,left:e}}function kf(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 Bb(e,t,n){let{reference:r,floating:o}=e;const s=to(t),i=Jv(t),a=Gv(i),l=Do(t),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(hl(t)){case"start":h[i]-=p*(n&&u?-1:1);break;case"end":h[i]+=p*(n&&u?-1:1);break}return h}const oD=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=Bb(u,r,l),p=r,h={},v=0;for(let m=0;m<a.length;m++){const{name:x,fn:g}=a[m],{x:y,y:w,data:k,reset:C}=await g({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:i,elements:{reference:e,floating:t}});d=y??d,f=w??f,h={...h,[x]:{...h[x],...k}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(u=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:d,y:f}=Bb(u,p,l)),m=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}};async function Dc(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Mo(t,e),v=XE(h),x=a[p?f==="floating"?"reference":"floating":f],g=kf(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),y=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),k=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=kf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:l}):y);return{top:(g.top-C.top+v.top)/k.y,bottom:(C.bottom-g.bottom+v.bottom)/k.y,left:(g.left-C.left+v.left)/k.x,right:(C.right-g.right+v.right)/k.x}}const sD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=Mo(e,t)||{};if(u==null)return{};const f=XE(d),p={x:n,y:r},h=Jv(o),v=Gv(h),m=await i.getDimensions(u),x=h==="y",g=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",k=s.reference[v]+s.reference[h]-p[h]-s.floating[v],C=p[h]-s.reference[h],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let S=j?j[w]:0;(!S||!await(i.isElement==null?void 0:i.isElement(j)))&&(S=a.floating[w]||s.floating[v]);const A=k/2-C/2,P=S/2-m[v]/2-1,R=Rs(f[g],P),T=Rs(f[y],P),I=R,F=S-m[v]-T,L=S/2-m[v]/2+A,V=Mg(I,L,F),Z=!l.arrow&&hl(o)!=null&&L!==V&&s.reference[v]/2-(L<I?R:T)-m[v]/2<0,K=Z?L<I?L-I:L-F:0;return{[h]:p[h]+K,data:{[h]:V,centerOffset:L-V-K,...Z&&{alignmentOffset:K}},reset:Z}}}),iD=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:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...x}=Mo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=Do(o),y=to(a),w=Do(a)===a,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=p||(w||!m?[bf(a)]:Y4(a)),j=v!=="none";!p&&j&&C.push(...nD(a,m,v,k));const S=[a,...C],A=await Dc(t,x),P=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&P.push(A[g]),f){const L=J4(o,i,k);P.push(A[L[0]],A[L[1]])}if(R=[...R,{placement:o,overflows:P}],!P.every(L=>L<=0)){var T,I;const L=(((T=s.flip)==null?void 0:T.index)||0)+1,V=S[L];if(V&&(!(f==="alignment"?y!==to(V):!1)||R.every(q=>to(q.placement)===y?q.overflows[0]>0:!0)))return{data:{index:L,overflows:R},reset:{placement:V}};let Z=(I=R.filter(K=>K.overflows[0]<=0).sort((K,q)=>K.overflows[1]-q.overflows[1])[0])==null?void 0:I.placement;if(!Z)switch(h){case"bestFit":{var F;const K=(F=R.filter(q=>{if(j){const H=to(q.placement);return H===y||H==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(H=>H>0).reduce((H,N)=>H+N,0)]).sort((q,H)=>q[1]-H[1])[0])==null?void 0:F[0];K&&(Z=K);break}case"initialPlacement":Z=a;break}if(o!==Z)return{reset:{placement:Z}}}return{}}}};function Wb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kb(e){return K4.some(t=>e[t]>=0)}const aD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Mo(e,t);switch(r){case"referenceHidden":{const s=await Dc(t,{...o,elementContext:"reference"}),i=Wb(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Kb(i)}}}case"escaped":{const s=await Dc(t,{...o,altBoundary:!0}),i=Wb(s,n.floating);return{data:{escapedOffsets:i,escaped:Kb(i)}}}default:return{}}}}},eN=new Set(["left","top"]);async function lD(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Do(n),a=hl(n),l=to(n)==="y",u=eN.has(i)?-1:1,d=s&&l?-1:1,f=Mo(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(h=a==="end"?v*-1:v),l?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const cD=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,l=await lD(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},uD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:x=>{let{x:g,y}=x;return{x:g,y}}},...l}=Mo(e,t),u={x:n,y:r},d=await Dc(t,l),f=to(Do(o)),p=Qv(f);let h=u[p],v=u[f];if(s){const x=p==="y"?"top":"left",g=p==="y"?"bottom":"right",y=h+d[x],w=h-d[g];h=Mg(y,h,w)}if(i){const x=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=v+d[x],w=v-d[g];v=Mg(y,v,w)}const m=a.fn({...t,[p]:h,[f]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:s,[f]:i}}}}}},dD=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:l=!0,crossAxis:u=!0}=Mo(e,t),d={x:n,y:r},f=to(o),p=Qv(f);let h=d[p],v=d[f];const m=Mo(a,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const w=p==="y"?"height":"width",k=s.reference[p]-s.floating[w]+x.mainAxis,C=s.reference[p]+s.reference[w]-x.mainAxis;h<k?h=k:h>C&&(h=C)}if(u){var g,y;const w=p==="y"?"width":"height",k=eN.has(Do(o)),C=s.reference[f]-s.floating[w]+(k&&((g=i.offset)==null?void 0:g[f])||0)+(k?0:x.crossAxis),j=s.reference[f]+s.reference[w]+(k?0:((y=i.offset)==null?void 0:y[f])||0)-(k?x.crossAxis:0);v<C?v=C:v>j&&(v=j)}return{[p]:h,[f]:v}}}},fD=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:l=()=>{},...u}=Mo(e,t),d=await Dc(t,u),f=Do(o),p=hl(o),h=to(o)==="y",{width:v,height:m}=s.floating;let x,g;f==="top"||f==="bottom"?(x=f,g=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,x=p==="end"?"top":"bottom");const y=m-d.top-d.bottom,w=v-d.left-d.right,k=Rs(m-d[x],y),C=Rs(v-d[g],w),j=!t.middlewareData.shift;let S=k,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=y),j&&!p){const R=Bn(d.left,0),T=Bn(d.right,0),I=Bn(d.top,0),F=Bn(d.bottom,0);h?A=v-2*(R!==0||T!==0?R+T:Bn(d.left,d.right)):S=m-2*(I!==0||F!==0?I+F:Bn(d.top,d.bottom))}await l({...t,availableWidth:A,availableHeight:S});const P=await i.getDimensions(a.floating);return v!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function wh(){return typeof window<"u"}function pl(e){return tN(e)?(e.nodeName||"").toLowerCase():"#document"}function Qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function uo(e){var t;return(t=(tN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function tN(e){return wh()?e instanceof Node||e instanceof Qn(e).Node:!1}function Lr(e){return wh()?e instanceof Element||e instanceof Qn(e).Element:!1}function ao(e){return wh()?e instanceof HTMLElement||e instanceof Qn(e).HTMLElement:!1}function Zb(e){return!wh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qn(e).ShadowRoot}const hD=new Set(["inline","contents"]);function ou(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=zr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!hD.has(o)}const pD=new Set(["table","td","th"]);function mD(e){return pD.has(pl(e))}const gD=[":popover-open",":modal"];function bh(e){return gD.some(t=>{try{return e.matches(t)}catch{return!1}})}const yD=["transform","translate","scale","rotate","perspective"],vD=["transform","translate","scale","rotate","perspective","filter"],xD=["paint","layout","strict","content"];function Yv(e){const t=Xv(),n=Lr(e)?zr(e):e;return yD.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)||vD.some(r=>(n.willChange||"").includes(r))||xD.some(r=>(n.contain||"").includes(r))}function wD(e){let t=Is(e);for(;ao(t)&&!Ja(t);){if(Yv(t))return t;if(bh(t))return null;t=Is(t)}return null}function Xv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const bD=new Set(["html","body","#document"]);function Ja(e){return bD.has(pl(e))}function zr(e){return Qn(e).getComputedStyle(e)}function kh(e){return Lr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Is(e){if(pl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zb(e)&&e.host||uo(e);return Zb(t)?t.host:t}function nN(e){const t=Is(e);return Ja(t)?e.ownerDocument?e.ownerDocument.body:e.body:ao(t)&&ou(t)?t:nN(t)}function Lc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=nN(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Qn(o);if(s){const a=Lg(i);return t.concat(i,i.visualViewport||[],ou(o)?o:[],a&&n?Lc(a):[])}return t.concat(o,Lc(o,[],n))}function Lg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rN(e){const t=zr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ao(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=wf(n)!==s||wf(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function e0(e){return Lr(e)?e:e.contextElement}function Sa(e){const t=e0(e);if(!ao(t))return io(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=rN(t);let i=(s?wf(n.width):n.width)/r,a=(s?wf(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const kD=io(0);function oN(e){const t=Qn(e);return!Xv()||!t.visualViewport?kD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _D(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qn(e)?!1:t}function ji(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=e0(e);let i=io(1);t&&(r?Lr(r)&&(i=Sa(r)):i=Sa(e));const a=_D(s,n,r)?oN(s):io(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const p=Qn(s),h=r&&Lr(r)?Qn(r):r;let v=p,m=Lg(v);for(;m&&r&&h!==v;){const x=Sa(m),g=m.getBoundingClientRect(),y=zr(m),w=g.left+(m.clientLeft+parseFloat(y.paddingLeft))*x.x,k=g.top+(m.clientTop+parseFloat(y.paddingTop))*x.y;l*=x.x,u*=x.y,d*=x.x,f*=x.y,l+=w,u+=k,v=Qn(m),m=Lg(v)}}return kf({width:d,height:f,x:l,y:u})}function _h(e,t){const n=kh(e).scrollLeft;return t?t.left+n:ji(uo(e)).left+n}function sN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-_h(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function SD(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=uo(r),a=t?bh(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=io(1);const d=io(0),f=ao(r);if((f||!f&&!s)&&((pl(r)!=="body"||ou(i))&&(l=kh(r)),ao(r))){const h=ji(r);u=Sa(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=i&&!f&&!s?sN(i,l):io(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function CD(e){return Array.from(e.getClientRects())}function ED(e){const t=uo(e),n=kh(e),r=e.ownerDocument.body,o=Bn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Bn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+_h(e);const a=-n.scrollTop;return zr(r).direction==="rtl"&&(i+=Bn(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Qb=25;function ND(e,t){const n=Qn(e),r=uo(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const d=Xv();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=_h(r);if(u<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-h);v<=Qb&&(s-=v)}else u<=Qb&&(s+=u);return{width:s,height:i,x:a,y:l}}const jD=new Set(["absolute","fixed"]);function PD(e,t){const n=ji(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ao(e)?Sa(e):io(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function Gb(e,t,n){let r;if(t==="viewport")r=ND(e,n);else if(t==="document")r=ED(uo(e));else if(Lr(t))r=PD(t,n);else{const o=oN(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return kf(r)}function iN(e,t){const n=Is(e);return n===t||!Lr(n)||Ja(n)?!1:zr(n).position==="fixed"||iN(n,t)}function TD(e,t){const n=t.get(e);if(n)return n;let r=Lc(e,[],!1).filter(a=>Lr(a)&&pl(a)!=="body"),o=null;const s=zr(e).position==="fixed";let i=s?Is(e):e;for(;Lr(i)&&!Ja(i);){const a=zr(i),l=Yv(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&jD.has(o.position)||ou(i)&&!l&&iN(e,i))?r=r.filter(d=>d!==i):o=a,i=Is(i)}return t.set(e,r),r}function $D(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?bh(t)?[]:TD(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,d)=>{const f=Gb(t,d,o);return u.top=Bn(f.top,u.top),u.right=Rs(f.right,u.right),u.bottom=Rs(f.bottom,u.bottom),u.left=Bn(f.left,u.left),u},Gb(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function RD(e){const{width:t,height:n}=rN(e);return{width:t,height:n}}function ID(e,t,n){const r=ao(t),o=uo(t),s=n==="fixed",i=ji(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=io(0);function u(){l.x=_h(o)}if(r||!r&&!s)if((pl(t)!=="body"||ou(o))&&(a=kh(t)),r){const h=ji(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?sN(o,a):io(0),f=i.left+a.scrollLeft-l.x-d.x,p=i.top+a.scrollTop-l.y-d.y;return{x:f,y:p,width:i.width,height:i.height}}function Op(e){return zr(e).position==="static"}function Jb(e,t){if(!ao(e)||zr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return uo(e)===n&&(n=n.ownerDocument.body),n}function aN(e,t){const n=Qn(e);if(bh(e))return n;if(!ao(e)){let o=Is(e);for(;o&&!Ja(o);){if(Lr(o)&&!Op(o))return o;o=Is(o)}return n}let r=Jb(e,t);for(;r&&mD(r)&&Op(r);)r=Jb(r,t);return r&&Ja(r)&&Op(r)&&!Yv(r)?n:r||wD(e)||n}const AD=async function(e){const t=this.getOffsetParent||aN,n=this.getDimensions,r=await n(e.floating);return{reference:ID(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OD(e){return zr(e).direction==="rtl"}const MD={convertOffsetParentRelativeRectToViewportRelativeRect:SD,getDocumentElement:uo,getClippingRect:$D,getOffsetParent:aN,getElementRects:AD,getClientRects:CD,getDimensions:RD,getScale:Sa,isElement:Lr,isRTL:OD};function lN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DD(e,t){let n=null,r;const o=uo(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=u;if(a||t(),!p||!h)return;const v=Bu(f),m=Bu(o.clientWidth-(d+p)),x=Bu(o.clientHeight-(f+h)),g=Bu(d),w={rootMargin:-v+"px "+-m+"px "+-x+"px "+-g+"px",threshold:Bn(0,Rs(1,l))||1};let k=!0;function C(j){const S=j[0].intersectionRatio;if(S!==l){if(!k)return i();S?i(!1,S):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!lN(u,e.getBoundingClientRect())&&i(),k=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return i(!0),s}function LD(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:l=!1}=r,u=e0(e),d=o||s?[...u?Lc(u):[],...Lc(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const f=u&&a?DD(u,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let v,m=l?ji(e):null;l&&x();function x(){const g=ji(e);m&&!lN(m,g)&&n(),m=g,v=requestAnimationFrame(x)}return n(),()=>{var g;d.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(v)}}const zD=cD,FD=uD,UD=iD,qD=fD,VD=aD,Yb=sD,HD=dD,BD=(e,t,n)=>{const r=new Map,o={platform:MD,...n},s={...o.platform,_c:r};return oD(e,t,{...o,platform:s})};var WD=typeof document<"u",KD=function(){},Nd=WD?b.useLayoutEffect:KD;function _f(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_f(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!_f(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function cN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xb(e,t){const n=cN(e);return Math.round(t*n)/n}function Mp(e){const t=b.useRef(e);return Nd(()=>{t.current=e}),t}function ZD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,f]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=b.useState(r);_f(p,r)||h(r);const[v,m]=b.useState(null),[x,g]=b.useState(null),y=b.useCallback(q=>{q!==j.current&&(j.current=q,m(q))},[]),w=b.useCallback(q=>{q!==S.current&&(S.current=q,g(q))},[]),k=s||v,C=i||x,j=b.useRef(null),S=b.useRef(null),A=b.useRef(d),P=l!=null,R=Mp(l),T=Mp(o),I=Mp(u),F=b.useCallback(()=>{if(!j.current||!S.current)return;const q={placement:t,strategy:n,middleware:p};T.current&&(q.platform=T.current),BD(j.current,S.current,q).then(H=>{const N={...H,isPositioned:I.current!==!1};L.current&&!_f(A.current,N)&&(A.current=N,Di.flushSync(()=>{f(N)}))})},[p,t,n,T,I]);Nd(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[u]);const L=b.useRef(!1);Nd(()=>(L.current=!0,()=>{L.current=!1}),[]),Nd(()=>{if(k&&(j.current=k),C&&(S.current=C),k&&C){if(R.current)return R.current(k,C,F);F()}},[k,C,F,R,P]);const V=b.useMemo(()=>({reference:j,floating:S,setReference:y,setFloating:w}),[y,w]),Z=b.useMemo(()=>({reference:k,floating:C}),[k,C]),K=b.useMemo(()=>{const q={position:n,left:0,top:0};if(!Z.floating)return q;const H=Xb(Z.floating,d.x),N=Xb(Z.floating,d.y);return a?{...q,transform:"translate("+H+"px, "+N+"px)",...cN(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:N}},[n,a,Z.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:F,refs:V,elements:Z,floatingStyles:K}),[d,F,V,Z,K])}const QD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Yb({element:r.current,padding:o}).fn(n):{}:r?Yb({element:r,padding:o}).fn(n):{}}}},GD=(e,t)=>({...zD(e),options:[e,t]}),JD=(e,t)=>({...FD(e),options:[e,t]}),YD=(e,t)=>({...HD(e),options:[e,t]}),XD=(e,t)=>({...UD(e),options:[e,t]}),eL=(e,t)=>({...qD(e),options:[e,t]}),tL=(e,t)=>({...VD(e),options:[e,t]}),nL=(e,t)=>({...QD(e),options:[e,t]});var rL="Arrow",uN=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(je.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});uN.displayName=rL;var oL=uN;function dN(e){const[t,n]=b.useState(void 0);return rn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var t0="Popper",[fN,ml]=lo(t0),[sL,hN]=fN(t0),pN=e=>{const{__scopePopper:t,children:n}=e,[r,o]=b.useState(null);return c.jsx(sL,{scope:t,anchor:r,onAnchorChange:o,children:n})};pN.displayName=t0;var mN="PopperAnchor",gN=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=hN(mN,n),i=b.useRef(null),a=Je(t,i),l=b.useRef(null);return b.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||i.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:c.jsx(je.div,{...o,ref:a})});gN.displayName=mN;var n0="PopperContent",[iL,aL]=fN(n0),yN=b.forwardRef((e,t)=>{var B,Q,ue,oe,fe,be;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:v,...m}=e,x=hN(n0,n),[g,y]=b.useState(null),w=Je(t,ot=>y(ot)),[k,C]=b.useState(null),j=dN(k),S=(j==null?void 0:j.width)??0,A=(j==null?void 0:j.height)??0,P=r+(s!=="center"?"-"+s:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(u)?u:[u],I=T.length>0,F={padding:R,boundary:T.filter(cL),altBoundary:I},{refs:L,floatingStyles:V,placement:Z,isPositioned:K,middlewareData:q}=ZD({strategy:"fixed",placement:P,whileElementsMounted:(...ot)=>LD(...ot,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[GD({mainAxis:o+A,alignmentAxis:i}),l&&JD({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?YD():void 0,...F}),l&&XD({...F}),eL({...F,apply:({elements:ot,rects:et,availableWidth:te,availableHeight:pe})=>{const{width:ne,height:Ve}=et.reference,se=ot.floating.style;se.setProperty("--radix-popper-available-width",`${te}px`),se.setProperty("--radix-popper-available-height",`${pe}px`),se.setProperty("--radix-popper-anchor-width",`${ne}px`),se.setProperty("--radix-popper-anchor-height",`${Ve}px`)}}),k&&nL({element:k,padding:a}),uL({arrowWidth:S,arrowHeight:A}),p&&tL({strategy:"referenceHidden",...F})]}),[H,N]=wN(Z),O=mr(v);rn(()=>{K&&(O==null||O())},[K,O]);const U=(B=q.arrow)==null?void 0:B.x,_=(Q=q.arrow)==null?void 0:Q.y,E=((ue=q.arrow)==null?void 0:ue.centerOffset)!==0,[$,M]=b.useState();return rn(()=>{g&&M(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:K?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$,"--radix-popper-transform-origin":[(oe=q.transformOrigin)==null?void 0:oe.x,(fe=q.transformOrigin)==null?void 0:fe.y].join(" "),...((be=q.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(iL,{scope:n,placedSide:H,onArrowChange:C,arrowX:U,arrowY:_,shouldHideArrow:E,children:c.jsx(je.div,{"data-side":H,"data-align":N,...m,ref:w,style:{...m.style,animation:K?void 0:"none"}})})})});yN.displayName=n0;var vN="PopperArrow",lL={top:"bottom",right:"left",bottom:"top",left:"right"},xN=b.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=aL(vN,r),i=lL[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(oL,{...o,ref:n,style:{...o.style,display:"block"}})})});xN.displayName=vN;function cL(e){return e!==null}var uL=e=>({name:"transformOrigin",options:e,fn(t){var x,g,y;const{placement:n,rects:r,middlewareData:o}=t,i=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,d]=wN(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,h=(((y=o.arrow)==null?void 0:y.y)??0)+l/2;let v="",m="";return u==="bottom"?(v=i?f:`${p}px`,m=`${-l}px`):u==="top"?(v=i?f:`${p}px`,m=`${r.floating.height+l}px`):u==="right"?(v=`${-l}px`,m=i?f:`${h}px`):u==="left"&&(v=`${r.floating.width+l}px`,m=i?f:`${h}px`),{data:{x:v,y:m}}}});function wN(e){const[t,n="center"]=e.split("-");return[t,n]}var bN=pN,Sh=gN,r0=yN,o0=xN,[Ch,Xee]=lo("Tooltip",[ml]),s0=ml(),kN="TooltipProvider",dL=700,ek="tooltip.open",[fL,_N]=Ch(kN),SN=e=>{const{__scopeTooltip:t,delayDuration:n=dL,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=b.useRef(!0),a=b.useRef(!1),l=b.useRef(0);return b.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(fL,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:b.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};SN.displayName=kN;var CN="Tooltip",[ete,Eh]=Ch(CN),zg="TooltipTrigger",hL=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Eh(zg,n),s=_N(zg,n),i=s0(n),a=b.useRef(null),l=Je(t,a,o.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),f=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(Sh,{asChild:!0,...i,children:c.jsx(je.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:xe(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:xe(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:xe(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:xe(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:xe(e.onBlur,o.onClose),onClick:xe(e.onClick,o.onClose)})})});hL.displayName=zg;var pL="TooltipPortal",[tte,mL]=Ch(pL,{forceMount:void 0}),Ya="TooltipContent",EN=b.forwardRef((e,t)=>{const n=mL(Ya,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Eh(Ya,e.__scopeTooltip);return c.jsx(co,{present:r||i.open,children:i.disableHoverableContent?c.jsx(NN,{side:o,...s,ref:t}):c.jsx(gL,{side:o,...s,ref:t})})}),gL=b.forwardRef((e,t)=>{const n=Eh(Ya,e.__scopeTooltip),r=_N(Ya,e.__scopeTooltip),o=b.useRef(null),s=Je(t,o),[i,a]=b.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=b.useCallback(()=>{a(null),f(!1)},[f]),h=b.useCallback((v,m)=>{const x=v.currentTarget,g={x:v.clientX,y:v.clientY},y=bL(g,x.getBoundingClientRect()),w=kL(g,y),k=_L(m.getBoundingClientRect()),C=CL([...w,...k]);a(C),f(!0)},[f]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(l&&d){const v=x=>h(x,d),m=x=>h(x,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",m)}}},[l,d,h,p]),b.useEffect(()=>{if(i){const v=m=>{const x=m.target,g={x:m.clientX,y:m.clientY},y=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),w=!SL(g,i);y?p():w&&(p(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,i,u,p]),c.jsx(NN,{...e,ref:s})}),[yL,vL]=Ch(CN,{isInside:!1}),xL=oM("TooltipContent"),NN=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=Eh(Ya,n),u=s0(n),{onClose:d}=l;return b.useEffect(()=>(document.addEventListener(ek,d),()=>document.removeEventListener(ek,d)),[d]),b.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),c.jsx(dl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:c.jsxs(r0,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(xL,{children:r}),c.jsx(yL,{scope:n,isInside:!0,children:c.jsx(EM,{id:l.contentId,role:"tooltip",children:o||r})})]})})});EN.displayName=Ya;var jN="TooltipArrow",wL=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=s0(n);return vL(jN,n).isInside?null:c.jsx(o0,{...o,...r,ref:t})});wL.displayName=jN;function bL(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 kL(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function _L(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 SL(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],l=t[i],u=a.x,d=a.y,f=l.x,p=l.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function CL(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),EL(t)}function EL(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)}var NL=SN,PN=EN;const jL=NL,PL=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(PN,{ref:r,sideOffset:t,className:Ee("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n}));PL.displayName=PN.displayName;const TL={total:0,byKind:{oauth_required:0,oauth_expired:0,service_unhealthy:0,credential_missing_secret:0,playbook_missing_deps:0},serviceWarnings:new Map,credentialWarnings:new Map,playbookWarnings:new Map};function $L(e){return e?{total:e.total,byKind:e.byKind,serviceWarnings:new Map(Object.entries(e.services)),credentialWarnings:new Map(Object.entries(e.credentials)),playbookWarnings:new Map(Object.entries(e.playbooks))}:TL}const wn="#92E4DD",Rn="#F9386D",Cr="#FFFFFF",Jr="bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900";function Hr(e){return wn}function Yr(e){return{borderColor:e,color:e,boxShadow:`0 0 20px ${e}20`}}const RL=yh("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{gold:"bg-[#C4B643] text-[#0A0A07] hover:bg-[#D4C760] border border-[#C4B643] font-medium",default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ae=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?nM:"button";return c.jsx(i,{className:Ee(RL({variant:t,size:n,className:e})),ref:s,...o})});ae.displayName="Button";function Ca({warnings:e}){if(!(e!=null&&e.length))return null;const t=e.find(r=>r.severity==="error")??e[0],n=t.severity==="error";return c.jsxs("div",{className:`absolute left-1/2 -translate-x-1/2 top-8 z-20 flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[7px] font-semibold uppercase tracking-wide shadow-lg ${n?"bg-red-500/90 text-white border border-red-300/60":"bg-amber-500/90 text-black border border-amber-200/60"}`,title:e.map(r=>r.message).join(" · "),"data-testid":"card-warning-badge",children:[c.jsx(Tr,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"max-w-[72px] truncate",children:t.message})]})}const tk="data:image/svg+xml,%3csvg%20id='eSEM9z84vJh1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20300%20300'%20shape-rendering='geometricPrecision'%20text-rendering='geometricPrecision'%20project-id='c9405aa1bbb44eb388e44d7178ee1932'%20export-id='327eb6bfd5a543cb88b86ffe07ce0c92'%20cached='false'%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='translate(71.928217%20125.25355)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='matrix(2.570356%200%200%202.449277%2067.884163%2017.275854)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='translate(163.184592%20125.25355)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='matrix(3.42849%200%200%200.403818%2040.469132%20102.975708)'%20stroke-width='0'/%3e%3cpolygon%20points='0,-42.01893%2030.924539,20.531677%2024.698107,33.994028%20-24.698107,33.994028%20-33.20748,20.12246%200,-42.01893'%20transform='matrix(-.687913%200.002106-.00101-.33%20149.995947%20212.592699)'%20stroke-width='0'/%3e%3cpolygon%20points='0,-42.01893%2036.327051,-24.945112%2016.852287,34.058016%20-19.029679,34.002758%20-36.534138,-25.057317%200,-42.01893'%20transform='matrix(-.466366%200.001428-.002837-.926983%20149.84238%20249.643929)'%20stroke-width='0'/%3e%3c/svg%3e";function IL(e){return e.iconUrl?e.iconUrl:null}function TN({service:e}){const t=Hr(),n=IL(e),[r,o]=b.useState(!1);return n&&!r?c.jsx("img",{src:n,alt:"",className:"w-7 h-7 object-contain rounded-sm",draggable:!1,onError:()=>o(!0)}):c.jsx("div",{style:{width:28,height:28,backgroundColor:t,WebkitMask:`url(${tk}) no-repeat center / contain`,mask:`url(${tk}) no-repeat center / contain`},"aria-hidden":!0})}function i0(e){return e?"ring-2 ring-inset ring-yellow-400/90 shadow-[0_0_10px_rgba(250,204,21,0.2)]":""}function a0(){return c.jsx("span",{className:"absolute top-1.5 left-1/2 z-20 -translate-x-1/2 rounded bg-yellow-500 px-1 py-px text-[7px] font-bold uppercase tracking-wide text-black shadow",children:"In deck"})}function AL({service:e,onDragStart:t,onDragEnd:n,isInActiveDeck:r,onCardClick:o,isInCollection:s=!1,onMouseEnter:i,onMouseLeave:a,activeDeck:l,warnings:u}){const d=on(),{toast:f}=Zt(),p=Hr(),h=vt({mutationFn:async()=>{if(!l)throw new Error("No active deck found");return Se("POST",`/api/decks/${l.id}/services`,{serviceId:e.id,position:0})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Service added to deck",description:`${e.name} has been added to your active deck.`})},onError:g=>{f({title:"Failed to add service",description:g.message,variant:"destructive"})}}),v=vt({mutationFn:async()=>Se("DELETE",`/api/services/${e.id}`,{}),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/services"]}),d.invalidateQueries({queryKey:["/api/collection/warnings"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Service deleted",description:`${e.name} has been deleted successfully.`})},onError:g=>{f({title:"Failed to delete service",description:g.message,variant:"destructive"})}}),m=g=>{g.stopPropagation(),h.mutate()},x=g=>{g.stopPropagation(),window.confirm(`Are you sure you want to delete ${e.name}? This action cannot be undone.`)&&v.mutate()};return c.jsx("div",{className:"relative group cursor-pointer",draggable:!r,onDragStart:g=>t(g,e),onDragEnd:n,onClick:()=>o==null?void 0:o(e),"data-testid":`card-${e.id}`,onMouseEnter:i,onMouseLeave:a,children:c.jsxs("div",{className:`
|
|
259
259
|
w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
|
|
260
260
|
transform transition-all duration-300 shadow-lg hover:shadow-2xl
|
|
261
261
|
bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
|
|
@@ -463,6 +463,6 @@ ${P.data.oauth.issuer?`Issuer: ${P.data.oauth.issuer}`:""}`;C({title:"OAuth Setu
|
|
|
463
463
|
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
464
464
|
`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const Aee=new Iee;function Oee(e,t,n){return Aee.diff(e,t,n)}function Mee(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
465
465
|
`));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let o=0;o<r.length;o++){const s=r[o];o%2&&!t.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}const _m=3,Dee=10;function Lee(e){return e===""?[]:e.replace(/\n$/,"").split(`
|
|
466
|
-
`)}function zee(e,t){const n=Oee(e,t),r=[];let o=1,s=1;for(const i of n){const a=Lee(i.value);if(!i.added&&!i.removed&&a.length>=Dee){const u=a.slice(0,_m),d=a.slice(-_m),f=a.length-_m*2;for(const p of u)r.push({kind:"unchanged",text:p,oldLine:o++,newLine:s++});f>0&&(r.push({kind:"ellipsis",text:`${f} unchanged lines`}),o+=f,s+=f);for(const p of d)r.push({kind:"unchanged",text:p,oldLine:o++,newLine:s++});continue}for(const u of a)i.added?r.push({kind:"added",text:u,newLine:s++}):i.removed?r.push({kind:"removed",text:u,oldLine:o++}):r.push({kind:"unchanged",text:u,oldLine:o++,newLine:s++})}return r}function Fee(e){return e.some(t=>t.kind==="added"||t.kind==="removed")}const iw="
|
|
466
|
+
`)}function zee(e,t){const n=Oee(e,t),r=[];let o=1,s=1;for(const i of n){const a=Lee(i.value);if(!i.added&&!i.removed&&a.length>=Dee){const u=a.slice(0,_m),d=a.slice(-_m),f=a.length-_m*2;for(const p of u)r.push({kind:"unchanged",text:p,oldLine:o++,newLine:s++});f>0&&(r.push({kind:"ellipsis",text:`${f} unchanged lines`}),o+=f,s+=f);for(const p of d)r.push({kind:"unchanged",text:p,oldLine:o++,newLine:s++});continue}for(const u of a)i.added?r.push({kind:"added",text:u,newLine:s++}):i.removed?r.push({kind:"removed",text:u,oldLine:o++}):r.push({kind:"unchanged",text:u,oldLine:o++,newLine:s++})}return r}function Fee(e){return e.some(t=>t.kind==="added"||t.kind==="removed")}const iw="max-w-full overflow-x-auto rounded-md border border-gray-800 bg-gray-950 font-mono text-xs leading-5";function Uee(e){switch(e){case"added":return"bg-emerald-950/70 text-emerald-100";case"removed":return"bg-rose-950/70 text-rose-100";case"ellipsis":return"bg-gray-900 text-gray-500 italic";default:return"bg-gray-950 text-gray-300"}}function qee(e){switch(e){case"added":return"+";case"removed":return"-";case"ellipsis":return"…";default:return" "}}function Vee({rows:e,emptyLabel:t}){return e.length===0?c.jsx("p",{className:"text-sm text-gray-500",children:t}):c.jsx("div",{className:iw,children:e.map((n,r)=>c.jsxs("div",{className:`grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] gap-0 ${Uee(n.kind)}`,children:[c.jsx("span",{className:"select-none border-r border-gray-800/80 px-2 py-0.5 text-right text-gray-600",children:n.oldLine??""}),c.jsx("span",{className:"select-none border-r border-gray-800/80 px-2 py-0.5 text-right text-gray-600",children:n.newLine??""}),c.jsxs("div",{className:"flex min-w-0 gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 select-none text-gray-500",children:qee(n.kind)}),c.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words",children:n.text||" "})]})]},`${n.kind}-${r}-${n.oldLine??""}-${n.newLine??""}`))})}function Hee({before:e,after:t}){const n=e.filter(o=>!t.includes(o)),r=t.filter(o=>!e.includes(o));return n.length===0&&r.length===0?null:c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium text-gray-400",children:"Triggers"}),c.jsxs("div",{className:`${iw} p-0`,children:[n.map(o=>c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-rose-950/70 text-rose-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"-"}),c.jsx("span",{children:o})]})]},`removed-${o}`)),r.map(o=>c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-emerald-950/70 text-emerald-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"+"}),c.jsx("span",{children:o})]})]},`added-${o}`))]})]})}function Bee({preview:e}){const t=iR(e),n=zee(e.before.body,e.after.body),r=e.before.body.trim()!==e.after.body.trim()&&e.after.body.length>0&&!e.after.body.includes(e.before.body.slice(0,40))&&Fee(n),o=e.before.title!==e.after.title,s=e.before.triggers.join(`
|
|
467
467
|
`)!==e.after.triggers.join(`
|
|
468
|
-
`);return c.jsxs("div",{className:"space-y-4",children:[!t&&c.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 text-sm text-amber-100",children:["No change detected — ops did not alter the playbook body or triggers. Reject this proposal and re-propose with a matching list anchor or ",c.jsx("code",{children:"rewrite_body"}),"."]}),r&&c.jsx("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 text-sm text-amber-100",children:"Full-body rewrite proposed — review carefully."}),o&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium text-gray-400",children:"Title"}),c.jsxs("div",{className:`${iw} p-0`,children:[e.before.title&&c.jsxs("div",{className:"grid grid-cols-[
|
|
468
|
+
`);return c.jsxs("div",{className:"min-w-0 space-y-4",children:[!t&&c.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 text-sm text-amber-100",children:["No change detected — ops did not alter the playbook body or triggers. Reject this proposal and re-propose with a matching list anchor or ",c.jsx("code",{children:"rewrite_body"}),"."]}),r&&c.jsx("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 text-sm text-amber-100",children:"Full-body rewrite proposed — review carefully."}),o&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium text-gray-400",children:"Title"}),c.jsxs("div",{className:`${iw} p-0`,children:[e.before.title&&c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-rose-950/70 text-rose-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"-"}),c.jsx("span",{children:e.before.title})]})]}),e.after.title&&c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-emerald-950/70 text-emerald-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"+"}),c.jsx("span",{children:e.after.title})]})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium text-gray-400",children:"Body"}),c.jsx(Vee,{rows:n,emptyLabel:"No body changes."})]}),s&&c.jsx(Hee,{before:e.before.triggers,after:e.after.triggers})]})}function Wee(e){if(!e.evidenceJson)return null;try{return JSON.parse(e.evidenceJson)}catch{return null}}function Kee(){const[e,t]=b.useState(null),[n,r]=b.useState(""),{toast:o}=Zt(),s=on(),{data:i=[],isLoading:a}=Ot({queryKey:["/api/playbook-patches","proposed"],queryFn:()=>Zj("proposed")}),{data:l,isLoading:u,isError:d,error:f}=Ot({queryKey:["/api/playbook-patches",e,"preview"],queryFn:()=>XF(e),enabled:!!e}),p=l?iR(l):!1,h=i.find(x=>x.id===e)??null,v=vt({mutationFn:x=>e3(x),onSuccess:()=>{o({title:"Patch accepted"}),t(null),s.invalidateQueries({queryKey:["/api/playbook-patches"]}),s.invalidateQueries({queryKey:["/api/playbooks"]})},onError:x=>{o({title:"Accept failed",description:x.message,variant:"destructive"})}}),m=vt({mutationFn:({id:x,reason:g})=>t3(x,g),onSuccess:()=>{o({title:"Patch rejected"}),t(null),r(""),s.invalidateQueries({queryKey:["/api/playbook-patches"]})},onError:x=>{o({title:"Reject failed",description:x.message,variant:"destructive"})}});return c.jsxs("div",{className:"min-h-dvh bg-gray-950 text-gray-100",children:[c.jsx("header",{className:"border-b border-gray-800 px-4 py-4 sm:px-6",children:c.jsxs("div",{className:"mx-auto flex max-w-7xl items-center gap-3",children:[c.jsx(BC,{href:"/",children:c.jsxs(ae,{variant:"ghost",size:"sm",className:"text-gray-300",children:[c.jsx(QM,{className:"mr-1 h-4 w-4"}),"Deck"]})}),c.jsx("h1",{className:"text-lg font-semibold",children:"Playbook review queue"}),c.jsxs(or,{variant:"secondary",children:[i.length," proposed"]})]})}),c.jsxs("main",{className:"mx-auto grid min-w-0 max-w-7xl gap-6 px-4 py-6 sm:px-6 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)] lg:items-start",children:[c.jsxs("section",{className:"min-w-0",children:[c.jsx("h2",{className:"mb-3 text-sm font-medium text-gray-400",children:"Proposals"}),a&&c.jsx("p",{className:"text-sm text-gray-500",children:"Loading…"}),!a&&i.length===0&&c.jsx("p",{className:"text-sm text-gray-500",children:"No proposals waiting for review."}),c.jsx("ul",{className:"space-y-2",children:i.map(x=>c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>t(x.id),className:`w-full rounded-lg border p-3 text-left transition ${e===x.id?"border-blue-500 bg-gray-900":"border-gray-800 bg-gray-900/50 hover:border-gray-700"}`,children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"font-medium",children:x.kind==="create"?`NEW: ${JSON.parse(x.opsJson).title??"playbook"}`:x.playbookId}),c.jsx(or,{variant:"outline",children:x.kind})]}),c.jsx("p",{className:"mt-1 line-clamp-2 text-sm text-gray-400",children:x.rationale}),c.jsxs("p",{className:"mt-1 text-xs text-gray-600",children:[x.source," · ",new Date(x.createdAt).toLocaleString()]})]})},x.id))})]}),c.jsxs("section",{className:"min-w-0",children:[c.jsx("h2",{className:"mb-3 text-sm font-medium text-gray-400",children:"Detail"}),!h&&c.jsx("p",{className:"text-sm text-gray-500",children:"Select a proposal to preview the diff."}),h&&c.jsxs("div",{className:"flex max-h-[calc(100dvh-8rem)] min-h-0 flex-col overflow-hidden rounded-lg border border-gray-800 bg-gray-900/50",children:[c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 sm:p-5",children:c.jsxs("div",{className:"min-w-0 space-y-4",children:[c.jsx("p",{className:"text-sm leading-relaxed text-gray-300",children:h.rationale}),(()=>{const x=Wee(h);return x?c.jsxs("div",{className:"rounded-md border border-gray-700 bg-gray-950 p-4 text-sm",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:"Your correction"}),c.jsxs("p",{className:"mt-2 italic text-gray-200",children:["“",x.user_feedback_excerpt,"”"]}),x.failure_summary&&c.jsx("p",{className:"mt-2 text-gray-400",children:x.failure_summary})]}):null})(),u&&c.jsx("p",{className:"text-sm text-gray-500",children:"Loading preview…"}),d&&c.jsxs("div",{className:"rounded-md border border-rose-500/50 bg-rose-500/10 p-3 text-sm text-rose-100",children:["Preview failed — ",(f==null?void 0:f.message)??"could not apply ops to the current playbook."," ","Reject and re-propose with exact list anchors or ",c.jsx("code",{children:"rewrite_body"}),"."]}),l&&c.jsx(Bee,{preview:l}),h.status==="stale"&&c.jsx("p",{className:"text-sm text-amber-400",children:"Stale — playbook changed since proposal. Re-propose from a fresh session."})]})}),c.jsxs("div",{className:"shrink-0 space-y-4 border-t border-gray-800 bg-gray-900/95 p-4 backdrop-blur-sm sm:p-5",children:[c.jsx("h3",{className:"text-sm font-medium text-gray-400",children:"Your decision"}),c.jsx(ae,{variant:"gold",className:"w-full sm:w-auto",onClick:()=>v.mutate(h.id),disabled:v.isPending||d||!p,children:"Accept"}),c.jsxs("div",{className:"space-y-2 rounded-md border border-gray-800 bg-gray-950/60 p-3",children:[c.jsx(_o,{placeholder:"Rejection reason (required)",value:n,onChange:x=>r(x.target.value),className:"min-h-[88px] bg-gray-950"}),c.jsx(ae,{variant:"destructive",disabled:!n.trim()||m.isPending,onClick:()=>m.mutate({id:h.id,reason:n.trim()}),children:"Reject"})]})]})]})]})]})]})}function Zee(){return c.jsxs(fO,{children:[c.jsx($l,{path:"/",component:GV}),c.jsx($l,{path:"/oauth/callback",component:XV}),c.jsx($l,{path:"/playbook-patches",component:Kee}),c.jsx($l,{path:"/mcp-test",component:$ee}),c.jsx($l,{component:YV})]})}function Qee(){return c.jsx(IO,{client:ZO,children:c.jsxs(jL,{children:[c.jsx(H4,{}),c.jsx(Zee,{})]})})}AC(document.getElementById("root")).render(c.jsx(b.StrictMode,{children:c.jsx(Qee,{})}));
|