PageSourceSearch

https://notetube.ai/_next/static/chunks/8844.95e6acf494f87051.js

js notetube.ai collected 2026-10-05 14:15:06 UTC 4,959 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];if(null!=r)for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:notetube-web":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fe3097fe-1b86-44b4-88d2-6ac32118bb93",e._sentryDebugIdIdentifier="sentry-dbid-fe3097fe-1b86-44b4-88d2-6ac32118bb93")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8844],{28844:(e,t,r)=>{r.r(t),r.d(t,{default:()=>b});var s=r(54568),n=r(7620),a=r(27541),o=r(97066),i=r(24154),l=r(60844),u=r(97325),d=r(5137),c=r(37054),f=r(44267),y=r(64215),p=r(88270),h=r(6845);function b(e){let{onCreated:t}=e,r=(0,o.c)("create"),b=(0,a.useRouter)(),{showUpgradeModal:m}=(0,f.v)(),[g,_]=(0,n.useState)(""),[k,w]=(0,n.useState)(null),[v,x]=(0,n.useState)(!1),N=(0,n.useCallback)(async()=>{try{_(await navigator.clipboard.readText()),w(null)}catch(e){}},[]),E=(0,n.useCallback)(e=>{var t,r,s,n,a;if("USAGE_LIMIT_EXCEEDED"!==e.code)return!1;let o=(null==(t=e.details)?void 0:t.usageType)==="max_video_duration_minutes";return m({limitType:o?p.C.MAX_VIDEO_DURATION_MINUTES:p.C.MONTHLY_STUDY_SESSIONS,currentUsage:null!=(n=null==(r=e.details)?void 0:r.currentUsage)?n:0,limit:null!=(a=null==(s=e.details)?void 0:s.limit)?a:0,featureName:o?"Video Duration":"Study Sessions",triggerLocation:"session_creation"}),!0},[m]),S=(0,n.useCallback)(async()=>{let e,s=g.trim();if(w(null),!s)return void w(r("link.errorEmpty"));try{e=new URL(s)}catch(e){w(r("link.errorInvalidUrl"));return}if((0,c.dS)(s))return void w(r("link.playlistUnsupported"));x(!0);try{var n,a,o,i;let{data:l}=await (0,d.createClient)().auth.getSession(),u=null==(n=l.session)?void 0:n.access_token;if(!u)return void b.push("/signin");let f={"Content-Type":"application/json",Authorization:"Bearer ".concat(u)};if((0,c.XK)(s)){let e=await fetch("/api/youtube/process",{method:"POST",headers:f,body:JSON.stringify({url:s})}),n=await e.json();if(!e.ok){if(E(n))return;throw Error(n.error||n.message||r("link.errorProcessVideo"))}let a=null==(i=n.data)?void 0:i.sessionId;if(!a)throw Error(r("link.errorNoNote"));let o=(0,c.Q9)(s);(0,y.Rs)({session_id:a,content_type:"youtube",source_type:"youtube"}),o&&(0,y.an)({video_id:o,video_platform:"youtube"}),null==t||t(),b.push("/study-sessions/".concat(a));return}let p=e.hostname.replace(/^www\./,""),h=await fetch("/api/study-sessions",{method:"POST",headers:f,body:JSON.stringify({title:"Article from ".concat(p),session_type:"mixed"})}),m=await h.json();if(!h.ok){if(E(m))return;throw Error(m.error||m.message||r("link.errorCreateNote"))}let g=null==(o=m.data)||null==(a=o.session)?void 0:a.id;if(!g)throw Error(r("link.errorCreateNote"));let _=await fetch("/api/sources/article",{method:"POST",headers:f,body:JSON.stringify({study_session_id:g,url:s})});if(!_.ok){let e=await _.json().catch(()=>({}));throw await fetch("/api/study-sessions/".concat(g),{method:"DELETE",headers:{Authorization:"Bearer ".concat(u)}}).catch(()=>void 0),Error(e.error||e.message||r("link.errorFetchArticle"))}(0,y.Rs)({session_id:g,content_type:"article",source_type:"article"}),null==t||t(),b.push("/study-sessions/".concat(g))}catch(e){w(e instanceof Error?e.message:r("link.errorGeneric"))}finally{x(!1)}},[g,b,E,t,r]);return(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{type:"url",value:g,onChange:e=>{_(e.target.value),w(null)},onKeyDown:e=>{"Enter"!==e.key||v||S()},placeholder:r("link.webPlaceholder"),disabled:v,className:"w-full rounded-xl border border-border bg-muted/40 px-4 py-3 pe-10 text-sm text-foreground placeholder:text-muted-foreground/60 transition-all duration-150 focus:border-primary focus:bg-background focus:outline-none focus:ring-2 focus:ring-primary/20","aria-label":r("link.urlA11y")}),(0,s.jsx)("button",{type:"button",onClick:N,disabled:v,className:"absolute end-3 top-1/2 -translate-y-1/2 cursor-pointer text-muted-foreground
1/50 transition-colors hover:text-muted-foreground","aria-label":r("link.pasteA11y"),children:(0,s.jsx)(i.A,{className:"size-4"})})]}),k&&(0,s.jsx)("p",{className:"text-sm font-medium text-destructive",children:k}),(0,s.jsx)(h.$,{onClick:()=>void S(),disabled:v||!g.trim(),className:"w-full cursor-pointer",children:v?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.A,{className:"size-4 animate-spin"}),r("link.creatingNote")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.A,{className:"size-4"}),r("link.createFromLink")]})}),(0,s.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:r("link.footer")})]})}}}]);

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.