PageSourceSearch

http://reports.reidin.com/assets/SocialMedia-Bhu9ljWm.js

js reidin.com collected 2026-09-24 20:06:56 UTC 9,162 bytes, 1 lines download raw bytes

1import{r as n,Q as H,m as R,f as ee,j as e,n as r,k as te}from"./index-wnr683Hh.js";import{C as w,H as se}from"./HelperChat-Cgga1cWa.js";import{a as P,D as _,b as V,C as p,E as ae,L as le,R as ce,F as U}from"./LeftOutlined-Dh5BYfF_.js";import{B as k,M as re}from"./index-DOhElbdn.js";import{I as Q}from"./AntdIcon-D7UhSpA6.js";import{a as W,M as I,I as T,D as ne}from"./DownOutlined-DgzhasMf.js";import"./index-BXZKBrK0.js";import"./Input-spNa0bMW.js";var oe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},ie=function(o,x){return n.createElement(Q,H({},o,{ref:x,icon:oe}))};const de=n.forwardRef(ie);var ue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},he=function(o,x){return n.createElement(Q,H({},o,{ref:x,icon:ue}))};const me=n.forwardRef(he),L="/assets/blank-tumbnail-7s9tBjEf.jpg",{Meta:fe}=P,ge=()=>{const[i,o]=n.useState([]),[x,v]=n.useState(!1),[m,C]=n.useState(["youtube","instagram","facebook","tiktok","linkedin","x"]),{t:S}=R(),f=ee(t=>t.auth.user.id);n.useEffect(()=>{j()},[]);const j=async()=>{await w.getSocialAccount(f).then(t=>{if(t&&Object.keys(t.data).length>0){const s=Object.keys(t.data).filter(d=>t.data[d]).map(d=>({platform:d,url:t.data[d]}));o(s),v(!0);const u=new Set(s.map(d=>d.platform.toLowerCase())),y=m.filter(d=>!u.has(d.toLowerCase()));C(y)}else v(!1)})},$=t=>l=>{const s=[...i],u=l.key,y=s[t].platform;m.includes(u)&&(s[t].platform=u,o(s),C(d=>[...d.filter(E=>E!==u),y].filter(Boolean)))},M=t=>l=>{const s=[...i];s[t].url=l.target.value,o(s)},A=()=>{if(i.filter(l=>l.platform&&l.url).length<i.length){r.toastMessage("Please fill out the social account name for the selected platform before adding a new one.","warn");return}if(m.length>0){const l=m[0];o([...i,{platform:l,url:""}]),C(m.filter(s=>s!==l))}else r.toastMessage("All platforms have been added.","warn")},b=t=>()=>{const l=i.filter((u,y)=>y!==t),s=i[t].platform;o(l),C([...m,s])},O=async()=>{let t={};const l=["youtube","instagram","facebook","tiktok","linkedin","x"];for(const{platform:s,url:u}of i)if(u)t[s]=u;else{r.toastMessage(`Account name cannot be empty for ${s}`,"warn");return}l.forEach(s=>{t.hasOwnProperty(s)||(t[s]="")}),x?await w.updateSocialAccount(f,t).then(s=>{s&&r.toastMessage("User social account updated successfully.","success")}).catch(s=>{r.toastMessage(`An error occurred while updating the account for ${account.platform}.`,"warn")}):await w.saveSocialAccount(t,f).then(s=>{s&&r.toastMessage("User social accounts created successfully.","success")}).catch(s=>{r.toastMessage("An error occurred while creating the accounts.","warn")}),j()},N=()=>{w.deleteSocialAccount(f).then(t=>{t&&r.toastMessage("User social accounts deleted successfully.","success")}).catch(t=>{r.toastMessage("An error occurred while deleting the accounts.","warn")}),j()},g=(t,l)=>e.jsxs("div",{className:"d-flex justify-content-center social-input-row",style:{marginBottom:10},children:[e.jsx(p,{children:e.jsx(W,{overlay:e.jsx(I,{onClick:$(l),children:m.map(s=>e.jsx(I.Item,{children:s},s))}),children:e.jsx(k,{style:{width:"12vh"},children:t.platform})})}),e.jsx(p,{children:e.jsx(T,{type:"text",placeholder:`Enter your ${t.platform.toLowerCase()} account`,prefix:"@",value:t.url,onChange:M(l),style:{marginLeft:10}})}),e.jsx(p,{children:e.jsx(k,{icon:e.jsx(de,{}),onClick:b(l),style:{marginLeft:10}})})]},l);
1return e.jsx("div",{children:e.jsx(P,{className:"card-shadow",style:{width:450,margin:30},actions:[e.jsx(_,{style:{color:"red"},onClick:N},"delete"),e.jsx(V,{style:{color:"green"},onClick:O},"save")],children:e.jsx(fe,{title:e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{textAlign:"center"},children:S("socialMedia.socialMediaforpdfprofile")}),i.map((t,l)=>g(t,l)),e.jsx(k,{icon:e.jsx(me,{}),onClick:A,style:{display:"block",margin:"0 auto"},children:S("socialMedia.add")})]})})})})},{Meta:xe}=P,ke=()=>{const i=te(),[o,x]=n.useState([]),[v,m]=n.useState("Instagram"),[C,S]=n.useState(""),[f,j]=n.useState(""),[$,M]=n.useState(!1),[A,b]=n.useState(!1),[O,N]=n.useState(null),{t:g}=R(),t=async()=>{await w.getSocialCards().then(a=>{a&&x(a.data)}).catch(a=>{r.toastMessage("An error occurred while fetching the cards.","warn")})};n.useEffect(()=>{t(),z()},[o.length]);const l=()=>f?!0:(r.toastMessage("Please enter the url.","warn"),!1),s=a=>{a.target.value||j(null),j(a.target.value)},u=a=>{const c=/\/(reel|p)\/([^\/?#]+)\//,h=a.match(c);return h&&h[2]?h[2]:null},y=a=>c=>{a(c.key)},d=e.jsx(I,{onClick:y(m),children:e.jsx(I.Item,{children:"Instagram"},"Instagram")}),E=()=>e.jsx("div",{className:"d-flex justify-content-center",children:e.jsx(p,{children:e.jsx(T,{type:"text",placeholder:g("socialMedia.socialPlaceholder"),value:f,onChange:s})})}),q=()=>e.jsxs("div",{className:"d-flex justify-content-center",children:[e.jsx(p,{children:D(d,v)}),e.jsx(p,{children:E()})]}),D=(a,c)=>e.jsx(W,{overlay:a,children:e.jsxs(k,{children:[c," ",e.jsx(ne,{})]})}),G=async()=>{if(!l())return;const c={url:"https://www.instagram.com/p/"+u(f)+"/",platform:v.toLowerCase(),is_active:!0};await w.saveSocialCard(c).then(h=>{h&&(c.id=h.data.id,r.toastMessage("Social Media Card created successfully.","success"))}).catch(h=>{r.toastMessage(h.response.data.message,"warn")}),x([...o,c]),F(),t()},F=()=>{m("Instagram"),j("")},J=async a=>{await w.deleteSocialCard(a).then(c=>{c&&r.toastMessage("Card deleted successfully.","success")}).catch(c=>{r.toastMessage("An error occurred while deleting the card.","warn")}),t()},K=a=>{const c=o.find(h=>h.id===a);c&&(j(c.url),S(`${r.cdnUrlCreate(c.image_path)}`),m(c.platform),N(a),b(!0),M(!0))},X=()=>{l()&&(Z(O),b(!1),M(!1),F())},Y=()=>{b(!1),M(!1),F()},Z=async a=>{const h={url:"https://www.instagram.com/p/"+u(f)+"/",platform:v};await w.updateSocialCard(a,h).then(B=>{B&&r.toastMessage("Card updated successfully.","success")}).catch(B=>{r.toastMessage("An error occurred while updating the card.","warn")}),t()},z=()=>o.map((a,c)=>e.jsx(p,{md:6,className:"mb-4",children:e.jsx(P,{hoverable:!0,style:{width:240},cover:a.url?e.jsx("div",{className:"img-wrapper",children:e.jsx("img",{src:`${r.cdnUrlCreate(a.image_path)}`,alt:"Thumbnail",style:{width:"100%",height:"100%",objectFit:"cover"}})}):e.jsxs("div",{className:"d-flex flex-column align-items-center justify-content-center vh-100 text-center",children:[e.jsx("p",{children:"There is no thumbnail for this URL"}),e.jsx("img",{width:350,height:280,alt:"blank-thumbnail",src:L})]}),actions:[e.jsx(_,{style:{color:"red"},onClick:()=>J(a.id)},"delete"),e.jsx(ae,{style:{color:"blue"},onClick:()=>K(a.id)},"edit")]})},c));return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"addCard d-flex justify-content-center",style:{position:"relative"},children:[e.jsx(k,{type:"link",icon:e.jsx(le,{}),style:{position:"absolute",top:10,left:10,zIndex:10,fontSize:"16px"},onClick:()=>i("/"),children:g("socialMedia.backToMainPage")}),e.jsx(ge,{}),e.jsx("div",{children:e.jsx(P,{className:"card-shadow",style:{width:450,margin:30},cover:e.jsxs("div",{className:"d-flex flex-column align-items-center justify-content-center vh-100 text-center",children:[e.jsx("p",{className:"mt-5",style:{fontWeight:"bold"},children:g("socialMedia.createtumbnailforyourpdf")}),e.jsx("img",{width:350,height:280,alt:"blank-tumbnail",src:L})]}),actions:[e.jsx(V,{style:{color:"green"},onClick:G},"save")],children:e.jsx(xe,{title:e.jsx(e.Fragment,{children:q()})})})})]}),e.jsxs("div",{className:"listing",children:[e.jsx(ce,{gutter:[16,16],children:z()}),e.jsx(re,{title:g("socialMedia.editCard"),open:A,onOk:X,onCancel:Y,okText:g("socialMedia.ok"),
1cancelText:g("socialMedia.cancel"),children:e.jsxs(U,{layout:"vertical",children:[e.jsx(U.Item,{children:f?e.jsx("div",{className:"img-wrapper",children:e.jsx("img",{src:C,alt:"Thumbnail",style:{width:"100%",height:"100%",objectFit:"cover"}})}):e.jsxs("div",{className:"d-flex flex-column align-items-center justify-content-center vh-100 text-center",children:[e.jsx("p",{children:g("socialMedia.thereisnothumbnailforthisURL")}),e.jsx("img",{width:350,height:280,alt:"blank-thumbnail",src:L})]})}),e.jsx(U.Item,{label:"Platform",children:D(d,v)}),e.jsx(U.Item,{label:"URL",children:e.jsx(p,{children:e.jsx(T,{type:"text",placeholder:g("socialMedia.socialPlaceholder"),value:f,onChange:s})})})]})})]}),e.jsx(se,{})]})};export{ke as default};

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.