PageSourceSearch

https://tryhugo.ai/static/js/5772.fc67449b.chunk.js

js tryhugo.ai collected 2026-10-05 16:09:16 UTC 5,629 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkreact_saas_template=self.webpackChunkreact_saas_template||[]).push([[5772],{45772:(e,t,a)=>{a.r(t),a.d(t,{default:()=>j});var i=a(89379),s=a(65043),n=a(57256),r=a(92823),o=a.n(r),l=(a(25884),a(85865)),d=a(11906),c=a(8789),p=a(12220),h=a(96446),u=a(53062),m=a(56258),x=a(40854),g=a.n(x),v=a(35323),b=a(70579);const j=(0,n.A)((e=>({wrapper:{display:"flex",flexDirection:"column",gap:e.spacing(2),maxWidth:"1000px"},dropzone:{display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",borderWidth:"2px",borderRadius:"2px",borderColor:e.palette.primary.main,borderStyle:"dashed",backgroundColor:"#fafafa",color:"#bdbdbd",outline:"none",transition:"border .24s ease-in-out",textAlign:"center","& p":{margin:e.spacing(.5)}},btnContainer:{display:"flex",flexDirection:"row-reverse",justifyContent:"end",gap:"1rem",alignItems:"center"},fileNameContainer:{display:"flex",flexDirection:"column","& ul":{margin:0,padding:e.spacing(0,1)},"& h4":{margin:e.spacing(2,0)}},titleField:{padding:"1rem",border:"1px solid #ccc",width:"100%",background:"transparent"},postImg:{height:"220px",width:"100%",aspectRatio:"16/9",objectFit:"cover",borderRadius:"8px"},profileContainer:{display:"flex",gap:"1rem",alignItems:"center","& img":{width:"55px",height:"55px",borderRadius:"50%"}}})),{withTheme:!0})((e=>{var t,a,n,r,x,j,f;let{classes:y,userLoggedIn:A}=e;const[w,C]=(0,s.useState)(""),[R,k]=(0,s.useState)(""),[S,D]=s.useState(!1),I=()=>D(!1),F=(0,v.W6)(),N=(0,v.zy)(),[z,P]=(0,s.useState)((null===(t=N.state)||void 0===t?void 0:t.edit)&&(null===(a=N.state)||void 0===a?void 0:a.post.imageURL)),{acceptedFiles:_,fileRejections:E,getRootProps:L,getInputProps:U,isDragActive:W,isDragAccept:M,isDragReject:B}=(0,c.VB)({maxFiles:1,accept:{"image/*":[]}});_.map((e=>(0,b.jsxs)("li",{children:[e.path," - ",e.size," bytes"]},e.path)));(0,s.useEffect)((()=>{if(_.length>0){const e=new FileReader;e.onloadend=()=>{P(e.result)},e.readAsDataURL(_[0])}}),[_]);return(0,s.useEffect)((()=>{var e;null!==(e=N.state)&&void 0!==e&&e.edit&&(k(N.state.post.title),C(N.state.post.content))}),[]),(0,b.jsxs)("div",{className:y.wrapper,style:{margin:null!==(n=N.state)&&void 0!==n&&n.edit?"10rem auto":"auto"},children:[(0,b.jsxs)("div",{className:y.profileContainer,children:[(0,b.jsx)("svg",{version:"1.1",id:"Vrstva_1",x:"0px",y:"0px",viewBox:"0 0 100 100",width:55,height:55,children:(0,b.jsxs)("g",{children:[(0,b.jsx)("path",{d:"M11.4,93.3c-0.1,0-0.1,0-0.2,0c-1.3-0.1-2.2-1.2-2.1-2.4c1.3-19.1,19.3-34,40.9-34c21.6,0,39.6,14.9,40.9,33.9   c0.1,1.3-0.9,2.3-2.1,2.4c-1.3,0.1-2.3-0.9-2.4-2.1C85.2,74.4,69.2,61.4,50,61.4c-19.3,0-35.3,13.1-36.4,29.8   C13.5,92.4,12.5,93.3,11.4,93.3z"}),(0,b.jsx)("path",{d:"M50,52.3c-12.6,0-22.8-10.2-22.8-22.8S37.4,6.7,50,6.7c12.6,0,22.8,10.2,22.8,22.8S62.6,52.3,50,52.3z M50,11.3   c-10,0-18.2,8.2-18.2,18.2S40,47.7,50,47.7c10,0,18.2-8.2,18.2-18.2S60,11.3,50,11.3z"})]})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(l.A,{variant:"h6",children:A.name}),(0,b.jsx)(l.A,{variant:"subtitle1",fontSize:12,children:"Post to Anyone"})]})]}),(0,b.jsxs)("div",{className:y.btnContainer,children:[(0,b.jsx)(d.A,{variant:"outlined",color:"primary",disableElevation:!0,onClick:()=>D(!0),sx:{borderWidth:"2px"},children:null!==(r=_[0])&&void 0!==r&&r.path||null!==(x=N.state)&&void 0!==x&&x.post.imageURL?"Change Image":"Add Image"}),(0,b.jsx)("span",{children:null===(j=_[0])||void 0===j?void 0:j.path})]}),(0,b.jsx)(u.A,{"aria-labelledby":"transition-modal-title","aria-describedby":"transition-modal-description",open:S,onClose:I,closeAfterTransition:!0,slots:{backdrop:p.A},slotProps:{backdrop:{timeout:500}},children:(0,b.jsx)(m.A,{in:S,children:(0,b.jsxs)(h.A,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",border:"none",borderRadius:"8px",boxShadow:24,p:4},children:[(0,b.jsxs)("div",(0,i.A)((0,i.A)({},L({className:y.dropzone})),{},{children:[(0,b.jsx)("input",(0,i.A)({},U())),(0,b.jsx)("p",{children:"Drag and drop the image you want to upload"}),(0,b.jsx)("p",{children:"OR"}),(0,b.jsx)("p",{children:"Click to browse"})]})),(0,b.jsxs)("aside",{className:y.fileNameContainer,children:[(0,b.jsx)("h4",{children:"File name: "}),(0,b.jsx)("ul",{children:null===(f=_[0])||void 0===f?void 0:f.path}),(0,b.jsx)(d.A,{disabled:0===_.length,onClick:()=>I(),variant:"contained",sx:{alignSelf:"end"},children:"Add Image"})]})]})})}),z&&(0,b.jsx)("img",{src:z,alt:"preview",className:y.postImg}),(0,b.jsx)("input",{type:"text",name:"title",placeholder:"Enter Post title",className:y.titleField,onChange:e=>k(e.target.value),value:R}),(0,b.jsx)(o(),{theme:"snow",value:w,onChange:C}),(0,b.jsx)(d.A,{onClick:()=>(async()=>
1{if(_.length){let e=new FormData,t="".concat(R,".","jpg"),a=new File([_[0]],t);e.append("file",a),g().post("/api/users/upload-image",e).then((e=>{var t;let a={title:R,content:w,imageURL:e.data.secure_url};return null!==(t=N.state)&&void 0!==t&&t.edit?g().put("/api/socials/posts/update/".concat(N.state.post.slug),a):g().post("/api/socials/posts/create",a)})).then((()=>{F.push({pathname:"/community",state:{created:!0}})})).catch((e=>{console.error("An error occurred:",e)}))}else try{var e;let t={title:R,content:w};null!==(e=N.state)&&void 0!==e&&e.edit?await g().put("/api/socials/posts/update/".concat(N.state.post.slug),t):await g().post("/api/socials/posts/create",t),F.push({pathname:"/community",state:{created:!0}})}catch(t){console.error("An error occurred:",t)}})(),variant:"contained",color:"primary",disableElevation:!0,children:"Create Post"})]})}))}}]);
2//# sourceMappingURL=5772.fc67449b.chunk.js.map

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.