@fungi.computer/prints 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/assets/audio-waveform-CKaaFNjh.js +1 -0
  2. package/dist/assets/audio-waveform-view-CqGGEmLT.js +1 -0
  3. package/dist/assets/button-oE2Hrd5D.js +83 -0
  4. package/dist/assets/computer-Dlwsjq-K.js +1 -0
  5. package/dist/assets/dialog-BXLOuKaF.js +1 -0
  6. package/dist/assets/dist-Cc0qB3Mq.js +1 -0
  7. package/dist/assets/dropdown-menu-Bp_cc0HZ.js +1 -0
  8. package/dist/assets/ellipsis-DlNHenkt.js +1 -0
  9. package/dist/assets/generation-quote-DLlxvJxr.js +2 -0
  10. package/dist/assets/heart-BquDo4lf.js +1 -0
  11. package/dist/assets/images-CQ3EhUoY.js +1 -0
  12. package/dist/assets/index-0YeCF6OC.js +2 -0
  13. package/dist/assets/keycap-D2RkH2IS.js +1 -0
  14. package/dist/assets/library-rail-CA4Qg4FP.js +1266 -0
  15. package/dist/assets/library-view--GUDH_qa.js +1 -0
  16. package/dist/assets/log-event-R2fM9w5a.js +1 -0
  17. package/dist/assets/{print-download-button-CwK9wdo2.js → print-download-button-hClIKKJA.js} +2 -2
  18. package/dist/assets/print-info-drawer-CtimiOWW.js +2 -0
  19. package/dist/assets/print-viewer-APDEs41V.js +2 -0
  20. package/dist/assets/prints-folder-dialog--W4H7Jx6.js +1 -0
  21. package/dist/assets/query-CvXKo0g1.js +1 -0
  22. package/dist/assets/status-DNJRO5m5.js +1 -0
  23. package/dist/assets/textarea-LIOZDOK4.js +1 -0
  24. package/dist/assets/upload-queue-BHAaEiPu.js +1 -0
  25. package/dist/assets/useMutation-RbhZiO3b.js +1 -0
  26. package/dist/assets/useTriggerFocusGuards-Bddw7Qdn.js +1 -0
  27. package/dist/index.html +20 -4
  28. package/package.json +7 -7
  29. package/dist/assets/generation-quote-D7I39kF2.js +0 -2
  30. package/dist/assets/index-C0hNF6s0.js +0 -1267
  31. package/dist/assets/local-images-B-ZLs6V_.js +0 -1
  32. package/dist/assets/log-event-BpFScFqd.js +0 -83
  33. package/dist/assets/print-info-drawer-B1PQWwH2.js +0 -2
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./print-download-button-hClIKKJA.js","./rolldown-runtime-hePW80VL.js","./button-oE2Hrd5D.js","./modules-C4mfDnjH.js","./dist-Cc0qB3Mq.js","./log-event-R2fM9w5a.js","./useMutation-RbhZiO3b.js","./computer-Dlwsjq-K.js","./ellipsis-DlNHenkt.js","./dropdown-menu-Bp_cc0HZ.js","./useTriggerFocusGuards-Bddw7Qdn.js","./keycap-D2RkH2IS.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,Vn as n,bn as r,dn as i,sn as a,wn as o,x as s,yn as c}from"./button-oE2Hrd5D.js";import{At as l}from"./dist-Cc0qB3Mq.js";import{o as u,t as d,u as f}from"./log-event-R2fM9w5a.js";import{i as p,t as m}from"./query-CvXKo0g1.js";import{t as h}from"./useMutation-RbhZiO3b.js";import{D as g,H as _,K as v,O as y,T as b,W as x,a as S,i as C,l as ee,o as w,r as T,s as E,t as te}from"./audio-waveform-CKaaFNjh.js";import{$ as D,C as ne,J as O,K as k,X as A,Y as j,Z as re,et as ie,g as ae,l as oe,m as se,nt as M,r as ce,s as le,tt as ue,v as N}from"./generation-quote-DLlxvJxr.js";import{f as de,m as P,p as fe,u as F}from"./textarea-LIOZDOK4.js";import{a as pe,o as me}from"./status-DNJRO5m5.js";import{n as he,t as ge}from"./heart-BquDo4lf.js";import{t as _e}from"./images-CQ3EhUoY.js";import{n as ve,t as I}from"./keycap-D2RkH2IS.js";var ye=s(`CircleDollarSign`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]),be=s(`Clapperboard`,[[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z`,key:`1tn4o7`}],[`path`,{d:`m6.2 5.3 3.1 3.9`,key:`iuk76l`}],[`path`,{d:`m12.4 3.4 3.1 4`,key:`6hsd6n`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z`,key:`ltgou9`}]]),xe=s(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Se=s(`Eraser`,[[`path`,{d:`m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21`,key:`182aya`}],[`path`,{d:`M22 21H7`,key:`t4ddhn`}],[`path`,{d:`m5 11 9 9`,key:`1mo9qw`}]]),Ce=s(`Link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),we=s(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),Te=s(`Palette`,[[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`path`,{d:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z`,key:`12rzf8`}]]),Ee=s(`Ruler`,[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]),De=s(`Shuffle`,[[`path`,{d:`M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.7-1.1 2-1.7 3.3-1.7H22`,key:`1wmou1`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 6h1.9c1.5 0 2.9.9 3.6 2.2`,key:`10bdb2`}],[`path`,{d:`M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8`,key:`vgxac0`}],[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}]]),Oe=s(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),ke=s(`WandSparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),L=t(),R={coral:`var(--stipe-art-coral, #ff6558)`,blue:`var(--stipe-art-blue, #43a6f2)`,mint:`var(--stipe-art-mint, #63cfaa)`,grape:`var(--stipe-art-grape, #a66cc1)`,yellow:`var(--stipe-art-yellow, #ffd05d)`,cream:`var(--stipe-art-cream, #fff4de)`,ink:`var(--stipe-art-ink, #242c28)`,graphite:`var(--stipe-art-graphite, #49423f)`,inkcap:`var(--stipe-art-inkcap, #80499d)`},z=`light-dark(var(--stipe-sketch-ink, #242c28), var(--stipe-art-cream, #fff4de))`,Ae=`var(--color-base-100, light-dark(#fff4de, #242c28))`;function B({transform:e,fill:t=z}){return(0,L.jsx)(`path`,{transform:e,style:{fill:t},d:`M-1.264-9.479C-2.098-8.643-1.802-1.057-.907-.332.47.782 1.6-.446 1.618-3.075 1.623-3.888 1.691-5.398 1.77-6.429 1.979-9.202 1.596-10 .055-10-.588-10-.843-9.9-1.264-9.479Z`})}function je(){return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(B,{transform:`translate(25.4 19.8) rotate(-39) scale(.95 .76)`}),(0,L.jsx)(B,{transform:`translate(32.1 17.8) scale(.96 .95)`}),(0,L.jsx)(B,{transform:`translate(38.8 19.9) rotate(39) scale(.95 .77)`})]})}function Me(){return(0,L.jsxs)(`g`,{style:{fill:R.blue},children:[(0,L.jsx)(`path`,{d:`M10.574 .604C9.804 1.375 9.867-.885 9.961 22.81 10.054 47.202 9.722 45.378 14.193 45.94 25.813 47.399 38.465 52.211 44.662 57.532 47.653 60.097 48.082 59.411 47.967 52.242L47.734 19.335C47.734 17.523 47.13 16.616 45.964 15.076 40.604 8.018 30.127 2.767 16.804 .462 13.045-.184 11.326-.148 10.574 .604Z`}),(0,L.jsx)(`path`,{d:`M81.571 .746C71.063 2.665 62.221 6.713 56.562 12.199 54.242 14.45 52 17.356 52.115 19.335L52.033 52.628C51.927 59.934 51.979 59.994 55.74 57.091 62.423 51.931 71.272 48.541 84.103 46.221 90.625 45.039 89.967 47.631 90.145 22.432 90.326-3.079 91.148-1 81.571 .746Z`}),(0,L.jsx)(`path`,{d:`M1.906 12.692C.1 13.42 .151 12.804 .151 33.825 .151 54.097 .163 54.302 1.447 55.498 2.71 56.674 3.384 56.81 7.937 56.816 20.943 56.834 30.647 58.293 38.776 61.45 45.964 64.242 46.435 61.924 39.526 57.773 32.296 53.429 26.656 51.544 14.943 49.553 5.958 48.027 6.535 49.414 6.408 29.003 6.32 14.74 6.263 13.103 5.816 12.764 5.254 12.335 2.9 12.293 1.906 12.692Z`}),(0,L.jsx)(`path`,{d:`M94.326 12.858C93.656 13.326 93.656 13.326 93.653 28.492 93.653 48.882 93.997 48.063 84.743 49.556 73.574 51.36 64.45 54.695 57.801 59.405 54.082 62.039 55.384 63.864 59.722 62.1 68.897 58.372 76.363 57.115 90.03 56.994 100.405 56.903 99.489 58.976 99.773 34.976 100.018 14.142 100.006 13.958 98.399 12.979 97.236 12.269 95.251 12.208 94.326 12.858Z`})]})}function V(){return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`path`,{style:{fill:R.cream},d:`M-8.572-25.123C-21.412-23.39-33.235-17.39-44.235-7.027-51.235-.433-51.251 .358-44.524 6.749-20.77 29.316 10.23 31.893 36.364 13.487 41.043 10.187 48.193 3.551 49.235 1.524 50.358-.642 49.471-2.102 43.738-7.497 29.257-21.128 9.968-27.631-8.572-25.123Z`}),(0,L.jsx)(`path`,{style:{fill:R.ink},d:`M-6.225-16.807C-17.727-13.267-21.176 4.433-12.08 13.257-1.118 23.898 16.829 16.102 17.032 .604 17.209-12.412 6.219-20.642-6.225-16.807Z`})]})}function Ne(){return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`path`,{style:{fill:R.mint},d:`M540 342C520 340 497 355 477 374C450 399 440 421 456 444C465 458 480 462 492 464C503 466 500 477 494 486C487 500 508 496 522 478L530 468C557 468 578 464 591 451C601 442 599 429 585 427C572 425 556 432 547 418C538 403 550 390 568 385C579 382 589 380 584 368C576 352 557 341 540 342Z`}),(0,L.jsx)(`path`,{style:{fill:R.coral},d:`M589 396C614 380 659 381 683 392C709 404 721 428 710 451C704 464 693 472 685 479C680 487 684 498 689 503C695 514 684 513 675 507C667 502 662 497 657 491C637 496 610 495 594 486C584 480 583 469 595 464C607 460 622 454 622 441C622 428 612 423 597 420C580 417 578 407 589 396Z`})]})}function H({fill:e}){return(0,L.jsx)(`path`,{style:{fill:e},d:`M44.648 .288C26.645 1.615 13.263 8.266 5.942 19.529-4.299 35.277-.917 57.684 13.224 67.784 16.958 70.452 16.936 71.742 13.064 77.665 11.28 80.391 10.895 81.565 11.341 82.914 13.163 88.435 25.022 86.396 36.307 78.62L38.681 76.986 41.294 77.335C45.371 77.878 59.645 77.789 64.125 77.191 89.213 73.837 100.562 61.427 99.92 38.044 99.18 11.1 79.587-2.285 44.648 .288Z`})}function U({onFigure:e=!1}){return(0,L.jsxs)(`g`,{style:{fill:e?Ae:R.ink},children:[(0,L.jsx)(`rect`,{x:`-15`,y:`-11`,width:`10`,height:`22`,rx:`5`}),(0,L.jsx)(`rect`,{x:`5`,y:`-11`,width:`10`,height:`22`,rx:`5`})]})}function Pe(){return(0,L.jsx)(`path`,{style:{fill:R.cream},d:`M18.125 .621C.039 1.574-2.575 4.791 2.264 20.133 17.454 68.284 77.345 69.396 96.119 21.875 100.749 10.154 100.318 4.348 94.605 1.513 91.981 .21 37.878-.421 18.125 .621Z`})}function Fe(){return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`path`,{style:{fill:R.yellow},d:`M31.42 5.279C29.108 5.983 28.068 6.993 25.817 10.732 24.033 13.687 24.027 13.762 25.58 14.265 30.375 15.821 36.711 20.506 39.938 24.885 42.077 27.788 41.835 27.806 45.281 24.463 48.633 21.213 49.164 20.185 48.982 17.325 48.812 14.643 48.174 13.872 42.68 9.741 36.737 5.273 34.439 4.361 31.42 5.279Z`}),(0,L.jsx)(`path`,{style:{fill:R.yellow},d:`M22.538 16.207C22.093 16.652 19.732 20.231 13.309 30.196 10.737 34.188 10.723 33.911 13.589 35.351 16.461 36.798 19.778 39.28 21.825 41.523L22.6 42.37Q23.34 43.186 24.05 42.538L24.711 41.933C31.278 35.937 38.928 28.484 38.928 28.083 38.928 24.656 24.521 14.219 22.538 16.207Z`}),(0,L.jsx)(`path`,{style:{fill:R.cream},d:`M8.89 38.053C8.203 39.566 6.598 44.473 6.598 45.056 6.598 45.137 6.887 45.125 7.236 45.036 9.655 44.404 13.526 47.475 13.526 50.027 13.526 51.132 13.361 51.164 16.187 49.49 21.421 46.387 21.966 45.665 20.575 43.659 19.002 41.387 14.975 38.238 11.909 36.881 9.799 35.949 9.854 35.926 8.89 38.053Z`}),(0,L.jsx)(`path`,{style:{fill:R.graphite},d:`M6.598 45.056C5.732 46.866 5.155 49.464 6.309 50.907 8.041 53.505 10.928 52.639 13.526 50.907 13.526 48.021 9.978 44.404 7.236 45.036Z`})]})}function Ie(){return(0,L.jsx)(`path`,{style:{fill:R.coral},d:`M40.804 40.625C38.238 41.462 37.291 41.953 31.169 45.625 15.743 54.871 8.047 56.158 5.879 49.856 5.501 48.754 5.501 48.754 4.843 50.913 1.673 61.302 12.377 61.671 30.386 51.796 39.649 46.719 41.142 46.647 40.81 51.291 40.565 54.775 41.168 56.135 43.486 57.31 49.556 60.387 62.035 54.816 59.605 50.116 58.502 47.983 56.1 47.882 52.163 49.799 47.082 52.273 45.983 51.652 47.998 47.449 50.89 41.416 47.686 38.376 40.804 40.625Z`})}function W({transform:e}){return(0,L.jsx)(`path`,{style:{fill:R.mint},transform:e,d:`M0 0C3 -2 5 -5 5 -8 5 -10.5 3 -12 0 -12S-5 -10.5 -5 -8C-5 -5 -3 -2 0 0Z`})}function Le(){return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`path`,{fillRule:`evenodd`,style:{fill:z},d:`M25.3 17.69C14.8 19.34 10.66 20.18 9.05 20.99 5.51 22.78 4.2 27.21 6.71 28.9 7.47 29.42 8.48 29.4 10.25 28.84 12.41 28.15 12.56 27.57 11.02 25.85 10 24.71 10.53 23.62 11.79 24.27 13.9 25.36 15.02 28.98 15.63 36.66 16.18 43.48 17.33 47.43 19.69 50.49 22.76 54.48 27.69 55.73 30.31 53.19 33 50.57 31.24 46.04 28.44 48.38 26.29 50.17 26.16 47.08 28.3 45.14 29.61 43.95 30.78 43.58 38.92 41.75 39.45 41.63 39.41 41.52 38.39 40.01 36.87 37.78 36.04 35.22 34.72 28.69 33.37 22 32.04 19.3 29.5 18.07 28.69 17.68 26.59 17.49 25.3 17.69M24.11 26.51C18.61 27.67 18.16 27.82 17.98 28.55 17.64 29.91 18.54 30.44 20.51 30.05 25.4 29.08 30.11 28.03 30.49 27.83 31.65 27.23 31 25.33 29.66 25.4 29.5 25.4 27 25.91 24.11 26.51M29.2 31.42C28.64 31.54 26.23 32.07 23.85 32.58 20.01 33.41 19.48 33.57 19.15 33.96 18.67 34.5 18.66 35.05 19.12 35.63 19.61 36.26 19.86 36.23 26.05 34.88 29.05 34.23 31.53 33.7 31.57 33.7 31.82 33.7 32.34 32.88 32.34 32.5 32.34 31.25 31.37 30.92 29.2 31.42M29.79 37.19C28.81 37.41 26.45 37.94 24.53 38.37 22.62 38.8 20.84 39.23 20.58 39.33 19.61 39.71 19.35 40.62 19.98 41.41 20.48 42.05 21 41.99 27.59 40.5 33.85 39.09 34.21 38.91 33.45 37.44 33.02 36.61 32.51 36.58 29.79 37.19M45.41 41.95C44.89 42.09 41.61 42.89 38.12 43.73 30.94 45.45 29.81 45.84 31.05 46.15 33.2 46.69 34.11 50.18 32.77 52.76 32.23 53.79 32.23 54.03 32.76 54.16 33.34 54.31 45.35 51.3 46.72 50.67 50.19 49.06 51.76 45.01 49.79 42.76 48.8 41.64 47.46 41.39 45.41 41.95`}),(0,L.jsx)(`path`,{style:{fill:R.grape},d:`M48.21 10.15C47.92 10.41 47.5 11.27 46.96 12.74 45.52 16.61 45.24 16.99 43.01 18.15 39.18 20.15 39.05 20.99 42.28 22.73 45.37 24.39 45.68 24.79 47.12 28.95 48.3 32.32 49.28 32.2 50.65 28.52 52.23 24.25 52.26 24.22 55.2 22.56 57.53 21.24 57.79 21 57.79 20.16 57.79 19.49 57.55 19.31 55.01 18.06 52.16 16.66 52.2 16.72 50.31 11.56 49.7 9.89 49.03 9.44 48.21 10.15M32.59 13.92C31.78 14.73 32.28 15.89 33.58 16.22 35.07 16.6 36.19 17.1 37.17 17.84 38.42 18.77 39.23 18.86 39.79 18.15 39.99 17.9 40.15 17.53 40.15 17.32 40.15 15.29 33.99 12.52 32.59 13.92M42.48 34.38C40.96 35.96 40.65 36.88 41.39 37.57 42.2 38.33 43.36 37.74 44.55 35.95 45.2 34.97 45.22 34.35 44.62 33.88 43.89 33.31 43.41 33.42 42.48 34.38`}),(0,L.jsx)(`path`,{style:{fill:R.yellow},d:`M40.75 25.96C39.69 27.07 38.11 30.69 38.11 31.98 38.11 32.66 38.55 33.19 39.12 33.19 39.8 33.19 40.24 32.73 40.58 31.66 40.95 30.46 41.65 29.09 42.42 28.01 43.77 26.14 42.29 24.32 40.75 25.96M54.85 27.67C54.71 27.81 54.47 28.32 54.31 28.82 53.67 30.76 53.19 31.37 51.67 32.13 50.25 32.85 50.34 33.36 52.04 34.21 53.25 34.82 53.57 35.23 54.24 37.01 54.98 38.98 55.47 39.08 56.03 37.37 56.7 35.32 57.08 34.81 58.64 33.87 60.18 32.95 60.14 32.65 58.38 31.78 57.02 31.11 56.68 30.66 56.02 28.65 55.69 27.64 55.25 27.27 54.85 27.67`})]})}function Re(){return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`path`,{fillRule:`evenodd`,style:{fill:z},d:`M42.24 14.07C41.52 14.24 40.53 14.54 35.06 16.26 33.33 16.8 31.2 17.47 30.34 17.74 29.47 18.01 27.86 18.52 26.75 18.88 25.64 19.23 24.03 19.74 23.16 20.01 20.16 20.94 19.45 21.4 18.97 22.71 18.71 23.44 18.45 26.33 17.83 35.41 17.64 38.25 17.44 41.03 17.41 41.58 17.32 42.77 17.24 42.69 18.79 42.84L20.01 42.95 21.98 39.97C24.69 35.88 24.85 35.82 27.05 37.9 27.9 38.7 28.43 39.08 28.61 39.02 28.76 38.96 28.91 38.91 28.94 38.91 28.98 38.91 29.38 38.38 29.84 37.73 30.3 37.08 31.47 35.48 32.43 34.17 33.4 32.86 34.86 30.85 35.67 29.71 36.49 28.56 37.5 27.29 37.91 26.88 39.73 25.07 41.01 26.43 43.32 32.67 43.76 33.84 44.3 35.28 44.52 35.86 44.74 36.44 44.97 37.28 45.04 37.74 45.19 38.71 45.17 38.71 46.63 38.03 47.69 37.53 47.77 37.46 47.68 37.02 47.58 36.52 46.97 30.64 46.79 28.41 46.73 27.69 46.62 26.43 46.53 25.61 46.44 24.79 46.24 22.87 46.09 21.32 45.61 16.44 45.5 15.66 45.22 15.12 44.72 14.15 43.59 13.76 42.24 14.07M29.38 22.45C26.04 23.47 24.49 27.62 26.6 29.91 29.17 32.7 34.15 30.16 34.16 26.05 34.16 23.38 31.9 21.68 29.38 22.45M46.7 41.5C39.3 44.23 28.33 46.04 20.1 45.88L17.21 45.82 17.16 46.88C17.08 48.22 17.33 49.03 18.01 49.68 18.73 50.37 19.73 50.35 23.77 49.53 25.46 49.19 29.12 48.47 31.91 47.93 46.31 45.14 46.9 44.99 47.57 43.91 47.95 43.3 48.25 41.29 47.99 41.15 47.91 41.11 47.33 41.26 46.7 41.5`}),(0,L.jsx)(`path`,{style:{fill:R.coral},d:`M29.72 22.45C25.84 23.34 24.28 28.36 27.25 30.42 29.34 31.88 32.91 30.43 33.83 27.75 34.92 24.55 32.75 21.76 29.72 22.45`}),(0,L.jsx)(`path`,{style:{fill:R.mint},d:`M12.96 14.29C12.87 14.41 12.7 15.03 12.58 15.68 12.37 16.82 11.59 18.26 11.18 18.26 11.08 18.26 10.88 18.46 10.72 18.7 10.36 19.25 10.59 19.58 11.45 19.74 12.18 19.88 13.08 20.63 13.54 21.49 14.23 22.76 14.75 22.53 15.15 20.79 15.39 19.71 15.51 19.51 16.4 18.66 17.54 17.58 17.51 17.36 16.18 16.85 15.16 16.47 14.84 16.19 14.14 15.1 13.56 14.2 13.22 13.96 12.96 14.29M49.04 24.13C48.56 24.86 48.91 25.31 50.59 26.09 53.89 27.64 54.85 29.82 53.45 32.6 52.01 35.43 46.84 38.54 40.51 40.39 39.73 40.62 38.88 40.89 38.62 40.99 37.24 41.52 30.85 42.64 27.54 42.93 20.72 43.52 13.63 42.49 10.57 40.46 5.81 37.3 7.51 32.32 14.74 28.24 15.84 27.61 16.17 27.1 15.9 26.4 15.66 25.78 15.35 25.84 13.19 26.94 6 30.61 2.97 35.32 4.95 39.74 7.86 46.21 22.78 47.8 40.05 43.46 51.97 40.47 58.57 36.38 59.47 31.43 60.09 27.97 57.74 25.34 52.93 24.12 50.6 23.53 49.43 23.54 49.04 24.13`}),(0,L.jsx)(`path`,{style:{fill:R.grape},d:`M34.82 8.91C33.48 10.04 34.21 12.14 35.94 12.14 37.29 12.14 38.18 10.99 37.77 9.77 37.36 8.53 35.81 8.08 34.82 8.91M53.15 43.16C53 43.28 52.74 43.86 52.57 44.45 52.18 45.78 51.76 46.32 50.64 46.93 49.52 47.53 49.45 47.89 50.33 48.34 51.34 48.85 52.24 49.95 52.56 51.04 53.13 53.01 53.6 53 54.21 50.99 54.61 49.69 55.13 48.93 55.91 48.54 57.17 47.91 57.23 47.51 56.15 46.96 55.23 46.49 54.67 45.76 54.23 44.44 53.8 43.15 53.54 42.84 53.15 43.16M24.18 53.18C22.45 53.9 22.87 56.59 24.71 56.59 26.79 56.59 27.2 53.67 25.2 53.09 24.89 53.01 24.51 53.04 24.18 53.18`}),(0,L.jsx)(`path`,{style:{fill:R.yellow},d:`M51.76 11.04C51.21 12.77 50.56 13.61 49.24 14.34 48.6 14.69 48.72 15.07 49.59 15.48 50.54 15.93 51.11 16.69 51.62 18.22 52.06 19.57 52.26 19.54 52.79 18.08 53.29 16.69 53.87 15.91 54.86 15.31 55.76 14.77 55.77 14.48 54.92 14.02 53.91 13.46 53.5 12.99 52.89 11.66 52.23 10.21 52.06 10.12 51.76 11.04M11.06 48.22C10.99 48.35 10.71 48.88 10.46 49.41 9.95 50.48 9.45 50.99 8.59 51.33 7.89 51.61 7.85 52.1 8.52 52.37 9.51 52.79 10.3 53.85 10.89 55.58 11.09 56.18 11.48 55.88 11.87 54.84 12.24 53.87 13.33 52.56 13.79 52.56 14 52.56 14.5 52.06 14.5 51.85 14.5 51.77 14.19 51.54 13.81 51.34 12.98 50.92 12.36 50.14 11.93 48.99 11.6 48.09 11.31 47.83 11.06 48.22`})]})}function ze(){return(0,L.jsxs)(`g`,{transform:`translate(2 8) scale(.114) translate(-125 -122)`,children:[(0,L.jsx)(`path`,{style:{fill:R.coral},d:`M278 155 482 123C517 117 527 135 530 167L542 309Q543 329 561 341L631 404Q649 419 646 444 645 465 623 472L407 521Q374 531 345 519L156 436Q115 418 128 375L221 191Q238 163 278 155Z`}),(0,L.jsx)(`path`,{style:{fill:R.ink},d:`M317 183 461 161Q493 155 497 188L504 288Q508 320 478 326L318 356Q289 362 286 331L281 226Q278 194 317 183Z`}),(0,L.jsx)(`path`,{style:{fill:R.cream},d:`M304 386 553 340Q562 337 570 346L631 404Q649 419 646 444Q645 448 629 452L411 483Q382 492 367 474Z`}),(0,L.jsxs)(`g`,{style:{fill:R.cream},children:[(0,L.jsx)(`rect`,{x:`319`,y:`236`,width:`26`,height:`59`,rx:`13`}),(0,L.jsx)(`rect`,{x:`364`,y:`229`,width:`26`,height:`59`,rx:`13`})]}),(0,L.jsxs)(`g`,{style:{fill:R.ink},transform:`rotate(-11 470 411)`,children:[(0,L.jsx)(`rect`,{x:`369`,y:`380`,width:`61`,height:`25`,rx:`13`}),(0,L.jsx)(`rect`,{x:`444`,y:`380`,width:`61`,height:`25`,rx:`13`}),(0,L.jsx)(`rect`,{x:`518`,y:`380`,width:`57`,height:`25`,rx:`13`}),(0,L.jsx)(`rect`,{x:`392`,y:`421`,width:`58`,height:`25`,rx:`13`}),(0,L.jsx)(`rect`,{x:`462`,y:`421`,width:`65`,height:`25`,rx:`13`}),(0,L.jsx)(`rect`,{x:`539`,y:`421`,width:`58`,height:`25`,rx:`13`})]})]})}function Be(){return(0,L.jsxs)(`g`,{transform:`translate(3 10) scale(.114) translate(-760 -140)`,children:[(0,L.jsx)(`path`,{style:{fill:R.blue},d:`M1226 153C1257 153 1273 195 1267 231Q1263 265 1237 268L1176 270V215C1176 178 1195 153 1226 153Z`}),(0,L.jsx)(`path`,{style:{fill:R.blue},d:`M824 376Q908 372 871 400C842 427 866 442 902 450L1113 480Q1188 479 1199 392C1207 447 1204 497 1163 511Q1134 521 1097 516C1055 510 991 507 957 507S869 511 826 512C781 513 758 483 760 441Q760 385 824 376Z`}),(0,L.jsx)(`path`,{style:{fill:R.cream},d:`M824 376 857 184Q864 133 911 141C1039 169 1124 151 1226 153Q1179 159 1184 241L1199 377C1202 434 1174 482 1117 480L902 450C864 445 849 429 871 400Q908 372 824 376Z`}),(0,L.jsxs)(`g`,{style:{fill:R.coral},children:[(0,L.jsx)(`path`,{d:`M982 198C1008 190 1030 197 1028 220L1023 265Q1020 295 1000 279C981 261 951 223 963 210Q970 202 982 198Z`}),(0,L.jsx)(`path`,{d:`M1063 220C1077 215 1100 237 1102 251Q1107 267 1084 282L1063 295Q1037 307 1040 278L1045 245Q1049 224 1063 220Z`}),(0,L.jsx)(`path`,{d:`M911 252C925 240 939 254 957 269L978 291Q995 311 961 316C938 318 907 316 898 308Q884 296 911 252Z`}),(0,L.jsx)(`path`,{d:`M1106 289Q1127 281 1134 304C1142 327 1146 352 1125 350Q1097 348 1073 335C1051 324 1072 311 1084 302Z`}),(0,L.jsx)(`path`,{d:`M927 338C946 334 972 334 985 343Q1004 353 984 384C970 408 957 418 940 403C922 389 896 356 913 345Z`}),(0,L.jsx)(`path`,{d:`M1010 375Q1025 363 1037 384C1049 407 1064 438 1044 442Q1025 448 1002 436C984 428 991 410 997 393Z`}),(0,L.jsx)(`path`,{d:`M1068 357C1084 359 1110 376 1120 389Q1130 402 1107 419C1090 432 1082 418 1073 401C1062 383 1043 355 1068 357Z`}),(0,L.jsx)(`path`,{d:`M1018 311C1037 312 1050 334 1034 343C1018 351 998 337 1005 320Q1009 311 1018 311Z`})]})]})}function Ve(){return(0,L.jsxs)(`g`,{transform:`translate(2 7) scale(.11) translate(-1380 -96)`,children:[(0,L.jsx)(`path`,{style:{fill:R.inkcap},d:`M1384 276C1394 238 1445 200 1497 158C1547 119 1604 97 1647 97C1690 97 1720 109 1745 138C1772 170 1791 184 1833 194C1870 201 1919 220 1922 257C1923 307 1891 339 1853 336C1801 335 1767 299 1701 294C1666 291 1620 294 1642 303Q1670 307 1675 333C1681 367 1697 389 1717 413C1735 434 1738 443 1719 464C1700 485 1692 502 1686 520Q1682 541 1653 541L1626 541Q1598 541 1594 519C1590 495 1578 474 1563 458C1545 440 1544 429 1559 410C1585 377 1608 337 1572 326C1554 320 1529 333 1506 340C1461 356 1428 357 1402 340Q1371 319 1384 276Z`}),(0,L.jsx)(`path`,{style:{fill:R.cream},d:`M1634 362Q1641 346 1649 362C1660 390 1676 404 1705 424Q1721 435 1704 453C1685 475 1677 490 1671 513Q1670 526 1653 525L1626 525Q1611 525 1610 513C1606 492 1592 465 1575 449Q1562 437 1577 424C1604 404 1620 390 1634 362Z`}),(0,L.jsx)(`path`,{style:{fill:R.inkcap},d:`M1634 456A18 18 0 1 1 1648 456V492Q1648 500 1641 500T1634 492Z`}),(0,L.jsx)(`path`,{style:{fill:R.inkcap},d:`M1780 391Q1786 386 1793 396C1810 420 1828 444 1827 467C1826 508 1768 510 1753 480C1741 456 1762 413 1780 391Z`})]})}var{coral:G,blue:K,mint:q,grape:J,yellow:Y,cream:X,ink:Z}=R,He={bonsai:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{fill:`none`,stroke:q,strokeWidth:`3.7`,strokeLinecap:`round`,d:`M35 27.5C36 25 35.5 22.5 34 21S31.5 17.5 31.5 14M36 27C40 26.8 43 26 45 24S47 20.5 47.5 18.5M30.5 31C32.5 26.5 30.5 24.6 26.5 24 22 23.5 18.5 21.6 16.8 18.5M29 37C26.5 34.5 25 33.7 21.5 33.2S15.5 32 13 31.6M36 39.5C38 38 40 37.5 42 36.5S47 34 51 32.2`}),(0,L.jsx)(`path`,{fill:q,d:`M25.5 43.5C28 40.5 28 37 27.5 33 27.3 29.5 29.5 27 33.5 26.3L37.5 26V29.5C35 29.8 34.2 31.5 34.3 34 34.5 37.5 37 39.5 41 43.5Z`}),(0,L.jsx)(`circle`,{fill:K,cx:`31.5`,cy:`10.7`,r:`4.8`}),(0,L.jsx)(`circle`,{fill:J,cx:`16.6`,cy:`18.3`,r:`4.6`}),(0,L.jsx)(`circle`,{fill:Y,cx:`47.9`,cy:`17.7`,r:`4.6`}),(0,L.jsx)(`circle`,{fill:Y,cx:`12.8`,cy:`31.5`,r:`4.6`}),(0,L.jsx)(`circle`,{fill:K,cx:`50.9`,cy:`32.1`,r:`4.6`}),(0,L.jsx)(`path`,{fill:G,d:`M16 46H47.5C47.5 54 44 58 38 58H25.5C19.5 58 16 54 16 46Z`}),(0,L.jsx)(`rect`,{fill:G,x:`14`,y:`43`,width:`35.5`,height:`4.6`,rx:`2.3`})]}),computer:(0,L.jsx)(ze,{}),prints:(0,L.jsx)(Be,{}),inkcap:(0,L.jsx)(Ve,{}),vishnu:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{style:{fill:G},d:`M6 37C6 21 17.5 9 32 9s26 12 26 28c0 2.2-1.8 4-4 4H10c-2.2 0-4-1.8-4-4Z`}),(0,L.jsx)(`circle`,{style:{fill:X},cx:`19`,cy:`25`,r:`4`}),(0,L.jsx)(`circle`,{style:{fill:X},cx:`33`,cy:`19.5`,r:`4.8`}),(0,L.jsx)(`circle`,{style:{fill:X},cx:`46`,cy:`28`,r:`3.4`}),(0,L.jsx)(`rect`,{style:{fill:K},x:`13`,y:`39`,width:`38`,height:`18`,rx:`9`}),(0,L.jsx)(`rect`,{style:{fill:X},x:`18.5`,y:`46.2`,width:`10`,height:`3.6`,rx:`1.8`}),(0,L.jsx)(`rect`,{style:{fill:X},x:`21.7`,y:`43`,width:`3.6`,height:`10`,rx:`1.8`}),(0,L.jsx)(`circle`,{style:{fill:Y},cx:`39`,cy:`50.5`,r:`2.7`}),(0,L.jsx)(`circle`,{style:{fill:X},cx:`45`,cy:`45.5`,r:`2.7`})]}),generateText:(0,L.jsx)(Le,{}),generateMedia:(0,L.jsx)(Re,{}),buyApps:(0,L.jsxs)(`g`,{transform:`rotate(-6 32 32)`,children:[(0,L.jsx)(`circle`,{fill:Y,cx:`32`,cy:`20`,r:`12`}),(0,L.jsx)(`circle`,{stroke:X,strokeWidth:`4`,cx:`32`,cy:`20`,r:`6`}),(0,L.jsx)(B,{fill:Y,transform:`translate(15.5 12) rotate(-60) scale(1.1 .85)`}),(0,L.jsx)(B,{fill:Y,transform:`translate(48.5 12) rotate(60) scale(1.1 .85)`}),(0,L.jsx)(`path`,{fill:K,d:`M10 35H54L50 53Q49 58 44 58H20Q15 58 14 53Z`}),(0,L.jsx)(`rect`,{fill:G,x:`5`,y:`27`,width:`54`,height:`10`,rx:`5`}),(0,L.jsxs)(`g`,{fill:X,children:[(0,L.jsx)(`rect`,{x:`20`,y:`41`,width:`5`,height:`11`,rx:`2.5`}),(0,L.jsx)(`rect`,{x:`29.5`,y:`41`,width:`5`,height:`11`,rx:`2.5`}),(0,L.jsx)(`rect`,{x:`39`,y:`41`,width:`5`,height:`11`,rx:`2.5`})]})]}),browseBazaar:(0,L.jsxs)(`g`,{transform:`rotate(-5 32 32)`,children:[(0,L.jsx)(`rect`,{fill:K,x:`10`,y:`14`,width:`44`,height:`38`,rx:`6`}),(0,L.jsx)(`rect`,{fill:K,x:`5`,y:`47`,width:`54`,height:`12`,rx:`6`}),(0,L.jsx)(`rect`,{fill:X,x:`12`,y:`50.5`,width:`40`,height:`4.5`,rx:`2.25`}),(0,L.jsx)(`rect`,{fill:G,x:`2`,y:`4`,width:`60`,height:`9`,rx:`4.5`}),(0,L.jsx)(`path`,{fill:G,d:`M3 9H14.6V18A5.8 5.8 0 0 1 3 18Z`}),(0,L.jsx)(`path`,{fill:X,d:`M14.6 9H26.2V18A5.8 5.8 0 0 1 14.6 18Z`}),(0,L.jsx)(`path`,{fill:G,d:`M26.2 9H37.8V18A5.8 5.8 0 0 1 26.2 18Z`}),(0,L.jsx)(`path`,{fill:X,d:`M37.8 9H49.4V18A5.8 5.8 0 0 1 37.8 18Z`}),(0,L.jsx)(`path`,{fill:G,d:`M49.4 9H61V18A5.8 5.8 0 0 1 49.4 18Z`}),(0,L.jsx)(`g`,{transform:`translate(32 36.5) scale(.34)`,children:(0,L.jsx)(V,{})})]}),agent:(0,L.jsxs)(`g`,{transform:`translate(32 33) scale(2.02) translate(-47.2 -41.8)`,children:[(0,L.jsx)(`path`,{fill:K,d:`M46.666 29.533C39.623 30.116 34.627 34.849 34.603 40.96 34.585 45.387 36.412 47.971 40.602 49.445 42.036 49.95 42.076 50.049 41.491 51.666 40.968 53.111 41.167 53.761 42.201 53.988 43.463 54.265 46.679 52.293 47.929 50.475 48.134 50.178 48.268 50.13 49.332 49.977 56.938 48.882 60.956 43.889 59.582 37.237 58.622 32.59 53.42 29.07 48.034 29.424 47.904 29.432 47.289 29.482 46.666 29.533Z`}),(0,L.jsx)(`g`,{transform:`translate(47.3 40) scale(.36 .34)`,children:(0,L.jsx)(U,{})})]}),list:(0,L.jsxs)(`g`,{transform:`rotate(-7 32 32)`,children:[(0,L.jsx)(`path`,{style:{fill:K},d:`M12 13Q6 13 6 19V50Q6 57 13 57H47Q53 57 53 50V20Q53 13 47 13Z`}),(0,L.jsx)(`path`,{style:{fill:X},d:`M19 7H39Q42 7 44 9L55 20Q57 22 57 26V44Q57 50 51 50H19Q13 50 13 44V13Q13 7 19 7Z`}),(0,L.jsx)(`path`,{style:{fill:G},d:`M39 7V18Q39 24 45 24H57Q57 22 55 20L44 9Q42 7 39 7Z`}),(0,L.jsxs)(`g`,{style:{fill:G},children:[(0,L.jsx)(`circle`,{cx:`22`,cy:`21`,r:`3`}),(0,L.jsx)(`circle`,{cx:`22`,cy:`31`,r:`3`}),(0,L.jsx)(`circle`,{cx:`22`,cy:`41`,r:`3`})]}),(0,L.jsx)(`path`,{style:{stroke:K},strokeWidth:`5`,strokeLinecap:`round`,d:`M31 21H32M31 31H46M31 41H42`})]}),chat:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`g`,{transform:`translate(3 11) scale(.22) translate(-449 -327)`,children:(0,L.jsx)(Ne,{})}),(0,L.jsx)(B,{transform:`translate(38.2 18) rotate(16) scale(.95 .6)`}),(0,L.jsx)(B,{transform:`translate(44.4 20.5) rotate(47) scale(.95 .6)`})]}),read:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`g`,{transform:`translate(4 20.5) scale(.56)`,children:(0,L.jsx)(Me,{})}),(0,L.jsx)(`g`,{transform:`translate(32 38.6) scale(.3164)`,children:(0,L.jsx)(V,{})}),(0,L.jsx)(je,{})]}),readConversations:(0,L.jsxs)(`g`,{transform:`translate(32 32) scale(.9) translate(-32 -32)`,children:[(0,L.jsx)(`g`,{transform:`translate(4 7.88) scale(.56)`,children:(0,L.jsx)(H,{fill:K})}),(0,L.jsx)(`g`,{transform:`translate(32.2 30.3) scale(.352)`,children:(0,L.jsx)(V,{})})]}),listAgents:(0,L.jsxs)(`g`,{transform:`translate(32 32) scale(1.04) translate(-32 -32)`,children:[(0,L.jsx)(`path`,{style:{fill:z},d:`M32.059 10.146C23.878 10.646 18.949 14.844 18.925 21.331 18.912 24.856 20.167 27.259 22.274 27.74 24.437 28.233 26.097 29.061 27.481 30.337 28.275 31.068 28.328 31.096 29.352 31.306 31.161 31.677 31.653 32.094 32.115 33.651 32.392 34.582 32.557 34.868 32.915 35.041 33.919 35.523 35.864 33.733 36.539 31.706L36.775 30.997 38.008 30.681C42.663 29.489 45.29 26.142 45.468 21.176 45.734 13.784 40.673 9.62 32.059 10.146Z`}),(0,L.jsx)(`g`,{transform:`translate(32.4 21.2) scale(.39)`,children:(0,L.jsx)(U,{onFigure:!0})}),(0,L.jsx)(`path`,{style:{fill:G},d:`M14.375 27.586C8.014 28.591 4.363 32.396 4.355 38.027 4.347 43.93 8.071 47.469 15.239 48.368L16.828 48.568 17.873 49.568C19.854 51.464 22.469 52.496 23.691 51.864 24.384 51.506 24.431 51.044 23.924 49.606 23.337 47.943 23.479 47.492 24.749 46.977 32.756 43.73 32.643 31.899 24.573 28.49 22.238 27.504 17.535 27.087 14.375 27.586Z`}),(0,L.jsx)(`g`,{transform:`translate(17.6 37.7) scale(.38 .36)`,children:(0,L.jsx)(U,{})}),(0,L.jsx)(`path`,{style:{fill:K},d:`M46.666 29.533C39.623 30.116 34.627 34.849 34.603 40.96 34.585 45.387 36.412 47.971 40.602 49.445 42.036 49.95 42.076 50.049 41.491 51.666 40.968 53.111 41.167 53.761 42.201 53.988 43.463 54.265 46.679 52.293 47.929 50.475 48.134 50.178 48.268 50.13 49.332 49.977 56.938 48.882 60.956 43.889 59.582 37.237 58.622 32.59 53.42 29.07 48.034 29.424 47.904 29.432 47.289 29.482 46.666 29.533Z`}),(0,L.jsx)(`g`,{transform:`translate(47.3 40) scale(.36 .34)`,children:(0,L.jsx)(U,{})})]}),createAgents:(0,L.jsxs)(`g`,{transform:`translate(32 32) scale(1.08) translate(-32 -32)`,children:[(0,L.jsx)(`path`,{style:{fill:z},d:`M20.436 24.499C13.35 25.216 7.504 28.799 5.442 33.687 3.114 39.208 4.438 45.791 8.593 49.358 10.446 50.949 10.34 50.831 10.34 51.301 10.34 51.796 10.106 52.294 9.281 53.558 7.191 56.76 12.108 56.905 16.701 53.777 17.517 53.221 17.715 53.135 18.015 53.201 20.013 53.639 25.739 53.051 28.595 52.113 35.47 49.857 39.129 44.162 37.83 37.738C37 31 33 26 26.717 24.428L24.075 24.413C22.623 24.405 20.985 24.444 20.436 24.499Z`}),(0,L.jsx)(`g`,{transform:`translate(21.9 40) scale(.46 .43)`,children:(0,L.jsx)(U,{onFigure:!0})}),(0,L.jsx)(`path`,{style:{fill:q},d:`M37.987 15.734C32.277 16.627 28.675 20.713 28.92 26.022 29.062 29.118 30.627 31.606 33.331 33.036 34.675 33.747 34.761 34.018 34.237 35.923 33.376 39.051 36.878 38.551 39.174 35.218 39.574 34.637 39.65 34.583 40.058 34.583 46.203 34.583 50.414 30.91 50.424 25.543 50.435 18.989 44.932 14.649 37.987 15.734Z`}),(0,L.jsx)(`g`,{transform:`translate(38.9 24.9) scale(.31)`,children:(0,L.jsx)(U,{})}),(0,L.jsx)(B,{fill:Y,transform:`translate(48.1 15.7) rotate(31) scale(1.25 .85)`}),(0,L.jsx)(B,{fill:Y,transform:`translate(52.2 19.8) rotate(70) scale(1.25 .85)`})]}),sendPrompts:(0,L.jsxs)(`g`,{transform:`translate(32 32) scale(1.08) translate(-32 -32)`,children:[(0,L.jsx)(`g`,{transform:`translate(4 13.2) scale(.412 .436)`,children:(0,L.jsx)(H,{fill:G})}),(0,L.jsx)(`g`,{transform:`translate(17.1 28.7) scale(.19)`,children:(0,L.jsx)(Pe,{})}),(0,L.jsx)(B,{fill:q,transform:`translate(48.1 26.4) rotate(65) scale(1.7 1.28)`}),(0,L.jsx)(B,{fill:q,transform:`translate(48.4 33.8) rotate(110) scale(1.7 1.28)`})]}),write:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Fe,{}),(0,L.jsx)(Ie,{})]}),run:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`rect`,{style:{fill:K},x:`6`,y:`9`,width:`52`,height:`43`,rx:`7`}),(0,L.jsx)(`path`,{style:{stroke:X},strokeWidth:`5`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`m17 22 9 8-9 8m17 0h12`})]}),stop:(0,L.jsx)(`rect`,{style:{fill:G},x:`12`,y:`12`,width:`40`,height:`40`,rx:`9`}),connected:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{fill:`none`,style:{stroke:K},strokeWidth:`12`,strokeLinecap:`round`,d:`M34 37Q43 21 26 20H18Q3 20 6 37q2 10 15 9`}),(0,L.jsx)(`path`,{fill:`none`,style:{stroke:G},strokeWidth:`12`,strokeLinecap:`round`,d:`M29 33Q20 50 38 53h8q16-1 12-17-2-11-14-10`}),(0,L.jsx)(`path`,{style:{stroke:Y},strokeWidth:`4`,strokeLinecap:`round`,d:`m27 4 2 6m10-5-2 7m12 0-5 4`})]}),working:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`ellipse`,{style:{fill:q},cx:`23`,cy:`14`,rx:`13`,ry:`8`,transform:`rotate(-30 23 14)`}),(0,L.jsx)(`ellipse`,{style:{fill:Y},cx:`48`,cy:`36`,rx:`13`,ry:`8`,transform:`rotate(35 48 36)`}),(0,L.jsx)(`ellipse`,{style:{fill:J},cx:`22`,cy:`48`,rx:`13`,ry:`8`,transform:`rotate(45 22 48)`}),(0,L.jsx)(`path`,{fill:`none`,style:{stroke:z},strokeWidth:`3`,strokeLinecap:`round`,d:`M42 8q13 2 13 13M43 55q-5 5-12 4M5 39q-5-9 1-17`})]}),complete:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{style:{fill:q},d:`M32 6q5-8 10 0 9-3 10 6 9 2 5 11 8 6 0 12 3 9-6 11-1 9-10 6-6 8-12 0-9 3-11-6-9-2-6-11-8-6 0-12-3-9 6-11 1-9 10-6Z`}),(0,L.jsx)(`path`,{fill:`none`,style:{stroke:Z},strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`m23 29 7 7 13-15`}),(0,L.jsx)(`path`,{style:{stroke:z},strokeWidth:`3`,strokeLinecap:`round`,d:`m4 8 5 6m48-4 5-5M2 24l6 1`})]}),installApps:(0,L.jsxs)(`g`,{transform:`rotate(-6 32 32)`,children:[(0,L.jsx)(`rect`,{style:{fill:K},x:`9`,y:`26`,width:`46`,height:`32`,rx:`10`}),(0,L.jsx)(`rect`,{style:{fill:X},x:`17`,y:`33`,width:`30`,height:`18`,rx:`5`}),(0,L.jsx)(`path`,{style:{fill:q},d:`M22 38h8v8h-8z`}),(0,L.jsx)(`path`,{style:{fill:J},d:`M34 38h8v8h-8z`}),(0,L.jsx)(`path`,{style:{stroke:G},strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M32 4v17m-8-7 8 8 8-8`})]}),restricted:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{fill:`none`,style:{stroke:G},strokeWidth:`9`,strokeLinecap:`round`,d:`M16 23V19q0-17 16-17t16 17v4`}),(0,L.jsx)(`rect`,{style:{fill:G},x:`8`,y:`26`,width:`48`,height:`36`,rx:`9`}),(0,L.jsx)(`path`,{style:{fill:X},d:`M32 34a7 7 0 0 0-4 13v7h8v-7a7 7 0 0 0-4-13Z`})]}),error:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{style:{fill:G},d:`M32 6q5-8 10 0 9-3 10 6 9 2 5 11 8 6 0 12 3 9-6 11-1 9-10 6-6 8-12 0-9 3-11-6-9-2-6-11-8-6 0-12-3-9 6-11 1-9 10-6Z`}),(0,L.jsx)(`path`,{fill:`none`,style:{stroke:X},strokeWidth:`7`,strokeLinecap:`round`,d:`M32 18v15`}),(0,L.jsx)(`circle`,{style:{fill:X},cx:`32`,cy:`45`,r:`4`})]}),trellis:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`g`,{fill:Y,children:[(0,L.jsx)(`rect`,{x:`17.25`,y:`9`,width:`3.9`,height:`49.2`,rx:`1.95`}),(0,L.jsx)(`rect`,{x:`42.95`,y:`9`,width:`3.9`,height:`49.2`,rx:`1.95`}),(0,L.jsx)(`rect`,{x:`30.4`,y:`18`,width:`3.2`,height:`26`}),(0,L.jsx)(`rect`,{x:`14.8`,y:`15.75`,width:`34.4`,height:`3.1`,rx:`1.55`}),(0,L.jsx)(`rect`,{x:`14.8`,y:`28.85`,width:`34.4`,height:`3.1`,rx:`1.55`}),(0,L.jsx)(`rect`,{x:`14.8`,y:`42.55`,width:`34.4`,height:`3.1`,rx:`1.55`})]}),(0,L.jsx)(`path`,{fill:`none`,stroke:q,strokeWidth:`3`,strokeLinecap:`round`,d:`M21.9 56.1C31.5 54.4 32.9 47 32.1 45.8`}),(0,L.jsx)(`path`,{fill:`none`,stroke:q,strokeWidth:`3`,strokeLinecap:`round`,d:`M32 44.2C28.7 41.8 25.2 35.7 32 32.3 38.8 28 38.9 24 31.9 18.8 32.4 16.3 32.8 14.7 34.5 12.2`}),(0,L.jsx)(W,{transform:`translate(32.1 14.1) rotate(45) scale(0.45 0.86)`}),(0,L.jsx)(W,{transform:`translate(32.2 14.7) rotate(-60) scale(0.42 0.58)`}),(0,L.jsx)(W,{transform:`translate(34.8 28.3) rotate(65) scale(0.38 0.8)`}),(0,L.jsx)(W,{transform:`translate(28.2 33.1) rotate(-51) scale(0.5 0.57)`}),(0,L.jsx)(W,{transform:`translate(28.6 53.3) rotate(-48) scale(0.47 0.6)`}),(0,L.jsx)(`circle`,{fill:G,cx:`31.9`,cy:`18.8`,r:`4`}),(0,L.jsx)(`circle`,{fill:K,cx:`32`,cy:`32.3`,r:`4`}),(0,L.jsx)(`circle`,{fill:J,cx:`32`,cy:`44.2`,r:`4`})]}),games:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{fill:K,d:`M18.5 28.5H45.5C49.5 29.5 53 32 54 35 55 37.5 56.8 45.5 56.6 48 56.5 53 52.5 57.5 47 58H15C9.5 56.5 6.6 51 7.6 45.5 8.6 39.5 9.3 35 10.5 33 12 31 14.5 29.5 18.5 28.5Z`}),(0,L.jsx)(`ellipse`,{fill:X,cx:`26.8`,cy:`37.9`,rx:`9.1`,ry:`5.6`}),(0,L.jsx)(`ellipse`,{fill:Z,cx:`27`,cy:`37.6`,rx:`4.7`,ry:`2.2`}),(0,L.jsx)(`path`,{fill:Z,d:`M23.1 26V35.4A4 4.2 0 0 0 31.1 35.4V26Z`}),(0,L.jsx)(`circle`,{fill:G,cx:`27.1`,cy:`18.3`,r:`12.4`}),(0,L.jsx)(`circle`,{fill:X,cx:`22.6`,cy:`14.3`,r:`3.05`}),(0,L.jsx)(`ellipse`,{fill:Y,cx:`45.1`,cy:`37.2`,rx:`5.6`,ry:`3.95`}),(0,L.jsx)(`ellipse`,{fill:X,cx:`40.1`,cy:`46.6`,rx:`6.2`,ry:`4.4`})]}),oyster:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{fill:J,d:`M35.5 6C33.7 6.3 32.3 7.6 31.4 9.4 30.9 10.3 30.4 10.3 29.5 10 25.5 9 20.6 11.6 19.6 15.9 19.4 16.6 19 17 18 17.1 14.5 17.6 12 20.6 12.1 24.2 12.2 25.4 12 25.9 11.5 26.5 7.5 30 10.5 34.5 17.5 34.4 15.3 32.6 16 31 19 29 26 24 37 19.5 43.5 19 46 19 46 22 43 25.5 46.5 23.5 51.5 18.5 53.5 15 55 11 50 7 45 9 43.8 9.4 43.3 9.2 42.5 8 40.7 6.3 38 5.6 35.5 6Z`}),(0,L.jsx)(`circle`,{fill:X,cx:`34.9`,cy:`41.9`,r:`11.3`}),(0,L.jsxs)(`g`,{fill:Z,children:[(0,L.jsx)(`rect`,{x:`29.9`,y:`33.2`,width:`3.2`,height:`5.6`,rx:`1.6`}),(0,L.jsx)(`rect`,{x:`36.7`,y:`33.2`,width:`3.2`,height:`5.6`,rx:`1.6`})]}),(0,L.jsx)(`path`,{fill:J,d:`M49.5 39C47.9 39.3 46.5 40 46.1 41.6 45.8 43.2 45.5 43.5 44 43.5 38.5 43.5 35 48 39 49.5 40 50 39.5 50.5 38 51 35.5 52.5 32.5 52 30 51 29 50.5 28.5 50 29.5 50 33 47.5 30 43.5 24.5 43.5 23.3 43.5 22.9 43.3 22.5 43 20.5 40.5 19 40 17.5 39.5 13 39.5 13 44 17 47.5 18.3 48.4 18.6 48.7 19 49.5 20.5 53 23 55 26 55 26.8 55 27 55.3 27.5 56 31 58.5 36.5 58.5 40 56 40.8 55.2 41.2 55 42 55 45 55 47.5 53 49 49.5 49.6 48.5 50 48 50.5 47.5 56 43.5 55 38.5 49.5 39Z`}),(0,L.jsx)(`path`,{fill:`none`,stroke:Y,strokeWidth:`3`,strokeLinecap:`round`,d:`M46.6 31.8 49.2 27.8 M49.4 35.5 52.8 33.7 M21.5 32.5 22.9 33.5 M19.3 37.5 21.1 38.1`})]}),tourtois:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`rect`,{fill:X,x:`11.07`,y:`35.73`,width:`26.8`,height:`9.7`,rx:`3.25`,transform:`rotate(-5 24.47 40.58)`}),(0,L.jsx)(`path`,{fill:Y,d:`M14.8 16C19 14.6 23 13.5 26.5 12.6 28.4 12.1 29.6 13.4 30.1 15.3L31.6 21 17.4 37.6C13.8 38.2 10.6 37.8 10.1 35.4L9.2 27.8C9.1 26.1 10.1 24.7 11.6 24.1 11.4 22.4 11.4 20.6 11.8 19.1 12.3 17.4 13.3 16.5 14.8 16Z`}),(0,L.jsx)(`path`,{fill:G,d:`M14.0 24.1Q13.3 21.2 16.2 20.4L30.7 16.2Q33.6 15.4 34.6 18.2L36.0 22.7Q37.0 25.5 34.7 27.4L20.2 39.7Q17.9 41.6 17.2 38.7Z`}),(0,L.jsx)(`path`,{fill:K,d:`M21 23.4 35.5 20.6C37.3 20.2 38.6 21 38.9 22.6L40 34.5C40.1 36.2 39.1 37.3 37.5 37.7 32.6 39.9 26 41 21 41 16 41 12.2 40.2 11 38.8 10.4 37.6 10.8 36.4 12.4 37L19.6 38.4 18.4 27C18.2 25.2 19.3 23.7 21 23.4Z`}),(0,L.jsx)(`path`,{fill:X,d:`M22.8 29.6 34.8 26.9C36.2 26.6 37 27.3 37.2 28.6L37.9 33C38.1 34.2 37.5 35 36.3 35.3L24.3 37.8C23 38.1 22.3 37.5 22.1 36.3L21.3 31.6C21.1 30.6 21.7 29.8 22.8 29.6Z`}),(0,L.jsxs)(`g`,{fill:X,children:[(0,L.jsx)(`circle`,{cx:`14.7`,cy:`18.45`,r:`1`}),(0,L.jsx)(`circle`,{cx:`17.6`,cy:`17.65`,r:`1`}),(0,L.jsx)(`circle`,{cx:`20.5`,cy:`16.85`,r:`1`}),(0,L.jsx)(`circle`,{cx:`17.9`,cy:`22.2`,r:`1`}),(0,L.jsx)(`circle`,{cx:`21`,cy:`21.5`,r:`1`}),(0,L.jsx)(`circle`,{cx:`24.1`,cy:`20.75`,r:`1`}),(0,L.jsx)(`circle`,{cx:`28.2`,cy:`25.3`,r:`1`})]}),(0,L.jsx)(`circle`,{fill:G,cx:`21.7`,cy:`26.6`,r:`1`}),(0,L.jsx)(`circle`,{fill:Y,cx:`24.9`,cy:`25.9`,r:`1.05`}),(0,L.jsxs)(`g`,{fill:q,children:[(0,L.jsx)(`ellipse`,{cx:`8.8`,cy:`36.6`,rx:`3.6`,ry:`1.9`,transform:`rotate(22 8.8 36.6)`}),(0,L.jsx)(`path`,{d:`M12 41C10 41.5 7.5 44.5 7 46.5 7 48 8.5 49.5 10.5 50 12.5 50.5 13.5 50 15 48 15.5 47 16.5 47.5 19 50 22 49.5 22 46.5 22 45.5 20.5 45.5 17 45 16.5 44.5 16.5 44 16.5 42 13.5 40.5L12 41Z`}),(0,L.jsx)(`path`,{d:`M40 33C39 38 36 42 34.5 41.5 32.5 40.5 29.5 42 28.5 44 26 49 27.5 51.5 32.5 51 36 51 37 50 36 46.5 36 45 37 44.5 38 44.5 38.5 45.5 40.5 49 43.5 50 46.5 47.5 47.5 46.5 46 43.5 44 42 43 41.5 43.5 40.5 44.5 39.5 46 38 47 37.5L47 33Z`})]}),(0,L.jsx)(`ellipse`,{fill:q,cx:`46.4`,cy:`30.6`,rx:`8.1`,ry:`8.3`}),(0,L.jsxs)(`g`,{fill:Z,children:[(0,L.jsx)(`rect`,{x:`45.05`,y:`26.95`,width:`2.25`,height:`4.6`,rx:`1.1`,transform:`rotate(-6 46.2 29.3)`}),(0,L.jsx)(`rect`,{x:`49.25`,y:`26.4`,width:`2.25`,height:`4.6`,rx:`1.1`,transform:`rotate(-6 50.4 28.7)`})]}),(0,L.jsx)(`path`,{fill:G,d:`M46.8 32.2H51C51 34.3 50 35.4 48.9 35.4S46.8 34.3 46.8 32.2Z`,transform:`rotate(-8 48.9 33.5)`}),(0,L.jsx)(`path`,{fill:`none`,stroke:Y,strokeWidth:`3`,strokeLinecap:`round`,d:`M50.9 17.7 50.5 19.7 M55.2 20.1 53.4 21.9 M56.5 24.5 55.7 24.7`})]}),allApps:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`rect`,{fill:G,x:`7`,y:`7.25`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(-6.2 18.6 18.6)`}),(0,L.jsx)(`rect`,{fill:K,x:`33.9`,y:`7.25`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(6.2 45.5 18.6)`}),(0,L.jsx)(`rect`,{fill:q,x:`7`,y:`34.15`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(6.2 18.6 45.5)`}),(0,L.jsx)(`rect`,{fill:Y,x:`33.9`,y:`34.15`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(-6.2 45.5 45.5)`})]}),search:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{fill:`none`,stroke:K,strokeWidth:`6.5`,d:`M37 37.5 43 43.5`}),(0,L.jsx)(`path`,{fill:`none`,stroke:G,strokeWidth:`12.6`,strokeLinecap:`round`,d:`M44.2 43.8 51.4 51.8`}),(0,L.jsx)(`path`,{fill:`none`,stroke:Y,strokeWidth:`3`,strokeLinecap:`round`,d:`M47.2 42.4 52.8 47.8`}),(0,L.jsx)(`ellipse`,{fill:K,cx:`25.6`,cy:`24.6`,rx:`19.25`,ry:`18.6`}),(0,L.jsx)(`ellipse`,{fill:X,cx:`25.2`,cy:`24.1`,rx:`14.2`,ry:`13.6`})]}),browser:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`rect`,{fill:G,x:`5.9`,y:`6.15`,width:`52.2`,height:`51.7`,rx:`5.5`}),(0,L.jsx)(`path`,{fill:X,d:`M10 16.5H29.4C30.3 16.1 31 14.4 31.8 12.5 32.5 10.9 33.2 10 34.5 10H52.2C53.4 10 54 10.7 54 12V16.5C55.2 16.5 56 17.1 56 18.3V52.4C56 53.7 55.1 54.6 53.8 54.6H10.2C8.9 54.6 8 53.7 8 52.4V18.2C8 17.1 8.7 16.5 10 16.5Z`}),(0,L.jsx)(`circle`,{fill:Y,cx:`12.2`,cy:`11.9`,r:`1.95`}),(0,L.jsx)(`circle`,{fill:K,cx:`18.6`,cy:`11.9`,r:`1.95`}),(0,L.jsx)(`circle`,{fill:J,cx:`25.1`,cy:`11.9`,r:`1.95`}),(0,L.jsx)(`circle`,{fill:q,cx:`32`,cy:`34.9`,r:`14.5`}),(0,L.jsxs)(`g`,{fill:`none`,stroke:X,strokeWidth:`3`,children:[(0,L.jsx)(`ellipse`,{cx:`32`,cy:`34.9`,rx:`7.7`,ry:`13.3`}),(0,L.jsx)(`path`,{d:`M17.5 34.9H46.5`})]})]}),internet:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`ellipse`,{fill:`none`,stroke:Y,strokeWidth:`4.4`,cx:`32.2`,cy:`30.2`,rx:`25.6`,ry:`8.1`,transform:`rotate(-20.8 32.2 30.2)`}),(0,L.jsx)(`circle`,{fill:K,cx:`32`,cy:`32`,r:`21.1`}),(0,L.jsxs)(`g`,{fill:`none`,stroke:X,strokeWidth:`3`,children:[(0,L.jsx)(`ellipse`,{cx:`32`,cy:`31.8`,rx:`12.2`,ry:`18.7`}),(0,L.jsx)(`path`,{d:`M32 13.1V50.5M15 20.4Q32 29 49 20.4M12.5 39Q32 44.6 51.5 39`})]}),(0,L.jsx)(`path`,{fill:`none`,stroke:Y,strokeWidth:`4.4`,d:`M6.6 30.2A25.6 8.1 0 0 0 57.8 30.2`,transform:`rotate(-20.8 32.2 30.2)`})]}),members:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`circle`,{fill:K,cx:`41.9`,cy:`22.85`,r:`12.2`}),(0,L.jsx)(`path`,{fill:K,d:`M36 34C33.8 34.8 32.2 35.8 31 37 37.5 39.5 40.5 43.5 40.5 49.5V53.5H54.5C57 53.5 58 51 58 47.5 58 40 55 35.5 49 34Z`}),(0,L.jsx)(`circle`,{fill:G,cx:`22.95`,cy:`27.6`,r:`12.85`}),(0,L.jsx)(`path`,{fill:G,d:`M15.5 38C10.5 39 7.5 42.5 6.5 47 5.5 50.5 6 53.5 8.5 53.5H38.5C42 52 40 43 36 40 34.5 39 32 38 31 38Z`}),(0,L.jsxs)(`g`,{fill:Z,children:[(0,L.jsx)(`circle`,{cx:`18.3`,cy:`28`,r:`1.6`}),(0,L.jsx)(`circle`,{cx:`27.9`,cy:`28`,r:`1.6`}),(0,L.jsx)(`circle`,{cx:`39.1`,cy:`23.05`,r:`1.55`}),(0,L.jsx)(`circle`,{cx:`47.25`,cy:`23.05`,r:`1.55`})]})]}),sell:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{fill:Y,d:`M6.4 41.2V48.4C6.4 51.4 13.2 54 21.8 54S37.2 51.4 37.2 48.4V41.2C37.2 37.8 30.4 35 21.8 35S6.4 37.8 6.4 41.2Z`}),(0,L.jsx)(`ellipse`,{fill:X,cx:`21.9`,cy:`40.8`,rx:`13.2`,ry:`3.6`}),(0,L.jsxs)(`g`,{transform:`rotate(-3 22.5 30) translate(0.5 0)`,children:[(0,L.jsx)(`path`,{fill:Y,d:`M7.5 26V34C7.5 37.3 14.2 40 22.5 40S37.5 37.3 37.5 34V26C37.5 22.7 30.8 20 22.5 20S7.5 22.7 7.5 26Z`}),(0,L.jsx)(`ellipse`,{fill:X,cx:`23.7`,cy:`26.55`,rx:`13.05`,ry:`4.4`})]}),(0,L.jsxs)(`g`,{transform:`translate(46.3 40.3) rotate(-25)`,children:[(0,L.jsx)(`path`,{fill:G,d:`M-8.5-10Q-8.5-12-7-13L-1.5-16.3Q0-17.2 1.5-16.3L7-13Q8.5-12 8.5-10V9Q8.5 12 5.5 12H-5.5Q-8.5 12-8.5 9Z`}),(0,L.jsx)(`circle`,{fill:X,cx:`0`,cy:`-10.7`,r:`2.2`})]}),(0,L.jsx)(B,{fill:Y,transform:`translate(38.2 18.6) scale(1.1 .86)`}),(0,L.jsx)(B,{fill:Y,transform:`translate(42.8 21.2) rotate(45) scale(1.1 .85)`})]}),schedule:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`rect`,{fill:X,x:`6`,y:`11`,width:`47.6`,height:`44`,rx:`6`}),(0,L.jsx)(`path`,{fill:G,d:`M12 11H47.6Q53.6 11 53.6 17V21.5H6V17Q6 11 12 11Z`}),(0,L.jsxs)(`g`,{fill:X,children:[(0,L.jsx)(`circle`,{cx:`16.1`,cy:`16.15`,r:`3.4`}),(0,L.jsx)(`circle`,{cx:`43.4`,cy:`16.15`,r:`3.4`})]}),(0,L.jsxs)(`g`,{fill:K,children:[(0,L.jsx)(`rect`,{x:`13.6`,y:`6`,width:`5`,height:`11.2`,rx:`2.5`}),(0,L.jsx)(`rect`,{x:`40.9`,y:`6`,width:`5`,height:`11.2`,rx:`2.5`})]}),(0,L.jsxs)(`g`,{fill:q,children:[(0,L.jsx)(`rect`,{x:`11.1`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,L.jsx)(`rect`,{x:`20.7`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,L.jsx)(`rect`,{x:`30.4`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,L.jsx)(`rect`,{x:`20.7`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,L.jsx)(`rect`,{x:`30.4`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,L.jsx)(`rect`,{x:`11.1`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,L.jsx)(`rect`,{x:`30.4`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`})]}),(0,L.jsxs)(`g`,{fill:J,children:[(0,L.jsx)(`rect`,{x:`40.4`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,L.jsx)(`rect`,{x:`11.1`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,L.jsx)(`rect`,{x:`20.7`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`})]}),(0,L.jsx)(`circle`,{fill:Y,cx:`45.5`,cy:`45.6`,r:`12.2`}),(0,L.jsx)(`path`,{fill:`none`,stroke:Z,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M45.1 39.3V46.2L51.3 49.8`}),(0,L.jsx)(`circle`,{fill:Z,cx:`45.1`,cy:`46.2`,r:`2.5`})]}),loop:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{style:{stroke:G},strokeWidth:`6`,strokeLinecap:`round`,d:`M47.5 14.5C43 11 37.5 9 32 9 19.5 9 9 19.5 9 32S19.5 55 32 55 55 44.5 55 32`}),(0,L.jsx)(`path`,{style:{fill:G},d:`M53.5 21.5Q54.5 20 55 22L58 33Q58.5 35 56.5 34.5L48.5 32.5Q47 32 48 30.5Z`}),(0,L.jsx)(`g`,{transform:`translate(18 21) scale(.28)`,children:(0,L.jsx)(H,{fill:K})}),(0,L.jsxs)(`g`,{style:{fill:X},children:[(0,L.jsx)(`rect`,{x:`25`,y:`27.5`,width:`14`,height:`3`,rx:`1.5`}),(0,L.jsx)(`rect`,{x:`25`,y:`33.5`,width:`9`,height:`3`,rx:`1.5`})]})]}),fungi:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`ellipse`,{fill:X,cx:`33.5`,cy:`43.6`,rx:`18.6`,ry:`14.4`,transform:`rotate(-6 33.5 43.6)`}),(0,L.jsx)(`path`,{fill:G,d:`M29.5 6.5C22 7.5 16 11 11 18.5 4 29 4.6 39.6 13.5 42.2 24 45 44 40.5 54 34.6 57.6 32.6 58.6 29.2 57.5 25 56.5 20 53 16 48.5 13 43.5 8 37 5.5 29.5 6.5Z`}),(0,L.jsxs)(`g`,{fill:X,children:[(0,L.jsx)(`ellipse`,{cx:`29`,cy:`15.7`,rx:`8.7`,ry:`6.3`,transform:`rotate(-15.5 29 15.7)`}),(0,L.jsx)(`ellipse`,{cx:`50.8`,cy:`20.1`,rx:`6.5`,ry:`3.5`,transform:`rotate(51.6 50.8 20.1)`}),(0,L.jsx)(`ellipse`,{cx:`13`,cy:`26.8`,rx:`4.2`,ry:`3.3`,transform:`rotate(-54.5 13 26.8)`})]}),(0,L.jsxs)(`g`,{fill:Z,transform:`translate(26.6 46.6) scale(1.1) translate(-33.7 -38.5)`,children:[(0,L.jsx)(`rect`,{x:`31.85`,y:`35.9`,width:`3.75`,height:`5.25`,rx:`1.85`}),(0,L.jsx)(`path`,{d:`M 47.4 34.3 C 46 35 44.6 35.8 43.5 36.7 42.9 37.2 43.2 38.3 44 38.4 45.2 38.6 46.5 38.6 47.7 38.4 48.4 38.3 48.3 37.3 47.6 37.3 46.6 37.4 45.7 37.4 45 37.3 45.9 36.7 46.9 36.1 48 35.6 48.7 35.3 48.2 34 47.4 34.3 Z`}),(0,L.jsx)(`path`,{d:`M 37.4 41.1 C 38.6 44.3 42.6 44.3 43.6 40.5 43.7 40 43.1 39.8 42.9 40.3 41.9 42.8 39.1 42.9 38.3 40.7 38.1 40.2 37.3 40.5 37.4 41.1 Z`})]})]})};function Ue({name:e,size:t}){return(0,L.jsx)(`svg`,{viewBox:`0 0 64 64`,width:t,height:t,fill:`none`,stroke:`none`,"aria-hidden":`true`,focusable:`false`,"data-sigil":e,children:He[e]})}var Q=e(n(),1),We=(e,t)=>p.of(e,`prints`,`share`,t);async function Ge(e,t,n){return n.kind===`stop`?e.stop(t):(n.kind===`reshare`&&await e.stop(t),e.share({requestId:t,showPrompt:n.showPrompt}))}function Ke({app:e,printId:t}){let n=l(),r=We(e,t),[i,a]=(0,Q.useState)(!0),[o,s]=(0,Q.useState)(!1),c=M({...m(e,u,r,e=>e.status(t)),enabled:e.capabilities.has(u)}),d=h({mutationFn:n=>Ge(e.capabilities.require(u),t,n),onSuccess:e=>{n.setQueryData(r,e),s(!1)}}),f=c.data?.shared===!0?c.data:null,p=f===null?i:f.showPrompt,g=c.isPending||d.isPending,_=d.isError||c.isError;return(0,Q.useEffect)(()=>{_&&E(`Sharing is unavailable right now. Try again.`,`prints-share-error`)},[_]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(N,{children:[(0,L.jsxs)(`span`,{className:`prints-info-label`,children:[(0,L.jsx)(Ue,{name:`connected`,size:16}),`Share`]}),(0,L.jsxs)(`span`,{className:`prints-info-value prints-share-value`,children:[(0,L.jsx)(F,{"aria-label":`Public link`,checked:f!==null,disabled:g||c.isError,onCheckedChange:e=>{d.mutate(e?{kind:`share`,showPrompt:i}:{kind:`stop`})}}),f===null?(0,L.jsx)(`span`,{className:`prints-share-note`,children:`Only your Team can see it`}):(0,L.jsx)(I,{density:`compact`,label:o?`Copied`:`Copy link`,icon:o?(0,L.jsx)(P,{}):(0,L.jsx)(Ce,{}),onClick:()=>{navigator.clipboard.writeText(f.url).then(()=>{s(!0)},()=>{s(!1)})}})]})]}),(0,L.jsxs)(N,{children:[(0,L.jsxs)(`span`,{className:`prints-info-label`,children:[(0,L.jsx)(Ue,{name:`sendPrompts`,size:16}),`On page`]}),(0,L.jsxs)(`span`,{className:`prints-info-value prints-share-value`,children:[(0,L.jsx)(F,{"aria-label":`Show the prompt on the public page`,checked:p,disabled:g||c.isError,onCheckedChange:e=>{a(e),f!==null&&d.mutate({kind:`reshare`,showPrompt:e})}}),(0,L.jsx)(`span`,{className:`prints-share-note`,children:p?`Print and prompt`:`Print only`})]})]})]})}function qe(e,t){return t.state===`loading`?`${e} · …`:t.state===`ready`&&t.price!==null?`${e} · ${t.price}`:e}function Je({models:e,source:t,operations:n}){let r=O(e,`remove_background`),i=O(e,`upscale`),a=i===void 0?[]:re(i,t),[o,s]=(0,Q.useState)(void 0),[c,l]=(0,Q.useState)(!1),u=a.find(e=>e.disabledReason===void 0),d=a.find(e=>e.megapixels===o&&e.disabledReason===void 0)?.megapixels??u?.megapixels,f=r===void 0?void 0:j(r,t),p=i===void 0?void 0:j(i,t),m=ce(n.session,r===void 0||f!==void 0?null:A(r,t,void 0)),h=ce(n.session,i===void 0||p!==void 0||d===void 0?null:A(i,t,d));if(r===void 0&&i===void 0)return null;let g=(e,t)=>{l(!0),n.onRun(e,t).finally(()=>{l(!1)})},v=c||n.atLimit,y=n.atLimit?_:void 0,b=a.filter(e=>e.disabledReason);return(0,L.jsxs)(`section`,{className:`prints-info-operations`,"aria-label":`Edit this image`,"data-print-operations":!0,children:[r?(0,L.jsx)(I,{label:qe(k.remove_background,m),icon:(0,L.jsx)(Se,{}),disabled:v||f!==void 0||m.state===`loading`,"aria-busy":m.state===`loading`,title:f??y,"data-operation":`remove_background`,onClick:()=>{g(`remove_background`,void 0)}}):null,i?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(C,{className:`prints-info-sizes`,value:d===void 0?``:String(d),onValueChange:e=>{s(Number(e))},children:(0,L.jsx)(S,{variant:`segmented`,"aria-label":`Upscale output size`,children:a.map(e=>(0,L.jsxs)(w,{value:String(e.megapixels),disabled:e.disabledReason!==void 0,title:e.disabledReason,children:[e.megapixels,` MP`]},e.megapixels))})}),b.length>0?(0,L.jsx)(`p`,{className:`prints-info-hint`,"data-operation-hint":!0,children:b[0]?.disabledReason}):null,(0,L.jsx)(I,{label:qe(d===void 0?k.upscale:`${k.upscale} to ${String(d)} MP`,h),icon:(0,L.jsx)(D,{}),disabled:v||p!==void 0||d===void 0||h.state===`loading`,"aria-busy":h.state===`loading`,title:p??(d===void 0?`This image is already larger than any size offered.`:y),"data-operation":`upscale`,onClick:()=>{g(`upscale`,d)}})]}):null]})}var Ye=(0,Q.lazy)(async()=>({default:(await T(()=>import(`./print-download-button-hClIKKJA.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)).PrintDownloadButton})),Xe=r({print:r({printId:o(),source:a([`recorded`,`file`]),kind:a([`image`,`video`,`audio`]),model:o(),width:c().nullable(),height:c().nullable(),steps:c().nullable(),durationSeconds:c().nullable().optional(),costMilliunits:c(),createdAt:c()}),typed:r({prompt:o(),references:c()}),references:i(r({path:o(),computerId:o().optional()})),characters:i(o())}),Ze=(e,t)=>({style:t,kind:e.print.kind,model:e.print.model,typed:e.typed,references:e.references,steps:e.print.steps,width:e.print.width,height:e.print.height}),Qe={image:`Image`,video:`Video`,audio:`Audio`},$e=(e,t)=>t===0?e:$e(t,e%t),et=(e,t)=>{let n=$e(e,t);return`${String(e/n)}:${String(t/n)}`},tt=new Intl.DateTimeFormat(`en`,{dateStyle:`medium`,timeStyle:`short`});function nt(e,t){let n=e.source,r=n.kind===`computer`?n.path:null,i=n.kind===`computer`?n.computerId:null;return M({...m(t,v,p.of(t,`prints`,`output-details`,i,r),async(e,t)=>{let n=await e.call(`getOutput`,JSON.stringify({path:r}));t.throwIfAborted();let i=Xe.safeParse(n);return i.success?i.data:null}),enabled:!!(t&&r&&i&&t.capabilities.has(v)),retry:!1})}function $({icon:e,label:t,children:n}){return(0,L.jsxs)(N,{children:[(0,L.jsxs)(`span`,{className:`prints-info-label`,children:[(0,L.jsx)(e,{size:16,"aria-hidden":!0}),t]}),(0,L.jsx)(`span`,{className:`prints-info-value`,children:n})]})}function rt({name:e}){let t=e.length>it?e.slice(-it):``;return(0,L.jsxs)(`span`,{className:`prints-info-file`,title:e,"data-print-file":!0,children:[(0,L.jsx)(`span`,{className:`prints-info-file-head`,children:e.slice(0,e.length-t.length)}),t?(0,L.jsx)(`span`,{className:`prints-info-file-tail`,children:t}):null]})}var it=10,at=240;function ot({prompt:e,references:t}){let[n,r]=(0,Q.useState)(!1),[i,a]=(0,Q.useState)(!1),o=e.length>at,s=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>{a(!1)},1500)}catch(e){d(`copy-print-prompt`,e)}};return(0,L.jsxs)(`span`,{className:`prints-info-prompt`,children:[(0,L.jsx)(`span`,{className:`whitespace-pre-wrap`,"data-print-prompt":!0,"data-folded":o&&!n?!0:void 0,children:e}),(0,L.jsx)(le,{tokens:oe(e,[],t,[])}),(0,L.jsxs)(`span`,{className:`prints-info-prompt-tools`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`prints-info-link`,onClick:()=>{s()},children:[i?(0,L.jsx)(P,{"aria-hidden":!0,size:14}):(0,L.jsx)(xe,{"aria-hidden":!0,size:14}),` `,i?`Copied`:`Copy`]}),o?(0,L.jsxs)(`button`,{type:`button`,className:`prints-info-link`,"aria-expanded":n,onClick:()=>{r(!n)},children:[n?(0,L.jsx)(ue,{"aria-hidden":!0,size:14}):(0,L.jsx)(me,{"aria-hidden":!0,size:14}),` `,n?`Show less`:`Show more`]}):null]})]})}function st({image:e,app:t,download:n=(0,L.jsx)(Q.Suspense,{fallback:null,children:(0,L.jsx)(Ye,{source:e.source,app:t})}),referenceImages:r,models:i,canAnimate:a,onIterate:o,operations:s,library:c,onClose:l}){let d=e=>{e&&E(e,`prints-iterate-refusal`)},p=(0,Q.useRef)(null),m=M(ne(t,e.source.kind===`computer`?e.source.path:null)),h=nt(e,t).data,_=h?Ze(h,f(e.file.name)?null:m.data?.style??null):null,v=t=>e.source.kind===`computer`&&b(t,e.source.computerId)?r.find(e=>e.path===t.path):void 0,S=h?g(i,h.print.model):null,C=h?se(h.print.costMilliunits):null,w=S?.transform?.operation,T=h?.references.at(0),D=w!==void 0&&T!==void 0?{operation:k[w],sourcePath:T.path}:null;return(0,Q.useEffect)(()=>{let e=document.activeElement;return p.current?.focus(),()=>{e instanceof HTMLElement&&e.isConnected&&e.focus()}},[]),(0,L.jsxs)(ee,{ref:p,className:`prints-info-drawer`,role:`region`,"aria-label":`Image information`,tabIndex:-1,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),l())},children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-sm`,children:[(0,L.jsxs)(`div`,{className:`prints-info-title`,children:[(0,L.jsx)(`h2`,{className:`text-base font-semibold`,title:e.file.name,children:e.file.name.replace(/\.[^.]+$/,``)}),(0,L.jsx)(`span`,{className:`prints-info-subtitle`,children:h?`${Qe[h.print.kind]} · ${tt.format(h.print.createdAt)}`:`Image info`})]}),(0,L.jsx)(ve,{className:`prints-info-close`,"aria-label":`Close image information`,icon:(0,L.jsx)(pe,{}),onClick:l})]}),(0,L.jsxs)(`div`,{className:`prints-info-actions`,role:`group`,"aria-label":`Image actions`,children:[_&&e.source.kind===`computer`?(0,L.jsxs)(L.Fragment,{children:[D===null?(0,L.jsx)(I,{label:`Reuse`,icon:(0,L.jsx)(de,{}),disabled:m.isPending,onClick:()=>{d(o(`reuse`,_))}}):null,_.kind===`audio`?null:(0,L.jsx)(I,{label:`Remix`,icon:(0,L.jsx)(De,{}),disabled:m.isPending,onClick:()=>{d(o(`remix`,_))}}),a&&_.kind===`image`?(0,L.jsx)(I,{label:`Animate`,icon:(0,L.jsx)(be,{}),disabled:m.isPending,onClick:()=>{d(o(`animate`,_))}}):null]}):null,c?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(I,{label:c.favorite?`Unfavorite`:`Favorite`,icon:(0,L.jsx)(ge,{}),onClick:c.onToggleFavorite}),c.onMove?(0,L.jsx)(I,{label:`Move to…`,icon:(0,L.jsx)(he,{}),onClick:c.onMove}):null]}):null,n]}),s&&h?.print.kind===`image`&&e.source.kind===`computer`?(0,L.jsx)(Je,{models:i,source:{computerId:e.source.computerId,path:e.source.path,width:e.width,height:e.height},operations:s}):null,(0,L.jsxs)(ae,{density:`compact`,className:`prints-info-facts`,children:[(0,L.jsx)($,{icon:fe,label:`File`,children:(0,L.jsx)(rt,{name:e.file.name})}),f(e.file.name)?null:(0,L.jsxs)($,{icon:Ee,label:`Size`,children:[e.width,` × `,e.height,` ·`,` `,et(e.width,e.height)]}),m.data?.style&&!f(e.file.name)?(0,L.jsx)($,{icon:Te,label:`Style`,children:m.data.style}):null,h&&D===null?(0,L.jsx)($,{icon:we,label:`Prompt`,children:(0,L.jsx)(ot,{prompt:h.typed.prompt,references:h.references.map((e,t)=>({number:t+1,name:e.path.split(`/`).at(-1)??e.path,url:v(e)?.url}))})}):null,h?(0,L.jsx)($,{icon:ie,label:`Model`,children:(0,L.jsx)(`span`,{"data-print-model":!0,children:S?y(S):`${h.print.model} (no longer available)`})}):null,h&&D!==null?(0,L.jsx)($,{icon:ke,label:`Made from`,children:(0,L.jsxs)(`span`,{"data-print-source":!0,children:[D.operation,` of`,` `,D.sourcePath.split(`/`).at(-1)??D.sourcePath]})}):null,h&&h.characters.length>0?(0,L.jsx)($,{icon:Oe,label:`Characters`,children:(0,L.jsx)(`span`,{"data-print-characters":!0,children:h.characters.map(e=>`@${e}`).join(`, `)})}):null,h&&h.references.length>0?(0,L.jsx)($,{icon:_e,label:`References`,children:(0,L.jsx)(`ul`,{className:`prints-info-references`,"data-print-references":!0,"aria-label":`${String(h.references.length)} references`,children:h.references.map((e,t)=>{let n=e.path.split(`/`).at(-1),r=v(e);return(0,L.jsxs)(`li`,{title:e.path,children:[r?(0,L.jsx)(`img`,{src:r.url,alt:``}):null,(0,L.jsx)(`span`,{"data-print-reference-name":!0,children:n})]},`${String(t)}:${e.path}`)})})}):null,h!=null&&h.print.kind!==`image`&&h.print.durationSeconds!=null?(0,L.jsx)($,{icon:x,label:`Duration`,children:(0,L.jsx)(`span`,{"data-print-duration":!0,children:te(h.print.durationSeconds)})}):null,h?.print.source===`recorded`&&C!==null?(0,L.jsx)($,{icon:ye,label:`Cost`,children:(0,L.jsx)(`span`,{"data-print-cost":!0,children:C})}):null,h?(0,L.jsx)($,{icon:x,label:`Made`,children:tt.format(h.print.createdAt)}):null,t&&h?.print.source===`recorded`&&t.capabilities.has(u)?(0,L.jsx)(Ke,{app:t,printId:h.print.printId}):null]})]})}export{st as PrintInfoDrawer};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./print-download-button-hClIKKJA.js","./rolldown-runtime-hePW80VL.js","./button-oE2Hrd5D.js","./modules-C4mfDnjH.js","./dist-Cc0qB3Mq.js","./log-event-R2fM9w5a.js","./useMutation-RbhZiO3b.js","./computer-Dlwsjq-K.js","./ellipsis-DlNHenkt.js","./dropdown-menu-Bp_cc0HZ.js","./useTriggerFocusGuards-Bddw7Qdn.js","./keycap-D2RkH2IS.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,Vn as n,b as r,n as i,v as a,x as o}from"./button-oE2Hrd5D.js";import{d as s,t as c,u as l}from"./log-event-R2fM9w5a.js";import{A as u,D as d,E as f,O as p,_ as m,g as h,h as g,i as _,k as v,m as y,n as b,r as x,t as S,v as C}from"./audio-waveform-view-CqGGEmLT.js";import{c as w,n as T,r as E,s as D,t as O}from"./audio-waveform-CKaaFNjh.js";import{a as k}from"./status-DNJRO5m5.js";import{a as A,u as j}from"./dropdown-menu-Bp_cc0HZ.js";import{n as M,t as N}from"./keycap-D2RkH2IS.js";import{c as P,l as F,n as I,s as L,t as R}from"./dialog-BXLOuKaF.js";var z=o(`ExternalLink`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),B=o(`Maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),V=t(),H=e(n(),1),U=r(`badge caps-badge`,{variants:{tone:{neutral:`badge-neutral`,primary:`badge-primary`,secondary:`badge-secondary`,accent:`badge-accent`,success:`badge-success`,info:`badge-info`,warning:`badge-warning`,error:`badge-error`},size:{sm:`badge-sm`,default:`badge-md`,lg:`badge-lg`},variant:{solid:``,quiet:`caps-badge-quiet`}},defaultVariants:{tone:`neutral`,size:`default`}}),W=(0,H.forwardRef)(function({className:e,size:t,tone:n,variant:r,...i},o){return(0,V.jsx)(`span`,{...i,className:a(U({size:t,tone:n,variant:r}),e),ref:o})});function G(e){return e.map(e=>e.key)}function K(e,t,n){let r=e.indexOf(t);return r<0?null:e[r+n]??null}function q(e,t,n){if(e.includes(t))return t;let r=n.indexOf(t);if(r>=0){let t=new Set(e);for(let e=1;e<n.length;e+=1)for(let i of[e,-e]){let e=r+i;if(e<0||e>=n.length)continue;let a=n[e];if(t.has(a))return a}}return e[0]??null}function J({facts:e}){let t=b(e.url,s),n=T(e.url,96),r=e.durationSeconds??(n.status===`ready`?n.durationSeconds:void 0),i=e.mode===void 0?`Audio`:_[e.mode],a=t.progress*(r??0);return(0,V.jsxs)(`section`,{"aria-label":`${i} print`,className:`prints-audio-stage`,"data-audio-stage":!0,children:[(0,V.jsx)(W,{size:`sm`,variant:`quiet`,children:i}),(0,V.jsx)(`button`,{"aria-label":`Seek`,className:`prints-audio-stage-seek`,type:`button`,onClick:e=>{let n=e.currentTarget.getBoundingClientRect();t.seek((e.clientX-n.left)/n.width)},children:(0,V.jsx)(S,{bars:96,className:`prints-audio-stage-waveform`,progress:t.progress,url:e.url})}),(0,V.jsxs)(`div`,{className:`prints-audio-stage-controls`,children:[(0,V.jsx)(M,{"aria-label":t.playing?`Pause`:`Play`,icon:t.playing?(0,V.jsx)(d,{}):(0,V.jsx)(f,{}),iconSize:`md`,size:`default`,variant:`accent`,onClick:t.toggle}),(0,V.jsxs)(`span`,{className:`prints-audio-stage-time`,children:[O(a,`elapsed`),r===void 0?null:` / ${O(r)}`]})]})]})}var Y=(0,H.lazy)(async()=>({default:(await E(()=>import(`./print-download-button-hClIKKJA.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)).PrintDownloadButton}));function X({url:e,path:t,onError:n,autoPlay:r}){let i=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let t=i.current;if(!t)return;let a=!1;return r&&t.play().catch(t=>{a||t instanceof DOMException&&(t.name===`NotAllowedError`||t.name===`AbortError`)||(c(`play-print-video`,t),n(e))}),()=>{a=!0,t.pause()}},[e,n,r]),(0,V.jsx)(`video`,{ref:i,src:e,"aria-label":t,controls:!0,playsInline:!0,preload:`auto`,className:`block max-h-full max-w-full object-contain`,onError:()=>{n(e)}})}function Z({item:e,actualSize:t}){let[n,r]=(0,H.useState)(null),[a,o]=(0,H.useState)(null),s=e.pending===!0&&!e.onVisible,[c,u]=(0,H.useState)(s);s&&!c&&u(!0);let d=e.pendingLabel??`Loading print…`,f=s?`Not saved`:`Prints can’t show this file`,p=(0,V.jsx)(`img`,{src:e.url,alt:e.path,decoding:`async`,width:t?e.width:void 0,height:t?e.height:void 0,className:t?`block max-w-none`:`block max-h-full max-w-full object-contain`,onLoad:()=>{r(e.url)},onError:()=>{o(e.url)}},e.url);return(0,V.jsx)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 items-center justify-center overflow-hidden`,"data-print-viewer-stage":!0,children:e.error||a===e.url?(0,V.jsx)(x,{status:`failed`,className:`h-full w-full`,failure:(0,V.jsxs)(`div`,{className:`flex max-w-full flex-col items-center gap-sm px-md text-center`,children:[(0,V.jsx)(`p`,{className:`max-w-full break-words text-sm`,children:e.path}),(0,V.jsx)(y,{density:`tile`,message:e.error?`${f}: ${e.error}`:f,onRetry:e.onRetry,onDismiss:e.onDismiss})]})}):l(e.path)&&e.url?(0,V.jsx)(J,{facts:{url:e.url}}):j(e.path)&&e.url?(0,V.jsx)(X,{url:e.url,path:e.path,onError:o,autoPlay:!c}):e.url?(0,V.jsxs)(V.Fragment,{children:[t?(0,V.jsx)(g,{className:`h-full w-full`,role:`region`,"aria-label":`Actual-size print`,tabIndex:0,"data-print-viewer-scroll":!0,children:p}):p,n===e.url?null:(0,V.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,V.jsx)(i,{label:`Loading print`,variant:`bloom`})})]}):(0,V.jsx)(x,{status:`generating`,label:d,className:`h-full w-full`,indicator:(0,V.jsxs)(`div`,{"aria-hidden":`true`,className:`flex max-w-full flex-col items-center gap-sm px-md text-center`,children:[(0,V.jsx)(i,{decorative:!0,variant:`bloom`}),(0,V.jsx)(`p`,{className:`text-sm`,children:d})]})})})}var Q=`(max-width: 640px)`;function $(){return(0,H.useSyncExternalStore)(e=>{let t=globalThis.matchMedia(Q);return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}},()=>globalThis.matchMedia(Q).matches,()=>!1)}function ee(e){let[t,n]=(0,H.useState)(!1);return{pending:t,open:()=>{e&&(n(!0),m(e).catch(t=>{c(`open-print-in-inkcap`,t),D(`Could not open ${e.path} in Inkcap.`,`prints-inkcap-open`)}).finally(()=>{n(!1)}))}}}function te({source:e,app:t,inkcap:n,phone:r}){let i=e.kind===`computer`&&n?e:null,a=ee(i);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(H.Suspense,{fallback:null,children:(0,V.jsx)(Y,{source:e,app:t,presentation:r?`menu`:`key`,menuItems:i?(0,V.jsx)(A,{disabled:a.pending,onSelect:a.open,children:`Open in Inkcap`}):void 0})}),i&&!r?(0,V.jsx)(N,{label:`Open in Inkcap`,icon:(0,V.jsx)(z,{}),disabled:a.pending,onClick:a.open}):null]})}function ne({items:e,images:t,viewerKey:n,app:r,onNavigate:i,onClose:a,renderInfo:o}){let s=(0,H.useRef)(null),c=C(r),d=$(),f=G(e),m=(0,H.useRef)(f),g=n===null?null:q(f,n,m.current);(0,H.useEffect)(()=>{m.current=f,n!==null&&g!==n&&(g===null?a(n):i(g))},[f,g,n,a,i]),(0,H.useEffect)(()=>{if(g===null)return;let t=e.findIndex(e=>e.key===g);for(let n of e.slice(Math.max(0,t-1),t+2))n.onVisible?.()},[e,g]);let[_,y]=(0,H.useState)(null),[b,x]=(0,H.useState)(null);(0,H.useEffect)(()=>{x(null)},[g]),(0,H.useEffect)(()=>{y(null)},[n]);let S=e.find(e=>e.key===g),T=t.find(e=>h(e)===g);if(!S||g===null)return null;let E=K(f,g,-1),D=K(f,g,1),O=S.path.split(`/`).at(-1)??S.path,A=()=>{a(g)},N=e=>{e!==null&&i(e)};return(0,V.jsx)(R,{open:!0,onOpenChange:e=>{e||A()},children:(0,V.jsxs)(P,{children:[(0,V.jsx)(I,{}),(0,V.jsxs)(L,{ref:s,size:`fill`,initialFocus:s,finalFocus:!1,className:`flex min-h-0 flex-col gap-sm`,onKeyDown:e=>{e.altKey||e.ctrlKey||e.metaKey||e.target instanceof HTMLElement&&e.target.closest(`input, textarea, select, video, [data-print-viewer-scroll], [contenteditable=true]`)||(e.key===`ArrowLeft`||e.key===`ArrowRight`?(e.preventDefault(),N(e.key===`ArrowLeft`?E:D)):e.key.toLowerCase()===`i`&&T&&(e.preventDefault(),y(_===g?null:g)))},children:[(0,V.jsx)(w,{className:`prints-viewer-frame`,children:(0,V.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,V.jsxs)(`div`,{className:`prints-viewer-caption`,"data-print-viewer-caption":!0,children:[(0,V.jsx)(F,{className:`prints-viewer-caption-name truncate text-xs font-normal`,children:O}),(0,V.jsxs)(`span`,{className:`prints-viewer-caption-position`,"aria-live":`polite`,"aria-atomic":`true`,children:[(0,V.jsxs)(`span`,{className:`sr-only`,children:[O,`, `]}),f.indexOf(g)+1,` of `,f.length]})]}),(0,V.jsxs)(`div`,{className:`@container relative flex min-h-0 min-w-0 flex-1`,children:[(0,V.jsx)(Z,{item:S,actualSize:b===g},g),_===g&&T?o(T,()=>{y(null)}):null]})]})}),(0,V.jsxs)(`div`,{className:`prints-viewer-actions`,children:[(0,V.jsx)(M,{size:`default`,iconSize:`md`,"aria-label":`Previous print`,title:`Previous print (Left arrow)`,"aria-keyshortcuts":`ArrowLeft`,icon:(0,V.jsx)(u,{}),disabled:E===null,onClick:()=>{N(E)}}),(0,V.jsx)(M,{size:`default`,iconSize:`md`,"aria-label":`Next print`,title:`Next print (Right arrow)`,"aria-keyshortcuts":`ArrowRight`,icon:(0,V.jsx)(v,{}),disabled:D===null,onClick:()=>{N(D)}}),(0,V.jsx)(M,{size:`default`,iconSize:`md`,"aria-label":`Image info`,title:`Image info (I)`,"aria-keyshortcuts":`i`,"aria-expanded":_===g,icon:(0,V.jsx)(p,{}),disabled:!T,onClick:()=>{y(_===g?null:g)}}),!j(S.path)&&!l(S.path)?(0,V.jsx)(M,{size:`default`,iconSize:`md`,"aria-label":`Actual size`,title:`Actual size`,"aria-pressed":b===g,active:b===g,icon:(0,V.jsx)(B,{}),disabled:!S.url||!!S.error,onClick:()=>{x(b===g?null:g)}}):null,T?(0,V.jsx)(te,{source:T.source,app:r,inkcap:c,phone:d},`${g}\n${T.url}`):null,(0,V.jsx)(M,{size:`default`,iconSize:`md`,"aria-label":`Close viewer`,title:`Close viewer (Escape)`,icon:(0,V.jsx)(k,{}),onClick:A})]})]})]})})}export{ne as PrintViewer};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$t as t,C as n,Ct as r,E as i,F as a,Ft as o,I as s,It as c,Jt as l,K as u,L as d,M as f,Nt as p,P as m,Pt as h,Qt as g,S as _,St as v,T as y,U as b,V as x,Vn as S,X as C,Xt as w,Yt as T,Z as E,Zt as D,_ as O,_t as k,a as A,an as j,bt as M,dt as N,en as P,ft as F,gt as I,h as L,ht as R,in as z,j as ee,jt as te,kn as ne,kt as B,mt as re,nn as ie,o as ae,on as oe,pt as se,rn as ce,s as le,st as ue,t as V,tn as de,v as H,vt as U,w as W,wt as fe,x as pe,xt as me,yt as he,z as ge}from"./button-oE2Hrd5D.js";import{a as _e,d as ve,i as ye,l as be,m as xe,t as Se,u as Ce}from"./textarea-LIOZDOK4.js";import{i as we,o as Te,r as Ee,t as De}from"./status-DNJRO5m5.js";import{_ as Oe,a as ke,c as Ae,d as je,f as G,g as Me,h as K,i as Ne,l as Pe,m as Fe,n as Ie,o as Le,p as Re,r as ze,s as Be,t as Ve,u as He}from"./upload-queue-BHAaEiPu.js";import{r as Ue}from"./modules-C4mfDnjH.js";import{A as We,B as Ge,C as Ke,D as qe,E as Je,F as Ye,G as Xe,Gt as Ze,H as Qe,I as $e,Kt as et,M as tt,N as nt,O as rt,On as it,P as at,Q as ot,S as st,St as ct,T as lt,Tn as ut,U as dt,V as ft,W as pt,X as mt,Y as ht,_ as gt,a as _t,b as q,bn as vt,bt as yt,c as bt,f as xt,fn as St,g as Ct,gn as wt,h as Tt,i as Et,j as Dt,k as Ot,kn as kt,lt as At,m as jt,mn as Mt,n as Nt,o as Pt,p as Ft,qt as It,r as Lt,s as Rt,t as zt,tt as Bt,u as Vt,v as Ht,vt as Ut,w as Wt,x as Gt,y as Kt,yn as J}from"./useTriggerFocusGuards-Bddw7Qdn.js";import{t as qt}from"./keycap-D2RkH2IS.js";import{a as Jt,i as Yt,l as Xt,o as Zt,r as Qt,t as $t}from"./dialog-BXLOuKaF.js";var en=pe(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),tn=pe(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Y=e(S(),1);function nn({getKey:e,isDisabled:t=()=>!1,items:n}){let r=(0,Y.useMemo)(()=>{let r=n.map(e);if(r.some(e=>!e))throw Error(`Selectable items require non-empty keys`);if(new Set(r).size!==r.length)throw Error(`Selectable items require unique keys`);return n.filter(e=>!t(e))},[e,t,n]),[i,a]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{i!==null&&!r.some(t=>e(t)===i)&&a(null)},[i,r,e]);let o=r.find(t=>e(t)===i),s=o?r.findIndex(t=>e(t)===i):-1;return{activeIndex:s,activeItem:o,activeKey:i,enabledItems:r,move:(t,n)=>{if(r.length===0)return;let i=n?n===`start`?0:r.length-1:s<0?t>0?0:r.length-1:(s+t+r.length)%r.length,o=r[i];o&&a(e(o))},setActiveKey:a}}var rn=u(a),an=u(s({message:a}));function on(e){for(let t of e.errors){let e=te(c(h(an(t),e=>e.message),()=>rn(t)));if(e!==void 0&&e.length>0)return e}}var sn=Y.createContext(void 0);function X(e){let t=Y.useContext(sn);if(t===void 0&&!e)throw Error(J(47));return t}var cn=e(_(),1),ln={...q,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!q.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&q.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>q.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},un=class extends Gt{constructor(e,t,n){let r=new Wt;super(dn(e,r,t,n),fn(r),ln)}setOpen=(e,t)=>{let n=t.reason===Ut,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=qe(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=Ot(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),cn.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function dn(e,t,n,r=!1){let i={...Kt(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function fn(e){return{popupRef:Y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:Y.createRef(),beforeTriggerFocusGuardRef:Y.createRef(),beforeContentFocusGuardRef:Y.createRef(),stickIfOpenTimeout:new vt,stickIfOpen:!0,triggerElements:e}}var Z=n(),pn=st(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=hn(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),at(u,d),We(u);let{forceUnmount:m}=Dt(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),Y.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),Y.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,yt(At))}),[m,u]);let h=d||f||s!=null;return(0,Z.jsxs)(sn.Provider,{value:u,children:[s&&(0,Z.jsx)(Je,{handle:s,store:u}),h&&(0,Z.jsx)(gn,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function mn(e){return X(!0)?(0,Z.jsx)(pn,{props:e}):(0,Z.jsx)(pt,{children:(0,Z.jsx)(pn,{props:e})})}function hn(e,t){let n=nt((e,n)=>new un(t,e,n));return Y.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function gn({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=Ge(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference,a=r.floating;return tt(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}var _n=Ke(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=X(!0),h=Ht(s)??m;if(!h)throw Error(J(74));let g=Mt(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=Y.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=Ye(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`isPressOpenedByTrigger`,g),T=h.useState(`isTouchPressOpen`,l),E=h.useState(`hasTriggerFocusGuards`,g),D=Ct(v,{enabled:!a&&l&&!T,mouseOnly:!0,move:!1,handleClose:Tt(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=ut(()=>h.context.stickIfOpen),k=ft(v,{stickIfOpen:O}),A=Vt(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,C),{getButtonProps:M,buttonRef:N}=ct({disabled:a,native:o}),P={open(e){return w?et.open(e):It.open(e)}},{handlePreFocusGuardFocus:F,handleFocusTargetFocus:I}=zt(h,x),L=wt(`button`,e,{state:{disabled:a,open:y},ref:[N,t,S,x],props:[k.reference,D,j,A,{[mt]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,M],stateAttributesMapping:P}),R=(0,Z.jsx)(Y.Fragment,{children:L},g);return E?(0,Z.jsxs)(Y.Fragment,{children:[(0,Z.jsx)(Bt,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:F}),R,(0,Z.jsx)(Bt,{ref:h.context.triggerFocusTargetRef,onFocus:I})]}):R}),vn=Y.createContext(void 0);function yn(){let e=Y.useContext(vn);if(e===void 0)throw Error(J(45));return e}var bn=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return X().useState(`mounted`)||n?(0,Z.jsx)(vn.Provider,{value:n,children:(0,Z.jsx)(ht,{ref:t,...r})}):null}),xn=Y.createContext(void 0);function Sn(){let e=Y.useContext(xn);if(!e)throw Error(J(46));return e}var Cn=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=ot,..._}=e,v=X(),y=yn(),b=Xe(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`adaptiveOrigin`),M=_t({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:j}),N=x.useState(`domReferenceElement`);Et({store:v,domReference:N,positionerElement:O,open:C});let P=E===!0&&w!==`trigger-hover`;Nt(C&&P,D===`touch`,O,T);let F=v.useStateSetter(`positionerElement`),I={open:C,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:k},L=Lt(e,I,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,F],hidden:!S,inert:!C});return(0,Z.jsxs)(xn.Provider,{value:M,children:[S&&P&&(0,Z.jsx)(xt,{inert:Ft(!C),cutout:T}),(0,Z.jsx)(dt,{id:b,children:L})]})}),wn=Y.createContext(void 0);function Tn(){let[e,t]=Y.useState(0),n=ut(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:Y.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var En=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=X(),l=Sn(),u=Rt(!0)!=null,{context:d,hasClosePart:f}=Tn(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);$e({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),gt(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?rt(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M={open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},N=wt(`div`,e,{state:M,ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...lt,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&jt.has(e.key)&&e.stopPropagation()}},Pt(g),s],stateAttributesMapping:Ze});return(0,Z.jsx)(Qe,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:St(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Z.jsx)(wn.Provider,{value:d,children:N})})}),Dn=(0,Y.forwardRef)(function({children:e,className:t,type:n=`button`,...r},i){return(0,Z.jsxs)(`button`,{...r,ref:i,type:n,className:H(`select caps-select caps-combobox-trigger w-full`,t),children:[(0,Z.jsx)(`span`,{children:e}),(0,Z.jsx)(Te,{className:`caps-select-chevron`,"aria-hidden":`true`})]})});function On({defaultInputValue:e,defaultOpen:t,defaultValue:n,getKey:r,getSearchText:i,groupBy:a,id:o,isDisabled:s,items:c,onOpenChange:l,onCommit:u,multiple:d,controlledOpen:f,controlledKeys:p,trigger:m}){let h=`${o}-listbox`,[g,_]=(0,Y.useState)(e),[v,y]=(0,Y.useState)(!1),[b,x]=(0,Y.useState)(n),[S,C]=(0,Y.useState)(t),w=p??(b===null?[]:[b]),T=m?f??S:!0,E=(0,Y.useMemo)(()=>{let e=g.trim().toLowerCase();return e?c.filter(t=>i(t).toLowerCase().includes(e)):c},[i,c,g]),D=nn({getKey:r,isDisabled:s,items:E});(0,Y.useEffect)(()=>{if(D.activeKey!==null)return;let e=D.enabledItems.find(e=>w.includes(r(e)))??D.enabledItems[0];e&&D.setActiveKey(r(e))},[D.activeKey,D.enabledItems,D.setActiveKey,r,w]);let O=e=>{y(!1),e||_(``),f===void 0&&C(e),l?.(e)},k=e=>`${h}-option-${encodeURIComponent(e)}`,A=e=>{let t=r(e);p===void 0&&x(t),u(e),m&&!d&&O(!1)},j=e=>{y(!0),_(e.target.value),D.setActiveKey(null)},M=e=>{if(be(e))return;let t;switch(e.key){case`ArrowDown`:t=[1,void 0];break;case`ArrowUp`:t=[-1,void 0];break;case`End`:t=[1,`end`];break;case`Home`:t=[-1,`start`]}t?(y(!0),e.preventDefault(),D.move(t[0],t[1])):e.key===`Enter`&&D.activeItem&&(e.preventDefault(),A(D.activeItem))},N=(0,Y.useMemo)(()=>{if(!a)return[{label:``,items:E}];let e=new Map;for(let t of E){let n=a(t),r=e.get(n);r?r.push(t):e.set(n,[t])}return[...e].map(([e,t])=>({label:e,items:t}))},[E,a]);return{keyboardNavigation:v,onPointerMove:()=>{y(!1)},activeKey:D.activeKey,activeItem:D.activeItem,groups:N,inputValue:g,listboxId:h,onInputChange:j,onInputKeyDown:M,optionId:k,open:T,commit:A,selectedKeys:w,setOpen:O}}function kn(e){let{"aria-describedby":t,"aria-invalid":n,"aria-label":r,"aria-labelledby":i,"aria-required":a,activeTone:o=`neutral`,container:s,contentClassName:c,defaultInputValue:l=``,defaultOpen:u=!1,defaultValue:d=null,emptyMessage:f=`No matches`,getKey:p,getLabel:m,getSearchText:h=m,groupBy:g,id:_,inputProps:v,inputRef:y,isDisabled:b=()=>!1,items:x,onOpenChange:S,onValueChange:C,multiple:w,open:T,placeholder:E=`Search…`,renderItem:D,rootRef:O,trigger:k,triggerRef:A,value:j,...M}=e,N=e=>{let t=p(e);if(w){let e=j.includes(t)?j.filter(e=>e!==t):[...j,t];C?.(e,x.filter(t=>e.includes(p(t))))}else C?.(t,e)},P;w?P=j:j!==void 0&&(P=j===null?[]:[j]);let F=(0,Y.useId)(),I=k?.props??v,L=_??I?.id??F,R={id:L,"aria-describedby":[t,I?.[`aria-describedby`]].filter(Boolean).join(` `)||void 0,"aria-invalid":n??I?.[`aria-invalid`],"aria-label":I?.[`aria-label`]??r,"aria-labelledby":I?.[`aria-labelledby`]??i,"aria-required":a??I?.[`aria-required`]},{keyboardNavigation:z,onPointerMove:ee,activeItem:te,activeKey:ne,commit:B,groups:re,inputValue:ie,listboxId:ae,onInputChange:oe,onInputKeyDown:se,open:ce,optionId:le,selectedKeys:ue,setOpen:V}=On({defaultInputValue:l,defaultOpen:u,defaultValue:d,getKey:p,getSearchText:h,groupBy:g,id:L,isDisabled:b,items:x,onOpenChange:S,onCommit:N,multiple:w??!1,controlledOpen:T,controlledKeys:P,trigger:k});it(()=>{k&&V(!1)});let de=kt(`popover`),U=s===void 0?de:s,W=bt(`.caps-combobox-option[data-active="true"]:not(:disabled), [data-navigation="pointer"] .caps-combobox-option:hover:not(:disabled)`),fe=(0,Z.jsx)(G,{...v,...k?{}:R,"aria-activedescendant":te?le(p(te)):void 0,"aria-autocomplete":`list`,"aria-controls":ae,"aria-expanded":!0,className:H(`input-sm`,v?.className),id:k?v?.id??`${L}-input`:L,onChange:e=>{v?.onChange?.(e),oe(e)},onKeyDown:e=>{v?.onKeyDown?.(e),e.defaultPrevented||se(e)},placeholder:v?.placeholder??E,ref:y,role:`combobox`,value:ie}),pe=(0,Z.jsx)(`div`,{id:ae,ref:W,className:`caps-combobox-list`,"data-navigation":z?`keyboard`:`pointer`,onPointerMove:ee,role:`listbox`,"aria-multiselectable":w??void 0,children:re.every(e=>e.items.length===0)?(0,Z.jsx)(`div`,{className:`px-md py-md text-sm text-base-content`,children:f}):re.map(e=>(0,Z.jsxs)(`div`,{"aria-label":e.label||void 0,role:e.label?`group`:void 0,children:[e.label?(0,Z.jsx)(`div`,{className:`px-md pb-xs pt-sm text-xs text-base-content uppercase tracking-wider`,children:e.label}):null,e.items.map(e=>{let t=p(e),n=b(e),r=ne===t,i={active:r,disabled:n,selected:ue.includes(t)};return(0,Z.jsxs)(`button`,{"aria-disabled":n||void 0,"aria-selected":i.selected,className:`caps-combobox-option`,"data-active":r&&z,disabled:n,id:le(t),onClick:()=>{B(e)},onMouseDown:e=>{e.preventDefault()},role:`option`,tabIndex:-1,type:`button`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`caps-combobox-check`,children:i.selected?(0,Z.jsx)(xe,{}):null}),D?.(e,r,i)??m(e)]},t)})]},e.label))});return k?(0,Z.jsx)(`div`,{...M,className:H(M.className),ref:O,children:(0,Z.jsxs)(mn,{modal:!0,onOpenChange:V,open:ce,children:[(0,Z.jsx)(_n,{...R,"aria-haspopup":`dialog`,className:`btn`,ref:A,render:k}),U===null?null:(0,Z.jsx)(bn,{container:U,children:(0,Z.jsx)(Cn,{align:`start`,side:`bottom`,sideOffset:4,children:(0,Z.jsxs)(En,{"data-active-tone":o,className:H(`min-w-40 rounded-box border border-base-300 bg-base-100 p-xs shadow-lg outline-none caps-combobox-panel caps-combobox-popup`,c),children:[(0,Z.jsx)(`div`,{className:`caps-combobox-search`,children:fe}),pe]})})})]})}):(0,Z.jsx)(`div`,{...M,className:H(M.className),ref:O,children:(0,Z.jsxs)(`div`,{className:H(`caps-combobox-panel`,c),"data-active-tone":o,children:[(0,Z.jsx)(`div`,{className:`caps-combobox-search`,children:fe}),pe]})})}function An({icon:e,caption:t}){return(0,Z.jsxs)(`span`,{className:`caps-icon-choice-mark`,"aria-hidden":`true`,children:[(0,Z.jsx)(`span`,{className:`caps-icon-choice-art`,children:e}),t?(0,Z.jsx)(`span`,{className:`caps-icon-choice-caption`,children:t}):null,(0,Z.jsx)(`span`,{className:`caps-icon-choice-lamp`})]})}var jn=(0,Y.forwardRef)(function({label:e,icon:t,caption:n,appearance:r,className:i,...a},o){return(0,Z.jsx)(`label`,{className:`caps-icon-choice`,"data-appearance":r===`compact`?r:void 0,children:(0,Z.jsx)(Ie,{...a,appearance:r??`default`,"aria-label":e,className:H(`caps-icon-choice-input`,i),indicator:(0,Z.jsx)(An,{icon:t,caption:n}),ref:o})})}),Mn=(0,Y.forwardRef)(function({label:e,icon:t,hint:n,className:r,...i},a){let o=(0,Y.useId)(),s=[i[`aria-describedby`],n?o:null].filter(Boolean).join(` `)||void 0;return(0,Z.jsx)(`label`,{className:`caps-check-key`,children:(0,Z.jsx)(Ie,{...i,"aria-label":e,"aria-describedby":s,className:H(`caps-check-key-input`,r),indicator:(0,Z.jsxs)(`span`,{className:`caps-check-key-face`,"aria-hidden":`true`,children:[t?(0,Z.jsx)(`span`,{className:`caps-check-key-icon`,children:t}):null,(0,Z.jsxs)(`span`,{className:`caps-check-key-copy`,children:[(0,Z.jsx)(`span`,{className:`caps-check-key-label`,children:e}),n?(0,Z.jsx)(`span`,{className:`caps-check-key-hint`,id:o,children:n}):null]}),(0,Z.jsx)(`span`,{className:`caps-check-key-lamp`})]}),ref:a})})});function Nn({className:e,...t}){return(0,Z.jsx)(`div`,{...t,className:H(`caps-check-keys`,e)})}function Pn({checked:e}){let t=`caps-radio-${(0,Y.useId)().replaceAll(`:`,``)}`,n=(0,Y.useRef)(null),r=(0,Y.useRef)(e).current,i=(0,Y.useRef)(e),a=(0,Y.useRef)(null),o=L(a),{reduced:s}=o;return(0,Y.useLayoutEffect)(()=>{if(!n.current)return;let t=s||i.current===e;i.current=e;let r=e?4:0,a=Ee(o,{ease:`outCubic`,duration:75}),c=e?we(o,{bounce:.65,duration:300}):Ee(o,{ease:`inCubic`,duration:100}),l=Ue(n.current,t?{rx:r,ry:r,cy:6,duration:0}:{rx:[{to:e?3.5:4.15,...a},{to:r,...c}],ry:[{to:e?4.5:3.85,...a},{to:r,...c}],cy:[{to:e?5.85:6.1,...a},{to:6,...c}]});return()=>{l.cancel()}},[e,s,o]),(0,Z.jsxs)(`svg`,{ref:a,className:`caps-radio-visual`,width:`24`,height:`24`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,Z.jsxs)(`defs`,{children:[(0,Z.jsx)(le,{id:`${t}-surface`,transform:`matrix(1 0 0 1 6 6)`}),(0,Z.jsx)(ae,{id:`${t}-shadow`}),(0,Z.jsx)(A,{id:`${t}-inset`}),(0,Z.jsx)(`clipPath`,{id:`${t}-well`,children:(0,Z.jsx)(`circle`,{cx:`6`,cy:`6`,r:`5`})})]}),(0,Z.jsx)(`circle`,{className:`caps-radio-track`,cx:`6`,cy:`6`,r:`5.5`,filter:`url(#${t}-inset)`}),(0,Z.jsx)(`g`,{clipPath:`url(#${t}-well)`,children:(0,Z.jsx)(`ellipse`,{ref:n,cx:`6`,cy:`6`,rx:r?4:0,ry:r?4:0,fill:`url(#${t}-surface)`,filter:`url(#${t}-shadow)`})})]})}var Fn=(0,Y.createContext)(null),In=(0,Y.forwardRef)(function({children:e,className:t,defaultValue:n,disabled:r=!1,name:i,onValueChange:a,orientation:o=`vertical`,value:s,...c},l){let u=(0,Y.useId)(),d=(0,Y.useRef)(null);(0,Y.useImperativeHandle)(l,()=>{if(!d.current)throw Error(`RadioGroup is not mounted`);return d.current},[]);let f=i??`radio-group-${u}`,[p,m]=(0,Y.useState)(n),h=s??p;return(0,Y.useEffect)(()=>{let e=d.current?.form;if(!e||s!==void 0)return;let t=e=>{queueMicrotask(()=>{e.defaultPrevented||m(n)})};return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[s,n,c.form]),(0,Z.jsx)(Fn.Provider,{value:{disabled:r,name:f,onValueChange:e=>{s===void 0&&m(e),a?.(e)},value:h},children:(0,Z.jsx)(`fieldset`,{...c,className:H(`flex gap-md`,o===`horizontal`?`flex-row flex-wrap`:`flex-col`,t),disabled:r,role:c.role??`radiogroup`,ref:d,children:e})})}),Q=(0,Y.forwardRef)(function({className:e,indicator:t,onChange:n,onClick:r,value:i,...a},o){let s=(0,Y.useContext)(Fn);if(!s)throw Error(`RadioGroupItem must be used inside <RadioGroup>`);let c=s.value===i,l=e=>{n?.(e),e.target.checked&&s.onValueChange?.(i)};return(0,Z.jsxs)(`span`,{className:`caps-radio`,"data-checked":c,"data-custom-indicator":t!==void 0||void 0,children:[(0,Z.jsx)(`input`,{...a,"aria-checked":c,checked:c,className:H(`caps-radio-input`,e),disabled:s.disabled||a.disabled,name:s.name,onChange:l,onClick:r,ref:o,type:`radio`,value:i}),t===void 0?(0,Z.jsx)(Pn,{checked:c}):t]})}),Ln=(0,Y.forwardRef)(function({description:e,id:t,meta:n,title:r,...i},a){let o=(0,Y.useContext)(Fn),s=(0,Y.useId)(),c=t??s,l=o?.value===i.value,u=o?.disabled===!0||i.disabled===!0;return(0,Z.jsxs)(`label`,{className:`caps-choice-card`,"data-checked":l,"data-disabled":u||void 0,htmlFor:c,children:[(0,Z.jsx)(Q,{...i,"aria-describedby":e?`${c}-description`:void 0,"aria-labelledby":`${c}-title`,id:c,ref:a}),(0,Z.jsxs)(`span`,{className:`caps-choice-card-copy`,children:[(0,Z.jsx)(`span`,{className:`caps-choice-card-title`,id:`${c}-title`,children:r}),e?(0,Z.jsx)(`span`,{className:`caps-choice-card-description`,id:`${c}-description`,children:e}):null]}),n?(0,Z.jsx)(`span`,{className:`caps-choice-card-meta`,children:n}):null]})}),Rn=(0,Y.forwardRef)(function({label:e,icon:t,caption:n,art:r=`dim`,className:i,...a},o){return(0,Z.jsx)(`label`,{className:`caps-icon-choice`,"data-art":r===`color`?r:void 0,children:(0,Z.jsx)(Q,{...a,"aria-label":e,className:H(`caps-icon-choice-input`,i),indicator:(0,Z.jsx)(An,{icon:t,caption:n}),ref:o})})});(0,Y.forwardRef)(function({label:e,color:t,className:n,...r},i){return(0,Z.jsx)(`label`,{className:`caps-icon-choice`,"data-art":`color`,"data-swatch":``,title:e,children:(0,Z.jsx)(Q,{...r,"aria-label":e,className:H(`caps-icon-choice-input`,n),indicator:(0,Z.jsx)(An,{icon:(0,Z.jsx)(`span`,{className:`caps-swatch-dot`,style:{backgroundColor:t}})}),ref:i})})});var zn=u(a),Bn=u(y),Vn=u(f(i)),Hn=u(W(a)),Un=W(C(File)),Wn=u(Un),Gn=x([a,i,y,ee,ge,W(a),Un]),Kn=u(Gn),$=e=>B(zn(e.state.value),()=>``),qn=e=>B(Bn(e.state.value),()=>!1),Jn=e=>B(Vn(e.state.value),()=>null),Yn=e=>B(Hn(e.state.value),()=>[]),Xn=e=>B(Wn(e.state.value),()=>[]),Zn=e=>B(Kn(e.state.value),()=>null);function Qn({field:e,spec:t,locked:n,...r}){let[i,a]=(0,Y.useState)(!1);return(0,Z.jsxs)(He,{children:[(0,Z.jsx)(G,{...r,name:t.name,disabled:n,type:i?`text`:`password`,autoComplete:`off`,spellCheck:!1,className:`caps-field-secret`,placeholder:t.placeholder,readOnly:t.readOnly,value:$(e),onBlur:e.handleBlur,onChange:t=>{e.handleChange(t.currentTarget.value)}}),(0,Z.jsx)(V,{type:`button`,variant:`outline`,size:`icon`,"aria-label":i?`Hide`:`Show`,"aria-pressed":i,disabled:n,onClick:()=>{a(e=>!e)},children:i?(0,Z.jsx)(en,{"aria-hidden":`true`}):(0,Z.jsx)(tn,{"aria-hidden":`true`})})]})}var $n={text:`text`,email:`email`,url:`url`,tel:`tel`};function er({spec:e,field:t,locked:n,...r}){let i=Xn(t),a=n||e.readOnly===!0,o=(0,Y.useRef)(null);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-sm`,children:[(0,Z.jsx)(O,{asChild:!0,children:(0,Z.jsx)(`input`,{...r,ref:o,type:`file`,tabIndex:-1,required:r.required===!0&&i.length===0,name:e.name,accept:e.accept,multiple:e.multiple,disabled:a,onBlur:t.handleBlur,onChange:e=>{t.handleChange(Array.from(e.currentTarget.files??[])),e.currentTarget.value=``}})}),(0,Z.jsx)(V,{type:`button`,variant:`outline`,"aria-label":`Choose files for ${e.label}`,"aria-describedby":r[`aria-describedby`],"aria-invalid":r[`aria-invalid`],disabled:a,onBlur:t.handleBlur,onClick:()=>{o.current?.click()},children:`Choose files`}),(0,Z.jsx)(Ve,{items:i.map((e,t)=>({id:String(t),name:e.name,preview:{kind:`file`},progress:0,progressLabel:`${String(e.size)} bytes`,statusLabel:`Selected`,actions:a?{}:{remove:{label:`Remove`,accessibleLabel:`Remove ${e.name}`}}})),onRemove:e=>{t.handleChange(i.filter((t,n)=>String(n)!==e))},onCancel:()=>void 0,onRetry:()=>void 0})]})}function tr({spec:e,field:t,locked:n,...r}){let i=e=>{t.handleChange(e)},a={...r,name:e.name,disabled:n,onBlur:t.handleBlur};switch(e.kind){case`text`:case`email`:case`url`:case`tel`:return(0,Z.jsx)(G,{...a,type:$n[e.kind],inputMode:e.kind===`text`?void 0:e.kind,autoComplete:e.autoComplete,placeholder:e.placeholder,maxLength:e.maxLength,readOnly:e.readOnly,value:$(t),onChange:e=>{i(e.currentTarget.value)}});case`textarea`:return(0,Z.jsx)(Se,{...a,rows:e.rows??3,placeholder:e.placeholder,maxLength:e.maxLength,readOnly:e.readOnly,value:$(t),onChange:e=>{i(e.currentTarget.value)}});case`secret`:return(0,Z.jsx)(Qn,{...r,field:t,spec:e,locked:n});case`money`:return(0,Z.jsxs)(He,{children:[(0,Z.jsx)(je,{className:`caps-field-currency`,children:e.currency??`USD`}),(0,Z.jsx)(G,{...a,inputMode:`decimal`,autoComplete:`off`,className:`caps-field-amount`,placeholder:e.placeholder??`0.00`,readOnly:e.readOnly,value:$(t),onChange:e=>{i(e.currentTarget.value)}})]});case`date`:return(0,Z.jsx)(G,{...a,type:`date`,readOnly:e.readOnly,value:$(t),onChange:e=>{i(e.currentTarget.value)}});case`number`:return(0,Z.jsx)(Pe,{...a,...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.step===void 0?{}:{step:e.step},...e.unit===void 0?{}:{unit:e.unit},...e.wrap===void 0?{}:{wrap:e.wrap},disabled:n||e.readOnly===!0,decrementLabel:`Decrease ${e.label}`,incrementLabel:`Increase ${e.label}`,value:Jn(t),onValueChange:e=>{t.handleChange(e)}});case`select`:return(0,Z.jsxs)(ze,{...a,value:$(t),onChange:e=>{i(e.currentTarget.value)},children:[e.placeholder===void 0?null:(0,Z.jsx)(`option`,{value:``,disabled:!0,children:e.placeholder}),e.options.map(e=>(0,Z.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]});case`combobox`:return(0,Z.jsx)(kn,{id:r.id??e.name,"aria-describedby":r[`aria-describedby`],"aria-invalid":r[`aria-invalid`],"aria-required":r[`aria-required`],items:e.options,getKey:e=>e.value,getLabel:e=>e.label,isDisabled:t=>t.disabled||n||e.readOnly===!0,value:$(t),...e.placeholder===void 0?{}:{placeholder:e.placeholder},trigger:(0,Z.jsx)(Dn,{name:e.name,disabled:n||e.readOnly===!0,onBlur:t.handleBlur,children:e.options.find(e=>e.value===$(t))?.label??e.placeholder??`Choose…`}),inputProps:{"aria-label":`Search ${e.label}`,disabled:n||e.readOnly===!0},onValueChange:e=>{i(e??``),t.handleBlur()}});case`file`:return(0,Z.jsx)(er,{...r,spec:e,field:t,locked:n});case`checkbox`:return(0,Z.jsx)(Ie,{...a,disabled:n||e.readOnly===!0,checked:qn(t),onChange:e=>{t.handleChange(e.currentTarget.checked)}});case`switch`:return(0,Z.jsx)(Ce,{...a,disabled:n||e.readOnly===!0,checked:qn(t),onCheckedChange:e=>{t.handleChange(e)}});case`radio`:case`icon-radio`:case`checkboxes`:case`icon-checkboxes`:return null}}var nr=new Set([`radio`,`icon-radio`,`checkboxes`,`icon-checkboxes`]);function rr({spec:e,field:t,locked:n,error:r,layout:i}){let a=n||e.readOnly===!0,o=e.label;if(e.kind===`checkboxes`||e.kind===`icon-checkboxes`){let n=Yn(t),s=(e,r)=>{t.handleChange(r?[...n,e]:n.filter(t=>t!==e))};return(0,Z.jsx)(ke,{legend:o,icon:e.icon,layout:i,...i===`columns`?{legendTitle:o}:{},description:e.help,disabled:a,error:r??null,children:e.kind===`icon-checkboxes`?(0,Z.jsx)(`div`,{className:`caps-field-icon-choices`,children:e.options.map(r=>(0,Z.jsx)(jn,{name:e.name,value:r.value,label:r.label,...r.caption===void 0?{}:{caption:r.caption},icon:r.icon,disabled:r.disabled,checked:n.includes(r.value),onBlur:t.handleBlur,onChange:e=>{s(r.value,e.currentTarget.checked)}},r.value))}):(0,Z.jsx)(Nn,{children:e.options.map(r=>(0,Z.jsx)(Mn,{name:e.name,value:r.value,label:r.label,icon:r.icon,hint:r.description,disabled:r.disabled,checked:n.includes(r.value),onBlur:t.handleBlur,onChange:e=>{s(r.value,e.currentTarget.checked)}},r.value))})})}let s=e.options.some(e=>e.description!==void 0||e.meta!==void 0);return(0,Z.jsx)(ke,{legend:o,icon:e.icon,layout:i,...i===`columns`?{legendTitle:o}:{},description:e.help,disabled:a,error:r??null,children:(0,Z.jsx)(In,{name:e.name,"aria-label":o,value:$(t),onValueChange:e=>{t.handleChange(e),t.handleBlur()},orientation:e.kind===`icon-radio`||s?`horizontal`:`vertical`,children:e.options.map(t=>e.kind===`icon-radio`?(0,Z.jsx)(Rn,{value:t.value,label:t.label,...t.caption===void 0?{}:{caption:t.caption},icon:t.icon,disabled:t.disabled},t.value):s?(0,Z.jsx)(Ln,{value:t.value,title:t.label,description:t.description,meta:t.meta,disabled:t.disabled},t.value):(0,Z.jsx)(Ne,{label:t.label,orientation:`inline`,children:(0,Z.jsx)(Q,{value:t.value,disabled:t.disabled})},t.value))})})}function ir({spec:e,field:t,locked:n,error:r,render:i,...a}){return i({name:e.name,label:e.label,help:e.help,value:Zn(t),onChange:e=>{t.handleChange(e)},onBlur:t.handleBlur,error:r,disabled:n,id:a.id??e.name,"aria-describedby":a[`aria-describedby`],"aria-invalid":r!==void 0})}function ar({form:e,spec:t,locked:n,layout:r}){let i=Fe({form:e,name:t.name}),a=K(e.store,e=>e.submissionAttempts>0),o=i.state.meta.isBlurred||a?on(i.state.meta):void 0;if(t.render===void 0&&nr.has(t.kind))return(0,Z.jsx)(rr,{spec:t,field:i,locked:n,error:o,layout:r});let s=r===`columns`?t.kind===`switch`||t.kind===`checkbox`?`horizontal`:`vertical`:t.kind===`checkbox`?`inline`:(t.layout??(t.kind===`switch`?`row`:`stacked`))===`row`?`horizontal`:`vertical`;return(0,Z.jsx)(Ne,{label:t.label,...r===`columns`?{labelTitle:t.label}:{},description:t.help,icon:t.icon,orientation:s,error:o,...t.required===void 0?{}:{required:t.required},...t.optional===void 0?{}:{optional:t.optional},children:t.render===void 0?(0,Z.jsx)(tr,{spec:t,field:i,locked:n}):(0,Z.jsx)(ir,{spec:t,field:i,locked:n,error:o,render:t.render})})}var or=u(m(a,Gn));function sr({form:e,spec:t,locked:n,layout:r}){let i=t.when;return K(e.store,e=>i===void 0||i(B(or(e.values),()=>({}))))?(0,Z.jsx)(ar,{form:e,spec:t,locked:n,layout:r}):null}function cr({form:e,section:t,locked:n,layout:r}){let i=t.fields.map(t=>(0,Z.jsx)(sr,{form:e,spec:t,locked:n,layout:r},t.name));return t.title===void 0?i:(0,Z.jsx)(Ae,{title:t.title,description:t.description,layout:r,children:i})}function lr({model:e,names:t,disabled:n=!1,layout:r}){let i=e.form;return t===void 0?e.description.sections.map(e=>(0,Z.jsx)(cr,{form:i,section:e,locked:n,layout:r},e.id??``)):t.map(t=>{let a=e.description.fields.find(e=>e.name===t);return a===void 0?null:(0,Z.jsx)(sr,{form:i,spec:a,locked:n,layout:r},t)})}var ur=class{annotation;constructor(e){this.annotation=e}},dr=class{sections;constructor(e){this.sections=e}},fr=`caps/form`,pr=0;function mr(e){pr+=1;let t={[`${fr}:${String(pr)}`]:new ur(e)};return e.label!==void 0&&(t.title=e.label),e.help!==void 0&&(t.description=e.help),t}a.annotate(mr({kind:`secret`})).pipe(b(`Secret`));var hr=e=>{let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)};function gr(e){return Object.values(e??{}).reduce((e,t)=>t instanceof ur?{...e,...t.annotation}:e,{})}function _r(e){return e.reduce((e,t)=>({...e,...gr(t)}),{})}function vr(e){let t=e?.[fr];return t instanceof dr?t.sections:{}}var yr=u(a);function br(e){if(re(e))return o(yr(e.literal),{onNone:()=>null,onSome:e=>[e]});if(!M(e))return null;let t=[];for(let n of e.types){if(he(n))continue;let e=br(n);if(e===null)return null;t.push(...e)}return t}function xr(e){if(U(e))return{type:`string`,literals:[]};if(I(e))return{type:`number`,nullable:!1};if(se(e))return{type:`boolean`};let t=br(e);if(t!==null)return{type:`string`,literals:t};if(F(e)){let[t]=e.rest;if(t===void 0)return null;if(U(t))return{type:`strings`,literals:[]};let n=br(t);return n===null?null:{type:`strings`,literals:n}}if(M(e)){let t=e.types.filter(e=>!he(e)&&!R(e)),n=e.types.some(e=>R(e)),[r]=t;if(t.length!==1||r===void 0)return null;let i=xr(r);return i?.type===`number`?{type:`number`,nullable:n}:n?null:i}return null}function Sr(e){let t=e.ast;if(!k(t))throw Error(`A schema form needs a Schema.Struct.`);return{fields:t.propertySignatures.map(e=>{let t=String(e.name),n=fe(e.type),i=_r([e.type.annotations,...(e.type.checks??[]).map(e=>e.annotations)]),a=i.kind===`file`?{type:`files`}:xr(n);if(a===null)throw Error(`Schema field "${t}" has no form control. Annotate it with field({ render }) or a kind.`);return{name:t,valueType:a,optional:e.type.context?.isOptional===!0,annotation:i,title:r(e.type),description:v(e.type)}}),sections:vr(me(t))}}function Cr(e){let n=e,r=!1,i=!1;for(;;)if(n instanceof ie)r=!0,n=n.unwrap();else if(n instanceof t)i=!0,n=n.unwrap();else if(n instanceof w)n=n.unwrap();else if(n instanceof ce)n=n.in;else return{node:n,optional:r,nullable:i}}function wr(e){if(e instanceof oe){let t=e.options.map(e=>wr(e));return t.some(e=>e===null)?null:t.flatMap(e=>e??[])}let t=e instanceof D?e.options:e instanceof g?[...e.values]:null;if(t===null)return null;let n=t.map(e=>yr(e));return n.every(p)?n.map(e=>e.value):null}function Tr(e){let{node:t,nullable:n}=Cr(e);if(t instanceof z)return{type:`string`,literals:[]};if(t instanceof P)return{type:`number`,nullable:n};if(t instanceof T)return{type:`boolean`};let r=wr(t);if(r!==null)return{type:`string`,literals:r};if(t instanceof l){let e=Cr(t.element).node;if(e instanceof z)return{type:`strings`,literals:[]};let n=wr(e);return n===null?null:{type:`strings`,literals:n}}return null}function Er(e){let n=[e];for(;;){let e=n[n.length-1];if(e===void 0)break;let r=e instanceof ie||e instanceof t||e instanceof w?e.unwrap():e instanceof ce?e.in:e;if(r===e)break;n.push(r)}return n.reverse().map(e=>ne.get(e))}function Dr(e){return Er(e).reduce((e,t)=>({...e,...t}),{})}function Or(e){return Object.entries(e.shape)}function kr(e){let t=Cr(e).node;if(!(t instanceof de))throw Error(`A schema form needs a z.object.`);return{fields:Or(t).map(([e,t])=>{let n=_r(Er(t)),r=n.kind===`file`?{type:`files`}:Tr(t);if(r===null)throw Error(`Schema field "${e}" has no form control. Annotate it with field({ render }) or a kind.`);let i=Dr(t);return{name:e,valueType:r,optional:Cr(t).optional,annotation:n,title:i.title,description:i.description}}),sections:vr(Dr(e))}}function Ar(e,t){let n=t.options??{};return(e.length>0?e:Object.keys(n)).map(e=>{let t=n[e],r=t===void 0?{}:t instanceof Object?t:{label:t};return{value:e,label:r.label??hr(e),description:r.description,meta:r.meta,icon:r.icon,caption:r.caption,disabled:r.disabled===!0}})}function jr(e,t){let n=t.some(e=>e.icon!==void 0);switch(e.type){case`boolean`:return`switch`;case`number`:return`number`;case`strings`:return n?`icon-checkboxes`:`checkboxes`;case`files`:return`file`;case`string`:return t.length===0?`text`:t.length>12?`combobox`:n?`icon-radio`:t.some(e=>e.description!==void 0||e.meta!==void 0)||t.length<=3?`radio`:`select`}}function Mr(e,t){switch(e.type){case`boolean`:return!1;case`number`:return e.nullable?null:0;case`strings`:case`files`:return[];case`string`:return t[0]?.value??``}}function Nr(e){let t=e instanceof j?kr(e):Sr(e),n=t.fields.map((e,t)=>{let{kind:n,...r}=e.annotation,i=Ar(e.valueType.type===`string`||e.valueType.type===`strings`?e.valueType.literals:[],e.annotation),a=r.help??e.description;return{...r,name:e.name,label:r.label??e.title??hr(e.name),help:a,kind:n??jr(e.valueType,i),options:i,optionalInSchema:e.optional,index:t}}),r={};t.fields.forEach((e,t)=>{let i=n[t];i&&(r[e.name]=Mr(e.valueType,i.options))});let i=e=>e.order??e.index,a=e=>e.section!==void 0&&Object.hasOwn(t.sections,e.section)?e.section:null,o=e=>n.filter(t=>a(t)===e).sort((e,t)=>i(e)-i(t)),s=Object.entries(t.sections).map(([e,t])=>({id:e,title:t.title,description:t.description,fields:o(e)}));return{fields:n,sections:[{id:null,title:void 0,description:void 0,fields:o(null)},...s].filter(e=>e.fields.length>0),defaults:r}}function Pr(e){let t=e instanceof j?e:N(e);return{"~standard":{...t[`~standard`],validate:e=>{let n=t[`~standard`].validate(e);return n instanceof Promise?n.then(e=>Fr(e)):Fr(n)}}}}function Fr(e){return e.issues===void 0?e:{issues:e.issues.map(e=>e.path===void 0?e:{...e,path:e.path.slice(0,1)})}}var Ir=`onServer`;function Lr(e){let t=e.querySelector(`[aria-invalid="true"]`),n=t?.matches(`input, select, textarea, button, [tabindex]`)?t:t?.querySelector(`input, select, textarea, button`);return n?.focus(),n!=null}function Rr(e){if(Lr(e))return()=>void 0;let t=new MutationObserver(()=>{Lr(e)&&t.disconnect()});return t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-invalid`]}),()=>{t.disconnect()}}function zr(e){return e.state.meta.errorMap.onServer!==void 0}function Br(e){e.setMeta(e=>({...e,errorMap:{...e.errorMap,[Ir]:void 0}}))}function Vr(e,t,n){e.setFieldMeta(t,e=>({...e,isBlurred:!0,errorMap:{...e.errorMap,[Ir]:n}}))}function Hr(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(e.defaultValues),[s,c]=(0,Y.useState)(null);Me(a,e.defaultValues)||(o(e.defaultValues),c(null));let{schema:l}=e,u=(0,Y.useMemo)(()=>Nr(l),[l]),d=(0,Y.useMemo)(()=>Pr(l),[l]),f=Re({defaultValues:s??a,validators:{onChange:d,onSubmit:d},listeners:{onChange:({fieldApi:e})=>{n(null),i(null),zr(e)&&Br(e)}},onSubmit:async({value:t,formApi:r})=>{n(null),i(null);let a=await Pr(l)[`~standard`].validate(t);if(a.issues){n(a.issues[0]?.message??`Check the form and try again.`);return}let o;try{o=await e.onSubmit(a.value,t)??{kind:`saved`}}catch(t){console.error(`SchemaForm submit failed`,t),n(e.failure??`Couldn't save changes. Try again.`);return}if(o.kind===`refused`){n(o.error??null);let e=r;for(let[t,n]of Object.entries(o.fields??{}))n!==void 0&&n.length>0&&Vr(e,t,n);return}let s=o.values??t;c(s),r.reset(s),i(o.message??`Saved`),e.onSaved?.(s)}});return{description:u,form:f,error:t,saved:r,discard:()=>{n(null),i(null),f.reset()},submit:()=>f.handleSubmit()}}function Ur(e){return{dirty:K(e.form.store,e=>!e.isDefaultValue),submitting:K(e.form.store,e=>e.isSubmitting),canSubmit:K(e.form.store,e=>e.canSubmit)}}function Wr({model:e,submitLabel:t=`Save changes`,discardLabel:n,onCancel:r,cancelLabel:i,allowClean:a,layout:o,footer:s,children:c,disabled:l=!1,...u}){let{submitting:d}=Ur(e),f=(0,Y.useRef)(null),p=(0,Y.useRef)(()=>void 0);return(0,Y.useEffect)(()=>()=>{p.current()},[]),(0,Z.jsxs)(Le,{...u,ref:f,layout:o,busy:d,noValidate:!0,onSubmit:t=>{t.preventDefault(),e.form.state.isSubmitting||e.submit().then(()=>{p.current();let t=f.current;t!==null&&!e.form.state.isValid&&(p.current=Rr(t))})},children:[c??(0,Z.jsx)(lr,{model:e,disabled:l,layout:o}),s===void 0?(0,Z.jsx)(qr,{model:e,label:t,discardLabel:r===void 0?n:void 0,onCancel:r,cancelLabel:i,allowClean:a??r!==void 0,divider:r===void 0}):s]})}function Gr({schema:e,defaultValues:t,onSubmit:n,onSaved:r,failure:i,...a}){let o=Hr({schema:e,defaultValues:t,onSubmit:n,onSaved:r,failure:i});return(0,Z.jsx)(Wr,{...a,model:o})}function Kr(e){return`model`in e?(0,Z.jsx)(Wr,{...e}):(0,Z.jsx)(Gr,{...e})}function qr({model:e,label:t,discardLabel:n,onCancel:r,cancelLabel:i=`Cancel`,allowClean:a=!1,dirtyLabel:o=`Unsaved changes`,buttonProps:s,...c}){let{dirty:l,submitting:u}=Ur(e),d=u?null:e.saved&&!l?(0,Z.jsx)(De,{tone:`success`,size:`compact`,label:e.saved}):l?(0,Z.jsx)(De,{tone:`neutral`,size:`compact`,label:o}):null;return(0,Z.jsxs)(Be,{...c,error:e.error,status:d,children:[r?(0,Z.jsx)(V,{type:`button`,variant:`ghost`,disabled:u,onClick:r,children:i}):n&&l?(0,Z.jsx)(V,{type:`button`,variant:`ghost`,disabled:u,onClick:e.discard,children:n}):null,(0,Z.jsx)(V,{...s,type:`submit`,loading:u,disabled:u||!l&&!a,title:!l&&!a?`No changes to save`:void 0,children:t})]})}function Jr({folder:e}){return(0,Z.jsx)($t,{open:e.editing,onOpenChange:e.setEditing,children:(0,Z.jsxs)(Yt,{children:[(0,Z.jsx)(Zt,{children:(0,Z.jsx)(Xt,{children:`Save prints to`})}),(0,Z.jsx)(Xr,{folder:e},e.computerId),(0,Z.jsx)(Jt,{children:(0,Z.jsx)(Qt,{render:(0,Z.jsx)(V,{variant:`outline`,size:`sm`}),children:`Close`})})]})})}var Yr=s({path:d.check(ue(E(ve),{message:`Enter an absolute Computer folder, such as /media.`})).annotate(mr({label:`Folder`,placeholder:`/media`}))});function Xr({folder:e}){let t=(0,Y.useRef)(!1),n=Hr({schema:Yr,defaultValues:{path:e.path??`/media`},onSubmit:async({path:n})=>{let r=await e.choose(n,t.current);return r?{kind:`refused`,fields:{path:r}}:{kind:`saved`}}}),r=e=>{t.current=e,n.form.setFieldMeta(`path`,e=>({...e,errorMap:{...e.errorMap,onServer:void 0}}))},i=e.busy||!e.writable;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Kr,{model:n,disabled:i,footer:(0,Z.jsxs)(Be,{divider:!1,children:[(0,Z.jsx)(qt,{className:`[--caps-keycap-width:auto]`,label:`Use`,type:`submit`,disabled:i,onClick:()=>{r(!1)}}),(0,Z.jsx)(qt,{className:`[--caps-keycap-width:auto]`,label:`Create`,type:`submit`,disabled:i,onClick:()=>{r(!0)}})]})}),e.error?(0,Z.jsx)(_e,{role:`alert`,icon:(0,Z.jsx)(Oe,{"aria-hidden":`true`,className:`size-[var(--stipe-icon-size-sm)]`}),primary:e.error}):(0,Z.jsx)(ye,{children:e.writable?`Prints saves new images and uploads here and shows this folder as your gallery.`:`This Computer is read-only for Prints, so the folder can’t change.`})]})}export{Jr as PrintsFolderDialog};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,Vn as n,vn as r,yn as i}from"./button-oE2Hrd5D.js";import{Ct as a,Dt as o,Et as s,Ot as c,Q as l,Tt as u,_t as d,at as f,bt as p,ct as m,dt as h,et as g,ft as _,gt as v,ht as y,it as b,jt as x,lt as ee,mt as S,nt as te,ot as C,pt as w,rt as ne,st as T,tt as E,ut as D,vt as O,wt as k,xt as A,yt as j}from"./dist-Cc0qB3Mq.js";function re(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ee(e,()=>t.signal,()=>n=!0)},u=_(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?h:D;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?N:M,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:M(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function M(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function N(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function P(e,t){return t?M(e,t)!=null:!1}function F(e,t){return!t||!e.getPreviousPageParam?!1:N(e,t)!=null}var I=class extends g{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=z(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=z(this.options);e.data!==void 0&&(this.setState(R(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=A(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(j).catch(j):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>a(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===s||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>a(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!o(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=_(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?re(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=ne({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof E&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof E){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...L(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...R(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),f.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function L(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:te(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function R(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function z(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ie=class extends T{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),B(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return V(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return V(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof a(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!k(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&H(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||a(this.options.enabled,this.#t)!==a(t.enabled,this.#t)||a(this.options.staleTime,this.#t)!==a(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||a(this.options.enabled,this.#t)!==a(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return k(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(j)),t}#h(e){return!m()&&a(this.options.enabled,this.#t)!==!1&&v(e)}#g(){this.#b();let e=a(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=o(this.#r.dataUpdatedAt,e)+1;this.#u=c.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=c.setInterval(()=>{(this.options.refetchIntervalInBackground||C.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(c.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(c.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,o=this.#i,s=this.#a,c=e===n?this.#n:e.state,{state:l}=e,u={...l},d=!1,f;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&B(e,t),o=i&&H(e,n,t,r);(a||o)&&(u={...u,...L(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(u.fetchStatus=`idle`)}let{error:p,errorUpdatedAt:m,status:h}=u;f=u.data;let g=!1;if(t.placeholderData!==void 0&&f===void 0&&h===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=i.data,g=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(h=`success`,f=A(i?.data,e,t),d=!0)}if(t.select&&f!==void 0&&!g){if(i&&f===o?.data&&t.select===this.#s)f=this.#c;else try{this.#s=t.select,f=t.select(f),f=A(i?.data,f,t),this.#c=f,this.#o=null}catch(e){this.#o=e}}else f===void 0&&(this.#o=null);this.#o&&(p=this.#o,f=this.#c,m=Date.now(),h=`error`,d=!1);let _=u.fetchStatus===`fetching`,v=h===`pending`,y=h===`error`,b=v&&_,x=f!==void 0;return{status:h,fetchStatus:u.fetchStatus,isPending:v,isSuccess:h===`success`,isError:y,isInitialLoading:b,isLoading:b,data:f,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:u.fetchStatus===`paused`,isPlaceholderData:d,isRefetchError:y&&x,isStale:U(e,t),refetch:this.refetch,isEnabled:a(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),k(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();f.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function ae(e,t){return a(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||a(t.retryOnMount,e)!==!1)}function B(e,t){return ae(e,t)||e.state.data!==void 0&&V(e,t,t.refetchOnMount)}function V(e,t,n){if(a(t.enabled,e)!==!1&&a(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&U(e,t)}return!1}function H(e,t,n,r){return(e!==t||a(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&U(e,n)}function U(e,t){return a(t.enabled,e)!==!1&&e.isStaleByTime(a(t.staleTime,e))}var W=class extends T{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new l({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=G(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=G(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=G(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=G(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){f.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>d(t,e))}findAll(e={}){return this.getAll().filter(t=>d(e,t))}notify(e){f.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return f.batch(()=>Promise.all(e.map(e=>e.continue().catch(j))))}};function G(e){return e.options.scope?.id}var K=class extends T{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??y(r,t),a=this.get(i);return a||(a=new I({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){f.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>O(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>O(e,t)):t}notify(e){f.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){f.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){f.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},q=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new K,this.#t=e.mutationCache||new W,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=C.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=b.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(a(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=w(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return f.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;f.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return f.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=f.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(j).catch(j)}invalidateQueries(e,t={}){return f.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=f.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(j)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(j)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(a(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(a(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(j).catch(j)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(j).catch(j)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return b.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(S(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{p(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(S(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{p(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=y(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===s&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},J=e(n(),1),Y=J.createContext(!1),oe=()=>J.useContext(Y);Y.Provider,t();function se(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ce=J.createContext(se()),le=()=>J.useContext(ce),ue=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?u(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},de=e=>{J.useEffect(()=>{e.clearReset()},[e])},fe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||u(n,[e.error,r])),pe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},me=(e,t)=>e?.suspense&&t.isPending,he=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function X(e){return e}function ge(e){return e}var _e=r({status:i()}),ve=3,ye=/network ?(?:changed|error)|failed to fetch|load failed|network connection was lost/iu;function be(e){let t=[];for(let n=e;n!==void 0&&t.length<5;n=n instanceof Error?n.cause:void 0)t.push(n);return t}function xe(e){return be(e).some(e=>{if(e instanceof TypeError)return!0;if(e instanceof x)return e.code===`HOST_FAILURE`&&e.retryable;let t=_e.safeParse(e);return t.success?t.data.status>=500:e instanceof Error&&ye.test(e.message)})}function Se(e,t){return e<ve&&xe(t)}function Z(e){return 250*2**e}function Q(e){return e instanceof x?e:new x(`App operation failed`,{cause:e,code:`HOST_FAILURE`,retryable:!1})}var $=new WeakMap,Ce={of(e,...t){return[e?.identity.surfaceId??null,e?.context.get().computerId??null,...t]}};function we(e){let t={};return e&&$.set(t,e),t}function Te(){let e=new q({defaultOptions:{queries:{retry:!1,staleTime:3e4,refetchOnWindowFocus:!1},mutations:{retry:!1}}}),t=new Map;return e.getQueryCache().subscribe(n=>{let r=n.query;if(n.type===`removed`){t.get(r.queryHash)?.release(),t.delete(r.queryHash);return}let i=r.meta&&$.get(r.meta),a=t.get(r.queryHash);if(a?.app===i||(a?.release(),t.delete(r.queryHash),!i))return;let o=()=>{queueMicrotask(()=>{e.getQueryCache().get(r.queryHash)===r&&t.get(r.queryHash)?.app===i&&e.resetQueries({predicate:e=>e===r})})},s=i.capabilities.subscribe(o);t.set(r.queryHash,{app:i,release:s}),a&&o()}),e}function Ee(e,t,n,r){let i=e?.context.get().computerId;return X({queryKey:n,meta:we(e),enabled:e!==null,retry:Se,retryDelay:Z,queryFn:async({signal:n})=>{try{if(!e)throw new x(`No App connection`,{code:`DISCONNECTED`,retryable:!0});if(e.context.get().computerId!==i)throw new x(`The selected Computer changed`,{code:`SELECTION_CHANGED`,retryable:!1});return await r(e.capabilities.require(t),n)}catch(e){throw Q(e)}}})}function De(e){return ge({mutationKey:e.queryKey,scope:{id:S(e.queryKey)},mutationFn:async(t,n)=>{try{return await e.mutationFn(t,n)}catch(e){throw Q(e)}},onMutate:async(t,{client:n})=>{if(n.isMutating({mutationKey:e.queryKey,exact:!0})>1)return;await n.cancelQueries({queryKey:e.queryKey,exact:!0});let r=n.getQueryData(e.queryKey);if(r!==void 0)return n.setQueryData(e.queryKey,e.apply(r,t)),{previous:r,optimistic:n.getQueryData(e.queryKey)}},onError:(t,n,r,{client:i})=>{r&&i.getQueryData(e.queryKey)===r.optimistic&&i.setQueryData(e.queryKey,r.previous)},onSettled:(t,n,r,i,{client:a})=>a.invalidateQueries({queryKey:e.queryKey,exact:!0})})}export{X as a,me as c,de as d,le as f,F as g,P as h,Ce as i,ue as l,ie as m,Te as n,pe as o,oe as p,De as r,he as s,Ee as t,fe as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,Vn as n,c as r,f as i,g as a,h as o,i as s,m as c,o as l,p as u,r as d,s as f,u as p,v as m,x as h}from"./button-oE2Hrd5D.js";import{a as g,i as _,n as v,o as y,r as b}from"./modules-C4mfDnjH.js";var x=h(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),S=h(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),C=(e=10,t)=>{let n=t?_:y;return t=>n(g(t,0,1)*e)*(1/e)},w=e(n(),1),T=t(),E=Object.freeze({ease:`linear`,duration:0});function D(e,t){let n=i(e,t.duration);return n<=0?E:e.steps>0?{ease:C(e.steps),duration:n}:{ease:v({bounce:p(e,t.bounce),duration:n}),duration:n}}function O(e,t){let n=u(e,t.duration);return{ease:e.steps>0?C(e.steps):t.ease,duration:n}}var k={dot:{y:-4,height:8,cy:0},pill:{y:-16,height:32,cy:0},bang:{y:-16,height:20,cy:12}};function A({className:e,glyph:t,motion:n}){let i=`caps-status-${(0,w.useId)().replaceAll(`:`,``)}`,a=(0,w.useRef)(null),p=(0,w.useRef)(null),m=(0,w.useRef)(null),h=(0,w.useRef)(null),g=(0,w.useRef)(null),_=(0,w.useRef)(null),v=(0,w.useRef)(k[t]).current,y=(0,w.useRef)(t===`dot`?1:4).current,x=(0,w.useRef)(+(t===`bang`)).current,S=(0,w.useRef)(t),C=o(h),{reduced:A}=C;return(0,w.useLayoutEffect)(()=>{if(!a.current||!p.current||!g.current||!_.current)return;let e=k[t],n=A||S.current===t;S.current=t;let r=c(a.current),i=n?{duration:0}:D(r,{bounce:.3,duration:360}),o=b(a.current,{y:e.y,height:e.height,...i}),s=b(p.current,{cy:e.cy,...n?{duration:0}:{delay:u(r,35),...D(r,{bounce:.3,duration:420})}}),l=b(g.current,{gradientTransform:`matrix(1 0 0 ${t===`dot`?`1`:`4`} 0 0)`,...i}),d=b(_.current,{opacity:+(t===`bang`),...n?E:O(r,{ease:`inOutSine`,duration:220})});return()=>{o.cancel(),s.cancel(),l.cancel(),d.cancel()}},[t,A]),(0,w.useLayoutEffect)(()=>{if(!m.current||!h.current||A||n===`none`)return;let e=n===`pulse`?b(m.current,{opacity:[1,.45],...O(C,{ease:`inOutSine`,duration:750}),alternate:!0,loop:!0}):b(m.current,{keyframes:{"0%":{translateY:0,scaleX:1,scaleY:1},"18%":{translateY:.25,scaleX:1.1,scaleY:.91},"42%":{translateY:-1.3,scaleX:.94,scaleY:1.06},"62%":{translateY:-1.65,scaleX:1,scaleY:1},"82%":{translateY:.15,scaleX:1.06,scaleY:.95},"100%":{translateY:0,scaleX:1,scaleY:1}},...O(C,{ease:`inOutSine`,duration:1e3}),loop:!0}),t=d(h.current,t=>{t?e.resume():e.pause()});return()=>{t(),e.revert()}},[n,A,C]),(0,T.jsxs)(`svg`,{ref:h,"aria-hidden":`true`,className:`caps-status-bead ${e??``}`,width:`8`,height:`8`,viewBox:`-4 -4 8 8`,focusable:`false`,children:[(0,T.jsxs)(`defs`,{children:[(0,T.jsx)(s,{id:i,values:r}),(0,T.jsx)(f,{ref:g,id:`${i}-surface`,transform:`matrix(1 0 0 ${String(y)} 0 0)`}),(0,T.jsxs)(`radialGradient`,{id:`${i}-drop-light`,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`10.4`,r:`5.6`,children:[(0,T.jsx)(`stop`,{offset:`0`,stopColor:`var(--color-white)`,style:{stopOpacity:`calc(var(--depth) * 0.5)`}}),(0,T.jsx)(`stop`,{offset:`1`,stopColor:`var(--color-white)`,stopOpacity:`0`})]}),(0,T.jsx)(l,{id:`${i}-shadow`}),(0,T.jsx)(`mask`,{id:`${i}-silhouette`,maskUnits:`userSpaceOnUse`,x:`-12`,y:`-24`,width:`24`,height:`48`,style:{maskType:`alpha`},children:(0,T.jsxs)(`g`,{fill:`var(--color-white)`,filter:`url(#${i})`,children:[(0,T.jsx)(`rect`,{ref:a,x:`-4`,y:v.y,width:`8`,height:v.height,rx:`4`}),(0,T.jsx)(`circle`,{ref:p,cx:`0`,cy:v.cy,r:`4`})]})})]}),(0,T.jsx)(`g`,{ref:m,filter:`url(#${i}-shadow)`,children:(0,T.jsxs)(`g`,{mask:`url(#${i}-silhouette)`,children:[(0,T.jsx)(`rect`,{x:`-12`,y:`-24`,width:`24`,height:`48`,fill:`url(#${i}-surface)`}),(0,T.jsx)(`rect`,{ref:_,x:`-12`,y:`-24`,width:`24`,height:`48`,fill:`url(#${i}-drop-light)`,opacity:x})]})})]})}var j=.28;function M(e,t){switch(e){case`ring`:return{dashes:1,track:0,arc:0,sweep:0,disc:0,tick:0,cross:0};case`arc`:return{dashes:0,track:1,arc:1,sweep:t===void 0?j:Math.min(1,Math.max(0,t)),disc:0,tick:0,cross:0};case`check`:return{dashes:0,track:0,arc:1,sweep:1,disc:1,tick:1,cross:0};case`cross`:return{dashes:0,track:0,arc:1,sweep:1,disc:1,tick:0,cross:1}}}var N=7.25;function P({className:e,glyph:t,progress:n}){let r=`caps-status-mark-${(0,w.useId)().replaceAll(`:`,``)}`,i=(0,w.useRef)(null),o=(0,w.useRef)(null),s=(0,w.useRef)(null),l=(0,w.useRef)(null),u=(0,w.useRef)(null),p=(0,w.useRef)(null),m=(0,w.useRef)(null),h=(0,w.useRef)(null),g=(0,w.useRef)(M(t,n)).current,_=(0,w.useRef)(t),v=a();(0,w.useLayoutEffect)(()=>{let e=i.current,r=o.current,a=s.current,u=l.current,d=p.current,f=m.current,g=h.current;if(!e||!r||!a||!u||!d||!f||!g)return;let y=M(t,n),x=_.current;_.current=t;let S=c(e),C=v||x===t&&t!==`arc`,w=C?v?{ease:S.ease,duration:S.fast}:E:O(S,{ease:`outQuad`,duration:160}),T=(t===`check`||t===`cross`)&&!C,k=O(S,{ease:`inOutSine`,duration:220}),A=[b(r,{opacity:y.dashes,...w}),b(a,{opacity:y.track*.28,...w}),b(u,{opacity:y.arc,"stroke-dasharray":`${String(y.sweep)} 1`,...C?v?E:w:k}),b(d,{r:y.disc*N,...T?{delay:k.duration*.7,...D(S,{bounce:.35,duration:360})}:v?E:O(S,{ease:`inCubic`,duration:140})}),b(f,{"stroke-dashoffset":1-y.tick,...T&&y.tick>0?{delay:k.duration*.7+S.fast,...O(S,{ease:`outCubic`,duration:240})}:E}),b(g,{"stroke-dashoffset":1-y.cross,...T&&y.cross>0?{delay:k.duration*.7+S.fast,...O(S,{ease:`outCubic`,duration:240})}:E})];return t===`cross`&&T&&S.shake>0&&A.push(b(e,{translateX:[0,-S.shake,S.shake,-S.shake/2,0],delay:k.duration+S.fast,...O(S,{ease:`linear`,duration:300})})),()=>{for(let e of A)e.cancel()}},[t,n,v]);let y=t===`arc`&&n===void 0&&!v;return(0,w.useLayoutEffect)(()=>{if(!y||!u.current||!i.current)return;let e=c(i.current),t=b(u.current,{rotate:[0,360],...O(e,{ease:`linear`,duration:900}),loop:!0}),n=d(i.current,e=>{e?t.resume():t.pause()});return()=>{n(),t.revert()}},[y]),(0,T.jsxs)(`svg`,{ref:i,"aria-hidden":`true`,className:`caps-status-mark ${e??``}`,viewBox:`0 0 16 16`,focusable:`false`,children:[(0,T.jsxs)(`defs`,{children:[(0,T.jsx)(f,{id:`${r}-surface`,transform:`matrix(1.6 0 0 1.6 8 8)`}),(0,T.jsxs)(`mask`,{id:`${r}-knock`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`16`,height:`16`,children:[(0,T.jsx)(`rect`,{width:`16`,height:`16`,fill:`var(--color-white)`}),(0,T.jsx)(`path`,{ref:m,d:`M4.9 8.3 7.1 10.5 11.2 5.9`,fill:`none`,stroke:`var(--color-black)`,strokeWidth:`1.9`,strokeLinecap:`round`,strokeLinejoin:`round`,pathLength:1,strokeDasharray:`1 1`,strokeDashoffset:1-g.tick}),(0,T.jsx)(`path`,{ref:h,d:`M5.4 5.4 10.6 10.6 M10.6 5.4 5.4 10.6`,fill:`none`,stroke:`var(--color-black)`,strokeWidth:`1.9`,strokeLinecap:`round`,pathLength:1,strokeDasharray:`1 1`,strokeDashoffset:1-g.cross})]})]}),(0,T.jsx)(`circle`,{ref:o,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`1.7 2.2`,opacity:g.dashes}),(0,T.jsx)(`circle`,{ref:s,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,opacity:g.track*.28}),(0,T.jsx)(`g`,{ref:u,className:`caps-status-mark-spin`,children:(0,T.jsx)(`circle`,{ref:l,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,pathLength:1,strokeDasharray:`${String(g.sweep)} 1`,transform:`rotate(-90 8 8)`,opacity:g.arc})}),(0,T.jsx)(`circle`,{ref:p,cx:`8`,cy:`8`,r:g.disc*N,fill:`url(#${r}-surface)`,mask:`url(#${r}-knock)`})]})}var F=new Set([`ring`,`arc`,`check`,`cross`]);function I(e){return F.has(e)}var L={neutral:`text-base-content`,primary:`text-primary`,secondary:`text-secondary`,accent:`text-accent`,success:`text-success`,info:`text-info`,warning:`text-warning`,error:`text-error`},R=(0,w.forwardRef)(function({className:e,label:t,glyph:n=`dot`,motion:r=`none`,tone:i=`neutral`,size:a=`default`,appearance:o=`plain`,progress:s,...c},l){return(0,T.jsxs)(`span`,{...c,className:m(`caps-status`,a===`compact`&&`caps-status-compact`,o===`chip`&&`caps-status-chip`,e),"data-tone":o===`chip`?i:void 0,"data-glyph":n,"data-motion":r,ref:l,children:[I(n)?(0,T.jsx)(P,{className:L[i],glyph:n,progress:s}):(0,T.jsx)(A,{className:L[i],glyph:n,motion:r}),t===void 0?null:(0,T.jsx)(`span`,{children:t})]})});export{S as a,D as i,E as n,x as o,O as r,R as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,An as n,Bn as r,C as i,F as a,Fn as o,I as s,In as c,Ln as l,M as u,Mn as d,Nn as f,O as p,Pn as m,Rn as h,Vn as g,W as _,a as v,g as y,it as b,jn as x,m as S,o as C,s as w,st as T,v as E,x as D,zn as O}from"./button-oE2Hrd5D.js";import{a as k,i as A,r as j,t as M}from"./status-DNJRO5m5.js";import{r as N}from"./modules-C4mfDnjH.js";import{n as P}from"./keycap-D2RkH2IS.js";var F=r(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);d.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>f(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>o(e,t,n),e.parseAsync=async(t,n)=>m(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>c(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>l(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),I=r(`ZodMiniObject`,(e,t)=>{x.init(e,t),F.init(e,t),h(e,`shape`,()=>t.shape)});function L(e,t){return new I({type:`object`,shape:e??{},...O(t)})}var R=r(`ZodMiniLiteral`,(e,t)=>{n.init(e,t),F.init(e,t)});function z(e,t){return new R({type:`literal`,values:Array.isArray(e)?e:[e],...O(t)})}var B=D(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),V=D(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),H=D(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]);s({operation:p(`read-library`),computerId:t});var U=a.pipe(_(b(4096)),_(T(e=>e.startsWith(`/`)&&e!==`/`&&!e.includes(`\0`)&&!e.endsWith(`/`)&&!e.split(`/`).some(e=>e===`.`||e===`..`))));s({path:u(U)});var W=i(),G=e(g(),1);function K({checked:e}){let t=`caps-switch-${(0,G.useId)().replaceAll(`:`,``)}`,n=(0,G.useRef)(null),r=(0,G.useRef)(null),i=(0,G.useRef)(e).current,a=(0,G.useRef)(e),o=y();return(0,G.useLayoutEffect)(()=>{if(!n.current||!r.current)return;let t=o||a.current===e;a.current=e;let i=e?16:8,s=S(n.current),c=A(s,{bounce:.25,duration:440}),l=j(s,{ease:`inOutSine`,duration:100}),u=N(n.current,t?{x:2,y:2,width:i,height:8,duration:0}:{x:[{to:e?2.5:1.5,...l},{to:2,...c}],y:[{to:1.5,...l},{to:2,...c}],height:[{to:9,...l},{to:8,...c}],width:[{to:e?7:16.5,...l},{to:i,...c}]}),d=N(r.current,{gradientTransform:e?`matrix(2 0 0 1 10 6)`:`matrix(1 0 0 1 6 6)`,...t?{duration:0}:{delay:l.duration,...c}});return()=>{u.cancel(),d.cancel()}},[e,o]),(0,W.jsxs)(`svg`,{className:`caps-switch-visual`,width:`40`,height:`24`,viewBox:`0 0 20 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,W.jsxs)(`defs`,{children:[(0,W.jsx)(w,{ref:r,id:`${t}-surface`,transform:i?`matrix(2 0 0 1 10 6)`:`matrix(1 0 0 1 6 6)`}),(0,W.jsx)(C,{id:`${t}-shadow`}),(0,W.jsx)(v,{id:`${t}-inset`}),(0,W.jsx)(`clipPath`,{id:`${t}-track`,children:(0,W.jsx)(`rect`,{x:`1`,y:`1`,width:`18`,height:`10`,rx:`5`})})]}),(0,W.jsx)(`rect`,{className:`caps-switch-track`,filter:`url(#${t}-inset)`,x:`0.5`,y:`0.5`,width:`19`,height:`11`,rx:`5.5`}),(0,W.jsx)(`g`,{clipPath:`url(#${t}-track)`,children:(0,W.jsx)(`rect`,{ref:n,x:`2`,y:`2`,width:i?16:8,height:`8`,rx:`4`,fill:`url(#${t}-surface)`,filter:`url(#${t}-shadow)`})})]})}var q=(0,G.forwardRef)(function({className:e,checked:t,defaultChecked:n=!1,onChange:r,onCheckedChange:i,...a},o){let s=(0,G.useRef)(null),[c,l]=(0,G.useState)(n),u=t??c;return(0,G.useImperativeHandle)(o,()=>{if(!s.current)throw Error(`Switch input is not mounted`);return s.current},[]),(0,G.useEffect)(()=>{let e=s.current?.form;if(!e||t!==void 0)return;let r=e=>{queueMicrotask(()=>{!e.defaultPrevented&&s.current&&l(n)})};return e.addEventListener(`reset`,r),()=>{e.removeEventListener(`reset`,r)}},[t,n,a.form]),(0,W.jsxs)(`span`,{className:`caps-switch`,"data-checked":u,children:[(0,W.jsx)(`input`,{...a,checked:u,className:E(`caps-switch-input`,e),onChange:e=>{t===void 0&&l(e.target.checked),r?.(e),i?.(e.target.checked)},ref:s,role:`switch`,type:`checkbox`}),(0,W.jsx)(K,{checked:u})]})}),J=L({keyCode:z(229)});function Y(e){return e.nativeEvent.isComposing||o(J,e.nativeEvent).success}var X=(0,G.forwardRef)(function({className:e,...t},n){return(0,W.jsx)(`div`,{...t,ref:n,className:E(`caps-popover-anchor`,e)})}),Z=(0,G.forwardRef)(function({className:e,open:t,side:n=`top`,...r},i){return t?(0,W.jsx)(`div`,{...r,ref:i,className:E(`caps-popover`,e),"data-side":n}):null}),Q=(0,G.forwardRef)(function({active:e,className:t,onMouseDown:n,...r},i){return(0,W.jsx)(`div`,{role:`option`,"aria-selected":e,...r,ref:i,className:E(`caps-popover-option`,t),"data-active":e,onMouseDown:e=>{e.preventDefault(),n?.(e)}})});function $({items:e,openId:t,onOpenChange:n,leading:r,trailing:i,renderTrigger:a,placement:o=`housing`,align:s=`end`,hostInset:c,className:l,...u}){let d=(0,G.useId)(),f=(0,G.useRef)(null),p=(0,G.useRef)(null),m=(0,G.useRef)(new Map),h=e.find(e=>e.id===t&&!e.disabled),g=h?.id,_=()=>{g&&m.current.get(g)?.focus(),n(null)};return(0,G.useEffect)(()=>{g&&p.current?.focus()},[g]),(0,G.useEffect)(()=>{c===void 0?f.current?.style.removeProperty(`--caps-status-tray-host-inset`):f.current?.style.setProperty(`--caps-status-tray-host-inset`,`${String(Math.max(0,c))}px`)},[c]),(0,G.useEffect)(()=>{if(!g)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),m.current.get(g)?.focus(),n(null))},t=e=>{!(e.target instanceof Node)||f.current?.contains(e.target)||f.current?.querySelector(`[aria-haspopup="menu"][aria-expanded="true"]`)||n(null)};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t,!0),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t,!0)}},[g,n]),(0,W.jsxs)(X,{...u,ref:f,className:E(`caps-status-tray`,l),"data-placement":o,"data-align":s,children:[h?(0,W.jsxs)(Z,{open:!0,ref:p,tabIndex:-1,side:`top`,id:`${d}-${h.id}`,role:`dialog`,"aria-labelledby":`${d}-title`,className:`caps-status-tray-panel`,"data-status-tray-panel":h.id,children:[(0,W.jsxs)(`div`,{className:`caps-status-tray-head`,children:[h.tone?(0,W.jsx)(M,{size:`compact`,tone:h.tone,glyph:h.glyph??`dot`}):null,(0,W.jsx)(`span`,{id:`${d}-title`,className:`caps-status-tray-title`,children:h.title??h.label}),h.actions,(0,W.jsx)(P,{"aria-label":`Close tray`,icon:(0,W.jsx)(k,{"aria-hidden":`true`}),onClick:_})]}),(0,W.jsx)(`div`,{className:`caps-status-tray-body`,children:h.content})]}):null,o===`host`?null:(0,W.jsxs)(`div`,{className:`caps-status-tray-row`,children:[r,(0,W.jsx)(`div`,{className:`caps-status-tray-chips`,children:e.map(e=>{let r={ref:t=>{t?m.current.set(e.id,t):m.current.delete(e.id)},type:`button`,className:a?void 0:`caps-status-tray-chip`,"aria-expanded":g===e.id,"aria-controls":g===e.id?`${d}-${e.id}`:void 0,"aria-label":e.accessibleLabel,disabled:e.disabled,title:e.disabled?e.accessibleLabel:void 0,"aria-haspopup":`dialog`,"data-status-tray-chip":e.id,onClick:()=>{n(t===e.id?null:e.id)},children:(0,W.jsxs)(W.Fragment,{children:[e.tone?(0,W.jsx)(M,{size:`compact`,glyph:e.glyph??`dot`,motion:e.motion??`none`,tone:e.tone}):null,(0,W.jsx)(`span`,{className:`caps-status-tray-label`,children:e.label}),e.count!==void 0&&e.count>0?(0,W.jsx)(`span`,{className:`caps-status-tray-count`,children:e.count}):null]})};return(0,W.jsxs)(G.Fragment,{children:[a?a(r):(0,W.jsx)(`button`,{...r}),e.after]},e.id)})}),i]})]})}function ee({children:e,className:t,...n}){return(0,W.jsx)(`div`,{...n,className:E(`caps-status-tray-list`,t),children:e})}function te({icon:e,primary:t,secondary:n,actions:r,className:i,...a}){return(0,W.jsxs)(`div`,{...a,className:E(`caps-status-tray-item`,i),children:[e?(0,W.jsx)(`span`,{className:`caps-status-tray-icon`,children:e}):null,(0,W.jsxs)(`span`,{className:`caps-status-tray-text`,children:[(0,W.jsx)(`span`,{className:`caps-status-tray-primary`,children:t}),n?(0,W.jsx)(`span`,{className:`caps-status-tray-secondary`,children:n}):null]}),r?(0,W.jsx)(`span`,{className:`caps-status-tray-actions`,children:r}):null]})}function ne({children:e=`All caught up.`,title:t}){return(0,W.jsxs)(`div`,{className:`caps-status-tray-note`,children:[t?(0,W.jsx)(`strong`,{className:`caps-status-tray-note-title`,children:t}):null,(0,W.jsx)(`p`,{children:e})]})}var re=(0,G.forwardRef)(function({className:e,invalid:t,...n},r){return(0,W.jsx)(`textarea`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:E(`textarea textarea-bordered w-full`,t&&`textarea-error`,e),ref:r})});export{te as a,Q as c,U as d,H as f,ne as i,Y as l,B as m,$ as n,Z as o,V as p,ee as r,X as s,re as t,q as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,Vn as n,a as r,d as i,g as a,i as o,l as s,m as c,o as l,p as u,s as d,t as f,v as p,x as m}from"./button-oE2Hrd5D.js";import{f as h,p as g}from"./textarea-LIOZDOK4.js";import{a as _,i as v,n as y,o as b,r as x}from"./status-DNJRO5m5.js";import{r as S}from"./modules-C4mfDnjH.js";import{Dn as C}from"./useTriggerFocusGuards-Bddw7Qdn.js";import{n as w}from"./keycap-D2RkH2IS.js";var T=m(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),ee=m(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),te=m(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);function E({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function D(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var O=[],k=0,{link:ne,unlink:A,propagate:j,checkDirty:re,shallowPropagate:ie}=E({update(e){return e._update()},notify(e){O[ae++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,se(e))}}),M=0,ae=0,N,oe=0;function P(e){try{++oe,e()}finally{--oe||ce()}}function se(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=A(n,e)}function ce(){if(!(oe>0)){for(;M<ae;){let e=O[M];O[M++]=void 0,e.notify()}M=0,ae=0}}function le(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return N!==void 0&&ne(i,N,k),i._snapshot},subscribe(e){let t=D(e),n={current:!1},r=ue(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=N,o=t?.compare??Object.is;if(n)N=i,++k,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{N=a,n&&(i.flags&=-5),se(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&re(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ie(e)}}else e&32&&(i.flags=e&-33);return N!==void 0&&ne(i,N,k),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(j(e),ie(e),ce())}},i}function ue(e){let t=()=>{let t=N;N=n,++k,n.depsTail=void 0,n.flags=6;try{return e()}finally{N=t,n.flags&=-5,se(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&re(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,se(this)}};return t(),n}var de=class{constructor(e,t){this.atom=le(e),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),t&&(this.actions=t(this))}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(D(e))}},fe=class{constructor(e){this.atom=le(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(D(e))}};function F(e,t){return typeof e==`function`?new fe(e):t?new de(e,t):new de(e)}var pe=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function me(e,t){return new pe(e,t).maybeExecute}var he=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},I=new class extends he{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function L(e,t){return typeof e==`function`?e(t):e}function ge(e,t){return Ce(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function R(e,t,n){let r=Ce(t);function i(e){if(!r.length)return L(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function _e(e,t){let n=Ce(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var ve=46,ye=91,be=93,xe=48,Se=57;function Ce(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===ye),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===ve||s===ye||s===be){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==xe),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==be&&(a!==-1||s!==be)&&(a!==s||s!==ve&&s!==ye)&&n.push(``);r=o+1,i=!0}else(s<xe||s>Se)&&(i=!1);a=s}return n.length||n.push(``),n}function we(e){return!(Array.isArray(e)&&e.length===0)}function z(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function B(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var Te=e=>!!e&&typeof e==`object`&&`fields`in e;function V(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!V(e[i],t[i]))return!1;return!0}var Ee=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},De=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function H(e,t){return e==null?t:{...e,...t}}for(var U=256,Oe=[],ke;U--;)Oe[U]=(U+256).toString(16).substring(1);function Ae(){let e=0,t,n=``;if(!ke||U+16>256){for(ke=Array(256),e=256;e--;)ke[e]=256*Math.random()|0;e=0,U=0}for(;e<16;e++)t=ke[U+e],n+=e===6?Oe[t&15|64]:e===8?Oe[t&63|128]:Oe[t],e&1&&e>1&&e<11&&(n+=`-`);return U++,n}var je=me(e=>I.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function W(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=W(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,W(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(W(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=W(e[n]));return t}function G(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var K=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function Me(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var Ne=(e,t)=>{let n=Me(e,t);return{form:n,fields:n}},q={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:Ne(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:Ne(r.issues,e)}},Pe=e=>!!e&&`~standard`in e,J={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function Y(e){function t(t){let n=e.getFieldMeta(t)??J;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>J;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function Fe(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var Ie=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{je(this)}),t=I.on(`request-form-state`,e=>{e.payload.id===this._formId&&I.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=I.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=I.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),I.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return I.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!V(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!V(e.defaultState,t.defaultState)&&!this.state.isTouched;if(!(!n&&!r)){if(P(()=>{this.baseStore.setState(()=>Fe(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=Y(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}I.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=R(t,e.instance.name,e.instance.options.defaultValue))}),Fe({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return P(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return P(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=z(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||K}),r=!1,i={};return P(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=Le(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=Re(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??J,r=a?.[e],{newErrorValue:s,newSource:c}=Ee({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=J)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=Re(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=Re(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=B(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||K});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=Re(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=Le(r);s&&(i=i?{...i,...s}:s);let c=Re(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??J,r=i?.[e],{newErrorValue:a,newSource:o}=Ee({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=J)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),P(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),I.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),I.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}P(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),P(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),I.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),I.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>ge(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:L(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=J,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;P(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:R(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t!==n&&t.startsWith(n)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=_e(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),Y(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],H(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),Y(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),H(r,{dontValidate:!0})),Y(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),H(n,{dontValidate:!0})),Y(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return R(R(e,`${t}`,i),`${n}`,r)},H(r,{dontValidate:!0})),Y(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},H(r,{dontValidate:!0})),Y(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],H(t,{dontValidate:!0})),Y(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=ge(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:J},values:i===void 0?t.values:R(t.values,e,i)}})},this.setErrorMap=e=>{P(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(Te(t)){let{formError:e,fieldErrors:r}=Le(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>q.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>q.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??Ae(),this._devtoolsSubmissionOverride=!1;let t=Fe({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(!(n===void 0||!Te(n)))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=F(t);let n;this.fieldMetaDerived=F(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=ge(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;(!e||!e.options.disableErrorFlat)&&(u=u.flat(1))}let d=!we(u),f=!o.isDirty,p=V(l,this.getFieldInfo(a)?.instance?.options.defaultValue??ge(this.options.defaultValues,a));if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s){i[a]=c,r++;continue}i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=F(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!G(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&G(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];(!y||y.__srcErrorMap!==g)&&(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let T={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(T,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=T}return r});let r;this.store=F(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];(!r||t.errorMap!==r.errorMap)&&(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&Te(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&V(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return Pe(e.validate)?q[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function Le(e){return e?Te(e)?{formError:Le(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function Re(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var ze=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...J,isTouched:e.fieldMetaBase[this.name]?.isTouched??J.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??J.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??J.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(V(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,H(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,H(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,H(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,H(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,H(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,H(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,H(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,H(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=z(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||K}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=z(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||K});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;P(()=>{let e=(e,n)=>{let r=Ve(n.cause),a=n.validate?Be(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=De({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=Ve(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=B(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||K}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=B(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||K});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));P(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=Ve(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=Be(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=De({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),P(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>G(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[Ve(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[Ve(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)a.get(t)&&!t.options.asyncAlways||c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>q.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>q.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)G(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=F(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...J,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!V(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return Pe(e.validate)?q[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function Be(e){if(e)return e}function Ve(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function He(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function Ue(e){return{...J,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var We=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??He({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(V(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...J,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??He({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;Ke(t)&&(n=t.group,r=t.fields);let i=Ge(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:He({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,H(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof ze&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&G(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=Ee({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=J)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=z(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||K}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=z(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||K});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;P(()=>{let t=(t,r)=>{let i=Je(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&Ke(s)&&(c=s.group,l=s.fields);let u=Ge(c),d=n[i],{newErrorValue:f,newSource:p}=De({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=Je(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=B(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||K}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=B(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||K});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=Je(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&Ke(o)&&(l=o.group,u=o.fields);let d=Ge(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=De({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return P(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>G(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[Je(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>G(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),P(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid()){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}P(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),P(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=F(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??Ue(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!V(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(Pe(e.validate)){let t=q[e.type](e.value,e.validate);return e.type===`validate`?qe(t):t.then(qe)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function Ge(e){if(e)return e}function Ke(e){return!!e&&typeof e==`object`&&`fields`in e}function qe(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function Je(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function Ye(e,t){if(!t)return;let n=Object.assign({},e,{state:W(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return P(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var X=e(n(),1),Xe=C();function Ze(e,t){return e===t}function Z(e,t=e=>e,n){let r=n?.compare??Ze,i=(0,X.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,X.useCallback)(()=>e.get(),[e]);return(0,Xe.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var Q=t(),$=typeof window<`u`?X.useLayoutEffect:X.useEffect;function Qe(e){let[t,n]=(0,X.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,X.useState)(()=>new ze({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new ze({...e}),i(a),n({form:e.form,name:e.name}));let o=Z(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=Z(a.store,e=>e.meta.isTouched),c=Z(a.store,e=>e.meta.isBlurred),l=Z(a.store,e=>e.meta.isDirty),u=Z(a.store,e=>e.meta.errorMap),d=Z(a.store,e=>e.meta.errorSourceMap),f=Z(a.store,e=>e.meta.isValidating),p=(0,X.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return $(a.mount,[a]),$(()=>{a.update(e)}),p}var $e=(({children:e,...t})=>{let n=Qe(t),r=(0,X.useMemo)(()=>L(e,n),[e,n]);return(0,Q.jsx)(Q.Fragment,{children:r})});function et(){return(0,X.useState)(()=>Ae())[0]}var tt=X,nt=`18.3.1`.split(`.`)[0]===`17`?et:tt.useId;function rt(e){let[t,n]=(0,X.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,X.useState)(()=>new We({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new We({...e})),n({form:e.form,name:e.name}));let a=Z(r.store,e=>e.value),o=Z(r.store,e=>e.meta.isTouched),s=Z(r.store,e=>e.meta.isBlurred),c=Z(r.store,e=>e.meta.isDirty),l=Z(r.store,e=>e.meta.errorMap),u=Z(r.store,e=>e.meta.errorSourceMap),d=Z(r.store,e=>e.meta.isValidating),f=Z(r.store,e=>e.meta.isSubmitting),p=Z(r.store,e=>e.meta.isSubmitted),m=Z(r.store,e=>e.meta.submissionAttempts),h=Z(r.store,e=>e.meta.isSubmitSuccessful),g=Z(r.store,e=>e.meta.canSubmit),_=Z(r.store,e=>e.meta.isValid),v=Z(r.store,e=>e.meta.isFieldsValid),y=Z(r.store,e=>e.meta.isFieldsValidating),b=Z(r.store,e=>e.meta.isGroupValid),x=(0,X.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return $(r.mount,[r]),$(()=>{r.update(e)}),x}var it=(({children:e,...t})=>{let n=rt(t),r=(0,X.useMemo)(()=>L(e,n),[e,n]);return(0,Q.jsx)(Q.Fragment,{children:r})});function at({form:e,selector:t=e=>e,children:n}){let r=Z(e.store,t);return(0,Q.jsx)(Q.Fragment,{children:L(n,r)})}function ot(e){let t=nt(),[n,r]=(0,X.useState)(e?.formId),[i,a]=(0,X.useState)(()=>new Ie({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new Ie({...e,formId:n})),r(n)}let o=(0,X.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,Q.jsx)($e,{...e,form:i})},e.FormGroup=function(e){return(0,Q.jsx)(it,{...e,form:i})},e.Subscribe=function(e){return(0,Q.jsx)(at,{form:i,selector:e.selector,children:e.children})},e},[i]);$(i.mount,[]),$(()=>{i.update(e)});let s=(0,X.useRef)(!1);return $(()=>{s.current&&e?.transform&&Ye(i,e.transform)},[i,e?.transform]),$(()=>{s.current=!0}),o}var st=(0,X.forwardRef)(function({className:e,invalid:t,...n},r){return(0,Q.jsx)(`input`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:p(`input caps-input w-full`,e),ref:r})});(0,X.forwardRef)(function({leading:e,className:t,...n},r){return(0,Q.jsxs)(`span`,{className:`caps-search-input`,"data-leading":e?`true`:void 0,children:[e?(0,Q.jsx)(`span`,{className:`caps-search-leading`,"aria-hidden":`true`,children:e}):null,(0,Q.jsx)(st,{...n,type:`search`,className:t,ref:r})]})});var ct=(0,X.forwardRef)(function({children:e,className:t,optional:n,required:r,...i},a){return(0,Q.jsxs)(`label`,{...i,className:p(`label caps-label cursor-pointer justify-start gap-sm text-sm font-semibold text-base-content`,t),ref:a,children:[e,r?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`text-error`,children:`*`}):null,n&&!r?(0,Q.jsx)(`span`,{className:`caps-label-optional`,children:`Optional`}):null]})}),lt=(0,X.forwardRef)(function({children:e,className:t,...n},r){return(0,Q.jsx)(`div`,{...n,className:p(`caps-input-group join flex w-full items-stretch [&>*]:join-item [&>*:first-child]:rounded-e-none [&>*:last-child]:rounded-s-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>.btn]:shrink-0 [&>.input]:min-w-0 [&>.input]:flex-1 [&>.select]:min-w-0 [&>.select]:flex-1`,t),ref:r,children:X.Children.map(e,e=>(0,X.isValidElement)(e)?(0,X.cloneElement)(e,{className:p(`join-item caps-input-group-control`,e.props.className)}):e)})}),ut=(0,X.forwardRef)(function({className:e,...t},n){return(0,Q.jsx)(`div`,{...t,className:p(`join-item flex items-center border border-base-300 bg-base-200 px-md text-sm text-base-content`,e),ref:n})});function dt(e){let t=e.parentElement;if(!t||e.previousElementSibling===null)return 0;let n=getComputedStyle(t);if(!(n.display.includes(`grid`)||n.display.includes(`flex`)&&n.flexDirection.startsWith(`column`)))return 0;let r=Number.parseFloat(n.rowGap);return Number.isFinite(r)?r:0}(0,X.forwardRef)(function({show:e,appear:t=!1,children:n,className:r,...o},l){let u=(0,X.useRef)(null);(0,X.useImperativeHandle)(l,()=>u.current);let d=a(),[f,m]=(0,X.useState)(e),h=(0,X.useRef)(!0);return e&&!f&&m(!0),(0,X.useLayoutEffect)(()=>{let n=u.current,r=h.current;if(h.current=!1,!n||r&&!t)return;if(!s(n)){e||m(!1);return}let a=c(n),o=`translateY(${String(a.distance)}px)`,l=i(a,a.ease),f=n.getBoundingClientRect().height,p=dt(n),g=(e,t)=>{n.style.overflow=`clip`;let r=e=>({height:`${String(e)}px`,marginBlockStart:`${String(e===0?-p:0)}px`}),i=n.animate([r(e),r(t)],{duration:a.normal,easing:l}),o=()=>{n.style.removeProperty(`overflow`)};return i.addEventListener(`finish`,o),i.addEventListener(`cancel`,o),i};if(e){let e=[n.animate([{opacity:0,transform:o},{opacity:1,transform:`none`}],{duration:a.normal,easing:l})];return!d&&f>0&&e.push(g(0,f)),()=>{for(let t of e)t.cancel()}}let _=n.animate([{opacity:1,transform:`none`},{opacity:0,transform:o}],{duration:a.fast,easing:i(a,a.easeExit),fill:`forwards`}),v=!d&&f>0?g(f,0):_;return v!==_&&v.effect?.updateTiming({fill:`forwards`}),v.addEventListener(`finish`,()=>{m(!1)}),()=>{_.cancel(),v.cancel()}},[e,t,d]),f?(0,Q.jsx)(`div`,{...o,ref:u,className:p(`caps-presence`,r),"data-present":e,"aria-hidden":!e||void 0,children:n}):null});var ft=(0,X.forwardRef)(function({open:e,children:t,className:n,...r},i){return(0,Q.jsx)(`div`,{...r,ref:i,className:p(`caps-collapse`,n),"data-open":e,"aria-hidden":!e||void 0,children:(0,Q.jsx)(`div`,{className:`caps-collapse-clip`,children:t})})});(0,X.forwardRef)(function({swapKey:e,anchor:t=`start`,children:n,className:r,...o},l){let u=(0,X.useRef)(null);(0,X.useImperativeHandle)(l,()=>u.current);let d=a(),[f,m]=(0,X.useState)({key:e,content:n}),[h,g]=(0,X.useState)([]);f.key===e?f.content!==n&&m({key:e,content:n}):(g([...h.filter(t=>t.key!==e&&t.key!==f.key),f]),m({key:e,content:n}));let _=(0,X.useRef)(null);return(0,X.useLayoutEffect)(()=>{let e=u.current;if(!e||!(`ResizeObserver`in globalThis))return;_.current=e.getBoundingClientRect();let t=new ResizeObserver(()=>{e.getAnimations().length===0&&(_.current=e.getBoundingClientRect())});return t.observe(e),()=>{t.disconnect()}},[]),(0,X.useLayoutEffect)(()=>{let e=u.current;if(!e)return;let t=[...e.querySelectorAll(`:scope > [data-swap-leaving]`)],n=e.querySelector(`:scope > [data-swap-current]`);if(n===null||t.length===0)return;if(!s(e)){g([]);return}let r=_.current,a=e.getBoundingClientRect(),o=c(e),l=[n.animate([{opacity:0,filter:`blur(${String(o.blur)}px)`,transform:`translateY(${String(o.distance/2)}px)`},{opacity:1,filter:`blur(0px)`,transform:`none`}],{duration:o.normal,easing:i(o,o.ease)})];for(let e of t){let t=e.animate([{opacity:1,filter:`blur(0px)`,transform:`none`},{opacity:0,filter:`blur(${String(o.blur)}px)`,transform:`translateY(${String(-o.distance/2)}px)`}],{duration:o.fast,easing:i(o,o.easeExit),fill:`forwards`}),n=e.dataset.swapLeaving;t.onfinish=()=>{g(e=>e.filter(e=>e.key!==n))},l.push(t)}let f=r!==null&&(Math.abs(r.height-a.height)>.5||Math.abs(r.width-a.width)>.5);return!d&&f&&l.push(e.animate([{width:`${String(r.width)}px`,height:`${String(r.height)}px`},{width:`${String(a.width)}px`,height:`${String(a.height)}px`}],{duration:o.normal,easing:i(o,o.ease)})),()=>{for(let e of l)e.cancel()}},[e,d]),(0,Q.jsx)(`div`,{...o,ref:u,className:p(`caps-swap`,r),"data-anchor":t,children:[...h.map(e=>(0,Q.jsx)(`div`,{className:`caps-swap-layer`,"data-swap-leaving":e.key,"aria-hidden":`true`,children:e.content},e.key)),(0,Q.jsx)(`div`,{className:`caps-swap-layer`,"data-swap-current":``,children:n},e)]})});function pt({children:e,...t}){let[n,r]=(0,X.useState)(e);return e&&e!==n&&r(e),(0,Q.jsx)(ft,{...t,className:p(`caps-field-error-reveal`,t.className),open:!!e,children:(0,Q.jsx)(`div`,{className:`caps-field-error`,role:`alert`,"aria-hidden":!e,children:n})})}function mt({children:e,divider:t=!0,error:n,layout:r=`end`,status:i,...a}){return(0,Q.jsxs)(`footer`,{...a,className:p(`caps-form-footer`,a.className),"data-divider":t,"data-layout":r,children:[(0,Q.jsx)(pt,{children:n}),(0,Q.jsxs)(`div`,{className:`caps-form-footer-row`,children:[i?(0,Q.jsx)(`div`,{className:`caps-form-footer-status`,role:`status`,children:i}):null,(0,Q.jsx)(`div`,{className:`caps-form-footer-actions`,children:e})]})]})}var ht=(0,X.forwardRef)(function({busy:e=!1,children:t,className:n,layout:r,...i},a){return(0,Q.jsx)(`form`,{...i,"aria-busy":e||void 0,className:p(`caps-form`,n),"data-layout":r,ref:a,children:(0,Q.jsx)(`fieldset`,{className:`caps-form-body`,disabled:e,children:t})})}),gt={2:`h2`,3:`h3`,4:`h4`},_t=(0,X.forwardRef)(function({children:e,className:t,description:n,layout:r,level:i=3,title:a,...o},s){let c=(0,X.useId)(),l=gt[i];return(0,Q.jsxs)(`section`,{...o,"aria-labelledby":`${c}-title`,className:p(`caps-form-section`,t),"data-layout":r,ref:s,children:[(0,Q.jsxs)(`header`,{className:`caps-form-section-copy`,children:[(0,Q.jsx)(l,{className:`caps-form-section-title`,id:`${c}-title`,children:a}),n?(0,Q.jsx)(`p`,{className:`caps-form-section-description`,children:n}):null]}),(0,Q.jsx)(`div`,{className:`caps-form-section-fields`,children:e})]})}),vt=(0,X.forwardRef)(function({children:e,className:t,description:n,error:r,icon:i,layout:a,legend:o,legendTitle:s,...c},l){let u=(0,X.useId)(),d=[n?`${u}-description`:c[`aria-describedby`],r?`${u}-error`:null].filter(Boolean).join(` `)||void 0;return(0,Q.jsxs)(`fieldset`,{...c,"aria-describedby":d,"aria-invalid":r?!0:c[`aria-invalid`],className:p(`caps-fieldset`,t),"data-layout":a,ref:l,children:[(0,Q.jsxs)(`legend`,{className:`caps-fieldset-legend`,title:s,children:[i?(0,Q.jsx)(`span`,{className:`caps-field-icon`,"aria-hidden":`true`,children:i}):null,o]}),n?(0,Q.jsx)(`p`,{className:`caps-fieldset-description`,id:`${u}-description`,children:n}):null,(0,Q.jsx)(`div`,{className:`caps-fieldset-fields`,children:e}),r===void 0?null:(0,Q.jsx)(pt,{id:`${u}-error`,children:r})]})});function yt(e){let t=[];return X.Children.forEach(e.props.children,e=>{(0,X.isValidElement)(e)&&e.type!==ut&&t.push(e)}),t[0]??null}var bt=(0,X.forwardRef)(function({children:e,className:t,description:n,error:r,icon:i,label:a,labelTitle:o,optional:s,orientation:c=`vertical`,readout:l=!1,required:u,...d},f){let m=(0,X.useId)(),h=(0,X.isValidElement)(e)?e:null,g=h?.type===lt,_=g?yt(h):h,v=_?.props.id??m,y=`${v}-description`,b=`${v}-error`,x=[_?.props[`aria-describedby`],n?y:null,r?b:null].filter(Boolean).join(` `)||void 0,S=u===!0||_?.props.required,C=r?!0:_?.props[`aria-invalid`],w=u===!0||_?.props[`aria-required`],T={id:v};S!==void 0&&(T.required=S),x!==void 0&&(T[`aria-describedby`]=x),C!==void 0&&(T[`aria-invalid`]=C),w!==void 0&&(T[`aria-required`]=w);let ee=h&&_&&!l?g?(0,X.cloneElement)(h,void 0,X.Children.map(h.props.children,e=>e===_?(0,X.cloneElement)(_,T):e)):(0,X.cloneElement)(h,T):e,te=a?(0,Q.jsx)(ct,{htmlFor:l?void 0:v,title:o,className:c===`inline`?`font-normal`:void 0,...u===void 0?{}:{required:u},...s===void 0?{}:{optional:s},children:a}):null,E=a||n?(0,Q.jsxs)(`div`,{className:`caps-field-copy`,children:[te,n?(0,Q.jsx)(`p`,{className:`caps-field-description`,id:y,children:n}):null]}):null,D=i?(0,Q.jsxs)(`div`,{className:`caps-field-lead`,children:[(0,Q.jsx)(`span`,{className:`caps-field-icon`,"aria-hidden":`true`,children:i}),E]}):E;return(0,Q.jsxs)(`div`,{...d,className:p(`caps-field`,t),"data-orientation":c,ref:f,children:[c===`horizontal`?(0,Q.jsxs)(`div`,{className:`caps-field-row`,children:[D,ee]}):c===`inline`?(0,Q.jsxs)(`div`,{className:`caps-field-row`,children:[ee,D]}):(0,Q.jsxs)(Q.Fragment,{children:[D,ee]}),(0,Q.jsx)(pt,{id:b,children:r})]})});function xt(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1}var St=`M 9.86 38.14 A 20 20 0 1 1 38.14 38.14`,Ct=6,wt=new Map([[`ArrowUp`,1],[`ArrowDown`,-1],[`PageUp`,10],[`PageDown`,-10]]),Tt=(0,X.forwardRef)(function({className:e,decrementLabel:t=`Decrease`,defaultValue:n=null,disabled:r,incrementLabel:i=`Increase`,invalid:a,max:o,min:s,onBlur:c,onKeyDown:l,onValueChange:u,step:d=1,unit:m,value:h,wrap:g=!1,..._},v){let[y,b]=(0,X.useState)(n),[x,S]=(0,X.useState)(null),C=h===void 0?y:h,w=xt(d),T=e=>{let t=Number(e.toFixed(w));return s!==void 0&&t<s?s:o!==void 0&&t>o?o:t},E=e=>{let t=e===null?null:T(e);b(t),S(null),t!==C&&u?.(t)},D=()=>{if(x===null)return;let e=Number(x);E(x.trim()===``||!Number.isFinite(e)?null:e)},O=e=>{let t=(C??s??0)+e*d;if(g&&s!==void 0&&o!==void 0){if(t>o){E(s);return}if(t<s){E(o);return}}E(t)},k=s!==void 0&&C!==null&&C<=s,ne=o!==void 0&&C!==null&&C>=o,A=r===!0,j=(0,X.useRef)(null),re=s!==void 0&&o!==void 0&&o>s?((C??s)-s)/(o-s):null,ie=e=>{A||(e.currentTarget.setPointerCapture(e.pointerId),j.current={y:e.clientY,value:C??s??0})},M=e=>{if(!j.current)return;let t=Math.trunc((j.current.y-e.clientY)/Ct),n=T(j.current.value+t*d);n!==C&&E(n)},ae=()=>{j.current=null};return(0,Q.jsxs)(`span`,{className:p(`caps-number-field`,e),"data-at-max":ne||void 0,"data-at-min":k||void 0,"data-disabled":A||void 0,"data-wrap":g||void 0,children:[re===null?null:(0,Q.jsxs)(`svg`,{className:`caps-number-field-dial`,viewBox:`0 0 48 48`,"aria-hidden":`true`,focusable:`false`,onPointerDown:ie,onPointerMove:M,onPointerUp:ae,onPointerCancel:ae,children:[(0,Q.jsx)(`path`,{className:`caps-number-field-dial-track`,d:St,pathLength:100}),(0,Q.jsx)(`path`,{className:`caps-number-field-dial-level`,d:St,pathLength:100,strokeDasharray:`${String(Math.max(.5,re*100))} 100`})]}),(0,Q.jsx)(f,{type:`button`,variant:`outline`,size:`icon`,className:`caps-number-field-decrement`,"aria-label":t,"aria-controls":_.id,tabIndex:-1,disabled:A||k&&!g,onClick:()=>{O(-1)},children:(0,Q.jsx)(ee,{"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`caps-number-field-readout`,children:[(0,Q.jsx)(`input`,{..._,"aria-invalid":a?!0:_[`aria-invalid`]===!1?void 0:_[`aria-invalid`],className:`input caps-input caps-number-field-input`,disabled:r,inputMode:_.inputMode??(w>0?`decimal`:`numeric`),max:o,min:s,onBlur:e=>{D(),c?.(e)},onChange:e=>{S(e.target.value)},onKeyDown:e=>{if(l?.(e),e.defaultPrevented)return;let t=wt.get(e.key);t===void 0?e.key===`Home`&&s!==void 0?(e.preventDefault(),E(s)):e.key===`End`&&o!==void 0?(e.preventDefault(),E(o)):e.key===`Enter`&&D():(e.preventDefault(),O(t))},ref:v,step:d,type:`number`,value:x??(C===null?``:String(C))}),m?(0,Q.jsx)(`span`,{className:`caps-number-field-unit`,"aria-hidden":`true`,children:m}):null]}),(0,Q.jsx)(f,{type:`button`,variant:`outline`,size:`icon`,className:`caps-number-field-increment`,"aria-label":i,"aria-controls":_.id,tabIndex:-1,disabled:A||ne&&!g,onClick:()=>{O(1)},children:(0,Q.jsx)(te,{"aria-hidden":`true`})})]})}),Et=(0,X.forwardRef)(function({className:e,invalid:t,...n},r){return(0,Q.jsxs)(`span`,{className:`caps-select-shell`,children:[(0,Q.jsx)(`select`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:p(`select select-bordered caps-select w-full`,t&&`select-error`,e),ref:r}),!n.multiple&&(!n.size||n.size<=1)?(0,Q.jsx)(b,{className:`caps-select-chevron`,"aria-hidden":`true`}):null]})}),Dt={unchecked:`M3.25 5.9 L5.1 7.9 L8.8 3.8`,checked:`M3.25 5.9 L5.1 7.9 L8.8 3.8`,mixed:`M3.4 6 L6 6 L8.6 6`},Ot={blurStdDeviation:.22,alphaSlope:18,alphaIntercept:-8};function kt({state:e}){let t=`caps-checkbox-${(0,X.useId)().replaceAll(`:`,``)}`,n=(0,X.useRef)(null),i=(0,X.useRef)(e).current,s=(0,X.useRef)(e),f=a();return(0,X.useLayoutEffect)(()=>{if(!n.current)return;let t=e!==`unchecked`,r=s.current!==`unchecked`,i=f||s.current===e;s.current=e;let a=c(n.current),o=x(a,{ease:`inCubic`,duration:160}),l=S(n.current,{d:{to:Dt[e],...i?y:x(a,{ease:`outCubic`,duration:200})},"stroke-dashoffset":{to:+!t,...i?y:t?x(a,{ease:`inOutSine`,duration:260}):o},"stroke-width":i?{to:t?2.4:0,duration:0}:t&&!r?[{to:2.2,...x(a,{ease:`outCubic`,duration:65})},{to:2.4,delay:u(a,120),...v(a,{bounce:.35,duration:220})}]:{to:t?2.4:0,...o}});return()=>{l.cancel()}},[e,f]),(0,Q.jsxs)(`svg`,{className:`caps-checkbox-visual`,width:`24`,height:`24`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,Q.jsxs)(`defs`,{children:[(0,Q.jsx)(d,{id:`${t}-surface`,transform:`matrix(1 0 0 1 6 6)`}),(0,Q.jsx)(l,{id:`${t}-shadow`}),(0,Q.jsx)(r,{id:`${t}-inset`}),(0,Q.jsx)(o,{id:`${t}-goo`,values:Ot}),(0,Q.jsxs)(`filter`,{id:`${t}-relief`,x:`-25%`,y:`-25%`,width:`150%`,height:`150%`,colorInterpolationFilters:`sRGB`,children:[(0,Q.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.28`,result:`relief`}),(0,Q.jsx)(`feSpecularLighting`,{in:`relief`,surfaceScale:`1.2`,specularConstant:`0.55`,specularExponent:`18`,lightingColor:`color-mix(in srgb, var(--color-white) calc(var(--depth) * 100%), var(--color-black))`,result:`light`,children:(0,Q.jsx)(`feDistantLight`,{azimuth:`225`,elevation:`55`})}),(0,Q.jsx)(`feComposite`,{in:`light`,in2:`SourceAlpha`,operator:`in`,result:`clipped-light`}),(0,Q.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`clipped-light`,mode:`screen`})]}),(0,Q.jsx)(`mask`,{id:`${t}-contour`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`12`,height:`12`,style:{maskType:`alpha`},children:(0,Q.jsx)(`path`,{ref:n,d:Dt[i],fill:`none`,stroke:`var(--color-white)`,strokeWidth:i===`unchecked`?0:2.4,pathLength:`1`,strokeDasharray:`1`,strokeDashoffset:+(i===`unchecked`),strokeLinecap:`round`,strokeLinejoin:`round`,filter:e===`mixed`?void 0:`url(#${t}-goo)`})}),(0,Q.jsx)(`clipPath`,{id:`${t}-well`,children:(0,Q.jsx)(`rect`,{x:`1`,y:`1`,width:`10`,height:`10`,rx:`2.5`})})]}),(0,Q.jsx)(`rect`,{className:`caps-checkbox-track`,x:`0.5`,y:`0.5`,width:`11`,height:`11`,rx:`3`,filter:`url(#${t}-inset)`}),(0,Q.jsx)(`g`,{clipPath:`url(#${t}-well)`,children:(0,Q.jsx)(`g`,{filter:`url(#${t}-shadow)`,children:(0,Q.jsx)(`g`,{filter:`url(#${t}-relief)`,children:(0,Q.jsx)(`g`,{mask:`url(#${t}-contour)`,children:(0,Q.jsx)(`rect`,{x:`0`,y:`0`,width:`12`,height:`12`,fill:`url(#${t}-surface)`})})})})})]})}var At=(0,X.forwardRef)(function({className:e,appearance:t,indicator:n,invalid:r,indeterminate:i=!1,checked:a,defaultChecked:o=!1,onChange:s,...c},l){let u=(0,X.useRef)(null),[d,f]=(0,X.useState)(o),m=a??d,h=i?`mixed`:m?`checked`:`unchecked`;return(0,X.useImperativeHandle)(l,()=>{if(!u.current)throw Error(`Checkbox input is not mounted`);return u.current},[]),(0,X.useLayoutEffect)(()=>{u.current&&(u.current.indeterminate=i)},[i]),(0,X.useEffect)(()=>{let e=u.current?.form;if(!e||a!==void 0)return;let t=e=>{queueMicrotask(()=>{!e.defaultPrevented&&u.current&&f(o)})};return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[a,o,c.form]),(0,Q.jsxs)(`span`,{className:`caps-checkbox`,"data-appearance":t===`compact`?t:void 0,"data-state":h,"data-custom-indicator":n!==void 0||void 0,children:[(0,Q.jsx)(`input`,{...c,checked:m,"aria-checked":i?`mixed`:m,"aria-invalid":r?!0:c[`aria-invalid`]===!1?void 0:c[`aria-invalid`],className:p(`caps-checkbox-input`,e),onChange:e=>{a===void 0&&f(e.target.checked),s?.(e),e.currentTarget.indeterminate=i},ref:u,type:`checkbox`}),n===void 0?(0,Q.jsx)(kt,{state:h}):n]})}),jt={neutral:`progress-neutral`,primary:`progress-primary`,secondary:`progress-secondary`,accent:`progress-accent`,success:`progress-success`,info:`progress-info`,warning:`progress-warning`,error:`progress-error`},Mt=(0,X.forwardRef)(function({className:e,tone:t=`primary`,...n},r){return(0,Q.jsx)(`progress`,{...n,"data-complete":n.value!==void 0&&Number(n.value)>=Number(n.max??1)?`true`:void 0,className:p(`progress caps-gooey-motion caps-gooey-progress w-full`,jt[t],e),ref:r})});(0,X.forwardRef)(function({label:e,value:t,max:n,tone:r=`info`,className:i,...a},o){return(0,Q.jsxs)(`div`,{...a,ref:o,className:p(`caps-game-meter`,i),children:[(0,Q.jsxs)(`div`,{className:`caps-game-meter-readout`,children:[(0,Q.jsx)(`span`,{children:e}),(0,Q.jsxs)(`span`,{className:`caps-game-meter-value`,children:[t,` / `,n]})]}),(0,Q.jsx)(Mt,{"aria-label":e,value:t,max:n,tone:r})]})});function Nt({className:e,items:t,onCancel:n,onRemove:r,onRetry:i,rowClassName:a}){return t.length?(0,Q.jsx)(`div`,{"aria-live":`polite`,className:`caps-upload-queue flex w-full min-w-0 flex-col gap-sm ${e??``}`,"data-upload-rows":!0,children:t.map(e=>(0,Q.jsx)(It,{item:e,onCancel:n,onRemove:r,onRetry:i,...a===void 0?{}:{rowClassName:a}},e.id))}):null}function Pt({action:e,id:t,onAction:n,retry:r=!1}){return e?(0,Q.jsx)(w,{"aria-label":e.accessibleLabel,title:e.label,variant:`ghost`,size:`xs`,className:`motion-reduce:transition-none`,icon:r?(0,Q.jsx)(h,{}):(0,Q.jsx)(_,{}),onClick:()=>void n(t),type:`button`}):null}function Ft({item:e}){return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`block min-w-0 truncate`,title:e.name,children:e.name}),(0,Q.jsx)(`div`,{className:`caps-upload-details`,children:(0,Q.jsxs)(`span`,{"aria-live":e.alert?`assertive`:void 0,className:`caps-upload-status min-w-0 break-words`,"data-upload-status":!0,role:e.alert?`alert`:void 0,children:[e.alert??e.statusLabel,` `,e.progressLabel]})})]})}function It({item:e,onCancel:t,onRemove:n,onRetry:r,rowClassName:i}){return(0,Q.jsxs)(`div`,{className:`caps-upload-row grid w-full min-w-0 max-w-full grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-sm p-sm text-xs ${i??``}`,children:[e.preview.kind===`image`?(0,Q.jsx)(`img`,{alt:``,className:`caps-upload-preview mask mask-squircle size-8 shrink-0 object-cover`,src:e.preview.url}):(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`caps-upload-preview mask mask-squircle flex size-8 shrink-0 items-center justify-center bg-base-300`,children:(0,Q.jsx)(g,{className:`size-4`})}),(0,Q.jsx)(Ft,{item:e}),(0,Q.jsx)(Lt,{actions:e.actions,id:e.id,onCancel:t,onRemove:n,onRetry:r}),(0,Q.jsx)(Mt,{"aria-label":`${e.name} progress`,className:`caps-upload-progress`,tone:e.alert?`error`:e.progress===100?`success`:`accent`,max:100,value:e.progress??(e.alert?0:void 0)})]})}function Lt({actions:e,id:t,onCancel:n,onRemove:r,onRetry:i}){return(0,Q.jsxs)(`div`,{className:`caps-upload-actions flex min-w-0 flex-wrap justify-end gap-xs`,children:[(0,Q.jsx)(Pt,{action:e.retry,id:t,onAction:i,retry:!0}),(0,Q.jsx)(Pt,{action:e.cancel,id:t,onAction:n}),(0,Q.jsx)(Pt,{action:e.remove,id:t,onAction:r})]})}export{T as _,vt as a,_t as c,ut as d,st as f,V as g,Z as h,bt as i,Tt as l,Qe as m,At as n,ht as o,ot as p,Et as r,mt as s,Nt as t,lt as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Vn as t}from"./button-oE2Hrd5D.js";import{$ as n,At as r,Tt as i,at as a,mt as o,st as s,wt as c,yt as l}from"./dist-Cc0qB3Mq.js";var u=class extends s{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),c(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&o(t.mutationKey)!==o(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??n();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){a.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},d=e(t(),1);function f(e,t){let n=r(t),[o]=d.useState(()=>new u(n,e));d.useEffect(()=>{o.setOptions(e)},[o,e]);let s=d.useSyncExternalStore(d.useCallback(e=>o.subscribe(a.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),c=d.useCallback((...e)=>{o.mutate(e[0],e[1]).catch(l)},[o]);if(s.error&&i(o.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}export{f as t};