@popmelt.com/core 0.41.2 → 0.42.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.
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/dist/{ExploreAttachment-GTHGWP6E.mjs → ExploreAttachment-TRA62BMX.mjs} +1 -1
- package/dist/PagePreviewLayer-TX74TJBY.mjs +1 -0
- package/dist/ParticipantRuntime-Y7MKLWBC.mjs +1 -0
- package/dist/PhoneHostGate-XRYFSUJA.mjs +1 -0
- package/dist/{PopmeltProvider-5g-1VH5a.d.mts → PopmeltProvider-NwqjKtGG.d.mts} +1 -1
- package/dist/PopmeltTasteConnectedPane-NMKIRMDM.mjs +1 -0
- package/dist/{PreviewRuntime-7EQNIOF5.mjs → PreviewRuntime-VJXFECBF.mjs} +1 -1
- package/dist/{QueuedReplies-U7GLT6QK.mjs → QueuedReplies-X2N4JRS6.mjs} +1 -1
- package/dist/SamplePlacementOverlay-VWCULP2R.mjs +1 -0
- package/dist/ShareProjectPane-L6AO57IN.mjs +1 -0
- package/dist/SuppliedContext-UGQSL4IG.mjs +1 -0
- package/dist/{ThreadErrorCard-L7F7VX6H.mjs → ThreadErrorCard-WSNEGY7J.mjs} +1 -1
- package/dist/ThreadPanel-QNDCQOA4.mjs +1 -0
- package/dist/adapter-react-three-fiber.d.mts +1 -1
- package/dist/adapter-three.d.mts +1 -1
- package/dist/bridge-entry.mjs +1 -1
- package/dist/{bridgeSSEStream-AUMOLOCC.mjs → bridgeSSEStream-BHUFYHTT.mjs} +1 -1
- package/dist/{bridgeWebSocketStream-PE5XBFAM.mjs → bridgeWebSocketStream-L277I5ZX.mjs} +1 -1
- package/dist/browser-runtime-3PAM2ZUE.mjs +1 -0
- package/dist/browser.d.mts +4 -4
- package/dist/browser.mjs +1 -1
- package/dist/canvas-chat-note-HTK23RYE.mjs +1 -0
- package/dist/canvas-text.d.mts +1 -1
- package/dist/{checkFixture-ZD5UD7OR.mjs → checkFixture-C26VSTGP.mjs} +1 -1
- package/dist/chunk-23YWKAQM.mjs +1 -0
- package/dist/chunk-2OWGUAUI.mjs +1 -0
- package/dist/{chunk-YTIDSDPP.mjs → chunk-2PARHFWP.mjs} +1 -1
- package/dist/chunk-2YT4X5VC.mjs +1 -0
- package/dist/{chunk-KYOD2RVN.mjs → chunk-47SWWW5Y.mjs} +1 -1
- package/dist/chunk-56AALMHI.mjs +1 -0
- package/dist/chunk-5JAZXI47.mjs +1 -0
- package/dist/chunk-5SXPTNUM.mjs +1 -0
- package/dist/chunk-5YNIYMKX.mjs +1 -0
- package/dist/{chunk-VTOLKIBD.mjs → chunk-7PZN2RNE.mjs} +1 -1
- package/dist/chunk-ALW6WNDJ.mjs +1 -0
- package/dist/{chunk-ADRWR5GI.mjs → chunk-BH5BNULT.mjs} +1 -1
- package/dist/chunk-BZPWT44Z.mjs +1 -0
- package/dist/chunk-DAMF6ZWZ.mjs +1 -0
- package/dist/chunk-E7VH7WB5.mjs +1 -0
- package/dist/chunk-EBESPLST.mjs +1 -0
- package/dist/{chunk-SHYAV76M.mjs → chunk-ECGXE2Z6.mjs} +1 -1
- package/dist/chunk-EEU5J3CD.mjs +1 -0
- package/dist/chunk-FGJX74DI.mjs +1 -0
- package/dist/chunk-I3LFTKJP.mjs +1 -0
- package/dist/chunk-K4CIGHJI.mjs +1 -0
- package/dist/chunk-KYS76O3N.mjs +1 -0
- package/dist/chunk-LB66O2BP.mjs +1 -0
- package/dist/chunk-LEMLTB2X.mjs +1 -0
- package/dist/chunk-M2BCEQDP.mjs +1 -0
- package/dist/{chunk-44NLL6X3.mjs → chunk-MYEG7OXO.mjs} +1 -1
- package/dist/chunk-NMMTIZ6K.mjs +1 -0
- package/dist/chunk-NWQGXYER.mjs +1 -0
- package/dist/{chunk-BWBGZZG7.mjs → chunk-OBYCW4I3.mjs} +1 -1
- package/dist/chunk-ODZOYCTC.mjs +1 -0
- package/dist/{chunk-EKRMVMQ4.mjs → chunk-OOFTFGZL.mjs} +1 -1
- package/dist/chunk-OSUJWNS2.mjs +1 -0
- package/dist/chunk-PACB6IBR.mjs +1 -0
- package/dist/{chunk-3IS5RGG6.mjs → chunk-PGIWJ37M.mjs} +1 -1
- package/dist/{chunk-P5ESNJTD.mjs → chunk-PLRJ4GAR.mjs} +1 -1
- package/dist/{chunk-KF35YUNZ.mjs → chunk-QF5B6AYF.mjs} +1 -1
- package/dist/chunk-QKJPWA2I.mjs +1 -0
- package/dist/{chunk-4O6YFMWF.mjs → chunk-RBX7ANQX.mjs} +1 -1
- package/dist/chunk-RQHZNEA2.mjs +1 -0
- package/dist/{chunk-B5NNYNRA.mjs → chunk-SDXFJ7JW.mjs} +1 -1
- package/dist/{chunk-EHM2ZBQU.mjs → chunk-SKQA53J2.mjs} +1 -1
- package/dist/chunk-TJ25JLBL.mjs +1 -0
- package/dist/chunk-U522GPBG.mjs +1 -0
- package/dist/{chunk-5J4BZL6N.mjs → chunk-V5K4F2XQ.mjs} +1 -1
- package/dist/chunk-VGX6J2OP.mjs +1 -0
- package/dist/{chunk-EO3SHOXX.mjs → chunk-VPF4NHAP.mjs} +1 -1
- package/dist/{chunk-2EQSGPAN.mjs → chunk-WNCZCPTX.mjs} +1 -1
- package/dist/chunk-XMCHOGMG.mjs +1 -0
- package/dist/chunk-XNCN6DGG.mjs +30 -0
- package/dist/{chunk-2B62TYAL.mjs → chunk-XRM2KI4C.mjs} +1 -1
- package/dist/{chunk-YU5PF45T.mjs → chunk-YFXYRNER.mjs} +1 -1
- package/dist/{chunk-63F7KX4E.mjs → chunk-YZIDCW7A.mjs} +1 -1
- package/dist/chunk-Z32CLWW2.mjs +1 -0
- package/dist/{chunk-KCDHP4N3.mjs → chunk-ZCJCM3DT.mjs} +1 -1
- package/dist/{chunk-WIJSWSNF.mjs → chunk-ZE3LG7MR.mjs} +1 -1
- package/dist/chunk-ZEIVO4X7.mjs +1 -0
- package/dist/{chunk-44KCB7YO.mjs → chunk-ZQLNGMVV.mjs} +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/codex-note-context-327LH622.mjs +1 -0
- package/dist/codex-project-25QJDNJN.mjs +1 -0
- package/dist/{codex-store-mount-FPS3CDO4.mjs → codex-store-mount-BRHVGYZU.mjs} +1 -1
- package/dist/{dev-server-D8Qxrp1A.d.mts → dev-server-C-mvGeOM.d.mts} +2 -2
- package/dist/dev-server-ZLIPCFFT.mjs +1 -0
- package/dist/{focus-inspection-FVQ6TVGA.mjs → focus-inspection-TPTEFBH3.mjs} +1 -1
- package/dist/guest-admission.mjs +1 -1
- package/dist/guest-live-canvas.mjs +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +1 -1
- package/dist/{invitationLink-LUIIOAEZ.mjs → invitationLink-RX53O6RI.mjs} +1 -1
- package/dist/media.d.mts +3 -3
- package/dist/memory-store.d.mts +6 -6
- package/dist/{page-interaction-ZXM6ZLL4.mjs → page-interaction-6SR32FFS.mjs} +1 -1
- package/dist/{page-planes-BeFZ3Wso.d.mts → page-planes-C5J6qgMj.d.mts} +99 -50
- package/dist/{participantBootstrap-BcfNTEe9.d.mts → participantBootstrap-BjHfrdwL.d.mts} +3 -2
- package/dist/peer-client-2LEZ7SW4.mjs +1 -0
- package/dist/phone-recovery.mjs +1 -0
- package/dist/plugin-astro.d.mts +7 -7
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-next.mjs +1 -1
- package/dist/plugin-nuxt.d.mts +5 -5
- package/dist/plugin-nuxt.mjs +1 -1
- package/dist/plugin-vite.d.mts +8 -7
- package/dist/plugin-vite.mjs +1 -1
- package/dist/project-id.mjs +1 -0
- package/dist/{protocol-BIUE4rB6.d.mts → protocol-aJ3S127Q.d.mts} +5 -1
- package/dist/server.d.mts +15 -7
- package/dist/server.mjs +1 -1
- package/dist/shared-page-KQSG3DM3.mjs +1 -0
- package/dist/{subjects-qHIrZrlt.d.mts → subjects-CGN4QTSS.d.mts} +1 -1
- package/dist/{video-adapter-B5eap10v.d.mts → video-adapter-DtIw_QVy.d.mts} +1 -1
- package/dist/{workspace-snapshot-RUGPDEYJ.mjs → workspace-snapshot-DX62ZFVF.mjs} +1 -1
- package/infra/phone-pairing/machine-config.mjs +15 -2
- package/infra/phone-pairing/machine-service.mjs +39 -13
- package/infra/phone-pairing/managed-install.mjs +8 -2
- package/package.json +1 -1
- package/dist/PagePreviewLayer-FHYXOFOZ.mjs +0 -1
- package/dist/ParticipantRuntime-NY7N7HFZ.mjs +0 -1
- package/dist/PhoneHostGate-RXW6DVQD.mjs +0 -1
- package/dist/PopmeltTasteConnectedPane-6T3F6ZNL.mjs +0 -1
- package/dist/SamplePlacementOverlay-K3Z5C67A.mjs +0 -1
- package/dist/ShareProjectPane-AFQS4SEM.mjs +0 -1
- package/dist/SuppliedContext-V62BO3EY.mjs +0 -1
- package/dist/ThreadPanel-ZXEPKB2P.mjs +0 -1
- package/dist/browser-runtime-FFURXKEP.mjs +0 -1
- package/dist/canvas-chat-note-RGALD6IH.mjs +0 -1
- package/dist/chunk-2F2BVGFH.mjs +0 -1
- package/dist/chunk-2IPPW6IP.mjs +0 -1
- package/dist/chunk-4XBW5E6L.mjs +0 -1
- package/dist/chunk-5GQXAV54.mjs +0 -30
- package/dist/chunk-6VZCE37E.mjs +0 -1
- package/dist/chunk-72CUIZA2.mjs +0 -1
- package/dist/chunk-7NXVLIDS.mjs +0 -1
- package/dist/chunk-7XGXFP5L.mjs +0 -1
- package/dist/chunk-BDSIJTX5.mjs +0 -1
- package/dist/chunk-C2ZSNUXQ.mjs +0 -1
- package/dist/chunk-DLXTHDBS.mjs +0 -1
- package/dist/chunk-EILBHZDX.mjs +0 -1
- package/dist/chunk-FLHUSWSY.mjs +0 -1
- package/dist/chunk-FQRYGTZ3.mjs +0 -1
- package/dist/chunk-HAZXZ5TU.mjs +0 -1
- package/dist/chunk-JXXK3Z5E.mjs +0 -1
- package/dist/chunk-KNMBEVHX.mjs +0 -1
- package/dist/chunk-MBEFYXSZ.mjs +0 -1
- package/dist/chunk-OTMGCIRL.mjs +0 -1
- package/dist/chunk-PRZ6C5X3.mjs +0 -1
- package/dist/chunk-QRFIQC2P.mjs +0 -1
- package/dist/chunk-RWZ7SVMO.mjs +0 -1
- package/dist/chunk-SOGN7S54.mjs +0 -1
- package/dist/chunk-SUAHDXJZ.mjs +0 -1
- package/dist/chunk-TMW3SI7F.mjs +0 -1
- package/dist/chunk-TNVYP6S4.mjs +0 -1
- package/dist/chunk-UFU5IA3G.mjs +0 -1
- package/dist/chunk-UNUYNWTJ.mjs +0 -1
- package/dist/chunk-VLTK7KWK.mjs +0 -1
- package/dist/chunk-WMCWSV2W.mjs +0 -1
- package/dist/chunk-WVGFWHL3.mjs +0 -1
- package/dist/chunk-YIKAZQRM.mjs +0 -1
- package/dist/codex-note-context-ECY4QU74.mjs +0 -1
- package/dist/codex-project-J7C4YAM2.mjs +0 -1
- package/dist/dev-server-5CHO7PTQ.mjs +0 -1
- package/dist/peer-client-4WNS5XZ4.mjs +0 -1
- package/dist/shared-page-3AVCYUOT.mjs +0 -1
- /package/dist/{chunk-CIKFUS7J.mjs → chunk-R565ZNSP.mjs} +0 -0
- /package/dist/{chunk-RG2CK6VE.mjs → chunk-XBA5ROC5.mjs} +0 -0
- /package/dist/{toolbarFonts-33BI56VQ.mjs → toolbarFonts-RR24L4CJ.mjs} +0 -0
- /package/dist/{webpEncoder-JVMGDKHV.mjs → webpEncoder-XTISHUBA.mjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as e}from"./chunk-DUWONLQE.mjs";import{c as t,b as n}from"./chunk-ATLUO4G7.mjs";import{j as o,a as i,d as a}from"./chunk-6VZCE37E.mjs";import{e as r,d as s}from"./chunk-C2ZSNUXQ.mjs";import{o as l,l as d}from"./chunk-EILBHZDX.mjs";import{k as p,j as c,h as m,c as u,a as h}from"./chunk-EKRMVMQ4.mjs";import{a as f}from"./chunk-ZVDKW7TO.mjs";import{a as g}from"./chunk-HQVWOBYH.mjs";import{a as y,b as v,c as b}from"./chunk-Q6C7ZA3H.mjs";import{a as x}from"./chunk-OREALBUO.mjs";import{c as w}from"./chunk-CK3CDA3L.mjs";import{a as Q,b as k}from"./chunk-SHYAV76M.mjs";import{ea as C,S,za as j,wa as z,Qa as E,G as L,fa as $,da as P,Ja as I,F as M,R as W}from"./chunk-KE4MQBRY.mjs";import{a as H}from"./chunk-ADRWR5GI.mjs";import{jsxs as D,jsx as T,Fragment as A}from"react/jsx-runtime";import{useRef as V,useState as R,useLayoutEffect as B,Children as F,useEffect as Z}from"react";var O="0.41.2";function q({descriptionId:e}){return T("svg",{"data-popmelt-wordmark":!0,role:"img","aria-label":"Popmelt",tabIndex:0,focusable:"true","aria-describedby":e,width:"61",height:"20.8",viewBox:"0 0 57.315 19.5",fill:"currentColor",style:{display:"block",flexShrink:0},children:T("path",{d:"M1.427 14.625V4.553H4.813Q6.199 4.553 7.215 4.969Q8.231 5.385 8.786 6.187Q9.341 6.989 9.341 8.167Q9.341 9.374 8.79 10.191Q8.238 11.008 7.245 11.424Q6.251 11.84 4.902 11.84H2.838L3.069 10.122H4.857Q5.639 10.122 6.214 9.915Q6.789 9.708 7.109 9.272Q7.429 8.836 7.429 8.167Q7.429 7.52 7.113 7.102Q6.797 6.685 6.222 6.478Q5.647 6.271 4.857 6.271H3.287Q3.287 14.618 1.427 14.625ZM9.421 10.913Q9.421 9.841 9.95 8.963Q10.478 8.086 11.378 7.561Q12.278 7.036 13.395 7.036Q14.527 7.036 15.423 7.561Q16.319 8.086 16.84 8.967Q17.361 9.848 17.361 10.913Q17.361 11.985 16.84 12.87Q16.319 13.755 15.419 14.284Q14.519 14.812 13.957 14.812Q13.395 14.812 12.832 14.812Q12.27 14.812 11.374 14.284Q10.478 13.755 9.95 12.87Q9.421 11.985 9.421 10.913ZM13.395 13.109Q14.019 13.109 14.504 12.812Q14.989 12.515 15.271 12.019Q15.553 11.522 15.553 10.928Q15.553 10.326 15.271 9.83Q14.989 9.334 14.504 9.036Q14.019 8.739 13.395 8.739Q12.778 8.739 12.289 9.036Q11.8 9.334 11.514 9.83Q11.229 10.326 11.229 10.928Q11.229 11.522 11.514 12.019Q11.8 12.515 12.289 12.812Q12.778 13.109 13.395 13.109ZM17.957 18.022V10.913Q17.957 9.803 18.478 8.93Q18.999 8.056 19.899 7.55Q20.799 7.044 21.931 7.044Q23.063 7.044 23.959 7.569Q24.855 8.093 25.376 8.971Q25.897 9.848 25.897 10.913Q25.897 12.045 25.402 12.93Q24.907 13.815 24.033 14.317Q23.16 14.82 22.02 14.82Q21.179 14.82 20.459 14.425Q19.738 14.031 19.303 13.392Q18.867 12.754 18.867 12.01L19.764 12.29Q19.764 18.022 17.957 18.022ZM21.931 13.117Q22.555 13.117 23.04 12.82Q23.525 12.522 23.807 12.022Q24.089 11.522 24.089 10.928Q24.089 10.326 23.807 9.834Q23.525 9.341 23.04 9.044Q22.555 8.747 21.931 8.747Q21.314 8.747 20.825 9.044Q20.336 9.341 20.05 9.834Q19.764 10.326 19.764 10.928Q19.764 11.522 20.05 12.022Q20.336 12.522 20.825 12.82Q21.314 13.117 21.931 13.117ZM39.274 10.748V14.625H37.467V11.046Q37.467 10.423 37.271 9.9Q37.075 9.378 36.666 9.062Q36.256 8.747 35.617 8.747Q34.994 8.747 34.591 9.055Q34.189 9.363 33.99 9.878Q33.791 10.392 33.791 11.016V14.625H31.983V11.024Q31.983 10.392 31.787 9.878Q31.592 9.363 31.178 9.055Q30.765 8.747 30.134 8.747Q29.495 8.747 29.093 9.062Q28.691 9.378 28.499 9.897Q28.307 10.415 28.307 11.039V14.625H26.499V10.755Q26.499 9.721 26.897 8.869Q27.294 8.018 28.073 7.509Q28.853 6.999 29.999 6.999Q30.944 6.999 31.634 7.355Q32.323 7.712 32.706 8.338Q33.088 8.964 33.104 9.789H32.7Q32.723 8.964 33.116 8.338Q33.51 7.712 34.188 7.355Q34.867 6.999 35.305 6.999Q35.744 6.999 36.325 6.999Q36.905 6.999 37.689 7.509Q38.472 8.018 38.873 8.866Q39.274 9.713 39.274 10.748ZM39.878 10.876Q39.878 9.811 40.354 8.93Q40.831 8.049 41.685 7.524Q42.54 6.999 43.664 6.999Q44.811 6.999 45.628 7.501Q46.445 8.003 46.884 8.847Q47.323 9.69 47.323 10.71V11.325H41.297L41.604 10.762Q41.566 11.468 41.841 12.025Q42.115 12.581 42.63 12.901Q43.145 13.221 43.837 13.221Q44.483 13.221 45.009 12.932Q45.534 12.643 45.828 12.079L47.217 12.789Q46.73 13.763 45.856 14.284Q44.983 14.805 44.417 14.805Q43.852 14.805 43.286 14.805Q42.72 14.805 41.816 14.302Q40.913 13.8 40.396 12.915Q39.878 12.03 39.878 10.876ZM41.701 10.255H45.523Q45.485 9.765 45.237 9.389Q44.989 9.012 44.583 8.801Q44.176 8.59 43.649 8.59Q43.115 8.59 42.701 8.813Q42.287 9.035 42.035 9.411Q41.783 9.788 41.701 10.255ZM50.147 3.841V14.625H48.339Q48.339 3.841 50.147 3.841ZM52.051 11.838V5.333H53.859V11.779Q53.859 12.455 54.231 12.827Q54.602 13.199 55.226 13.199Q55.564 13.199 55.935 13.093Q56.306 12.988 56.576 12.8V14.437Q56.291 14.617 55.875 14.722Q55.459 14.827 55.26 14.827Q55.061 14.827 54.567 14.827Q54.073 14.827 53.403 14.449Q52.733 14.071 52.392 13.393Q52.051 12.715 52.051 11.838ZM56.576 8.778H50.64V7.238H56.576V8.778Z"})})}function X(e,t){return{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px 2px 4px",border:0,borderRadius:6,backgroundColor:t?e.hoverSurface:"transparent",color:t?e.hoverForeground:e.muted,font:"inherit",fontWeight:500,cursor:"pointer"}}function N({theme:t,themePreference:n,onShare:o,onHistory:i,history:a,version:r=O,onSettings:s,active:l,workspace:d,connection:c,connectionDetails:m,style:u}){let h=Q[t];return D("div",{role:"region","aria-label":"About Popmelt","data-popmelt-guidance":"popmelt","data-popmelt-tooltip-boundary":!0,"data-popmelt-font":"sans","data-popmelt-theme":t,"data-popmelt-theme-preference":n,style:{position:"relative",display:"flex",width:"100%",flexDirection:"column",alignItems:"flex-start",gap:12,overflowY:a?"auto":"visible",overscrollBehavior:"contain",boxSizing:"border-box",padding:16,border:`1px solid ${h.border}`,borderRadius:20,backgroundColor:h.surface,backdropFilter:"blur(59.5px)",WebkitBackdropFilter:"blur(59.5px)",zIndex:10001,color:h.primary,fontFamily:H,fontSize:14,lineHeight:1.3,letterSpacing:"-0.14px","--popmelt-thread-action":h.actionSurface,"--popmelt-thread-on-action":h.actionForeground,...u},children:[D("header",{style:{display:"flex",alignItems:"center",width:"100%",flexWrap:"wrap",gap:8},children:[D("div",{style:{display:"flex",alignItems:"center",gap:8},children:[T(e,{interactive:!0,active:l,"aria-hidden":"true",width:24,height:24,viewBox:"7 7 26 26",fill:h.primary,style:{display:"block",flexShrink:0}}),D("div",{style:{display:"flex",alignItems:"center",gap:4},children:[T(w,{hint:`Version ${r}`,above:!0,children:e=>T(q,{descriptionId:e})}),D("span",{"aria-label":"Command Command",style:{display:"inline-flex",alignItems:"center",gap:2,padding:"1px 3px",borderRadius:6,backgroundColor:h.control,color:h.mutedStrong,fontSize:12,lineHeight:1.3,letterSpacing:"-0.12px"},children:[T("span",{children:"⌘"}),T("span",{children:"⌘"})]})]})]}),D("div",{style:{marginInlineStart:"auto",flexShrink:0,display:"flex",gap:4},children:[o&&D(p,{theme:t,"aria-label":"Pair and Share",onClick:o,children:[T(C,{size:14,"aria-hidden":"true"})," Pair"]}),[["Thread History","Open history",S,i],["Settings","Open settings",j,s]].map(([e,n,o,i])=>i&&T(p,{theme:t,variant:"ghost","aria-label":n,hint:e,above:!0,onClick:i,icon:o,style:{color:h.muted}},n))]})]}),d,c&&T("div",{style:{display:"flex",width:"100%",alignItems:"flex-start",gap:8,fontSize:12},children:c}),m,a]})}var Y={toolbar:10,send:18,approval:[18,60,18],reply:14};function K(e){if(f()&&"visible"===document.visibilityState&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches&&navigator.vibrate&&!1!==navigator.userActivation?.hasBeenActive)try{navigator.vibrate(Y[e])}catch{}}var U="bottom-left",G=16,J=40,_=8,ee="popmelt-toolbar-snap-position";function te(e){return e.startsWith("top-")}function ne(e){return e.endsWith("-right")}function oe(e){return e.endsWith("-center")}function ie(){try{let e=localStorage.getItem(ee);if(e&&function(e){return["bottom-right","bottom-center","bottom-left","top-right","top-center","top-left"].includes(e)}(e))return e}catch{}return U}function ae(e){try{localStorage.setItem(ee,e)}catch{}}function re(e){let t=te(e)?"top":"bottom",n=ne(e)?"right":"left",o="var(--popmelt-toolbar-edge, 16px)";return{position:"fixed",[t]:`max(${o}, env(safe-area-inset-${t}))`,...oe(e)?{left:"50%",transform:"translateX(-50%)"}:{[n]:`max(${o}, env(safe-area-inset-${n}))`}}}function se(e,t,n,o=12){let i,a=te(e),r=y(t),s=v(t),l=a?{top:r?`calc(max(${s}px, env(safe-area-inset-top)) + ${J+o}px)`:s+J+o}:{bottom:r?`calc(max(${s}px, env(safe-area-inset-bottom)) + ${J+o}px)`:s+J+o};return i=oe(e)?{left:"50%",transform:"translateX(-50%)"}:ne(e)?{right:r?`max(${s}px, env(safe-area-inset-right))`:s}:{left:r?`max(${s}px, env(safe-area-inset-left))`:s},{position:"fixed",...l,...i}}function le(e,t,n){let o,i,a=te(e),r=y(t),s=v(t),l=a?{top:r?`calc(max(${s}px, env(safe-area-inset-top)) + 48px)`:s+J+8}:{bottom:r?`calc(max(${s}px, env(safe-area-inset-bottom)) + 48px)`:s+J+8};return oe(e)?(o={left:"50%",transform:"translateX(-50%)"},i="center"):ne(e)?(o={right:r?`max(${s}px, env(safe-area-inset-right))`:s},i="flex-end"):(o={left:r?`max(${s}px, env(safe-area-inset-left))`:s},i="flex-start"),{position:"fixed",...l,...o,zIndex:9999,display:"flex",flexDirection:"column",alignItems:i}}function de(e,t=(typeof window<"u"?window.innerWidth:1920)){let n=te(e),o=ne(e)||oe(e),i=y(t),a=v(t),r=n&&o?a+J+8:a,s=!n&&o?a+J+8:a;return{position:"fixed",top:i?`max(${r}px, env(safe-area-inset-top))`:r,right:i?`max(${a}px, env(safe-area-inset-right))`:a,bottom:i?`max(${s}px, env(safe-area-inset-bottom))`:s,width:b(t)}}function pe(e,t,n){let o,i,a=b(t),r=v(t),s=te(e);return ne(e)||oe(e)?(o=t-r,i=o-a):(i=r,o=i+a),{left:i,right:o,y:s?r+J+8:n-r-J-8}}var ce=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"];function me({position:e}){let t=e.endsWith("-left"),n=e.endsWith("-center"),o=e.startsWith("top-")?4:10;return T("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:D("g",{transform:t?"translate(14 0) scale(-1 1)":void 0,children:[T("rect",{x:"1.5",y:"1.5",width:"11",height:"11",rx:"2.5",stroke:"currentColor",strokeWidth:"1"}),T("circle",{cx:n?7:10,cy:o,r:"1.5",fill:"currentColor"})]})})}function ue(e){return e.charAt(0).toUpperCase()+e.slice(1)}var he={display:"flex",flexDirection:"column",gap:3},fe={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:28,width:"100%"},ge={display:"inline-flex",alignItems:"center",gap:4,padding:"4px 10px",border:0,borderRadius:8,font:"inherit",fontSize:14,fontWeight:500,lineHeight:1.3,minWidth:0};function ye(e){return{...ge,background:"transparent",color:e}}function ve(e){if(!(e instanceof HTMLElement)||e.hidden||e.hasAttribute("data-settings-search-ignore")||"none"===e.style.display||"STYLE"===e.tagName)return"";let t=[e.dataset.settingsKeywords,"status"===e.getAttribute("role")?e.getAttribute("aria-label"):""];for(let n of Array.from(e.childNodes))n instanceof Element?t.push(ve(n)):n.nodeType===Node.TEXT_NODE&&t.push(n.textContent);return t.join(" ")}function be(e){return e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function xe({theme:e,appearance:t,onClose:n,style:o,children:i}){let a=Q[e],{snapPosition:r,onSnapPositionChange:s,themePreference:l,onThemePreferenceChange:d}=t,c=V(null),m=V(null),u=V(null),h=V(null),[f,g]=R(null),[y,v]=R(""),[b,x]=R(!1),w=null!==f,C=V(!1);function S(){C.current=!0,v(""),g(null)}B(()=>{w?u.current?.focus():C.current&&h.current?.focus(),C.current=!1},[w]),B(()=>{let e=m.current;if(!e)return;e.scrollTop=0;let t=be(y);if(!t)return e.querySelectorAll("[data-settings-filtered]").forEach(e=>e.removeAttribute("data-settings-filtered")),void x(!1);let n=t.split(" "),o=()=>{let t=!1;for(let o of e.querySelectorAll("[data-settings-group]")){let e=!1;for(let t of o.querySelectorAll("[data-settings-row]")){let i=be((o.dataset.settingsGroup??"")+" "+ve(t)),a=n.every(e=>i.includes(e));t.toggleAttribute("data-settings-filtered",!a),a&&(e=!0)}o.toggleAttribute("data-settings-filtered",!e),e&&(t=!0)}x(!t)};o();let i=new MutationObserver(o);return i.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["data-settings-keywords","data-settings-group","aria-label","style","hidden"]}),()=>i.disconnect()},[y]);let M="bottom-right"===r?"bottom-left":"bottom-right",W=k(l);return D("div",{ref:c,role:"region","aria-label":"Popmelt Settings",onKeyDown:e=>{!w||e.nativeEvent.isComposing||e.defaultPrevented||("Escape"===e.key?(e.preventDefault(),e.stopPropagation(),S()):e.target===u.current&&e.stopPropagation())},"data-popmelt-settings":!0,"data-popmelt-font":"sans","data-popmelt-theme":e,style:{position:"relative",width:"100%",boxSizing:"border-box",padding:"20px 16px 16px",display:"flex",flexDirection:"column",overflow:"hidden",maxHeight:"calc(100dvh - 64px)",overscrollBehavior:"contain",gap:12,border:`1px solid ${a.border}`,borderRadius:20,background:a.surface,color:a.secondary,backdropFilter:"blur(59.5px)",fontFamily:H,fontSize:14,lineHeight:1.3,letterSpacing:"-0.14px",...o,height:f??o?.height},children:[T("style",{children:`\n [data-popmelt-settings] [data-settings-filtered] { display: none !important; }\n [data-popmelt-settings] input[type=search]::-webkit-search-cancel-button { display: none; }\n [data-popmelt-settings] button:not([data-model-picker] button):not([data-provider-action], [data-popmelt-pane-back], [data-settings-search-control]):not(:disabled):hover { background-color: ${a.hoverSurface} !important; }\n [data-popmelt-settings] button:not([data-model-picker] button):disabled { cursor: default; opacity: .6; }\n [data-popmelt-settings][data-popmelt-theme="${e}"] [data-settings-search-control] { color: ${a.secondary}; }\n [data-popmelt-settings][data-popmelt-theme="${e}"] [data-settings-search-control]:is(:hover, :focus-visible) { color: ${a.actionHover}; }\n `}),T("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:24,flexShrink:0},children:D(A,w?{children:[T(z,{size:16,"aria-hidden":"true"}),T("input",{ref:u,"aria-label":"Search settings",type:"search",placeholder:"Search settings",value:y,onChange:e=>v(e.target.value),style:{flex:1,minWidth:0,padding:0,border:0,outline:"none",background:"transparent",color:a.primary,font:"inherit",fontSize:12}}),T(p,{theme:e,variant:"ghost",icon:E,"aria-label":"Close search",onClick:S,"data-settings-search-control":!0})]}:{children:[D(p,{variant:"custom","data-popmelt-pane-back":!0,"aria-label":"Back to Popmelt",onClick:n,style:{border:0,padding:0,background:"transparent",font:"inherit",cursor:"pointer",display:"flex",gap:4,alignItems:"center",color:a.primary,fontWeight:600},children:[T(L,{size:16}),T(j,{size:16}),"Settings"]}),T(p,{ref:h,theme:e,variant:"ghost",icon:z,"aria-label":"Search settings","data-settings-search-control":!0,onClick:()=>{c.current&&g(c.current.getBoundingClientRect().height)}})]})}),D("div",{ref:m,style:{minHeight:0,overflowX:"hidden",overflowY:"auto",overscrollBehavior:"contain",display:"flex",flexDirection:"column",gap:12},children:[D("section",{"data-settings-group":"Appearance",style:he,"aria-label":"Appearance settings",children:[T("span",{style:{color:a.hoverForeground,fontSize:12,fontWeight:500,marginBottom:1},children:"Appearance"}),D("div",{"data-settings-row":!0,style:fe,children:[T("span",{children:"Toolbar position"}),D(p,{theme:e,size:"regular",variant:"ghost",disabled:!s,"aria-label":`Toolbar position: ${ue(r)}. Move to ${M}.`,onClick:()=>s?.(M),children:[T(me,{position:r}),ue(r)]})]}),D("div",{"data-settings-row":!0,style:fe,children:[T("span",{children:"Theme"}),D(p,{theme:e,size:"regular",variant:"ghost",disabled:!d,"aria-label":`Theme mode: ${l}. Click to switch to ${W}`,"data-popmelt-theme-control":l,onClick:()=>d?.(W),children:[T("dark"===l?$:"auto"===l?P:I,{size:14,strokeWidth:1.5}),T("span",{children:"auto"===l?"Auto":"dark"===l?"Dark":"Light"})]})]})]}),i,b&&T("span",{role:"status",style:{fontSize:12},children:"No matching settings."})]})]})}function we({theme:e,expanded:t,width:n,snapPosition:o,toolbarRef:i,children:a,style:r,...s}){let l=Q[e],d=o.endsWith("-left"),p=F.toArray(a);return D("div",{...s,ref:i,id:"devtools-toolbar",role:"toolbar","data-popmelt-theme":e,style:{...re(o),zIndex:9999,display:"flex",alignItems:"center",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",cursor:"pointer",overflow:"visible",backgroundColor:l.surface,color:l.primary,colorScheme:e,boxSizing:"border-box",border:0,boxShadow:`inset 0 0 0 1px ${l.border}`,borderRadius:20,padding:t?d?"4px 4px 4px 8px":"4px 8px 4px 4px":0,width:t?n:40,height:40,gap:t?6:0,justifyContent:t?"flex-start":"center",...r},children:[T("style",{children:"@media (max-width: 480px) {\n #devtools-toolbar { --popmelt-toolbar-edge: 8px; }\n }"}),d?p.reverse():p]})}function Qe({theme:e,...t}){return D("button",{type:"button","data-popmelt-connect-agent":!0,...t,style:{...c(e),gap:5},children:[D("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:2},children:[T(r,{size:12}),T(s,{size:12}),T("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:T("path",{fillRule:"evenodd",d:"M12 .25 22.25 6.2v11.6L12 23.75 1.75 17.8V6.2L12 .25ZM2.8 6.55 12 12v10.9l9.3-16.35H2.8Z"})})]}),"Connect your agent"]})}function ke({expanded:t,active:n=!1,connected:o,color:i,onSettlingChange:a,onLongPress:r,onClick:s,...l}){let d=V(void 0),p=V(null),c=V(!1),m=()=>{clearTimeout(d.current),p.current=null};Z(()=>m,[t]);let u=t||n||void 0!==o;return T("button",{type:"button","aria-description":!1===o?"Disconnected":void 0,"aria-label":t?"Collapse Popmelt":"Open Popmelt","aria-expanded":t,...l,onPointerDown:e=>{c.current=!1,r&&e.isPrimary&&"touch"===e.pointerType&&(m(),p.current={x:e.clientX,y:e.clientY},d.current=setTimeout(()=>{c.current=!0,K("toolbar"),r()},480))},onPointerMove:e=>{p.current&&Math.hypot(e.clientX-p.current.x,e.clientY-p.current.y)>10&&m()},onPointerCancel:m,onPointerUp:m,onPointerLeave:m,onContextMenu:e=>{(p.current||c.current)&&e.preventDefault()},onClick:e=>{if(c.current&&0!==e.detail)return c.current=!1,e.preventDefault(),void e.stopPropagation();K("toolbar"),s?.(e)},style:{display:"flex",alignItems:"center",justifyContent:"center",WebkitTouchCallout:"none",userSelect:"none",touchAction:"manipulation",width:t?24:40,height:t?32:40,flexShrink:0,border:"none",background:"none",padding:0,cursor:"pointer"},children:T(e,{"data-popmelt-logo":!0,active:n&&!1!==o,tracing:!1===o,onSettlingChange:a,width:"24",height:"24",viewBox:"0 0 40 40",fill:u?i:"none",stroke:u?"none":i,color:i,strokeWidth:"1",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg"})})}function Ce({theme:e,active:t,busy:n,connected:o,color:i,onSettlingChange:a,onOpen:r,onCrosshairHover:s,...l}){return D(we,{...l,theme:e,expanded:!1,width:40,"data-popmelt-hover-fill":!n&&void 0===o||void 0,children:[T("style",{children:"\n [data-popmelt-hover-fill]:is(:hover, :focus-within) [data-popmelt-logo] { fill: currentColor; stroke: none; }\n "}),T(w,{hint:"Open (⌘⌘)",above:l.snapPosition.startsWith("bottom-"),surfaceStyle:{background:Q[e].actionSurface,color:Q[e].actionForeground,fontFamily:H},children:e=>T(ke,{expanded:!1,"aria-describedby":e,connected:o,active:t,color:i,onSettlingChange:a,onClick:r,onMouseEnter:()=>s?.(!0),onMouseLeave:()=>s?.(!1)})})]})}function Se(){return typeof window>"u"?{w:1920,h:1080}:{w:window.visualViewport?.width??window.innerWidth,h:window.visualViewport?.height??window.innerHeight}}function je(e=!0){let[t,n]=R(Se);return B(()=>{if(!e)return;let t=()=>{let e=Se();n(t=>t.w===e.w&&t.h===e.h?t:e)};return t(),window.addEventListener("resize",t),window.visualViewport?.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),window.visualViewport?.removeEventListener("resize",t)}},[e]),t}function ze(e){let t=V(e);t.current=e,Z(()=>{let e=0,n=0,o=o=>{if("Meta"!==o.key&&"Control"!==o.key)return void(n=0);let i=Date.now();n=i-e<g.toolbar.toggleWindowMs?n+1:1,n>=2&&(t.current(),n=0),e=i},i=e=>{"Meta"!==e.key&&"Control"!==e.key&&(n=0)};return window.addEventListener("keydown",o),window.addEventListener("keyup",i),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",i)}},[])}var Ee=(e,t)=>({display:"flex",width:t,height:32,borderRadius:16,overflow:"hidden",background:Q[e].control});function Le({theme:e,icon:t,menuOpen:n=!1,interactive:o=!0,primaryLabel:i="Cycle annotations",primaryCursor:a=!1,dotColor:r,onPrimary:s,onMenu:l}){let d=Q[e];return D("div",{"data-popmelt-compact-tool-control":!0,style:{...Ee(e,46),pointerEvents:o?void 0:"none"},children:[D("button",{type:"button","aria-label":i,"aria-disabled":!o,tabIndex:o?void 0:-1,onClick:s,style:{width:26,height:32,display:"flex",alignItems:"center",justifyContent:"flex-end",position:"relative",padding:0,border:0,background:"transparent",color:d.primary,cursor:o&&a?"pointer":"default"},children:[t,r&&T("span",{"aria-hidden":"true",style:{position:"absolute",left:16,top:14,width:4,height:4,borderRadius:"50%",background:r,pointerEvents:"none"}})]}),T("button",{type:"button","aria-label":"Choose tool","aria-haspopup":"menu","aria-expanded":n,"aria-disabled":!o,tabIndex:o?void 0:-1,onClick:l,style:{width:20,height:32,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",padding:"0 6px 0 2px",border:0,background:"transparent",color:d.mutedStrong,cursor:o?"pointer":"default"},children:T(M,{size:12,strokeWidth:2,style:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 120ms ease"}})})]})}function $e({theme:e,themePreference:o=e,onThemePreferenceChange:i,action:a,logoOnly:r=!1,connected:s,connection:l,panel:d,deemphasizeControls:p=!1,onCollapse:c,ariaLabel:m="Popmelt admission"}){let[u,h]=R(()=>!r),[f,g]=R(ie),y=V(null),v=t(),x=v.surface??"popmelt-guide",{leave:w,dismiss:k}=v,C=null!==v.surface&&"visible"===v.phase,S=je(u),j=()=>{if(u)return k(),c?.(),void h(!1);h(!0),r&&v.show("popmelt-guide")};return ze(j),Z(()=>{let e=y.current;if(!e)return;let t=t=>{"touch"!==t.pointerType&&(t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||w(x))},n=t=>{"touch"===t.pointerType&&!t.composedPath().includes(e)&&k()};return e.addEventListener("pointerout",t),document.addEventListener("pointerdown",n),()=>{e.removeEventListener("pointerout",t),document.removeEventListener("pointerdown",n)}},[u,k,w,x]),u?D("div",{ref:y,style:{display:"contents"},onKeyDown:e=>{"Escape"===e.key&&k()},onBlur:e=>{e.relatedTarget instanceof Node&&y.current?.contains(e.relatedTarget)||w(x)},children:[T("style",{children:'\n [data-popmelt-entry-dimmed] [data-popmelt-entry-content],\n [data-popmelt-entry-dimmed] [data-popmelt-entry-control] > [data-popmelt-logo] {\n opacity: 1;\n transition: opacity 120ms ease;\n }\n [data-popmelt-entry-dimmed="true"] [data-popmelt-entry-content],\n [data-popmelt-entry-dimmed="true"] [data-popmelt-entry-control] > [data-popmelt-logo] {\n opacity: 0.5;\n }\n [data-popmelt-entry-dimmed] [data-popmelt-entry-control]:is(:hover:not([aria-expanded="true"]), :focus-visible) > [data-popmelt-entry-content],\n [data-popmelt-entry-dimmed] [data-popmelt-entry-control]:is(:hover:not([aria-expanded="true"]), :focus-visible) > [data-popmelt-logo] {\n opacity: 1;\n }\n @media (prefers-reduced-motion: reduce) {\n [data-popmelt-entry-dimmed] [data-popmelt-entry-content],\n [data-popmelt-entry-dimmed] [data-popmelt-entry-control] > [data-popmelt-logo] {\n transition: none;\n }\n }\n '}),v.surface&&T("div",{"data-devtools":"popmelt-guide-corridor",onMouseEnter:()=>v.enter(x),style:{...se(f,S.w,S.h,0),width:b(S.w),boxSizing:"content-box",...f.startsWith("top-")?{paddingTop:8}:{paddingBottom:8},zIndex:10001,opacity:C?1:0,transition:C?"none":`opacity ${n}ms ease`},children:"settings"===x?T(xe,{theme:e,appearance:{themePreference:o,onThemePreferenceChange:i,snapPosition:f,onSnapPositionChange:e=>{ae(e),g(e)}},onClose:()=>v.show("popmelt-guide")}):T(N,{theme:e,themePreference:o,active:C,onSettings:()=>v.show("settings"),connection:l})}),d&&!v.surface&&T("div",{"data-devtools":"toolbar-entry-panel",style:{...se(f,S.w,S.h,8),zIndex:10001},children:d}),D(we,{theme:e,expanded:!0,width:"max-content",snapPosition:f,"aria-label":m,"data-popmelt-entry-dock":f,"data-popmelt-entry-dimmed":!(!p||!d||v.surface),style:r?{width:40,padding:0,gap:0,justifyContent:"center"}:void 0,children:[T("span",{style:{display:"contents"},onMouseEnter:()=>k(),onFocus:()=>k(),children:a}),T(ke,{expanded:!0,"data-popmelt-entry-control":!0,connected:s,color:Q[e].primary,onClick:j,onLongPress:()=>v.show(x),onMouseEnter:()=>v.enter(x),onFocus:()=>v.show("popmelt-guide")})]})]}):T(Ce,{theme:e,snapPosition:f,color:Q[e].primary,connected:s,onOpen:j})}function Pe(e){return{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:m.padding,height:m.height,borderRadius:m.radius,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontSize:10,fontWeight:400,background:Q[e].control,color:Q[e].primary}}function Ie(e){return o(e)}function Me(e){return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:u.gap,padding:u.padding,borderRadius:u.radius,border:0,background:"transparent",color:Q[e].primary,font:"inherit",fontWeight:500,cursor:"pointer",whiteSpace:"nowrap",flexShrink:0}}function We({request:e,selected:t,dimmed:n=!1,onClick:o,theme:a,detailsId:r,onDetailsEnter:s,onDetailsLeave:p,onDetailsDismiss:c,onHoverChange:m}){let u=V(null);return Z(()=>{let e=u.current;if(!e)return;let t=t=>{if("touch"===t.pointerType||t.relatedTarget instanceof Node&&e.contains(t.relatedTarget))return;let n="pointerover"===t.type;m?.(n),n?s?.("pointer"):p?.(t.relatedTarget)};return e.addEventListener("pointerover",t),e.addEventListener("pointerout",t),e.addEventListener("pointercancel",t),()=>{e.removeEventListener("pointerover",t),e.removeEventListener("pointerout",t),e.removeEventListener("pointercancel",t)}},[s,p,m]),D("button",{ref:u,type:"button","data-devtools":"admission-chip","data-admission-request-id":e.id,"aria-label":`Access request from ${e.name}`,"aria-expanded":t,"aria-controls":t?r:void 0,onFocus:()=>s?.("focus"),onBlur:e=>p?.(e.relatedTarget),onKeyDown:e=>{"Escape"!==e.key||!t||(e.preventDefault(),e.stopPropagation(),c?.())},onClick:o,style:{width:d(l(e)),height:22,boxSizing:"border-box",padding:0,flexShrink:0,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",color:n?`color-mix(in srgb, #fff 20%, ${Q[a].surface})`:"#fff",cursor:"pointer",border:0},children:[T(i,{shape:l(e),color:n&&e.color?`color-mix(in srgb, ${e.color} 20%, ${Q[a].surface})`:e.color??"transparent",outline:t?Q[a].primary:Q[a].surface,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",maxWidth:"none"}}),T(W,{size:12,style:{width:12,height:12,position:"relative",flexShrink:0,pointerEvents:"none"},"aria-hidden":"true","data-popmelt-admission-wave":!0})]})}function He({id:e,request:t,theme:n,onDecide:o,style:r,grantRef:s}){let[d,c]=R(!1),[m,f]=R(),g=V(0),y=V(!1),v=async e=>{if(!y.current){y.current=!0,c(!0),f(void 0);try{await o(t.id,e)}catch{g.current+=1,f({target:e,pulse:g.current})}finally{y.current=!1,c(!1)}}};return D("div",{id:e,role:"group","aria-label":`${t.name}'s access request`,"data-devtools":"admission-card","data-popmelt-font":"sans","data-popmelt-theme":n,style:{...Ie(n),...r},children:[T("style",{children:`\n [data-devtools="admission-card"][data-popmelt-theme="${n}"] [data-admission-reject] {\n color: ${Q[n].mutedStrong};\n transition: color 120ms ease;\n }\n [data-devtools="admission-card"][data-popmelt-theme="${n}"] [data-admission-reject]:not(:disabled):is(:hover, :focus-visible) {\n color: ${Q[n].primary};\n }\n [data-admission-invite] {\n transition: opacity 120ms ease;\n }\n [data-admission-reject-label] {\n max-width: 0;\n opacity: 0;\n overflow: hidden;\n transition: max-width 160ms ease, opacity 120ms ease;\n }\n [data-admission-reject]:not(:disabled):is(:hover, :focus-visible) [data-admission-reject-label] {\n max-width: 54px;\n opacity: 1;\n }\n [data-admission-invite]:not(:focus-visible):has(+ [data-admission-reject]:not(:disabled):is(:hover, :focus-visible)) {\n opacity: 0;\n pointer-events: none;\n }\n [data-popmelt-admission-decision-rejection="odd"] {\n animation: popmelt-admission-decision-rejection-odd 220ms ease-out;\n }\n [data-popmelt-admission-decision-rejection="even"] {\n animation: popmelt-admission-decision-rejection-even 220ms ease-out;\n }\n @keyframes popmelt-admission-decision-rejection-odd {\n ${x}\n }\n @keyframes popmelt-admission-decision-rejection-even {\n ${x}\n }\n @keyframes popmelt-admission-invite-label-out {\n 0%, 30% {\n opacity: 1;\n transform: translateX(0);\n }\n 100% {\n opacity: 0;\n transform: translateX(10px);\n }\n }\n @keyframes popmelt-admission-updating-label-in {\n 0% {\n opacity: 0;\n transform: translate(-12px, -50%);\n }\n 100% {\n opacity: 1;\n transform: translate(0, -50%);\n }\n }\n [data-popmelt-admission-updating-dot] {\n animation-duration: 1.2s;\n animation-iteration-count: infinite;\n animation-timing-function: step-end;\n }\n [data-popmelt-admission-updating-dot="1"] {\n animation-name: popmelt-admission-updating-dot-1;\n }\n [data-popmelt-admission-updating-dot="2"] {\n animation-name: popmelt-admission-updating-dot-2;\n }\n [data-popmelt-admission-updating-dot="3"] {\n animation-name: popmelt-admission-updating-dot-3;\n }\n @keyframes popmelt-admission-updating-dot-1 {\n 0%, 24.99% { opacity: 0; }\n 25%, 100% { opacity: 1; }\n }\n @keyframes popmelt-admission-updating-dot-2 {\n 0%, 49.99% { opacity: 0; }\n 50%, 100% { opacity: 1; }\n }\n @keyframes popmelt-admission-updating-dot-3 {\n 0%, 74.99% { opacity: 0; }\n 75%, 100% { opacity: 1; }\n }\n @media (prefers-reduced-motion: reduce) {\n [data-popmelt-admission-invite-label],\n [data-popmelt-admission-updating-label] { animation: none !important; }\n [data-admission-invite],\n [data-admission-reject-label] { transition: none !important; }\n [data-popmelt-admission-updating-dot] { animation: none; opacity: 1; }\n [data-popmelt-admission-decision-rejection] { animation: none !important; }\n }\n `}),D("div",{style:{display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0},children:[T(i,{"data-popmelt-request-avatar":!0,shape:l(t),color:t.color??"transparent",size:h.identitySize}),T("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:600},children:t.name}),T(a,{at:t.createdAt,theme:n,label:"Requested"})]}),D("div",{style:{display:"flex",gap:0,position:"relative"},children:[D(p,{ref:s,variant:"custom",disabled:d,"data-admission-invite":!0,"data-popmelt-admission-decision-rejection":"grant"===m?.target?m.pulse%2?"odd":"even":void 0,"aria-keyshortcuts":"Space","aria-label":d?"Updating…":"grant"===m?.target?"Invite failed; try again":"Invite",style:{...Me(n),position:"relative",boxSizing:"border-box",overflow:"hidden"},onClick:()=>{v("grant")},children:[T("kbd",{"aria-hidden":"true","data-popmelt-admission-invite-shortcut":!0,style:{...Pe(n),opacity:d?0:1,transition:"opacity 120ms ease"},children:"space"}),T("span",{"aria-hidden":"true","data-popmelt-admission-invite-label":!0,style:{fontSize:12,opacity:d?0:1,transform:d?"translateX(10px)":"translateX(0)",animation:d?"popmelt-admission-invite-label-out 260ms ease both":void 0},children:"to invite"}),d&&D("span",{"aria-hidden":"true","data-popmelt-admission-updating-label":!0,style:{position:"absolute",top:"50%",right:8,fontSize:12,opacity:1,transform:"translate(0, -50%)",animation:"popmelt-admission-updating-label-in 260ms ease 40ms both"},children:["Updating",D("span",{"aria-hidden":"true","data-popmelt-admission-updating-dots":!0,style:{display:"inline-block"},children:[T("span",{"data-popmelt-admission-updating-dot":"1",children:"."}),T("span",{"data-popmelt-admission-updating-dot":"2",children:"."}),T("span",{"data-popmelt-admission-updating-dot":"3",children:"."})]})]})]}),D(p,{variant:"custom",disabled:d,"aria-label":"decline"===m?.target?"Decline request failed; try again":"Decline request","data-admission-reject":!0,"data-popmelt-admission-decision-rejection":"decline"===m?.target?m.pulse%2?"odd":"even":void 0,style:{...Me(n),color:void 0,position:"relative"},onClick:()=>{v("decline")},children:[T("span",{"data-admission-reject-label":!0,"aria-hidden":"true",style:{position:"absolute",right:20,top:"50%",transform:"translateY(-50%)"},children:T("span",{style:{display:"block",paddingRight:4,whiteSpace:"nowrap"},children:"Decline?"})}),T(E,{size:u.iconSize,strokeWidth:1.5,"aria-hidden":"true",style:{flexShrink:0}})]})]})]})}var De='\n [data-popmelt-admission-wave] {\n transform-box: fill-box;\n transform-origin: 70% 85%;\n }\n @media (prefers-reduced-motion: no-preference) {\n [data-popmelt-admission-ask][aria-expanded="false"]:is(:hover, :focus-visible) [data-popmelt-admission-wave],\n [data-devtools="admission-chip"]:is(:hover, :focus-visible) [data-popmelt-admission-wave] {\n animation: popmelt-admission-wave 650ms ease-in-out;\n }\n }\n @keyframes popmelt-admission-wave {\n 0%, 100% { transform: rotate(0deg); }\n 20% { transform: rotate(18deg); }\n 40% { transform: rotate(-12deg); }\n 60% { transform: rotate(12deg); }\n 80% { transform: rotate(-6deg); }\n }\n';export{je as A,ze as B,Le as C,$e as D,De as E,Pe as F,Ie as G,Me as H,We as I,He as J,K as a,U as b,G as c,J as d,_ as e,te as f,ne as g,ie as h,ae as i,se as j,le as k,de as l,pe as m,ce as n,O as o,X as p,N as q,he as r,fe as s,ge as t,ye as u,xe as v,we as w,Qe as x,ke as y,Ce as z};
|
|
1
|
+
"use client";import{a as e}from"./chunk-DUWONLQE.mjs";import{c as t,b as n}from"./chunk-ATLUO4G7.mjs";import{i as o,c as i}from"./chunk-BZPWT44Z.mjs";import{f as a,e as r,d as s}from"./chunk-VGX6J2OP.mjs";import{k as l,h as d}from"./chunk-5JAZXI47.mjs";import{k as p,j as c,h as m,c as u,a as h}from"./chunk-OOFTFGZL.mjs";import{a as f}from"./chunk-ZVDKW7TO.mjs";import{a as g}from"./chunk-HQVWOBYH.mjs";import{a as y,b as v,c as b}from"./chunk-Q6C7ZA3H.mjs";import{a as x}from"./chunk-OREALBUO.mjs";import{c as w}from"./chunk-CK3CDA3L.mjs";import{a as Q,b as k}from"./chunk-ECGXE2Z6.mjs";import{ea as C,S,za as j,wa as z,Qa as L,G as E,fa as P,da as $,Ja as I,F as W,R as T}from"./chunk-KE4MQBRY.mjs";import{a as H}from"./chunk-BH5BNULT.mjs";import{jsxs as M,jsx as D,Fragment as A}from"react/jsx-runtime";import{useRef as V,useState as B,useLayoutEffect as F,Children as O,useEffect as R}from"react";var Z="0.42.0";function X({descriptionId:e}){return D("svg",{"data-popmelt-wordmark":!0,role:"img","aria-label":"Popmelt",tabIndex:0,focusable:"true","aria-describedby":e,width:"61",height:"20.8",viewBox:"0 0 57.315 19.5",fill:"currentColor",style:{display:"block",flexShrink:0},children:D("path",{d:"M1.427 14.625V4.553H4.813Q6.199 4.553 7.215 4.969Q8.231 5.385 8.786 6.187Q9.341 6.989 9.341 8.167Q9.341 9.374 8.79 10.191Q8.238 11.008 7.245 11.424Q6.251 11.84 4.902 11.84H2.838L3.069 10.122H4.857Q5.639 10.122 6.214 9.915Q6.789 9.708 7.109 9.272Q7.429 8.836 7.429 8.167Q7.429 7.52 7.113 7.102Q6.797 6.685 6.222 6.478Q5.647 6.271 4.857 6.271H3.287Q3.287 14.618 1.427 14.625ZM9.421 10.913Q9.421 9.841 9.95 8.963Q10.478 8.086 11.378 7.561Q12.278 7.036 13.395 7.036Q14.527 7.036 15.423 7.561Q16.319 8.086 16.84 8.967Q17.361 9.848 17.361 10.913Q17.361 11.985 16.84 12.87Q16.319 13.755 15.419 14.284Q14.519 14.812 13.957 14.812Q13.395 14.812 12.832 14.812Q12.27 14.812 11.374 14.284Q10.478 13.755 9.95 12.87Q9.421 11.985 9.421 10.913ZM13.395 13.109Q14.019 13.109 14.504 12.812Q14.989 12.515 15.271 12.019Q15.553 11.522 15.553 10.928Q15.553 10.326 15.271 9.83Q14.989 9.334 14.504 9.036Q14.019 8.739 13.395 8.739Q12.778 8.739 12.289 9.036Q11.8 9.334 11.514 9.83Q11.229 10.326 11.229 10.928Q11.229 11.522 11.514 12.019Q11.8 12.515 12.289 12.812Q12.778 13.109 13.395 13.109ZM17.957 18.022V10.913Q17.957 9.803 18.478 8.93Q18.999 8.056 19.899 7.55Q20.799 7.044 21.931 7.044Q23.063 7.044 23.959 7.569Q24.855 8.093 25.376 8.971Q25.897 9.848 25.897 10.913Q25.897 12.045 25.402 12.93Q24.907 13.815 24.033 14.317Q23.16 14.82 22.02 14.82Q21.179 14.82 20.459 14.425Q19.738 14.031 19.303 13.392Q18.867 12.754 18.867 12.01L19.764 12.29Q19.764 18.022 17.957 18.022ZM21.931 13.117Q22.555 13.117 23.04 12.82Q23.525 12.522 23.807 12.022Q24.089 11.522 24.089 10.928Q24.089 10.326 23.807 9.834Q23.525 9.341 23.04 9.044Q22.555 8.747 21.931 8.747Q21.314 8.747 20.825 9.044Q20.336 9.341 20.05 9.834Q19.764 10.326 19.764 10.928Q19.764 11.522 20.05 12.022Q20.336 12.522 20.825 12.82Q21.314 13.117 21.931 13.117ZM39.274 10.748V14.625H37.467V11.046Q37.467 10.423 37.271 9.9Q37.075 9.378 36.666 9.062Q36.256 8.747 35.617 8.747Q34.994 8.747 34.591 9.055Q34.189 9.363 33.99 9.878Q33.791 10.392 33.791 11.016V14.625H31.983V11.024Q31.983 10.392 31.787 9.878Q31.592 9.363 31.178 9.055Q30.765 8.747 30.134 8.747Q29.495 8.747 29.093 9.062Q28.691 9.378 28.499 9.897Q28.307 10.415 28.307 11.039V14.625H26.499V10.755Q26.499 9.721 26.897 8.869Q27.294 8.018 28.073 7.509Q28.853 6.999 29.999 6.999Q30.944 6.999 31.634 7.355Q32.323 7.712 32.706 8.338Q33.088 8.964 33.104 9.789H32.7Q32.723 8.964 33.116 8.338Q33.51 7.712 34.188 7.355Q34.867 6.999 35.305 6.999Q35.744 6.999 36.325 6.999Q36.905 6.999 37.689 7.509Q38.472 8.018 38.873 8.866Q39.274 9.713 39.274 10.748ZM39.878 10.876Q39.878 9.811 40.354 8.93Q40.831 8.049 41.685 7.524Q42.54 6.999 43.664 6.999Q44.811 6.999 45.628 7.501Q46.445 8.003 46.884 8.847Q47.323 9.69 47.323 10.71V11.325H41.297L41.604 10.762Q41.566 11.468 41.841 12.025Q42.115 12.581 42.63 12.901Q43.145 13.221 43.837 13.221Q44.483 13.221 45.009 12.932Q45.534 12.643 45.828 12.079L47.217 12.789Q46.73 13.763 45.856 14.284Q44.983 14.805 44.417 14.805Q43.852 14.805 43.286 14.805Q42.72 14.805 41.816 14.302Q40.913 13.8 40.396 12.915Q39.878 12.03 39.878 10.876ZM41.701 10.255H45.523Q45.485 9.765 45.237 9.389Q44.989 9.012 44.583 8.801Q44.176 8.59 43.649 8.59Q43.115 8.59 42.701 8.813Q42.287 9.035 42.035 9.411Q41.783 9.788 41.701 10.255ZM50.147 3.841V14.625H48.339Q48.339 3.841 50.147 3.841ZM52.051 11.838V5.333H53.859V11.779Q53.859 12.455 54.231 12.827Q54.602 13.199 55.226 13.199Q55.564 13.199 55.935 13.093Q56.306 12.988 56.576 12.8V14.437Q56.291 14.617 55.875 14.722Q55.459 14.827 55.26 14.827Q55.061 14.827 54.567 14.827Q54.073 14.827 53.403 14.449Q52.733 14.071 52.392 13.393Q52.051 12.715 52.051 11.838ZM56.576 8.778H50.64V7.238H56.576V8.778Z"})})}function q(e,t){return{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px 2px 4px",border:0,borderRadius:6,backgroundColor:t?e.hoverSurface:"transparent",color:t?e.hoverForeground:e.muted,font:"inherit",fontWeight:500,cursor:"pointer"}}function N({theme:t,themePreference:n,onShare:o,onHistory:i,history:a,version:r=Z,onSettings:s,active:l,workspace:d,connection:c,connectionDetails:m,style:u}){let h=Q[t];return M("div",{role:"region","aria-label":"About Popmelt","data-popmelt-guidance":"popmelt","data-popmelt-tooltip-boundary":!0,"data-popmelt-font":"sans","data-popmelt-theme":t,"data-popmelt-theme-preference":n,style:{position:"relative",display:"flex",width:"100%",flexDirection:"column",alignItems:"flex-start",gap:12,overflowY:a?"auto":"visible",overscrollBehavior:"contain",boxSizing:"border-box",padding:16,border:`1px solid ${h.border}`,borderRadius:20,backgroundColor:h.surface,backdropFilter:"blur(59.5px)",WebkitBackdropFilter:"blur(59.5px)",zIndex:10001,color:h.primary,fontFamily:H,fontSize:14,lineHeight:1.3,letterSpacing:"-0.14px","--popmelt-thread-action":h.actionSurface,"--popmelt-thread-on-action":h.actionForeground,...u},children:[M("header",{style:{display:"flex",alignItems:"center",width:"100%",flexWrap:"wrap",gap:8},children:[M("div",{style:{display:"flex",alignItems:"center",gap:8},children:[D(e,{interactive:!0,active:l,"aria-hidden":"true",width:24,height:24,viewBox:"7 7 26 26",fill:h.primary,style:{display:"block",flexShrink:0}}),M("div",{style:{display:"flex",alignItems:"center",gap:4},children:[D(w,{hint:`Version ${r}`,above:!0,children:e=>D(X,{descriptionId:e})}),M("span",{"aria-label":"Command Command",style:{display:"inline-flex",alignItems:"center",gap:2,padding:"1px 3px",borderRadius:6,backgroundColor:h.control,color:h.mutedStrong,fontSize:12,lineHeight:1.3,letterSpacing:"-0.12px"},children:[D("span",{children:"⌘"}),D("span",{children:"⌘"})]})]})]}),M("div",{style:{marginInlineStart:"auto",flexShrink:0,display:"flex",gap:4},children:[o&&M(p,{theme:t,"aria-label":"Pair and Share",onClick:o,children:[D(C,{size:14,"aria-hidden":"true"})," Pair"]}),[["Thread History","Open history",S,i],["Settings","Open settings",j,s]].map(([e,n,o,i])=>i&&D(p,{theme:t,variant:"ghost","aria-label":n,hint:e,above:!0,onClick:i,icon:o,style:{color:h.muted}},n))]})]}),d,c&&D("div",{style:{display:"flex",width:"100%",alignItems:"flex-start",gap:8,fontSize:12},children:c}),m,a]})}var U={toolbar:10,send:18,approval:[18,60,18],reply:14};function Y(e){if(f()&&"visible"===document.visibilityState&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches&&navigator.vibrate&&!1!==navigator.userActivation?.hasBeenActive)try{navigator.vibrate(U[e])}catch{}}var K="bottom-left",G=16,J=40,_=8,ee="popmelt-toolbar-snap-position";function te(e){return e.startsWith("top-")}function ne(e){return e.endsWith("-right")}function oe(e){return e.endsWith("-center")}function ie(){try{let e=localStorage.getItem(ee);if(e&&function(e){return["bottom-right","bottom-center","bottom-left","top-right","top-center","top-left"].includes(e)}(e))return e}catch{}return K}function ae(e){try{localStorage.setItem(ee,e)}catch{}}function re(e){let t=te(e)?"top":"bottom",n=ne(e)?"right":"left",o="var(--popmelt-toolbar-edge, 16px)";return{position:"fixed",[t]:`max(${o}, env(safe-area-inset-${t}))`,...oe(e)?{left:"50%",transform:"translateX(-50%)"}:{[n]:`max(${o}, env(safe-area-inset-${n}))`}}}function se(e,t,n,o=12){let i,a=te(e),r=y(t),s=v(t),l=a?{top:r?`calc(max(${s}px, env(safe-area-inset-top)) + ${J+o}px)`:s+J+o}:{bottom:r?`calc(max(${s}px, env(safe-area-inset-bottom)) + ${J+o}px)`:s+J+o};return i=oe(e)?{left:"50%",transform:"translateX(-50%)"}:ne(e)?{right:r?`max(${s}px, env(safe-area-inset-right))`:s}:{left:r?`max(${s}px, env(safe-area-inset-left))`:s},{position:"fixed",...l,...i}}function le(e,t,n){let o,i,a=te(e),r=y(t),s=v(t),l=a?{top:r?`calc(max(${s}px, env(safe-area-inset-top)) + 48px)`:s+J+8}:{bottom:r?`calc(max(${s}px, env(safe-area-inset-bottom)) + 48px)`:s+J+8};return oe(e)?(o={left:"50%",transform:"translateX(-50%)"},i="center"):ne(e)?(o={right:r?`max(${s}px, env(safe-area-inset-right))`:s},i="flex-end"):(o={left:r?`max(${s}px, env(safe-area-inset-left))`:s},i="flex-start"),{position:"fixed",...l,...o,zIndex:9999,display:"flex",flexDirection:"column",alignItems:i}}function de(e,t=(typeof window<"u"?window.innerWidth:1920)){let n=te(e),o=ne(e)||oe(e),i=y(t),a=v(t),r=n&&o?a+J+8:a,s=!n&&o?a+J+8:a;return{position:"fixed",top:i?`max(${r}px, env(safe-area-inset-top))`:r,right:i?`max(${a}px, env(safe-area-inset-right))`:a,bottom:i?`max(${s}px, env(safe-area-inset-bottom))`:s,width:b(t)}}function pe(e,t,n){let o,i,a=b(t),r=v(t),s=te(e);return ne(e)||oe(e)?(o=t-r,i=o-a):(i=r,o=i+a),{left:i,right:o,y:s?r+J+8:n-r-J-8}}var ce=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"];function me({position:e}){let t=e.endsWith("-left"),n=e.endsWith("-center"),o=e.startsWith("top-")?4:10;return D("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:M("g",{transform:t?"translate(14 0) scale(-1 1)":void 0,children:[D("rect",{x:"1.5",y:"1.5",width:"11",height:"11",rx:"2.5",stroke:"currentColor",strokeWidth:"1"}),D("circle",{cx:n?7:10,cy:o,r:"1.5",fill:"currentColor"})]})})}function ue(e){return e.charAt(0).toUpperCase()+e.slice(1)}var he={display:"flex",flexDirection:"column",gap:3},fe={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:28,width:"100%"},ge={display:"inline-flex",alignItems:"center",gap:4,padding:"4px 10px",border:0,borderRadius:8,font:"inherit",fontSize:14,fontWeight:500,lineHeight:1.3,minWidth:0};function ye(e){return{...ge,background:"transparent",color:e}}function ve(e){if(!(e instanceof HTMLElement)||e.hidden||e.hasAttribute("data-settings-search-ignore")||"none"===e.style.display||"STYLE"===e.tagName)return"";let t=[e.dataset.settingsKeywords,"status"===e.getAttribute("role")?e.getAttribute("aria-label"):""];for(let n of Array.from(e.childNodes))n instanceof Element?t.push(ve(n)):n.nodeType===Node.TEXT_NODE&&t.push(n.textContent);return t.join(" ")}function be(e){return e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function xe({theme:e,appearance:t,onClose:n,style:o,children:i}){let a=Q[e],{snapPosition:r,onSnapPositionChange:s,themePreference:l,onThemePreferenceChange:d}=t,c=V(null),m=V(null),u=V(null),h=V(null),[f,g]=B(null),[y,v]=B(""),[b,x]=B(!1),w=null!==f,C=V(!1);function S(){C.current=!0,v(""),g(null)}F(()=>{w?u.current?.focus():C.current&&h.current?.focus(),C.current=!1},[w]),F(()=>{let e=m.current;if(!e)return;e.scrollTop=0;let t=be(y);if(!t)return e.querySelectorAll("[data-settings-filtered]").forEach(e=>e.removeAttribute("data-settings-filtered")),void x(!1);let n=t.split(" "),o=()=>{let t=!1;for(let o of e.querySelectorAll("[data-settings-group]")){let e=!1;for(let t of o.querySelectorAll("[data-settings-row]")){let i=be((o.dataset.settingsGroup??"")+" "+ve(t)),a=n.every(e=>i.includes(e));t.toggleAttribute("data-settings-filtered",!a),a&&(e=!0)}o.toggleAttribute("data-settings-filtered",!e),e&&(t=!0)}x(!t)};o();let i=new MutationObserver(o);return i.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["data-settings-keywords","data-settings-group","aria-label","style","hidden"]}),()=>i.disconnect()},[y]);let W="bottom-right"===r?"bottom-left":"bottom-right",T=k(l);return M("div",{ref:c,role:"region","aria-label":"Popmelt Settings",onKeyDown:e=>{!w||e.nativeEvent.isComposing||e.defaultPrevented||("Escape"===e.key?(e.preventDefault(),e.stopPropagation(),S()):e.target===u.current&&e.stopPropagation())},"data-popmelt-settings":!0,"data-popmelt-font":"sans","data-popmelt-theme":e,style:{position:"relative",width:"100%",boxSizing:"border-box",padding:"20px 16px 16px",display:"flex",flexDirection:"column",overflow:"hidden",maxHeight:"calc(100dvh - 64px)",overscrollBehavior:"contain",gap:12,border:`1px solid ${a.border}`,borderRadius:20,background:a.surface,color:a.secondary,backdropFilter:"blur(59.5px)",fontFamily:H,fontSize:14,lineHeight:1.3,letterSpacing:"-0.14px",...o,height:f??o?.height},children:[D("style",{children:`\n [data-popmelt-settings] [data-settings-filtered] { display: none !important; }\n [data-popmelt-settings] input[type=search]::-webkit-search-cancel-button { display: none; }\n [data-popmelt-settings] button:not([data-model-picker] button):not([data-provider-action], [data-popmelt-pane-back], [data-settings-search-control]):not(:disabled):hover { background-color: ${a.hoverSurface} !important; }\n [data-popmelt-settings] button:not([data-model-picker] button):disabled { cursor: default; opacity: .6; }\n [data-popmelt-settings][data-popmelt-theme="${e}"] [data-settings-search-control] { color: ${a.secondary}; }\n [data-popmelt-settings][data-popmelt-theme="${e}"] [data-settings-search-control]:is(:hover, :focus-visible) { color: ${a.actionHover}; }\n `}),D("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:24,flexShrink:0},children:M(A,w?{children:[D(z,{size:16,"aria-hidden":"true"}),D("input",{ref:u,"aria-label":"Search settings",type:"search",placeholder:"Search settings",value:y,onChange:e=>v(e.target.value),style:{flex:1,minWidth:0,padding:0,border:0,outline:"none",background:"transparent",color:a.primary,font:"inherit",fontSize:12}}),D(p,{theme:e,variant:"ghost",icon:L,"aria-label":"Close search",onClick:S,"data-settings-search-control":!0})]}:{children:[M(p,{variant:"custom","data-popmelt-pane-back":!0,"aria-label":"Back to Popmelt",onClick:n,style:{border:0,padding:0,background:"transparent",font:"inherit",cursor:"pointer",display:"flex",gap:4,alignItems:"center",color:a.primary,fontWeight:600},children:[D(E,{size:16}),D(j,{size:16}),"Settings"]}),D(p,{ref:h,theme:e,variant:"ghost",icon:z,"aria-label":"Search settings","data-settings-search-control":!0,onClick:()=>{c.current&&g(c.current.getBoundingClientRect().height)}})]})}),M("div",{ref:m,style:{minHeight:0,overflowX:"hidden",overflowY:"auto",overscrollBehavior:"contain",display:"flex",flexDirection:"column",gap:12},children:[M("section",{"data-settings-group":"Appearance",style:he,"aria-label":"Appearance settings",children:[D("span",{style:{color:a.hoverForeground,fontSize:12,fontWeight:500,marginBottom:1},children:"Appearance"}),M("div",{"data-settings-row":!0,style:fe,children:[D("span",{children:"Toolbar position"}),M(p,{theme:e,size:"regular",variant:"ghost",disabled:!s,"aria-label":`Toolbar position: ${ue(r)}. Move to ${W}.`,onClick:()=>s?.(W),children:[D(me,{position:r}),ue(r)]})]}),M("div",{"data-settings-row":!0,style:fe,children:[D("span",{children:"Theme"}),M(p,{theme:e,size:"regular",variant:"ghost",disabled:!d,"aria-label":`Theme mode: ${l}. Click to switch to ${T}`,"data-popmelt-theme-control":l,onClick:()=>d?.(T),children:[D("dark"===l?P:"auto"===l?$:I,{size:14,strokeWidth:1.5}),D("span",{children:"auto"===l?"Auto":"dark"===l?"Dark":"Light"})]})]})]}),i,b&&D("span",{role:"status",style:{fontSize:12},children:"No matching settings."})]})]})}function we({theme:e,expanded:t,width:n,snapPosition:o,toolbarRef:i,children:a,style:r,...s}){let l=Q[e],d=o.endsWith("-left"),p=O.toArray(a);return M("div",{...s,ref:i,id:"devtools-toolbar",role:"toolbar","data-popmelt-theme":e,style:{...re(o),zIndex:9999,display:"flex",alignItems:"center",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",cursor:"pointer",overflow:"visible",backgroundColor:l.surface,color:l.primary,colorScheme:e,boxSizing:"border-box",border:0,boxShadow:`inset 0 0 0 1px ${l.border}`,borderRadius:20,padding:t?d?"4px 4px 4px 8px":"4px 8px 4px 4px":0,width:t?n:40,height:40,gap:t?6:0,justifyContent:t?"flex-start":"center",...r},children:[D("style",{children:"@media (max-width: 480px) {\n #devtools-toolbar { --popmelt-toolbar-edge: 8px; }\n }"}),d?p.reverse():p]})}function Qe({theme:e,...t}){return M("button",{type:"button","data-popmelt-connect-agent":!0,...t,style:{...c(e),gap:5},children:[M("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:2},children:[D(a,{size:12}),D(r,{size:12}),D("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:D("path",{fillRule:"evenodd",d:"M12 .25 22.25 6.2v11.6L12 23.75 1.75 17.8V6.2L12 .25ZM2.8 6.55 12 12v10.9l9.3-16.35H2.8Z"})})]}),"Connect your agent"]})}function ke({expanded:t,active:n=!1,connected:o,color:i,onSettlingChange:a,onLongPress:r,onClick:s,...l}){let d=V(void 0),p=V(null),c=V(!1),m=()=>{clearTimeout(d.current),p.current=null};R(()=>m,[t]);let u=t||n||void 0!==o;return D("button",{type:"button","aria-description":!1===o?"Disconnected":void 0,"aria-label":t?"Collapse Popmelt":"Open Popmelt","aria-expanded":t,...l,onPointerDown:e=>{c.current=!1,r&&e.isPrimary&&"touch"===e.pointerType&&(m(),p.current={x:e.clientX,y:e.clientY},d.current=setTimeout(()=>{c.current=!0,Y("toolbar"),r()},480))},onPointerMove:e=>{p.current&&Math.hypot(e.clientX-p.current.x,e.clientY-p.current.y)>10&&m()},onPointerCancel:m,onPointerUp:m,onPointerLeave:m,onContextMenu:e=>{(p.current||c.current)&&e.preventDefault()},onClick:e=>{if(c.current&&0!==e.detail)return c.current=!1,e.preventDefault(),void e.stopPropagation();Y("toolbar"),s?.(e)},style:{display:"flex",alignItems:"center",justifyContent:"center",WebkitTouchCallout:"none",userSelect:"none",touchAction:"manipulation",width:t?24:40,height:t?32:40,flexShrink:0,border:"none",background:"none",padding:0,cursor:"pointer"},children:D(e,{"data-popmelt-logo":!0,active:n&&!1!==o,tracing:!1===o,onSettlingChange:a,width:"24",height:"24",viewBox:"0 0 40 40",fill:u?i:"none",stroke:u?"none":i,color:i,strokeWidth:"1",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg"})})}function Ce({theme:e,active:t,busy:n,connected:o,color:i,onSettlingChange:a,onOpen:r,onCrosshairHover:s,...l}){return M(we,{...l,theme:e,expanded:!1,width:40,"data-popmelt-hover-fill":!n&&void 0===o||void 0,children:[D("style",{children:"\n [data-popmelt-hover-fill]:is(:hover, :focus-within) [data-popmelt-logo] { fill: currentColor; stroke: none; }\n "}),D(w,{hint:"Open (⌘⌘)",above:l.snapPosition.startsWith("bottom-"),surfaceStyle:{background:Q[e].actionSurface,color:Q[e].actionForeground,fontFamily:H},children:e=>D(ke,{expanded:!1,"aria-describedby":e,connected:o,active:t,color:i,onSettlingChange:a,onClick:r,onMouseEnter:()=>s?.(!0),onMouseLeave:()=>s?.(!1)})})]})}function Se(){return typeof window>"u"?{w:1920,h:1080}:{w:window.visualViewport?.width??window.innerWidth,h:window.visualViewport?.height??window.innerHeight}}function je(e=!0){let[t,n]=B(Se);return F(()=>{if(!e)return;let t=()=>{let e=Se();n(t=>t.w===e.w&&t.h===e.h?t:e)};return t(),window.addEventListener("resize",t),window.visualViewport?.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),window.visualViewport?.removeEventListener("resize",t)}},[e]),t}function ze(e){let t=V(e);t.current=e,R(()=>{let e=0,n=0,o=o=>{if("Meta"!==o.key&&"Control"!==o.key)return void(n=0);let i=Date.now();n=i-e<g.toolbar.toggleWindowMs?n+1:1,n>=2&&(t.current(),n=0),e=i},i=e=>{"Meta"!==e.key&&"Control"!==e.key&&(n=0)};return window.addEventListener("keydown",o),window.addEventListener("keyup",i),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",i)}},[])}var Le=(e,t)=>({display:"flex",width:t,height:32,borderRadius:16,overflow:"hidden",background:Q[e].control});function Ee({theme:e,icon:t,menuOpen:n=!1,interactive:o=!0,primaryLabel:i="Cycle annotations",primaryCursor:a=!1,dotColor:r,onPrimary:s,onMenu:l}){let d=Q[e];return M("div",{"data-popmelt-compact-tool-control":!0,style:{...Le(e,46),pointerEvents:o?void 0:"none"},children:[M("button",{type:"button","aria-label":i,"aria-disabled":!o,tabIndex:o?void 0:-1,onClick:s,style:{width:26,height:32,display:"flex",alignItems:"center",justifyContent:"flex-end",position:"relative",padding:0,border:0,background:"transparent",color:d.primary,cursor:o&&a?"pointer":"default"},children:[t,r&&D("span",{"aria-hidden":"true",style:{position:"absolute",left:16,top:14,width:4,height:4,borderRadius:"50%",background:r,pointerEvents:"none"}})]}),D("button",{type:"button","aria-label":"Choose tool","aria-haspopup":"menu","aria-expanded":n,"aria-disabled":!o,tabIndex:o?void 0:-1,onClick:l,style:{width:20,height:32,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",padding:"0 6px 0 2px",border:0,background:"transparent",color:d.mutedStrong,cursor:o?"pointer":"default"},children:D(W,{size:12,strokeWidth:2,style:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 120ms ease"}})})]})}function Pe({theme:e,themePreference:o=e,onThemePreferenceChange:i,action:a,logoOnly:r=!1,connected:s,connection:l,panel:d,deemphasizeControls:p=!1,onCollapse:c,ariaLabel:m="Popmelt admission"}){let[u,h]=B(()=>!r),[f,g]=B(ie),y=V(null),v=t(),x=v.surface??"popmelt-guide",{leave:w,dismiss:k}=v,C=null!==v.surface&&"visible"===v.phase,S=je(u),j=()=>{if(u)return k(),c?.(),void h(!1);h(!0),r&&v.show("popmelt-guide")};return ze(j),R(()=>{let e=y.current;if(!e)return;let t=t=>{"touch"!==t.pointerType&&(t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||w(x))},n=t=>{"touch"===t.pointerType&&!t.composedPath().includes(e)&&k()};return e.addEventListener("pointerout",t),document.addEventListener("pointerdown",n),()=>{e.removeEventListener("pointerout",t),document.removeEventListener("pointerdown",n)}},[u,k,w,x]),u?M("div",{ref:y,style:{display:"contents"},onKeyDown:e=>{"Escape"===e.key&&k()},onBlur:e=>{e.relatedTarget instanceof Node&&y.current?.contains(e.relatedTarget)||w(x)},children:[D("style",{children:'\n [data-popmelt-entry-dimmed] [data-popmelt-entry-content],\n [data-popmelt-entry-dimmed] [data-popmelt-entry-control] > [data-popmelt-logo] {\n opacity: 1;\n transition: opacity 120ms ease;\n }\n [data-popmelt-entry-dimmed="true"] [data-popmelt-entry-content],\n [data-popmelt-entry-dimmed="true"] [data-popmelt-entry-control] > [data-popmelt-logo] {\n opacity: 0.5;\n }\n [data-popmelt-entry-dimmed] [data-popmelt-entry-control]:is(:hover:not([aria-expanded="true"]), :focus-visible) > [data-popmelt-entry-content],\n [data-popmelt-entry-dimmed] [data-popmelt-entry-control]:is(:hover:not([aria-expanded="true"]), :focus-visible) > [data-popmelt-logo] {\n opacity: 1;\n }\n @media (prefers-reduced-motion: reduce) {\n [data-popmelt-entry-dimmed] [data-popmelt-entry-content],\n [data-popmelt-entry-dimmed] [data-popmelt-entry-control] > [data-popmelt-logo] {\n transition: none;\n }\n }\n '}),v.surface&&D("div",{"data-devtools":"popmelt-guide-corridor",onMouseEnter:()=>v.enter(x),style:{...se(f,S.w,S.h,0),width:b(S.w),boxSizing:"content-box",...f.startsWith("top-")?{paddingTop:8}:{paddingBottom:8},zIndex:10001,opacity:C?1:0,transition:C?"none":`opacity ${n}ms ease`},children:"settings"===x?D(xe,{theme:e,appearance:{themePreference:o,onThemePreferenceChange:i,snapPosition:f,onSnapPositionChange:e=>{ae(e),g(e)}},onClose:()=>v.show("popmelt-guide")}):D(N,{theme:e,themePreference:o,active:C,onSettings:()=>v.show("settings"),connection:l})}),d&&!v.surface&&D("div",{"data-devtools":"toolbar-entry-panel",style:{...se(f,S.w,S.h,8),zIndex:10001},children:d}),M(we,{theme:e,expanded:!0,width:"max-content",snapPosition:f,"aria-label":m,"data-popmelt-entry-dock":f,"data-popmelt-entry-dimmed":!(!p||!d||v.surface),style:r?{width:40,padding:0,gap:0,justifyContent:"center"}:void 0,children:[D("span",{style:{display:"contents"},onMouseEnter:()=>k(),onFocus:()=>k(),children:a}),D(ke,{expanded:!0,"data-popmelt-entry-control":!0,connected:s,color:Q[e].primary,onClick:j,onLongPress:()=>v.show(x),onMouseEnter:()=>v.enter(x),onFocus:()=>v.show("popmelt-guide")})]})]}):D(Ce,{theme:e,snapPosition:f,color:Q[e].primary,connected:s,onOpen:j})}function $e(e){return{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:m.padding,height:m.height,borderRadius:m.radius,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontSize:10,fontWeight:400,background:Q[e].control,color:Q[e].primary}}function Ie(e){return o(e)}function We(e){return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:u.gap,padding:u.padding,borderRadius:u.radius,border:0,background:"transparent",color:Q[e].primary,font:"inherit",fontWeight:500,cursor:"pointer",whiteSpace:"nowrap",flexShrink:0}}function Te({request:e,selected:t,dimmed:n=!1,onClick:o,theme:i,detailsId:a,onDetailsEnter:r,onDetailsLeave:p,onDetailsDismiss:c,onHoverChange:m}){let u=V(null);return R(()=>{let e=u.current;if(!e)return;let t=t=>{if("touch"===t.pointerType||t.relatedTarget instanceof Node&&e.contains(t.relatedTarget))return;let n="pointerover"===t.type;m?.(n),n?r?.("pointer"):p?.(t.relatedTarget)};return e.addEventListener("pointerover",t),e.addEventListener("pointerout",t),e.addEventListener("pointercancel",t),()=>{e.removeEventListener("pointerover",t),e.removeEventListener("pointerout",t),e.removeEventListener("pointercancel",t)}},[r,p,m]),M("button",{ref:u,type:"button","data-devtools":"admission-chip","data-admission-request-id":e.id,"aria-label":`Access request from ${e.name}`,"aria-expanded":t,"aria-controls":t?a:void 0,onFocus:()=>r?.("focus"),onBlur:e=>p?.(e.relatedTarget),onKeyDown:e=>{"Escape"!==e.key||!t||(e.preventDefault(),e.stopPropagation(),c?.())},onClick:o,style:{width:d(l(e)),height:22,boxSizing:"border-box",padding:0,flexShrink:0,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",color:n?`color-mix(in srgb, #fff 20%, ${Q[i].surface})`:"#fff",cursor:"pointer",border:0},children:[D(s,{shape:l(e),color:n&&e.color?`color-mix(in srgb, ${e.color} 20%, ${Q[i].surface})`:e.color??"transparent",outline:t?Q[i].primary:Q[i].surface,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",maxWidth:"none"}}),D(T,{size:12,style:{width:12,height:12,position:"relative",flexShrink:0,pointerEvents:"none"},"aria-hidden":"true","data-popmelt-admission-wave":!0})]})}function He({id:e,request:t,theme:n,onDecide:o,style:a,grantRef:r}){let[d,c]=B(!1),[m,f]=B(),g=V(0),y=V(!1),v=async e=>{if(!y.current){y.current=!0,c(!0),f(void 0);try{await o(t.id,e)}catch{g.current+=1,f({target:e,pulse:g.current})}finally{y.current=!1,c(!1)}}};return M("div",{id:e,role:"group","aria-label":`${t.name}'s access request`,"data-devtools":"admission-card","data-popmelt-font":"sans","data-popmelt-theme":n,style:{...Ie(n),...a},children:[D("style",{children:`\n [data-devtools="admission-card"][data-popmelt-theme="${n}"] [data-admission-reject] {\n color: ${Q[n].mutedStrong};\n transition: color 120ms ease;\n }\n [data-devtools="admission-card"][data-popmelt-theme="${n}"] [data-admission-reject]:not(:disabled):is(:hover, :focus-visible) {\n color: ${Q[n].primary};\n }\n [data-admission-invite] {\n transition: opacity 120ms ease;\n }\n [data-admission-reject-label] {\n max-width: 0;\n opacity: 0;\n overflow: hidden;\n transition: max-width 160ms ease, opacity 120ms ease;\n }\n [data-admission-reject]:not(:disabled):is(:hover, :focus-visible) [data-admission-reject-label] {\n max-width: 54px;\n opacity: 1;\n }\n [data-admission-invite]:not(:focus-visible):has(+ [data-admission-reject]:not(:disabled):is(:hover, :focus-visible)) {\n opacity: 0;\n pointer-events: none;\n }\n [data-popmelt-admission-decision-rejection="odd"] {\n animation: popmelt-admission-decision-rejection-odd 220ms ease-out;\n }\n [data-popmelt-admission-decision-rejection="even"] {\n animation: popmelt-admission-decision-rejection-even 220ms ease-out;\n }\n @keyframes popmelt-admission-decision-rejection-odd {\n ${x}\n }\n @keyframes popmelt-admission-decision-rejection-even {\n ${x}\n }\n @keyframes popmelt-admission-invite-label-out {\n 0%, 30% {\n opacity: 1;\n transform: translateX(0);\n }\n 100% {\n opacity: 0;\n transform: translateX(10px);\n }\n }\n @keyframes popmelt-admission-updating-label-in {\n 0% {\n opacity: 0;\n transform: translate(-12px, -50%);\n }\n 100% {\n opacity: 1;\n transform: translate(0, -50%);\n }\n }\n [data-popmelt-admission-updating-dot] {\n animation-duration: 1.2s;\n animation-iteration-count: infinite;\n animation-timing-function: step-end;\n }\n [data-popmelt-admission-updating-dot="1"] {\n animation-name: popmelt-admission-updating-dot-1;\n }\n [data-popmelt-admission-updating-dot="2"] {\n animation-name: popmelt-admission-updating-dot-2;\n }\n [data-popmelt-admission-updating-dot="3"] {\n animation-name: popmelt-admission-updating-dot-3;\n }\n @keyframes popmelt-admission-updating-dot-1 {\n 0%, 24.99% { opacity: 0; }\n 25%, 100% { opacity: 1; }\n }\n @keyframes popmelt-admission-updating-dot-2 {\n 0%, 49.99% { opacity: 0; }\n 50%, 100% { opacity: 1; }\n }\n @keyframes popmelt-admission-updating-dot-3 {\n 0%, 74.99% { opacity: 0; }\n 75%, 100% { opacity: 1; }\n }\n @media (prefers-reduced-motion: reduce) {\n [data-popmelt-admission-invite-label],\n [data-popmelt-admission-updating-label] { animation: none !important; }\n [data-admission-invite],\n [data-admission-reject-label] { transition: none !important; }\n [data-popmelt-admission-updating-dot] { animation: none; opacity: 1; }\n [data-popmelt-admission-decision-rejection] { animation: none !important; }\n }\n `}),M("div",{style:{display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0},children:[D(s,{"data-popmelt-request-avatar":!0,shape:l(t),color:t.color??"transparent",size:h.identitySize}),D("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:600},children:t.name}),D(i,{at:t.createdAt,theme:n,label:"Requested"})]}),M("div",{style:{display:"flex",gap:0,position:"relative"},children:[M(p,{ref:r,variant:"custom",disabled:d,"data-admission-invite":!0,"data-popmelt-admission-decision-rejection":"grant"===m?.target?m.pulse%2?"odd":"even":void 0,"aria-keyshortcuts":"Space","aria-label":d?"Updating…":"grant"===m?.target?"Invite failed; try again":"Invite",style:{...We(n),position:"relative",boxSizing:"border-box",overflow:"hidden"},onClick:()=>{v("grant")},children:[D("kbd",{"aria-hidden":"true","data-popmelt-admission-invite-shortcut":!0,style:{...$e(n),opacity:d?0:1,transition:"opacity 120ms ease"},children:"space"}),D("span",{"aria-hidden":"true","data-popmelt-admission-invite-label":!0,style:{fontSize:12,opacity:d?0:1,transform:d?"translateX(10px)":"translateX(0)",animation:d?"popmelt-admission-invite-label-out 260ms ease both":void 0},children:"to invite"}),d&&M("span",{"aria-hidden":"true","data-popmelt-admission-updating-label":!0,style:{position:"absolute",top:"50%",right:8,fontSize:12,opacity:1,transform:"translate(0, -50%)",animation:"popmelt-admission-updating-label-in 260ms ease 40ms both"},children:["Updating",M("span",{"aria-hidden":"true","data-popmelt-admission-updating-dots":!0,style:{display:"inline-block"},children:[D("span",{"data-popmelt-admission-updating-dot":"1",children:"."}),D("span",{"data-popmelt-admission-updating-dot":"2",children:"."}),D("span",{"data-popmelt-admission-updating-dot":"3",children:"."})]})]})]}),M(p,{variant:"custom",disabled:d,"aria-label":"decline"===m?.target?"Decline request failed; try again":"Decline request","data-admission-reject":!0,"data-popmelt-admission-decision-rejection":"decline"===m?.target?m.pulse%2?"odd":"even":void 0,style:{...We(n),color:void 0,position:"relative"},onClick:()=>{v("decline")},children:[D("span",{"data-admission-reject-label":!0,"aria-hidden":"true",style:{position:"absolute",right:20,top:"50%",transform:"translateY(-50%)"},children:D("span",{style:{display:"block",paddingRight:4,whiteSpace:"nowrap"},children:"Decline?"})}),D(L,{size:u.iconSize,strokeWidth:1.5,"aria-hidden":"true",style:{flexShrink:0}})]})]})]})}var Me='\n [data-popmelt-admission-wave] {\n transform-box: fill-box;\n transform-origin: 70% 85%;\n }\n @media (prefers-reduced-motion: no-preference) {\n [data-popmelt-admission-ask][aria-expanded="false"]:is(:hover, :focus-visible) [data-popmelt-admission-wave],\n [data-devtools="admission-chip"]:is(:hover, :focus-visible) [data-popmelt-admission-wave] {\n animation: popmelt-admission-wave 650ms ease-in-out;\n }\n }\n @keyframes popmelt-admission-wave {\n 0%, 100% { transform: rotate(0deg); }\n 20% { transform: rotate(18deg); }\n 40% { transform: rotate(-12deg); }\n 60% { transform: rotate(12deg); }\n 80% { transform: rotate(-6deg); }\n }\n';export{je as A,ze as B,Ee as C,Pe as D,Me as E,$e as F,Ie as G,We as H,Te as I,He as J,Y as a,K as b,G as c,J as d,_ as e,te as f,ne as g,ie as h,ae as i,se as j,le as k,de as l,pe as m,ce as n,Z as o,q as p,N as q,he as r,fe as s,ge as t,ye as u,xe as v,we as w,Qe as x,ke as y,Ce as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{k as e}from"./chunk-
|
|
1
|
+
"use client";import{k as e}from"./chunk-OOFTFGZL.mjs";import{b as n}from"./chunk-ODZOYCTC.mjs";import{w as t,M as i}from"./chunk-KE4MQBRY.mjs";import{useState as r,useRef as a,useEffect as o,useCallback as l}from"react";import{jsx as d,jsxs as c,Fragment as u}from"react/jsx-runtime";function p(e,t,i){let[d,c]=r("idle"),u=a(!0),p=a(!1),s=`${t}/provider-${i}/${e}`;o(()=>(u.current=!0,()=>{u.current=!1}),[]);let m=l(async e=>{let t=await n(s,{method:e,cache:"no-store",signal:AbortSignal.timeout(1e4),..."POST"===e?{headers:{"Content-Type":"application/json"},body:"{}"}:{}});if(!t.ok)throw new Error("Provider action unavailable");let i=await t.json();return["pending","complete","failed","manual"].includes(i.state)?i.state:"failed"},[s]);return o(()=>{if("pending"!==d)return;let e,n=!1,t=Date.now()+6e5;async function i(){try{let r=await m("GET");if(n)return;"pending"!==r||Date.now()>=t?c("pending"===r?"failed":r):e=setTimeout(()=>{i()},1500)}catch{n||c("failed")}}return e=setTimeout(()=>{i()},1500),()=>{n=!0,clearTimeout(e)}},[d,m]),{state:d,start:async function(){if(!p.current){p.current=!0,c("opening");try{let e=await m("POST");u.current&&c(e)}catch{u.current&&c("failed")}finally{p.current=!1}}}}}function s({provider:n,bridgeUrl:a}){let{state:o,start:l}=p(n,a,"login"),[s,m]=r(!1),g="codex"===n?"Codex":"Claude",h="codex"===n?"codex login":"claude auth login",f={display:"inline-flex",alignItems:"center",gap:8,font:"inherit",fontWeight:400,color:"var(--popmelt-thread-primary)",background:"var(--popmelt-thread-control)",cursor:"pointer"};return d("span",{"data-provider-sign-in":n,children:"complete"===o?c("span",{role:"status",children:["Signed in to ",g,". Send your reply to continue."]}):c(u,{children:[c(e,{theme:"dark",style:f,disabled:"opening"===o||"pending"===o,onClick:()=>{l()},children:["opening"===o?"Opening…":"pending"===o?`Signing in to ${g}…`:`Sign in to ${g}`,d(t,{size:14,"aria-hidden":"true"})]}),d("span",{role:"status",children:"pending"===o?" Complete sign-in in the terminal window, then return here.":"manual"===o?" Open your terminal and paste the login command.":"failed"===o?" Sign-in did not finish. Try again, or use your terminal.":" to continue."}),("manual"===o||"failed"===o)&&c(e,{theme:"dark",style:{...f,marginLeft:6},onClick:()=>{navigator.clipboard.writeText(h).then(()=>m(!0)).catch(()=>m(!1))},"aria-label":`Copy ${g} login command`,children:[s?"Copied":h,d(i,{size:14,"aria-hidden":"true"})]})]})})}export{p as a,s as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{c as t}from"./chunk-WP2SHSCG.mjs";import{d as e,c as o,m as r}from"./chunk-LH7HKUCK.mjs";import{b as i}from"./chunk-ADRWR5GI.mjs";var n=[4,2],a=n.join(" "),h=n[0]+n[1];function l(t){return"bottom-left"===t?[2,8,8,8]:"bottom-right"===t?[8,2,8,8]:"top-right"===t?[8,8,2,8]:[8,8,8,2]}function f(t){return l(t).map(t=>`${t}px`).join(" ")}var u=1.1666666666666667;function s(t){return t.length>2048?`${t.slice(0,2048)}…`:t}function p(t,e,o){return e.flatMap(e=>function(t,e,o){let r=s(e);if(!r||t.measureText(r).width<=o)return[r];let i=r.split(/\s+/),n=[],a="";for(let e of i){let r=a?`${a} ${e}`:e;a&&t.measureText(r).width>o?(n.push(a),a=e):a=r}return a&&n.push(a),n.length>0?n:[r]}(t,e,o))}var m=i,y=16;function g(t){let e=window.innerWidth-t-16;return Math.max(60,Math.min(400,e))}function x(t,e,o){let r=s(e);if(r===e&&t.measureText(r).width<=o)return r;let i="…",n=0,a=r.endsWith(i)?r.length-1:r.length;for(;n<a;){let e=Math.ceil((n+a)/2);t.measureText(r.slice(0,e)+i).width<=o?n=e:a=e-1}return n>0?r.slice(0,n)+i:i}function b(t,e,o,r,i){let n=0,a=typeof window<"u"?window.innerHeight:9999;o&&function(t,e,o){if(void 0===t||void 0===e||void 0===o.avoidLeft&&void 0===o.avoidRight)return!0;let r=typeof window<"u"?window.innerWidth:9999,i=o.avoidLeft??0,n=o.avoidRight??r;return t+e>i&&t<n}(r,i,o)&&(n=o.avoidTop??n,a=o.avoidBottom??a);let h=Math.max(n,a-e);return Math.max(n,Math.min(t,h))}function d(t,e=12,o,r){let i=e*u+8,n=t.y-4,a=b(n,i,o,t.x-8,r);return a===n?t:{...t,y:a+4}}function c(t,e,o,r,i=12,n,a,h,f="#dddddd",s,p=!1){if(!o)return;let y=i*u,g=o.replace(/\n/g," "),b=void 0!==n?n+". "+g:g;t.font=`${i}px ${m}`,t.textBaseline="middle";let c=void 0!==a?Math.min(400,Math.max(60,window.innerWidth-a-16)):400,R=p?16:0,L=x(t,b,Math.max(60,c-R)),w=R+t.measureText(L).width,M=d(e,i,h,w+16);t.fillStyle=r;let v=M.x-8,S=M.y-4,C=w+16,N=y+8;t.beginPath(),t.roundRect(v,S,C,N,l(s)),t.fill();let A=M.y+y/2;if(p){let e=M.x,o=A-6;t.strokeStyle=f,t.lineWidth=1.5,t.lineCap="round",t.lineJoin="round",t.beginPath(),t.moveTo(e+7.5,o+4),t.lineTo(e+10.5,o+6.5),t.lineTo(e+7.5,o+9),t.moveTo(e+1.5,o+1.5),t.lineTo(e+1.5,o+4.5),t.quadraticCurveTo(e+1.5,o+6.5,e+3.5,o+6.5),t.lineTo(e+10.5,o+6.5),t.stroke()}t.fillStyle=f,t.fillText(L,M.x+R,A)}function R(t=22){return{height:t,minHeight:t,maxHeight:t,boxSizing:"border-box",flexShrink:0}}function L(t){let e=t.startsWith("top-");return{top:e?4:12,right:4,bottom:e?12:4,left:4}}function w({hasCommentEntry:t,stagedChangeCount:e}){return t&&0===e?2:6}function M({annotationNumber:t,stickerCount:e,interactionEpisodeStepCount:o,hasStatus:r,hasSend:i,controlGap:n}){let a=16+7.2*Math.max(1,void 0===t?0:String(t).length),h=28*e-2*Math.max(0,e-1),l=o>0?32+7.2*String(o).length:0,f=[e>0?e>0?h+(l>0?l-2:0)+(i?26:0):0:0,0===e?l:0,0===e&&i?28:0,r?28:0].filter(t=>t>0);return a+f.reduce((t,e)=>t+e,0)+f.length*n}function v(t,e,o){let r="right"===t.horizontalAlignment?t.left-e:t.left;return{left:r,top:t.top,right:r+e,bottom:t.top+o}}function S(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}function C(t,e,o,r,i,n){let a=n-4,h=(t,o,r)=>Math.max(t,Math.min(e,o-r)),l=h(4,a,o);if(!i.some(t=>l<t.right&&l+o>t.left))return;let f=null;function u(i,n){if(t.left>=n||t.left+t.width<=i)return;let a=Math.max(i,t.left),l=n-a>=r,u=Math.min(o,Math.floor(n-(l?a:i)));if(u<r||u<=0)return;let s=l?a:h(i,n,u);(!f||u>f.width||u===f.width&&Math.abs(s-e)<Math.abs(f.left-e))&&(f={left:s,width:u})}let s=4;for(let t of[...i].sort((t,e)=>t.left-e.left))u(s,Math.min(a,t.left-2)),s=Math.max(s,t.right+2);return u(s,a),f}function N(t,e,o,r,i=0,n=Number.POSITIVE_INFINITY){let a=t.top>=e+o,h=t.bottom+o+e<=r;if(t.height>=r&&!a&&!h){let o=t.top<0&&t.bottom<=r;return{anchor:o?"bottom-left":"top-left",horizontalAlignment:"left",left:t.left+8,top:o?t.bottom-e-8:t.top+8}}let l=function(t,e,o){let r=Math.max(0,t.left+e-o);return Math.max(0,e-t.right)<r?"right":"left"}(t,i,n);return a?{anchor:"right"===l?"top-right":"top-left",horizontalAlignment:l,left:"right"===l?t.right:t.left,top:t.top-e-o}:{anchor:"right"===l?"bottom-right":"bottom-left",horizontalAlignment:l,left:"right"===l?t.right:t.left,top:t.bottom+o}}function A(t,e){let r=({x:t,y:r})=>{let i=o({left:t,top:r,width:0,height:0},e);return{x:i.left,y:i.top}};return{topLeft:r(t.topLeft),topRight:r(t.topRight),bottomRight:r(t.bottomRight),bottomLeft:r(t.bottomLeft)}}var T=12,$=["transition","transform","translate","rotate","scale"];function F(t){let[e]=t.getBoxQuads?.({box:"border"})??[];return e?{topLeft:{x:e.p1.x,y:e.p1.y},topRight:{x:e.p2.x,y:e.p2.y},bottomRight:{x:e.p3.x,y:e.p3.y},bottomLeft:{x:e.p4.x,y:e.p4.y}}:k(t.getBoundingClientRect())}function k(t){return{topLeft:{x:t.left,y:t.top},topRight:{x:t.right,y:t.top},bottomRight:{x:t.right,y:t.bottom},bottomLeft:{x:t.left,y:t.bottom}}}var P={a:1,b:0,c:0,d:1,e:0,f:0};function W(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function j(t,e){return{...P,e:t,f:e}}function I(t){let e=t*Math.PI/180,o=Math.cos(e),r=Math.sin(e);return{a:o,b:r,c:-r,d:o,e:0,f:0}}function B(t,e){return{a:t,b:0,c:0,d:e,e:0,f:0}}function E(t,e){if(!t)return 0;let o=Number.parseFloat(t);return Number.isFinite(o)?t.endsWith("%")?o/100*e:o:0}function H(t){if(!t)return 1;let e=Number.parseFloat(t);return Number.isFinite(e)?t.endsWith("%")?e/100:e:1}function D(t){if(!t||"none"===t)return P;let e=t.match(/^matrix\(([^)]+)\)$/);if(e){let t=e[1].split(",").map(Number);if(6===t.length&&t.every(Number.isFinite)){let[e,o,r,i,n,a]=t;return{a:e,b:o,c:r,d:i,e:n,f:a}}}let o=t.match(/^matrix3d\(([^)]+)\)$/);if(o){let t=o[1].split(",").map(Number);if(16===t.length&&t.every(Number.isFinite))return{a:t[0],b:t[1],c:t[4],d:t[5],e:t[12],f:t[13]}}return P}function O(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function z(t){let e=getComputedStyle(t),o=e.rotate.trim().split(/\s+/).at(-1)??"0",r=I(Number.parseFloat(o)||0),[i="1",n=i]=e.scale.trim().split(/\s+/);return{...W(r,W(B(H(i),H(n)),D(e.transform))),e:0,f:0}}function Q(e){let o=P,i=e.assignedSlot??r(e);for(;i;)t(i)&&(o=W(z(i),o)),i=i.assignedSlot??r(i);return o}function G(t){let e=W(Q(t),z(t));return(t.currentCSSZoom||1)*Math.hypot(e.c,e.d)}function V(t,e,o){let r=(r,i)=>({x:t.x+(e.x*r+o.x*i)/2,y:t.y+(e.y*r+o.y*i)/2});return{topLeft:r(-1,-1),topRight:r(1,-1),bottomRight:r(1,1),bottomLeft:r(-1,1)}}function Z(e){let o=Array.from(e.getClientRects()).filter(t=>t.width>0&&t.height>0);if(o.length>1)return o.map(t=>{let o=k(t),r=A(o,e.ownerDocument);return ht(r,et(X(e,o),o,r))}).join(" ");let r=F(e),i=t(e)?tt(e,r):Y(r),n=V({x:0,y:0},{x:i.width,y:0},{x:0,y:i.height}),a=r;if(!e.getBoxQuads&&t(e)){let t=W(Q(e),z(e));if(0!==t.b||0!==t.c||t.a<0||t.d<0){let o=e.currentCSSZoom||1;a=V(lt(r),{x:t.a*i.width*o,y:t.b*i.width*o},{x:t.c*i.height*o,y:t.d*i.height*o})}}let h=A(a,e.ownerDocument);return ht(h,et(X(e,n),n,h))}function K(t,e){let[o]=t.getBoxQuads?.({box:"border"})??[];if(o)return F(t);let r=getComputedStyle(t),{width:i,height:n}=tt(t,e);if(i<=0||n<=0)return F(t);let[a="0",h="0"]=r.translate.trim().split(/\s+/),l=j(E(a,i),E(h,n)),f=r.rotate.trim().split(/\s+/).at(-1)??"0",u=I(Number.parseFloat(f)||0),[s="1",p=s]=r.scale.trim().split(/\s+/),m=B(H(s),H(p)),y=D(r.transform),[g="50%",x="50%"]=r.transformOrigin.trim().split(/\s+/),b={x:E(g,i),y:E(x,n)},d=W(j(b.x,b.y),W(u,W(m,W(y,j(-b.x,-b.y))))),c=W(l,d),R=(e.topRight.x-e.topLeft.x)/i,L=(e.topRight.y-e.topLeft.y)/i,w=(e.bottomLeft.x-e.topLeft.x)/n,M=(e.bottomLeft.y-e.topLeft.y)/n,v=t=>{let o=O(c,t);return{x:e.topLeft.x+R*o.x+w*o.y,y:e.topLeft.y+L*o.x+M*o.y}};return{topLeft:v({x:0,y:0}),topRight:v({x:i,y:0}),bottomRight:v({x:i,y:n}),bottomLeft:v({x:0,y:n})}}function q(t){return K(t,J(t))}function J(t){let e=$.map(e=>({property:e,value:t.style.getPropertyValue(e),priority:t.style.getPropertyPriority(e)}));try{t.style.setProperty("transition","none","important");for(let e of $)"transition"!==e&&t.style.setProperty(e,"none","important");let[e]=t.getBoxQuads?.({box:"border"})??[],o=F(t);return e?o:function(t,e){let{width:o,height:r}=tt(t,e);if(o<=0||r<=0)return e;let i=Q(t);if(0===i.b&&0===i.c&&i.a>0&&i.d>0)return e;let n=t.currentCSSZoom||1,a=O(i,{x:o*n,y:0}),h=O(i,{x:0,y:r*n});return V(lt(e),a,h)}(t,o)}finally{for(let{property:o,value:r,priority:i}of e.filter(({property:t})=>"transition"!==t))r?t.style.setProperty(o,r,i):t.style.removeProperty(o);let o=e.find(({property:t})=>"transition"===t);o&&(t.ownerDocument.defaultView?.getComputedStyle(t).transitionProperty,o.value?t.style.setProperty(o.property,o.value,o.priority):t.style.removeProperty(o.property))}}function U(t,e,o=1){return["topLeft","topRight","bottomRight","bottomLeft"].some(r=>Math.hypot(t[r].x-e[r].x,t[r].y-e[r].y)>o)}function _(t,e,o){let[r="0",i=r]=t.trim().split(/\s+/),n=(t,e)=>{let o=Number.parseFloat(t);return Number.isFinite(o)?t.endsWith("%")?o/100*e:o:0};return{x:n(r,e),y:n(i,o)}}function X(t,e){let o=getComputedStyle(t),r=(Math.hypot(e.topRight.x-e.topLeft.x,e.topRight.y-e.topLeft.y)+Math.hypot(e.bottomRight.x-e.bottomLeft.x,e.bottomRight.y-e.bottomLeft.y))/2,i=(Math.hypot(e.bottomLeft.x-e.topLeft.x,e.bottomLeft.y-e.topLeft.y)+Math.hypot(e.bottomRight.x-e.topRight.x,e.bottomRight.y-e.topRight.y))/2;return{topLeft:_(o.borderTopLeftRadius,r,i),topRight:_(o.borderTopRightRadius,r,i),bottomRight:_(o.borderBottomRightRadius,r,i),bottomLeft:_(o.borderBottomLeftRadius,r,i)}}function Y(t){return{width:(Math.hypot(t.topRight.x-t.topLeft.x,t.topRight.y-t.topLeft.y)+Math.hypot(t.bottomRight.x-t.bottomLeft.x,t.bottomRight.y-t.bottomLeft.y))/2,height:(Math.hypot(t.bottomLeft.x-t.topLeft.x,t.bottomLeft.y-t.topLeft.y)+Math.hypot(t.bottomRight.x-t.topRight.x,t.bottomRight.y-t.topRight.y))/2}}function tt(t,e){let o=Y(e);if("offsetWidth"in t)return{width:t.offsetWidth||o.width,height:t.offsetHeight||o.height};let r=getComputedStyle(t),i=Number.parseFloat(r.width),n=Number.parseFloat(r.height);return{width:Number.isFinite(i)&&i>0?i:o.width,height:Number.isFinite(n)&&n>0?n:o.height}}function et(t,e,o){let r=Y(e),i=Y(o),n=r.width>0?i.width/r.width:1,a=r.height>0?i.height/r.height:1;return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,{x:e.x*n,y:e.y*a}]))}function ot(t){let e=getComputedStyle(t);return(!e.backgroundImage||"none"===e.backgroundImage)&&function(t){let e=t.trim().toLowerCase();if(!e||"transparent"===e)return 0;if(e.match(/^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/))return 5===e.length?Number.parseInt(e.at(-1).repeat(2),16)/255:9===e.length?Number.parseInt(e.slice(-2),16)/255:1;let o=e.match(/\/\s*([\d.]+%?)\s*\)$/);if(o){let t=Number.parseFloat(o[1]);return o[1].endsWith("%")?t/100:t}let r=e.match(/^rgba\([^,]+,[^,]+,[^,]+,\s*([\d.]+%?)\s*\)$/);if(r){let t=Number.parseFloat(r[1]);return r[1].endsWith("%")?t/100:t}return 1}(e.backgroundColor)>=.999}function rt(t,e,o){let r=e.x-t.x,i=e.y-t.y,n=Math.max(1,Math.hypot(r,i));return{x:t.x+r/n*o,y:t.y+i/n*o}}function it(t,e){let o=(t,e)=>Math.hypot(e.x-t.x,e.y-t.y),r=[[o(t.topLeft,t.topRight),e.topLeft.x+e.topRight.x],[o(t.topRight,t.bottomRight),e.topRight.y+e.bottomRight.y],[o(t.bottomRight,t.bottomLeft),e.bottomRight.x+e.bottomLeft.x],[o(t.bottomLeft,t.topLeft),e.bottomLeft.y+e.topLeft.y]];return Math.min(1,...r.map(([t,e])=>e>0?t/e:1))}function nt(t){return{topLeft:[t.topLeft.y,t.topLeft.x],topRight:[t.topRight.x,t.topRight.y],bottomRight:[t.bottomRight.y,t.bottomRight.x],bottomLeft:[t.bottomLeft.x,t.bottomLeft.y]}}function at(t,e){let o=["topLeft","topRight","bottomRight","bottomLeft"],r=nt(e),i=it(t,e),n=1-Math.SQRT1_2;return Object.fromEntries(o.map((e,a)=>{let h=t[e],l=t[o[(a+o.length-1)%o.length]],f=t[o[(a+1)%o.length]],[u,s]=r[e],p=rt(h,l,u*i*n),m=rt(h,f,s*i*n);return[e,{x:p.x+m.x-h.x,y:p.y+m.y-h.y}]}))}function ht(t,e){let o=.5522847498,r=["topLeft","topRight","bottomRight","bottomLeft"],i=nt(e),n=it(t,e),a=r.map((e,a)=>{let h=t[e],l=r[(a+r.length-1)%r.length],f=r[(a+1)%r.length],u=t[l],s=t[f],[p,m]=i[e],y=p*n,g=m*n,x=rt(h,u,y),b=rt(h,s,g);return{entry:x,exit:b,entryControl:rt(x,h,y*o),exitControl:rt(b,h,g*o)}}),h=a[0],l=[`M ${h.exit.x} ${h.exit.y}`];for(let t=1;t<=a.length;t+=1){let e=a[t%a.length];l.push(`L ${e.entry.x} ${e.entry.y}`),l.push(`C ${e.entryControl.x} ${e.entryControl.y} ${e.exitControl.x} ${e.exitControl.y} ${e.exit.x} ${e.exit.y}`)}return l.push("Z"),l.join(" ")}function lt(t){return{x:(t.topLeft.x+t.topRight.x+t.bottomRight.x+t.bottomLeft.x)/4,y:(t.topLeft.y+t.topRight.y+t.bottomRight.y+t.bottomLeft.y)/4}}function ft(t,e=28,o="top"){let[r,i]="top"===o?[t.topLeft,t.topRight]:"right"===o?[t.topRight,t.bottomRight]:"bottom"===o?[t.bottomRight,t.bottomLeft]:[t.bottomLeft,t.topLeft],n={x:(r.x+i.x)/2,y:(r.y+i.y)/2},a=i.x-r.x,h=i.y-r.y,l=Math.max(1,Math.hypot(a,h));return{edge:n,handle:{x:n.x+h/l*e,y:n.y-a/l*e}}}function ut(t,e){let o=ft(t);return o.handle.y>=e/2?{...o,side:"top"}:{...ft(t,28,"bottom"),side:"bottom"}}function st(t,e,o){let r=o.x-e.x,i=o.y-e.y,n=r*r+i*i;if(0===n)return Math.hypot(t.x-e.x,t.y-e.y);let a=Math.max(0,Math.min(1,((t.x-e.x)*r+(t.y-e.y)*i)/n));return Math.hypot(t.x-(e.x+a*r),t.y-(e.y+a*i))}var pt=["top","right","bottom","left"];function mt(t,e,o,r={}){let i=pt.map(o=>({...ft(t,28,o),side:o,distance:st(e,"top"===o?t.topLeft:"right"===o?t.topRight:"bottom"===o?t.bottomRight:t.bottomLeft,"top"===o?t.topRight:"right"===o?t.bottomRight:"bottom"===o?t.bottomLeft:t.topLeft)})),n=r.viewport?i.filter(({handle:t})=>function(t,e,o){let r=e/2;return t.x>=r&&t.x<=o.width-r&&t.y>=r&&t.y<=o.height-r}(t,o,r.viewport)):i,a=n.length>0?n:i,h=a.reduce((t,e)=>e.distance<t.distance?e:t),l=r.currentSide?a.find(({side:t})=>t===r.currentSide):void 0,f=l&&l.distance<=h.distance+(r.hysteresis??8)?l:h;return{edge:f.edge,handle:f.handle,side:f.side}}function yt(t,e,o){let r=e,i=o,n=[t.topLeft,t.topRight,t.bottomRight,t.bottomLeft],a=!1,h=!1;for(let t=0;t<n.length;t+=1){let e=n[t],o=n[(t+1)%n.length],l=(o.x-e.x)*(i-e.y)-(o.y-e.y)*(r-e.x);if(l>.001&&(a=!0),l<-.001&&(h=!0),a&&h)return!1}return!0}function gt(t,e,o,r){let i={x:e,y:o},n=[t.topLeft,t.topRight,t.bottomRight,t.bottomLeft],a=r/2;if(n.some(t=>Math.hypot(e-t.x,o-t.y)<=a)||[[t.topLeft,t.topRight],[t.topRight,t.bottomRight],[t.bottomRight,t.bottomLeft],[t.bottomLeft,t.topLeft]].some(([t,e])=>st(i,t,e)<=6))return!0;let h=mt(t,i,r);return st(i,h.edge,h.handle)<=r/2}function xt(t,e,o,r){let i={x:e,y:o},n=mt(t,i,r);return st(i,n.edge,n.handle)<=1.5*r}function bt(t){let e=Math.max(1,Math.hypot(t.x,t.y));return{x:t.x/e,y:t.y/e}}function dt(t,e){let o=lt(t);return bt({x:t[e].x-o.x,y:t[e].y-o.y})}function ct(t,e){let o=lt(t),{handle:r}=ft(t,28,e),i=bt({x:r.x-o.x,y:r.y-o.y});return{x:-i.y,y:i.x}}function Rt(t,e){if(!e||0===t.x&&0===t.y)return t;let o=Math.PI/4,r=Math.atan2(t.y,t.x),i=Math.round(r/o)*o,n=Math.hypot(t.x,t.y);return{x:Math.cos(i)*n,y:Math.sin(i)*n}}function Lt(t,e,o=8){return Math.hypot(e.x-t.x,e.y-t.y)<=o}function wt(t){if(!t||"none"===t)return{x:0,y:0};let[e="0",o="0"]=t.trim().split(/\s+/);return{x:Number.parseFloat(e)||0,y:Number.parseFloat(o)||0}}function Mt(t,o){let r=t.ownerDocument.createElementNS("http://www.w3.org/2000/svg","svg"),{x:i,y:n,width:a,height:h}=e(t);return r.setAttribute("viewBox",[i,n,a,h].join(" ")),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("aria-hidden","true"),r.setAttribute("data-devtools",o),r.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:hidden;pointer-events:none",r}function vt(t,e,o,r,i){if(!t.closest("[data-popmelt-hover-painter]"))return;let n=new AbortController,h=new CustomEvent("popmelt:paint-annotation",{bubbles:!0,cancelable:!0,detail:{signal:n.signal,setHitArea:i,createOverlay(t,i){let n=Mt(i,"painted-annotation"),h=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");return h.setAttribute("d",Z(t)),h.setAttribute("fill",o?e:"none"),h.setAttribute("fill-opacity",String(o)),h.setAttribute("stroke",e),h.setAttribute("stroke-width",String(1)),h.setAttribute("vector-effect","non-scaling-stroke"),h.setAttribute("stroke-linejoin","round"),"solid"!==r&&h.setAttribute("stroke-dasharray",a),"marching"===r&&h.setAttribute("data-popmelt-marching-stroke","true"),n.append(h),n}}});if(!t.dispatchEvent(h))return n;n.abort()}export{Z as A,K as B,q as C,J as D,U as E,X as F,et as G,ot as H,at as I,ht as J,lt as K,ft as L,ut as M,mt as N,yt as O,gt as P,xt as Q,dt as R,ct as S,Rt as T,Lt as U,wt as V,Mt as W,vt as X,n as a,a as b,h as c,f as d,u as e,s as f,p as g,m as h,y as i,g as j,x as k,b as l,d as m,c as n,R as o,L as p,w as q,M as r,v as s,S as t,C as u,N as v,A as w,T as x,F as y,G as z};
|
|
1
|
+
"use client";import{c as t}from"./chunk-WP2SHSCG.mjs";import{d as e,c as o,m as r}from"./chunk-LH7HKUCK.mjs";import{b as i}from"./chunk-BH5BNULT.mjs";var n=[4,2],a=n.join(" "),h=n[0]+n[1];function l(t){return"bottom-left"===t?[2,8,8,8]:"bottom-right"===t?[8,2,8,8]:"top-right"===t?[8,8,2,8]:[8,8,8,2]}function f(t){return l(t).map(t=>`${t}px`).join(" ")}var u=1.1666666666666667;function s(t){return t.length>2048?`${t.slice(0,2048)}…`:t}function p(t,e,o){return e.flatMap(e=>function(t,e,o){let r=s(e);if(!r||t.measureText(r).width<=o)return[r];let i=r.split(/\s+/),n=[],a="";for(let e of i){let r=a?`${a} ${e}`:e;a&&t.measureText(r).width>o?(n.push(a),a=e):a=r}return a&&n.push(a),n.length>0?n:[r]}(t,e,o))}var m=i,y=16;function g(t){let e=window.innerWidth-t-16;return Math.max(60,Math.min(400,e))}function x(t,e,o){let r=s(e);if(r===e&&t.measureText(r).width<=o)return r;let i="…",n=0,a=r.endsWith(i)?r.length-1:r.length;for(;n<a;){let e=Math.ceil((n+a)/2);t.measureText(r.slice(0,e)+i).width<=o?n=e:a=e-1}return n>0?r.slice(0,n)+i:i}function b(t,e,o,r,i){let n=0,a=typeof window<"u"?window.innerHeight:9999;o&&function(t,e,o){if(void 0===t||void 0===e||void 0===o.avoidLeft&&void 0===o.avoidRight)return!0;let r=typeof window<"u"?window.innerWidth:9999,i=o.avoidLeft??0,n=o.avoidRight??r;return t+e>i&&t<n}(r,i,o)&&(n=o.avoidTop??n,a=o.avoidBottom??a);let h=Math.max(n,a-e);return Math.max(n,Math.min(t,h))}function d(t,e=12,o,r){let i=e*u+8,n=t.y-4,a=b(n,i,o,t.x-8,r);return a===n?t:{...t,y:a+4}}function c(t,e,o,r,i=12,n,a,h,f="#dddddd",s,p=!1){if(!o)return;let y=i*u,g=o.replace(/\n/g," "),b=void 0!==n?n+". "+g:g;t.font=`${i}px ${m}`,t.textBaseline="middle";let c=void 0!==a?Math.min(400,Math.max(60,window.innerWidth-a-16)):400,L=p?16:0,R=x(t,b,Math.max(60,c-L)),w=L+t.measureText(R).width,M=d(e,i,h,w+16);t.fillStyle=r;let v=M.x-8,S=M.y-4,C=w+16,N=y+8;t.beginPath(),t.roundRect(v,S,C,N,l(s)),t.fill();let A=M.y+y/2;if(p){let e=M.x,o=A-6;t.strokeStyle=f,t.lineWidth=1.5,t.lineCap="round",t.lineJoin="round",t.beginPath(),t.moveTo(e+7.5,o+4),t.lineTo(e+10.5,o+6.5),t.lineTo(e+7.5,o+9),t.moveTo(e+1.5,o+1.5),t.lineTo(e+1.5,o+4.5),t.quadraticCurveTo(e+1.5,o+6.5,e+3.5,o+6.5),t.lineTo(e+10.5,o+6.5),t.stroke()}t.fillStyle=f,t.fillText(R,M.x+L,A)}function L(t=22){return{height:t,minHeight:t,maxHeight:t,boxSizing:"border-box",flexShrink:0}}function R(t){let e=t.startsWith("top-");return{top:e?4:12,right:4,bottom:e?12:4,left:4}}function w({hasCommentEntry:t,stagedChangeCount:e}){return t&&0===e?2:6}function M({annotationNumber:t,stickerCount:e,interactionEpisodeStepCount:o,hasStatus:r,hasSend:i,controlGap:n}){let a=16+7.2*Math.max(1,void 0===t?0:String(t).length),h=28*e-2*Math.max(0,e-1),l=o>0?32+7.2*String(o).length:0,f=[e>0?e>0?h+(l>0?l-2:0)+(i?26:0):0:0,0===e?l:0,0===e&&i?28:0,r?28:0].filter(t=>t>0);return a+f.reduce((t,e)=>t+e,0)+f.length*n}function v(t,e,o){let r="right"===t.horizontalAlignment?t.left-e:t.left;return{left:r,top:t.top,right:r+e,bottom:t.top+o}}function S(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}function C(t,e,o,r,i,n){let a=n-4,h=(t,o,r)=>Math.max(t,Math.min(e,o-r)),l=h(4,a,o);if(!i.some(t=>l<t.right&&l+o>t.left))return;let f=null;function u(i,n){if(t.left>=n||t.left+t.width<=i)return;let a=Math.max(i,t.left),l=n-a>=r,u=Math.min(o,Math.floor(n-(l?a:i)));if(u<r||u<=0)return;let s=l?a:h(i,n,u);(!f||u>f.width||u===f.width&&Math.abs(s-e)<Math.abs(f.left-e))&&(f={left:s,width:u})}let s=4;for(let t of[...i].sort((t,e)=>t.left-e.left))u(s,Math.min(a,t.left-2)),s=Math.max(s,t.right+2);return u(s,a),f}function N(t,e,o,r,i=0,n=Number.POSITIVE_INFINITY){let a=t.top>=e+o,h=t.bottom+o+e<=r;if(t.height>=r&&!a&&!h){let o=t.top<0&&t.bottom<=r;return{anchor:o?"bottom-left":"top-left",horizontalAlignment:"left",left:t.left+8,top:o?t.bottom-e-8:t.top+8}}let l=function(t,e,o){let r=Math.max(0,t.left+e-o);return Math.max(0,e-t.right)<r?"right":"left"}(t,i,n);return a?{anchor:"right"===l?"top-right":"top-left",horizontalAlignment:l,left:"right"===l?t.right:t.left,top:t.top-e-o}:{anchor:"right"===l?"bottom-right":"bottom-left",horizontalAlignment:l,left:"right"===l?t.right:t.left,top:t.bottom+o}}function A(t,e){let r=({x:t,y:r})=>{let i=o({left:t,top:r,width:0,height:0},e);return{x:i.left,y:i.top}};return{topLeft:r(t.topLeft),topRight:r(t.topRight),bottomRight:r(t.bottomRight),bottomLeft:r(t.bottomLeft)}}var T=12,$=["transition","transform","translate","rotate","scale"];function F(t){let[e]=t.getBoxQuads?.({box:"border"})??[];return e?{topLeft:{x:e.p1.x,y:e.p1.y},topRight:{x:e.p2.x,y:e.p2.y},bottomRight:{x:e.p3.x,y:e.p3.y},bottomLeft:{x:e.p4.x,y:e.p4.y}}:k(t.getBoundingClientRect())}function k(t){return{topLeft:{x:t.left,y:t.top},topRight:{x:t.right,y:t.top},bottomRight:{x:t.right,y:t.bottom},bottomLeft:{x:t.left,y:t.bottom}}}var P={a:1,b:0,c:0,d:1,e:0,f:0};function W(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function j(t,e){return{...P,e:t,f:e}}function B(t){let e=t*Math.PI/180,o=Math.cos(e),r=Math.sin(e);return{a:o,b:r,c:-r,d:o,e:0,f:0}}function I(t,e){return{a:t,b:0,c:0,d:e,e:0,f:0}}function E(t,e){if(!t)return 0;let o=Number.parseFloat(t);return Number.isFinite(o)?t.endsWith("%")?o/100*e:o:0}function H(t){if(!t)return 1;let e=Number.parseFloat(t);return Number.isFinite(e)?t.endsWith("%")?e/100:e:1}function O(t){if(!t||"none"===t)return P;let e=t.match(/^matrix\(([^)]+)\)$/);if(e){let t=e[1].split(",").map(Number);if(6===t.length&&t.every(Number.isFinite)){let[e,o,r,i,n,a]=t;return{a:e,b:o,c:r,d:i,e:n,f:a}}}let o=t.match(/^matrix3d\(([^)]+)\)$/);if(o){let t=o[1].split(",").map(Number);if(16===t.length&&t.every(Number.isFinite))return{a:t[0],b:t[1],c:t[4],d:t[5],e:t[12],f:t[13]}}return P}function z(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function D(t){let e=getComputedStyle(t),o=e.rotate.trim().split(/\s+/).at(-1)??"0",r=B(Number.parseFloat(o)||0),[i="1",n=i]=e.scale.trim().split(/\s+/);return{...W(r,W(I(H(i),H(n)),O(e.transform))),e:0,f:0}}function Q(e){let o=P,i=e.assignedSlot??r(e);for(;i;)t(i)&&(o=W(D(i),o)),i=i.assignedSlot??r(i);return o}function V(t){let e=W(Q(t),D(t));return(t.currentCSSZoom||1)*Math.hypot(e.c,e.d)}function Z(t,e,o){let r=(r,i)=>({x:t.x+(e.x*r+o.x*i)/2,y:t.y+(e.y*r+o.y*i)/2});return{topLeft:r(-1,-1),topRight:r(1,-1),bottomRight:r(1,1),bottomLeft:r(-1,1)}}function G(e){let o=Array.from(e.getClientRects()).filter(t=>t.width>0&&t.height>0);if(o.length>1)return o.map(t=>{let o=k(t),r=A(o,e.ownerDocument);return ht(r,et(X(e,o),o,r))}).join(" ");let r=F(e),i=t(e)?tt(e,r):Y(r),n=Z({x:0,y:0},{x:i.width,y:0},{x:0,y:i.height}),a=r;if(!e.getBoxQuads&&t(e)){let t=W(Q(e),D(e));if(0!==t.b||0!==t.c||t.a<0||t.d<0){let o=e.currentCSSZoom||1;a=Z(lt(r),{x:t.a*i.width*o,y:t.b*i.width*o},{x:t.c*i.height*o,y:t.d*i.height*o})}}let h=A(a,e.ownerDocument);return ht(h,et(X(e,n),n,h))}function K(t,e){let[o]=t.getBoxQuads?.({box:"border"})??[];if(o)return F(t);let r=getComputedStyle(t),{width:i,height:n}=tt(t,e);if(i<=0||n<=0)return F(t);let[a="0",h="0"]=r.translate.trim().split(/\s+/),l=j(E(a,i),E(h,n)),f=r.rotate.trim().split(/\s+/).at(-1)??"0",u=B(Number.parseFloat(f)||0),[s="1",p=s]=r.scale.trim().split(/\s+/),m=I(H(s),H(p)),y=O(r.transform),[g="50%",x="50%"]=r.transformOrigin.trim().split(/\s+/),b={x:E(g,i),y:E(x,n)},d=W(j(b.x,b.y),W(u,W(m,W(y,j(-b.x,-b.y))))),c=W(l,d),L=(e.topRight.x-e.topLeft.x)/i,R=(e.topRight.y-e.topLeft.y)/i,w=(e.bottomLeft.x-e.topLeft.x)/n,M=(e.bottomLeft.y-e.topLeft.y)/n,v=t=>{let o=z(c,t);return{x:e.topLeft.x+L*o.x+w*o.y,y:e.topLeft.y+R*o.x+M*o.y}};return{topLeft:v({x:0,y:0}),topRight:v({x:i,y:0}),bottomRight:v({x:i,y:n}),bottomLeft:v({x:0,y:n})}}function U(t){return K(t,q(t))}function q(t){let e=$.map(e=>({property:e,value:t.style.getPropertyValue(e),priority:t.style.getPropertyPriority(e)}));try{t.style.setProperty("transition","none","important");for(let e of $)"transition"!==e&&t.style.setProperty(e,"none","important");let[e]=t.getBoxQuads?.({box:"border"})??[],o=F(t);return e?o:function(t,e){let{width:o,height:r}=tt(t,e);if(o<=0||r<=0)return e;let i=Q(t);if(0===i.b&&0===i.c&&i.a>0&&i.d>0)return e;let n=t.currentCSSZoom||1,a=z(i,{x:o*n,y:0}),h=z(i,{x:0,y:r*n});return Z(lt(e),a,h)}(t,o)}finally{for(let{property:o,value:r,priority:i}of e.filter(({property:t})=>"transition"!==t))r?t.style.setProperty(o,r,i):t.style.removeProperty(o);let o=e.find(({property:t})=>"transition"===t);o&&(t.ownerDocument.defaultView?.getComputedStyle(t).transitionProperty,o.value?t.style.setProperty(o.property,o.value,o.priority):t.style.removeProperty(o.property))}}function J(t,e,o=1){return["topLeft","topRight","bottomRight","bottomLeft"].some(r=>Math.hypot(t[r].x-e[r].x,t[r].y-e[r].y)>o)}function _(t,e,o){let[r="0",i=r]=t.trim().split(/\s+/),n=(t,e)=>{let o=Number.parseFloat(t);return Number.isFinite(o)?t.endsWith("%")?o/100*e:o:0};return{x:n(r,e),y:n(i,o)}}function X(t,e){let o=getComputedStyle(t),r=(Math.hypot(e.topRight.x-e.topLeft.x,e.topRight.y-e.topLeft.y)+Math.hypot(e.bottomRight.x-e.bottomLeft.x,e.bottomRight.y-e.bottomLeft.y))/2,i=(Math.hypot(e.bottomLeft.x-e.topLeft.x,e.bottomLeft.y-e.topLeft.y)+Math.hypot(e.bottomRight.x-e.topRight.x,e.bottomRight.y-e.topRight.y))/2;return{topLeft:_(o.borderTopLeftRadius,r,i),topRight:_(o.borderTopRightRadius,r,i),bottomRight:_(o.borderBottomRightRadius,r,i),bottomLeft:_(o.borderBottomLeftRadius,r,i)}}function Y(t){return{width:(Math.hypot(t.topRight.x-t.topLeft.x,t.topRight.y-t.topLeft.y)+Math.hypot(t.bottomRight.x-t.bottomLeft.x,t.bottomRight.y-t.bottomLeft.y))/2,height:(Math.hypot(t.bottomLeft.x-t.topLeft.x,t.bottomLeft.y-t.topLeft.y)+Math.hypot(t.bottomRight.x-t.topRight.x,t.bottomRight.y-t.topRight.y))/2}}function tt(t,e){let o=Y(e);if("offsetWidth"in t)return{width:t.offsetWidth||o.width,height:t.offsetHeight||o.height};let r=getComputedStyle(t),i=Number.parseFloat(r.width),n=Number.parseFloat(r.height);return{width:Number.isFinite(i)&&i>0?i:o.width,height:Number.isFinite(n)&&n>0?n:o.height}}function et(t,e,o){let r=Y(e),i=Y(o),n=r.width>0?i.width/r.width:1,a=r.height>0?i.height/r.height:1;return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,{x:e.x*n,y:e.y*a}]))}function ot(t){let e=getComputedStyle(t);return(!e.backgroundImage||"none"===e.backgroundImage)&&function(t){let e=t.trim().toLowerCase();if(!e||"transparent"===e)return 0;if(e.match(/^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/))return 5===e.length?Number.parseInt(e.at(-1).repeat(2),16)/255:9===e.length?Number.parseInt(e.slice(-2),16)/255:1;let o=e.match(/\/\s*([\d.]+%?)\s*\)$/);if(o){let t=Number.parseFloat(o[1]);return o[1].endsWith("%")?t/100:t}let r=e.match(/^rgba\([^,]+,[^,]+,[^,]+,\s*([\d.]+%?)\s*\)$/);if(r){let t=Number.parseFloat(r[1]);return r[1].endsWith("%")?t/100:t}return 1}(e.backgroundColor)>=.999}function rt(t,e,o){let r=e.x-t.x,i=e.y-t.y,n=Math.max(1,Math.hypot(r,i));return{x:t.x+r/n*o,y:t.y+i/n*o}}function it(t,e){let o=(t,e)=>Math.hypot(e.x-t.x,e.y-t.y),r=[[o(t.topLeft,t.topRight),e.topLeft.x+e.topRight.x],[o(t.topRight,t.bottomRight),e.topRight.y+e.bottomRight.y],[o(t.bottomRight,t.bottomLeft),e.bottomRight.x+e.bottomLeft.x],[o(t.bottomLeft,t.topLeft),e.bottomLeft.y+e.topLeft.y]];return Math.min(1,...r.map(([t,e])=>e>0?t/e:1))}function nt(t){return{topLeft:[t.topLeft.y,t.topLeft.x],topRight:[t.topRight.x,t.topRight.y],bottomRight:[t.bottomRight.y,t.bottomRight.x],bottomLeft:[t.bottomLeft.x,t.bottomLeft.y]}}function at(t,e){let o=["topLeft","topRight","bottomRight","bottomLeft"],r=nt(e),i=it(t,e),n=1-Math.SQRT1_2;return Object.fromEntries(o.map((e,a)=>{let h=t[e],l=t[o[(a+o.length-1)%o.length]],f=t[o[(a+1)%o.length]],[u,s]=r[e],p=rt(h,l,u*i*n),m=rt(h,f,s*i*n);return[e,{x:p.x+m.x-h.x,y:p.y+m.y-h.y}]}))}function ht(t,e){let o=.5522847498,r=["topLeft","topRight","bottomRight","bottomLeft"],i=nt(e),n=it(t,e),a=r.map((e,a)=>{let h=t[e],l=r[(a+r.length-1)%r.length],f=r[(a+1)%r.length],u=t[l],s=t[f],[p,m]=i[e],y=p*n,g=m*n,x=rt(h,u,y),b=rt(h,s,g);return{entry:x,exit:b,entryControl:rt(x,h,y*o),exitControl:rt(b,h,g*o)}}),h=a[0],l=[`M ${h.exit.x} ${h.exit.y}`];for(let t=1;t<=a.length;t+=1){let e=a[t%a.length];l.push(`L ${e.entry.x} ${e.entry.y}`),l.push(`C ${e.entryControl.x} ${e.entryControl.y} ${e.exitControl.x} ${e.exitControl.y} ${e.exit.x} ${e.exit.y}`)}return l.push("Z"),l.join(" ")}function lt(t){return{x:(t.topLeft.x+t.topRight.x+t.bottomRight.x+t.bottomLeft.x)/4,y:(t.topLeft.y+t.topRight.y+t.bottomRight.y+t.bottomLeft.y)/4}}function ft(t,e=28,o="top"){let[r,i]="top"===o?[t.topLeft,t.topRight]:"right"===o?[t.topRight,t.bottomRight]:"bottom"===o?[t.bottomRight,t.bottomLeft]:[t.bottomLeft,t.topLeft],n={x:(r.x+i.x)/2,y:(r.y+i.y)/2},a=i.x-r.x,h=i.y-r.y,l=Math.max(1,Math.hypot(a,h));return{edge:n,handle:{x:n.x+h/l*e,y:n.y-a/l*e}}}function ut(t,e){let o=ft(t);return o.handle.y>=e/2?{...o,side:"top"}:{...ft(t,28,"bottom"),side:"bottom"}}function st(t,e,o){let r=o.x-e.x,i=o.y-e.y,n=r*r+i*i;if(0===n)return Math.hypot(t.x-e.x,t.y-e.y);let a=Math.max(0,Math.min(1,((t.x-e.x)*r+(t.y-e.y)*i)/n));return Math.hypot(t.x-(e.x+a*r),t.y-(e.y+a*i))}var pt=["top","right","bottom","left"];function mt(t,e,o,r={}){let i=pt.map(o=>({...ft(t,28,o),side:o,distance:st(e,"top"===o?t.topLeft:"right"===o?t.topRight:"bottom"===o?t.bottomRight:t.bottomLeft,"top"===o?t.topRight:"right"===o?t.bottomRight:"bottom"===o?t.bottomLeft:t.topLeft)})),n=r.viewport?i.filter(({handle:t})=>function(t,e,o){let r=e/2;return t.x>=r&&t.x<=o.width-r&&t.y>=r&&t.y<=o.height-r}(t,o,r.viewport)):i,a=n.length>0?n:i,h=a.reduce((t,e)=>e.distance<t.distance?e:t),l=r.currentSide?a.find(({side:t})=>t===r.currentSide):void 0,f=l&&l.distance<=h.distance+(r.hysteresis??8)?l:h;return{edge:f.edge,handle:f.handle,side:f.side}}function yt(t,e,o){let r=e,i=o,n=[t.topLeft,t.topRight,t.bottomRight,t.bottomLeft],a=!1,h=!1;for(let t=0;t<n.length;t+=1){let e=n[t],o=n[(t+1)%n.length],l=(o.x-e.x)*(i-e.y)-(o.y-e.y)*(r-e.x);if(l>.001&&(a=!0),l<-.001&&(h=!0),a&&h)return!1}return!0}function gt(t,e,o,r){let i={x:e,y:o},n=[t.topLeft,t.topRight,t.bottomRight,t.bottomLeft],a=r/2;if(n.some(t=>Math.hypot(e-t.x,o-t.y)<=a)||[[t.topLeft,t.topRight],[t.topRight,t.bottomRight],[t.bottomRight,t.bottomLeft],[t.bottomLeft,t.topLeft]].some(([t,e])=>st(i,t,e)<=6))return!0;let h=mt(t,i,r);return st(i,h.edge,h.handle)<=r/2}function xt(t,e,o,r){let i={x:e,y:o},n=mt(t,i,r);return st(i,n.edge,n.handle)<=1.5*r}function bt(t){let e=Math.max(1,Math.hypot(t.x,t.y));return{x:t.x/e,y:t.y/e}}function dt(t,e){let o=lt(t);return bt({x:t[e].x-o.x,y:t[e].y-o.y})}function ct(t,e){let o=lt(t),{handle:r}=ft(t,28,e),i=bt({x:r.x-o.x,y:r.y-o.y});return{x:-i.y,y:i.x}}function Lt(t,e){if(!e||0===t.x&&0===t.y)return t;let o=Math.PI/4,r=Math.atan2(t.y,t.x),i=Math.round(r/o)*o,n=Math.hypot(t.x,t.y);return{x:Math.cos(i)*n,y:Math.sin(i)*n}}function Rt(t,e,o=8){return Math.hypot(e.x-t.x,e.y-t.y)<=o}function wt(t){if(!t||"none"===t)return{x:0,y:0};let[e="0",o="0"]=t.trim().split(/\s+/);return{x:Number.parseFloat(e)||0,y:Number.parseFloat(o)||0}}function Mt(t,o){let r=t.ownerDocument.createElementNS("http://www.w3.org/2000/svg","svg"),{x:i,y:n,width:a,height:h}=e(t);return r.setAttribute("viewBox",[i,n,a,h].join(" ")),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("aria-hidden","true"),r.setAttribute("data-devtools",o),r.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:hidden;pointer-events:none",r}function vt(t,e,o,r,i){if(!t.closest("[data-popmelt-hover-painter]"))return;let n=new AbortController,h=new CustomEvent("popmelt:paint-annotation",{bubbles:!0,cancelable:!0,detail:{signal:n.signal,setHitArea:i,createOverlay(t,i){let n=Mt(i,"painted-annotation"),h=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");return h.setAttribute("d",G(t)),h.setAttribute("fill",o?e:"none"),h.setAttribute("fill-opacity",String(o)),h.setAttribute("stroke",e),h.setAttribute("stroke-width",String(1)),h.setAttribute("vector-effect","non-scaling-stroke"),h.setAttribute("stroke-linejoin","round"),"solid"!==r&&h.setAttribute("stroke-dasharray",a),"marching"===r&&h.setAttribute("data-popmelt-marching-stroke","true"),n.append(h),n}}});if(!t.dispatchEvent(h))return n;n.abort()}export{G as A,K as B,U as C,q as D,J as E,X as F,et as G,ot as H,at as I,ht as J,lt as K,ft as L,ut as M,mt as N,yt as O,gt as P,xt as Q,dt as R,ct as S,Lt as T,Rt as U,wt as V,Mt as W,vt as X,n as a,a as b,h as c,f as d,u as e,s as f,p as g,m as h,y as i,g as j,x as k,b as l,d as m,c as n,L as o,R as p,w as q,M as r,v as s,S as t,C as u,N as v,A as w,T as x,F as y,V as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-XMCHOGMG.mjs";import{G as t,H as a,n as r}from"./chunk-XNCN6DGG.mjs";import{readFile as o,readdir as s,realpath as n,stat as i}from"fs/promises";import{dirname as c,join as p,parse as l,relative as m,resolve as d,sep as u}from"path";import{getPopmeltProjectId as f}from"./project-id.mjs";async function w(e){return i(e).then(()=>!0,()=>!1)}async function y(e){try{let t=JSON.parse(await o(e,"utf8"));return"@popmelt.com/core"===t.name||["dependencies","devDependencies","peerDependencies"].some(e=>{let a=t[e];return!(!a||"object"!=typeof a||!Object.prototype.hasOwnProperty.call(a,"@popmelt.com/core"))})}catch{return!1}}async function h(e){return n(e).catch(()=>d(e))}async function j(e){let t=new Set;try{let a=await o(p(e,"pnpm-workspace.yaml"),"utf8");for(let r of a.matchAll(/^\s*-\s*['"]?([^'"\r\n]+)['"]?\s*$/gm)){let a=r[1].trim().split(/[*{[]/,1)[0].replace(/\/$/,"");a&&t.add(d(e,a))}}catch{}try{let a=JSON.parse(await o(p(e,"package.json"),"utf8")),r=Array.isArray(a.workspaces)?a.workspaces:a.workspaces?.packages??[];for(let a of r){let r=a.split(/[*{[]/,1)[0].replace(/\/$/,"");r&&t.add(d(e,r))}}catch{}return[...t]}var g=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","vendor"]);async function k(e,t=5){let a=[],r=async(e,o)=>{if(o>t)return;let n;try{n=await s(e,{withFileTypes:!0})}catch{return}n.some(e=>e.isDirectory()&&".popmelt"===e.name)&&a.push(e),await Promise.all(n.flatMap(t=>!t.isDirectory()||".popmelt"===t.name||g.has(t.name)?[]:[r(p(e,t.name),o+1)]))};return await r(e,0),a}function P(e,t){let a=m(e,t);return a?a.split(u).filter(Boolean).length:0}async function I(e=process.cwd()){let a=await h(e),r=a,o=l(r).root,s=new Map,n=(e,t)=>{let a=s.get(e)??new Set;a.add(t),s.set(e,a)},i=[];for(;await w(p(r,".popmelt"))&&n(r,"store"),await w(p(r,".popmelt","ambient.json"))&&n(r,"marker"),await y(p(r,"package.json"))&&n(r,"package"),await y(p(r,"packages","popmelt","package.json"))&&n(r,"workspace_package"),(await j(r)).length&&i.push(r),r!==o;)r=c(r);for(let e of i){let t=await j(e),a=await Promise.all(t.map(e=>k(e)));for(let e of a.flat())n(await h(e),"store")}return(await Promise.all([...s].map(async([e,a])=>{let r=await h(e),o=await t(r),s=[...a].sort();return{root:r,storeId:o.storeId,projectId:f(r),reason:s[0],reasons:s,initialized:a.has("store")}}))).sort((e,t)=>e.initialized!==t.initialized?e.initialized?-1:1:P(a,e.root)-P(a,t.root)||e.root.localeCompare(t.root))}async function b(e=process.cwd()){return(await I(e))[0]??null}function O(){return process.env.POPMELT_EXECUTION_OWNER}function v(){return O()===r}async function N(t){let r=await a(t.root);return{...await e({projectRoot:t.root,detached:!0,manageLease:!1}),storeId:r.storeId}}async function C(e,t,a={}){let r=await fetch(`http://127.0.0.1:${e.port}${t}`,{...a,headers:{"Content-Type":"application/json","X-Popmelt-Project-Id":e.projectId,...a.headers}}),o=await r.json().catch(()=>null);return{response:r,body:o}}export{I as a,b,O as c,v as d,N as e,C as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-TJ25JLBL.mjs";import{a as t}from"./chunk-R565ZNSP.mjs";import{existsSync as r}from"fs";import{realpath as o}from"fs/promises";import{join as a}from"path";import{createRequire as i}from"module";import{pathToFileURL as n}from"url";async function s(e){return await(import(n(i(a(e,"package.json")).resolve("vite")).href))}function m(i,n){if(!r(a(i,"index.html"))||"custom"===n?.config.appType)return;let m,p=!1,c=()=>{m=void 0};return n?.watcher?.on("all",c),n?.httpServer?.once("close",()=>{n?.watcher?.off("all",c)}),async({url:r,document:a,projectId:l})=>{if(!n&&a&&!p&&c(),!m){p=!0;let t=(async()=>{let t=await s(i);return e(t.build,await o(i),"/")})();m=t,t.then(()=>{p=!1},()=>{p=!1,m===t&&c()})}let u;try{u=decodeURIComponent(r.pathname.slice(1))}catch{return}if(/[\\%]/.test(u)||u.split("/").some(e=>e.startsWith(".")||"node_modules"===e))return;let f=await(await m)(u,a,{version:1,projectId:l,url:r.origin+t,revision:"unversioned"});return f?new Response(Buffer.from(f.body),{headers:{"Content-Type":f.type}}):void 0}}export{s as a,m as b};
|