PageSourceSearch

https://www.euhu.co.uk/_next/static/chunks/pages/plans/editor/[id]/[slug]/image-346a6bee313b5db4.js

js euhu.co.uk collected 2026-10-04 05:21:18 UTC 3,580 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8698],{87687:function(e,a,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/plans/editor/[id]/[slug]/image",function(){return n(50410)}])},41296:function(e,a,n){"use strict";n.d(a,{X:function(){return s}});var t=n(33299),i=n(11163);function s(){let e=(0,i.useRouter)();return(0,t.useSession)({required:!0,onUnauthenticated:()=>{let a=encodeURIComponent(e.asPath);e.push("/sign-in?error=SessionRequired".concat(a?"&callbackUrl=".concat(a):""))}})}},50410:function(e,a,n){"use strict";n.r(a);var t=n(85893),i=n(55166),s=n(41296),l=n(22121),o=n(2962),d=n(11163),r=n(67294),u=n(35800),c=n(86501),m=n(90048),p=n(77783),g=n(18144),h=n(36445),v=n(83915),f=n(32562),y=n(55490),I=n(62469);let w=()=>{var e,a,n,h,w,b,x,N;let j=(0,s.X)(),_=(0,d.useRouter)(),k=(0,u.useErrorHandler)(),U="string"==typeof _.query.id?_.query.id:null,E=null!==(N=null===(e=_.query.slug)||void 0===e?void 0:e.toString())&&void 0!==N?N:"",P=(0,y.M)({type:"plans",mode:"editor",id:null!=U?U:"",slug:E,subSection:null}),q="string"==typeof _.query.sharedContentId?_.query.sharedContentId:void 0,S=v.h.plans.get.useQuery({planId:U||"",sharedContentId:q},{enabled:!0,retry:!1,onError:e=>{var a,n;return k(new p.FZ(null===(a=e.data)||void 0===a?void 0:a.httpStatus,null===(n=e.shape)||void 0===n?void 0:n.type))}}),C=v.h.plans.deletePlanImage.useMutation({onSuccess:()=>{S.refetch()}});async function Z(){await c.ZP.promise(C.mutateAsync({planId:U||""}),{error:"Deletion failed",loading:"Deleting image...",success:"Image deleted"})}let L=v.h.plans.setPlanImage.useMutation({trpc:{context:{skipBatch:!0}},onSuccess:e=>{e&&S.refetch()}});async function M(e){let a=await (0,f.l)(e);await c.ZP.promise(L.mutateAsync({planId:U||"",image:{data:a,name:e.name,type:e.type}}),{error:'Uploading "'.concat(e.name,'" failed'),loading:'Uploading file "'.concat(e.name,'"...'),success:'"'.concat(e.name,'" uploaded')})}return(0,r.useEffect)(()=>{var e,a;"authenticated"!==j.status||(0,l.Fs)("upload-plan-background",(null===(a=j.data.user)||void 0===a?void 0:null===(e=a.details)||void 0===e?void 0:e.permissions)||[])||_.replace("/plans/viewer/".concat(U||"undefined"))},[U,_,null===(h=j.data)||void 0===h?void 0:null===(n=h.user)||void 0===n?void 0:null===(a=n.details)||void 0===a?void 0:a.permissions,j.status]),(0,t.jsxs)("main",{className:"mx-auto",children:[(0,t.jsx)(o.PB,{title:"Plan Image"}),P&&(0,t.jsx)("div",{className:"mb-2",children:(0,t.jsxs)(m.Qj,{variant:"text",href:P,className:"inline-flex items-center gap-2 py-1 pr-1",size:"custom","data-testid":"page-image-back-button",children:[(0,t.jsx)(I.wyc,{className:"h-5 w-5 text-primary "})," Back"]})}),(0,t.jsx)(i.Z,{size:"h2",tag:"h2",className:"mb-2 grow break-words",children:"Edit Image"}),(0,t.jsx)("p",{className:"mb-2",children:"Specify a thumbnail image for this plan or, if there is one available, the default image will be used as a fallback."}),(0,t.jsx)("p",{className:"mb-4",children:"Please upload a square image which is between 1000 and 2000px wide."}),U&&(0,t.jsx)("div",{className:"relative h-full",children:(0,t.jsx)(g.Z,{id:U,onImageDelete:Z,onImageUpload:M,image:{isLoading:S.isLoading,defaultImageUrl:null===(w=S.data)||void 0===w?void 0:w.defaultImageUrl,customImageUrl:null===(b=S.data)||void 0===b?void 0:b.customImageUrl},isImageUploading:L.isLoading,uploadImageErrorMessage:null===(x=L.error)||void 0===x?void 0:x.message})})]})};a.default=w,w.getLayout=e=>(0,t.jsx)(h.Z,{children:e})}},function(e){e.O(0,[2946,6445,2994,2888,9774,179],function(){return e(e.s=87687)}),_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.