1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dw6J9krp.js","assets/suid-material-beZszf02.js","assets/SignIn-CUDqSt_U.js","assets/index-Ds5MqEm-.js","assets/GuestAuthChrome-BI7Tq_Ui.js","assets/components-B14In4Ni.js","assets/Guest.Layout-DJD5U2XZ.js","assets/logo-CkfnQ46G.js","assets/navigateAfterSignIn-D7QtfsNL.js","assets/sign-in-DvQCZr9p.js","assets/sign-up-CtA5UnSN.js","assets/FirstUseModal-n-Arg6Im.js","assets/suid-icons-BVoj-b7W.js","assets/AppIconButton-D7UwNbyJ.js","assets/firstUseModalHelpers-C_IqPerG.js","assets/performanceLogger-CBSM28jc.js","assets/forgot-BQ2mc6Un.js","assets/guestReason-CZ8QrUUm.js","assets/check-email-I3klW6jQ.js","assets/_token_-BGq6QMaA.js","assets/passwordValidation-VgfXvnQJ.js","assets/index-CNqiX_8c.js","assets/browser.umd-YwivngSI.js","assets/ContractLayout-CHFd-_fK.js","assets/EditPartyIndividualSchema-Bb5dCtNy.js","assets/entitySchemaHelpers-BOMdESs1.js","assets/partyUtils-Bl9jBxI3.js","assets/confirmPartyChangesHelpers-_gzC2mro.js","assets/ConfirmPartyChangesModal-C_FVMXXZ.js","assets/BindDropdowns-DGjmkPlQ.js","assets/Nav-CablUE1w.js","assets/_contractId_-Asqewepq.js","assets/_contractId_-CelnTt6R.js","assets/_templateId_-BFzWeWFA.js","assets/CreateContractModal-BXZCDHM6.js","assets/featureFlags-DDJbx1WI.js","assets/contracts-Lo-kfNsI.js","assets/Dashboard-DcJeq5SH.js","assets/helpS3Urls-DQj1Gxwt.js","assets/contentDispositionFilename-BDP-SJLT.js","assets/help-DSjPY2uA.js","assets/parties-BKmwi_Oz.js","assets/_partyId_-C6Fa1Rsa.js","assets/organizations-CIQ8U7Ub.js","assets/account-CaYz8VDW.js","assets/templates-myPK_U82.js","assets/_id_-DYTnX3z9.js","assets/navigationHelpers-DaEWqaZc.js","assets/variantResolver-guc7eo9c.js","assets/navigationHelpers-DPAfM6Oi.css","assets/_templateId_-oTejS8G-.js","assets/esignature-return-Dm_Pdwge.js","assets/content-docs-C-xi1iOb.js","assets/_id_-Ct8wawTS.js","assets/ContentDocEditor-BuazF62R.js","assets/new-B1vOb9ss.js","assets/_...404_-Pa6Xiypr.js"])))=>i.map(i=>d[i]); 2var __defProp = Object.defineProperty; 3var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 4var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); 5import { a as createComponent, b as createContext, s as spread, u as useContext, d as createRenderEffect, o as onCleanup, e as sharedConfig, f as createUniqueId, r as runWithOwner, g as createMemo, h as getOwner, i as untrack, j as createSignal, k as on, l as isServer, v as voidFn, m as startTransition, n as batch, p as children, q as mergeProps, w as memo, S as Show, x as createRoot, y as delegateEvents, z as createResource, A as onMount, B as createEffect, C as splitProps, D as Button, E as Box, F as For, G as Slide, H as Alert, I as AlertTitle, J as CircularProgress, K as lazy, L as createTheme, T as ThemeProvider, M as CssBaseline, N as Suspense, O as render } from "./suid-material-beZszf02.js"; 6(function polyfill() { 7 const relList = document.createElement("link").relList; 8 if (relList && relList.supports && relList.supports("modulepreload")) { 9 return; 10 } 11 for (const link of document.querySelectorAll('link[rel="modulepreload"]')) { 12 processPreload(link); 13 } 14 new MutationObserver((mutations) => { 15 for (const mutation of mutations) { 16 if (mutation.type !== "childList") { 17 continue; 18 } 19 for (const node of mutation.addedNodes) { 20 if (node.tagName === "LINK" && node.rel === "modulepreload") 21 processPreload(node); 22 } 23 } 24 }).observe(document, { childList: true, subtree: true }); 25 function getFetchOpts(link) { 26 const fetchOpts = {}; 27 if (link.integrity) fetchOpts.integrity = link.integrity; 28 if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy; 29 if (link.crossOrigin === "use-credentials") 30 fetchOpts.credentials = "include"; 31 else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit"; 32 else fetchOpts.credentials = "same-origin"; 33 return fetchOpts; 34 } 35 function processPreload(link) { 36 if (link.ep) 37 return; 38 link.ep = true; 39 const fetchOpts = getFetchOpts(link); 40 fetch(link.href, fetchOpts); 41 } 42})(); 43const MetaContext = createContext(); 44const cascadingTags = ["title", "meta"]; 45const titleTagProperties = []; 46const metaTagProperties = ( 47 // https://html.spec.whatwg.org/multipage/semantics.html#the-meta-element 48 ["name", "http-equiv", "content", "charset", "media"].concat(["property"]) 49); 50const getTagKey = (tag, properties) => { 51 const tagProps = Object.fromEntries(Object.entries(tag.props).filter(([k]) => properties.includes(k)).sort()); 52 if (Object.hasOwn(tagProps, "name") || Object.hasOwn(tagProps, "property")) { 53 tagProps.name = tagProps.name || tagProps.property; 54 delete tagProps.property; 55 } 56 return tag.tag + JSON.stringify(tagProps); 57}; 58function initClientProvider() { 59 if (!sharedConfig.context) { 60 const ssrTags = document.head.querySelectorAll(`[data-sm]`); 61 Array.prototype.forEach.call(ssrTags, (ssrTag) => ssrTag.parentNode.removeChild(ssrTag)); 62 } 63 const cascadedTagInstances = /* @__PURE__ */ new Map(); 64 function getElement(tag) { 65 if (tag.ref) { 66 return tag.ref; 67 } 68 let el = document.querySelector(`[data-sm="${tag.id}"]`); 69 if (el) { 70 if (el.tagName.toLowerCase() !== tag.tag) { 71 if (el.parentNode) { 72 el.parentNode.removeChild(el); 73 } 74 el = document.createElement(tag.tag); 75 } 76 el.removeAttribute("data-sm"); 77 } else { 78 el = document.createElement(tag.tag); 79 } 80 return el; 81 } 82 return { 83 addTag(tag) { 84 if (cascadingTags.indexOf(tag.tag) !== -1) { 85 const properties = tag.tag === "title" ? titleTagProperties : metaTagProperties; 86 const tagKey = getTagKey(tag, properties); 87 if (!cascadedTagInstances.has(tagKey)) { 88 cascadedTagInstances.set(tagKey, []); 89 } 90 let instances = cascadedTagInstances.get(tagKey); 91 let index = instances.length; 92 instances = [...instances, tag]; 93 cascadedTagInstances.set(tagKey, instances); 94 let element2 = getElement(tag); 95 tag.ref = element2; 96 spread(element2, tag.props); 97 let lastVisited = null; 98 for (var i = index - 1; i >= 0; i--) { 99 if (instances[i] != null) { 100 lastVisited = instances[i]; 101 break; 102 } 103 } 104 if (element2.parentNode != document.head) { 105 document.head.appendChild(element2); 106 } 107 if (lastVisited && lastVisited.ref && lastVisited.ref.parentNode) { 108 document.head.removeChild(lastVisited.ref); 109 } 110 return index; 111 } 112 let element = getElement(tag); 113 tag.ref = element; 114 spread(element, tag.props); 115 if (element.parentNode != document.head) { 116 document.head.appendChild(element); 117 } 118 return -1; 119 }, 120 removeTag(tag, index) { 121 const properties = tag.tag === "title" ? titleTagProperties : metaTagProperties; 122 const tagKey = getTagKey(tag, properties); 123 if (tag.ref) { 124 const t = cascadedTagInstances.get(tagKey); 125 if (t) { 126 if (tag.ref.parentNode) { 127 tag.ref.parentNode.removeChild(tag.ref); 128 for (let i = index - 1; i >= 0; i--) { 129 if (t[i] != null) { 130 document.head.appendChild(t[i].ref); 131 } 132 } 133 } 134 t[index] = null; 135 cascadedTagInstances.set(tagKey, t); 136 } else { 137 if (tag.ref.parentNode) { 138 tag.ref.parentNode.removeChild(tag.ref); 139 } 140 } 141 } 142 } 143 }; 144} 145const MetaProvider = (props) => { 146 const actions2 = initClientProvider(); 147 return createComponent(MetaContext.Provider, { 148 value: actions2, 149 get children() { 150 return props.children; 151 } 152 }); 153}; 154const MetaTag = (tag, props, setting) => { 155 useHead({ 156 tag, 157 props, 158 setting, 159 id: createUniqueId(), 160 get name() { 161 return props.name || props.property; 162 } 163 }); 164 return null; 165}; 166function useHead(tagDesc) { 167 const c = useContext(MetaContext); 168 if (!c) throw new Error("<MetaProvider /> should be in the tree"); 169 createRenderEffect(() => { 170 const index = c.addTag(tagDesc); 171 onCleanup(() => c.removeTag(tagDesc, index)); 172 }); 173} 174const Title = (props) => MetaTag("title", props, { 175 escape: true, 176 close: true 177}); 178function createBeforeLeave() { 179 let listeners = /* @__PURE__ */ new Set(); 180 function subscribe(listener) { 181 listeners.add(listener); 182 return () => listeners.delete(listener); 183 } 184 let ignore = false;
185 function confirm(to, options) { 186 if (ignore) 187 return !(ignore = false); 188 const e = { 189 to, 190 options, 191 defaultPrevented: false, 192 preventDefault: () => e.defaultPrevented = true 193 }; 194 for (const l of listeners) 195 l.listener({ 196 ...e, 197 from: l.location, 198 retry: (force) => { 199 force && (ignore = true); 200 l.navigate(to, { ...options, resolve: false }); 201 } 202 }); 203 return !e.defaultPrevented; 204 } 205 return { 206 subscribe, 207 confirm 208 }; 209} 210let depth; 211function saveCurrentDepth() { 212 if (!window.history.state || window.history.state._depth == null) { 213 window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, ""); 214 } 215 depth = window.history.state._depth; 216} 217{ 218 saveCurrentDepth(); 219} 220function keepDepth(state) { 221 return { 222 ...state, 223 _depth: window.history.state && window.history.state._depth 224 }; 225} 226function notifyIfNotBlocked(notify, block) { 227 let ignore = false; 228 return () => { 229 const prevDepth = depth; 230 saveCurrentDepth(); 231 const delta = prevDepth == null ? null : depth - prevDepth; 232 if (ignore) { 233 ignore = false; 234 return; 235 } 236 if (delta && block(delta)) { 237 ignore = true; 238 window.history.go(-delta); 239 } else { 240 notify(); 241 } 242 }; 243} 244const hasSchemeRegex = /^(?:[a-z0-9]+:)?\/\//i; 245const trimPathRegex = /^\/+|(\/)\/+$/g; 246const mockBase = "http://sr"; 247function normalizePath(path, omitSlash = false) { 248 const s = path.replace(trimPathRegex, "$1"); 249 return s ? omitSlash || /^[?#]/.test(s) ? s : "/" + s : ""; 250} 251function resolvePath(base, path, from) { 252 if (hasSchemeRegex.test(path)) { 253 return void 0; 254 } 255 const basePath = normalizePath(base); 256 const fromPath = from && normalizePath(from); 257 let result = ""; 258 if (!fromPath || path.startsWith("/")) { 259 result = basePath; 260 } else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) { 261 result = basePath + fromPath; 262 } else { 263 result = fromPath; 264 } 265 return (result || "/") + normalizePath(path, !result); 266} 267function invariant(value, message) { 268 if (value == null) { 269 throw new Error(message); 270 } 271 return value; 272} 273function joinPaths(from, to) { 274 return normalizePath(from).replace(/\/*(\*.*)?$/g, "") + normalizePath(to); 275} 276function extractSearchParams(url) { 277 const params = {}; 278 url.searchParams.forEach((value, key) => { 279 if (key in params) { 280 if (Array.isArray(params[key])) 281 params[key].push(value); 282 else 283 params[key] = [params[key], value]; 284 } else 285 params[key] = value; 286 }); 287 return params; 288} 289function createMatcher(path, partial, matchFilters) { 290 const [pattern, splat] = path.split("/*", 2); 291 const segments = pattern.split("/").filter(Boolean); 292 const len = segments.length; 293 return (location) => { 294 const locSegments = location.split("/").filter(Boolean); 295 const lenDiff = locSegments.length - len; 296 if (lenDiff < 0 || lenDiff > 0 && splat === void 0 && !partial) { 297 return null; 298 } 299 const match = { 300 path: len ? "" : "/", 301 params: {} 302 }; 303 const matchFilter = (s) => matchFilters === void 0 ? void 0 : matchFilters[s]; 304 for (let i = 0; i < len; i++) { 305 const segment = segments[i]; 306 const dynamic = segment[0] === ":"; 307 const locSegment = dynamic ? locSegments[i] : locSegments[i].toLowerCase(); 308 const key = dynamic ? segment.slice(1) : segment.toLowerCase(); 309 if (dynamic && matchSegment(locSegment, matchFilter(key))) { 310 match.params[key] = locSegment; 311 } else if (dynamic || !matchSegment(locSegment, key)) { 312 return null; 313 } 314 match.path += `/${locSegment}`; 315 } 316 if (splat) { 317 const remainder = lenDiff ? locSegments.slice(-lenDiff).join("/") : ""; 318 if (matchSegment(remainder, matchFilter(splat))) { 319 match.params[splat] = remainder; 320 } else { 321 return null; 322 } 323 } 324 return match; 325 }; 326} 327function matchSegment(input, filter) { 328 const isEqual = (s) => s === input; 329 if (filter === void 0) { 330 return true; 331 } else if (typeof filter === "string") { 332 return isEqual(filter); 333 } else if (typeof filter === "function") { 334 return filter(input); 335 } else if (Array.isArray(filter)) { 336 return filter.some(isEqual); 337 } else if (filter instanceof RegExp) { 338 return filter.test(input); 339 } 340 return false;
341} 342function scoreRoute(route) { 343 const [pattern, splat] = route.pattern.split("/*", 2); 344 const segments = pattern.split("/").filter(Boolean); 345 return segments.reduce((score, segment) => score + (segment.startsWith(":") ? 2 : 3), segments.length - (splat === void 0 ? 0 : 1)); 346} 347function createMemoObject(fn) { 348 const map = /* @__PURE__ */ new Map(); 349 const owner = getOwner(); 350 return new Proxy({}, { 351 get(_, property) { 352 if (!map.has(property)) { 353 runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property]))); 354 } 355 return map.get(property)(); 356 }, 357 getOwnPropertyDescriptor() { 358 return { 359 enumerable: true, 360 configurable: true 361 }; 362 }, 363 ownKeys() { 364 return Reflect.ownKeys(fn()); 365 } 366 }); 367} 368function mergeSearchString(search, params) { 369 const merged = new URLSearchParams(search); 370 Object.entries(params).forEach(([key, value]) => { 371 if (value == null || value === "" || value instanceof Array && !value.length) { 372 merged.delete(key); 373 } else { 374 if (value instanceof Array) { 375 merged.delete(key); 376 value.forEach((v) => { 377 merged.append(key, String(v)); 378 }); 379 } else { 380 merged.set(key, String(value)); 381 } 382 } 383 }); 384 const s = merged.toString(); 385 return s ? `?${s}` : ""; 386} 387function expandOptionals(pattern) { 388 let match = /(\/?\:[^\/]+)\?/.exec(pattern); 389 if (!match) 390 return [pattern]; 391 let prefix = pattern.slice(0, match.index); 392 let suffix = pattern.slice(match.index + match[0].length); 393 const prefixes = [prefix, prefix += match[1]]; 394 while (match = /^(\/\:[^\/]+)\?/.exec(suffix)) { 395 prefixes.push(prefix += match[1]); 396 suffix = suffix.slice(match[0].length); 397 } 398 return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map((p) => p + expansion)], []); 399} 400const MAX_REDIRECTS = 100; 401const RouterContextObj = createContext(); 402const RouteContextObj = createContext(); 403const useRouter = () => invariant(useContext(RouterContextObj), "<A> and 'use' router primitives can be only used inside a Route."); 404const useRoute = () => useContext(RouteContextObj) || useRouter().base; 405const useResolvedPath = (path) => { 406 const route = useRoute(); 407 return createMemo(() => route.resolvePath(path())); 408}; 409const useHref = (to) => { 410 const router = useRouter(); 411 return createMemo(() => { 412 const to_ = to(); 413 return to_ !== void 0 ? router.renderPath(to_) : to_; 414 }); 415}; 416const useNavigate = () => useRouter().navigatorFactory(); 417const useLocation = () => useRouter().location; 418const useParams = () => useRouter().params; 419const useSearchParams = () => { 420 const location = useLocation(); 421 const navigate = useNavigate(); 422 const setSearchParams = (params, options) => { 423 const searchString = untrack(() => mergeSearchString(location.search, params) + location.hash); 424 navigate(searchString, { 425 scroll: false, 426 resolve: false, 427 ...options 428 }); 429 }; 430 return [location.query, setSearchParams]; 431}; 432function createRoutes(routeDef, base = "") { 433 const { component, preload: preload2, load, children: children2, info } = routeDef; 434 const isLeaf = !children2 || Array.isArray(children2) && !children2.length; 435 const shared = { 436 key: routeDef, 437 component, 438 preload: preload2 || load, 439 info 440 }; 441 return asArray(routeDef.path).reduce((acc, originalPath) => { 442 for (const expandedPath of expandOptionals(originalPath)) { 443 const path = joinPaths(base, expandedPath); 444 let pattern = isLeaf ? path : path.split("/*", 1)[0]; 445 pattern = pattern.split("/").map((s) => { 446 return s.startsWith(":") || s.startsWith("*") ? s : encodeURIComponent(s); 447 }).join("/"); 448 acc.push({ 449 ...shared, 450 originalPath, 451 pattern, 452 matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters) 453 }); 454 } 455 return acc; 456 }, []); 457} 458function createBranch(routes, index = 0) { 459 return { 460 routes, 461 score: scoreRoute(routes[routes.length - 1]) * 1e4 - index, 462 matcher(location) { 463 const matches = []; 464 for (let i = routes.length - 1; i >= 0; i--) { 465 const route = routes[i]; 466 const match = route.matcher(location); 467 if (!match) { 468 return null; 469 } 470 matches.unshift({ 471 ...match, 472 route 473 }); 474 } 475 return matches; 476 } 477 }; 478} 479function asArray(value) { 480 return Array.isArray(value) ? value : [value]; 481} 482function createBranches(routeDef, base = "", stack = [], branches = []) { 483 const routeDefs = asArray(routeDef); 484 for (let i = 0, len = routeDefs.length; i < len; i++) { 485 const def = routeDefs[i]; 486 if (def && typeof def === "object") { 487 if (!def.hasOwnProperty("path")) 488 def.path = ""; 489 const routes = createRoutes(def, base); 490 for (const route of routes) { 491 stack.push(route); 492 const isEmptyArray = Array.isArray(def.children) && def.children.length === 0; 493 if (def.children && !isEmptyArray) { 494 createBranches(def.children, route.pattern, stack, branches); 495 } else { 496 const branch = createBranch([...stack], branches.length); 497 branches.push(branch); 498 } 499 stack.pop(); 500 } 501 } 502 } 503 return stack.length ? branches : branches.sort((a, b) => b.score - a.score); 504} 505function getRouteMatches(branches, location) { 506 for (let i = 0, len = branches.length; i < len; i++) { 507 const match = branches[i].matcher(location); 508 if (match) { 509 return match; 510 } 511 } 512 return []; 513} 514function createLocation(path, state, queryWrapper) { 515 const origin = new URL(mockBase); 516 const url = createMemo((prev) => { 517 const path_ = path(); 518 try { 519 return new URL(path_, origin); 520 } catch (err) { 521 console.error(`Invalid path ${path_}`); 522 return prev; 523 } 524 }, origin, { 525 equals: (a, b) => a.href === b.href 526 }); 527 const pathname = createMemo(() => url().pathname); 528 const search = createMemo(() => url().search, true); 529 const hash = createMemo(() => url().hash); 530 const key = () => "";
531 const queryFn = on(search, () => extractSearchParams(url())); 532 return { 533 get pathname() { 534 return pathname(); 535 }, 536 get search() { 537 return search(); 538 }, 539 get hash() { 540 return hash(); 541 }, 542 get state() { 543 return state(); 544 }, 545 get key() { 546 return key(); 547 }, 548 query: queryWrapper ? queryWrapper(queryFn) : createMemoObject(queryFn) 549 }; 550} 551let intent; 552function getIntent() { 553 return intent; 554} 555function setInPreloadFn(value) { 556} 557function createRouterContext(integration, branches, getContext, options = {}) { 558 const { signal: [source, setSource], utils = {} } = integration; 559 const parsePath = utils.parsePath || ((p) => p); 560 const renderPath = utils.renderPath || ((p) => p); 561 const beforeLeave = utils.beforeLeave || createBeforeLeave(); 562 const basePath = resolvePath("", options.base || ""); 563 if (basePath === void 0) { 564 throw new Error(`${basePath} is not a valid base path`); 565 } else if (basePath && !source().value) { 566 setSource({ value: basePath, replace: true, scroll: false }); 567 } 568 const [isRouting, setIsRouting] = createSignal(false); 569 let lastTransitionTarget; 570 const transition = (newIntent, newTarget) => { 571 if (newTarget.value === reference() && newTarget.state === state()) 572 return; 573 if (lastTransitionTarget === void 0) 574 setIsRouting(true); 575 intent = newIntent; 576 lastTransitionTarget = newTarget; 577 startTransition(() => { 578 if (lastTransitionTarget !== newTarget) 579 return; 580 setReference(lastTransitionTarget.value); 581 setState(lastTransitionTarget.state); 582 submissions[1]((subs) => subs.filter((s) => s.pending)); 583 }).finally(() => { 584 if (lastTransitionTarget !== newTarget) 585 return; 586 batch(() => { 587 intent = void 0; 588 if (newIntent === "navigate") 589 navigateEnd(lastTransitionTarget); 590 setIsRouting(false); 591 lastTransitionTarget = void 0; 592 }); 593 }); 594 }; 595 const [reference, setReference] = createSignal(source().value); 596 const [state, setState] = createSignal(source().state); 597 const location = createLocation(reference, state, utils.queryWrapper); 598 const referrers = []; 599 const submissions = createSignal([]); 600 const matches = createMemo(() => { 601 if (typeof options.transformUrl === "function") { 602 return getRouteMatches(branches(), options.transformUrl(location.pathname)); 603 } 604 return getRouteMatches(branches(), location.pathname); 605 }); 606 const buildParams = () => { 607 const m = matches(); 608 const params2 = {}; 609 for (let i = 0; i < m.length; i++) { 610 Object.assign(params2, m[i].params); 611 } 612 return params2; 613 }; 614 const params = utils.paramsWrapper ? utils.paramsWrapper(buildParams, branches) : createMemoObject(buildParams); 615 const baseRoute = { 616 pattern: basePath, 617 path: () => basePath, 618 outlet: () => null, 619 resolvePath(to) { 620 return resolvePath(basePath, to); 621 } 622 }; 623 createRenderEffect(on(source, (source2) => transition("native", source2), { defer: true })); 624 return { 625 base: baseRoute, 626 location, 627 params, 628 isRouting, 629 renderPath, 630 parsePath, 631 navigatorFactory, 632 matches, 633 beforeLeave, 634 preloadRoute, 635 singleFlight: options.singleFlight === void 0 ? true : options.singleFlight, 636 submissions 637 }; 638 function navigateFromRoute(route, to, options2) { 639 untrack(() => { 640 if (typeof to === "number") { 641 if (!to) { 642 } else if (utils.go) { 643 utils.go(to); 644 } else { 645 console.warn("Router integration does not support relative routing"); 646 } 647 return; 648 } 649 const queryOnly = !to || to[0] === "?"; 650 const { replace, resolve, scroll, state: nextState } = { 651 replace: false, 652 resolve: !queryOnly, 653 scroll: true, 654 ...options2 655 }; 656 const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(queryOnly && location.pathname || "", to); 657 if (resolvedTo === void 0) { 658 throw new Error(`Path '${to}' is not a routable path`); 659 } else if (referrers.length >= MAX_REDIRECTS) { 660 throw new Error("Too many redirects"); 661 } 662 const current = reference(); 663 if (resolvedTo !== current || nextState !== state()) { 664 if (isServer) ; 665 else if (beforeLeave.confirm(resolvedTo, options2)) { 666 referrers.push({ value: current, replace, scroll, state: state() }); 667 transition("navigate", { 668 value: resolvedTo, 669 state: nextState 670 }); 671 } 672 } 673 }); 674 } 675 function navigatorFactory(route) { 676 route = route || useContext(RouteContextObj) || baseRoute; 677 return (to, options2) => navigateFromRoute(route, to, options2); 678 } 679 function navigateEnd(next) {
680 const first = referrers[0]; 681 if (first) { 682 setSource({ 683 ...next, 684 replace: first.replace, 685 scroll: first.scroll 686 }); 687 referrers.length = 0; 688 } 689 } 690 function preloadRoute(url, preloadData) { 691 const matches2 = getRouteMatches(branches(), url.pathname); 692 const prevIntent = intent; 693 intent = "preload"; 694 for (let match in matches2) { 695 const { route, params: params2 } = matches2[match]; 696 route.component && route.component.preload && route.component.preload(); 697 const { preload: preload2 } = route; 698 preloadData && preload2 && runWithOwner(getContext(), () => preload2({ 699 params: params2, 700 location: { 701 pathname: url.pathname, 702 search: url.search, 703 hash: url.hash, 704 query: extractSearchParams(url), 705 state: null, 706 key: "" 707 }, 708 intent: "preload" 709 })); 710 } 711 intent = prevIntent; 712 } 713} 714function createRouteContext(router, parent, outlet, match) { 715 const { base, location, params } = router; 716 const { pattern, component, preload: preload2 } = match().route; 717 const path = createMemo(() => match().path); 718 component && component.preload && component.preload(); 719 const data = preload2 ? preload2({ params, location, intent: intent || "initial" }) : void 0; 720 const route = { 721 parent, 722 pattern, 723 path, 724 outlet: () => component ? createComponent(component, { 725 params, 726 location, 727 data, 728 get children() { 729 return outlet(); 730 } 731 }) : outlet(), 732 resolvePath(to) { 733 return resolvePath(base.path(), to, path()); 734 } 735 }; 736 return route; 737} 738const createRouterComponent = (router) => (props) => { 739 const { 740 base 741 } = props; 742 const routeDefs = children(() => props.children); 743 const branches = createMemo(() => createBranches(routeDefs(), props.base || "")); 744 let context; 745 const routerState = createRouterContext(router, branches, () => context, { 746 base, 747 singleFlight: props.singleFlight, 748 transformUrl: props.transformUrl 749 }); 750 router.create && router.create(routerState); 751 return createComponent(RouterContextObj.Provider, { 752 value: routerState, 753 get children() { 754 return createComponent(Root, { 755 routerState, 756 get root() { 757 return props.root; 758 }, 759 get preload() { 760 return props.rootPreload || props.rootLoad; 761 }, 762 get children() { 763 return [memo(() => (context = getOwner()) && null), createComponent(Routes, { 764 routerState, 765 get branches() { 766 return branches(); 767 } 768 })]; 769 } 770 }); 771 } 772 }); 773}; 774function Root(props) { 775 const location = props.routerState.location; 776 const params = props.routerState.params; 777 const data = createMemo(() => props.preload && untrack(() => { 778 setInPreloadFn(true); 779 props.preload({ 780 params, 781 location, 782 intent: getIntent() || "initial" 783 }); 784 setInPreloadFn(false); 785 })); 786 return createComponent(Show, { 787 get when() { 788 return props.root; 789 }, 790 keyed: true, 791 get fallback() { 792 return props.children; 793 }, 794 children: (Root2) => createComponent(Root2, { 795 params, 796 location, 797 get data() { 798 return data(); 799 }, 800 get children() { 801 return props.children; 802 } 803 }) 804 }); 805} 806function Routes(props) { 807 const disposers = []; 808 let root; 809 const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => { 810 let equal = prevMatches && nextMatches.length === prevMatches.length; 811 const next = []; 812 for (let i = 0, len = nextMatches.length; i < len; i++) { 813 const prevMatch = prevMatches && prevMatches[i]; 814 const nextMatch = nextMatches[i]; 815 if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) { 816 next[i] = prev[i]; 817 } else { 818 equal = false; 819 if (disposers[i]) { 820 disposers[i](); 821 } 822 createRoot((dispose) => { 823 disposers[i] = dispose; 824 next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]); 825 }); 826 } 827 }
828 disposers.splice(nextMatches.length).forEach((dispose) => dispose()); 829 if (prev && equal) { 830 return prev; 831 } 832 root = next[0]; 833 return next; 834 })); 835 return createOutlet(() => routeStates() && root)(); 836} 837const createOutlet = (child) => { 838 return () => createComponent(Show, { 839 get when() { 840 return child(); 841 }, 842 keyed: true, 843 children: (child2) => createComponent(RouteContextObj.Provider, { 844 value: child2, 845 get children() { 846 return child2.outlet(); 847 } 848 }) 849 }); 850}; 851const Route = (props) => { 852 const childRoutes = children(() => props.children); 853 return mergeProps(props, { 854 get children() { 855 return childRoutes(); 856 } 857 }); 858}; 859function intercept([value, setValue], get, set) { 860 return [value, set ? (v) => setValue(set(v)) : setValue]; 861} 862function createRouter(config) { 863 let ignore = false; 864 const wrap = (value) => typeof value === "string" ? { value } : value; 865 const signal = intercept(createSignal(wrap(config.get()), { 866 equals: (a, b) => a.value === b.value && a.state === b.state 867 }), void 0, (next) => { 868 !ignore && config.set(next); 869 if (sharedConfig.registry && !sharedConfig.done) 870 sharedConfig.done = true; 871 return next; 872 }); 873 config.init && onCleanup(config.init((value = config.get()) => { 874 ignore = true; 875 signal[1](wrap(value)); 876 ignore = false; 877 })); 878 return createRouterComponent({ 879 signal, 880 create: config.create, 881 utils: config.utils 882 }); 883} 884function bindEvent(target, type, handler) { 885 target.addEventListener(type, handler); 886 return () => target.removeEventListener(type, handler); 887} 888function scrollToHash(hash, fallbackTop) { 889 const el = hash && document.getElementById(hash); 890 if (el) { 891 el.scrollIntoView(); 892 } else if (fallbackTop) { 893 window.scrollTo(0, 0); 894 } 895} 896const actions = /* @__PURE__ */ new Map(); 897function setupNativeEvents(preload2 = true, explicitLinks = false, actionBase = "/_server", transformUrl) { 898 return (router) => { 899 const basePath = router.base.path(); 900 const navigateFromRoute = router.navigatorFactory(router.base); 901 let preloadTimeout; 902 let lastElement; 903 function isSvg(el) { 904 return el.namespaceURI === "http://www.w3.org/2000/svg"; 905 } 906 function handleAnchor(evt) { 907 if (evt.defaultPrevented || evt.button !== 0 || evt.metaKey || evt.altKey || evt.ctrlKey || evt.shiftKey) 908 return; 909 const a = evt.composedPath().find((el) => el instanceof Node && el.nodeName.toUpperCase() === "A"); 910 if (!a || explicitLinks && !a.hasAttribute("link")) 911 return; 912 const svg = isSvg(a); 913 const href = svg ? a.href.baseVal : a.href; 914 const target = svg ? a.target.baseVal : a.target; 915 if (target || !href && !a.hasAttribute("state")) 916 return; 917 const rel = (a.getAttribute("rel") || "").split(/\s+/); 918 if (a.hasAttribute("download") || rel && rel.includes("external")) 919 return; 920 const url = svg ? new URL(href, document.baseURI) : new URL(href); 921 if (url.origin !== window.location.origin || basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())) 922 return; 923 return [a, url]; 924 } 925 function handleAnchorClick(evt) { 926 const res = handleAnchor(evt); 927 if (!res) 928 return; 929 const [a, url] = res; 930 const to = router.parsePath(url.pathname + url.search + url.hash); 931 const state = a.getAttribute("state"); 932 evt.preventDefault(); 933 navigateFromRoute(to, { 934 resolve: false, 935 replace: a.hasAttribute("replace"), 936 scroll: !a.hasAttribute("noscroll"), 937 state: state ? JSON.parse(state) : void 0 938 }); 939 } 940 function handleAnchorPreload(evt) { 941 const res = handleAnchor(evt); 942 if (!res) 943 return; 944 const [a, url] = res; 945 transformUrl && (url.pathname = transformUrl(url.pathname)); 946 router.preloadRoute(url, a.getAttribute("preload") !== "false"); 947 } 948 function handleAnchorMove(evt) { 949 clearTimeout(preloadTimeout); 950 const res = handleAnchor(evt); 951 if (!res) 952 return lastElement = null; 953 const [a, url] = res; 954 if (lastElement === a) 955 return; 956 transformUrl && (url.pathname = transformUrl(url.pathname)); 957 preloadTimeout = setTimeout(() => { 958 router.preloadRoute(url, a.getAttribute("preload") !== "fal
958se"); 959 lastElement = a; 960 }, 20); 961 } 962 function handleFormSubmit(evt) { 963 if (evt.defaultPrevented) 964 return; 965 let actionRef = evt.submitter && evt.submitter.hasAttribute("formaction") ? evt.submitter.getAttribute("formaction") : evt.target.getAttribute("action"); 966 if (!actionRef) 967 return; 968 if (!actionRef.startsWith("https://action/")) { 969 const url = new URL(actionRef, mockBase); 970 actionRef = router.parsePath(url.pathname + url.search); 971 if (!actionRef.startsWith(actionBase)) 972 return; 973 } 974 if (evt.target.method.toUpperCase() !== "POST") 975 throw new Error("Only POST forms are supported for Actions"); 976 const handler = actions.get(actionRef); 977 if (handler) { 978 evt.preventDefault(); 979 const data = new FormData(evt.target, evt.submitter); 980 handler.call({ r: router, f: evt.target }, evt.target.enctype === "multipart/form-data" ? data : new URLSearchParams(data)); 981 } 982 } 983 delegateEvents(["click", "submit"]); 984 document.addEventListener("click", handleAnchorClick); 985 if (preload2) { 986 document.addEventListener("mousemove", handleAnchorMove, { passive: true }); 987 document.addEventListener("focusin", handleAnchorPreload, { passive: true }); 988 document.addEventListener("touchstart", handleAnchorPreload, { passive: true }); 989 } 990 document.addEventListener("submit", handleFormSubmit); 991 onCleanup(() => { 992 document.removeEventListener("click", handleAnchorClick); 993 if (preload2) { 994 document.removeEventListener("mousemove", handleAnchorMove); 995 document.removeEventListener("focusin", handleAnchorPreload); 996 document.removeEventListener("touchstart", handleAnchorPreload); 997 } 998 document.removeEventListener("submit", handleFormSubmit); 999 }); 1000 }; 1001} 1002function Router(props) { 1003 const getSource = () => { 1004 const url = window.location.pathname.replace(/^\/+/, "/") + window.location.search; 1005 const state = window.history.state && window.history.state._depth && Object.keys(window.history.state).length === 1 ? void 0 : window.history.state; 1006 return { 1007 value: url + window.location.hash, 1008 state 1009 }; 1010 }; 1011 const beforeLeave = createBeforeLeave(); 1012 return createRouter({ 1013 get: getSource, 1014 set({ value, replace, scroll, state }) { 1015 if (replace) { 1016 window.history.replaceState(keepDepth(state), "", value); 1017 } else { 1018 window.history.pushState(state, "", value); 1019 } 1020 scrollToHash(decodeURIComponent(window.location.hash.slice(1)), scroll); 1021 saveCurrentDepth(); 1022 }, 1023 init: (notify) => bindEvent(window, "popstate", notifyIfNotBlocked(notify, (delta) => { 1024 if (delta && delta < 0) { 1025 return !beforeLeave.confirm(delta); 1026 } else { 1027 const s = getSource(); 1028 return !beforeLeave.confirm(s.value, { state: s.state }); 1029 } 1030 })), 1031 create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase, props.transformUrl), 1032 utils: { 1033 go: (delta) => window.history.go(delta), 1034 beforeLeave 1035 } 1036 })(props); 1037} 1038const apiPaths = { 1039 contracts: { 1040 collection: () => "/api/contracts", 1041 list: ({ page, pageSize, organizationId, includeArchived }) => `/api/contracts?page=${page}&pageSize=${pageSize}${organizationId ? `&organizationId=${encodeURIComponent(organizationId)}` : ""}${includeArchived ? "&includeArchived=true" : ""}`, 1042 detail: (contractId) => `/api/contracts/${contractId}`, 1043 cleanupIfNoParties: (contractId) => `/api/contracts/${contractId}?ifNoParties=true`, 1044 archive: (contractId) => `/api/contracts/${contractId}/archive` 1045 }, 1046 parties: { 1047 collection: () => "/api/parties", 1048 list: ({ page, pageSize, organizationId }) => `/api/parties?page=${page}&pageSize=${pageSize}${organizationId ? `&organizationId=${encodeURIComponent(organizationId)}` : ""}`, 1049 default: () => "/api/parties?default=true", 1050 searchByLegalEntityName: (legalEntityName, limit = 7) => `/api/parties?legalEntityName=${encodeURIComponent(legalEntityName)}&limit=${limit}`, 1051 detail: (partyId) => `/api/party/${partyId}` 1052 }, 1053 partyMembers: { 1054 collection: () => "/api/party-members", 1055 listByParty: (partyId) => `/api/party-members?partyId=${encodeURIComponent(partyId)}`, 1056 detail: (partyMemberId) => `/api/party-members/${partyMemberId}` 1057 }, 1058 templates: { 1059 collection: () => "/api/templates", 1060 list: ({ page, pageSize }) => `/api/templates?page=${page}&pageSize=${pageSize}`, 1061 detail: (templateId) => `/api/templates/${templateId}`, 1062 preview: (templateId) => `/api/templates/${templateId}/preview`, 1063 use: (templateId) => `/api/templates/${templateId}/use` 1064 }, 1065 contractParties: { 1066 link: () => "/api/contract-parties", 1067 replaceForRole: () => "/api/contract-parties" 1068 }, 1069 documents: { 1070 collection: () => "/api/documents", 1071 byContract: (contractId) => `/api/documents/by-contract/${contractId}`, 1072 detail: (documentId) => `/api/documents/${documentId}`, 1073 complete: (documentId) => `/api/documents/${documentId}/complete`, 1074 sendForSignature: (documentId) => `/api/documents/${documentId}/send-for-signature`, 1075 syncEsignature: (documentId) => `/api/documents/${documentId}/sync-esignature`, 1076 embeddedSigning: (documentId) => `/api/documents/${documentId}/embedded-signing`, 1077 preview: (documentId) => `/api/documents/${documentId}/preview`, 1078 redlinePreview: (documentId) => `/api/documents/${documentId}/redline-preview`, 1079 send: (documentId) => `/api/documents/${documentId}/send`, 1080 completeReview: (documentId) => `/api/documents/${documentId}/complete-review`, 1081 toggleHold: (documentId) => `/api/documents/${documentId}/toggle-hold`, 1082 explicitAccept: (documentId) => `/api/documents/${documentId}/explicit-accept`, 1083 commentThreadRead: (documentId) => `/api/documents/${documentId}/comment-thread-read`, 1084 exportPdf: (documentId) => `/api/documents/${documentId}/export-pdf`, 1085 exportExecutedPdf: (documentId) => `/api/documents/${documentId}/export-executed-pdf`,
1086 exportDocx: (documentId) => `/api/documents/${documentId}/export-docx`, 1087 emailPdf: (documentId) => `/api/documents/${documentId}/email-pdf`, 1088 roleGrants: (documentId) => `/api/documents/${documentId}/role-grants`, 1089 comments: (documentId, sectionId, anchor) => anchor ? `/api/documents/${documentId}/comments?anchorKind=${encodeURIComponent(anchor.anchorKind)}&anchorId=${encodeURIComponent(anchor.anchorId)}` : sectionId ? `/api/documents/${documentId}/comments?sectionId=${encodeURIComponent(sectionId)}` : `/api/documents/${documentId}/comments`, 1090 commentDetail: (documentId, commentId) => `/api/documents/${documentId}/comments/${commentId}` 1091 }, 1092 contentDocs: { 1093 collection: () => "/api/content-docs", 1094 detail: (contentDocId) => `/api/content-docs/${contentDocId}`, 1095 detailWithOptions: (contentDocId, options = {}) => { 1096 const params = new URLSearchParams(); 1097 if (options.createNewVersion) { 1098 params.set("createNewVersion", "true"); 1099 } 1100 if (options.allowOverwritePublished) { 1101 params.set("allowOverwritePublished", "true"); 1102 } 1103 const query = params.toString(); 1104 return query ? `/api/content-docs/${contentDocId}?${query}` : `/api/content-docs/${contentDocId}`; 1105 }, 1106 publish: (contentDocId) => `/api/content-docs/${contentDocId}/publish` 1107 }, 1108 content: { 1109 latestPublished: (type) => `/api/content/latest-published?type=${encodeURIComponent(type)}` 1110 }, 1111 account: { 1112 update: () => "/api/account" 1113 }, 1114 session: { 1115 current: () => "/api/session" 1116 }, 1117 firstUseModal: { 1118 detail: (pageId) => `/api/first-use-modal/${encodeURIComponent(pageId)}` 1119 }, 1120 playbookTour: { 1121 event: () => "/api/playbook-tour/event" 1122 }, 1123 auth: { 1124 signIn: () => "/api/auth/sign-in", 1125 signOut: () => "/api/auth/sign-out", 1126 signUp: () => "/api/auth/sign-up", 1127 forgotPassword: () => "/api/auth/forgot-password", 1128 passwordReset: () => "/api/auth/password-reset", 1129 validateResetToken: () => "/api/auth/validate-reset-token", 1130 classifyExpiredToken: () => "/api/auth/classify-expired-token", 1131 resendInvite: () => "/api/auth/resend-invite", 1132 envExchangeMint: () => "/api/auth/env-exchange/mint", 1133 envExchangeRedeem: () => "/api/auth/env-exchange/redeem" 1134 }, 1135 system: { 1136 testMongo: () => "/api/test-mongo" 1137 }, 1138 billing: { 1139 status: () => "/api/billing/status", 1140 checkoutSession: () => "/api/billing/checkout-session", 1141 portalSession: () => "/api/billing/portal-session" 1142 } 1143}; 1144const __vite_import_meta_env__ = {}; 1145const API_BASE_URL = (__vite_import_meta_env__ == null ? void 0 : __vite_import_meta_env__.VITE_API_BASE_URL) || ""; 1146function getApiUrl(path) { 1147 const normalizedPath = path.startsWith("/") ? path : `/${path}`; 1148 return `${API_BASE_URL}${normalizedPath}`; 1149} 1150async function fetchAPI(path, options = {}) { 1151 const url = getApiUrl(path); 1152 const defaultOptions = { 1153 credentials: "include", 1154 // Always include cookies for session management 1155 headers: { 1156 "Content-Type": "application/json", 1157 ...options.headers 1158 } 1159 }; 1160 return fetch(url, { ...defaultOptions, ...options }); 1161} 1162async function fetchAPIPost(path, body) { 1163 return fetchAPI(path, { 1164 method: "POST", 1165 body: body ? JSON.stringify(body) : void 0 1166 }); 1167} 1168async function fetchAPIPut(path, body) { 1169 return fetchAPI(path, { 1170 method: "PUT", 1171 body: body ? JSON.stringify(body) : void 0 1172 }); 1173} 1174async function fetchAPIDelete(path) { 1175 return fetchAPI(path, { method: "DELETE" }); 1176} 1177class ApiClientError extends Error { 1178 constructor(message, status, details, requestId, code, blockingSections) { 1179 super(message); 1180 __publicField(this, "status"); 1181 __publicField(this, "details"); 1182 __publicField(this, "requestId"); 1183 __publicField(this, "code"); 1184 /** Present when /send (or similar) returns disposition blockingSections. */ 1185 __publicField(this, "blockingSections"); 1186 this.name = "ApiClientError"; 1187 this.status = status; 1188 this.details = details; 1189 this.requestId = requestId; 1190 this.code = code; 1191 this.blockingSections = blockingSections; 1192 } 1193} 1194function parseBlockingSections(payload) { 1195 const raw = payload == null ? void 0 : payload.blockingSections; 1196 if (!Array.isArray(raw) || raw.length === 0) return void 0; 1197 const sections = []; 1198 for (const item of raw) { 1199 if (item && typeof item === "object" && typeof item.sectionId === "string" && typeof item.sectionName === "string") { 1200 sections.push({ 1201 sectionId: item.sectionId, 1202 sectionName: item.sectionName 1203 }); 1204 } 1205 } 1206 return sections.length > 0 ? sections : void 0; 1207} 1208function throwApiClientError(status, errorPayload) { 1209 const message = typeof (errorPayload == null ? void 0 : errorPayload.details) === "string" ? errorPayload.details : (errorPayload == null ? void 0 : errorPayload.error) || `Request failed with status ${status}`; 1210 const code = typeof (errorPayload == null ? void 0 : errorPayload.code) === "string" ? errorPayload.code : void 0; 1211 throw new ApiClientError( 1212 message, 1213 status, 1214 errorPayload == null ? void 0 : errorPayload.details, 1215 errorPayload == null ? void 0 : errorPayload.requestId, 1216 code, 1217 parseBlockingSections(errorPayload) 1218 ); 1219} 1220function isPaywallError(error) { 1221 return error instanceof ApiClientError && error.status === 402 && error.code === "PAYWALL"; 1222} 1223async function parseJsonSafe(response) { 1224 try { 1225 return await response.json(); 1226 } catch { 1227 return null; 1228 } 1229} 1230async function requestJson(path, options = {}) { 1231 const response = await fetchAPI(path, options); 1232 const payload = await parseJsonSafe(response); 1233 if (!response.ok) { 1234 throwApiClientError(response.status, payload); 1235 } 1236 return payload; 1237} 1238async function requestStatus(path, options = {}) { 1239 const response = await fetchAPI(path, options); 1240 return response.status; 1241} 1242async function requestRaw(path, options = {}) { 1243 const response = await fetchAPI(path, options); 1244 if (!response.ok) { 1245 const errorPayload = await parseJsonSafe(response); 1246 throwApiClientError(response.status, errorPayload); 1247 } 1248 return response; 1249} 1250const apiClient = { 1251 session: { 1252 current() { 1253 return requestJson(apiPaths.session.current()); 1254 } 1255 }, 1256 auth: {
1257 signIn(payload) { 1258 return requestJson(apiPaths.auth.signIn(), { 1259 method: "POST", 1260 body: JSON.stringify(payload) 1261 }); 1262 }, 1263 signOut() { 1264 return requestJson(apiPaths.auth.signOut(), { method: "POST" }); 1265 }, 1266 signUp(payload) { 1267 return requestJson(apiPaths.auth.signUp(), { 1268 method: "POST", 1269 body: JSON.stringify(payload) 1270 }); 1271 }, 1272 forgotPassword(payload) { 1273 return requestJson(apiPaths.auth.forgotPassword(), { 1274 method: "POST", 1275 body: JSON.stringify(payload) 1276 }); 1277 }, 1278 passwordReset(payload) { 1279 return requestJson(apiPaths.auth.passwordReset(), { 1280 method: "POST", 1281 body: JSON.stringify(payload) 1282 }); 1283 }, 1284 validateResetToken(payload) { 1285 return requestJson(apiPaths.auth.validateResetToken(), { 1286 method: "POST", 1287 body: JSON.stringify(payload) 1288 }); 1289 }, 1290 classifyExpiredToken(payload) { 1291 return requestJson(apiPaths.auth.classifyExpiredToken(), { 1292 method: "POST", 1293 body: JSON.stringify(payload) 1294 }); 1295 }, 1296 resendInvite(payload) { 1297 return requestJson(apiPaths.auth.resendInvite(), { 1298 method: "POST", 1299 body: JSON.stringify(payload) 1300 }); 1301 }, 1302 mintEnvExchange(payload) { 1303 return requestJson(apiPaths.auth.envExchangeMint(), { 1304 method: "POST", 1305 body: JSON.stringify(payload ?? {}) 1306 }); 1307 } 1308 }, 1309 account: { 1310 update(payload) { 1311 return requestJson(apiPaths.account.update(), { 1312 method: "PUT", 1313 body: JSON.stringify(payload) 1314 }); 1315 } 1316 }, 1317 contracts: { 1318 list(page, pageSize, organizationId, includeArchived) { 1319 return requestJson(apiPaths.contracts.list({ page, pageSize, organizationId, includeArchived })); 1320 }, 1321 getById(contractId) { 1322 return requestJson(apiPaths.contracts.detail(contractId)); 1323 }, 1324 create(payload) { 1325 return requestJson(apiPaths.contracts.collection(), { 1326 method: "POST", 1327 body: JSON.stringify(payload) 1328 }); 1329 }, 1330 update(contractId, payload) { 1331 return requestJson(apiPaths.contracts.detail(contractId), { 1332 method: "PUT", 1333 body: JSON.stringify(payload) 1334 }); 1335 }, 1336 deleteIfNoParties(contractId, options = {}) { 1337 return requestStatus(apiPaths.contracts.cleanupIfNoParties(contractId), { method: "DELETE", ...options }); 1338 }, 1339 delete(contractId) { 1340 return requestStatus(apiPaths.contracts.detail(contractId), { method: "DELETE" }); 1341 }, 1342 archive(contractId, isArchived) { 1343 return requestJson(apiPaths.contracts.archive(contractId), { 1344 method: "PATCH", 1345 body: JSON.stringify({ isArchived }) 1346 }); 1347 } 1348 }, 1349 documents: { 1350 create(payload) { 1351 return requestJson(apiPaths.documents.collection(), { 1352 method: "POST", 1353 body: JSON.stringify(payload) 1354 }); 1355 }, 1356 getByContract(contractId) { 1357 return requestJson(apiPaths.documents.byContract(contractId)); 1358 }, 1359 getById(documentId) { 1360 return requestJson(apiPaths.documents.detail(documentId)); 1361 }, 1362 update(documentId, payload, options = {}) { 1363 return requestJson(apiPaths.documents.detail(documentId), { 1364 method: "PATCH", 1365 body: JSON.stringify(payload), 1366 ...options 1367 }); 1368 }, 1369 complete(documentId) { 1370 return requestJson(apiPaths.documents.complete(documentId), { 1371 method: "POST", 1372 body: JSON.stringify({}) 1373 }); 1374 }, 1375 sendForSignature(documentId) { 1376 return requestJson(apiPaths.documents.sendForSignature(documentId), { 1377 method: "POST", 1378 body: JSON.stringify({}) 1379 }); 1380 }, 1381 syncEsignature(documentId) { 1382 return requestJson(apiPaths.documents.syncEsignature(documentId), { 1383 method: "POST", 1384 body: JSON.stringify({}) 1385 }); 1386 }, 1387 embeddedSigningUrl(documentId) { 1388 return requestJson(apiPaths.documents.embeddedSigning(documentId)); 1389 }, 1390 preview(documentId) { 1391 return requestJson(apiPaths.documents.preview(documentId), { 1392 method: "POST" 1393 }); 1394 }, 1395 redlinePreview(documentId, payload) { 1396 return requestJson(apiPaths.documents.redlinePreview(documentId), { 1397 method: "POST", 1398 body: JSON.stringify(payload) 1399 }); 1400 }, 1401 send(documentId, payload) { 1402 return requestJson(apiPaths.documents.send(documentId), { 1403 method: "POST", 1404 body: JSON.stringify(payload) 1405 }); 1406 }, 1407 completeReview(documentId) { 1408 return requestJson(apiPaths.documents.completeReview(documentId), { 1409 method: "POST" 1410 }); 1411 }, 1412 toggleHold(documentId, payload) { 1413 return requestJson(apiPaths.documents.toggleHold(documentId), { 1414 method: "POST", 1415 body: JSON.stringify(payload) 1416 }); 1417 }, 1418 explicitAccept(documentId, payload) { 1419 return requestJson(apiPaths.documents.explicitAccept(documentId), { 1420 method: "POST", 1421 body: JSON.stringify(payload) 1422 }); 1423 }, 1424 markCommentThreadRead(documentId, payload) { 1425 const bodyPayload = { sectionId: payload.sectionId, read: payload.read ?? true }; 1426 if (payload.anchorKind) bodyPayload.anchorKind = payload.anchorKind; 1427 if (payload.anchorId) bodyPayload.anchorId = payload.anchorId; 1428 return requestJson(apiPaths.documents.commentThreadRead(documentId), { 1429 method: "POST", 1430 body: JSON.stringify(bodyPayload) 1431 }); 1432 }, 1433 exportPdf(documentId) { 1434 return requestRaw(apiPaths.documents.exportPdf(documentId)); 1435 }, 1436 exportExecutedPdf(documentId) { 1437 return requestRaw(apiPaths.documents.exportExecutedPdf(documentId)); 1438 }, 1439 exportDocx(documentId) { 1440 return requestRaw(apiPaths.documents.exportDocx(documentId)); 1441 }, 1442 emailPdf(documentId, payload) { 1443 return requestJson(apiPaths.documents.emailPdf(documentId), { 1444 method: "POST", 1445 body: JSON.stringify(payload) 1446 }); 1447 }, 1448 listComments(documentId, sectionId, anchor) { 1449 return requestJson(apiPaths.documents.comments(documentId, sectionId, anchor)); 1450 }, 1451 listPlaybookComments(documentId, anchorId) { 1452 return requestJson( 1453 apiPaths.documents.comments(documentId, void 0, { 1454 anchorKind: "playbookSection", 1455 anchorId 1456 }) 1457 ); 1458 }, 1459 saveComment(documentId, payload, commentId) { 1460 const path = commentId ? apiPaths.documents.commentDetail(documentId, commentId) : apiPaths.documents.comments(documentId); 1461 return requestJson(path, {
1462 method: commentId ? "PUT" : "POST", 1463 body: JSON.stringify(payload) 1464 }); 1465 }, 1466 deleteComment(documentId, commentId) { 1467 return requestJson(apiPaths.documents.commentDetail(documentId, commentId), { 1468 method: "DELETE" 1469 }); 1470 }, 1471 getRoleGrants(documentId) { 1472 return requestJson(apiPaths.documents.roleGrants(documentId)); 1473 }, 1474 updateRoleGrant(documentId, payload) { 1475 return requestJson(apiPaths.documents.roleGrants(documentId), { 1476 method: "PATCH", 1477 body: JSON.stringify(payload) 1478 }); 1479 } 1480 }, 1481 parties: { 1482 list(page, pageSize, organizationId) { 1483 return requestJson(apiPaths.parties.list({ page, pageSize, organizationId })); 1484 }, 1485 getDefault() { 1486 return requestJson(apiPaths.parties.default()); 1487 }, 1488 getById(partyId) { 1489 return requestJson(apiPaths.parties.detail(partyId)); 1490 }, 1491 create(payload) { 1492 return requestJson(apiPaths.parties.collection(), { 1493 method: "POST", 1494 body: JSON.stringify(payload) 1495 }); 1496 }, 1497 update(partyId, payload, options) { 1498 const basePath = apiPaths.parties.detail(partyId); 1499 const path = (options == null ? void 0 : options.contractId) ? `${basePath}?contractId=${encodeURIComponent(options.contractId)}` : basePath; 1500 return requestJson(path, { 1501 method: "PUT", 1502 body: JSON.stringify(payload) 1503 }); 1504 }, 1505 remove(partyId) { 1506 return requestRaw(apiPaths.parties.detail(partyId), { 1507 method: "DELETE" 1508 }); 1509 }, 1510 searchByLegalEntityName(legalEntityName, limit = 7) { 1511 return requestJson(apiPaths.parties.searchByLegalEntityName(legalEntityName, limit)); 1512 } 1513 }, 1514 partyMembers: { 1515 listByParty(partyId) { 1516 return requestJson(apiPaths.partyMembers.listByParty(partyId)); 1517 }, 1518 create(payload) { 1519 return requestJson(apiPaths.partyMembers.collection(), { 1520 method: "POST", 1521 body: JSON.stringify(payload) 1522 }); 1523 }, 1524 update(id, payload) { 1525 return requestJson(apiPaths.partyMembers.detail(id), { 1526 method: "PATCH", 1527 body: JSON.stringify(payload) 1528 }); 1529 }, 1530 remove(id) { 1531 return requestRaw(apiPaths.partyMembers.detail(id), { 1532 method: "DELETE" 1533 }); 1534 } 1535 }, 1536 content: { 1537 latestPublished(type) { 1538 return requestJson(apiPaths.content.latestPublished(type)); 1539 } 1540 }, 1541 templates: { 1542 create(payload) { 1543 return requestJson(apiPaths.templates.collection(), { 1544 method: "POST", 1545 body: JSON.stringify(payload) 1546 }); 1547 }, 1548 createBlank(payload) { 1549 return requestJson(apiPaths.templates.collection(), { 1550 method: "POST", 1551 body: JSON.stringify(payload) 1552 }); 1553 }, 1554 list(page, pageSize) { 1555 return requestJson(apiPaths.templates.list({ page, pageSize })); 1556 }, 1557 getById(templateId) { 1558 return requestJson(apiPaths.templates.detail(templateId)); 1559 }, 1560 update(templateId, payload, options = {}) { 1561 return requestJson(apiPaths.templates.detail(templateId), { 1562 method: "PUT", 1563 body: JSON.stringify(payload), 1564 ...options 1565 }); 1566 }, 1567 preview(templateId, payload) { 1568 return requestJson(apiPaths.templates.preview(templateId), { 1569 method: "POST", 1570 body: JSON.stringify(payload ?? {}) 1571 }); 1572 }, 1573 use(templateId) { 1574 return requestJson(apiPaths.templates.use(templateId), { 1575 method: "POST", 1576 body: JSON.stringify({}) 1577 }); 1578 } 1579 }, 1580 contractParties: { 1581 link(payload) { 1582 return requestJson(apiPaths.contractParties.link(), { 1583 method: "POST", 1584 body: JSON.stringify(payload) 1585 }); 1586 }, 1587 replaceForRole(payload) { 1588 return requestJson(apiPaths.contractParties.replaceForRole(), { 1589 method: "PUT", 1590 body: JSON.stringify(payload) 1591 }); 1592 } 1593 }, 1594 contentDocs: { 1595 create(payload) { 1596 return requestJson(apiPaths.contentDocs.collection(), { 1597 method: "POST", 1598 body: JSON.stringify(payload) 1599 }); 1600 }, 1601 update(contentDocId, payload, options = {}) { 1602 return requestJson(apiPaths.contentDocs.detailWithOptions(contentDocId, options), { 1603 method: "PUT", 1604 body: JSON.stringify(payload) 1605 }); 1606 }, 1607 publish(contentDocId) { 1608 return requestJson(apiPaths.contentDocs.publish(contentDocId), { 1609 method: "POST" 1610 }); 1611 }, 1612 getById(contentDocId) { 1613 return requestJson(apiPaths.contentDocs.detail(contentDocId)); 1614 }, 1615 list(type) { 1616 const query = type ? `?type=${encodeURIComponent(type)}` : ""; 1617 return requestJson(`${apiPaths.contentDocs.collection()}${query}`); 1618 }, 1619 remove(contentDocId) { 1620 return requestRaw(apiPaths.contentDocs.detail(contentDocId), { method: "DELETE" }); 1621 } 1622 }, 1623 firstUseModal: { 1624 checkSeen(pageId) { 1625 return requestJson(apiPaths.firstUseModal.detail(pageId)); 1626 }, 1627 markSeen(pageId) { 1628 return requestJson(apiPaths.firstUseModal.detail(pageId), { 1629 method: "POST" 1630 }); 1631 } 1632 }, 1633 playbookTour: { 1634 event(payload) { 1635 return requestJson(apiPaths.playbookTour.event(), { 1636 method: "POST", 1637 headers: { "Content-Type": "application/json" }, 1638 body: JSON.stringify(payload) 1639 }); 1640 } 1641 }, 1642 system: { 1643 testMongo() { 1644 return requestJson(apiPaths.system.testMongo()); 1645 } 1646 }, 1647 billing: { 1648 status() { 1649 return requestJson(apiPaths.billing.status()); 1650 }, 1651 createCheckoutSession() { 1652 return requestJson(apiPaths.billing.checkoutSession(), { method: "POST" }); 1653 }, 1654 createPortalSession() { 1655 return requestJson(apiPaths.billing.portalSession(), { method: "POST" }); 1656 } 1657 } 1658}; 1659const shouldLogDebug = () => { 1660 if (typeof window !== "undefined") { 1661 const hostname = window.location.hostname; 1662 if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1") { 1663 return true; 1664 } 1665 } 1666 return false;
1667}; 1668const isDebugEnabled = shouldLogDebug(); 1669const logger = { 1670 info: (messageOrObject) => { 1671 if (typeof messageOrObject === "string") { 1672 console.log(`[INFO] ${messageOrObject}`); 1673 } else { 1674 const { message, ...meta } = messageOrObject; 1675 console.log(`[INFO] ${message}`, Object.keys(meta).length > 0 ? meta : ""); 1676 } 1677 }, 1678 error: (messageOrObject) => { 1679 if (typeof messageOrObject === "string") { 1680 console.error(`[ERROR] ${messageOrObject}`); 1681 } else { 1682 const { message, ...meta } = messageOrObject; 1683 console.error(`[ERROR] ${message}`, Object.keys(meta).length > 0 ? meta : ""); 1684 } 1685 }, 1686 warn: (messageOrObject) => { 1687 if (typeof messageOrObject === "string") { 1688 console.warn(`[WARN] ${messageOrObject}`); 1689 } else { 1690 const { message, ...meta } = messageOrObject; 1691 console.warn(`[WARN] ${message}`, Object.keys(meta).length > 0 ? meta : ""); 1692 } 1693 }, 1694 debug: (messageOrObject) => { 1695 if (isDebugEnabled) { 1696 if (typeof messageOrObject === "string") { 1697 console.debug(`[DEBUG] ${messageOrObject}`); 1698 } else { 1699 const { message, ...meta } = messageOrObject; 1700 console.debug(`[DEBUG] ${message}`, Object.keys(meta).length > 0 ? meta : ""); 1701 } 1702 } 1703 } 1704}; 1705async function fetchCurrentUser() { 1706 try { 1707 const data = await apiClient.session.current(); 1708 const user = data.authenticated ? data.user : null; 1709 if (user) { 1710 logger.info({ 1711 "message": "AuthProvider: User authenticated:", 1712 data: { 1713 email: user.email 1714 } 1715 }); 1716 } 1717 return user; 1718 } catch (error) { 1719 if (error instanceof ApiClientError && error.status === 401) { 1720 logger.info({ 1721 "message": "AuthProvider: User not authenticated" 1722 }); 1723 return null; 1724 } 1725 logger.error({ 1726 "message": "AuthProvider: Error fetching current user", 1727 data: { 1728 error 1729 } 1730 }); 1731 return null; 1732 } 1733} 1734const AuthContext = createContext(null); 1735const AuthProvider = (props) => { 1736 const [userData, { 1737 refetch 1738 }] = createResource(fetchCurrentUser); 1739 const user = () => userData() || null; 1740 const loading = () => userData.loading; 1741 return createComponent(AuthContext.Provider, { 1742 value: { 1743 user, 1744 loading, 1745 refetch 1746 }, 1747 get children() { 1748 return props.children; 1749 } 1750 }); 1751}; 1752const useAuth = () => { 1753 const context = useContext(AuthContext); 1754 if (!context) { 1755 throw new Error("useAuth must be used within AuthProvider"); 1756 } 1757 return context; 1758}; 1759const STORAGE_KEY = "selectedOrganizationId"; 1760const OrganizationContext = createContext(null); 1761async function requestOrganizations() { 1762 const response = await fetchAPI("/api/organizations?page=1&pageSize=100"); 1763 if (!response.ok) { 1764 return []; 1765 } 1766 const payload = await response.json(); 1767 return payload.organizations || []; 1768} 1769const OrganizationProvider = (props) => { 1770 const { 1771 user 1772 } = useAuth(); 1773 const [storedOrganizationId, setStoredOrganizationId] = createSignal(null); 1774 const [selectedOrganizationId, setSelectedOrganizationIdSignal] = createSignal(null); 1775 const [organizationsResource, { 1776 refetch 1777 }] = createResource(() => { 1778 var _a, _b; 1779 return ((_a = user()) == null ? void 0 : _a.id) || ((_b = user()) == null ? void 0 : _b._id) || null; 1780 }, async (userId) => { 1781 if (!userId) return []; 1782 try { 1783 return await requestOrganizations(); 1784 } catch (error) { 1785 logger.error({ 1786 message: "OrganizationProvider fetch failed", 1787 data: { 1788 error 1789 } 1790 }); 1791 return []; 1792 } 1793 }); 1794 onMount(() => { 1795 if (typeof window === "undefined") return; 1796 const storedId = window.localStorage.getItem(STORAGE_KEY); 1797 setStoredOrganizationId(storedId); 1798 }); 1799 createEffect(() => { 1800 const organizations = organizationsResource() || []; 1801 if (organizations.length === 0) { 1802 setSelectedOrganizationIdSignal(null); 1803 return; 1804 } 1805 const storedId = storedOrganizationId(); 1806 const storedOrganization = storedId ? organizations.find((organization) => organization._id === storedId) : void 0; 1807 if (storedOrganization) { 1808 setSelectedOrganizationIdSignal(storedOrganization._id); 1809 return; 1810 } 1811 const ownerOrganization = organizations.find((organization) => organization.userRole === "owner"); 1812 setSelectedOrganizationIdSignal((ownerOrganization || organizations[0])._id); 1813 }); 1814 const selectedOrganization = createMemo(() => { 1815 const selectedId = selectedOrganizationId(); 1816 if (!selectedId) return null; 1817 return (organizationsResource() || []).find((organization) => organization._id === selectedId) || null; 1818 }); 1819 const setSelectedOrganization = (organizationId) => { 1820 setSelectedOrganizationIdSignal(organizationId); 1821 if (typeof window !== "undefined") { 1822 if (!organizationId) { 1823 window.localStorage.removeItem(STORAGE_KEY); 1824 } else { 1825 window.localStorage.setItem(STORAGE_KEY, organizationId); 1826 } 1827 } 1828 }; 1829 return createComponent(OrganizationContext.Provider, { 1830 value: { 1831 organizations: () => organizationsResource() || [], 1832 selectedOrganization, 1833 setSelectedOrganization, 1834 isLoading: () => organizationsResource.loading, 1835 refetch: () => void refetch() 1836 }, 1837 get children() { 1838 return props.children; 1839 } 1840 }); 1841}; 1842function useOrganization() { 1843 const context = useContext(OrganizationContext); 1844 if (!context) throw new Error("useOrganization must be used within OrganizationProvider"); 1845 return context; 1846}
1847const BillingContext = createContext(null); 1848const BillingProvider = (props) => { 1849 const { 1850 user 1851 } = useAuth(); 1852 const [billing, { 1853 refetch 1854 }] = createResource(() => { 1855 var _a; 1856 return (_a = user()) == null ? void 0 : _a.id; 1857 }, async (id) => { 1858 if (!id) return null; 1859 try { 1860 return await apiClient.billing.status(); 1861 } catch (e) { 1862 if (e instanceof ApiClientError && e.status === 401) return null; 1863 throw e; 1864 } 1865 }); 1866 return createComponent(BillingContext.Provider, { 1867 value: { 1868 billing: () => billing() ?? null, 1869 loading: () => billing.loading, 1870 refetch 1871 }, 1872 get children() { 1873 return props.children; 1874 } 1875 }); 1876}; 1877const useBilling = () => { 1878 const ctx = useContext(BillingContext); 1879 if (!ctx) { 1880 throw new Error("useBilling must be used within BillingProvider"); 1881 } 1882 return ctx; 1883}; 1884function buttonPropsForIntent(intent2) { 1885 switch (intent2) { 1886 case "primary": 1887 return { variant: "contained", color: "primary", size: "medium" }; 1888 case "secondary": 1889 return { variant: "outlined", color: "secondary", size: "medium" }; 1890 case "info": 1891 return { variant: "text", color: "info", size: "medium" }; 1892 case "destructive": 1893 return { variant: "contained", color: "error", size: "medium" }; 1894 case "custom": 1895 return {}; 1896 } 1897} 1898function iconButtonPropsForIntent(intent2) { 1899 switch (intent2) { 1900 case "default": 1901 return { color: "default", size: "medium" }; 1902 case "emphasized": 1903 return { color: "primary", size: "medium" }; 1904 case "destructive": 1905 return { color: "error", size: "medium" }; 1906 case "custom": 1907 return {}; 1908 } 1909} 1910function buttonGroupPropsForIntent(intent2) { 1911 switch (intent2) { 1912 case "segmented": 1913 return { variant: "outlined", color: "primary" }; 1914 case "custom": 1915 return {}; 1916 } 1917} 1918function AppButton(props) { 1919 const [local, rest] = splitProps(props, ["intent"]); 1920 const fromIntent = () => buttonPropsForIntent(local.intent ?? "primary"); 1921 return createComponent(Button, mergeProps(fromIntent, rest)); 1922} 1923const ToastContext = createContext(); 1924function useToast() { 1925 const context = useContext(ToastContext); 1926 if (!context) { 1927 throw new Error("useToast must be used within a ToastProvider"); 1928 } 1929 return context; 1930} 1931const ToastItem = (props) => { 1932 const [isOpen, setIsOpen] = createSignal(true); 1933 let timeoutId; 1934 const handleClose = () => { 1935 setIsOpen(false); 1936 setTimeout(() => { 1937 props.onClose(); 1938 }, 300); 1939 }; 1940 onMount(() => { 1941 if (props.toast.persist) return; 1942 timeoutId = window.setTimeout(() => { 1943 handleClose(); 1944 }, 1e4); 1945 }); 1946 onCleanup(() => { 1947 if (timeoutId !== void 0) { 1948 clearTimeout(timeoutId); 1949 } 1950 }); 1951 return createComponent(Box, { 1952 get sx() { 1953 return { 1954 position: "fixed", 1955 top: 16 + props.index * 80, 1956 left: "50%", 1957 transform: "translateX(-50%)", 1958 zIndex: 9999, 1959 maxWidth: "600px", 1960 width: "90%", 1961 pointerEvents: "auto" 1962 }; 1963 }, 1964 get children() { 1965 return createComponent(Slide, { 1966 direction: "down", 1967 get ["in"]() { 1968 return isOpen(); 1969 }, 1970 mountOnEnter: true, 1971 unmountOnExit: true, 1972 timeout: 300, 1973 get children() { 1974 return createComponent(Alert, { 1975 get severity() { 1976 return props.toast.severity; 1977 }, 1978 onClick: handleClose, 1979 sx: { 1980 cursor: "pointer" 1981 }, 1982 get action() { 1983 return memo(() => !!(props.toast.actionLabel && props.toast.onAction))() ? createComponent(AppButton, { 1984 color: "inherit", 1985 size: "small", 1986 onClick: (e) => { 1987 var _a, _b; 1988 e.stopPropagation(); 1989 (_b = (_a = props.toast).onAction) == null ? void 0 : _b.call(_a); 1990 }, 1991 get children() { 1992 return props.toast.actionLabel; 1993 } 1994 }) : void 0; 1995 }, 1996 get children() { 1997 return [memo(() => memo(() => !!props.toast.title)() && createComponent(AlertTitle, { 1998 get children() { 1999 return props.toast.title; 2000 } 2001 })), memo(() => props.toast.message)]; 2002 } 2003 }); 2004 } 2005 }); 2006 } 2007 }); 2008}; 2009function ToastProvider(props) { 2010 const [toasts, setToasts] = createSignal([]); 2011 const showToast = (severity, message, title, action) => { 2012 const id = Math.random().toString(36).substring(2, 9); 2013 const newToast = { 2014 id, 2015 severity, 2016 message, 2017 title, 2018 actionLabel: action == null ? void 0 : action.label, 2019 onAction: action == null ? void 0 : action.onClick, 2020 persist: action == null ? void 0 : action.persist 2021 }; 2022 setToasts((prev) => [...prev, newToast]); 2023 }; 2024 const removeToast = (id) => { 2025 setToasts((prev) => prev.filter((toast) => toast.id !== id)); 2026 }; 2027 const contextValue = { 2028 toasts, 2029 showToast, 2030 removeToast 2031 }; 2032 return createComponent(ToastContext.Provider, { 2033 value: contextValue, 2034 get children() { 2035 return [memo(() => props.children), createComponent(Show, { 2036 get when() { 2037 return toasts().length > 0; 2038 }, 2039 get children() { 2040 return createComponent(Box, { 2041 sx: { 2042 position: "fixed", 2043 top: 0, 2044 left: 0, 2045 right: 0, 2046 pointerEvents: "none", 2047 zIndex: 9999 2048 }, 2049 get children() { 2050 return createComponent(For, { 2051 get each() { 2052 return toasts(); 2053 }, 2054 children: (toast, index) => createComponent(ToastItem, { 2055 toast, 2056 get index() { 2057 return index(); 2058 }, 2059 onClose: () => removeToast(toast.id) 2060 }) 2061 }); 2062 } 2063 }); 2064 } 2065 })]; 2066 } 2067 }); 2068} 2069const scriptRel = "modulepreload"; 2070const assetsURL = function(dep) { 2071 return "/" + dep; 2072}; 2073const seen = {}; 2074const __vitePreload = function preload(baseModule, deps, importerUrl) { 2075 let promise = Promise.resolve(); 2076 if (deps && deps.length > 0) { 2077 let allSettled2 = function(promises) { 2078 return Promise.all( 2079 promises.map( 2080 (p) => Promise.resolve(p).then( 2081 (value) => ({ status: "fulfilled", value }), 2082 (reason) => ({ status: "rejected", reason }) 2083 ) 2084 ) 2085 ); 2086 }; 2087 document.getElementsByTagName("link"); 2088 const cspNonceMeta = document.querySelector( 2089 "meta[property=csp-nonce]" 2090 ); 2091 const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce")); 2092 promise = allSettled2( 2093 deps.map((dep) => { 2094 dep = assetsURL(dep); 2095 if (dep in seen) return; 2096 seen[dep] = true;
2097 const isCss = dep.endsWith(".css"); 2098 const cssSelector = isCss ? '[rel="stylesheet"]' : ""; 2099 if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) { 2100 return; 2101 } 2102 const link = document.createElement("link"); 2103 link.rel = isCss ? "stylesheet" : scriptRel; 2104 if (!isCss) { 2105 link.as = "script"; 2106 } 2107 link.crossOrigin = ""; 2108 link.href = dep; 2109 if (cspNonce) { 2110 link.setAttribute("nonce", cspNonce); 2111 } 2112 document.head.appendChild(link); 2113 if (isCss) { 2114 return new Promise((res, rej) => { 2115 link.addEventListener("load", res); 2116 link.addEventListener( 2117 "error", 2118 () => rej(new Error(`Unable to preload CSS for ${dep}`)) 2119 ); 2120 }); 2121 } 2122 }) 2123 ); 2124 } 2125 function handlePreloadError(err) { 2126 const e = new Event("vite:preloadError", { 2127 cancelable: true 2128 }); 2129 e.payload = err; 2130 window.dispatchEvent(e); 2131 if (!e.defaultPrevented) { 2132 throw err; 2133 } 2134 } 2135 return promise.then((res) => { 2136 for (const item of res || []) { 2137 if (item.status !== "rejected") continue; 2138 handlePreloadError(item.reason); 2139 } 2140 return baseModule().catch(handlePreloadError); 2141 }); 2142}; 2143function useAuthGuard(redirectTo = "/") { 2144 const { 2145 user, 2146 loading 2147 } = useAuth(); 2148 const navigate = useNavigate(); 2149 createEffect(() => { 2150 if (!loading() && !user()) { 2151 navigate(redirectTo, { 2152 replace: true 2153 }); 2154 } 2155 }); 2156 return { 2157 user, 2158 loading 2159 }; 2160} 2161function RouteLoading() { 2162 return createComponent(Box, { 2163 sx: { 2164 display: "flex", 2165 justifyContent: "center", 2166 alignItems: "center", 2167 minHeight: "100vh" 2168 }, 2169 get children() { 2170 return createComponent(CircularProgress, {}); 2171 } 2172 }); 2173} 2174function createProtectedRoute(ComponentToWrap, redirectTo = "/") { 2175 const Protected = (props) => { 2176 const { 2177 user, 2178 loading 2179 } = useAuthGuard(redirectTo); 2180 return createComponent(Show, { 2181 get when() { 2182 return memo(() => !!!loading())() && !!user(); 2183 }, 2184 get fallback() { 2185 return createComponent(RouteLoading, {}); 2186 }, 2187 get children() { 2188 return createComponent(ComponentToWrap, props); 2189 } 2190 }); 2191 }; 2192 return Protected; 2193} 2194const IndexPage = lazy(() => __vitePreload(() => import("./index-Dw6J9krp.js"), true ? __vite__mapDeps([0,1,2,3,4,5,6,7,8]) : void 0)); 2195const SignInPage = lazy(() => __vitePreload(() => import("./sign-in-DvQCZr9p.js"), true ? __vite__mapDeps([9,2,1,3,4,5,6,7,8]) : void 0)); 2196const SignUpPage = lazy(() => __vitePreload(() => import("./sign-up-CtA5UnSN.js"), true ? __vite__mapDeps([10,1,3,11,12,13,4,5,6,7,14,15]) : void 0)); 2197const ForgotPage = lazy(() => __vitePreload(() => import("./forgot-BQ2mc6Un.js"), true ? __vite__mapDeps([16,1,3,17,6,7,5]) : void 0)); 2198const GuestCheckEmailPage = lazy(() => __vitePreload(() => import("./check-email-I3klW6jQ.js"), true ? __vite__mapDeps([18,1,17,6,7,5]) : void 0)); 2199const SetPasswordPage = lazy(() => __vitePreload(() => import("./_token_-BGq6QMaA.js"), true ? __vite__mapDeps([19,1,3,17,20,4,5,6,7,8]) : void 0)); 2200const InitiatorPage = lazy(() => __vitePreload(() => import("./index-CNqiX_8c.js"), true ? __vite__mapDeps([21,22,23,1,3,24,25,26,27,28,29,30,12,13,7]) : void 0)); 2201const InitiatorPageWithId = lazy(() => __vitePreload(() => import("./_contractId_-Asqewepq.js"), true ? __vite__mapDeps([31,22,23,1,3,24,25,26,27,28,29,30,12,13,7]) : void 0)); 2202const ReceiverPage = lazy(() => __vitePreload(() => import("./_contractId_-CelnTt6R.js"), true ? __vite__mapDeps([32,22,23,1,3,24,25,26,27,28,29,30,12,13,7]) : void 0)); 2203const CreateContractFromTemplatePage = lazy(() => __vitePreload(() => import("./_templateId_-BFzWeWFA.js"), true ? __vite__mapDeps([33,1,34,3,35,26,22]) : void 0)); 2204const ContractsPageBase = lazy(() => __vitePreload(() => import("./contracts-Lo-kfNsI.js"), true ? __vite__mapDeps([36,1,37,12,30,13,22,7,11,14,38,15,29,39,34,3,35,26,5]) : void 0)); 2205const HelpPageBase = lazy(() => __vitePreload(() =>
2205 import("./help-DSjPY2uA.js"), true ? __vite__mapDeps([40,1,30,12,13,22,7,38]) : void 0)); 2206const PartiesPageBase = lazy(() => __vitePreload(() => import("./parties-BKmwi_Oz.js"), true ? __vite__mapDeps([41,1,12,30,13,22,7,26,3,24,25]) : void 0)); 2207const PartyMembersPageBase = lazy(() => __vitePreload(() => import("./_partyId_-C6Fa1Rsa.js"), true ? __vite__mapDeps([42,1,30,12,13,22,7]) : void 0)); 2208const OrganizationsPageBase = lazy(() => __vitePreload(() => import("./organizations-CIQ8U7Ub.js"), true ? __vite__mapDeps([43,12,1,30,13,22,7]) : void 0)); 2209const AccountPageBase = lazy(() => __vitePreload(() => import("./account-CaYz8VDW.js"), true ? __vite__mapDeps([44,1,12,30,13,22,7,20,3]) : void 0)); 2210const TemplatesPageBase = lazy(() => __vitePreload(() => import("./templates-myPK_U82.js"), true ? __vite__mapDeps([45,1,37,12,30,13,22,7,11,14,38,15,29,39,34,3,35,26,5]) : void 0)); 2211const PlaybookPageBase = lazy(() => __vitePreload(() => import("./_id_-DYTnX3z9.js"), true ? __vite__mapDeps([46,1,35,15,47,12,13,39,22,26,25,3,48,30,7,27,29,14,49,28]) : void 0)); 2212const TemplatePlaybookPageBase = lazy(() => __vitePreload(() => import("./_templateId_-oTejS8G-.js"), true ? __vite__mapDeps([50,1,47,12,13,35,39,22,26,25,3,48,30,7,27,29,14,49]) : void 0)); 2213const EsignatureReturnPageBase = lazy(() => __vitePreload(() => import("./esignature-return-Dm_Pdwge.js"), true ? __vite__mapDeps([51,1]) : void 0)); 2214const ContentDocsPageBase = lazy(() => __vitePreload(() => import("./content-docs-C-xi1iOb.js"), true ? __vite__mapDeps([52,1,12,13,30,22,7]) : void 0)); 2215const ContentDocEditorPageBase = lazy(() => __vitePreload(() => import("./_id_-Ct8wawTS.js"), true ? __vite__mapDeps([53,1,30,12,13,22,7,54,26,48]) : void 0)); 2216const NewContentDocPageBase = lazy(() => __vitePreload(() => import("./new-B1vOb9ss.js"), true ? __vite__mapDeps([55,1,30,12,13,22,7,54,26,48]) : void 0)); 2217const NotFoundPage = lazy(() => __vitePreload(() => import("./_...404_-Pa6Xiypr.js"), true ? __vite__mapDeps([56,1,30,12,13,22,7,5]) : void 0)); 2218const ContractsPage = createProtectedRoute(ContractsPageBase); 2219const HelpPage = createProtectedRoute(HelpPageBase); 2220const PartiesPage = createProtectedRoute(PartiesPageBase); 2221const PartyMembersPage = createProtectedRoute(PartyMembersPageBase); 2222const OrganizationsPage = createProtectedRoute(OrganizationsPageBase); 2223const AccountPage = createProtectedRoute(AccountPageBase); 2224const TemplatesPage = createProtectedRoute(TemplatesPageBase); 2225const PlaybookPage = createProtectedRoute(PlaybookPageBase); 2226const TemplatePlaybookPage = createProtectedRoute(TemplatePlaybookPageBase); 2227const EsignatureReturnPage = createProtectedRoute(EsignatureReturnPageBase); 2228const ContentDocsPage = createProtectedRoute(ContentDocsPageBase); 2229const ContentDocEditorPage = createProtectedRoute(ContentDocEditorPageBase); 2230const NewContentDocPage = createProtectedRoute(NewContentDocPageBase); 2231function AppRoutes() { 2232 return [createComponent(Route, { 2233 path: "/", 2234 component: IndexPage 2235 }), createComponent(Route, { 2236 path: "/sign-in", 2237 component: SignInPage 2238 }), createComponent(Route, { 2239 path: "/sign-up", 2240 component: SignUpPage 2241 }), createComponent(Route, { 2242 path: "/forgot", 2243 component: ForgotPage 2244 }), createComponent(Route, { 2245 path: "/guest/check-email", 2246 component: GuestCheckEmailPage 2247 }), createComponent(Route, { 2248 path: "/set-password/:token", 2249 component: SetPasswordPage 2250 }), createComponent(Route, { 2251 path: "/create-contract/initiator/:contractId", 2252 component: InitiatorPageWithId 2253 }), createComponent(Route, { 2254 path: "/create-contract/initiator", 2255 component: InitiatorPage 2256 }), createComponent(Route, { 2257 path: "/create-contract/receiver/:contractId", 2258 component: ReceiverPage 2259 }), createComponent(Route, { 2260 path: "/create-contract/from-template/:templateId", 2261 component: CreateContractFromTemplatePage 2262 }), createComponent(Route, { 2263 path: "/contracts", 2264 component: ContractsPage 2265 }), createComponent(Route, { 2266 path: "/help", 2267 component: HelpPage 2268 }), createComponent(Route, { 2269 path: "/parties", 2270 component: PartiesPage 2271 }), createComponent(Route, { 2272 path: "/party-members/:partyId", 2273 component: PartyMembersPage 2274 }), createComponent(Route, { 2275 path: "/organizations", 2276 component: OrganizationsPage 2277 }), createComponent(Route, { 2278 path: "/account", 2279 component: AccountPage 2280 }), createComponent(Route, { 2281 path: "/templates", 2282 component: TemplatesPage 2283 }), createComponent(Route, { 2284 path: "/playbook/template/:templateId", 2285 component: TemplatePlaybookPage 2286 }), createComponent(Route, { 2287 path: "/playbook/:id", 2288 component: PlaybookPage 2289 }), createComponent(Route, { 2290 path: "/esignature-return", 2291 component: EsignatureReturnPage 2292 }), createComponent(Route, { 2293 path: "/content-docs", 2294 component: ContentDocsPage 2295 }), createComponent(Route, { 2296 path: "/content-docs/new", 2297 component: NewContentDocPage 2298 }), createComponent(Route, { 2299 path: "/content-docs/:id", 2300 component: ContentDocEditorPage 2301 }), createComponent(Route, {
2302 path: "*404", 2303 component: NotFoundPage 2304 })]; 2305} 2306const roleChipColors = { 2307 initiator: "#ac9bfa", 2308 receiver: "#faaa16", 2309 //#60fb9e', //30AB6D 2310 text: "#333", 2311 contrastText: "#FFFFFF" 2312}; 2313function hexToRgba(hex, alpha) { 2314 const n = parseInt(hex.slice(1), 16); 2315 const r = n >> 16 & 255; 2316 const g = n >> 8 & 255; 2317 const b = n & 255; 2318 return `rgba(${r}, ${g}, ${b}, ${alpha})`; 2319} 2320const HIGHLIGHT_ALPHA = 0.3; 2321({ 2322 initiator: hexToRgba(roleChipColors.initiator, HIGHLIGHT_ALPHA), 2323 receiver: hexToRgba(roleChipColors.receiver, HIGHLIGHT_ALPHA) 2324}); 2325const themeOptions = { 2326 palette: { 2327 mode: "light", 2328 role: roleChipColors, 2329 primary: { 2330 main: "#2E2D51", 2331 // Legacy primary purple 2332 light: "#67659a", 2333 // --purple-light 2334 dark: "#1A1A3A", 2335 contrastText: "#FFFFFF" 2336 // --text-color 2337 }, 2338 secondary: { 2339 main: "#74A6FA", 2340 // Baby blue 2341 light: "#A8C7FF", 2342 // Lighter blue 2343 dark: "#4386F8", 2344 // Darker blue 2345 contrastText: "#FFFFFF" 2346 }, 2347 info: { 2348 main: "#9593A6", 2349 // Gray 2350 light: "#B9B7C3", 2351 // Light gray 2352 dark: "#434848", 2353 // Dark gray 2354 contrastText: "#FFFFFF" 2355 }, 2356 success: { 2357 main: "#1E7A4A", 2358 // Success green 2359 light: "#30AB6D", 2360 // Light green 2361 dark: "#01422e", 2362 // Dark green 2363 contrastText: "#FFFFFF" 2364 }, 2365 warning: { 2366 main: "#E59D29", 2367 // Orange 2368 light: "#F0B85C", 2369 // Light orange 2370 dark: "#B87A1F", 2371 // Dark orange 2372 contrastText: "#FFFFFF" 2373 }, 2374 error: { 2375 main: "#D45B3A", 2376 // Error red 2377 light: "#E88A6F", 2378 // Light red 2379 dark: "#A8462E", 2380 // Dark red 2381 contrastText: "#FFFFFF" 2382 }, 2383 grey: { 2384 50: "#F9F9F9", 2385 // Light gray background 2386 100: "#F2F2F2", 2387 // Medium gray background 2388 200: "#DCE5E7", 2389 // Gray base border 2390 300: "#B9B7C3", 2391 // Light gray 2392 400: "#9593A6", 2393 // Light text 2394 500: "#434848", 2395 // Text color 2396 600: "#2E2D51", 2397 // Primary purple 2398 700: "#1A1A3A", 2399 // Dark purple 2400 800: "#0F0F1F", 2401 // Darker purple 2402 900: "#000000" 2403 // Black 2404 }, 2405 background: { 2406 default: "#2e2d50", 2407 paper: "#ffffff" 2408 }, 2409 text: { 2410 primary: "#434848", 2411 secondary: "#9593A6", 2412 white: "#FFFFFF", 2413 grey: "#9593A6", 2414 black: "#000000" 2415 }, 2416 link: { 2417 color: "#2e2d50" 2418 }, 2419 status: { 2420 complete: "#30AB6D" 2421 }, 2422 action: { 2423 hover: "#5B349A3B", 2424 // --purple-light with opacity 2425 /** Solid fill + stronger label so disabled buttons stay visible (e.g. guest flows on dark chrome). */ 2426 disabled: "rgba(0, 0, 0, 0.5)", 2427 disabledBackground: "#DCE5E7" 2428 } 2429 }, 2430 typography: { 2431 fontFamily: '"MuseoSans", "Segoe UI", "Roboto", "SourceSansPro", "Helvetica Neue", Arial, sans-serif', 2432 // Use unified MuseoSans family with weights 2433 h1: { 2434 fontFamily: '"MuseoSans"', 2435 fontSize: "28px", 2436 lineHeight: "35px", 2437 fontWeight: 700 2438 }, 2439 h2: { 2440 fontFamily: '"MuseoSans"', 2441 fontSize: "22px", 2442 lineHeight: "29px", 2443 fontWeight: 700 2444 }, 2445 h3: { 2446 fontFamily: '"MuseoSans"', 2447 fontSize: "18px", 2448 lineHeight: "25px", 2449 fontWeight: 700 2450 }, 2451 h4: { 2452 fontFamily: '"MuseoSans"', 2453 fontSize: "15px", 2454 textTransform: "uppercase", 2455 fontWeight: 700 2456 }, 2457 body1: { 2458 fontFamily: '"MuseoSans"', 2459 fontSize: "15px", 2460 lineHeight: "22px" 2461 }, 2462 body2: { 2463 fontFamily: '"MuseoSans"', 2464 fontSize: "13px", 2465 lineHeight: "20px" 2466 }, 2467 button: { 2468 fontFamily: '"MuseoSans"', 2469 fontSize: "15px", 2470 fontWeight: 700, 2471 textTransform: "none" 2472 }, 2473 link: { 2474 color: "inherit", 2475 fontSize: "1rem", 2476 fontWeight: 300 2477 // Legacy app uses normal weight 2478 } 2479 }, 2480 spacing: { 2481 unit: 5, 2482 // 5px base unit 2483 xs: 5, 2484 // 5px 2485 sm: 10, 2486 // 10px 2487 md: 15, 2488 // 15px 2489 lg: 20, 2490 // 20px 2491 xl: 30, 2492 // 30px 2493 xxl: 40 2494 // 40px 2495 }, 2496 shape: { 2497 borderRadius: 8 2498 }, 2499 components: { 2500 /** 2501 * Button defaults align with `palette` / `typography.button` tokens (hex mirrors theme palette). 2502 * Variant classes follow SUID/MUI `MuiButton-*` naming for reliable `sx` overrides. 2503 */ 2504 MuiButton: { 2505 defaultProps: { 2506 disableElevation: true, 2507 sx: { 2508 fontFamily: '"MuseoSans"', 2509 fontWeight: 700, 2510 textTransform: "none", 2511 /** Default product button shape (playbook toolbar, modals, dense actions). */ 2512 borderRadius: "5.1rem", 2513 minHeight: 40, 2514 padding: "0.45rem 1.2rem", 2515 transition: "background-color 150ms ease, box-shadow 150ms ease, border-color 150ms ease", 2516 "&:focus-visible": { 2517 outline: "2px solid #2E2D51", 2518 outlineOffset: "2px" 2519 }, 2520 /** Rely on `palette.action.disabled*` for the muted look; avoid extra opacity (it stacks with rgba fills). */ 2521 "&.Mui-disabled": { 2522 opacity: 1 2523 }, 2524 "&.MuiButton-containedPrimary": { 2525 backgroundColor: "#2E2D51", 2526 color: "#FFFFFF", 2527 "&:hover": { 2528 backgroundColor: "#67659a" 2529 } 2530 }, 2531 "&.MuiButton-outlinedPrimary": { 2532 borderColor: "#2e2d51", 2533 color: "#67659a", 2534 "&:hover": { 2535 backgroundColor: "#2e2d51", 2536 borderColor: "#B9B7C3" 2537 } 2538 }, 2539 "&.MuiButton-textPrimary": { 2540 color: "#2E2D51", 2541 "&:hover": { 2542 backgroundColor: "#2e2d51" 2543 } 2544 }, 2545 "&.MuiButton-containedSecondary": { 2546 backgroundColor: "#FFFFFF", 2547 color: "#000000", 2548 "&:hover": { 2549 backgroundColor: "#F5F5F5"
2550 } 2551 }, 2552 "&.MuiButton-outlinedSecondary": { 2553 borderColor: "#DCE5E7", 2554 color: "#000000", 2555 "&:hover": { 2556 backgroundColor: "#F5F5F5", 2557 borderColor: "#DCE5E7" 2558 } 2559 }, 2560 "&.MuiButton-textSecondary": { 2561 color: "#000000", 2562 "&:hover": { 2563 backgroundColor: "#F5F5F5" 2564 } 2565 }, 2566 "&.MuiButton-containedInfo": { 2567 backgroundColor: "#9593A6", 2568 color: "#FFFFFF", 2569 "&:hover": { 2570 backgroundColor: "#B9B7C3" 2571 } 2572 }, 2573 "&.MuiButton-outlinedInfo": { 2574 borderColor: "#9593A6", 2575 color: "#9593A6", 2576 "&:hover": { 2577 backgroundColor: "rgba(149, 147, 166, 0.08)" 2578 } 2579 }, 2580 "&.MuiButton-textInfo": { 2581 color: "#9593A6", 2582 "&:hover": { 2583 backgroundColor: "rgba(149, 147, 166, 0.08)" 2584 } 2585 }, 2586 "&.MuiButton-containedError": { 2587 backgroundColor: "#D45B3A", 2588 color: "#FFFFFF", 2589 "&:hover": { 2590 backgroundColor: "#A8462E" 2591 } 2592 }, 2593 "&.MuiButton-outlinedError": { 2594 borderColor: "#D45B3A", 2595 color: "#D45B3A", 2596 "&:hover": { 2597 backgroundColor: "rgba(212, 91, 58, 0.08)" 2598 } 2599 }, 2600 "&.MuiButton-textError": { 2601 color: "#D45B3A", 2602 "&:hover": { 2603 backgroundColor: "rgba(212, 91, 58, 0.08)" 2604 } 2605 } 2606 } 2607 } 2608 }, 2609 MuiButtonGroup: { 2610 defaultProps: { 2611 disableElevation: true, 2612 variant: "outlined", 2613 color: "primary" 2614 } 2615 }, 2616 MuiTextField: { 2617 defaultProps: { 2618 variant: "outlined", 2619 sx: { 2620 root: { 2621 "& .MuiOutlinedInput-root": { 2622 backgroundColor: "#ffffff !important", 2623 color: "#000000 !important", 2624 borderRadius: "5px", 2625 "& fieldset": { 2626 borderColor: "#DCE5E7" 2627 }, 2628 "&:hover fieldset": { 2629 borderColor: "#B9B7C3" 2630 }, 2631 "&.Mui-focused fieldset": { 2632 borderColor: "#B9B7C3" 2633 } 2634 } 2635 } 2636 } 2637 } 2638 }, 2639 MuiTextFieldEx: { 2640 defaultProps: { 2641 fullWidth: true, 2642 variant: "outlined", 2643 sx: { 2644 "& .MuiOutlinedInput-root": { 2645 backgroundColor: "#616080 !important", 2646 color: "#ffffff !important", 2647 "& fieldset": { 2648 border: "none !important" 2649 }, 2650 "&:hover fieldset": { 2651 border: "none !important" 2652 }, 2653 "&.Mui-focused fieldset": { 2654 border: "none !important" 2655 } 2656 } 2657 } 2658 } 2659 }, 2660 MuiOutlinedInput: { 2661 styleOverrides: { 2662 root: { 2663 backgroundColor: "#616080 !important", 2664 color: "#ffffff !important", 2665 "& fieldset": { 2666 border: "none !important" 2667 }, 2668 "&:hover fieldset": { 2669 border: "none !important" 2670 }, 2671 "&.Mui-focused fieldset": { 2672 border: "none !important" 2673 } 2674 }, 2675 notchedOutline: { 2676 border: "none !important" 2677 }, 2678 input: { 2679 padding: "10px", 2680 fontSize: "15px", 2681 color: "#ffffff !important", 2682 backgroundColor: "transparent !important" 2683 } 2684 } 2685 }, 2686 MuiInputBase: { 2687 styleOverrides: { 2688 input: { 2689 color: "#ffffff", 2690 "::placeholder": { 2691 color: "rgba(255,255,255,0.7)", 2692 opacity: 1 2693 } 2694 } 2695 } 2696 }, 2697 MuiFormLabel: { 2698 styleOverrides: { 2699 root: { 2700 color: "rgba(255,255,255,0.9)", 2701 "&.Mui-focused": { 2702 color: "rgba(255,255,255,0.9)" 2703 }, 2704 "&.Mui-disabled": { 2705 color: "rgba(255,255,255,0.6)" 2706 } 2707 } 2708 } 2709 }, 2710 MuiTableCell: { 2711 defaultProps: { 2712 padding: "0.1rem", 2713 sx: { 2714 color: "#000000", 2715 fontSize: ".75rem", 2716 lineHeight: 1 2717 } 2718 } 2719 }, 2720 MuiTableHead: { 2721 defaultProps: { 2722 sx: { 2723 "& .MuiTableCell-root": { 2724 color: "#000000", 2725 fontSize: ".75rem", 2726 lineHeight: 1, 2727 fontWeight: 700 2728 } 2729 } 2730 } 2731 }, 2732 MuiTableBody: { 2733 defaultProps: { 2734 sx: { 2735 "& .MuiTableCell-root": { 2736 color: "#000000", 2737 fontSize: ".75rem", 2738 lineHeight: 1 2739 }, 2740 "& .MuiTableRow-root:nth-of-type(even)": { 2741 backgroundColor: "#f5f5f5" 2742 }, 2743 "& .MuiTableRow-root:hover": { 2744 backgroundColor: "#eeeeee" 2745 } 2746 } 2747 } 2748 }, 2749 MuiTableRow: { 2750 root: { 2751 "&:nth-child(odd)": { 2752 backgroundColor: "#f9f9f9" 2753 }, 2754 "&:nth-child(even)": { 2755 backgroundColor: "#FFF" 2756 }, 2757 "&:hover": { 2758 backgroundColor: "#f3fbf6" 2759 } 2760 } 2761 }, 2762 MuiIconButton: { 2763 defaultProps: { 2764 sx: { 2765 color: "#434848", 2766 "&:hover": { 2767 backgroundColor: "rgba(46, 45, 81, 0.08)" 2768 }, 2769 "&:focus-visible": { 2770 outline: "2px solid #2E2D51", 2771 outlineOffset: "2px" 2772 }, 2773 "&.Mui-disabled": { 2774 color: "rgba(0, 0, 0, 0.26)" 2775 }, 2776 "&.MuiIconButton-colorPrimary": { 2777 color: "#2E2D51", 2778 "&:hover": { 2779 backgroundColor: "rgba(46, 45, 81, 0.12)" 2780 } 2781 }, 2782 "&.MuiIconButton-colorError": { 2783 color: "#D45B3A", 2784 "&:hover": { 2785 backgroundColor: "rgba(212, 91, 58, 0.12)" 2786 } 2787 } 2788 } 2789 } 2790 }, 2791 MuiLink: { 2792 defaultProps: { 2793 sx: { 2794 color: "#74A6FA !important", 2795 // $primary-link-color (baby-blue) 2796 textDecoration: "none !important", 2797 transition: "color 0.2s ease", 2798 "&:hover": { 2799 color: "#5A8FE8 !important", 2800 // darken($baby-blue, 10%) - $primary-link-hover 2801 textDecoration: "none !important" 2802 }, 2803 "&:active, &:focus": { 2804 color: "#5A8FE8 !important" 2805 } 2806 } 2807 } 2808 }, 2809 MuiModal: { 2810 root: { 2811 "& .MuiBackdrop-root": { 2812 backgroundColor: "rgba(0, 0, 0, 0.5)" 2813 } 2814 } 2815 }, 2816 MuiPopover: { 2817 defaultProps: { 2818 sx: { 2819 pointerEvents: "none", 2820 "& .MuiPopover-paper": { 2821 backgroundColor: "#FFFFFF", 2822 // theme primary.main 2823 color: "#000000", 2824 // theme primary.contrastText 2825 fontSize: "13px", 2826 // theme typography.body2.fontSize 2827 fontFamily: '"MuseoSans"', 2828 // theme typography.fontFamily 2829 lineHeight: "20px", 2830 // theme typography.body2.lineHeight 2831 maxWidth: "250px", 2832 padding: "8px 12px", 2833 borderRadius: "4px", 2834 boxShadow: "0 4px 8px rgba(0,0,0,0.2)" 2835 } 2836 } 2837 } 2838 } 2839 } 2840}; 2841const theme = createTheme(themeOptions); 2842const darkThemeOptions = { 2843 ...themeOptions, 2844 palette: {
2845 mode: "dark", 2846 primary: { 2847 main: "#664b90", 2848 // --purple-light for dark mode 2849 light: "#8a6bb8", 2850 dark: "#2e2d50", 2851 // --purple for dark mode 2852 contrastText: "#f3f3f5" 2853 // --text-color 2854 }, 2855 secondary: { 2856 main: "#f48fb1", 2857 light: "#f8bbd9", 2858 dark: "#ec407a", 2859 contrastText: "#000000" 2860 }, 2861 background: { 2862 default: "#f9f9f9", 2863 paper: "#2e2d50" 2864 // --purple for paper 2865 }, 2866 text: { 2867 primary: "#f3f3f5", 2868 // --text-color 2869 secondary: "#93bafd" 2870 // Link color 2871 }, 2872 action: { 2873 hover: "rgba(102, 75, 144, 0.2)" 2874 } 2875 } 2876}; 2877createTheme(darkThemeOptions); 2878const LoadingFallback = () => createComponent(Box, { 2879 sx: { 2880 display: "flex", 2881 justifyContent: "center", 2882 alignItems: "center", 2883 minHeight: "100vh" 2884 }, 2885 get children() { 2886 return createComponent(CircularProgress, {}); 2887 } 2888}); 2889function App() { 2890 return createComponent(Router, { 2891 root: (props) => createComponent(MetaProvider, { 2892 get children() { 2893 return createComponent(ThemeProvider, { 2894 theme, 2895 get children() { 2896 return [createComponent(CssBaseline, {}), createComponent(AuthProvider, { 2897 get children() { 2898 return createComponent(BillingProvider, { 2899 get children() { 2900 return createComponent(OrganizationProvider, { 2901 get children() { 2902 return createComponent(ToastProvider, { 2903 get children() { 2904 return createComponent(Suspense, { 2905 get fallback() { 2906 return createComponent(LoadingFallback, {}); 2907 }, 2908 get children() { 2909 return props.children; 2910 } 2911 }); 2912 } 2913 }); 2914 } 2915 }); 2916 } 2917 }); 2918 } 2919 })]; 2920 } 2921 }); 2922 } 2923 }), 2924 get children() { 2925 return createComponent(AppRoutes, {}); 2926 } 2927 }); 2928} 2929render(() => createComponent(App, {}), document.getElementById("root")); 2930export { 2931 AppButton as A, 2932 RouteLoading as R, 2933 Title as T, 2934 useNavigate as a, 2935 useSearchParams as b, 2936 useToast as c, 2937 apiClient as d, 2938 ApiClientError as e, 2939 useParams as f, 2940 useLocation as g, 2941 useOrganization as h, 2942 fetchAPI as i, 2943 useBilling as j, 2944 fetchAPIDelete as k, 2945 logger as l, 2946 fetchAPIPost as m, 2947 fetchAPIPut as n, 2948 isPaywallError as o, 2949 buttonGroupPropsForIntent as p, 2950 useResolvedPath as q, 2951 roleChipColors as r, 2952 useHref as s, 2953 themeOptions as t, 2954 useAuth as u, 2955 normalizePath as v, 2956 iconButtonPropsForIntent as w 2957};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.