1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9964],{44887:(e,t,r)=>{r.d(t,{R:()=>u});var n=r(14232),o=r(5720),a=r(5646),i=r(2553),s=a.Ay.button.withConfig({componentId:"sc-4meq4x-0"})(function(e){var t=e.theme;return(0,a.AH)(["position:fixed;bottom:",";right:",";z-index:",";transform:rotate(90deg);background-color:",";border:0;border-radius:",";box-shadow:"," "," "," rgba(0,0,0,0.2);padding:",";cursor:pointer;&:hover{background-color:",";}"],t.sz.s10,t.sz.s4,t.zi.modal,t.co.neutral99,t.bo.round,t.sz.s0,t.sz.s05,t.sz.s2,t.sz.s3,t.co.neutral98)}),d=(0,a.Ay)(i.A).withConfig({componentId:"sc-4meq4x-1"})(function(e){var t=e.theme;return(0,a.AH)(["font-size:",";"],t.sz.s6)}),c=r(37876),l=(0,o.YK)({backToTop:{id:"back_to_top",defaultMessage:"Back to top"}}),u=function(){var e=(0,o.tz)().formatMessage(l.backToTop),t=(0,n.useCallback)(function(){(document.querySelector(".reactModalContent")||window).scrollTo({top:0,behavior:"smooth"})},[]);return(0,c.jsx)(s,{"aria-label":e,title:e,onClick:t,"data-testid":"back-to-top",children:(0,c.jsx)(d,{name:"backwards"})})}},69964:(e,t,r)=>{r.d(t,{i2:()=>eS,k_:()=>eH,Ay:()=>eO});var n,o,a,i=r(42969),s=r(63857),d=r(60180),c=r.n(d),l=r(14232),u=r(5720),p=r(85499),g=r(90316),m=r(44887),f=r(61542),h=r(33772),w=r(5646),b=w.Ay.div.withConfig({componentId:"sc-7xjll4-0"})(function(e){var t=e.theme;return(0,w.AH)(["position:fixed;bottom:0;left:0;right:0;background:",";border-top:"," solid ",";box-shadow:0 -4px 8px rgba(0,0,0,0.1);z-index:1000;padding:"," ",";"],t.co.neutral99,t.bo.thinWidth,t.co.neutral90,t.sz.s3,t.sz.s4)}),y=w.Ay.div.withConfig({componentId:"sc-7xjll4-1"})(function(e){var t=e.theme;return(0,w.AH)(["display:flex;align-items:center;justify-content:space-between;max-width:1200px;margin:0 auto;gap:",";@media (max-width:","){flex-direction:column;gap:",";}"],t.sz.s3,t.sz.md,t.sz.s2)}),x=w.Ay.div.withConfig({componentId:"sc-7xjll4-2"})(function(e){var t=e.theme;return(0,w.AH)(["",";color:",";font-weight:",";"],t.typography.paragraph.base,t.co.neutral30,t.DEPRECATED_ty.mediumWeight)}),v=w.Ay.div.withConfig({componentId:"sc-7xjll4-3"})(function(e){var t=e.theme;return(0,w.AH)(["display:flex;gap:",";align-items:center;"],t.sz.s2)}),_=r(37876),k=(0,u.YK)({selected:{id:"dashboard_tooltip_filter_title"},markAsKnown:{id:"scenarioDetails_markWordAsKnown"},unmarkAsKnown:{id:"scenarioDetails_unmarkWordAsKnown"},cancel:{id:"communicate_report_modal_cancel"}}),A=function(e){var t=e.selectedCount,r=e.sectionType,n=e.onMarkAsKnown,o=e.onUnmarkAsKnown,a=e.onCancel,i=(0,u.tz)();return 0===t?null:(0,_.jsx)(b,{children:(0,_.jsxs)(y,{children:[(0,_.jsxs)(x,{children:[i.formatMessage(k.selected)," - ",t]}),(0,_.jsxs)(v,{children:["toLearn"===r&&(0,_.jsx)(f.$n,{buttonType:"primary",buttonSize:"small",onClick:n,"data-testid":"bulk-mark-as-known",children:i.formatMessage(k.markAsKnown)}),"learned"===r&&(0,_.jsx)(f.$n,{buttonType:"primary",buttonSize:"small",onClick:o,"data-testid":"bulk-unmark-as-known",children:i.formatMessage(k.unmarkAsKnown)}),(0,_.jsx)(f.$n,{buttonType:"secondary",buttonSize:"small",onClick:a,"data-testid":"bulk-cancel",children:i.formatMessage(k.cancel)})]})]})})},z=r(89099),C=r(99634),I=r(4285),j=r(53403),T=r(68567),M=r(62296),L=r(74359),P=r(19596),S=r(26900),W=r(53590),H=r(48278),O=r(63521),q=r(50433),B=r(80654),K=r(8447),E=(n=(0,s.A)(c().mark(function e(t){var r,n,o,a,i;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.languagePairId,n=t.wordIds,o=t.onSuccess,a=t.onError,e.prev=1,i=n.map(function(e){return{learnable_key:e,known:!0}}),e.next=5,K.Y.updateLearnables(r,{learnables:i});case 5:null==o||o(),e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(1),null==a||a(e.t0),e.t0;case 12:case"end":return e.stop()}},e,null,[[1,8]])})),function(e){return n.apply(this,arguments)}),D=(o=(0,s.A)(c().mark(function e(t){var r,n,o,a,i;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.languagePairId,n=t.wordIds,o=t.onSuccess,a=t.onError,e.prev=1,i=n.map(function(e){return{learnable_key:e,known:!1,reset_growth_level:!0}}),e.next=5,K.Y.updateLearnables(r,{learnables:i});case 5:null==o||o(),e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(1),null==a||a(e.t0),e.t0;case 12:case"end":return e.stop()}},e,null,[[1,8]])})),function(e){return o.apply(this,arguments)}),U=r(73933),R=r(2553),$=r(83199),N=(a=(0,s.A)(c().mark(function e(t){var r;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new $.D("URL to share is required");case 2:if(!(null!=(r=window.AndroidJsInterface)&&r.shareURL)){e.
1next=5;break}return window.AndroidJsInterface.shareURL(t),e.abrupt("return","shared");case 5:if(!("u">typeof navigator&&navigator.share)){e.next=18;break}return e.prev=6,e.next=9,navigator.share({url:t});case 9:return e.abrupt("return","shared");case 12:if(e.prev=12,e.t0=e.catch(6),!(e.t0 instanceof DOMException&&"AbortError"===e.t0.name)){e.next=16;break}return e.abrupt("return","cancelled");case 16:if(e.t0 instanceof DOMException&&("NotAllowedError"===e.t0.name||"InvalidStateError"===e.t0.name)){e.next=18;break}throw e.t0;case 18:if(!("u">typeof navigator&&navigator.clipboard)){e.next=22;break}return e.next=21,navigator.clipboard.writeText(t);case 21:return e.abrupt("return","copied");case 22:throw new $.D("No sharing method available");case 23:case"end":return e.stop()}},e,null,[[6,12]])})),function(e){return a.apply(this,arguments)}),F=r(43526),Y=r(25022),V=r(15644),G=w.Ay.div.withConfig({componentId:"sc-c9xyra-0"})(function(e){var t=e.theme;return(0,w.AH)(["min-height:",";background-color:",";border-radius:",";display:flex;flex-direction:column;justify-content:flex-end;gap:",";position:relative;overflow:hidden;@media (max-width:","){border-radius:0;}"],t.sz.s48,t.co.neutral95,t.bo.medium,t.sz.s2,t.sz.m)}),J=w.Ay.img.withConfig({componentId:"sc-c9xyra-1"})(function(){return(0,w.AH)(["position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;z-index:0;pointer-events:none;"])}),Q=w.Ay.div.attrs(V.ft).withConfig({componentId:"sc-c9xyra-2"})(function(e){var t=e.theme,r=e.$noOverlay;return(0,w.AH)(["position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;justify-content:flex-end;gap:",";padding:"," ",";",""],t.sz.s2,t.sz.s2,t.sz.s4,!r&&(0,w.AH)(["&::before{content:'';position:absolute;inset:0;background:linear-gradient(0deg,rgba(0,0,0,0.5) 0%,rgba(0,0,0,0.5) 100%);z-index:-1;}"]))}),X=w.Ay.div.withConfig({componentId:"sc-c9xyra-3"})(function(e){var t=e.theme;return(0,w.AH)(["",";background:",";color:",";border-radius:",";padding:"," ",";"],t.typography.button.s,t.co.primary20,t.co.secondary0,t.bo.small,t.sz.s1,t.sz.s2)}),Z=w.Ay.div.withConfig({componentId:"sc-c9xyra-4"})(function(e){var t=e.theme;return(0,w.AH)(["",";background:",";color:",";border-radius:",";padding:"," ",";display:flex;align-items:flex-start;gap:",";svg{width:",";height:",";}path{fill:",";}"],t.typography.button.s,t.co.primary20,t.co.secondary20,t.bo.small,t.sz.s1,t.sz.s2,t.sz.s1,t.sz.s6,t.sz.s6,t.co.secondary20)}),ee=w.Ay.div.withConfig({componentId:"sc-c9xyra-5"})(function(e){var t=e.theme;return(0,w.AH)(["",";color:",";background:",";padding:"," ",";border-radius:",";"],t.typography.paragraph.m,t.co.secondary20,t.co.secondary90,t.sz.s1,t.sz.s2,t.bo.small)}),et=w.Ay.div.withConfig({componentId:"sc-c9xyra-6"})(function(e){var t=e.theme;return(0,w.AH)(["display:flex;flex-wrap:wrap;gap:",";margin-bottom:",";"],t.sz.s2,t.sz.s2)}),er=w.Ay.div.withConfig({componentId:"sc-c9xyra-7"})(function(e){var t=e.theme;return(0,w.AH)(["background:",";color:",";padding:"," ",";border-radius:",";display:flex;align-items:center;gap:",";",";svg{width:",";height:",";}"],t.co.secondary40,t.co.neutral99,t.sz.s1,t.sz.s2,t.bo.small,t.sz.s1,t.typography.button.s,t.sz.s6,t.sz.s6)}),en=w.Ay.h1.withConfig({componentId:"sc-c9xyra-8"})(function(e){var t=e.theme;return(0,w.AH)(["color:",";",";margin:0;"],t.co.neutral99,t.typography.heading.desktop.m)}),eo=w.Ay.div.withConfig({componentId:"sc-c9xyra-9"})(function(e){var t=e.theme;return(0,w.AH)(["display:inline-flex;align-items:center;gap:",";color:",";cursor:pointer;path{fill:",";}"],t.sz.s1,t.co.primary20,t.co.primary20)}),ea=w.Ay.div.withConfig({componentId:"sc-c9xyra-10"})(function(e){var t=e.theme;return(0,w.AH)(["",";background:",";padding:"," ",";border-radius:",";display:flex;align-items:center;gap:",";svg{width:",";height:",";}"],t.typography.paragraph.m,t.co.tertiary98,t.sz.s1,t.sz.s2,t.bo.small,t.sz.s1,t.sz.s6,t.sz.s6)}),ei=w.Ay.div.withConfig({componentId:"sc-c9xyra-11"})(function(e){var t=e.theme;return(0,w.AH)(["",";background:",";padding:"," ",";border-radius:",";display:flex;align-items:center;gap:",";
1"],t.typography.paragraph.m,t.co.information98,t.sz.s1,t.sz.s2,t.bo.small,t.sz.s1)}),es=(0,w.Ay)(f.$n).withConfig({componentId:"sc-c9xyra-12"})(function(e){var t=e.theme;return(0,w.AH)(["",";position:absolute;right:",";top:",";svg{width:",";height:",";}@media (max-width:","){right:",";top:",";}"],t.typography.button.l,t.sz.s3,t.sz.s3,t.sz.s6,t.sz.s6,t.sz.m,t.sz.s1,t.sz.s1)}),ed=(0,w.Ay)(Y.K).withConfig({componentId:"sc-c9xyra-13"})(function(e){var t=e.theme;return(0,w.AH)(["position:absolute;right:",";bottom:",";width:",";height:",";background:",";transition:transform 0.2s ease-in-out;"],t.sz.s3,t.sz.s3,t.sz.s10,t.sz.s10,t.co.primary20)}),ec=(0,w.Ay)(Y.K).withConfig({componentId:"sc-c9xyra-14"})(function(e){var t=e.theme;return(0,w.AH)(["position:absolute;right:",";bottom:",";width:",";height:",";background:",";transition:transform 0.2s ease-in-out;"],t.sz.s16,t.sz.s3,t.sz.s10,t.sz.s10,t.co.primary20)}),el=(0,u.YK)({completed:{id:"wordlist_completedscreen_label"},currentlyLearning:{id:"wordlists_currentlylearning_label"},pro:{id:"wordlists_viewscreen_PRO_badge"},wordsToLearn:{id:"wordlists_viewlist_wordcount_label"},shareCta:{id:"wordlists_viewscreen_share"},editWordlist:{id:"wordlists_edit_button",defaultMessage:"Edit Word List"},deleteWordlist:{id:"wordlists_delete_confirm_header"},deleteConfirmHeader:{id:"wordlists_delete_confirm_header"},deleteConfirmText:{id:"wordlists_delete_confirm_text"},cancel:{id:"wordlist_enrollment_cancel"},confirm:{id:"resetprogress_delete_language_cta"},learnerCount:{id:"wordlists_viewscreen_learner_count"},creatorName:{id:"wordlists_viewscreen_author_name"},viewDescription:{id:"wordlists_viewscreen_description",defaultMessage:"View Description"}}),eu=function(e){var t,r,n=e.title,o=e.pictureUrl,a=e.isActive,i=e.isCompleted,d=e.isPremium,p=e.isLocked,g=e.wordsToLearn,m=e.creator,f=e.creatorId,w=e.wordlistId,b=e.languagePairId,y=e.description,x=e.creatorUsername,v=e.userCollectionCount,k=(0,u.tz)(),A=(0,z.useRouter)(),I=(0,C.u)().user,M=(0,T.A)().safePush,L=(0,l.useState)(!1),P=L[0],W=L[1],H=null==I?void 0:I.isPro,O=(null==I?void 0:I.id)===f,q=(t=(0,s.A)(c().mark(function e(){var t;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.next=2;break;case 2:return t=w&&b?"".concat(window.location.origin).concat((0,F.f)("".concat(j.b.wordlists.details,"/").concat(w),{languagePairId:String(b)})):window.location.href,e.next=5,N(t);case 5:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),B=function(){W(!1)},K=(r=(0,s.A)(c().mark(function e(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!w||!b)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,S.Uq.deleteWordlist(b,w);
1case 4:W(!1),M((0,F.f)(j.b.wordlists.main,{languagePairId:String(b)}),!0);case 6:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)});return(0,_.jsxs)(G,{"data-testid":"image-banner",children:[(0,_.jsx)(J,{src:o,alt:"","data-testid":"image-banner-cover"}),(0,_.jsxs)(Q,{$noOverlay:"user"===m&&!f,"data-testid":"image-banner-chrome",children:[(0,_.jsx)(es,{icon:"share",buttonSize:"small",buttonType:"secondary",onClick:q,children:k.formatMessage(el.shareCta)}),(0,_.jsx)(en,{"data-testid":"wordlist_".concat(n),children:n}),y&&(0,_.jsx)(eo,{"data-testid":"view-description",children:(0,_.jsx)(U.j,{tooltip:y,label:k.formatMessage(el.viewDescription)})}),(0,_.jsxs)(et,{children:[a&&(0,_.jsx)(X,{"data-testid":"wordlist_currently_learning_label",children:k.formatMessage(el.currentlyLearning)}),d&&(H||p)&&(0,_.jsxs)(Z,{children:[!H&&p&&(0,_.jsx)(R.A,{name:"padlock"}),k.formatMessage(el.pro)]}),i&&"memrise"===m&&(0,_.jsxs)(er,{"data-testid":"wordlist_completed_label",children:[(0,_.jsx)(R.A,{name:"tickFilled"}),k.formatMessage(el.completed)]}),void 0!==v&&(0,_.jsxs)(ea,{"data-testid":"learner-count",children:[(0,_.jsx)(R.A,{name:"community"}),k.formatMessage(el.learnerCount,{LearnerCount:v})]}),x&&(0,_.jsxs)(ei,{"data-testid":"creator-name",children:[(0,_.jsx)(R.A,{name:"edit"}),k.formatMessage(el.creatorName,{creator:x})]}),(0,_.jsx)(ee,{children:k.formatMessage(el.wordsToLearn,{n:g})})]}),O&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ec,{icon:"deleteIcon",handleClick:function(){W(!0)},"aria-label":k.formatMessage(el.deleteWordlist),"data-testid":"delete-wordlist-button"}),(0,_.jsx)(ed,{icon:"edit",handleClick:function(){A.push((0,F.f)("".concat(j.b.wordlists.create,"/").concat(w),{languagePairId:String(b)}))},"aria-label":k.formatMessage(el.editWordlist),"data-testid":"edit-wordlist-button"}),(0,_.jsx)(h.o,{isOpen:P,onClose:B,header:k.formatMessage(el.deleteConfirmHeader),text:k.formatMessage(el.deleteConfirmText),secondaryBtnText:k.formatMessage(el.cancel),secondaryBtnAction:B,primaryBtnText:k.formatMessage(el.confirm),primaryBtnAction:K})]})]})]})},ep=r(33318),eg=r(35311);w.Ay.div.withConfig({componentId:"sc-14w3iog-0"})(function(e){var t=e.theme;return(0,w.AH)(["margin:"," auto 0 auto;width:",";"],t.sz.s32,t.sz.s20)});var em=w.Ay.div.withConfig({componentId:"sc-14w3iog-1"})(function(e){var t=e.theme,r=e.$bgColor;return(0,w.AH)(["background-color:",";border-radius:",";padding:"," ",";@media (max-width:","){border-radius:0;}"],t.co[r],t.bo.medium,t.sz.s3,t.sz.s4,t.sz.m)}),ef=w.Ay.div.withConfig({componentId:"sc-14w3iog-2"})(function(e){var t=e.theme,r=e.$bgColor;return(0,w.AH)(["display:grid;grid-template-columns:1fr auto;padding:"," ",";cursor:pointer;background-color:",";gap:",";"],t.sz.s3,t.sz.s4,t.co[r],t.sz.s2)}),eh=w.Ay.h2.withConfig({componentId:"sc-14w3iog-3"})(function(e){var t=e.theme;return(0,w.AH)(["",";color:",";margin:0;flex:1;@media (max-width:","){",";}"],t.typography.heading.desktop.xs,t.co.secondary0,t.sz.m,t.typography.button.l)}),ew=w.Ay.p.withConfig({componentId:"sc-14w3iog-4"})(function(e){var t=e.theme;return(0,w.AH)(["",";color:",";margin:0;@media (max-width:","){",";}"],t.typography.paragraph.base,t.co.secondary20,t.sz.m,t.typography.paragraph.m)}),eb=w.Ay.button.withConfig({componentId:"sc-14w3iog-5"})(function(e){var t=e.theme,r=e.$isExpanded;return(0,w.AH)(["transform:rotate(",");color:",";font-size:",";height:max-content;display:flex;margin-top:",";background:none;border:none;cursor:pointer;"],r?"180deg":"0deg",t.co.neutral50,t.sz.s6,t.sz.s1)});w.Ay.ul.withConfig({componentId:"sc-14w3iog-6"})(function(e){var t=e.theme;return(0,w.AH)(["padding:0 ",";min-width:100%;margin:0;"],t.sz.s4)});var ey=(0,u.YK)({close:{id:"scenario_dashboard_sidebar_collapse"},expand:{id:"scenario_dashboard_sidebar_expand"},words:{id:"wordlists_viewlist_section1_subheader"}}),ex=function(e){var t=e.title,r=e.words,n=e.bgColor,o=void 0===n?"neutral99":n,a=e.expanded,i=void 0!==a&&a,s=e.showOptions,d=e.creator,c=e.creatorId,p=e.wordsCount,g=e.onToggleExpand,m=e.hideDifficultToggle,f=e.hideMarkAsKnownToggle,h=e.refetchLearnables,w=e.sectionType,b=e.selectionState,y=e.selectionActions,x=e.wordlistId,v=(0,l.useState)(i),k=v[0],A=v[1],z=(0,u.tz)();return(0,l.useEffect)(function(){A(i)},[i]),(0,l.useEffect)(function(){null==g||g(k)},[k,g]),(0,_.jsxs)(em,{$bgColor:o,children:[(0,_.jsxs)(ef,{$bgColor:o,onClick:function(){return A(!k)},children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(eh,{children:t}),(0,_.jsx)(ew,{children:z.formatMessage(ey.words,{n:p})})]}),p>0&&(0,_.jsx)(eb,{$isExpanded:k,"aria-label":k?z.formatMessage(ey.close):z.formatMessage(ey.expand),children:(0,_.jsx)(R.A,{name:"down"})})]}
1),k&&(0,_.jsx)(eg.Gy,{children:(0,_.jsx)(ep.$,{items:r.map(function(e){var t;return{id:e.learnableIdKey,targetValue:e.displayTargetItem,sourceValue:e.sourceDefinitionValue,audioUrl:null==(t=e.audios[1])?void 0:t.url,difficult:e.markedAsDifficult,known:e.markedAsKnown||e.isLearned,wordlistCreatorId:c}}),showOptions:s,wordlistCreator:d,hideDifficultToggle:m,hideMarkAsKnownToggle:f,refetchLearnables:h,sectionType:w,selectionState:b,selectionActions:y,wordlistId:x})})]})},ev=r(25493),e_=w.Ay.div.withConfig({componentId:"sc-1xu967e-0"})(function(e){var t=e.theme;return(0,w.AH)(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:"," ",";background-color:",";border-radius:",";margin:0 auto;gap:",";min-height:",";@media (max-width:","){height:100%;border-radius:0;}"],t.sz.s8,t.sz.s4,t.co.neutral99,t.bo.mediumSmall,t.sz.s4,t.sz.ms,t.sz.m)}),ek=w.Ay.div.withConfig({componentId:"sc-1xu967e-1"})(function(e){var t=e.theme;return(0,w.AH)(["",";color:",";"],t.typography.heading.desktop.s,t.co.neutral0)}),eA=w.Ay.p.withConfig({componentId:"sc-1xu967e-2"})(function(e){var t=e.theme;return(0,w.AH)(["",";color:",";margin:0;"],t.typography.paragraph.base,t.co.neutral0)}),ez=(0,u.YK)({emptyTitle:{id:"wordlists_addedbyme_emptystate_header"},emptyDescription:{id:"wordlists_addedbyme_emptystate_body_copy"},exploreVideosButton:{id:"wordlists_addedbyme_emptystate_CTA"},letsGoButton:{id:"wordlists_viewlist_CTA"}}),eC=function(e){var t=e.handleWordlistSelection,r=(0,u.tz)(),n=(0,z.useRouter)().query,o=!!(n.back&&String(n.back).includes("choose-wordlist"));return(0,_.jsxs)(e_,{children:[(0,_.jsx)(ek,{children:r.formatMessage(ez.emptyTitle)}),(0,_.jsx)(eA,{children:r.formatMessage(ez.emptyDescription)}),o?(0,_.jsx)(f.$n,{buttonSize:"large",buttonType:"primary","data-testid":"wordlist_switch_btn",onClick:t,children:r.formatMessage(ez.letsGoButton)}):(0,_.jsx)(ev.z,{buttonSize:"large",buttonType:"primary",href:j.b.video.immerse,"data-testid":"explore-videos-button",children:r.formatMessage(ez.exploreVideosButton)})]})},eI=w.Ay.div.withConfig({componentId:"sc-jsq115-0"})(function(e){var t=e.theme;return(0,w.AH)(["margin:0 auto 0 auto;width:",";"],t.sz.s20)}),ej=w.Ay.div.withConfig({componentId:"sc-jsq115-1"})(function(e){var t=e.theme,r=e.$hasWhiteBackground;return(0,w.AH)(["display:flex;flex-direction:column;width:100%;min-height:100vh;background-color:",";align-items:center;gap:",";padding-bottom:",";@media (max-width:","){padding-bottom:",";gap:0;background-color:",";}"],t.co.primary99,t.sz.s12,t.sz.s18,t.sz.m,t.sz.s44,r?t.co.neutral99:t.co.primary99)}),eT=w.Ay.div.withConfig({componentId:"sc-jsq115-2"})(function(e){var t=e.theme;return(0,w.AH)(["display:flex;flex-direction:column;gap:",";padding:",";max-width:",";margin:0 auto;width:100%;@media (max-width:","){padding:0;gap:0;}"],t.sz.s4,t.sz.s4,t.sz.lg,t.sz.m)}),eM=w.Ay.div.withConfig({componentId:"sc-jsq115-3"})(function(e){var t=e.theme;return(0,w.AH)(["position:fixed;bottom:0;left:0;width:100%;z-index:",";padding:",";background:",";display:flex;justify-content:center;box-shadow:0 -"," "," rgba(0,0,0,0.08);@media (max-width:","){display:block;}"],t.zi.z6,t.sz.s4,t.co.primary98,t.bo.thinWidth,t.sz.s10,t.sz.m)});function eL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eL(Object(r),!0).forEach(function(t){(0,i.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eL(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var eS="00000000-0000-0000-0000-000000000000",eW=(0,u.YK)({learnedWords:{id:"wordlists_viewlist_section1_header"},wordsToLearn:{id:"wordlists_viewlist_section2_header"},switchCta:{id:"wordlist_non_active_CTA"},chooseCta:{id:"wordlists_viewlist_CTA"},upgradeCta:{id:"onboarding_wordlist_detail_upgradeCTA"},startLesson:{id:"scenario_button_start_lesson"},title:{id:"wordlists_viewscreen_title"},placeholderTitle:{id:"wordlists_personal_placeholder_title"},enrollmentHeader:{id:"wordlist_enrollment_header"},enrollmentBody:{id:"wordlist_enrollment_body"},enrollmentConfirm:{id:"wordlist_enrollment_confirm"},enrollmentCancel:{id:"wordlist_enrollment_cancel"},viewOnlyHeader:{id:"wordlist_view_only_header"},viewOnlyBody:{id:"wordlist_view_only_body"},viewOnlyClose:{id:"wordlist_view_only_close"},switchLanguagePairHeader:{id:"wordlist_switch_lp_header"},switchLanguagePairBody:{id:"wordlist_switch_lp_body"}
1,switchLanguagePairConfirm:{id:"wordlist_switch_lp_confirm"},switchLanguagePairCancel:{id:"wordlist_switch_lp_cancel"}}),eH=function(e){var t,r,n,o,a,i,d=e.languagePairId,w=e.wordlistId,b=e.onClose,y=e.onWordlistActivated,x=e.backRoute,v=(0,u.tz)(),k=(0,z.useRouter)(),q=k.query,B=k.asPath,K=q.id,U=q.back,R=q.languagePairId,$="string"==typeof K?K:w,N=R?Number(R):d,F=(0,C.u)().user,Y=(0,I.hF)().experienceType,V=(0,T.A)().safePush,G=(0,l.useState)(!1),J=G[0],Q=G[1],X=(0,l.useState)(!1),Z=X[0],ee=X[1],et=(0,l.useState)(!1),er=et[0],en=et[1],eo=(0,l.useState)(!1),ea=eo[0],ei=eo[1],es=null==F?void 0:F.isPro,ed=!!B.startsWith(j.b.wordlists.select),ec=U?String(U):x||j.b.wordlists.main,el="2024"===Y,ep=(0,H.S)(),eg=(0,l.useMemo)(function(){return null!=N&&null!=ep&&N!==ep},[N,ep]);(0,l.useEffect)(function(){$&&S.mq.trackUserAction("screen_viewed","wordlist_details_screen",null!=N?N:null,!!es,{wordlist_id:String($)})},[$]);var em=(0,l.useRef)(null),ef=(0,l.useRef)(null),eh=(0,l.useRef)(null),ew=(0,W.v1)(em,"10px"),eb=(0,W.v1)(ef,"10px"),ey=(0,W.v1)(eh,"500px"),ev=$===eS,e_=(0,l.useState)(!1),ek=e_[0],eA=e_[1],ez=(0,l.useState)(!0),eL=ez[0],eH=ez[1],eO=(0,l.useState)({selectedWordIds:new Set,lastSelectedWordId:null,sectionType:null}),eq=eO[0],eB=eO[1],eK=(0,L.I)({queryKey:["userLanguages"],queryFn:function(){return S.fR.getUserLanguages()}}).data,eE=(0,l.useMemo)(function(){var e;return N&&eK?null==(e=eK.languagePairs)?void 0:e.some(function(e){return e.languagePairId===N}):null},[N,eK]),eD=(0,L.I)({queryKey:["getWordlist",N,$],queryFn:function(){return N&&$?S.Uq.getWordlist(N,$):null},enabled:!!N&&!!$&&!ev}),eU=eD.data,eR=eD.isLoading,e$=eD.refetch,eN=(0,P.q)({queryKey:["getWordlistLearnablesWithProgress",N,$,"only_with_progress"],queryFn:function(e){var t=e.pageParam;return N&&$?S.Uq.getWordlistLearnables(N,$,{wordlist_learnables_state:"only_with_progress",learnables_page_token:t||""}):null},staleTime:0,gcTime:0,initialPageParam:"",getNextPageParam:function(e){return(null==e?void 0:e.nextLearnablesPageToken)||void 0},enabled:!!N&&!!$&&ek&&!ev}),eF=eN.data,eY=eN.isLoading,eV=eN.fetchNextPage,eG=eN.hasNextPage,eJ=eN.isFetchingNextPage,eQ=eN.refetch,eX=(0,P.q)({queryKey:["getWordlistLearnablesWithoutProgress",N,$,"only_without_progress"],queryFn:function(e){var t=e.pageParam;return N&&$?S.Uq.getWordlistLearnables(N,$,{wordlist_learnables_state:"only_without_progress",learnables_page_token:t||""}):null},staleTime:0,gcTime:0,initialPageParam:"",getNextPageParam:function(e){return(null==e?void 0:e.nextLearnablesPageToken)||void 0},enabled:!!N&&!!$&&eL&&!ev}),eZ=eX.data,e0=eX.isLoading,e1=eX.fetchNextPage,e2=eX.hasNextPage,e9=eX.isFetchingNextPage,e4=eX.refetch;(0,l.useEffect)(function(){ew&&eG&&!eJ&&eV(),eb&&e2&&!e9&&e1()},[ew,eb,e2,e1,e9,eG,eJ,eV]);var e5=(0,l.useMemo)(function(){var e;return(null==eF||null==(e=eF.pages)?void 0:e.flatMap(function(e){return(null==e?void 0:e.learnables)||[]}))||[]},[null==eF?void 0:eF.pages]),e3=(0,l.useMemo)(function(){var e;return(null==eZ||null==(e=eZ.pages)?void 0:e.flatMap(function(e){return(null==e?void 0:e.learnables)||[]}))||[]},[null==eZ?void 0:eZ.pages]),e6=null==eU?void 0:eU.wordlist,e7=J||!!(null!=eU&&eU.isActive),e8=null==e6?void 0:e6.creator,te=e7&&eg,tt=(0,l.useMemo)(function(){if(null!=e6&&e6.isLocked&&!es)return"padlock"},[null==e6?void 0:e6.isLocked,es]),tr=(0,l.useMemo)(function(){return null!=e6&&e6.isLocked&&!es?eW.upgradeCta:ed?eW.chooseCta:eW.startLesson},[null==e6?void 0:e6.isLocked,es,ed]),tn=null==e6?void 0:e6.remainingLearnablesCount,to=(null==e6?void 0:e6.learnablesCount)===0||ev,ta=function(){null==y||y($),null==b||b()},ti=(t=(0,s.A)(c().mark(function e(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!N||!$)){e.next=2;break}return e.abrupt("return");case 2:return Q(!0),e.next=5,S.Uq.activateWordlist(N,$);case 5:V((0,M.b)(N));case 6:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),ts=function(){V({pathname:ed?j.b.onboarding.choosePlan:j.b.payment.plans,query:{next:B}})},td=(r=(0,s.A)(c().mark(function e(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(S.mq.trackUserAction("clicked_activate_wordlist_button","wordlist_details_screen",null!=N?N:null,!!es,eP({},$&&{wordlist_id:String($)})),!el){e.next=4;break}return en(!0),e.abrupt("return");case 4:if(!(!1===eE&&N)){e.next=7;break}return ee(!0),e.abrupt("return");case 7:if(!(te||!0===eE&&eg&&N)){e.next=10;break}return ei(!0),e.abrupt("return");case 10:if(!(!(null!=e6&&e6.isLocked)||es)){e.next=19;break}if(!ed){e.next=15;break}ta(),e.next=17;break;case 15:return e.next=17,ti();case 17:e.next=20;break;case 19:ts();case 20:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)}),tc=(n=(0,s.A)(c().mark(function e(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(N){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,S.s2.enroll(N);case 5:if($){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,S.Uq.activateWordlist(N,$);case 9:(0,O.MO)(N,void 0,void 0,!0),ee(!1),window.location.href=j.b.dashboard,e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),ee(!1);case 17:case"end":return e.stop()}},e,null,[[2,14]])})),function(){return n.apply(this,arguments)}),tl=function(){ee(!1)},tu=(o=(0,s.A)(c().mark(function e(){var t,r;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!N||!eK)){e.next=2;break}return e.abrupt("return");case 2:if(r=null==(t=eK.languagePairs)?void 0:t.find(function(e){return e.languagePairId===N})){e.next=5;break}return e.abrupt("return");case 5:if(e.prev=5,!(!te&&$)){e.next=9;break}return e.next=9,S.Uq.activateWordlist(N,$);case 9:(0,O.MO)(N,r.sourceLanguageLocale,r.targetLanguageLocale,!0),ei(!1),window.location.href=j.b.dashboard,e.next=17;break;case 14:e.prev=14,e.t0=e.catch(5),ei(!1);case 17:case"end":return e.stop()}},e,null,[[5,14]])}
1)),function(){return o.apply(this,arguments)}),tp=function(){ei(!1)},tg=(0,l.useMemo)(function(){return{toggleSelection:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0;eB(function(o){if(o.sectionType&&o.sectionType!==n)return{selectedWordIds:new Set([e]),lastSelectedWordId:e,sectionType:n||null};var a=new Set(o.selectedWordIds);if(!t||null===o.lastSelectedWordId||!(r.length>0))return a.has(e)?a.delete(e):a.add(e),{selectedWordIds:a,lastSelectedWordId:e,sectionType:n||o.sectionType};var i=r.indexOf(o.lastSelectedWordId),s=r.indexOf(e);if(-1!==i&&-1!==s)for(var d=Math.min(i,s),c=Math.max(i,s),l=d;l<=c;l++)a.add(r[l]);return{selectedWordIds:a,lastSelectedWordId:e,sectionType:n||o.sectionType}})},clearSelection:function(){eB({selectedWordIds:new Set,lastSelectedWordId:null,sectionType:null})},selectRange:function(e,t,r,n){eB(function(o){var a=new Set(o.selectedWordIds),i=r.indexOf(e),s=r.indexOf(t);if(-1!==i&&-1!==s)for(var d=Math.min(i,s),c=Math.max(i,s),l=d;l<=c;l++)a.add(r[l]);return eP(eP({},o),{},{selectedWordIds:a,sectionType:n||o.sectionType})})}}},[]),tm=(a=(0,s.A)(c().mark(function e(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!N||0===eq.selectedWordIds.size)){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,E({languagePairId:N,wordIds:Array.from(eq.selectedWordIds),onSuccess:function(){eQ(),e4(),e$(),tg.clearSelection()}});case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.error("Bulk mark as known failed:",e.t0);case 10:case"end":return e.stop()}},e,null,[[2,7]])})),function(){return a.apply(this,arguments)}),tf=(i=(0,s.A)(c().mark(function e(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!N||0===eq.selectedWordIds.size)){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,D({languagePairId:N,wordIds:Array.from(eq.selectedWordIds),onSuccess:function(){eQ(),e4(),e$(),tg.clearSelection()}});case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.error("Bulk unmark as known failed:",e.t0);case 10:case"end":return e.stop()}},e,null,[[2,7]])})),function(){return i.apply(this,arguments)});return to?(0,_.jsxs)(ej,{$hasWhiteBackground:!0,children:[(0,_.jsx)(p.t,{href:ec}),(0,_.jsxs)(eT,{children:[(0,_.jsx)(eu,{title:v.formatMessage(eW.placeholderTitle),pictureUrl:"https://static.memrise.com/uploads/Words%20Added%20by%20Me/Words_added_by_me_(Web).png",isActive:!1,isPremium:!1,isLocked:!1,isCompleted:!1,wordsToLearn:0,creator:"user",creatorId:null==e6?void 0:e6.creatorId,wordlistId:$,languagePairId:N}),(0,_.jsx)(eC,{handleWordlistSelection:td})]})]}):eR?(0,_.jsx)(eI,{children:(0,_.jsx)(g.A,{})}):(0,_.jsxs)(ej,{children:[!ed&&(0,_.jsx)(p.t,{href:ec}),e6&&(0,_.jsxs)(eT,{children:[(0,_.jsx)(eu,{title:e6.title,pictureUrl:e6.pictureUrl,isActive:e7&&!ed,isPremium:e6.isPremium,isLocked:e6.isLocked,isCompleted:e6.isCompleted,wordsToLearn:e6.remainingLearnablesCount,creator:e6.creator,creatorId:e6.creatorId,wordlistId:$,languagePairId:N,description:e6.description,creatorUsername:e6.creatorUsername,userCollectionCount:e6.userCollectionCount}),(0,_.jsx)(ex,{bgColor:"neutral98",title:v.formatMessage(eW.learnedWords),wordsCount:e6.learnedLearnablesCount,words:e5,expanded:0===tn,showOptions:!ed&&(es||!e6.isLocked),creator:e8,creatorId:e6.creatorId,onToggleExpand:function(e){eA(e)},refetchLearnables:function(){eQ(),e4(),e$()},sectionType:"learned",selectionState:eq,selectionActions:tg,wordlistId:$}),ek&&e5.length>0&&(0,_.jsx)("div",{ref:em}),ek&&(eY||eJ)&&(0,_.jsx)(eI,{children:(0,_.jsx)(g.A,{})}),(0,_.jsx)("div",{ref:eh}),(0,_.jsx)(ex,{title:v.formatMessage(eW.wordsToLearn),wordsCount:e6.remainingLearnablesCount,words:e3,expanded:!!tn&&tn>0,showOptions:!ed&&(es||!e6.isLocked),creator:e8,creatorId:e6.creatorId,onToggleExpand:function(e){eH(e)},hideDifficultToggle:!0,refetchLearnables:function(){eQ(),e4(),e$()},sectionType:"toLearn",selectionState:eq,selectionActions:tg,wordlistId:$}),eL&&e3.length>0&&(0,_.jsx)("div",{ref:ef}),eL&&(e0||e9)&&(0,_.jsx)(eI,{children:(0,_.jsx)(g.A,{})})]}
1),!ey&&(0,_.jsx)(m.R,{}),!to&&(!el||te)&&(0,_.jsx)(eM,{children:(0,_.jsx)(f.$n,{icon:tt,"data-testid":"wordlist_switch_btn",buttonSize:"large",buttonType:"primary",wide:!0,onClick:td,children:v.formatMessage(tr)})}),(0,_.jsx)(h.o,{header:v.formatMessage(eW.enrollmentHeader),text:v.formatMessage(eW.enrollmentBody),primaryBtnText:v.formatMessage(eW.enrollmentConfirm),primaryBtnAction:tc,secondaryBtnText:v.formatMessage(eW.enrollmentCancel),secondaryBtnAction:tl,isOpen:Z,onClose:tl}),(0,_.jsx)(h.o,{header:v.formatMessage(eW.viewOnlyHeader),text:v.formatMessage(eW.viewOnlyBody),primaryBtnText:v.formatMessage(eW.viewOnlyClose),primaryBtnAction:function(){return en(!1)},isOpen:er,onClose:function(){return en(!1)}}),(0,_.jsx)(h.o,{header:v.formatMessage(eW.switchLanguagePairHeader),text:v.formatMessage(eW.switchLanguagePairBody),primaryBtnText:v.formatMessage(eW.switchLanguagePairConfirm),primaryBtnAction:tu,secondaryBtnText:v.formatMessage(eW.switchLanguagePairCancel),secondaryBtnAction:tp,isOpen:ea,onClose:tp}),eq.selectedWordIds.size>0&&eq.sectionType&&(0,_.jsx)(A,{selectedCount:eq.selectedWordIds.size,sectionType:eq.sectionType,onMarkAsKnown:tm,onUnmarkAsKnown:tf,onCancel:function(){tg.clearSelection()}})]})};let eO=function(){var e=(0,u.tz)();return(0,_.jsx)(q.A,{hasSidebar:!1,pageScreenName:B.J.WORDLISTS,pageTitle:e.formatMessage(eW.title),children:(0,_.jsx)(eH,{})})}}}]); 2//# sourceMappingURL=9964-8839477b7f472dab.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.