@popmelt.com/core 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +11 -15
  2. package/THIRD_PARTY_NOTICES.md +26 -0
  3. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  4. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  5. package/dist/ExploreAttachment-H5WPEAZB.mjs +1 -0
  6. package/dist/{PagePreviewLayer-TJZOJBSD.mjs → PagePreviewLayer-WCYOBKAS.mjs} +1 -1
  7. package/dist/ParticipantRuntime-HEC26AER.mjs +1 -0
  8. package/dist/{PhoneHostGate-LNSDZOG2.mjs → PhoneHostGate-Q2AXVOSH.mjs} +1 -1
  9. package/dist/PopmeltTasteConnectedPane-B7DHQKRQ.mjs +1 -0
  10. package/dist/QueuedReplies-ESIFFRKS.mjs +1 -0
  11. package/dist/{SuppliedContext-YKQSMF3J.mjs → SuppliedContext-7ASO6GAW.mjs} +1 -1
  12. package/dist/ThreadErrorCard-6R7W3RGZ.mjs +1 -0
  13. package/dist/ThreadPanel-3IS7GUYS.mjs +1 -0
  14. package/dist/bridge-entry.mjs +1 -1
  15. package/dist/browser-runtime-ILNTJLZ5.mjs +1 -0
  16. package/dist/browser.mjs +1 -1
  17. package/dist/{checkFixture-BXILOUP5.mjs → checkFixture-YE2ROOLL.mjs} +1 -1
  18. package/dist/{chunk-AYDREFWN.mjs → chunk-26P7UUHT.mjs} +1 -1
  19. package/dist/chunk-3SEXH3AZ.mjs +1 -0
  20. package/dist/chunk-3XJEC6LS.mjs +1 -0
  21. package/dist/chunk-7CGKO4IU.mjs +30 -0
  22. package/dist/{chunk-M5P6VHZY.mjs → chunk-AH6LZOQC.mjs} +1 -1
  23. package/dist/{chunk-ZG6XHKYO.mjs → chunk-BACXPVHP.mjs} +1 -1
  24. package/dist/{chunk-N4737FRL.mjs → chunk-DLUNNAZC.mjs} +1 -1
  25. package/dist/chunk-EXIUW3JX.mjs +1 -0
  26. package/dist/chunk-FLTHWLRC.mjs +1 -0
  27. package/dist/chunk-GBVPRXA3.mjs +1 -0
  28. package/dist/chunk-L7QONR4K.mjs +1 -0
  29. package/dist/chunk-MSWXKP77.mjs +1 -0
  30. package/dist/chunk-NWE5PYKM.mjs +1 -0
  31. package/dist/{chunk-XG2YIAJS.mjs → chunk-OZBMHEOD.mjs} +1 -1
  32. package/dist/chunk-PNTM77NT.mjs +1 -0
  33. package/dist/chunk-TLREGQQB.mjs +1 -0
  34. package/dist/chunk-TUXBMJQZ.mjs +1 -0
  35. package/dist/chunk-X2Q3H6X7.mjs +1 -0
  36. package/dist/chunk-XJQJQ5V5.mjs +1 -0
  37. package/dist/chunk-YHYFWNN6.mjs +1 -0
  38. package/dist/{chunk-KTRMNVPZ.mjs → chunk-ZDXQ7WNW.mjs} +1 -1
  39. package/dist/cli.mjs +1 -1
  40. package/dist/codex-note-context-YFURG7VL.mjs +1 -0
  41. package/dist/{codex-project-B5466BL6.mjs → codex-project-3NSU5OWL.mjs} +1 -1
  42. package/dist/index.mjs +1 -1
  43. package/dist/memory-store.d.mts +1 -1
  44. package/dist/peer-client-56EAHIGF.mjs +1 -0
  45. package/dist/plugin-astro.mjs +1 -1
  46. package/dist/plugin-nuxt.mjs +1 -1
  47. package/dist/plugin-vite.d.mts +17 -0
  48. package/dist/plugin-vite.mjs +1 -1
  49. package/dist/server.d.mts +3 -3
  50. package/dist/server.mjs +1 -1
  51. package/dist/{types-C8tjyhiF.d.mts → types-g9YCBx4Z.d.mts} +2 -1
  52. package/package.json +2 -1
  53. package/dist/ExploreAttachment-TTEKD4AU.mjs +0 -1
  54. package/dist/ParticipantRuntime-BQAOTSQZ.mjs +0 -1
  55. package/dist/PopmeltTasteConnectedPane-NCCF7YUX.mjs +0 -1
  56. package/dist/QueuedReplies-LQUBEZ6K.mjs +0 -1
  57. package/dist/ThreadErrorCard-4MOA34C4.mjs +0 -1
  58. package/dist/ThreadPanel-T6IXWFLA.mjs +0 -1
  59. package/dist/browser-runtime-HQM2Y6EL.mjs +0 -1
  60. package/dist/chunk-66VOM5NA.mjs +0 -1
  61. package/dist/chunk-CRJPE33X.mjs +0 -1
  62. package/dist/chunk-DOJBWTT5.mjs +0 -1
  63. package/dist/chunk-F45IVFS3.mjs +0 -1
  64. package/dist/chunk-F5XSNRGT.mjs +0 -1
  65. package/dist/chunk-GKOMTSWV.mjs +0 -1
  66. package/dist/chunk-PQT5FYN5.mjs +0 -1
  67. package/dist/chunk-R34FOW4D.mjs +0 -1
  68. package/dist/chunk-S7BCEQKP.mjs +0 -1
  69. package/dist/chunk-T4CCY2EL.mjs +0 -1
  70. package/dist/chunk-TH7DML4A.mjs +0 -1
  71. package/dist/chunk-UEGDSECJ.mjs +0 -1
  72. package/dist/chunk-Y3SF5YCR.mjs +0 -1
  73. package/dist/chunk-ZG7MAEEV.mjs +0 -30
  74. package/dist/codex-note-context-OUG4S6XE.mjs +0 -1
  75. package/dist/peer-client-SCSWLRCX.mjs +0 -1
  76. /package/dist/{chunk-6LBPTCGC.mjs → chunk-G6RYESYI.mjs} +0 -0
  77. /package/dist/{chunk-XM6RE6HT.mjs → chunk-YD3PDEFX.mjs} +0 -0
