@arbidocs/blocks 0.4.162 → 0.4.164

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 (156) hide show
  1. package/bin/arbidocs-copy-pdf-assets.mjs +6 -29
  2. package/bin/pdfjs-shims.mjs +54 -0
  3. package/dist/{ConnectedNativeDocxComparison-GLHOGUP6.cjs → ConnectedNativeDocxComparison-4LSTT6MZ.cjs} +10 -10
  4. package/dist/{ConnectedNativeDocxComparison-GLHOGUP6.cjs.map → ConnectedNativeDocxComparison-4LSTT6MZ.cjs.map} +1 -1
  5. package/dist/{ConnectedNativeDocxComparison-LKIMKOTA.js → ConnectedNativeDocxComparison-SAYKB52H.js} +9 -9
  6. package/dist/{ConnectedStreamedWordArtifact-432HT7DK.js.map → ConnectedNativeDocxComparison-SAYKB52H.js.map} +1 -1
  7. package/dist/{ConnectedNativeDocxEditor-6LNYWZ3P.js → ConnectedNativeDocxEditor-G6RTBKEB.js} +8 -8
  8. package/dist/{ConnectedNativeDocxEditor-6LNYWZ3P.js.map → ConnectedNativeDocxEditor-G6RTBKEB.js.map} +1 -1
  9. package/dist/{ConnectedNativeDocxEditor-M3UGWL6K.cjs → ConnectedNativeDocxEditor-OGZ3UPSY.cjs} +10 -10
  10. package/dist/{ConnectedNativeDocxEditor-M3UGWL6K.cjs.map → ConnectedNativeDocxEditor-OGZ3UPSY.cjs.map} +1 -1
  11. package/dist/{ConnectedStreamedWordArtifact-432HT7DK.js → ConnectedStreamedWordArtifact-2T6ZBLUV.js} +9 -9
  12. package/dist/{ConnectedNativeDocxComparison-LKIMKOTA.js.map → ConnectedStreamedWordArtifact-2T6ZBLUV.js.map} +1 -1
  13. package/dist/{ConnectedStreamedWordArtifact-COEXL5IT.cjs → ConnectedStreamedWordArtifact-5SIOSURE.cjs} +10 -10
  14. package/dist/ConnectedStreamedWordArtifact-5SIOSURE.cjs.map +1 -0
  15. package/dist/NativeDocxEditor-T2PJIZMU.cjs +1 -1
  16. package/dist/NativeDocxEditor-TBTBD6TC.js +1 -1
  17. package/dist/{WorkspaceTableView-PTB5BPVA.js → WorkspaceTableView-EJKJZ6R4.js} +7 -7
  18. package/dist/{WorkspaceTableView-PTB5BPVA.js.map → WorkspaceTableView-EJKJZ6R4.js.map} +1 -1
  19. package/dist/{WorkspaceTableView-AQTF5F6T.cjs → WorkspaceTableView-G22XS4ZK.cjs} +9 -9
  20. package/dist/{WorkspaceTableView-AQTF5F6T.cjs.map → WorkspaceTableView-G22XS4ZK.cjs.map} +1 -1
  21. package/dist/agents/index.cjs +264 -264
  22. package/dist/agents/index.js +7 -7
  23. package/dist/auth/index.cjs +39 -27
  24. package/dist/auth/index.d.ts +1 -0
  25. package/dist/auth/index.js +1 -1
  26. package/dist/calls/index.cjs +5 -5
  27. package/dist/calls/index.js +3 -3
  28. package/dist/{chunk-NOXGEQQR.js → chunk-3EYPVHSY.js} +3 -3
  29. package/dist/{chunk-NOXGEQQR.js.map → chunk-3EYPVHSY.js.map} +1 -1
  30. package/dist/{chunk-2AMYT2HQ.js → chunk-4Q4W5WEO.js} +31 -7
  31. package/dist/chunk-4Q4W5WEO.js.map +1 -0
  32. package/dist/{chunk-NUAC5GTQ.cjs → chunk-5D5YDIBC.cjs} +3 -3
  33. package/dist/{chunk-NUAC5GTQ.cjs.map → chunk-5D5YDIBC.cjs.map} +1 -1
  34. package/dist/{chunk-4WWM3GQ5.js → chunk-ABEKUV6L.js} +11 -6
  35. package/dist/chunk-ABEKUV6L.js.map +1 -0
  36. package/dist/{chunk-SQQU3WRB.js → chunk-CVDIWVSU.js} +3 -3
  37. package/dist/{chunk-SQQU3WRB.js.map → chunk-CVDIWVSU.js.map} +1 -1
  38. package/dist/{chunk-ZW2AWACP.js → chunk-D7BUC2GM.js} +3 -3
  39. package/dist/{chunk-ZW2AWACP.js.map → chunk-D7BUC2GM.js.map} +1 -1
  40. package/dist/{chunk-LQYPOWKN.cjs → chunk-DX5Y2NO5.cjs} +5 -5
  41. package/dist/{chunk-LQYPOWKN.cjs.map → chunk-DX5Y2NO5.cjs.map} +1 -1
  42. package/dist/{chunk-VHJHY7TT.js → chunk-ECERC6TI.js} +3 -3
  43. package/dist/{chunk-VHJHY7TT.js.map → chunk-ECERC6TI.js.map} +1 -1
  44. package/dist/chunk-EQ3WRY2N.js +49 -0
  45. package/dist/chunk-EQ3WRY2N.js.map +1 -0
  46. package/dist/{chunk-6UTIAHQG.cjs → chunk-F5RV6Z4T.cjs} +62 -62
  47. package/dist/chunk-F5RV6Z4T.cjs.map +1 -0
  48. package/dist/{chunk-ZDOKJD44.js → chunk-FN5LMFMI.js} +4 -4
  49. package/dist/{chunk-ZDOKJD44.js.map → chunk-FN5LMFMI.js.map} +1 -1
  50. package/dist/{chunk-O5E3NKPI.cjs → chunk-G2Z2KARY.cjs} +5 -5
  51. package/dist/{chunk-O5E3NKPI.cjs.map → chunk-G2Z2KARY.cjs.map} +1 -1
  52. package/dist/{chunk-KQWC4YBX.js → chunk-H55HBIBH.js} +3 -3
  53. package/dist/{chunk-KQWC4YBX.js.map → chunk-H55HBIBH.js.map} +1 -1
  54. package/dist/{chunk-VYTK2WJB.cjs → chunk-ITMHL3HI.cjs} +4 -4
  55. package/dist/{chunk-VYTK2WJB.cjs.map → chunk-ITMHL3HI.cjs.map} +1 -1
  56. package/dist/{chunk-PCL7IEZO.js → chunk-IZ6SDB2Q.js} +4 -4
  57. package/dist/{chunk-PCL7IEZO.js.map → chunk-IZ6SDB2Q.js.map} +1 -1
  58. package/dist/{chunk-WU34CHU5.js → chunk-KM7P35MJ.js} +3 -3
  59. package/dist/{chunk-WU34CHU5.js.map → chunk-KM7P35MJ.js.map} +1 -1
  60. package/dist/{chunk-J7YHBMBB.js → chunk-L5GDCJPP.js} +4 -4
  61. package/dist/{chunk-J7YHBMBB.js.map → chunk-L5GDCJPP.js.map} +1 -1
  62. package/dist/{chunk-B3FMUFAW.cjs → chunk-LMQOTLG4.cjs} +4 -4
  63. package/dist/{chunk-B3FMUFAW.cjs.map → chunk-LMQOTLG4.cjs.map} +1 -1
  64. package/dist/{chunk-3VW7ZXQ6.cjs → chunk-LPUQHIVP.cjs} +4 -4
  65. package/dist/{chunk-3VW7ZXQ6.cjs.map → chunk-LPUQHIVP.cjs.map} +1 -1
  66. package/dist/{chunk-7RGLTF76.cjs → chunk-MEMWZ72Y.cjs} +11 -6
  67. package/dist/chunk-MEMWZ72Y.cjs.map +1 -0
  68. package/dist/{chunk-SFXVNFES.js → chunk-NKT6CO5F.js} +69 -6
  69. package/dist/chunk-NKT6CO5F.js.map +1 -0
  70. package/dist/{chunk-AR6A2PMV.cjs → chunk-NMU6VW4D.cjs} +4 -4
  71. package/dist/{chunk-AR6A2PMV.cjs.map → chunk-NMU6VW4D.cjs.map} +1 -1
  72. package/dist/{chunk-I6I34FDU.cjs → chunk-NVVBRQN2.cjs} +9 -9
  73. package/dist/{chunk-I6I34FDU.cjs.map → chunk-NVVBRQN2.cjs.map} +1 -1
  74. package/dist/{chunk-U7OUZHBH.cjs → chunk-OISSVUGI.cjs} +3 -3
  75. package/dist/{chunk-U7OUZHBH.cjs.map → chunk-OISSVUGI.cjs.map} +1 -1
  76. package/dist/chunk-TM2D4XT4.cjs +52 -0
  77. package/dist/chunk-TM2D4XT4.cjs.map +1 -0
  78. package/dist/{chunk-X3XPXEIM.cjs → chunk-UJEH5REK.cjs} +9 -9
  79. package/dist/{chunk-X3XPXEIM.cjs.map → chunk-UJEH5REK.cjs.map} +1 -1
  80. package/dist/{chunk-TQUYWUEE.cjs → chunk-UUN2WGGM.cjs} +7 -7
  81. package/dist/{chunk-TQUYWUEE.cjs.map → chunk-UUN2WGGM.cjs.map} +1 -1
  82. package/dist/{chunk-WQFGG2BV.cjs → chunk-VDGLAVVM.cjs} +69 -3
  83. package/dist/chunk-VDGLAVVM.cjs.map +1 -0
  84. package/dist/{chunk-HRDVQERS.cjs → chunk-W7IFDFOZ.cjs} +31 -5
  85. package/dist/chunk-W7IFDFOZ.cjs.map +1 -0
  86. package/dist/{chunk-K7CZFNJ2.js → chunk-W7M5QVJ3.js} +10 -10
  87. package/dist/{chunk-K7CZFNJ2.js.map → chunk-W7M5QVJ3.js.map} +1 -1
  88. package/dist/{chunk-JTJCCL2E.js → chunk-XHJAYCPQ.js} +3 -3
  89. package/dist/{chunk-JTJCCL2E.js.map → chunk-XHJAYCPQ.js.map} +1 -1
  90. package/dist/{chunk-FMJGVAWX.js → chunk-XYYOZATD.js} +5 -5
  91. package/dist/{chunk-FMJGVAWX.js.map → chunk-XYYOZATD.js.map} +1 -1
  92. package/dist/{chunk-5C7DRQQE.cjs → chunk-Y3AXV27O.cjs} +5 -5
  93. package/dist/{chunk-5C7DRQQE.cjs.map → chunk-Y3AXV27O.cjs.map} +1 -1
  94. package/dist/{chunk-3PQIWOTZ.js → chunk-YEYN3GHT.js} +3 -3
  95. package/dist/{chunk-3PQIWOTZ.js.map → chunk-YEYN3GHT.js.map} +1 -1
  96. package/dist/{chunk-KNCJSPXV.js → chunk-YRI5HWSS.js} +3 -3
  97. package/dist/{chunk-KNCJSPXV.js.map → chunk-YRI5HWSS.js.map} +1 -1
  98. package/dist/{chunk-DWZXSPMB.cjs → chunk-ZAVEMQ37.cjs} +3 -3
  99. package/dist/{chunk-DWZXSPMB.cjs.map → chunk-ZAVEMQ37.cjs.map} +1 -1
  100. package/dist/{chunk-WKSP73RU.js → chunk-ZPE7334Z.js} +4 -4
  101. package/dist/{chunk-WKSP73RU.js.map → chunk-ZPE7334Z.js.map} +1 -1
  102. package/dist/{chunk-ANLTECZ6.cjs → chunk-ZV4DNZ5N.cjs} +5 -5
  103. package/dist/{chunk-ANLTECZ6.cjs.map → chunk-ZV4DNZ5N.cjs.map} +1 -1
  104. package/dist/collaboration/index.cjs +71 -71
  105. package/dist/collaboration/index.js +2 -2
  106. package/dist/components/ErrorBoundary.d.ts +33 -0
  107. package/dist/connect/docx.cjs +12 -12
  108. package/dist/connect/docx.js +8 -8
  109. package/dist/connect/index.cjs +706 -706
  110. package/dist/connect/index.cjs.map +1 -1
  111. package/dist/connect/index.js +20 -20
  112. package/dist/connect/index.js.map +1 -1
  113. package/dist/connect/viewer.cjs +75 -65
  114. package/dist/connect/viewer.cjs.map +1 -1
  115. package/dist/connect/viewer.js +23 -13
  116. package/dist/connect/viewer.js.map +1 -1
  117. package/dist/connection/auth/auth-hash.d.ts +13 -0
  118. package/dist/connection/auth/fragment-credentials.d.ts +40 -0
  119. package/dist/document-tools/index.cjs +20 -20
  120. package/dist/document-tools/index.js +3 -3
  121. package/dist/docx/index.cjs +1 -1
  122. package/dist/docx/index.js +1 -1
  123. package/dist/facts/index.cjs +55 -55
  124. package/dist/facts/index.js +5 -5
  125. package/dist/files/index.cjs +224 -224
  126. package/dist/files/index.js +4 -4
  127. package/dist/home/index.cjs +2 -2
  128. package/dist/home/index.js +2 -2
  129. package/dist/index.cjs +543 -514
  130. package/dist/index.cjs.map +1 -1
  131. package/dist/index.d.ts +1 -0
  132. package/dist/index.js +14 -13
  133. package/dist/index.js.map +1 -1
  134. package/dist/lib/start-inset.d.ts +13 -0
  135. package/dist/retrieval/index.cjs +1 -1
  136. package/dist/retrieval/index.js +1 -1
  137. package/dist/settings/index.cjs +159 -159
  138. package/dist/settings/index.js +4 -4
  139. package/dist/shell/InstallPrompt.d.ts +2 -1
  140. package/dist/shell/index.cjs +55 -47
  141. package/dist/shell/index.d.ts +1 -0
  142. package/dist/shell/index.js +4 -4
  143. package/dist/studio/index.cjs +2 -2
  144. package/dist/studio/index.js +2 -2
  145. package/dist/workflow-canvas/index.cjs +20 -20
  146. package/dist/workflow-canvas/index.js +7 -7
  147. package/node_modules/@arbidocs/coedit/package.json +1 -1
  148. package/package.json +5 -5
  149. package/dist/ConnectedStreamedWordArtifact-COEXL5IT.cjs.map +0 -1
  150. package/dist/chunk-2AMYT2HQ.js.map +0 -1
  151. package/dist/chunk-4WWM3GQ5.js.map +0 -1
  152. package/dist/chunk-6UTIAHQG.cjs.map +0 -1
  153. package/dist/chunk-7RGLTF76.cjs.map +0 -1
  154. package/dist/chunk-HRDVQERS.cjs.map +0 -1
  155. package/dist/chunk-SFXVNFES.js.map +0 -1
  156. package/dist/chunk-WQFGG2BV.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/auth/AuthLayout.tsx","../src/auth/AuthForm.tsx","../src/auth/SsoLoginButton.tsx","../src/auth/AuthFooter.tsx","../src/auth/RecoveryDialogs.tsx","../src/connection/auth/auth-hash.ts","../src/connection/auth/fragment-credentials.ts"],"names":["jsxs","jsx","cn","useMemo","Button","AlertCircle","useId","Input","Fragment","Loader2","useState","useRef"],"mappings":";;;;;;;AAwBO,SAAS,UAAA,CAAW;AAAA,EACzB,QAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA,GAAS;AACX,CAAA,EAAoB;AAClB,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,4CAAA;AAAA;AAAA,QAEA,KAAA,IAAS,mDAAA;AAAA,QACT;AAAA,OACF;AAAA,MACA,aAAA,EAAa,MAAA;AAAA,MAEZ,QAAA,EAAA;AAAA,QAAA,MAAA;AAAA,wBACD,IAAA,CAAC,SAAA,EAAA,EAAQ,SAAA,EAAU,+DAAA,EAChB,QAAA,EAAA;AAAA,UAAA,KAAA,oBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uDAAA,EAAyD,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,0BAGhF,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,qEAAA,EACZ,QAAA,EAAA;AAAA,YAAA,WAAA,oBAAe,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,mBAAA,EAAqB,QAAA,EAAA,WAAA,EAAY,CAAA;AAAA,YAC/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AACR,IAAA,QAAA,CAAS,QAAQ,WAAW,CAAA;AAAA,EAC9B,CAAA,EAAG,CAAC,WAAW,CAAC,CAAA;AAEhB,EAAA,OAAO,eAAe,EAAE,KAAA,EAAO,YAAY,KAAA,EAAO,IAAA,EAAM,YAAY,IAAA,EAAK;AAC3E","file":"chunk-NKT6CO5F.js","sourcesContent":["import type { LucideIcon } from 'lucide-react'\nimport { ArrowRight } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport interface AuthLayoutProps {\n /** The form column content. */\n children: ReactNode\n /** Sits above the form: the Login / Register tabs, or an offline badge. */\n headerRight?: ReactNode\n /** Hero panel: the right half on desktop, hidden on mobile. Omit for a single centred column. */\n aside?: ReactNode\n /** Brand mark shown top-left of the form column (logo + name). */\n brand?: ReactNode\n /** Pinned bottom-right over the hero on desktop (e.g. a deployment indicator). */\n corner?: ReactNode\n className?: string\n testId?: string\n}\n\n/**\n * Full-bleed split: a calm form column on the left, the hero (`aside`) on the right. On mobile the\n * hero is hidden and the form fills the screen. With no `aside` it is a single centred column.\n */\nexport function AuthLayout({\n children,\n headerRight,\n aside,\n brand,\n corner,\n className,\n testId = 'auth-layout',\n}: AuthLayoutProps) {\n return (\n <div\n data-slot=\"auth-layout\"\n className={cn(\n 'min-h-screen bg-background text-foreground',\n // The hero needs height: a phone held sideways (under 32rem tall) gets the form alone.\n aside && 'md:grid [@media(min-height:32rem)]:md:grid-cols-2',\n className\n )}\n data-testid={testId}\n >\n {corner}\n <section className=\"flex min-h-screen flex-col px-4 py-5 sm:px-8 md:px-12 md:py-6\">\n {brand && (\n <div className=\"flex items-center gap-3 font-semibold text-foreground\">{brand}</div>\n )}\n {/* Top-aligned at a fixed offset (not vertically centred) so switching tabs never moves the tabs. */}\n <div className=\"mx-auto mt-10 flex w-full max-w-sm flex-col gap-5 py-8 md:mt-[14vh]\">\n {headerRight && <div className=\"flex items-center\">{headerRight}</div>}\n {children}\n </div>\n </section>\n {/* Exactly one screen tall and pinned, so the hero is centred in the window rather than in\n the row: a form that overflows the screen (Login, with its SSO buttons, on a laptop)\n would otherwise stretch the row and move the hero text when switching tabs. */}\n {aside && (\n <div className=\"hidden [@media(min-height:32rem)]:md:sticky [@media(min-height:32rem)]:md:top-0 [@media(min-height:32rem)]:md:flex [@media(min-height:32rem)]:md:h-screen\">\n {aside}\n </div>\n )}\n </div>\n )\n}\n\nexport interface AuthHeroPillar {\n icon: LucideIcon\n title: string\n body: string\n}\n\nexport interface AuthHeroProps {\n /** First line of the headline. */\n headline?: ReactNode\n /** Second headline line, set in italic accent. */\n emphasis?: string\n lead?: ReactNode\n pillars?: AuthHeroPillar[]\n link?: { href: string; label: string }\n /** Cover image behind the content (any CSS `url(...)` source). A tint keeps text legible. */\n backgroundImage?: string\n /** Extra content under the pillars (a quote, a logo row, a screenshot). */\n children?: ReactNode\n className?: string\n testId?: string\n}\n\n/** The value-proposition panel for {@link AuthLayout}'s `aside`: headline, lead, pillars, link. */\nexport function AuthHero({\n headline,\n emphasis,\n lead,\n pillars = [],\n link,\n backgroundImage,\n children,\n className,\n testId = 'product-pillars',\n}: AuthHeroProps) {\n return (\n <div\n data-slot=\"auth-hero\"\n className={cn(\n 'relative flex w-full flex-col justify-center gap-6 overflow-hidden bg-hero px-12 py-16 text-white',\n className\n )}\n data-testid={testId}\n >\n {backgroundImage && (\n <>\n <div\n aria-hidden=\"true\"\n data-slot=\"auth-hero-image\"\n className=\"absolute inset-0 bg-cover bg-center\"\n style={{ backgroundImage: `url(${backgroundImage})` }}\n />\n <div aria-hidden=\"true\" className=\"absolute inset-0 bg-hero/70\" />\n </>\n )}\n {headline && (\n <h2 className=\"relative max-w-[18ch] text-3xl font-semibold leading-tight text-white\">\n {headline}\n {emphasis && (\n <>\n <br />\n <span className=\"italic text-theme-cyan-bright\">{emphasis}</span>\n </>\n )}\n </h2>\n )}\n {lead && <p className=\"relative max-w-[44ch] text-base text-white/70\">{lead}</p>}\n\n <ul className=\"relative flex max-w-[46ch] flex-col gap-5\">\n {pillars.map(({ icon: Icon, title, body }) => (\n <li key={title} className=\"flex gap-3\">\n <Icon className=\"mt-0.5 h-5 w-5 shrink-0 text-theme-cyan-bright\" aria-hidden=\"true\" />\n <div>\n <h3 className=\"text-base font-semibold leading-snug text-white\">{title}</h3>\n <p className=\"text-sm leading-relaxed text-white/70\">{body}</p>\n </div>\n </li>\n ))}\n </ul>\n\n {children && <div className=\"relative\">{children}</div>}\n\n {link && (\n <a\n href={link.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"relative inline-flex items-center gap-1 text-sm font-medium text-theme-cyan-bright transition-colors hover:text-white\"\n >\n {link.label}\n <ArrowRight className=\"h-4 w-4\" />\n </a>\n )}\n </div>\n )\n}\n","import { AlertCircle, Eye, EyeOff, Loader2, WifiOff } from 'lucide-react'\nimport {\n createContext,\n useContext,\n useId,\n useMemo,\n useState,\n type ComponentProps,\n type ReactNode,\n} from 'react'\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { Button, cn, Input } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Title + one-line description above an auth form. */\nexport function AuthHeading({ title, description }: { title: ReactNode; description?: ReactNode }) {\n return (\n <div data-slot=\"auth-heading\">\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">{title}</h1>\n {description && <p className=\"mt-2 text-sm text-muted-foreground\">{description}</p>}\n </div>\n )\n}\n\n/** A text-style action under or beside a field (\"Forgot your password?\", \"Clear form\"). */\nexport function AuthLink({ className, type = 'button', ...props }: ComponentProps<'button'>) {\n return (\n <button\n type={type}\n data-slot=\"auth-link\"\n className={cn(\n 'text-sm text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11',\n className\n )}\n {...props}\n />\n )\n}\n\ninterface AuthFieldContextValue {\n id: string\n errorId?: string\n}\n\n/** What an `AuthField` hands to the control inside: its id and the id of its error message. */\nconst AuthFieldContext = createContext<AuthFieldContextValue | null>(null)\n\n/** Merge space-separated id lists for `aria-describedby`. */\nfunction joinIds(...ids: Array<string | undefined>): string | undefined {\n const joined = ids.filter(Boolean).join(' ')\n return joined || undefined\n}\n\nexport interface AuthFieldProps {\n /** Id of the control inside, for the label. Omit it to use a generated (`useId`) id that the\n * `AuthInput` / `RevealablePasswordInput` inside picks up automatically. */\n htmlFor?: string\n /** Field-level error: shown under the control, linked with `aria-describedby`, and marks the\n * control `aria-invalid`. */\n error?: ReactNode\n errorTestId?: string\n label: ReactNode\n required?: boolean\n /** Right-aligned action in the label row (e.g. \"Clear form\"). */\n labelAction?: ReactNode\n /** Overlaid at the right edge of the control (e.g. a \"Verified\" badge). */\n trailing?: ReactNode\n className?: string\n children: ReactNode\n}\n\n/** Label (with required marker) above a control. */\nexport function AuthField({\n htmlFor,\n error,\n errorTestId,\n label,\n required,\n labelAction,\n trailing,\n className,\n children,\n}: AuthFieldProps) {\n const generatedId = useId()\n const id = htmlFor ?? generatedId\n const errorId = error ? `${id}-error` : undefined\n const context = useMemo(() => ({ id, errorId }), [id, errorId])\n return (\n <AuthFieldContext.Provider value={context}>\n <div data-slot=\"auth-field\" className={className}>\n <div className=\"mb-1 flex items-center justify-between\">\n <label htmlFor={id} className=\"block text-sm font-medium text-foreground\">\n {label} {required && <span className=\"text-red-text\">*</span>}\n </label>\n {labelAction}\n </div>\n {trailing ? (\n <div className=\"relative\">\n {children}\n {trailing}\n </div>\n ) : (\n children\n )}\n {error && (\n <p\n id={errorId}\n role=\"alert\"\n className=\"mt-1 text-sm text-red-text\"\n data-testid={errorTestId}\n >\n {error}\n </p>\n )}\n </div>\n </AuthFieldContext.Provider>\n )\n}\n\n/** Input styled for auth forms (faint placeholder). */\nexport function AuthInput({\n className,\n id,\n 'aria-describedby': describedBy,\n 'aria-invalid': invalid,\n ...props\n}: ComponentProps<typeof Input>) {\n const field = useContext(AuthFieldContext)\n return (\n <Input\n id={id ?? field?.id}\n aria-describedby={joinIds(describedBy, field?.errorId)}\n aria-invalid={invalid ?? (field?.errorId ? true : undefined)}\n className={cn('placeholder:text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\n/** Every fixed string of the revealable password input. */\nexport interface RevealablePasswordInputLabels {\n hidePassword: string\n showPassword: string\n}\n\nexport const DEFAULT_REVEALABLE_PASSWORD_INPUT_LABELS: RevealablePasswordInputLabels = {\n hidePassword: 'Hide password',\n showPassword: 'Show password',\n}\n\n/** Every fixed string of the offline badge. */\nexport interface AuthOfflineBadgeLabels {\n offline: string\n}\n\nexport const DEFAULT_AUTH_OFFLINE_BADGE_LABELS: AuthOfflineBadgeLabels = {\n offline: 'Offline',\n}\n\nexport interface RevealablePasswordInputProps extends Omit<ComponentProps<typeof Input>, 'type'> {\n /** Controlled reveal state. Omit it and the input manages its own (see `defaultRevealed`). */\n isRevealed?: boolean\n /** Initial state when uncontrolled. */\n defaultRevealed?: boolean\n /** Called on every toggle press, controlled or not. */\n onToggleReveal?: () => void\n labels?: Partial<RevealablePasswordInputLabels>\n /** Show/hide button id (default `toggle-password-visibility`); `data-testid` goes to the input. */\n toggleTestId?: string\n}\n\n/** Password input with a show/hide button inside the field. */\nexport function RevealablePasswordInput({\n isRevealed: controlledRevealed,\n defaultRevealed = false,\n onToggleReveal,\n className,\n labels,\n toggleTestId,\n ...props\n}: RevealablePasswordInputProps) {\n const [innerRevealed, setInnerRevealed] = useState(defaultRevealed)\n const isControlled = controlledRevealed !== undefined\n const isRevealed = isControlled ? controlledRevealed : innerRevealed\n const l = useMemo(() => ({ ...DEFAULT_REVEALABLE_PASSWORD_INPUT_LABELS, ...labels }), [labels])\n return (\n <div className=\"relative\">\n <AuthInput\n type={isRevealed ? 'text' : 'password'}\n className={cn('pr-10', className)}\n {...props}\n />\n <button\n type=\"button\"\n onClick={() => {\n if (!isControlled) setInnerRevealed((prev) => !prev)\n onToggleReveal?.()\n }}\n aria-label={isRevealed ? l.hidePassword : l.showPassword}\n aria-pressed={isRevealed}\n className=\"absolute inset-y-0 right-0 flex w-10 items-center justify-center rounded-r-md text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring pointer-coarse:w-11\"\n data-testid={testIdOr(toggleTestId, { testId: 'toggle-password-visibility' })}\n >\n {isRevealed ? (\n <EyeOff className=\"h-4 w-4\" aria-hidden=\"true\" />\n ) : (\n <Eye className=\"h-4 w-4\" aria-hidden=\"true\" />\n )}\n </button>\n </div>\n )\n}\n\n/** Small pill on a locked field, e.g. \"Verified\". */\nexport function AuthFieldBadge({\n icon,\n children,\n testId,\n}: {\n icon?: ReactNode\n children: ReactNode\n testId?: string\n}) {\n return (\n <span\n className=\"pointer-events-none absolute inset-y-0 right-3 flex items-center gap-1 text-xs font-medium text-green-text\"\n data-testid={testId}\n >\n {icon}\n {children}\n </span>\n )\n}\n\n/** Centred muted sentence under a step's primary action. */\nexport function AuthNote({ className, ...props }: ComponentProps<'p'>) {\n return <p className={cn('text-center text-sm text-muted-foreground', className)} {...props} />\n}\n\n/** Error / status message box for a form. */\nexport function AuthAlert({\n children,\n withIcon = false,\n testId,\n id,\n}: {\n children: ReactNode\n withIcon?: boolean\n testId?: string\n /** Lets a field point at this message with `aria-describedby`. */\n id?: string\n}) {\n return (\n <div\n id={id}\n role=\"alert\"\n data-testid={testId}\n className=\"flex gap-2 rounded-md bg-red-bg p-3 text-sm text-red-text\"\n >\n {withIcon && <AlertCircle className=\"h-5 w-5 flex-shrink-0\" aria-hidden=\"true\" />}\n <div>{children}</div>\n </div>\n )\n}\n\nexport interface AuthSubmitButtonProps extends ComponentProps<typeof Button> {\n /** Shows a spinner and sets `aria-busy`. */\n isBusy?: boolean\n /** Shorthand for `data-testid`. */\n testId?: string\n}\n\n/** Full-width primary submit with a spinner while busy. */\nexport function AuthSubmitButton({\n isBusy,\n testId,\n children,\n className,\n ...props\n}: AuthSubmitButtonProps) {\n return (\n <Button\n type=\"submit\"\n className={cn('w-full', className)}\n aria-busy={isBusy || undefined}\n data-testid={testId}\n {...props}\n >\n {isBusy && <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />}\n {children}\n </Button>\n )\n}\n\n/** \"or continue with\" separator between the form and the SSO button. */\nexport function AuthDivider({ label, testId }: { label: string; testId?: string }) {\n return (\n <div\n data-slot=\"auth-divider\"\n data-testid={testIdOr(testId, { testId: 'login-divider' })}\n className=\"relative\"\n >\n <div className=\"absolute inset-0 flex items-center\">\n <div className=\"w-full border-t border-border\" />\n </div>\n <div className=\"relative flex justify-center text-xs\">\n <span className=\"bg-background px-2 text-muted-foreground\">{label}</span>\n </div>\n </div>\n )\n}\n\nexport interface AuthTabOption<T extends string> {\n value: T\n label: string\n testId?: string\n}\n\n/**\n * Underline tab pair (Login / Register) above the form. Radix Tabs: one tab stop, arrow keys,\n * Home and End move between tabs and select them (the form below swaps with the selection).\n */\nexport function AuthTabs<T extends string>({\n value,\n onChange,\n tabs,\n ariaLabel,\n}: {\n value: T\n onChange: (value: T) => void\n tabs: AuthTabOption<T>[]\n ariaLabel: string\n}) {\n return (\n <TabsPrimitive.Root value={value} onValueChange={(next) => onChange(next as T)}>\n <TabsPrimitive.List aria-label={ariaLabel} className=\"inline-flex items-center gap-6\">\n {tabs.map((tab) => (\n <TabsPrimitive.Trigger\n key={tab.value}\n value={tab.value}\n data-testid={tab.testId}\n className={cn(\n '-mb-px border-b-2 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-w-11 pointer-coarse:py-3',\n tab.value === value\n ? 'border-primary text-foreground'\n : 'border-transparent text-muted-foreground hover:text-foreground'\n )}\n >\n {tab.label}\n </TabsPrimitive.Trigger>\n ))}\n </TabsPrimitive.List>\n {/* The form the tabs switch lives outside this component; these empty, hidden panels only\n give each tab's `aria-controls` a valid target. */}\n {tabs.map((tab) => (\n <TabsPrimitive.Content\n key={tab.value}\n value={tab.value}\n tabIndex={-1}\n aria-hidden=\"true\"\n className=\"hidden\"\n />\n ))}\n </TabsPrimitive.Root>\n )\n}\n\n/** Pill shown instead of the tabs when the device is offline. */\nexport function AuthOfflineBadge({\n label,\n title,\n testId,\n labels,\n}: {\n label?: string\n title?: string\n testId?: string\n labels?: Partial<AuthOfflineBadgeLabels>\n}) {\n const text = label ?? labels?.offline ?? DEFAULT_AUTH_OFFLINE_BADGE_LABELS.offline\n return (\n <span\n data-testid={testIdOr(testId, { testId: 'login-offline-indicator' })}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-yellow-bg px-2.5 py-1.5 text-sm font-medium text-yellow-text\"\n title={title}\n >\n <WifiOff className=\"h-4 w-4 shrink-0\" />\n {text}\n </span>\n )\n}\n","import { useMemo } from 'react'\nimport { ARBI_MARK_SRC, Button } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Every fixed string of the SSO button. `brandIconAlt` prop wins over `brandIconAlt` label. */\nexport interface SsoLoginButtonLabels {\n loginWith: string\n brandIconAlt: string\n}\n\nexport const DEFAULT_SSO_LOGIN_BUTTON_LABELS: SsoLoginButtonLabels = {\n loginWith: 'Login with',\n brandIconAlt: 'ARBI Docs',\n}\n\nexport interface SsoLoginButtonProps {\n labels?: Partial<SsoLoginButtonLabels>\n onClick: () => void\n /** Source of the brand mark shown first. */\n brandIconSrc?: string\n brandIconAlt?: string\n /** Button test id (default `login-with-arbi-button`). */\n testId?: string\n /** Wrapper test id (default `sso-login-button-container`). */\n containerTestId?: string\n}\n\n/** \"Login with\" button showing the ARBI mark and the supported identity providers. */\nexport function SsoLoginButton({\n onClick,\n brandIconSrc = ARBI_MARK_SRC,\n brandIconAlt,\n testId,\n containerTestId,\n labels,\n}: SsoLoginButtonProps) {\n const l = useMemo(() => ({ ...DEFAULT_SSO_LOGIN_BUTTON_LABELS, ...labels }), [labels])\n return (\n <div\n data-slot=\"sso-login\"\n data-testid={testIdOr(containerTestId, { testId: 'sso-login-button-container' })}\n className=\"text-center\"\n >\n <Button\n onClick={onClick}\n className=\"flex w-full items-center justify-center gap-3\"\n variant=\"outline\"\n data-testid={testIdOr(testId, { testId: 'login-with-arbi-button' })}\n >\n <span>{l.loginWith}</span>\n <div className=\"flex items-center gap-3 pr-1\">\n <img\n src={brandIconSrc}\n alt={brandIconAlt ?? l.brandIconAlt}\n className=\"h-5 w-5 rounded object-contain\"\n />\n\n {/* LinkedIn */}\n <svg className=\"h-5 w-5\" viewBox=\"0 0 24 24\" fill=\"#0A66C2\" aria-hidden=\"true\">\n <path d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z\" />\n </svg>\n\n {/* Google */}\n <svg className=\"h-5 w-5\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n fill=\"#4285F4\"\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"\n />\n <path\n fill=\"#34A853\"\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n />\n <path\n fill=\"#FBBC05\"\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n />\n <path\n fill=\"#EA4335\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n />\n </svg>\n\n {/* Apple */}\n <svg className=\"h-5 w-5\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z\" />\n </svg>\n </div>\n </Button>\n </div>\n )\n}\n","import { useMemo, type ReactNode } from 'react'\nimport { MoreVertical } from 'lucide-react'\nimport {\n Checkbox,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\nexport interface AuthLegalLink {\n href: string\n label: string\n}\n\nexport interface AuthConsentProps {\n termsAccepted: boolean\n onTermsAcceptedChange: (accepted: boolean) => void\n /** Whether to download a recovery key on signup (opt-out; unchecking shows the warning). */\n saveRecoveryKey: boolean\n onSaveRecoveryKeyChange: (save: boolean) => void\n termsLink: AuthLegalLink\n privacyLink: AuthLegalLink\n /** Shown (role=\"alert\") only when the recovery-key box is unchecked. */\n noRecoveryKeyWarning: string\n labels?: Partial<AuthConsentLabels>\n /** Part ids; defaults are the current ids. */\n testIds?: Partial<\n Record<'termsCheckbox' | 'recoveryKeyCheckbox' | 'noRecoveryKeyWarning', string>\n >\n}\n\n/** Every fixed string of the sign-up consent block. */\nexport interface AuthConsentLabels {\n /** Text before the terms link. */\n acknowledge: string\n /** Text between the terms and privacy links. */\n and: string\n downloadRecoveryKey: string\n}\n\nexport const DEFAULT_AUTH_CONSENT_LABELS: AuthConsentLabels = {\n acknowledge: 'I acknowledge the',\n and: 'and',\n downloadRecoveryKey: 'Download my recovery key',\n}\n\n/** Every fixed string of the sign-in footer. */\nexport interface AuthFooterLinksLabels {\n installOptions: string\n install: string\n}\n\nexport const DEFAULT_AUTH_FOOTER_LINKS_LABELS: AuthFooterLinksLabels = {\n installOptions: 'Install options',\n install: 'Install',\n}\n\nconst LEGAL_LINK_CLASS = 'underline transition-colors hover:text-primary'\n\n/** Sign-up consent: required terms checkbox and the opt-out \"download recovery key\" checkbox. */\nexport function AuthConsent({\n termsAccepted,\n onTermsAcceptedChange,\n saveRecoveryKey,\n onSaveRecoveryKeyChange,\n termsLink,\n privacyLink,\n noRecoveryKeyWarning,\n labels,\n testIds,\n}: AuthConsentProps) {\n const l = useMemo(() => ({ ...DEFAULT_AUTH_CONSENT_LABELS, ...labels }), [labels])\n return (\n <div data-slot=\"auth-consent\" className=\"space-y-2\">\n <div className=\"flex items-start gap-2\">\n <Checkbox\n id=\"accept-terms\"\n checked={termsAccepted}\n onCheckedChange={(checked) => onTermsAcceptedChange(checked === true)}\n data-testid={testIdOr(testIds?.termsCheckbox, { testId: 'accept-terms-checkbox' })}\n />\n <label\n htmlFor=\"accept-terms\"\n className=\"cursor-pointer text-sm leading-relaxed text-muted-foreground\"\n >\n {l.acknowledge}{' '}\n <a\n href={termsLink.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={LEGAL_LINK_CLASS}\n >\n {termsLink.label}\n </a>{' '}\n {l.and}{' '}\n <a\n href={privacyLink.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={LEGAL_LINK_CLASS}\n >\n {privacyLink.label}\n </a>\n </label>\n </div>\n <div className=\"flex items-start gap-2\">\n <Checkbox\n id=\"save-recovery-key\"\n checked={saveRecoveryKey}\n onCheckedChange={(checked) => onSaveRecoveryKeyChange(checked === true)}\n data-testid={testIdOr(testIds?.recoveryKeyCheckbox, {\n testId: 'save-recovery-key-checkbox',\n })}\n />\n <label\n htmlFor=\"save-recovery-key\"\n className=\"cursor-pointer text-sm leading-relaxed text-muted-foreground\"\n >\n {l.downloadRecoveryKey}\n </label>\n </div>\n {/* Only shown on opt-out: the default path stays free of warnings. */}\n {!saveRecoveryKey && (\n <p\n className=\"text-sm text-red-text\"\n role=\"alert\"\n data-testid={testIdOr(testIds?.noRecoveryKeyWarning, {\n testId: 'no-recovery-key-warning',\n })}\n >\n {noRecoveryKeyWarning}\n </p>\n )}\n </div>\n )\n}\n\nexport interface AuthInstallOption {\n id: string\n label: ReactNode\n icon?: ReactNode\n onSelect: () => void\n disabled?: boolean\n testId?: string\n}\n\nexport interface AuthFooterLinksProps {\n privacyLink: AuthLegalLink\n /** Entries of the \"Install\" kebab menu. Omit/empty to hide the menu. */\n installOptions?: AuthInstallOption[]\n /** Dialog or other overlay owned by the host, rendered inside the footer. */\n children?: ReactNode\n labels?: Partial<AuthFooterLinksLabels>\n /** Install menu trigger id (default `install-options-trigger`). */\n installTriggerTestId?: string\n}\n\n/** Sign-in footer: privacy link on the left, an \"Install\" kebab menu on the right. */\nexport function AuthFooterLinks({\n privacyLink,\n installOptions = [],\n children,\n labels,\n installTriggerTestId,\n}: AuthFooterLinksProps) {\n const l = useMemo(() => ({ ...DEFAULT_AUTH_FOOTER_LINKS_LABELS, ...labels }), [labels])\n return (\n <div\n data-slot=\"auth-footer-links\"\n className=\"flex items-center justify-between pt-2 text-sm text-muted-foreground\"\n >\n <a\n href={privacyLink.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center transition-colors hover:text-primary pointer-coarse:min-h-11\"\n >\n {privacyLink.label}\n </a>\n\n {installOptions.length > 0 && (\n <DropdownMenu>\n <DropdownMenuTrigger\n className=\"flex items-center gap-1 rounded-md px-1.5 py-1 transition-colors hover:text-primary focus:outline-none focus-visible:ring-1 focus-visible:ring-ring pointer-coarse:min-h-11\"\n aria-label={l.installOptions}\n data-testid={testIdOr(installTriggerTestId, { testId: 'install-options-trigger' })}\n >\n {l.install}\n <MoreVertical size={14} />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {installOptions.map((option) => (\n <DropdownMenuItem\n key={option.id}\n onClick={option.onSelect}\n disabled={option.disabled}\n className=\"gap-2\"\n data-testid={option.testId}\n >\n {option.icon}\n {option.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n {children}\n </div>\n )\n}\n","import {\n useMemo,\n useRef,\n useState,\n type DragEvent,\n type FormEvent,\n type ReactNode,\n useId,\n} from 'react'\nimport { AlertCircle, Key, Loader2, Shield, Upload } from 'lucide-react'\nimport {\n Button,\n cn,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Input,\n} from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\nfunction ErrorBox({ message, id }: { message: string; id?: string }) {\n return (\n <div id={id} role=\"alert\" className=\"rounded-md bg-red-bg p-3\">\n <div className=\"flex gap-2\">\n <AlertCircle className=\"h-5 w-5 flex-shrink-0 text-red-text\" aria-hidden=\"true\" />\n <p className=\"text-sm text-red-text\">{message}</p>\n </div>\n </div>\n )\n}\n\n/** Every fixed string of the recovery-key dialog. `title` / description props win. */\nexport interface RecoveryKeyDialogLabels {\n title: string\n verifiedDescription: string\n unverifiedDescription: string\n done: string\n currentPassword: string\n passwordPlaceholder: string\n cancel: string\n verifying: string\n verify: string\n}\n\nexport const DEFAULT_RECOVERY_KEY_DIALOG_LABELS: RecoveryKeyDialogLabels = {\n title: 'Save your recovery key',\n verifiedDescription:\n \"If you forget your password, this is the only way to get back into your account. Save it to your password manager so it's there when you need it.\",\n unverifiedDescription: 'Confirm your password to continue.',\n done: 'Done',\n currentPassword: 'Current Password',\n passwordPlaceholder: 'Enter your password',\n cancel: 'Cancel',\n verifying: 'Verifying...',\n verify: 'Verify',\n}\n\n/** Every fixed string of the account-recovery dialog. */\nexport interface AccountRecoveryDialogLabels {\n title: string\n description: string\n emailAddress: string\n emailPlaceholder: string\n keyLoadedFromLink: string\n ssoProtectedKeyNotice: string\n recoveryKey: string\n ssoProtectedKey: string\n dropKeyHere: string\n uploadKeyPrompt: string\n ssoSignInNotice: string\n ssoSignIn: string\n afterRecoveryNotice: string\n cancel: string\n recovering: string\n recoverAccount: string\n}\n\nexport const DEFAULT_ACCOUNT_RECOVERY_DIALOG_LABELS: AccountRecoveryDialogLabels = {\n title: 'Recover Your Account',\n description: 'Upload your recovery key to regain access to your account',\n emailAddress: 'Email Address',\n emailPlaceholder: 'Enter your email',\n keyLoadedFromLink: 'Recovery key loaded from link',\n ssoProtectedKeyNotice: 'SSO-protected key — you must be signed into the matching SSO account.',\n recoveryKey: 'Recovery Key',\n ssoProtectedKey: 'SSO Protected Key',\n dropKeyHere: 'Drop your recovery key here',\n uploadKeyPrompt: 'Click or drag to upload your recovery key (.key file)',\n ssoSignInNotice:\n 'This account signs in with single sign-on. Sign in with your identity provider to continue — you won\\u2019t need your forgotten master password for that step.',\n ssoSignIn: 'Sign in with Auth0 to continue',\n afterRecoveryNotice:\n 'After successful recovery, you will be prompted to set a new password to secure your account.',\n cancel: 'Cancel',\n recovering: 'Recovering...',\n recoverAccount: 'Recover Account',\n}\n\nexport interface RecoveryKeyDialogProps {\n labels?: Partial<RecoveryKeyDialogLabels>\n open: boolean\n onClose: () => void\n /** Content shown once the password is verified (the key download). `null` while verifying. */\n verified: ReactNode | null\n password: string\n onPasswordChange: (password: string) => void\n onVerify: () => void\n isVerifying: boolean\n error: string | null\n title?: string\n verifiedDescription?: string\n unverifiedDescription?: string\n /** Dialog test id (default `download-recovery-key-dialog`). */\n testId?: string\n /** Part ids; defaults are the current ids. */\n testIds?: Partial<Record<'passwordInput', string>>\n}\n\n/**\n * \"Save your recovery key\": confirm the account password first, then reveal the key download\n * (`verified`) with a Done button.\n */\nexport function RecoveryKeyDialog({\n open,\n onClose,\n verified,\n password,\n onPasswordChange,\n onVerify,\n isVerifying,\n error,\n title,\n verifiedDescription,\n unverifiedDescription,\n labels,\n testId,\n testIds,\n}: RecoveryKeyDialogProps) {\n const verifyPasswordId = useId()\n const l = useMemo(() => ({ ...DEFAULT_RECOVERY_KEY_DIALOG_LABELS, ...labels }), [labels])\n const handleSubmit = (e: FormEvent) => {\n e.preventDefault()\n onVerify()\n }\n\n return (\n <Dialog open={open} onOpenChange={onClose}>\n <DialogContent\n presentation=\"sheet\"\n className=\"sm:max-w-md\"\n data-testid={testIdOr(testId, { testId: 'download-recovery-key-dialog' })}\n >\n <DialogHeader>\n <DialogTitle className=\"font-heading\">{title ?? l.title}</DialogTitle>\n <DialogDescription>\n {verified\n ? (verifiedDescription ?? l.verifiedDescription)\n : (unverifiedDescription ?? l.unverifiedDescription)}\n </DialogDescription>\n </DialogHeader>\n\n {verified ? (\n <div className=\"space-y-4\">\n {verified}\n <div className=\"flex justify-end\">\n <Button onClick={onClose}>{l.done}</Button>\n </div>\n </div>\n ) : (\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <div className=\"space-y-2\">\n <label htmlFor={verifyPasswordId} className=\"text-sm font-medium\">\n {l.currentPassword}\n </label>\n <Input\n id={verifyPasswordId}\n type=\"password\"\n value={password}\n onChange={(e) => onPasswordChange(e.target.value)}\n placeholder={l.passwordPlaceholder}\n disabled={isVerifying}\n autoComplete=\"current-password\"\n aria-invalid={error ? true : undefined}\n aria-describedby={error ? `${verifyPasswordId}-error` : undefined}\n data-testid={testIdOr(testIds?.passwordInput, { testId: 'verify-password-input' })}\n />\n </div>\n\n {error && <ErrorBox message={error} id={`${verifyPasswordId}-error`} />}\n\n <div className=\"flex flex-col-reverse sm:flex-row sm:justify-end gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={onClose} disabled={isVerifying}>\n {l.cancel}\n </Button>\n <Button type=\"submit\" disabled={isVerifying || !password}>\n {isVerifying ? (\n <>\n <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n {l.verifying}\n </>\n ) : (\n l.verify\n )}\n </Button>\n </div>\n </form>\n )}\n </DialogContent>\n </Dialog>\n )\n}\n\nexport interface AccountRecoveryDialogProps {\n labels?: Partial<AccountRecoveryDialogLabels>\n open: boolean\n onClose: () => void\n email: string\n onEmailChange: (email: string) => void\n /** The key arrived in the page URL (the /recover link): show a \"loaded\" notice, no file picker. */\n isKeyFromLink: boolean\n /** Name of the chosen key file, once one is loaded. */\n keyFileName: string | null\n /** The loaded key is wrapped with the user's SSO identity. */\n isKeyEncrypted: boolean\n /** A file was picked or dropped. */\n onKeyFile: (file: File) => void\n error: string | null\n /** SSO sign-in is the next required step (SSO-wrapped key or SSO-linked account). */\n needsSsoSignIn: boolean\n onSsoSignIn: () => void\n isProcessing: boolean\n /** Enables the submit button (email and key present). */\n canSubmit: boolean\n onSubmit: () => void\n /** Dialog test id (default `forgot-password-modal`). */\n testId?: string\n /** Part ids; defaults are the current ids. */\n testIds?: Partial<\n Record<'emailInput' | 'keyDropzone' | 'keyInput' | 'ssoSignIn' | 'cancel' | 'submit', string>\n >\n}\n\n/**\n * Account recovery: email + recovery key (file or link) -> sign in with the key. When the account\n * is SSO-linked, the SSO prompt replaces the submit button.\n */\nexport function AccountRecoveryDialog({\n open,\n onClose,\n email,\n onEmailChange,\n isKeyFromLink,\n keyFileName,\n isKeyEncrypted,\n onKeyFile,\n error,\n needsSsoSignIn,\n onSsoSignIn,\n isProcessing,\n canSubmit,\n onSubmit,\n labels,\n testId,\n testIds,\n}: AccountRecoveryDialogProps) {\n const recoveryEmailId = useId()\n const l = useMemo(() => ({ ...DEFAULT_ACCOUNT_RECOVERY_DIALOG_LABELS, ...labels }), [labels])\n const fileInputRef = useRef<HTMLInputElement>(null)\n const [isDragActive, setIsDragActive] = useState(false)\n\n const handleDragOver = (e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragActive(true)\n }\n const handleDragLeave = (e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragActive(false)\n }\n const handleDrop = (e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragActive(false)\n const file = e.dataTransfer.files?.[0]\n if (file) onKeyFile(file)\n }\n\n return (\n <Dialog open={open} onOpenChange={onClose}>\n <DialogContent\n presentation=\"sheet\"\n className=\"sm:max-w-md\"\n data-testid={testIdOr(testId, { testId: 'forgot-password-modal' })}\n >\n <DialogHeader>\n <DialogTitle className=\"flex items-center gap-2\">\n <Key className=\"h-5 w-5 text-primary\" />\n {l.title}\n </DialogTitle>\n <DialogDescription>{l.description}</DialogDescription>\n </DialogHeader>\n\n <div className=\"space-y-4\">\n <div className=\"space-y-2\">\n <label htmlFor={recoveryEmailId} className=\"text-sm font-medium\">\n {l.emailAddress}\n </label>\n <Input\n id={recoveryEmailId}\n type=\"email\"\n value={email}\n onChange={(e) => onEmailChange(e.target.value)}\n placeholder={l.emailPlaceholder}\n disabled={isProcessing}\n data-testid={testIdOr(testIds?.emailInput, { testId: 'recovery-email-input' })}\n />\n </div>\n\n {isKeyFromLink ? (\n <div className=\"rounded-md bg-green-bg p-3\">\n <div className=\"flex items-center gap-2 text-sm\">\n <Key className=\"h-4 w-4 text-green-text\" />\n <span className=\"font-medium text-green-text\">{l.keyLoadedFromLink}</span>\n </div>\n {isKeyEncrypted && (\n <p className=\"mt-1 inline-flex items-center gap-1 text-sm text-primary\">\n <Shield className=\"h-3 w-3\" />\n {l.ssoProtectedKeyNotice}\n </p>\n )}\n </div>\n ) : (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">{l.recoveryKey}</label>\n <div\n role=\"button\"\n tabIndex={0}\n className={cn(\n 'cursor-pointer rounded-lg p-4 text-center transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n isDragActive ? 'bg-accent' : 'bg-muted hover:bg-muted/70'\n )}\n onClick={() => fileInputRef.current?.click()}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n fileInputRef.current?.click()\n }\n }}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n data-testid={testIdOr(testIds?.keyDropzone, { testId: 'recovery-key-dropzone' })}\n >\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\".key\"\n onClick={(e) => e.stopPropagation()}\n onChange={(e) => {\n const file = e.target.files?.[0]\n if (file) onKeyFile(file)\n }}\n className=\"hidden\"\n data-testid={testIdOr(testIds?.keyInput, { testId: 'recovery-key-input' })}\n />\n {keyFileName ? (\n <div className=\"flex flex-col items-center gap-1\">\n <div className=\"flex items-center justify-center gap-2 text-sm\">\n <Key className=\"h-4 w-4 text-green-text\" />\n <span className=\"font-medium text-green-text\">{keyFileName}</span>\n </div>\n {isKeyEncrypted && (\n <span className=\"inline-flex items-center gap-1 text-sm text-primary\">\n <Shield className=\"h-3 w-3\" />\n {l.ssoProtectedKey}\n </span>\n )}\n </div>\n ) : (\n <div className=\"space-y-2\">\n <Upload className=\"mx-auto h-8 w-8 text-muted-foreground\" />\n <p className=\"text-sm text-muted-foreground\">\n {isDragActive ? l.dropKeyHere : l.uploadKeyPrompt}\n </p>\n </div>\n )}\n </div>\n </div>\n )}\n\n {error && <ErrorBox message={error} />}\n\n {needsSsoSignIn ? (\n <div className=\"space-y-2 rounded-lg bg-muted p-3\">\n <div className=\"flex gap-2\">\n <Shield className=\"h-5 w-5 flex-shrink-0 text-primary\" />\n <p className=\"text-sm\">{l.ssoSignInNotice}</p>\n </div>\n <Button\n onClick={onSsoSignIn}\n className=\"w-full\"\n data-testid={testIdOr(testIds?.ssoSignIn, { testId: 'recovery-sso-signin-button' })}\n >\n {l.ssoSignIn}\n </Button>\n </div>\n ) : (\n <div className=\"rounded-md bg-muted p-3\">\n <p className=\"text-sm text-muted-foreground\">{l.afterRecoveryNotice}</p>\n </div>\n )}\n </div>\n\n <DialogFooter className=\"gap-2\">\n <Button\n variant=\"outline\"\n onClick={onClose}\n disabled={isProcessing}\n data-testid={testIdOr(testIds?.cancel, { testId: 'forgot-password-cancel' })}\n >\n {l.cancel}\n </Button>\n {/* Hidden when SSO sign-in is the next step, to avoid two competing options. */}\n {!needsSsoSignIn && (\n <Button\n onClick={onSubmit}\n disabled={isProcessing || !canSubmit}\n data-testid={testIdOr(testIds?.submit, { testId: 'forgot-password-submit' })}\n >\n {isProcessing ? (\n <>\n <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n {l.recovering}\n </>\n ) : (\n l.recoverAccount\n )}\n </Button>\n )}\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n","/** The auth pages' URL fragment: `#verify=…&code=…&next=…`, and a fragment carried after it. */\n\n/**\n * Split an auth page's hash (`#verify=…&code=…&next=…`) from a second fragment appended after it.\n * A call invitation's registration link ends with the call key fragment (`…#k=…&v=…`) — a URL has\n * one fragment, so it arrives inside ours, after a second `#`.\n */\nexport function splitAuthHash(hash: string): {\n params: URLSearchParams\n /** `#k=…&v=…` (with its `#`), or '' when there is none. */\n trailingFragment: string\n} {\n const raw = hash.replace(/^#/, '')\n const cut = raw.indexOf('#')\n return {\n params: new URLSearchParams(cut >= 0 ? raw.slice(0, cut) : raw),\n trailingFragment: cut >= 0 ? raw.slice(cut) : '',\n }\n}\n\n/** `next` with the trailing fragment appended, unless `next` already carries a fragment. */\nexport function withTrailingFragment(next: string, trailingFragment: string): string {\n if (!trailingFragment || trailingFragment === '#' || next.includes('#')) return next\n return `${next}${trailingFragment}`\n}\n","/**\n * Sign-in from the URL fragment, for mock and demo deployments only:\n *\n * <login page>#email=<urlencoded>&password=<urlencoded>[&next=/path]\n *\n * OFF by default: nothing is read unless the page opts in (`enabled`). A password in a link is\n * visible to whoever holds the link, so a real deployment never turns this on. When on, the\n * fragment is read once and scrubbed from the address bar (`history.replaceState`) before the\n * first render commits, so it does not linger in history or get copied along with the URL. The\n * fragment never reaches the server; the credentials are never logged nor stored.\n *\n * Values are form-urlencoded (`URLSearchParams`): encode a `+` in a password as `%2B`. Other\n * auth-page parameters (`#verify=…`) and a trailing fragment after a second `#` (a call key) are\n * left in place.\n */\n\nimport { useEffect, useRef, useState } from 'react'\nimport { splitAuthHash, withTrailingFragment } from './auth-hash'\n\nexport interface FragmentCredentials {\n email: string\n password: string\n /** Where to go once signed in: a same-origin path, or `null`. */\n next: string | null\n}\n\nconst KEYS = ['email', 'password', 'next'] as const\n\n/** A same-origin absolute path (`/app/…`), never a scheme or a protocol-relative URL. */\nfunction safeNext(next: string | null): string | null {\n if (!next || !next.startsWith('/') || next.startsWith('//') || next.startsWith('/\\\\')) return null\n return next\n}\n\n/** The credentials in an auth page's hash, or `null` without both an email and a password. */\nexport function parseFragmentCredentials(hash: string): FragmentCredentials | null {\n const { params, trailingFragment } = splitAuthHash(hash)\n const email = params.get('email')?.trim()\n const password = params.get('password')\n if (!email || !password) return null\n const next = safeNext(params.get('next'))\n return { email, password, next: next && withTrailingFragment(next, trailingFragment) }\n}\n\n/**\n * Read the credentials from the current URL's fragment and scrub them (with `next`) from the\n * address bar, keeping any other fragment parameters. `null` when there are none; a fragment with\n * only one of email/password is scrubbed all the same.\n */\nexport function consumeFragmentCredentials(): FragmentCredentials | null {\n if (typeof window === 'undefined') return null\n const { hash, pathname, search } = window.location\n const { params, trailingFragment } = splitAuthHash(hash)\n if (!KEYS.some((k) => k !== 'next' && params.has(k))) return null\n const credentials = parseFragmentCredentials(hash)\n for (const k of KEYS) params.delete(k)\n const rest = params.toString()\n const kept = rest ? `#${rest}${trailingFragment}` : trailingFragment\n window.history.replaceState(window.history.state, '', `${pathname}${search}${kept}`)\n return credentials\n}\n\n// Read once per page load and held only until the sign-in is handed over (a strict-mode double\n// render reads the already-scrubbed URL, so it takes these instead).\nlet taken: FragmentCredentials | null = null\n\nfunction take(): FragmentCredentials | null {\n const fresh = consumeFragmentCredentials()\n if (fresh) taken = fresh\n return taken\n}\n\nexport interface UseFragmentCredentialsOptions {\n /** Opt in. Off by default: only a mock/demo deployment turns this on. */\n enabled?: boolean\n /** Sign in with them (the same path as the form). Called once. */\n onCredentials: (credentials: FragmentCredentials) => void\n}\n\n/**\n * Opt-in sign-in from `#email=…&password=…[&next=…]` (see the top of this file). Returns the\n * email and `next` from the link (to prefill the form should the sign-in fail), or `null`.\n */\nexport function useFragmentCredentials({\n enabled = false,\n onCredentials,\n}: UseFragmentCredentialsOptions): Omit<FragmentCredentials, 'password'> | null {\n // Read (and scrub) during the first render, before any effect or await.\n const [credentials] = useState(() => (enabled ? take() : null))\n const handedOver = useRef(false)\n const callback = useRef(onCredentials)\n callback.current = onCredentials\n\n useEffect(() => {\n if (!credentials || handedOver.current) return\n handedOver.current = true\n taken = null\n callback.current(credentials)\n }, [credentials])\n\n return credentials && { email: credentials.email, next: credentials.next }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkI6I34FDU_cjs = require('./chunk-I6I34FDU.cjs');
4
+ var chunkNVVBRQN2_cjs = require('./chunk-NVVBRQN2.cjs');
5
5
  var chunkGFVIFXWT_cjs = require('./chunk-GFVIFXWT.cjs');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
 
@@ -9,10 +9,10 @@ function ConnectedStreamedWordArtifact({
9
9
  fontBaseUrl,
10
10
  ...props
11
11
  }) {
12
- const adapter = chunkI6I34FDU_cjs.useConnectedNativeDocxAdapter(fontBaseUrl);
12
+ const adapter = chunkNVVBRQN2_cjs.useConnectedNativeDocxAdapter(fontBaseUrl);
13
13
  return /* @__PURE__ */ jsxRuntime.jsx(chunkGFVIFXWT_cjs.StreamedWordArtifact, { ...props, adapter });
14
14
  }
15
15
 
16
16
  exports.ConnectedStreamedWordArtifact = ConnectedStreamedWordArtifact;
17
- //# sourceMappingURL=chunk-AR6A2PMV.cjs.map
18
- //# sourceMappingURL=chunk-AR6A2PMV.cjs.map
17
+ //# sourceMappingURL=chunk-NMU6VW4D.cjs.map
18
+ //# sourceMappingURL=chunk-NMU6VW4D.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/docx/ConnectedStreamedWordArtifact.tsx"],"names":["useConnectedNativeDocxAdapter","jsx","StreamedWordArtifact"],"mappings":";;;;;;AAMO,SAAS,6BAAA,CAA8B;AAAA,EAC5C,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA0E;AACxE,EAAA,MAAM,OAAA,GAAUA,gDAA8B,WAAW,CAAA;AACzD,EAAA,uBAAOC,cAAA,CAACC,sCAAA,EAAA,EAAsB,GAAG,KAAA,EAAO,OAAA,EAAkB,CAAA;AAC5D","file":"chunk-AR6A2PMV.cjs","sourcesContent":["import { useConnectedNativeDocxAdapter } from './ConnectedNativeDocxEditor'\nimport {\n StreamedWordArtifact,\n type StreamedWordArtifactProps,\n} from '../../docx/StreamedWordArtifact'\n\nexport function ConnectedStreamedWordArtifact({\n fontBaseUrl,\n ...props\n}: Omit<StreamedWordArtifactProps, 'adapter'> & { fontBaseUrl?: string }) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n return <StreamedWordArtifact {...props} adapter={adapter} />\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/docx/ConnectedStreamedWordArtifact.tsx"],"names":["useConnectedNativeDocxAdapter","jsx","StreamedWordArtifact"],"mappings":";;;;;;AAMO,SAAS,6BAAA,CAA8B;AAAA,EAC5C,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA0E;AACxE,EAAA,MAAM,OAAA,GAAUA,gDAA8B,WAAW,CAAA;AACzD,EAAA,uBAAOC,cAAA,CAACC,sCAAA,EAAA,EAAsB,GAAG,KAAA,EAAO,OAAA,EAAkB,CAAA;AAC5D","file":"chunk-NMU6VW4D.cjs","sourcesContent":["import { useConnectedNativeDocxAdapter } from './ConnectedNativeDocxEditor'\nimport {\n StreamedWordArtifact,\n type StreamedWordArtifactProps,\n} from '../../docx/StreamedWordArtifact'\n\nexport function ConnectedStreamedWordArtifact({\n fontBaseUrl,\n ...props\n}: Omit<StreamedWordArtifactProps, 'adapter'> & { fontBaseUrl?: string }) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n return <StreamedWordArtifact {...props} adapter={adapter} />\n}\n"]}
@@ -7,10 +7,10 @@ var chunk464YPRAE_cjs = require('./chunk-464YPRAE.cjs');
7
7
  var chunk4GITK3Q5_cjs = require('./chunk-4GITK3Q5.cjs');
8
8
  var chunkLJJJ6CYH_cjs = require('./chunk-LJJJ6CYH.cjs');
9
9
  var chunkWP4VIOOA_cjs = require('./chunk-WP4VIOOA.cjs');
10
- var chunkANLTECZ6_cjs = require('./chunk-ANLTECZ6.cjs');
10
+ var chunkZV4DNZ5N_cjs = require('./chunk-ZV4DNZ5N.cjs');
11
11
  var chunk2VHYOTWW_cjs = require('./chunk-2VHYOTWW.cjs');
12
- var chunkJKB7WT7L_cjs = require('./chunk-JKB7WT7L.cjs');
13
12
  var chunkEFEFLBRM_cjs = require('./chunk-EFEFLBRM.cjs');
13
+ var chunkJKB7WT7L_cjs = require('./chunk-JKB7WT7L.cjs');
14
14
  var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
15
15
  var react = require('react');
16
16
  var reactQuery = require('@tanstack/react-query');
@@ -44,7 +44,7 @@ function toWorkflowFieldDocument(doc) {
44
44
  function useConnectedWorkflowScopeSource() {
45
45
  const { data: docs } = chunkBGJZVJJM_cjs.useConnectedDocuments();
46
46
  const { data: tags } = chunkBGJZVJJM_cjs.useConnectedTags();
47
- return react.useMemo(() => chunkANLTECZ6_cjs.buildWorkflowScopeSource(docs, chunkANLTECZ6_cjs.documentScopeLabels(tags)), [docs, tags]);
47
+ return react.useMemo(() => chunkZV4DNZ5N_cjs.buildWorkflowScopeSource(docs, chunkZV4DNZ5N_cjs.documentScopeLabels(tags)), [docs, tags]);
48
48
  }
49
49
  function useConnectedAgentOptions() {
50
50
  const { data: agents } = react$1.useAgents();
@@ -101,7 +101,7 @@ function ConnectedWorkflowDocumentsField({
101
101
  }
102
102
  ),
103
103
  /* @__PURE__ */ jsxRuntime.jsx(
104
- chunkANLTECZ6_cjs.WorkflowDocumentsField,
104
+ chunkZV4DNZ5N_cjs.WorkflowDocumentsField,
105
105
  {
106
106
  field,
107
107
  value,
@@ -123,7 +123,7 @@ function ConnectedWorkflowLauncher({
123
123
  const scopeSource = useConnectedWorkflowScopeSource();
124
124
  const agents = useConnectedAgentOptions();
125
125
  return /* @__PURE__ */ jsxRuntime.jsx(
126
- chunkANLTECZ6_cjs.WorkflowLauncher,
126
+ chunkZV4DNZ5N_cjs.WorkflowLauncher,
127
127
  {
128
128
  ...props,
129
129
  scopeSource,
@@ -245,7 +245,7 @@ var DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS = {
245
245
  var messageOf = (error) => error instanceof Error ? error.message : "";
246
246
  function ConnectedWorkflowsTable({
247
247
  filter,
248
- describeTrigger = (w) => chunkANLTECZ6_cjs.workflowTriggerType(w).replaceAll("_", " "),
248
+ describeTrigger = (w) => chunkZV4DNZ5N_cjs.workflowTriggerType(w).replaceAll("_", " "),
249
249
  formatDate = chunkKDG6FER6_cjs.fmtDate,
250
250
  onViewRuns,
251
251
  connectedLabels,
@@ -307,7 +307,7 @@ function ConnectedWorkflowsTable({
307
307
  await act(workflow, () => remove.mutateAsync(workflow.external_id));
308
308
  };
309
309
  return /* @__PURE__ */ jsxRuntime.jsx(
310
- chunkANLTECZ6_cjs.WorkflowsTable,
310
+ chunkZV4DNZ5N_cjs.WorkflowsTable,
311
311
  {
312
312
  ...tableProps,
313
313
  workflows,
@@ -564,5 +564,5 @@ exports.useConnectedWorkflowScopeSource = useConnectedWorkflowScopeSource;
564
564
  exports.useConnectedWorkspaceRole = useConnectedWorkspaceRole;
565
565
  exports.useDocxCommentTarget = useDocxCommentTarget;
566
566
  exports.useNativeDocxSupport = useNativeDocxSupport;
567
- //# sourceMappingURL=chunk-I6I34FDU.cjs.map
568
- //# sourceMappingURL=chunk-I6I34FDU.cjs.map
567
+ //# sourceMappingURL=chunk-NVVBRQN2.cjs.map
568
+ //# sourceMappingURL=chunk-NVVBRQN2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useHost","useConnectedDocuments","useConnectedTags","useMemo","buildWorkflowScopeSource","documentScopeLabels","useAgents","useBlocksEnvironment","useConnectedWorkspace","useUploadDocuments","useThumbnails","useRef","useState","useCallback","jsxs","Fragment","jsx","WorkflowDocumentsField","WorkflowLauncher","DocumentPicker","useArbi","buildDeepLinkUrl","parseDeepLinkPath","useWorkspaceUsers","workflowTriggerType","fmtDate","useWorkflows","useConnectedConversations","useUpdateWorkflow","useDeleteWorkflow","useConnectedRunWorkflow","useEffect","WorkflowsTable","useSetWorkspaceHouseTemplate","useWorkspaces","supportsHouseTemplates","workspaceHouseTemplateId","useHouseTemplateCandidates","contentPath","builtinHouseTemplate","isCandidate","useRegisterOpenDocument","NativeDocxEditor","useQueryClient","useOptionalDocumentTools","loadDocxFonts","refreshDocuments","fetchSavedSignature","storeSavedSignature"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,aAAgC,EAAC;AACvC,IAAM,YAAY,MAAM,IAAA;AAEjB,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAOA,yBAAA,GAAU,IAAA,IAAQ,UAAA;AAC3B;AAGO,SAAS,oBAAA,GAAyE;AACvF,EAAA,MAAM,SAAA,GAAY,oBAAA,EAAqB,CAAE,gBAAA,IAAoB,SAAA;AAC7D,EAAA,OAAO,SAAA,EAAU;AACnB;ACZA,IAAM,gBAAA,mBAAmB,IAAI,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,MAAM,C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;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-I6I34FDU.cjs","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * The workflow launcher bound to the connection: the open workspace's folders, labels and files\n * behind its scope and `documents` fields (files can be added right there), and the user's agents\n * behind \"Run as\". The host still says what a launch does (`onLaunch`): open a chat, start a task.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react'\nimport { useAgents, useThumbnails, useUploadDocuments } from '@arbidocs/react'\nimport { WorkflowLauncher, type WorkflowLauncherProps } from '../agents/workflows/WorkflowLauncher'\nimport {\n WorkflowDocumentsField,\n type WorkflowDocumentsFieldLabels,\n type WorkflowFieldDocument,\n} from '../agents/workflows/WorkflowDocumentsField'\nimport type { WorkflowScopeSource } from '../agents/workflows/WorkflowConfigDialog'\nimport { buildWorkflowScopeSource, documentScopeLabels } from '../agents/workflows/workspaceScope'\nimport type { AgentOption } from '../agents/workflows/AgentSelect'\nimport type { WorkflowField, WorkflowScope } from '../agents/workflows/types'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedDocuments, useConnectedTags, type ConnectedDocument } from './workspaceData'\n\nconst IMAGE_FILE_TYPES = new Set(['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'webp'])\n\n/** A workspace document as a `documents` field offers it. */\nexport function toWorkflowFieldDocument(doc: ConnectedDocument): WorkflowFieldDocument {\n // Pages and tokens are a text-parsing concept: never meaningful for an image.\n const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? '').toLowerCase())\n return {\n id: doc.external_id,\n title: doc.doc_metadata?.title || doc.file_name || doc.external_id,\n fileName: doc.file_name,\n pages: isImage ? null : (doc.n_pages ?? null),\n tokens: isImage ? null : (doc.tokens ?? null),\n status: doc.status,\n isImage,\n }\n}\n\n/** The open workspace's folders and labels for a workflow's scope field. */\nexport function useConnectedWorkflowScopeSource(): WorkflowScopeSource {\n const { data: docs } = useConnectedDocuments()\n const { data: tags } = useConnectedTags()\n return useMemo(() => buildWorkflowScopeSource(docs, documentScopeLabels(tags)), [docs, tags])\n}\n\n/** The user's agents, for \"Run as\". */\nexport function useConnectedAgentOptions(): AgentOption[] {\n const { data: agents } = useAgents()\n return useMemo(\n () => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),\n [agents]\n )\n}\n\nexport interface ConnectedWorkflowDocumentsFieldProps {\n field: WorkflowField\n value: WorkflowScope\n onChange: (value: WorkflowScope) => void\n /** Add files the host's way (its upload dialog). Absent: they are uploaded here. */\n onAddFiles?: (files?: File[]) => void\n labels?: Partial<WorkflowDocumentsFieldLabels>\n}\n\n/**\n * A workflow `documents` field over the open workspace's files: pick, add (or drop) files, see the\n * chosen images. A launcher's or a task composer's `renderDocuments`.\n */\nexport function ConnectedWorkflowDocumentsField({\n field,\n value,\n onChange,\n onAddFiles,\n labels,\n}: ConnectedWorkflowDocumentsFieldProps) {\n const { notify } = useBlocksEnvironment()\n const { ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: docs, loaded } = useConnectedDocuments()\n const uploadDocuments = useUploadDocuments()\n const documents = useMemo(() => docs.map(toWorkflowFieldDocument), [docs])\n const chosen = value.documents ?? []\n const { data: thumbnails } = useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 })\n const input = useRef<HTMLInputElement>(null)\n const [adding, setAdding] = useState(false)\n\n const upload = useCallback(\n async (files: File[]) => {\n setAdding(true)\n try {\n await ensureWorkspaceOpen()\n // Each new document joins the shared list as it lands.\n for (const file of files) await uploadDocuments.mutateAsync({ files: [file] })\n } catch (error) {\n notify(error instanceof Error && error.message ? error.message : String(error), 'error')\n } finally {\n setAdding(false)\n }\n },\n [uploadDocuments, ensureWorkspaceOpen, notify]\n )\n\n return (\n <>\n {!onAddFiles && (\n <input\n ref={input}\n type=\"file\"\n multiple\n className=\"hidden\"\n aria-label=\"Add files\"\n data-testid=\"workflow-add-files-input\"\n onChange={(e) => {\n const files = Array.from(e.target.files ?? [])\n e.target.value = ''\n if (files.length) void upload(files)\n }}\n />\n )}\n <WorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n documents={documents}\n loaded={loaded}\n thumbnailOf={(id) => thumbnails?.[id]}\n onAddFiles={\n onAddFiles ?? ((files) => (files?.length ? void upload(files) : input.current?.click()))\n }\n adding={adding}\n labels={labels}\n />\n </>\n )\n}\n\nexport interface ConnectedWorkflowLauncherProps extends Omit<\n WorkflowLauncherProps,\n 'scopeSource' | 'renderDocuments' | 'agents'\n> {\n /** Add files from a `documents` field the host's way (its upload dialog). Absent: uploaded here. */\n onAddFiles?: (files?: File[]) => void\n}\n\nexport function ConnectedWorkflowLauncher({\n onAddFiles,\n ...props\n}: ConnectedWorkflowLauncherProps) {\n const scopeSource = useConnectedWorkflowScopeSource()\n const agents = useConnectedAgentOptions()\n return (\n <WorkflowLauncher\n {...props}\n scopeSource={scopeSource}\n agents={agents}\n renderDocuments={(field, value, onChange) => (\n <ConnectedWorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n onAddFiles={onAddFiles}\n />\n )}\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useConnectedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useConnectedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport { workflowTriggerType } from '../agents/tasks/workflowRows'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations, useConnectedRunWorkflow } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n> {\n /** Which saved workflows to list (e.g. those on a schedule). Default: all. */\n filter?: (workflow: WorkflowResponse) => boolean\n /** When a workflow starts, in the host's words. Default: its trigger type. */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger = (w) => workflowTriggerType(w).replaceAll('_', ' '),\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useConnectedRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => (filter ? saved.filter(filter) : saved), [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={describeTrigger}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/NativeDocxEditor'\nimport {\n builtinHouseTemplate,\n type HouseTemplate,\n type HouseTemplateHost,\n} from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n return builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../../docx/fonts'\nimport { useRegisterOpenDocument } from '../../chat/open-document'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn&apos;t available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id) => {\n await (onDocumentsChanged\n ? onDocumentsChanged([id], 'version')\n : refreshDocuments(queries, arbi, [id]))\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useHost","useConnectedDocuments","useConnectedTags","useMemo","buildWorkflowScopeSource","documentScopeLabels","useAgents","useBlocksEnvironment","useConnectedWorkspace","useUploadDocuments","useThumbnails","useRef","useState","useCallback","jsxs","Fragment","jsx","WorkflowDocumentsField","WorkflowLauncher","DocumentPicker","useArbi","buildDeepLinkUrl","parseDeepLinkPath","useWorkspaceUsers","workflowTriggerType","fmtDate","useWorkflows","useConnectedConversations","useUpdateWorkflow","useDeleteWorkflow","useConnectedRunWorkflow","useEffect","WorkflowsTable","useSetWorkspaceHouseTemplate","useWorkspaces","supportsHouseTemplates","workspaceHouseTemplateId","useHouseTemplateCandidates","contentPath","builtinHouseTemplate","isCandidate","useRegisterOpenDocument","NativeDocxEditor","useQueryClient","useOptionalDocumentTools","loadDocxFonts","refreshDocuments","fetchSavedSignature","storeSavedSignature"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,aAAgC,EAAC;AACvC,IAAM,YAAY,MAAM,IAAA;AAEjB,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAOA,yBAAA,GAAU,IAAA,IAAQ,UAAA;AAC3B;AAGO,SAAS,oBAAA,GAAyE;AACvF,EAAA,MAAM,SAAA,GAAY,oBAAA,EAAqB,CAAE,gBAAA,IAAoB,SAAA;AAC7D,EAAA,OAAO,SAAA,EAAU;AACnB;ACZA,IAAM,gBAAA,mBAAmB,IAAI,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,MAAM,CAAC,CAAA;AAG9E,SAAS,wBAAwB,GAAA,EAA+C;AAErF,EAAA,MAAM,UAAU,gBAAA,CAAiB,GAAA,CAAA,CAAK,IAAI,SAAA,IAAa,EAAA,EAAI,aAAa,CAAA;AACxE,EAAA,OAAO;AAAA,IACL,IAAI,GAAA,CAAI,WAAA;AAAA,IACR,OAAO,GAAA,CAAI,YAAA,EAAc,KAAA,IAAS,GAAA,CAAI,aAAa,GAAA,CAAI,WAAA;AAAA,IACvD,UAAU,GAAA,CAAI,SAAA;AAAA,IACd,KAAA,EAAO,OAAA,GAAU,IAAA,GAAQ,GAAA,CAAI,OAAA,IAAW,IAAA;AAAA,IACxC,MAAA,EAAQ,OAAA,GAAU,IAAA,GAAQ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ChF,MAAA,EAAQ,MAAA;AAAA,UACR,OAAA,EAAS,EAAE,cAAA,EAAgB,kBAAA,EAAmB;AAAA,UAC9C,IAAA,EAAM,KAAK,SAAA,CAAU;AAAA,YACnB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,aAAa,OAAA,CAAQ,WAAA;AAAA,YACrB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,eAAe,OAAA,CAAQ;AAAA,WACxB;AAAA,SACF,CAAA;AACD,QAAA,MAAM,QAAA,GAAY,MAAM,QAAA,CAAS,IAAA,EAAK;AACtC,QAAA,MAAA,CAAO,sBAAsB,SAAS,CAAA;AACtC,QAAA,OAAO,EAAE,WAAA,EAAa,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE;AAAA,MACpD,CAAA;AAAA,MACA,cAAA,EAAgB,OAAO,UAAA,KAAA,CAAgB,MAAM,KAAK,SAAA,CAAU,WAAA,CAAY,UAAU,CAAA,EAAG,MAAA;AAAA,MACrF,aAAa,OAAA,CAAQ,WAAA;AAAA,MACrB,UAAA;AAAA,MACA,iBAAiB,OAAA,CAAQ,eAAA;AAAA,MACzB;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,IAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-NVVBRQN2.cjs","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * The workflow launcher bound to the connection: the open workspace's folders, labels and files\n * behind its scope and `documents` fields (files can be added right there), and the user's agents\n * behind \"Run as\". The host still says what a launch does (`onLaunch`): open a chat, start a task.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react'\nimport { useAgents, useThumbnails, useUploadDocuments } from '@arbidocs/react'\nimport { WorkflowLauncher, type WorkflowLauncherProps } from '../agents/workflows/WorkflowLauncher'\nimport {\n WorkflowDocumentsField,\n type WorkflowDocumentsFieldLabels,\n type WorkflowFieldDocument,\n} from '../agents/workflows/WorkflowDocumentsField'\nimport type { WorkflowScopeSource } from '../agents/workflows/WorkflowConfigDialog'\nimport { buildWorkflowScopeSource, documentScopeLabels } from '../agents/workflows/workspaceScope'\nimport type { AgentOption } from '../agents/workflows/AgentSelect'\nimport type { WorkflowField, WorkflowScope } from '../agents/workflows/types'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedDocuments, useConnectedTags, type ConnectedDocument } from './workspaceData'\n\nconst IMAGE_FILE_TYPES = new Set(['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'webp'])\n\n/** A workspace document as a `documents` field offers it. */\nexport function toWorkflowFieldDocument(doc: ConnectedDocument): WorkflowFieldDocument {\n // Pages and tokens are a text-parsing concept: never meaningful for an image.\n const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? '').toLowerCase())\n return {\n id: doc.external_id,\n title: doc.doc_metadata?.title || doc.file_name || doc.external_id,\n fileName: doc.file_name,\n pages: isImage ? null : (doc.n_pages ?? null),\n tokens: isImage ? null : (doc.tokens ?? null),\n status: doc.status,\n isImage,\n }\n}\n\n/** The open workspace's folders and labels for a workflow's scope field. */\nexport function useConnectedWorkflowScopeSource(): WorkflowScopeSource {\n const { data: docs } = useConnectedDocuments()\n const { data: tags } = useConnectedTags()\n return useMemo(() => buildWorkflowScopeSource(docs, documentScopeLabels(tags)), [docs, tags])\n}\n\n/** The user's agents, for \"Run as\". */\nexport function useConnectedAgentOptions(): AgentOption[] {\n const { data: agents } = useAgents()\n return useMemo(\n () => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),\n [agents]\n )\n}\n\nexport interface ConnectedWorkflowDocumentsFieldProps {\n field: WorkflowField\n value: WorkflowScope\n onChange: (value: WorkflowScope) => void\n /** Add files the host's way (its upload dialog). Absent: they are uploaded here. */\n onAddFiles?: (files?: File[]) => void\n labels?: Partial<WorkflowDocumentsFieldLabels>\n}\n\n/**\n * A workflow `documents` field over the open workspace's files: pick, add (or drop) files, see the\n * chosen images. A launcher's or a task composer's `renderDocuments`.\n */\nexport function ConnectedWorkflowDocumentsField({\n field,\n value,\n onChange,\n onAddFiles,\n labels,\n}: ConnectedWorkflowDocumentsFieldProps) {\n const { notify } = useBlocksEnvironment()\n const { ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: docs, loaded } = useConnectedDocuments()\n const uploadDocuments = useUploadDocuments()\n const documents = useMemo(() => docs.map(toWorkflowFieldDocument), [docs])\n const chosen = value.documents ?? []\n const { data: thumbnails } = useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 })\n const input = useRef<HTMLInputElement>(null)\n const [adding, setAdding] = useState(false)\n\n const upload = useCallback(\n async (files: File[]) => {\n setAdding(true)\n try {\n await ensureWorkspaceOpen()\n // Each new document joins the shared list as it lands.\n for (const file of files) await uploadDocuments.mutateAsync({ files: [file] })\n } catch (error) {\n notify(error instanceof Error && error.message ? error.message : String(error), 'error')\n } finally {\n setAdding(false)\n }\n },\n [uploadDocuments, ensureWorkspaceOpen, notify]\n )\n\n return (\n <>\n {!onAddFiles && (\n <input\n ref={input}\n type=\"file\"\n multiple\n className=\"hidden\"\n aria-label=\"Add files\"\n data-testid=\"workflow-add-files-input\"\n onChange={(e) => {\n const files = Array.from(e.target.files ?? [])\n e.target.value = ''\n if (files.length) void upload(files)\n }}\n />\n )}\n <WorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n documents={documents}\n loaded={loaded}\n thumbnailOf={(id) => thumbnails?.[id]}\n onAddFiles={\n onAddFiles ?? ((files) => (files?.length ? void upload(files) : input.current?.click()))\n }\n adding={adding}\n labels={labels}\n />\n </>\n )\n}\n\nexport interface ConnectedWorkflowLauncherProps extends Omit<\n WorkflowLauncherProps,\n 'scopeSource' | 'renderDocuments' | 'agents'\n> {\n /** Add files from a `documents` field the host's way (its upload dialog). Absent: uploaded here. */\n onAddFiles?: (files?: File[]) => void\n}\n\nexport function ConnectedWorkflowLauncher({\n onAddFiles,\n ...props\n}: ConnectedWorkflowLauncherProps) {\n const scopeSource = useConnectedWorkflowScopeSource()\n const agents = useConnectedAgentOptions()\n return (\n <WorkflowLauncher\n {...props}\n scopeSource={scopeSource}\n agents={agents}\n renderDocuments={(field, value, onChange) => (\n <ConnectedWorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n onAddFiles={onAddFiles}\n />\n )}\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useConnectedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useConnectedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport { workflowTriggerType } from '../agents/tasks/workflowRows'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations, useConnectedRunWorkflow } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n> {\n /** Which saved workflows to list (e.g. those on a schedule). Default: all. */\n filter?: (workflow: WorkflowResponse) => boolean\n /** When a workflow starts, in the host's words. Default: its trigger type. */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger = (w) => workflowTriggerType(w).replaceAll('_', ' '),\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useConnectedRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => (filter ? saved.filter(filter) : saved), [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={describeTrigger}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/NativeDocxEditor'\nimport {\n builtinHouseTemplate,\n type HouseTemplate,\n type HouseTemplateHost,\n} from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n return builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../../docx/fonts'\nimport { useRegisterOpenDocument } from '../../chat/open-document'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn&apos;t available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id) => {\n await (onDocumentsChanged\n ? onDocumentsChanged([id], 'version')\n : refreshDocuments(queries, arbi, [id]))\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
@@ -3,8 +3,8 @@
3
3
 
4
4
  var chunk7G2LJMUG_cjs = require('./chunk-7G2LJMUG.cjs');
5
5
  var chunkC2CWWEHO_cjs = require('./chunk-C2CWWEHO.cjs');
6
- var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
7
6
  var chunkULWRNGGE_cjs = require('./chunk-ULWRNGGE.cjs');
7
+ var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
8
8
  var lucideReact = require('lucide-react');
9
9
  var ui = require('@arbidocs/react/ui');
10
10
  var jsxRuntime = require('react/jsx-runtime');
@@ -1699,5 +1699,5 @@ exports.toAddContactsRow = toAddContactsRow;
1699
1699
  exports.toAddContactsRows = toAddContactsRows;
1700
1700
  exports.toggleMailFolder = toggleMailFolder;
1701
1701
  exports.validateContactForm = validateContactForm;
1702
- //# sourceMappingURL=chunk-U7OUZHBH.cjs.map
1703
- //# sourceMappingURL=chunk-U7OUZHBH.cjs.map
1702
+ //# sourceMappingURL=chunk-OISSVUGI.cjs.map
1703
+ //# sourceMappingURL=chunk-OISSVUGI.cjs.map