PageSourceSearch

https://dm.link/_next/static/chunks/pages/creator/my-contents/requests-962a2bea77dab7c9.js

js dm.link collected 2026-09-29 01:26:16 UTC 10,509 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7043],{83767:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/creator/my-contents/requests",function(){return s(87001)}])},87001:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return B}});var l=s(85893),n=s(35484),r=s(51478),a=s(67294),o=s(61452),d=s(93967),i=s.n(d),u=s(58533),c=s(10149),x=s(11163),h=s(76607),f=s(27197),m=s(94618),b=s(82911),p=s(48974),y=s(31415),g=s(95231),j=s(76249),v=s(96614),w=s(13204),N=s(2141),_=s(41664),C=s.n(_),q=s(69602),R=s(78680),T=s(35225),k=s(94737),P=s(22029),E=s(35278);function ContentRequestPhotoList(e){let{files:t,contentRequestId:s}=e,[n,r]=(0,a.useState)(t),[o,d]=(0,a.useState)(!1),[i,u]=(0,a.useState)(0),onClickToPreview=e=>{d(!0),u(e)};return(0,E.KW)(()=>{r(t)},[t]),n?.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(P.Z,{event:"file_processed",handler:e=>{if(!n?.length||!e?._id)return;let t=n.find(t=>t._id===e._id);t&&r(t=>t.map(t=>t._id===e._id?{...t,...e}:t))},dependency:[n]}),(0,l.jsxs)("div",{className:"px-3 pb-3 grid grid-cols-[repeat(auto-fill,_minmax(64px,_1fr))] gap-1",children:[n.map((e,t)=>(0,l.jsx)(l.Fragment,{children:"finished"===e.status?(0,l.jsx)("button",{type:"button",className:"w-full pb-[100%] relative rounded-lg overflow-hidden",onClick:()=>onClickToPreview(t),children:(0,l.jsx)(q.Z,{options:{width:void 0,height:void 0,fill:!0,style:{objectFit:"cover"},sizes:"64px",quality:40,alt:e?.name},src:e?.mimeType?.includes("video")?e?.thumbnails[0]:e?.url})},e?._id):(0,l.jsx)("div",{className:"pb-[100%] relative",children:(0,l.jsx)("div",{className:"absolute top-0 left-0 w-full h-full flex items-center justify-center bg-neutral-200 rounded-lg",children:(0,l.jsx)(k.Z,{})})})})),(0,l.jsx)(C(),{href:`/creator/my-contents/requests/update/${s}`,children:(0,l.jsx)("div",{className:"relative w-full pb-[100%] bg-neutral-200 rounded-lg text-neutral-500 hover:bg-neutral-300 hover:text-neutral-600",children:(0,l.jsx)("div",{className:"absolute w-full h-full top-0 left-0 flex items-center justify-center",children:(0,l.jsx)(R.Z,{className:"w-7 h-7 stroke-[2]"})})})})]}),o&&(0,l.jsx)(T.default,{viewType:"popup",content:n,onClose:()=>d(!1),defaultIndex:i})]})}function ContentRequestCard(e){let{contentRequest:t,removeContentRequest:s}=e,n=t?.price&&t?.estimatedBuyers?.min?t.price*t.estimatedBuyers.min:null,r=t?.price&&t?.estimatedBuyers?.max?t.price*t.estimatedBuyers.max:null,declineContentRequest=async()=>{try{if(!window.confirm("Are you sure you want to decline this request?"))return;await N.N.declineContentRequest(t._id),s(t._id),(0,w.s$)("Content request declined successfully")}catch(e){(0,w.x2)(e)}},handleMoveContentRequestToTodo=async()=>{try{if(!window.confirm("Are you sure you want to move this request to To Do?"))return;await N.N.moveContentRequestToTodo(t._id),s(t._id),(0,w.s$)("Content request moved successfully")}catch(e){(0,w.x2)(e)}},handleDeleteContentRequest=async()=>{try{if(!window.confirm("Are you sure you want to delete this request?"))return;await N.N.deleteContentRequest(t._id),s(t._id),(0,w.s$)("Content request deleted successfully")}catch(e){(0,w.x2)(e)}};return(0,l.jsxs)("div",{className:"border border-neutral-300 bg-white flex flex-col gap-2 rounded-lg h-fit",children:[(0,l.jsxs)("div",{className:"px-3 pt-3 pb-2 flex flex-col gap-2",children:[(0,l.jsx)("div",{className:"text-base whitespace-pre-line",children:t.description}),(0,l.jsx)("div",{className:"grid grid-cols-[5fr_4fr] gap-1",children:!!t.price&&t.estimatedBuyers&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col mt-1",children:[(0,l.jsx)("div",{className:"text-neutral-500",children:"Estimated earnings"}),(0,l.jsxs)("div",{className:"font-medium text-base",children:[n&&r&&`${(0,v.st)(n,0)} - ${(0,v.st)(r,0)}`,n&&!r&&`${(0,v.st)(n,0)}+`]})]}),(0,l.jsxs)("div",{className:"flex flex-col bg-neutral-100 border border-neutral-200 rounded-lg px-3 py-2 w-fit text-neutral-600 leading-tight gap-1",children:[!!t?.price&&(0,l.jsxs)("div",{children:[(0,v.st)(t.price,0)," ","each"]}),!!t?.estimatedBuyers&&(0,l.jsxs)("div",{children:[!!t.estimatedBuyers.min&&!!t.estimatedBuyers.max&&`${t.estimatedBuyers.min}-${t.estimatedBuyers.max} buyers`,!!t.estimatedBuyers.min&&!t.estimatedBuyers.max&&`${t.estimatedBuyers.min}+ buyers`]})]})]})})]}),"to-do"===t.status&&(0,l.jsxs)("div",{className:"bg-neutral-100 rounded-b-lg px-3 py-2 border-t border-neutral-200 flex justify-between",children:[(0,l.jsx)(C(),{href:`/creator/my-contents/requests/update/${t._id}`,children:(0,l.jsxs)("button",{className:"bg-blue-500 px-3 py-2 text-white rounded-full border border-blue-600 flex gap-1 items-center hover:bg-blue-600 hover:border-blue-700",type:"button",children:[(0,l.jsx)(b.Z,{className:"w-4 h-4 stroke-[3]"}),"Add to vault"]})}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(C(),{href:`/creator/my-contents/requests/edit/${t._id}`,children:(0,l.jsx)("button",{className:"bg-yellow-200 p-[10px] text-yellow-600 rounded-full border border-yellow-300 hover:bg-yellow-300 hover:text-yellow-700 hover:border-yellow-400",type:"button",children:(0,l.jsx)(p.Z,{className:"w-5 h-5 stroke-[2]"})})}),(0,l.jsx)("button",{className:"bg-neutral-200 p-2 text-neutral-500 rounded-full border border-neutral-300 hover:bg-neutral-300 hover:text-neutral-600 hover:border-neutral-400",type:"button",onClick:declineContentRequest,children:(0,l.jsx)(y.Z,{className:"w-[24px] h-full stroke-2"})})]})]}),"declined"===t.status&&(0,l.jsxs)("div",{className:"bg-neutral-100 rounded-b-lg px-3 py-2 border-t border-neutral-200 flex justify-between",children:[(0,l.jsxs)("button",{className:"bg-blue-500 px-3 py-2 text-white rounded-full border border-blue-600 flex gap-1 items-center hover:bg-blue-600 hover:border-blue-700",type:"button",onClick:handleMoveContentRequestToTodo,children:[(0,l.jsx)(g.Z,{className:"w-4 h-4 stroke-[3]"}),"Move to To do"]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(C(),{href:`/creator/my-contents/requests/edit/${t._id}`,children:(0,l.jsx)("button",{className:"bg-yellow-200 p-[10px] text-yellow-600 rounded-full border border-yellow-300 hover:bg-yellow-300 hover:text-yellow-700 hover:border-yellow-400",type:"button",children:(0,l.jsx)(p.Z,{className:"w-5 h-5 stroke-[2]"})})}),(0,l.jsx)("button",{className:"bg-red-200 p-[10px] text-red-600 rounded-full border border-red-300 hover:bg-red-300 hover:text-red-700 hover:border-red-400",type:"button",onClick:handleDeleteContentRequest,children:(0,l.jsx)(j.Z,{className:"w-5 h-5 stroke-[2]"})})]})]}),"accepted"===t.status&&(0,l.jsx)(ContentRequestPhotoList,{files:t.files,contentRequestId:t._id})]})}function ContentRequestList(){let e=(0,x.useRouter)(),{type:t}=e.query,s=["to-do","accepted","declined"].includes(t),d=s?t:"to-do",b=(0,a.useCallback)((e,t)=>{if(t){let e=t?.data?.data||[];if(0===e.length||e.length<12)return null}return(0,f.z3)((0,f.kG)((0,m.Q2)("/performer/content-request/self/list",{limit:12,offset:12*e,status:d})))},[d]),{data:p,size:y,setSize:g,isLoading:j,mutate:v}=(0,h.ZP)(b,f._i,{shouldRetryOnError:!1,revalidateFirstPage:!1,keepPreviousData:!1}),w=p?p.flatMap(e=>e?.data?.data||[]):[],N=p?.[0]?.data?.total||0;(0,a.useEffect)(()=>{g(1)},[d]);let removeContentRequest=e=>{v(t=>t?t.map(t=>({...t,data:{...t.data,data:(t?.data?.data||[]).filter(t=>t._id!==e),total:(t?.data?.total||0)-1}})):t,{revalidate:!1})},handleTabChange=t=>{e.replace({pathname:"/creator/my-contents/requests",query:{type:t}},void 0,{shallow:!0})},TabButton=({children:e,type:t})=>(0,l.jsx)("button",{className:i()("rounded-full py-2 px-3 text-base hover:bg-blue-200 hover:text-blue-800",{"bg-neutral-200":t!==d,"bg-blue-200 text-blue-800 font-medium":t===d}),type:"button",onClick:()=>handleTabChange(t),children:e});return(0,l.jsxs)("div",{className:"main-container subpage",children:[(0,l.jsx)(r.Z,{title:"Content requests"}),(0,l.jsxs)("div",{className:"flex justify-between",children:[(0,l.jsx)(n.Z,{title:"Requests",backUrl:"/creator/settings"}),(0,l.jsxs)("button",{type:"button",className:"page-heading-create-btn",onClick:()=>e.push("/creator/my-contents/requests/create"),children:[" ",(0,l.jsx)(o.Z,{className:"header-icon"})," ","New request"]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-[20px] text-sm",children:[(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(TabButton,{type:"to-do",children:"To do"}),(0,l.jsx)(TabButton,{type:"accepted",children:"Accepted"}),(0,l.jsx)(TabButton,{type:"declined",children:"Declined"})]}),(0,l.jsx)(u.Z,{dataLength:w.length,loader:null,hasMore:N>w.length,next:()=>g(y+1),className:"grid grid-cols-[repeat(auto-fill,_minmax(250px,_1fr))] gap-x-2 gap-y-3",scrollThreshold:"200px",children:!!w?.length&&w.map(e=>(0,l.jsx)(ContentRequestCard,{contentRequest:e,removeContentRequest:removeC
1ontentRequest}))}),j&&(0,l.jsx)(c.default,{})]})]})}function ContentRequestPage(){return(0,l.jsx)(ContentRequestList,{})}ContentRequestPage.authenticate=!0,ContentRequestPage.enableAnimation=!0,ContentRequestPage.onlyPerformer=!0,ContentRequestPage.onlyVerifiedDocument=!0;var B=ContentRequestPage},35484:function(e,t,s){"use strict";var l=s(85893),n=s(11163),r=s(51446),a=s(67294),o=s(31618),d=s(33658);t.Z=function(e){let{title:t,className:s="",iconBack:i=null,icon:u=null,actionButton:c=null,backUrl:x=null,onBack:h=null,disabledBack:f=!1,disabledAction:m=!1}=e,b=(0,n.useRouter)(),{ref:p,isStuck:y}=(0,o._)(),{setStickyHeaderTitle:g}=(0,d.mn)();return(0,a.useEffect)(()=>{g(y&&"string"==typeof t?t:null)},[y,t]),(0,a.useEffect)(()=>()=>g(null),[]),(0,l.jsxs)("div",{ref:p,className:`page-heading flex items-center${y?" is-stuck":""} ${s}`,children:[(0,l.jsx)("button",{className:"flex flex-row text-black flex-1",onClick:()=>{h?h():x?b.push(x):b.back()},type:"button",disabled:f,children:i||(0,l.jsx)(r.Z,{className:"header-icon"})}),u,t," ",(0,l.jsx)("div",{className:"flex flex-1 justify-end",children:c&&a.cloneElement(c,{style:{fontWeight:500,color:"#306FD2",backgroundColor:"#fff",fontSize:18,display:"flex",flex:"1 1 0%",justifyContent:"flex-end",...c.props.style},disabled:m})})]})}},45732:function(e,t,s){"use strict";s.d(t,{f:function(){return l}});let l={POST:"post",MESSAGE:"message",BULK_MESSAGE:"bulk_message",TIP_CHAT_MESSAGE:"tip_chat_message",SUBSCRIPTION_TIER:"subscription_tier",TIP_STREAM:"tip_stream",PPM_JOIN_STREAM:"ppm_join_stream",BUNDLE:"bundle"}}},function(e){e.O(0,[3495,3850,5225,2586,3241,9774,2888,179],function(){return e(e.s=83767)}),_N_E=e.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.