PageSourceSearch

https://assets.commonlit.org/builds/assets/TextRecommendations-Bto_FKr0.js

js commonlit.org collected 2026-09-24 09:01:01 UTC 4,340 bytes, 1 lines download raw bytes

1var f=(t,s,i)=>new Promise((l,r)=>{var n=o=>{try{p(i.next(o))}catch(h){r(h)}},a=o=>{try{p(i.throw(o))}catch(h){r(h)}},p=o=>o.done?l(o.value):Promise.resolve(o.value).then(n,a);p((i=i.apply(t,s)).next())});import{j as e}from"./reactHelper-CTR3Ab_y.js";import{b as c}from"./react-aria-UQ5A--8d.js";import{a7 as b}from"./index-6p9cik3L.js";import{t as L}from"./toArray-iycmm9hf.js";import{i as _}from"./isArrayLike-BmwVxSWA.js";import{t as j,d as v}from"./definePathHelper-BDhmnoXI.js";import{C as u}from"./CLLink-D02kPQqz.js";import{G as w}from"./GenreLabel-CpMIUI-d.js";import{G as I}from"./GradeLevelLabel-BceTXyK7.js";import{C as y}from"./CLLabel-BSf6EPpD.js";import{U as R,A as d}from"./UserActivityLog-BUV6qFyt.js";import{a as k}from"./ajax-_xqGaJaW.js";import{T as x}from"./TextsRoutes-BgADOq4O.js";import{p as g}from"./domPurify-BgfGFtYJ.js";(function(){try{var t=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="96d6715e-92fd-413a-871c-d8d3d14737c5",t._sentryDebugIdIdentifier="sentry-dbid-96d6715e-92fd-413a-871c-d8d3d14737c5")}catch(i){}})();function T(t,s){return t.slice(0,s)}function E(t,s=1,i){return s=s===void 0?1:j(s),s<1||!_(t)?[]:T(L(t),s)}const N=({lexile:t})=>t===0?e.jsx(y,{text:I18n.t("non_prose"),color:"purple"}):t?e.jsx(y,{text:`${t}L`,color:"purple"}):null,$=c.memo(N),A=({activityType:t,children:s,note:i,textId:l})=>{const r=c.useRef(null);return c.useEffect(()=>{const n=()=>{R.create({activityType:t,note:i,textId:l})},a=r.current;return a==null||a.addEventListener("click",n),()=>{a==null||a.removeEventListener("click",n)}},[t,i,l]),s(r)},m=c.memo(A),C={show:v("get","/api/v1/teachers/text_recommendations/:text_id")};class S{static getForText(s){return f(this,null,function*(){try{return(yield k.getGeneric(C.show.path({text_id:s.id}))).data}catch(i){return}})}}const G="https://www.commonlit.org/blog/new-research-shows-accelerated-reading-comprehe
1nsion-gains-with-commonlit/",H=({text:t})=>{const[s,i]=c.useState([]);c.useEffect(()=>{f(null,null,function*(){const n=yield S.getForText(t);n&&i(n)})},[t]);const l=()=>s.length>3?e.jsx(m,{activityType:d.VisitedViewMoreRecommendationsLink,textId:t.id,children:r=>e.jsx(u,{href:x.pairedTexts.path({slug:t.slug}),linkRef:r,variation:"primary-btn",children:I18n.t("view_more_recommendations")})}):e.jsx(m,{activityType:d.VisitedSupplementalRecsBrowseTheLibraryLink,textId:t.id,children:r=>e.jsx(u,{href:x.index.path(),linkRef:r,variation:"primary-btn",children:I18n.t("browse_the_library")})});return e.jsxs("div",{className:"text-recommendations",children:[e.jsxs("p",{className:"effectiveness-blurb",children:[e.jsx("span",{children:`${I18n.t("students_who_complete")} `}),e.jsx(m,{activityType:d.VisitedResearchLink,textId:t.id,children:r=>e.jsx(u,{ariaLabel:`${I18n.t("read_the_research")} ${I18n.t("opens_in_new_tab")}`,href:G,newTab:!0,linkRef:r,iconEnd:b,children:I18n.t("read_the_research")})})]}),!!s.length&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"recommended-texts-label",dangerouslySetInnerHTML:{__html:g.sanitize(I18n.t("recommended_texts",{title:t.formattedTitle}))}}),e.jsx("ul",{className:"recommendations-list",children:E(s,3).map(r=>e.jsx("li",{className:"recommended-text",children:e.jsx(m,{activityType:d.VisitedRecommendedText,textId:r.id,children:n=>e.jsxs("a",{"aria-labelledby":`text-title-${r.id}`,"data-test":"recommended-text",href:x.show.path({slug:r.slug}),rel:"noreferrer nofollow",ref:n,target:"_blank",children:[e.jsx("img",{alt:"",src:r.imageUrl}),e.jsxs("div",{className:"recommended-text-body",children:[e.jsx("h4",{className:"recommended-text-title",id:`text-title-${r.id}`,dangerouslySetInnerHTML:{__html:g.sanitize(r.formattedTitle)}}),e.jsx("p",{className:"recommended-text-author mb-2.5",children:r.author}),e.jsx("p",{className:"pairing-summary mb-2.5",children:e.jsx("span",{dangerouslySetInnerHTML:{__html:g.sanitize(r.description)}})}),e.jsxs("div",{className:"content-card-labels",children:[e.jsx(I,{gradeLevel:`${r.gradeLevel} ${I18n.t("grade")}`}),!!r.genre&&e.jsx(w,{genre:r.genre}),e.jsx($,{lexile:r.lexile})]})]})]})})},r.id))})]}),e.jsx("div",{className:"view-more-link",children:l()})]})},Y=c.memo(H);export{Y as T};

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.