;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="8d65f0b0-f0a6-c8bf-c935-8e4d1d313a36")}catch(e){}}(); (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,715084,e=>{"use strict";var t=e.i(472361);e.s(["usePrevious",0,function(e){let i=t.useRef({value:e,previous:e});return t.useMemo(()=>(i.current.value!==e&&(i.current.previous=i.current.value,i.current.value=e),i.current.previous),[e])}])},103512,e=>{"use strict";e.s(["clamp",0,function(e,[t,i]){return Math.min(i,Math.max(t,e))}])},564438,e=>{"use strict";let t=["KB","MB","GB","TB"];e.s(["formatBytes",0,function(e){let i=e,r="B";for(let e of t){if(1024>Math.abs(i))break;i/=1024,r=e}return`${parseFloat(i.toFixed(2))} ${r}`}])},375055,e=>{"use strict";var t=e.i(564438);let i={maxFileSize:0x6400000,maxFilesPerUpload:10,maxPdfPages:9,allowAllFileTypes:!1,supportedMimeTypes:[{mimeType:"image/jpeg",extensions:[".jpg",".jpeg"],category:"image"},{mimeType:"image/png",extensions:[".png"],category:"image"},{mimeType:"image/webp",extensions:[".webp"],category:"image"},{mimeType:"image/gif",extensions:[".gif"],category:"image"},{mimeType:"image/heic",extensions:[".heic"],category:"image"},{mimeType:"image/heif",extensions:[".heif"],category:"image"},{mimeType:"application/pdf",extensions:[".pdf"],category:"document"},{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:[".docx"],category:"document"},{mimeType:"application/msword",extensions:[".doc"],category:"document"},{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extensions:[".xlsx"],category:"document"},{mimeType:"application/vnd.ms-excel",extensions:[".xls"],category:"document"},{mimeType:"video/mp4",extensions:[".mp4"],category:"video"},{mimeType:"video/quicktime",extensions:[".mov"],category:"video"},{mimeType:"text/plain",extensions:[".txt",".text",".rst",".log",".py",".pyi",".rb",".php",".lua",".rs",".go",".c",".h",".cpp",".cc",".hpp",".cs",".java",".kt",".scala",".swift",".m",".mm",".hs",".ml",".clj",".ex",".exs",".erl",".sh",".bash",".zsh",".ps1",".bat",".dockerfile",".tf",".buck",".bzl",".sql",".proto",".thrift",".diff",".patch",".ini",".cfg",".conf",".env",".properties"],category:"text"},{mimeType:"text/markdown",extensions:[".md",".markdown",".mdx"],category:"text"},{mimeType:"text/html",extensions:[".html",".htm"],category:"text"},{mimeType:"text/xml",extensions:[".xml"],category:"text"},{mimeType:"text/css",extensions:[".css",".scss"],category:"text"},{mimeType:"text/javascript",extensions:[".js",".mjs",".jsx"],category:"text"},{mimeType:"application/javascript",extensions:[".js",".mjs"],category:"text"},{mimeType:"text/typescript",extensions:[".ts",".tsx"],category:"text"},{mimeType:"application/typescript",extensions:[".ts",".tsx"],category:"text"},{mimeType:"application/json",extensions:[".json"],category:"text"},{mimeType:"text/yaml",extensions:[".yaml",".yml"],category:"text"},{mimeType:"application/x-yaml",extensions:[".yaml",".yml"],category:"text"},{mimeType:"application/toml",extensions:[".toml"],category:"text"},{mimeType:"text/csv",extensions:[".csv"],category:"text"},{mimeType:"text/tab-separated-values",extensions:[".tsv"],category:"text"},{mimeType:"application/graphql",extensions:[".graphql",".gql"],category:"text"},{mimeType:"application/x-tex",extensions:[".tex"],category:"text"},{mimeType:"application/x-latex",extensions:[".latex"],category:"text"},{mimeType:"text/x-r-source",extensions:[".r",".R"],category:"text"},{mimeType:"text/x-vue",extensions:[".vue"],category:"text"},{mimeType:"text/x-svelte",extensions:[".svelte"],category:"text"}]},r={...i,allowAllFileTypes:!0},n={...i,supportedMimeTypes:i.supportedMimeTypes.filter(e=>"image"===e.category)},a={...i,supportedMimeTypes:[...i.supportedMimeTypes,{mimeType:"video/webm",extensions:[".webm"],category:"video"},{mimeType:"video/3gpp",extensions:[".3gp",".3gpp"],category:"video"}]};function o(e,t=i){if(e.type){if(e.type.startsWith("image/"))return"image";if(e.type.startsWith("video/"))return"video"}let r=s(e.name,t);if(r){if(r.startsWith("image/"))return"image";if(r.startsWith("video/"))return"video"}return null}function s(e,t=i){let r=e.toLowerCase().match(/\.[^.]+$/)?.[0];if(!r)return null;for(let e of t.supportedMimeTypes)if(e.extensions.includes(r))return e.mimeType;return null}e.s(["ALL_FILES_UPLOAD_CONFIG",0,r,"BUG_REPORT_UPLOAD_CONFIG",0,a,"DEFAULT_UPLOAD_CONFIG",0,i,"IMAGE_ONLY_UPLOAD_CONFIG",0,n,"ensureFileType",0,function(e,t=i){if(e.type)return e;let r=s(e.name,t);return r?new File([e],e.name,{type:r,lastModified:e.lastModified}):e},"getAcceptAttribute",0,function(e,t=i){if(t.allowAllFileTypes)return"*/*";let r=e?t.supportedMimeTypes.filter(t=>e.includes(t.category)):t.supportedMimeTypes;return[...r.map(e=>e.mimeType),...r.flatMap(e=>e.extensions)].join(",")},"getFileCategory",0,function(e,t=i){let r=t.supportedMimeTypes.find(t=>t.mimeType===e);return r?.category??null},"getSupportedFileTypesDisplay",0,function(e,t=i){let r=e?t.supportedMimeTypes.filter(t=>e.includes(t.category)):t.supportedMimeTypes,n=new Set;return r.forEach(e=>{"image"===e.category?"image/jpeg"===e.mimeType?n.add("JPEG"):"image/png"===e.mimeType?n.add("PNG"):"image/gif"===e.mimeType?n.add("GIF"):"image/webp"===e.mimeType?n.add("WebP"):("image/heic"===e.mimeType||"image/heif"===e.mimeType)&&n.add("HEIC"):"document"===e.category?"application/pdf"===e.mimeType?n.add("PDF"):e.mimeType.includes("wordprocessingml")||"application/msword"===e.mimeType?n.add("Word"):(e.mimeType.includes("spreadsheetml")||"application/vnd.ms-excel"===e.mimeType)&&n.add("Excel"):"video"===e.category?"video/mp4"===e.mimeType?n.add("MP4"):"video/quicktime"===e.mimeType?n.add("MOV"):"video/webm"===e.mimeType?n.add("WebM"):"video/3gpp"===e.mimeType&&n.add("3GP"):"text"===e.category&&n.add("Code & Text files")}),Array.from(n).join(", ")},"inferMediaCategory",0,o,"isImageFile",0,function(e,t=i){return"image"===o(e,t)},"isVideoFile",0,function(e,t=i){return"video"===o(e,t)},"validateFile",0,function(e,r,n,a=i){if(e<=0)throw Error("File is empty");if(e>a.maxFileSize)throw Error(`File too large: ${(0,t.formatBytes)(e)}. Maximum: ${(0,t.formatBytes)(a.maxFileSize)}`);if(!a.allowAllFileTypes&&!function(e,t,r=i){return!!(r.allowAllFileTypes||function(e,t=i){return!!t.allowAllFileTypes||t.supportedMimeTypes.some(t=>t.mimeType===e)}(e,r)||t&&s(t,r))||!1}(r,n,a)){let e=a.supportedMimeTypes.map(e=>e.mimeType).join(", ");throw Error(`Unsupported file type: ${r}. Supported types: ${e}`)}}])},40425,e=>{"use strict";let t=new WeakMap;function i(e,i){t.set(e,i)}function r(e){return t.get(e)}e.s(["copyFileUploadSource",0,function(e,t){let n=r(e);null!=n&&i(t,n)},"getFileUploadSource",0,r,"markFileUploadSource",0,i])},66413,e=>{"use strict";class t extends Error{status;network;constructor(e,{status:t=null,network:i=!1,cause:r}={}){super(e,null!=r?{cause:r}:void 0),this.name="UploadError",this.status=t,this.network=i}}function i(e){return e instanceof t&&(!!e.network||null!=e.status&&(408===e.status||429===e.status||e.status>=500))}function r(e){let t=Math.min(4e3,400*2**(e-1));return Math.round(t/2+t/2*Math.random())}function n(e){return new Promise(t=>setTimeout(t,e))}async function a(e,{maxAttempts:t=3,isRetryable:o=i,delayMs:s=r,sleep:l=n,onRetry:p}={}){let u;for(let i=1;i<=t;i++)try{return await e()}catch(e){if(u=e,i>=t||!o(e))throw e;p?.(i,e),await l(s(i))}throw u}e.s(["UploadError",0,t,"isRetryableUploadError",0,i,"retryUpload",0,a])},196769,e=>{"use strict";var t=e.i(178414),i=e.i(277358),r=e.i(835917),n=e.i(27292),a=e.i(38103),o=e.i(840387),s=e.i(375055),l=e.i(40425),p=e.i(66413);let u=(0,o.createClientLogger)("directUploadClient"),d="file_source_type";async function m(e){try{if("u"{let s=`https://rupload.meta.ai/gen_ai_document_gen_ai_tenant/${x}`,l=Date.now();try{let y,w=await e.arrayBuffer(),v=encodeURIComponent(e.name);if(y=t.default.env.NEXT_PUBLIC_UPLOAD_DEDUPE_DISABLED,"true"!==y&&"1"!==y&&!g){let t=await f(s,w,e,o,v,m);if(t.mediaId){let e=Date.now()-l;return a.setAttribute("file.uploadDurationMs",e),a.setAttribute("file.mediaId",t.mediaId),a.setAttribute("file.deduplicated",!0),t.mediaId}if(t.postAttempted){let e=(0,r.v4)();s=`https://rupload.meta.ai/gen_ai_document_gen_ai_tenant/${e}`,a.setAttribute("file.dedupFallbackFreshSession",!0)}}let b={"Content-Length":e.size.toString(),[i.EctoOutboundHeaders.ENTITY_LENGTH]:e.size.toString(),[i.EctoOutboundHeaders.ENTITY_NAME]:v,[i.EctoOutboundHeaders.ENTITY_TYPE]:e.type,Offset:"0",Authorization:`OAuth ${o}`,desired_upload_handler:"genai_document",is_abra_user:"true",ecto_auth_token:"true"};null!=m&&(b[d]=m),g&&(b.ai_detector_upload="true");let E=await fetch(s,{method:"POST",headers:b,body:w}),S=Date.now()-l;if(!E.ok){let t,i=await E.text();try{let e=JSON.parse(i),r=e.detail||e.title||e.debug_info?.message||"Upload failed";t=new p.UploadError(`File upload failed: ${r}`,{status:E.status})}catch{t=new p.UploadError(`File upload failed: ${E.status} ${E.statusText}`,{status:E.status})}throw h&&(u.error({status:E.status,statusText:E.statusText,duration:S,errorText:i},"Direct upload failed"),n.captureException(t,{tags:{"file.category":T,"file.errorType":"http"},extra:{fileName:e.name,fileSize:e.size,mimeType:e.type,duration:S,uploadUuid:x,httpStatus:E.status}})),t}let _=await E.json(),P=c(_);if(!P){let t=new p.UploadError("Upload response missing media ID");throw h&&(u.error({response:_},"No media ID found in response"),n.captureException(t,{tags:{"file.category":T,"file.errorType":"missing_id"},extra:{fileName:e.name,fileSize:e.size,mimeType:e.type,duration:S,uploadUuid:x,response:_}})),t}return a.setAttribute("file.uploadDurationMs",S),a.setAttribute("file.mediaId",P),S>1e4&&n.captureMessage("Slow file upload detected",{level:"warning",tags:{"file.metric":"slow_upload","file.category":T},extra:{duration:S,fileName:e.name,fileSize:e.size,mimeType:e.type,uploadUuid:x,mediaId:P}}),P}catch(i){let t=Date.now()-l;if(i instanceof TypeError&&"Failed to fetch"===i.message)throw h&&(u.error({duration:t,fileName:e.name,errorType:"CORS or Network"},"Direct upload failed - likely CORS issue (browser blocked request)"),n.captureException(i,{tags:{"file.category":T,"file.errorType":"network"},extra:{fileName:e.name,fileSize:e.size,mimeType:e.type,duration:t,uploadUuid:x}})),new p.UploadError("Direct upload blocked by browser (CORS). This means rupload does not allow browser uploads. Using server proxy fallback.",{network:!0,cause:i});throw h&&u.error({duration:t,error:i,fileName:e.name},"Direct upload error"),i}})}e.s(["uploadFileDirectToRupload",0,y])},740406,e=>{"use strict";let t="version",i=new Set(["www.meta.ai","meta.ai","artifacts.meta.ai"]);e.s(["ARTIFACT_VERSION_QUERY_PARAM",0,t,"buildArtifactShareUrl",0,function(e,i){let r=`/share/a/${e}`;return null==i?r:`${r}?${t}=${i}`},"isArtifactContentHostname",0,function(e,t){return t.startsWith(".")?e.endsWith(t):e===t||e.endsWith(`.${t}`)},"isArtifactShareHref",0,function(e){if(e.startsWith("/share/a/"))return!0;try{let t=new URL(e);if("https:"!==t.protocol||!t.pathname.startsWith("/share/a/"))return!1;return i.has(t.hostname)||t.hostname.endsWith(".ecto1.ai")}catch{return!1}},"isSlidesAssetType",0,function(e){return e?.toUpperCase()==="SLIDES"},"isStatefulArtifactSandboxUrl",0,function(e){try{let t=new URL(e),i=t.searchParams.get("ext"),r=t.searchParams.get("hash");return"https:"===t.protocol&&""===t.username&&""===t.password&&(""===t.port||"443"===t.port)&&t.hostname.endsWith(".fbsbx.com")&&"1"===t.searchParams.get("isolated_origin")&&"1"===t.searchParams.get("stateful_artifact")&&null!=i&&/^\d+$/.test(i)&&null!=r&&""!==r}catch{return!1}}])},770427,76250,e=>{"use strict";e.i(178414);var t=e.i(740406);let i={type:"html",handlerPath:"/html",supportsSourceView:!0,downloadOptions:[{name:"html",type:"download"}],extensions:[".html",".htm"],autoOpenInSidePanel:!1,allowParentLinkNavigation:!0,supportsEmbeddedPreview:!0,supportsTextEdit:!1},r={type:"pdf",handlerPath:"/pdf",supportsSourceView:!1,downloadOptions:[{name:"pdf",type:"download"}],extensions:[".pdf"],autoOpenInSidePanel:!1,allowParentLinkNavigation:!1,supportsEmbeddedPreview:!0,supportsTextEdit:!1},n={type:"markdown",handlerPath:"/markdown",supportsSourceView:!1,downloadOptions:[{name:"markdown",type:"download"},{name:"pdf",type:"pdf"}],extensions:[".md",".markdown"],autoOpenInSidePanel:!0,sidePanelInitialWidth:500,allowParentLinkNavigation:!0,supportsEmbeddedPreview:!0,supportsTextEdit:!0},a={type:"slide_deck",handlerPath:"/slide-deck",supportsSourceView:!1,downloadOptions:[{name:"pdf",type:"pdf"},{name:"pptx",type:"pptx"},{name:"google_slides",type:"google_slides"}],extensions:[],autoOpenInSidePanel:!1,allowParentLinkNavigation:!1,supportsEmbeddedPreview:!0,supportsTextEdit:!1},o={type:"spreadsheet",handlerPath:"/spreadsheet",supportsSourceView:!1,downloadOptions:[{name:"spreadsheet",type:"download"}],extensions:[".xlsx",".csv",".tsv"],autoOpenInSidePanel:!1,allowParentLinkNavigation:!1,supportsEmbeddedPreview:!0,supportsTextEdit:!0},s={type:"document",handlerPath:"/document",supportsSourceView:!1,downloadOptions:[{name:"document",type:"download"}],autoOpenInSidePanel:!1,allowParentLinkNavigation:!1,supportsEmbeddedPreview:!0,extensions:[".txt",".docx",".log",".json",".xml",".yaml",".yml",".toml",".ini",".cfg",".conf",".env",".sh",".bash",".zsh",".py",".js",".ts",".jsx",".tsx",".css",".scss",".sql",".graphql",".proto",".c",".cpp",".h",".hpp",".java",".kt",".swift",".go",".rs",".rb"],supportsTextEdit:!0},l={type:"audio",handlerPath:"/audio",supportsSourceView:!1,downloadOptions:[{name:"audio",type:"download"}],extensions:[".mp3",".wav",".m4a",".ogg",".flac",".aac"],autoOpenInSidePanel:!1,allowParentLinkNavigation:!1,supportsEmbeddedPreview:!1,supportsTextEdit:!1},p={type:"svg",handlerPath:"/svg",supportsSourceView:!0,downloadOptions:[{name:"svg",type:"download"}],extensions:[".svg"],autoOpenInSidePanel:!1,allowParentLinkNavigation:!1,supportsEmbeddedPreview:!0,supportsTextEdit:!1},u=[i,r,n,a,o,s,l,p];function d(e){let t=e.toLowerCase();for(let e of u)if(e.extensions.some(e=>t.endsWith(e)))return e;return null}function m(e){let t=e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`;for(let e of u)if(e.extensions.some(e=>e===t))return e;return null}e.s(["SLIDE_DECK_CAPABILITIES",0,a,"getArtifactPreviewCapabilities",0,function(e,t){let u;if(null==e)u=(t?m(t):null)??i;else switch(e.toLowerCase()){case"html":u=i;break;case"svg":u=p;break;case"pdf":u=r;break;case"markdown":u=n;break;case"slide_deck":case"slides":u=a;break;case"document":u=s;break;case"spreadsheet":u=o;break;case"audio":u=l;break;default:{let e=t?m(t):null;if(null==e)return null;u=e}}return void 0!==t?!function(e,t){if("document"!==t.type&&"spreadsheet"!==t.type||0===t.extensions.length||null==e)return!0;let i=e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`;return t.extensions.some(e=>e===i)}(t,u)?t?m(t):null:u:u},"getArtifactPreviewCapabilitiesByExtension",0,d,"getDefaultDownloadExtension",0,function(e){return e.extensions[0]?.replace(/^\./,"")}],76250);let c=[".fbcdn.net",".meta.ai"],f=".fbsbx.com",y=[".mp4",".webm",".mov",".m4v"],h="📎",g="(File)";function x(e){return c.some(t=>e.endsWith(t))}let T=/^(\d+)(\.od)?$/;function w(e,i){return(0,t.isArtifactShareHref)(e)?e:function(e,i){try{let r=new URL(e);if("https:"!==r.protocol||""!==r.username||""!==r.password||""!==r.port&&"443"!==r.port||!r.hostname.endsWith(f))return null;let n=new URL(r.origin);if(n.pathname=r.pathname,n.search=r.search,n.hash=r.hash,i&&!(0,t.isStatefulArtifactSandboxUrl)(n.toString()))return((function(e,t){let i=T.exec(t);if(!i)return null;let r=i[1],n=`${r}.od.fbsbx.com`;if(!e.hostname.endsWith(n)){let t=e.hostname.length-f.length,i=t>0?e.hostname.slice(0,t):"";e.hostname=i?`${i}.${n}`:n}return e})(n,i)??n).toString();return n.toString()}catch{return null}}(e,i)??function(e){try{let t=new URL(e),i=t.pathname.toLowerCase();if("https:"!==t.protocol||""!==t.username||""!==t.password||""!==t.port&&"443"!==t.port||!x(t.hostname)||!(i.endsWith(".html")||i.endsWith(".htm")))return null;let r=new URL(t.origin);return r.pathname=t.pathname,r.search=t.search,r.toString()}catch{return null}}(e)??function(e){let i=".a.metaaiusercontent.com";try{let r=new URL(e);if("https:"!==r.protocol||""!==r.username||""!==r.password||!(0,t.isArtifactContentHostname)(r.hostname,i)||r.hostname===i)return null;let n=new URL(r.origin);return n.pathname=r.pathname,n.search=r.search,n.toString()}catch{return null}}(e)??null}function v(e,t){if(!e||null==w(e))return null;let i=t.trim();for(;i.startsWith(h);)i=i.slice(h.length).trimStart();return i.endsWith(g)&&(i=i.slice(0,-g.length).trimEnd()),d(i)}function b(e){if(!e)return!1;try{let t=new URL(e);if("https:"!==t.protocol||!x(t.hostname))return!1;let i=t.pathname.toLowerCase().split("?")[0]??"";return y.some(e=>i.endsWith(e))}catch{return!1}}e.s(["ATTACHMENT_EMOJI",0,h,"VIDEO_EXTENSIONS",0,y,"extractArtifactDisplayTitle",0,function(e){let t=e.trim();for(;t.startsWith(h);)t=t.slice(h.length).trimStart();return t.endsWith(g)&&(t=t.slice(0,-g.length).trimEnd()),(t=t.trim()).length>0?t:null},"extractArtifactShareUuid",0,function(e){if(!(0,t.isArtifactShareHref)(e))return null;let i=e.startsWith("/share/a/")?e.split("?")[0]?.split("#")[0]:new URL(e).pathname;if(null==i)return null;let r=i.slice(9).split("/")[0];return null!=r&&""!==r?r:null},"extractIframableArtifactUrl",0,w,"getArtifactLinkCapabilities",0,v,"isIframableArtifactLink",0,function(e,t){return null!=v(e,t)},"isPreviewableVideoLink",0,b,"normalizeInlineHtmlArtifactMarkdown",0,function(e){let t="",i=0,r=0;for(let n=0;n<=e.length;n++){if(n{"use strict";var t=e.i(733783),i=e.i(908464);function r(e){let r,n,a,o,s,l=(0,i.c)(10);l[0]!==e?({size:n,...r}=e,l[0]=e,l[1]=r,l[2]=n):(r=l[1],n=l[2]);let p=void 0===n?32:n;return l[3]!==r.title?(a=null!=r.title&&(0,t.jsx)("title",{children:r.title}),l[3]=r.title,l[4]=a):a=l[4],l[5]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("path",{d:"M8 14.125a1.875 1.875 0 1 1 0 3.75 1.875 1.875 0 0 1 0-3.75zm8 0a1.875 1.875 0 1 1 0 3.75 1.875 1.875 0 0 1 0-3.75zm8 0a1.875 1.875 0 1 1 0 3.75 1.875 1.875 0 0 1 0-3.75z",fill:"currentColor"}),l[5]=o):o=l[5],l[6]!==r||l[7]!==p||l[8]!==a?(s=(0,t.jsxs)("svg",{viewBox:"0 0 32 32",fill:"none",width:p,height:p,...r,children:[a,o]}),l[6]=r,l[7]=p,l[8]=a,l[9]=s):s=l[9],s}r._isSVG=!0,e.s(["default",0,r])}]); //# debugId=8d65f0b0-f0a6-c8bf-c935-8e4d1d313a36