PageSourceSearch

https://www.lighthouseacademy.ai/_next/static/chunks/477.0faebf41f044af9e.js

js lighthouseacademy.ai collected 2026-10-04 23:38:34 UTC 19,843 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[477,4182],{34182:function(e,t,n){n.r(t);var r=n(3827),i=n(64090),o=n(81886);let a=(0,i.forwardRef)(function(e,t){let{initialContent:n="",onChange:o,placeholder:a,className:l,minHeight:s=300}=e,[c,d]=(0,i.useState)(n);return(0,i.useImperativeHandle)(t,()=>({getHTML:async()=>c,getText:async()=>c.replace(/<[^>]*>/g,"")})),(0,r.jsxs)("div",{className:"overflow-hidden rounded-lg border border-[#2a2a2a] bg-[#1a1a1a] ".concat(l||""),children:[(0,r.jsx)("div",{className:"bg-[#2a2a2a] px-3 py-2 text-xs text-[#FFFFB8]/60",children:"Simple editor mode (HTML supported)"}),(0,r.jsx)("textarea",{value:c,onChange:e=>{let t=e.target.value;d(t),null==o||o(t)},placeholder:a,className:"w-full resize-none bg-[#1a1a1a] p-4 text-[#FFFFB8] focus:outline-none",style:{minHeight:s-40}})]})});function l(e){let{onClick:t,active:n,disabled:i,title:o,children:a}=e;return(0,r.jsx)("button",{type:"button",onClick:t,disabled:i,title:o,className:"flex h-8 w-8 items-center justify-center rounded transition-colors ".concat(n?"bg-[#FFAD4A] text-[#1a1a1a]":"text-[#FFFFB8]/80 hover:bg-[#2a2a2a] hover:text-[#FFAD4A]"," ").concat(i?"cursor-not-allowed opacity-30":""),children:a})}function s(){return(0,r.jsx)("div",{className:"mx-1 h-5 w-px bg-[#2a2a2a]"})}let c=(0,i.forwardRef)(function(e,t){let{initialContent:c="",onChange:u,placeholder:p="Start typing...",className:h,minHeight:g=300,uploadFolder:f="/general/",imageAltPrefix:m}=e,[x,v]=(0,i.useState)(null),[b,j]=(0,i.useState)(!1),[w,M]=(0,i.useState)(!1),[k,C]=(0,i.useState)(""),[F,y]=(0,i.useState)(!1),[H,N]=(0,i.useState)(!1),[,A]=(0,i.useState)(0),I=i.useRef(u),P=i.useRef(null),z=i.useRef(null),L=i.useRef(async()=>{});I.current=u;let E=(0,i.useCallback)(async e=>{let t=P.current;if(!t||!e.type.startsWith("image/"))return;if(e.size>20971520){window.alert("Image must be 20MB or smaller.");return}N(!0);let n=e.name.replace(/\.[^/.]+$/,""),r=m?"".concat(m," ").concat(n):n,i=URL.createObjectURL(e);try{t.chain().focus().setImage({src:i,alt:r}).run();let n=await (0,o.l)(e,{folder:f,tags:"upload"});if(!n.success||!n.url)throw Error(n.error||"Upload failed");!function(e,t,n){let r=e.getHTML();if(r.includes(t)){let i=r.split(t).join(n);e.commands.setContent(i,!0)}}(t,i,n.url)}catch(e){console.error("Failed to upload image:",e),function(e,t){let n=e.getHTML();if(n.includes(t)){let r=n.replace(RegExp('<img[^>]*src="'.concat(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),'"[^>]*>'),"g"),"");e.commands.setContent(r,!0)}}(t,i),window.alert(e instanceof Error?e.message:"Failed to upload image")}finally{URL.revokeObjectURL(i),N(!1)}},[]);L.current=E;let T=(0,i.useCallback)(e=>{var t;let n=null===(t=e.target.files)||void 0===t?void 0:t[0];n&&E(n),e.target.value=""},[E]);(0,i.useEffect)(()=>{j(!0);let e=null;return(async()=>{try{let[t,r,i,o,a]=await Promise.all([Promise.all([n.e(7902),n.e(3572),n.e(7973),n.e(9776),n.e(7842),n.e(1948)]).then(n.bind(n,81948)),Promise.all([n.e(7902),n.e(3572),n.e(7973),n.e(9776)]).then(n.bind(n,59776)),Promise.all([n.e(7902),n.e(3572),n.e(7973),n.e(5453)]).then(n.bind(n,15453)),Promise.all([n.e(7902),n.e(3572),n.e(7973),n.e(7842),n.e(2759)]).then(n.bind(n,92759)),Promise.all([n.e(7902),n.e(3572),n.e(7973),n.e(4826)]).then(n.bind(n,34826))]),l=t.default||t.StarterKit,s=r.default||r.Link,d=i.default||i.Underline,u=o.default||o.Placeholder,h=a.default||a.Image,{Editor:g}=await Promise.all([n.e(7902),n.e(3572),n.e(7973)]).then(n.bind(n,40318));e=new g({extensions:[l.configure({heading:{levels:[1,2,3]}}),s.configure({openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),d,h.configure({inline:!0,allowBase64:!1,HTMLAttributes:{class:"email-inline-image"}}),u.configure({placeholder:p})],content:c||"<p></p>",editorProps:{handlePaste:(e,t)=>
1{var n;let r=null===(n=t.clipboardData)||void 0===n?void 0:n.items;if(!r)return!1;for(let e=0;e<r.length;e++){let n=r[e];if(n.type.startsWith("image/")){t.preventDefault();let e=n.getAsFile();return e&&L.current(e),!0}}return!1},handleDrop:(e,t,n,r)=>{var i;if(r)return!1;let o=null===(i=t.dataTransfer)||void 0===i?void 0:i.files;if(!(null==o?void 0:o.length))return!1;let a=Array.from(o).find(e=>e.type.startsWith("image/"));return!!a&&(t.preventDefault(),L.current(a),!0)}},onUpdate:e=>{var t;let{editor:n}=e;null===(t=I.current)||void 0===t||t.call(I,n.getHTML()),A(e=>e+1)},onSelectionUpdate:()=>{A(e=>e+1)}}),P.current=e,v(e)}catch(e){console.error("Failed to load Tiptap editor:",e),M(!0)}})(),()=>{P.current=null,null==e||e.destroy()}},[]),(0,i.useImperativeHandle)(t,()=>({getHTML:async()=>(null==x?void 0:x.getHTML())||"",getText:async()=>(null==x?void 0:x.getText())||""}));let B=(0,i.useCallback)(()=>{x&&k&&(""===k?x.chain().focus().extendMarkRange("link").unsetLink().run():x.chain().focus().extendMarkRange("link").setLink({href:k}).run(),C(""),y(!1))},[x,k]),S=(0,i.useCallback)(()=>{x&&(x.chain().focus().extendMarkRange("link").unsetLink().run(),y(!1))},[x]);return b?w?(0,r.jsx)(a,{ref:t,initialContent:c,onChange:u,placeholder:p,className:h,minHeight:g}):x?(0,r.jsxs)("div",{className:"rounded-lg border border-[#2a2a2a] bg-[#1a1a1a] ".concat(h||""),children:[(0,r.jsxs)("div",{className:"sticky top-[83px] z-30 flex flex-nowrap items-center gap-0.5 overflow-x-auto rounded-t-lg border-b border-[#2a2a2a] bg-[#111] px-2 py-1.5",children:[(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleBold().run(),active:x.isActive("bold"),title:"Bold (Cmd+B)",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"})})}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleItalic().run(),active:x.isActive("italic"),title:"Italic (Cmd+I)",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"})})}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleUnderline().run(),active:x.isActive("underline"),title:"Underline (Cmd+U)",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"})})}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleStrike().run(),active:x.isActive("strike"),title:"Strikethrough",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"})})}),(0,r.jsx)(s,{}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleHeading({level:1}).run(),active:x.isActive("heading",{level:1}),title:"Heading 1",children:(0,r.jsx)("span",{className:"text-xs font-bold",children:"H1"})}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleHeading({level:2}).run(),active:x.isActive("heading",{level:2}),title:"Heading 2",children:(0,r.jsx)("span",{className:"text-xs font-bold",children:"H2"})}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleHeading({level:3}).run(),active:x.isActive("heading",{level:3}),title:"Heading 3",children:(0,r.jsx)("span",{className:"text-xs font-bold",children:"H3"})}),(0,r.jsx)(s,{}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleBulletList().run(),active:x.isActive("bulletList"),title:"Bullet list",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"})})}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleOrderedList().run(),active:x.isActive("orderedList"),title:"Numbered list",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,r.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"})})}),(0,r.jsx)(s,{}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleBlockquote().run(),active:x.isActive("blockquote"),title:"Blockquote",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})})}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().toggleCode().run(),active:x.isActive("code"),title:"Inline code",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"})})}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().setHorizontalRule().run(),title:"Horizontal rule",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M4 11h16v2H4z"})})}),(0,r.jsx)(s,{}),(0,r.jsx)(l,{onClick:()=>{x.isActive("link")?S():(C(x.getAttributes("link").href||""),y(!0))},active:x.isActive("link"),title:"Link",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"})})}),(0,r.jsx)(l,{onClick:()=>{var e;return null===(e=z.current)||void 0===e?void 0:e.click()},disabled:H,title:H?"Uploading image...":"Insert image",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"})})}),(0,r.jsx)(s,{}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,r.jsx)(l,{onClick:()=>x.chain().focus().undo().run(),disabled:!x.can().undo(),title:"Undo (Cmd+Z)",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"})})}),(0,r.jsx)(l,{onClick:()=>x.chain().focus().redo().run(),disabled:!x.can().redo(),title:"Redo (Cmd+Shift+Z)",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"})})})]})]}),(0,r.jsx)("input",{ref:z,type:"file",accept:"image/jpeg,image/jpg,image/png,image/gif,image/webp",className:"hidden",onChange:T}),H&&(0,r.jsx)("div",{className:"border-b border-[#2a2a2a] bg-[#1a1a1a] px-3 py-1.5 text-xs text-[#FFFFB8]/60",children:"Uploading image..."}),F&&(0,r.jsxs)("div",{className:"flex items-center gap-2 border-b border-[#2a2a2a] bg-[#1a1a1a] px-3 py-2",children:[(0,r.jsx)("input",{type:"url",value:k,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),B()),"Escape"===e.key&&(y(!1),C(""))},placeholder:"Enter URL...",className:"flex-1 rounded border border-[#2a2a2a] bg-[#0a0a0a] px-2 py-1 text-sm text-[#FFFFB8] placeholder-[#FFFFB8]/30 focus:border-[#FFAD4A] focus:outline-none",autoFocus:!0}),(0,r.jsx)("button",{onClick:B,className:"rounded bg-[#FFAD4A] px-3 py-1 text-xs font-medium text-[#1a1a1a] hover:bg-[#FFFFB8]",children:"Apply"}),(0,r.jsx)("button",{onClick:()=>{y(!1),C("")},className:"rounded px-2 py-1 text-xs text-[#FFFFB8]/60 hover:text-[#FFFFB8]",children:"Cancel"})]}),(0,r.jsx)(d,{editor:x,minHeight:g-50})]}):(0,r.jsx)("div",{className:"flex items-center justify-center overflow-hidden rounded-lg bg-[#1a1a1a] ".concat(h||""),style:{minHeight:g},children:(0,r.jsx)("div",{className:"text-[#FFFFB8]/50",children:"Loading editor..."})}):(0,r.jsx)("div",{className:"flex items-center justify-center overflow-hidden rounded-lg bg-[#1a1a1a] ".concat(h||""),style:{minHeight:g},children:(0,r.jsx)("div",{className:"text-[#FFFFB8]/50",children:"Loading editor..."})})});function d(e){let{editor:t,minHeight:n}=e,o=i.useRef(null);return(0,i.useEffect)(()=>
1{if(!t||!o.current)return;let e=t.view.dom;return o.current.appendChild(e),()=>{if(e.parentNode===o.current){var t;null===(t=o.current)||void 0===t||t.removeChild(e)}}},[t]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{children:u}),(0,r.jsx)("div",{ref:o,className:"tiptap-editor-content",style:{minHeight:n}})]})}let u='\n    .tiptap-editor-content .ProseMirror {\n        padding: 24px;\n        min-height: inherit;\n        outline: none;\n        color: #ffffb8;\n        font-family: \'Inter\', -apple-system, BlinkMacSystemFont, \'Segoe UI\', system-ui, sans-serif;\n        font-size: 14px;\n        line-height: 1.7;\n    }\n    .tiptap-editor-content .ProseMirror p {\n        margin-bottom: 12px;\n    }\n    .tiptap-editor-content .ProseMirror h1,\n    .tiptap-editor-content .ProseMirror h2,\n    .tiptap-editor-content .ProseMirror h3 {\n        color: #ffffb8;\n        font-weight: 600;\n        margin-bottom: 12px;\n        margin-top: 20px;\n    }\n    .tiptap-editor-content .ProseMirror h1 { font-size: 1.5em; }\n    .tiptap-editor-content .ProseMirror h2 { font-size: 1.25em; }\n    .tiptap-editor-content .ProseMirror h3 { font-size: 1.1em; }\n    .tiptap-editor-content .ProseMirror a {\n        color: #FFAD4A;\n        text-decoration: underline;\n        cursor: pointer;\n    }\n    .tiptap-editor-content .ProseMirror strong {\n        color: #ffffb8;\n        font-weight: 600;\n    }\n    .tiptap-editor-content .ProseMirror em {\n        font-style: italic;\n    }\n    .tiptap-editor-content .ProseMirror u {\n        text-decoration: underline;\n    }\n    .tiptap-editor-content .ProseMirror s {\n        text-decoration: line-through;\n        opacity: 0.7;\n    }\n    .tiptap-editor-content .ProseMirror ul,\n    .tiptap-editor-content .ProseMirror ol {\n        padding-left: 24px;\n        margin-bottom: 12px;\n        list-style-position: outside;\n    }\n    .tiptap-editor-content .ProseMirror ul {\n        list-style-type: disc;\n    }\n    .tiptap-editor-content .ProseMirror ol {\n        list-style-type: decimal;\n    }\n    .tiptap-editor-content .ProseMirror ul ul {\n        list-style-type: circle;\n    }\n    .tiptap-editor-content .ProseMirror ul ul ul {\n        list-style-type: square;\n    }\n    .tiptap-editor-content .ProseMirror li {\n        display: list-item;\n        margin-bottom: 4px;\n    }\n    .tiptap-editor-content .ProseMirror li::marker {\n        color: #ffffb8;\n    }\n    .tiptap-editor-content .ProseMirror blockquote {\n        border-left: 3px solid #FFAD4A;\n        padding-left: 16px;\n        color: #ffffb8cc;\n        margin: 16px 0;\n    }\n    .tiptap-editor-content .ProseMirror code {\n        background-color: #2a2a2a;\n        color: #FFAD4A;\n        padding: 2px 6px;\n        border-radius: 4px;\n        font-family: \'SF Mono\', Monaco, monospace;\n        font-size: 13px;\n    }\n    .tiptap-editor-content .ProseMirror pre {\n        background-color: #0d0d0d;\n        border: 1px solid #2a2a2a;\n        border-radius: 6px;\n        padding: 16px;\n        overflow-x: auto;\n        margin: 16px 0;\n    }\n    .tiptap-editor-content .ProseMirror pre code {\n        background: none;\n        padding: 0;\n        font-size: 13px;\n    }\n    .tiptap-editor-content .ProseMirror hr {\n        border: none;\n        border-top: 1px solid #2a2a2a;\n        margin: 24px 0;\n    }\n    .tiptap-editor-content .ProseMirror img,\n    .tiptap-editor-content .ProseMirror .email-inline-image {\n        max-width: 100%;\n        height: auto;\n        border-radius: 0.75rem;\n        margin: 1rem auto;\n        display: block;\n        border: 2px solid rgba(255, 255, 184, 0.2);\n    }\n    .tiptap-editor-content .ProseMirror img[alt*="small"] {\n        max-width: 320px;\n        max-height: 240px;\n        object-fit: cover;\n    }\n    .tiptap-editor-content .ProseMirror img[alt*="medium"] {\n        max-width: 560px;\n        max-height: 400px;\n        object-fit: cover;\n    }\n    .tiptap-editor-content .ProseMirror img[alt*="large"] {\n        max-width: 800px;\n        max-height: 600px;\n        object-fit: cover;\n    }\n    .tiptap-editor-content .ProseMirror img[alt*="full"] {\n        width: 100%;\n        max-height: 700px;\n        object-fit: cover;\n    }\n    .tiptap-editor-content .ProseMirror p.is-editor-empty:first-child::before {\n        content: attr(data-placeholder);\n        color: #ffffb850;\n        float: left;\n        height: 0;\n        pointer-events: none;\n    }\n';t.default=c}
1,81886:function(e,t,n){async function r(){let e=await fetch("/api/blog/imagekit-auth",{cache:"no-store",headers:{"Cache-Control":"no-cache",Pragma:"no-cache"}});if(!e.ok){let t=await e.text();throw console.error("[IMAGEKIT_CLIENT] Auth response error:",e.status,t),Error("Failed to get authentication parameters: ".concat(e.status))}let t=await e.json();if("error"in t)throw console.error("[IMAGEKIT_CLIENT] Auth error:",t.error),Error(t.error);if(!t.token||!t.signature||!t.expire)throw console.error("[IMAGEKIT_CLIENT] Invalid auth response - missing required fields:",t),Error("Invalid authentication response from server");return t}async function i(e,t){var n;let i=null!==(n=null==t?void 0:t.maxRetries)&&void 0!==n?n:2,o=null;for(let n=0;n<=i;n++)try{n>0&&(console.log("[IMAGEKIT_CLIENT] Retry attempt ".concat(n,"/").concat(i," for ").concat(e.name)),await new Promise(e=>setTimeout(e,1e3*Math.pow(2,n-1))));let o=await r(),a="public_hgn+h6HmS/leVVfcf6aoWRqHnnc=";if(!a)throw console.error("[IMAGEKIT_CLIENT] ImageKit public key missing"),Error("ImageKit configuration missing. Please set NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY");let l=new FormData;l.append("file",e),l.append("publicKey",a),l.append("signature",o.signature),l.append("expire",o.expire.toString()),l.append("token",o.token);let s=Date.now(),c=e.name.replace(/[^a-zA-Z0-9.-]/g,"_"),d="".concat(s,"_").concat(c);l.append("fileName",d),l.append("folder",(null==t?void 0:t.folder)||"/general/"),l.append("useUniqueFileName","true"),l.append("tags",(null==t?void 0:t.tags)||"upload"),console.log("[IMAGEKIT_CLIENT] Uploading ".concat(e.name," (").concat((e.size/1024/1024).toFixed(2),"MB) to ").concat((null==t?void 0:t.folder)||"/general/"));let u=await fetch("https://upload.imagekit.io/api/v1/files/upload",{method:"POST",body:l});if(!u.ok){let e=await u.json().catch(()=>({}));console.error("[IMAGEKIT_CLIENT] Upload error:",u.status,e);let t=e.message||"Upload failed with status ".concat(u.status);if(t.includes("token")||t.includes("signature")||t.includes("expire"))throw Error("Auth error: ".concat(t));if(429===u.status)throw await new Promise(e=>setTimeout(e,5e3)),Error("Rate limited - please try again");throw Error(t)}let p=await u.json();return console.log("[IMAGEKIT_CLIENT] ✅ Upload successful: ".concat(e.name," -> ").concat(p.url)),{success:!0,url:p.url}}catch(t){if(o=t instanceof Error?t:Error(String(t)),console.error("[IMAGEKIT_CLIENT] Attempt ".concat(n+1," failed for ").concat(e.name,":"),o.message),o.message.includes("configuration missing")||o.message.includes("File too large"))break}return console.error("[IMAGEKIT_CLIENT] ❌ All attempts failed for ".concat(e.name)),{success:!1,error:(null==o?void 0:o.message)||"Upload failed after multiple attempts"}}n.d(t,{l:function(){return i}})}}]);

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.