PageSourceSearch

https://dashboard.goldenvolunteer.com/_next/static/chunks/pages/[o…/create_from_template-f75e15b802de3ba4.js

js goldenvolunteer.com collected 2026-09-24 10:54:33 UTC 6,227 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8425],{19463:(t,e,i)=>{"use strict";i.r(e),i.d(e,{__N_SSP:()=>W,default:()=>L});var n=i(37876),o=i(14232),a=i(95062),s=i.n(a),r=i(65013),l=i.n(r),u=i(10239),p=i.n(u),c=i(16968),d=i.n(c),m=i(65698),h=i(34657),y=i(41728),g=i(91810),x=i(52991),A=i(32555),C=i(66922),f=i(12999),b=i(64359),v=i(73963),_=i(21182),O=i(19990),j=i(52551),w=i(862),T=i(28993),S=i(66703),k=i(41177),N=i(16773),E=i(50156);let I=(0,T.n9)()(()=>({backLink:{padding:"0 10px",marginBottom:40,"& .no-action":{cursor:"inherit"},"& .no-action:hover > span":{textDecoration:"none !important"},"& .btnLabelWrapper svg.MuiSvgIcon-root":{height:13,width:13}}})),P=t=>{var e;let{t:i,currentOrganization:a,router:s,onValidateSubmission:r,validationContent:u,theme:p,isMobileViewport:c,opportunityTypes:d,oppId:y,sideNavCollapsed:x,classes:A}=t,[C,v]=(0,o.useState)(!1),w=(0,o.useContext)(f.A),{user:T}=(0,o.useContext)(b.A),{onImageSelected:S,onFileSelected:k,templateOpportunities:N}=w,[E,I]=(0,o.useState)(!1),P=l()(N,t=>t.id===y),z=null!=(e=null==P?void 0:P.allManagers)?e:[],W=!a.permissions.has(O.Jj.MANAGE_ALL_OPPORTUNITIES)&&a.permissions.has(O.Jj.CREATE_OPPORTUNITIES),L=z.some(t=>t.id===T.id);W&&!L&&(z=[...z,T]);let V={...P,__templatedOpportunity:!0,fromTemplateId:P.id,allManagers:z};delete V.id;let M=(0,o.useRef)(V),R=async t=>{await r(t);let e=await w.createOpportunity(t);"template"!==e.status?s.push("/".concat(a.id,"/opportunity/").concat(e.id)):s.push("/".concat(a.id,"/opportunities/all"))},U=0;return c||(U=x?p.custom.AsideWidthCollapsed:p.custom.AsideWidth),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:A.backLink,children:[(0,n.jsx)(h.N_,{href:"/".concat(a.id,"/opportunities/redirect"),children:(0,n.jsx)(g.A,{variant:"text",afterIcon:(0,n.jsx)(m.A,{}),children:i("opportunities","Opportunities")})}),(0,n.jsx)(g.A,{variant:"text",className:"no-action",children:i("createAnOpportunity","Create an Opportunity")})]}),(0,n.jsx)(j.A,{t:i,displayAs:"page",overrideMode:"all-template",opportunityTypes:d,currentOrganization:a,initialValues:M.current,onSubmitOpportunityClick:R,onImageSelected:S,onFileSelected:k,fetching:w.fetching,leftFooterOffset:U,onCancelClick:()=>v(!0),isClosing:E}),C&&(0,n.jsx)(_.A,{open:!0,t:i,title:i("cancel-create-opportunity","Cancel Create Opportunity"),onConfirm:()=>{I(!0),setTimeout(()=>{I(!1),s.push("/".concat(a.id,"/opportunities/all"))},250)},onDismiss:()=>v(!1)}),u]})},z=t=>{let e=(0,E.rd)(),i=(0,S.A)(),{t:a}=(0,N.useTranslation)("common"),{companyName:s}=(0,o.useContext)(v.A),{chat:r}=(0,o.useContext)(x.A),{onValidateSubmission:l,displayContent:u}=(0,y.A)({t:a,API:k.Ay});(0,o.useEffect)(()=>(r&&r.hide(),()=>{r&&r.show()}),[r]);let{sideNavCollapsed:c}=(0,o.useContext)(w.C3);(0,E.HU)(a("page-name-oppcreate","{{companyName}} - Create Opportunity",{companyName:s}));let{classes:m}=I(),g=(0,o.useContext)(h.eB),[f,b]=(0,o.useState)(!1),[_,O]=(0,o.useState)(),{currentOrganization:j,opportunityTypes:T}=g,{orgId:z,oppId:W}=t,L=(0,h.UQ)({key:"xs"});return((0,o.useEffect)(()=>{(async()=>{let t=await k.Ay.userClient().call({url:"organizations/".concat(z,"/opportunities"),params:{includeNextTimeslot:!0,showAvailableTemplates:!0}}),e=d()(t,"id");p()(e,W)?O(t):b(!0)})()},[]),f)?(0,n.jsx)(A.A,{header:a("template-unable-to-load","Unable to load Template"),message:a("template-unassigned-error","Your organization must be assigned to that template as a Partner or Chapter to be able to make use of it. Please contact [email protected] for help.")}):_?(0,n.jsx)(h.h1,{API:k.Ay,t:a,templateOpportunities:_,opportunityTypes:T,currentOrganization:j,children:(0,n.jsx)(P,{t:a,oppId:W,currentOrganization:j,router:e,theme:i,isMobileViewport:L,onValidateSubmission:l,validationContent:u,opportunityTypes:T,sideNavCollapsed:c,classes:m})}):(0,n.jsx)(C.A,{})};z.propTypes={orgId:s().string.isRequired};var W=!0;let L=z},21182:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(37876);i(14232);var o=i(13659),a=i(75620),s=i(94314);let r=t=>{let{t:e,title:i,open:r,onDismiss:l,onConfirm:u}=t,p=e("cancel-opportunity-creation-message","Are you sure you want to cancel?"),c=e("cancel-opportunity-creation-message-sub","You will lose any progress and this cannot be restored.");return(0,n.jsxs)(a.A,{fullWidth:!0,maxWidth:"sm",alignContent:"leftOnly",open:r,title:i,toggleVisibility:l,actions:{positive:{label:e("yes-cancel","Yes, Cancel"),onClick:u},negative:{label:e("no-continue","No, Continue"),onClick:l}},children:[(0,n.jsx)(o.A,{children:p}),(0,n.jsx)(s.A,{children:c})]})}},41728:(t,e,i)=>{"use strict";i.d(e,{A:()=>u});var n=i(37876),o=i(14232),a=i(12571),s=i(40435),r=i(1665),l=i(58666);let u=t=>{let e,{t:i,API:u}=t,[p,c]=(0,o.useState)(!1),[d,m]=(0,o.useState)(),[h,y]=(0,o.useState)(),[g,x]=(0,o.useState)(),{currentOrganization:A}=(0,o.useContext)(l.A);return(null==d?void 0:d.length)?(console.log("The opportunity that did not work",h),e=(0,n.jsxs)(r.A,{t:i,open:g,fullWidth:!0,maxWidth:"sm",title:i("opportunity-submission-exceeded-limits","Opportunity Submission Exceeded 
1Limits"),alignContent:"leftOnly",toggleVisibility:()=>x(!1),actions:{negative:{label:i("continue-editing","Continue Editing"),onClick:()=>x(!1)}},children:[i("organization-limit-opportunity-error","Your submission of this opportunity would have exceeded the following limits. Try saving as a draft or template to save your work, and upgrade your plan to allow unlimited Opportunity creation."),(0,n.jsx)("ul",{children:d.map(t=>(0,n.jsx)("li",{children:t.label},t.label))})]})):p&&(e=(0,n.jsx)(s.A,{})),{displayContent:e,onValidateSubmission:async t=>{if((null==A?void 0:A.limits)&&"template"!==t.status&&!t.isTemplate&&"draft"!==t.status)try{x(!0),y(t),c(!0),m([]);let e=await u.userClient().call({method:"post",url:"organizations/".concat(A.id,"/opportunity_submission_errors"),data:{opportunity:(0,a.A)(t)}});if(c(!1),null==e?void 0:e.length)return m(e),Promise.reject("Server reported errors")}finally{c(!1)}}}}},85966:(t,e,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[orgId]/opportunities/[listType]/create_from_template",function(){return i(19463)}])}},t=>{var e=e=>t(t.s=e);t.O(0,[1316,2551,636,6593,8792],()=>(e(3821),e(85966))),_N_E=t.O()}]);

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.