(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9939],{4465:function(e,t,n){"use strict";n.d(t,{J:function(){return loadStripe}});var r="https://js.stripe.com/v3",o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,findScript=function(){for(var e=document.querySelectorAll('script[src^="'.concat(r,'"]')),t=0;t<e.length;t++){var n=e[t];if(o.test(n.src))return n}return null},injectScript=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(r).concat(t);var o=document.head||document.body;if(!o)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n},registerWrapper=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.54.2",startTime:t})},i=null,initStripe=function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return registerWrapper(r,n),r},a=Promise.resolve().then(function(){return null!==i?i:i=new Promise(function(e,t){if("undefined"==typeof window||"undefined"==typeof document){e(null);return}if(window.Stripe,window.Stripe){e(window.Stripe);return}try{var n=findScript();n||(n=injectScript(null)),n.addEventListener("load",function(){window.Stripe?e(window.Stripe):t(Error("Stripe.js not available"))}),n.addEventListener("error",function(){t(Error("Failed to load Stripe.js"))})}catch(e){t(e);return}})}),l=!1;a.catch(function(e){l||console.warn(e)});var loadStripe=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];l=!0;var r=Date.now();return a.then(function(e){return initStripe(e,t,r)})}},6915:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1373);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let o=(0,r.Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},6316:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1373);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let o=(0,r.Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},2691:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pricing",function(){return n(2378)}])},1731:function(e,t,n){"use strict";n.d(t,{Ol:function(){return l},SZ:function(){return c},Zb:function(){return a},aY:function(){return u},eW:function(){return d},ll:function(){return s}});var r=n(5893),o=n(7294),i=n(2917);let a=o.forwardRef((e,t)=>{let{className:n,...o}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("rounded-xl border bg-card text-card-foreground shadow",n),...o})});a.displayName="Card";let l=o.forwardRef((e,t)=>{let{className:n,...o}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",n),...o})});l.displayName="CardHeader";let s=o.forwardRef((e,t)=>{let{className:n,...o}=e;return(0,r.jsx)("h3",{ref:t,className:(0,i.cn)("font-semibold leading-none tracking-tight",n),...o})});s.displayName="CardTitle";let c=o.forwardRef((e,t)=>{let{className:n,...o}=e;return(0,r.jsx)("p",{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",n),...o})});c.displayName="CardDescription";let u=o.forwardRef((e,t)=>{let{className:n,...o}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("p-6 pt-0",n),...o})});u.displayName="CardContent";let d=o.forwardRef((e,t)=>{let{className:n,...o}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex items-center p-6 pt-0",n),...o})});d.displayName="CardFooter"},2378:function(e,t,n){"use strict";let r;n.r(t),n.d(t,{__N_SSG:function(){return g},default:function(){return PricingPage}});var o=n(5893),i=n(7294),a=n(1163),l=n(7871),s=n(4465),c=n(4155);let getStripe=()=>{if(!r){var e,t;r=(0,s.J)(null!==(t=null!==(e=c.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE)&&void 0!==e?e:"pk_live_51I6ygMC9tctgYpa13cmNI4jATvp0tNEh9dF0Kq6NROFi8fx1bthD4s1k4dn806ewqJC6dteD0usCCqusKV0eGx2300QfXgIcVi")&&void 0!==t?t:"")}return r};var u=n(5922),d=n(6915),m=n(1373);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let f=(0,m.Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var p=n(6316),h=n(9663),x=n(1731);let v=["Unlimited transcriptions","Advanced summarization and highlights","Over 100 languages supported","Interactive Q&A chatbot","Generate viral moments from any video (10 per month)","Dub videos into your native language (3 per month)","Create custom quizzes to practice what you learned","Convert videos to blog posts, LinkedIn articles, or Twitter threads","Download transcripts, summaries, and videos","TLDR Academy: Transform any YouTube playlist into study materials","Compare and analyze multiple videos","Enjoy Lofi music while you work","No daily limits or ads","Priority support"];function Pricing(e){let{products:t}=e,n=(0,a.useRouter)(),[r,s]=(0,i.useState)("month"),[c,m]=(0,i.useState)(),{user:g,isLoading:y,subscription:b}=(0,u.aF)(),handleCheckout=async e=>{if(m(e.id),!g)return n.push("/signin");if(b)return n.push("/account");try{let{sessionId:t}=await (0,l.qC)({url:"/api/create-checkout-session",data:{price:e}}),n=await getStripe();null==n||n.redirectToCheckout({sessionId:t})}catch(e){return alert(null==e?void 0:e.message)}finally{m(void 0)}},copyPromoCode=()=>{navigator.clipboard.writeText("SAVE25")};return t.length?(0,o.jsx)("section",{className:"bg-gray-50 py-16 sm:py-24",children:(0,o.jsxs)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:[(0,o.jsxs)("div",{className:"mx-auto max-w-3xl text-center",children:[(0,o.jsx)("h1",{className:"text-4xl font-extrabold text-gray-900 sm:text-5xl",children:"Unlock the Power of YouTube"}),(0,o.jsx)("p",{className:"mt-6 text-xl text-gray-600",children:"Transform the way you interact with YouTube with our cutting-edge AI tools."})]}),(0,o.jsx)("div",{className:"mt-16 flex flex-col items-center",children:t.map(e=>{var t,n,i;let a=null==e?void 0:null===(t=e.prices)||void 0===t?void 0:t.find(e=>e.interval===r&&1900===e.unit_amount);if(!a)return null;let l=new Intl.NumberFormat("en-US",{style:"currency",currency:a.currency,minimumFractionDigits:0}).format(((null==a?void 0:a.unit_amount)||0)/100),s=Math.floor(.75*((null==a?void 0:a.unit_amount)||0)),u=new Intl.NumberFormat("en-US",{style:"currency",currency:a.currency,minimumFractionDigits:0}).format(s/100);return(0,o.jsxs)(x.Zb,{className:"w-full max-w-3xl",children:[(0,o.jsxs)("div",{className:"bg-red-500 p-4 text-center text-white",children:[(0,o.jsx)("span",{className:"text-lg font-bold",children:"Limited Time Offer: 25% OFF for the first 2 months!"}),(0,o.jsxs)("div",{className:"mt-2 flex items-center justify-center",children:[(0,o.jsx)("span",{className:"mr-2 text-xl font-semibold",children:"Use code:"}),(0,o.jsx)("code",{className:"rounded bg-white px-2 py-1 text-xl font-bold text-red-500",children:"SAVE25"}),(0,o.jsxs)(h.z,{variant:"ghost",size:"icon",className:"ml-2 text-white hover:bg-red-600 hover:text-white",onClick:copyPromoCode,children:[(0,o.jsx)(d.Z,{className:"h-4 w-4"}),(0,o.jsx)("span",{className:"sr-only",children:"Copy promo code"})]})]})]}),(0,o.jsxs)(x.Ol,{children:[(0,o.jsx)(x.ll,{className:"text-center text-3xl font-bold",children:"Our Premium Plan"}),(0,o.jsx)(x.SZ,{className:"text-center text-xl",children:"Unlock all our features and transform your YouTube experience."})]}),(0,o.jsxs)(x.aY,{children:[(0,o.jsxs)("div",{className:"mb-8 text-center",children:[(0,o.jsx)("span",{className:"text-6xl font-bold",children:u}),(0,o.jsxs)("span",{className:"text-2xl text-gray-600",children:["/",r]}),(0,o.jsxs)("div",{className:"mt-2",children:[(0,o.jsxs)("span",{className:"text-lg text-gray-500 line-through",children:[l,"/",r]}),(0,o.jsx)("span",{className:"ml-2 text-lg font-semibold text-red-500",children:"Save 25%"})]}),(0,o.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["For the first 2 months, then ",l,"/",r]})]}),(0,o.jsx)("ul",{className:"grid gap-4 sm:grid-cols-2",children:v.map(e=>(0,o.jsxs)("li",{className:"flex items-center",children:[(0,o.jsx)(f,{className:"mr-3 h-5 w-5 flex-shrink-0 text-green-500"}),(0,o.jsx)("span",{className:"text-gray-700",children:e})]},e))})]}),(0,o.jsx)(x.eW,{children:(0,o.jsxs)(h.z,{onClick:()=>handleCheckout(a),disabled:y||c===a.id,className:"w-full bg-red-500 py-4 text-lg font-semibold hover:bg-red-600",children:[y||c===a.id?(0,o.jsx)(p.Z,{className:"mr-2 h-5 w-5 animate-spin"}):null,e.name===(null==b?void 0:null===(i=b.prices)||void 0===i?void 0:null===(n=i.products)||void 0===n?void 0:n.name)?"Manage Your Subscription":"Upgrade to Pro - 25% OFF"]})})]},e.id)})}),(0,o.jsx)("div",{className:"mt-12 text-center",children:(0,o.jsx)("p",{className:"text-lg text-gray-600",children:"All plans come with a 30-day money-back guarantee. No questions asked."})})]})}):(0,o.jsx)("section",{className:"bg-gray-100 py-16",children:(0,o.jsx)("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 lg:px-8",children:(0,o.jsxs)(x.Zb,{children:[(0,o.jsx)(x.Ol,{children:(0,o.jsx)(x.ll,{className:"text-center text-3xl font-bold",children:"No Pricing Plans Available"})}),(0,o.jsx)(x.aY,{children:(0,o.jsxs)("p",{className:"text-center text-xl",children:["No subscription pricing plans found. Create them in your"," ",(0,o.jsx)("a",{className:"text-primary underline",href:"https://dashboard.stripe.com/products",rel:"noopener noreferrer",target:"_blank",children:"Stripe Dashboard"}),"."]})})]})})})}var g=!0;function PricingPage(e){let{products:t}=e;return(0,o.jsx)(Pricing,{products:t})}},7871:function(e,t,n){"use strict";n.d(t,{AK:function(){return classNames},Ax:function(){return getURL},Q7:function(){return aggregateTimeStamps},Tm:function(){return extractVideoId},be:function(){return handleDownloadClick},eC:function(){return convertSecondsToISO},qC:function(){return postData}});var r=n(4155);let getURL=()=>{var e,t;let n=null!==(t=null==r?void 0:null===(e=r.env)||void 0===e?void 0:"https://www.you-tldr.com/")&&void 0!==t?t:"http://localhost:3000/";return"/"===(n=n.includes("http")?n:"https://".concat(n)).charAt(n.length-1)?n:"".concat(n,"/")},postData=async e=>{let{url:t,data:n}=e;console.log("posting,",t,n);let r=await fetch(t,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),credentials:"same-origin",body:JSON.stringify(n)});if(!r.ok)throw console.log("Error in postData",{url:t,data:n,res:r}),Error(r.statusText);return r.json()};function classNames(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}function convertSecondsToISO(e){var t=~~(e/3600),n=~~(e%3600/60),r=~~e%60,o="";return t>0&&(o+=""+t+":"+(n<10?"0":"")),o+=""+n+":"+(r<10?"0":"")+r}function convertDataToCSVUri(e){let t="data:text/csv;charset=utf-8,",n=e[0],r=Object.keys(n),o=r.join(",");return t+=o+"\r\n",e.forEach(function(e){let n=[];for(let t in r)n.push(e[r[t]]);let o=n.join(",");t+=o+"\r\n"}),encodeURI(t)}function handleDownloadClick(e,t){if("csv-detailed"===e){let e=convertDataToCSVUri(t);var n=document.createElement("a");n.setAttribute("href",e),n.setAttribute("download","output.csv"),document.body.appendChild(n),n.click()}else if("csv"===e){let e="";t.forEach(t=>{e+=t.text+"\n"});let r=convertDataToCSVUri([{text:e}]);var n=document.createElement("a");n.setAttribute("href",r),n.setAttribute("download","output.csv"),document.body.appendChild(n),n.click()}else if("text"===e){let e="";t.forEach(t=>{e+=t.text+"\n"});let r=convertDataToCSVUri([{text:e}]);var n=document.createElement("a");n.setAttribute("href",r),n.setAttribute("download","output.txt"),document.body.appendChild(n),n.click()}else if("doc"===e){let e="";t.forEach(t=>{e+=t.text+"\n"});let r=convertDataToCSVUri([{text:e}]);var n=document.createElement("a");n.setAttribute("href",r),n.setAttribute("download","output.doc"),document.body.appendChild(n),n.click()}else if("srt"===e){let e="";for(let n=0;n<t.length;n++){let r=t[n],o=r.start,i=r.start+r.duration,a=new Date(1e3*o).toISOString().substr(11,12).replace(".",","),l=new Date(1e3*i).toISOString().substr(11,12).replace(".",",");e+="".concat(n+1,"\n").concat(a," --> ").concat(l,"\n").concat(r.text,"\n\n")}let n=new Blob([e],{type:"text/srt"}),r=URL.createObjectURL(n),o=document.createElement("a");o.style.display="none",o.href=r,o.download="output.srt",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)}else if("vtt"===e){let e="WEBVTT\n\n";for(let n=0;n<t.length;n++){let r=t[n],o=r.start,i=r.start+r.duration,a=new Date(1e3*o).toISOString().substr(11,12),l=new Date(1e3*i).toISOString().substr(11,12);e+="".concat(n+1,"\n").concat(a," --> ").concat(l,"\n- ").concat(r.text,"\n\n")}let n=new Blob([e],{type:"text/vtt"}),r=URL.createObjectURL(n),o=document.createElement("a");o.style.display="none",o.href=r,o.download="output.vtt",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)}}function aggregateTimeStamps(e,t){let n=[],r=0,o="";if(t.forEach(t=>{let i=n.length+1;t.duration+t.start<=i*e?(r+=t.duration,t.top_sentence?o+="<b>".concat(t.text,"</b>"," "):o+=t.text+" "):(r=0,""!==o&&n.push({text:o,start:(i-1)*e}),o=t.text+" ")}),0!==r){let t=n.length;n.push({text:o,start:t*e})}return n}let extractVideoId=e=>{let t="";if(e.includes("v=")){t=e.split("v=")[1];let n=t.indexOf("&");-1!==n&&(t=t.substring(0,n))}else t=e.split(".be/")[1];return t}},4155:function(e){var t,n,r,o=e.exports={};function defaultSetTimout(){throw Error("setTimeout has not been defined")}function defaultClearTimeout(){throw Error("clearTimeout has not been defined")}function runTimeout(e){if(t===setTimeout)return setTimeout(e,0);if((t===defaultSetTimout||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){t=defaultSetTimout}try{n="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){n=defaultClearTimeout}}();var i=[],a=!1,l=-1;function cleanUpNextTick(){a&&r&&(a=!1,r.length?i=r.concat(i):l=-1,i.length&&drainQueue())}function drainQueue(){if(!a){var e=runTimeout(cleanUpNextTick);a=!0;for(var t=i.length;t;){for(r=i,i=[];++l<t;)r&&r[l].run();l=-1,t=i.length}r=null,a=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===defaultClearTimeout||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}o.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];i.push(new Item(e,t)),1!==i.length||a||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=noop,o.addListener=noop,o.once=noop,o.off=noop,o.removeListener=noop,o.removeAllListeners=noop,o.emit=noop,o.prependListener=noop,o.prependOnceListener=noop,o.listeners=function(e){return[]},o.binding=function(e){throw Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw Error("process.chdir is not supported")},o.umask=function(){return 0}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=2691)}),_N_E=e.O()}]);