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]="de12d4a0-525d-4e92-8f4c-52134d3a124b",e._sentryDebugIdIdentifier="sentry-dbid-de12d4a0-525d-4e92-8f4c-52134d3a124b")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7841],{12086:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/repurpose-content",function(){return n(78066)}])},493:function(e,t,n){"use strict";var a=n(85893),r=n(3712),o=n(50232),i=n(38488),l=n(67294),s=n(48633),c=n(95857),u=n(29141);t.Z=()=>{let e=l.useContext(u.B1);return(0,l.useEffect)(()=>{e.setIsOpen(!1)},[]),(0,a.jsxs)(r.K,{maxW:400,spacing:4,margin:"auto",mt:"5vh",children:[(0,a.jsx)(o.X,{fontSize:"2xl",textAlign:"center",children:"You have been logged out."}),(0,a.jsx)(o.X,{p:10,fontSize:"lg",textAlign:"center",children:"Please login to continue using the app."}),(0,a.jsx)(i.z,{variant:"primary",onClick:()=>{var e,t;(0,c.kS)(!1);let n=null===(t=window)||void 0===t?void 0:null===(e=t.location)||void 0===e?void 0:e.href;n||(n="https://app.tweethunter.io/subscribe"),(0,s.zB)("twitter",{callbackUrl:n})},children:"Sign in"})]})}},78066:function(e,t,n){"use strict";n.a(e,async function(e,a){try{n.r(t),n.d(t,{default:function(){return T}});var r,o,i=n(85893),l=n(12553),s=n(88329),c=n(68029),u=n(15715),d=n(64831),p=n(82206),m=n(90092),h=n(38488),f=n(25295),b=n(6630),g=n(1467),w=n(493),y=n(56528),v=n(48633),x=n(96885),k=n(67294),j=n(89583),E=n(53854),S=n(95857),_=n(67142),C=n(74931),I=n(99832),R=e([g]);g=(R.then?(await R)():R)[0],(r=o||(o={})).Article="article",r.Youtube="youtube";let N=e=>{try{e.startsWith("https://")||e.startsWith("http://")||(e="https://"+e);let t=new URL(e).hostname,n=(null==t?void 0:t.replace("www.","").split(".")[0])||null;return n}catch(e){return null}},P={[o.Article]:{label:"Article",icon:(0,i.jsx)(l.J,{as:E.iDf}),placeholder:"https://website.com"},[o.Youtube]:{label:"Youtube Video",icon:(0,i.jsx)(l.J,{as:j.V2E}),placeholder:"https://youtube.com/watch?v=..."}};function T(){let[e,t]=(0,v.kP)(),[n,a]=(0,k.useState)(!1),[r,l]=(0,k.useState)(null),[j,E]=(0,k.useState)([]),[R,T]=(0,k.useState)(!1),z=(0,x.useRouter)(),[W,A]=(0,k.useState)(o.Article),[L,O]=(0,k.useState)(""),[D,F]=(0,k.useState)(""),U=async t=>{var n,a;let{account:r}=t;if(!(null==e?void 0:null===(n=e.user)||void 0===n?void 0:n.uid))throw Error("User is not authorised");let o=await (0,_.LP)(e),i=await fetch((0,I.kG)("generateTweetFromLink"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(o),tokenuserid:null==e?void 0:null===(a=e.user)||void 0===a?void 0:a.uid},body:JSON.stringify(t)}),l=await i.json();if(!l.success)throw Error((null==l?void 0:l.error)||"Formatting error");let s=[l.post].map(e=>({fullText:e.replace(/"/g,""),full_text:e.replace(/"/g,""),user:{name:r.name,description:r.description,image:r.image,profile_image_url_https:r.imageHosted,username:r.username}}));return{data:{tweets:s}}},Y=async e=>{try{var t,r;if(n)return;a(!0),W!==o.Youtube||L.includes("watch?v=")||C.default.error("Please ensure that you are using a video url");let i=(0,S.D0)(e);if(!i){C.default.error("Please add a Twitter account first");return}let l=await U({urlType:W,urlString:L,account:i}),s=(null==l?void 0:null===(t=l.data)||void 0===t?void 0:t.tweets)?null==l?void 0:null===(r=l.data)||void 0===r?void 0:r.tweets:[];E(s)}catch(e){console.error(e),C.default.error(e.message)}finally{a(!1)}},B=async t=>{F(""),t.preventDefault(),await Y(e)};return((0,k.useEffect)(()=>{F(""),W===o.Youtube&&F("We strongly recommended using videos that are voice-intensive and less than 15 minutes long.")},[W]),(0,k.useEffect)(()=>{let{from:t,idea:n}=z.query;e&&!R&&t&&n&&(T(!0),Y(e))},[e]),t||e)?(0,i.jsxs)(g.T,{title:"Repurpose Content Into Threads",description:"Transform any article or video into a thread",children:[(0,i.jsxs)(s.k,{mt:6,gap:4,maxW:"4xl",alignItems:"stretch",as:"form",onSubmit:B,children:[(0,i.jsxs)(c.x,{w:"100%",children:[(0,i.jsxs)(c.x,{display:"flex",alignItems:"flex-start",border:"1px solid",borderColor:"transparent",borderRadius:"md",bg:"neutral.background",_focusWithin:{boxShadow:"md",borderColor:"inherit"},children:[(0,i.jsx)(c.x,{minW:"fit-content",children:(0,i.jsx)(f.P,{options:Object.keys(P).map(e=>({label:P[e].label,value:e})),value:{label:P[W].label,value:W},onChange:e=>e&&A(e.value),isSearchable:!1,size:"sm",chakraStyles:{control:e=>({...e,borderRightRadius:0,borderLeftRadius:"md"})}})}),(0,i.jsx)(u.M,{h:"100%",py:1,children:(0,i.jsx)(d.i,{orientation:"vertical",borderColor:"neutral.content-subdued"})}),(0,i.jsx)(p.I,{border:"none",_hover:{border:"none"},_focus:{border:"none"},borderLeftRadius:"0",borderLeft:"0",variant:"filled",onChange:e=>{F("");let t=e.target.value,n=N(t);n===o.Youtube?A(o.Youtube):A(o.Article),O(t)},required:!0,value:L,autoFocus:!0,fontSize:"sm",placeholder:P[W].placeholder})]}),!!D.length&&(0,i.jsx)(m.x,{fontSize:"sm",align:"center",mt:2,fontWeight:"regular",color:"neutral.content",px:"12",children:D})]}),(0,i.jsx)(h.z,{variant:"primary",px:4,type:"submit",minW:"36",children:"â¡ï¸ Generate"})]}),n&&(0,i.jsxs)(c.x,{py:"24",maxW:"4xl",px:"8",children:[(0,i.jsx)(u.M,{mt:10,py:5,w:"100%",children:(0,i.jsx)(b.r,{loading:n,css:"display: block; margin: 0 auto; border-color: red;",size:50})}),(0,i.jsxs)(m.x,{fontSize:"sm",align:"center",children:["This may take a minute as we extract information from the URL you provided.",(0,i.jsx)("br",{}),"Feel free to come back to this page in a few moments, your content will be waiting for you."]})]}),(0,i.jsx)(c.x,{pt:10,children:!n&&!!(null==j?void 0:j.length)&&(0,i.jsx)(c.x,{w:"100%",children:(0,i.jsx)(y.Z,{send
1Request:Y,tweets:j,data:r,setData:l,disableBlur:!1,disableBookmarkButton:!0,disableRequest:!0,disableSaveCsv:!0,disableEmbed:!0,disableTryAgain:!1,disableSubMenu:!0,disableRetweet:!0,disableLike:!0,disableUserPopup:!0,isVariation:!0})})})]}):(0,i.jsx)(w.Z,{})}a()}catch(e){a(e)}})},89238:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var a=n(67294),r=function(){return(r=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},o=a.forwardRef(function(e,t){var n=a.useState(!1),o=n[0],i=n[1],l=a.useState(e.alwaysLoadIframe||!1),s=l[0],c=l[1],u=encodeURIComponent(e.id),d="string"==typeof e.playlistCoverId?encodeURIComponent(e.playlistCoverId):null,p=e.title,m=e.poster||"hqdefault",h=e.announce||"Watch",f=new URLSearchParams(r(r(r(r({},e.muted?{mute:"1"}:{}),e.alwaysLoadIframe?{}:{autoplay:"1",state:"1"}),e.enableJsApi?{enablejsapi:"1"}:{}),e.playlist?{list:u}:{})),b=e.noCookie?"https://www.youtube-nocookie.com":"https://www.youtube.com";b=e.cookie?"https://www.youtube.com":"https://www.youtube-nocookie.com";var g=e.playlist?"".concat(b,"/embed/videoseries?").concat(f.toString()):"".concat(b,"/embed/").concat(u,"?").concat(f.toString()),w=e.webp?"webp":"jpg",y=e.webp?"vi_webp":"vi",v=e.thumbnail||(e.playlist?"https://i.ytimg.com/".concat(y,"/").concat(d,"/").concat(m,".").concat(w):"https://i.ytimg.com/".concat(y,"/").concat(u,"/").concat(m,".").concat(w)),x=e.activatedClass||"lyt-activated",k=e.adNetwork||!1,j=e.aspectHeight||9,E=e.aspectWidth||16,S=e.iframeClass||"",_=e.playerClass||"lty-playbtn",C=e.wrapperClass||"yt-lite",I=e.onIframeAdded||function(){},R=e.rel?"prefetch":"preload",T=e.containerElement||"article",N=e.style||{};return a.useEffect(function(){s&&I()},[s]),a.createElement(a.Fragment,null,a.createElement("link",{rel:R,href:v,as:"image"}),a.createElement(a.Fragment,null,o&&a.createElement(a.Fragment,null,a.createElement("link",{rel:"preconnect",href:b}),a.createElement("link",{rel:"preconnect",href:"https://www.google.com"}),k&&a.createElement(a.Fragment,null,a.createElement("link",{rel:"preconnect",href:"https://static.doubleclick.net"}),a.createElement("link",{rel:"preconnect",href:"https://googleads.g.doubleclick.net"})))),a.createElement(T,{onPointerOver:function(){o||i(!0)},onClick:function(){s||c(!0)},className:"".concat(C," ").concat(s?x:""),"data-title":p,style:r(r({backgroundImage:"url(".concat(v,")")},{"--aspect-ratio":"".concat(j/E*100,"%")}),N)},a.createElement("button",{type:"button",className:_,"aria-label":"".concat(h," ").concat(p)}),s&&a.createElement("iframe",{ref:t,className:S,title:p,width:"560",height:"315",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,src:g})))})},9008:function(e,t,n){e.exports=n(42636)},70647:function(e,t,n){"use strict";n.d(t,{E:function(){return l}});var a=n(85893),r=n(376),o=n(49381),i=n(17997);let l=(0,o.G)((e,t)=>(0,a.jsx)(i.m.img,{ref:t,as:r.Z,className:"chakra-image",...e}))},85355:function(e,t,n){"use strict";n.d(t,{R:function(){return l}});var a=n(85893),r=n(34926),o=n(90608),i=n(17997);let l=e=>{let{className:t,...n}=e,l=(0,o.x)();return(0,a.jsx)(i.m.hr,{"aria-orientation":"horizontal",className:(0,r.cx)("chakra-menu__divider",t),...n,__css:l.divider})};l.displayName="MenuDivider"}},function(e){e.O(0,[4980,1778,3422,6765,1467,6528,9774,2888,179],function(){return e(e.s=12086)}),_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.