Files
2026-02-10 01:14:19 +00:00

1 line
4.6 KiB
JavaScript

(()=>{var e={};e.id=2221,e.ids=[2221],e.modules={72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1896:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>s.a,__next_app__:()=>c,originalPathname:()=>p,pages:()=>u,routeModule:()=>h,tree:()=>d}),r(53051),r(88242),r(35866);var a=r(23191),n=r(88716),i=r(37922),s=r.n(i),o=r(95231),l={};for(let e in o)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>o[e]);r.d(t,l);let d=["",{children:["admin",{children:["printful",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,53051)),"/root/ShiftedOffRoad/app/admin/printful/page.tsx"]}]},{}]},{}]},{layout:[()=>Promise.resolve().then(r.bind(r,88242)),"/root/ShiftedOffRoad/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,35866,23)),"next/dist/client/components/not-found-error"]}],u=["/root/ShiftedOffRoad/app/admin/printful/page.tsx"],p="/admin/printful/page",c={require:r,loadChunk:()=>Promise.resolve()},h=new a.AppPageRouteModule({definition:{kind:n.x.APP_PAGE,page:"/admin/printful/page",pathname:"/admin/printful",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},82423:(e,t,r)=>{Promise.resolve().then(r.bind(r,13495))},99369:(e,t,r)=>{Promise.resolve().then(r.bind(r,6844))},90486:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,12994,23)),Promise.resolve().then(r.t.bind(r,96114,23)),Promise.resolve().then(r.t.bind(r,9727,23)),Promise.resolve().then(r.t.bind(r,79671,23)),Promise.resolve().then(r.t.bind(r,41868,23)),Promise.resolve().then(r.t.bind(r,84759,23))},13495:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var a=r(10326),n=r(17577);function i(){let[e,t]=(0,n.useState)(""),[r,i]=(0,n.useState)(""),[s,o]=(0,n.useState)(""),[l,d]=(0,n.useState)(""),[u,p]=(0,n.useState)(""),[c,h]=(0,n.useState)(""),[m,f]=(0,n.useState)(""),[x,v]=(0,n.useState)(!1);async function g(t){t.preventDefault(),v(!0),f("");try{let t={sync_product:{name:e,external_id:r||void 0,thumbnail:s||void 0},sync_variants:[{variant_id:Number(l),retail_price:u,files:c?[{type:"default",url:c}]:[]}]},a=await fetch("/api/printful/sync-products",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await a.json();if(!a.ok)throw Error(n.error||"Failed to create product.");f(`Created sync product: ${n.result?.id||"ok"}`)}catch(e){f(e.message||"Failed to create product.")}finally{v(!1)}}return a.jsx("main",{className:"auth-page",children:a.jsx("section",{className:"section",children:(0,a.jsxs)("div",{className:"container auth-page__inner",children:[a.jsx("h1",{className:"page-title",children:"Printful Admin"}),(0,a.jsxs)("form",{className:"auth-card",onSubmit:g,children:[a.jsx("input",{type:"text",placeholder:"Product name",value:e,onChange:e=>t(e.target.value),required:!0}),a.jsx("input",{type:"text",placeholder:"External ID (optional)",value:r,onChange:e=>i(e.target.value)}),a.jsx("input",{type:"text",placeholder:"Thumbnail URL (optional)",value:s,onChange:e=>o(e.target.value)}),a.jsx("input",{type:"number",placeholder:"Printful variant ID",value:l,onChange:e=>d(e.target.value),required:!0}),a.jsx("input",{type:"text",placeholder:"Retail price (e.g. 29.99)",value:u,onChange:e=>p(e.target.value),required:!0}),a.jsx("input",{type:"text",placeholder:"Print file URL (optional)",value:c,onChange:e=>h(e.target.value)}),a.jsx("button",{className:"btn",type:"submit",disabled:x,children:x?"Creating...":"Create Sync Product"}),m?a.jsx("div",{className:"connect-message",children:m}):null]})]})})})}},6844:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var a=r(10326),n=r(77109);function i({children:e}){return a.jsx(n.SessionProvider,{children:e})}},53051:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});let a=(0,r(68570).createProxy)(String.raw`/root/ShiftedOffRoad/app/admin/printful/page.tsx#default`)},88242:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s,metadata:()=>i});var a=r(19510);r(7633);let n=(0,r(68570).createProxy)(String.raw`/root/ShiftedOffRoad/components/Providers.tsx#default`),i={title:"ShiftedFDev",description:"Next.js app"};function s({children:e}){return a.jsx("html",{lang:"en",children:a.jsx("body",{children:a.jsx(n,{children:e})})})}},7633:()=>{}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[9276,1159],()=>r(1896));module.exports=a})();