orcaq 1.0.30 → 1.0.32
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{DzJD_fir.js → -p9JbKy8.js} +3 -3
- package/.output/public/_nuxt/019vQzZn.js +1 -0
- package/.output/public/_nuxt/0lRW_xjL.js +1 -0
- package/.output/public/_nuxt/{BV6TSzbC.js → 3UJtAGbG.js} +3 -2
- package/.output/public/_nuxt/ACOLmAuq.js +15 -0
- package/.output/public/_nuxt/B1X10hvy.js +261 -0
- package/.output/public/_nuxt/B27ECqWz.js +220 -0
- package/.output/public/_nuxt/B6EI6PpE.js +1 -0
- package/.output/public/_nuxt/B8JnYxjr.js +2 -0
- package/.output/public/_nuxt/B9Mt45db.js +1 -0
- package/.output/public/_nuxt/B9zSkyFO.js +1 -0
- package/.output/public/_nuxt/BCcTASq_.js +139 -0
- package/.output/public/_nuxt/BJxYuvXF.js +7 -0
- package/.output/public/_nuxt/{FyrDS92w.js → BM4vnZvX.js} +101 -101
- package/.output/public/_nuxt/BNYR501z.js +1 -0
- package/.output/public/_nuxt/BQOaPJzs.js +145 -0
- package/.output/public/_nuxt/BUDtG__q.js +1 -0
- package/.output/public/_nuxt/BVLVn__t.js +9 -0
- package/.output/public/_nuxt/{KlH93fIm.js → BY1l0S_M.js} +1 -1
- package/.output/public/_nuxt/{ClnidwGv.js → B_PBOfFN.js} +2 -2
- package/.output/public/_nuxt/{y68LmDX2.js → BcvJQkv0.js} +1 -1
- package/.output/public/_nuxt/{llxtZpFD.js → BdN9B2_l.js} +2 -2
- package/.output/public/_nuxt/BflvengI.js +1 -0
- package/.output/public/_nuxt/BgolbRTO.js +1 -0
- package/.output/public/_nuxt/BhUkpIlA.js +1 -0
- package/.output/public/_nuxt/BsoQBloB.js +24 -0
- package/.output/public/_nuxt/BwISH3M4.js +1 -0
- package/.output/public/_nuxt/C-M4q4KX.js +1 -0
- package/.output/public/_nuxt/C07rlnlv.js +1 -0
- package/.output/public/_nuxt/C27bL9Es.js +1 -0
- package/.output/public/_nuxt/C2Ziircr.js +1 -0
- package/.output/public/_nuxt/C3NWXcpd.js +39 -0
- package/.output/public/_nuxt/C5p44jKD.js +1 -0
- package/.output/public/_nuxt/C617vhDd.js +1 -0
- package/.output/public/_nuxt/C6Vqzp-9.js +7 -0
- package/.output/public/_nuxt/C7C8tPlA.js +65 -0
- package/.output/public/_nuxt/C8S0o4Gy.js +1 -0
- package/.output/public/_nuxt/CHOD7i6O.js +4 -0
- package/.output/public/_nuxt/CNlsVoWh.js +1 -0
- package/.output/public/_nuxt/CQb_mUBo.js +1 -0
- package/.output/public/_nuxt/{MLO1tLKS.js → CSTzT9hP.js} +1 -1
- package/.output/public/_nuxt/CVliJ52o.js +162 -0
- package/.output/public/_nuxt/CWGdTiOD.js +1 -0
- package/.output/public/_nuxt/{CzF1NEwP.js → CWkPMmwS.js} +2 -2
- package/.output/public/_nuxt/CffFK_qY.js +189 -0
- package/.output/public/_nuxt/Cgy4ijjN.js +67 -0
- package/.output/public/_nuxt/ChkFTcxr.js +43 -0
- package/.output/public/_nuxt/Cjgqfl1g.js +10 -0
- package/.output/public/_nuxt/ClBBUcFW.js +1 -0
- package/.output/public/_nuxt/{DFd73eNR.js → ClYziJpO.js} +1 -1
- package/.output/public/_nuxt/CmKTTxBW.js +1 -0
- package/.output/public/_nuxt/CuRyxljq.js +1 -0
- package/.output/public/_nuxt/CvTHaPAO.js +1 -0
- package/.output/public/_nuxt/{HQyqkOpZ.js → CwdIiq6J.js} +1 -1
- package/.output/public/_nuxt/Cx4Bnfq1.js +2 -0
- package/.output/public/_nuxt/CyJtwmzi.js +331 -0
- package/.output/public/_nuxt/{ubO-cWd-.js → D-H6_V16.js} +1 -1
- package/.output/public/_nuxt/D-SDqguC.js +1 -0
- package/.output/public/_nuxt/{6I72R6kW.js → D-XwprNU.js} +1 -1
- package/.output/public/_nuxt/D3G5Xy_-.js +1 -0
- package/.output/public/_nuxt/D4jn2f-6.js +255 -0
- package/.output/public/_nuxt/D9o5Pdvp.js +1 -0
- package/.output/public/_nuxt/DDYV6jDr.js +1 -0
- package/.output/public/_nuxt/DFArp87o.js +1 -0
- package/.output/public/_nuxt/{C_CjS9Yt.js → DFZIXzfU.js} +1 -1
- package/.output/public/_nuxt/DHRNt0p9.js +1 -0
- package/.output/public/_nuxt/DLHYqHwF.js +24 -0
- package/.output/public/_nuxt/{D8pqASdN.js → DLKku6fV.js} +1 -1
- package/.output/public/_nuxt/DNZpxuwM.js +1 -0
- package/.output/public/_nuxt/DRKnK1N_.js +132 -0
- package/.output/public/_nuxt/DVxTxYP4.js +34 -0
- package/.output/public/_nuxt/{DQiMjOqm.js → DWgjNKGq.js} +1 -1
- package/.output/public/_nuxt/DX6XiGOO.js +1 -0
- package/.output/public/_nuxt/DYm57BZk.js +2 -0
- package/.output/public/_nuxt/DaQw8gVp.js +1 -0
- package/.output/public/_nuxt/DcfsxCxL.js +36 -0
- package/.output/public/_nuxt/DgnsV5Qb.js +1 -0
- package/.output/public/_nuxt/DkY69STm.js +292 -0
- package/.output/public/_nuxt/DkggUtNN.js +30 -0
- package/.output/public/_nuxt/Dnx67EG9.js +68 -0
- package/.output/public/_nuxt/{DVe5MHjS.js → DnxDSFih.js} +1 -1
- package/.output/public/_nuxt/Do5Fyo7J.js +1 -0
- package/.output/public/_nuxt/{h2fvG4Xe.js → Dqirx7MF.js} +1 -1
- package/.output/public/_nuxt/{WrapperErdDiagram.DsE2QNGr.css → ErdDiagram.Cnqgwj9d.css} +1 -1
- package/.output/public/_nuxt/FIJP2AmN.js +73 -0
- package/.output/public/_nuxt/Gi6I4Gst.js +1 -0
- package/.output/public/_nuxt/{C26aAkUg.js → GoTwJjoS.js} +1 -1
- package/.output/public/_nuxt/Hs25HoUO.js +22 -0
- package/.output/public/_nuxt/IitECNfD.js +89 -0
- package/.output/public/_nuxt/J2CvNR3L.js +1 -0
- package/.output/public/_nuxt/LFK46Fls.js +61 -0
- package/.output/public/_nuxt/LK6Q8l0D.js +1 -0
- package/.output/public/_nuxt/Oh9SO2qg.js +1 -0
- package/.output/public/_nuxt/{CtRc_P0d.js → P_8UoGnr.js} +2 -2
- package/.output/public/_nuxt/UqWhjgOc.js +10 -0
- package/.output/public/_nuxt/V5yaR3hv.js +2 -0
- package/.output/public/_nuxt/XWTuAj6n.js +1 -0
- package/.output/public/_nuxt/XqwbcqcW.js +1 -0
- package/.output/public/_nuxt/ZdjmUBoX.js +70 -0
- package/.output/public/_nuxt/_8UrUcVF.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/27a307c3-bfc5-4ccd-94b8-387eb94981bb.json +1 -0
- package/.output/public/_nuxt/cKBf5-av.js +1 -0
- package/.output/public/_nuxt/c_huf6xz.js +162 -0
- package/.output/public/_nuxt/entry.DeK5kcSi.css +1 -0
- package/.output/public/_nuxt/gO22NLpn.js +1 -0
- package/.output/public/_nuxt/index.xxedlMJo.css +1 -0
- package/.output/public/_nuxt/kc-op4gz.js +12 -0
- package/.output/public/_nuxt/lSaGvORn.js +10 -0
- package/.output/public/_nuxt/lY3EyFEK.js +1 -0
- package/.output/public/_nuxt/qsFoMdT2.js +1 -0
- package/.output/public/_nuxt/sE-55p4e.js +1 -0
- package/.output/public/_nuxt/tMhdAKU2.js +3 -0
- package/.output/public/_nuxt/trZyeId5.js +70 -0
- package/.output/public/_nuxt/uyCIL8xw.js +1 -0
- package/.output/server/chunks/_/db-connection.mjs +17 -3
- package/.output/server/chunks/_/db-connection.mjs.map +1 -1
- package/.output/server/chunks/_/instance-insights.factory.mjs.map +1 -1
- package/.output/server/chunks/_/metadata.factory.mjs +4 -5
- package/.output/server/chunks/_/metadata.factory.mjs.map +1 -1
- package/.output/server/chunks/_/query.factory.mjs +31 -2
- package/.output/server/chunks/_/query.factory.mjs.map +1 -1
- package/.output/server/chunks/build/client.manifest.mjs +1302 -546
- package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +712 -364
- package/.output/server/chunks/routes/api/ai/agent.mjs +258 -89
- package/.output/server/chunks/routes/api/ai/agent.mjs.map +1 -1
- package/.output/server/chunks/routes/api/ai/chat.mjs +1 -2
- package/.output/server/chunks/routes/api/ai/chat.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-export/export-database.mjs +1 -2
- package/.output/server/chunks/routes/api/database-export/export-database.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-import/import-database.mjs +1 -2
- package/.output/server/chunks/routes/api/database-import/import-database.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/create-role.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/create-role.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/delete-role.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/delete-role.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-databases.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-databases.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-role.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-role.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-roles.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-roles.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/definition.post.mjs +5 -3
- package/.output/server/chunks/routes/api/functions/definition.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/delete.post.mjs +1 -2
- package/.output/server/chunks/routes/api/functions/delete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/overview.post.mjs +12 -10
- package/.output/server/chunks/routes/api/functions/overview.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/rename.post.mjs +1 -2
- package/.output/server/chunks/routes/api/functions/rename.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/signature.post.mjs +5 -3
- package/.output/server/chunks/routes/api/functions/signature.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/update.post.mjs +1 -2
- package/.output/server/chunks/routes/api/functions/update.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/state.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/state.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +1 -2
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metadata/erd.post.mjs +12 -10
- package/.output/server/chunks/routes/api/metadata/erd.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs +14 -12
- package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs +12 -10
- package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metrics/monitor.post.mjs +12 -10
- package/.output/server/chunks/routes/api/metrics/monitor.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/query/execute.post.mjs +14 -12
- package/.output/server/chunks/routes/api/query/execute.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs +14 -12
- package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/query/raw-execute.post.mjs +14 -12
- package/.output/server/chunks/routes/api/query/raw-execute.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs +1 -2
- package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs +1 -2
- package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/ddl.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/ddl.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/export.post.mjs +1 -2
- package/.output/server/chunks/routes/api/tables/export.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/indexes.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/indexes.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/meta.post.mjs +12 -10
- package/.output/server/chunks/routes/api/tables/meta.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/overview.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/overview.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/rls.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/rls.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/rules.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/rules.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/size.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/size.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/structure.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/structure.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/triggers.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/triggers.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/definition.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/definition.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/dependencies.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/dependencies.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/explain.post.mjs +1 -2
- package/.output/server/chunks/routes/api/views/explain.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/indexes.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/indexes.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/meta.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/meta.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/overview.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/overview.post.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -2
- package/.output/server/index.mjs +1 -2
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/README.md +8 -2
- package/package.json +1 -1
- package/.output/public/_nuxt/8_EuFD3X.js +0 -1
- package/.output/public/_nuxt/B6H7odCi.js +0 -1
- package/.output/public/_nuxt/B7nSJBpY.js +0 -1
- package/.output/public/_nuxt/BBNxNerU.js +0 -1
- package/.output/public/_nuxt/BDKd-SA5.js +0 -1
- package/.output/public/_nuxt/BDRdbLz0.js +0 -1
- package/.output/public/_nuxt/BKWWO5HE.js +0 -1
- package/.output/public/_nuxt/BVKG-F8j.js +0 -1
- package/.output/public/_nuxt/BoGW82nK.js +0 -1
- package/.output/public/_nuxt/Bs_ItSbk.js +0 -1
- package/.output/public/_nuxt/Btu7FO8S.js +0 -1
- package/.output/public/_nuxt/C04Tz2vC.js +0 -67
- package/.output/public/_nuxt/C4JPKbJK.js +0 -1
- package/.output/public/_nuxt/C5KSeJUi.js +0 -8
- package/.output/public/_nuxt/CDnZBTSk.js +0 -1
- package/.output/public/_nuxt/CKq06U7u.js +0 -19
- package/.output/public/_nuxt/CQpD-JHn.js +0 -1
- package/.output/public/_nuxt/Chcc8yNZ.js +0 -1
- package/.output/public/_nuxt/CpzDNDcD.js +0 -1
- package/.output/public/_nuxt/Cs1HkKH7.js +0 -1
- package/.output/public/_nuxt/CsYOf3m-.js +0 -39
- package/.output/public/_nuxt/Ctr2mpV9.js +0 -2
- package/.output/public/_nuxt/D2j2esR5.js +0 -3
- package/.output/public/_nuxt/D4ZGn1tW.js +0 -1
- package/.output/public/_nuxt/D6YseYA6.js +0 -1
- package/.output/public/_nuxt/D7EPcL9i.js +0 -1
- package/.output/public/_nuxt/DCMJS6Fh.js +0 -1
- package/.output/public/_nuxt/D_G1mAJ8.js +0 -3
- package/.output/public/_nuxt/De1hkrJC.js +0 -1
- package/.output/public/_nuxt/DnCs9xpG.js +0 -1
- package/.output/public/_nuxt/DvJ2MjiW.js +0 -2
- package/.output/public/_nuxt/Dzr_z_mY.js +0 -9
- package/.output/public/_nuxt/OEVyCyyD.js +0 -1
- package/.output/public/_nuxt/builds/meta/0ab6db39-d52b-46b9-a687-0df3b4c65db5.json +0 -1
- package/.output/public/_nuxt/builds/meta/dev.json +0 -1
- package/.output/public/_nuxt/e_Ir8LP9.js +0 -1
- package/.output/public/_nuxt/entry.XV7TCKso.css +0 -1
- package/.output/public/_nuxt/fRxmPZZB.js +0 -8
- package/.output/public/_nuxt/logo.BsJ2Dfin.png +0 -0
- package/.output/public/_nuxt/q4KcRwD-.js +0 -1
- package/.output/public/_nuxt/qIKg23Pc.js +0 -1
- package/.output/public/_nuxt/txD20ixW.js +0 -1
- package/.output/public/_nuxt/x2HBvptj.js +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DWgjNKGq.js","./BM4vnZvX.js","./entry.DeK5kcSi.css","./D4jn2f-6.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var fl=Object.defineProperty;var pl=t=>{throw TypeError(t)};var ml=(t,e,n)=>e in t?fl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var We=(t,e,n)=>ml(t,typeof e!="symbol"?e+"":e,n);var Ie=(t,e,n)=>e.has(t)?pl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{ao as ta,ap as na,c as L,eJ as yi,r as G,cY as gl,ad as be,an as vl,J as Mn,K as Fs,$ as sa,eK as yl,eL as xl,d as Y,ab as At,eM as bl,N as ia,cV as wl,cR as _l,e as Sl,b as K,o as x,a6 as oa,L as Dt,n as ae,w as A,f as Tl,aE as Bn,eN as js,al as Gt,m as T,t as M,u as _,ag as kl,ai as Al,a9 as Se,a4 as ke,ee as aa,C as y,h as v,at as Dn,au as Vn,A as ve,F as H,j as de,av as Ln,G as re,i as N,dQ as ra,aW as Te,ew as Zt,aQ as On,cp as la,a7 as Cl,B as Pl,q as Ml,s as Dl,x as Vl,y as Ll,z as El,eo as $l,a2 as Be,aY as Rl,d2 as Il,d3 as Bl,a5 as xi,bY as bi,dg as Ol,dh as Fl,dj as jl,aX as Nl,eO as ua,dA as zl,ax as Ul,O as ql,dz as Hl,l as Kl,c8 as Gl,aP as Wl,bR as wi,eP as Yl,p as _i,eQ as Xl}from"./BM4vnZvX.js";import{h as Ql,s as Zl,u as Jl,_ as eu,a as tu,b as nu}from"./LK6Q8l0D.js";import{_ as su,b as iu,c as cn}from"./BNYR501z.js";import{_ as ou}from"./D3G5Xy_-.js";import{g as au,c as ru,a as lu,b as uu,d as cu}from"./DWgjNKGq.js";import{u as Ns,_ as du}from"./-p9JbKy8.js";import{_ as hu}from"./BhUkpIlA.js";import{_ as fu}from"./0lRW_xjL.js";import{_ as Si,a as Ti}from"./BwISH3M4.js";import{_ as zs}from"./B_PBOfFN.js";import{b as pu,c as mu,E as gu,d as vu,e as yu,_ as xu}from"./C3NWXcpd.js";import{D as ca,b as os,F as Ue,G as bu,H as wu,I as _u,P as me,J as ki,K as Ai,L as da,M as Su,N as Ci,O as Pi,Q as Fn,l as dn,f as ha,R as Tu,_ as Vt,T as fa,U as Xe,V as ku,W as pa,Z as Au,X as hn,Y as jn,$ as Mi,a0 as Cu,a1 as Pu,a2 as Mu,a3 as Du,a4 as Vu,a5 as Lu,a6 as Eu,a7 as $u,a8 as Di,a9 as ma,aa as Ru,ab as Iu,ac as Bu,ad as ga,ae as Ou,af as Fu,ag as ju,ah as Nu,ai as zu,aj as Uu,ak as qu,al as va,am as Hu,v as ya,an as Ku,w as Gu,y as Wu,x as Yu,z as Xu,A as Qu,B as Zu,E as Ju}from"./DnxDSFih.js";import{f as xa}from"./BKltSiU0.js";import{u as ec,l as tc}from"./CwdIiq6J.js";import"./C2Ziircr.js";import"./Bdtn2mn5.js";import"./D-XwprNU.js";import"./CWkPMmwS.js";import"./GoTwJjoS.js";var Vi=Math.PI*2,fn=Math.PI/180;function ba(t,e){return bu(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function wa(t,e){var n=ba(t,e),s=t.get("center"),i=t.get("radius");os(i)||(i=[0,i]);var a=Ue(n.width,e.getWidth()),o=Ue(n.height,e.getHeight()),r=Math.min(a,o),l=Ue(i[0],r/2),u=Ue(i[1],r/2),c,h,d=t.coordinateSystem;if(d){var f=d.dataToPoint(s);c=f[0]||0,h=f[1]||0}else os(s)||(s=[s,s]),c=Ue(s[0],a)+n.x,h=Ue(s[1],o)+n.y;return{cx:c,cy:h,r0:l,r:u}}function nc(t,e,n){e.eachSeriesByType(t,function(s){var i=s.getData(),a=i.mapDimension("value"),o=ba(s,n),r=wa(s,n),l=r.cx,u=r.cy,c=r.r,h=r.r0,d=-s.get("startAngle")*fn,f=s.get("endAngle"),p=s.get("padAngle")*fn;f=f==="auto"?d-Vi:-f*fn;var b=s.get("minAngle")*fn,m=b+p,g=0;i.each(a,function(W){!isNaN(W)&&g++});var P=i.getSum(a),w=Math.PI/(P||g)*2,E=s.get("clockwise"),D=s.get("roseType"),V=s.get("stillShowZeroSum"),k=i.getDataExtent(a);k[0]=0;var S=E?1:-1,B=[d,f],$=S*p/2;wu(B,!E),d=B[0],f=B[1];var U=_a(s);U.startAngle=d,U.endAngle=f,U.clockwise=E;var F=Math.abs(f-d),te=F,C=0,I=d;if(i.setLayout({viewRect:o,r:c}),i.each(a,function(W,X){var q;if(isNaN(W)){i.setItemLayout(X,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:E,cx:l,cy:u,r0:h,r:D?NaN:c});return}D!=="area"?q=P===0&&V?w:W*w:q=F/g,q<m?(q=m,te-=m):C+=W;var Q=I+S*q,Z=0,J=0;p>q?(Z=I+S*q/2,J=Z):(Z=I+$,J=Q-$),i.setItemLayout(X,{angle:q,startAngle:Z,endAngle:J,clockwise:E,cx:l,cy:u,r0:h,r:D?_u(W,k,[h,c]):c}),I=Q}),te<Vi&&g)if(te<=.001){var z=F/g;i.each(a,function(W,X){if(!isNaN(W)){var q=i.getItemLayout(X);q.angle=z;var Q=0,Z=0;z<p?(Q=d+S*(X+1/2)*z,Z=Q):(Q=d+S*X*z+$,Z=d+S*(X+1)*z-$),q.startAngle=Q,q.endAngle=Z}})}else w=te/C,I=d,i.each(a,function(W,X){if(!isNaN(W)){var q=i.getItemLayout(X),Q=q.angle===m?m:W*w,Z=0,J=0;Q<p?(Z=I+S*Q/2,J=Z):(Z=I+$,J=I+S*Q-$),q.startAngle=Z,q.endAngle=J,I+=S*Q}})})}var _a=ca();function sc(t){return{seriesType:t,reset:function(e,n){var s=n.findComponents({mainType:"legend"});if(!(!s||!s.length)){var i=e.getData();i.filterSelf(function(a){for(var o=i.getName(a),r=0;r<s.length;r++)if(!s[r].isSelected(o))return!1;return!0})}}}}function Sa(t,e,n,s,i,a,o,r){var l=i-t,u=a-e,c=n-t,h=s-e,d=Math.sqrt(c*c+h*h);c/=d,h/=d;var f=l*c+u*h,p=f/d;p*=d;var b=o[0]=t+p*c,m=o[1]=e+p*h;return Math.sqrt((b-i)*(b-i)+(m-a)*(m-a))}var Qe=new me,ie=new me,pe=new me,Ze=new me,Oe=new me,wn=[],xe=new me;function ic(t,e){if(e<=180&&e>0){e=e/180*Math.PI,Qe.fromArray(t[0]),ie.fromArray(t[1]),pe.fromArray(t[2]),me.sub(Ze,Qe,ie),me.sub(Oe,pe,ie);var n=Ze.len(),s=Oe.len();if(!(n<.001||s<.001)){Ze.scale(1/n),Oe.scale(1/s);var i=Ze.dot(Oe),a=Math.cos(e);if(a<i){var o=Sa(ie.x,ie.y,pe.x,pe.y,Qe.x,Qe.y,wn);xe.fromArray(wn),xe.scaleAndAdd(Oe,o/Math.tan(Math.PI-e));var r=pe.x!==ie.x?(xe.x-ie.x)/(pe.x-ie.x):(xe.y-ie.y)/(pe.y-ie.y);if(isNaN(r))return;r<0?me.copy(xe,ie):r>1&&me.copy(xe,pe),xe.toArray(t[1])}}}}function oc(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,Qe.fromArray(t[0]),ie.fromArray(t[1]),pe.fromArray(t[2]),me.sub(Ze,ie,Qe),me.sub(Oe,pe,ie);var s=Ze.len(),i=Oe.len();if(!(s<.001||i<.001)){Ze.scale(1/s),Oe.scale(1/i);var a=Ze.dot(e),o=Math.cos(n);if(a<o){var r=Sa(ie.x,ie.y,pe.x,pe.y,Qe.x,Qe.y,wn);xe.fromArray(wn);var l=Math.PI/2,u=Math.acos(Oe.dot(e)),c=l+u-n;if(c>=l)me.copy(xe,pe);else{xe.scaleAndAdd(Oe,r/Math.tan(Math.PI/2-c));var h=pe.x!==ie.x?(xe.x-ie.x)/(pe.x-ie.x):(xe.y-ie.y)/(pe.y-ie.y);if(isNaN(h))return;h<0?me.copy(xe,ie):h>1&&me.copy(xe,pe)}xe.toArray(t[1])}}}}function Nn(t,e,n,s){var i=n==="normal",a=i?t:t.ensureState(n);a.ignore=e;var o=s.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var r=s.getModel("lineStyle").getLineStyle();i?t.useStyle(r):a.style=r}function ac(t,e){var n=e.smooth,s=e.points;if(s)if(t.moveTo(s[0][0],s[0][1]),n>0&&s.length>=3){var i=Pi(s[0],s[1]),a=Pi(s[1],s[2]);if(!i||!a){t.lineTo(s[1][0],s[1][1]),t.lineTo(s[2][0],s[2][1]);return}var o=Math.min(i,a)*n,r=Fn([],s[1],s[0],o/i),l=Fn([],s[1],s[2],o/a),u=Fn([],r,l,.5);t.bezierCurveTo(r[0],r[1],r[0],r[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],s[2][0],s[2][1])}else for(var c=1;c<s.length;c++)t.lineTo(s[c][0],s[c][1])}function rc(t,e,n){var s=t.getTextGuideLine(),i=t.getTextContent();if(!i){s&&t.removeTextGuideLine();return}for(var a=e.normal,o=a.get("show"),r=i.ignore,l=0;l<ki.length;l++){var u=ki[l],c=e[u],h=u==="normal";if(c){var d=c.get("show"),f=h?r:Ai(i.states[u]&&i.states[u].ignore,r);if(f||!Ai(d,o)){var p=h?s:s&&s.states[u];p&&(p.ignore=!0),s&&Nn(s,!0,u,c);continue}s||(s=new da,t.setTextGuideLine(s),!h&&(r||!o)&&Nn(s,!0,"normal",e.normal),t.stateProxy&&(s.stateProxy=t.stateProxy)),Nn(s,!1,u,c)}}if(s){Su(s.style,n),s.style.fill=null;var b=a.get("showAbove"),m=t.textGuideLineConfig=t.textGuideLineConfig||{};m.showAbove=b||!1,s.buildPath=ac}}function lc(t,e){e=e||"labelLine";for(var n={normal:t.getModel(e)},s=0;s<Ci.length;s++){var i=Ci[s];n[i]=t.getModel([i,e])}return n}var uc=Math.PI/180;function Li(t,e,n,s,i,a,o,r,l,u){if(t.length<2)return;function c(b){for(var m=b.rB,g=m*m,P=0;P<b.list.length;P++){var w=b.list[P],E=Math.abs(w.label.y-n),D=s+w.len,V=D*D,k=Math.sqrt(Math.abs((1-E*E/g)*V)),S=e+(k+w.len2)*i,B=S-w.label.x,$=w.targetTextWidth-B*i;Ta(w,$,!0),w.label.x=S}}function h(b){for(var m={list:[],maxY:0},g={list:[],maxY:0},P=0;P<b.length;P++)if(b[P].labelAlignTo==="none"){var w=b[P],E=w.label.y>n?g:m,D=Math.abs(w.label.y-n);if(D>=E.maxY){var V=w.label.x-e-w.len2*i,k=s+w.len,S=Math.abs(V)<k?Math.sqrt(D*D/(1-V*V/k/k)):k;E.rB=S,E.maxY=D}E.list.push(w)}c(m),c(g)}for(var d=t.length,f=0;f<d;f++)if(t[f].position==="outer"&&t[f].labelAlignTo==="labelLine"){var p=t[f].label.x-u;t[f].linePoints[1][0]+=p,t[f].label.x=u}Tu(t,l,l+o)&&h(t)}function cc(t,e,n,s,i,a,o,r){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<t.length;d++){var f=t[d].label;zn(t[d])||(f.x<e?(c=Math.min(c,f.x),l.push(t[d])):(h=Math.max(h,f.x),u.push(t[d])))}for(var d=0;d<t.length;d++){var p=t[d];if(!zn(p)&&p.linePoints){if(p.labelStyleWidth!=null)continue;var f=p.label,b=p.linePoints,m=void 0;p.labelAlignTo==="edge"?f.x<e?m=b[2][0]-p.labelDistance-o-p.edgeDistance:m=o+i-p.edgeDistance-b[2][0]-p.labelDistance:p.labelAlignTo==="labelLine"?f.x<e?m=c-o-p.bleedMargin:m=o+i-h-p.bleedMargin:f.x<e?m=f.x-o-p.bleedMargin:m=o+i-f.x-p.bleedMargin,p.targetTextWidth=m,Ta(p,m)}}Li(u,e,n,s,1,i,a,o,r,h),Li(l,e,n,s,-1,i,a,o,r,c);for(var d=0;d<t.length;d++){var p=t[d];if(!zn(p)&&p.linePoints){var f=p.label,b=p.linePoints,g=p.labelAlignTo==="edge",P=f.style.padding,w=P?P[1]+P[3]:0,E=f.style.backgroundColor?0:w,D=p.rect.width+E,V=b[1][0]-b[2][0];g?f.x<e?b[2][0]=o+p.edgeDistance+D+p.labelDistance:b[2][0]=o+i-p.edgeDistance-D-p.labelDistance:(f.x<e?b[2][0]=f.x+p.labelDistance:b[2][0]=f.x-p.labelDistance,b[1][0]=b[2][0]+V),b[1][1]=b[2][1]=f.y}}}function Ta(t,e,n){if(n===void 0&&(n=!1),t.labelStyleWidth==null){var s=t.label,i=s.style,a=t.rect,o=i.backgroundColor,r=i.padding,l=r?r[1]+r[3]:0,u=i.overflow,c=a.width+(o?0:l);if(e<c||n){var h=a.height;if(u&&u.match("break")){s.setStyle("backgroundColor",null),s.setStyle("width",e-l);var d=s.getBoundingRect();s.setStyle("width",Math.ceil(d.width)),s.setStyle("backgroundColor",o)}else{var f=e-l,p=e<c?f:n?f>t.unconstrainedWidth?null:f:null;s.setStyle("width",p)}var b=s.getBoundingRect();a.width=b.width;var m=(s.style.margin||0)+2.1;a.height=b.height+m,a.y-=(a.height-h)/2}}}function zn(t){return t.position==="center"}function dc(t){var e=t.getData(),n=[],s,i,a=!1,o=(t.get("minShowLabelAngle")||0)*uc,r=e.getLayout("viewRect"),l=e.getLayout("r"),u=r.width,c=r.x,h=r.y,d=r.height;function f(V){V.ignore=!0}function p(V){if(!V.ignore)return!0;for(var k in V.states)if(V.states[k].ignore===!1)return!0;return!1}e.each(function(V){var k=e.getItemGraphicEl(V),S=k.shape,B=k.getTextContent(),$=k.getTextGuideLine(),U=e.getItemModel(V),F=U.getModel("label"),te=F.get("position")||U.get(["emphasis","label","position"]),C=F.get("distanceToLabelLine"),I=F.get("alignTo"),z=Ue(F.get("edgeDistance"),u),W=F.get("bleedMargin"),X=U.getModel("labelLine"),q=X.get("length");q=Ue(q,u);var Q=X.get("length2");if(Q=Ue(Q,u),Math.abs(S.endAngle-S.startAngle)<o){dn(B.states,f),B.ignore=!0,$&&(dn($.states,f),$.ignore=!0);return}if(p(B)){var Z=(S.startAngle+S.endAngle)/2,J=Math.cos(Z),ge=Math.sin(Z),ue,$e,ze,xt;s=S.cx,i=S.cy;var Re=te==="inside"||te==="inner";if(te==="center")ue=S.cx,$e=S.cy,xt="center";else{var Rt=(Re?(S.r+S.r0)/2*J:S.r*J)+s,Ve=(Re?(S.r+S.r0)/2*ge:S.r*ge)+i;if(ue=Rt+J*3,$e=Ve+ge*3,!Re){var bt=Rt+J*(q+l-S.r),wt=Ve+ge*(q+l-S.r),sn=bt+(J<0?-1:1)*Q,on=wt;I==="edge"?ue=J<0?c+z:c+u-z:ue=sn+(J<0?-C:C),$e=on,ze=[[Rt,Ve],[bt,wt],[sn,on]]}xt=Re?"center":I==="edge"?J>0?"right":"left":J>0?"left":"right"}var tt=Math.PI,Ke=0,nt=F.get("rotate");if(ha(nt))Ke=nt*(tt/180);else if(te==="center")Ke=0;else if(nt==="radial"||nt===!0){var Rn=J<0?-Z+tt:-Z;Ke=Rn}else if(nt==="tangential"&&te!=="outside"&&te!=="outer"){var Ge=Math.atan2(J,ge);Ge<0&&(Ge=tt*2+Ge);var In=ge>0;In&&(Ge=tt+Ge),Ke=Ge-tt}if(a=!!Ke,B.x=ue,B.y=$e,B.rotation=Ke,B.setStyle({verticalAlign:"middle"}),Re){B.setStyle({align:xt});var It=B.states.select;It&&(It.x+=B.x,It.y+=B.y)}else{var st=B.getBoundingRect().clone();st.applyTransform(B.getComputedTransform());var an=(B.style.margin||0)+2.1;st.y-=an/2,st.height+=an,n.push({label:B,labelLine:$,position:te,len:q,len2:Q,minTurnAngle:X.get("minTurnAngle"),maxSurfaceAngle:X.get("maxSurfaceAngle"),surfaceNormal:new me(J,ge),linePoints:ze,textAlign:xt,labelDistance:C,labelAlignTo:I,edgeDistance:z,bleedMargin:W,rect:st,unconstrainedWidth:st.width,labelStyleWidth:B.style.width})}k.setTextConfig({inside:Re})}}),!a&&t.get("avoidLabelOverlap")&&cc(n,s,i,l,u,d,c,h);for(var b=0;b<n.length;b++){var m=n[b],g=m.label,P=m.labelLine,w=isNaN(g.x)||isNaN(g.y);if(g){g.setStyle({align:m.textAlign}),w&&(dn(g.states,f),g.ignore=!0);var E=g.states.select;E&&(E.x+=g.x,E.y+=g.y)}if(P){var D=m.linePoints;w||!D?(dn(P.states,f),P.ignore=!0):(ic(D,m.minTurnAngle),oc(D,m.surfaceNormal,m.maxSurfaceAngle),P.setShape({points:D}),g.__hostTarget.textGuideLineConfig={anchor:new me(D[0][0],D[0][1])})}}}var hc=function(t){Vt(e,t);function e(n,s,i){var a=t.call(this)||this;a.z2=2;var o=new Au;return a.setTextContent(o),a.updateData(n,s,i,!0),a}return e.prototype.updateData=function(n,s,i,a){var o=this,r=n.hostModel,l=n.getItemModel(s),u=l.getModel("emphasis"),c=n.getItemLayout(s),h=Xe(hn(l.getModel("itemStyle"),c,!0),c);if(isNaN(h.startAngle)){o.setShape(h);return}if(a){o.setShape(h);var d=r.getShallow("animationType");r.ecModel.ssr?(jn(o,{scaleX:0,scaleY:0},r,{dataIndex:s,isFrom:!0}),o.originX=h.cx,o.originY=h.cy):d==="scale"?(o.shape.r=c.r0,jn(o,{shape:{r:c.r}},r,s)):i!=null?(o.setShape({startAngle:i,endAngle:i}),jn(o,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},r,s)):(o.shape.endAngle=c.startAngle,Mi(o,{shape:{endAngle:c.endAngle}},r,s))}else Cu(o),Mi(o,{shape:h},r,s);o.useStyle(n.getItemVisual(s,"style")),Pu(o,l);var f=(c.startAngle+c.endAngle)/2,p=r.get("selectedOffset"),b=Math.cos(f)*p,m=Math.sin(f)*p,g=l.getShallow("cursor");g&&o.attr("cursor",g),this._updateLabel(r,n,s),o.ensureState("emphasis").shape=Xe({r:c.r+(u.get("scale")&&u.get("scaleSize")||0)},hn(u.getModel("itemStyle"),c)),Xe(o.ensureState("select"),{x:b,y:m,shape:hn(l.getModel(["select","itemStyle"]),c)}),Xe(o.ensureState("blur"),{shape:hn(l.getModel(["blur","itemStyle"]),c)});var P=o.getTextGuideLine(),w=o.getTextContent();P&&Xe(P.ensureState("select"),{x:b,y:m}),Xe(w.ensureState("select"),{x:b,y:m}),Mu(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(n,s,i){var a=this,o=s.getItemModel(i),r=o.getModel("labelLine"),l=s.getItemVisual(i,"style"),u=l&&l.fill,c=l&&l.opacity;Du(a,Vu(o),{labelFetcher:s.hostModel,labelDataIndex:i,inheritColor:u,defaultOpacity:c,defaultText:n.getFormattedLabel(i,"normal")||s.getName(i)});var h=a.getTextContent();a.setTextConfig({position:null,rotation:null}),h.attr({z2:10});var d=n.get(["label","position"]);if(d!=="outside"&&d!=="outer")a.removeTextGuideLine();else{var f=this.getTextGuideLine();f||(f=new da,this.setTextGuideLine(f)),rc(this,lc(o),{stroke:u,opacity:Lu(r.get(["lineStyle","opacity"]),c,1)})}},e}(fa),fc=function(t){Vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.ignoreLabelLineUpdate=!0,n}return e.prototype.render=function(n,s,i,a){var o=n.getData(),r=this._data,l=this.group,u;if(!r&&o.count()>0){for(var c=o.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h<o.count();++h)c=o.getItemLayout(h);c&&(u=c.startAngle)}if(this._emptyCircleSector&&l.remove(this._emptyCircleSector),o.count()===0&&n.get("showEmptyCircle")){var d=_a(n),f=new fa({shape:Xe(wa(n,i),d)});f.useStyle(n.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=f,l.add(f)}o.diff(r).add(function(p){var b=new hc(o,p,u);o.setItemGraphicEl(p,b),l.add(b)}).update(function(p,b){var m=r.getItemGraphicEl(b);m.updateData(o,p,u),m.off("click"),l.add(m),o.setItemGraphicEl(p,m)}).remove(function(p){var b=r.getItemGraphicEl(p);ku(b,n,p)}).execute(),dc(n),n.get("animationTypeUpdate")!=="expansion"&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(n,s){var i=s.getData(),a=i.getItemLayout(0);if(a){var o=n[0]-a.cx,r=n[1]-a.cy,l=Math.sqrt(o*o+r*r);return l<=a.r&&l>=a.r0}},e.type="pie",e}(pa);function pc(t,e,n){e=os(e)&&{coordDimensions:e}||Xe({encodeDefine:t.getEncode()},e);var s=t.getSource(),i=Eu(s,e).dimensions,a=new $u(i,t);return a.initData(s,n),a}var mc=function(){function t(e,n){this._getDataWithEncodedVisual=e,this._getRawData=n}return t.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},t.prototype.containName=function(e){var n=this._getRawData();return n.indexOfName(e)>=0},t.prototype.indexOfName=function(e){var n=this._getDataWithEncodedVisual();return n.indexOfName(e)},t.prototype.getItemVisual=function(e,n){var s=this._getDataWithEncodedVisual();return s.getItemVisual(e,n)},t}(),gc=ca(),vc=function(t){Vt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(n){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new mc(Di(this.getData,this),Di(this.getRawData,this)),this._defaultLabelLine(n)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return pc(this,{coordDimensions:["value"],encodeDefaulter:ma(Ru,this)})},e.prototype.getDataParams=function(n){var s=this.getData(),i=gc(s),a=i.seats;if(!a){var o=[];s.each(s.mapDimension("value"),function(l){o.push(l)}),a=i.seats=Iu(o,s.hostModel.get("percentPrecision"))}var r=t.prototype.getDataParams.call(this,n);return r.percent=a[n]||0,r.$vars.push("percent"),r},e.prototype._defaultLabelLine=function(n){Bu(n,"labelLine",["show"]);var s=n.labelLine,i=n.emphasis.labelLine;s.show=s.show&&n.label.show,i.show=i.show&&n.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(ga);function yc(t){return{seriesType:t,reset:function(e,n){var s=e.getData();s.filterSelf(function(i){var a=s.mapDimension("value"),o=s.get(a,i);return!(ha(o)&&!isNaN(o)&&o<0)})}}}function xc(t){t.registerChartView(fc),t.registerSeriesModel(vc),Ou("pie",t.registerAction),t.registerLayout(ma(nc,"pie")),t.registerProcessor(sc("pie")),t.registerProcessor(yc("pie"))}var bc=function(t){Vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return e.prototype.getInitialData=function(n,s){return Fu(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var n=this.option.progressive;return n??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var n=this.option.progressiveThreshold;return n??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(n,s,i){return i.point(s.getItemLayout(n))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(ga),ka=4,wc=function(){function t(){}return t}(),_c=function(t){Vt(e,t);function e(n){var s=t.call(this,n)||this;return s._off=0,s.hoverDataIdx=-1,s}return e.prototype.getDefaultShape=function(){return new wc},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(n,s){var i=s.points,a=s.size,o=this.symbolProxy,r=o.shape,l=n.getContext?n.getContext():n,u=l&&a[0]<ka,c=this.softClipShape,h;if(u){this._ctx=l;return}for(this._ctx=null,h=this._off;h<i.length;){var d=i[h++],f=i[h++];isNaN(d)||isNaN(f)||c&&!c.contain(d,f)||(r.x=d-a[0]/2,r.y=f-a[1]/2,r.width=a[0],r.height=a[1],o.buildPath(n,r,!0))}this.incremental&&(this._off=h,this.notClear=!0)},e.prototype.afterBrush=function(){var n=this.shape,s=n.points,i=n.size,a=this._ctx,o=this.softClipShape,r;if(a){for(r=this._off;r<s.length;){var l=s[r++],u=s[r++];isNaN(l)||isNaN(u)||o&&!o.contain(l,u)||a.fillRect(l-i[0]/2,u-i[1]/2,i[0],i[1])}this.incremental&&(this._off=r,this.notClear=!0)}},e.prototype.findDataIndex=function(n,s){for(var i=this.shape,a=i.points,o=i.size,r=Math.max(o[0],4),l=Math.max(o[1],4),u=a.length/2-1;u>=0;u--){var c=u*2,h=a[c]-r/2,d=a[c+1]-l/2;if(n>=h&&s>=d&&n<=h+r&&s<=d+l)return u}return-1},e.prototype.contain=function(n,s){var i=this.transformCoordToLocal(n,s),a=this.getBoundingRect();if(n=i[0],s=i[1],a.contain(n,s)){var o=this.hoverDataIdx=this.findDataIndex(n,s);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var n=this._rect;if(!n){for(var s=this.shape,i=s.points,a=s.size,o=a[0],r=a[1],l=1/0,u=1/0,c=-1/0,h=-1/0,d=0;d<i.length;){var f=i[d++],p=i[d++];l=Math.min(f,l),c=Math.max(f,c),u=Math.min(p,u),h=Math.max(p,h)}n=this._rect=new Nu(l-o/2,u-r/2,c-l+o,h-u+r)}return n},e}(zu),Sc=function(){function t(){this.group=new ju}return t.prototype.updateData=function(e,n){this._clear();var s=this._create();s.setShape({points:e.getLayout("points")}),this._setCommon(s,e,n)},t.prototype.updateLayout=function(e){var n=e.getLayout("points");this.group.eachChild(function(s){if(s.startIndex!=null){var i=(s.endIndex-s.startIndex)*2,a=s.startIndex*4*2;n=new Float32Array(n.buffer,a,i)}s.setShape("points",n),s.reset()})},t.prototype.incrementalPrepareUpdate=function(e){this._clear()},t.prototype.incrementalUpdate=function(e,n,s){var i=this._newAdded[0],a=n.getLayout("points"),o=i&&i.shape.points;if(o&&o.length<2e4){var r=o.length,l=new Float32Array(r+a.length);l.set(o),l.set(a,r),i.endIndex=e.end,i.setShape({points:l})}else{this._newAdded=[];var u=this._create();u.startIndex=e.start,u.endIndex=e.end,u.incremental=!0,u.setShape({points:a}),this._setCommon(u,n,s)}},t.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},t.prototype._create=function(){var e=new _c({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},t.prototype._setCommon=function(e,n,s){var i=n.hostModel;s=s||{};var a=n.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=s.clipShape||null,e.symbolProxy=Uu(n.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<ka;e.useStyle(i.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var r=n.getVisual("style"),l=r&&r.fill;l&&e.setColor(l);var u=qu(e);u.seriesIndex=i.seriesIndex,e.on("mousemove",function(c){u.dataIndex=null;var h=e.hoverDataIdx;h>=0&&(u.dataIndex=h+(e.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),Tc=function(t){Vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type=e.type,n}return e.prototype.render=function(n,s,i){var a=n.getData(),o=this._updateSymbolDraw(a,n);o.updateData(a,{clipShape:this._getClipShape(n)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(n,s,i){var a=n.getData(),o=this._updateSymbolDraw(a,n);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(n,s,i){this._symbolDraw.incrementalUpdate(n,s.getData(),{clipShape:this._getClipShape(s)}),this._finished=n.end===s.getData().count()},e.prototype.updateTransform=function(n,s,i){var a=n.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=va("").reset(n,s,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(n){this._symbolDraw&&this._symbolDraw.eachRendered(n)},e.prototype._getClipShape=function(n){if(n.get("clip",!0)){var s=n.coordinateSystem;return s&&s.getArea&&s.getArea(.1)}},e.prototype._updateSymbolDraw=function(n,s){var i=this._symbolDraw,a=s.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new Sc:new Hu,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(n,s){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(pa);function kc(t){ya(Ku),t.registerSeriesModel(bc),t.registerChartView(Tc),t.registerLayout(va("scatter"))}function Jt(t,e){const n=typeof t=="string"?`${t}Context`:e,s=Symbol(n);return[o=>{const r=ta(s,o);if(r===void 0)throw new Error(`Injection \`${s.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`);return r},o=>(na(s,o),o),s]}function Ac(t,e){const{layoutGroup:n,presenceContext:s,config:i}=e,a=n.id&&t.layoutId?`${n.id}-${t.layoutId}`:t.layoutId||void 0;return{...t,layoutId:a,transition:t.transition??i.transition,layoutGroup:n,motionConfig:i,inViewOptions:t.inViewOptions??i.inViewOptions,presenceContext:s,initial:s.initial===!1?s.initial:t.initial===!0?void 0:t.initial}}function Us(t,e){t.indexOf(e)===-1&&t.push(e)}function _n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Ne=(t,e,n)=>n>e?e:n<t?t:n;let qs=()=>{};const qe={},Aa=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Ca(t){return typeof t=="object"&&t!==null}const Pa=t=>/^0[^.\s]+$/u.test(t);function Ma(t){let e;return()=>(e===void 0&&(e=t()),e)}const Me=t=>t,Cc=(t,e)=>n=>e(t(n)),en=(...t)=>t.reduce(Cc),Wt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class Hs{constructor(){this.subscriptions=[]}add(e){return Us(this.subscriptions,e),()=>_n(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const De=t=>t*1e3,Pe=t=>t/1e3;function Da(t,e){return e?t*(1e3/e):0}const Va=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Pc=1e-7,Mc=12;function Dc(t,e,n,s,i){let a,o,r=0;do o=e+(n-e)/2,a=Va(o,s,i)-t,a>0?n=o:e=o;while(Math.abs(a)>Pc&&++r<Mc);return o}function tn(t,e,n,s){if(t===e&&n===s)return Me;const i=a=>Dc(a,0,1,t,n);return a=>a===0||a===1?a:Va(i(a),e,s)}const La=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ea=t=>e=>1-t(1-e),$a=tn(.33,1.53,.69,.99),Ks=Ea($a),Ra=La(Ks),Ia=t=>(t*=2)<1?.5*Ks(t):.5*(2-Math.pow(2,-10*(t-1))),Gs=t=>1-Math.sin(Math.acos(t)),Ba=Ea(Gs),Oa=La(Gs),Vc=tn(.42,0,1,1),Lc=tn(0,0,.58,1),Fa=tn(.42,0,.58,1),Ec=t=>Array.isArray(t)&&typeof t[0]!="number",ja=t=>Array.isArray(t)&&typeof t[0]=="number",$c={linear:Me,easeIn:Vc,easeInOut:Fa,easeOut:Lc,circIn:Gs,circInOut:Oa,circOut:Ba,backIn:Ks,backInOut:Ra,backOut:$a,anticipate:Ia},Rc=t=>typeof t=="string",Ei=t=>{if(ja(t)){qs(t.length===4);const[e,n,s,i]=t;return tn(e,n,s,i)}else if(Rc(t))return $c[t];return t},pn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ic(t,e){let n=new Set,s=new Set,i=!1,a=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(u.schedule(c),t()),c(r)}const u={schedule:(c,h=!1,d=!1)=>{const p=d&&i?n:s;return h&&o.add(c),p.has(c)||p.add(c),c},cancel:c=>{s.delete(c),o.delete(c)},process:c=>{if(r=c,i){a=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,a&&(a=!1,u.process(c))}};return u}const Bc=40;function Na(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=pn.reduce((w,E)=>(w[E]=Ic(a),w),{}),{setup:r,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:d,render:f,postRender:p}=o,b=()=>{const w=qe.useManualTiming?i.timestamp:performance.now();n=!1,qe.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(w-i.timestamp,Bc),1)),i.timestamp=w,i.isProcessing=!0,r.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),f.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(b))},m=()=>{n=!0,s=!0,i.isProcessing||t(b)};return{schedule:pn.reduce((w,E)=>{const D=o[E];return w[E]=(V,k=!1,S=!1)=>(n||m(),D.schedule(V,k,S)),w},{}),cancel:w=>{for(let E=0;E<pn.length;E++)o[pn[E]].cancel(w)},state:i,steps:o}}const{schedule:ee,cancel:et,state:fe,steps:Un}=Na(typeof requestAnimationFrame<"u"?requestAnimationFrame:Me,!0);let yn;function Oc(){yn=void 0}const we={now:()=>(yn===void 0&&we.set(fe.isProcessing||qe.useManualTiming?fe.timestamp:performance.now()),yn),set:t=>{yn=t,queueMicrotask(Oc)}},za=t=>e=>typeof e=="string"&&e.startsWith(t),Ws=za("--"),Fc=za("var(--"),Ys=t=>Fc(t)?jc.test(t.split("/*")[0].trim()):!1,jc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function $i(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Lt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Yt={...Lt,transform:t=>Ne(0,1,t)},mn={...Lt,default:1},Ut=t=>Math.round(t*1e5)/1e5,Xs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Nc(t){return t==null}const zc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qs=(t,e)=>n=>!!(typeof n=="string"&&zc.test(n)&&n.startsWith(t)||e&&!Nc(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ua=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,a,o,r]=s.match(Xs);return{[t]:parseFloat(i),[e]:parseFloat(a),[n]:parseFloat(o),alpha:r!==void 0?parseFloat(r):1}},Uc=t=>Ne(0,255,t),qn={...Lt,transform:t=>Math.round(Uc(t))},rt={test:Qs("rgb","red"),parse:Ua("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+qn.transform(t)+", "+qn.transform(e)+", "+qn.transform(n)+", "+Ut(Yt.transform(s))+")"};function qc(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const as={test:Qs("#"),parse:qc,transform:rt.transform},nn=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ye=nn("deg"),je=nn("%"),j=nn("px"),Hc=nn("vh"),Kc=nn("vw"),Ri={...je,parse:t=>je.parse(t)/100,transform:t=>je.transform(t*100)},_t={test:Qs("hsl","hue"),parse:Ua("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+je.transform(Ut(e))+", "+je.transform(Ut(n))+", "+Ut(Yt.transform(s))+")"},le={test:t=>rt.test(t)||as.test(t)||_t.test(t),parse:t=>rt.test(t)?rt.parse(t):_t.test(t)?_t.parse(t):as.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?rt.transform(t):_t.transform(t),getAnimatableNone:t=>{const e=le.parse(t);return e.alpha=0,le.transform(e)}},Gc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Wc(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Xs))==null?void 0:e.length)||0)+(((n=t.match(Gc))==null?void 0:n.length)||0)>0}const qa="number",Ha="color",Yc="var",Xc="var(",Ii="${}",Qc=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(Qc,l=>(le.test(l)?(s.color.push(a),i.push(Ha),n.push(le.parse(l))):l.startsWith(Xc)?(s.var.push(a),i.push(Yc),n.push(l)):(s.number.push(a),i.push(qa),n.push(parseFloat(l))),++a,Ii)).split(Ii);return{values:n,split:r,indexes:s,types:i}}function Zc(t){return Pt(t).values}function Ka({split:t,types:e}){const n=t.length;return s=>{let i="";for(let a=0;a<n;a++)if(i+=t[a],s[a]!==void 0){const o=e[a];o===qa?i+=Ut(s[a]):o===Ha?i+=le.transform(s[a]):i+=s[a]}return i}}function Jc(t){return Ka(Pt(t))}const ed=t=>typeof t=="number"?0:le.test(t)?le.getAnimatableNone(t):t,td=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:ed(t);function nd(t){const e=Pt(t);return Ka(e)(e.values.map((s,i)=>td(s,e.split[i])))}const Ee={test:Wc,parse:Zc,createTransformer:Jc,getAnimatableNone:nd};function Hn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function sd({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,a=0,o=0;if(!e)i=a=o=n;else{const r=n<.5?n*(1+e):n+e-n*e,l=2*n-r;i=Hn(l,r,t+1/3),a=Hn(l,r,t),o=Hn(l,r,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:s}}function Sn(t,e){return n=>n>0?e:t}const se=(t,e,n)=>t+(e-t)*n,Kn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},id=[as,rt,_t],od=t=>id.find(e=>e.test(t));function Bi(t){const e=od(t);if(!e)return!1;let n=e.parse(t);return e===_t&&(n=sd(n)),n}const Oi=(t,e)=>{const n=Bi(t),s=Bi(e);if(!n||!s)return Sn(t,e);const i={...n};return a=>(i.red=Kn(n.red,s.red,a),i.green=Kn(n.green,s.green,a),i.blue=Kn(n.blue,s.blue,a),i.alpha=se(n.alpha,s.alpha,a),rt.transform(i))},rs=new Set(["none","hidden"]);function ad(t,e){return rs.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function rd(t,e){return n=>se(t,e,n)}function Zs(t){return typeof t=="number"?rd:typeof t=="string"?Ys(t)?Sn:le.test(t)?Oi:cd:Array.isArray(t)?Ga:typeof t=="object"?le.test(t)?Oi:ld:Sn}function Ga(t,e){const n=[...t],s=n.length,i=t.map((a,o)=>Zs(a)(a,e[o]));return a=>{for(let o=0;o<s;o++)n[o]=i[o](a);return n}}function ld(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Zs(t[i])(t[i],e[i]));return i=>{for(const a in s)n[a]=s[a](i);return n}}function ud(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const a=e.types[i],o=t.indexes[a][s[a]],r=t.values[o]??0;n[i]=r,s[a]++}return n}const cd=(t,e)=>{const n=Ee.createTransformer(e),s=Pt(t),i=Pt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?rs.has(t)&&!i.values.length||rs.has(e)&&!s.values.length?ad(t,e):en(Ga(ud(s,i),i.values),n):Sn(t,e)};function Wa(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?se(t,e,n):Zs(t)(t,e)}const dd=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>ee.update(e,n),stop:()=>et(e),now:()=>fe.isProcessing?fe.timestamp:we.now()}},Ya=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let a=0;a<i;a++)s+=Math.round(t(a/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Tn=2e4;function Js(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Tn;)e+=n,s=t.next(e);return e>=Tn?1/0:e}function hd(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Js(s),Tn);return{type:"keyframes",ease:a=>s.next(i*a).value/e,duration:Pe(i)}}const oe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ls(t,e){return t*Math.sqrt(1-e*e)}const fd=12;function pd(t,e,n){let s=n;for(let i=1;i<fd;i++)s=s-t(s)/e(s);return s}const Fi=.001;function md({duration:t=oe.duration,bounce:e=oe.bounce,velocity:n=oe.velocity,mass:s=oe.mass}){let i,a,o=1-e;o=Ne(oe.minDamping,oe.maxDamping,o),t=Ne(oe.minDuration,oe.maxDuration,Pe(t)),o<1?(i=u=>{const c=u*o,h=c*t,d=c-n,f=ls(u,o),p=Math.exp(-h);return Fi-d/f*p},a=u=>{const h=u*o*t,d=h*n+n,f=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),b=ls(Math.pow(u,2),o);return(-i(u)+Fi>0?-1:1)*((d-f)*p)/b}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-.001+c*h},a=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const r=5/t,l=pd(i,a,r);if(t=De(t),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const gd=["duration","bounce"],vd=["stiffness","damping","mass"];function ji(t,e){return e.some(n=>t[n]!==void 0)}function yd(t){let e={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...t};if(!ji(t,vd)&&ji(t,gd))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,a=2*Ne(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:oe.mass,stiffness:i,damping:a}}else{const n=md({...t,velocity:0});e={...e,...n,mass:oe.mass},e.isResolvedFromDuration=!0}return e}function kn(t=oe.visualDuration,e=oe.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],r={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=yd({...n,velocity:-Pe(n.velocity||0)}),p=d||0,b=u/(2*Math.sqrt(l*c)),m=o-a,g=Pe(Math.sqrt(l/c)),P=Math.abs(m)<5;s||(s=P?oe.restSpeed.granular:oe.restSpeed.default),i||(i=P?oe.restDelta.granular:oe.restDelta.default);let w,E,D,V,k,S;if(b<1)D=ls(g,b),V=(p+b*g*m)/D,w=$=>{const U=Math.exp(-b*g*$);return o-U*(V*Math.sin(D*$)+m*Math.cos(D*$))},k=b*g*V+m*D,S=b*g*m-V*D,E=$=>Math.exp(-b*g*$)*(k*Math.sin(D*$)+S*Math.cos(D*$));else if(b===1){w=U=>o-Math.exp(-g*U)*(m+(p+g*m)*U);const $=p+g*m;E=U=>Math.exp(-g*U)*(g*$*U-p)}else{const $=g*Math.sqrt(b*b-1);w=C=>{const I=Math.exp(-b*g*C),z=Math.min($*C,300);return o-I*((p+b*g*m)*Math.sinh(z)+$*m*Math.cosh(z))/$};const U=(p+b*g*m)/$,F=b*g*U-m*$,te=b*g*m-U*$;E=C=>{const I=Math.exp(-b*g*C),z=Math.min($*C,300);return I*(F*Math.sinh(z)+te*Math.cosh(z))}}const B={calculatedDuration:f&&h||null,velocity:$=>De(E($)),next:$=>{if(!f&&b<1){const F=Math.exp(-b*g*$),te=Math.sin(D*$),C=Math.cos(D*$),I=o-F*(V*te+m*C),z=De(F*(k*te+S*C));return r.done=Math.abs(z)<=s&&Math.abs(o-I)<=i,r.value=r.done?o:I,r}const U=w($);if(f)r.done=$>=h;else{const F=De(E($));r.done=Math.abs(F)<=s&&Math.abs(o-U)<=i}return r.value=r.done?o:U,r},toString:()=>{const $=Math.min(Js(B),Tn),U=Ya(F=>B.next($*F).value,$,30);return $+"ms "+U},toTransition:()=>{}};return B}kn.applyToOptions=t=>{const e=hd(t,100,kn);return t.ease=e.ease,t.duration=De(e.duration),t.type="keyframes",t};const xd=5;function Xa(t,e,n){const s=Math.max(e-xd,0);return Da(n-t(s),e-s)}function us({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:r,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},f=S=>r!==void 0&&S<r||l!==void 0&&S>l,p=S=>r===void 0?l:l===void 0||Math.abs(r-S)<Math.abs(l-S)?r:l;let b=n*e;const m=h+b,g=o===void 0?m:o(m);g!==m&&(b=g-h);const P=S=>-b*Math.exp(-S/s),w=S=>g+P(S),E=S=>{const B=P(S),$=w(S);d.done=Math.abs(B)<=u,d.value=d.done?g:$};let D,V;const k=S=>{f(d.value)&&(D=S,V=kn({keyframes:[d.value,p(d.value)],velocity:Xa(w,S,d.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return k(0),{calculatedDuration:null,next:S=>{let B=!1;return!V&&D===void 0&&(B=!0,E(S),k(S)),D!==void 0&&S>=D?V.next(S-D):(!B&&E(S),d)}}}function bd(t,e,n){const s=[],i=n||qe.mix||Wa,a=t.length-1;for(let o=0;o<a;o++){let r=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||Me:e;r=en(l,r)}s.push(r)}return s}function wd(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const a=t.length;if(qs(a===e.length),a===1)return()=>e[0];if(a===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=bd(e,s,i),l=r.length,u=c=>{if(o&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const d=Wt(t[h],t[h+1],c);return r[h](d)};return n?c=>u(Ne(t[0],t[a-1],c)):u}function _d(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Wt(0,e,s);t.push(se(n,1,i))}}function Sd(t){const e=[0];return _d(e,t.length-1),e}function Td(t,e){return t.map(n=>n*e)}function kd(t,e){return t.map(()=>e||Fa).splice(0,t.length-1)}function qt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Ec(s)?s.map(Ei):Ei(s),a={done:!1,value:e[0]},o=Td(n&&n.length===e.length?n:Sd(e),t),r=wd(o,e,{ease:Array.isArray(i)?i:kd(e,i)});return{calculatedDuration:t,next:l=>(a.value=r(l),a.done=l>=t,a)}}const Ad=t=>t!==null;function ei(t,{repeat:e,repeatType:n="loop"},s,i=1){const a=t.filter(Ad),r=i<0||e&&n!=="loop"&&e%2===1?0:a.length-1;return!r||s===void 0?a[r]:s}const Cd={decay:us,inertia:us,tween:qt,keyframes:qt,spring:kn};function Qa(t){typeof t.type=="string"&&(t.type=Cd[t.type])}class ti{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Pd=t=>t/100;class ni extends ti{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==we.now()&&this.tick(we.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Qa(e);const{type:n=qt,repeat:s=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=e;let{keyframes:r}=e;const l=n||qt;l!==qt&&typeof r[0]!="number"&&(this.mixKeyframes=en(Pd,Wa(r[0],r[1])),r=[0,100]);const u=l({...e,keyframes:r});a==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...r].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Js(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:f,type:p,onUpdate:b,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,E=s;if(h){const S=Math.min(this.currentTime,i)/r;let B=Math.floor(S),$=S%1;!$&&S>=1&&($=1),$===1&&B--,B=Math.min(B,h+1),!!(B%2)&&(d==="reverse"?($=1-$,f&&($-=f/r)):d==="mirror"&&(E=o)),w=Ne(0,1,$)*r}const D=P?{done:!1,value:c[0]}:E.next(w);a&&!P&&(D.value=a(D.value));let{done:V}=D;!P&&l!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return k&&p!==us&&(D.value=ei(c,this.options,m,this.speed)),b&&b(D.value),k&&this.finish(),D}then(e,n){return this.finished.then(e,n)}get duration(){return Pe(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Pe(e)}get time(){return Pe(this.currentTime)}set time(e){e=De(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Xa(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(we.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Pe(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:e=dd,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(a=(i=this.options).onPlay)==null||a.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(we.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Md(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const lt=t=>t*180/Math.PI,cs=t=>{const e=lt(Math.atan2(t[1],t[0]));return ds(e)},Dd={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:cs,rotateZ:cs,skewX:t=>lt(Math.atan(t[1])),skewY:t=>lt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ds=t=>(t=t%360,t<0&&(t+=360),t),Ni=cs,zi=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ui=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Vd={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:zi,scaleY:Ui,scale:t=>(zi(t)+Ui(t))/2,rotateX:t=>ds(lt(Math.atan2(t[6],t[5]))),rotateY:t=>ds(lt(Math.atan2(-t[2],t[0]))),rotateZ:Ni,rotate:Ni,skewX:t=>lt(Math.atan(t[4])),skewY:t=>lt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function hs(t){return t.includes("scale")?1:0}function fs(t,e){if(!t||t==="none")return hs(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Vd,i=n;else{const r=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Dd,i=r}if(!i)return hs(e);const a=s[e],o=i[1].split(",").map(Ed);return typeof a=="function"?a(o):o[a]}const Ld=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return fs(n,e)};function Ed(t){return parseFloat(t.trim())}const Et=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$t=new Set(Et),qi=t=>t===Lt||t===j,$d=new Set(["x","y","z"]),Rd=Et.filter(t=>!$d.has(t));function Id(t){const e=[];return Rd.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Je={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>fs(e,"x"),y:(t,{transform:e})=>fs(e,"y")};Je.translateX=Je.x;Je.translateY=Je.y;const yt=new Set;let ps=!1,ms=!1,gs=!1;function Za(){if(ms){const t=Array.from(yt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Id(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([a,o])=>{var r;(r=s.getValue(a))==null||r.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ms=!1,ps=!1,yt.forEach(t=>t.complete(gs)),yt.clear()}function Ja(){yt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ms=!0)})}function Bd(){gs=!0,Ja(),Za(),gs=!1}class si{constructor(e,n,s,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(yt.add(this),ps||(ps=!0,ee.read(Ja),ee.resolveKeyframes(Za))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const a=i==null?void 0:i.get(),o=e[e.length-1];if(a!==void 0)e[0]=a;else if(s&&n){const r=s.readValue(n,o);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=o),i&&a===void 0&&i.set(e[0])}Md(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yt.delete(this)}cancel(){this.state==="scheduled"&&(yt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Od=t=>t.startsWith("--");function er(t,e,n){Od(e)?t.style.setProperty(e,n):t.style[e]=n}const Fd={};function tr(t,e){const n=Ma(t);return()=>Fd[e]??n()}const jd=tr(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),nr=tr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Nt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Hi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Nt([0,.65,.55,1]),circOut:Nt([.55,0,1,.45]),backIn:Nt([.31,.01,.66,-.59]),backOut:Nt([.33,1.53,.69,.99])};function sr(t,e){if(t)return typeof t=="function"?nr()?Ya(t,e):"ease-out":ja(t)?Nt(t):Array.isArray(t)?t.map(n=>sr(n,e)||Hi.easeOut):Hi[t]}function Nd(t,e,n,{delay:s=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=sr(r,i);Array.isArray(h)&&(c.easing=h);const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(c,d)}function ir(t){return typeof t=="function"&&"applyToOptions"in t}function zd({type:t,...e}){return ir(t)&&nr()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class or extends ti{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:r,onComplete:l}=e;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=e,qs(typeof e.type!="string");const u=zd(e);this.animation=Nd(n,s,i,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const c=ei(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(c),er(n,s,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,s,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return Pe(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Pe(e)}get time(){return Pe(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=De(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){var a;return this.allowFlatten&&((a=this.animation.effect)==null||a.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&jd()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),Me):i(this)}}const ar={anticipate:Ia,backInOut:Ra,circInOut:Oa};function Ud(t){return t in ar}function qd(t){typeof t.ease=="string"&&Ud(t.ease)&&(t.ease=ar[t.ease])}const Gn=10;class Hd extends or{constructor(e){qd(e),Qa(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:a,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const r=new ni({...o,autoplay:!1}),l=Math.max(Gn,we.now()-this.startTime),u=Ne(0,Gn,l-Gn),c=r.sample(l).value,{name:h}=this.options;a&&h&&er(a,h,c),n.setWithVelocity(r.sample(Math.max(0,l-u)).value,c,u),r.stop()}}const Ki=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ee.test(t)||t==="0")&&!t.startsWith("url("));function Kd(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Gd(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const a=t[t.length-1],o=Ki(i,e),r=Ki(a,e);return!o||!r?!1:Kd(t)||(n==="spring"||ir(n))&&s}function vs(t){t.duration=0,t.type="keyframes"}const Wd=new Set(["opacity","clipPath","filter","transform"]),Yd=Ma(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Xd(t){var c;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:a,type:o}=t;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return Yd()&&n&&Wd.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&a!==0&&o!=="inertia"}const Qd=40;class Zd extends ti{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:r,name:l,motionValue:u,element:c,...h}){var p;super(),this.stop=()=>{var b,m;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(m=this.keyframeResolver)==null||m.cancel()},this.createdAt=we.now();const d={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:u,element:c,...h},f=(c==null?void 0:c.KeyframeResolver)||si;this.keyframeResolver=new f(r,(b,m,g)=>this.onKeyframesResolved(b,m,d,!g),l,u,c),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,n,s,i){var m,g;this.keyframeResolver=void 0;const{name:a,type:o,velocity:r,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=we.now(),Gd(e,a,o,r)||((qe.instantAnimations||!l)&&(c==null||c(ei(e,s,n))),e[0]=e[e.length-1],vs(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Qd?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},f=!u&&Xd(d),p=(g=(m=d.motionValue)==null?void 0:m.owner)==null?void 0:g.current,b=f?new Hd({...d,element:p}):new ni(d);b.finished.then(()=>{this.notifyFinished()}).catch(Me),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Bd()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function rr(t,e,n,s=0,i=1){const a=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,r=(o-1)*s;return typeof n=="function"?n(a,o):i===1?a*s:r-a*s}const Jd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function eh(t){const e=Jd.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function lr(t,e,n=1){const[s,i]=eh(t);if(!s)return;const a=window.getComputedStyle(e).getPropertyValue(s);if(a){const o=a.trim();return Aa(o)?parseFloat(o):o}return Ys(i)?lr(i,e,n+1):i}const th={type:"spring",stiffness:500,damping:25,restSpeed:10},nh=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),sh={type:"keyframes",duration:.8},ih={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oh=(t,{keyframes:e})=>e.length>2?sh:$t.has(t)?t.startsWith("scale")?nh(e[1]):th:ih,ah=t=>t!==null;function rh(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ah),a=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[a]}function ur(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function ii(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?ur(n,t):n}function lh({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:r,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const oi=(t,e,n,s={},i,a)=>o=>{const r=ii(s,t)||{},l=r.delay||s.delay||0;let{elapsed:u=0}=s;u=u-De(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...r,delay:-u,onUpdate:d=>{e.set(d),r.onUpdate&&r.onUpdate(d)},onComplete:()=>{o(),r.onComplete&&r.onComplete()},name:t,motionValue:e,element:a?void 0:i};lh(r)||Object.assign(c,oh(t,c)),c.duration&&(c.duration=De(c.duration)),c.repeatDelay&&(c.repeatDelay=De(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(vs(c),c.delay===0&&(h=!0)),(qe.instantAnimations||qe.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,vs(c),c.delay=0),c.allowFlatten=!r.type&&!r.ease,h&&!a&&e.get()!==void 0){const d=rh(c.keyframes,r);if(d!==void 0){ee.update(()=>{c.onUpdate(d),c.onComplete()});return}}return r.isSync?new ni(c):new Zd(c)};function Gi(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function cr(t,e,n,s){if(typeof e=="function"){const[i,a]=Gi(s);e=e(n!==void 0?n:t.custom,i,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,a]=Gi(s);e=e(n!==void 0?n:t.custom,i,a)}return e}function Ct(t,e,n){const s=t.getProps();return cr(s,e,n!==void 0?n:s.custom,t)}const dr=new Set(["width","height","top","left","right","bottom",...Et]),Wi=30,uh=t=>!isNaN(parseFloat(t));class ch{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var a;const i=we.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=we.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uh(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Hs);const s=this.events[e].add(n);return e==="change"?()=>{s(),ee.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=we.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Wi)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Wi);return Da(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Mt(t,e){return new ch(t,e)}const dh=t=>Array.isArray(t);function hh(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Mt(n))}function fh(t){return dh(t)?t[t.length-1]||0:t}function ph(t,e){const n=Ct(t,e);let{transitionEnd:s={},transition:i={},...a}=n||{};a={...a,...s};for(const o in a){const r=fh(a[o]);hh(t,o,r)}}const ye=t=>!!(t&&t.getVelocity);function mh(t){return!!(ye(t)&&t.add)}function ys(t,e){const n=t.getValue("willChange");if(mh(n))return n.add(e);if(!n&&qe.WillChange){const s=new qe.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function ai(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const gh="framerAppearId",vh="data-"+ai(gh);function hr(t){return t.props[vh]}function yh({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function fr(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:a,transitionEnd:o,...r}=e;const l=t.getDefaultTransition();a=a?ur(a,l):l;const u=a==null?void 0:a.reduceMotion;s&&(a=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const d in r){const f=t.getValue(d,t.latestValues[d]??null),p=r[d];if(p===void 0||h&&yh(h,d))continue;const b={delay:n,...ii(a||{},d)},m=f.get();if(m!==void 0&&!f.isAnimating&&!Array.isArray(p)&&p===m&&!b.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const E=hr(t);if(E){const D=window.MotionHandoffAnimation(E,d,ee);D!==null&&(b.startTime=D,g=!0)}}ys(t,d);const P=u??t.shouldReduceMotion;f.start(oi(d,f,p,P&&dr.has(d)?{type:!1}:b,t,g));const w=f.animation;w&&c.push(w)}if(o){const d=()=>ee.update(()=>{o&&ph(t,o)});c.length?Promise.all(c).then(d):d()}return c}function xs(t,e,n={}){var l;const s=Ct(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const a=s?()=>Promise.all(fr(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:d}=i;return xh(t,e,u,c,h,d,n)}:()=>Promise.resolve(),{when:r}=i;if(r){const[u,c]=r==="beforeChildren"?[a,o]:[o,a];return u().then(()=>c())}else return Promise.all([a(),o(n.delay)])}function xh(t,e,n=0,s=0,i=0,a=1,o){const r=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),r.push(xs(l,e,{...o,delay:n+(typeof s=="function"?0:s)+rr(t.variantChildren,l,s,i,a)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(r)}function bh(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(a=>xs(t,a,n));s=Promise.all(i)}else if(typeof e=="string")s=xs(t,e,n);else{const i=typeof e=="function"?Ct(t,e,n.custom):e;s=Promise.all(fr(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const wh={test:t=>t==="auto",parse:t=>t},pr=t=>e=>e.test(t),mr=[Lt,j,je,Ye,Kc,Hc,wh],Yi=t=>mr.find(pr(t));function _h(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Pa(t):!0}const Sh=new Set(["brightness","contrast","saturate","opacity"]);function Th(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Xs)||[];if(!s)return t;const i=n.replace(s,"");let a=Sh.has(e)?1:0;return s!==n&&(a*=100),e+"("+a+i+")"}const kh=/\b([a-z-]*)\(.*?\)/gu,bs={...Ee,getAnimatableNone:t=>{const e=t.match(kh);return e?e.map(Th).join(" "):t}},ws={...Ee,getAnimatableNone:t=>{const e=Ee.parse(t);return Ee.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Xi={...Lt,transform:Math.round},Ah={rotate:Ye,rotateX:Ye,rotateY:Ye,rotateZ:Ye,scale:mn,scaleX:mn,scaleY:mn,scaleZ:mn,skew:Ye,skewX:Ye,skewY:Ye,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:Yt,originX:Ri,originY:Ri,originZ:j},ri={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...Ah,zIndex:Xi,fillOpacity:Yt,strokeOpacity:Yt,numOctaves:Xi},Ch={...ri,color:le,backgroundColor:le,outlineColor:le,fill:le,stroke:le,borderColor:le,borderTopColor:le,borderRightColor:le,borderBottomColor:le,borderLeftColor:le,filter:bs,WebkitFilter:bs,mask:ws,WebkitMask:ws},gr=t=>Ch[t],Ph=new Set([bs,ws]);function vr(t,e){let n=gr(t);return Ph.has(n)||(n=Ee),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Mh=new Set(["auto","none","0"]);function Dh(t,e,n){let s=0,i;for(;s<t.length&&!i;){const a=t[s];typeof a=="string"&&!Mh.has(a)&&Pt(a).values.length&&(i=t[s]),s++}if(i&&n)for(const a of e)t[a]=vr(n,i)}class Vh extends si{constructor(e,n,s,i,a){super(e,n,s,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let h=e[c];if(typeof h=="string"&&(h=h.trim(),Ys(h))){const d=lr(h,n.current);d!==void 0&&(e[c]=d),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!dr.has(s)||e.length!==2)return;const[i,a]=e,o=Yi(i),r=Yi(a),l=$i(i),u=$i(a);if(l!==u&&Je[s]){this.needsMeasurement=!0;return}if(o!==r)if(qi(o)&&qi(r))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else Je[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||_h(e[i]))&&s.push(i);s.length&&Dh(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Je[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var r;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const a=s.length-1,o=s[a];s[a]=Je[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(r=this.removedTransforms)!=null&&r.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Lh=new Set(["opacity","clipPath","filter","transform"]);function yr(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const xr=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Eh(t){return Ca(t)&&"offsetHeight"in t}const{schedule:br}=Na(queueMicrotask,!1),$h={y:!1};function Rh(){return $h.y}function wr(t,e){const n=yr(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Ih(t){return!(t.pointerType==="touch"||Rh())}function Bh(t,e,n={}){const[s,i,a]=wr(t,n);return s.forEach(o=>{let r=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",p)},h=m=>{u&&(u(m),u=void 0),c()},d=m=>{r=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),l&&(l=!1,h(m))},f=()=>{r=!0,window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",d,i)},p=m=>{if(m.pointerType!=="touch"){if(r){l=!0;return}h(m)}},b=m=>{if(!Ih(m))return;l=!1;const g=e(o,m);typeof g=="function"&&(u=g,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",b,i),o.addEventListener("pointerdown",f,i)}),a}const _r=(t,e)=>e?t===e?!0:_r(t,e.parentElement):!1,Oh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Fh=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function jh(t){return Fh.has(t.tagName)||t.isContentEditable===!0}const xn=new WeakSet;function Qi(t){return e=>{e.key==="Enter"&&t(e)}}function Wn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Nh=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Qi(()=>{if(xn.has(n))return;Wn(n,"down");const i=Qi(()=>{Wn(n,"up")}),a=()=>Wn(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",a,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Zi(t){return Oh(t)&&!0}const Ji=new WeakSet;function zh(t,e,n={}){const[s,i,a]=wr(t,n),o=r=>{const l=r.currentTarget;if(!Zi(r)||Ji.has(r))return;xn.add(l),n.stopPropagation&&Ji.add(r);const u=e(l,r),c=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),xn.has(l)&&xn.delete(l),Zi(f)&&typeof u=="function"&&u(f,{success:p})},h=f=>{c(f,l===window||l===document||n.useGlobalTarget||_r(l,f.target))},d=f=>{c(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",d,i)};return s.forEach(r=>{(n.useGlobalTarget?window:r).addEventListener("pointerdown",o,i),Eh(r)&&(r.addEventListener("focus",u=>Nh(u,i)),!jh(r)&&!r.hasAttribute("tabindex")&&(r.tabIndex=0))}),a}function Sr(t){return Ca(t)&&"ownerSVGElement"in t}function Uh(t){return Sr(t)&&t.tagName==="svg"}const qh=[...mr,le,Ee],Hh=t=>qh.find(pr(t)),eo=()=>({translate:0,scale:1,origin:0,originPoint:0}),St=()=>({x:eo(),y:eo()}),to=()=>({min:0,max:0}),ce=()=>({x:to(),y:to()}),Kh=new WeakMap;function li(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function En(t){return typeof t=="string"||Array.isArray(t)}const Gh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Wh=["initial",...Gh];function Tr(t){return li(t.animate)||Wh.some(e=>En(t[e]))}function Yh(t){return!!(Tr(t)||t.variants)}function Xh(t,e,n){for(const s in e){const i=e[s],a=n[s];if(ye(i))t.addValue(s,i);else if(ye(a))t.addValue(s,Mt(i,{owner:t}));else if(a!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Mt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const _s={current:null},kr={current:!1},Qh=typeof window<"u";function Zh(){if(kr.current=!0,!!Qh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>_s.current=t.matches;t.addEventListener("change",e),e()}else _s.current=!1}const no=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let so={};class Jh{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:r},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=si,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=we.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,ee.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=r;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=Tr(n),this.isVariantNode=Yh(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];u[f]!==void 0&&ye(p)&&p.set(u[f])}}mount(e){var n,s;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,Kh.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,a)=>this.bindToMotionValue(a,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(kr.current||Zh(),this.shouldReduceMotion=_s.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),et(this.notifyUpdate),et(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Lh.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:r,times:l,ease:u,duration:c}=n.accelerate,h=new or({element:this.current,name:e,keyframes:r,times:l,ease:u,duration:De(c)}),d=o(h);this.valueSubscriptions.set(e,()=>{d(),h.cancel()});return}const s=$t.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&ee.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in so){const n=so[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ce()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<no.length;s++){const i=no[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=e[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Xh(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Mt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Aa(s)||Pa(s))?s=parseFloat(s):!Hh(s)&&Ee.test(n)&&(s=vr(e,n)),this.setBaseTarget(e,ye(s)?s.get():s)),ye(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var a;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=cr(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!ye(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Hs),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){br.render(this.render)}}class Ar extends Jh{constructor(){super(...arguments),this.KeyframeResolver=Vh}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ye(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Cr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function ef({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function tf(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Yn(t){return t===void 0||t===1}function Ss({scale:t,scaleX:e,scaleY:n}){return!Yn(t)||!Yn(e)||!Yn(n)}function at(t){return Ss(t)||Pr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Pr(t){return io(t.x)||io(t.y)}function io(t){return t&&t!=="0%"}function An(t,e,n){const s=t-n,i=e*s;return n+i}function oo(t,e,n,s,i){return i!==void 0&&(t=An(t,i,s)),An(t,n,s)+e}function Ts(t,e=0,n=1,s,i){t.min=oo(t.min,e,n,s,i),t.max=oo(t.max,e,n,s,i)}function Mr(t,{x:e,y:n}){Ts(t.x,e.translate,e.scale,e.originPoint),Ts(t.y,n.translate,n.scale,n.originPoint)}const ao=.999999999999,ro=1.0000000000001;function nf(t,e,n,s=!1){var r;const i=n.length;if(!i)return;e.x=e.y=1;let a,o;for(let l=0;l<i;l++){a=n[l],o=a.projectionDelta;const{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(s&&a.options.layoutScroll&&a.scroll&&a!==a.root&&kt(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Mr(t,o)),s&&at(a.latestValues)&&kt(t,a.latestValues,(r=a.layout)==null?void 0:r.layoutBox))}e.x<ro&&e.x>ao&&(e.x=1),e.y<ro&&e.y>ao&&(e.y=1)}function Tt(t,e){t.min=t.min+e,t.max=t.max+e}function lo(t,e,n,s,i=.5){const a=se(t.min,t.max,i);Ts(t,e,n,a,s)}function uo(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function kt(t,e,n){const s=n??t;lo(t.x,uo(e.x,s.x),e.scaleX,e.scale,e.originX),lo(t.y,uo(e.y,s.y),e.scaleY,e.scale,e.originY)}function Dr(t,e){return Cr(tf(t.getBoundingClientRect(),e))}function sf(t,e,n){const s=Dr(t,n),{scroll:i}=e;return i&&(Tt(s.x,i.offset.x),Tt(s.y,i.offset.y)),s}const of={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},af=Et.length;function rf(t,e,n){let s="",i=!0;for(let a=0;a<af;a++){const o=Et[a],r=t[o];if(r===void 0)continue;let l=!0;if(typeof r=="number")l=r===(o.startsWith("scale")?1:0);else{const u=parseFloat(r);l=o.startsWith("scale")?u===1:u===0}if(!l||n){const u=xr(r,ri[o]);if(!l){i=!1;const c=of[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function ui(t,e,n){const{style:s,vars:i,transformOrigin:a}=t;let o=!1,r=!1;for(const l in e){const u=e[l];if($t.has(l)){o=!0;continue}else if(Ws(l)){i[l]=u;continue}else{const c=xr(u,ri[l]);l.startsWith("origin")?(r=!0,a[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=rf(e,t.transform,n):s.transform&&(s.transform="none")),r){const{originX:l="50%",originY:u="50%",originZ:c=0}=a;s.transformOrigin=`${l} ${u} ${c}`}}function Vr(t,{style:e,vars:n},s,i){const a=t.style;let o;for(o in e)a[o]=e[o];i==null||i.applyProjectionStyles(a,s);for(o in n)a.setProperty(o,n[o])}function co(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Fe={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(j.test(t))t=parseFloat(t);else return t;const n=co(t,e.target.x),s=co(t,e.target.y);return`${n}% ${s}%`}},Lr={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Ee.parse(t);if(i.length>5)return s;const a=Ee.createTransformer(t),o=typeof i[0]!="number"?1:0,r=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=r,i[1+o]/=l;const u=se(r,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}},Xt={borderRadius:{...Fe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fe,borderTopRightRadius:Fe,borderBottomLeftRadius:Fe,borderBottomRightRadius:Fe,boxShadow:Lr};function Er(t){for(const e in t)Xt[e]=t[e],Ws(e)&&(Xt[e].isCSSVariable=!0)}function lf(t,{layout:e,layoutId:n}){return $t.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Xt[t]||t==="opacity")}function $r(t,e,n){var o;const s=t.style,i=e==null?void 0:e.style,a={};if(!s)return a;for(const r in s)(ye(s[r])||i&&ye(i[r])||lf(r,t)||((o=n==null?void 0:n.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(a[r]=s[r]);return a}function uf(t){return window.getComputedStyle(t)}class cf extends Ar{constructor(){super(...arguments),this.type="html",this.renderInstance=Vr}readValueFromInstance(e,n){var s;if($t.has(n))return(s=this.projection)!=null&&s.isProjecting?hs(n):Ld(e,n);{const i=uf(e),a=(Ws(n)?i.getPropertyValue(n):i[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Dr(e,n)}build(e,n,s){ui(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return $r(e,n,s)}}const df={offset:"stroke-dashoffset",array:"stroke-dasharray"},hf={offset:"strokeDashoffset",array:"strokeDasharray"};function ff(t,e,n=1,s=0,i=!0){t.pathLength=1;const a=i?df:hf;t[a.offset]=`${-s}`,t[a.array]=`${e} ${n}`}const pf=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Rr(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...r},l,u,c){if(ui(t,r,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete h.transformBox);for(const f of pf)h[f]!==void 0&&(d[f]=h[f],delete h[f]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&ff(h,i,a,o,!1)}const ci=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Ir=t=>typeof t=="string"&&t.toLowerCase()==="svg";function mf(t,e,n,s){Vr(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(ci.has(i)?i:ai(i),e.attrs[i])}function gf(t,e,n){const s=$r(t,e,n);for(const i in t)if(ye(t[i])||ye(e[i])){const a=Et.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[a]=t[i]}return s}class vf extends Ar{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ce}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if($t.has(n)){const s=gr(n);return s&&s.default||0}return n=ci.has(n)?n:ai(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return gf(e,n,s)}build(e,n,s){Rr(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){mf(e,n,s,i)}mount(e){this.isSVGTag=Ir(e.tagName),super.mount(e)}}function ho(t,e){t.min=e.min,t.max=e.max}function Le(t,e){ho(t.x,e.x),ho(t.y,e.y)}function fo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Br=1e-4,yf=1-Br,xf=1+Br,Or=.01,bf=0-Or,wf=0+Or;function _e(t){return t.max-t.min}function _f(t,e,n){return Math.abs(t-e)<=n}function po(t,e,n,s=.5){t.origin=s,t.originPoint=se(e.min,e.max,t.origin),t.scale=_e(n)/_e(e),t.translate=se(n.min,n.max,t.origin)-t.originPoint,(t.scale>=yf&&t.scale<=xf||isNaN(t.scale))&&(t.scale=1),(t.translate>=bf&&t.translate<=wf||isNaN(t.translate))&&(t.translate=0)}function Ht(t,e,n,s){po(t.x,e.x,n.x,s?s.originX:void 0),po(t.y,e.y,n.y,s?s.originY:void 0)}function mo(t,e,n){t.min=n.min+e.min,t.max=t.min+_e(e)}function Sf(t,e,n){mo(t.x,e.x,n.x),mo(t.y,e.y,n.y)}function go(t,e,n){t.min=e.min-n.min,t.max=t.min+_e(e)}function Cn(t,e,n){go(t.x,e.x,n.x),go(t.y,e.y,n.y)}function vo(t,e,n,s,i){return t-=e,t=An(t,1/n,s),i!==void 0&&(t=An(t,1/i,s)),t}function Tf(t,e=0,n=1,s=.5,i,a=t,o=t){if(je.test(e)&&(e=parseFloat(e),e=se(o.min,o.max,e/100)-o.min),typeof e!="number")return;let r=se(a.min,a.max,s);t===a&&(r-=e),t.min=vo(t.min,e,n,r,i),t.max=vo(t.max,e,n,r,i)}function yo(t,e,[n,s,i],a,o){Tf(t,e[n],e[s],e[i],e.scale,a,o)}const kf=["x","scaleX","originX"],Af=["y","scaleY","originY"];function xo(t,e,n,s){yo(t.x,e,kf,n?n.x:void 0,s?s.x:void 0),yo(t.y,e,Af,n?n.y:void 0,s?s.y:void 0)}function bo(t){return t.translate===0&&t.scale===1}function Fr(t){return bo(t.x)&&bo(t.y)}function wo(t,e){return t.min===e.min&&t.max===e.max}function Cf(t,e){return wo(t.x,e.x)&&wo(t.y,e.y)}function _o(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function jr(t,e){return _o(t.x,e.x)&&_o(t.y,e.y)}function So(t){return _e(t.x)/_e(t.y)}function To(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ce(t){return[t("x"),t("y")]}function Pf(t,e,n){let s="";const i=t.x.translate/e.x,a=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(s=`translate3d(${i}px, ${a}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),d&&(s+=`rotateY(${d}deg) `),f&&(s+=`skewX(${f}deg) `),p&&(s+=`skewY(${p}deg) `)}const r=t.x.scale*e.x,l=t.y.scale*e.y;return(r!==1||l!==1)&&(s+=`scale(${r}, ${l})`),s||"none"}const Nr=["TopLeft","TopRight","BottomLeft","BottomRight"],Mf=Nr.length,ko=t=>typeof t=="string"?parseFloat(t):t,Ao=t=>typeof t=="number"||j.test(t);function Df(t,e,n,s,i,a){i?(t.opacity=se(0,n.opacity??1,Vf(s)),t.opacityExit=se(e.opacity??1,0,Lf(s))):a&&(t.opacity=se(e.opacity??1,n.opacity??1,s));for(let o=0;o<Mf;o++){const r=`border${Nr[o]}Radius`;let l=Co(e,r),u=Co(n,r);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Ao(l)===Ao(u)?(t[r]=Math.max(se(ko(l),ko(u),s),0),(je.test(u)||je.test(l))&&(t[r]+="%")):t[r]=u}(e.rotate||n.rotate)&&(t.rotate=se(e.rotate||0,n.rotate||0,s))}function Co(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Vf=zr(0,.5,Ba),Lf=zr(.5,.95,Me);function zr(t,e,n){return s=>s<t?0:s>e?1:n(Wt(t,e,s))}function Ef(t,e,n){const s=ye(t)?t:Mt(t);return s.start(oi("",s,e,n)),s.animation}function $f(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Rf=(t,e)=>t.depth-e.depth;class If{constructor(){this.children=[],this.isDirty=!1}add(e){Us(this.children,e),this.isDirty=!0}remove(e){_n(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Rf),this.isDirty=!1,this.children.forEach(e)}}function Bf(t,e){const n=we.now(),s=({timestamp:i})=>{const a=i-n;a>=e&&(et(s),t(a-e))};return ee.setup(s,!0),()=>et(s)}function Xn(t){return ye(t)?t.get():t}class Of{constructor(){this.members=[]}add(e){Us(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(_n(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(_n(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let s=this.members.indexOf(e)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:a}=s.options,{layoutDependency:o}=e.options;(a===void 0||a!==o)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,i,a,o;(s=(n=e.options).onExitComplete)==null||s.call(n),(o=(i=e.resumingFrom)==null?void 0:(a=i.options).onExitComplete)==null||o.call(a)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const bn={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Qn=["","X","Y","Z"],Ff=1e3;let jf=0;function Zn(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Ur(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=hr(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ee,!(i||a))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Ur(s)}function qr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},r=e==null?void 0:e()){this.id=jf++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Uf),this.nodes.forEach(Gf),this.nodes.forEach(Wf),this.nodes.forEach(qf)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new If)}addEventListener(o,r){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Hs),this.eventHandlers.get(o).add(r)}notifyListeners(o,...r){const l=this.eventHandlers.get(o);l&&l.notify(...r)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Sr(o)&&!Uh(o),this.instance=o;const{layoutId:r,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||r)&&(this.isLayoutDirty=!0),t){let c,h=0;const d=()=>this.root.updateBlockedByResize=!1;ee.read(()=>{h=window.innerWidth}),t(o,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,c&&c(),c=Bf(d,250),bn.hasAnimatedSinceResize&&(bn.hasAnimatedSinceResize=!1,this.nodes.forEach(Do)))})}r&&this.root.registerSharedNode(r,this),this.options.animate!==!1&&u&&(r||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Jf,{onLayoutAnimationStart:b,onLayoutAnimationComplete:m}=u.getProps(),g=!this.targetLayout||!jr(this.targetLayout,f),P=!h&&d;if(this.options.layoutRoot||this.resumeFrom||P||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...ii(p,"layout"),onPlay:b,onComplete:m};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(c,P)}else h||Do(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),et(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Yf),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ur(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:r,layout:l}=this.options;if(r===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Po);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Mo);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Kf),this.nodes.forEach(Nf),this.nodes.forEach(zf)):this.nodes.forEach(Mo),this.clearAllSnapshots();const r=we.now();fe.delta=Ne(0,1e3/60,r-fe.timestamp),fe.timestamp=r,fe.isProcessing=!0,Un.update.process(fe),Un.preRender.process(fe),Un.render.process(fe),fe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,br.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Hf),this.sharedNodes.forEach(Xf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ee.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ee.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_e(this.snapshot.measuredBox.x)&&!_e(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ce(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:r}=this.options;r&&r.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let r=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(r=!1),r&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,r=this.projectionDelta&&!Fr(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(r||at(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const r=this.measurePageBox();let l=this.removeElementScroll(r);return o&&(l=this.removeTransform(l)),ep(l),{animationId:this.root.animationId,measuredBox:r,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return ce();const r=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(tp))){const{scroll:c}=this.root;c&&(Tt(r.x,c.offset.x),Tt(r.y,c.offset.y))}return r}removeElementScroll(o){var l;const r=ce();if(Le(r,o),(l=this.scroll)!=null&&l.wasRoot)return r;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:d}=c;c!==this.root&&h&&d.layoutScroll&&(h.wasRoot&&Le(r,o),Tt(r.x,h.offset.x),Tt(r.y,h.offset.y))}return r}applyTransform(o,r=!1){var u,c;const l=ce();Le(l,o);for(let h=0;h<this.path.length;h++){const d=this.path[h];!r&&d.options.layoutScroll&&d.scroll&&d!==d.root&&kt(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),at(d.latestValues)&&kt(l,d.latestValues,(u=d.layout)==null?void 0:u.layoutBox)}return at(this.latestValues)&&kt(l,this.latestValues,(c=this.layout)==null?void 0:c.layoutBox),l}removeTransform(o){var l;const r=ce();Le(r,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!at(c.latestValues))continue;let h;c.instance&&(Ss(c.latestValues)&&c.updateSnapshot(),h=ce(),Le(h,c.measurePageBox())),xo(r,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,h)}return at(this.latestValues)&&xo(r,this.latestValues),r}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==fe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;const r=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=r.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=r.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=r.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==r;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=fe.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ce(),this.targetWithTransforms=ce()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Sf(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Le(this.target,this.layout.layoutBox),Mr(this.target,this.targetDelta)):Le(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ss(this.parent.latestValues)||Pr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,r,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ce(),this.relativeTargetOrigin=ce(),Cn(this.relativeTargetOrigin,r,l),Le(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const o=this.getLead(),r=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===fe.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;Le(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;nf(this.layoutCorrected,this.treeScale,this.path,r),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=ce());const{target:f}=o;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fo(this.prevProjectionDelta.x,this.projectionDelta.x),fo(this.prevProjectionDelta.y,this.projectionDelta.y)),Ht(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!To(this.projectionDelta.x,this.prevProjectionDelta.x)||!To(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var r;if((r=this.options.visualElement)==null||r.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=St(),this.projectionDelta=St(),this.projectionDeltaWithTransform=St()}setAnimationOrigin(o,r=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=St();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!r;const d=ce(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,b=f!==p,m=this.getStack(),g=!m||m.members.length<=1,P=!!(b&&!g&&this.options.crossfade===!0&&!this.path.some(Zf));this.animationProgress=0;let w;this.mixTargetDelta=E=>{const D=E/1e3;Vo(h.x,o.x,D),Vo(h.y,o.y,D),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cn(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Qf(this.relativeTarget,this.relativeTargetOrigin,d,D),w&&Cf(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=ce()),Le(w,this.relativeTarget)),b&&(this.animationValues=c,Df(c,u,this.latestValues,D,P,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var r,l,u;this.notifyListeners("animationStart"),(r=this.currentAnimation)==null||r.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(et(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ee.update(()=>{bn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Mt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Ef(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ff),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:r,target:l,layout:u,latestValues:c}=o;if(!(!r||!l||!u)){if(this!==o&&this.layout&&u&&Hr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ce();const h=_e(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=_e(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}Le(r,l),kt(r,c),Ht(this.projectionDeltaWithTransform,this.layoutCorrected,r,c)}}registerSharedNode(o,r){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Of),this.sharedNodes.get(o).add(r);const u=r.options.initialPromotionConfig;r.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(r):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var r;const{layoutId:o}=this.options;return o?((r=this.getStack())==null?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:o}=this.options;return o?(r=this.getStack())==null?void 0:r.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:r,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),r&&this.setOptions({transition:r})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let r=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(r=!0),!r)return;const u={};l.z&&Zn("z",o,u,this.animationValues);for(let c=0;c<Qn.length;c++)Zn(`rotate${Qn[c]}`,o,u,this.animationValues),Zn(`skew${Qn[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,r){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Xn(r==null?void 0:r.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Xn(r==null?void 0:r.pointerEvents)||""),this.hasProjected&&!at(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Pf(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),o.transform=h;const{x:d,y:f}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in Xt){if(c[p]===void 0)continue;const{correct:b,applyTo:m,isCSSVariable:g}=Xt[p],P=h==="none"?c[p]:b(c[p],u);if(m){const w=m.length;for(let E=0;E<w;E++)o[m[E]]=P}else g?this.options.visualElement.renderState.vars[p]=P:o[p]=P}this.options.layoutId&&(o.pointerEvents=u===this?Xn(r==null?void 0:r.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var r;return(r=o.currentAnimation)==null?void 0:r.stop()}),this.root.nodes.forEach(Po),this.root.sharedNodes.clear()}}}function Nf(t){t.updateLayout()}function zf(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:a}=t.options,o=e.source!==t.layout.source;a==="size"?Ce(h=>{const d=o?e.measuredBox[h]:e.layoutBox[h],f=_e(d);d.min=s[h].min,d.max=d.min+f}):Hr(a,e.layoutBox,s)&&Ce(h=>{const d=o?e.measuredBox[h]:e.layoutBox[h],f=_e(s[h]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+f)});const r=St();Ht(r,s,e.layoutBox);const l=St();o?Ht(l,t.applyTransform(i,!0),e.measuredBox):Ht(l,s,e.layoutBox);const u=!Fr(r);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:f}=h;if(d&&f){const p=ce();Cn(p,e.layoutBox,d.layoutBox);const b=ce();Cn(b,s,f.layoutBox),jr(p,b)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:r,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Uf(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function qf(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Hf(t){t.clearSnapshot()}function Po(t){t.clearMeasurements()}function Mo(t){t.isLayoutDirty=!1}function Kf(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Do(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Gf(t){t.resolveTargetDelta()}function Wf(t){t.calcProjection()}function Yf(t){t.resetSkewAndRotation()}function Xf(t){t.removeLeadSnapshot()}function Vo(t,e,n){t.translate=se(e.translate,0,n),t.scale=se(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Lo(t,e,n,s){t.min=se(e.min,n.min,s),t.max=se(e.max,n.max,s)}function Qf(t,e,n,s){Lo(t.x,e.x,n.x,s),Lo(t.y,e.y,n.y,s)}function Zf(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Jf={duration:.45,ease:[.4,0,.1,1]},Eo=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),$o=Eo("applewebkit/")&&!Eo("chrome/")?Math.round:Me;function Ro(t){t.min=$o(t.min),t.max=$o(t.max)}function ep(t){Ro(t.x),Ro(t.y)}function Hr(t,e,n){return t==="position"||t==="preserve-aspect"&&!_f(So(e),So(n),.2)}function tp(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const np=qr({attachResizeListener:(t,e)=>$f(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Jn={current:void 0},sp=qr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Jn.current){const t=new np({});t.mount(window),t.setOptions({layoutScroll:!0}),Jn.current=t}return Jn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ip={some:0,all:1};function op(t,e,{root:n,margin:s,amount:i="some"}={}){const a=yr(t),o=new WeakMap,r=u=>{u.forEach(c=>{const h=o.get(c.target);if(c.isIntersecting!==!!h)if(c.isIntersecting){const d=e(c.target,c);typeof d=="function"?o.set(c.target,d):l.unobserve(c.target)}else typeof h=="function"&&(h(c),o.delete(c.target))})},l=new IntersectionObserver(r,{root:n,rootMargin:s,threshold:typeof i=="number"?i:ip[i]});return a.forEach(u=>l.observe(u)),()=>l.disconnect()}const Io=(t,e)=>Math.abs(t-e);function ap(t,e){const n=Io(t.x,e.x),s=Io(t.y,e.y);return Math.sqrt(n**2+s**2)}function Kr({current:t}){return t?t.ownerDocument.defaultView:null}function ks(t){if(t)return t.nodeType===3||t.nodeType===8?ks(t.nextSibling):t}const[rp,lp,hx]=Jt("Motion"),[up,fx,px]=Jt("LayoutGroup"),cp={reducedMotion:"never",transition:void 0,nonce:void 0},[dp,mx,gx]=Jt("MotionConfig");function hp(){return dp(L(()=>cp))}const fp={motionAttribute:"data-ap"},As=[];function Gr(t){for(const e of t)e&&!As.includes(e)&&As.push(e)}function Wr(t,e,n){if(Array.isArray(t))return t.reduce((s,i)=>{const a=Wr(i,e,n);return a?{...s,...a}:s},{});if(typeof t=="object")return t;if(t&&e){const s=e[t];return typeof s=="function"?s(n):s}}function pp(t,e,n){const s=Wr(t,e,n);if(!s)return;const{transition:i,transitionEnd:a,...o}=s;return{...o,...a}}function mp(t,e){var i;const n=(t.initial===void 0&&t.variants?e==null?void 0:e.initial:t.initial)===!1?["initial","animate"]:["initial"],s=t.custom??((i=t.presenceContext)==null?void 0:i.custom);return n.reduce((a,o)=>({...a,...pp(t[o]||(e==null?void 0:e[o]),t.variants,s)}),{})}function Yr(t,e){const n=e==null?void 0:e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}var gp=new Set(["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]);function Xr(t){return gp.has(t)}const Bo=new WeakMap;var vp=class{constructor(t,e){var n;this.element=null,this.isExiting=!1,this.presenceContainer=null,this.children=new Set,this.features=new Map,this._context=null,this.options=t,this.parent=e,(n=e==null?void 0:e.children)==null||n.add(this),this.latestValues=mp(t,this.context),this.type=Xr(this.options.as)?"svg":"html"}get context(){return this._context||(this._context=new Proxy({},{get:(t,e)=>{var s;const n=this.options[e];return En(n)||e==="initial"&&n===!1?n:(s=this.parent)==null?void 0:s.context[e]}})),this._context}updateFeatures(){if(this.visualElement)for(const t of As){this.features.has(t.key)||this.features.set(t.key,new t(this));const e=this.features.get(t.key);this.isMounted()&&(e.isMount?e.update():(e.mount(),e.isMount=!0))}}updateOptions(t){var e;this.options=t,(e=this.visualElement)==null||e.update({...this.options,whileTap:this.options.whilePress},null)}mount(t){var e,n;Bo.set(t,this),this.element=t,t.setAttribute(fp.motionAttribute,((e=this.options.presenceContext)==null?void 0:e.presenceId)??""),(n=this.visualElement)==null||n.mount(t),this.updateFeatures()}beforeUnmount(){this.getSnapshot(this.options,!1)}unmount(){var t,e,n;(e=(t=this.parent)==null?void 0:t.children)==null||e.delete(this),Bo.delete(this.element),this.features.forEach(s=>{var i;return(i=s.unmount)==null?void 0:i.call(s)}),(n=this.visualElement)==null||n.unmount()}beforeUpdate(){this.getSnapshot(this.options,void 0)}update(){this.updateFeatures(),this.didUpdate()}tryExitComplete(){var t,e,n,s,i;this.isExiting||(t=this.options)!=null&&t.layoutId&&((n=(e=this.visualElement.projection)==null?void 0:e.currentAnimation)==null?void 0:n.state)==="running"||(i=(s=this.options.presenceContext)==null?void 0:s.onMotionExitComplete)==null||i.call(s,this.presenceContainer,this)}setActive(t,e){var n,s;t==="exit"&&e&&(this.isExiting=!0),(s=(n=this.visualElement)==null?void 0:n.animationState)==null||s.setActive(t,e).then(()=>{var i;t==="exit"&&e&&(this.isExiting=!1,(i=this.options)!=null&&i.layoutId?ee.postRender(()=>this.tryExitComplete()):this.tryExitComplete())})}isMounted(){return!!this.element}initVisualElement(t){var e,n,s;this.visualElement||(this.visualElement=t(this.options.as,{presenceContext:null,parent:(e=this.parent)==null?void 0:e.visualElement,props:{...this.options,whileTap:this.options.whilePress},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{...this.latestValues}},reducedMotionConfig:(n=this.options.motionConfig)==null?void 0:n.reducedMotion}),(s=this.visualElement.parent)==null||s.addChild(this.visualElement),this.isMounted()&&this.visualElement.mount(this.element))}getSnapshot(t,e){}didUpdate(){}},He=class{constructor(t){this.state=t}mount(){}unmount(){}update(){}};const Qr=["initial","animate","exit","whileHover","whileDrag","whileFocus","whilePress"];var yp=Qr.length;function Zr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Zr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<yp;n++){const s=Qr[n],i=t.props[s];(En(i)||i===!1)&&(e[s]=i)}return e}var Jr=["animate","whileInView","whileFocus","whileHover","whilePress","whileDrag","exit"],xp=[...Jr].reverse(),bp=Jr.length;function ot(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Oo(){return{animate:ot(!0),whileInView:ot(),whileHover:ot(),whilePress:ot(),whileDrag:ot(),whileFocus:ot(),exit:ot()}}function wp(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Yr(e,t):!1}function Fo(t){return Array.isArray(t)}function _p(t){return e=>Promise.all(e.map(({animation:n,options:s})=>bh(t,n,s)))}function Sp(t){let e=_p(t),n=Oo(),s=!0;const i=l=>(u,c)=>{var d;const h=Ct(t,c,l==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(h){const{transition:f,transitionEnd:p,...b}=h;u={...u,...b,...p}}return u};function a(l){e=l(t)}function o(l){const{props:u}=t,c=Zr(t.parent)||{},h=[],d=new Set;let f={},p=1/0;for(let m=0;m<bp;m++){const g=xp[m],P=n[g],w=u[g]!==void 0?u[g]:c[g],E=En(w),D=g===l?P.isActive:null;D===!1&&(p=m);let V=w===c[g]&&w!==u[g]&&E;if(V&&s&&t.manuallyAnimateOnMount&&(V=!1),P.protectedKeys={...f},!P.isActive&&D===null||!w&&!P.prevProp||li(w)||typeof w=="boolean")continue;const k=wp(P.prevProp,w);let S=k||g===l&&P.isActive&&!V&&E||m>p&&E,B=!1;const $=Array.isArray(w)?w:[w];let U=$.reduce(i(g),{});D===!1&&(U={});const{prevResolvedValues:F={}}=P,te={...F,...U},C=z=>{S=!0,d.has(z)&&(B=!0,d.delete(z)),P.needsAnimating[z]=!0;const W=t.getValue(z);W&&(W.liveStyle=!1)};for(const z in te){const W=U[z],X=F[z];if(Object.hasOwnProperty.call(f,z))continue;let q=!1;Fo(W)&&Fo(X)?q=!Yr(W,X):q=W!==X,q?W!=null?C(z):d.add(z):W!==void 0&&d.has(z)?C(z):P.protectedKeys[z]=!0}P.prevProp=w,P.prevResolvedValues=U,P.isActive&&(f={...f,...U}),s&&t.blockInitialAnimation&&(S=!1);const I=V&&k;S&&(!I||B)&&h.push(...$.map(z=>{const W={type:g};if(typeof z=="string"&&s&&!I&&t.manuallyAnimateOnMount&&t.parent){const{parent:X}=t,q=Ct(X,z);if(X.enteringChildren&&q){const{delayChildren:Q}=q.transition||{};W.delay=rr(X.enteringChildren,t,Q)}}return{animation:z,options:W}}))}if(d.size){const m={};if(typeof u.initial!="boolean"){const g=Ct(t,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(m.transition=g.transition)}d.forEach(g=>{const P=t.getBaseTarget(g),w=t.getValue(g);w&&(w.liveStyle=!0),m[g]=P??null}),h.push({animation:m})}let b=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(b=!1),s=!1,b?e(h):Promise.resolve()}function r(l,u){var h;if(n[l].isActive===u)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(d=>{var f;(f=d.animationState)==null||f.setActive(l,u)}),n[l].isActive=u;const c=o(l);for(const d in n)n[d].protectedKeys={};return c}return{animateChanges:o,setActive:r,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Oo(),s=!0}}}function el(t){return t.style.display==="none"||t.offsetParent===null&&window.getComputedStyle(t).position!=="fixed"}var ut,Ds,Tp=(ut=class extends He{constructor(e){super(e);const n=e.visualElement;n.animationState||(n.animationState=Sp(n))}updateAnimationControlsSubscription(){const{animate:e}=this.state.options;li(e)&&(this.unmountControls=e.subscribe(this.state.visualElement))}mount(){var e;el(this.state.element)?this.state.setActive("exit",!0):(e=this.state.visualElement.animationState)==null||e.animateChanges(),this.updateAnimationControlsSubscription()}update(){var s;(s=this.state.visualElement.animationState)==null||s.animateChanges();const{animate:e}=this.state.visualElement.getProps(),{animate:n}=this.state.visualElement.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.state.visualElement.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}},Ds=new WeakMap,Ie(ut,Ds,ut.key="animation"),ut);function kp(t,e){return Xr(t)?new vf(e):new cf(e)}function jo(t){return{point:{x:t.pageX,y:t.pageY}}}var ct,Vs,Ap=(ct=class extends He{constructor(e){super(e)}isActive(){const{whilePress:e,onPress:n,onPressCancel:s,onPressStart:i}=this.state.options;return!!(e||n||s||i)}register(){var n;const e=this.state.element;!e||!this.isActive()||((n=this.removePress)==null||n.call(this),this.removePress=zh(e,(s,i)=>{const a=this.state.options;return this.state.setActive("whilePress",!0),a.onPressStart&&ee.postRender(()=>a.onPressStart(i,jo(i))),(o,{success:r})=>{this.state.setActive("whilePress",!1);const l=r?"onPress":"onPressCancel",u=this.state.options[l];u&&ee.postRender(()=>u(o,jo(o)))}},{useGlobalTarget:this.state.options.globalPressTarget}))}mount(){this.register()}update(){const e=this.state.visualElement.prevProps;!(e!=null&&e.whilePress||e!=null&&e.whileTap||e!=null&&e.onPress||e!=null&&e.onPressCancel||e!=null&&e.onPressStart)&&this.isActive()&&this.register()}unmount(){var e;(e=this.removePress)==null||e.call(this),this.removePress=void 0}},Vs=new WeakMap,Ie(ct,Vs,ct.key="press"),ct);function tl(t){return t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1}function Qt(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}function Cp(t){return e=>tl(e)&&t(e,Qt(e))}var dt,Ls,Pp=(dt=class extends He{constructor(e){super(e)}isActive(){const{whileHover:e,onHoverStart:n,onHoverEnd:s}=this.state.options;return!!(e||n||s)}register(){var n;const e=this.state.element;!e||!this.isActive()||((n=this.removeHover)==null||n.call(this),this.removeHover=Bh(e,(s,i)=>{const a=this.state.options;return this.state.setActive("whileHover",!0),a.onHoverStart&&ee.postRender(()=>a.onHoverStart(i,Qt(i))),o=>{this.state.setActive("whileHover",!1);const r=this.state.options.onHoverEnd;r&&ee.postRender(()=>r(o,Qt(o)))}}))}mount(){this.register()}update(){const e=this.state.visualElement.prevProps;!(e!=null&&e.whileHover||e!=null&&e.onHoverStart||e!=null&&e.onHoverEnd)&&this.isActive()&&this.register()}unmount(){var e;(e=this.removeHover)==null||e.call(this),this.removeHover=void 0}},Ls=new WeakMap,Ie(dt,Ls,dt.key="hover"),dt),ht,Es,Mp=(ht=class extends He{constructor(e){super(e)}isActive(){const{whileInView:e,onViewportEnter:n,onViewportLeave:s}=this.state.options;return!!(e||n||s)}startObserver(){var i;const e=this.state.element;if(!e||!this.isActive())return;(i=this.removeObserver)==null||i.call(this);const{once:n,...s}=this.state.options.inViewOptions||{};this.removeObserver=op(e,(a,o)=>{const r=this.state.options;if(this.state.setActive("whileInView",!0),r.onViewportEnter&&ee.postRender(()=>r.onViewportEnter(o)),!n)return()=>{this.state.setActive("whileInView",!1);const l=this.state.options.onViewportLeave;l&&ee.postRender(()=>l(o))}},s)}mount(){this.startObserver()}update(){const{props:e,prevProps:n}=this.state.visualElement;["amount","margin","root"].some(s=>{var i,a;return((i=e.inViewOptions)==null?void 0:i[s])!==((a=n==null?void 0:n.inViewOptions)==null?void 0:a[s])})&&this.startObserver()}unmount(){var e;(e=this.removeObserver)==null||e.call(this),this.removeObserver=void 0}},Es=new WeakMap,Ie(ht,Es,ht.key="inView"),ht);function Pn(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}var ft,$s,Dp=(ft=class extends He{constructor(e){super(e),this.isFocused=!1}onFocus(){let e=!1;try{e=this.state.element.matches(":focus-visible")}catch{e=!0}e&&(this.state.setActive("whileFocus",!0),this.isFocused=!0)}onBlur(){this.isFocused&&(this.state.setActive("whileFocus",!1),this.isFocused=!1)}mount(){const e=this.state.element;this.removeFocus=en(Pn(e,"focus",()=>this.onFocus()),Pn(e,"blur",()=>this.onBlur()))}unmount(){var e;(e=this.removeFocus)==null||e.call(this),this.removeFocus=void 0}},$s=new WeakMap,Ie(ft,$s,ft.key="focus"),ft);function nl(t){if(t)return t.options.allowProjection!==!1?t.projection:nl(t.parent)}const sl={borderRadius:{...Fe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fe,borderTopRightRadius:Fe,borderBottomLeftRadius:Fe,borderBottomRightRadius:Fe,boxShadow:Lr};function zt(t){return typeof t=="object"&&t!==null&&"nodeType"in t}const Vp=typeof window>"u";var pt,Rs,Lp=(pt=class extends He{constructor(e){super(e),Er(sl),Vp||this.initProjection()}initProjection(){const e=this.state.options;this.state.visualElement.projection=new sp(this.state.visualElement.latestValues,e["data-framer-portal-id"]?void 0:nl(this.state.visualElement.parent)),this.projection=this.state.visualElement.projection,this.projection.isPresent=!0,this.setOptions()}setOptions(){var o;const e=this.state.options,{layoutId:n,layout:s,drag:i=!1,dragConstraints:a=!1}=e;(o=this.projection)==null||o.setOptions({layout:s,layoutId:n,alwaysMeasureLayout:!!n||!!i||a&&zt(a),visualElement:this.state.visualElement,animationType:typeof e.layout=="string"?e.layout:"both",layoutRoot:e.layoutRoot,layoutScroll:e.layoutScroll,crossfade:e.crossfade,onExitComplete:()=>{var r;!((r=this.projection)!=null&&r.isPresent)&&this.state.options.layoutId&&!this.state.isExiting&&queueMicrotask(()=>{var l,u;(u=(l=this.state.options.presenceContext)==null?void 0:l.onMotionExitComplete)==null||u.call(l,this.state.presenceContainer,this.state)})}})}update(){this.setOptions()}mount(){var e;(e=this.projection)==null||e.mount(this.state.element)}},Rs=new WeakMap,Ie(pt,Rs,pt.key="projection"),pt);function Kt(t,e,n,s){return Pn(t,e,Cp(n),s)}var No=new Set(["auto","scroll"]),il=class{constructor(t,e,{transformPagePoint:n,contextWindow:s,dragSnapToOrigin:i=!1,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=c=>{this.handleScroll(c.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=ts(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,d=ap(c.offset,{x:0,y:0})>=3;if(!h&&!d)return;const{point:f}=c,{timestamp:p}=fe;this.history.push({...f,timestamp:p});const{onStart:b,onMove:m}=this.handlers;h||(b&&b(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,c)},this.handlePointerMove=(c,h)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=es(h,this.transformPagePoint),ee.update(this.updatePoint,!0)},this.handlePointerUp=(c,h)=>{this.end();const{onEnd:d,onSessionEnd:f,resumeAnimation:p}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=ts(c.type==="pointercancel"?this.lastMoveEventInfo:es(h,this.transformPagePoint),this.history);this.startEvent&&d&&d(c,b),f&&f(c,b)},!tl(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=n,this.contextWindow=s||window;const o=es(Qt(t),this.transformPagePoint),{point:r}=o,{timestamp:l}=fe;this.history=[{...r,timestamp:l}];const{onSessionStart:u}=e;u&&u(t,ts(o,this.history)),this.removeListeners=en(Kt(this.contextWindow,"pointermove",this.handlePointerMove),Kt(this.contextWindow,"pointerup",this.handlePointerUp),Kt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}isScrollable(t){const e=window.getComputedStyle(t);return e.overflow==="auto"||e.overflow==="scroll"||e.overflowX==="auto"||e.overflowX==="scroll"||e.overflowY==="auto"||e.overflowY==="scroll"}startScrollTracking(t){let e=t.parentElement;for(;e;){const n=getComputedStyle(e);(No.has(n.overflowX)||No.has(n.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,s=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-e.x,y:s.y-e.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),ee.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){var t;this.removeListeners&&this.removeListeners(),(t=this.removeScrollListeners)==null||t.call(this),this.scrollPositions.clear(),et(this.updatePoint)}};function es(t,e){return e?{point:e(t.point)}:t}function zo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ts({point:t},e){return{point:t,delta:zo(t,ol(e)),offset:zo(t,Ep(e)),velocity:$p(e,.1)}}function Ep(t){return t[0]}function ol(t){return t[t.length-1]}function $p(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=ol(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>De(e)));)n--;if(!s)return{x:0,y:0};const a=Pe(i.timestamp-s.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-s.x)/a,y:(i.y-s.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Uo(t){return(e,n)=>{t&&ee.postRender(()=>t(e,n))}}var mt,Is,Rp=(mt=class extends He{constructor(...e){super(...e),this.removePointerDownListener=Me}onPointerDown(e){this.session=new il(e,this.createPanHandlers(),{transformPagePoint:this.state.visualElement.getTransformPagePoint(),contextWindow:Kr(this.state.visualElement)})}createPanHandlers(){return{onSessionStart:Uo((e,n)=>{const{onPanSessionStart:s}=this.state.options;s&&s(e,n)}),onStart:Uo((e,n)=>{const{onPanStart:s}=this.state.options;s&&s(e,n)}),onMove:(e,n)=>{const{onPan:s}=this.state.options;s&&s(e,n)},onEnd:(e,n)=>{const{onPanEnd:s}=this.state.options;delete this.session,s&&ee.postRender(()=>s(e,n))}}}mount(){this.removePointerDownListener=Kt(this.state.element,"pointerdown",this.onPointerDown.bind(this))}update(){}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Is=new WeakMap,Ie(mt,Is,mt.key="pan"),mt);function al(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}var qo=al("dragHorizontal"),Ho=al("dragVertical");function Ip(t){let e=!1;if(t==="y")e=Ho();else if(t==="x")e=qo();else{const n=qo(),s=Ho();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function Bp(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?se(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?se(n,t,s.max):Math.min(t,n)),t}const Cs=.35;function Op(t,{top:e,left:n,bottom:s,right:i}){return{x:Ko(t.x,n,i),y:Ko(t.y,e,s)}}function Ko(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Fp(t=Cs){return t===!1?t=0:t===!0&&(t=Cs),{x:Go(t,"left","right"),y:Go(t,"top","bottom")}}function Go(t,e,n){return{min:Wo(t,e),max:Wo(t,n)}}function Wo(t,e){return typeof t=="number"?t:t[e]||0}function jp(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}function Np(t,e){return{x:Yo(t.x,e.x),y:Yo(t.y,e.y)}}function Yo(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function zp(t,e){let n=.5;const s=_e(t),i=_e(e);return i>s?n=Wt(e.min,e.max-s,t.min):s>i&&(n=Wt(t.min,t.max-i,e.min)),Ne(0,1,n)}const Up=new WeakMap;var qp=class{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ce(),this.state=t}get visualElement(){return this.state.visualElement}start(t,{snapToCursor:e=!1}={}){const n=l=>{e?this.stopAnimation():this.pauseAnimation(),e&&this.snapToCursor(Qt(l,"page").point)},s=(l,u)=>{this.stopAnimation();const{drag:c,dragPropagation:h,onDragStart:d}=this.getProps();c&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Ip(c),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ce(f=>{let p=this.getAxisMotionValue(f).get()||0;if(je.test(p)){const{projection:b}=this.visualElement;if(b&&b.layout){const m=b.layout.layoutBox[f];m&&(p=_e(m)*(parseFloat(p)/100))}}this.originPoint[f]=p}),d&&ee.postRender(()=>d(l,u)),ys(this.visualElement,"transform"),this.state.setActive("whileDrag",!0))},i=(l,u)=>{const{dragPropagation:c,dragDirectionLock:h,onDirectionLock:d,onDrag:f}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(h&&this.currentDirection===null){this.currentDirection=Hp(p),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),f&&f(l,u)},a=(l,u)=>this.stop(l,u),o=()=>Ce(l=>{var u;return this.getAnimationState(l)==="paused"&&((u=this.getAxisMotionValue(l).animation)==null?void 0:u.play())}),{dragSnapToOrigin:r}=this.getProps();this.panSession=new il(t,{onSessionStart:n,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:o},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Kr(this.visualElement),element:this.state.element})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&ee.postRender(()=>i(t,e))}cancel(){this.isDragging=!1;const{projection:t}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:e}=this.getProps();!e&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),this.state.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:s}=this.getProps();if(!n||!gn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(a=Bp(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&zt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=Op(n.layoutBox,t):this.constraints=!1,this.elastic=Fp(e),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Ce(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=jp(n.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!zt(t))return!1;const n=t,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=sf(n,s.root,this.visualElement.getTransformPagePoint());let a=Np(s.layout.layoutBox,i);if(e){const o=e(ef(a));this.hasMutatedConstraints=!!o,o&&(a=Cr(o))}return a}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),r=this.constraints||{},l=Ce(u=>{if(!gn(u,e,this.currentDirection))return;let c=r&&r[u]||{};a&&(c={min:0,max:0});const h=s?200:1e6,d=s?40:1e7,f={type:"inertia",velocity:n?t[u]:0,bounceStiffness:h,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(u,f)});return Promise.all(l).then(o)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return ys(this.visualElement,t),n.start(oi(t,n,0,e,this.visualElement,!1))}stopAnimation(){var t;(t=this.visualElement.projection)!=null&&t.isPresent&&Ce(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ce(t=>{var e;return(e=this.getAxisMotionValue(t).animation)==null?void 0:e.pause()})}getAnimationState(t){var e;return(e=this.getAxisMotionValue(t).animation)==null?void 0:e.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Ce(e=>{const{drag:n}=this.getProps();if(!gn(e,n,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(e);if(s&&s.layout){const{min:a,max:o}=s.layout.layoutBox[e];i.set(t[e]-se(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!zt(e)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ce(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const r=o.get();s[a]=zp({min:r,max:r},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.state.element.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ce(a=>{if(!gn(a,t,null))return;const o=this.getAxisMotionValue(a),{min:r,max:l}=this.constraints[a];o.set(se(r,l,s[a]))})}addListeners(){if(!this.state.element)return;Up.set(this.visualElement,this);const t=this.state.element,e=Kt(t,"pointerdown",r=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(r)}),n=()=>{const{dragConstraints:r}=this.getProps();zt(r)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ee.read(n);const a=Pn(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:r,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ce(u=>{const c=this.getAxisMotionValue(u);c&&(this.originPoint[u]+=r[u].translate,c.set(c.get()+r[u].translate))}),this.visualElement.render())});return()=>{a(),e(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=Cs,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function gn(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Hp(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}var gt,Bs,Kp=(gt=class extends He{constructor(e){super(e),this.removeGroupControls=Me,this.removeListeners=Me,this.controls=new qp(e)}mount(){const{dragControls:e}=this.state.options;e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Me}unmount(){this.removeGroupControls(),this.removeListeners()}},Bs=new WeakMap,Ie(gt,Bs,gt.key="drag"),gt),Ft=!1,vt,Os,Gp=(vt=class extends He{constructor(e){super(e),this.hasMountSettled=!1,Er(sl),e.getSnapshot=this.getSnapshot.bind(this),e.didUpdate=this.didUpdate.bind(this)}updatePrevLead(e){const n=e.getStack();n!=null&&n.prevLead&&!n.prevLead.snapshot&&(n.prevLead.willUpdate(),Ft=!0)}didUpdate(){var e,n;Ft&&(this.state.options.layout||this.state.options.layoutId||this.state.options.drag)&&(Ft=!1,(n=(e=this.state.visualElement.projection)==null?void 0:e.root)==null||n.didUpdate())}mount(){var s;const e=this.state.options,n=this.state.options.layoutGroup;if(e.layout||e.layoutId){const i=this.state.visualElement.projection;if(e.layoutId){const a=!el(this.state.element);i.isPresent=a,a?i.promote():i.relegate(),this.updatePrevLead(i)}(s=n==null?void 0:n.group)==null||s.add(i),bn.hasEverUpdated=!0}this.didUpdate(),ee.postRender(()=>{this.hasMountSettled=!0})}unmount(){const e=this.state.options.layoutGroup,n=this.state.visualElement.projection;n&&(e!=null&&e.group&&(this.state.options.layout||this.state.options.layoutId)&&e.group.remove(n),this.state.options.layoutId&&(Ft=!0),this.didUpdate())}getSnapshot(e,n){const s=this.state.visualElement.projection,{drag:i,layoutDependency:a,layout:o,layoutId:r}=e;if(!s||!o&&!r&&!i||!this.hasMountSettled)return;Ft=!0;const l=this.state.options;(i||l.layoutDependency!==a||a===void 0||yi(n)&&s.isPresent!==n)&&s.willUpdate(),yi(n)&&n!==s.isPresent&&(s.isPresent=n,n?(s.promote(),this.updatePrevLead(s)):s.relegate())}},Os=new WeakMap,Ie(vt,Os,vt.key="layout"),vt);const Wp={renderer:kp,features:[Tp,Ap,Pp,Mp,Dp,Lp,Rp,Kp,Gp]},[Yp,vx]=Jt("LazyMotionContext"),[Xp,yx,xx]=Jt("AnimatePresenceContext");function Qp(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function rl(){return{transform:{},transformOrigin:{},style:{},vars:{}}}function Zp(){return{...rl(),attrs:{}}}function Jp(t){const e=rl();ui(e,t);const n={...e.style};for(const s in e.vars)n[s]=e.vars[s];return Object.keys(n).length===0?null:n}function em(t,e,n){const s=Zp();Rr(s,t,Ir(e),void 0,n);const i={};for(const a in s.attrs){const o=ci.has(a)?a:Qp(a);i[o]=s.attrs[a]}return{attrs:i,style:{...s.style,...s.vars}}}function tm(t,e){const n=rp(null),s=up({}),i=hp(),a=Xp({}),o=Yp({features:G({}),strict:!1}),r=gl();function l(){return Ac(t,{layoutGroup:s,presenceContext:a,config:i.value})}function u(){return{...r,...l()}}const c=new vp(u(),n);lp(c),e&&c.initVisualElement(e),be(o.features,f=>{var p;(p=f.features)!=null&&p.length&&Gr(f.features),f.renderer&&c.initVisualElement(f.renderer),c.updateFeatures()},{immediate:!0,flush:"pre"});function h(){var P;const f=c.type==="svg",p={...r};Object.keys(r).forEach(w=>{ye(r[w])&&(p[w]=r[w].get())});const b=((P=c.visualElement)==null?void 0:P.latestValues)||c.latestValues;let m={...t.style,...f?{}:b};for(const w in m)ye(m[w])&&(m[w]=m[w].get());if(f){const{attrs:w,style:E}=em({...b,...m},c.options.as,t.style);Object.assign(p,w),m=E}t.drag&&t.dragListener!==!1&&Object.assign(m,{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`});const g=Jp(m);return g&&(p.style=g),p}const d=vl().proxy;return Mn(()=>{const f=ks(d.$el);c.mount(f)}),Fs(()=>c.beforeUnmount()),sa(()=>{var f;(f=ks(d.$el))!=null&&f.isConnected||c.unmount()}),yl(()=>{c.beforeUpdate(),c.updateOptions(u())}),xl(()=>{c.update()}),{getProps:l,getAttrs:h,layoutGroup:s,state:c}}const nm={ignoreStrict:{type:Boolean},forwardMotionProps:{type:Boolean,default:!1},asChild:{type:Boolean,default:!1},whileDrag:{type:[String,Array,Object]},whileHover:{type:[String,Array,Object]},whilePress:{type:[String,Array,Object]},whileInView:{type:[String,Array,Object]},whileFocus:{type:[String,Array,Object]},custom:{type:[String,Number,Object,Array]},initial:{type:[String,Array,Object,Boolean],default:void 0},animate:{type:[String,Array,Object],default:void 0},exit:{type:[String,Array,Object]},variants:{type:Object},inherit:{type:Boolean},style:{type:Object},transformTemplate:{type:Function},transition:{type:Object},onAnimationComplete:{type:Function},onUpdate:{type:Function},layout:{type:[Boolean,String],default:!1},layoutId:{type:String,default:void 0},layoutScroll:{type:Boolean,default:!1},layoutRoot:{type:Boolean,default:!1},"data-framer-portal-id":{type:String},crossfade:{type:Boolean,default:!0},layoutDependency:{type:null,default:void 0},onBeforeLayoutMeasure:{type:Function},onLayoutMeasure:{type:Function},onLayoutAnimationStart:{type:Function},onLayoutAnimationComplete:{type:Function},globalPressTarget:{type:Boolean},onPressStart:{type:Function},onPress:{type:Function},onPressCancel:{type:Function},onHoverStart:{type:Function},onHoverEnd:{type:Function},inViewOptions:{type:Object},onViewportEnter:{type:Function},onViewportLeave:{type:Function},drag:{type:[Boolean,String]},dragSnapToOrigin:{type:Boolean},dragDirectionLock:{type:Boolean},dragPropagation:{type:Boolean},dragConstraints:{type:[Boolean,Object]},dragElastic:{type:[Boolean,Number,Object],default:.5},dragMomentum:{type:Boolean,default:!0},dragTransition:{type:Object},dragListener:{type:Boolean,default:!0},dragControls:{type:Object},onDragStart:{type:Function},onDragEnd:{type:Function},onDrag:{type:Function},onDirectionLock:{type:Function},onDragTransitionEnd:{type:Function},onMeasureDragConstraints:{type:Function},onPanSessionStart:{type:Function},onPanStart:{type:Function},onPan:{type:Function},onPanEnd:{type:Function}};var sm=new Map,im=new Map;function om(t){if(!Array.isArray(t))return[t];const e=[];for(const n of t)Array.isArray(n)?e.push(...n):e.push(n);return e}var am=["area","img","input"];function rm(t,e,n){var s,i;if(typeof t=="string"&&am.includes(t))return At(t,e);if(t==="template"){if(!n.default)return null;const a=om(n.default()),o=a.findIndex(c=>c.type!==bl);if(o===-1)return a;const r=a[o];(s=r.props)==null||delete s.ref;const l=r.props?ia(e,r.props):e;e.class&&((i=r.props)!=null&&i.class)&&delete r.props.class;const u=wl(r,l);for(const c in l)c.startsWith("on")&&(u.props||(u.props={}),u.props[c]=l[c]);return a.length===1?u:(a[o]=u,a)}return null}function Xo(t,e={}){const n=typeof t=="string",s=n?t:t.name||"",i=e.renderer?sm:im;if(n&&(i!=null&&i.has(t)))return i.get(t);const a=Y({inheritAttrs:!1,props:{...nm,as:{type:[String,Object],default:t||"div"}},name:s?`motion.${s}`:"Motion",setup(o,{slots:r}){const{getProps:l,getAttrs:u,state:c}=tm(o,e.renderer);function h(){const d=c.element;if((typeof o.as!="object"||o.asChild)&&d){const{style:f}=u();if(f)for(const[p,b]of Object.entries(f))d.style[p]=b}}return()=>{const d=l(),f=u(),p=o.asChild?"template":o.as,b={...o.forwardMotionProps?d:{},...f,onVnodeUpdated:h},m=rm(p,b,r);return m!==null?m:At(p,{...b},r)}}});return n&&(i==null||i.set(t,a)),a}function lm(t){const e=t==null?void 0:t.renderer;return Gr((t==null?void 0:t.features)||[]),new Proxy({},{get(n,s){return s==="create"?(i,a)=>Xo(i,{...a,renderer:e}):Xo(s,{renderer:e})}})}const Ps=lm(Wp);Ps.create("div");const di=Y({__name:"Shimmer",props:{as:{default:"p"},class:{},duration:{default:2},spread:{default:2}},setup(t){const e=t,n=_l(),s=L(()=>{var u;const l=(u=n.default)==null?void 0:u.call(n);return!l||l.length===0?"":l.map(c=>typeof c.children=="string"?c.children:"").join("")}),i=L(()=>{var l;return(((l=s.value)==null?void 0:l.length)??0)*e.spread}),a=L(()=>Sl("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",e.class)),o=L(()=>({"--spread":`${i.value}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"})),r=L(()=>Ps[e.as]||Ps.p);return(l,u)=>(x(),K(oa(r.value),{class:ae(a.value),style:Dt(o.value),initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:Number.POSITIVE_INFINITY,duration:l.duration,ease:"linear"}},{default:A(()=>[Tl(l.$slots,"default")]),_:3},8,["class","style","transition"]))}});function ll(t){const e=L(()=>{const a=[];for(const o of t.value){if(o.role!=="assistant")continue;(o.blocks||[]).forEach((l,u)=>{const c=`${o.id}-attachment-${u}`;if(l.kind==="code")a.push({id:c,messageId:o.id,type:"code",language:l.language,code:l.code});else if(l.kind==="source")a.push({id:c,messageId:o.id,type:"source",url:l.url,title:l.title,filename:l.filename,mediaType:l.mediaType});else if(l.kind==="tool"&&(l.toolName==="export_query_result"||l.toolName==="export_content")){const h=l.result;h!=null&&h.filename&&h.content!==void 0&&a.push({id:c,messageId:o.id,type:"file",filename:h.filename,result:h})}})}return a}),n=L(()=>e.value.filter(a=>a.type==="file")),s=L(()=>e.value.filter(a=>a.type==="code")),i=L(()=>e.value.filter(a=>a.type==="source"));return{attachments:e,files:n,codes:s,sources:i}}function um(t){const e=window.atob(t),n=new Uint8Array(e.length);for(let s=0;s<e.length;s+=1)n[s]=e.charCodeAt(s);return n}function hi(){return{downloadFile:async e=>{if(e.error)return Bn.error(e.error),!1;try{const n=e.encoding==="base64"?new Blob([um(e.content)],{type:e.mimeType}):new Blob([e.content],{type:e.mimeType}),s=URL.createObjectURL(n),i=document.createElement("a");return i.href=s,i.download=e.filename,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s),Bn.success(`Downloaded ${e.filename}`),!0}catch(n){const s=n instanceof Error?n.message:"Failed to download export file.";return Bn.error(s),!1}}}}const cm={class:"whitespace-pre-wrap leading-normal chat-text"},dm=Y({__name:"BlockMessageText",props:{content:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean},isUserMessage:{type:Boolean}},setup(t){const e=t,n=L(()=>!!(e.isBlockStreaming&&e.isStreaming)),s=js(Gt(e,"content"),n);return(i,a)=>(x(),T("p",cm,M(_(s)),1))}});class fi{constructor(e){We(this,"options");We(this,"tokensStable",[]);We(this,"tokensUnstable",[]);We(this,"lastUnstableCodeChunk","");We(this,"lastStableGrammarState");this.options=e}async enqueue(e){const n=(this.lastUnstableCodeChunk+e).split(`
|
|
3
|
+
`),s=[];let i=[];const a=this.tokensUnstable.length;return n.forEach((o,r)=>{const l=r===n.length-1,u=this.options.highlighter.codeToTokens(o,{...this.options,grammarState:this.lastStableGrammarState}),c=u.tokens[0];l||c.push({content:`
|
|
4
|
+
`,offset:0}),l?(i=c,this.lastUnstableCodeChunk=o):(this.lastStableGrammarState=u.grammarState,s.push(...c))}),this.tokensStable.push(...s),this.tokensUnstable=i,{recall:a,stable:s,unstable:i}}close(){const e=this.tokensUnstable;return this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0,{stable:e}}clear(){this.tokensStable=[],this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0}clone(){const e=new fi(this.options);return e.lastUnstableCodeChunk=this.lastUnstableCodeChunk,e.tokensUnstable=this.tokensUnstable,e.tokensStable=this.tokensStable,e.lastStableGrammarState=this.lastStableGrammarState,e}}class hm extends TransformStream{constructor(n){const s=new fi(n),{allowRecalls:i=!1}=n;super({async transform(a,o){const{stable:r,unstable:l,recall:u}=await s.enqueue(a);i&&u>0&&o.enqueue({recall:u});for(const c of r)o.enqueue(c);if(i)for(const c of l)o.enqueue(c)},async flush(a){const{stable:o}=s.close();if(!i)for(const r of o)a.enqueue(r)}});We(this,"tokenizer");We(this,"options");this.tokenizer=s,this.options=n}}function fm(t){return!t||Object(t)!==t}const pm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function mm(t=16,e=pm){let n="",s=t;const i=e.length;for(;s--;)n+=e[Math.random()*i|0];return n}const ns=new WeakMap;function gm(t){return fm(t)?t:(ns.has(t)||ns.set(t,mm()),ns.get(t))}const vm=Y({name:"ShikiStreamRenderer",props:{stream:{type:Object,required:!0}},emits:["stream-start","stream-end"],setup(t,{emit:e}){const n=Al([]);let s=null;return be(()=>t.stream,i=>{n.length=0,s&&s.abort(),s=new AbortController;const a=s.signal;let o=!1;i.pipeTo(new WritableStream({write(r){a.aborted||(o||(o=!0,e("stream-start")),"recall"in r?n.length-=r.recall:n.push(r))},close:()=>{a.aborted||e("stream-end")},abort:()=>{a.aborted||e("stream-end")}}),{signal:a}).catch(r=>{r.name!=="AbortError"&&console.error("Stream error:",r)})},{immediate:!0}),()=>At("pre",{class:"shiki shiki-stream"},At("code",Se(n,i=>At("span",{key:gm(i),style:i.htmlStyle||au(i)},i.content))))}}),ym=Y({name:"ShikiCachedRenderer",props:{code:{type:String,required:!0},lang:{type:String,required:!0},theme:{type:String,required:!0},highlighter:{type:Object,required:!0}},emits:["stream-start","stream-end"],setup(t,{emit:e}){const n=G(0);let s=null;const i=new ReadableStream({start(o){s=o}});kl(()=>{t.code.length>n.value&&(s==null||s.enqueue(t.code.slice(n.value)),n.value=t.code.length)});const a=i.pipeThrough(new hm({highlighter:t.highlighter,lang:t.lang,theme:t.theme,allowRecalls:!0}));return()=>At(vm,{stream:a,onStreamStart:()=>e("stream-start"),onStreamEnd:()=>e("stream-end")})}});let jt=null,ss=null;const xm=new Set,bm=[ke(()=>import("./B9xm8XSJ.js"),[],import.meta.url),ke(()=>import("./DWgjNKGq.js").then(t=>t.f),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./DWgjNKGq.js").then(t=>t.e),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./Yzrsuije.js"),[],import.meta.url),ke(()=>import("./DWgjNKGq.js").then(t=>t.m),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./fuZLfV_i.js"),[],import.meta.url),ke(()=>import("./DWgjNKGq.js").then(t=>t.x),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./DWgjNKGq.js").then(t=>t.y),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./DWgjNKGq.js").then(t=>t.h),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./DWgjNKGq.js").then(t=>t.j),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./DlfHMoPT.js"),[],import.meta.url)],wm=async t=>{if(ss||(ss=ru({langs:bm,themes:[uu,cu],engine:lu()})),jt||(jt=await ss),t!=null&&t.length){const e=jt.getLoadedLanguages();await Promise.all(t.filter(n=>!e.includes(n)).map(n=>jt.loadLanguage(n).catch(()=>{xm.add(n),console.warn(`[useHighlighter] Unknown language: "${n}" — will render as plain text`)})))}return jt},_m={class:"rounded-xl border overflow-hidden shadow-sm"},Sm={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},Tm={class:"text-xxs font-semibold capitalize text-muted-foreground select-none"},km={class:"flex items-center gap-1 justify-center"},Am={class:"overflow-x-auto px-3 py-2 chat-code-text"},Cm={key:1,class:"m-0"},$n=Y({__name:"BlockMessageCode",props:{id:{},code:{},language:{},class:{},meta:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean}},setup(t){const e=aa(),n=G(null),s=t;be(()=>s.language,async p=>{n.value=await wm([p])},{immediate:!0});const{handleCopyWithKey:i,isCopied:a,getCopyIcon:o,getCopyIconClass:r,getCopyTooltip:l}=Ns(),u=L(()=>!!(s.isBlockStreaming&&s.isStreaming)),c=js(Gt(s,"code"),u),h=L(()=>{switch(s.language){case"markdown":return"markdown";case"csv":return"csv";case"json":return"json";case"javascript":return"js";case"typescript":return"ts";case"postgresql":case"mysql":case"sql":case"plsql":case"sqlpl":case"sqlserver":return"sql";default:return"text"}}),d=L(()=>c.value.trim().replace(/`+$/,"")),f=L(()=>`${h.value}-${e.value}`);return(p,b)=>{const m=de,g=ve;return x(),T("div",_m,[y("div",Sm,[y("span",Tm,M(s.language),1),v(_(Dn),null,{default:A(()=>[v(_(Vn),{"as-child":""},{default:A(()=>[v(g,{variant:"ghost",size:"xxs",class:"h-6!",onClick:b[0]||(b[0]=P=>_(i)(p.id,p.code))},{default:A(()=>[y("span",km,[(x(),K(m,{key:_(a)(p.id)?"tick":"copy",name:_(o)(_(a)(p.id)),class:ae(["size-3.5",_(r)(_(a)(p.id))])},null,8,["name","class"])),_(a)(p.id)?(x(),T("span",{key:0,class:ae(["text-[10px] font-medium leading-none",_(r)(_(a)(p.id))])}," Copied ",2)):H("",!0)])]),_:1})]),_:1}),v(_(Ln),null,{default:A(()=>[y("p",null,M(_(l)(_(a)(p.id))),1)]),_:1})]),_:1})]),y("div",Am,[n.value?(x(),K(_(ym),{key:f.value,highlighter:n.value,code:d.value,lang:h.value,theme:_(e).value==="dark"?"catppuccin-mocha":"catppuccin-latte"},null,8,["highlighter","code","lang","theme"])):(x(),T("pre",Cm,[y("code",null,M(d.value),1)]))])])}}}),Pm={class:"rounded-xl border overflow-hidden shadow-sm"},Mm={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},Dm={class:"flex items-center gap-0.5"},Vm={class:"flex items-center gap-1 justify-center"},Lm={key:0,class:"text-[10px] font-medium leading-none"},Em={key:0,class:"overflow-auto bg-background max-h-[400px] p-4"},$m={key:0,class:"text-destructive text-sm p-2 bg-destructive/10 rounded"},Rm=["innerHTML"],Im={key:1,class:"overflow-x-auto px-3 py-2 chat-code-text"},Bm={class:"m-0"},Om={key:0,class:"fixed inset-0 z-50 bg-background flex flex-col"},Fm={class:"flex items-center justify-between px-4 py-2 border-b border-border"},jm={class:"flex items-center gap-2"},Nm={class:"flex items-center gap-1"},zm={key:0,class:"flex-1 overflow-auto p-6"},Um={key:0,class:"text-destructive text-sm p-2 bg-destructive/10 rounded"},qm=["innerHTML"],Hm={key:1,class:"flex-1 overflow-auto px-4 py-3 chat-code-text"},Km={class:"m-0"},Gm=Y({__name:"BlockMessageMermaid",props:{id:{},code:{}},setup(t){const e=t,n=G(null),s=G(null),i=G(null),a=G(null),{handleCopyWithKey:o,isCopied:r,getCopyIcon:l,getCopyIconClass:u,getCopyTooltip:c}=Ns();let h=0;const d=async()=>{if(e.code.trim())try{i.value=null;const{default:m}=await ke(async()=>{const{default:w}=await import("./D4jn2f-6.js").then(E=>E.bf);return{default:w}},__vite__mapDeps([3,1,2]),import.meta.url);m.initialize({startOnLoad:!1,theme:aa().value==="dark"?"dark":"default",securityLevel:"strict",fontFamily:"inherit"}),h+=1;const g=`mermaid-${e.id}-${h}`,{svg:P}=await m.render(g,e.code.trim());a.value=P}catch(m){i.value=m instanceof Error?m.message:"Failed to render diagram",a.value=null}};Mn(d),be(()=>e.code,d);const f=G(!1),p=G(!1),b=()=>{f.value=!f.value};return(m,g)=>{const P=de,w=ve,E=Vn,D=Ln,V=Dn;return x(),T(re,null,[y("div",Pm,[y("div",Mm,[g[4]||(g[4]=y("span",{class:"text-xxs font-semibold capitalize text-muted-foreground select-none"}," Mermaid ",-1)),y("div",Dm,[v(V,null,{default:A(()=>[v(E,{"as-child":""},{default:A(()=>[v(w,{variant:"ghost",size:"iconSm",onClick:g[0]||(g[0]=k=>p.value=!p.value)},{default:A(()=>[v(P,{name:p.value?"hugeicons:eye":"hugeicons:source-code",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),v(D,null,{default:A(()=>[N(M(p.value?"Show diagram":"Show source"),1)]),_:1})]),_:1}),v(V,null,{default:A(()=>[v(E,{"as-child":""},{default:A(()=>[v(w,{variant:"ghost",size:"iconSm",class:"w-[unset]",onClick:g[1]||(g[1]=k=>_(o)(m.id,m.code))},{default:A(()=>[y("span",Vm,[(x(),K(P,{key:_(r)(m.id)?"tick":"copy",name:_(l)(_(r)(m.id)),class:ae(["size-4",_(u)(_(r)(m.id))])},null,8,["name","class"])),_(r)(m.id)?(x(),T("span",Lm," Copied ")):H("",!0)])]),_:1})]),_:1}),v(D,null,{default:A(()=>[N(M(_(c)(_(r)(m.id))),1)]),_:1})]),_:1}),v(V,null,{default:A(()=>[v(E,{"as-child":""},{default:A(()=>[v(w,{variant:"ghost",size:"iconSm",onClick:b},{default:A(()=>[v(P,{name:f.value?"hugeicons:arrow-shrink-02":"hugeicons:arrow-expand-02",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),v(D,null,{default:A(()=>[N(M(f.value?"Exit full view":"Full view"),1)]),_:1})]),_:1})])]),p.value?(x(),T("div",Im,[y("pre",Bm,[y("code",null,M(m.code),1)])])):(x(),T("div",Em,[i.value?(x(),T("div",$m,M(i.value),1)):a.value?(x(),T("div",{key:1,ref_key:"containerRef",ref:n,class:"flex items-center justify-center [&>svg]:max-w-full",innerHTML:a.value},null,8,Rm)):H("",!0)]))]),(x(),K(ra,{to:"body"},[f.value?(x(),T("div",Om,[y("div",Fm,[y("div",jm,[v(P,{name:"hugeicons:chart-relationship",class:"size-4 text-primary"}),g[5]||(g[5]=y("span",{class:"text-sm font-medium"},"Mermaid Diagram",-1))]),y("div",Nm,[v(V,null,{default:A(()=>[v(E,{"as-child":""},{default:A(()=>[v(w,{variant:"ghost",size:"xxs",class:"h-7!",onClick:g[2]||(g[2]=k=>p.value=!p.value)},{default:A(()=>[v(P,{name:p.value?"hugeicons:eye":"hugeicons:source-code",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),v(D,null,{default:A(()=>[N(M(p.value?"Show diagram":"Show source"),1)]),_:1})]),_:1}),v(V,null,{default:A(()=>[v(E,{"as-child":""},{default:A(()=>[v(w,{variant:"ghost",size:"iconSm",onClick:g[3]||(g[3]=k=>_(o)(m.id,m.code))},{default:A(()=>[v(P,{name:_(l)(_(r)(m.id)),class:ae(["size-4",_(u)(_(r)(m.id))])},null,8,["name","class"])]),_:1})]),_:1}),v(D,null,{default:A(()=>[N(M(_(c)(_(r)(m.id))),1)]),_:1})]),_:1}),v(w,{variant:"ghost",size:"iconSm",onClick:b},{default:A(()=>[v(P,{name:"hugeicons:arrow-shrink-02",class:"size-4"})]),_:1})])]),p.value?(x(),T("div",Hm,[y("pre",Km,[y("code",null,M(m.code),1)])])):(x(),T("div",zm,[i.value?(x(),T("div",Um,M(i.value),1)):a.value?(x(),T("div",{key:1,ref_key:"fullscreenContainerRef",ref:s,class:"flex items-center justify-center [&>svg]:max-w-full [&>svg]:max-h-full",innerHTML:a.value},null,8,qm)):H("",!0)]))])):H("",!0)]))],64)}}}),Wm={class:"flex items-center gap-2 text-muted-foreground chat-text"},Ym=Y({__name:"BlockMessageLoading",props:{label:{}},setup(t){return(e,n)=>{const s=de;return x(),T("div",Wm,[v(s,{name:"hugeicons:loading-03",class:"size-4 animate-spin"}),v(di,null,{default:A(()=>[N(M(e.label||"Generating summary..."),1)]),_:1})])}}}),Xm={class:"rounded-xl py-2 text-destructive"},Qm=Y({__name:"BlockMessageError",props:{message:{}},setup(t){return(e,n)=>(x(),T("div",Xm,M(e.message),1))}}),Zm={key:1,class:"rounded-2xl border bg-muted/40"},Jm={class:"overflow-x-auto px-3 py-3 leading-6 chat-code-text"},eg=Y({__name:"BlockMessageTool",props:{toolName:{},result:{},getToolComponent:{type:Function}},setup(t){const e=t,n=L(()=>e.getToolComponent(e.toolName)),s=i=>JSON.stringify(i,null,2);return(i,a)=>_(n)?(x(),K(oa(_(n)),{key:0,data:i.result},null,8,["data"])):(x(),T("div",Zm,[y("pre",Jm,M(s(i.result)),1)]))}}),tg={class:"inline-flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-xs"},ng={class:"min-w-0 flex-1"},sg=["href"],ig={key:1,class:"truncate font-medium text-foreground"},og={key:2,class:"ml-2 text-xxs text-muted-foreground"},ag=Y({__name:"BlockMessageSource",props:{sourceId:{},url:{},title:{},mediaType:{},filename:{}},setup(t){return(e,n)=>{const s=de;return x(),T("div",tg,[v(s,{name:e.url?"hugeicons:link-02":"hugeicons:file-02",class:"size-3.5 shrink-0 text-muted-foreground"},null,8,["name"]),y("div",ng,[e.url?(x(),T("a",{key:0,href:e.url,target:"_blank",rel:"noopener noreferrer",class:"truncate font-medium text-primary hover:underline"},M(e.title||e.url),9,sg)):(x(),T("span",ig,M(e.title||e.filename||"Source document"),1)),e.mediaType?(x(),T("span",og,M(e.mediaType),1)):H("",!0)])])}}}),rg={key:0,class:"flex items-center gap-2 rounded-xl border border-border/60 bg-muted/30 px-3 py-2"},lg={class:"text-xs text-muted-foreground truncate"},ug={key:1,class:"rounded-2xl border border-border/70 bg-background/80 overflow-hidden"},cg={class:"px-4 pt-4"},dg={class:"flex items-center justify-between gap-2 mb-2"},hg={class:"flex items-center gap-2 min-w-0"},fg=["title"],pg={class:"shrink-0 text-[11px] text-muted-foreground"},mg={class:"h-0.5 rounded-full bg-muted overflow-hidden"},gg={class:"px-4 py-3"},vg={class:"text-sm leading-relaxed"},yg={key:0,class:"text-destructive ml-0.5","aria-label":"required"},xg={key:1,class:"flex flex-col gap-3 py-1"},bg=["value","placeholder"],wg={class:"px-4 pb-4 flex items-center justify-between gap-2"},_g={key:1},Sg={class:"flex items-center gap-1.5"},Tg=Y({__name:"BlockMessageQuiz",props:{toolCallId:{},context:{},questions:{}},emits:["submit"],setup(t,{emit:e}){const n=t,s=e,i=G({}),a=G(0),o=G(!1),r=L(()=>n.questions[a.value]),l=L(()=>a.value===n.questions.length-1),u=L(()=>n.questions.every(V=>!V.required||d(V.id))),c=G("");function h(){if(!r.value)return;const V=i.value[r.value.id];c.value=typeof V=="string"?V:""}function d(V){const k=i.value[V];return Array.isArray(k)?k.length>0:!!(k!=null&&k.trim())}function f(V){const k=r.value;if(!k)return!1;const S=i.value[k.id];return k.type==="multiple"?Array.isArray(S)&&S.includes(V):S===V}function p(V){const k=r.value;if(k){if(k.type==="single")i.value={...i.value,[k.id]:V},c.value="";else if(k.type==="multiple"){const S=i.value[k.id]??[],B=S.includes(V)?S.filter($=>$!==V):[...S,V];i.value={...i.value,[k.id]:B}}}}function b(V){const k=r.value;if(!k)return;const S=V.target.value;c.value=S,i.value={...i.value,[k.id]:S}}function m(){a.value>0&&(a.value--,h())}function g(){l.value?E():(a.value++,h())}function P(){l.value?E():(a.value++,h())}function w(){return`[Quiz answers] ${n.questions.filter(k=>d(k.id)).map(k=>{const S=i.value[k.id],B=Array.isArray(S)?S.join(", "):S;return`${k.id}: ${B}`}).join(" | ")}`}function E(){u.value&&(o.value=!0,s("submit",w()))}const D=L(()=>n.questions.filter(V=>d(V.id)).map(V=>{const k=i.value[V.id];return Array.isArray(k)?k.join(", "):k}).join(" · "));return(V,k)=>{var $;const S=de,B=ve;return o.value?(x(),T("div",rg,[v(S,{name:"lucide:check-circle-2",class:"size-3.5 shrink-0 text-primary"}),y("span",lg,[k[2]||(k[2]=y("span",{class:"font-medium text-foreground"},"Answered",-1)),D.value?(x(),T(re,{key:0},[N(" · "+M(D.value),1)],64)):H("",!0)])])):V.questions.length>0?(x(),T("div",ug,[y("div",cg,[y("div",dg,[y("div",hg,[v(_(Te),{variant:"outline",class:"text-xs px-1"},{default:A(()=>[v(S,{name:"lucide:help-circle",class:"size-3 text-primary"}),k[3]||(k[3]=N(" Clarification "))]),_:1}),V.context?(x(),T("span",{key:0,class:"text-xs text-muted-foreground truncate",title:V.context},M(V.context),9,fg)):H("",!0)]),y("span",pg,M(a.value+1)+" / "+M(V.questions.length),1)]),y("div",mg,[y("div",{class:"h-full rounded-full bg-primary transition-all duration-300",style:Dt({width:`${(a.value+1)/V.questions.length*100}%`})},null,4)])]),y("div",gg,[v(Zt,{name:"quiz-slide",mode:"out-in"},{default:A(()=>{var U;return[r.value?(x(),T("div",{key:r.value.id,class:"space-y-3"},[y("p",vg,[N(M(r.value.question)+" ",1),r.value.required?(x(),T("span",yg,"*")):H("",!0)]),(U=r.value.suggestions)!=null&&U.length?(x(),T(re,{key:0},[r.value.type==="single"?(x(),K(_(Si),{key:0,"model-value":i.value[r.value.id],"onUpdate:modelValue":k[0]||(k[0]=F=>p(String(F))),class:"flex flex-col gap-3 py-1"},{default:A(()=>[(x(!0),T(re,null,Se(r.value.suggestions,F=>(x(),T("div",{key:F,class:"flex items-center space-x-2"},[v(_(Ti),{id:F,value:F},null,8,["id","value"]),v(_(On),{for:F,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:A(()=>[N(M(F),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"])):r.value.type==="multiple"?(x(),T("div",xg,[(x(!0),T(re,null,Se(r.value.suggestions,F=>(x(),T("div",{key:F,class:"flex items-center space-x-2"},[v(_(fu),{id:F,checked:f(F),"onUpdate:checked":te=>p(F)},null,8,["id","checked","onUpdate:checked"]),v(_(On),{for:F,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:A(()=>[N(M(F),1)]),_:2},1032,["for"])]))),128))])):(x(),K(_(Si),{key:2,"model-value":i.value[r.value.id],"onUpdate:modelValue":k[1]||(k[1]=F=>p(String(F))),class:"flex flex-col gap-3 py-1"},{default:A(()=>[(x(!0),T(re,null,Se(r.value.suggestions,F=>(x(),T("div",{key:F,class:"flex items-center space-x-2"},[v(_(Ti),{id:F,value:F},null,8,["id","value"]),v(_(On),{for:F,class:"cursor-pointer text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:A(()=>[N(M(F),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"]))],64)):H("",!0),y("input",{value:c.value,type:"text",class:"w-full rounded-lg border border-border bg-muted/30 px-3 py-1.5 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary/40 focus:border-primary/50 transition-all",placeholder:r.value.type==="open"?"Type your answer…":"Or type a custom answer…",onInput:b},null,40,bg)])):H("",!0)]}),_:1})]),y("div",wg,[a.value>0?(x(),K(B,{key:0,variant:"ghost",size:"sm",class:"text-xs h-7",onClick:m},{default:A(()=>[v(S,{name:"lucide:arrow-left",class:"size-3 mr-1"}),k[4]||(k[4]=N(" Back "))]),_:1})):(x(),T("div",_g)),y("div",Sg,[!(($=r.value)!=null&&$.required)&&!l.value?(x(),K(B,{key:0,variant:"ghost",size:"xs",onClick:P},{default:A(()=>k[5]||(k[5]=[N(" Skip ")])),_:1})):H("",!0),v(B,{size:"xs",disabled:l.value&&!u.value,onClick:g},{default:A(()=>[N(M(l.value?"Submit":"Next")+" ",1),l.value?(x(),K(S,{key:1,name:"lucide:send",class:"size-3 ml-1"})):(x(),K(S,{key:0,name:"lucide:arrow-right",class:"size-3 ml-1"}))]),_:1},8,["disabled"])])])])):H("",!0)}}}),kg=la(Tg,[["__scopeId","data-v-2b68c703"]]),Ag={class:"flex h-full flex-col bg-sidebar/50 z-50 p-2 gap-2"},Cg={class:"flex shrink-0 items-center justify-between gap-2"},Pg={class:"flex items-center min-w-0 gap-1 flex-1"},Mg={class:"text-xs"},Dg={class:"flex-1 overflow-hidden flex flex-col min-h-0 relative mt-2"},Vg={class:"flex-1 min-h-0 overflow-y-auto w-full relative"},Lg={key:0,class:"absolute inset-0 flex items-center justify-center p-6 z-10"},Eg={class:"space-y-2"},$g=["onClick"],Rg={class:"min-w-0 flex-1"},Ig={class:"text-xs font-medium truncate"},Bg={class:"flex items-center gap-2"},Og={class:"min-w-0 flex-1"},Fg={class:"flex flex-wrap gap-1.5 text-xs"},jg={class:"flex-1 overflow-y-auto px-4 space-y-4"},Ng={key:0,class:"space-y-2"},zg={key:0,class:"bg-muted/50 p-3 rounded-md overflow-x-auto whitespace-pre-wrap font-mono border chat-code-text"},Ug={key:1,class:"flex flex-col items-center justify-center p-5 bg-muted/20 rounded-md border border-dashed min-h-[140px]"},qg={key:1,class:"text-sm"},Hg={key:2,class:"flex flex-col gap-3 p-3 bg-muted/30 rounded-md border"},Kg={class:"text-xs font-medium"},Gg={key:0,class:"text-xs text-primary break-all flex items-center gap-1"},Wg=["href"],Yg={key:1,class:"text-xs text-muted-foreground"},Xg={class:"flex gap-2"},Qg=Y({__name:"AgentAttachmentPanel",props:{messages:{}},emits:["close"],setup(t,{emit:e}){const n=t,s=e,i=L(()=>n.messages),{attachments:a,files:o,codes:r,sources:l}=ll(i),{downloadFile:u}=hi(),c=G("all"),h=k=>({type:"file",id:k.id,name:k.filename,description:"Exported File",icon:"hugeicons:file-02",data:k.result}),d=k=>({type:"source",id:k.id,name:k.title||k.filename||k.url,description:k.url||"Link & Resources",icon:"hugeicons:link-square-02",data:k}),f=k=>({type:"code",id:k.id,name:k.language?`Snippet (${k.language})`:"Snippet",description:"Code Snippet",icon:"hugeicons:code-circle",data:k}),p=L(()=>({all:[...o.value.map(h),...l.value.map(d),...r.value.map(f)],files:o.value.map(h),code:r.value.map(f),links:l.value.map(d)})),b=L(()=>p.value[c.value]||[]),m=G(!1),g=G(null),P=k=>{if(k==null)return"—";if(k<1024)return`${k} B`;const S=["KB","MB","GB","TB"];let B=k/1024,$=0;for(;B>=1024&&$<S.length-1;)B/=1024,$+=1;return`${B.toFixed(B>=10?0:1)} ${S[$]}`},w=L(()=>g.value?g.value.type==="file"?"File":g.value.type==="code"?"Code":"Link":""),E=L(()=>{var k,S;return((k=g.value)==null?void 0:k.type)==="source"&&!!((S=g.value.data)!=null&&S.url)}),D=k=>{g.value=k,m.value=!0},V=async k=>{var S;if(k)if(k.type==="file")await u(k.data);else if(k.type==="code"){const B=k.data.code,$=new Blob([B],{type:"text/plain"}),U=URL.createObjectURL($),F=document.createElement("a");F.href=U,F.download=`snippet-${k.id.substring(0,6)}.${k.data.language||"txt"}`,F.click(),URL.revokeObjectURL(U)}else k.type==="source"&&(S=k.data)!=null&&S.url&&window.open(k.data.url,"_blank","noopener,noreferrer")};return(k,S)=>{const B=de,$=Cl;return x(),T("div",Ag,[y("div",Cg,[y("div",Pg,[v(B,{name:"hugeicons:attachment",class:"size-4"}),S[6]||(S[6]=y("h3",{class:"text-sm font-semibold text-foreground"},"Attachments",-1)),y("p",Mg,M(_(a).length),1)]),v(_(ve),{size:"iconMd",variant:"ghost",onClick:S[0]||(S[0]=U=>s("close"))},{default:A(()=>[v(B,{name:"lucide:x",class:"size-4"})]),_:1})]),y("div",Dg,[v(_(su),{modelValue:c.value,"onUpdate:modelValue":S[1]||(S[1]=U=>c.value=U),class:"flex-1 min-h-0"},{default:A(()=>[v(_(iu),{class:"h-8"},{default:A(()=>[v(_(cn),{value:"all",class:"text-xs cursor-pointer"},{default:A(()=>S[7]||(S[7]=[N("All")])),_:1}),v(_(cn),{value:"files",class:"text-xs cursor-pointer"},{default:A(()=>S[8]||(S[8]=[N("Files")])),_:1}),v(_(cn),{value:"code",class:"text-xs cursor-pointer"},{default:A(()=>S[9]||(S[9]=[N("Code")])),_:1}),v(_(cn),{value:"links",class:"text-xs cursor-pointer"},{default:A(()=>S[10]||(S[10]=[N("Links")])),_:1})]),_:1}),y("div",Vg,[b.value.length===0?(x(),T("div",Lg,[v($,{title:"No items found",desc:"Add an attachment to see it here."})])):H("",!0),(x(),T(re,null,Se(["all","files","code","links"],U=>v(_(ou),{key:U,value:U,class:"h-full mt-0 focus-visible:ring-0"},{default:A(()=>[y("div",Eg,[(x(!0),T(re,null,Se(p.value[U],F=>(x(),T("div",{key:F.id,class:"p-2 px-3 border rounded-lg bg-card hover:bg-accent/50 transition-colors flex items-center gap-2 cursor-pointer group",onClick:te=>D(F)},[v(B,{name:F.icon,class:"size-5!"},null,8,["name"]),y("div",Rg,[y("p",Ig,M(F.name),1),y("p",{class:ae(["text-xxs text-muted-foreground truncate",F.type==="source"?"text-primary/70":""])},M(F.description),3)]),v(B,{name:"hugeicons:view",class:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground"})],8,$g))),128))])]),_:2},1032,["value"])),64))])]),_:1},8,["modelValue"])]),v(_(Pl),{open:m.value,"onUpdate:open":S[5]||(S[5]=U=>m.value=U)},{default:A(()=>[v(_(Ml),{class:"max-w-[50vw]! w-full max-h-[70vh] p-0 flex flex-col overflow-hidden"},{default:A(()=>{var U,F,te;return[v(_(Dl),{class:"p-4 pb-2 text-left"},{default:A(()=>{var C;return[y("div",Bg,[v(B,{name:((C=g.value)==null?void 0:C.icon)||"hugeicons:file-02",class:"size-5!"},null,8,["name"]),y("div",Og,[v(_(Vl),{class:"truncate flex items-center gap-2"},{default:A(()=>{var I,z,W,X,q,Q;return[N(M(((I=g.value)==null?void 0:I.name)||"Attachment Preview")+" ",1),y("div",Fg,[v(_(Te),{variant:"secondary",class:"h-5 px-1.5"},{default:A(()=>[N(M(w.value),1)]),_:1}),((z=g.value)==null?void 0:z.type)==="file"?(x(),K(_(Te),{key:0,variant:"outline",class:"h-5 px-1.5"},{default:A(()=>[N(M(g.value.data.format||"file"),1)]),_:1})):H("",!0),((W=g.value)==null?void 0:W.type)==="file"?(x(),K(_(Te),{key:1,variant:"outline",class:"h-5 px-1.5"},{default:A(()=>[N(M(P(g.value.data.fileSize)),1)]),_:1})):H("",!0),((X=g.value)==null?void 0:X.type)==="code"?(x(),K(_(Te),{key:2,variant:"outline",class:"h-5 px-1.5"},{default:A(()=>[N(M(g.value.data.language||"text"),1)]),_:1})):H("",!0),((q=g.value)==null?void 0:q.type)==="source"&&((Q=g.value.data)!=null&&Q.mediaType)?(x(),K(_(Te),{key:3,variant:"outline",class:"h-5 px-1.5"},{default:A(()=>[N(M(g.value.data.mediaType),1)]),_:1})):H("",!0)])]}),_:1}),v(_(Ll),{class:"text-sm"},{default:A(()=>S[11]||(S[11]=[N(" Preview attachment details and content. ")])),_:1})])])]}),_:1}),y("div",jg,[((U=g.value)==null?void 0:U.type)==="file"?(x(),T("div",Ng,[g.value.data.encoding==="utf8"?(x(),T("div",zg,M(g.value.data.content),1)):(x(),T("div",Ug,[v(B,{name:"hugeicons:file-unknown",class:"size-12 text-muted-foreground/50 mb-3"}),S[12]||(S[12]=y("p",{class:"text-foreground text-sm font-medium"}," Binary file format ",-1)),S[13]||(S[13]=y("p",{class:"text-xs text-muted-foreground text-center mt-1"}," Preview is not available for this file type. Download to view. ",-1))]))])):((F=g.value)==null?void 0:F.type)==="code"?(x(),T("div",qg,[v(_($n),{id:g.value.data.id,code:g.value.data.code,language:g.value.data.language,"is-streaming":!1,"is-block-streaming":!1},null,8,["id","code","language"])])):((te=g.value)==null?void 0:te.type)==="source"?(x(),T("div",Hg,[y("div",null,[S[14]||(S[14]=y("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," Title ",-1)),y("p",Kg,M(g.value.data.title||g.value.data.filename||"Untitled Resource"),1)]),y("div",null,[S[15]||(S[15]=y("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," URL ",-1)),g.value.data.url?(x(),T("p",Gg,[y("a",{href:g.value.data.url,target:"_blank",class:"hover:underline"},M(g.value.data.url),9,Wg),v(B,{name:"hugeicons:link-square-02",class:"size-3 shrink-0"})])):(x(),T("p",Yg," No URL provided. "))])])):H("",!0)]),v(_(El),{class:"p-4 flex justify-end pt-0"},{default:A(()=>{var C;return[v(_(ve),{variant:"outline",size:"sm",onClick:S[2]||(S[2]=I=>m.value=!1)},{default:A(()=>S[16]||(S[16]=[N(" Close ")])),_:1}),y("div",Xg,[((C=g.value)==null?void 0:C.type)==="source"?(x(),K(_(ve),{key:0,size:"sm",disabled:!E.value,onClick:S[3]||(S[3]=I=>V(g.value))},{default:A(()=>[S[17]||(S[17]=N(" Open Link ")),v(B,{name:"hugeicons:link-square-02",class:"size-3 ml-2"})]),_:1},8,["disabled"])):(x(),K(_(ve),{key:1,size:"sm",onClick:S[4]||(S[4]=I=>V(g.value))},{default:A(()=>[S[18]||(S[18]=N(" Download ")),v(B,{name:"hugeicons:download-04",class:"size-3"})]),_:1}))])]}),_:1})]}),_:1})]),_:1},8,["open"])])}}}),Ms=[{id:"generate-query",label:"Generate Query",toolName:"generate_query",category:"SQL",description:"Turn a natural language request into SQL for the active schema.",insertText:"Generate SQL for ",icon:"hugeicons:ai-brain-03",promptHint:"The user wants help drafting SQL from natural language. Prefer generate_query first and keep the response focused on producing or refining SQL."},{id:"render-table",label:"Render Table",toolName:"render_table",category:"Execution",description:"Run a read-only SQL query and show the result rows as a table.",insertText:"Run this query and show the table result for ",icon:"hugeicons:table-01",promptHint:"The user expects concrete table output. After generating or receiving read-only SQL, prefer render_table and summarize the returned rows briefly."},{id:"visualize-table",label:"Visualize Table",toolName:"visualize_table",category:"Charts",description:"Build a bar, line, pie, or scatter chart from a read-only query.",insertText:"Visualize this data as a bar, line, pie, or scatter chart for ",icon:"hugeicons:chart-line-data-01",promptHint:"The user wants a chart-oriented answer. Prefer visualize_table for read-only SQL, and ask for the chart type only if it is still missing."},{id:"describe-table",label:"Describe Table",toolName:"describe_table",category:"Schema",description:"Inspect columns, keys, relationships, and table structure.",insertText:"Describe the structure of table ",icon:"hugeicons:database",promptHint:"The user is asking about schema shape, keys, or relationships. Prefer describe_table when a specific table is involved."},{id:"explain-query",label:"Explain Query",toolName:"explain_query",category:"Performance",description:"Analyze a query plan and explain possible performance issues.",insertText:"Explain why this query is slow: ",icon:"hugeicons:activity-02",promptHint:"The user is focused on query performance. Prefer explain_query once a concrete SQL statement is available."},{id:"detect-anomaly",label:"Detect Anomaly",toolName:"detect_anomaly",category:"Quality",description:"Scan for nulls, duplicates, orphaned keys, and outlier values.",insertText:"Detect anomalies in table ",icon:"hugeicons:search-list-01",promptHint:"The user wants data quality checks. Prefer detect_anomaly for table-level validation and summarize the findings with severity."}],ul=t=>{const e=new Set(t);return Ms.filter(n=>e.has(n.id))},Zg={class:"w-full relative"},Jg={key:0,class:"absolute bottom-[calc(100%+8px)] left-4 right-4 z-50 overflow-hidden rounded-2xl border border-border/80 bg-background shadow-lg"},ev=["id","aria-selected","onMouseenter","onClick"],tv={class:"min-w-0 flex-1"},nv={class:"flex items-center gap-2"},sv={class:"text-xs font-medium text-foreground"},iv={class:"mt-1 block text-xs text-muted-foreground"},ov={key:0,class:"rounded-xl px-3 py-5 text-center text-[11px] text-muted-foreground"},av={class:"dark:bg-sidebar rounded-3xl border shadow-xs p-3 px-2 pb-2 flex flex-col gap-1 relative z-40"},rv={key:0,class:"flex flex-wrap gap-2 pb-1"},lv=["aria-label","onClick"],uv={class:"flex items-center justify-between px-1"},cv={class:"flex items-center gap-1"},dv={class:"relative w-fit"},hv={class:"flex items-center gap-3"},vn="agent-command-listbox",Qo="agent-command-status",fv=Y({__name:"AgentChatInput",props:{modelValue:{},isLoading:{type:Boolean},hasApiKey:{type:Boolean},provider:{},model:{},selectedCommandOptions:{}},emits:["update:modelValue","update:provider","update:model","update:selectedCommandOptions","submit","stop","keydown"],setup(t,{expose:e,emit:n}){const s=t,i=n,a=G(s.modelValue),o=G(0),r=G("");be(()=>s.modelValue,C=>{a.value=C});const l=G(null),u=L({get:()=>s.selectedCommandOptions,set:C=>i("update:selectedCommandOptions",C)}),c=L(()=>ul(u.value)),h=()=>{const C=l.value;if(!C)return null;if(C instanceof HTMLTextAreaElement)return C;if(typeof C=="object"&&"$el"in C&&C.$el instanceof HTMLElement){const I=C.$el;return I instanceof HTMLTextAreaElement?I:I.querySelector("textarea")}return C instanceof HTMLElement?C.querySelector("textarea"):null},d=()=>{const C=h();C==null||C.focus()};e({focusInput:d});const f=L(()=>{const C=h(),I=(C==null?void 0:C.selectionStart)??a.value.length;return a.value.slice(0,I).match(/(?:^|\s)\/([a-z0-9_-]*)$/i)}),p=L(()=>{var C,I;return((I=(C=f.value)==null?void 0:C[1])==null?void 0:I.toLowerCase())||""}),b=L(()=>f.value?f.value[0]:""),m=L(()=>{const C=p.value.trim();return f.value?C?Ms.filter(I=>[I.label,I.toolName,I.description,I.category].join(" ").toLowerCase().includes(C)):Ms:[]}),g=L(()=>!!f.value&&b.value!==r.value),P=L(()=>m.value[o.value]||null),w=L(()=>g.value?m.value.length===0?"No matching agent tools. Keep typing to filter or press Escape to close.":`${m.value.length} agent tools available. Use arrow keys to move, Enter or Tab to insert, and Escape to close.`:"");be(m,C=>{if(C.length===0){o.value=0;return}o.value>=C.length&&(o.value=0)}),be(b,C=>{C||(r.value="")});const E=C=>{const I=C.target.value;a.value=I,r.value&&r.value!==b.value&&(r.value=""),i("update:modelValue",I)},D=async()=>{r.value=b.value,o.value=0,await Be(),d()},V=C=>{u.value.includes(C.id)||(u.value=[...u.value,C.id])},k=C=>{u.value=u.value.filter(I=>I!==C)},S=async C=>{const I=h(),z=(I==null?void 0:I.selectionStart)??a.value.length,W=a.value.slice(0,z),X=a.value.slice(z);if(!W.match(/(?:^|\s)\/([a-z0-9_-]*)$/i))return;const Q=W.lastIndexOf("/"),Z=a.value.slice(0,Q);let J=`${Z}${X}`;Z.trim()||(J=J.trimStart());const ge=Math.min(Z.length,J.length);a.value=J,i("update:modelValue",J),V(C),o.value=0,r.value="",await Be();const ue=h();ue==null||ue.focus(),ue==null||ue.setSelectionRange(ge,ge)},B=C=>{if(g.value){if(C.key==="Escape"){C.preventDefault(),D();return}if(m.value.length>0){if(C.key==="ArrowDown"){C.preventDefault(),o.value=(o.value+1)%m.value.length;return}if(C.key==="ArrowUp"){C.preventDefault(),o.value=(o.value-1+m.value.length)%m.value.length;return}if(C.key==="Home"){C.preventDefault(),o.value=0;return}if(C.key==="End"){C.preventDefault(),o.value=m.value.length-1;return}if(C.key==="Enter"||C.key==="Tab"){C.preventDefault();const I=P.value;I&&S(I);return}}}i("keydown",C)},$=C=>{C==null||C.preventDefault(),i("submit",typeof C=="object"&&C!==null?C:void 0)},U=C=>{if(s.isLoading){C==null||C.preventDefault(),i("stop");return}$(C)},F=L({get:()=>s.provider,set:C=>i("update:provider",C)}),te=L({get:()=>s.model,set:C=>i("update:model",C)});return(C,I)=>{const z=de,W=hu,X=ve;return x(),T("div",Zg,[g.value?(x(),T("div",Jg,[I[4]||(I[4]=y("div",{class:"border-b border-border/50 px-3 py-2"},[y("p",{class:"text-xs font-medium"},"Agent tools"),y("p",{class:"mt-1 text-xs text-muted-foreground"},[N(" Type after "),y("span",{class:"font-medium text-foreground"},"/"),N(" to filter. ")])],-1)),y("div",{id:vn,role:"listbox","aria-label":"Agent tools",class:"max-h-[260px] overflow-y-auto px-2 py-2"},[(x(!0),T(re,null,Se(m.value,(q,Q)=>(x(),T("button",{id:`${vn}-${q.id}`,key:q.id,type:"button",role:"option","aria-selected":Q===o.value,class:ae(["mt-0.5 flex w-full items-start gap-2 rounded-xl px-3 py-2 text-left transition-colors first:mt-0 cursor-pointer",Q===o.value?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"]),onMouseenter:Z=>o.value=Q,onClick:Z=>S(q)},[v(z,{name:q.icon,class:"mt-0.5 size-[18px] shrink-0"},null,8,["name"]),y("span",tv,[y("span",nv,[y("span",sv,M(q.label),1)]),y("span",iv,M(q.description),1)]),y("div",null,[c.value.find(Z=>Z.id===q.id)?(x(),K(z,{key:0,name:"hugeicons:checkmark-circle-01",class:"size-4 mt-0.5 text-muted-foreground cursor-pointer"})):H("",!0)])],42,ev))),128)),m.value.length===0?(x(),T("div",ov,I[3]||(I[3]=[N(" No matching tools. Try "),y("span",{class:"font-medium text-foreground"},"/render",-1),N(" or "),y("span",{class:"font-medium text-foreground"},"/describe",-1),N(". ")]))):H("",!0)])])):H("",!0),y("div",av,[c.value.length>0?(x(),T("div",rv,[(x(!0),T(re,null,Se(c.value,q=>(x(),T("div",{key:q.id,class:"inline-flex items-center gap-1 rounded-full border border-border/70 bg-muted/40 px-1.5 py-0.5 text-xs text-foreground"},[v(z,{name:q.icon,class:"size-3.5 text-muted-foreground"},null,8,["name"]),y("span",null,M(q.label),1),y("button",{type:"button",class:"inline-flex size-4 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-background hover:text-foreground","aria-label":`Remove ${q.label}`,onClick:Q=>k(q.id)},[v(z,{name:"lucide:x",class:"size-3"})],8,lv)]))),128))])):H("",!0),v(W,{ref_key:"textareaRef",ref:l,modelValue:a.value,"onUpdate:modelValue":I[0]||(I[0]=q=>a.value=q),disabled:!C.hasApiKey||C.isLoading,placeholder:"Ask Orca anythink, / for agent tools",class:"w-full bg-transparent! outline-none border-0 shadow-none focus-visible:ring-0 placeholder:text-muted-foreground resize-none px-2 pt-0 min-h-12 max-h-36 text-sm","aria-autocomplete":"list","aria-controls":g.value?vn:void 0,"aria-describedby":Qo,"aria-activedescendant":P.value?`${vn}-${P.value.id}`:void 0,"aria-expanded":g.value,onInput:E,onKeydown:B},null,8,["modelValue","disabled","aria-controls","aria-activedescendant","aria-expanded"]),y("p",{id:Qo,class:"sr-only","aria-live":"polite"},M(w.value),1),y("div",uv,[y("div",cv,[y("div",dv,[v($l,{provider:F.value,"onUpdate:provider":I[1]||(I[1]=q=>F.value=q),model:te.value,"onUpdate:model":I[2]||(I[2]=q=>te.value=q),class:"h-7! border-0 bg-transparent hover:bg-muted rounded-lg shadow-none px-2! text-xs text-muted-foreground hover:text-foreground cursor-pointer"},null,8,["provider","model"])])]),y("div",hv,[v(X,{size:"iconMd",type:"button",class:"rounded-full shadow bg-foreground text-background hover:bg-foreground disabled disabled:bg-muted disabled:text-muted-foreground",disabled:!a.value.trim()&&!C.isLoading||!C.hasApiKey,onClick:U},{default:A(()=>[v(z,{name:C.isLoading?"lucide:square":"lucide:arrow-up",class:ae(["size-4 stroke-[2]",C.isLoading?"fill-current":""])},null,8,["name","class"])]),_:1},8,["disabled"])])])])])}}}),pv={class:"flex items-center justify-between px-4 mt-2 text-[12px] text-muted-foreground relative z-30"},mv={class:"flex items-center gap-4"},gv={class:"flex items-center gap-1"},vv={class:"flex items-center gap-1.5"},yv={class:"flex items-center gap-1.5"},xv=Y({__name:"AgentChatStatusBar",props:{modelLabel:{},isLoading:{type:Boolean},showReasoning:{type:Boolean}},emits:["update:showReasoning"],setup(t,{emit:e}){const n=e;return(s,i)=>{const a=de,o=Rl;return x(),T("div",pv,[y("div",mv,[y("div",gv,[v(a,{name:"hugeicons:ai-brain-05",class:"size-3.5 stroke-[1.5]"}),i[1]||(i[1]=y("span",null,"Reasoning",-1)),v(o,{"model-value":s.showReasoning,"aria-label":"Toggle reasoning",class:"cursor-pointer","onUpdate:modelValue":i[0]||(i[0]=r=>n("update:showReasoning",!!r))},null,8,["model-value"])]),y("div",vv,[v(a,{name:"hugeicons:robotic",class:"size-3.5 stroke-[1.5]"}),y("span",null,M(s.modelLabel),1)])]),y("div",yv,[v(a,{name:s.isLoading?"hugeicons:loading-03":"hugeicons:checkmark-circle-01",class:ae(["size-3.5 stroke-[1.5]",s.isLoading?"animate-spin":""])},null,8,["name","class"]),y("span",null,M(s.isLoading?"Streaming":"Ready"),1)])])}}}),bv={class:"w-full py-2"},wv={class:"relative w-full max-w-3xl mx-auto flex flex-col px-4"},_v={key:0,class:"absolute -top-12 left-1/2 transform -translate-x-1/2 z-20"},Sv=Y({__name:"AgentChatFooter",props:{modelValue:{},isLoading:{type:Boolean},hasApiKey:{type:Boolean},provider:{},model:{},selectedCommandOptions:{},showReasoning:{type:Boolean},showScrollButton:{type:Boolean}},emits:["update:modelValue","update:provider","update:model","update:selectedCommandOptions","update:showReasoning","submit","stop","keydown","scrollToBottom"],setup(t,{expose:e,emit:n}){const s=t,i=n,a=L({get:()=>s.modelValue,set:d=>i("update:modelValue",d)}),o=L({get:()=>s.provider,set:d=>i("update:provider",d)}),r=L({get:()=>s.model,set:d=>i("update:model",d)}),l=L({get:()=>s.selectedCommandOptions,set:d=>i("update:selectedCommandOptions",d)}),u=L(()=>`${s.provider} / ${s.model}`),c=G(null);return e({focusInput:()=>{var d;(d=c.value)==null||d.focusInput()}}),(d,f)=>(x(),T("footer",bv,[y("div",wv,[v(Zt,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"opacity-0 translate-y-4","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition-all duration-200 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 translate-y-4"},{default:A(()=>[d.showScrollButton?(x(),T("div",_v,[y("button",{class:"flex items-center justify-center size-8 bg-background border border-border rounded-full shadow-sm text-muted-foreground hover:bg-muted/50 cursor-pointer outline-none transition-colors",onClick:f[0]||(f[0]=p=>i("scrollToBottom"))},[v(_(de),{name:"lucide:arrow-down",class:"size-4 shrink-0"})])])):H("",!0)]),_:1}),v(fv,{ref_key:"inputRef",ref:c,modelValue:a.value,"onUpdate:modelValue":f[1]||(f[1]=p=>a.value=p),provider:o.value,"onUpdate:provider":f[2]||(f[2]=p=>o.value=p),model:r.value,"onUpdate:model":f[3]||(f[3]=p=>r.value=p),"selected-command-options":l.value,"onUpdate:selectedCommandOptions":f[4]||(f[4]=p=>l.value=p),"is-loading":d.isLoading,"has-api-key":d.hasApiKey,onSubmit:f[5]||(f[5]=p=>i("submit",p)),onStop:f[6]||(f[6]=p=>i("stop")),onKeydown:f[7]||(f[7]=p=>i("keydown",p))},null,8,["modelValue","provider","model","selected-command-options","is-loading","has-api-key"]),v(xv,{"model-label":u.value,"is-loading":d.isLoading,"show-reasoning":d.showReasoning,"onUpdate:showReasoning":f[8]||(f[8]=p=>i("update:showReasoning",p))},null,8,["model-label","is-loading","show-reasoning"])])]))}}),Tv={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},kv={class:"flex flex-wrap items-center gap-2"},Av={key:0,class:"rounded-2xl border bg-background/80 px-3 py-3 text-sm"},Cv={key:1,class:"space-y-3"},Pv={class:"flex flex-wrap items-center gap-2"},Mv={key:0,class:"text-xs text-muted-foreground"},Dv={class:"mt-3 text-sm leading-6"},Vv={key:0,class:"mt-3 rounded-xl border bg-muted/30"},Lv={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},Ev=Y({__name:"AgentAnomalyBlock",props:{data:{}},setup(t){const e={high:"destructive",medium:"secondary",low:"outline"},n=s=>e[s];return(s,i)=>{const a=Te;return x(),T("div",Tv,[y("div",kv,[v(a,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:A(()=>[N(" Clean Score "+M(s.data.cleanScore)+"/100 ",1)]),_:1}),v(a,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:A(()=>[N(M(s.data.scannedRows)+" rows scanned ",1)]),_:1})]),s.data.issues.length===0?(x(),T("div",Av," No anomalies were detected in the requested checks. ")):(x(),T("div",Cv,[(x(!0),T(re,null,Se(s.data.issues,(o,r)=>(x(),T("div",{key:`${o.type}-${o.column||r}`,class:"rounded-2xl border bg-background/90 p-3"},[y("div",Pv,[v(a,{variant:n(o.severity),class:"text-xxs tracking-[0.16em]"},{default:A(()=>[N(M(o.severity.toUpperCase()),1)]),_:2},1032,["variant"]),v(a,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:A(()=>[N(M(o.type),1)]),_:2},1024),o.column?(x(),T("span",Mv,M(o.column),1)):H("",!0)]),y("p",Dv,M(o.description),1),o.fixSql?(x(),T("details",Vv,[i[0]||(i[0]=y("summary",{class:"cursor-pointer px-3 py-2 text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground"}," Fix suggestion ",-1)),y("pre",Lv,M(o.fixSql),1)])):H("",!0)]))),128))]))])}}}),$v={class:"space-y-2"},Rv={class:"flex flex-wrap justify-start gap-2"},Iv=Y({__name:"AgentApprovalBlock",props:{toolName:{},input:{},approvalId:{}},emits:["approve","deny"],setup(t,{emit:e}){const n=t,s=e,i=L(()=>"sql"in n.input&&typeof n.input.sql=="string"?n.input.sql:JSON.stringify(n.input,null,2));return(a,o)=>{const r=$n,l=ve;return x(),T("div",$v,[o[4]||(o[4]=y("div",{class:""},[y("div",{class:"text-xs font-medium"},"Approval Required"),y("p",{class:"text-xs text-muted-foreground"}," *This action needs confirmation before execution. ")],-1)),v(r,{id:n.approvalId,code:_(i)||"",language:"sql"},null,8,["id","code"]),y("div",Rv,[v(l,{variant:"outline",size:"xs",class:"rounded-xl font-normal",onClick:o[0]||(o[0]=u=>s("deny",a.approvalId))},{default:A(()=>o[2]||(o[2]=[N(" Cancel ")])),_:1}),v(l,{size:"xs",class:"rounded-xl font-normal",onClick:o[1]||(o[1]=u=>s("approve",a.approvalId))},{default:A(()=>o[3]||(o[3]=[N(" Confirm ")])),_:1})])])}}}),Bv={class:"flex items-start justify-between gap-3"},Ov={class:"space-y-2 min-w-0"},Fv={class:"flex items-center gap-2"},jv={class:"text-sm font-medium"},Nv={class:"text-sm leading-6"},zv={key:0,class:"space-y-2"},Uv={class:"flex flex-wrap gap-1"},is=Y({__name:"AgentDescribeBlock",props:{data:{}},setup(t){const e=t,n=L(()=>[["name","Name"],["type","Type"],["nullable","Nullable"],["pk","PK"],["fk","FK"],["references","References"],["description","Description"]].map(([a,o])=>({originalName:a,queryFieldName:a,aliasFieldName:o,isPrimaryKey:!1,isForeignKey:!1,canMutate:!1,type:"text",tableName:""}))),s=L(()=>e.data.columns.map(a=>({name:a.name,type:a.type,nullable:a.isNullable?"Yes":"No",pk:a.isPrimaryKey?"Yes":"No",fk:a.isForeignKey?"Yes":"No",references:a.referencesTable||"—",description:a.description||"—"}))),i=L(()=>{const u=48+s.value.length*32;return Math.max(120,Math.min(u,360))});return(a,o)=>{const r=de,l=Te;return x(),T(re,null,[y("div",Bv,[y("div",Ov,[y("div",Fv,[v(r,{name:"hugeicons:grid-table",class:"size-4 text-primary"}),y("div",jv,M(a.data.tableName),1)]),y("p",Nv,M(a.data.summary),1)]),v(l,{variant:"outline",class:"shrink-0"},{default:A(()=>[N(M(a.data.columns.length)+" columns ",1)]),_:1})]),y("div",{class:"overflow-hidden rounded-lg border",style:Dt({height:`${_(i)}px`})},[v(zs,{columns:_(n),data:_(s),"column-key-by":"field","has-hash-index":!1,class:"h-full w-full"},null,8,["columns","data"])],4),a.data.relatedTables.length>0?(x(),T("div",zv,[o[0]||(o[0]=y("div",{class:"text-[11px] font-medium text-muted-foreground"}," Related Tables ",-1)),y("div",Uv,[(x(!0),T(re,null,Se(a.data.relatedTables,u=>(x(),K(l,{key:u,variant:"outline",class:"text-xxs"},{default:A(()=>[N(M(u),1)]),_:2},1024))),128))])])):H("",!0)],64)}}});function qv(t){return t.nodes.map(e=>({id:e.id,schema:e.schemaName,table:e.tableName,rows:0,type:"table",comment:null,columns:e.columns.map((n,s)=>({name:n.name,ordinal_position:s+1,short_type_name:n.type,type:n.type,character_maximum_length:null,precision:null,nullable:!n.isPrimaryKey,default:null,collation:null,comment:null})),foreign_keys:t.edges.filter(n=>n.source===e.id).map(n=>{const[s,i]=n.target.split(".");return{foreign_key_name:n.id,column:n.sourceColumn,reference_schema:s,reference_table:i,reference_column:n.targetColumn,fk_def:""}}),primary_keys:e.columns.filter(n=>n.isPrimaryKey).map(n=>({column:n.name,pk_def:""})),indexes:[]}))}const Hv={class:"space-y-2"},Kv={class:"flex items-center justify-between"},Gv={class:"flex items-center gap-2"},Wv={key:0,class:"fixed inset-0 z-50 bg-background flex flex-col"},Yv={class:"flex items-center justify-between px-4 py-2 border-b border-border"},Xv={class:"flex items-center gap-2"},Qv={class:"flex-1 relative"},Zv=Y({__name:"AgentErdBlock",props:{data:{}},setup(t){const e=t,n=L(()=>qv(e.data)),s=L(()=>pu(n.value)),i=L(()=>{const u={};for(const c of s.value.nodes)u[c.id]=c.position;return u}),a=L(()=>{const c=Math.max(...e.data.nodes.map(h=>h.columns.length),3)*Il+Bl+120;return Math.max(300,Math.min(c,500))}),o=G(!1),r=G(!1),l=()=>{o.value=!o.value,o.value||(r.value=!1)};return(u,c)=>{const h=de,d=Te,f=ve;return x(),T("div",Hv,[y("div",Kv,[y("div",Gv,[v(h,{name:"hugeicons:hierarchy-square-01",class:"size-4 text-primary"}),c[1]||(c[1]=y("span",{class:"text-sm font-medium"}," Entity Relationship Diagram ",-1)),v(d,{variant:"outline",class:"text-xs"},{default:A(()=>[N(M(u.data.nodes.length)+" tables ",1)]),_:1})]),v(f,{variant:"ghost",size:"iconSm",onClick:l},{default:A(()=>[v(h,{name:o.value?"hugeicons:arrow-shrink-02":"hugeicons:arrow-expand-02"},null,8,["name"])]),_:1})]),o.value?H("",!0):(x(),T("div",{key:0,class:"overflow-hidden rounded-lg border border-border/70",style:Dt({height:`${a.value}px`})},[v(_(yu),{class:"erd-flow w-full h-full","pan-on-scroll":!0,"pan-on-scroll-speed":1.2,nodes:s.value.nodes,edges:s.value.edges,"default-viewport":{zoom:_(jl),x:40,y:40},"min-zoom":_(Fl),"max-zoom":_(Ol),"fit-view-on-init":""},{"edge-custom":A(p=>[v(vu,xi(bi(p)),null,16)]),"node-value":A(p=>[v(gu,xi(bi(p)),null,16)]),default:A(()=>[v(_(mu),{size:2,gap:30})]),_:1},8,["nodes","edges","default-viewport","min-zoom","max-zoom"])],4)),(x(),K(ra,{to:"body"},[o.value?(x(),T("div",Wv,[y("div",Yv,[y("div",Xv,[v(h,{name:"hugeicons:hierarchy-square-01",class:"size-4 text-primary"}),c[2]||(c[2]=y("span",{class:"text-sm font-medium"}," Entity Relationship Diagram ",-1)),v(d,{variant:"outline",class:"text-xs"},{default:A(()=>[N(M(u.data.nodes.length)+" tables ",1)]),_:1})]),v(f,{variant:"ghost",size:"iconSm",onClick:l},{default:A(()=>[v(h,{name:"hugeicons:arrow-shrink-02"})]),_:1})]),y("div",Qv,[v(xu,{nodes:s.value.nodes,edges:s.value.edges,matrixTablePosition:i.value,tables:n.value,isShowFilter:r.value,"onUpdate:isShowFilter":c[0]||(c[0]=p=>r.value=p)},null,8,["nodes","edges","matrixTablePosition","tables","isShowFilter"])])])):H("",!0)]))])}}}),Jv={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},ey={class:"flex flex-wrap items-center gap-2"},ty={class:"text-sm leading-6 text-foreground/90"},ny={key:0,class:"space-y-2"},sy={class:"space-y-2 text-sm leading-6"},iy={class:"rounded-2xl border bg-background/90"},oy={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},ay=Y({__name:"AgentExplainBlock",props:{data:{}},setup(t){return(e,n)=>{const s=Te;return x(),T("div",Jv,[y("div",ey,[v(s,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:A(()=>[N(M(e.data.slowestNode),1)]),_:1}),v(s,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:A(()=>[N(" Cost "+M(e.data.estimatedCost.toFixed(2)),1)]),_:1})]),y("p",ty,M(e.data.summary),1),e.data.suggestions.length>0?(x(),T("div",ny,[n[0]||(n[0]=y("div",{class:"text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground"}," Suggestions ",-1)),y("ul",sy,[(x(!0),T(re,null,Se(e.data.suggestions,i=>(x(),T("li",{key:i,class:"rounded-2xl border bg-background/80 px-3 py-2"},M(i),1))),128))])])):H("",!0),y("details",iy,[n[1]||(n[1]=y("summary",{class:"cursor-pointer px-3 py-2 text-sm font-medium"}," Raw EXPLAIN output ",-1)),y("pre",oy,M(e.data.rawPlan),1)])])}}}),ry=["disabled"],ly={class:"flex items-center min-w-0 gap-2 flex-1"},uy={class:"flex flex-col"},cy={class:"truncate text-sm leading-4 font-normal text-foreground"},dy={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},hy={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},Zo=Y({__name:"AgentExportFileBlock",props:{data:{}},setup(t){const e=t,n=ta("activeExportPreview"),{downloadFile:s}=hi(),i=()=>{n&&(n.value=e.data)};L(()=>{switch(e.data.format){case"json":return"lucide:braces";case"sql":return"lucide:database";case"markdown":return"lucide:file-text";case"xml":return"lucide:code-xml";case"yaml":return"lucide:settings-2";case"html":return"lucide:globe";case"tsv":case"csv":return"lucide:table-2";case"txt":return"lucide:file";default:return"lucide:file-text"}});const a=L(()=>{const r=e.data.fileSize;return xa(r)});L(()=>e.data.error?e.data.error:"Preview available before download");const o=async()=>{await s(e.data)};return(r,l)=>{const u=de,c=ve;return x(),T("button",{type:"button",class:ae(["flex w-full items-center gap-2 rounded-xl border border-border/70 bg-muted/20 p-4 text-left transition-colors hover:bg-muted/35",e.data.error?"cursor-not-allowed opacity-80":"cursor-pointer"]),disabled:!!e.data.error,onClick:i},[y("div",ly,[v(u,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),y("div",uy,[y("h3",cy,M(e.data.filename),1),e.data.preview.truncated?(x(),T("p",dy," First "+M(e.data.preview.rows.length)+" rows ",1)):(x(),T("p",hy," size: "+M(a.value)+" • type: "+M(e.data.format),1))])]),v(c,{disabled:!!e.data.error,size:"xs",variant:"outline"},{default:A(()=>[l[0]||(l[0]=N(" view ")),v(u,{name:"lucide:eye",class:"size-3"})]),_:1},8,["disabled"]),v(c,{onClick:Nl(o,["stop"]),disabled:!!e.data.error,size:"xs",variant:"outline"},{default:A(()=>[l[1]||(l[1]=N(" Download ")),v(u,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"])],10,ry)}}}),fy={class:"overflow-hidden mb-1"},py={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},my={class:"my-1"},pi=Y({__name:"AgentToolSqlPreview",props:{id:{},sql:{},label:{default:"View SQL"},defaultOpen:{type:Boolean,default:!1}},setup(t){const e=t,n=G(!1);function s(o){const r=o;r.style.height="0",r.style.opacity="0",requestAnimationFrame(()=>{r.style.height=r.scrollHeight+"px",r.style.opacity="1"})}function i(o){o.style.height="auto"}function a(o){const r=o;r.style.height=r.scrollHeight+"px",r.style.opacity="1",requestAnimationFrame(()=>{r.style.height="0",r.style.opacity="0"})}return(o,r)=>{const l=de,u=$n;return x(),T("div",fy,[y("button",{type:"button",class:"flex cursor-pointer items-center justify-start gap-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",onClick:r[0]||(r[0]=c=>n.value=!_(n))},[N(M(e.label)+" ",1),v(l,{name:"lucide:chevron-down",class:ae(["ml-auto size-4 transition-transform duration-300",{"rotate-180":_(n)}])},null,8,["class"])]),v(Zt,{onEnter:s,onAfterEnter:i,onLeave:a},{default:A(()=>[_(n)?(x(),T("div",py,[y("div",my,[v(u,{id:e.id,code:e.sql,language:"sql"},null,8,["id","code"])])])):H("",!0)]),_:1})])}}}),gy={class:"space-y-3 rounded-xl border border-border/70 bg-muted/20 p-4"},vy={class:"flex items-start justify-between gap-3"},yy={class:"text-sm leading-6 text-foreground/90"},xy=Y({__name:"AgentQueryBlock",props:{data:{}},setup(t){const e=t,n=L(()=>`agent-query-${e.data.sql}`);return(s,i)=>{const a=Te;return x(),T("div",gy,[y("div",vy,[y("p",yy,M(s.data.explanation),1),v(a,{variant:s.data.isMutation?"destructive":"secondary",class:"shrink-0 text-xxs"},{default:A(()=>[N(M(s.data.isMutation?"MUTATION":"READ ONLY"),1)]),_:1},8,["variant"])]),v(pi,{id:_(n),sql:s.data.sql,label:s.data.isMutation?"Review SQL before approval":"View SQL","default-open":s.data.isMutation},null,8,["id","sql","label","default-open"])])}}}),by={class:"overflow-hidden"},wy={key:1,class:""},_y={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},Sy={class:"mt-2 border-l-2 border-border pl-3 py-1 text-foreground/80 opacity-70 chat-text"},Ty=Y({__name:"AgentReasoningBlock",props:{content:{},isStreaming:{type:Boolean}},setup(t){const e=t,n=Gt(e,"isStreaming"),s=js(Gt(e,"content"),n),i=G(!1);be(()=>e.isStreaming,l=>{l?i.value=!0:i.value=!1},{immediate:!0});function a(l){const u=l;u.style.height="0",u.style.opacity="0",requestAnimationFrame(()=>{u.style.height=u.scrollHeight+"px",u.style.opacity="1"})}function o(l){l.style.height="auto"}function r(l){const u=l;u.style.height=u.scrollHeight+"px",u.style.opacity="1",requestAnimationFrame(()=>{u.style.height="0",u.style.opacity="0"})}return(l,u)=>{const c=de;return x(),T("div",by,[y("button",{type:"button",class:"flex cursor-pointer items-center justify-start gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",onClick:u[0]||(u[0]=h=>i.value=!_(i))},[v(c,{name:"hugeicons:ai-brain-05",class:ae(["size-3.5! shrink-0",{"animate-pulse text-primary":l.isStreaming}])},null,8,["class"]),l.isStreaming?(x(),K(di,{key:0,duration:1},{default:A(()=>u[1]||(u[1]=[N("Reasoning")])),_:1})):(x(),T("span",wy," Reasoning ")),v(c,{name:"lucide:chevron-down",class:ae(["ml-auto size-4 transition-transform duration-300",{"rotate-180":_(i)}])},null,8,["class"])]),v(Zt,{onEnter:a,onAfterEnter:o,onLeave:r},{default:A(()=>[_(i)?(x(),T("div",_y,[y("div",Sy,[v(ua,{content:_(s),"is-streaming":l.isStreaming,"is-block-streaming":l.isStreaming,"is-user-message":!1},null,8,["content","is-streaming","is-block-streaming"])])])):H("",!0)]),_:1})])}}}),ky={key:1,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},Ay={class:"text-xs text-muted-foreground mt-1"},Cy=Y({__name:"AgentTableBlock",props:{data:{}},setup(t){const e=t,n=L(()=>(e.data.columns??[]).map(o=>({originalName:o.name,queryFieldName:o.name,aliasFieldName:o.name,isPrimaryKey:!1,isForeignKey:!1,canMutate:!1,type:o.type,tableName:""}))),s=L(()=>e.data.rows??[]),i=L(()=>`agent-render-table-${e.data.sql||""}`),a=L(()=>{const c=48+s.value.length*32;return Math.max(120,Math.min(c,420))});return(o,r)=>(x(),T(re,null,[o.data.sql?(x(),K(pi,{key:0,id:_(i),sql:o.data.sql,label:"View SQL"},null,8,["id","sql"])):H("",!0),o.data.truncated?(x(),T("div",ky," Showing only the first "+M(o.data.rowCount)+" rows. ",1)):H("",!0),y("div",{class:"overflow-hidden rounded-lg border max-h-96",style:Dt({height:`${_(a)}px`})},[v(zs,{columns:_(n),data:_(s),"column-key-by":"field","has-hash-index":!1,class:"h-full w-full"},null,8,["columns","data"])],4),y("div",Ay," Showing "+M(_(s).length)+" row"+M(_(s).length===1?"":"s"),1)],64))}}),Py={class:"flex flex-wrap items-center justify-between gap-2"},My={class:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground"},Dy={class:"text-xs text-muted-foreground"},Vy={key:0,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},Ly={class:"overflow-hidden rounded-xl border bg-background/90 p-2 pt-8"},Ey={class:"agent-chart-container"},$y=Y({__name:"AgentVisualizeTableBlock",props:{data:{}},setup(t){ya([Gu,Wu,Yu,xc,kc,Xu,Qu,Zu]);const e=t,n=L(()=>`agent-visualize-table-${e.data.chartType}-${e.data.sql}`),s=L(()=>e.data.chartType.replace("_"," ")),i=L(()=>e.data.chartType==="pie"?{tooltip:{trigger:"item"},legend:{bottom:0},series:[{type:"pie",radius:["35%","68%"],data:e.data.points.map(a=>({name:a.label,value:a.y}))}]}:e.data.chartType==="scatter"?{tooltip:{trigger:"item"},grid:{left:16,right:16,top:24,bottom:24,containLabel:!0},xAxis:{type:"value",name:e.data.xField},yAxis:{type:"value",name:e.data.yField},series:[{type:"scatter",symbolSize:10,data:e.data.points.map(a=>[a.x,a.y])}]}:{tooltip:{trigger:"axis"},grid:{left:16,right:16,top:24,bottom:24,containLabel:!0},xAxis:{type:"category",name:e.data.xField,data:e.data.points.map(a=>a.label),axisLabel:{hideOverlap:!0}},yAxis:{type:"value",name:e.data.yField},series:[{type:e.data.chartType,smooth:e.data.chartType==="line",data:e.data.points.map(a=>a.y)}]});return(a,o)=>{const r=Te;return x(),T(re,null,[y("div",Py,[y("div",My,[v(r,{variant:"secondary",class:"uppercase tracking-[0.16em]"},{default:A(()=>[N(M(_(s)),1)]),_:1}),a.data.xField?(x(),K(r,{key:0,variant:"outline"},{default:A(()=>[N(" X: "+M(a.data.xField),1)]),_:1})):H("",!0),a.data.yField?(x(),K(r,{key:1,variant:"outline"},{default:A(()=>[N(" Y: "+M(a.data.yField),1)]),_:1})):H("",!0)]),y("div",Dy,M(a.data.rowCount)+" point"+M(a.data.rowCount===1?"":"s"),1)]),v(pi,{id:_(n),sql:a.data.sql,label:"View SQL"},null,8,["id","sql"]),a.data.truncated?(x(),T("div",Vy," Showing only the first "+M(a.data.rowCount)+" points. ",1)):H("",!0),y("div",Ly,[y("div",Ey,[v(_(Ju),{option:_(i),autoresize:"",class:"agent-chart"},null,8,["option"])])])],64)}}}),Ry=la($y,[["__scopeId","data-v-8ea150a2"]]),Iy={class:"min-w-0 flex-1 overflow-hidden"},By={class:"flex items-center gap-1 justify-center"},Oy=Y({__name:"AgentMessageBubble",props:{message:{},getToolComponent:{type:Function},showReasoning:{type:Boolean},isStreaming:{type:Boolean},highlightedResponseId:{},registerMessageElement:{type:Function}},emits:["approval","edit","quiz-submit"],setup(t,{emit:e}){const n=t,s=e,{handleCopyWithKey:i,isCopied:a,getCopyIcon:o,getCopyIconClass:r,getCopyTooltip:l}=Ns(),u=L(()=>n.message.role==="user"),c=d=>{u.value||!n.registerMessageElement||n.registerMessageElement(n.message.id,d)},h=L(()=>(n.message.blocks??[]).map(d=>d.kind==="text"||d.kind==="markdown"?d.content:d.kind==="code"||d.kind==="mermaid"?d.code:"").filter(Boolean).join(`
|
|
5
|
+
|
|
6
|
+
`));return(d,f)=>{const p=de,b=ve,m=Vn,g=Ln,P=Dn;return x(),T("div",{class:ae(["w-full",u.value?"flex justify-end":"flex justify-start"]),ref:w=>c(w)},[y("div",{class:ae(["flex w-full max-w-3xl gap-3",u.value?"justify-end":"items-start"])},[y("div",Iy,[(x(!0),T(re,null,Se(d.message.blocks,(w,E)=>(x(),T("div",{key:`${d.message.id}-${w.kind}-${E}`,class:ae(["overflow-hidden chat-text",!u.value&&n.highlightedResponseId===d.message.id?"ring-1 ring-primary/25 bg-primary/6":"",u.value?"rounded-xl bg-muted text-foreground p-2 px-3 shadow-none whitespace-pre-wrap ml-auto":"rounded-xl border-none bg-transparent py-2 shadow-none flex flex-col gap-1.5"])},[w.kind==="text"?(x(),K(_(dm),{key:0,content:w.content,"is-block-streaming":w.isStreaming,"is-streaming":d.isStreaming,"is-user-message":u.value},null,8,["content","is-block-streaming","is-streaming","is-user-message"])):w.kind==="reasoning"&&d.showReasoning?(x(),K(_(Ty),{key:1,content:w.content,"is-streaming":w.isStreaming},null,8,["content","is-streaming"])):w.kind==="markdown"?(x(),K(_(ua),{key:2,content:w.content,"is-block-streaming":w.isStreaming,"is-streaming":d.isStreaming,"is-user-message":u.value},null,8,["content","is-block-streaming","is-streaming","is-user-message"])):w.kind==="code"?(x(),K(_($n),{key:3,id:`${d.message.id}-${E}`,code:w.code,language:w.language||"text","is-block-streaming":w.isStreaming,"is-streaming":d.isStreaming},null,8,["id","code","language","is-block-streaming","is-streaming"])):w.kind==="mermaid"?(x(),K(_(Gm),{key:4,id:`${d.message.id}-${E}`,code:w.code},null,8,["id","code"])):w.kind==="loading"?(x(),K(_(Ym),{key:5,label:w.label},null,8,["label"])):w.kind==="error"?(x(),K(_(Qm),{key:6,message:w.message},null,8,["message"])):w.kind==="tool"?(x(),K(_(eg),{key:7,"tool-name":w.toolName,result:w.result,"get-tool-component":d.getToolComponent},null,8,["tool-name","result","get-tool-component"])):w.kind==="approval"?(x(),K(_(Iv),{key:8,"tool-name":w.toolName,input:w.input,"approval-id":w.approvalId,onApprove:f[0]||(f[0]=D=>s("approval",D,!0)),onDeny:f[1]||(f[1]=D=>s("approval",D,!1))},null,8,["tool-name","input","approval-id"])):w.kind==="source"?(x(),K(_(ag),{key:9,"source-id":w.sourceId,url:w.url,title:w.title,"media-type":w.mediaType,filename:w.filename},null,8,["source-id","url","title","media-type","filename"])):w.kind==="quiz"?(x(),K(_(kg),{key:10,"tool-call-id":w.toolCallId,context:w.context,questions:w.questions,onSubmit:f[2]||(f[2]=D=>s("quiz-submit",D))},null,8,["tool-call-id","context","questions"])):H("",!0)],2))),128)),d.isStreaming?H("",!0):(x(),T("div",{key:0,class:ae(["mt-1 flex items-center gap-1",u.value?"justify-end":"justify-start"])},[v(P,null,{default:A(()=>[v(m,{"as-child":""},{default:A(()=>[v(b,{size:"xxs",variant:"ghost",class:"h-4!",onClick:f[3]||(f[3]=w=>_(i)(d.message.id,h.value))},{default:A(()=>[y("span",By,[v(p,{name:_(o)(_(a)(d.message.id)),class:ae(["size-3.5!",_(r)(_(a)(d.message.id))])},null,8,["name","class"]),_(a)(d.message.id)?(x(),T("span",{key:0,class:ae(["text-[10px] font-medium leading-none",_(r)(_(a)(d.message.id))])},"Copied",2)):H("",!0)])]),_:1})]),_:1}),v(g,null,{default:A(()=>[y("p",null,M(_(l)(_(a)(d.message.id))),1)]),_:1})]),_:1}),u.value?(x(),K(P,{key:0},{default:A(()=>[v(m,{"as-child":""},{default:A(()=>[v(b,{size:"iconSm",variant:"ghost",class:"size-4!",onClick:f[4]||(f[4]=w=>s("edit",h.value))},{default:A(()=>[v(p,{name:"lucide:pencil",class:"size-3!"})]),_:1})]),_:1}),v(g,null,{default:A(()=>f[5]||(f[5]=[y("p",null,"Edit",-1)])),_:1})]),_:1})):H("",!0)],2))])],2)],2)}}}),Fy={class:"mx-auto flex max-w-xl flex-col items-center rounded-2xl border bg-background/90 px-8 py-10 text-center shadow-sm"},jy={class:"text-xl font-medium tracking-tight"},Ny=Y({__name:"AgentSetupCard",props:{currentProvider:{}},setup(t){const{openSettings:e}=zl();return(n,s)=>{const i=de,a=ve;return x(),T("div",Fy,[y("h2",jy,[v(i,{name:"lucide:key-round",class:"size-4! text-muted-foreground"}),N(" Connect "+M(n.currentProvider.name),1)]),s[2]||(s[2]=y("p",{class:"mt-2 text-sm leading-6 text-muted-foreground"}," Add an API key in Settings so the agent can answer questions, inspect schema context, and keep chat history in this workspace. ",-1)),v(a,{variant:"outline",size:"sm",class:"mt-6 rounded-2xl",onClick:s[0]||(s[0]=o=>_(e)("Agent"))},{default:A(()=>[v(i,{name:"lucide:settings-2",class:"size-4"}),s[1]||(s[1]=N(" Open Agent Settings "))]),_:1})])}}}),zy={class:"mx-auto my-auto w-full max-w-3xl py-8"},Uy={class:"rounded-3xl p-5"},qy={class:"flex items-start"},Hy={class:"min-w-0 flex-1"},Ky={class:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground"},Gy=Y({__name:"AgentWelcomePanel",props:{promptCards:{},threadCount:{}},emits:["prompt"],setup(t,{emit:e}){const n=t;return(s,i)=>(x(),T("div",zy,[y("div",Uy,[y("div",qy,[y("div",Hy,[y("div",Ky,[i[0]||(i[0]=y("span",{class:"rounded-full bg-muted px-2.5 py-1 font-medium text-foreground"}," Orca Agent ",-1)),y("span",null,M(n.threadCount)+" saved threads ready to resume",1)]),i[1]||(i[1]=y("h2",{class:"mt-3 text-xl font-medium text-foreground"}," Ask for schema help, query ideas, or result checks. ",-1)),i[2]||(i[2]=y("p",{class:"mt-2 max-w-2xl text-sm text-muted-foreground"}," Keep it short. The agent already sees the connected schema and can keep working from past conversations. ",-1))])])])]))}}),Wy={class:"flex flex-col items-center gap-1"},Yy=["onClick"],Xy=["aria-label"],Qy={class:"line-clamp-3 leading-relaxed"},Zy=Y({__name:"ResponseNavigatorDotIndicator",props:{currentIndex:{},responses:{},position:{}},emits:["select"],setup(t,{emit:e}){const n=e;return(s,i)=>(x(),T("div",Wy,[(x(!0),T(re,null,Se(s.responses,(a,o)=>(x(),T("div",{key:a.id,class:"group relative flex items-center justify-center px-3 cursor-pointer",onClick:r=>n("select",o)},[y("button",{type:"button",class:ae(["rounded-full transition-all duration-200 ease-out focus:outline-none focus:ring-2 focus:ring-primary/60 pointer-events-none",s.currentIndex===o?"h-1 w-5 bg-foreground":"h-[3px] w-3 bg-foreground/30 group-hover:bg-foreground/50 group-hover:w-4"]),"aria-label":`Go to response ${o+1}`},null,10,Xy),a.preview?(x(),T("div",{key:0,class:ae(["absolute top-1/2 -translate-y-1/2 pointer-events-none opacity-0 transition-opacity duration-200 group-hover:opacity-100 z-50 w-56 p-2.5 text-xs bg-popover text-popover-foreground rounded-lg shadow-md border border-border",s.position==="left"?"left-full ml-2":"right-full mr-2"])},[y("div",Qy,M(a.preview),1)],2)):H("",!0)],8,Yy))),128))]))}}),Jy=Y({__name:"ResponseNavigatorToast",props:{message:{},position:{}},setup(t){return(e,n)=>(x(),K(Zt,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"translate-x-2 opacity-0","enter-to-class":"translate-x-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"translate-x-0 opacity-100","leave-to-class":"translate-x-2 opacity-0"},{default:A(()=>[e.message?(x(),T("div",{key:0,class:ae(["absolute top-1/2 -translate-y-1/2 whitespace-nowrap rounded-full bg-foreground/90 px-3.5 py-2 text-xs text-background shadow-lg",e.position==="right"?"right-full mr-3":"left-full ml-3"]),role:"status","aria-live":"polite"},M(e.message),3)):H("",!0)]),_:1}))}});function e0({currentIndex:t,total:e,onNavigate:n}){const s=G("");let i=null;const a=L(()=>t.value>0),o=L(()=>t.value<e.value-1),r=d=>{s.value=d,i&&clearTimeout(i),i=setTimeout(()=>{s.value=""},1500)},l=d=>{d<0||d>=e.value||n(d)},u=()=>{if(!a.value){r("Already at first response");return}const d=t.value-1;l(d),r("Previous response")},c=()=>{if(!o.value){r("Already at last response");return}const d=t.value+1;l(d),r("Next response")},h=d=>{d.key==="ArrowUp"&&(d.preventDefault(),u()),d.key==="ArrowDown"&&(d.preventDefault(),c())};return Fs(()=>{i&&clearTimeout(i)}),{canGoNext:o,canGoPrevious:a,goNext:c,goPrevious:u,handleKeydown:h,toastMessage:s}}const t0=Y({__name:"ResponseNavigator",props:{responses:{},currentIndex:{},position:{default:"right"},offset:{default:()=>({})}},emits:["navigate"],setup(t,{emit:e}){const n=t,s=e,i=L(()=>n.responses.length),a=L(()=>({top:`calc(50% + ${n.offset.y??0}px)`,right:n.position==="right"?`${0+(n.offset.x??0)}px`:"auto",left:n.position==="left"?`${0+(n.offset.x??0)}px`:"auto",transform:"translateY(-50%)"})),{canGoNext:o,canGoPrevious:r,goNext:l,goPrevious:u,handleKeydown:c,toastMessage:h}=e0({currentIndex:Gt(n,"currentIndex"),total:i,onNavigate:d=>s("navigate",d)});return(d,f)=>{const p=de,b=ve,m=Vn,g=Ln,P=Dn;return d.responses.length>0?(x(),T("div",{key:0,class:"absolute z-30 flex flex-col items-center gap-0.5",style:Dt(a.value),tabindex:"0",onKeydown:f[1]||(f[1]=(...w)=>_(c)&&_(c)(...w))},[v(Jy,{message:_(h),position:d.position},null,8,["message","position"]),v(P,{"delay-duration":150},{default:A(()=>[v(m,{"as-child":""},{default:A(()=>[v(b,{size:"iconSm",variant:"ghost","aria-label":"Go to previous response","aria-disabled":!_(r),disabled:!_(r),onClick:_(u)},{default:A(()=>[v(p,{name:"lucide:chevron-up"})]),_:1},8,["aria-disabled","disabled","onClick"])]),_:1}),v(g,{side:d.position==="left"?"right":"left"},{default:A(()=>f[2]||(f[2]=[y("p",null,"Previous response",-1)])),_:1},8,["side"])]),_:1}),v(Zy,{"current-index":d.currentIndex,responses:d.responses,position:d.position,onSelect:f[0]||(f[0]=w=>s("navigate",w))},null,8,["current-index","responses","position"]),v(P,{"delay-duration":150},{default:A(()=>[v(m,{"as-child":""},{default:A(()=>[v(b,{size:"iconSm",variant:"ghost","aria-label":"Go to next response","aria-disabled":!_(o),disabled:!_(o),onClick:_(l)},{default:A(()=>[v(p,{name:"lucide:chevron-down"})]),_:1},8,["aria-disabled","disabled","onClick"])]),_:1}),v(g,{side:d.position==="left"?"right":"left"},{default:A(()=>f[3]||(f[3]=[y("p",null,"Next response",-1)])),_:1},8,["side"])]),_:1})],36)):H("",!0)}}}),n0={class:"flex h-full flex-col bg-sidebar z-50 p-2 gap-2"},s0={class:"flex shrink-0 items-center justify-between gap-2"},i0={class:"flex items-center min-w-0 gap-1 flex-1"},o0={class:"flex flex-col"},a0={class:"truncate text-sm leading-4 font-medium text-foreground"},r0={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},l0={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},u0={class:"flex shrink-0 items-center justify-end gap-1"},c0={class:"flex-1 overflow-hidden min-h-0 flex flex-col"},d0={key:0,class:"rounded-xl border border-destructive/20 bg-destructive/5 p-4 text-sm text-destructive mx-2"},h0={key:1,class:"flex-1 w-full overflow-hidden rounded-xl border border-border/70 flex flex-col min-h-0 relative h-full"},f0=Y({__name:"ExportPreviewPanel",props:{result:{}},emits:["close"],setup(t,{emit:e}){const n=t,s=e,{downloadFile:i}=hi(),a=new Set(["csv","tsv"]),o=L(()=>a.has(n.result.format)),r={json:"json",sql:"sql",markdown:"markdown",xml:"xml",yaml:"yaml",html:"html"},l=L(()=>r[n.result.format]),u=L(()=>n.result.preview.columns??[]),c=L(()=>n.result.preview.rows??[]),h=L(()=>n.result.encoding==="base64"?`${n.result.filename} is a binary spreadsheet file. Use Download to open it locally.`:n.result.content),d=L(()=>u.value.map(b=>({originalName:b,aliasFieldName:b,queryFieldName:b,tableName:"",type:"string",isPrimaryKey:!1,isForeignKey:!1,canMutate:!1}))),f=async()=>{await i(n.result)},p=L(()=>{const b=n.result.fileSize;return xa(b)});return(b,m)=>{const g=de,P=ve,w=du;return x(),T("div",n0,[y("div",s0,[y("div",i0,[v(g,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),y("div",o0,[y("h3",a0,M(b.result.filename),1),b.result.preview.truncated?(x(),T("p",r0," First "+M(c.value.length)+" rows ",1)):(x(),T("p",l0," size: "+M(p.value)+" • type: "+M(b.result.format),1))])]),y("div",u0,[v(P,{size:"xs",variant:"outline",disabled:!!b.result.error,onClick:f},{default:A(()=>[m[1]||(m[1]=N(" Download ")),v(g,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"]),v(P,{size:"iconMd",variant:"ghost",onClick:m[0]||(m[0]=E=>s("close"))},{default:A(()=>[v(g,{name:"lucide:x",class:"size-4"})]),_:1})])]),y("div",c0,[b.result.error?(x(),T("div",d0,M(b.result.error),1)):o.value?(x(),T("div",h0,[v(zs,{columns:d.value,data:c.value,"column-key-by":"field",class:"h-full"},null,8,["columns","data"])])):(x(),K(w,{key:2,code:h.value,language:l.value,"max-height":"100%",class:"h-full rounded-xl overflow-auto border border-border/70"},null,8,["code","language"]))])])}}});function p0(t,e){return e.length===0?t:`[Tool hints]
|
|
7
|
+
${ul(e).map(i=>`${i.label}: ${i.promptHint}`).join(`
|
|
8
|
+
`)}
|
|
9
|
+
|
|
10
|
+
${t}`}function m0(t){const e=Ul(),n=ql(),s=ec({api:"/api/ai/agent",body:()=>{var o,r;return{dbConnectionString:(o=n.selectedConnection)==null?void 0:o.connectionString,dbType:(r=n.selectedConnection)==null?void 0:r.type,schemaSnapshots:e.activeSchemas||[],sendReasoning:(t==null?void 0:t.value)??!0}},sendAutomaticallyWhen:tc}),i=()=>{if(!Ql(s.messages.value))return;const o=Zl(s.messages.value);s.messages.value.splice(0,s.messages.value.length,...o)};return{...s,sendMessage:async(o,r=[])=>{i();const l=p0(o,r);await s.sendMessage(l)}}}const Ae={GenerateQuery:"generate_query",RenderTable:"render_table",VisualizeTable:"visualize_table",ExplainQuery:"explain_query",DetectAnomaly:"detect_anomaly",DescribeTable:"describe_table",ExportQueryResult:"export_query_result",ExportContent:"export_content",ListSchemas:"list_schemas",GetTableSchema:"get_table_schema",RenderErd:"render_erd",AskClarification:"askClarification"},g0=[Ae.GenerateQuery,Ae.RenderTable,Ae.VisualizeTable,Ae.ExplainQuery,Ae.DetectAnomaly,Ae.DescribeTable,Ae.ExportQueryResult,Ae.ExportContent,Ae.ListSchemas,Ae.GetTableSchema,Ae.RenderErd],v0=/^#{1,6}\s|(\*\*|__).+(\*\*|__)|^[-*]\s|^\d+\.\s|^\|.+\|/m,y0=/```([\w-]*)\n?([\s\S]*?)```/g,x0={generate_query:xy,render_table:Cy,visualize_table:Ry,explain_query:ay,detect_anomaly:Ev,describe_table:is,export_query_result:Zo,export_content:Zo,list_schemas:is,get_table_schema:is,render_erd:Zv},b0={generate_query:"Generating query...",render_table:"Running query...",visualize_table:"Building chart...",explain_query:"Analyzing query...",detect_anomaly:"Scanning data...",describe_table:"Reading schema...",export_query_result:"Fetching & exporting...",export_content:"Preparing export...",list_schemas:"Listing schemas...",get_table_schema:"Reading table schema...",render_erd:"Building ERD diagram..."},w0=t=>g0.includes(t),Jo=(t,e)=>{const n=e.trim();n&&t.push({kind:v0.test(n)?"markdown":"text",content:n})},_0=(t,e=!1)=>{var i;const n=[];let s=0;for(const a of t.matchAll(y0)){const o=a.index??0;Jo(n,t.slice(s,o));const r=a[1]||"text",l=((i=a[2])==null?void 0:i.trimEnd())||"";r==="mermaid"?n.push({kind:"mermaid",code:l}):n.push({kind:"code",language:r,code:l}),s=o+a[0].length}if(Jo(n,t.slice(s)),e)for(let a=n.length-1;a>=0;a-=1){const o=n[a];if((o==null?void 0:o.kind)==="text"||(o==null?void 0:o.kind)==="markdown"||(o==null?void 0:o.kind)==="code"){o.isStreaming=!0;break}}return n},cl=t=>t.errorText||t.message||t.error||"Something went wrong.",S0=t=>{var n,s,i;const e=String(t.type||"").replace(/^tool-/,"");return e===Ae.AskClarification?t.state==="output-available"?[{kind:"quiz",toolCallId:String(t.toolCallId||""),context:String(((n=t.input)==null?void 0:n.context)||""),questions:Array.isArray((s=t.input)==null?void 0:s.questions)?t.input.questions:[]}]:[]:w0(e)?t.state==="input-streaming"||t.state==="input-available"?[{kind:"loading",toolName:e,toolCallId:t.toolCallId,label:b0[e]}]:t.state==="approval-requested"?[{kind:"approval",toolName:e,toolCallId:t.toolCallId,input:t.input,approvalId:((i=t.approval)==null?void 0:i.id)||t.toolCallId}]:t.state==="output-available"?[{kind:"tool",toolName:e,toolCallId:t.toolCallId,result:t.output}]:t.state==="output-error"?[{kind:"error",message:cl(t)}]:t.state==="output-denied"?[{kind:"error",message:"Execution was denied. No database changes were made."}]:[]:[]},T0=t=>{if(t.type==="text")return _0(typeof t.text=="string"?t.text:"",t.state==="streaming");if(t.type==="reasoning"){const e=typeof t.text=="string"?t.text.trim():"";return e?[{kind:"reasoning",content:e,isStreaming:t.state==="streaming"}]:[]}return t.type==="source-url"?[{kind:"source",sourceId:t.sourceId||"",url:t.url,title:t.title}]:t.type==="source-document"?[{kind:"source",sourceId:t.sourceId||"",title:t.title,mediaType:t.mediaType,filename:t.filename}]:typeof t.type=="string"&&t.type.startsWith("tool-")?S0(t):t.type==="error"?[{kind:"error",message:cl(t)}]:[]};function k0(t){const e=L(()=>{const a=t.value??[],o=[];for(let r=0;r<a.length;r++){const l=a[r];if(l.role==="system")continue;const u=l.parts??[],c=[];for(let d=0;d<u.length;d++){const f=T0(u[d]);f!=null&&f.length&&c.push(...f)}if(c.length===0)continue;const h=[];for(const d of c){const f=h[h.length-1];if(d.kind==="reasoning"&&(f==null?void 0:f.kind)==="reasoning"){const p=[f.content,d.content].filter(Boolean).join(`
|
|
11
|
+
|
|
12
|
+
`);h[h.length-1]={kind:"reasoning",content:p,isStreaming:f.isStreaming||d.isStreaming}}else h.push(d)}o.push({id:l.id,role:l.role,blocks:h})}return o}),n=L(()=>e.value.some(a=>a.blocks.some(o=>o.kind==="approval"))),s=a=>x0[a]||null,i=L(()=>{const a=e.value[e.value.length-1];if(!a)return null;const o=a.blocks[a.blocks.length-1];return o?o.kind:null});return{renderedMessages:e,hasMutationPending:n,getComponent:s,getLastPartKindMessage:i}}const A0=["motion-key","initial"],ea="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=[]{}|;:,.<>?/~アイウエオカキクケコサシスセソタチツテトナニヌネノ░▒▓█▌▐▄▀■□▪▫▲△▼▽◆◇○●◎∞≈≠≤≥±÷×√∑πΩµ",C0=Y({__name:"ScrambleText",props:{texts:{},duration:{default:800},speed:{default:55},loop:{type:Boolean,default:!0},loopDelay:{default:600}},setup(t){const e=t,n=G([]);let s=0,i=0,a=0,o=0,r="scramble",l=0,u=[];function c(){return ea[Math.random()*ea.length|0]}function h(){return Math.random()>.5?1:-1}function d(){u=[...e.texts[o]],n.value=u.map(()=>({char:"",reveal:!1,dir:h(),v:0}))}function f(p){const b=u.length,m=b/2|0;i||(i=p);const g=p-i;if(r==="scramble"){if(p-a>e.speed){for(let P=0;P<b;P++)n.value[P].reveal||(n.value[P].char=c(),n.value[P].v++);a=p}g>e.duration&&(r="reveal",l=p)}if(r==="reveal"){const P=p-l;for(let w=0;w<b;w++){const E=Math.abs(w-m)*40;P>E&&!n.value[w].reveal&&(n.value[w].char=u[w],n.value[w].reveal=!0,n.value[w].v++)}P>m*40+200&&(r="wait",i=p)}r==="wait"&&p-i>e.loopDelay&&(o=(o+1)%e.texts.length,d(),r="scramble",i=p),s=requestAnimationFrame(f)}return Mn(()=>{d(),s=requestAnimationFrame(f)}),sa(()=>{cancelAnimationFrame(s)}),(p,b)=>{const m=Hl("motion");return x(),T("span",ia({class:"inline-flex select-none"},p.$attrs),[(x(!0),T(re,null,Se(n.value,(g,P)=>Kl((x(),T("span",{key:P,"motion-key":g.v,initial:{opacity:0,y:g.dir*16,scale:.9},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:260,damping:20},class:"inline-block will-change-transform transform-gpu"},[N(M(g.char),1)],8,A0)),[[m]])),128))],16)}}}),P0={class:"relative h-full w-full bg-[radial-gradient(circle_at_top,_hsl(var(--primary)/0.12),transparent_40%),linear-gradient(180deg,hsl(var(--background)),hsl(var(--background)))]"},M0={class:"absolute inset-0 flex flex-col overflow-hidden"},D0={class:"mx-auto shadow-xs flex w-full flex-col gap-4 px-3 py-2 lg:flex-row lg:items-center lg:justify-between bg-background/50 backdrop-blur-sm"},V0={class:"flex flex-1 items-center gap-2 min-w-0 text-sm leading-4 font-medium text-foreground"},L0={key:0,class:"flex-1 max-w-md"},E0={class:"truncate text-foreground"},$0={class:"flex shrink-0 items-center gap-2"},R0={class:"mx-auto flex min-h-full w-full max-w-5xl flex-col px-6 py-8"},I0={key:2,class:"w-full pb-6"},B0={class:"space-y-4"},O0={key:0,class:"flex gap-1 items-center mt-2"},F0={class:"font-medium text-muted-foreground chat-text"},j0={key:1,class:"mt-4 overflow-hidden rounded-2xl border border-destructive/15 bg-destructive/5 backdrop-blur-sm"},N0={class:"flex items-start gap-3 px-4 py-3"},z0={class:"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full bg-destructive/10"},U0={class:"min-w-0 flex-1"},q0={class:"mt-0.5 text-sm leading-relaxed text-destructive"},bx=Y({__name:"AgentWorkspace",setup(t){const e=G(null);na("activeExportPreview",e);const{activeHistory:n,histories:s,showAttachmentPanel:i,showReasoning:a,saveConversation:o,startNewChat:r,renameHistory:l}=Jl(),u=G(!1),c=G(""),h=G(null),d=()=>{n.value&&(c.value=n.value.title,u.value=!0,Be(()=>{var R,O;(R=h.value)==null||R.focus(),(O=h.value)==null||O.select()}))},f=()=>{if(!n.value||!u.value)return;const R=c.value.trim();R&&R!==n.value.title&&l(n.value.id,R),u.value=!1},p=()=>{u.value=!1},b=Gl(),m=L(()=>b.chatUiConfigs.thinkingStyle),{selectedProvider:g,selectedModel:P,isLoading:w,error:E,messages:D,hasApiKey:V,currentProvider:k,sendMessage:S,addToolApprovalResponse:B,stopStream:$}=m0(a),{renderedMessages:U,getComponent:F,getLastPartKindMessage:te}=k0(D),C=G(""),I=G([]),z=G(null),W=G(null),X=G(!1),q=G(null),Q=R=>JSON.parse(JSON.stringify(R)),Z=G(!1),J=G(null),ge=G(0),ue=G({});let $e=null;be(i,R=>{R&&(e.value=null)},{immediate:!0}),be(e,R=>{R&&(i.value=!1)});const ze=L(()=>U.value.flatMap(R=>{if(R.role!=="assistant")return[];const O=(R.blocks??[]).map(ne=>ne.kind==="text"||ne.kind==="markdown"||ne.kind==="reasoning"?ne.content:"").filter(Boolean).join(" ").trim().replace(/\s+/g," ");return[{id:R.id,type:"message",element:ue.value[R.id]??null,preview:O.length>80?O.slice(0,80)+"...":O||"Thinking..."}]})),xt=(R,O)=>{if(O instanceof HTMLElement){ue.value[R]=O;return}delete ue.value[R]},Re=()=>{if(!z.value||ze.value.length===0){ge.value=0;return}const{scrollTop:R,scrollHeight:O,clientHeight:ne}=z.value;if(O-R-ne<50){ge.value=ze.value.length-1;return}const Bt=z.value.getBoundingClientRect().top;let it=0;ze.value.forEach((Ot,rn)=>{var ln;(((ln=Ot.element)==null?void 0:ln.getBoundingClientRect().top)??1/0)-Bt<=150&&(it=rn)}),ge.value=it},Rt=()=>{if(!z.value)return;const{scrollTop:R,scrollHeight:O,clientHeight:ne}=z.value;Z.value=O-R-ne>150,Re()},Ve=(R=!1)=>{z.value&&(z.value.scrollTo({top:z.value.scrollHeight,behavior:R===!0?"smooth":"auto"}),Z.value=!1)};Mn(()=>{setTimeout(()=>{Ve()},100)});const bt=R=>{D.value.splice(0,D.value.length,...R)},wt=async R=>{if(R==null||R.preventDefault(),!C.value.trim()||w.value)return;const O=C.value.trim(),ne=[...I.value];C.value="",I.value=[],S(O,ne),await Be(),Ve()},sn=R=>{R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),wt(R))},on=async R=>{C.value=R,await Be(),await wt()},tt=()=>{$()},Ke=()=>{r(),I.value=[],bt([])},nt=async(R,O)=>{await B({id:R,approved:O})},Rn=async R=>{var O;C.value=R,await Be(),(O=W.value)==null||O.focusInput()},Ge=R=>{const O=ze.value[R];if(!(O!=null&&O.element)||(ge.value=R,J.value=O.id,$e&&clearTimeout($e),$e=setTimeout(()=>{J.value=null},250),!z.value))return;const ne=z.value,Bt=O.element.getBoundingClientRect().top,it=ne.getBoundingClientRect().top,Ot=ne.scrollTop;ne.scrollTo({top:Ot+(Bt-it)-24,behavior:"smooth"})},In=Xl(()=>{X.value||D.value.length===0||o({messages:Q(D.value),provider:g.value,model:P.value,showReasoning:a.value})},250);be(()=>{var R;return((R=n.value)==null?void 0:R.id)??null},async R=>{R!==q.value&&(X.value=!0,q.value=R,R&&n.value?(bt(Q(n.value.messages)),n.value.provider&&(g.value=n.value.provider),n.value.model&&(P.value=n.value.model),typeof n.value.showReasoning=="boolean"&&(a.value=n.value.showReasoning)):D.value.length>0&&bt([]),await Be(),Ve(),X.value=!1)},{immediate:!0}),be(()=>D.value.length,async()=>{await Be(),Ve(),Re()}),be(()=>{const R=D.value.at(-1);return R!=null&&R.parts?R.parts.map(O=>O.type==="text"||O.type==="reasoning"?O.text||"":JSON.stringify(O)).join(""):""},async()=>{await Be(),Ve(),Re()}),be(()=>U.value.flatMap(R=>R.role!=="assistant"?[]:[R.id]),R=>{const O={};for(const ne of R)ue.value[ne]&&(O[ne]=ue.value[ne]);ue.value=O}),Fs(()=>{$e&&clearTimeout($e)}),be(()=>[D.value,P.value,g.value,a.value],()=>{!D.value.length||X.value||In()},{deep:!0});const st=L(()=>{const R=D.value[0];if(!R||!R.parts||!R.parts.length)return"New Chat";const O=R.parts[0];return typeof O=="object"&&"text"in O?O.text:"New Chat"}),an=async R=>{await S(R),await Be(),Ve()},It=L(()=>["Summarize the current schema and highlight the tables that matter most.","Suggest safe next steps for debugging a slow database query.","Write a query plan for the report I need before generating SQL."].filter(R=>!!R)),dl=L(()=>U.value),{attachments:hl}=ll(dl),mi=L(()=>hl.value.length);return(R,O)=>{const ne=de,Bt=Wl,it=ve,Ot=di,rn=eu,gi=tu,ln=nu;return x(),T("section",P0,[v(ln,{direction:"horizontal",class:"h-full w-full"},{default:A(()=>[v(rn,{"default-size":e.value||_(i)?60:100,class:"h-full relative"},{default:A(()=>{var un;return[y("div",M0,[y("div",D0,[y("div",V0,[v(ne,{name:"hugeicons:chatting-01",class:"size-4! shrink-0"}),u.value?(x(),T("div",L0,[v(Bt,{ref_key:"titleInputRef",ref:h,modelValue:c.value,"onUpdate:modelValue":O[0]||(O[0]=he=>c.value=he),class:"h-7 text-xs py-0",onKeydown:[wi(f,["enter"]),wi(p,["escape"])],onBlur:f},null,8,["modelValue"])])):(x(),T("div",{key:1,class:"flex items-center gap-2 truncate group cursor-pointer",onClick:d},[y("span",E0,M(((un=_(n))==null?void 0:un.title)||st.value),1),v(ne,{name:"hugeicons:edit-02",class:"size-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]))]),y("div",$0,[v(it,{size:"xs",variant:"ghost",onClick:O[1]||(O[1]=he=>i.value=!_(i)),class:"relative"},{default:A(()=>[O[10]||(O[10]=N(" Attachment ")),v(ne,{name:"hugeicons:attachment",class:"size-3"}),mi.value>0?(x(),K(_(Te),{key:0,variant:"secondary",class:"absolute -top-1 -right-1 h-4 min-w-4 px-1 text-xxs font-normal"},{default:A(()=>[N(M(mi.value),1)]),_:1})):H("",!0)]),_:1}),v(it,{size:"xs",variant:"outline",onClick:Ke},{default:A(()=>[O[11]||(O[11]=N(" New Thread ")),v(ne,{name:"hugeicons:plus-sign",class:"size-3"})]),_:1})])]),y("div",{ref_key:"messagesContainer",ref:z,class:"flex-1 overflow-y-auto min-h-0",onScroll:Rt},[y("div",R0,[_(V)?_(U).length===0?(x(),K(Gy,{key:1,"prompt-cards":It.value,"thread-count":_(s).length,onPrompt:on},null,8,["prompt-cards","thread-count"])):(x(),T("div",I0,[y("div",B0,[(x(!0),T(re,null,Se(_(U),he=>{var vi;return x(),T("div",{key:he.id},[v(Oy,{message:he,"get-tool-component":_(F),"show-reasoning":_(a),"highlighted-response-id":J.value,"register-message-element":xt,"is-streaming":_(w)&&he.role==="assistant"&&he.id===((vi=_(U).at(-1))==null?void 0:vi.id),onApproval:nt,onEdit:Rn,onQuizSubmit:an},null,8,["message","get-tool-component","show-reasoning","highlighted-response-id","is-streaming"])])}),128))]),_(w)?(x(),T("div",O0,[v(ne,{class:"size-7! text-primary",name:"icons:logo-8-bits"}),y("div",F0,[m.value===_(Yl).Shimmer?(x(),K(Ot,{key:0},{default:A(()=>O[12]||(O[12]=[N(" Thinking... ")])),_:1})):(x(),K(_(C0),{key:1,texts:["Thinking...","Orca_Thinking",_(te)||""]},null,8,["texts"]))])])):H("",!0),_(E)?(x(),T("div",j0,[y("div",N0,[y("div",z0,[v(ne,{name:"lucide:alert-triangle",class:"size-3.5 text-destructive/90"})]),y("div",U0,[O[13]||(O[13]=y("p",{class:"text-[11px] font-semibold uppercase tracking-wider text-destructive/70"}," Error ",-1)),y("p",q0,M(_(E)),1)])])])):H("",!0)])):(x(),K(Ny,{key:0,class:"my-auto","current-provider":_(k)},null,8,["current-provider"]))])],544),ze.value.length>0?(x(),K(t0,{key:0,responses:ze.value,"current-index":ge.value,onNavigate:Ge},null,8,["responses","current-index"])):H("",!0),v(Sv,{ref_key:"footerRef",ref:W,modelValue:C.value,"onUpdate:modelValue":O[2]||(O[2]=he=>C.value=he),provider:_(g),"onUpdate:provider":O[3]||(O[3]=he=>_i(g)?g.value=he:null),model:_(P),"onUpdate:model":O[4]||(O[4]=he=>_i(P)?P.value=he:null),"selected-command-options":I.value,"onUpdate:selectedCommandOptions":O[5]||(O[5]=he=>I.value=he),"is-loading":_(w),"has-api-key":_(V),"show-reasoning":_(a),"show-scroll-button":Z.value,onSubmit:wt,onStop:tt,onKeydown:sn,"onUpdate:showReasoning":O[6]||(O[6]=he=>a.value=he),onScrollToBottom:O[7]||(O[7]=he=>Ve(!0))},null,8,["modelValue","provider","model","selected-command-options","is-loading","has-api-key","show-reasoning","show-scroll-button"])])]}),_:1},8,["default-size"]),e.value||_(i)?(x(),T(re,{key:0},[v(gi,{"with-handle":"",class:"[&[data-state=hover]]:bg-primary/30! [&[data-state=drag]]:bg-primary/20!"}),v(rn,{"min-size":20,"max-size":60,"default-size":30,class:"h-full relative"},{default:A(()=>[e.value?(x(),K(f0,{key:0,result:e.value,onClose:O[8]||(O[8]=un=>e.value=null)},null,8,["result"])):_(i)?(x(),K(Qg,{key:1,messages:_(U),onClose:O[9]||(O[9]=un=>i.value=!1)},null,8,["messages"])):H("",!0)]),_:1})],64)):H("",!0)]),_:1})])}}});export{bx as default};
|