PageSourceSearch

https://app.idrivesafely.com/assets/index-Bm6QmGK1.js

js idrivesafely.com collected 2026-09-24 18:01:27 UTC 5,428 bytes, 2 lines download raw bytes

1import{t as y,v as b,w as x,a2 as v,au as w,D as d,z as g,ag as f,x as j,G as t,av as P,U as m,a9 as E,aw as k,ax as B,ay as S,az as C,aA as O,T as u}from"./index-LrH-sEEU.js";import{u as L}from"./useComponentLog-Cgv22-r1.js";import{A as T,a as I,b as R}from"./index-BPhddQiO.js";import"./index-CX1lWa68.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"[email protected]"};var s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="8afa87dd-e870-4a76-9dfb-11a495d9c902",e._sentryDebugIdIdentifier="sentry-dbid-8afa87dd-e870-4a76-9dfb-11a495d9c902")}catch{}})();const N=(e,s)=>{const o={queryKey:s};for(const r of Object.keys(e))r!=="queryKey"&&Object.defineProperty(o,r,{enumerable:!0,configurable:!0,get:()=>e[r]});return o},q=e=>{const s=new URLSearchParams;Object.entries(e||{}).forEach(([r,a])=>{a!==void 0&&s.append(r,a===null?"null":String(a))});const o=s.toString();return o.length>0?`/progress-bookmark?${o}`:"/progress-bookmark"},_=async(e,s)=>x(q(e),{...s,method:"GET"}),h=e=>["/progress-bookmark",...e?[e]:[]],z=(e,s)=>{const{query:o,request:r}=s??{},a=o?.queryKey??h(e);return b({queryKey:a,queryFn:({signal:i})=>_(e,{signal:i,...r}),...o})};function A(e,s,o){const r=z(e,s),a=y(r,o);return N(a,r.queryKey)}const p={levelList:[],bookmark:null,bookmarkCount:0,bookmarkLimit:300,redirectedFromBookmarks:!1},K=e=>({progressId:e}),G=e=>{const s=e.data;if(typeof s!="object"||s===null)return{...p};const o=s,r=o.progressBookmarkList??o;return{...p,...r,levelList:r.levelList??[]}},M=e=>A(K(e),{query:{enabled:!!e,select:G}}),[D]=h(),F=()=>{const e=v();return w({mutation:{onSuccess:()=>e.invalidateQueries({predicate:s=>s.queryKey.includes(D)})}})},Q=(e,s)=>{d.useEffect(()=>{if(!e)return;const o=()=>{s()};return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",o,{capture:!0})}},[e,s])},U=e=>d.createElement("svg",{width:30,height:24,xmlns:"http://www.w3.org/2000/svg",...e},d.createElement("path",{d:"M18 16a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm0-6a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm0-6a2 2 0 1 1 0 4 2 2 0 0 1 0-4z",fill:"currentColor",fillRule:"evenodd"})),$=({subBookmark:e,chapterCacheKey:s,onBookmarkRemove:o})=>{const r=g(f),a=j(),[l,n]=d.useState(!1);Q(l,()=>{n(!1)});const i=()=>{s&&B({progressId:r,chapterCacheKey:s,nodeId:e.nodeId}).then(c=>{a({type:S,payload:{redirectedFromBookmarks:!0}}),a({type:C,payload:{result:c}})}).catch(()=>{console.error("unable to review bookmark")})};return t.jsxs("li",{className:"flex min-h-16 w-full items-center justify-between gap-3 rounded-lg bg-background-secondary py-2 pr-2 pl-4","data-test":"bookmarkCard",children:[t.jsxs("button",{type:"button",onClick:i,"aria-label":`Go to bookmark content: ${e.nodeTitle}`,"data-test":"goToBookmarkContent",className:"flex min-w-0 flex-1 cursor-pointer items-center gap-4 roun
1ded-md border-none bg-transparent p-0 text-left focus-visible:shadow-focus-subtle focus-visible:outline-none",children:[t.jsx(P,{className:"size-6 shrink-0 text-content-regular","aria-hidden":"true"}),t.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[t.jsx(m,{as:"span",variant:"paragraph-medium",weight:"semibold",className:"break-words",children:e.nodeTitle}),e.nodeType==="PAGE"&&t.jsxs(m,{as:"span",variant:"paragraph-small",className:"text-content-subtle",children:["Page ",e.nodeIdx+1]})]})]}),t.jsxs(T,{open:l,onOpenChange:n,children:[t.jsx(I,{asChild:!0,children:t.jsx(E,{type:"button",variant:"text-secondary",size:"icon","aria-label":`Bookmark options for ${e.nodeTitle}`,"aria-expanded":l,"data-test":"bookmarkIconEllipsis",children:t.jsx(U,{className:"size-6","aria-hidden":"true"})})}),t.jsx(R,{align:"end",sideOffset:6,className:"w-48 gap-0 overflow-hidden rounded-lg bg-background-primary p-0 focus:outline-none",children:t.jsxs("ul",{className:"w-full","data-test":"subMenu",children:[t.jsx(k,{"data-test":"goToPage",onClick:()=>{n(!1),i()},children:"Go to page"}),t.jsx(k,{"data-test":"removeBookmark",onClick:()=>{n(!1),o(s,e.nodeId)},children:"Remove bookmark"})]})})]})]})},J=()=>{L("Bookmarks");const e=g(f),{data:s,isError:o,isLoading:r}=M(e),a=F(),l=async(n,i)=>{try{await a.mutateAsync({data:{progressId:e,chapterCacheKey:n,currentNodeId:i,isActive:!1}})}catch(c){console.error("error",c)}};return r?t.jsx(O,{isLoading:!0,centered:!0}):t.jsx("div",{className:"grit screen bookmarks",children:t.jsxs("main",{className:"mx-auto flex w-full max-w-[45rem] flex-col items-stretch px-4 py-8 tablet:p-12","data-test":"bookmarksMain",children:[t.jsx("header",{className:"mb-8","data-test":"bookmarksPageTitle",children:t.jsx(u,{as:"h1",size:"xxxlarge",children:"Bookmarks"})}),s&&s.levelList.length>0&&!o?s.levelList.map(n=>t.jsxs("div",{children:[t.jsx(u,{as:"h2",size:"xxlarge","data-test":"bookmarksLevelTitle",children:n.title}),n.chapterList.map(i=>t.jsxs("div",{className:"pt-4 pb-6",children:[t.jsx(u,{as:"h3",size:"large","data-test":"bookmarksChapterTitle",children:i.title}),t.jsx("ul",{className:"flex flex-col gap-3 pt-4 pb-6",children:i.subBookmarkList.map(c=>t.jsx($,{chapterCacheKey:i.chapterCacheKey,subBookmark:c,onBookmarkRemove:l},c._id))})]},i.chapterCacheKey))]},n.title)):t.jsx(m,{children:"Pages that you bookmark in your course will show up here."})]})})};export{J as default};
2//# sourceMappingURL=index-Bm6QmGK1.js.map

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.