PageSourceSearch

https://www.007icu.top/assets/useNotionImport-CfJPeRmb.js

js 007icu.top collected 2026-10-09 04:36:23 UTC 3,174 bytes, 4 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/es-D3_QMuVV.js","assets/rolldown-runtime-CMxvf4Kt.js","vendor/vendor-ui-runtime-CtdfFhWo.js","assets/app-const-BzFqCjOv.js","vendor/vendor-react-Bwss5s6Y.js","vendor/vendor-ai-runtime-DrDK77gy.js","vendor/vendor-data-runtime-nLFaCKB0.js"])))=>i.map(i=>d[i]);
2import{n as e,o as t}from"./rolldown-runtime-CMxvf4Kt.js";import{Ki as n,na as r,ta as i}from"../vendor/vendor-ai-runtime-DrDK77gy.js";import{Ao as a,Qi as o,Ri as s,jo as c}from"./app-const-BzFqCjOv.js";import{d as l,u}from"./store-DZ_eFvAj.js";import{i as d,n as f,r as p,t as m}from"./GuideVideo-DmeVY_mE.js";var h,g,_,v,y,b=e((()=>{s(),h=t(n()),g=t(c()),d(),f(),u(),_=t(a()),r(),v=(0,h.default)(`resource:notion-import`),y=({createDocument:e,currentFolderId:t,libraryId:n,refetchResources:r,t:a})=>{let s=(0,g.useRef)(null),c=(0,g.useCallback)(()=>{p({cancelText:a(`header.actions.notionGuide.cancel`),cover:(0,_.jsx)(m,{height:269,src:o.importFromNotionGuide,width:358}),desc:a(`header.actions.notionGuide.desc`),okText:a(`header.actions.notionGuide.ok`),onOk:()=>{s.current?.click()},title:a(`header.actions.notionGuide.title`)})},[a]);return{handleNotionImport:(0,g.useCallback)(async o=>{let s=o.target.files?.[0];if(s){try{let{message:o}=await i(async()=>{let{message:e}=await import(`./es-D3_QMuVV.js`).then(e=>(e.n(),e.t));return{message:e}},__vite__mapDeps([0,1,2,3,4,5,6])),c=`notion-import`;o.loading({content:a(`header.actions.notion.importing`),duration:0,key:c});let u=await l(s);v(`Extracted files (level 1):`,u.map(e=>({name:e.name,type:e.type})));let d=u.filter(e=>e.name.toLowerCase().endsWith(`.zip`));if(d.length>0){v(`Found nested ZIPs, extracting...`,d.map(e=>e.name));let e=[];for(let t of d)try{let n=await l(t);v(`Extracted from ${t.name}:`,n.map(e=>({name:e.name,type:e.type}))),e.push(...n)}catch(e){console.error(`Failed to extract nested ZIP ${t.name}:`,e)}u=e}v(`All extracted files:`,u.map(e=>({name:e.name,type:e.type})));let f=u.filter(e=>{let t=e.name.toLowerCase();return t.endsWith(`.md`)||t.endsWith(`.markdown`)});if(f.length===0){o.destroy(c),o.warning(a(`header.actions.notion.noMarkdownFiles`)+` (${a(`header.actions.notion.foundFiles`,{count:u.length})})`),v(`No markdown files found. All files:`,u.map(e=>e.name));return}let p=0,m=0;for(let r of f)try{let i=await r.text(),a=``,o=i.split(`
3`),s=o[0]?.trim()||``;s.startsWith(`#`)?(a=s.replace(/^#+\s*/,``).trim(),i=o.slice(1).join(`
4`).trim()):a=(r.name.split(`/`).pop()||`Untitled`).replace(/\.md$/,``),await e({content:i,knowledgeBaseId:n??void 0,parentId:t??void 0,title:a}),p++}catch(e){console.error(`Failed to import ${r.name}:`,e),m++}o.destroy(c),m===0?o.success(a(`header.actions.notion.success`,{count:p})):o.warning(a(`header.actions.notion.partial`,{failed:m,success:p})),await r?.()}catch(e){console.error(`Failed to import Notion export:`,e);let{message:t}=await i(async()=>{let{message:e}=await import(`./es-D3_QMuVV.js`).then(e=>(e.n(),e.t));return{message:e}},__vite__mapDeps([0,1,2,3,4,5,6]));t.error(a(`header.actions.notion.error`))}o.target.value=``}},[e,t,n,r,a]),handleOpenNotionGuide:c,notionInputRef:s}}}));export{y as n,b as t};

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.