PageSourceSearch

https://tokentails.com/_next/static/chunks/202-07119cbe7c6f9156.js

js tokentails.com collected 2026-10-01 15:58:51 UTC 9,944 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[202],{992:(e,t,r)=>{r.d(t,{u:()=>p});var a=r(7876),s=r(4232),n=r(5784),o=r(8581),i=r(5002),c=r(8021),d=r(8398),l=r(7756),m=r(5149);let p=({onImageUpload:e,uploadedImage:t,onClear:r,selectedStyle:p,onStyleChange:u,drawerOpen:h,onDrawerOpenChange:g,stylePickerControl:x,uploadButtonLabel:f})=>{let[y,b]=(0,s.useState)(!1),j=(0,s.useCallback)(e=>{e.preventDefault(),b(!0)},[]),N=(0,s.useCallback)(e=>{e.preventDefault(),b(!1)},[]),w=(0,s.useCallback)(t=>{t.preventDefault(),b(!1);let r=t.dataTransfer.files[0];r&&r.type.startsWith("image/")&&e(r)},[e]),k=(0,s.useCallback)(t=>{let r=t.target.files?.[0];r&&e(r)},[e]);return(0,a.jsxs)("div",{className:"w-full max-w-md mx-auto relative",children:[(0,a.jsx)("div",{className:"absolute top-4 right-4 z-10",children:x??(0,a.jsx)(m.C,{selectedStyle:p,onStyleChange:u,open:h,onOpenChange:g})}),(0,a.jsx)(n.N,{mode:"wait",children:t?(0,a.jsxs)(o.P.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:"relative rounded-sm overflow-hidden card-baroque",children:[(0,a.jsx)("img",{src:t,alt:"Uploaded cat",className:"w-full aspect-[3/4] object-cover"}),(0,a.jsx)("button",{onClick:r,className:"absolute top-3 right-3 p-2 rounded-sm bg-background/90 backdrop-blur-sm hover:bg-background transition-colors border border-border",children:(0,a.jsx)(i.A,{className:"w-4 h-4"})}),(0,a.jsx)("div",{className:"absolute bottom-0 left-0 right-0 p-3 bg-gradient-to-t from-background via-background/80 to-transparent",children:(0,a.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-2 tracking-wider uppercase",children:[(0,a.jsx)(c.A,{className:"w-3 h-3 text-primary"}),"Ready for transformation"]})})]},"preview"):(0,a.jsx)(o.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},onDragOver:j,onDragLeave:N,onDrop:w,className:`upload-zone rounded-sm p-6 cursor-pointer transition-all duration-400 ${y?"dragging":""}`,children:(0,a.jsxs)("label",{className:"cursor-pointer flex flex-col items-center gap-3",children:[(0,a.jsx)(o.P.div,{animate:{y:y?-3:0},className:"w-12 h-12 rounded-sm bg-secondary/50 border border-border flex items-center justify-center",children:y?(0,a.jsx)(d.A,{className:"w-5 h-5 text-primary"}):(0,a.jsx)(l.A,{className:"w-5 h-5 text-muted-foreground"})}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-foreground text-sm tracking-wide",children:"Upload your pet photo"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1 tracking-wide",children:"Use a well-lit photo"})]}),f&&(0,a.jsx)("span",{className:"inline-flex items-center rounded-md border border-border bg-background/90 px-3 py-1 text-xs font-semibold tracking-wide uppercase text-foreground shadow-sm",children:f}),f&&(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground tracking-wide",children:"or drag and drop"}),(0,a.jsx)("input",{type:"file",accept:"image/*",onChange:k,className:"hidden"})]})},"upload")})]})}},1013:(e,t,r)=>{r.d(t,{l:()=>n});var a=r(4591);let s=()=>({Accept:"application/json","Content-Type":"application/json",accesstoken:sessionStorage.getItem("accesstoken")||""}),n={createPaymentIntent:async(e,t,r,n)=>{let o=await fetch(`${a.y0}/web3/create-payment`,{method:"POST",headers:s(),body:JSON.stringify({amount:e,id:t,discount:r,entityType:n?.entityType,productType:n?.productType,imageId:n?.imageId})});if(!o.ok)throw Error("Failed to create payment intent");return o.json()},confirmPayment:async({paymentIntent:e,clientSecret:t,discount:r,entityType:n,productType:o,imageId:i})=>{let c=await fetch(`${a.y0}/web3/confirm-payment`,{method:"POST",headers:s(),body:JSON.stringify({paymentIntent:e,clientSecret:t,discount:r,entityType:n,productType:o,imageId:i})});if(!c.ok)throw Error("Failed to confirm payment");return c.json()},createCheckoutSession:async({amount:e,productType:t,imageId:r,email:n})=>{let o=await fetch(`${a.y0}/image/create-checkout-session`,{method:"POST",headers:s(),body:JSON.stringify({amount:e,productType:t,imageId:r,email:n})});if(!o.ok)throw Error("Failed to create checkout session");return o.json()},createSignedCheckoutSession:async({amount:e,productType:t,imageId:r})=>{let n=await fetch(`${a.y0}/image/create-checkout-session-signed`,{method:"POST",headers:s(),body:JSON.stringify({amount:e,productType:t,imageId:r})});if(!n.ok)throw Error("Failed to create signed checkout session");return n.json()}}},3439:(e,t,r)=>{r.d(t,{P:()=>d,S:()=>c});var a=r(4591);async function s(e,{name:t,style:r}={}){let n=new FormData;return n.append("file",e),n.append("name",t||""),n.append("isTemporary","true"),r&&n.append("style",r),fetch(`${a.y0}/image/portrait`,{method:"POST",headers:{Accept:"application/json"},body:n}).then(e=>e.ok?e.json():(console.warn(JSON.stringify(e)),null))}async function n(e,{name:t,style:r}={}){return s(e,{name:t,style:r})}async function o(e){return fetch(`${a.y0}/image/${e}`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.ok?e.json():(console.warn(JSON.stringify(e)),null))}async function i(e){return fetch(`${a.y0}/image/order/status?_id=${e}`,{method:"GET",headers:{Accept:"application/json"}}).then(e=>e.ok?e.json():(console.warn(JSON.stringify(e)),null))}class c extends Error{constructor(){super("Sign in to generate another version of your portrait."),this.name="SignInRequiredError",Object.setPrototypeOf(this,c.prototype)}}let d={uploadImage:s,generatePortrait:n,regeneratePortrait:async function(e,t){return fetch(`${a.y0}/image/portrait/${e}/regenerate`,{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json",accesstoken:sessionStorage.getItem("accesstoken")||""},body:t?JSON.stringify({style:t}):null}).then(e=>{if(e.ok)return e.json();if(401===e.status)throw new c;return console.warn(JSON.stringify(e)),null})},get:o,getOrderById:i}},4584:(e,t,r)=>{r.d(t,{BE:()=>p,I6:()=>h,Uz:()=>c,_s:()=>i,gk:()=>u,zj:()=>m});var a=r(7876),s=r(4232),n=r(8374),o=r(5861);
1let i=({shouldScaleBackground:e=!0,...t})=>(0,a.jsx)(n._s.Root,{shouldScaleBackground:e,...t});i.displayName="Drawer";let c=n._s.Trigger,d=n._s.Portal;n._s.Close;let l=s.forwardRef(({className:e,...t},r)=>(0,a.jsx)(n._s.Overlay,{ref:r,className:(0,o.cn)("fixed inset-0 z-50 bg-black/80",e),...t}));l.displayName=n._s.Overlay.displayName;let m=s.forwardRef(({className:e,children:t,...r},s)=>(0,a.jsxs)(d,{children:[(0,a.jsx)(l,{}),(0,a.jsxs)(n._s.Content,{ref:s,className:(0,o.cn)("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...r,children:[(0,a.jsx)("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));m.displayName="DrawerContent";let p=({className:e,...t})=>(0,a.jsx)("div",{className:(0,o.cn)("grid gap-1.5 p-4 text-center sm:text-left",e),...t});p.displayName="DrawerHeader";let u=s.forwardRef(({className:e,...t},r)=>(0,a.jsx)(n._s.Title,{ref:r,className:(0,o.cn)("text-lg font-semibold leading-none tracking-tight text-foreground",e),...t}));u.displayName=n._s.Title.displayName;let h=s.forwardRef(({className:e,...t},r)=>(0,a.jsx)(n._s.Description,{ref:r,className:(0,o.cn)("text-sm text-muted-foreground",e),...t}));h.displayName=n._s.Description.displayName},5149:(e,t,r)=>{r.d(t,{C:()=>x,j:()=>h});var a,s=r(7876),n=r(1827),o=r(4584),i=r(8581),c=r(8021),d=r(8061),l=r(4137),m=r(4229),p=r(5164),u=r(4232),h=((a={}).HIGHNESS="highness",a.MONARCH="monarch",a.ARISTOCRAT="aristocrat",a.COMMANDER="commander",a);let g=[{id:"highness",name:"Highness",description:"Let us choose the perfect style for you",icon:c.A},{id:"monarch",name:"Monarch",description:"Regal & commanding presence",icon:d.A},{id:"aristocrat",name:"Aristocrat",description:"Elegant & refined nobility",icon:l.A},{id:"commander",name:"Commander",description:"Military distinction & honor",icon:m.A}],x=({selectedStyle:e,onStyleChange:t,open:r,onOpenChange:a})=>{let[c,d]=(0,u.useState)(!1),l=a||d,m=g.find(t=>t.id===e)||g[0],h=m.icon,[x,f]=(0,u.useState)(!1),y=x?m.name:"Pick Style";return(0,s.jsxs)(o._s,{open:void 0!==r?r:c,onOpenChange:l,children:[(0,s.jsx)(o.Uz,{asChild:!0,children:(0,s.jsxs)("button",{className:"flex items-center gap-1 text-[9px] tracking-widest uppercase text-muted-foreground hover:text-foreground transition-colors",children:[(0,s.jsx)(h,{className:"w-2.5 h-2.5"}),(0,s.jsx)("span",{children:y}),(0,s.jsx)(p.A,{className:"w-2 h-2"})]})}),(0,s.jsxs)(o.zj,{className:"bg-card border-border",children:[(0,s.jsx)(o.BE,{className:"pb-2",children:(0,s.jsx)(o.gk,{className:"text-display text-lg tracking-[0.1em] text-center text-foreground",children:"Select Style"})}),(0,s.jsx)("div",{className:"px-4 pb-6",children:(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:g.map(r=>{r.icon;let a=e===r.id;return(0,s.jsxs)(i.P.button,{onClick:()=>{t(r.id),f(!0),l(!1)},whileTap:{scale:.98},className:`relative flex flex-col items-center gap-2 p-3 rounded-sm border transition-all duration-300 ${a?"border-primary bg-primary/5":"border-border bg-transparent hover:border-muted-foreground"}`,children:[(0,s.jsx)("div",{className:"w-full aspect-[3/4] rounded-sm overflow-hidden mb-1",children:(0,s.jsx)("img",{src:(0,n.Uu)(`portrait/${r.id}.webp`),alt:r.name,className:"w-full h-full object-cover"})}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("p",{className:`text-xs tracking-[0.1em] uppercase font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:r.name}),(0,s.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-tight",children:r.description})]}),a&&(0,s.jsx)(i.P.div,{layoutId:"selected-style",className:"absolute inset-0 border-2 border-primary rounded-sm pointer-events-none",transition:{type:"spring",bounce:.2,duration:.6}})]},r.id)})})})]})]})}},5861:(e,t,r)=>{r.d(t,{cn:()=>n});var a=r(9241),s=r(9573);function n(...e){return(0,s.QP)((0,a.$)(e))}}}]);

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.