1"use strict";(self.webpackChunk_overleaf_web=self.webpackChunk_overleaf_web||[]).push([[9464],{90919(e,t,s){var r=s(28870),i=s(46886),n=s(83764),a=s.n(n),o=s(44273);const l=e=>{let{children:t,className:s}=e;return(0,o.jsx)(r.A,{className:a()("page-content-card",s),children:(0,o.jsx)(i.A,{children:t})})};s.d(t,["A",0,l])},99464(e,t,s){s.r(t),s.d(t,{default:()=>ee});var r=s(66485),i=s(35956),n=s.n(i),a=(s(36342),s(71124),s(86574)),o=s.n(a),l=(s(8922),s(15765),s(78245),s(93185)),d=s(48685),c=s(44273);class h extends r.Component{render(){const{name:e,id:t,category:s,displayCategory:r,switchTo:i}=this.props;return(0,c.jsxs)(d.A,{md:6,children:[r&&(0,c.jsx)("div",{className:"table-content-category",children:s.replace("_"," ")}),(0,c.jsx)("div",{className:"table-content-name",translate:"no",children:e}),(0,c.jsxs)("div",{className:"table-content-main",children:[(0,c.jsx)("div",{className:"table-content-icon",children:(0,c.jsx)("button",{type:"button","data-event":"publish_entry_select","data-category":"Publish","data-action":"choose","data-label":this.props.id,className:"btn-transparent p-0",onClick:()=>this.props.onSwitch(i,t),children:(0,c.jsx)("img",{src:this.props.publish_menu_icon,alt:e})})}),(0,c.jsx)("div",{className:"table-content-text",children:(0,c.jsx)("div",{className:"table-content-slogan",dangerouslySetInnerHTML:{__html:this.props.publish_menu_html}})})]}),(0,c.jsx)("div",{className:"table-content-link",children:(0,c.jsx)("button",{className:`${this.props.linkClass} btn btn-primary btn-wrapping`,"data-event":"publish_entry_select","data-category":"Publish","data-action":"choose","data-label":this.props.id,onClick:()=>this.props.onSwitch(i,t),dangerouslySetInnerHTML:{__html:this.props.publish_menu_link_html}})})]})}}h.propTypes={id:n().number,name:n().string,category:n().string,publish_menu_icon:n().string,publish_menu_html:n().string,publish_menu_link_html:n().string,linkClass:n().string,switchTo:n().string,onSwitch:n().func.isRequired,displayCategory:n().bool};class p extends r.Component{render(){const{right:e,left:t,onSwitch:s,displayCategory:r}=this.props;return(0,c.jsxs)(c.Fragment,{children:[this.props.left&&(0,c.jsx)(h,{...u(t,s,r)}),this.props.right&&(0,c.jsx)(h,{...u(e,s,r)})]})}}function u(e,t,s){let r;return r=e.partner?"exportGuide":"guide",o().assign({},e,{switchTo:r,linkClass:void 0,onSwitch:t,displayCategory:s})}p.propTypes={left:n().object,right:n().object,onSwitch:n().func.isRequired,displayCategory:n().bool};var m=s(98019),x=s(32387),j=s(90919);class f extends r.Component{constructor(e){super(e),this.props.entries.length>2?this.state={shownCount:4}:this.state={shownCount:2}}showMore(){this.setState({shownCount:this.state.shownCount+4})}render(){const e=[];for(let t=0;t<this.state.shownCount&&!(this.props.entries.length<t+1);t+=2)e.push((0,c.jsx)(p,{left:this.props.entries[t],right:this.props.entries[t+1],onSwitch:this.props.onSwitch,displayCategory:this.props.displayCategory}));return(0,c.jsxs)(j.A,{children:[e.map((e,t)=>(0,c.jsxs)(r.Fragment,{children:[t>0&&(0,c.jsx)("hr",{}),(0,c.jsx)(m.A,{children:e})]},"outer-div"+t)),this.state.shownCount<this.props.entries.length&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("br",{}),(0,c.jsx)(x.A,{variant:"link",className:"btn-inline-link",onClick:()=>this.showMore(),children:(0,c.jsx)("small",{children:"Show more"})})]})]})}}f.propTypes={entries:n().array,onSwitch:n().func.isRequired,displayCategory:n().bool};var b=s(28957),y=s(82084),g=s(26591);class w extends r.Component{constructor(e){super(e);const t=o().flattenDeep(o().map(e.entries,(e,t)=>"featured"===t||"search"===t?[]:e.entries));this.entriesById=new Map;for(const e of t)this.entriesById.set(e.id,e);const s=o().map(e.entries,(e,t)=>{if("featured"!==t&&"search"!==t)return e.title}).filter(e=>e);this.categoryListing=o().initial(s).join(", ")+" or "+o().last(s),this.state={results:[]},this.searchIndex=new l.A({fields:["name","brand_name","publish_menu_html","publish_guide_html"]}),this.searchIndex.addAll(t),this.handleInput=this.handleInput.bind(this)}handleInput(e){let t;const s=e.target.value.trim();
1t=""===s?[]:this.searchIndex.search(s,{prefix:!0,fuzzy:.2,combineWith:"AND"});const r=[];for(const e of t){const t=this.entriesById.get(e.id);null!=t&&r.push(t)}this.setState({results:r})}handleSubmit(e){e.preventDefault()}render(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("form",{className:"search",id:"search",onSubmit:this.handleSubmit,children:(0,c.jsxs)(g.A,{controlId:"search",children:[(0,c.jsx)(y.A,{visuallyHidden:!0,children:"Search"}),(0,c.jsx)(b.A,{type:"text",name:"search-input",className:"form-control search-input",placeholder:this.categoryListing,onChange:this.handleInput})]})}),this.state.results.length>0&&(0,c.jsx)("div",{id:"search-results",children:(0,c.jsx)(f,{entries:this.state.results,onSwitch:this.props.onSwitch,displayCategory:!0})})]})}}w.propTypes={entries:n().object.isRequired,onSwitch:n().func.isRequired};const S=e=>{let{entries:t,onSwitch:s}=e;return o().map(t,(e,r)=>(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"affix-content-title","data-affix-target":r,children:e.title}),(0,c.jsx)("div",{className:"affix-subcontent",children:v(e,r,t,s)})]},"category-"+r))};function v(e,t,s,r){return"search"===t?(0,c.jsx)(w,{entries:s,onSwitch:r},"journal-search-"+t):(0,c.jsx)(f,{entries:e.entries,onSwitch:r},"publish-menu-"+t)}S.propTypes={entries:n().object.isRequired,onSwitch:n().func.isRequired};const N=S;class I extends r.Component{render(){const{entries:e}=this.props;return(0,c.jsx)("div",{className:"content-as-table",children:(0,c.jsx)(N,{entries:e,onSwitch:this.props.onSwitch})})}}I.propTypes={entries:n().object.isRequired,onSwitch:n().func.isRequired};const R=e=>{let{returnText:t,onReturn:s}=e;return s?(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(x.A,{variant:"link",className:"btn-inline-link mb-2",onClick:()=>s(null,null),children:t})}):null};R.propTypes={returnText:n().string,onReturn:n().func};const T=R;s(18683),s(18527);var _=s(16647);function k(e,t){let s;return o().forEach(e,e=>{s||(s=o().find(e.entries,e=>e.id===t))}),s}function A(e,t,s){return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,_.TB)(e,{body:t}).catch(e=>{throw e instanceof _.fk&&(e.message=e.getUserFacingMessage()),e})}(`/project/${t}/export/${e.id}`,s).then(e=>function(e,t,s){let r=`/project/${t}/export/${e}`;s&&(r+=`?token=${encodeURIComponent(s)}`);return function(e,t,s){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;return new Promise((i,n)=>{function a(){(0,_.hm)(e).then(e=>{s(e)?n(e):t(e)?i(e):setTimeout(()=>{r<1e4&&(r+=1e3),a()},r)}).catch(n)}a()})}(r,e=>{let{export_json:t}=e;return"succeeded"===t.status_summary},e=>{let{export_json:t}=e;return"failed"===t.status_summary})}(e.export_v1_id,t,e.token).then(t=>{const s=[t.export_json.v2_user_first_name,t.export_json.v2_user_last_name].filter(Boolean).join(" ");return{exportId:e.export_v1_id,message:e.message,token:e.token??t.export_json.token,submissionId:t.export_json.partner_submission_id,authorEmail:t.export_json.v2_user_email,authorName:s,title:t.export_json.title}}).catch(e=>{throw e.export_json?new Error(e.export_json.status_detail):e}))}var C=s(12761);class E extends r.Component{constructor(e){super(e),this.state={exportState:"uninitiated",errorDetails:null},this.initiateGuideExport=this.initiateGuideExport.bind(this)}initiateGuideExport(e,t,s){this.setState({exportState:"initiated"}),A(e,t).then(e=>{let{exportId:r,token:i}=e,n=`/project/${t}/export/${r}/${"zip"===s?"zip":"pdf"}`;i&&(n+=`?token=${encodeURIComponent(i)}`),this.props.downloadFile(n),this.setState({exportState:"uninitiated"})}).catch(e=>{this.setState({exportState:"error",errorDetails:e.message})})}render(){const{entry:e,returnText:t,onReturn:s,projectId:r}=this.props;return(0,c.jsx)("div",{className:"content-as-table",id:"publish-guide-"+e.id,children:(0,c.jsxs)(c.Fragment,{children:[s&&t&&(0,c.jsx)(T,{onReturn:s,returnText:t}),(0,c.jsx)(L,{guideHtml:e.publish_guide_html,renderDownload:(0,c.jsx)(U,{entry:e,projectId:r,exportState:this.state.exportState,initiateGuideExport:this.initiateGuideExport,errorDetails:this.state.errorDetails})}),e.publish_link_destination&&(0,c.jsxs)("div",{children:[(0,c.jsx)(U,{entry:e,projectId:r,exportState:this.state.exportState,initiateGuideExport:this.initiateGuideExport,errorDetails:this.state.errorDetails}),(0,c.jsx)(D,{entry:e})]})]})},e.id)}}function L(e){let{guideHtml:t,renderDownload:s}=e;if(-1!==t.indexOf("DOWNLOAD")){const e=t.split("DOWNLOAD");return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{dangerouslySetInnerHTML:{__html:e[0]}}),s,(0,c.jsx)("div",{style:{marginLeft:"140px",paddingLeft:"15px"},dangerouslySetInnerHTML:{__html:e[1]}})]})}return(0,c.jsx)("div",{dangerouslySetInnerHTML:{__html:t}})}function U(e){let{entry:t,projectId:s,exportState:r,initiateGuideExport:i,errorDetails:n}=e;return(0,c.jsxs)("div",{style:{marginLeft:"140px",paddingLeft:"15px"},children:[(0,c.jsx)("p",{children:(0,c.jsx)("strong",{children:"Step 1: Download files"})}),"uninitiated"===r&&(0,c.jsxs)("span",{children:[(0,c.jsx)("p",{children:(0,c.jsx)(x.A,{variant:"primary",onClick:()=>i(t,s,"zip"),children:"Download project ZIP with submission files (e.g. .bbl)"})}),(0,c.jsx)("p",{children:(0,c.jsx)(x.A,{variant:"primary",onClick:()=>i(t,s,"pdf"),children:"Download PDF file of your article"})})]}),"initiated"===r&&(0,c.jsx)("p",{style:{fontSize:20,margin:"20px 0px 20px"},children:(0,c.jsx)(C.A,{loadingText:"Compiling project, please wait"})}),"error"===r&&(0,c.jsxs)("p",{children:["Project failed to compile",(0,c.jsx)("br",{}),"Error message: ",n]})]})}function D(e){let{entry:t}=e;return(0,c.jsxs)("div",{style:{marginLeft:"140px",paddingLeft:"15px"},children:[(0,c.jsx)("p",{children:(0,c.jsx)("strong",{children:"Step 2: Submit your manuscript"})}),(0,c.jsx)("p",{children:(0,c.jsxs)(x.A,{variant:"primary",href:t.publish_link_destination,target:"_blank",rel:"noopener noreferrer","data-event":"link_submit","data-category":"Publish","data-action":"submit","data-label":t.id,children:["Submit to ",t.name]})})]})}E.defaultProps={downloadFile:function(e){window.location.href=e}},E.propTypes={entry:n().object.isRequired,returnText:n().string,onReturn:n().func,projectId:n().string.isRequired,downloadFile:n().func.isRequired},L.propTypes={guideHtml:n().string.isRequired,renderDownload:n().node},U.propTypes={entry:n().object.isRequired,projectId:n().string.isRequired,exportState:n().string.isRequired,initiateGuideExport:n().func.isRequired,errorDetails:n().string},D.propTypes={entry:n().object.isRequired};class F extends r.Component{render(){const{entries:e}=this.props,t=o().omit(e,"brand_data");return(0,c.jsxs)("div",{id:"publish-table",className:"content-as-table",children:[(0,c.jsx)(E,{entry:e.brand_data,projectId:this.props.initParams.projectId}),(0,c.jsx)("br",{}),(0,c.jsx)(N,{entries:t,onSwitch:this.props.onSwitch})]})}}function P(e){let{entry:t,onReturn:s,returnText:r,initParams:i,onSwitch:n}=e;const a=(0,c.jsx)("p",{dangerouslySetInnerHTML:{__html:t.publish_menu_html}}),o=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:(0,c.jsx)("b",{children:"Overleaf Gallery"})}
1),(0,c.jsx)("p",{children:"Thank you for your interest in sharing your work as a template with the Overleaf community!"}),(0,c.jsxs)("p",{children:["Submitting a document as a template to the Overleaf Gallery means that a copy of your document will be made"," ",(0,c.jsx)("b",{children:"publicly available for everyone on Overleaf"})," to find and reuse for their own work."]}),(0,c.jsxs)("p",{children:["Before you submit the template, make sure it doesnât contain identifiable personal details (please use only contents). Also, please make sure it conforms to our"," ",(0,c.jsx)("a",{href:"https://docs.overleaf.com/templates/submitting-to-the-overleaf-template-gallery",target:"_blank",rel:"noopener noreferrer",children:"submission guidelines"}),"."]})]});return(0,c.jsxs)(m.A,{className:"content-as-table",children:[(0,c.jsx)(d.A,{xs:12,children:(0,c.jsx)(T,{onReturn:s,returnText:r})}),(0,c.jsx)(d.A,{md:2,style:{verticalAlign:"top"},children:t.publish_menu_icon&&(0,c.jsx)("img",{src:t.publish_menu_icon,alt:t.name,style:{width:"100%",maxWidth:"106px",float:"right"}})}),(0,c.jsxs)(d.A,{md:10,children:["gallery"===t.partner?o:a,(0,c.jsx)(q,{...i,entry:t,onSwitch:n})]})]},t.id)}function q(e){let{entry:t,onSwitch:s,logs:r}=e;return(0,c.jsxs)("div",{children:["gallery"!==t.partner?(0,c.jsx)("p",{children:"To begin a direct export from Overleaf please click the button below"}):(0,c.jsx)(c.Fragment,{}),(0,c.jsx)("p",{children:(0,c.jsx)(x.A,{variant:"primary",onClick:()=>s("export",t.id),children:"gallery"===t.partner?"Begin submission":"Continue"})}),(0,c.jsx)("p",{children:"You will have a chance to confirm your submission on the next page before your files are sent."}),r.warnings.length>0&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:" Warning: "})," LaTeX warnings on this project may affect submissions. Please check the logs before continuing"]})]})}F.propTypes={entries:n().object.isRequired,onSwitch:n().func.isRequired,initParams:n().object.isRequired};const O=e=>{let t,{entry:s,projectId:r,exportId:i,token:n}=e;return t=s.publish_link_destination?V(s.publish_link_destination):"the journal's website",(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("p",{children:["This project has already been submitted to this journal, and this journal does not allow resubmission from within Overleaf. Please download your project files below and log in at ",t," to resubmit from there."]}),(0,c.jsx)("p",{children:(0,c.jsx)(x.A,{variant:"primary",onClick:()=>$(r,i,"zip",n),children:"Download project ZIP with submission files (e.g. .bbl)"})}),(0,c.jsx)("p",{children:(0,c.jsx)(x.A,{variant:"primary",onClick:()=>$(r,i,"pdf",n),children:"Download PDF file of your article"})})]})};function $(e,t,s,r){let i=`/project/${e}/export/${t}/${"zip"===s?"zip":"pdf"}`;r&&(i+=`?token=${encodeURIComponent(r)}`),window.location.href=i}const V=e=>(0,c.jsx)("a",{href:e,children:"the journal's website"});O.propTypes={entry:n().object.isRequired,projectId:n().string.isRequired,exportId:n().string.isRequired,token:n().string};const B=O;class G extends r.Component{constructor(e){super(e),this.state={exportState:"uninitiated",submissionValid:!0,errorDetails:null},this.handleSubmit=this.handleSubmit.bind(this)}handleSubmit(e){e.preventDefault();const{entry:t,projectId:s}=this.props;this.firstName.value&&this.lastName.value?(this.setState({submissionValid:!0,exportState:"initiated"}),A(t,s,{firstName:this.firstName.value,lastName:this.lastName.value}).then(e=>{let{exportId:t,token:s,message:r}=e;"RESUBMISSION"===r?this.setState({exportState:"resubmission",exportId:t,token:s}):this.setState({exportState:"complete"})}).catch(e=>{this.setState({exportState:"error",errorDetails:e.message})})):this.setState({submissionValid:!1})}render(){const{entry:e,onReturn:t,returnText:s,firstName:r,lastName:i,projectId:n}=this.props;return(0,c.jsx)("div",{className:"content-as-table",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(T,{onReturn:t,returnText:s}),(0,c.jsxs)("h3",{className:"mt-1",children:["Submit to: ",(0,c.jsx)("br",{}),(0,c.jsx)("strong",{children:e.name})]}),"uninitiated"===this.state.exportState&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Thanks for using Overleaf to submit your article."}),(0,c.jsx)("p",{children:"When you submit using the button below, your manuscript and supporting files will be sent to the journal automatically, and you will receive a confirmation email from Overleaf. The journal's editorial team will then send you a follow-up email with instructions for how to complete your submission."}),(0,c.jsx)("p",{children:"To send your article, please confirm your first and last name:"}),(0,c.jsxs)("form",{onSubmit:this.handleSubmit,children:[(0,c.jsxs)(g.A,{controlId:"ejp-first-name",children:[(0,c.jsx)(y.A,{children:"First Name"}),(0,c.jsx)(b.A,{type:"text",defaultValue:r,style:{width:"30%",display:"inline-block"},maxLength:"255",ref:e=>this.firstName=e})]}),(0,c.jsxs)(g.A,{controlId:"ejp-last-name",children:[(0,c.jsx)(y.A,{children:"Last Name"}),(0,c.jsx)(b.A,{type:"text",defaultValue:i,style:{width:"30%",display:"inline-block"},maxLength:"255",ref:e=>this.lastName=e})]}),(0,c.jsx)("br",{}),(0,c.jsxs)(x.A,{type:"submit",variant:"primary",children:["Submit to ",e.name]})]}
1),!this.state.submissionValid&&(0,c.jsx)("p",{className:"text-danger",children:"Please add valid first and last names before continuing"})]}),"initiated"===this.state.exportState&&(0,c.jsx)("div",{className:"my-3",children:(0,c.jsx)(C.A,{loadingText:"Exporting files, please wait"})}),"complete"===this.state.exportState&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Export Successful!"}),(0,c.jsxs)("p",{children:["Thanks for submitting to ",e.name,". Your manuscript and supporting files have been sent directly to the journal's editorial team, and they will send a follow-up email with instructions for how to complete your submission."]}),(0,c.jsx)("p",{children:"Please check your email for confirmation of your submission."})]}),"error"===this.state.exportState&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Export Failed"}),(0,c.jsxs)("p",{children:["Error message: ",this.state.errorDetails]})]}),"resubmission"===this.state.exportState&&(0,c.jsx)(B,{entry:e,projectId:n,exportId:this.state.exportId,token:this.state.token})]})},e.id)}}G.propTypes={entry:n().object.isRequired,returnText:n().string,onReturn:n().func,projectId:n().string.isRequired,firstName:n().string,lastName:n().string};class M extends r.Component{constructor(e){super(e),this.state={exportState:"uninitiated",submissionValid:!0,exportId:null,errorDetails:null},this.handleSubmit=this.handleSubmit.bind(this)}handleSubmit(e){e.preventDefault();const{entry:t,projectId:s}=this.props;this.firstName.value&&this.lastName.value?(this.setState({submissionValid:!0,exportState:"initiated"}),A(t,s,{firstName:this.firstName.value,lastName:this.lastName.value}).then(e=>{let{exportId:t,token:s,message:r}=e;"RESUBMISSION"===r?this.setState({exportState:"resubmission",exportId:t,token:s}):this.setState({exportState:"complete"})}).catch(e=>{this.setState({exportState:"error",errorDetails:e.message})})):this.setState({submissionValid:!1})}render(){const{entry:e,onReturn:t,returnText:s,hasFolders:r,projectId:i,firstName:n,lastName:a}=this.props;return r?(0,c.jsx)("div",{className:"content-as-table",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(T,{onReturn:t,returnText:s}),(0,c.jsxs)("h3",{className:"mt-1",children:["Submit to: ",(0,c.jsx)("br",{}),(0,c.jsx)("strong",{children:e.name})]}),(0,c.jsx)("p",{children:(0,c.jsx)("strong",{children:" Files must be at top folder level "})}),(0,c.jsxs)("p",{children:["This project has one or more files in subfolders, rather than at the top folder level. Although Overleaf allows you to create and nest folders within your project,",e.name," requires all files to be at the top level of your project."]}),(0,c.jsx)("p",{children:"Please move each of the above files to the top level of the project, check that your project renders properly, and then retry the submission. We apologize for the inconvenience."})]})},e.id):(0,c.jsx)("div",{className:"content-as-table",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(T,{onReturn:t,returnText:s}),(0,c.jsxs)("h3",{className:"mt-1",children:["Submit to: ",(0,c.jsx)("br",{}),(0,c.jsx)("strong",{children:e.name})]}),"uninitiated"===this.state.exportState&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Thanks for using Overleaf to submit your article."}),(0,c.jsx)("p",{children:"When you submit using the button below, your manuscript and supporting files will be sent to the journal automatically, and you will receive a confirmation email from Overleaf. The journal's editorial team will then send you a follow-up email with instructions for how to complete your submission."}),(0,c.jsx)("p",{children:"To send your article, please confirm your first and last name:"}),(0,c.jsxs)("form",{onSubmit:this.handleSubmit,children:[(0,c.jsxs)(g.A,{controlId:"emis-first-name",children:[(0,c.jsx)(y.A,{children:"First Name"}),(0,c.jsx)(b.A,{type:"text",defaultValue:n,style:{width:"30%",display:"inline-block"},maxLength:"255",ref:e=>this.firstName=e})]}),(0,c.jsxs)(g.A,{controlId:"emis-last-name",children:[(0,c.jsx)(y.A,{children:"Last Name"}),(0,c.jsx)(b.A,{type:"text",defaultValue:a,style:{width:"30%",display:"inline-block"},maxLength:"255",ref:e=>this.lastName=e})]}),(0,c.jsx)("br",{}),(0,c.jsxs)(x.A,{type:"submit",variant:"primary",children:["Submit to ",e.name]})]}
1),!this.state.submissionValid&&(0,c.jsx)("p",{className:"text-danger",children:"Please add valid first and last names before continuing"})]}),"initiated"===this.state.exportState&&(0,c.jsx)("div",{className:"my-3",children:(0,c.jsx)(C.A,{loadingText:"Exporting files, please wait"})}),"complete"===this.state.exportState&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Export Successful!"}),(0,c.jsxs)("p",{children:["Thanks for submitting to ",e.name,". Your manuscript and supporting files have been sent directly to the journal's editorial team, and they will send a follow-up email with instructions for how to complete your submission."]}),(0,c.jsx)("p",{children:"Please check your email for confirmation of your submission."})]}),"error"===this.state.exportState&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Export Failed"}),(0,c.jsxs)("p",{children:["Error message: ",this.state.errorDetails]})]}),"resubmission"===this.state.exportState&&(0,c.jsx)(B,{entry:e,projectId:i,exportId:this.state.exportId,token:this.state.token})]})},e.id)}}M.propTypes={entry:n().object.isRequired,returnText:n().string,onReturn:n().func,projectId:n().string.isRequired,hasFolders:n().bool,firstName:n().string,lastName:n().string};var H=s(87432),z=s(90593),W=s(41492),Z=s(19603);class X extends r.Component{constructor(e){super(e),this.state={exportState:"uninitiated",submissionValid:!0,errorDetails:null,allowTemplateChecked:!0},this.handleAllowTemplate=this.handleAllowTemplate.bind(this),this.handleSharingOptionsClick=this.handleSharingOptionsClick.bind(this)}handleAllowTemplate(){this.setState({allowTemplateChecked:!this.state.allowTemplateChecked})}handleSharingOptionsClick(){(0,H._)("gallery-submission-sharing-options-click")}runExport(e){if(e.preventDefault(),this.title.value&&this.author.value&&this.description.value&&this.license.value){const{entry:e,projectId:t}=this.props;this.setState({submissionValid:!0,exportState:"initiated"});A(e,t,{title:this.title.value,author:this.author.value,description:this.description.value,license:this.license.value,showSource:this.state.allowTemplateChecked}).then(()=>{this.setState({exportState:"complete"})}).catch(e=>{this.setState({exportState:"error",errorDetails:e.message})})}else this.setState({submissionValid:!1})}renderUninitiated(){const{entry:e,author:t,title:s,description:r,license:i}=this.props;return(0,c.jsxs)(z.A,{onSubmit:e=>this.runExport(e),children:[(0,c.jsxs)("p",{children:["Almost done! Please provide some final information to complete your submission."," ",(0,c.jsx)("b",{children:"This is what people browsing the Overleaf Gallery will see when previewing your template."})]}),(0,c.jsx)("p",{children:"If you obtained the template from another source, please include a link to the webpage you obtained it from in the description box. If this template was not authored by you, please ensure that the template is licensed to be reposted."}),(0,c.jsxs)(g.A,{controlId:"gallery-export-title",className:"row",children:[(0,c.jsx)(d.A,{xs:2,children:(0,c.jsx)(y.A,{column:!0,children:"Title"})}),(0,c.jsx)(d.A,{xs:10,children:(0,c.jsx)(b.A,{type:"text",defaultValue:s,maxLength:"255",ref:e=>this.title=e})})]}),(0,c.jsxs)(g.A,{controlId:"gallery-export-author",className:"row",children:[(0,c.jsx)(d.A,{xs:2,children:(0,c.jsx)(y.A,{column:!0,children:"Author(s)"})}),(0,c.jsx)(d.A,{xs:10,children:(0,c.jsx)(b.A,{type:"text",defaultValue:t,maxLength:"255",ref:e=>this.author=e})})]}),(0,c.jsxs)(g.A,{controlId:"gallery-export-description",className:"row",children:[(0,c.jsx)(d.A,{xs:2,children:(0,c.jsx)(y.A,{column:!0,children:"Description"})}),(0,c.jsx)(d.A,{xs:10,children:(0,c.jsx)(b.A,{as:"textarea",rows:"4",defaultValue:r,maxLength:"5000",ref:e=>{this.description=e}})})]}),(0,c.jsxs)(g.A,{controlId:"gallery-export-license",className:"row",children:[(0,c.jsx)(d.A,{xs:2,children:(0,c.jsx)(y.A,{column:!0,children:"License"})}),(0,c.jsx)(d.A,{xs:10,children:(0,c.jsxs)("div",{className:"gallery-export-license",children:[(0,c.jsxs)(W.A,{ref:e=>this.license=e,defaultValue:i,children:[(0,c.jsx)("option",{value:"cc_by_4.0",children:"Creative
1Commons CC BY 4.0"}),(0,c.jsx)("option",{value:"lppl_1.3c",children:"LaTeX Project Public License 1.3c"}),(0,c.jsx)("option",{value:"other",children:"Other (as stated in the work)"})]}),(0,c.jsx)("a",{className:"ms-2",href:"https://docs.overleaf.com/templates/licensing-and-copyright",target:"_blank",rel:"noopener noreferrer",children:"(?)"})]})})]}),(0,c.jsx)(g.A,{controlId:"gallery-export-show-source",className:"row",children:(0,c.jsxs)(d.A,{xs:{span:10,offset:2},children:[(0,c.jsx)(Z.A,{type:"checkbox",checked:this.state.allowTemplateChecked,onChange:this.handleAllowTemplate,label:(0,c.jsxs)("strong",{children:["I have read the"," ",(0,c.jsx)("a",{href:"https://docs.overleaf.com/templates/submitting-to-the-overleaf-template-gallery",target:"_blank",rel:"noopener noreferrer",children:"submission guidelines"}),", and I allow my project to be used as a template by others on Overleaf"]})}),!this.state.allowTemplateChecked&&(0,c.jsxs)("div",{className:"text-small",children:["Overleaf Gallery is intended for sharing"," ",(0,c.jsx)("b",{children:"public templates only"}),". If you want to:",(0,c.jsxs)("ul",{children:[(0,c.jsxs)("li",{children:["publish a final document, consider using another platform such as"," ",(0,c.jsx)("a",{href:"https://figshare.com/",target:"_blank",rel:"noopener noreferrer",children:"figshare"}),"."]}),(0,c.jsxs)("li",{children:["share your project with collaborators only, consider using the"," ",(0,c.jsx)("a",{onClick:this.handleSharingOptionsClick,href:"https://docs.overleaf.com/collaborating/sharing-a-project",target:"_blank",rel:"noopener noreferrer",children:"project sharing options"}),"."]})]})]})]})}),(0,c.jsx)(g.A,{className:"row",children:(0,c.jsxs)(d.A,{xs:{span:10,offset:2},children:[(0,c.jsxs)(x.A,{variant:"primary",type:"submit",disabled:!this.state.allowTemplateChecked,children:["Submit to ",e.name]}
1),!this.state.submissionValid&&(0,c.jsx)("p",{className:"text-danger",children:"Please provide all of title, author(s) and description before continuing"})]})})]})}renderInitiated(){return(0,c.jsx)("div",{className:"my-3",children:(0,c.jsx)(C.A,{loadingText:"Exporting files, please wait"})})}renderComplete(){return(0,c.jsxs)("p",{children:["Thank you for your submission to the Overleaf Gallery! Your submission is pending, and ",(0,c.jsx)("b",{children:"requires action from you"})," â weâve sent you an email with instructions."]})}renderError(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Export Failed"}),(0,c.jsxs)("p",{children:["Error message: ",this.state.errorDetails]})]})}render(){const{entry:e,onReturn:t,returnText:s}=this.props;let r;return r="uninitiated"===this.state.exportState?this.renderUninitiated():"initiated"===this.state.exportState?this.renderInitiated():"complete"===this.state.exportState?this.renderComplete():this.renderError(),(0,c.jsxs)("div",{className:"content-as-table",children:[(0,c.jsx)(T,{onReturn:t,returnText:s}),(0,c.jsxs)("h3",{className:"mt-1",children:["Submit to: ",(0,c.jsx)("strong",{children:e.name})]}),r]},e.id)}}X.propTypes={entry:n().object.isRequired,returnText:n().string,onReturn:n().func,projectId:n().string.isRequired,author:n().string,title:n().string,description:n().string,license:n().string};class Y extends r.Component{constructor(e){super(e),this.state={exportState:"uninitiated",errorDetails:null}}runExport(e,t){this.setState({exportState:"initiated"}),A(e,t).then(e=>{let{exportId:t,token:s,submissionId:r}=e;this.setState({exportState:"complete",exportId:`${t}${s}`,submissionId:r})}).catch(e=>{this.setState({exportState:"error",errorDetails:e.message})})}componentDidUpdate(){"complete"===this.state.exportState&&this.submitButton.click()}renderUninitiated(e,t){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Thanks for using Overleaf to submit your article."}),(0,c.jsx)("p",{children:"Use the button below to send a PDF of your paper and a ZIP file of the LaTeX source files to the journalâs submission site."}),(0,c.jsx)("p",{children:"Log In or Create an Account on the next screen."}),(0,c.jsx)("p",{children:"Once you have logged in,"}),(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:"If you have just started, you will be on the first step of the submission process and your files will be automatically attached."}),(0,c.jsx)("li",{children:"If you have edited an existing project, you will be on the step where the Overleaf files are replaced by your latest version."})]}),(0,c.jsx)("br",{}),(0,c.jsxs)(x.A,{variant:"primary",onClick:()=>this.runExport(e,t),children:["Submit to ",e.name]})]})}renderInitiated(){return(0,c.jsx)("div",{className:"my-3",children:(0,c.jsx)(C.A,{loadingText:"Exporting files, please wait"})})}renderComplete(){return(0,c.jsxs)("form",{action:this.props.entry.export_url,method:"post",id:"export_form","data-testid":"export-complete",children:[(0,c.jsx)("input",{id:"export_id",name:"export_id",type:"hidden",value:this.state.exportId}),(0,c.jsx)("input",{id:"submission_id",name:"submission_id",type:"hidden",value:this.state.submissionId}),(0,c.jsx)("input",{id:"EXT_ACTION",name:"EXT_ACTION",type:"hidden",value:"OVERLEAF_SUBMISSION"}),(0,c.jsx)("button",{style:{display:"none"},ref:e=>{this.submitButton=e},children:"Submit"})]})}renderError(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Export Failed"}),(0,c.jsxs)("p",{children:["Error message: ",this.state.errorDetails]})]})}render(){const{entry:e,onReturn:t,projectId:s,returnText:r}=this.props;let i;return i="uninitiated"===this.state.exportState?this.renderUninitiated(e,s):"initiated"===this.state.exportState?this.renderInitiated(e,s):"complete"===this.state.exportState?this.renderComplete(e):this.renderError(),(0,c.jsxs)("div",{className:"content-as-table",children:[(0,c.jsx)(T,{onReturn:t,returnText:r}),(0,c.jsxs)("h3",{className:"mt-1",children:["Submit to: ",(0,c.jsx)("br",{}),(0,c.jsx)("strong",{children:e.name})]}),i]},e.id)}}Y.propTypes={entry:n().object.isRequired,returnText:n().string,onReturn:n().func,projectId:n().string.isRequired};var J=s(27395);class K extends r.Component{constructor(e){super(e),this.state={exportState:"uninitiated",errorDetails:null}}runExport(e,t){this.setState({exportState:"initiated"});const{siteUrl:s}=(0,J.A)("ol-ExposedSettings");A(e,t).then(e=>{let{authorEmail:t,authorName:r,title:i,exportId:n,token:a}=e;this.setState({exportState:"complete",authorEmail:t,authorName:r,title:i,articleZipURL:`${s}/exports/${n}${a}.zip`,pdfURL:`${s}/exports/${n}${a}.pdf`,revisionURL:`${s}/exports/${n}${a}/revise`,submissionURL:"",publicationURL:"",rejectionURL:"",newVersionURL:"",articleId:""})}).catch(e=>{this.setState({exportState:"error",errorDetails:e.message})})}componentDidUpdate(){"complete"===this.state.exportState&&this.submitButton.click()}renderUninitiated(e,t){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Thanks for using Overleaf to write your article."}),(0,c.jsxs)("p",{children:["When you are ready to submit, then click",(0,c.jsxs)("strong",{children:[" Submit to ",e.name]})," below. (Your files will be sent to ",e.name," by Overleaf)"]}),(0,c.jsxs)(x.A,{"data-testid":"submit-button",variant:"primary",onClick:()=>this.runExport(e,t),children:["Submit to ",e.name]})]})}renderInitiated(){return(0,c.jsx)("div",{className:"my-3",children:(0,c.jsx)(C.A,{loadingText:"Exporting files, please wait"})})}renderComplete(){return(0,c.jsxs)("form",{action:this.props.entry.export_url,method:"GET","data-testid":"export-complete",children:[(0,c.jsx)("input",{id:"authorEmail",n
1ame:"authorEmail",type:"hidden",value:this.state.authorEmail}),(0,c.jsx)("input",{id:"authorName",name:"authorName",type:"hidden",value:this.state.authorName}),(0,c.jsx)("input",{id:"title",name:"title",type:"hidden",value:this.state.title}),(0,c.jsx)("input",{id:"articleZipURL",name:"articleZipURL",type:"hidden",value:this.state.articleZipURL}),(0,c.jsx)("input",{id:"pdfURL",name:"pdfURL",type:"hidden",value:this.state.pdfURL}),(0,c.jsx)("input",{id:"revisionURL",name:"revisionURL",type:"hidden",value:this.state.revisionURL}),(0,c.jsx)("input",{id:"submissionURL",name:"submissionURL",type:"hidden",value:""}),(0,c.jsx)("input",{id:"publicationURL",name:"publicationURL",type:"hidden",value:""}),(0,c.jsx)("input",{id:"rejectionURL",name:"rejectionURL",type:"hidden",value:""}),(0,c.jsx)("input",{id:"newVersionURL",name:"newVersionURL",type:"hidden",value:""}),(0,c.jsx)("input",{id:"articleId",name:"articleId",type:"hidden",value:""}),(0,c.jsx)("button",{style:{display:"none"},ref:e=>{this.submitButton=e},children:"Submit"})]})}renderError(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:"Export Failed"}),(0,c.jsxs)("p",{children:["Error message: ",this.state.errorDetails]})]})}render(){const{entry:e,onReturn:t,projectId:s,returnText:r}=this.props;let i;return i="uninitiated"===this.state.exportState?this.renderUninitiated(e,s):"initiated"===this.state.exportState?this.renderInitiated(e,s):"complete"===this.state.exportState?this.renderComplete():this.renderError(),(0,c.jsxs)("div",{className:"content-as-table",children:[(0,c.jsx)(T,{onReturn:t,returnText:r}),(0,c.jsxs)("h3",{className:"mt-1",children:["Submit to: ",(0,c.jsx)("br",{}),(0,c.jsx)("strong",{children:e.name})]}),i]},e.id)}}K.propTypes={entry:n().object.isRequired,returnText:n().string,onReturn:n().func,projectId:n().string.isRequired};class Q extends r.Component{render(){const{guideId:e,initialEntry:t,entries:s,onSwitch:r,shown:i,initParams:n}=this.props;let a,o,l;return t&&e===t.id?(a=t,s.journal&&s.journal.entries.length>1&&s.brand_data.active&&(l="More "+s.brand_data.name+" Journals",o=r)):(a=k(s,e),l="Back to Journals and Services",o=r),"guide"===i?(0,c.jsx)(E,{onReturn:o,entry:a,returnText:l,projectId:n.projectId}):"export"===i?"gallery"===a.partner?(0,c.jsx)(X,{onReturn:o,entry:a,returnText:l,projectId:n.projectId,firstName:n.firstName,lastName:n.lastName,title:n.title,author:n.author,description:n.description,license:n.license,showSource:n.showSource,hasFolders:n.hasFolders}):"scholar_one"===a.partner?(0,c.jsx)(Y,{onReturn:o,entry:a,returnText:l,projectId:n.projectId}):"f1000"===a.partner||"wellcome_trust"===a.partner?(0,c.jsx)(K,{onReturn:o,entry:a,partnerName:a.name,partnerContactURL:a.home_url+"/contact",returnText:l,projectId:n.projectId}):"ejp"===a.partner?(0,c.jsx)(G,{onReturn:o,entry:a,returnText:l,projectId:n.projectId,firstName:n.firstName,lastName:n.lastName}):(0,c.jsx)(M,{onReturn:o,entry:a,returnText:l,projectId:n.projectId,firstName:n.firstName,lastName:n.lastName,hasFolders:n.hasFolders}):"exportGuide"===i?(0,c.jsx)(P,{onReturn:o,entry:a,returnText:l,projectId:n.projectId,onSwitch:r,initParams:n}):null}}Q.propTypes={entries:n().object.isRequired,initialEntry:n().object,guideId:n().number.isRequired,shown:n().string.isRequired,onSwitch:n().func.isRequired,initParams:n().object.isRequired};class ee extends r.Component{constructor(e){super(e),this.state={shown:e.initialShown,baseReturn:e.initialShown},this.handleSwitch=this.handleSwitch.bind(this),"guide"!==e.initialShown&&"export"!==e.initialShown||(this.state.initialEntry=k(e.entries,e.brandVariationId),this.state.guideId=this.state.initialEntry.id,this.state.baseReturn="branded")}handleSwitch(e,t){e?this.setState({shown:e,guideId:t}):this.setState({shown:this.state.baseReturn,guideId:null})}render(){const{entries:e,initParams:t}=this.props;return t.pdfUrl?t.logs.errors&&t.logs.errors.length>0?(0,c.jsx)("p",{children:(0,c.jsx)("strong",{children:"This project has LaTeX errors, which can cause problems with your submission. Please check the logs, fix the errors and try submitting again."})}
1):t.rootDocOverridden?(0,c.jsx)("p",{children:(0,c.jsx)("strong",{children:"The current document in the editor has a documentclass command but is not the project's main document. To ensure you are submitting the project as intended, please switch to the project's main document and recompile before continuing."})}):t.uncompiled?(0,c.jsx)("p",{children:(0,c.jsx)("strong",{children:"This project has been changed since it was last compiled. Please recompile the project and submit again."})}):"basic"===this.state.shown?(0,c.jsx)(I,{entries:this.props.entries,onSwitch:this.handleSwitch}):"guide"===this.state.shown||"exportGuide"===this.state.shown||"export"===this.state.shown?(0,c.jsx)(Q,{onSwitch:this.handleSwitch,entries:e,guideId:this.state.guideId,initParams:t,shown:this.state.shown,initialEntry:this.state.initialEntry}):"branded"===this.state.shown?(0,c.jsx)(F,{onSwitch:this.handleSwitch,entries:e,initialEntry:this.state.initialEntry,initParams:t}):void 0:(0,c.jsx)("p",{children:(0,c.jsx)("strong",{children:"No current PDF. Please make sure your project compiles before submitting."})})}}ee.propTypes={entries:n().object.isRequired,initialShown:n().string.isRequired,initParams:n().object.isRequired,brandVariationId:n().number}},28870(e,t,s){s.d(t,{A:()=>A});var r=s(83764),i=s.n(r),n=s(66485),a=s(12962),o=s(46886),l=s(44273);const d=n.forwardRef(({className:e,bsPrefix:t,as:s="div",...r},n)=>(t=(0,a.oU)(t,"card-footer"),(0,l.jsx)(s,{ref:n,className:i()(e,t),...r})));d.displayName="CardFooter";const c=d;var h=s(83616);const p=n.forwardRef(({bsPrefix:e,className:t,as:s="div",...r},o)=>{const d=(0,a.oU)(e,"card-header"),c=(0,n.useMemo)(()=>({cardHeaderBsPrefix:d}),[d]);return(0,l.jsx)(h.A.Provider,{value:c,children:(0,l.jsx)(s,{ref:o,...r,className:i()(t,d)})})});p.displayName="CardHeader";const u=p,m=n.forwardRef(({bsPrefix:e,className:t,variant:s,as:r="img",...n},o)=>{const d=(0,a.oU)(e,"card-img");return(0,l.jsx)(r,{ref:o,className:i()(s?`${d}-${s}`:d,t),...n})});m.displayName="CardImg";const x=m,j=n.forwardRef(({className:e,bsPrefix:t,as:s="div",...r},n)=>(t=(0,a.oU)(t,"card-img-overlay"),(0,l.jsx)(s,{ref:n,className:i()(e,t),...r})));j.displayName="CardImgOverlay";const f=j,b=n.forwardRef(({className:e,bsPrefix:t,as:s="a",...r},n)=>(t=(0,a.oU)(t,"card-link"),(0,l.jsx)(s,{ref:n,className:i()(e,t),...r})));b.displayName="CardLink";const y=b;var g=s(93850);const w=(0,g.A)("h6"),S=n.forwardRef(({className:e,bsPrefix:t,as:s=w,...r},n)=>(t=(0,a.oU)(t,"card-subtitle"),(0,l.jsx)(s,{ref:n,className:i()(e,t),...r})));S.displayName="CardSubtitle";const v=S,N=n.forwardRef(({className:e,bsPrefix:t,as:s="p",...r},n)=>(t=(0,a.oU)(t,"card-text"),(0,l.jsx)(s,{ref:n,className:i()(e,t),...r})));N.displayName="CardText";const I=N,R=(0,g.A)("h5"),T=n.forwardRef(({className:e,bsPrefix:t,as:s=R,...r},n)=>(t=(0,a.oU)(t,"card-title"),(0,l.jsx)(s,{ref:n,className:i()(e,t),...r})));T.displayName="CardTitle";const _=T,k=n.forwardRef(({bsPrefix:e,className:t,bg:s,text:r,border:n,body:d=!1,children:c,as:h="div",...p},u)=>{const m=(0,a.oU)(e,"card");return(0,l.jsx)(h,{ref:u,...p,className:i()(t,m,s&&`bg-${s}`,r&&`text-${r}`,n&&`border-${n}`),children:d?(0,l.jsx)(o.A,{children:c}):c})});k.displayName="Card";const A=Object.assign(k,{Img:x,Title:_,Subtitle:v,Body:o.A,Link:y,Text:I,Header:u,Footer:c,ImgOverlay:f})},46886(e,t,s){var r=s(66485),i=s(83764),n=s.n(i),a=s(12962),o=s(44273);const l=r.forwardRef(({className:e,bsPrefix:t,as:s="div",...r},i)=>(t=(0,a.oU)(t,"card-body"),(0,o.jsx)(s,{ref:i,className:n()(e,t),...r})));l.displayName="CardBody";const d=l;s.d(t,["A",0,d])}}]);
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.