@@ -1 +0,0 @@
1
- "use client";import{forwardRef as a}from"react";import{jsxs as h,Fragment as d,jsx as t}from"react/jsx-runtime";function e(d,t){return a(function({size:a=24,width:e=a,height:i=a,color:c="currentColor",className:l,children:r,...p},n){let M=!!r||Object.keys(p).some(a=>a.startsWith("aria-")||"role"===a||"title"===a);return h("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",width:e,height:i,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:l?`lucide ${d} ${l}`:`lucide ${d}`,"aria-hidden":!M||void 0,...p,children:[t,r]})})}var i=e("lucide-a-large-small",h(d,{children:[t("path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16"}),t("path",{d:"M15.697 14h5.606"}),t("path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16"}),t("path",{d:"M3.304 13h6.392"})]})),c=e("lucide-text-align-center lucide-align-center",h(d,{children:[t("path",{d:"M21 5H3"}),t("path",{d:"M17 12H7"}),t("path",{d:"M19 19H5"})]})),l=e("lucide-align-center-vertical",h(d,{children:[t("path",{d:"M12 2v20"}),t("path",{d:"M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4"}),t("path",{d:"M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4"}),t("path",{d:"M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1"}),t("path",{d:"M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1"})]})),r=e("lucide-align-end-vertical",h(d,{children:[t("rect",{width:"16",height:"6",x:"2",y:"4",rx:"2"}),t("rect",{width:"9",height:"6",x:"9",y:"14",rx:"2"}),t("path",{d:"M22 22V2"})]})),p=e("lucide-align-horizontal-justify-center",h(d,{children:[t("rect",{width:"6",height:"14",x:"2",y:"5",rx:"2"}),t("rect",{width:"6",height:"10",x:"16",y:"7",rx:"2"}),t("path",{d:"M12 2v20"})]})),n=e("lucide-align-horizontal-justify-end",h(d,{children:[t("rect",{width:"6",height:"14",x:"2",y:"5",rx:"2"}),t("rect",{width:"6",height:"10",x:"12",y:"7",rx:"2"}),t("path",{d:"M22 2v20"})]})),M=e("lucide-align-horizontal-justify-start",h(d,{children:[t("rect",{width:"6",height:"14",x:"6",y:"5",rx:"2"}),t("rect",{width:"6",height:"10",x:"16",y:"7",rx:"2"}),t("path",{d:"M2 2v20"})]})),s=e("lucide-align-horizontal-space-around",h(d,{children:[t("rect",{width:"6",height:"10",x:"9",y:"7",rx:"2"}),t("path",{d:"M4 22V2"}),t("path",{d:"M20 22V2"})]})),u=e("lucide-align-horizontal-space-between",h(d,{children:[t("rect",{width:"6",height:"14",x:"3",y:"5",rx:"2"}),t("rect",{width:"6",height:"10",x:"15",y:"7",rx:"2"}),t("path",{d:"M3 2v20"}),t("path",{d:"M21 2v20"})]})),o=e("lucide-text-align-justify lucide-align-justify",h(d,{children:[t("path",{d:"M3 5h18"}),t("path",{d:"M3 12h18"}),t("path",{d:"M3 19h18"})]})),x=e("lucide-text-align-start lucide-text lucide-align-left",h(d,{children:[t("path",{d:"M21 5H3"}),t("path",{d:"M15 12H3"}),t("path",{d:"M17 19H3"})]})),v=e("lucide-text-align-end lucide-align-right",h(d,{children:[t("path",{d:"M21 5H3"}),t("path",{d:"M21 12H9"}),t("path",{d:"M21 19H7"})]})),g=e("lucide-align-start-vertical",h(d,{children:[t("rect",{width:"9",height:"6",x:"6",y:"14",rx:"2"}),t("rect",{width:"16",height:"6",x:"6",y:"4",rx:"2"}),t("path",{d:"M2 2v20"})]})),m=e("lucide-archive",h(d,{children:[t("rect",{width:"20",height:"5",x:"2",y:"3",rx:"1"}),t("path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"}),t("path",{d:"M10 12h4"})]})),y=e("lucide-arrow-down",h(d,{children:[t("path",{d:"M12 5v14"}),t("path",{d:"m19 12-7 7-7-7"})]})),w=e("lucide-arrow-left",h(d,{children:[t("path",{d:"m12 19-7-7 7-7"}),t("path",{d:"M19 12H5"})]})),H=e("lucide-arrow-left-right",h(d,{children:[t("path",{d:"M8 3 4 7l4 4"}),t("path",{d:"M4 7h16"}),t("path",{d:"m16 21 4-4-4-4"}),t("path",{d:"M20 17H4"})]})),z=e("lucide-arrow-right",h(d,{children:[t("path",{d:"M5 12h14"}),t("path",{d:"m12 5 7 7-7 7"})]})),f=e("lucide-arrow-up-right",h(d,{children:[t("path",{d:"M7 7h10v10"}),t("path",{d:"M7 17 17 7"})]})),V=e("lucide-ban",h(d,{children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M4.929 4.929 19.07 19.071"})]})),L=e("lucide-between-horizontal-start lucide-between-horizonal-start",h(d,{children:[t("rect",{width:"13",height:"7",x:"8",y:"3",rx:"1"}),t("path",{d:"m2 9 3 3-3 3"}),t("rect",{width:"13",height:"7",x:"8",y:"14",rx:"1"})]})),k=e("lucide-between-vertical-end",h(d,{children:[t("rect",{width:"7",height:"13",x:"3",y:"3",rx:"1"}),t("path",{d:"m9 22 3-3 3 3"}),t("rect",{width:"7",height:"13",x:"14",y:"3",rx:"1"})]})),b=e("lucide-blend",h(d,{children:[t("circle",{cx:"15",cy:"9",r:"7"}),t("circle",{cx:"9",cy:"15",r:"7"})]})),A=e("lucide-letter-b lucide-bold",t("path",{d:"M6 12h9a4 4 0 010 8H7a1 1 0 01-1-1V5a1 1 0 011-1h7a4 4 0 010 8"})),j=e("lucide-bot",h(d,{children:[t("path",{d:"M12 8V4H8"}),t("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),t("path",{d:"M2 14h2"}),t("path",{d:"M20 14h2"}),t("path",{d:"M15 13v2"}),t("path",{d:"M9 13v2"})]})),C=e("lucide-brain",h(d,{children:[t("path",{d:"M12 18V5"}),t("path",{d:"M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4"}),t("path",{d:"M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294"}),t("path",{d:"M17.996 5.125a4 4 0 012.526 5.77"}),t("path",{d:"M18 18a4 4 0 002-7.465"}),t("path",{d:"M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517"}),t("path",{d:"M6 18a4 4 0 01-2-7.465"}),t("path",{d:"M6.004 5.125a4 4 0 00-2.526 5.77"})]})),q=e("lucide-check",t("path",{d:"M20 6 9 17l-5-5"})),N=e("lucide-chevron-down",t("path",{d:"m6 9 6 6 6-6"})),Z=e("lucide-chevron-left",t("path",{d:"m15 18-6-6 6-6"})),$=e("lucide-chevron-right",t("path",{d:"m9 18 6-6-6-6"})),B=e("lucide-circle-dashed",h(d,{children:[t("path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0"}),t("path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0"}),t("path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7"}),t("path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8"}),t("path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69"}),t("path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8"}),t("path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69"}),t("path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7"})]})),W=e("lucide-clock",h(d,{children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M12 6v6l4 2"})]})),D=e("lucide-command",t("path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3"})),E=e("lucide-component",h(d,{children:[t("path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}),t("path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z"}),t("path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z"}),t("path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"})]})),F=e("lucide-copy",h(d,{children:[t("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),t("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})),G=e("lucide-corner-down-left",h(d,{children:[t("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"}),t("path",{d:"m9 10-5 5 5 5"})]})),I=e("lucide-eye",h(d,{children:[t("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),t("circle",{cx:"12",cy:"12",r:"3"})]})),J=e("lucide-eye-off",h(d,{children:[t("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),t("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),t("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),t("path",{d:"m2 2 20 20"})]})),K=e("lucide-fingerprint-pattern lucide-fingerprint",h(d,{children:[t("path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4"}),t("path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88"}),t("path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02"}),t("path",{d:"M2 12a10 10 0 0 1 18-6"}),t("path",{d:"M2 16h.01"}),t("path",{d:"M21.8 16c.2-2 .131-5.354 0-6"}),t("path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2"}),t("path",{d:"M8.65 22c.21-.66.45-1.32.57-2"}),t("path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2"})]})),O=e("lucide-folder",t("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})),P=e("lucide-hand",h(d,{children:[t("path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2"}),t("path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2"}),t("path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8"}),t("path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"})]})),Q=e("lucide-rotate-ccw-clock lucide-history",h(d,{children:[t("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),t("path",{d:"M3 3v5h5"}),t("path",{d:"M12 7v5l4 2"})]})),R=e("lucide-image",h(d,{children:[t("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),t("circle",{cx:"9",cy:"9",r:"2"}),t("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})),S=e("lucide-info",h(d,{children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M12 16v-4"}),t("path",{d:"M12 8h.01"})]})),T=e("lucide-link-2",h(d,{children:[t("path",{d:"M9 17H7A5 5 0 0 1 7 7h2"}),t("path",{d:"M15 7h2a5 5 0 1 1 0 10h-2"}),t("line",{x1:"8",x2:"16",y1:"12",y2:"12"})]})),U=e("lucide-loader-circle lucide-loader-2",t("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})),X=e("lucide-lock",h(d,{children:[t("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),t("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})),Y=e("lucide-lock-open lucide-unlock",h(d,{children:[t("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),t("path",{d:"M7 11V7a5 5 0 0 1 9.9-1"})]})),_=e("lucide-log-out",h(d,{children:[t("path",{d:"m16 17 5-5-5-5"}),t("path",{d:"M21 12H9"}),t("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"})]})),aa=e("lucide-maximize-2",h(d,{children:[t("path",{d:"M15 3h6v6"}),t("path",{d:"m21 3-7 7"}),t("path",{d:"m3 21 7-7"}),t("path",{d:"M9 21H3v-6"})]})),ha=e("lucide-message-circle",t("path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"})),da=e("lucide-message-circle-question-mark lucide-message-circle-question",h(d,{children:[t("path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"}),t("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),t("path",{d:"M12 17h.01"})]})),ta=e("lucide-minimize-2",h(d,{children:[t("path",{d:"m14 10 7-7"}),t("path",{d:"M20 10h-6V4"}),t("path",{d:"m3 21 7-7"}),t("path",{d:"M4 14h6v6"})]})),ea=e("lucide-minus",t("path",{d:"M5 12h14"})),ia=e("lucide-monitor",h(d,{children:[t("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),t("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),t("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})),ca=e("lucide-moon",t("path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"})),la=e("lucide-move",h(d,{children:[t("path",{d:"M12 2v20"}),t("path",{d:"m15 19-3 3-3-3"}),t("path",{d:"m19 9 3 3-3 3"}),t("path",{d:"M2 12h20"}),t("path",{d:"m5 9-3 3 3 3"}),t("path",{d:"m9 5 3-3 3 3"})]})),ra=e("lucide-move-horizontal",h(d,{children:[t("path",{d:"m18 8 4 4-4 4"}),t("path",{d:"M2 12h20"}),t("path",{d:"m6 8-4 4 4 4"})]})),pa=e("lucide-move-vertical",h(d,{children:[t("path",{d:"M12 2v20"}),t("path",{d:"m8 18 4 4 4-4"}),t("path",{d:"m8 6 4-4 4 4"})]})),na=e("lucide-octagon-alert lucide-alert-octagon",h(d,{children:[t("path",{d:"M12 16h.01"}),t("path",{d:"M12 8v4"}),t("path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z"})]})),Ma=e("lucide-palette",h(d,{children:[t("path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"}),t("circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor"}),t("circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor"}),t("circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor"}),t("circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor"})]})),sa=e("lucide-pause",h(d,{children:[t("rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}),t("rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"})]})),ua=e("lucide-pen-line lucide-edit-3",h(d,{children:[t("path",{d:"M13 21h8"}),t("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"})]})),oa=e("lucide-play",t("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})),xa=e("lucide-plug",h(d,{children:[t("path",{d:"M12 22v-5"}),t("path",{d:"M15 8V2"}),t("path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z"}),t("path",{d:"M9 8V2"})]})),va=e("lucide-plus",h(d,{children:[t("path",{d:"M5 12h14"}),t("path",{d:"M12 5v14"})]})),ga=e("lucide-refresh-cw",h(d,{children:[t("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),t("path",{d:"M21 3v5h-5"}),t("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),t("path",{d:"M8 16H3v5"})]})),ma=e("lucide-reply",h(d,{children:[t("path",{d:"M20 18v-2a4 4 0 0 0-4-4H4"}),t("path",{d:"m9 17-5-5 5-5"})]})),ya=e("lucide-rotate-ccw",h(d,{children:[t("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),t("path",{d:"M3 3v5h5"})]})),wa=e("lucide-rotate-cw",h(d,{children:[t("path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}),t("path",{d:"M21 3v5h-5"})]})),Ha=e("lucide-ruler",h(d,{children:[t("path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z"}),t("path",{d:"m14.5 12.5 2-2"}),t("path",{d:"m11.5 9.5 2-2"}),t("path",{d:"m8.5 6.5 2-2"}),t("path",{d:"m17.5 15.5 2-2"})]})),za=e("lucide-scaling",h(d,{children:[t("path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),t("path",{d:"M14 15H9v-5"}),t("path",{d:"M16 3h5v5"}),t("path",{d:"M21 3 9 15"})]})),fa=e("lucide-search",h(d,{children:[t("path",{d:"m21 21-4.34-4.34"}),t("circle",{cx:"11",cy:"11",r:"8"})]})),Va=e("lucide-send",h(d,{children:[t("path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"}),t("path",{d:"m21.854 2.147-10.94 10.939"})]})),La=e("lucide-send-horizontal lucide-send-horizonal",h(d,{children:[t("path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z"}),t("path",{d:"M6 12h16"})]})),ka=e("lucide-settings",h(d,{children:[t("path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}),t("circle",{cx:"12",cy:"12",r:"3"})]})),ba=e("lucide-signal",h(d,{children:[t("path",{d:"M2 20h.01"}),t("path",{d:"M7 20v-4"}),t("path",{d:"M12 20v-8"}),t("path",{d:"M17 20V8"}),t("path",{d:"M22 4v16"})]})),Aa=e("lucide-signal-high",h(d,{children:[t("path",{d:"M2 20h.01"}),t("path",{d:"M7 20v-4"}),t("path",{d:"M12 20v-8"}),t("path",{d:"M17 20V8"})]})),ja=e("lucide-signal-low",h(d,{children:[t("path",{d:"M2 20h.01"}),t("path",{d:"M7 20v-4"})]})),Ca=e("lucide-signal-medium",h(d,{children:[t("path",{d:"M2 20h.01"}),t("path",{d:"M7 20v-4"}),t("path",{d:"M12 20v-8"})]})),qa=e("lucide-signal-zero",t("path",{d:"M2 20h.01"})),Na=e("lucide-sliders-horizontal",h(d,{children:[t("path",{d:"M10 5H3"}),t("path",{d:"M12 19H3"}),t("path",{d:"M14 3v4"}),t("path",{d:"M16 17v4"}),t("path",{d:"M21 12h-9"}),t("path",{d:"M21 19h-5"}),t("path",{d:"M21 5h-7"}),t("path",{d:"M8 10v4"}),t("path",{d:"M8 12H3"})]})),Za=e("lucide-square-mouse-pointer lucide-inspect",h(d,{children:[t("path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"}),t("path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"})]})),$a=e("lucide-stretch-horizontal",h(d,{children:[t("rect",{width:"20",height:"6",x:"2",y:"4",rx:"2"}),t("rect",{width:"20",height:"6",x:"2",y:"14",rx:"2"})]})),Ba=e("lucide-sun",h(d,{children:[t("circle",{cx:"12",cy:"12",r:"4"}),t("path",{d:"M12 2v2"}),t("path",{d:"M12 20v2"}),t("path",{d:"m4.93 4.93 1.41 1.41"}),t("path",{d:"m17.66 17.66 1.41 1.41"}),t("path",{d:"M2 12h2"}),t("path",{d:"M20 12h2"}),t("path",{d:"m6.34 17.66-1.41 1.41"}),t("path",{d:"m19.07 4.93-1.41 1.41"})]})),Wa=e("lucide-terminal",h(d,{children:[t("path",{d:"M12 19h8"}),t("path",{d:"m4 17 6-6-6-6"})]})),Da=e("lucide-thumbs-up",h(d,{children:[t("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"}),t("path",{d:"M7 10v12"})]})),Ea=e("lucide-trash lucide-trash-2",h(d,{children:[t("path",{d:"M10 11v6"}),t("path",{d:"M14 11v6"}),t("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),t("path",{d:"M3 6h18"}),t("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})),Fa=e("lucide-triangle-alert lucide-alert-triangle",h(d,{children:[t("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),t("path",{d:"M12 9v4"}),t("path",{d:"M12 17h.01"})]})),Ga=e("lucide-user",h(d,{children:[t("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),t("circle",{cx:"12",cy:"7",r:"4"})]})),Ia=e("lucide-user-plus",h(d,{children:[t("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),t("circle",{cx:"9",cy:"7",r:"4"}),t("line",{x1:"19",x2:"19",y1:"8",y2:"14"}),t("line",{x1:"22",x2:"16",y1:"11",y2:"11"})]})),Ja=e("lucide-x",h(d,{children:[t("path",{d:"M18 6 6 18"}),t("path",{d:"m6 6 12 12"})]})),Ka=e("lucide-zap",t("path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z"}));export{ta as $,C as A,Ca as Aa,q as B,qa as Ba,N as C,Na as Ca,Z as D,Za as Da,$ as E,$a as Ea,B as F,Ba as Fa,W as G,Wa as Ga,D as H,Da as Ha,E as I,Ea as Ia,F as J,Fa as Ja,G as K,Ga as Ka,I as L,Ia as La,J as M,Ja as Ma,K as N,Ka as Na,O,P,Q,R,S,T,U,X as V,Y as W,_ as X,aa as Y,ha as Z,da as _,e as a,ea as aa,i as b,ia as ba,c,ca,l as d,la as da,r as e,ra as ea,p as f,pa as fa,n as g,na as ga,M as h,Ma as ha,s as i,sa as ia,u as j,ua as ja,o as k,oa as ka,x as l,xa as la,v as m,va as ma,g as n,ga as na,m as o,ma as oa,y as p,ya as pa,w as q,wa as qa,H as r,Ha as ra,z as s,za as sa,f as t,fa as ta,V as u,Va as ua,L as v,La as va,k as w,ka as wa,b as x,ba as xa,A as y,Aa as ya,j as z,ja as za};
@@ -1 +0,0 @@
1
- "use client";import{forwardRef as e,useId as t,useRef as r,useState as n,useLayoutEffect as o,useEffect as i}from"react";import{createPortal as l}from"react-dom";import{jsx as a,jsxs as d}from"react/jsx-runtime";var c=e(function({style:e,...t},r){return a("span",{...t,ref:r,role:"tooltip",style:{background:"var(--popmelt-thread-raised, #222)",color:"var(--popmelt-thread-primary, #eee)",borderRadius:16,boxSizing:"border-box",...e}})}),s=new WeakMap;function u(e){return e.closest("[data-popmelt-tooltip-group]")??e.parentElement}function p({hint:e,above:p,anchorRef:m,children:h,...v}){let f=t(),g=r(null),y=r(null),b=r(!1),x=r(!1),[w,E]=n("closed"),M="entering"===w||"instant"===w,R="closed"!==w?g.current:null,L=R?.closest('[data-popmelt-tooltip-boundary], [data-devtools="thread-panel"]'),W=R?.getRootNode(),k=L??(W&&"host"in W?W:R?.ownerDocument.body);function z(e,t){let r=u(e),n=r&&s.get(r),o=!1;if(n&&n.tip!==y.current){let r=e.ownerDocument.defaultView;o=t&&!!r&&Number(r.getComputedStyle(n.tip).opacity)>0,n.close()}E(o?"instant":"entering")}return o(()=>{let e=y.current,t=R?.ownerDocument.defaultView;if(!R||!e||!t)return;let r=m?.current??R,n=()=>{let n=L?.getBoundingClientRect(),o=r.getBoundingClientRect(),i=Math.max(n?.left??0,0)+8,l=Math.min(n?.right??t.innerWidth,t.innerWidth)-8,a=Math.max(n?.top??0,0)+8,d=Math.min(n?.bottom??t.innerHeight,t.innerHeight)-8;e.style.maxWidth=Math.max(0,Math.min(180,l-i))+"px";let{width:c,height:s}=e.getBoundingClientRect();if(o.right<=i||o.left>=l||o.bottom<=a||o.top>=d||c>l-i||s>d-a)return void(e.style.visibility="hidden");let u=(e,t,r)=>Math.max(t,Math.min(e,r)),m=u(o.left+(o.width-c)/2,i,l-c),h=o.top-s-4,v=o.bottom+4,f=u((p?h>=a:v+s>d)?h:v,a,d-s);e.style.left=m-(n?.left??0)-(L?.clientLeft??0)+"px",e.style.top=f-(n?.top??0)-(L?.clientTop??0)+"px",e.style.visibility="visible"};n();let o=new t.ResizeObserver(n);o.observe(R),r!==R&&o.observe(r),o.observe(e),L&&o.observe(L);let i=R.getRootNode();return i.addEventListener("scroll",n,!0),t.addEventListener("resize",n),()=>{o.disconnect(),i.removeEventListener("scroll",n,!0),t.removeEventListener("resize",n)}},[R,m,L,p,e]),o(()=>{let e=R&&u(R),t=y.current;if(!e||!t)return;let r={tip:t,close:()=>E("closed")};return s.set(e,r),()=>{s.get(e)===r&&s.delete(e)}},[R]),o(()=>{let e=y.current,t=R?.ownerDocument.defaultView;if(!e||!t)return;let r="instant"!==w&&!t.matchMedia("(prefers-reduced-motion: reduce)").matches;if(e.style.transition=r?"opacity 120ms ease-out":"none","entering"===w&&t.getComputedStyle(e).opacity,e.style.opacity=M?"1":"0",!M){if(!r)return void E("closed");let e=t.setTimeout(()=>E("closed"),120);return()=>t.clearTimeout(e)}},[R,M,w]),i(()=>{let e=g.current?.ownerDocument;if(!M||!e)return;let t=e=>{"Escape"===e.key&&(E("closed"),e.stopPropagation())};return e.addEventListener("keydown",t,!0),()=>e.removeEventListener("keydown",t,!0)},[M]),d("span",{ref:g,style:{position:"relative",display:"inline-flex",minWidth:0},onPointerEnter:e=>{"touch"!==e.pointerType&&(b.current=!0,z(e.currentTarget,!0))},onPointerLeave:()=>{b.current=!1,x.current||E(e=>"closed"===e?e:"leaving")},onFocus:e=>{x.current=e.target.matches(":focus-visible"),x.current&&z(e.currentTarget,!1)},onBlur:()=>{x.current=!1,b.current||E(e=>"closed"===e?e:"leaving")},children:[a("button",{type:"button",...v,"aria-describedby":M?f:void 0,children:h}),k&&l(a(c,{ref:y,id:f,"aria-hidden":!M||void 0,style:{position:L?"absolute":"fixed",opacity:0,visibility:"hidden",background:"var(--popmelt-thread-action, #222)",color:"var(--popmelt-thread-on-action, #eee)",whiteSpace:"normal",overflowWrap:"anywhere",zIndex:20,width:"max-content",maxWidth:180,pointerEvents:"none",fontSize:12,fontWeight:500,lineHeight:1.35,padding:"5px 8px",borderRadius:8},children:e??v["aria-label"]}),k)]})}export{c as a,p as b};
@@ -1 +0,0 @@
1
- "use client";import{b as e,a as t}from"./chunk-NSCO633B.mjs";import{f as n}from"./chunk-J4WDYITA.mjs";import{_ as r,Q as o,N as i,J as a,A as l,z as s,H as d,F as c,D as u,E as p,K as m,I as h,G as f,M as g,ca as y,ea as x,L as C,W as v,ba as w,C as b,T as k,S as I,V as S,ga as M}from"./chunk-AYDREFWN.mjs";import{a as $}from"./chunk-G2ZHJXHZ.mjs";import{b as A,a as E}from"./chunk-6LBPTCGC.mjs";import{R as H,G as T,ga as R,_ as j,Ja as N,oa as z,b as P,y as V,v as B,w as L,l as W,ha as Z,da as F,sa as O,qa as D,F as _,x as q,ea as J,fa as Y,Ca as K,n as X,d as G,e as Q,Ea as U,h as ee,f as te,g as ne,j as re,i as oe,c as ie,m as ae,k as le}from"./chunk-F45IVFS3.mjs";import{b as se,a as de}from"./chunk-G7JR5Z3P.mjs";import{a as ce}from"./chunk-HU2XWUJC.mjs";import{f as ue,c as pe}from"./chunk-XT6PHPPG.mjs";import{x as me,y as he,d as fe,b as ge,j as ye,w as xe,K as Ce,M as ve,L as we,N as be,k as ke,g as Ie,f as Se,I as Me,i as $e,n as Ae}from"./chunk-HAE5LUJX.mjs";import{b as Ee,a as He}from"./chunk-53SKVMWR.mjs";import{c as Te,a as Re}from"./chunk-57FM7XQV.mjs";import{a as je}from"./chunk-LVEMYZOA.mjs";import{d as Ne,m as ze,v as Pe,u as Ve,p as Be}from"./chunk-WHJEKDNP.mjs";import{createContext as Le,useMemo as We,useState as Ze,useEffect as Fe,useCallback as Oe,useRef as De,useLayoutEffect as _e,useContext as qe,useReducer as Je}from"react";import{jsxs as Ye,jsx as Ke,Fragment as Xe}from"react/jsx-runtime";function Ge(e){let{selector:t,durableSelector:n,pathname:r,annotationNumber:o,changes:i}=e;return{selector:t,durableSelector:n,pathname:r,annotationNumber:o,changes:i.map(({property:e,original:t,modified:n,token:r})=>({property:e,original:t,modified:n,token:r}))}}function Qe(e,t){if((e.pathname??"")!==(t.pathname??"")||e.selector!==t.selector&&(!e.durableSelector||e.durableSelector!==t.durableSelector))return!1;let n=e=>JSON.stringify(e.map(({property:e,original:t,modified:n,token:r})=>[e,t,n,r??null]).sort((e,t)=>String(e[0]).localeCompare(String(t[0]))));return n(e.changes)===n(t.changes)}function Ue(e,t,n,r=new Set){let o=new Map(t.filter(e=>e.authorId===n).flatMap(e=>e.annotations?.map(({id:t})=>[t,e.threadId])??[])),i=!1,a=e.annotations.map(e=>{if(r.has(e.id)&&["pending","sending"].includes(e.status??"pending"))return i=!0,{...e,status:"awaiting_review"};let t="sending"===e.status&&!!e.threadId&&e.threadId===o.get(e.id);return"pending"!==(e.status??"pending")&&!t||e.threadId&&e.threadId!==o.get(e.id)||!o.has(e.id)?e:(i=!0,{...e,threadId:o.get(e.id)??e.threadId,status:"awaiting_review"})}),l=!1,s=e.styleModifications.map(e=>{if(e.captured)return e;let r=[...t].reverse().find(t=>t.authorId===n&&t.threadId&&t.styleModifications?.some(t=>Qe(e,t)));return r?.threadId?(l=!0,{...e,awaitingReview:{submissionId:r.id,threadId:r.threadId}}):e});return i||l?{...e,annotations:i?a:e.annotations,styleModifications:l?s:e.styleModifications}:e}function et(e){if(e.awaitingReview)return{jobId:`suggestion:${e.awaitingReview.submissionId}`,threadId:e.awaitingReview.threadId,status:"awaiting_review",selectors:[e.selector],annotationNumber:e.annotationNumber}}function tt(e,t){if(!t)return e;let n=e.activeColor!==t,r=e.annotations.map(e=>e.color===t?e:(n=!0,{...e,color:t}));return n?{...e,activeColor:t,annotations:r}:e}function nt(e,t){return t.selectors??(t.targetBindingId?[]:[e])}function rt(e,t,n){let r=[...new Set(e)];if(1!==r.length)return;let o=n(r[0]);if(!o)return;let i=t.filter(e=>!(!e.threadId||!e.linkedSelector||"pending"===e.status)&&n(e.linkedSelector)===o),a=[...new Set(i.map(e=>e.threadId))];return 1===a.length?{threadId:a[0],targetBindingId:i.find(e=>e.targetBindingId)?.targetBindingId,color:i.find(e=>e.color)?.color,selectorAliases:[...new Set([r[0],...i.map(e=>e.linkedSelector)])]}:void 0}function ot(e,t,n,r){let o=[...new Set(e)];return 1!==o.length?n:lt(o[0],t,r)?.color??n}function it(e,t){let n=[...new Set(e)];if(1!==n.length)return;let r=lt(n[0],t);return r?.continuationEligible?r.threadId:void 0}function at(e,t){let n=[...new Set(e)];if(1!==n.length)return;let r=lt(n[0],t);return r?.continuationEligible?r.targetBindingId:void 0}function lt(e,t,n){for(let[n,r]of t)if(nt(n,r).includes(e))return r;if(!n)return;let r=n(e);if(r)for(let[e,o]of t)if(nt(e,o).some(e=>n(e)===r))return o}function st(e,t,n){let r=new Map(e);for(let[o,i]of e)i.threadId===t&&r.set(o,{...i,jobId:n,threadId:t,status:"in_flight",label:void 0});return r}function dt(e,t){let n=new Set;for(let[r,o]of e)if(t.has(o.threadId))for(let e of nt(r,o))n.add(e);return n}function ct(e,t,n,r,o,i){let a=new Set(o);for(let[n,r]of e)if(r.jobId===t)for(let e of nt(n,r))a.add(e);let l=new Map(e);for(let e of a){let o=[...l].find(([t,n])=>nt(t,n).includes(e)),a=o?.[1];if(a&&a.jobId!==t)continue;let s=i??a?.threadId;if(!s)continue;let d=o?.[0]??`job:${t}:${e}`;l.set(d,{...a,jobId:t,threadId:s,status:n,label:r,selectors:a?.selectors??[e]})}return l}function ut(e,t,n){let r=new Map(e);for(let[e,o]of t)n.has(o.jobId)&&r.set(e,o);return r}function pt(e,t,n,r){if(!r)return new Map;let o=new Map;for(let[r,i]of e){if(t.has(i.threadId))continue;let e=n.indexOf(i.threadId);o.set(r,{...i,annotationNumber:i.annotationNumber??(e>=0?e+1:void 0)})}return o}function mt(e,t,n){if(t)return e?t.jobId===n?t:void 0:t}var ht=Number.MAX_SAFE_INTEGER;function ft(e){return`${e.pathname??"*"}\0${e.selector}`}function gt(e,t){return`element:${e??"*"}\0${t}`}function yt({annotations:e,styleModifications:t,textModifications:n}){let r=new Map,o=0,i=new Map;for(let t of e)t.groupId&&t.linkedSelector&&i.set(t.groupId,{selector:t.linkedSelector,pathname:t.pathname});for(let t of e){let e=t.groupId?i.get(t.groupId):t.linkedSelector?{selector:t.linkedSelector,pathname:t.pathname}:void 0,n=e?gt(e.pathname,e.selector):`annotation:${t.groupId??t.id}`,a=r.get(n);a?(a.createdAt=Math.min(a.createdAt,t.timestamp),a.annotationIds.push(t.id)):r.set(n,{key:n,createdAt:t.timestamp,stableIndex:o++,annotationIds:[t.id]})}let a=e=>{let t=ft(e),n=`element:${t}`,i=e.createdAt??ht,a=r.get(n);if(a)return a.createdAt=Math.min(a.createdAt,i),void(a.modificationKey=t);r.set(n,{key:n,createdAt:i,stableIndex:o++,annotationIds:[],modificationKey:t})};t.forEach(a),n.forEach(a);let l=new Map,s=new Map,d=[...r.values()].sort((e,t)=>e.createdAt-t.createdAt||e.stableIndex-t.stableIndex);return d.forEach((e,t)=>{let n=t+1;e.annotationIds.forEach(e=>l.set(e,n)),e.modificationKey&&s.set(e.modificationKey,n)}),{annotationNumberById:l,modificationNumberByKey:s,count:d.length}}function xt(e){let t=new Set,n=new Map;for(let t of e){if(!t.linkedSelector)continue;let e=n.get(t.linkedSelector)||[];e.push(t),n.set(t.linkedSelector,e)}let r=new Set,o=new Set;for(let e of n.values()){if(e.length<=1){e[0]?.groupId&&o.add(e[0].groupId);continue}e.sort((e,t)=>t.timestamp-e.timestamp);let n=e[0];n.groupId&&o.add(n.groupId);for(let n=1;n<e.length;n++){let o=e[n];t.add(o),o.groupId&&r.add(o.groupId)}}for(let n of e)n.groupId&&r.has(n.groupId)&&!o.has(n.groupId)&&t.add(n);return t}function Ct({state:e,pageAnnotations:t,pageStyleModifications:n,pageTextModifications:r}){let o=We(()=>xt(e.annotations),[e.annotations]),i=We(()=>yt({annotations:t.filter(e=>!o.has(e)),styleModifications:n,textModifications:r}),[t,n,r,o]),a=We(()=>{let e=new Map,t=t=>{let n=i.modificationNumberByKey.get(ft(t));if(void 0===n)return;let r=e.get(t.selector);(void 0===r||n<r)&&e.set(t.selector,n)};return n.forEach(t),r.forEach(t),e},[n,r,i.modificationNumberByKey]);return{supersededAnnotations:o,stagedArtifactOrder:i,annotationGroupMap:i.annotationNumberById,pageModificationNumberBySelector:a}}async function vt(e,t,n){let r=n=>{e.length&&t({type:"SET_ANNOTATION_STATUS",payload:{ids:e,status:n}})};r("sending");let o=!1;try{return o=await n(),o}catch(e){return console.error("[Popmelt] Failed to prepare submission:",e),!1}finally{o||r("pending")}}var wt="devtools-active-text";async function bt(e,t,n){if(e.current)return n;e.current=!0;try{return await t()}finally{e.current=!1}}function kt(e){e.removeItem(wt)}function It(e){return!("Enter"!==e.key||!e.metaKey&&!e.ctrlKey)&&(e.preventDefault(),e.stopPropagation(),!0)}function St(e){return!!e&&(void 0!==e.originalText?e.text!==e.originalText:e.text.trim().length>0||!!e.hasInteractionEpisode)}var Mt={expanded:"devtools-toolbar-expanded",annotations:"devtools-annotations",styleMods:"devtools-style-modifications",textMods:"devtools-text-modifications",domMods:"devtools-dom-modifications",spacingChanges:"devtools-spacing-changes",tool:"devtools-active-tool",color:"devtools-next-thread-color",legacyColor:"devtools-active-color",stroke:"devtools-stroke-width",inspected:"devtools-inspected-element"};function $t(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function At(e,t){return{styleModifications:$t(e.getItem(t.styleMods)),textModifications:$t(e.getItem(t.textMods)),domModifications:$t(e.getItem(t.domMods)),spacingTokenChanges:$t(e.getItem(t.spacingChanges))}}function Et(e,t){return`${e}:project:${encodeURIComponent(t.trim())}`}function Ht(e){return{expanded:Et(Mt.expanded,e),annotations:Et(Mt.annotations,e),styleMods:Et(Mt.styleMods,e),textMods:Et(Mt.textMods,e),domMods:Et(Mt.domMods,e),spacingChanges:Et(Mt.spacingChanges,e),tool:Et(Mt.tool,e),color:Et(Mt.color,e),stroke:Et(Mt.stroke,e),inspected:Et(Mt.inspected,e)}}function Tt(e){return Et("popmelt-workspace-generation",e)}function Rt(e,t){let n=e.getItem(Tt(t));if(null===n||""===n.trim())return null;let r=Number(n);return Number.isInteger(r)&&r>=0?r:null}function jt(e,t){return!(!Number.isInteger(t)||t<0)&&t>(e??0)}function Nt(e,t){return"string"==typeof e.pathname&&e.pathname===t}function zt(e){let{storage:t,projectId:n,pathname:r,selectorExists:o}=e,i=Ht(n),a=Et("popmelt-annotation-workspace-migration-v1",n);if("complete"===t.getItem(a))return i;let l=function(e,t,n){return e.filter(e=>!(!e||"string"!=typeof e.id||!Nt(e,t)||"pending"!==(e.status??"pending")||e.threadId||!e.target&&e.linkedSelector&&!n(e.linkedSelector)))}(function(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}(t.getItem(Mt.annotations)),r,o);null===t.getItem(i.annotations)&&t.setItem(i.annotations,JSON.stringify(l));let s=[["expanded",Mt.expanded],["tool",Mt.tool],["color",Mt.color],["stroke",Mt.stroke]];for(let[e,n]of s){let r="color"===e?t.getItem(n)??t.getItem(Mt.legacyColor):t.getItem(n);null!==r&&null===t.getItem(i[e])&&t.setItem(i[e],r)}for(let e of[i.styleMods,i.textMods,i.domMods,i.spacingChanges])null===t.getItem(e)&&t.setItem(e,"[]");null===t.getItem(i.inspected)&&t.removeItem(i.inspected),t.setItem(a,"complete");for(let e of Object.values(Mt))t.removeItem(e);return i}function Pt(e,t,n=new Set){let r=function(e){let t=new Map;for(let n of e)n.groupId&&n.threadId&&t.set(n.groupId,n.threadId);return t}(e);return e.filter(e=>{let o=function(e,t){return e.threadId??(e.groupId?t.get(e.groupId):void 0)}(e,r);return Nt(e,t)&&"dismissed"!==e.status&&(!o||!n.has(o))})}function Vt(e,t,n,r=new Set,o=new Map){let i=new Set;for(let e of Pt(t,n,r))e.linkedSelector&&i.add(e.linkedSelector);for(let[e,t]of o)if(!r.has(t.threadId))for(let n of t.selectors??[e])i.add(n);return e.filter(e=>(!e.pathname||e.pathname===n)&&(!e.captured||i.has(e.selector)||!!e.durableSelector&&i.has(e.durableSelector)))}function Bt({state:e,activeText:t,currentPathname:n,dismissedThreadIds:r,modifiedElementThreadStates:o}){let i=We(()=>Pt(e.annotations,n,r),[e.annotations,n,r]),a=We(()=>Vt(e.styleModifications,e.annotations,n,r,o),[e.annotations,e.styleModifications,n,r,o]),l=We(()=>Vt(e.textModifications,e.annotations,n,r,o),[e.annotations,e.textModifications,n,r,o]),s=We(()=>{let t=new Set,r=e=>!(e.captured||e.pathname&&e.pathname!==n);for(let n of e.styleModifications)r(n)&&!n.awaitingReview&&t.add(`element:${n.selector}`);for(let n of e.textModifications)r(n)&&t.add(`element:${n.selector}`);for(let n of e.domModifications)r(n)&&t.add(`element:${n.selector}`);for(let n of e.spacingTokenChanges)n.captured||t.add(`spacing:${n.tokenPath}`);for(let n of e.spacingTokenMods)n.captured||t.add(`spacing:${n.tokenPath}`);return t},[n,e.domModifications,e.spacingTokenChanges,e.spacingTokenMods,e.styleModifications,e.textModifications]),d=We(()=>function(e,t,n=[]){let r=new Set(e.filter(e=>"pending"===(e.status??"pending")).map(e=>`annotation:${e.groupId||e.id}`));t?.isNew&&!t.domEdit&&(t.text.trim()||t.interactionEpisode?.steps.length)&&r.add(`annotation:${t.groupId||t.id}`);for(let e of n)r.add(`edit:${e}`);return r.size}(e.annotations,t,s),[e.annotations,t,s]),c=We(()=>e.annotations.filter(e=>"text"===e.type&&e.text&&"pending"===(e.status??"pending")).sort((e,t)=>t.timestamp-e.timestamp),[e.annotations]);return{pageAnnotations:i,pageStyleModifications:a,pageTextModifications:l,pendingBundleCount:d,pendingTextAnnotations:c}}function Lt(e,t="host",n){let[r,o]=Ze(()=>n?.read().selectedId??t),[i,a]=Ze(null);Fe(()=>{o(n?.read().selectedId??t),a(null)},[n,t]);let l=Oe(e=>{n?.select(e),o(e),a(null)},[n]),s=Oe(e=>a(e),[]),d=Oe(e=>{a(t=>t===e?null:t)},[]);return Fe(()=>{let t=()=>a(null);e||t();let n=()=>{document.hidden&&t()};return window.addEventListener("blur",t),document.addEventListener("visibilitychange",n),()=>{window.removeEventListener("blur",t),document.removeEventListener("visibilitychange",n)}},[e]),{selectedId:r,viewedId:e?i??r:r,isPeeking:e&&null!==i&&i!==r,select:l,peek:s,leave:d}}function Wt({name:e,isOwnPlane:t,color:n,changed:r}){return Ye("div",{"data-devtools":"peer-plane-label","data-popmelt-font":"mono",role:"status",title:r?"Source changed beneath staged work. Editing, clearing, commenting or sending acknowledges the affected work; viewing alone does not.":void 0,style:{position:"fixed",bottom:8,left:"50%",transform:"translateX(-50%)",maxWidth:"calc(100vw - 32px)",boxSizing:"border-box",padding:"4px 8px",borderRadius:8,background:n,color:"#fff",fontFamily:A,fontSize:12,fontWeight:500,lineHeight:"16px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",zIndex:10002},children:[t?"Your plane":`${e}’s plane`,r&&" (source changed)"]})}function Zt(e,t=[],n=""){let r=new Map;if(!e)return r;let o=Ue(e,t,n),i=xt(o.annotations),a=o.annotations.filter(e=>!i.has(e)),l=yt({...o,annotations:a});for(let e of a){let t=l.annotationNumberById.get(e.id);e.threadId&&void 0!==t&&!r.has(e.threadId)&&r.set(e.threadId,t)}for(let e of o.styleModifications){let t=e.awaitingReview?.threadId,n=l.modificationNumberByKey.get(ft(e));t&&void 0!==n&&!r.has(t)&&r.set(t,n)}return r}var Ft=Le(null);function Ot(e,t){return JSON.stringify([e,t??null])}function Dt(e){return(e.annotations?.length?e.annotations:[{id:void 0,label:"Submitted changes"}]).map(t=>({submission:e,annotation:t,key:Ot(e.id,t.id)}))}function _t(e,t){return e.filter(e=>e.threadId===t).flatMap(e=>Dt(e).map(e=>e.key))}function qt(e,t){let n=[],r=()=>{try{let r=JSON.parse(e.getItem(t)??"[]");Array.isArray(r)&&(n=[...new Set([...r.filter(e=>"string"==typeof e),...n])].slice(-1e3))}catch{}return n},o=o=>{let i=r(),a=o.filter(e=>!i.includes(e));if(!a.length)return i;let l=[...new Set([...i,...a])].slice(-1e3);n=l;try{e.setItem(t,JSON.stringify(l))}catch{}return l};return{read:r,markMany:o,mark:e=>o([e])}}function Jt(e){return(e%360+360)%360}function Yt(e){let t=e.match(/oklch\([^)]*\s+([\d.]+)\s*\)/i);if(!t?.[1])return null;let n=Number.parseFloat(t[1]);return Number.isFinite(n)?Jt(n):null}function Kt(e){return`oklch(0.628 0.258 ${Jt(e)})`}function Xt(e){return Kt((Yt(e)??29)+60)}function Gt(e){return new Set(e.filter(e=>e.groupId&&e.threadId).map(e=>e.groupId))}function Qt(e,t){let n=!(!e.groupId||!t.has(e.groupId));return!("pending"!==(e.status??"pending")||e.threadId||n||e.replyCount&&e.replyCount>0)}function Ut(e,t,n){return e.threadId?`thread:${e.threadId}`:e.groupId&&n.has(e.groupId)?`thread-group:${e.groupId}`:e.groupId?`group:${e.groupId}`:e.id?`annotation:${e.id}`:`annotation-index:${t}`}function en(e,t){let n=Math.abs(Jt(e)-Jt(t));return Math.min(n,360-n)<.5}function tn(e,t,n){let r=Yt(e)??29,o=Math.round(6),i=Gt(t),a=t.flatMap((e,t)=>{if(!e.color)return[];if(n&&e.pathname&&e.pathname!==n)return[];if(Qt(e,i))return[];let r=Yt(e.color);return null===r?[]:[{hue:r,key:Ut(e,t,i)}]}),l=Kt(r),s=Number.POSITIVE_INFINITY;for(let e=0;e<o;e+=1){let t=Jt(r+60*e),n=new Set(a.filter(e=>en(e.hue,t)).map(e=>e.key));if(0===n.size)return Kt(t);n.size<s&&(s=n.size,l=Kt(t))}return l}function nn(e,t){let n=Gt(e);return e.map(e=>Qt(e,n)?{...e,color:t}:e)}function rn(e){let t=new Set(e.annotationIds),n={color:e.color,threadId:e.threadId,pathname:e.pathname},r=e.annotations.map(n=>n.id&&t.has(n.id)?{...n,color:e.color,threadId:e.threadId}:n);return r.push(n),tn(Xt(e.color),r,e.pathname)}function on(e,t){return e.find(e=>e.color)?.color??t}function an(e){let t=[...e.annotations].sort((e,t)=>t.timestamp-e.timestamp),n=Gt(e.annotations),r=t.find(e=>Qt(e,n)&&!!e.color);if(r?.color)return tn(r.color,e.annotations,e.currentPathname);if(e.savedCursor)return tn(e.savedCursor,e.annotations,e.currentPathname);let o=t.find(e=>!(!e.threadId||!e.color));return tn(o?.color?Xt(o.color):e.legacyColor??Kt(29),e.annotations,e.currentPathname)}var ln=["circle","square","diamond","hexagon"];function sn(e="circle",t=26){return{circle:19,square:17.5,diamond:20,hexagon:19}[e]*t/24}var dn=e=>e.map((t,n)=>{let r=e=>{let n=Math.hypot(e[0]-t[0],e[1]-t[1]),r=Math.min(3,n/2)/n;return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r].join(" ")};return`${n?"L":"M"}${r(e[(n+e.length-1)%e.length])} Q${t.join(" ")} ${r(e[(n+1)%e.length])}`}).join(" ")+" Z",cn={diamond:dn([[12,1],[23,12],[12,23],[1,12]]),hexagon:dn([[12,2],[21,7],[21,17],[12,22],[3,17],[3,7]])},un=[210,150,270,90,330,30].map(e=>Jt(29+e)),pn=[.68,.5,.82,.59,.75,.43];function mn(e){if("host"===e.identity?.relationship)return"circle";if(e.shape&&ln.includes(e.shape))return e.shape;let t=/^oklch\(([\d.]+) ([\d.]+) ([\d.]+)\)$/.exec(e.color??"");if(t){let n=pn.indexOf(Number(t[1])),r=un.indexOf(Number(t[3])),o=Math.round(4*(.14/Number(t[2])-1)),i=(o*pn.length+n)*un.length+r;if(n>=0&&r>=0&&o>=0&&Number.isSafeInteger(i)&&hn(i)===e.color)return function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Invalid peer color slot");return ln[([0,2,3,0,1,1][e%6]+Math.floor(e/6))%4]}(i)}return"circle"}function hn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Invalid peer color slot");let t=Math.floor(e/un.length),n=pn;return`oklch(${n[t%n.length]} ${.14/(1+.25*Math.floor(t/n.length))} ${un[e%un.length]})`}function fn(e,t,n){return"host"===e?.identity.relationship?e.identity.id===t?n:e.color??ce.activeColor:e?.color??hn(0)}function gn(e){return"inspect"!==e.type&&"style"!==e.type&&"comment"!==e.type&&"attention"!==e.type||!e.selector?null:{selector:e.selector,plane:"inspect"===e.type?e.plane??"own":"own",activity:"attention"===e.type?e.activity??"looking":"inspect"===e.type?"looking":"working"}}function yn(e){return function(e){let t=e.replace(/^\uFEFF/,"").trim().replace(/^<\?xml[\s\S]*?\?>\s*/i,"").replace(/^(?:<!--[\s\S]*?-->\s*)+/i,"").replace(/^<!doctype\s+svg[\s\S]*?>\s*/i,"");return/^<svg(?:\s|>)[\s\S]*<\/svg>\s*$/i.test(t)}(e)?{blob:new Blob([e],{type:"image/svg+xml"}),kind:"svg",name:"figma-selection.svg"}:e.length>=8192?{blob:new Blob([e],{type:"text/plain"}),kind:"text",name:"pasted-context.txt"}:null}function xn(e){return e<1024?`${e} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1048576).toFixed(1)} MB`}function Cn(e){return`${e} image${e>1?"s":""} attached`}function vn(e){return e<=0?0:32+7.2*String(e).length}function wn({imageCount:e,color:t,layered:n=!1}){return e<=0?null:Ye("div",{"data-devtools":"active-image-attachment-badge",role:"img","aria-label":Cn(e),title:Cn(e),style:{position:"relative",flex:"0 0 auto",display:"flex",marginRight:-2,zIndex:2},children:[Ke("span",{"aria-hidden":!0,style:{position:"absolute",left:-4,top:"50%",width:14.142,height:14.142,transform:"translateY(-50%)",display:"grid",placeItems:"center",pointerEvents:"none",maskImage:n?Ee:void 0,WebkitMaskImage:n?Ee:void 0},children:Ke("span",{style:{width:10,height:10,background:t,transform:"rotate(-45deg)"}})}),Ye("span",{style:{position:"relative",display:"flex",alignItems:"center",gap:4,height:22,padding:n?"0 8px 0 10px":"0 8px",borderRadius:8,backgroundColor:t,color:"#fff",font:`12px/1.2 ${E}`,whiteSpace:"nowrap",maskImage:n?He:void 0,WebkitMaskImage:n?He:void 0},children:[Ke(H,{size:12,strokeWidth:2,"aria-hidden":!0}),e]})]})}function bn({point:e,scroll:t,attachments:n,showAttachments:r,onRemoveAttachment:o}){return Ke(Xe,{children:r&&n.length>0&&Ke("div",{"data-devtools":!0,style:{position:"fixed",left:e.x-8-t.x,top:e.y-4-t.y-24,zIndex:10001,display:"flex",gap:4,flexWrap:"wrap",maxWidth:400},children:n.map(e=>Ye("button",{type:"button",title:"Remove attachment",onMouseDown:e=>e.preventDefault(),onClick:()=>o(e.id),style:{appearance:"none",border:0,borderRadius:8,background:"rgba(0,0,0,0.72)",color:"#fff",cursor:"pointer",font:"11px/16px system-ui, sans-serif",padding:"2px 7px",whiteSpace:"nowrap"},children:[e.name," · ",xn(e.size)," ×"]},e.id))})})}function kn({query:e,border:t,background:n,foreground:r,renderIcon:o}){return Ye("span",{"aria-hidden":"true","data-popmelt-sticker-query":!0,style:{position:"absolute",left:"50%",top:44,minWidth:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",gap:4,padding:"0 10px",boxSizing:"border-box",border:`1px solid ${t}`,borderRadius:12,background:n,color:r,fontSize:11,fontWeight:600,letterSpacing:.22,lineHeight:1,whiteSpace:"nowrap",transform:"translateX(-50%)",zIndex:4},children:[e.tokens.map((e,t)=>"icon"===e.kind?Ke("span",{"aria-label":e.label,"data-popmelt-sticker-query-token":"icon",style:{display:"inline-flex",color:r,flexShrink:0},children:o(e)},`${e.label}-${t}`):Ke("span",{"data-popmelt-sticker-query-token":"label",style:{color:r,opacity:.72},children:e.label},`${e.label}-${t}`)),e.typed?Ke("span",{children:e.typed}):Ye("span",{style:{display:"inline-flex",alignItems:"center",gap:0,color:r,opacity:.58,fontWeight:500},children:[Ke("span",{"data-popmelt-sticker-query-caret":!0,style:{width:1,height:11,flexShrink:0,background:r,animation:"popmeltStickerQueryCaret 900ms steps(1, end) infinite"}}),Ke("span",{children:e.fallback})]}),e.completion&&Ke("span",{style:{color:r,opacity:.62},children:e.completion}),e.fallback&&e.typed&&Ye("span",{style:{color:r,opacity:.68},children:["→ ",e.fallback]})]})}var In=106,Sn=42,Mn=24,$n=250,An=32,En="cubic-bezier(0.16, 1, 0.3, 1)",Hn=[0,180,240,300];function Tn(e,t,n=42,r=40,o=In){let i=e.left+o,a=e.top+n,l=Math.min(i,t.right)-Math.max(e.left,t.left),s=Math.min(a,t.bottom)-Math.max(e.top,t.top);if(l<=0||s<=0)return 1;let d=Math.min(l,s);return Math.max(0,1-d/r)}function Rn(e,t,n,r=42,o=80,i=8,a=In){let l=Math.min(Math.max(e.x,n.left),n.right),s=Math.min(Math.max(e.y,n.top),n.bottom),d={x:l-e.x,y:s-e.y},c=Math.hypot(d.x,d.y);if(0===c)return 0;let u=d.x/c,p=d.y/c,m=[{x:t.left,y:t.top},{x:t.left+a,y:t.top},{x:t.left,y:t.top+r},{x:t.left+a,y:t.top+r}],h=Math.max(0,...m.map(t=>(t.x-e.x)*u+(t.y-e.y)*p)),f=Math.max(o,h+i);return Math.min(1,c/f)}var jn={padding:"padding",margin:"margin",border:"border",radius:"radius",stack:"stack-vertical",grid:"grid",text:"text-size",color:"palette",transform:"transform-translate",opacity:"opacity"},Nn={top:0,right:90,bottom:180,left:270},zn={"top-right":0,"bottom-right":90,"bottom-left":180,"top-left":270};function Pn({name:e}){switch(e){case"padding":return Ke("path",{d:"M9.333 0.375C10.701 0.375 11.625 1.662 11.625 3V9C11.625 10.338 10.701 11.625 9.333 11.625H2.667C1.299 11.625 0.375 10.338 0.375 9V3C0.375 1.662 1.299 0.375 2.667 0.375H9.333ZM2.667 1.625C2.194 1.625 1.625 2.129 1.625 3V9C1.625 9.871 2.194 10.375 2.667 10.375H9.333C9.806 10.375 10.375 9.871 10.375 9V3C10.375 2.129 9.806 1.625 9.333 1.625H2.667ZM7.375 3A0.625 0.625 0 0 1 7.375 4.25H4.625A0.625 0.625 0 0 1 4.625 3H7.375Z",fill:"currentColor"});case"padding-top":return Ke("path",{d:"M9.333 1.375C10.701 1.375 11.625 2.662 11.625 4V10A0.625 0.625 0 0 1 10.375 10V4C10.375 3.129 9.806 2.625 9.333 2.625H2.667C2.194 2.625 1.625 3.129 1.625 4V10A0.625 0.625 0 0 1 0.375 10V4C0.375 2.662 1.299 1.375 2.667 1.375H9.333ZM7.375 5A0.625 0.625 0 0 1 7.375 6.25H4.625A0.625 0.625 0 0 1 4.625 5H7.375Z",fill:"currentColor"});case"padding-x":return Ke("path",{d:"M2.75 0.375C3.095 0.375 3.375 0.655 3.375 1S3.095 1.625 2.75 1.625C2.344 1.625 2.073 1.759 1.904 1.929C1.733 2.101 1.625 2.354 1.625 2.667V9.333C1.625 9.646 1.733 9.899 1.904 10.071C2.073 10.241 2.344 10.375 2.75 10.375C3.095 10.375 3.375 10.655 3.375 11S3.095 11.625 2.75 11.625C2.052 11.625 1.448 11.386 1.018 10.952C0.59 10.522 0.375 9.941 0.375 9.333V2.667C0.375 2.059 0.59 1.478 1.018 1.048C1.448 0.614 2.052 0.375 2.75 0.375ZM9.25 0.375C9.948 0.375 10.552 0.614 10.982 1.048C11.41 1.478 11.625 2.059 11.625 2.667V9.333C11.625 9.941 11.41 10.522 10.982 10.952C10.552 11.386 9.948 11.625 9.25 11.625C8.905 11.625 8.625 11.345 8.625 11S8.905 10.375 9.25 10.375C9.656 10.375 9.927 10.241 10.096 10.071C10.267 9.899 10.375 9.646 10.375 9.333V2.667C10.375 2.354 10.267 2.101 10.096 1.929C9.927 1.759 9.656 1.625 9.25 1.625C8.905 1.625 8.625 1.345 8.625 1S8.905 0.375 9.25 0.375ZM8.079 5.25C8.424 5.25 8.704 5.53 8.704 5.875S8.424 6.5 8.079 6.5H3.921C3.576 6.5 3.296 6.22 3.296 5.875S3.576 5.25 3.921 5.25H8.079Z",fill:"currentColor"});case"padding-y":return Ke("path",{d:"M11.625 2.75C11.625 3.095 11.346 3.375 11 3.375S10.375 3.095 10.375 2.75C10.375 2.344 10.241 2.073 10.072 1.904C9.899 1.733 9.646 1.625 9.333 1.625H2.667C2.355 1.625 2.102 1.733 1.929 1.904C1.759 2.073 1.625 2.344 1.625 2.75C1.625 3.095 1.346 3.375 1 3.375S0.375 3.095 0.375 2.75C0.375 2.052 0.615 1.448 1.048 1.018C1.479 0.59 2.06 0.375 2.667 0.375H9.333C9.941 0.375 10.522 0.59 10.953 1.018C11.386 1.448 11.625 2.052 11.625 2.75ZM11.625 9.25C11.625 9.948 11.386 10.552 10.953 10.982C10.522 11.41 9.941 11.625 9.333 11.625H2.667C2.06 11.625 1.479 11.41 1.048 10.982C0.615 10.552 0.375 9.948 0.375 9.25C0.375 8.905 0.655 8.625 1 8.625S1.625 8.905 1.625 9.25C1.625 9.656 1.759 9.927 1.929 10.096C2.102 10.267 2.355 10.375 2.667 10.375H9.333C9.646 10.375 9.899 10.267 10.072 10.096C10.241 9.927 10.375 9.656 10.375 9.25C10.375 8.905 10.655 8.625 11 8.625S11.625 8.905 11.625 9.25ZM6.75 8.079C6.75 8.424 6.471 8.704 6.125 8.704S5.5 8.424 5.5 8.079V3.921C5.5 3.576 5.78 3.296 6.125 3.296S6.75 3.576 6.75 3.921V8.079Z",fill:"currentColor"});case"margin":return Ke("path",{d:"M9.333 4.525C10.701 4.525 11.625 5.812 11.625 7.15V8.15C11.625 9.488 10.701 10.775 9.333 10.775H2.667C1.299 10.775 0.375 9.488 0.375 8.15V7.15C0.375 5.812 1.299 4.525 2.667 4.525H9.333ZM2.667 5.775C2.194 5.775 1.625 6.279 1.625 7.15V8.15C1.625 9.021 2.194 9.525 2.667 9.525H9.333C9.806 9.525 10.375 9.021 10.375 8.15V7.15C10.375 6.279 9.806 5.775 9.333 5.775H2.667ZM8.375 1.2A0.625 0.625 0 0 1 8.375 2.45H3.625A0.625 0.625 0 0 1 3.625 1.2H8.375Z",fill:"currentColor"});case"margin-top":return Ke("path",{d:"M9.333 4.575C10.701 4.575 11.625 5.862 11.625 7.2V10.2A0.625 0.625 0 0 1 10.375 10.2V7.2C10.375 6.329 9.806 5.825 9.333 5.825H2.667C2.194 5.825 1.625 6.329 1.625 7.2V10.2A0.625 0.625 0 0 1 0.375 10.2V7.2C0.375 5.862 1.299 4.575 2.667 4.575H9.333ZM8.375 1.25A0.625 0.625 0 0 1 8.375 2.5H3.625A0.625 0.625 0 0 1 3.625 1.25H8.375Z",fill:"currentColor"});case"margin-x":return Ke("path",{d:"M11.277 2.902C11.622 2.902 11.902 3.182 11.902 3.527V8.277C11.902 8.622 11.622 8.902 11.277 8.902S10.652 8.622 10.652 8.277V3.527C10.652 3.182 10.931 2.902 11.277 2.902ZM0.724 2.901C1.069 2.901 1.349 3.181 1.349 3.526V8.276C1.349 8.621 1.069 8.901 0.724 8.901S0.099 8.621 0.099 8.276V3.527C0.099 3.182 0.379 2.901 0.724 2.901ZM7.333 3.325C8.643 3.325 9.543 4.506 9.617 5.781C9.62 5.805 9.625 5.829 9.625 5.853L9.622 5.901L9.625 5.95C9.625 5.974 9.62 5.998 9.617 6.021C9.544 7.297 8.643 8.478 7.333 8.478H4.667C3.357 8.478 2.456 7.297 2.382 6.021C2.379 5.998 2.375 5.974 2.375 5.95L2.377 5.901L2.375 5.853C2.375 5.829 2.379 5.805 2.382 5.781C2.456 4.506 3.358 3.325 4.667 3.325H7.333ZM4.667 4.575C4.203 4.575 3.647 5.06 3.626 5.901C3.647 6.742 4.203 7.228 4.667 7.228H7.333C7.798 7.228 8.352 6.742 8.372 5.901C8.351 5.06 7.798 4.575 7.333 4.575H4.667Z",fill:"currentColor"});case"margin-y":return Ke("path",{d:"M8.375 10.001C8.72 10.001 9 10.281 9 10.626S8.72 11.251 8.375 11.251H3.625C3.28 11.251 3 10.971 3 10.626S3.28 10.001 3.625 10.001H8.375ZM9.333 3.325C10.642 3.325 11.543 4.506 11.617 5.781C11.62 5.805 11.625 5.829 11.625 5.853L11.622 5.901L11.625 5.95C11.625 5.974 11.619 5.998 11.617 6.021C11.543 7.297 10.643 8.478 9.333 8.478H2.667C1.357 8.478 0.455 7.297 0.381 6.021C0.379 5.998 0.375 5.974 0.375 5.95L0.377 5.901L0.375 5.853C0.375 5.829 0.379 5.805 0.381 5.781C0.456 4.506 1.357 3.325 2.667 3.325H9.333ZM2.667 4.575C2.202 4.575 1.648 5.061 1.627 5.901C1.647 6.742 2.202 7.228 2.667 7.228H9.333C9.797 7.228 10.352 6.742 10.373 5.901C10.352 5.06 9.797 4.575 9.333 4.575H2.667ZM8.376 0.751C8.721 0.751 9.001 1.031 9.001 1.376S8.72 2.001 8.376 2.001H3.626C3.28 2.001 3.001 1.72 3.001 1.375S3.281 0.751 3.626 0.751H8.376Z",fill:"currentColor"});case"border":return Ke(Xe,{children:Ke("path",{d:"M4 1.25H8M4 10.75H8M1.25 8V4M10.75 8V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});case"radius":return Ke(Xe,{children:Ke("path",{d:"M3.25 1.25C2.145 1.25 1.25 2.145 1.25 3.25M10.75 3.25C10.75 2.145 9.855 1.25 8.75 1.25M3.25 10.75C2.145 10.75 1.25 9.855 1.25 8.75M10.75 8.75C10.75 9.855 9.855 10.75 8.75 10.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});case"gap-x":return Ye(Xe,{children:[Ke("path",{d:"M6.625 9.375A0.625 0.625 0 0 1 5.375 9.375V2.625A0.625 0.625 0 0 1 6.625 2.625V9.375Z",fill:"currentColor"}),Ke("circle",{cx:"1.252",cy:"1.248",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"10.748",cy:"1.248",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"1.252",cy:"6",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"10.748",cy:"6",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"1.252",cy:"10.752",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"10.748",cy:"10.752",r:"0.748",fill:"currentColor"})]});case"gap-y":return Ye(Xe,{children:[Ke("path",{d:"M9.375 5.375A0.625 0.625 0 0 1 9.375 6.625H2.625A0.625 0.625 0 0 1 2.625 5.375H9.375Z",fill:"currentColor"}),Ke("circle",{cx:"1.248",cy:"10.748",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"1.248",cy:"1.252",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"6",cy:"10.748",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"6",cy:"1.252",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"10.752",cy:"10.748",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"10.752",cy:"1.252",r:"0.748",fill:"currentColor"})]});case"border-top":return Ye(Xe,{children:[Ke("path",{d:"M3.25 0.5A0.75 0.75 0 0 1 3.25 2C2.56 2 2 2.56 2 3.25V8.75C2 9.44 2.56 10 3.25 10A0.75 0.75 0 0 1 3.25 11.5C1.731 11.5 0.5 10.269 0.5 8.75V3.25C0.5 1.731 1.731 0.5 3.25 0.5Z",fill:"currentColor"}),Ke("circle",{cx:"10.748",cy:"10.752",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"6.625",cy:"10.752",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"10.748",cy:"6",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"10.748",cy:"1.248",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"6.625",cy:"1.248",r:"0.748",fill:"currentColor"})]});case"radius-top-right":return Ye(Xe,{children:[Ke("path",{d:"M8.25 1.25H8.75A2 2 0 0 1 10.75 3.25V3.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),Ke("circle",{cx:"9.748",cy:"9.748",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"2.248",cy:"9.748",r:"0.748",fill:"currentColor"}),Ke("circle",{cx:"2.248",cy:"2.248",r:"0.748",fill:"currentColor"})]});case"stack-vertical":case"stack-horizontal":return Ke("path",{d:"M9.333 0.375C10.701 0.375 11.625 1.662 11.625 3V9C11.625 10.338 10.701 11.625 9.333 11.625H2.667C1.299 11.625 0.375 10.338 0.375 9V3C0.375 1.662 1.299 0.375 2.667 0.375H9.333ZM1.625 6.625V9C1.625 9.871 2.194 10.375 2.667 10.375H9.333C9.806 10.375 10.375 9.871 10.375 9V6.625H1.625ZM2.667 1.625C2.194 1.625 1.625 2.129 1.625 3V5.375H10.375V3C10.375 2.129 9.806 1.625 9.333 1.625H2.667Z",fill:"currentColor"});case"align":return Ye(Xe,{children:[Ke("path",{d:"M1 2H11M2.5 5.25H9.5M4 8.5H8",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),Ke("path",{d:"M6 0.75V10.75",stroke:"currentColor",strokeWidth:"0.75",strokeDasharray:"1 2"})]});case"justify":return Ye(Xe,{children:[Ke("path",{d:"M1 1.5V10.5M11 1.5V10.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),Ke("path",{d:"M3 3H9M3 6H9M3 9H9",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]});case"grid":return Ke("path",{d:"M9.333 0.375C10.701 0.375 11.625 1.662 11.625 3V9C11.625 10.338 10.701 11.625 9.333 11.625H2.667C1.299 11.625 0.375 10.338 0.375 9V3C0.375 1.662 1.299 0.375 2.667 0.375H9.333ZM6.625 10.375H9.333C9.806 10.375 10.375 9.871 10.375 9V6.625H6.625V10.375ZM1.625 9C1.625 9.871 2.194 10.375 2.667 10.375H5.375V6.625H1.625V9ZM6.625 5.375H10.375V3C10.375 2.129 9.806 1.625 9.333 1.625H6.625V5.375ZM2.667 1.625C2.194 1.625 1.625 2.129 1.625 3V5.375H5.375V1.625H2.667Z",fill:"currentColor"});case"grid-rows":return Ke("path",{d:"M4.512 0.385C5.781 0.491 6.625 1.721 6.625 3V9C6.625 10.279 5.78 11.508 4.511 11.614C4.477 11.62 4.443 11.625 4.408 11.625H2.666C1.299 11.625 0.375 10.338 0.375 9V3C0.375 1.662 1.299 0.375 2.667 0.375H4.409C4.444 0.375 4.478 0.379 4.512 0.385ZM10.748 10.004C11.161 10.004 11.497 10.339 11.497 10.752C11.497 11.165 11.161 11.5 10.748 11.5C10.335 11.5 10 11.165 10 10.752C10 10.339 10.335 10.004 10.748 10.004ZM1.625 9C1.625 9.871 2.193 10.375 2.666 10.375H4.333C4.806 10.375 5.375 9.871 5.375 9V6.625H1.625V9ZM10.748 5.252C11.161 5.252 11.497 5.587 11.497 6C11.497 6.413 11.161 6.748 10.748 6.748C10.335 6.748 10 6.413 10 6C10 5.587 10.335 5.252 10.748 5.252ZM2.667 1.625C2.194 1.625 1.625 2.129 1.625 3V5.375H5.375V3C5.375 2.129 4.806 1.625 4.333 1.625H2.667ZM10.748 0.5C11.161 0.5 11.497 0.835 11.497 1.248C11.497 1.661 11.161 1.997 10.748 1.997C10.335 1.997 10 1.661 10 1.248C10 0.835 10.335 0.5 10.748 0.5Z",fill:"currentColor"});case"grid-columns":return Ke("path",{d:"M0.321 7.424C0.427 6.155 1.657 5.311 2.936 5.311H8.936C10.215 5.311 11.444 6.156 11.55 7.425C11.556 7.458 11.561 7.493 11.561 7.528V9.27C11.56 10.637 10.274 11.561 8.936 11.561H2.936C1.598 11.561 0.311 10.636 0.311 9.269V7.527C0.311 7.492 0.315 7.458 0.321 7.424ZM9.94 1.188C9.94 0.775 10.275 0.439 10.688 0.439C11.101 0.439 11.437 0.774 11.437 1.188C11.437 1.601 11.101 1.936 10.688 1.936C10.275 1.936 9.94 1.601 9.94 1.188ZM8.936 10.311C9.806 10.311 10.31 9.743 10.311 9.27V7.603C10.311 7.129 9.807 6.561 8.936 6.561H6.561V10.311H8.936ZM5.188 1.188C5.188 0.775 5.523 0.439 5.936 0.439C6.349 0.439 6.685 0.774 6.685 1.188C6.685 1.601 6.349 1.936 5.936 1.936C5.523 1.936 5.188 1.601 5.188 1.188ZM1.561 9.269C1.561 9.742 2.065 10.311 2.936 10.311H5.311V6.561H2.936C2.065 6.561 1.561 7.129 1.561 7.603V9.269ZM0.436 1.188C0.436 0.774 0.772 0.439 1.185 0.439C1.598 0.439 1.933 0.775 1.933 1.188C1.933 1.601 1.598 1.936 1.185 1.936C0.772 1.936 0.436 1.601 0.436 1.188Z",fill:"currentColor"})}}function Vn({family:e,size:t=12,step:n,subproperty:r="all"}){let o=function(e,t="all"){return ke(e,t)?{name:"palette",rotation:0}:"stack"===e?"horizontal"===t?{name:"stack-horizontal",rotation:90}:"align"===t?{name:"align",rotation:0}:"justify"===t?{name:"justify",rotation:0}:{name:"stack-vertical",rotation:0}:"grid"===e?{name:"rows"===t?"grid-rows":"columns"===t?"grid-columns":"grid",rotation:90}:"text"===e?{name:"weight"===t?"text-weight":"line-height"===t?"text-leading":"letter-spacing"===t?"text-tracking":"text-align"===t?"text-align":"text-size",rotation:0}:"transform"===e?{name:"scale"===t?"transform-scale":"rotate"===t?"transform-rotate":"transform-translate",rotation:0}:"opacity"===e?{name:"mix-blend"===t?"mix-blend":"opacity",rotation:0}:"all"===t?{name:jn[e],rotation:0}:"radius"===e?{name:"radius-top-right",rotation:zn[t]??0}:{name:"padding"===e?"x"===t?"padding-x":"y"===t?"padding-y":"padding-top":"margin"===e?"x"===t?"margin-x":"y"===t?"margin-y":"margin-top":"border-top",rotation:("border"===e?90:0)+(Nn[t]??0)}}(e,r),i="text-size"===o.name?P:"text-weight"===o.name?V:"text-leading"===o.name?B:"text-tracking"===o.name?L:"text-align"===o.name?W:"palette"===o.name?Z:"transform-translate"===o.name?F:"transform-scale"===o.name?O:"transform-rotate"===o.name?D:"opacity"===o.name?_:"mix-blend"===o.name?q:null;return i?Ke(i,{"aria-hidden":"true","data-popmelt-sticker-icon":`${e}-${r}`,width:t,height:t,strokeWidth:2.5,style:{display:"block",transform:o.rotation?`rotate(${o.rotation}deg)`:void 0,transition:"width 250ms ease, height 250ms ease"}}):Ke("svg",{"aria-hidden":"true","data-popmelt-sticker-icon":`${e}-${r}`,viewBox:"0 0 12 12",fill:"none",style:{width:t,height:t,display:"block",transform:o.rotation?`rotate(${o.rotation}deg)`:void 0,transition:"width 250ms ease, height 250ms ease"},children:Ke(Pn,{name:o.name})})}function Bn(e,t){let n=($e.indexOf(e)+t%$e.length+$e.length)%$e.length;return $e[n]}function Ln(e,t){let n=$e.indexOf(e),r=($e.indexOf(t)-n+$e.length)%$e.length;return r<=$e.length/2?r:r-$e.length}function Wn(e,t,n,r="all"){let o=Ae(e,r),i=(o.indexOf(t)+n%o.length+o.length)%o.length;return o[i]}function Zn(e,t,n,r="all"){let o=Ae(e,r),i=o.indexOf(t),a=(o.indexOf(n)-i+o.length)%o.length;return a<=o.length/2?a:a-o.length}function Fn({offset:e,colors:t,renderItem:n,showControl:r=!0,activeColor:o,snapActiveColor:i=!1}){let a=[e-2,e-1,e,e+1,e+2];return Ye("div",{style:{position:"relative",width:96,height:32,overflow:"hidden"},children:[r&&Ke("span",{"aria-hidden":"true",style:{position:"absolute",left:An,top:0,width:An,height:An,borderRadius:16,background:t.control}}),Ke("div",{"data-popmelt-sticker-rail":!0,style:{position:"absolute",inset:0,transform:`translateX(${-e*An}px)`,transition:"transform 250ms ease",willChange:"transform"},children:a.map(r=>{let a=r===e;return Ke("span",{style:{position:"absolute",left:An+r*An,top:0,width:An,height:An,display:"flex",alignItems:"center",justifyContent:"center",color:a?o??t.primary:t.mutedStrong,transition:i?"none":`color 400ms ${En}`},children:n(r,a)},r)})})]})}function On({family:e,colors:t,showControl:n=!0,activeColor:r,snapActiveColor:o}){let i=De(e),a=De(e),[l,s]=Ze(0);return _e(()=>{if(a.current===e)return;let t=Ln(a.current,e);a.current=e,s(e=>e+t)},[e]),Ke(Fn,{offset:l,colors:t,showControl:n,activeColor:r,snapActiveColor:o,renderItem:(e,t)=>{let n=Bn(i.current,e);return Ke(Vn,{family:n,subproperty:"all",size:t?14:12})}})}function Dn({color:e,colors:t,showControl:n=!0}){let r=De(e),o=De(e),[i,a]=Ze(0);return _e(()=>{if(o.current===e)return;let t=Ie(o.current,e);o.current=e,a(e=>e+t)},[e]),Ke(Fn,{offset:i,colors:t,showControl:n,renderItem:(e,t)=>{let n=Se(r.current,e),o=t?14:12;return Ke("span",{"aria-label":n,"data-popmelt-sticker-color":n,style:{width:o,height:o,borderRadius:"50%",background:fe(n,ge),boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 0.08)",transition:"width 250ms ease, height 250ms ease"}})}})}function _n({name:e,size:t}){let n="align-start"===e?X:"align-center"===e?G:"align-end"===e?Q:"align-stretch"===e?U:"justify-start"===e?ee:"justify-center"===e?te:"justify-end"===e?ne:"justify-between"===e?re:"justify-around"===e?oe:"text-align-left"===e?W:"text-align-center"===e?ie:"text-align-right"===e?ae:"text-align-justify"===e?le:null;return n?Ke(n,{"aria-hidden":"true","data-popmelt-sticker-step-icon":e,width:t,height:t,strokeWidth:2.25,style:{display:"block"}}):Ke("svg",{"aria-hidden":"true","data-popmelt-sticker-step-icon":e,width:t,height:t,viewBox:"0 0 14 14",fill:"none",style:{display:"block"},children:Ye(Xe,"align-baseline"===e?{children:[Ke("path",{d:"M1.5 10.5H12.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),Ke("path",{d:"M3 8V4.75M3 4.75H6.5M6.5 4.75V8M8.5 8V6M8.5 6H11M11 6V8",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]}:{children:[Ke("path",{d:"M1.5 2V12M12.5 2V12",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),Ke("rect",{x:"3.25",y:"4.75",width:"2",height:"4.5",rx:"1",fill:"currentColor"}),Ke("rect",{x:"8.75",y:"4.75",width:"2",height:"4.5",rx:"1",fill:"currentColor"}),Ke("circle",{cx:"7",cy:"7",r:"0.75",fill:"currentColor"})]})})}function qn({family:e,step:t,subproperty:n,colors:r,showControl:o=!0,unavailable:i=!1,activeColor:a,snapActiveColor:l=!1}){let s=De(t),d=De(t),[c,u]=Ze(0);return Fe(()=>{if(d.current===t)return;let r=Zn(e,d.current,t,n);d.current=t,u(e=>e+r)},[e,t,n]),Ke(Fn,{offset:c,colors:r,showControl:o,activeColor:a??(i?r.muted:r.primary),snapActiveColor:l,renderItem:(t,r)=>{let o=Wn(e,s.current,t,n),a=function(e,t,n){if("stack"===e&&"align"===t){if("start"===n)return"align-start";if("center"===n)return"align-center";if("end"===n)return"align-end";if("stretch"===n)return"align-stretch";if("baseline"===n)return"align-baseline"}if("stack"===e&&"justify"===t){if("start"===n)return"justify-start";if("center"===n)return"justify-center";if("end"===n)return"justify-end";if("between"===n)return"justify-between";if("around"===n)return"justify-around";if("evenly"===n)return"justify-evenly"}if("text"===e&&"text-align"===t){if("left"===n)return"text-align-left";if("center"===n)return"text-align-center";if("right"===n)return"text-align-right";if("justify"===n)return"text-align-justify"}return null}(e,n,o);return Ke("span",{"data-popmelt-sticker-step-unavailable":r&&i?"true":void 0,style:{alignItems:"center",display:"flex",fontSize:r?14:12,justifyContent:"center",transition:"font-size 250ms ease"},children:a?Ke(_n,{name:a,size:r?14:12}):Me(o,e,n)})}})}function Jn(e){return"family"===e?0:35}function Yn(e){return"family"===e?An/Mn:1}function Kn(e){return"family"===e?14/(12*Yn(e)):1}function Xn(e,t,n){return`${e}:${t}:${n}`}function Gn(e,t,n){return!!ye(n)&&("color"===e?"family"!==t:("text"===e||"border"===e)&&"value"===t)}function Qn({family:e,step:t,subproperty:n,stage:r,accentColor:o,applyPulse:i=0,snapPulse:a=0,stepUnavailable:l=!1,colors:s}){let d=function(e,t="padding",n="all"){return ke(t,n)?"family"===e?{family:0,variant:-An,value:-64}:"variant"===e?{family:An,variant:0,value:-An}:{family:64,variant:An,value:0}:"family"===e?{family:0,variant:-64,value:-An}:{family:An,variant:-An,value:0}}(r,e,n),c=De(r),u=De(i),p=De(a),[m,h]=Ze(!1),f=p.current!==a;_e(()=>{p.current=a},[a]),_e(()=>{let e=c.current!==r&&"family"!==r,t="value"===r&&u.current!==i;if(c.current=r,u.current=i,!e&&!t)return;h(!0);let n=window.requestAnimationFrame(()=>h(!1));return()=>window.cancelAnimationFrame(n)},[i,r]);let g=e=>({position:"absolute",left:0,right:0,top:4,height:An,transform:`translateY(${e}px)`,transition:f?"none":"transform 250ms ease",willChange:"transform"});return Ye("div",{"data-popmelt-sticker-depth-rail":r,style:{position:"relative",width:96,height:40,marginBlock:-4,overflow:"hidden",zIndex:2},children:[Ke("span",{"aria-hidden":"true","data-popmelt-sticker-depth-control":!0,style:{position:"absolute",left:An,top:4,width:An,height:An,borderRadius:16,background:m?o:s.control,transition:m?"none":`background 400ms ${En}`}}),Ke("div",{"aria-hidden":"family"!==r,"data-popmelt-sticker-depth-row":"family",style:g(d.family),children:Ke(On,{family:e,colors:s,showControl:!1,activeColor:m?s.surface:s.primary,snapActiveColor:m})}),Ke("div",{"aria-hidden":"variant"!==r,"data-popmelt-sticker-depth-row":"variant",style:g(d.variant),children:ke(e,n)&&ye(n)&&Ke(Dn,{color:n,colors:s,showControl:!1})}),Ke("div",{"aria-hidden":"value"!==r,"data-popmelt-sticker-depth-row":"value",style:g(d.value),children:Ke(qn,{family:e,step:t,subproperty:n,colors:s,showControl:!1,unavailable:l,activeColor:m?s.surface:void 0,snapActiveColor:m},Xn(r,e,n))})]})}function Un(e,t,n=42,r=In){let o=e.x+10,i=e.y+10;return{left:Math.min(Math.max(8,o),Math.max(8,t.width-r-8)),top:Math.min(Math.max(8,i),Math.max(8,t.height-n-8))}}function er(e,t,n){return n?0:Math.min(e,t)}function tr({cursor:e,family:t,step:n,subproperty:o,stage:i,accentColor:a,applyPulse:l=0,contextLabelPulse:s=0,depthSnapPulse:d=0,rejectPulse:c=0,stepUnavailable:u=!1,query:p=null,toolbarElement:m,controlBounds:h,threadElement:f,annotationRailHovered:g=!1}){let[y]=Te(),x=Re[y],C=`color-mix(in srgb, ${x.actionForeground} 16%, ${x.actionSurface})`,v=me(t,o),w=De(t),b=De(i),k=De(o),I=De(i),S=De(l),M=De(s),$=De(c),A=De(null),H=De(!1),T=De(!1),R=De(0),j=De(0),N=De(0),z=De(0),[P,V]=Ze(null),[B,L]=Ze(!1),[W,Z]=Ze(!1),[F,O]=Ze(!1),[D,_]=Ze(null),[q,J]=Ze(!1),[Y,K]=Ze(0),[X,G]=Ze(!1),[Q,U]=Ze(!1);_e(()=>{if($.current===c)return;$.current=c,U(!1);let e=window.requestAnimationFrame(()=>U(!0)),t=window.setTimeout(()=>U(!1),240);return()=>{window.cancelAnimationFrame(e),window.clearTimeout(t)}},[c]),_e(()=>{let e=I.current!==i&&"family"!==i,t="value"===i&&S.current!==l;if(I.current=i,S.current=l,!e&&!t)return;G(!0);let n=window.requestAnimationFrame(()=>G(!1));return()=>window.cancelAnimationFrame(n)},[l,i]),_e(()=>{let e="family"!==b.current&&"family"===i;b.current=i;let n=(e=!1)=>{R.current&&window.cancelAnimationFrame(R.current),e||window.clearTimeout(j.current),window.clearTimeout(N.current),window.clearTimeout(z.current),R.current=0,e||(j.current=0),N.current=0,z.current=0},r=e=>{N.current=window.setTimeout(()=>{Z(e),T.current=!1,L(!1)},750),z.current=window.setTimeout(()=>{H.current=!1,V(null)},984)};if("family"!==i){if(n(),w.current=t,!H.current)return;return Z(!0),T.current=!1,L(!1),void(z.current=window.setTimeout(()=>{H.current=!1,V(null)},$n))}if(w.current!==t||e){if(w.current=t,H.current=!0,V(t),e)return n(),Z(!1),O(!0),T.current=!0,L(!0),j.current=window.setTimeout(()=>{j.current=0,O(!1)},$n),void r(!1);j.current||(n(!0),O(!1),Z(!1),T.current||(T.current=!0,L(!0)),r(!1))}},[t,i]),Fe(()=>()=>{window.cancelAnimationFrame(R.current),window.clearTimeout(j.current),window.clearTimeout(N.current),window.clearTimeout(z.current)},[]),Fe(()=>{let e=M.current!==s;if(M.current=s,!function(e,t,n="all"){return"value"===t||ke(e,n)&&"variant"===t}(t,i,o))return _(null),J(!1),void(k.current=o);if(w.current!==t)return k.current=o,_(null),void J(!1);if(k.current===o&&!e)return;k.current=o,J(e),_(e?function(e,t){let n=xe(e),r=he(e,t);return r===n?n:`${n} ${r}`}(t,o):he(t,o));let n=window.setTimeout(()=>{_(null),J(!1)},750);return()=>window.clearTimeout(n)},[s,t,i,o]),_e(()=>{D&&A.current?K(A.current.scrollWidth):K(0)},[D]);let ee=function(e,t=7.5){return null===e?Mn:Math.max(39,18+2*t+Math.ceil(e))}(D?Y:null,q?10:7.5),te=q?10:7.5,ne=D?0:140,re=p||"family"!==i||P?68:Sn,oe=We(()=>Un(e,h?.viewport??{width:typeof window>"u"?In:window.innerWidth,height:typeof window>"u"?Sn:window.innerHeight},re),[re,e,h?.viewport]),ie=m?Tn(oe,m.getBoundingClientRect(),re):1,ae=f?Rn(e,oe,f.getBoundingClientRect(),re):1,le=h?.compact?function(e,t,n,r,o){let i,a=8,l=o-r-8,s=1;for(let d of n){let n=Math.max(d.left-e.x,e.x-d.right,0),c=Math.max(d.top-e.y,e.y-d.bottom,0);if(s=Math.min(s,Math.hypot(n,c)/12),t.left+In<=d.left||t.left>=d.right)continue;let u=(d.top+d.bottom)/2<o/2,p=u?d.bottom+1:d.top-1-r;u?a=Math.max(a,p):l=Math.min(l,p);let m=u?t.top<=p:t.top>=p,h=u?e.y-d.bottom:d.top-e.y;if(!m||h<0)continue;let f=Math.max(n/12,Math.max(0,h-1)/r);f<s&&(s=f,i=u?0:r)}let d=Math.max(a,Math.min(t.top,l));return{top:d,scale:s,originY:i??Math.min(r,Math.max(0,e.y-d))}}(e,oe,h.bounds,re,h.viewport?.height??window.innerHeight):void 0,se=le?.scale??h?.bounds.reduce((t,n)=>Math.min(t,Rn(e,oe,n,re,40)),1)??1,de=er(Math.min(ie,se),ae,g),ce=le?.top??oe.top,ue={position:"fixed",left:oe.left,top:ce,width:In,height:Sn,display:"flex",alignItems:"center",justifyContent:"center",gap:1,boxSizing:"border-box",padding:4,border:`1px solid ${x.border}`,borderRadius:22,background:x.surface,color:x.primary,fontFamily:E,fontSize:12,fontWeight:600,lineHeight:1,pointerEvents:"none",overflow:"visible",opacity:de,transform:`scale(${de})`,transformOrigin:`${e.x-oe.left}px ${le?.originY??e.y-ce}px`,visibility:0===de?"hidden":"visible",animation:Q?"popmeltStickerReject 220ms ease-out":void 0,zIndex:2147483647,colorScheme:y},pe=p?function(e){return[...e.tokens.map(e=>e.label),`${e.typed}${e.completion||e.fallback}`].filter(Boolean).join(" ")}(p):"";return Ye("div",{role:"status","aria-label":p?`Sticker search: ${pe||"search tokens"}`:`Sticker ${i}: ${"family"===i?t:"variant"===i?v:`${n} ${v}`}`,"data-devtools":"sticker-hud","data-popmelt-sticker-hud":!0,"aria-hidden":g||void 0,style:ue,children:[Ke("style",{children:`@keyframes popmeltStickerReject {\n ${r}\n }\n @keyframes popmeltStickerFamilyLabelEnter {\n from {\n opacity: 0;\n transform: translate(-50%, 10px) scale(0.9);\n }\n to {\n opacity: 1;\n transform: translate(-50%, 0) scale(1);\n }\n }\n @keyframes popmeltStickerQueryCaret {\n 0%, 45% { opacity: 1; }\n 55%, 100% { opacity: 0; }\n }`}),Ke("span",{"aria-hidden":"true","data-popmelt-sticker-wheel-shell":!0,style:{position:"absolute",inset:1,borderRadius:21,background:x.surface,zIndex:1}}),Ke(Qn,{family:t,step:n,subproperty:o,stage:i,accentColor:a,applyPulse:l,snapPulse:d,stepUnavailable:u,colors:x}),!p&&Ye("span",{"aria-hidden":"true","data-popmelt-sticker-token-context":!0,"data-popmelt-sticker-token-context-stage":i,"data-popmelt-sticker-token-context-expanded":D?"true":"false",style:{position:"absolute",left:(In-ee)/2,top:9,width:ee,height:Mn,display:"flex",alignItems:"center",justifyContent:"center",gap:D?4:0,padding:D?`0 ${te}px`:0,boxSizing:"border-box",border:`1px solid ${C}`,borderRadius:12,background:x.actionSurface,color:x.actionForeground,transform:`translateY(${Jn(i)}px) scale(${Yn(i)})`,transition:`left ${ne}ms ease-out, width ${ne}ms ease-out, gap ${ne}ms ease-out, padding ${ne}ms ease-out, transform 250ms ease`,transformOrigin:"center",willChange:"left, width, transform",overflow:"hidden",zIndex:0},children:[Ke("span",{style:{display:"block",transform:`scale(${Kn(i)})`,transition:"transform 250ms ease",transformOrigin:"center"},children:Gn(t,i,o)?Ke("span",{"data-popmelt-sticker-color-context":o,style:{display:"block",width:12,height:12,borderRadius:"50%",background:fe(o,"value"===i?n:ge),boxShadow:"inset 0 0 0 1px rgb(255 255 255 / 0.16)"}}):Ke(Vn,{family:t,subproperty:"text"===t&&"variant"===i&&ye(o)?"color":o})}),Ke("span",{ref:A,"data-popmelt-sticker-subproperty-label":!0,style:{flexShrink:0,opacity:D&&Y>0?1:0,color:x.actionForeground,fontSize:11,fontWeight:600,letterSpacing:.22,lineHeight:1,whiteSpace:"nowrap",transition:"opacity 120ms ease"},children:D})]}),p&&Ke(kn,{query:p,border:C,background:x.actionSurface,foreground:x.actionForeground,renderIcon:e=>Ke(Vn,{family:e.family,subproperty:e.subproperty,size:12})}),Ke("span",{"aria-hidden":"true","data-popmelt-sticker-depth-burst":!0,style:{position:"absolute",left:37,top:5,width:An,height:An,overflow:"visible",pointerEvents:"none",zIndex:3},children:Hn.map(e=>Ke("span",{style:{position:"absolute",left:"50%",top:"50%",width:4,height:1.5,borderRadius:1,background:a,opacity:X?1:0,transform:`translate(-50%, -50%) rotate(${e}deg) translateX(${X?17:30}px) scaleX(${X?.7:1})`,transformOrigin:"center",transition:X?"none":"transform 180ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms ease-out",willChange:"transform, opacity"}},e))}),!p&&P&&Ke("span",{"data-popmelt-sticker-family-label":!0,style:{position:"absolute",left:"50%",top:44,height:Mn,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 10px",boxSizing:"border-box",opacity:B?1:0,transform:`translate(-50%, ${W?-35:0}px) scale(${W?.9:1})`,transformOrigin:"center",transition:"transform 250ms ease, opacity 200ms ease",animation:B&&F?"popmeltStickerFamilyLabelEnter 250ms ease":void 0,border:`1px solid ${C}`,borderRadius:12,background:x.actionSurface,color:x.actionForeground,fontSize:11,fontWeight:600,letterSpacing:.22,lineHeight:1,whiteSpace:"nowrap",willChange:"transform, opacity",zIndex:0},children:xe(P)})]})}var nr=["reviewing","considering","thinking","zhuzhing","iterating","tweaking","reflecting","noodling","pondering","finessing","polishing","riffing"];function rr(e){if(e.subjectLabel)return`<${e.subjectLabel}>`;let t=e.dataAttributes?.["data-popmelt-label"]?.trim();if(t)return t;let n=e.tagName,r=e.id?`#${e.id}`:"",o=e.className?`.${e.className.split(" ").slice(0,2).join(".")}`:"";return e.reactComponent?`<${e.reactComponent}> ${n}${r}${o}`:`${n}${r}${o}`}var or=["id","data-pm","data-popmelt-frame","data-testid","data-test","data-cy","data-popmelt-media-id","data-popmelt-see-id","data-popmelt-subject-key","aria-label","name","href"],ir=["style","class","open","hidden","aria-hidden","data-state"];function ar(e){let t=new Set(or);for(let n of e){/\.[\w\\-]/.test(n)&&t.add("class");for(let e of n.matchAll(/\[\s*([\w:-]+)/g))t.add(e[1]);if(/:(checked|disabled|enabled|required|optional|read-only|read-write)\b/.test(n))for(let e of["checked","selected","disabled","required","readonly","contenteditable"])t.add(e)}return{attributes:[...new Set([...t,...ir])],changesIdentity:e=>"attributes"!==e.type||t.has(e.attributeName??"")}}var lr=12,sr=.24,dr=8;function cr(e){return{...a(),display:"flex",alignItems:"center",gap:4,backgroundColor:e,color:"#fff",fontSize:12,lineHeight:12*i+"px",fontFamily:o,letterSpacing:"0.24px",padding:"0 8px",borderRadius:8,whiteSpace:"nowrap",maxWidth:400}}var ur={overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0};function pr(e,t){return!(!t||e!==t&&!e.contains(t))}function mr(e){let t=new Set(["resolved","needs_review","waiting_input","failed"]);return!!("text"===e.type&&e.text&&e.linkedSelector&&e.status&&t.has(e.status)&&e.threadId)}function hr(e){let t=e.status??"pending",n=new Set(["pending","sending","in_flight","resolved","waiting_input","failed"]);return!!("text"===e.type&&e.text&&e.linkedSelector&&n.has(t))}function fr(e){return e.isInFlight?"#888888":e.comment?!1===e.comment.pending?"#888888":e.threadAccentColor:e.isInFlight||e.hasThreadState||e.hasStickers?"#888888":e.accentColor}function gr(e,t){let n=e.get(t);return!!n&&(clearTimeout(n),e.delete(t),!0)}function yr(e,t,n){return null!==e&&e.selector===t&&e.expandedIndices.includes(n)}function xr(e,t){return e?.selector===t?null:e}function Cr({selector:e,label:t,tokens:n}){return JSON.stringify([e,t,n])}function vr({hasElementChanges:e=!1,hasPendingChanges:t,hasThreadState:n,isHovered:r,hasTimedReveal:o,isRevealedSticker:i}){let a=(e||t||n)&&!r;return{annotationCollapsed:a,stickerCollapsed:a&&!i,sendCompact:a&&!o}}function wr({property:e}){let t,n=/^(padding|margin)(?:-(top|right|bottom|left))?$/.exec(e);n&&(t={family:n[1],subproperty:n[2]??"all"});let r=/^border-(top|right|bottom|left)-width$/.exec(e);r&&(t={family:"border",subproperty:r[1]});let o=/^border-(top-left|top-right|bottom-right|bottom-left)-radius$/.exec(e);o&&(t={family:"radius",subproperty:o[1]});let i={"border-width":["border","all"],"border-radius":["radius","all"],"font-size":["text","size"],"font-weight":["text","weight"],"line-height":["text","line-height"],"letter-spacing":["text","letter-spacing"],"text-align":["text","text-align"],"flex-direction":["stack","direction"],"align-items":["stack","align"],"justify-content":["stack","justify"],gap:["stack","gap"],"grid-template-columns":["grid","columns"],"grid-template-rows":["grid","rows"],translate:["transform","translate"],scale:["transform","scale"],rotate:["transform","rotate"],opacity:["opacity","opacity"],"mix-blend-mode":["opacity","mix-blend"]}[e];if(i&&(t={family:i[0],subproperty:i[1]}),t)return Ke(Vn,{...t});let a=/(^|-)color$|^(fill|stroke)$/.test(e)?Z:/(^|-)(width|inline-size)$/.test(e)?J:/(^|-)(height|block-size)$/.test(e)?Y:K;return Ke(a,{"aria-hidden":"true","data-popmelt-property-icon":e,size:12,strokeWidth:2.5,style:{display:"block"}})}function br({chip:e}){return e.selection?Ke(Vn,{...e.selection}):Ke(wr,{property:e.custom.property})}function kr(e){return e.comment?.threadState??e.threadState}function Ir(e){return rr(e.element)}function Sr(e,t,n){return function(e,t,n){if(void 0===n.avoidLeft&&void 0===n.avoidRight)return!0;let r=typeof window<"u"?window.innerWidth:9999,o=n.avoidLeft??0,i=n.avoidRight??r;return e+t>o&&e<i}(t,n,e)?e:{}}function Mr(e){let t=e.stickers.map(e=>e.token).join(""),n=e.comment?.text??e.label;return Math.min(720,44+7.2*n.length+7.2*t.length)}function $r(e,t){return t||!1===e?.pending?0:e?.imageCount??0}function Ar(e,t,n,r,o,i){return`translate(${"right"===n?`max(calc(-100% + ${r}px), calc(0px - max(0px, ${e}px)))`:`min(0px, calc(100vw - max(0px, ${e}px) - 100%))`}, min(max(0px, calc(${void 0!==o?`${o}px`:"0px"} - max(0px, ${t}px))), calc(${void 0!==i?`${i}px`:"100dvh"} - max(0px, ${t}px) - 100%)))`}function Er({left:e,top:t,avoidTop:n,avoidBottom:r,anchor:o,horizontalAlignment:i="left",visualRef:a,style:l,children:s,...d}){let c=b(o),u=e-c.left,p=t-c.top;return Ke("div",{"data-devtools":"badge-hit-area",...d,style:{position:"fixed",left:`max(0px, ${u}px)`,top:`max(0px, ${p}px)`,padding:`${c.top}px ${c.right}px ${c.bottom}px ${c.left}px`,transform:Ar(u,p,i,c.left+c.right,n,r),...l},children:Ke("div",{ref:a,children:s})})}function Hr({targetDocument:e,subjectRegistry:t,projectedTargets:n,readOnly:r=!1,focusedSelector:o,threadAccessory:i,styleModifications:a,textModifications:v,stagedComments:b,accentColor:k,annotationNumberBySelector:I,inFlightSelectors:S,inFlightAnnotationIds:M,activeAnnotationIds:A,inFlightSelectorJobIds:E,waitingApprovalJobIds:H,inFlightSelectorColors:P,toolbarRef:V,onHoverSelector:B,sendHintSelector:L,pendingBundleCount:W=1,onHoverSendBundle:Z,onSend:F,onSelectSticker:O,onDeleteSticker:D,threadStates:_,onViewThread:q,hoveredElement:J,hoveredElementInfo:Y,showHoverIdentifier:K=!1,onEditComment:X,onDeleteComment:G,onDeletePeerComment:Q,onDeletePeerStyles:U,onDiscardTextChanges:ee,onArchiveThread:te,onClearInteractionEpisode:ne,onEditSubject:re,onDeleteSubject:oe,onHoverSubjectLabel:ie,activeCommentEntry:ae,refreshKey:le}){let de=qe(l),ce=qe($),[me,he]=Ze([]),[fe,ge]=Ze(null),[ye,xe]=Ze(null),[ke,Ie]=Ze(()=>new Map),Se=De(new Map),Me=De(new Map),$e=De(new Map),Ae=De(new Map),Te=De(new Map),Re=De(new Map),ze=Oe(e=>{gr(Te.current,e)},[]),Be=Oe(e=>{!function(e,t,n,r=1e3){gr(e,t),e.set(t,setTimeout(()=>{e.delete(t),n()},r))}(Te.current,e,()=>{xe(t=>t===e?null:t),ge(t=>t?.selector===e?null:t)})},[]),Le=Oe((e,t,n)=>{ge(r=>function(e,t){return e&&e.selector===t.selector?t.index===e.index?e:{...t,expandedIndices:t.index>e.index?[...new Set([...e.expandedIndices,t.index])]:[...new Set([...e.expandedIndices.filter(e=>e<=t.index),t.index])]}:{...t,expandedIndices:[t.index]}}(r,{selector:e,target:t,index:n}))},[]),We=Oe(e=>!!S?.has(e.selector)||!!e.comment&&!!A?.has(e.comment.id),[A,S]),Je=Oe((e,t)=>!We(e)&&(!!e.comment&&!!M?.has(e.comment.id)||"in_flight"===t?.status),[We,M]),Ge=Oe(e=>{let t=mt(e.hasPendingChanges,kr(e),E?.get(e.selector));return function({isInFlight:e,isQueued:t=!1,threadStatus:n}){return e?"working":t||"in_flight"===n?"queued":"waiting_input"===n?"question":"failed"===n?"failed":"resolved"===n?"replied":"draft"}({isInFlight:We(e),isQueued:Je(e,t),threadStatus:t?.status})},[We,Je,E]),Qe=me.filter(e=>e.hasPendingChanges||!!kr(e)).map(e=>Cr({selector:e.selector,label:e.label,tokens:[...e.stickers.map(e=>e.token),..."draft"===Ge(e)?[]:[`status:${Ge(e)}`]]})).join("|");_e(()=>{let e=new Set,t=new Map,n=new Set,r=new Set;for(let o of me){let i=kr(o);if(!o.hasPendingChanges&&!i)continue;e.add(o.selector);let a=Ge(o),l=Cr({selector:o.selector,label:o.label,tokens:[...o.stickers.map(e=>e.token),..."draft"===a?[]:[`status:${a}`]]});if(Se.current.get(o.selector)===l)continue;Se.current.set(o.selector,l);let s=$e.current.get(o.selector);$e.current.set(o.selector,a),"working"===a&&"working"!==s&&r.add(o.selector);let d=Me.current.get(o.selector),c=new Map,u=null;for(let e of o.stickers){let t=Ce(e);c.set(t,e.token),d?.get(t)!==e.token&&(u=t)}if(Me.current.set(o.selector,c),!o.hasPendingChanges&&(void 0===s||"draft"===s&&"queued"!==a&&"working"!==a)){let e=Ae.current.get(o.selector);e&&clearTimeout(e),Ae.current.delete(o.selector),n.add(o.selector);continue}t.set(o.selector,u);let p=Ae.current.get(o.selector);p&&clearTimeout(p),Ae.current.set(o.selector,setTimeout(()=>{Ie(e=>{if(!e.has(o.selector))return e;let t=new Map(e);return t.delete(o.selector),t}),Ae.current.delete(o.selector)},1e3))}for(let[t,n]of Ae.current)e.has(t)||(clearTimeout(n),Ae.current.delete(t),Se.current.delete(t),Me.current.delete(t),$e.current.delete(t));r.size>0&&ge(e=>e&&r.has(e.selector)?null:e),Ie(r=>{let o=new Map([...r].filter(([t])=>e.has(t)));for(let[e,n]of t)o.set(e,n);for(let e of n)o.delete(e);return o.size===r.size&&[...o].every(([e,t])=>r.get(e)===t)?r:o})},[me,Qe,Ge]),Fe(()=>()=>{for(let e of Ae.current.values())clearTimeout(e);Ae.current.clear();for(let e of Te.current.values())clearTimeout(e);Te.current.clear(),Se.current.clear(),Me.current.clear(),$e.current.clear()},[]);let Ue=S&&S.size>0||A&&A.size>0,{charIndex:tt,word:nt}=function(e){let t=qe(l),[n,r]=Ze(0),[o,i]=Ze(()=>Math.floor(Math.random()*nr.length));return Fe(()=>{if(!e||!t)return;let n=setInterval(()=>r(e=>(e+1)%3),250),o=setInterval(()=>i(e=>(e+1)%nr.length),3e3);return()=>{clearInterval(n),clearInterval(o)}},[e,t]),{charIndex:n,word:nr[o]}}(!!Ue);Fe(()=>{if(!de)return;let t=null,r=!1,o=e??document,i=ar([...b.flatMap(e=>[e.selector,e.element.selector]),...a.flatMap(e=>[e.selector,e.element.selector]),...v.flatMap(e=>[e.selector,e.element.selector]),...Array.from(_??[]).flatMap(([e,t])=>t.selectors??[e])]),l=(e,t)=>n?null:Pe(e,t,o),d=()=>{let t=[],r=new Map,i=t=>(r.has(t)||r.set(t,n?null:e?(e=>{try{let t=o.querySelectorAll(e);return 1===t.length?t[0]:null}catch{return null}})(t):pe(t)),r.get(t)),s=new Map;for(let e of b)s.set(e.selector,{selector:e.selector,element:e.element,styleChangeCount:0,textChangeCount:0,hasPendingChanges:!1!==e.pending,stickers:[],comment:e});for(let e of a){let t=s.get(e.selector),n=[...t?.stickers??[]];if(we(e.captured,E?.get(e.selector)))for(let t of be(e.changes)){let e=Ce(t);n.some(t=>Ce(t)===e)||n.push(t)}s.set(e.selector,{selector:e.selector,element:e.element,styleChangeCount:(t?.styleChangeCount??0)+e.changes.length,textChangeCount:t?.textChangeCount??0,modifiedText:t?.modifiedText,hasPendingChanges:(t?.hasPendingChanges??!1)||!e.captured&&!e.awaitingReview,threadState:et(e)??t?.threadState,stickers:n,comment:t?.comment})}for(let e of v){let t=s.get(e.selector);s.set(e.selector,{selector:e.selector,element:t?.element??e.element,styleChangeCount:t?.styleChangeCount??0,textChangeCount:1,modifiedText:e.modified,hasPendingChanges:(t?.hasPendingChanges??!1)||!e.captured,stickers:t?.stickers??[],threadState:t?.threadState,comment:t?.comment})}let d=new Set,c=new Set,u=new Set;for(let e of s.values()){let t=e.comment?.threadState;t?.threadId&&c.add(t.threadId),t?.targetBindingId&&u.add(t.targetBindingId)}for(let[e,t]of s){let n=l(e,t.element);n&&(t.resolvedElement=n),n&&d.add(n)}for(let[e,t]of _??[]){if(n||c.has(t.threadId)||t.targetBindingId&&u.has(t.targetBindingId))continue;let r=Ve(t.selectors??[e],t.targetFingerprint,o);if("matched"!==r.status)continue;let{element:i}=r,a=t.selectors?.[0]??e;!i||d.has(i)||(d.add(i),s.set(a,{selector:a,element:{...ue(i),selector:a},styleChangeCount:0,textChangeCount:0,hasPendingChanges:!1,stickers:[],resolvedElement:i,threadState:t}))}Array.from(s.values()).forEach(e=>{let r=e.transientElement??e.resolvedElement??l(e.selector,e.element),o=n?.get(e.selector);if(!r&&!o)return;let a=function(e){return e.textChangeCount>0&&0===e.styleChangeCount?{label:`Text changed: ${e.modifiedText?.replace(/\s+/g," ").trim()||"Empty text"}`}:{label:e.elementLabel}}({elementLabel:Ir(e),styleChangeCount:e.styleChangeCount,textChangeCount:e.textChangeCount,modifiedText:e.modifiedText}),s=e.comment?.threadState??e.threadState??(_?lt(e.selector,_,i):void 0);t.push({threadState:s,selector:e.selector,label:e.threadState?.title?.trim()||a.label,annotationNumber:e.transientElement?void 0:e.comment?.annotationNumber??s?.annotationNumber??I.get(e.selector),domElement:r,projectedRect:o,hasPendingChanges:e.hasPendingChanges,hasElementChanges:e.styleChangeCount>0||e.textChangeCount>0,stickers:e.stickers,transient:!!e.transientElement,comment:e.comment})}),he(e=>function(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return e.selector===r.selector&&e.label===r.label&&e.annotationNumber===r.annotationNumber&&e.domElement===r.domElement&&e.projectedRect===r.projectedRect&&e.threadState===r.threadState&&e.comment===r.comment&&e.hasPendingChanges===r.hasPendingChanges&&e.hasElementChanges===r.hasElementChanges&&e.transient===r.transient&&e.stickers.length===r.stickers.length&&e.stickers.every((e,t)=>{let n=r.stickers[t];return e.token===n.token&&e.selection===n.selection&&Ce(e)===Ce(n)})})}(e,t)?e:t)},c=()=>{r||null!==t||(t=requestAnimationFrame(()=>{t=null,d()}))};if(d(),n)return;window.addEventListener("resize",c,!0);let u=new MutationObserver(e=>{e.some(i.changesIdentity)&&c()});u.observe(o.body,{attributes:!0,childList:!0,characterData:!0,subtree:!0,attributeFilter:i.attributes}),window.addEventListener("load",c),o.fonts?.ready?.then(c);let p=[...a,...v].some(e=>e.selector.startsWith("@frame("))||b.some(e=>e.selector.startsWith("@frame("))?s(c):void 0;return()=>{r=!0,p?.(),window.removeEventListener("resize",c,!0),window.removeEventListener("load",c),u.disconnect(),t&&cancelAnimationFrame(t)}},[de,I,b,a,v,_,E,e,n]);let rt=K&&!ye&&J&&Y?.selector&&!me.some(e=>e.domElement===J)?{selector:Y.selector,label:Ir({element:Y}),annotationNumber:void 0,domElement:J,hasPendingChanges:!1,hasElementChanges:!1,stickers:[],transient:!0}:null,ot=rt?[...me,rt]:me;if(0===ot.length)return null;let it=de?V?.current?.getBoundingClientRect():void 0,at=!!it&&it.top<window.innerHeight/2,st=it?{avoidTop:at?it.bottom+8:void 0,avoidBottom:at?void 0:it.top-8,avoidLeft:it.left-8,avoidRight:it.right+8}:{},dt=e=>i?.threadId&&i.threadId===(e.comment?.threadId??kr(e)?.threadId)?i:void 0,ct=e=>ce?.preview&&ce.preview.threadId===(e.comment?.threadId??kr(e)?.threadId),ut=e=>{let t=ae?.element===e.domElement,n=mt(e.hasPendingChanges,kr(e),E?.get(e.selector)),r=We(e),o=Je(e,n),i=H?.has(E?.get(e.selector)??n?.jobId??""),a=e.comment?.awaitingReview?"Awaiting review":i?"Approval needed":r?nt||"Thinking":o?"Queued":"in_flight"===n?.status?"Thinking":"waiting_input"===n?.status?"Question":"failed"===n?.status?"Failed":n?.label??"Replied";return(t?ae.width+(ae.trailingWidth??0)+Mr(e):Mr(e)+vn($r(e.comment,r||!!n))+w(e.comment?.interactionEpisodeStepCount??0))+(dt(e)?.width??(n||e.comment?.awaitingReview?28+7.2*a.length:0))+(ct(e)?m+2:0)},pt=ot.find(e=>e.transient)??ot.find(e=>e.domElement&&pr(e.domElement,J)||ye===e.selector||fe?.selector===e.selector)??(r?ot.find(e=>e.selector===o):void 0),ht=(()=>{if(!pt)return null;let e=pt.projectedRect,t=e?{...e,right:e.left+e.width,bottom:e.top+e.height}:pt.domElement?Ne(pt.domElement):void 0;if(!t)return null;let n=ut(pt),r=d(t,22,2,window.innerHeight,n,window.innerWidth);return c(r,n,22)})(),ft=cr(k),gt=ur;return Ye(Xe,{children:[Ke("style",{dangerouslySetInnerHTML:{__html:'\n[data-devtools="badge"]::selection,\n[data-devtools="badge"] *::selection {\n background: #000000;\n color: #ffffff;\n}\n.popmelt-staged-sticker-group {\n display: flex;\n align-items: center;\n isolation: isolate;\n}\n.popmelt-staged-sticker-layer {\n position: relative;\n align-self: stretch;\n display: flex;\n align-items: center;\n margin-right: -2px;\n}\n.popmelt-staged-sticker-pointer {\n position: absolute;\n left: -4px;\n top: 50%;\n width: 14.142px;\n height: 14.142px;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: translateY(-50%);\n pointer-events: none;\n}\n.popmelt-staged-sticker-pointer::before {\n content: \'\';\n width: 10px;\n height: 10px;\n background: var(--popmelt-staged-accent);\n transform: rotate(-45deg);\n}\n.popmelt-collapsible-badge-detail {\n max-width: 400px;\n opacity: 1;\n overflow: hidden;\n transition: max-width 180ms cubic-bezier(0.2, 0, 0, 1), opacity 100ms linear;\n}\n.popmelt-collapsible-badge-detail-inner {\n display: block;\n min-width: 0;\n overflow: hidden;\n padding-left: 4px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n[data-popmelt-collapsed="true"] .popmelt-collapsible-badge-detail {\n max-width: 0;\n opacity: 0;\n}\n@supports (interpolate-size: allow-keywords) {\n .popmelt-collapsible-badge-detail {\n width: max-content;\n interpolate-size: allow-keywords;\n transition: width 180ms cubic-bezier(0.2, 0, 0, 1), opacity 100ms linear;\n }\n [data-popmelt-collapsed="true"] .popmelt-collapsible-badge-detail {\n width: 0;\n max-width: 400px;\n }\n}\n[data-popmelt-snap-collapse="true"] .popmelt-collapsible-badge-detail {\n transition: none;\n}\n@media (prefers-reduced-motion: reduce) {\n .popmelt-collapsible-badge-detail {\n transition: none;\n }\n}\n'}}),ot.map(e=>{let n=dt(e),i=ae?.element===e.domElement,l=mt(e.hasPendingChanges,kr(e),E?.get(e.selector)),s=We(e),d=Je(e,l),w=function(e,t,n,r){return t?r?.get(e)??n:n}(e.selector,s,k,P),b=function(e,t,n){return n?.color?n.color:!1===t?.pending&&(t.threadState||t.awaitingReview)?t.color:e}(w,e.comment,kr(e)),I=function(e,t){return t?"#888888":e}(b,s||"in_flight"===l?.status),S=H?.has(E?.get(e.selector)??l?.jobId??""),M=e.comment?.awaitingReview||"awaiting_review"===l?.status,$=M?"Awaiting review":S?"Approval needed":s?nt||"Thinking":d?"Queued":"in_flight"===l?.status?"Thinking":"waiting_input"===l?.status?"Question":"failed"===l?.status?"Failed":l?.label??"Replied",A=!(!e.domElement||!pr(e.domElement,J)),V=ye===e.selector,_=ke.has(e.selector),Y=ke.get(e.selector),K=!!l||!1===e.comment?.pending,de=vr({hasElementChanges:e.hasElementChanges,hasPendingChanges:e.hasPendingChanges,hasThreadState:K,isHovered:r&&o===e.selector||A||V||yr(fe,e.selector,0),hasTimedReveal:_,isRevealedSticker:!1}),ce=e.stickers.length+1,ue=vr({hasElementChanges:e.hasElementChanges,hasPendingChanges:e.hasPendingChanges,hasThreadState:K,isHovered:yr(fe,e.selector,ce),hasTimedReveal:_,isRevealedSticker:!1}),pe=vr({hasElementChanges:e.hasElementChanges,hasPendingChanges:e.hasPendingChanges,hasThreadState:K,isHovered:r&&o===e.selector||A||V||yr(fe,e.selector,ce),hasTimedReveal:_,isRevealedSticker:_}),me=ut(e),he=(i?ae.imageCount:$r(e.comment,s||!!l))??0,we=e.stickers.length>0||he>0,be=u({hasCommentEntry:i||!!e.comment,stagedChangeCount:e.stickers.length+ +(he>0)}),Ie=s||!!l||!!e.comment?.awaitingReview,Se=!Ie&&e.selector===L,Me=!i&&de.annotationCollapsed&&pe.stickerCollapsed&&ue.sendCompact&&!_&&fe?.selector!==e.selector,$e=Me?p({annotationNumber:e.annotationNumber,stickerCount:e.stickers.length,interactionEpisodeStepCount:e.comment?.interactionEpisodeStepCount??0,hasStatus:Ie,hasSend:Se,controlGap:be})+vn(he)+(ct(e)?m+be:0):me;return Ke(h,{element:e.domElement,projectedRect:e.projectedRect,onRemove:e.comment&&Q?()=>Q(e.comment.id):U&&a.some(t=>t.selector===e.selector)?()=>U(a.filter(t=>t.selector===e.selector)):void 0,onActivate:e.comment?.threadId||l?.threadId?()=>q?.(e.comment?.threadId??l?.threadId):void 0,hideOutline:!(r&&pt===e),color:b,fillOpacity:.1,outlineZIndex:10002,subjectRegistry:t,hideTooltip:!0,railGap:2,railWidth:me,refreshKey:le,renderRail:t=>{let o=Re.current.get(e.selector)?.getBoundingClientRect(),u=o?.width?o:c(t,me,22),p=!!(Me&&pt!==e&&ht&&f(u,ht));if(pt!==e&&ht&&f(c(t,$e,22),ht))return null;let m="right"===t.horizontalAlignment?t.left-me:t.left,h=Sr(st,m,me);if(e.transient){let n=e.domElement?se(e.domElement):null;return Ke(Er,{"data-popmelt-rail-priority":"intent","data-popmelt-subject-label-action":n?"true":void 0,"data-popmelt-subject-adapter":n?.adapter,"data-popmelt-subject-key":n?.key,left:t.left,top:t.top,avoidTop:h.avoidTop,avoidBottom:h.avoidBottom,anchor:t.anchor,horizontalAlignment:t.horizontalAlignment,style:{zIndex:10001,pointerEvents:n?"auto":"none",cursor:n?"pointer":void 0},onPointerDown:e=>{n&&e.stopPropagation()},onClick:e=>{n&&(e.preventDefault(),e.stopPropagation(),re?.(n))},onContextMenu:e=>{n&&(e.preventDefault(),e.stopPropagation(),oe?.(n))},onMouseEnter:()=>{n&&ie?.(n)},onMouseLeave:()=>ie?.(null),children:Ke("div",{"data-devtools":"steer-element-identifier",ref:t=>{e.domElement&&je(e.domElement,t)},"data-popmelt-subject-label-action":n?"true":void 0,style:{...ft,borderRadius:e.domElement===document.body?g("bottom-left"):g(t.anchor)},children:Ke("span",{style:gt,children:e.label})})})}return Ke(Er,{"data-popmelt-rail-priority":"history","data-popmelt-snap-collapse":p||void 0,visualRef:t=>{t?Re.current.set(e.selector,t):Re.current.delete(e.selector)},left:t.left,top:t.top,avoidTop:h.avoidTop,avoidBottom:h.avoidBottom,anchor:t.anchor,horizontalAlignment:t.horizontalAlignment,onClick:()=>{if(i)return;let t=function(e,t){if(e){if(e.threadId)return{type:"open-thread",threadId:e.threadId};if(!1!==e.pending)return{type:"edit-comment",annotationId:e.id};if(e.threadState?.threadId)return{type:"open-thread",threadId:e.threadState.threadId}}return t?{type:"open-thread",threadId:t}:{type:"none"}}(e.comment,e.comment?.threadId??l?.threadId);"edit-comment"===t.type?X?.(t.annotationId):"open-thread"===t.type&&q?.(t.threadId)},onContextMenu:t=>{if(t.preventDefault(),t.stopPropagation(),e.comment&&Q)Q(e.comment.id);else{if(U){let t=a.filter(t=>t.selector===e.selector);if(t.length)return void U(t)}e.comment&&!1!==e.comment.pending&&G?(ze(e.selector),ge(t=>xr(t,e.selector)),xe(t=>t===e.selector?null:t),B?.(null),G(e.comment.id)):v.some(t=>t.selector===e.selector&&!t.captured)?ee?.(e.selector):!e.hasPendingChanges&&!s&&"resolved"===l?.status&&te?.(l.threadId)}},onMouseEnter:()=>{ze(e.selector),xe(e.selector),B?.(e.selector)},onMouseLeave:()=>{Be(e.selector),B?.(null)},style:{zIndex:i?10002:1e4,cursor:i?"text":"pointer",pointerEvents:"auto"},children:Ye("div",{ref:t=>{e.domElement&&je(e.domElement,t)},style:{display:"flex",alignItems:"center",gap:be},children:[i?ae.render(t.anchor):Ye("div",{"data-devtools":"badge","data-popmelt-collapsed":de.annotationCollapsed,onMouseEnter:()=>Le(e.selector,"annotation",0),style:{...ft,...n&&{maxWidth:`min(400px, calc(100vw - ${n.width+24}px))`},backgroundColor:fr({accentColor:k,threadAccentColor:b,comment:e.comment,isInFlight:s,hasThreadState:!!l,hasStickers:e.stickers.length>0}),gap:0,letterSpacing:e.comment?0:ft.letterSpacing,borderRadius:e.domElement===document.body?g("bottom-left"):g(t.anchor)},children:[Ke("span",{style:{fontWeight:600},children:e.annotationNumber}),Ke("span",{className:"popmelt-collapsible-badge-detail",children:Ke("span",{className:"popmelt-collapsible-badge-detail-inner",style:{...gt,paddingLeft:e.comment?0:void 0},children:e.comment?Ye(Xe,{children:[".",Ke("span",{style:{marginLeft:2},children:n?n.formatText(e.comment.text):e.comment.text})]}):Ye(Xe,{children:[". ",e.label]})})})]}),!we&&Ke(y,{stepCount:i?0:e.comment?.interactionEpisodeStepCount??0,onClear:!1!==e.comment?.pending&&ne?()=>ne(e.comment.id):void 0,submitted:!1===e.comment?.pending}),we&&Ye("div",{className:"popmelt-staged-sticker-group",children:[e.stickers.map((t,n)=>{let o=Ce(t),i=vr({hasElementChanges:e.hasElementChanges,hasPendingChanges:e.hasPendingChanges,hasThreadState:!!l,isHovered:yr(fe,e.selector,n+1),hasTimedReveal:_,isRevealedSticker:_&&o===Y}),a=ve(n,e.stickers.length+ +(he>0)),s=0===n?void 0:He;return Ye("div",{className:"popmelt-staged-sticker-layer",style:{zIndex:a.zIndex},children:[Ke("span",{"aria-hidden":!0,className:"popmelt-staged-sticker-pointer",style:{"--popmelt-staged-accent":I,WebkitMaskImage:0===n?void 0:Ee,maskImage:0===n?void 0:Ee}}),Ye("button",{type:"button","data-devtools":"staged-sticker","data-popmelt-style-property":t.custom?.property,title:t.custom?`${t.custom.property}: ${t.custom.value}`:void 0,"data-popmelt-collapsed":i.stickerCollapsed,onMouseEnter:()=>Le(e.selector,o,n+1),"aria-label":t.custom?`Custom ${t.custom.property}: ${t.custom.value}`:`${r?"Staged":"Edit staged"} ${t.token} sticker`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:n=>{n.preventDefault(),n.stopPropagation(),t.selection&&O?.(e.selector,t.selection)},onContextMenu:n=>{n.preventDefault(),n.stopPropagation(),ze(e.selector),ge(t=>xr(t,e.selector)),B?.(null),t.selection&&D?.(e.selector,t.selection)},style:{...ft,position:"relative",height:"100%",minHeight:22,appearance:"none",border:0,margin:0,paddingLeft:a.paddingLeft,paddingRight:a.paddingRight,gap:0,cursor:t.selection&&(O||D)?"pointer":"default",backgroundColor:I,WebkitMaskImage:s,maskImage:s},children:[Ke(br,{chip:t}),Ke("span",{className:"popmelt-collapsible-badge-detail",children:Ke("span",{className:"popmelt-collapsible-badge-detail-inner",children:t.token})})]})]},o)}),Ke(wn,{imageCount:he,color:I,layered:e.stickers.length>0}),!i&&(e.comment?.interactionEpisodeStepCount??0)>0&&Ke("div",{className:"popmelt-staged-sticker-layer",style:{zIndex:1},children:Ke(y,{stepCount:e.comment.interactionEpisodeStepCount,layered:!0,onClear:!1!==e.comment?.pending&&ne?()=>ne(e.comment.id):void 0,submitted:!1===e.comment?.pending})}),Se&&Ke(x,{bundleCount:W,compact:ue.sendCompact,layered:!0,onHoverChange:t=>{t&&Le(e.selector,"send",ce),Z?.(t)},onSend:F,style:{position:"relative",zIndex:(e.comment?.interactionEpisodeStepCount??0)>0?0:1}})]}),n?.controls,Ke(C,{threadId:e.comment?.threadId??l?.threadId,color:b}),!n&&Ie&&Ke("button",{type:"button","data-devtools":"annotation-badge","data-popmelt-collapsed":pe.stickerCollapsed,onMouseEnter:()=>Le(e.selector,"thread-status",ce),"aria-label":l?`${$}. Open thread`:$,onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:t=>{t.preventDefault(),t.stopPropagation();let n=e.comment?.threadId??l?.threadId;n&&q?.(n)},style:{...ft,appearance:"none",border:0,margin:0,cursor:l&&q?"pointer":"default",backgroundColor:b,gap:0},children:Ye(Xe,M?{children:[Ke(T,{size:12,strokeWidth:2.25}),Ke("span",{className:"popmelt-collapsible-badge-detail",children:Ke("span",{className:"popmelt-collapsible-badge-detail-inner",children:$})})]}:s?{children:[S?Ke(R,{size:12,"aria-label":"Approval needed"}):Ke("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"currentColor",style:{verticalAlign:"middle"},children:Ye(Xe,1===tt?{children:[Ke("circle",{cx:"7",cy:"7",r:"2"}),Ke("circle",{cx:"17",cy:"7",r:"2"}),Ke("circle",{cx:"7",cy:"17",r:"2"}),Ke("circle",{cx:"17",cy:"17",r:"2"})]}:{children:[Ke("circle",{cx:"12",cy:"6",r:"2"}),Ke("circle",{cx:"6",cy:"12",r:"2"}),Ke("circle",{cx:"18",cy:"12",r:"2"}),Ke("circle",{cx:"12",cy:"18",r:"2"})]})}),Ke("span",{className:"popmelt-collapsible-badge-detail",children:Ke("span",{className:"popmelt-collapsible-badge-detail-inner",style:{opacity:.8},children:$})})]}:{children:[d?Ke(T,{"data-devtools":"queued-status-icon",size:12,strokeWidth:2.25,style:{verticalAlign:"middle",opacity:.6}}):"waiting_input"===l?.status?Ke(j,{"data-devtools":"question-status-icon",size:12,strokeWidth:2.25,style:{transform:"translateY(-0.5px)",flexShrink:0}}):Ke("failed"===l?.status?N:z,{size:12,strokeWidth:2.25}),Ke("span",{className:"popmelt-collapsible-badge-detail",children:Ke("span",{className:"popmelt-collapsible-badge-detail-inner",children:$})})]})}),Se&&!we&&Ke(x,{bundleCount:W,compact:ue.sendCompact,onHoverChange:t=>{t&&Le(e.selector,"send",ce),Z?.(t)},onSend:F})]})})}},`${e.transient?"intent":"history"}:${e.selector}`)})]})}var Tr=4;function Rr(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function jr(e,t){return function(e,t){return e===t||Be(e,t)||Be(t,e)}(e,t)||null!==ze(e)&&ze(e)===ze(t)}function Nr(e){let t=0,n=ze(e);for(;n;)t+=1,n=ze(n);return t}function zr(e,t){return Pe(e,t?.[0])}function Pr(e){return!(!e.linkedSelector||"body"!==e.elements?.[0]?.tagName.toLowerCase())}function Vr(e){let t=d(e,22,2,window.innerHeight);return{x:t.left+window.scrollX+8,y:t.top+window.scrollY+4}}function Br(e){let t=e?.getBoundingClientRect();return!t||typeof window>"u"?{}:t.top<window.innerHeight/2?{avoidTop:t.bottom+8,avoidLeft:t.left-8,avoidRight:t.right+8}:{avoidBottom:t.top-8,avoidLeft:t.left-8,avoidRight:t.right+8}}function Lr(e,t){if(0===t.size)return null;let n=new Set,r=new Set;for(let o of e)t.has(o.id)&&(o.groupId&&n.add(o.groupId),o.threadId&&r.add(o.threadId));for(let t of e)t.groupId&&n.has(t.groupId)&&t.threadId&&r.add(t.threadId);let o=new Set(t);for(let t of e)(t.groupId&&n.has(t.groupId)||t.threadId&&r.has(t.threadId))&&o.add(t.id);return o}function Wr(e,t,n=0,r,o,i=90){let a=e.left+window.scrollX+8,l="top-left"===t?e.top+window.scrollY-4-22-22*n+4:e.bottom+window.scrollY+4+4+22*n,s=window.scrollY+4,d=window.scrollY+window.innerHeight-22-4,c=null;if(r&&void 0!==o){let t=r.getBoundingClientRect(),n=e.left;if(n+o+16+i>t.left&&n<t.right)if(t.top<window.innerHeight/2){let e=window.scrollY+t.bottom+4;e>s&&(s=e,c="top")}else{let e=window.scrollY+t.top-22-4;e<d&&(d=e,c="bottom")}}return s>d&&(d=s),l<s?l="top"===c?s:e.top+window.scrollY+4:l>d&&(l="bottom"===c?d:Math.max(e.top+window.scrollY+4,d)),{x:a,y:l}}var Zr=new Set(["resolved","needs_review","waiting_input","failed"]);function Fr(e){return e.linkedSelector??(e.target?de(e.target):void 0)}function Or(e,t){let n=e.groupId?t.filter(t=>t.groupId===e.groupId):[e],r=n.find(e=>void 0!==e.status&&Zr.has(e.status)),o=n.find(e=>e.threadId),i=n.find(e=>Fr(e)),a=i?Fr(i):void 0;if(!r?.status||!o?.threadId||!a)return;let l=n.find(e=>e.targetBindingId),s=n.find(e=>e.replyJobIds?.length);return{status:r.status,threadId:o.threadId,targetBindingId:l?.targetBindingId,replyJobIds:s?.replyJobIds,linkedSelector:a,elements:i?.elements}}function Dr({resolveElement:e,projectedSelectors:t,activeText:n,activeColor:r,annotations:o,annotationNumberById:i,focusedThreadAnnotationId:a,hiddenCollidingAnnotationIds:l,modifiedElementThreadStates:s,nestedCollidingAnnotationCountById:d,nestedCollidingAnnotationIdsById:c,pageAnnotations:u,pageStyleModifications:p,pageTextModifications:m,sendHintAnchorId:h,supersededAnnotations:f,visibleCollisionRepresentativeByAnnotationId:g,activeTextSendHintId:y,targetResolutionRevision:x}){let C=Oe((n,r)=>t?null:e?e(n,r):zr(n,r),[x,e,t]),v=We(()=>{let e=[],n=new Set,r=[...u].sort((e,t)=>t.timestamp-e.timestamp);for(let o of r){if("text"!==o.type||!o.text||!o.linkedSelector||f.has(o)||l.has(o.id))continue;let r=o.status??(o.captured?"in_flight":"pending");if(!["pending","sending","in_flight","awaiting_review"].includes(r))continue;let a=i.get(o.id);if(void 0===a||n.has(o.linkedSelector))continue;let s=C(o.linkedSelector,o.elements),d=o.elements?.[0];!s&&(!t?.has(o.linkedSelector)||!d)||(n.add(o.linkedSelector),e.push({id:o.id,selector:o.linkedSelector,text:o.text.replace(/\n/g," "),annotationNumber:a,color:o.color,element:d??ue(s),pending:"pending"===r,awaitingReview:"awaiting_review"===r,threadId:o.threadId,imageCount:o.imageCount??0,interactionEpisodeStepCount:o.interactionEpisode?.steps.length}))}return e},[i,l,u,f,C,t]),w=We(()=>new Set(v.map(e=>e.id)),[v]),b=We(()=>{let e=new Map;for(let t of u){if("text"!==t.type)continue;let n=Or(t,u);n&&e.set(t.id,n)}return e},[u]),k=We(()=>{let e=[],n=new Set,r=[...u].sort((e,t)=>+(t.id===a)-+(e.id===a)||t.timestamp-e.timestamp);for(let o of r){let r=b.get(o.id);if(!r||!mr({...o,status:r.status,threadId:r.threadId,linkedSelector:r.linkedSelector})||!o.text||f.has(o)||l.has(o.id)||n.has(r.linkedSelector))continue;let a=i.get(o.id);if(void 0===a)continue;let s=C(r.linkedSelector,r.elements),d=r.elements?.[0];!s&&(!t?.has(r.linkedSelector)||!d)||(n.add(r.linkedSelector),e.push({id:o.id,selector:r.linkedSelector,text:o.text.replace(/\n/g," "),annotationNumber:a,color:o.color,element:d??ue(s),pending:!1,imageCount:o.imageCount??0,interactionEpisodeStepCount:o.interactionEpisode?.steps.length,threadState:{jobId:r.replyJobIds?.[r.replyJobIds.length-1]??r.threadId,threadId:r.threadId,targetBindingId:r.targetBindingId,annotationNumber:a,status:"waiting_input"===r.status?"waiting_input":"failed"===r.status?"failed":"resolved",label:"waiting_input"===r.status?"Question":"failed"===r.status?"Failed":"Replied"}}))}return e},[i,a,l,u,b,f,C,t]),I=We(()=>[...v,...k],[k,v]),S=We(()=>{let e=new Set,t=new Set,n=new Set,r=new Set;for(let[e,o]of s??[])if("matched"===Ve(o.selectors??[e],o.targetFingerprint).status){t.add(o.threadId),o.targetBindingId&&n.add(o.targetBindingId);for(let e of o.selectors??[])r.add(e);!o.targetBindingId&&!o.selectors?.length&&r.add(e)}for(let o of u){let i=b.get(o.id),a=o.groupId?u.filter(e=>e.groupId===o.groupId):[o],s=a.map(Fr).find(e=>!!e),d=a.find(e=>e.threadId)?.threadId,c=a.find(e=>e.targetBindingId)?.targetBindingId;"text"===o.type&&o.text&&s&&!f.has(o)&&!l.has(o.id)&&((d&&t.has(d)||c&&n.has(c)||r.has(s)||i&&mr({...o,status:i.status,threadId:i.threadId,linkedSelector:i.linkedSelector})&&C(i.linkedSelector,i.elements))&&e.add(o.id))}return e},[l,s,u,b,f,C]),M=We(()=>{let e=new Set;for(let t of u)hr(t)&&t.linkedSelector&&!f.has(t)&&!l.has(t.id)&&C(t.linkedSelector,t.elements)&&e.add(t.id);return e},[l,u,f,C]),$=We(()=>{let e=new Set(M);for(let t of w)e.add(t);for(let t of S)e.add(t);return e},[M,S,w]),A=We(()=>new Map(I.map(e=>[e.selector,e.color])),[I]),E=We(()=>new Set([...l,...$]),[$,l]),H=We(()=>{if(!n?.linkedSelector||n.domEdit)return null;let e=C(n.linkedSelector,n.elements);if(!e)return null;let t=[...p,...m].find(t=>!t.captured&&zr(t.selector,[t.element])===e),r=u.find(e=>e.id===n.id),o=!(n.isNew||!r||!hr(r));return t||o?{element:e,selector:t?.selector??n.linkedSelector}:null},[n,u,p,m,C]),T=h===y?h:h?g.get(h)??h:null,R=We(()=>{if(T===y)return n?.text.trim()?H?.selector??null:null;if(T&&T!==y)return v.find(e=>e.id===T)?.selector??null;for(let e=m.length-1;e>=0;e-=1){let t=m[e];if(t&&!t.captured)return t.selector}for(let e=p.length-1;e>=0;e-=1){let t=p[e];if(t&&!t.captured&&!t.awaitingReview)return t.selector}return null},[n,H,y,p,m,v,T]),j=n?n.isNew?y:n.id:null,N=j?d.get(j)??0:0,z=j?c.get(j)??[]:[],P=n?.isNew?void 0:o.find(e=>e.id===n?.id),V="pending"===(P?.status??(P?.captured?"in_flight":"pending"))?P?.color??r:"#8c8c8c",B=We(()=>u.filter(e=>!(f.has(e)||l.has(e.id)||$.has(e.id)||n&&!n.isNew&&e.id===n.id)),[n,$,l,u,f]);return{activeTextAnnotation:P,activeTextCollisionId:j,activeTextModifiedRail:H,activeTextNestedAnnotationCount:N,activeTextNestedAnnotationIds:z,activeTextNestedBadgeColor:V,elementRailColorBySelector:A,elementRailCommentIds:$,elementRailComments:I,hiddenAnnotationBadgeIds:E,modifiedElementSendHintSelector:R,stagedElementComments:v,visibleCanvasAnnotations:B,visibleSendHintAnchorId:T}}function _r(e){if(e.length<2)return null;let t=e[0],n=e[e.length-1];return t&&n?[t,n]:null}function qr(e,t,n){return e.map(e=>({x:e.x-t,y:e.y-n}))}function Jr(e,t,n,r,o,i){let a=String(r);e.font="600 11px system-ui, -apple-system, sans-serif";let l=e.measureText(a).width+8,s=t-l/2,d=n+i/2+2;e.fillStyle=o,e.fillRect(s,d,l,19),e.fillStyle="#ffffff",e.textBaseline="middle",e.fillText(a,s+4,d+9.5)}function Yr(e,t){if(e.points.length<2&&"text"!==e.type)return null;switch(e.type){case"rectangle":case"freehand":{let t,n;if("freehand"===e.type)t=Math.min(...e.points.map(e=>e.x)),n=Math.max(...e.points.map(e=>e.y));else{let r=e.points[0],o=e.points[e.points.length-1];t=Math.min(r.x,o.x),n=Math.max(r.y,o.y)}return{x:t,y:n}}case"circle":{let t=e.points[0],n=e.points[e.points.length-1];return{x:Math.min(t.x,n.x),y:(Math.min(t.y,n.y)+Math.max(t.y,n.y))/2}}case"line":{let t=e.points[0],n=e.points[e.points.length-1],r=t.y>n.y?t:n;return{x:r.x,y:r.y}}default:return null}}function Kr(){let e=De(null),t=Oe(()=>{let t=e.current;if(!t)return;let n=t.getContext("2d");n&&n.clearRect(0,0,t.width,t.height)},[]),r=Oe((t,r,o,i=1,a=!1,l=!1)=>{let s=e.current;if(!s)return;let d=s.getContext("2d");if(!d)return;let c=t.status??(t.captured?"in_flight":"pending"),u="pending"===c?t.color:"#8c8c8c";switch(d.save(),d.globalAlpha=i,t.region&&n(d,t.region.points,u,!l),t.type){case"freehand":((e,t,n,r)=>{let o=_r(t);if(!o)return;let[i,a]=o;e.beginPath(),e.strokeStyle=n,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.moveTo(i.x,i.y);for(let n=1;n<t.length-1;n++){let r=t[n],o=t[n+1];!r||!o||e.quadraticCurveTo(r.x,r.y,(r.x+o.x)/2,(r.y+o.y)/2)}e.lineTo(a.x,a.y),e.stroke()})(d,t.points,u,t.strokeWidth);break;case"line":((e,t,n,r)=>{let o=_r(t);if(!o)return;let[i,a]=o;e.beginPath(),e.strokeStyle=n,e.lineWidth=r,e.lineCap="round",e.moveTo(i.x,i.y),e.lineTo(a.x,a.y),e.stroke()})(d,t.points,u,t.strokeWidth);break;case"rectangle":((e,t,n,r)=>{let o=_r(t);if(!o)return;let[i,a]=o;e.beginPath(),e.strokeStyle=n,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.strokeRect(Math.min(i.x,a.x),Math.min(i.y,a.y),Math.abs(a.x-i.x),Math.abs(a.y-i.y))})(d,t.points,u,t.strokeWidth);break;case"circle":((e,t,n,r)=>{let o=_r(t);if(!o)return;let[i,a]=o,l=(i.x+a.x)/2,s=(i.y+a.y)/2,d=Math.abs(a.x-i.x)/2,c=Math.abs(a.y-i.y)/2;e.beginPath(),e.strokeStyle=n,e.lineWidth=r,e.ellipse(l,s,d,c,0,0,2*Math.PI),e.stroke()})(d,t.points,u,t.strokeWidth);break;case"text":if(t.text&&t.points[0]){let e="pending"===c?"#ffffff":"#dddddd";v(d,t.points[0],t.text,u,t.fontSize,r,t.points[0].x,o,e,Pr(t)?"bottom-left":t.linkedAnchor,a)}}d.restore()},[]),o=Oe((t,n)=>{let r=e.current;if(!r||t.points.length<2)return;let o=r.getContext("2d");if(o){if(o.fillStyle="#ffffff",o.strokeStyle=t.color,o.lineWidth=1.5,"line"===t.type){return void[t.points[0],t.points[t.points.length-1]].forEach(e=>{o.beginPath(),o.arc(e.x,e.y,n/2,0,2*Math.PI),o.fill(),o.stroke()})}if("circle"===t.type){let e=t.points[0],r=t.points[t.points.length-1],i=Math.min(e.x,r.x),a=Math.max(e.x,r.x),l=Math.min(e.y,r.y),s=Math.max(e.y,r.y),d=(i+a)/2,c=(l+s)/2;return void[{x:d,y:l},{x:d,y:s},{x:i,y:c},{x:a,y:c}].forEach(e=>{o.beginPath(),o.rect(e.x-n/2,e.y-n/2,n,n),o.fill(),o.stroke()})}if("rectangle"===t.type||"freehand"===t.type){let e,r,i,a;if("freehand"===t.type)e=Math.min(...t.points.map(e=>e.x)),r=Math.max(...t.points.map(e=>e.x)),i=Math.min(...t.points.map(e=>e.y)),a=Math.max(...t.points.map(e=>e.y));else{let n=t.points[0],o=t.points[t.points.length-1];e=Math.min(n.x,o.x),r=Math.max(n.x,o.x),i=Math.min(n.y,o.y),a=Math.max(n.y,o.y)}[{x:e,y:i},{x:r,y:i},{x:e,y:a},{x:r,y:a}].forEach(e=>{o.beginPath(),o.rect(e.x-n/2,e.y-n/2,n,n),o.fill(),o.stroke()})}}},[]),i=Oe((n,i,a,l=0,s=0,d,c,u,p,m,h=.5,f,g)=>{if(t(),n.forEach(e=>{let t={...e,points:qr(e.points,l,s),...e.region?{region:{...e.region,points:qr(e.region.points,l,s)}}:{}},n=d?.get(e.id),o=m?.has(e.id)??!1,i=!!c?.size,a=c?.has(e.id)??!1,y=i?a?1:.2:!p||p.has(e.id)||o?1:h;r(t,n,u,y,f?.has(e.id),g?.has(e.id))}),i&&i.length>0&&a){let t=e.current?.getContext("2d");for(let e of i){let r=n.find(t=>t.id===e);if(r){let e=m?.has(r.id)??!1,i=!!c?.size,u=c?.has(r.id)??!1,f=i?u?1:.2:!p||p.has(r.id)||e?1:h,g={...r,points:qr(r.points,l,s)};if(t?.save(),t&&(t.globalAlpha=f),o(g,a),t&&"text"!==r.type&&d&&(!r.groupId||!n.some(e=>e.groupId===r.groupId&&"text"===e.type))){let e=d.get(r.id);if(void 0!==e){let n=Yr(g);if(n){let o="pending"===(r.status??(r.captured?"in_flight":"pending"))?r.color:"#999999";Jr(t,n.x,n.y,e,o,a)}}}t?.restore()}}}},[t,r,o]),a=Oe(()=>{let t=e.current;if(!t)return;let n=window.devicePixelRatio||1,r=window.visualViewport?.width??window.innerWidth,o=window.visualViewport?.height??window.innerHeight;t.width=r*n,t.height=o*n;let i=t.getContext("2d");i&&i.scale(n,n)},[]);return{canvasRef:e,clearCanvas:t,drawAnnotation:r,redrawAll:i,resizeCanvas:a}}var Xr=new Set;function Gr({annotations:e,annotationGroupMap:t,targetDocument:n,color:r,onViewThread:a,onDelete:l}){let{canvasRef:s,redrawAll:d,resizeCanvas:c}=Kr(),[u,p]=Ze({x:0,y:0,revision:0}),[m,h]=Ze([]);_e(()=>{let e=n.defaultView,t=()=>{let t=e?.frameElement?.getBoundingClientRect();p(n=>({x:(t?.left??0)-(e?.scrollX??0),y:(t?.top??0)-(e?.scrollY??0),revision:n.revision+1}))};return t(),e?.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),()=>{e?.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[n]);let f=We(()=>Pt(e,n.location?.pathname??"/").filter(e=>e.points.length>0).map(e=>({...e,color:r,...e.region?{region:{...e.region,points:e.region.points.map(e=>({x:e.x+u.x,y:e.y+u.y}))}}:{},points:e.points.map(e=>({x:e.x+u.x,y:e.y+u.y}))})),[e,r,n,u]);return _e(()=>{if(!f.length)return void h([]);c(),d(f,[],void 0,0,0,t);let e=s.current?.getContext("2d");e&&h(f.map(n=>{if("text"!==n.type){let e=function(e){if(0===e.length)return{x:0,y:0,width:0,height:0};let t=e.map(e=>e.x),n=e.map(e=>e.y),r=Math.min(...t),o=Math.max(...t),i=Math.min(...n);return{x:r,y:i,width:o-r,height:Math.max(...n)-i}}(n.points);return{annotation:n,left:e.x,top:e.y,width:Math.max(12,e.width),height:Math.max(12,e.height)}}let r=n.fontSize??12,a=t.get(n.id),l=`${void 0===a?"":`${a}. `}${(n.text??"").replace(/\n/g," ")}`,s=n.points[0];e.font=`${r}px ${o}`;let d=e.measureText(k(e,l,I(s.x))).width+16,c=S(s,r,void 0,d);return{annotation:n,left:c.x-8,top:c.y-4,width:d,height:r*i+8}}))},[f,t,s,d,c]),f.length?Ye(Xe,{children:[Ke("canvas",{ref:s,"aria-hidden":!0,style:{position:"fixed",inset:0,width:"100vw",height:"100vh",pointerEvents:"none",zIndex:9999}}),m.map(({annotation:e,...t})=>Ke("button",{type:"button","data-devtools":"peer-canvas-annotation","data-annotation-id":e.id,"aria-label":e.text??"Annotation",onClick:t=>{t.stopPropagation(),e.threadId&&a?.(e.threadId)},onPointerDown:e=>e.stopPropagation(),onContextMenu:l?t=>{t.preventDefault(),t.stopPropagation(),l(e.id)}:void 0,style:{...t,position:"fixed",padding:0,border:0,background:"transparent",pointerEvents:"auto",cursor:e.threadId?"pointer":"default",zIndex:9999}},e.id)),Ke(M,{annotations:f,supersededAnnotations:Xr,annotationGroupMap:t,scrollX:0,scrollY:0,onViewThread:a,canvasRef:s,pendingBundleCount:0})]}):null}var Qr=new Set,Ur=new Map,eo=new Map,to=new Map;function no({peer:n,targetDocument:r,projectedTargets:o,hoveredElement:i,getSubjects:a,onApprove:l,focusedAnnotationId:s}){let d=qe(e),c=qe(t),u=c?.isHost&&"guest"===n.identity.relationship&&c.deletePeerAnnotations&&!c.view?.isPeeking?e=>{c.deletePeerAnnotations(n.identity.id,[e]).catch(()=>{})}:void 0,p=We(()=>tt(Ue(n.state??ce,c?.pendingSubmissions??[],n.identity.id),"guest"===n.identity.relationship?n.color:void 0),[n.state,n.identity.id,n.identity.relationship,n.color,c?.pendingSubmissions]),m=c?.isHost&&"guest"===n.identity.relationship&&c.deletePeerStyles&&!c.view?.isPeeking?e=>{c.deletePeerStyles(n.identity.id,e.map(Ge)).catch(()=>{})}:void 0,[h,f]=Ze(0),g=We(()=>ar((n.state?.annotations??[]).flatMap(e=>[e.linkedSelector,e.elements?.[0]?.selector].filter(e=>!!e))),[n.state?.annotations]);Fe(()=>{if(!r||o)return;let e=new MutationObserver(e=>{e.some(g.changesIdentity)&&f(e=>e+1)});return e.observe(r.body,{childList:!0,characterData:!0,subtree:!0,attributes:!0,attributeFilter:g.attributes}),()=>e.disconnect()},[r,o,g]);let y=Oe((e,t)=>!r||o?null:Pe(e,t?.[0],r),[r,o]),x=We(()=>o?new Set(o.keys()):void 0,[o]),C=Ct({state:p,pageAnnotations:p.annotations,pageStyleModifications:p.styleModifications,pageTextModifications:p.textModifications}),v=p.annotations.find(e=>e.id===s)?.linkedSelector,w=[...p.annotations].filter(e=>!e.captured&&!C.supersededAnnotations.has(e)).sort((e,t)=>t.timestamp-e.timestamp)[0],b=Dr({resolveElement:y,projectedSelectors:x,activeText:null,activeColor:n.color,annotations:p.annotations,annotationNumberById:C.annotationGroupMap,hiddenCollidingAnnotationIds:Qr,nestedCollidingAnnotationCountById:Ur,nestedCollidingAnnotationIdsById:eo,pageAnnotations:p.annotations,pageStyleModifications:p.styleModifications,pageTextModifications:p.textModifications,sendHintAnchorId:w?.id??null,supersededAnnotations:C.supersededAnnotations,visibleCollisionRepresentativeByAnnotationId:to,activeTextSendHintId:"",targetResolutionRevision:n.revision+h});return Ye("div",{"data-devtools":"peer-rails","data-peer-id":n.identity.id,"aria-label":`${n.identity.name}'s suggestions`,children:[r&&!o&&Ke(Gr,{annotations:b.visibleCanvasAnnotations,annotationGroupMap:C.annotationGroupMap,targetDocument:r,color:n.color,onViewThread:d,onDelete:u}),Ke(Hr,{targetDocument:r,projectedTargets:o,hoveredElement:i,subjectRegistry:a?.(),readOnly:!0,onDeletePeerComment:u,onDeletePeerStyles:m,styleModifications:p.styleModifications,textModifications:p.textModifications,stagedComments:b.elementRailComments,accentColor:n.color,annotationNumberBySelector:C.pageModificationNumberBySelector,sendHintSelector:l?b.modifiedElementSendHintSelector:null,pendingBundleCount:C.stagedArtifactOrder.count,onSend:l,onViewThread:d,focusedSelector:v,refreshKey:n.revision})]})}function ro(e,t){let[n,r]=Je(e=>e+1,0),o=Date.now(),i=t?e.filter(e=>e.startedAt<=o&&o<e.expiresAt+2e3).map(e=>({presence:e,engaged:!e.ended&&o<e.expiresAt})):[],a=Math.min(...i.map(({presence:e,engaged:t})=>t?e.expiresAt:e.expiresAt+2e3));return Fe(()=>{if(!t||!Number.isFinite(a))return;let e=setTimeout(r,Math.max(0,a-Date.now()));return window.addEventListener("focus",r),document.addEventListener("visibilitychange",r),()=>{clearTimeout(e),window.removeEventListener("focus",r),document.removeEventListener("visibilitychange",r)}},[t,a,n]),i}export{At as $,Rn as A,mn as Aa,Un as B,fn as Ba,er as C,tr as D,Hr as E,Tr as F,Rr as G,jr as H,Nr as I,zr as J,Pr as K,Vr as L,Br as M,Lr as N,Wr as O,Dr as P,ft as Q,yt as R,xt as S,Ct as T,Kr as U,vt as V,wt as W,bt as X,kt as Y,It as Z,St as _,Qe as a,Et as aa,Ue as b,Ht as ba,tt as c,Tt as ca,gn as d,Rt as da,rr as e,jt as ea,ar as f,zt as fa,yn as g,Bt as ga,vn as h,no as ha,wn as i,Lt as ia,bn as j,ro as ja,lr as k,Wt as ka,sr as l,Zt as la,dr as m,Ft as ma,cr as n,Ot as na,rt as o,Dt as oa,ot as p,_t as pa,it as q,qt as qa,at as r,Yt as ra,mr as s,Kt as sa,hr as t,tn as ta,st as u,nn as ua,dt as v,rn as va,ct as w,on as wa,ut as x,an as xa,pt as y,sn as ya,Tn as z,cn as za};
@@ -1 +0,0 @@
1
- "use client";import{useRef as e,useId as t,useLayoutEffect as r}from"react";import{jsxs as n,Fragment as i,jsx as a}from"react/jsx-runtime";var l=Array.from({length:16},(e,t)=>{let r=2.75+5*t;return`M${r} 0L${r-40} 40`}).join(" "),o="M20.25 8.00293H20.249C21.5098 8.0286 22.7219 8.25094 23.8584 8.63672L23.8604 8.63574C23.8961 8.64787 23.9312 8.66145 23.9668 8.67383C24.0611 8.70686 24.1548 8.74106 24.248 8.77637C24.2915 8.79273 24.3357 8.80727 24.3789 8.82422L24.376 8.82617C27.6145 10.0955 30.1646 12.7301 31.3213 16.0234L31.3232 16.0225C31.3327 16.0493 31.3404 16.0766 31.3496 16.1035C31.7691 17.3256 32 18.6356 32 20C32 20.8726 31.9366 21.6706 31.7598 22.4902L31.7197 22.6328C31.6412 23.0066 31.5136 23.6108 31.3408 24.2217L31.3398 24.2246C31.2967 24.377 31.251 24.5299 31.2021 24.6797C30.9215 25.5403 30.5473 26.2998 30.0879 26.2998C29.7613 26.2996 29.5995 25.9674 29.4316 25.6221C29.2501 25.2487 29.0614 24.8605 28.6484 24.8604C27.8532 24.8604 27.2081 25.5046 27.208 26.2998V27.0771C27.2079 27.6079 26.9661 28.112 26.5205 28.4004C25.9146 28.7925 25.2357 28.6462 24.7959 28.2061L24.7949 28.208C24.7897 28.2028 24.7854 28.1967 24.7803 28.1914C24.7654 28.1761 24.7507 28.1606 24.7363 28.1445C24.7105 28.1156 24.6858 28.0857 24.6621 28.0547C24.6461 28.0339 24.6302 28.013 24.6152 27.9912C24.5931 27.9591 24.5726 27.9257 24.5527 27.8916C24.5392 27.8685 24.5261 27.8452 24.5137 27.8213C24.5093 27.8128 24.5043 27.8045 24.5 27.7959L24.501 27.7939C24.3932 27.5763 24.3282 27.3276 24.3281 27.0576V26.2998C24.328 25.5993 23.8278 25.0158 23.165 24.8867V24.8877C23.0752 24.8702 22.9826 24.8604 22.8877 24.8604C22.8446 24.8604 22.8019 24.8624 22.7598 24.8662C22.0247 24.9312 21.4483 25.5479 21.4482 26.2998C21.4482 26.9127 21.4608 27.5305 21.4736 28.1494L21.4951 29.3135C21.5 29.7013 21.5015 30.089 21.4971 30.4756C21.4874 31.3103 20.8426 32 20.0078 32C19.1732 31.9998 18.5292 31.3102 18.5195 30.4756C18.5159 30.1613 18.5176 29.8464 18.5205 29.5312V29.5322C18.5212 29.4593 18.5206 29.3864 18.5215 29.3135L18.5303 28.8154V28.8145C18.5343 28.5927 18.5384 28.371 18.543 28.1494C18.5558 27.5305 18.5684 28.1129 18.5684 27.5C18.5684 26.7047 17.9232 26.0596 17.1279 26.0596C16.907 26.0596 16.6978 26.1103 16.5107 26.1992C16.2161 26.3393 15.9767 26.5769 15.834 26.8701C15.8269 26.8846 15.8201 26.8993 15.8135 26.9141C15.7821 26.9845 15.7562 27.0579 15.7363 27.1338C15.7243 27.1798 15.7155 27.2267 15.708 27.2744C15.7012 27.3175 15.6953 27.361 15.6924 27.4053C15.6903 27.4366 15.6885 27.4681 15.6885 27.5V28.7383C15.6883 29.9234 14.4911 30.7248 13.4961 30.0811C13.0505 29.7926 12.8086 29.2886 12.8086 28.7578V26.2998C12.8086 25.9737 12.6984 25.674 12.5156 25.4326C12.4437 25.3381 12.3612 25.2521 12.2686 25.1777V25.1768C12.0219 24.9788 11.709 24.8604 11.3682 24.8604C10.9892 24.8604 10.8622 24.8872 10.7295 25.2295C10.5837 25.6055 10.4302 26 9.92773 26C9.33081 25.9996 8.95963 25.2403 8.71484 24.3799C8.5591 23.8325 8.45907 23.571 8.3623 23.0107C8.3501 22.9401 8.33284 22.8403 8.31738 22.7529C8.12812 21.9466 8.02043 21.1089 8.00293 20.249V20.25L8 20C8 19.8617 8.00317 19.724 8.00781 19.5869C8.00837 19.5703 8.00816 19.5537 8.00879 19.5371L8.00977 19.5352C8.0998 17.1716 8.87444 14.9844 10.1396 13.1631C10.1488 13.1499 10.1587 13.1372 10.168 13.124C12.255 10.1453 15.6582 8.15745 19.5352 8.00977L19.5371 8.00879C19.5537 8.00816 19.5703 8.00837 19.5869 8.00781C19.724 8.00317 19.8617 8 20 8L20.25 8.00293Z";function u({active:u,interactive:c=!1,hatched:h=!1,onSettlingChange:s,...m}){let d=e(null),C=e(null),p=e(null),M=t(),f=e(0),g=e(!1),y=e(null);return r(()=>{u&&(C.current?.setAttribute("fill",m.fill??"currentColor"),C.current?.setAttribute("stroke","none"))},[u,m.fill]),r(()=>{let e=d.current;if(!e)return;e.style.removeProperty("fill"),e.style.removeProperty("stroke");let t=window.matchMedia("(prefers-reduced-motion: reduce)"),r=0,n=null,i=0,a=!1,l=f.current,h=Math.ceil(l),m=!u&&h-l>1e-9,M=!1,v=0,x=null,b=e,L=b.style.cursor,A=b.style.touchAction,I=e=>{C.current?.setAttribute("d",e),p.current?.setAttribute("d",e)},P=()=>{y.current??(y.current=function(){let e=[],t=0,r=0;for(let[,n,i]of o.matchAll(/([A-Z])([^A-Z]*)/g)){let a=(i.match(/-?\d*\.?\d+/g)??[]).map(Number),l=t,o=r;if("Z"!==n)if("H"===n?t=a[0]:"V"===n?r=a[0]:(t=a[a.length-2],r=a[a.length-1]),"C"===n)for(let n=1;n<=24;n++){let i=n/24,u=1-i;e.push({x:u**3*l+3*u**2*i*a[0]+3*u*i**2*a[2]+i**3*t,y:u**3*o+3*u**2*i*a[1]+3*u*i**2*a[3]+i**3*r})}else e.push({x:t,y:r})}let n=24,i=e.findIndex(e=>e.y>=n),a=i;for(;a+1<e.length&&e[a+1].y>=n;)a++;let l=(e,t)=>({x:e.x+(t.x-e.x)*(n-e.y)/(t.y-e.y),y:n}),u=l(e[i-1],e[i]),c=l(e[a],e[a+1]),h=(u.x+c.x)/2,s=(u.x-c.x)/2,m=[u,...e.slice(i,a+1),c].map(e=>{let t=Math.asin(Math.max(-1,Math.min(1,(e.x-h)/s))),r=Math.cos(t);return{longitude:t,height:r>1e-5?(e.y-n)/r:0}}),d=[],C=[8,6.2,8.6,6.5,8],p=[0,1.4,.8,1.8,1.1,0],M=(e,t,r,n)=>{for(let i=0;i<=24;i++){let a=i/24,l=1-a;d.push({longitude:l**3*e[0]+3*l**2*a*t[0]+3*l*a**2*r[0]+a**3*n[0],height:l**3*e[1]+3*l**2*a*t[1]+3*l*a**2*r[1]+a**3*n[1]})}};for(let[e,t]of C.entries()){let r=Math.PI/2+e/C.length*Math.PI,n=r+Math.PI/C.length,i=(r+n)/2,a=.145,l=p[e],o=p[e+1];M([r,l],[i-a,l],[i-a,l+.7],[i-a,t-1.4]);for(let e=0;e<=32;e++){let r=Math.PI*(1-e/32);d.push({longitude:i+a*Math.cos(r),height:t-1.4+1.4*Math.sin(r)})}M([i+a,t-1.4],[i+a,o+.7],[i+a,o],[n,o])}let f=[...m,...d],g=e=>`L${e.x} ${e.y}`,y=`M${e[0].x} ${e[0].y}`+e.slice(1,i).map(g).join("")+g(u),v=g(c)+e.slice(a+1).map(g).join("")+"Z";return e=>{let t=Math.atan2(Math.sin(e),Math.cos(e));if(Math.abs(t)<1e-9)return o;let r=f.map(e=>({longitude:Math.atan2(Math.sin(e.longitude+t),Math.cos(e.longitude+t)),height:e.height})).filter(e=>Math.abs(e.longitude)<Math.PI/2).sort((e,t)=>t.longitude-e.longitude).map(e=>`L${h+s*Math.sin(e.longitude)} ${n+e.height*Math.cos(e.longitude)}`).join("");return y+r+v}}()),I(y.current(-f.current*Math.PI*2))},k=()=>{a=!0,f.current=0,I(o),C.current?.removeAttribute("fill"),C.current?.removeAttribute("stroke"),s?.(!1)},V=e=>{let t=null===n?0:e-n;if(n=e,M){let e=Math.min(t/1e3,.05),r=u?1/15:0,n=Math.exp(-1.8*e);f.current+=r*e+(v-r)*(1-n)/1.8,v=r+(v-r)*n,Math.abs(v-r)<.005&&(M=!1,l=f.current,h=Math.round(l),i=0)}else if(u)f.current+=t/15e3;else{i+=t;let e=Math.min(1,i/250);if(1===e)return void k();let r=1-(1-e)**3;f.current=l+(h-l)*r}P(),r=requestAnimationFrame(V)},$=()=>{cancelAnimationFrame(r),n=null,!x&&!a&&(u||!t.matches&&g.current&&!document.hidden?t.matches?(f.current=0,I(o)):g.current&&!document.hidden&&(r=requestAnimationFrame(V)):k())},j=e=>{x||!e.isPrimary||0!==e.button||(b.setPointerCapture(e.pointerId),x={id:e.pointerId,startX:e.clientX,x:e.clientX,time:e.timeStamp,moved:!1},v=0,cancelAnimationFrame(r),b.style.cursor="grabbing")},w=e=>{if(!x||x.id!==e.pointerId||!x.moved&&Math.abs(e.clientX-x.startX)<3)return;x.moved=!0;let t=-(e.clientX-x.x)/160,r=Math.max((e.timeStamp-x.time)/1e3,.001),n=24/(2*Math.PI);v+=(Math.max(-n,Math.min(n,t/r))-v)*(1-Math.exp(-r/.035)),f.current+=t,x.x=e.clientX,x.time=e.timeStamp,P()},X=e=>{!x||x.id!==e.pointerId||(x.moved&&(v*=Math.exp(-Math.max(0,e.timeStamp-x.time-40)/60),M="pointerup"===e.type&&!t.matches,a=!1,l=f.current,h=Math.round(l),i=0),x=null,b.style.cursor="grab",b.hasPointerCapture(e.pointerId)&&b.releasePointerCapture(e.pointerId),$())};if(!u&&!m&&(k(),!c))return;let E=e=>{for(let[t,r]of Object.entries({pointerdown:j,pointermove:w,pointerup:X,pointercancel:X,lostpointercapture:X}))b[e](t,r)};c&&(b.style.cursor="grab",b.style.touchAction="pan-y",E("addEventListener")),s?.(m);let S=new IntersectionObserver(([e])=>{g.current=e?.isIntersecting??!1,$()});return S.observe(e),t.addEventListener("change",$),document.addEventListener("visibilitychange",$),$(),()=>{cancelAnimationFrame(r),S.disconnect(),c&&(E("removeEventListener"),b.style.cursor=L,b.style.touchAction=A,x&&b.hasPointerCapture(x.id)&&b.releasePointerCapture(x.id)),t.removeEventListener("change",$),document.removeEventListener("visibilitychange",$)}},[u,c,s]),n("svg",{...m,ref:d,children:[h&&n(i,{children:[a("defs",{children:n("mask",{id:M,x:"0",y:"0",width:"40",height:"40",maskUnits:"userSpaceOnUse",style:{maskType:"luminance"},children:[a("rect",{width:"40",height:"40",fill:"white"}),a("path",{ref:p,d:o,fill:"black",stroke:"black",strokeWidth:"5",strokeLinejoin:"round"})]})}),a("path",{d:l,fill:"none",stroke:"currentColor",strokeWidth:"0.65",mask:`url(#${M})`})]}),a("path",{ref:C,d:o})]})}export{u as a};