1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[713],{7329:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(676);var a=r(2961);function s(e){return function(e){if(Array.isArray(e))return(0,n.Z)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||(0,a.Z)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},4837:function(e,t,r){"use strict";var n=r(5893);r(7294);t.Z=function(e){var t=e.file,r=e.setFile,a=e.isImage,s=e.id;return(0,n.jsx)("div",{className:"flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md",children:(0,n.jsxs)("div",{className:"w-full space-y-1 text-center",children:[t?(0,n.jsxs)("div",{className:"w-full",children:[a?(0,n.jsx)("img",{src:URL.createObjectURL(t),alt:"project cover image",className:"object-cover mx-auto rounded-lg max-h-80"}):(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-12 h-12 mx-auto text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),(0,n.jsx)("p",{className:"w-full text-gray-400 truncate",children:t.name})]}):(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-12 h-12 mx-auto text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),(0,n.jsx)("div",{className:"flex justify-center text-sm text-gray-600",children:(0,n.jsxs)("label",{htmlFor:s,className:"relative font-medium text-indigo-600 rounded-md cursor-pointer hover:text-indigo-500 focus-within:outline-none",children:[(0,n.jsxs)("span",{children:[t?"Change":"Upload"," a file"]}),(0,n.jsx)("input",{id:s,name:s,type:"file",accept:a?"image/*":"*",onChange:function(e){return r(e.target.files?e.target.files[0]:null)},className:"sr-only"})]})})]})})}},9961:function(e,t,r){"use strict";r.r(t);var n=r(7329),a=r(5893),s=r(7757),c=r.n(s),o=r(2137),i=r(7294),l=r(3747),u=r(8638),d=r(4837),p=r(6049),m=r(1163),h=r(632),x=r(2793),f=r(3826),j=r(8526);function v(e,t){var r;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"===typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(e,t)}(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,c=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return c=e.done,e},e:function(e){o=!0,s=e},f:function(){try{c||null==r.return||r.return()}finally{if(o)throw s}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}t.default=function(){var e=(0,m.useRouter)(),t=(0,i.useState)(""),r=t[0],s=t[1],g=(0,i.useState)(""),b=g[0],w=g[1],N=(0,i.useState)([]),y=(N[0],N[1],(0,i.useState)([])),P=(y[0],y[1],(0,i.useState)(null)),k=P[0],Z=P[1],C=(0,i.useState)(0),I=C[0],S=C[1],T=(0,i.useState)(0),A=T[0],E=T[1],B=(0,i.useState)(0),_=B[0],F=B[1],L=(0,i.useState)([]),D=L[0],M=L[1],O=(0,i.useState)(null),U=O[0],W=O[1],Y=e.query.pid;(0,i.useEffect)((function(){(function(){var e=(0,o.Z)(c().mark((function e(){var t,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!Y){e.next=19;break}return e.next=4,h.Z.getProjectById(Y);case 4:if(!(t=e.sent).data.success){e.next=18;break}if("REMIX_REVIEW"!=(r=t.data.data).status){e.next=9;break}throw"You can not edit project info at this moment.";case 9:s(r.name),w(r.description),F(r.sovereignPercentage),S(r.charmerPercentage),E(r.predictedProphetPercentage),M(r.prophets),W(r),e.next=19;break;case 18:throw"Can not find project info.";case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(0),(0,x.v)(e.t0);case 24:case"end":return e.stop()}}),e,null,[[0,21]])})));return function(){return e.apply(this,arguments)}})()()}),[Y]);var R=function(){var t=(0,o.Z)(c().mark((function t(){var n,a,s,o,i;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!U){t.next=46;break}if(r){t.next=4;break}throw"You must fill the name of your project.";case 4:if(b){t.next=6;break}throw"You must fill the description of your project.";case 6:if(console.log(I+A+_),I+A+_==100){t.next=9;break}throw"The total percentage share of the project should be 100.";case 9:if(!D.length){t.next=14;break}if(n=0,D.forEach((function(e){return n+=e.percentage})),n==A){t.next=14;break}throw"Prophet percentage is not right.";case 14:a=v(D),t.prev=15,a.s();case 17:if((s=a.n()).done){t.next=24;break}return o=s.value,t.next=21,h.Z.updateProphetPercentage({prophetId:o.id,percentage:o.percentage});case 21:t.sent;case 22:t.next=17;break;case 24:t.next=29;break;
1case 26:t.prev=26,t.t0=t.catch(15),a.e(t.t0);case 29:return t.prev=29,a.f(),t.finish(29);case 32:if(i=null,!k){t.next=37;break}return t.next=36,f.Z.uploadFile(k,"project-cover");case 36:i=t.sent;case 37:return t.next=39,h.Z.updateProject({projectId:U.id,name:r,description:b,coverImage:i||U.coverImage,charmerPercentage:I,predictedProphetPercentage:A,sovereignPercentage:_});case 39:if(!t.sent.data.success){t.next=45;break}(0,x.V)("Update project info success"),e.push("/dev/project/".concat(U.id)),t.next=46;break;case 45:throw"Update project info failed.";case 46:t.next=51;break;case 48:t.prev=48,t.t1=t.catch(0),(0,x.v)(t.t1);case 51:case"end":return t.stop()}}),t,null,[[0,48],[15,26,29,32]])})));return function(){return t.apply(this,arguments)}}();return(0,a.jsxs)("div",{className:"w-full h-full bg-dark",children:[(0,a.jsx)(u.Z,{}),(0,a.jsx)("div",{className:"container mx-auto font-serif",children:(0,a.jsxs)("div",{className:"max-w-3xl px-4 mx-auto my-10 text-white",children:[(0,a.jsxs)("div",{className:"",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"pb-1 font-sans text-3xl text-white",children:"Project Settings"}),(0,a.jsxs)("div",{className:"pt-8",children:[(0,a.jsx)("p",{className:"text-lg text-white",children:"Basic Information"}),(0,a.jsx)("p",{className:"max-w-2xl mt-1 text-sm text-neutral-300",children:"This information will be displayed publicly so be careful what you share."})]})]}),(0,a.jsxs)("div",{className:"mt-6 space-y-6 sm:mt-5 sm:space-y-5",children:[(0,a.jsxs)("div",{className:"",children:[(0,a.jsx)("label",{htmlFor:"project-name",className:"block pb-1 text-sm font-medium text-white sm:mt-px sm:pt-2",children:"Project Name"}),(0,a.jsx)("div",{className:"mt-1 sm:mt-0 sm:col-span-2",children:(0,a.jsx)("div",{className:"flex rounded-md shadow-sm",children:(0,a.jsx)("input",{type:"text",name:"project-name",id:"project-name",autoComplete:"project-name",placeholder:"Project name",value:r,onChange:function(e){s(e.target.value)},className:"flex-1 block w-full min-w-0 px-2 py-2 rounded-md placeholder-neutral-300 bg-neutral-400 border-neutral-200 focus:ring-indigo-500 focus:border-indigo-500 rounded-r-md sm:text-sm"})})})]}),(0,a.jsxs)("div",{className:"pb-8 border-b border-neutral-400 ",children:[(0,a.jsx)("label",{htmlFor:"Project Description",className:"block pb-1 text-sm font-medium text-white sm:mt-px sm:pt-2",children:"Project Description"}),(0,a.jsx)("div",{className:"mt-1 sm:mt-0 sm:col-span-2",children:(0,a.jsx)("textarea",{id:"Project Description",name:"Project Description",rows:3,className:"block w-full px-2 py-2 rounded-md shadow-sm placeholder-neutral-300 bg-neutral-400 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",value:b,onChange:function(e){w(e.target.value)},placeholder:"Project Description"})})]}),(0,a.jsxs)("div",{className:"pb-8 border-b border-neutral-400 ",children:[(0,a.jsx)("p",{className:"pb-1 text-sm text-white",children:"Project Percentage"}),D.length?(0,a.jsxs)("div",{className:"flex p-4 mt-1 mb-4 rounded text-neutral-300 bg-neutral-600",children:[(0,a.jsx)("span",{children:(0,a.jsx)(p.AV5,{className:"w-4 mr-1"})}),(0,a.jsx)("p",{className:"text-xs",children:"There are more than one prophet in your project. The \u201cprophet\u201d percentage represents the total percentage of all prophets. The sum of their individual percentage shall not exceed this number."})]}):null,(0,a.jsxs)("div",{className:"items-start md:flex md:",children:[(0,a.jsxs)("div",{className:"relative flex items-center text-xs text-neutral-300",children:[(0,a.jsx)("p",{className:"w-24 pr-2 ",children:"Charmer"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",placeholder:"100",value:I,onChange:function(e){return isNaN(+e.target.value)?null:S(+e.target.value)},className:"w-16 px-3 py-2 text-center text-white border rounded-md bg-neutral-400 border-neutral-400 "}),(0,a.jsx)("p",{className:"absolute right-1 top-2.5",children:"%"})]})]}),(0,a.jsxs)("div",{className:"relative flex items-center py-4 text-xs md:border-l md:border-r md:px-10 border-neutral-600 md:mx-5 lg:mx-10 text-neutral-300 md:py-0",children:[" ",(0,a.jsx)("p",{className:"w-24 pr-2 ",children:"Sovereign"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:_,placeholder:"100",onChange:function(e){return isNaN(+e.target.value)?null:F(+e.target.value)},className:"w-16 px-3 py-2 text-center text-white border rounded-md bg-neutral-400 border-neutral-400 "}),(0,a.jsx)("p",{className:"absolute right-1 top-2.5",children:"%"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"relative flex items-center text-xs text-neutral-300",children:[(0,a.jsx)("p",{className:"w-24 pr-2 ",children:"Prophet(Total)"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:A,onChange:function(e){return isNaN(+e.target.value)?null:E(+e.target.value)},placeholder:"100",className:"w-16 px-3 py-2 text-center text-white border rounded-md bg-neutral-400 border-neutral-400 "}),(0,a.jsx)("p",{className:"absolute right-1 top-2.5",children:"%"})]})]}),D.length?D.map((function(e,t){return(0,a.jsxs)("div",{className:"relative flex items-center mt-4 text-xs text-neutral-300",children:[(0,a.jsx)("p",{className:"w-24 pr-2 ",children:e.user.nickName}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:e.percentage,onChange:function(e){if(!isNaN(+e.target.value)){var r=D;r[t].percentage=+e.target.value,M((0,n.Z)(r))}},placeholder:"100",className:"w-16 px-3 py-2 text-center text-white border rounded-md bg-neutral-400 border-neutral-400 "}),(0,a.jsx)("p",{className:"absolute right-1 top-2.5",children:"%"})]})]})})):null]})]})]}),(0,a.jsx)("div",{className:"pt-3 mt-0",children:(0,a.jsxs)("div",{className:"",children:[(0,a.jsx)("label",{htmlFor:"banner-image",className:"block mb-1 text-sm font-medium text-white",children:"Cover"}),(0,a.jsx)("div",{className:"pb-6 ",children:(0,a.jsx)(d.Z,{file:k,setFile:Z,isImage:!0,id:"coverImage"})})]})})]})]}),(0,a.jsx)("div",{className:"pt-8 mt-8 border-t border-neutral-400",children:(0,a.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,a.jsx)(j.Z,{variant:"light",size:"small",className:"w-1/2 px-6",children:"Cancel"}),(0,a.jsx)(j.Z,{variant:"primary",size:"small",className:"w-1/2",onClick:function(){return R()},children:"Save"})]})})]})}),(0,a.jsx)(l.Z,{})]})}}
1,632:function(e,t,r){"use strict";var n=r(4154),a={createNewProject:function(e){return n.ZP.post("/api/project/create",e)},getProjectById:function(e){return n.ZP.get("/api/project/getById",{params:{id:e}})},getAllProject:function(e,t){return n.ZP.get("/api/project/getAll",{params:{page:e,tagId:t}})},followProject:function(e){return n.ZP.post("/api/project/follow",e)},addToShortList:function(e){return n.ZP.post("/api/project/addToShortList",e)},addToProject:function(e){return n.ZP.post("/api/project/addToProject",e)},sentComment:function(e){return n.ZP.post("/api/project/comment/sent",e)},fetchComments:function(e){return n.ZP.get("/api/project/comment/getByProjectId",{params:{projectId:e}})},updateStatus:function(e){return n.ZP.post("/api/project/updateStatus",e)},removeFromProject:function(e){return n.ZP.post("/api/project/removeFromProject",e)},updateProphetPercentage:function(e){return n.ZP.post("/api/project/prophet/percentage",e)},updateProject:function(e){return n.ZP.post("/api/project/updateInfo",e)},acceptInv:function(e){return n.ZP.post("/api/project/accept",e)},getProjectByWalletId:function(e){return n.ZP.get("/api/project/getByWalletId",{params:{walletId:e}})},updateNFTContract:function(e){return n.ZP.post("/api/project/updateContract",e)},confirmContract:function(e){return n.ZP.post("/api/project/confirmContract",e)}};t.Z=a},3826:function(e,t,r){"use strict";var n=r(7757),a=r.n(n),s=r(2137),c=r(8241),o=r(7989),i=new c.S3({endpoint:"https://nyc3.digitaloceanspaces.com",region:"us-east-1",credentials:{accessKeyId:"665PY4UDB3E4WOBOTXDM",secretAccessKey:"Xt6LKcPoE3jrGhoH7wenNmqq7nJF9gY+bwyCfkhcYlU"}}),l={uploadFile:function(){var e=(0,s.Z)(a().mark((function e(t,r){var n,s;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Date.now()+"-"+Math.round(1e5*Math.random()),s={Bucket:"amethyst",Key:"".concat(r,"/").concat(n,".").concat(t.name.split(".")[t.name.split(".").length-1]),Body:t,ACL:"public-read"},e.next=4,i.send(new o.w(s));case 4:return e.sent,e.abrupt("return","https://amethyst.nyc3.digitaloceanspaces.com/".concat(r,"/").concat(n,".").concat(t.name.split(".")[t.name.split(".").length-1]));case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()};t.Z=l},2878:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dev/project-setting/[pid]",function(){return r(9961)}])},3743:function(){}},function(e){e.O(0,[179,669,144,705,696,774,888,377],(function(){return t=2878,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.