PageSourceSearch

https://deckthemes.com/_next/static/chunks/pages/submit-13d924bd81a6efc8.js

js deckthemes.com collected 2026-10-07 11:43:59 UTC 15,598 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[453],{7579:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/submit",function(){return s(3493)}])},3493:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return Submit}});var a=s(5893),l=s(7294),r=s(7483);function SubmitCarouselProgressBar(e){let{progress:t}=e;return(0,a.jsx)(r.fC,{className:"absolute top-0 h-2 w-full overflow-hidden rounded-full dark:bg-base-3-dark",value:t,children:(0,a.jsx)(r.z$,{className:"duration-660ms h-full w-full rounded-full bg-brandBlue transition-transform",style:{transform:"translateX(-".concat(100-t,"%)")}})})}var n=s(1480),o=s(8236),i=s.n(o),d=s(521),c=s.n(d);s(3027);var u=s(3042),m=s(2920),f=s(4380);function ZipSubmitPanel(e){let{info:t,setInfo:s}=e,[r,n]=(0,l.useState)();return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"flex w-full flex-col items-center justify-center",children:(0,a.jsx)("div",{className:"w-full md:w-1/2",children:(0,a.jsx)(u.Q9,{allowFileTypeValidation:!0,labelFileTypeNotAllowed:"Invalid File Type!",fileValidateTypeLabelExpectedTypes:"File must be a .zip archive",acceptedFileTypes:["application/zip","application/x-zip","application/x-zip-compressed"],allowFileSizeValidation:!0,maxFileSize:"10MB",files:r,onupdatefiles:n,onremovefile:()=>{s({blob:""})},allowMultiple:!1,maxFiles:1,server:{url:"".concat("https://api.deckthemes.com","/blobs"),revert:()=>{},process:(e,t,a,l,r)=>{let n=new FormData;n.append("File",t),(0,f.MU)("/blobs",{method:"POST",body:n}).then(e=>{(null==e?void 0:e.id)&&(s({blob:e.id}),l(e.id))}).catch(e=>{m.Am.error("Error Uploading File! ".concat(JSON.stringify(e instanceof Error?e.message:e))),r(e)})}},name:"File",labelIdle:'Drag & Drop your files or <span class="filepond--label-action">Browse</span>'})})})})}function GitSubmitPanel(e){let{info:t,setInfo:s}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-4",children:[(0,a.jsx)(n.vK,{rootClass:"w-full md:w-1/2",label:"Repo URL",value:t.url,onValueChange:e=>s({...t,url:e})}),(0,a.jsx)(n.vK,{rootClass:"w-full md:w-1/2",label:"Commit ID",value:t.commit,onValueChange:e=>s({...t,commit:e})}),(0,a.jsx)(n.vK,{rootClass:"w-full md:w-1/2",label:"Subfolder",value:t.subfolder,onValueChange:e=>s({...t,subfolder:e})})]})})}(0,u.fo)(i(),c());var x=s(1468);function CSSSubmitPanel(e){let{info:t,setInfo:s}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"".concat(x.G6),children:[(0,a.jsx)(n.vK,{rootClass:"w-full md:w-1/2",label:"Name",value:t.name,onValueChange:e=>s({...t,name:e})}),(0,a.jsx)(n.PN,{rootClass:"w-full md:w-1/2",label:"CSS",value:t.css,onValueChange:e=>s({...t,css:e})})]})})}let p={git:{url:"",commit:"",subfolder:""},css:{css:"",name:""},zip:{blob:""}};function Step1(e){let{uploadType:t,uploadMethod:s,setUploadType:r,setUploadMethod:o,uploadInfo:i,setUploadInfo:d}=e;return(0,l.useEffect)(()=>{d(p[s])},[s]),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex w-full flex-col items-center justify-center",children:[(0,a.jsxs)("div",{className:"mb-4 flex w-full flex-col gap-4 md:w-1/2 md:flex-row",children:[(0,a.jsx)(n.Rz,{ariaLabel:"Upload Method Dropdown",headingText:"Upload Method",value:s,onValueChange:e=>{o(e),"css"===e&&r("css")},options:[{value:"git",displayText:"Link Git Repo"},{value:"zip",displayText:"Upload Zip"},{value:"css",displayText:"Paste CSS Snippet"}]}),(0,a.jsx)(n.Rz,{ariaLabel:"Target Plugin Dropdown",headingText:"Target Plugin",value:t,onValueChange:e=>{("css"===e||"audio"===e)&&r(e)},options:[{value:"css",displayText:"CSS Loader"},{value:"audio",displayText:"Audio Loader",disabled:"css"===s}]})]}),"zip"===s&&(0,a.jsx)(ZipSubmitPanel,{info:i,setInfo:d}),"git"===s&&(0,a.jsx)(GitSubmitPanel,{info:i,setInfo:d}),"css"===s&&(0,a.jsx)(CSSSubmitPanel,{info:i,setInfo:d})]})})}var b=s(5227),h=s.n(b),g=s(2965),v=s.n(g);s(2817),(0,u.fo)(i(),c(),h(),v());let j=["Preset","Profile"];function MetaSubmitPanel(e){let{info:t,setInfo:s,uploadType:r,uploadMethod:o}=e,[i,d]=(0,l.useState)([]),[c,p]=(0,l.useState)(["None","System-Wide","Snippet"]);async function getTargets(){let e=await (0,f.Nb)("/themes/filters?type=CSS");(null==e?void 0:e.filters)&&p(["None",...Object.keys(e.filters).filter(e=>!j.includes(e))])}return(0,l.useEffect)(()=>{"css"===o&&"None"===t.target&&s({...t,target:"Snippet"})},[o]),(0,l.useEffect)(()=>{getTargets(),"css"===r&&("Music"===t.target||"Audio"===t.target)&&s({...t,target:"None"}),"audio"===r&&("None"!==t.target||"Music"!==t.target||"Audio"!==t.target)&&s({...t,target:"None"})},[r]),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"".concat(x.G6),children:["audio"!==r&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"".concat(x.nh," w-full"),children:(0,a.jsx)(n.Rz,{ariaLabel:"Theme Target Dropdown",headingText:"Theme Target",value:t.target,onValueChange:e=>{s({...t,target:e})},options:c.sort().map(e=>({value:e,displayText:"None"!==e?e:"Use JSON Value",disabled:"None"===e&&"css"===o}))})})}),(0,a.jsxs)("div",{className:"".concat(x.nh),children:[(0,a.jsx)("span",{className:"".concat(x.wp),children:"Images"}),(0,a.jsx)("div",{className:"relative flex w-full flex-col",children:(0,a.jsx)(u.Q9,{allowFileTypeValidation:!0,labelFileTypeNotAllowed:"Invalid File Type!",fileValidateTypeLabelExpectedTypes:"Images must be in .JPG or .PNG format",acceptedFileTypes:["image/jpeg","image/png"],allowFileSizeValidation:!0,allowImagePreview:!0,allowImageExifOrientation:!0,maxFileSize:"1MB",files:i,onupdatefiles:d,onremovefile:(e,a)=>{s({...t,imageBlobs:t.imageBlobs.filter(e=>e!==a.serverId)})},onreorderfiles:e=>{s({...t,imageBlobs:e.map(e=>e.serverId)})},allowReorder:!0,allowMultiple:!0,maxFiles:5,server:{url:"".concat("https://api.deckthemes.com","/blobs"),revert:(e,a)=>{s({...t,imageBlobs:[]}),a()},process:(e,t,a,l,r)=>{let n=new FormData;n.append("File",t),(0,f.MU)("/blobs",{method:"POST",body:n}).then(e=>{(null==e?void 0:e.id)&&(s(t=>({...t,imageBlobs:[e.id,...t.imageBlobs]})),l(e.id))}).catch(e=>{m.Am.error("Error Uploading Image! ".concat(JSON.stringify(e instanceof Error?e.message:e))),r(e)})}},name:"File",labelIdle:'Drag & Drop images or <span class="filepond--label-action">Browse</span>'})})]}),(0,a.jsx)(n.PN,{label:"Description",rootClass:"w-full md:w-1/2",value:t.description,onValueChange:e=>s({...t,description:e})})]})})}var w=s(4334),N=s(4160),y=s(2010),k=s(5537),S=s(5675),T=s.n(S);function AddContactPage(){let{resolvedTheme:e}=(0,y.F)();return(0,a.jsxs)("div",{className:"flex max-w-2xl flex-col gap-8",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("span",{children:"In order to follow up on any potential issues, reviewers need to be able to contact you. We offer two methods of contact: Joining the Deckthemes discord or adding a contact Email."}),(0,a.jsx)("span",{children:"If you do not join the discord or link an email, we will deny your submission if we find issues."})]}),(0,a.jsxs)("div",{className:"-mx-4 flex flex-col items-start justify-center gap-4 roun
1ded-3xl",children:[(0,a.jsxs)("div",{className:"flex flex-col items-start justify-between gap-4 p-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"font-fancy text-xl font-semibold",children:"Discord"}),(0,a.jsx)("span",{className:"font-fancy text-sm font-medium text-textFadedLight dark:text-textFadedDark",children:"Have In-Server Discussions"})]}),(0,a.jsxs)("a",{href:"https://deckthemes.com/discord",rel:"noreferrer",target:"_blank",className:"flex h-fit w-fit select-none items-center gap-2 rounded-full border border-borders-base3-dark py-2 px-4 text-textLight transition duration-150 hover:scale-95 hover:bg-base-3-dark hover:text-bgDark hover:active:scale-90 dark:text-textDark dark:hover:text-bgLight",children:[(0,a.jsx)(T(),{alt:"Discord Logo",height:"16",width:"16",src:"https://cdn.simpleicons.org/discord/".concat("light"===e?"black":"white")}),(0,a.jsx)("div",{className:"font-fancy text-xs font-bold",children:"Join Discord"})]})]}),(0,a.jsx)(k.Zd,{})]})]})}function CopyrightSelector(e){let{setCopyrightRead:t}=e;return(0,a.jsxs)("div",{className:"flex flex-col items-center gap-6",children:[(0,a.jsxs)("div",{className:"flex max-w-4xl flex-col items-center gap-2 rounded-lg border-2 border-amber-500 bg-amber-950 p-4",children:[(0,a.jsx)("div",{className:"text-2xl font-bold text-amber-400",children:"Sound Packs Only"}),(0,a.jsx)("div",{className:"text-center text-lg text-amber-200",children:"Due to copyright concerns, DeckThemes only accepts sound effect packs. Music packs are not accepted."})]}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 rounded-lg border-2 border-[#334155] bg-[#1e293b] p-4 transition-colors hover:border-[#475569]",children:[(0,a.jsx)("input",{type:"checkbox",className:"h-5 w-5 cursor-pointer accent-emerald-500",onChange:e=>t(e.target.checked)}),(0,a.jsx)("span",{className:"text-lg text-white",children:"I confirm this pack contains sound effects only, not music."})]})]})}function SubmitStepsCarousel(e){let{submitTheme:t}=e,{accountInfo:s}=(0,l.useContext)(N.g),[r,n]=(0,l.useState)(1),[o,i]=(0,l.useState)("git"),[d,c]=(0,l.useState)("css"),[u,m]=(0,l.useMemo)(()=>{let e=["Upload Information"];return s&&!s.email&&e.push("Add Contact Information"),"audio"===d&&e.push("Copyright Information"),e.push("Edit Listing","Accept Upload Terms"),[e.length,e]},[s,d]),goToNextStep=()=>{r<u&&n(r+1)},[f,x]=(0,l.useState)(0),calculateProgress=()=>{let e=r/u*100;x(e)};(0,l.useEffect)(()=>{calculateProgress()},[r,u]);let[p,b]=(0,l.useState)({url:"",commit:"",subfolder:""}),[h,g]=(0,l.useState)({imageBlobs:[],description:"",target:"None"}),[v,j]=(0,l.useState)(!1),[y,k]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{console.log(h.imageBlobs)},[h]),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"relative flex min-h-[52rem] w-full max-w-7xl flex-col items-center justify-center overflow-hidden rounded-3xl border-[1px] border-borders-base1-light bg-base-3-light dark:border-borders-base1-dark dark:bg-base-2.5-dark",children:[(0,a.jsx)(SubmitCarouselProgressBar,{progress:f}),(0,a.jsxs)("section",{className:"flex w-full flex-col items-center justify-center gap-4 p-4 py-8",children:[(0,a.jsx)("span",{className:"font-fancy w-full pb-4 text-center text-2xl font-semibold md:text-4xl",children:m[r-1]}),(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsx)("div",{className:1!==r?"hidden":"w-full",children:(0,a.jsx)(Step1,{uploadType:d,setUploadType:c,uploadInfo:p,setUploadInfo:b,uploadMethod:o,setUploadMethod:i})}),(0,a.jsx)("div",{className:r!==m.indexOf("Copyright Information")+1?"hidden":"w-full",children:(0,a.jsx)(CopyrightSelector,{setCopyrightRead:j})}),(0,a.jsx)("div",{className:r!==m.indexOf("Edit Listing")+1?"hidden":"w-full",children:(0,a.jsx)(MetaSubmitPanel,{info:h,setInfo:g,uploadType:d,uploadMethod:o})}),m.includes("Add Contact Information")&&(0,a.jsx)("div",{className:r!==m.indexOf("Add Contact Information")+1?"hidden":"w-full",children:(0,a.jsx)("div",{className:"flex w-full flex-col items-center justify-center gap-4",children:(0,a.jsx)(AddContactPage,{})})}),(0,a.jsx)("div",{className:r!==u?"disable-timer hidden":"w-full",children:(0,a.jsx)("div",{className:"flex w-full flex-col items-center justify-center gap-4",children:(0,a.jsx)(w.w,{checkValue:y,setCheckValue:k,uploadType:d})})})]}),(0,a.jsxs)("div",{className:"flex flex-row gap-4 py-2",children:[(0,a.jsx)("button",{disabled:1===r,className:"group mb-2 inline-flex w-fit items-center justify-center gap-2 rounded-full border-2 border-borders-base1-light bg-brandBlue py-2 px-4 text-sm font-semibold text-white no-underline transition hover:border-borders-base2-light hover:bg-fore-11-dark hover:text-fore-contrast-dark focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-60 disabled:pointer-events-none disabled:opacity-50 dark:border-borders-base1-dark hover:dark:border-borders-base2-dark sm:mb-0",onClick:()=>{r>1&&n(r-1)},children:"Back"}),(0,a.jsx)("button",{disabled:r===m.indexOf("Copyright Information")+1&&!v||r===u&&!function(){let e=!1;switch(o){case"git":p.url&&(e=!0);break;case"css":p.css&&p.name&&(e=!0);break;case"zip":p.blob&&(e=!0)}return e&&y}(),className:"group mb-2 inline-flex w-fit items-center justify-center gap-2 rounded-full border-2 border-borders-base1-light bg-brandBlue py-2 px-4 text-sm font-semibold text-white no-underline transition hover:border-borders-base2-light hover:bg-fore-11-dark hover:text-fore-contrast-dark focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-60 disabled:pointer-events-none disabled:opacity-50 dark:border-borders-base1-dark hover:dark:border-borders-base2-dark sm:mb-0",onClick:()=>r!==u?goToNextStep():void t(d,o,p,h),children:r!==u?"Next":"Submit"})]})]})]})})}var C=s(9008),F=s.n(C),P=s(1163),I=s(8329);function Submit(){let e=(0,P.useRouter)(),t=(0,I.X)(),{accountInfo:s}=(0,l.useContext)(N.g);async function submitTheme(t,s,a,l){let r={imageBlobs:l.imageBlobs.filter(
1Boolean),description:l.description||null,target:"None"!==l.target?l.target:null};if(0===r.imageBlobs.length){m.Am.error("Please upload at least one image.");return}(0,f.MU)("/submissions/".concat(t,"_").concat(s),{method:"POST",body:JSON.stringify({...a,meta:r}),headers:{"Content-Type":"application/json"}}).then(t=>{if(null==t?void 0:t.task)e.push("/taskStatus/view?task=".concat(t.task));else throw alert("Error Submitting Theme, No Task Returned: ".concat((null==t?void 0:t.message)||"Unknown Error")),Error("No task in response")}).catch(e=>{m.Am.error("Error Submitting Theme, Request Failed: ".concat(JSON.stringify(e instanceof Error?e.message:e))),console.error("Error Submitting Theme:",e)})}if(null==s?void 0:s.username){var r;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(F(),{children:(0,a.jsx)("title",{children:"DeckThemes | Submit"})}),(0,a.jsx)("style",{children:"\n          .dark .filepond--panel-root {\n            background-color: hsla(220, 9%, 60%, 0.1);\n          }\n\n          .dark .filepond--drop-label {\n            color: #fff;\n          }\n\n		      .dark .filepond--panel-root {\n		      	background: transparent;\n		      }\n        \n	    	  .filepond--credits {\n	    	  	display: none !important;\n	    	  }\n\n		      .dark .filepond--root {\n	     	  	background: #1e2024;\n	    	  	border-radius: 12px;\n		      }\n          "}),(null==e?void 0:null===(r=e.query)||void 0===r?void 0:r.update)&&(0,a.jsx)("div",{className:"text-lg font-bold",children:(0,a.jsx)("span",{className:"",children:"To update a theme, submit a new theme with the same name as the original"})}),(0,a.jsx)("div",{className:"m-4 rounded-xl bg-cardLight px-4 py-2 text-xl transition-colors hover:bg-borderLight dark:bg-cardDark hover:dark:bg-borderDark",children:(0,a.jsxs)("a",{href:"https://docs.deckthemes.com",target:"_blank",rel:"noreferrer",className:"rounded-3xl bg-gradient-to-tl from-blue-800 to-blue-500 bg-clip-text p-1 text-transparent",children:[(0,a.jsx)("span",{className:"text-textLight dark:text-textDark",children:"Need help? "}),(0,a.jsx)("br",{className:"flex md:hidden"}),"View the docs ",(0,a.jsx)("br",{className:"flex md:hidden"}),(0,a.jsx)("span",{className:"text-textLight dark:text-textDark",children:"for guides, documentation, and tools!"})]})}),(0,a.jsx)(SubmitStepsCarousel,{submitTheme:submitTheme})]})}return t?(0,a.jsx)(k.h2,{}):(0,a.jsx)(k.wp,{})}}},function(e){e.O(0,[719,53,774,888,179],function(){return e(e.s=7579)}),_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.