PageSourceSearch

https://photocat.com/_next/static/chunks/9483.5d40f9457ef14784.js

js photocat.com collected 2026-10-02 05:02:03 UTC 16,597 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fd4283a7-c711-439f-8e98-82fb3195b6b0",e._sentryDebugIdIdentifier="sentry-dbid-fd4283a7-c711-439f-8e98-82fb3195b6b0")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9483],{15576:function(e,t,r){r.d(t,{SF:function(){return i},Vl:function(){return n},rq:function(){return s}});var l=r(75271);t.ZP=e=>{let{ref:t,callback:r}=e;(0,l.useEffect)(()=>{let e=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(null==r||r(),e.disconnect())})});return t.current&&e.observe(t.current),()=>{e.disconnect()}},[r,t])};let n=e=>{let t=(0,l.useRef)(new Map),r=(0,l.useCallback)((r,l,n)=>{var i;let s=t.current.get(l);if(null==r){s.observer.disconnect(),s.el=void 0,s.meta=n;return}if(null==s?void 0:s.exposed){s.el=r,s.meta=n;return}let a=null!==(i=null==s?void 0:s.observer)&&void 0!==i?i:new IntersectionObserver(r=>{r.forEach(r=>{let n=t.current.get(l);r.isIntersecting&&!(null==n?void 0:n.exposed)&&(null==e||e(r.target,null==n?void 0:n.meta),a.disconnect(),t.current.get(l)&&(t.current.get(l).exposed=!0))})});(null==s?void 0:s.el)!==r&&((null==s?void 0:s.el)&&a.unobserve(null==s?void 0:s.el),a.observe(r));let u={...s,meta:n,el:r,observer:a};t.current.set(l,u)},[e]);return[t,r]},i=function(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,l=[];return n=>{l.push(n),void 0===t&&(t=setTimeout(()=>{e(l),l=[],clearInterval(t),t=void 0},r))}},s=(e,t)=>{let r=e.reduce((e,r)=>{var l;let n=t(r),i=n.length+1,s=null!==(l=e[e.length-1])&&void 0!==l?l:{slice:[],count:0};return s.count+i>100?[...e,{slice:[r],count:n.length}]:(s.count+=i,s.slice.push(r),0===e.length?[s]:e)},[]);return r.map(e=>e.slice)}},37310:function(e,t,r){r.d(t,{Z:function(){return f}});var l=r(75271),n=r(36958),i=r(75491),s=r(17542),a=r(34758),u=r(46653),o=r(65051),c=r(97690);let d=async(e,t)=>{let{data:r}=await (0,n.Fc)(n.Qp.getTaskResult,{args:[e],signal:t,decider:e=>{var t;return["success","error"].includes(null===(t=e.data)||void 0===t?void 0:t.data.status)}});return r};function f(e){var t;let{module:r,initialSource:f,reportId:v,apiParams:m,getStyleId:p,sceneId:g}=e,[h,_]=(0,l.useState)(f),[b,x]=(0,l.useState)(new Map),{report:I}=(0,i.n)(),{requestAddCredit:y}=(0,s.t)(),{user:S}=(0,c.useLogin)(),w=(0,l.useRef)(new AbortController);(0,l.useEffect)(()=>()=>{w.current.abort()},[]);let E=(0,l.useCallback)(async(e,t)=>{try{var l,i,s,c;if(!h)return;let f=Date.now(),{data:{data:_,code:b}}=await n.Qp.createTask(m.taskCategory,null!==(i=m.version)&&void 0!==i?i:"1.0",{mode:e,styleId:e,imageUrl:h,...t}),R=null==_?void 0:_.taskId;if(b===n.Q4.INSUFFICIENT_BALANCE){let l=await y({source:a.MU[r],styleId:e,isVip:S.isLogin&&(null===(s=S.vipInfo)||void 0===s?void 0:s.isVip)});if(l)return await E(e,t);x(t=>(t.delete(e),new Map(t)));return}if(!R){x(t=>(t.set(e,{...t.get(e),status:u.Tr.ERROR,styleId:e}),new Map(t)));return}x(t=>(t.set(e,{status:u.Tr.PENDING,taskId:R,styleId:e}),new Map(t)));let M=null!==(c=null==p?void 0:p(e))&&void 0!==c?c:{style_id:e};I(o.B_.EDIT_FUNC_USE,{edit_func:a.MU[r],task_id:v.current,...M,scene_id:g});let U=await d(R,w.current.signal);return I(o.B_.EDIT_FUNC_SUCCESS,{edit_func:a.MU[r],loading_time:Date.now()-f,task_id:v.current,...M,scene_id:g}),I(o.B_.RESULT_EXPOSURE,{picture_number:1,from_tab:a.MU[r],from_email:0,stage:"full",task_id:v.current,...M,scene_id:g}),I(o.B_.CREDIT_CONSUME,{source:a.MU[r],material_id:null==M?void 0:M.style_id,credit_amount:1,order_id:null==U?void 0:null===(l=U.data)||void 0===l?void 0:l.orderId}),U}catch(t){if((0,n.pm)(t))return;x(t=>(t.set(e,{...t.get(e),status:u.Tr.ERROR,styleId:e}),new Map(t)))}},[h,m.taskCategory,m.version,p,I,r,v,g,y,S.isLogin,null===(t=S.vipInfo)||void 0===t?void 0:t.isVip]),R=(0,l.useCallback)((e,t)=>{var r,l;let n=b.get(e);if(!(null==n?void 0:null===(r=n.result)||void 0===r?void 0:null===(l=r.result)||void 0===l?void 0:l.resultUrl)){let r=E(e,t).then(t=>{t&&x(r=>{var l;return r.set(e,{...r.get(e),status:(null==t?void 0:null===(l=t.data)||void 0===l?void 0:l.status)==="success"?u.Tr.SUCCESS:u.Tr.ERROR,result:null==t?void 0:t.data}),new Map(r)})}).catch(()=>{x(t=>(t.set(e,{...t.get(e),status:u.Tr.ERROR,styleId:e}),new Map(t)))});return x(t=>(t.set(e,{status:u.Tr.PENDING,styleId:e}),new Map(t))),r}if((null==n?void 0:n.status)===u.Tr.ERROR)return b.delete(e),R(e,t)},[E,b]),M=(0,l.useCallback)(e=>{_(e),x(new Map)},[]),U=(0,l.useCallback)(async e=>{var t;let l=null==e?void 0:e.taskId,n=e.styleId,i=await d(l,w.current.signal),s=null!==(t=null==p?void 0:p(n))&&void 0!==t?t:{style_id:n};I(o.B_.EDIT_FUNC_SUCCESS,{edit_func:a.MU[r],loading_time:void 0,task_id:v.current,...s,scene_id:g}),I(o.B_.RESULT_EXPOSURE,{picture_number:1,from_tab:a.MU[r],from_email:0,stage:"full",task_id:v.current,...s,scene_id:g}),x(e=>{var t;return e.set(n,{...e.get(n),status:(null==i?void 0:null===(t=i.data)||void 0===t?void 0:t.status)==="success"?u.Tr.SUCCESS:u.Tr.ERROR,result:null==i?void 0:i.data}),new Map(e)})},[p,r,I,v,g]);return{source:h,setSource:M,taskMap:b,makeTask:R,setTaskMap:x,queryTaskResult:U}}},55219:function(e,t,r){r.r(t),r.d(t,{default:function(){return B}});var l=r(82095),n=r(52676),i=r(75271),s=r(22971),a=r(36810),u=r.n(a),o=r(23545),c=r(4814),d=r(75491),f=r(52890),v=r(1129),m=r(76284),p=r(83274),g=r(46653),h=r(65051),_=r(34758),b=r(76773),x=r(92868),I=r(15576),y=r(5722),S=r(62284),w=r.n(S),E=r(41047),R=r(37310),M=r(36958),U=r(85793),k=r(160),C=r(7388),T=r(81076),N=r(6172),j=r(8859),O=r(38820),L=r(71477),Z=r(70647),D=r(41627);function A(){let e=(0,l._)(["",""]);return A=function(){return e},e}function B(){var e,t,r,l;let{report:a}=(0,d.n)(),[S,B]=(0,v.Z)(),P=(0,s.useRouter)(),{styleList:F}=(0,Z.y)(),J=(0,T.ZP)(),{phase:V,scrollRef:q}=(0,k.v)("x",!0),[z,W]=(0,i.useState)(""),{source:X}=(0,i.useMemo)(()=>{var e;let t=new URLSearchParams(window.location.search),r=t.get("charged"),l=t.get("curStyle"),n=F.findIndex(e=>e.styleId===l),i=-1===n?0:n,s=null!==(e=t.get("source"))&&void 0!==e?e:void 0;if(r)return{source:s,selectedIndex:i};let a=sessionStorage.getItem(D.oy);if(!a)return{source:s,selectedIndex:i,charged:!!r};
1sessionStorage.removeItem(D.oy);let u=JSON.parse(a);return W(u.styleId),u},[F]),Q=(0,i.useRef)(P.query.rp),[$,G]=(0,i.useState)(!1),K=(0,i.useRef)(null),{stageRect:H}=(0,U.D)({conRef:K}),Y=e=>({style_id:"retouch_".concat(e)}),{taskMap:ee,setTaskMap:et,makeTask:er,queryTaskResult:el,source:en,setSource:ei}=(0,R.Z)({module:_.lS.ImageRetouch,initialSource:X,reportId:Q,apiParams:{taskCategory:M.ZJ.AutoRetouch},getStyleId:Y});(0,i.useEffect)(()=>{X&&sessionStorage.setItem(D.bv,JSON.stringify({sourceUrl:X,rp:Q.current}))},[X]);let es=(0,i.useCallback)(async e=>{G(!0);try{if(et(new Map),sessionStorage.removeItem(D.bv),e){if("string"==typeof e)ei(e);else{a(h.B_.IMPORT_MEDIA_START,{from_tab:_.MU[_.lS.ImageRetouch],type:"click",picture_number:1});let t=Date.now(),r=await (0,p.v)(e),{error:l}=await (0,N.IC)(r,D.sl);if(l){a(h.B_.IMPORT_MEDIA_FAILED,{from_tab:_.MU[_.lS.ImageRetouch],type:"click",reason:(0,o.t)(Error[l]),ori_picture_number:1,picture_number:1}),S((0,o.t)(j.Bc[l]),3e3),ei(void 0),sessionStorage.removeItem(D.bv),G(!1);return}let n=(0,b.rg)();Q.current=n,a(h.B_.IMPORT_MEDIA_SUCCESS,{from_tab:_.MU[_.lS.ImageRetouch],type:"click",picture_number:1,task_id:n,uploading_time:Date.now()-t}),ei(r),sessionStorage.setItem(D.bv,JSON.stringify({sourceUrl:r,rp:Q.current}))}}else ei(void 0)}catch(e){if(a(h.B_.IMPORT_MEDIA_FAILED,{from_tab:_.MU[_.lS.ImageRetouch],reason:"".concat(e),type:"click",picture_number:1,ori_picture_number:1}),"nsfw content"===e.message){S((0,o.t)("general.popup.upload.det.toast"));return}S((0,o.t)("gen.upload.failed.retry"))}finally{G(!1)}},[a,S]);(0,i.useEffect)(()=>{if(P.isReady){let t=JSON.parse(sessionStorage.getItem(D.bv));if((null==t?void 0:t.sourceUrl)&&!t.sourceUrl.startsWith("blob:")){var e;ei(t.sourceUrl),Q.current=t.rp||(0,b.rg)(),(null!==(e=null==t?void 0:t.tasks)&&void 0!==e?e:[]).forEac
1h(e=>{(null==e?void 0:e.resultUrl)?ee.set(null==e?void 0:e.resultUrl.request.mode,{result:{...e.resultUrl},status:g.Tr.SUCCESS}):(null==e?void 0:e.styleId)&&(null==e?void 0:e.taskId)&&(ee.set(null==e?void 0:e.styleId,{status:g.Tr.SUCCESS,...e}),el(e))}),et(new Map(ee))}}},[P.isReady]),(0,i.useEffect)(()=>{if(P.isReady){let e=[];Array.from(ee.keys()).forEach(t=>{let r=ee.get(t);if(null==r?void 0:r.result)e.push({resultUrl:null==r?void 0:r.result});else{let t=null==r?void 0:r.taskId,l=r.styleId;t&&e.push({taskId:t,styleId:l})}});let t=JSON.parse(sessionStorage.getItem(D.bv));sessionStorage.setItem(D.bv,JSON.stringify({...t,tasks:e}))}},[ee]);let ea=(0,i.useMemo)(()=>ee.get(z),[z,ee]),eu=(0,i.useMemo)(()=>(null==ea?void 0:ea.status)==="pending",[null==ea?void 0:ea.status]),eo=(0,i.useMemo)(()=>{var e,t;return null==ea?void 0:null===(e=ea.result)||void 0===e?void 0:null===(t=e.result)||void 0===t?void 0:t.resultUrl},[null==ea?void 0:ea.result]),ec=(0,i.useMemo)(()=>eu||$,[eu,$]),ed=(0,i.useMemo)(()=>ec||!en||!!eo||!z,[ec,en,eo,z]),ef=(0,i.useMemo)(()=>!eo||ec,[eo,ec]),ev=(0,i.useCallback)(e=>{if(e===z)return;W(e),a(h.B_.MATERIAL_CLICK,{from_tab:_.MU[_.lS.ImageRetouch],task_id:Q.current,...Y(e)});let t=ee.get(e);t&&a(h.B_.RESULT_EXPOSURE,{picture_number:1,from_tab:_.MU[_.lS.ImageRetouch],from_email:0,stage:"full",task_id:Q.current,...Y(e)})},[z,a,ee]),em=(0,i.useCallback)(async()=>{var e,t;let r=ee.get(z);null!=r&&null!==(e=r.result)&&void 0!==e&&null!==(t=e.result)&&void 0!==t&&t.resultUrl||await er(z)},[er,z,ee]),ep=(0,i.useCallback)(()=>{var e,t;let r=null==ea?void 0:null===(e=ea.result)||void 0===e?void 0:null===(t=e.result)||void 0===t?void 0:t.resultUrl;if(r)return a(h.B_.MEDIA_SAVE,{media_time:0,picture_number:1,edit_func:_.MU[_.lS.ImageRetouch],task_id:Q.current,...Y(z)}),(0,m.LR)(r,_.MU[_.lS.ImageRetouch])},[null==ea?void 0:null===(e=ea.result)||void 0===e?void 0:null===(t=e.result)||void 0===t?void 0:t.resultUrl,a,z]),eg=(0,i.useMemo)(()=>(0,I.SF)(e=>{(0,I.rq)(e,e=>"retouch_".concat(e.styleId)).forEach(e=>{a(h.B_.MATERIAL_EXPOSURE,{from_tab:_.MU[_.lS.ImageRetouch],task_id:Q.current,style_id:e.map(e=>"retouch_".concat(e.styleId)).join(",")})})}),[a]),eh=(0,i.useCallback)((e,t)=>{eg(t)},[eg]),[e_,eb]=(0,I.Vl)(eh),ex=(0,i.useMemo)(()=>F.map(e=>(0,n.jsxs)("div",{ref:t=>{eb(t,e.styleId,e)},onClick:()=>ev(e.styleId),className:(0,f.cn)("flex flex-shrink-0 flex-col items-center"),children:[(0,n.jsx)("div",{className:(0,f.cn)("relative flex h-[91px] w-[71px] cursor-pointer rounded-[8px] border border-transparent p-[2px]",e.styleId===z&&"border-[var(--theme-color)]"),children:(0,n.jsx)(u(),{src:(0,x.sX)(e.url,195,255),width:65,height:85,alt:e.name,className:"rounded-[6px]"})}),(0,n.jsx)("div",{className:"break-all pt-[6px] text-center text-[10px]",children:e.name})]},e.styleId)),[F,ev,z,eb]);return(0,n.jsxs)("div",{className:"mt-0",children:[B,(0,n.jsx)("div",{className:(0,c.Z)(A(),w().main_1200),children:(0,n.jsxs)("div",{className:"mobile:flex-col mobile:px-0 xmd:gap-6 flex justify-center gap-10 px-6 py-5 md:min-h-[600px] md:pb-[60px] md:pt-8",children:[(0,n.jsxs)("div",{className:"mobile:px-4 relative flex w-full flex-1 flex-col gap-3 overflow-hidden md:gap-4",children:[(0,n.jsx)(O.Z,{module:_.lS.ImageRetouch,headerType:O.P.TWO_BTN,upload:{show:!0,enable:!ec,checkSizeAndPixel:!1,setUploading:G,onUpload:es,onUrl:es},download:{show:!0,disabled:ef,onClick:ep}}),(0,n.jsx)("div",{ref:K,className:"mobile:h-[322px] relative isolate flex h-full w-full grow select-none items-center justify-center overflow-hidden rounded-[20px] bg-white/10",style:H?{height:H.height}:{},children:H&&(0,n.jsx)(E.ZP,{stageRect:H,originUrl:en,result:{resultUrl:eo,styleId:null==ea?void 0:null===(r=ea.result)||void 0===r?void 0:null===(l=r.request)||void 0===l?void 0:l.mode},uploading:$,status:null==ea?void 0:ea.status,module:_.lS.ImageRetouch,reportId:Q,getStyleId:Y})})]}),(0,n.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-5 md:mt-[56px] md:w-[320px]",children:[(0,n.jsx)("div",{className:(0,f.cn)("relative w-full",J&&("end"===V||"both"===V)&&"".concat(w()["scroll-fade-prev"]),J&&("start"===V||"both"===V)&&"".concat(w()["scroll-fade-next"]," ")),children:J?(0,n.jsx)(C.Z,{ref:q,className:"mobile:px-4 gap-3",children:ex}):(0,n.jsx)("div",{className:"no-scrollbar w-full overflow-x-auto md:grid md:grid-cols-4 md:gap-3",children:ex})}),(0,n.jsx)("div",{className:"mobile:px-4 flex w-full flex-col items-center justify-center gap-5",children:(0,n.jsx)(L.z,{disabled:ed,onClick:em,variant:"ghost",className:(0,f.cn)("h-[60px] w-full max-w-[330px] gap-[10px] bg-[var(--theme-color)] text-lg font-semibold text-[var(--c-text-intro-upload-btn)]",ed&&"opacity-30"),children:(0,n.jsxs)("div",{className:"flex flex-col items-center",children:[(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,n.jsx)(y.Z,{width:24,height:24}),(0,n.jsx)("div",{className:"mb-[2px] flex items-center justify-center",children:(0,n.jsx)("span",{className:"text-lg font-semibold text-[var(--c-text-intro-upload-btn)]",children:(0,o.t)("gen.generate.button")})})]}),(0,n.jsx)("div",{className:"text-sm font-normal leading-[1.5] tracking-[-0.24px] text-[#1C2A06]",children:(0,n.jsx)("span",{children:(0,o.t)("gen.cost.generate")})})]})})})]})]})})]})}},70647:function(e,t,r){r.d(t,{y:function(){return i}});var l=r(36958),n=r(75271);let i=()=>
1{let[e,t]=(0,n.useState)([]),r=async()=>{try{let{data:{data:e}}=await l.Le.getMaterialList(l.ZJ.AutoRetouch,"2.0",{pageIndex:1,pageSize:100});t(e)}catch(e){t([])}};return(0,n.useEffect)(()=>{r()},[]),{styleList:e}}},5722:function(e,t,r){var l=r(75271);let n=l.forwardRef(function({title:e,titleId:t,...r},n){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))});t.Z=n},82095:function(e,t,r){r.d(t,{_:function(){return l}});function l(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}},67811:function(e,t,r){r.d(t,{Z:function(){return _}});var l=r(82433),n=r(99615),i=function(){return n.Z.Date.now()},s=/\s/,a=function(e){for(var t=e.length;t--&&s.test(e.charAt(t)););return t},u=/^\s+/,o=r(98111),c=0/0,d=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,v=/^0o[0-7]+$/i,m=parseInt,p=function(e){if("number"==typeof e)return e;if((0,o.Z)(e))return c;if((0,l.Z)(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=(0,l.Z)(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,a(t)+1).replace(u,""):t;var n=f.test(e);return n||v.test(e)?m(e.slice(2),n?2:8):d.test(e)?c:+e},g=Math.max,h=Math.min,_=function(e,t,r){var n,s,a,u,o,c,d=0,f=!1,v=!1,m=!0;if("function"!=typeof e)throw TypeError("Expected a function");function _(t){var r=n,l=s;return n=s=void 0,d=t,u=e.apply(l,r)}function b(e){var r=e-c,l=e-d;return void 0===c||r>=t||r<0||v&&l>=a}function x(){var e,r,l,n=i();if(b(n))return I(n);o=setTimeout(x,(e=n-c,r=n-d,l=t-e,v?h(l,a-r):l))}function I(e){return(o=void 0,m&&n)?_(e):(n=s=void 0,u)}function y(){var e,r=i(),l=b(r);if(n=arguments,s=this,c=r,l){if(void 0===o)return d=e=c,o=setTimeout(x,t),f?_(e):u;if(v)return clearTimeout(o),o=setTimeout(x,t),_(c)}return void 0===o&&(o=setTimeout(x,t)),u}return t=p(t)||0,(0,l.Z)(r)&&(f=!!r.leading,a=(v="maxWait"in r)?g(p(r.maxWait)||0,t):a,m="trailing"in r?!!r.trailing:m),y.cancel=function(){void 0!==o&&clearTimeout(o),d=0,n=c=s=o=void 0},y.flush=function(){return void 0===o?u:I(i())},y}},98111:function(e,t,r){var l=r(33918),n=r(13795);t.Z=function(e){return"symbol"==typeof e||(0,n.Z)(e)&&"[object Symbol]"==(0,l.Z)(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.