Sunteți pe pagina 1din 4

(window.webpackJsonp=window.webpackJsonp||[]).

push([[11],{"/RZT":function(e,t,a)
{},"1aYn":function(e,t,a){var
n=a("S3pA"),o=a("9y2L"),r=a("BlJA");e.exports=function(e){return function(t,a,s)
{var l=Object(t);if(!o(t)){var i=n(a,3);t=r(t),a=function(e){return
i(l[e],e,l)}}var d=e(t,a,s);return d>-1?l[i?t[d]:d]:void
0}}},"3hy0":function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var
n=a("O94r"),o=a.n(n),r=a("ERkP"),s=a.n(r),l=a("twg/"),i=a("mMFA");a("Yq7m");functio
n d(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!
0,configurable:!0,writable:!0}):e[t]=a,e}class c extends
s.a.Component{constructor(e){super(e),d(this,"handleFocus",
(()=>{this.setState({focused:!0}),"function"==typeof
this.props.onFocus&&this.props.onFocus()})),d(this,"handleBlur",
(()=>{this.setState({focused:!1})})),this.state={focused:!1},this.uid=i.a}render()
{const{children:e,description:t,disabled:a,id:n,labelText:r,labelTextClass:i,name:d
,onChange:c,onKeyDown:u,selected:m,value:p}=this.props,_=m?"icon-
ic_radiobutton_filled":"icon-ic_radiobutton_empty",h=t&&s.a.createElement("span",
{className:"description",id:this.uid("description")},t);return
s.a.createElement("div",{className:o()
("auto__doc_page_shared_forms_radio",this.props.class,"radio_component")},s.a.creat
eElement("label",{className:o()("radio_label",_,
{checked:m,focused:this.state.focused,with_description:t}),htmlFor:n||
this.uid(p),onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:u},s.a.create
Element(l.a,null,s.a.createElement("input",{"aria-describedby":t?
this.uid("description"):null,checked:m,className:"radio_input
radio",disabled:a,id:n||
this.uid(p),name:d,onChange:c,type:"radio",value:p})),r&&s.a.createElement("span",
{className:o()("input_text",i)},r),h,e))}}c.defaultProps={children:
[],description:"",disabled:!1,id:"",labelText:"",labelTextClass:"",name:"",onFocus:
()=>{},onKeyDown:()=>{},selected:!1,value:""}},"6R5o":function(e,t,a){var
n=a("1aYn")(a("FllU"));e.exports=n},DuXo:function(e,t){e.exports=function(e,t,a,n)
{for(var o=e.length,r=a+(n?1:-1);n?r--:++r<o;)if(t(e[r],r,e))return r;return-
1}},EmNC:function(e,t,a){},FllU:function(e,t,a){var
n=a("DuXo"),o=a("S3pA"),r=a("m2YG"),s=Math.max;e.exports=function(e,t,a){var
l=null==e?0:e.length;if(!l)return-1;var i=null==a?0:r(a);return
i<0&&(i=s(l+i,0)),n(e,o(t,3),i)}},MTrC:function(e,t,a){},OOfv:function(e,t,a){"use
strict";a.d(t,"a",(function(){return n})),a.d(t,"d",(function(){return
l})),a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return d}));const
n="auto__doc_page_receipt_download",o={docx:"application/vnd.openxmlformats-
officedocument.wordprocessingml.document",pptx:"application/vnd.openxmlformats-
officedocument.presentationml.presentation",ppt:"application/vnd.openxmlformats-
officedocument.presentationml.presentation",ppsx:"application/vnd.openxmlformats-
officedocument.presentationml.slideshow",xlsx:"application/vnd.openxmlformats-
officedocument.spreadsheetml.sheet"};var r=a("z+cI"),s=a("rrYN");function l(e)
{return["iphone","ipad"].includes(e)}function i(e,t,a={})
{const{download_url:n,access_key:s}=t,l={secret_password:s,extension:e};if(a.showPd
f){l.show_pdf=!0;const t=o[e];t&&(l.content_type=t,l.exclude_disposition=!
0)}return`${n}/?${Object(r.a)(l)}`}function d(e,t,a,n,o,r){if(l(a)){const t=i(e,n,
{showPdf:!0});Object(s.a)("download_lightbox:opened_in_new_tab",
{format:e}),window.open(t,"_blank")}else
t&&(t.src+="");o(),r(n.id)}},VNI5:function(e,t,a){},XS7D:function(e,t,a)
{},Yq7m:function(e,t,a){},hLBy:function(e,t,a){"use strict";a.r(t);var
n=a("lXyA"),o=a.n(n),r=a("O94r"),s=a.n(r),l=a("d5gM"),i=a("ERkP"),d=a.n(i),c=a("twg
/"),u=a("mjw8"),m=a("6R5o"),p=a.n(m),_=a("uP87"),h=a("BMmL"),f=a("3hy0"),w=a("rrYN"
),b=a("k3iA"),g=a("38NX"),v=a("OOfv");a("/RZT");function y(e,t,a){return t in e?
Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!
0}):e[t]=a,e}class E extends d.a.Component{constructor(e)
{super(e),y(this,"handleSelection",
(e=>{this.setState({format:e.target.value})})),y(this,"handleViewInSaved",
(()=>{const e=this.props.document.id;Object(w.a)
("download_modal:view_in_saved:click",{document_id:e})})),y(this,"handleDownload",
(e=>{e.preventDefault();const{platform:t,document:a,handleDownloadClick:n,saveItem:
o}=this.props,{format:r}=this.state,s=this.iframeRef;Object(v.c)
(r,s,t,a,n,o)})),y(this,"handleRetry",(e=>{const
t=this.props.document.id;Object(w.a)("download_modal:retry_download:click",
{document_id:t}),this.handleDownload(e)})),this.state={format:e.document.formats&&e
.document.formats.length&&e.document.formats[0].extension},this.downloadSubtitleRef
=d.a.createRef()}componentDidUpdate()
{this.props.downloaded&&this.downloadSubtitleRef&&this.downloadSubtitleRef.current.
focus()}renderSubtitle(){if(this.props.downloaded)return d.a.createElement("div",
{className:"download_subtitle",tabIndex:"-1",ref:this.downloadSubtitleRef,"data-
e2e":"post_download_msg"},l.default.t("shared.doc_download_modal.download_started")
)}renderFormat(e){if(this.state.format)return d.a.createElement(f.a,
{key:e.extension,labelText:e.extension,onChange:this.handleSelection,selected:this.
state.format===e.extension,value:e.extension})}renderAlsoAddedToSaved(){const
e=this.props.isSaved?
l.default.t("webpack.doc_page.src.shared.components.modals.Download.Download.also_a
dded_to_your_saved_list"):l.default.t("webpack.doc_page.src.shared.components.modal
s.Download.Download.also_adds_to_your_saved_list");return d.a.createElement("div",
{className:"saved_to_library"},d.a.createElement("i",{className:"icon-
ic_saved_for_later_2px","aria-hidden":"true"}),e)}renderDownloadButton(){if(!
this.state.format)return;const{formats:e}=this.props.document,t=p()(e,
{extension:this.state.format});return d.a.createElement(b.a,
{className:"download_selection_btn",href:"#",onClick:this.handleDownload},l.default
.t("webpack.doc_page.src.shared.modals.download.download.download_format_extension_
touppercase_format_filesize",
{format_extension_touppercase:t.extension.toUpperCase(),format_filesize:t.filesize}
))}renderInputGroup(){const{formats:e}=this.props.document;if(!(e.length<2))return
d.a.createElement(_.a,
{legend:l.default.t("receipt.download.choose_document_formguvyfjyubgat_type"),hideL
egend:!0,horizontal:!0},e.map(this.renderFormat,this))}renderSelection(){if(!
this.props.downloaded&&this.state.format)return d.a.createElement("div",
{className:"selection_wrapper"},d.a.createElement("div",
{className:"download_as"},l.default.t("doc_page.shared.components.modals.download.d
ownload_as")),this.renderInputGroup(),d.a.createElement("div",
{className:"button_container flex_col"},d.a.createElement("div",
{className:"button_with_saved"},this.renderDownloadButton(),this.renderAlsoAddedToS
aved())))}renderDownloadIframe(){if(!this.props.downloaded||Object(v.d)
(this.props.platform))return;const{format:e}=this.state;return
d.a.createElement("iframe",
{ref:e=>this.iframeRef=e,width:"1",height:"1",title:l.default.t("receipt.download.d
ownload_iframe"),frameBorder:"0",style:{display:"none"},src:Object(v.b)
(e,this.props.document)})}renderDocumentViewRetryLinks(){if(!
this.props.downloaded)return;let e;return
this.props.width>h.a.breakpoint_450&&(e=d.a.createElement(g.a,
{className:"view_in_saved
text_btn",href:this.props.libraryUrl,text:l.default.t("receipt.download.view_in_sav
ed_list"),onClick:this.handleViewInSaved})),d.a.createElement("div",
{className:"bestsellers_picker_links"},d.a.createElement(g.a,
{className:"redownload_btn
text_btn",onClick:this.handleRetry,text:l.default.t("receipt.download.retry_downloa
d")}),e)}renderDownloadContent(){return d.a.createElement("div",
{className:"content_wrapper"},this.renderSubtitle(),this.renderDocumentViewRetryLin
ks(),this.renderSelection())}render(){return d.a.createElement("div",{className:s()
(v.a,"download_module_wrapper","download_module")},this.renderDownloadIframe(),this
.renderDownloadContent())}}E.defaultProps={isSaved:!1};var
k=a("uDfI"),x=a("/Dx/");var S,N,D,O=Object(k.b)
((e=>({platform:e.platform,width:e.viewport.width,libraryUrl:e.global.paths.actions
.library_url,isSaved:e.page.word_document.in_library})),
(e=>({saveItem:t=>{e(Object(x.b)(t,!0))}})))
(E),j=a("W9j8"),C=a("yaP6"),R=a("vJVZ"),I=a("mTyF"),P=a("zexW");a("MTrC");class B
extends I.a{constructor(e)
{super(e),this.enclosing_class("auto__doc_page_save_only_cell")}component_classes()
{return s()({main_item:this.props.main_item})}render_stars(){if(!
this.props.star_rating_props)return;const
e=this.props.star_rating_props.system_rating,t=[],a=Math.ceil(e);for(let
n=1;n<=5;n++)t.push(d.a.createElement("span",{className:s()("rating_star",
{light_lit:n<=a,"icon-ic_star_small_fill":n<=e,"icon-
ic_star_small_halffill":n>e&&n<=a,"icon-ic_star_small_outline":n>a}),key:n,"aria-
hidden":"true"}));const n=d.a.createElement("span",
{className:"rating"},e,"/5");return
d.a.createElement(d.a.Fragment,null,t,n)}render_content()
{const{id:e,in_library:t,title:a,short_title:n}=this.props,o={id:e,in_library:t,tit
le:a,short_title:n};let r,s;return this.props.main_item?s=d.a.createElement("span",
{className:"saveonly_subtitle"},l.default.t("webpack.doc_page.src.shared.components
.modals.Download.Receipt.InfiniteScrollingBestsellers.SaveOnlyCell.SaveOnlyCell.you
r_document")):r=d.a.createElement("span",{className:"saveonly_suurn t
.tracking=a,e}));this.setState({compilationId:s,documents:this.state.documents.conc
at(d),page:this.state.page+1,loading:!1})})),A(this,"handleRecView",
(e=>{this.tracking&&this.tracking.track_obj_view(e)})),A(this,"handleLoadMoreClick"
,
(()=>{this.fetchBestSellersPage(this.state.page)})),A(this,"renderAvailableInSubscr
iption",(()=>{if(this.props.isSubscriber)return d.a.createElement("div",
{className:"available_in_subscription"},d.a.createElement("div",
{className:"icon_wrapper"},d.a.createElement(j.a,
{icon:"checkmark_outline_circle"})),d.a.createElement("div",
{className:"copy_wrapper"},d.a.createElement("div",null,l.default.t("webpack.doc_pa
ge.src.shared.components.modals.Download.Receipt.InfiniteScrollingBestsellers.Infin
iteScrollingBestsellers
.
included_in_your_membership")),d.a.createElement("div",null,l.default.t("webpack.do
c_page.src.shared.components.modals.Download.Receipt.InfiniteScrollingBestsellers.I
nfiniteScrollingBestsellers.at_no_additional_cost"))))})),A(this,"renderCells",
(()=>{if(!this.state.documents.length)return;const
e=Object.assign({},this.props.wordDocument,{main_item:!
0}),t=this.renderCell(e,"main_doc"),a=this.state.documents.map((e=>this.renderCell(
e,e.id)));return d.a.createElement(d.a.Fragment,null,t,a)})),A(this,"renderCell",
((e,t)=>d.a.createElement(B,U({},e,{lazy_load:!
1,thumb_url:e.image_url,carousel_scrolling_ref:this.container.current,in_view_check
_events:
["bestsellers:scroll"],handle_rec_view:this.handleRecView,key:t})))),A(this,"render
LoadingSpinner",(()=>{if(this.state.loading)return
d.a.createElement(F.a,null)})),A(this,"renderLoadMore",(()=>{if(!
this.state.loading)return d.a.createElement("div",
{className:"load_more"},d.a.createElement(b.a,
{className:"load_more_button",onClick:this.handleLoadMoreClick},l.default.t("webpac
k.doc_page.src.shared.components.modals.Download.Receipt.InfiniteScrollingBestselle
rs.InfiniteScrollingBestsellers.load_more")))})),this.state={compilationId:null,doc
uments:[],loading:!1,page:1},this.container=d.a.createRef()}componentDidMount()
{this.fetchBestSellersPage(this.state.page)}componentDidUpdate()
{this.handleIsKeyboardUser()}render(){return d.a.createElement("div",
{className:"wrapper__infinite_scrolling_bestsellers",ref:this.container},this.rende
rAvailableInSubscription(),d.a.createElement("ul",
{className:"cards"},this.renderCells()),this.renderLoadMore(),this.renderLoadingSpi
nner())}}var L=Object(k.b)
((e=>({bestsellersUrl:e.global.paths.actions.bestsellers_url,isKeyboardUser:e.viewp
ort.isKeyboardUser,isSubscriber:e.user.isSubscriber,wordDocument:e.page.word_docume
nt})),null)(M),T=a("NUf2"),V=a("WLt/"),z=a("7HaD");a("XS7D");const K=o()
((()=>{{const e="__CJ_receipt_lightbox:position";let t=Object(V.a)(e);return t=void
0===t||"true"!==t,Object(z.a)(e,t),t}}));class Y extends T.a{constructor(e)
{super(e),this.enclosing_class(s()
("auto__doc_page_shared_modals_download_receipt","bestsellers_picker")),this.state=
{show_content_types:K(),downloaded:!1}}componentDidMount(){Object(w.a)
("download_modal:lightbox:view")}componentWillUnmount()
{this.state.downloaded&&Object(w.a)
("download_started_modal:control:close")}isMobile(){return
this.props.mobile_app_link}get_title(){return
d.a.createElement(d.a.Fragment,null,d.a.createElement(c.a,null,l.default.t("receipt
.download.downloading")),this.props.document.title)}handle_download_click()
{this.setState({downloaded:!0},(()=>{Object(w.a)
("download_started_modal:control:view")}))}render_doc_title(){return
d.a.createElement("div",
{className:"doc_info_wrapper"},this.render_doc_thumbnail(),d.a.createElement("div",
{className:"doc_title_wrapper"},d.a.createElement("div",
{className:"doc_title"},this.get_title()),d.a.createElement("div",
{className:"uploaded_by"},l.default.t("webpack.doc_page.src.shared.components.modal
s.Download.Receipt.Receipt.uploaded_by_this_props_document_author_name",
{this_props_document_author_name:this.props.document.author.name}))))}render_doc_th
umbnail(){const{image_url:e,retina_image_url:t}=this.props.document;return
d.a.createElement("div",{className:"thumbnail"},d.a.createElement("img",
{className:"document
thumb_img",src:e,alt:l.default.t("receipt.download.document"),srcSet:`${t}
2x`}))}render_bestsellers_picker(){return
d.a.createElement(d.a.Fragment,null,d.a.createElement(O,
{document:this.props.document,downloaded:this.state.downloaded,handleDownloadClick:
this.handle_download_click}),d.a.createElement(L,null))}render_content(){const
e=this.render_bestsellers_picker();return
d.a.createElement(d.a.Fragment,null,this.render_modal_title(l.default.t("shared.doc
_download_modal.download_document"),"download_modal_title","download_modal_title"),
d.a.createElement(u.a,
{extra_classes:"download_card"},this.render_doc_title(),e))}}!function(e,t,a){t in
e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!
0}):e[t]=a}(Y,"defaultProps",{no_module:!1});t.default=Object(k.b)((e=>{const
t=e.user,a=e.page.word_document.show_archive_paywall;return{no_module:!
t.isSubscriber&&!a}}),null)(Y)},mjw8:function(e,t,a){"use strict";a.d(t,"a",
(function(){return l}));var
n=a("ERkP"),o=a.n(n),r=a("O94r"),s=a.n(r);a("VNI5");function
l({children:e,extra_classes:t}){return o.a.createElement("div",{className:s()
("auto__shared_react_basic_card",t)},e)}l.defaultProps={extra_classes:""}}}]);
//#
sourceMappingURL=https://www.scribd.com/webpack/doc_page/11.ac3c121a29dc8d216aa7.js
.map

S-ar putea să vă placă și