@hua-labs/ui 2.0.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- export{a as AdvancedPageTransition,p as AnimatedGradient,K as BlogEditor,I as BlogEditorActions,B as BlogEditorContent,y as BlogEditorHeader,A as BlogEditorLanguageTabs,z as BlogEditorMetadata,H as BlogEditorPreview,x as BlogEditorProvider,G as BlogEditorToolbar,J as BlogEditorTranslate,s as Carousel,g as CubePageTransition,b as FadePageTransition,e as FlipPageTransition,m as GlowCard,l as Marquee,f as MorphPageTransition,k as Parallax,d as ScalePageTransition,c as SlidePageTransition,n as SpotlightCard,o as TextReveal,q as TiltCard,r as VideoBackground,h as ZoomPageTransition,t as generateSlug,E as getMarkdownPreview,F as insertMarkdown,u as isValidSlug,v as normalizeSlug,C as parseMarkdown,D as stripMarkdown,w as useBlogEditor,i as usePageTransition,j as usePageTransitionManager}from'./chunk-COR6CDMA.mjs';export{d as EmotionAnalysis,b as EmotionButton,a as EmotionMeter,c as EmotionSelector}from'./chunk-5BMH7223.mjs';import'./chunk-FSL373O6.mjs';import'./chunk-IFSEJVOR.mjs';import'./chunk-HN5LSP6L.mjs';import'./chunk-UUHAXGMO.mjs';//# sourceMappingURL=advanced-motion.mjs.map
2
+ export{a as AdvancedPageTransition,p as AnimatedGradient,K as BlogEditor,I as BlogEditorActions,B as BlogEditorContent,y as BlogEditorHeader,A as BlogEditorLanguageTabs,z as BlogEditorMetadata,H as BlogEditorPreview,x as BlogEditorProvider,G as BlogEditorToolbar,J as BlogEditorTranslate,s as Carousel,g as CubePageTransition,b as FadePageTransition,e as FlipPageTransition,m as GlowCard,l as Marquee,f as MorphPageTransition,k as Parallax,d as ScalePageTransition,c as SlidePageTransition,n as SpotlightCard,o as TextReveal,q as TiltCard,r as VideoBackground,h as ZoomPageTransition,t as generateSlug,E as getMarkdownPreview,F as insertMarkdown,u as isValidSlug,v as normalizeSlug,C as parseMarkdown,D as stripMarkdown,w as useBlogEditor,i as usePageTransition,j as usePageTransitionManager}from'./chunk-COR6CDMA.mjs';export{d as EmotionAnalysis,b as EmotionButton,a as EmotionMeter,c as EmotionSelector}from'./chunk-PYBYZVSL.mjs';import'./chunk-BXX2TZUB.mjs';import'./chunk-IFSEJVOR.mjs';import'./chunk-HN5LSP6L.mjs';import'./chunk-UUHAXGMO.mjs';//# sourceMappingURL=advanced-motion.mjs.map
3
3
  //# sourceMappingURL=advanced-motion.mjs.map
package/dist/advanced.js CHANGED
@@ -72,7 +72,7 @@
72
72
  ${Math.atan2(a.y-50,a.x-50)*(180/Math.PI)+90}deg,
73
73
  rgba(255, 255, 255, ${p?b:0}) 0%,
74
74
  transparent 80%
75
- )`,transition:p?"opacity 0.1s ease-out":`opacity ${s}ms ease-out`,pointerEvents:"none",opacity:p?1:0};return jsxRuntime.jsx("div",{ref:Wn(d,m),className:i("relative",e),style:w,onMouseMove:f,onMouseEnter:y,onMouseLeave:T,...x,children:jsxRuntime.jsxs("div",{style:N,className:"relative",children:[t,c&&jsxRuntime.jsx("div",{style:B,"aria-hidden":"true"})]})})});Vr.displayName="TiltCard";function Wn(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r&&typeof r=="object"&&(r.current=e);});}}var Ur=le__default.default.forwardRef(({src:t,type:e="native",poster:r,autoPlay:o=true,loop:n=true,muted:s=true,controls:c=false,objectFit:b="cover",overlay:g=true,overlayColor:l="rgba(0, 0, 0, 0.4)",gradient:x=false,gradientDirection:d="bottom",playbackRate:m=1,fadeIn:v=true,children:u,className:a,style:h,...p},C)=>{let f=le.useRef(null),[y,T]=le.useState(false),[w,N]=le.useState(false);le.useEffect(()=>{e==="native"&&f.current&&(f.current.playbackRate=m);},[m,e]);let B=()=>{T(true);},R=()=>{N(true);},L=F=>{let Q=new URLSearchParams({autoplay:o?"1":"0",mute:s?"1":"0",loop:n?"1":"0",controls:c?"1":"0",playlist:F,modestbranding:"1",rel:"0",showinfo:"0",iv_load_policy:"3",disablekb:"1",enablejsapi:"1",playsinline:"1"});return `https://www.youtube.com/embed/${F}?${Q.toString()}`},k=F=>{let Q=new URLSearchParams({autoplay:o?"1":"0",muted:s?"1":"0",loop:n?"1":"0",controls:c?"1":"0",background:"1",quality:"auto",dnt:"1"});return `https://player.vimeo.com/video/${F}?${Q.toString()}`},S=()=>{let F={cover:"object-cover",contain:"object-contain",fill:"object-fill"}[b];switch(e){case "youtube":return jsxRuntime.jsx("iframe",{src:L(t),className:i("absolute inset-0 w-full h-full pointer-events-none","scale-[1.2]"),style:{opacity:y||!v?1:0,transition:v?"opacity 0.8s ease-out":void 0},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:true,onLoad:()=>T(true),title:"YouTube video background"});case "vimeo":return jsxRuntime.jsx("iframe",{src:k(t),className:"absolute inset-0 w-full h-full pointer-events-none",style:{opacity:y||!v?1:0,transition:v?"opacity 0.8s ease-out":void 0},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:true,onLoad:()=>T(true),title:"Vimeo video background"});default:return jsxRuntime.jsx("video",{ref:f,src:t,poster:r,autoPlay:o,loop:n,muted:s,controls:c,playsInline:true,className:i("absolute inset-0 w-full h-full",F),style:{opacity:w||!v?1:0,transition:v?"opacity 0.8s ease-out":void 0},onLoadedData:B,onPlaying:R})}},U=()=>{if(!x)return null;let F=[];return (d==="top"||d==="both")&&F.push(jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-1/3",style:{background:`linear-gradient(to bottom, ${l}, transparent)`},"aria-hidden":"true"},"top")),(d==="bottom"||d==="both")&&F.push(jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1/3",style:{background:`linear-gradient(to top, ${l}, transparent)`},"aria-hidden":"true"},"bottom")),jsxRuntime.jsx(jsxRuntime.Fragment,{children:F})},O=a&&/\b(fixed|absolute|sticky)\b/.test(a);return jsxRuntime.jsxs("div",{ref:C,className:i("overflow-hidden",!O&&"relative",a),style:h,...p,children:[r&&v&&!y&&!w&&jsxRuntime.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${r})`},"aria-hidden":"true"}),S(),g&&!x&&jsxRuntime.jsx("div",{className:"absolute inset-0",style:{backgroundColor:l},"aria-hidden":"true"}),U(),u&&jsxRuntime.jsx("div",{className:"relative z-10 h-full",children:u})]})});Ur.displayName="VideoBackground";var _r=le__default.default.forwardRef(({children:t,autoPlay:e=false,interval:r=5e3,loop:o=true,pauseOnHover:n=true,indicators:s="dots",indicatorPosition:c="bottom",showArrows:b=true,arrowPosition:g="inside",transition:l="slide",transitionDuration:x=500,onSlideChange:d,showPlayPause:m=false,playPausePosition:v="right",className:u,style:a,...h},p)=>{let C=()=>l==="slide"&&o?1:0,[f,y]=le.useState(C),[T,w]=le.useState(!e),[N,B]=le.useState(false),[R,L]=le.useState(false),[k,S]=le.useState(false),[U,O]=le.useState(null),[F,Q]=le.useState(null),K=le.useRef(null),$=le__default.default.Children.count(t),q=Jn(),V=le.useCallback(I=>l!=="slide"||!o?I:I===0?$-1:I===$+1?0:I-1,[o,$,l]),Y=le.useCallback(I=>{if(R)return;let E=I;if(o?l!=="slide"&&(I<0?E=$-1:I>=$&&(E=0)):E=Math.max(0,Math.min(I,$-1)),E!==f){L(true),y(E);let A=o&&l==="slide"?E===0?$-1:E===$+1?0:E-1:E;d==null||d(A),setTimeout(()=>L(false),x);}},[f,$,o,R,x,l,d]);le.useEffect(()=>{!o||R||l!=="slide"||(f===0?setTimeout(()=>{S(true),y($),setTimeout(()=>S(false),50);},x):f===$+1&&setTimeout(()=>{S(true),y(1),setTimeout(()=>S(false),50);},x));},[f,$,o,R,x,l]);let de=le.useCallback(()=>{Y(f+1);},[f,Y]),Le=le.useCallback(()=>{Y(f-1);},[f,Y]),gt=le.useCallback(()=>{B(I=>!I);},[]);le.useCallback(()=>{B(false);},[]);le.useCallback(()=>{B(true);},[]);le.useEffect(()=>{if(!e||T||N||q)return;let I=setInterval(de,r);return ()=>clearInterval(I)},[e,r,T,N,de,q]);let ft=I=>{O(I.targetTouches[0].clientX);},bt=I=>{Q(I.targetTouches[0].clientX);},ht=()=>{if(!U||!F)return;let I=U-F;Math.abs(I)>=50&&(I>0?de():Le()),O(null),Q(null);};le.useEffect(()=>{let I=A=>{A.key==="ArrowLeft"?Le():A.key==="ArrowRight"&&de();},E=K.current;return E==null||E.addEventListener("keydown",I),()=>E==null?void 0:E.removeEventListener("keydown",I)},[de,Le]);let Ot=()=>{let I=q||k?0:x,E=V(f);switch(l){case "fade":return le__default.default.Children.map(t,(A,G)=>jsxRuntime.jsx("div",{className:i("absolute inset-0 w-full h-full",G===E?"z-10":"z-0"),style:{opacity:G===E?1:0,transition:`opacity ${I}ms ease-in-out`},children:A},G));case "scale":return le__default.default.Children.map(t,(A,G)=>jsxRuntime.jsx("div",{className:i("absolute inset-0 w-full h-full",G===E?"z-10":"z-0"),style:{opacity:G===E?1:0,transform:`scale(${G===E?1:.9})`,transition:`opacity ${I}ms ease-in-out, transform ${I}ms ease-in-out`},children:A},G));default:{let A=le__default.default.Children.toArray(t);return (o?[A[A.length-1],...A,A[0]]:A).map((te,ue)=>jsxRuntime.jsx("div",{className:"absolute inset-0 w-full h-full",style:{transform:`translateX(${(ue-f)*100}%)`,transition:k?"none":`transform ${I}ms ease-in-out`},children:te},ue))}}},et=()=>{if(s==="none")return null;let I=c.includes("inside"),E=c.includes("top"),A=V(f),G=i("flex items-center justify-center gap-2",I?i("absolute left-1/2 -translate-x-1/2 z-20",E?"top-4":"bottom-4"):i("mt-4",E&&"order-first mb-4 mt-0")),te=ue=>{Y(o&&l==="slide"?ue+1:ue);};return jsxRuntime.jsx("div",{className:G,role:"tablist",children:Array.from({length:$},(ue,se)=>{let be=se===A;switch(s){case "bars":return jsxRuntime.jsx("button",{onClick:()=>te(se),className:i("h-1 rounded-full transition-all duration-300",be?"w-8 bg-white":"w-4 bg-white/50 hover:bg-white/70"),role:"tab","aria-selected":be,"aria-label":`\uC2AC\uB77C\uC774\uB4DC ${se+1}`},se);case "numbers":return jsxRuntime.jsx("button",{onClick:()=>te(se),className:i("w-8 h-8 rounded-full text-sm font-medium transition-all duration-300",be?"bg-white text-gray-900":"bg-white/30 text-white hover:bg-white/50"),role:"tab","aria-selected":be,"aria-label":`\uC2AC\uB77C\uC774\uB4DC ${se+1}`,children:se+1},se);default:return jsxRuntime.jsx("button",{onClick:()=>te(se),className:i("w-2.5 h-2.5 rounded-full transition-all duration-300",be?"bg-white scale-125":"bg-white/50 hover:bg-white/70"),role:"tab","aria-selected":be,"aria-label":`\uC2AC\uB77C\uC774\uB4DC ${se+1}`},se)}})})},xt=()=>{if(!m||!e)return null;let I=!N;return jsxRuntime.jsx("button",{onClick:gt,className:i("absolute bottom-4 z-20","w-8 h-8 rounded-full flex items-center justify-center","bg-white/80 hover:bg-white text-gray-800","transition-all duration-200","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white",{left:"left-4",center:"left-1/2 -translate-x-1/2",right:"right-4"}[v]),"aria-label":I?"\uC77C\uC2DC\uC815\uC9C0":"\uC7AC\uC0DD",children:I?jsxRuntime.jsx(oa,{className:"w-4 h-4"}):jsxRuntime.jsx(ra,{className:"w-4 h-4"})})},vt=()=>{if(!b||g==="hidden")return null;let I=o||f>0,E=o||f<$-1,A=i("absolute top-1/2 -translate-y-1/2 z-20","w-10 h-10 rounded-full flex items-center justify-center","bg-white/80 hover:bg-white text-gray-800","transition-all duration-200","disabled:opacity-30 disabled:cursor-not-allowed","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white"),G=g==="outside"?"-left-14":"left-4",te=g==="outside"?"-right-14":"right-4";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:Le,disabled:!I,className:i(A,G),"aria-label":"\uC774\uC804 \uC2AC\uB77C\uC774\uB4DC",children:jsxRuntime.jsx(ea,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:de,disabled:!E,className:i(A,te),"aria-label":"\uB2E4\uC74C \uC2AC\uB77C\uC774\uB4DC",children:jsxRuntime.jsx(ta,{className:"w-5 h-5"})})]})};return jsxRuntime.jsxs("div",{ref:p,className:i("flex flex-col w-full h-full",g==="outside"&&"px-16",u),style:a,...h,children:[jsxRuntime.jsxs("div",{ref:K,className:"relative overflow-hidden w-full flex-1",onMouseEnter:()=>n&&w(true),onMouseLeave:()=>n&&w(false),onTouchStart:ft,onTouchMove:bt,onTouchEnd:ht,tabIndex:0,role:"region","aria-roledescription":"carousel","aria-label":"\uC774\uBBF8\uC9C0 \uC2AC\uB77C\uC774\uB354",children:[Ot(),vt(),xt(),c.includes("inside")&&et()]}),!c.includes("inside")&&et()]})});_r.displayName="Carousel";function Jn(){let[t,e]=le.useState(false);return le.useEffect(()=>{let r=window.matchMedia("(prefers-reduced-motion: reduce)");e(r.matches);let o=n=>{e(n.matches);};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),t}function ea({className:t}){return jsxRuntime.jsx("svg",{className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function ta({className:t}){return jsxRuntime.jsx("svg",{className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}function ra({className:t}){return jsxRuntime.jsx("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M8 5v14l11-7z"})})}function oa({className:t}){return jsxRuntime.jsx("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})})}var sa=classVarianceAuthority.cva("rounded-lg",{variants:{variant:{default:"bg-card text-card-foreground border border-border",outline:"bg-transparent border-2 border-border",elevated:"bg-card text-card-foreground shadow-lg border border-border"},shadow:{none:"shadow-none",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg"},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6"}},defaultVariants:{variant:"default",padding:"none"}}),ot=le__default.default.forwardRef(({className:t,variant:e="default",shadow:r,padding:o="none",hoverable:n,...s},c)=>jsxRuntime.jsx("div",{ref:c,className:i(sa({variant:e,shadow:r,padding:o}),n&&"transition-shadow hover:shadow-lg cursor-pointer",t),...s}));ot.displayName="Card";var Kt=le__default.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("div",{ref:r,className:i("flex flex-col space-y-1 p-3",t),...e}));Kt.displayName="CardHeader";var Qt=le__default.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("h3",{ref:r,className:i("text-base md:text-lg font-semibold leading-tight tracking-tight",t),...e}));Qt.displayName="CardTitle";var Jt=le__default.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("p",{ref:r,className:i("text-sm text-muted-foreground",t),...e}));Jt.displayName="CardDescription";var nt=le__default.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("div",{ref:r,className:i("px-3 pb-3",t),...e}));nt.displayName="CardContent";var ia=le__default.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("div",{ref:r,className:i("flex items-center px-3 pb-3",t),...e}));ia.displayName="CardFooter";var ca=classVarianceAuthority.cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2",{variants:{variant:{default:"bg-[var(--badge-default-bg)] text-[var(--badge-default-text)] hover:opacity-80",secondary:"bg-[var(--badge-secondary-bg)] text-[var(--badge-secondary-text)] hover:opacity-80",destructive:"bg-[var(--badge-destructive-bg)] text-slate-50 hover:opacity-80",error:"bg-[var(--badge-destructive-bg)] text-slate-50 hover:opacity-80",outline:"bg-transparent text-[var(--badge-outline-text)] border border-[var(--badge-outline-border)] hover:bg-[var(--badge-outline-hover-bg)]",glass:"bg-[var(--badge-glass-bg)] backdrop-blur-sm border border-[var(--badge-glass-border)] text-[var(--badge-glass-text)] hover:opacity-80"}},defaultVariants:{variant:"default"}}),xe=le__default.default.memo(le__default.default.forwardRef(({className:t,variant:e="default",...r},o)=>jsxRuntime.jsx("div",{ref:o,className:i(ca({variant:e}),t),...r})));xe.displayName="Badge";function kt(t){return t.toLowerCase().replace(/[^a-z0-9가-힣ぁ-んァ-ン一-龯_.~\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").trim()}function jr(t){return !t||t.length===0||t.length>200?false:/^[a-z0-9가-힣ぁ-んァ-ン一-龯_.~-]+$/.test(t)}function Ct(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9가-힣ぁ-んァ-ン一-龯_.~-]/g,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}var pa={pageTitle:"\uC0C8 \uAE00 \uC791\uC131",editTitle:"\uAE00 \uC218\uC815",preview:"\uBBF8\uB9AC\uBCF4\uAE30",editMode:"\uD3B8\uC9D1",basicInfo:"\uAE30\uBCF8 \uC815\uBCF4",slug:"\uC2AC\uB7EC\uADF8",slugPrefix:"/blog/",tags:"\uD0DC\uADF8",tagsPlaceholder:"\uAC1C\uBC1C, \uC77C\uC0C1, \uC5C5\uB370\uC774\uD2B8",coverImage:"\uCEE4\uBC84 \uC774\uBBF8\uC9C0 URL",coverImagePlaceholder:"https://example.com/image.jpg",publishDate:"\uBC1C\uD589 \uC608\uC57D\uC77C\uC2DC",publishDateHint:"\uBE44\uC6CC\uB450\uBA74 \uC989\uC2DC \uBC1C\uD589\uB428",expiresAt:"\uB9CC\uB8CC \uC77C\uC2DC",expiresAtHint:"\uBE44\uC6CC\uB450\uBA74 \uB9CC\uB8CC\uB418\uC9C0 \uC54A\uC74C",titleLabel:"\uC81C\uBAA9",titlePlaceholder:"\uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694",excerpt:"\uC694\uC57D",excerptPlaceholder:"\uCE74\uB4DC\uC5D0 \uD45C\uC2DC\uB420 \uC9E7\uC740 \uC694\uC57D",contentLabel:"\uBCF8\uBB38",contentPlaceholder:"\uB9C8\uD06C\uB2E4\uC6B4\uC73C\uB85C \uC791\uC131\uD558\uC138\uC694...",cancel:"\uCDE8\uC18C",saveDraft:"\uC784\uC2DC\uC800\uC7A5",publish:"\uBC1C\uD589",update:"\uC218\uC815 \uC644\uB8CC",saving:"\uC800\uC7A5 \uC911...",translateHint:"AI \uBC88\uC5ED \uAE30\uB2A5",translateButton:"AI \uBC88\uC5ED",translating:"\uBC88\uC5ED \uC911...",translateSuccess:"\uBC88\uC5ED \uC644\uB8CC!",requiredFields:"\uD544\uC218 \uD544\uB4DC\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694",saveError:"\uC800\uC7A5 \uC911 \uC624\uB958 \uBC1C\uC0DD",translateError:"\uBC88\uC5ED \uC911 \uC624\uB958 \uBC1C\uC0DD",noTitle:"\uC81C\uBAA9 \uC5C6\uC74C",bold:"\uAD75\uAC8C",italic:"\uAE30\uC6B8\uC784",strikethrough:"\uCDE8\uC18C\uC120",heading:"\uC81C\uBAA9",link:"\uB9C1\uD06C",image:"\uC774\uBBF8\uC9C0",code:"\uCF54\uB4DC",codeBlock:"\uCF54\uB4DC\uBE14\uB85D",quote:"\uC778\uC6A9\uBB38",list:"\uBAA9\uB85D",orderedList:"\uC21C\uC11C \uBAA9\uB85D",horizontalRule:"\uC218\uD3C9\uC120"},ga={enableSlug:true,enableTags:true,enableCoverImage:true,enablePublishDate:true,enableExcerpt:true,enableTranslation:true,enablePreview:true,enableMarkdownToolbar:true,enableAutoSave:true,enableExpiresAt:false},fa=[{key:"ko",label:"\uD55C\uAD6D\uC5B4",isPrimary:true,flag:"\u{1F1F0}\u{1F1F7}"},{key:"en",label:"English",flag:"\u{1F1FA}\u{1F1F8}"},{key:"ja",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"}];function tr(t){let e={};return t.forEach(r=>{e[r.key]="";}),e}function ba(t,e){var r,o,n,s,c,b,g,l;return {slug:(r=e==null?void 0:e.slug)!=null?r:"",title:(o=e==null?void 0:e.title)!=null?o:tr(t),excerpt:(n=e==null?void 0:e.excerpt)!=null?n:tr(t),content:(s=e==null?void 0:e.content)!=null?s:tr(t),tags:(c=e==null?void 0:e.tags)!=null?c:[],coverImage:(b=e==null?void 0:e.coverImage)!=null?b:"",publishedAt:(g=e==null?void 0:e.publishedAt)!=null?g:null,expiresAt:(l=e==null?void 0:e.expiresAt)!=null?l:null}}var Yr=le.createContext(null);function Z(){let t=le.useContext(Yr);if(!t)throw new Error("useBlogEditor must be used within a BlogEditorProvider");return t}function Tt({children:t,initialData:e,isEditMode:r=false,languages:o=fa,defaultLanguage:n,labels:s,callbacks:c,features:b,variant:g="default",autoSaveKey:l,autoSaveInterval:x=3e3}){var et,xt,vt,I;let d=(I=(vt=(et=o.find(E=>E.isPrimary))==null?void 0:et.key)!=null?vt:(xt=o[0])==null?void 0:xt.key)!=null?I:"ko",m=n!=null?n:d,v=le.useMemo(()=>({...pa,...s}),[s]),u=le.useMemo(()=>({...ga,...b}),[b]),[a,h]=le.useState(()=>ba(o,e)),[p,C]=le.useState(m),[f,y]=le.useState(false),[T,w]=le.useState(false),[N,B]=le.useState(false),[R,L]=le.useState(false),[k,S]=le.useState(null),[U,O]=le.useState(false),[F,Q]=le.useState(r||!!(e!=null&&e.slug)),[K,$]=le.useState("idle"),q=le.useRef(null),V=le.useRef(true),Y=l||(r?null:"blog-editor-draft");le.useEffect(()=>{if(!(!u.enableAutoSave||!Y||r))try{let E=localStorage.getItem(Y);if(E){let A=JSON.parse(E);h(A);}}catch{}},[]),le.useEffect(()=>{if(!(!u.enableAutoSave||!Y)){if(V.current){V.current=false;return}return q.current&&clearTimeout(q.current),$("saving"),q.current=setTimeout(()=>{try{localStorage.setItem(Y,JSON.stringify(a)),$("saved"),setTimeout(()=>$("idle"),2e3);}catch{$("idle");}},x),()=>{q.current&&clearTimeout(q.current);}}},[a,u.enableAutoSave,Y,x]);let de=le.useCallback(()=>{if(Y)try{localStorage.removeItem(Y);}catch{}},[Y]),Le=le.useCallback((E,A)=>{h(G=>({...G,[E]:A}));},[]),gt=le.useCallback((E,A,G)=>{h(te=>({...te,[E]:{...te[E],[A]:G}}));},[]),$t=le.useCallback(E=>kt(E),[]),zt=le.useCallback(async E=>{let A=a.title[d],G=a.content[d];if(!A||!G){S(v.requiredFields);return}if(u.enableSlug&&!a.slug){S(v.requiredFields);return}w(true),S(null);try{await c.onSave(a,E),de();}catch{S(v.saveError);}finally{w(false);}},[a,d,v,u,c,de]),ft=le.useCallback(async()=>{if(!c.onTranslate)return;let E=a.title[d],A=a.content[d],G=a.excerpt[d];if(!E||!A){S(v.requiredFields);return}B(true),S(null),O(false);try{let te=await c.onTranslate({sourceLanguage:d,title:E,content:A,excerpt:G||void 0});h(ue=>{let se={...ue.title},be={...ue.content},yr={...ue.excerpt};return Object.keys(te).forEach(tt=>{if(tt!==d){let Ft=te[tt];if(typeof Ft=="object"&&Ft!==null){let He=Ft;He.title&&(se[tt]=He.title),He.content&&(be[tt]=He.content),He.excerpt&&(yr[tt]=He.excerpt);}}}),{...ue,title:se,content:be,excerpt:yr}}),O(!0),setTimeout(()=>O(!1),3e3);}catch{S(v.translateError);}finally{B(false);}},[a,d,v,c]),bt=le.useCallback(async E=>{if(!c.onUploadImage)return null;L(true),S(null);try{return await c.onUploadImage(E)}catch{return S("\uC774\uBBF8\uC9C0 \uC5C5\uB85C\uB4DC \uC2E4\uD328"),null}finally{L(false);}},[c]),ht=le.useCallback(()=>{var E;(E=c.onCancel)==null||E.call(c);},[c]),Ot=le.useMemo(()=>({formData:a,activeLanguage:p,showPreview:f,submitting:T,translating:N,uploading:R,error:k,translateSuccess:U,autoSaveStatus:K,languages:o,features:u,labels:v,variant:g,isEditMode:r,setActiveLanguage:C,setShowPreview:y,updateField:Le,updateMultilingualField:gt,handleSave:zt,handleTranslate:ft,handleUploadImage:bt,handleCancel:ht,setError:S,generateSlug:$t,slugManuallyEdited:F,setSlugManuallyEdited:Q}),[a,p,f,T,N,R,k,U,K,o,u,v,g,r,Le,gt,zt,ft,bt,ht,$t,F,Q]);return jsxRuntime.jsx(Yr.Provider,{value:Ot,children:t})}var ro={home:ssr.House,arrowLeft:ssr.ArrowLeft,arrowRight:ssr.ArrowRight,arrowUp:ssr.ArrowUp,arrowDown:ssr.ArrowDown,menu:ssr.List,close:ssr.X,search:ssr.MagnifyingGlass,settings:ssr.Gear,externalLink:ssr.ArrowSquareOut,chevronLeft:ssr.CaretLeft,chevronRight:ssr.CaretRight,chevronDown:ssr.CaretDown,chevronUp:ssr.CaretUp,edit:ssr.Pencil,delete:ssr.Trash,add:ssr.Plus,remove:ssr.Minus,download:ssr.Download,upload:ssr.Upload,refresh:ssr.ArrowClockwise,save:ssr.FloppyDisk,copy:ssr.Copy,loader:ssr.SpinnerGap,success:ssr.CheckCircle,error:ssr.XCircle,alertCircle:ssr.WarningCircle,warning:ssr.WarningCircle,info:ssr.Info,check:ssr.Check,circle:ssr.Circle,helpCircle:ssr.Question,user:ssr.User,users:ssr.Users,userPlus:ssr.UserPlus,logIn:ssr.SignIn,logOut:ssr.SignOut,eye:ssr.Eye,eyeOff:ssr.EyeSlash,chart:ssr.ChartBar,barChart:ssr.ChartBar,trendingUp:ssr.TrendUp,activity:ssr.Pulse,database:ssr.Database,zap:ssr.Lightning,fileText:ssr.FileText,file:ssr.File,folder:ssr.Folder,book:ssr.Book,bookOpen:ssr.BookOpen,mail:ssr.Envelope,message:ssr.ChatCircle,phone:ssr.Phone,image:ssr.Image,video:ssr.Video,camera:ssr.Camera,smile:ssr.Smiley,frown:ssr.SmileySad,meh:ssr.SmileyMeh,lock:ssr.Lock,unlock:ssr.LockOpen,shield:ssr.Shield,wallet:ssr.Wallet,key:ssr.Key,clock:ssr.Clock,calendar:ssr.Calendar,calendarPlus:ssr.CalendarPlus,bell:ssr.Bell,heart:ssr.Heart,star:ssr.Star,bookmark:ssr.Bookmark,share:ssr.Share,monitor:ssr.Monitor,sun:ssr.Sun,moon:ssr.Moon,lightbulb:ssr.Lightbulb,brain:ssr.Brain,flag:ssr.Flag,square:ssr.Square,sparkle:ssr.Sparkle,sparkles:ssr.Sparkle,globe:ssr.Globe,smartphone:ssr.DeviceMobile,deviceMobile:ssr.DeviceMobile,floppyDisk:ssr.FloppyDisk,ticket:ssr.Ticket,clipboard:ssr.Clipboard,wifi:ssr.WifiHigh,wifiOff:ssr.WifiSlash,cpu:ssr.Cpu,mask:ssr.MaskHappy,bold:ssr.TextB,italic:ssr.TextItalic,strikethrough:ssr.TextStrikethrough,heading:ssr.TextHOne,link:ssr.Link,code:ssr.Code,fileCode:ssr.FileCode,quote:ssr.Quotes,list:ssr.List,listOrdered:ssr.ListNumbers,minus:ssr.Minus},oo={happy:"smile",sad:"frown",neutral:"meh",excited:"smile",angry:"frown",love:"heart",like:"heart",dislike:"frown"},no={loading:"loader",success:"success",error:"error",warning:"warning",info:"info",locked:"lock",unlocked:"unlock",visible:"eye",hidden:"eyeOff"};function ao(t){return !t||!/[-_]/.test(t)&&/^[a-z]/.test(t)?t:/^[A-Z]+$/.test(t)?t.toLowerCase():/^[A-Z]/.test(t)&&!/[-_]/.test(t)?t.charAt(0).toLowerCase()+t.slice(1):t.split(/[-_]/).map((e,r)=>r===0?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")}var J=null,ee=null;var so={home:{lucide:"Home",phosphor:"House",iconsax:"Home2"},"layout-dashboard":{lucide:"LayoutDashboard",phosphor:"SquaresFour"},folder:{lucide:"Folder",phosphor:"Folder",iconsax:"Folder"},"alert-circle":{lucide:"AlertCircle",phosphor:"WarningCircle",iconsax:"Danger"},alertCircle:{lucide:"AlertCircle",phosphor:"WarningCircle",iconsax:"Danger"},columns:{lucide:"Columns",phosphor:"Columns"},users:{lucide:"Users",phosphor:"Users",iconsax:"People"},settings:{lucide:"Settings",phosphor:"Gear"},menu:{lucide:"Menu",phosphor:"List",iconsax:"Menu"},close:{lucide:"X",phosphor:"X",iconsax:"CloseCircle"},chevronLeft:{lucide:"ChevronLeft",phosphor:"CaretLeft",iconsax:"ArrowLeft2"},chevronRight:{lucide:"ChevronRight",phosphor:"CaretRight",iconsax:"ArrowRight2"},chevronDown:{lucide:"ChevronDown",phosphor:"CaretDown",iconsax:"ArrowDown2"},chevronUp:{lucide:"ChevronUp",phosphor:"CaretUp",iconsax:"ArrowUp2"},arrowLeft:{lucide:"ArrowLeft",phosphor:"ArrowLeft",iconsax:"ArrowLeft"},arrowRight:{lucide:"ArrowRight",phosphor:"ArrowRight",iconsax:"ArrowRight"},arrowUp:{lucide:"ArrowUp",phosphor:"ArrowUp",iconsax:"ArrowUp"},arrowDown:{lucide:"ArrowDown",phosphor:"ArrowDown",iconsax:"ArrowDown"},add:{lucide:"Plus",phosphor:"Plus",iconsax:"Add"},edit:{lucide:"Edit",phosphor:"Pencil"},pencil:{lucide:"Pencil",phosphor:"Pencil"},delete:{lucide:"Trash2",phosphor:"Trash",iconsax:"Trash"},trash:{lucide:"Trash2",phosphor:"Trash",iconsax:"Trash"},upload:{lucide:"Upload",phosphor:"Upload",iconsax:"Upload"},download:{lucide:"Download",phosphor:"Download",iconsax:"Download"},x:{lucide:"X",phosphor:"X"},check:{lucide:"Check",phosphor:"Check",iconsax:"Check"},search:{lucide:"Search",phosphor:"MagnifyingGlass",iconsax:"SearchNormal"},share:{lucide:"Share",phosphor:"Share"},copy:{lucide:"Copy",phosphor:"Copy"},save:{lucide:"Save",phosphor:"FloppyDisk"},loader:{lucide:"Loader2",phosphor:"Spinner"},loader2:{lucide:"Loader2",phosphor:"Spinner"},"check-circle":{lucide:"CheckCircle",phosphor:"CheckCircle",iconsax:"TickCircle"},checkCircle:{lucide:"CheckCircle",phosphor:"CheckCircle",iconsax:"TickCircle"},success:{lucide:"CheckCircle",phosphor:"CheckCircle",iconsax:"TickCircle"},error:{lucide:"XCircle",phosphor:"XCircle",iconsax:"CloseCircle"},warning:{lucide:"AlertCircle",phosphor:"WarningCircle",iconsax:"Warning2"},info:{lucide:"Info",phosphor:"Info",iconsax:"InfoCircle"},refresh:{lucide:"RefreshCw",phosphor:"ArrowClockwise",iconsax:"Refresh"},refreshCw:{lucide:"RefreshCw",phosphor:"ArrowClockwise",iconsax:"Refresh"},bell:{lucide:"Bell",phosphor:"Bell",iconsax:"Bell"},heart:{lucide:"Heart",phosphor:"Heart",iconsax:"Heart"},star:{lucide:"Star",phosphor:"Star",iconsax:"Star"},bookmark:{lucide:"Bookmark",phosphor:"Bookmark"},user:{lucide:"User",phosphor:"User",iconsax:"User"},userPlus:{lucide:"UserPlus",phosphor:"UserPlus",iconsax:"UserAdd"},logIn:{lucide:"LogIn",phosphor:"SignIn",iconsax:"Login"},logOut:{lucide:"LogOut",phosphor:"SignOut",iconsax:"Logout"},chrome:{lucide:"Chrome",phosphor:"ChromeLogo",iconsax:"Chrome"},github:{lucide:"Github",phosphor:"GithubLogo"},message:{lucide:"MessageCircle",phosphor:"ChatCircle"},messageSquare:{lucide:"MessageSquare",phosphor:"ChatSquare"},"message-square":{lucide:"MessageSquare",phosphor:"ChatSquare"},inbox:{lucide:"Inbox",phosphor:"Inbox"},calendar:{lucide:"Calendar",phosphor:"Calendar"},calendarPlus:{lucide:"CalendarPlus",phosphor:"CalendarPlus"},checkSquare:{lucide:"CheckSquare",phosphor:"CheckSquare",iconsax:"TickSquare"},clock:{lucide:"Clock",phosphor:"Clock"},book:{lucide:"Book",phosphor:"Book",iconsax:"Book"},bookOpen:{lucide:"BookOpen",phosphor:"BookOpen",iconsax:"Book"},monitor:{lucide:"Monitor",phosphor:"Monitor",iconsax:"Monitor"},sun:{lucide:"Sun",phosphor:"Sun",iconsax:"Sun"},moon:{lucide:"Moon",phosphor:"Moon",iconsax:"Moon"},sparkle:{lucide:"Sparkle",phosphor:"Sparkle"},sparkles:{lucide:"Sparkles",phosphor:"Sparkle"},lightbulb:{lucide:"Lightbulb",phosphor:"Lightbulb"},brain:{lucide:"Brain",phosphor:"Brain"},zap:{lucide:"Zap",phosphor:"Lightning"},globe:{lucide:"Globe",phosphor:"Globe",iconsax:"Global"},deviceMobile:{lucide:"Smartphone",phosphor:"DeviceMobile"},smartphone:{lucide:"Smartphone",phosphor:"DeviceMobile"},floppyDisk:{lucide:"Save",phosphor:"FloppyDisk"},chart:{lucide:"BarChart3",phosphor:"ChartBar"},barChart:{lucide:"BarChart",phosphor:"ChartBar"},trendingUp:{lucide:"TrendingUp",phosphor:"TrendUp"},trendingDown:{lucide:"TrendingDown",phosphor:"TrendDown"},activity:{lucide:"Activity",phosphor:"Pulse"},database:{lucide:"Database",phosphor:"Database"},dollarSign:{lucide:"DollarSign",phosphor:"CurrencyDollar"},dollar:{lucide:"DollarSign",phosphor:"CurrencyDollar"},currency:{lucide:"DollarSign",phosphor:"CurrencyDollar"},layers:{lucide:"Layers",phosphor:"Stack"},ban:{lucide:"Ban",phosphor:"Prohibit"},lock:{lucide:"Lock",phosphor:"Lock",iconsax:"Lock"},unlock:{lucide:"Unlock",phosphor:"LockOpen",iconsax:"Unlock"},shield:{lucide:"Shield",phosphor:"Shield",iconsax:"Shield"},key:{lucide:"Key",phosphor:"Key"},play:{lucide:"Play",phosphor:"Play",iconsax:"Play"},pause:{lucide:"Pause",phosphor:"Pause",iconsax:"Pause"},image:{lucide:"Image",phosphor:"Image",iconsax:"Image"},video:{lucide:"Video",phosphor:"Video",iconsax:"Video"},camera:{lucide:"Camera",phosphor:"Camera",iconsax:"Camera"},fileText:{lucide:"FileText",phosphor:"FileText"},file:{lucide:"File",phosphor:"File"},externalLink:{lucide:"ExternalLink",phosphor:"ArrowSquareOut"},link:{lucide:"Link",phosphor:"Link",iconsax:"Link"},moreHorizontal:{lucide:"MoreHorizontal",phosphor:"DotsThreeOutline"},moreVertical:{lucide:"MoreVertical",phosphor:"DotsThreeVertical"},remove:{lucide:"Minus",phosphor:"Minus",iconsax:"Minus"},eye:{lucide:"Eye",phosphor:"Eye",iconsax:"Eye"},eyeOff:{lucide:"EyeOff",phosphor:"EyeSlash",iconsax:"EyeSlash"},smile:{lucide:"Smile",phosphor:"Smiley",iconsax:"EmojiHappy"},frown:{lucide:"Frown",phosphor:"SmileySad",iconsax:"EmojiSad"},meh:{lucide:"Meh",phosphor:"SmileyMeh",iconsax:"EmojiNormal"},mail:{lucide:"Mail",phosphor:"Envelope"},phone:{lucide:"Phone",phosphor:"Phone"},flag:{lucide:"Flag",phosphor:"Flag",iconsax:"Flag"},rocket:{lucide:"Rocket",phosphor:"Rocket",iconsax:"Rocket"},ticket:{lucide:"Ticket",phosphor:"Ticket",iconsax:"Ticket"},clipboard:{lucide:"ClipboardList",phosphor:"Clipboard",iconsax:"Sticker"},wifi:{lucide:"Wifi",phosphor:"WifiHigh",iconsax:"Wifi"},wifiOff:{lucide:"WifiOff",phosphor:"WifiSlash"},cpu:{lucide:"Cpu",phosphor:"Cpu",iconsax:"Computing"},mask:{lucide:"Drama",phosphor:"MaskHappy",iconsax:"EmojiHappy"},bold:{lucide:"Bold",phosphor:"TextB"},italic:{lucide:"Italic",phosphor:"TextItalic"},strikethrough:{lucide:"Strikethrough",phosphor:"TextStrikethrough"},heading:{lucide:"Heading",phosphor:"TextHOne"},code:{lucide:"Code",phosphor:"Code",iconsax:"Code"},fileCode:{lucide:"FileCode",phosphor:"FileCode"},quote:{lucide:"Quote",phosphor:"Quotes",iconsax:"QuoteUp"},list:{lucide:"List",phosphor:"List"},listOrdered:{lucide:"ListOrdered",phosphor:"ListNumbers"},minus:{lucide:"Minus",phosphor:"Minus",iconsax:"Minus"}};async function io(){if(typeof window=="undefined")return null;if(!J)try{J=await import('@phosphor-icons/react');}catch{return console.warn("Phosphor Icons not available. Install @phosphor-icons/react to use."),null}return J}async function lo(){if(typeof window=="undefined")return null;if(!ee)try{ee=await import('lucide-react');}catch{return console.warn("Lucide Icons not available. Install lucide-react to use lucide provider."),null}return ee}function Et(t,e="phosphor"){let r=so[t];if(!r)return ei(t,e);let o=r[e];switch(e){case "phosphor":return !o||!J?null:(J==null?void 0:J[o])||null;case "lucide":return !o||!ee?null:(ee==null?void 0:ee[o])||null;case "iconsax":{return null;}default:return null}}function ei(t,e){switch(e){case "phosphor":{if(!J)return null;let r=t.charAt(0).toUpperCase()+t.slice(1),o=t.split(/(?=[A-Z])/).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("");return (J==null?void 0:J[r])||(J==null?void 0:J[o])||(J==null?void 0:J[t])||null}case "lucide":{if(!ee)return null;let r=t.charAt(0).toUpperCase()+t.slice(1),o=t.replace(/([A-Z])/g,n=>n===t[0]?n.toLowerCase():n);return (ee==null?void 0:ee[r])||(ee==null?void 0:ee[t])||(ee==null?void 0:ee[o])||null}case "iconsax":{return null;}default:return null}}function co(t,e){let r=so[t];if(r){let o=r[e];if(o)return o}return t}var or={"arrow-left":"arrowLeft","arrow-right":"arrowRight","arrow-up":"arrowUp","arrow-down":"arrowDown","chevron-left":"chevronLeft","chevron-right":"chevronRight","chevron-up":"chevronUp","chevron-down":"chevronDown","external-link":"externalLink","more-horizontal":"moreHorizontal","more-vertical":"moreVertical","user-plus":"userPlus","log-in":"logIn","log-out":"logOut","check-circle":"checkCircle","check-square":"checkSquare","alert-circle":"alertCircle","eye-off":"eyeOff","file-text":"fileText","book-open":"bookOpen","bar-chart":"barChart","trending-up":"trendingUp","trending-down":"trendingDown","message-square":"messageSquare","calendar-plus":"calendarPlus","refresh-cw":"refreshCw","dollar-sign":"dollarSign","layout-dashboard":"layoutDashboard","device-mobile":"deviceMobile","floppy-disk":"floppyDisk",back:"arrowLeft",prev:"arrowLeft",previous:"arrowLeft",forward:"arrowRight",next:"arrowRight",close:"x",cancel:"x",remove:"delete",trash:"delete",plus:"add",new:"add",pencil:"edit",modify:"edit",store:"save",floppy:"save",magnify:"search",person:"user",account:"user",profile:"user",gear:"settings",config:"settings",preferences:"settings",house:"home",main:"home",done:"check",complete:"check",tick:"check",information:"info",help:"info",alert:"warning",caution:"warning",checkmark:"success",checkCircle:"success",fail:"error",cross:"error",xCircle:"error",spinner:"loader",loading:"loader",wait:"loader",reload:"refresh",update:"refresh",sync:"refresh",show:"eye",view:"eye",hide:"eyeOff",hidden:"eyeOff",secure:"lock",locked:"lock",unsecure:"unlock",unlocked:"unlock",get:"download",fetch:"download",post:"upload",send:"share",export:"share",duplicate:"copy",clone:"copy",email:"mail",envelope:"mail",chat:"message",comment:"message",talk:"message",date:"calendar",schedule:"calendar",time:"clock",watch:"clock",document:"fileText",doc:"fileText",text:"fileText",directory:"folder",dir:"folder",picture:"image",img:"image",movie:"video",film:"video",photo:"camera",capture:"camera",start:"play",run:"play",stop:"pause",halt:"pause",like:"heart",love:"heart",favorite:"star",saveBookmark:"bookmark",notification:"bell",notify:"bell",alarm:"bell",prefs:"settings",lookup:"search",dots:"moreHorizontal",moreMenu:"moreHorizontal",moreOptions:"moreVertical",external:"externalLink",outbound:"externalLink",open:"externalLink",url:"link",hyperlink:"link",graph:"barChart",stats:"barChart",analytics:"barChart",db:"database",storage:"database",pulse:"activity",monitor:"activity",up:"trendingUp",down:"trendingDown",lightning:"zap",bolt:"zap",flash:"zap",security:"shield",protect:"shield",password:"key",secret:"key",signin:"logIn",login:"logIn",enter:"logIn",signout:"logOut",logout:"logOut",exit:"logOut",people:"users",group:"users",team:"users",addUser:"userPlus",invite:"userPlus",read:"book",library:"book",reading:"bookOpen",openBook:"bookOpen",light:"sun",day:"sun",dark:"moon",night:"moon",screen:"monitor",display:"monitor",ai:"brain",intelligence:"brain",think:"brain",idea:"lightbulb",bulb:"lightbulb",inspiration:"lightbulb",magic:"sparkles",stars:"sparkles",glitter:"sparkles"};function uo(t){if(!t||typeof t!="string")return {normalized:t||"",wasAlias:false};let e=ao(t),r=or[t]||or[e];return r?{normalized:r,wasAlias:true,originalAlias:t}:{normalized:e,wasAlias:false}}var mo={set:"lucide",weight:"regular",size:20,color:"currentColor",strokeWidth:1.25,iconsaxVariant:"line"};var oi=le.createContext(mo);function po(){return le.useContext(oi)}var go=le__default.default.forwardRef(({name:t,size:e,className:r,emotion:o,status:n,provider:s,weight:c,animated:b=false,pulse:g=false,spin:l=false,bounce:x=false,variant:d="default","aria-label":m,"aria-hidden":v},u)=>{var $,q;let a=po(),h=s||a.set,p=e!=null?e:a.size,C=c||a.weight,f=a.color,y=($=a.strokeWidth)!=null?$:1.25,T=(q=a.iconsaxVariant)!=null?q:"line",[w,N]=le__default.default.useState(false),[B,R]=le__default.default.useState(false);le__default.default.useEffect(()=>{N(true),h==="lucide"?lo().then(()=>R(true)):h==="phosphor"?io().then(()=>R(true)):R(true);},[h]);let L=le__default.default.useMemo(()=>{let V=o?oo[o]:n?no[n]:t,{normalized:Y}=uo(V),de=co(Y,h);return {normalized:Y,providerName:de}},[t,o,n,h]),k=L.normalized,S=le__default.default.useMemo(()=>{return null},[h,L.providerName,w,T]),U=Vt({"text-current":d==="default","text-primary":d==="primary","text-muted-foreground":d==="secondary"||d==="muted","text-green-600 dark:text-green-400":d==="success","text-yellow-600 dark:text-yellow-400":d==="warning","text-destructive":d==="error"});if(!w)return jsxRuntime.jsx("span",{style:{width:p,height:p},className:i(U,r),"aria-hidden":v!==void 0?v:true,"aria-label":m});let O=null;if(h==="phosphor"?(O=ro[k]||null,!O&&B&&(O=Et(k,h))):h==="iconsax"?(O=S,O||(O=Et(k,h))):O=Et(k,h),!O)return h==="iconsax"&&true?process.env.NODE_ENV==="development"&&console.warn(`Icon "${k}" \u2014 iconsax resolver not registered. Use HuaProvider with icons.set='iconsax', or add: import '@hua-labs/ui/iconsax'`):console.warn(`Icon "${k}" not found for provider "${h}"`),jsxRuntime.jsx("span",{ref:u,className:i("inline-flex items-center justify-center rounded-full border-2 border-dashed border-border",U,r),style:{width:p,height:p},"aria-label":m||`\uC544\uC774\uCF58\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C: ${k}`,title:`Icon not found: ${k}`,children:jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground","aria-hidden":"true",children:"?"})});let F={size:typeof p=="number"?p:void 0,width:p,height:p,color:f};h==="phosphor"?F.weight=C:F.strokeWidth=y;let Q=Vt({"animate-pulse":g,"animate-spin":l,"animate-bounce":x,"transition-all duration-200 ease-in-out":b}),K={};return m?(K["aria-label"]=m,K["aria-hidden"]=false):v!==void 0?K["aria-hidden"]=v:K["aria-hidden"]=true,jsxRuntime.jsx("span",{ref:u,className:i("inline-flex items-center justify-center",Q,U,r),style:{width:p,height:p},...K,children:O&&le__default.default.createElement(O,{...F,className:U,"aria-hidden":true})})});go.displayName="Icon";var ni=le__default.default.memo(go,(t,e)=>t.name===e.name&&t.size===e.size&&t.className===e.className&&t.emotion===e.emotion&&t.status===e.status&&t.provider===e.provider&&t.animated===e.animated&&t.pulse===e.pulse&&t.spin===e.spin&&t.bounce===e.bounce&&t.variant===e.variant&&t.weight===e.weight&&t["aria-label"]===e["aria-label"]&&t["aria-hidden"]===e["aria-hidden"]),M=ni;M.displayName="Icon";var fo=le__default.default.forwardRef((t,e)=>jsxRuntime.jsx(M,{ref:e,name:"smile",...t}));fo.displayName="EmotionIcon";var bo=le__default.default.forwardRef((t,e)=>jsxRuntime.jsx(M,{ref:e,name:"info",...t}));bo.displayName="StatusIcon";var ho=le__default.default.forwardRef((t,e)=>jsxRuntime.jsx(M,{ref:e,name:"loader",status:"loading",spin:true,"aria-label":"\uB85C\uB529 \uC911",...t}));ho.displayName="LoadingIcon";var xo=le__default.default.forwardRef((t,e)=>jsxRuntime.jsx(M,{ref:e,name:"check",status:"success",variant:"success","aria-label":"\uC131\uACF5",...t}));xo.displayName="SuccessIcon";var vo=le__default.default.forwardRef((t,e)=>jsxRuntime.jsx(M,{ref:e,name:"alertCircle",status:"error",variant:"error","aria-label":"\uC624\uB958",...t}));vo.displayName="ErrorIcon";var $e=le__default.default.forwardRef(({onBack:t,backLink:e,className:r},o)=>{let{labels:n,isEditMode:s,formData:c}=Z();return jsxRuntime.jsx("header",{ref:o,className:i("flex items-center justify-between mb-8",r),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[e||t&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:"p-2 text-muted-foreground hover:text-foreground transition-colors","aria-label":"\uB4A4\uB85C\uAC00\uAE30",children:jsxRuntime.jsx(M,{name:"chevronLeft",size:24})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold text-foreground",children:s?n.editTitle:n.pageTitle}),s&&c.slug&&jsxRuntime.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.slugPrefix,c.slug]})]})]})})});$e.displayName="BlogEditorHeader";var ze=le__default.default.forwardRef(({className:t},e)=>{var y,T;let{formData:r,updateField:o,features:n,labels:s,variant:c,handleUploadImage:b,uploading:g,setSlugManuallyEdited:l}=Z(),[x,d]=le.useState(""),m=le.useRef(null),v=i("rounded-xl p-6 space-y-4",c==="glass"?"bg-white/10 backdrop-blur-sm border border-white/20 dark:bg-background/20 dark:border-border/50":c==="minimal"?"bg-transparent":"bg-background",t),u="w-full px-3 py-2 border border-border rounded-lg bg-background text-foreground focus:ring-1 focus:ring-ring focus:border-transparent transition-colors",a="block text-sm font-medium text-foreground mb-1",h=le.useCallback(w=>{let N=w.trim();N&&!r.tags.includes(N)&&o("tags",[...r.tags,N]),d("");},[r.tags,o]),p=le.useCallback(w=>{o("tags",r.tags.filter(N=>N!==w));},[r.tags,o]),C=le.useCallback(w=>{let N=w.target.value;if(N.includes(",")){let B=N.split(",");B.forEach((R,L)=>{L<B.length-1?h(R):d(R);});}else d(N);},[h]),f=le.useCallback(w=>{w.key==="Enter"?(w.preventDefault(),h(x)):w.key==="Backspace"&&!x&&r.tags.length>0&&p(r.tags[r.tags.length-1]);},[x,r.tags,h,p]);return jsxRuntime.jsxs("div",{ref:e,className:v,children:[jsxRuntime.jsx("h2",{className:"font-semibold text-foreground",children:s.basicInfo}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.enableSlug&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:a,children:[s.slug," *"]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground mr-1 text-sm",children:s.slugPrefix}),jsxRuntime.jsx("input",{type:"text",value:r.slug,onChange:w=>{o("slug",Ct(w.target.value)),l(true);},className:i(u,"flex-1"),placeholder:"my-post-slug"})]})]}),n.enableTags&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:a,children:s.tags}),jsxRuntime.jsxs("div",{className:i("flex flex-wrap items-center gap-2 min-h-[42px] px-3 py-2 border border-border rounded-lg bg-background focus-within:ring-1 focus-within:ring-ring focus-within:border-transparent transition-colors"),children:[r.tags.map(w=>jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary/10 text-primary text-sm rounded-md",children:[w,jsxRuntime.jsx("button",{type:"button",onClick:()=>p(w),className:"hover:text-primary transition-colors","aria-label":`${w} \uD0DC\uADF8 \uC0AD\uC81C`,children:jsxRuntime.jsx(M,{name:"x",size:14})})]},w)),jsxRuntime.jsx("input",{type:"text",value:x,onChange:C,onKeyDown:f,className:"flex-1 min-w-[100px] bg-transparent outline-none text-foreground text-sm",placeholder:r.tags.length===0?s.tagsPlaceholder:"\uD0DC\uADF8 \uCD94\uAC00..."})]}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"\uC27C\uD45C(,) \uB610\uB294 Enter\uB85C \uD0DC\uADF8 \uCD94\uAC00"})]})]}),n.enableCoverImage&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:a,children:s.coverImage}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[r.coverImage&&jsxRuntime.jsxs("div",{className:"relative w-full h-40 rounded-lg overflow-hidden bg-muted",children:[jsxRuntime.jsx("img",{src:r.coverImage,alt:"\uCEE4\uBC84 \uC774\uBBF8\uC9C0 \uBBF8\uB9AC\uBCF4\uAE30",className:"w-full h-full object-cover"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o("coverImage",""),className:"absolute top-2 right-2 p-1.5 bg-red-500 text-white rounded-full hover:bg-red-600 transition-colors","aria-label":"\uC774\uBBF8\uC9C0 \uC0AD\uC81C",children:jsxRuntime.jsx(M,{name:"x",size:14})})]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:r.coverImage,onChange:w=>o("coverImage",w.target.value),className:i(u,"flex-1"),placeholder:s.coverImagePlaceholder}),jsxRuntime.jsx("input",{ref:m,type:"file",accept:"image/*",className:"hidden",onChange:async w=>{var B;let N=(B=w.target.files)==null?void 0:B[0];if(N){let R=await b(N);R&&o("coverImage",R);}w.target.value="";}}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{var w;return (w=m.current)==null?void 0:w.click()},disabled:g,className:"px-3 py-2 border border-border rounded-lg hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",title:"\uC774\uBBF8\uC9C0 \uC5C5\uB85C\uB4DC",children:g?jsxRuntime.jsx(M,{name:"loader",size:20,spin:true}):jsxRuntime.jsx(M,{name:"upload",size:20})})]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.enablePublishDate&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:a,children:s.publishDate}),jsxRuntime.jsx("input",{type:"datetime-local",value:(y=r.publishedAt)!=null?y:"",onChange:w=>o("publishedAt",w.target.value||null),className:u}),jsxRuntime.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s.publishDateHint})]}),n.enableExpiresAt&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:a,children:s.expiresAt}),jsxRuntime.jsx("input",{type:"datetime-local",value:(T=r.expiresAt)!=null?T:"",onChange:w=>o("expiresAt",w.target.value||null),className:u}),jsxRuntime.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s.expiresAtHint})]})]})]})});ze.displayName="BlogEditorMetadata";var Oe=le__default.default.forwardRef(({className:t},e)=>{let{languages:r,activeLanguage:o,setActiveLanguage:n,showPreview:s,setShowPreview:c,features:b,labels:g}=Z();return jsxRuntime.jsxs("div",{ref:e,className:i("flex items-center border-b border-border sticky top-0 z-10 bg-background",t),role:"tablist","aria-label":"\uC5B8\uC5B4 \uC120\uD0DD",children:[jsxRuntime.jsx("div",{className:"flex flex-1",children:r.map(l=>{let x=o===l.key,d=l.isPrimary;return jsxRuntime.jsxs("button",{type:"button",role:"tab","aria-selected":x,"aria-controls":`tabpanel-${l.key}`,id:`tab-${l.key}`,onClick:()=>n(l.key),className:i("flex-1 px-4 py-3 text-sm font-medium transition-colors",x?"bg-primary/10 text-primary border-b-2 border-primary":"text-muted-foreground hover:bg-muted"),children:[l.flag&&jsxRuntime.jsx("span",{className:"mr-1.5",children:l.flag}),l.label,d&&" *"]},l.key)})}),b.enablePreview&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>c(!s),className:"inline-flex items-center gap-1.5 px-3 py-2 mx-2 text-sm border border-border rounded-lg hover:bg-muted transition-colors shrink-0",children:[jsxRuntime.jsx(M,{name:s?"pencil":"eye",size:14}),s?g.editMode:g.preview]})]})});Oe.displayName="BlogEditorLanguageTabs";var Fe=le__default.default.forwardRef(({className:t,textareaRef:e},r)=>{var f;let{formData:o,activeLanguage:n,updateMultilingualField:s,updateField:c,features:b,labels:g,languages:l,generateSlug:x,isEditMode:d,slugManuallyEdited:m}=Z(),v=((f=l.find(y=>y.isPrimary))==null?void 0:f.key)===n,u=l.find(y=>y.key===n),a="w-full px-3 py-2 border border-border rounded-lg bg-background text-foreground focus:ring-1 focus:ring-ring focus:border-transparent transition-colors",h="block text-sm font-medium text-foreground mb-1",p=y=>{s("title",n,y),n==="en"&&!d&&!m&&c("slug",x(y));},C=y=>v?`${y} *`:`${y} (${(u==null?void 0:u.label)||n})`;return jsxRuntime.jsxs("div",{ref:r,className:i("p-6 space-y-4",t),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:h,children:C(g.titleLabel)}),jsxRuntime.jsx("input",{type:"text",value:o.title[n]||"",onChange:y=>p(y.target.value),className:a,placeholder:g.titlePlaceholder})]}),b.enableExcerpt&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:h,children:C(g.excerpt)}),jsxRuntime.jsx("textarea",{value:o.excerpt[n]||"",onChange:y=>s("excerpt",n,y.target.value),rows:2,className:i(a,"resize-none"),placeholder:g.excerptPlaceholder})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:h,children:[C(g.contentLabel)," (\uB9C8\uD06C\uB2E4\uC6B4)"]}),jsxRuntime.jsx("textarea",{ref:e,value:o.content[n]||"",onChange:y=>s("content",n,y.target.value),rows:15,className:i(a,"font-mono text-sm resize-y min-h-[300px]"),placeholder:g.contentPlaceholder})]})]})});Fe.displayName="BlogEditorContent";function ui(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Lt(t){if(!t)return "";let e=t;return e=e.replace(/```(\w*)\n?([\s\S]*?)```/g,(r,o,n)=>`<pre class="bg-gray-100 dark:bg-gray-800 rounded-lg p-4 overflow-x-auto my-4"><code class="text-sm">${ui(n.trim())}</code></pre>`),e=e.replace(/`([^`]+)`/g,'<code class="bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded text-sm">$1</code>'),e=e.replace(/^######\s+(.+)$/gm,'<h6 class="text-base font-semibold mt-4 mb-2">$1</h6>'),e=e.replace(/^#####\s+(.+)$/gm,'<h5 class="text-lg font-semibold mt-4 mb-2">$1</h5>'),e=e.replace(/^####\s+(.+)$/gm,'<h4 class="text-xl font-semibold mt-5 mb-2">$1</h4>'),e=e.replace(/^###\s+(.+)$/gm,'<h3 class="text-2xl font-semibold mt-5 mb-3">$1</h3>'),e=e.replace(/^##\s+(.+)$/gm,'<h2 class="text-2xl font-bold mt-6 mb-3">$1</h2>'),e=e.replace(/^#\s+(.+)$/gm,'<h1 class="text-3xl font-bold mt-6 mb-4">$1</h1>'),e=e.replace(/^---+$/gm,'<hr class="my-6 border-gray-300 dark:border-gray-600" />'),e=e.replace(/^>\s+(.+)$/gm,'<blockquote class="border-l-4 border-gray-300 dark:border-gray-600 pl-4 my-4 italic text-gray-600 dark:text-gray-400">$1</blockquote>'),e=e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\*(.+?)\*/g,"<em>$1</em>"),e=e.replace(/~~(.+?)~~/g,'<del class="text-gray-500">$1</del>'),e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" class="text-cyan-600 hover:text-cyan-700 dark:text-cyan-400 dark:hover:text-cyan-300 underline" target="_blank" rel="noopener noreferrer">$1</a>'),e=e.replace(/^[-*]\s+(.+)$/gm,'<li class="ml-4">$1</li>'),e=e.replace(/(<li[^>]*>.*<\/li>\n?)+/g,r=>`<ul class="list-disc list-inside my-4 space-y-1">${r}</ul>`),e=e.replace(/\n(?!<)/g,`<br />
75
+ )`,transition:p?"opacity 0.1s ease-out":`opacity ${s}ms ease-out`,pointerEvents:"none",opacity:p?1:0};return jsxRuntime.jsx("div",{ref:Wn(d,m),className:i("relative",e),style:w,onMouseMove:f,onMouseEnter:y,onMouseLeave:T,...x,children:jsxRuntime.jsxs("div",{style:N,className:"relative",children:[t,c&&jsxRuntime.jsx("div",{style:B,"aria-hidden":"true"})]})})});Vr.displayName="TiltCard";function Wn(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r&&typeof r=="object"&&(r.current=e);});}}var Ur=le__default.default.forwardRef(({src:t,type:e="native",poster:r,autoPlay:o=true,loop:n=true,muted:s=true,controls:c=false,objectFit:b="cover",overlay:g=true,overlayColor:l="rgba(0, 0, 0, 0.4)",gradient:x=false,gradientDirection:d="bottom",playbackRate:m=1,fadeIn:v=true,children:u,className:a,style:h,...p},C)=>{let f=le.useRef(null),[y,T]=le.useState(false),[w,N]=le.useState(false);le.useEffect(()=>{e==="native"&&f.current&&(f.current.playbackRate=m);},[m,e]);let B=()=>{T(true);},R=()=>{N(true);},L=F=>{let Q=new URLSearchParams({autoplay:o?"1":"0",mute:s?"1":"0",loop:n?"1":"0",controls:c?"1":"0",playlist:F,modestbranding:"1",rel:"0",showinfo:"0",iv_load_policy:"3",disablekb:"1",enablejsapi:"1",playsinline:"1"});return `https://www.youtube.com/embed/${F}?${Q.toString()}`},k=F=>{let Q=new URLSearchParams({autoplay:o?"1":"0",muted:s?"1":"0",loop:n?"1":"0",controls:c?"1":"0",background:"1",quality:"auto",dnt:"1"});return `https://player.vimeo.com/video/${F}?${Q.toString()}`},S=()=>{let F={cover:"object-cover",contain:"object-contain",fill:"object-fill"}[b];switch(e){case "youtube":return jsxRuntime.jsx("iframe",{src:L(t),className:i("absolute inset-0 w-full h-full pointer-events-none","scale-[1.2]"),style:{opacity:y||!v?1:0,transition:v?"opacity 0.8s ease-out":void 0},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:true,onLoad:()=>T(true),title:"YouTube video background"});case "vimeo":return jsxRuntime.jsx("iframe",{src:k(t),className:"absolute inset-0 w-full h-full pointer-events-none",style:{opacity:y||!v?1:0,transition:v?"opacity 0.8s ease-out":void 0},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:true,onLoad:()=>T(true),title:"Vimeo video background"});default:return jsxRuntime.jsx("video",{ref:f,src:t,poster:r,autoPlay:o,loop:n,muted:s,controls:c,playsInline:true,className:i("absolute inset-0 w-full h-full",F),style:{opacity:w||!v?1:0,transition:v?"opacity 0.8s ease-out":void 0},onLoadedData:B,onPlaying:R})}},U=()=>{if(!x)return null;let F=[];return (d==="top"||d==="both")&&F.push(jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-1/3",style:{background:`linear-gradient(to bottom, ${l}, transparent)`},"aria-hidden":"true"},"top")),(d==="bottom"||d==="both")&&F.push(jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1/3",style:{background:`linear-gradient(to top, ${l}, transparent)`},"aria-hidden":"true"},"bottom")),jsxRuntime.jsx(jsxRuntime.Fragment,{children:F})},O=a&&/\b(fixed|absolute|sticky)\b/.test(a);return jsxRuntime.jsxs("div",{ref:C,className:i("overflow-hidden",!O&&"relative",a),style:h,...p,children:[r&&v&&!y&&!w&&jsxRuntime.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${r})`},"aria-hidden":"true"}),S(),g&&!x&&jsxRuntime.jsx("div",{className:"absolute inset-0",style:{backgroundColor:l},"aria-hidden":"true"}),U(),u&&jsxRuntime.jsx("div",{className:"relative z-10 h-full",children:u})]})});Ur.displayName="VideoBackground";var _r=le__default.default.forwardRef(({children:t,autoPlay:e=false,interval:r=5e3,loop:o=true,pauseOnHover:n=true,indicators:s="dots",indicatorPosition:c="bottom",showArrows:b=true,arrowPosition:g="inside",transition:l="slide",transitionDuration:x=500,onSlideChange:d,showPlayPause:m=false,playPausePosition:v="right",className:u,style:a,...h},p)=>{let C=()=>l==="slide"&&o?1:0,[f,y]=le.useState(C),[T,w]=le.useState(!e),[N,B]=le.useState(false),[R,L]=le.useState(false),[k,S]=le.useState(false),[U,O]=le.useState(null),[F,Q]=le.useState(null),K=le.useRef(null),$=le__default.default.Children.count(t),q=Jn(),V=le.useCallback(I=>l!=="slide"||!o?I:I===0?$-1:I===$+1?0:I-1,[o,$,l]),Y=le.useCallback(I=>{if(R)return;let E=I;if(o?l!=="slide"&&(I<0?E=$-1:I>=$&&(E=0)):E=Math.max(0,Math.min(I,$-1)),E!==f){L(true),y(E);let A=o&&l==="slide"?E===0?$-1:E===$+1?0:E-1:E;d==null||d(A),setTimeout(()=>L(false),x);}},[f,$,o,R,x,l,d]);le.useEffect(()=>{!o||R||l!=="slide"||(f===0?setTimeout(()=>{S(true),y($),setTimeout(()=>S(false),50);},x):f===$+1&&setTimeout(()=>{S(true),y(1),setTimeout(()=>S(false),50);},x));},[f,$,o,R,x,l]);let de=le.useCallback(()=>{Y(f+1);},[f,Y]),Le=le.useCallback(()=>{Y(f-1);},[f,Y]),gt=le.useCallback(()=>{B(I=>!I);},[]);le.useCallback(()=>{B(false);},[]);le.useCallback(()=>{B(true);},[]);le.useEffect(()=>{if(!e||T||N||q)return;let I=setInterval(de,r);return ()=>clearInterval(I)},[e,r,T,N,de,q]);let ft=I=>{O(I.targetTouches[0].clientX);},bt=I=>{Q(I.targetTouches[0].clientX);},ht=()=>{if(!U||!F)return;let I=U-F;Math.abs(I)>=50&&(I>0?de():Le()),O(null),Q(null);};le.useEffect(()=>{let I=A=>{A.key==="ArrowLeft"?Le():A.key==="ArrowRight"&&de();},E=K.current;return E==null||E.addEventListener("keydown",I),()=>E==null?void 0:E.removeEventListener("keydown",I)},[de,Le]);let Ot=()=>{let I=q||k?0:x,E=V(f);switch(l){case "fade":return le__default.default.Children.map(t,(A,G)=>jsxRuntime.jsx("div",{className:i("absolute inset-0 w-full h-full",G===E?"z-10":"z-0"),style:{opacity:G===E?1:0,transition:`opacity ${I}ms ease-in-out`},children:A},G));case "scale":return le__default.default.Children.map(t,(A,G)=>jsxRuntime.jsx("div",{className:i("absolute inset-0 w-full h-full",G===E?"z-10":"z-0"),style:{opacity:G===E?1:0,transform:`scale(${G===E?1:.9})`,transition:`opacity ${I}ms ease-in-out, transform ${I}ms ease-in-out`},children:A},G));default:{let A=le__default.default.Children.toArray(t);return (o?[A[A.length-1],...A,A[0]]:A).map((te,ue)=>jsxRuntime.jsx("div",{className:"absolute inset-0 w-full h-full",style:{transform:`translateX(${(ue-f)*100}%)`,transition:k?"none":`transform ${I}ms ease-in-out`},children:te},ue))}}},et=()=>{if(s==="none")return null;let I=c.includes("inside"),E=c.includes("top"),A=V(f),G=i("flex items-center justify-center gap-2",I?i("absolute left-1/2 -translate-x-1/2 z-20",E?"top-4":"bottom-4"):i("mt-4",E&&"order-first mb-4 mt-0")),te=ue=>{Y(o&&l==="slide"?ue+1:ue);};return jsxRuntime.jsx("div",{className:G,role:"tablist",children:Array.from({length:$},(ue,se)=>{let be=se===A;switch(s){case "bars":return jsxRuntime.jsx("button",{onClick:()=>te(se),className:i("h-1 rounded-full transition-all duration-300",be?"w-8 bg-white":"w-4 bg-white/50 hover:bg-white/70"),role:"tab","aria-selected":be,"aria-label":`\uC2AC\uB77C\uC774\uB4DC ${se+1}`},se);case "numbers":return jsxRuntime.jsx("button",{onClick:()=>te(se),className:i("w-8 h-8 rounded-full text-sm font-medium transition-all duration-300",be?"bg-white text-gray-900":"bg-white/30 text-white hover:bg-white/50"),role:"tab","aria-selected":be,"aria-label":`\uC2AC\uB77C\uC774\uB4DC ${se+1}`,children:se+1},se);default:return jsxRuntime.jsx("button",{onClick:()=>te(se),className:i("w-2.5 h-2.5 rounded-full transition-all duration-300",be?"bg-white scale-125":"bg-white/50 hover:bg-white/70"),role:"tab","aria-selected":be,"aria-label":`\uC2AC\uB77C\uC774\uB4DC ${se+1}`},se)}})})},xt=()=>{if(!m||!e)return null;let I=!N;return jsxRuntime.jsx("button",{onClick:gt,className:i("absolute bottom-4 z-20","w-8 h-8 rounded-full flex items-center justify-center","bg-white/80 hover:bg-white text-gray-800","transition-all duration-200","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white",{left:"left-4",center:"left-1/2 -translate-x-1/2",right:"right-4"}[v]),"aria-label":I?"\uC77C\uC2DC\uC815\uC9C0":"\uC7AC\uC0DD",children:I?jsxRuntime.jsx(oa,{className:"w-4 h-4"}):jsxRuntime.jsx(ra,{className:"w-4 h-4"})})},vt=()=>{if(!b||g==="hidden")return null;let I=o||f>0,E=o||f<$-1,A=i("absolute top-1/2 -translate-y-1/2 z-20","w-10 h-10 rounded-full flex items-center justify-center","bg-white/80 hover:bg-white text-gray-800","transition-all duration-200","disabled:opacity-30 disabled:cursor-not-allowed","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white"),G=g==="outside"?"-left-14":"left-4",te=g==="outside"?"-right-14":"right-4";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:Le,disabled:!I,className:i(A,G),"aria-label":"\uC774\uC804 \uC2AC\uB77C\uC774\uB4DC",children:jsxRuntime.jsx(ea,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:de,disabled:!E,className:i(A,te),"aria-label":"\uB2E4\uC74C \uC2AC\uB77C\uC774\uB4DC",children:jsxRuntime.jsx(ta,{className:"w-5 h-5"})})]})};return jsxRuntime.jsxs("div",{ref:p,className:i("flex flex-col w-full h-full",g==="outside"&&"px-16",u),style:a,...h,children:[jsxRuntime.jsxs("div",{ref:K,className:"relative overflow-hidden w-full flex-1",onMouseEnter:()=>n&&w(true),onMouseLeave:()=>n&&w(false),onTouchStart:ft,onTouchMove:bt,onTouchEnd:ht,tabIndex:0,role:"region","aria-roledescription":"carousel","aria-label":"\uC774\uBBF8\uC9C0 \uC2AC\uB77C\uC774\uB354",children:[Ot(),vt(),xt(),c.includes("inside")&&et()]}),!c.includes("inside")&&et()]})});_r.displayName="Carousel";function Jn(){let[t,e]=le.useState(false);return le.useEffect(()=>{let r=window.matchMedia("(prefers-reduced-motion: reduce)");e(r.matches);let o=n=>{e(n.matches);};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),t}function ea({className:t}){return jsxRuntime.jsx("svg",{className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function ta({className:t}){return jsxRuntime.jsx("svg",{className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}function ra({className:t}){return jsxRuntime.jsx("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M8 5v14l11-7z"})})}function oa({className:t}){return jsxRuntime.jsx("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})})}var sa=classVarianceAuthority.cva("rounded-lg",{variants:{variant:{default:"bg-card text-card-foreground border border-border",outline:"bg-transparent border-2 border-border",elevated:"bg-card text-card-foreground shadow-lg border border-border"},shadow:{none:"shadow-none",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg"},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6"}},defaultVariants:{variant:"default",padding:"none"}}),ot=le__default.default.forwardRef(({className:t,variant:e="default",shadow:r,padding:o="none",hoverable:n,...s},c)=>jsxRuntime.jsx("div",{ref:c,className:i(sa({variant:e,shadow:r,padding:o}),"transition-[transform,box-shadow,border-color] duration-200 ease-out",n&&"hover:-translate-y-0.5 hover:shadow-lg hover:border-primary/30 cursor-pointer active:translate-y-0 active:shadow-md",t),...s}));ot.displayName="Card";var Kt=le__default.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("div",{ref:r,className:i("flex flex-col space-y-1 p-3",t),...e}));Kt.displayName="CardHeader";var Qt=le__default.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("h3",{ref:r,className:i("text-base md:text-lg font-semibold leading-tight tracking-tight",t),...e}));Qt.displayName="CardTitle";var Jt=le__default.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("p",{ref:r,className:i("text-sm text-muted-foreground",t),...e}));Jt.displayName="CardDescription";var nt=le__default.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("div",{ref:r,className:i("px-3 pb-3",t),...e}));nt.displayName="CardContent";var ia=le__default.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("div",{ref:r,className:i("flex items-center px-3 pb-3",t),...e}));ia.displayName="CardFooter";var ca=classVarianceAuthority.cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2",{variants:{variant:{default:"bg-[var(--badge-default-bg)] text-[var(--badge-default-text)] hover:opacity-80",secondary:"bg-[var(--badge-secondary-bg)] text-[var(--badge-secondary-text)] hover:opacity-80",destructive:"bg-[var(--badge-destructive-bg)] text-slate-50 hover:opacity-80",error:"bg-[var(--badge-destructive-bg)] text-slate-50 hover:opacity-80",outline:"bg-transparent text-[var(--badge-outline-text)] border border-[var(--badge-outline-border)] hover:bg-[var(--badge-outline-hover-bg)]",glass:"bg-[var(--badge-glass-bg)] backdrop-blur-sm border border-[var(--badge-glass-border)] text-[var(--badge-glass-text)] hover:opacity-80"}},defaultVariants:{variant:"default"}}),xe=le__default.default.memo(le__default.default.forwardRef(({className:t,variant:e="default",...r},o)=>jsxRuntime.jsx("div",{ref:o,className:i(ca({variant:e}),t),...r})));xe.displayName="Badge";function kt(t){return t.toLowerCase().replace(/[^a-z0-9가-힣ぁ-んァ-ン一-龯_.~\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").trim()}function jr(t){return !t||t.length===0||t.length>200?false:/^[a-z0-9가-힣ぁ-んァ-ン一-龯_.~-]+$/.test(t)}function Ct(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9가-힣ぁ-んァ-ン一-龯_.~-]/g,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}var pa={pageTitle:"\uC0C8 \uAE00 \uC791\uC131",editTitle:"\uAE00 \uC218\uC815",preview:"\uBBF8\uB9AC\uBCF4\uAE30",editMode:"\uD3B8\uC9D1",basicInfo:"\uAE30\uBCF8 \uC815\uBCF4",slug:"\uC2AC\uB7EC\uADF8",slugPrefix:"/blog/",tags:"\uD0DC\uADF8",tagsPlaceholder:"\uAC1C\uBC1C, \uC77C\uC0C1, \uC5C5\uB370\uC774\uD2B8",coverImage:"\uCEE4\uBC84 \uC774\uBBF8\uC9C0 URL",coverImagePlaceholder:"https://example.com/image.jpg",publishDate:"\uBC1C\uD589 \uC608\uC57D\uC77C\uC2DC",publishDateHint:"\uBE44\uC6CC\uB450\uBA74 \uC989\uC2DC \uBC1C\uD589\uB428",expiresAt:"\uB9CC\uB8CC \uC77C\uC2DC",expiresAtHint:"\uBE44\uC6CC\uB450\uBA74 \uB9CC\uB8CC\uB418\uC9C0 \uC54A\uC74C",titleLabel:"\uC81C\uBAA9",titlePlaceholder:"\uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694",excerpt:"\uC694\uC57D",excerptPlaceholder:"\uCE74\uB4DC\uC5D0 \uD45C\uC2DC\uB420 \uC9E7\uC740 \uC694\uC57D",contentLabel:"\uBCF8\uBB38",contentPlaceholder:"\uB9C8\uD06C\uB2E4\uC6B4\uC73C\uB85C \uC791\uC131\uD558\uC138\uC694...",cancel:"\uCDE8\uC18C",saveDraft:"\uC784\uC2DC\uC800\uC7A5",publish:"\uBC1C\uD589",update:"\uC218\uC815 \uC644\uB8CC",saving:"\uC800\uC7A5 \uC911...",translateHint:"AI \uBC88\uC5ED \uAE30\uB2A5",translateButton:"AI \uBC88\uC5ED",translating:"\uBC88\uC5ED \uC911...",translateSuccess:"\uBC88\uC5ED \uC644\uB8CC!",requiredFields:"\uD544\uC218 \uD544\uB4DC\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694",saveError:"\uC800\uC7A5 \uC911 \uC624\uB958 \uBC1C\uC0DD",translateError:"\uBC88\uC5ED \uC911 \uC624\uB958 \uBC1C\uC0DD",noTitle:"\uC81C\uBAA9 \uC5C6\uC74C",bold:"\uAD75\uAC8C",italic:"\uAE30\uC6B8\uC784",strikethrough:"\uCDE8\uC18C\uC120",heading:"\uC81C\uBAA9",link:"\uB9C1\uD06C",image:"\uC774\uBBF8\uC9C0",code:"\uCF54\uB4DC",codeBlock:"\uCF54\uB4DC\uBE14\uB85D",quote:"\uC778\uC6A9\uBB38",list:"\uBAA9\uB85D",orderedList:"\uC21C\uC11C \uBAA9\uB85D",horizontalRule:"\uC218\uD3C9\uC120"},ga={enableSlug:true,enableTags:true,enableCoverImage:true,enablePublishDate:true,enableExcerpt:true,enableTranslation:true,enablePreview:true,enableMarkdownToolbar:true,enableAutoSave:true,enableExpiresAt:false},fa=[{key:"ko",label:"\uD55C\uAD6D\uC5B4",isPrimary:true,flag:"\u{1F1F0}\u{1F1F7}"},{key:"en",label:"English",flag:"\u{1F1FA}\u{1F1F8}"},{key:"ja",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"}];function tr(t){let e={};return t.forEach(r=>{e[r.key]="";}),e}function ba(t,e){var r,o,n,s,c,b,g,l;return {slug:(r=e==null?void 0:e.slug)!=null?r:"",title:(o=e==null?void 0:e.title)!=null?o:tr(t),excerpt:(n=e==null?void 0:e.excerpt)!=null?n:tr(t),content:(s=e==null?void 0:e.content)!=null?s:tr(t),tags:(c=e==null?void 0:e.tags)!=null?c:[],coverImage:(b=e==null?void 0:e.coverImage)!=null?b:"",publishedAt:(g=e==null?void 0:e.publishedAt)!=null?g:null,expiresAt:(l=e==null?void 0:e.expiresAt)!=null?l:null}}var Yr=le.createContext(null);function Z(){let t=le.useContext(Yr);if(!t)throw new Error("useBlogEditor must be used within a BlogEditorProvider");return t}function Tt({children:t,initialData:e,isEditMode:r=false,languages:o=fa,defaultLanguage:n,labels:s,callbacks:c,features:b,variant:g="default",autoSaveKey:l,autoSaveInterval:x=3e3}){var et,xt,vt,I;let d=(I=(vt=(et=o.find(E=>E.isPrimary))==null?void 0:et.key)!=null?vt:(xt=o[0])==null?void 0:xt.key)!=null?I:"ko",m=n!=null?n:d,v=le.useMemo(()=>({...pa,...s}),[s]),u=le.useMemo(()=>({...ga,...b}),[b]),[a,h]=le.useState(()=>ba(o,e)),[p,C]=le.useState(m),[f,y]=le.useState(false),[T,w]=le.useState(false),[N,B]=le.useState(false),[R,L]=le.useState(false),[k,S]=le.useState(null),[U,O]=le.useState(false),[F,Q]=le.useState(r||!!(e!=null&&e.slug)),[K,$]=le.useState("idle"),q=le.useRef(null),V=le.useRef(true),Y=l||(r?null:"blog-editor-draft");le.useEffect(()=>{if(!(!u.enableAutoSave||!Y||r))try{let E=localStorage.getItem(Y);if(E){let A=JSON.parse(E);h(A);}}catch{}},[]),le.useEffect(()=>{if(!(!u.enableAutoSave||!Y)){if(V.current){V.current=false;return}return q.current&&clearTimeout(q.current),$("saving"),q.current=setTimeout(()=>{try{localStorage.setItem(Y,JSON.stringify(a)),$("saved"),setTimeout(()=>$("idle"),2e3);}catch{$("idle");}},x),()=>{q.current&&clearTimeout(q.current);}}},[a,u.enableAutoSave,Y,x]);let de=le.useCallback(()=>{if(Y)try{localStorage.removeItem(Y);}catch{}},[Y]),Le=le.useCallback((E,A)=>{h(G=>({...G,[E]:A}));},[]),gt=le.useCallback((E,A,G)=>{h(te=>({...te,[E]:{...te[E],[A]:G}}));},[]),$t=le.useCallback(E=>kt(E),[]),zt=le.useCallback(async E=>{let A=a.title[d],G=a.content[d];if(!A||!G){S(v.requiredFields);return}if(u.enableSlug&&!a.slug){S(v.requiredFields);return}w(true),S(null);try{await c.onSave(a,E),de();}catch{S(v.saveError);}finally{w(false);}},[a,d,v,u,c,de]),ft=le.useCallback(async()=>{if(!c.onTranslate)return;let E=a.title[d],A=a.content[d],G=a.excerpt[d];if(!E||!A){S(v.requiredFields);return}B(true),S(null),O(false);try{let te=await c.onTranslate({sourceLanguage:d,title:E,content:A,excerpt:G||void 0});h(ue=>{let se={...ue.title},be={...ue.content},yr={...ue.excerpt};return Object.keys(te).forEach(tt=>{if(tt!==d){let Ft=te[tt];if(typeof Ft=="object"&&Ft!==null){let He=Ft;He.title&&(se[tt]=He.title),He.content&&(be[tt]=He.content),He.excerpt&&(yr[tt]=He.excerpt);}}}),{...ue,title:se,content:be,excerpt:yr}}),O(!0),setTimeout(()=>O(!1),3e3);}catch{S(v.translateError);}finally{B(false);}},[a,d,v,c]),bt=le.useCallback(async E=>{if(!c.onUploadImage)return null;L(true),S(null);try{return await c.onUploadImage(E)}catch{return S("\uC774\uBBF8\uC9C0 \uC5C5\uB85C\uB4DC \uC2E4\uD328"),null}finally{L(false);}},[c]),ht=le.useCallback(()=>{var E;(E=c.onCancel)==null||E.call(c);},[c]),Ot=le.useMemo(()=>({formData:a,activeLanguage:p,showPreview:f,submitting:T,translating:N,uploading:R,error:k,translateSuccess:U,autoSaveStatus:K,languages:o,features:u,labels:v,variant:g,isEditMode:r,setActiveLanguage:C,setShowPreview:y,updateField:Le,updateMultilingualField:gt,handleSave:zt,handleTranslate:ft,handleUploadImage:bt,handleCancel:ht,setError:S,generateSlug:$t,slugManuallyEdited:F,setSlugManuallyEdited:Q}),[a,p,f,T,N,R,k,U,K,o,u,v,g,r,Le,gt,zt,ft,bt,ht,$t,F,Q]);return jsxRuntime.jsx(Yr.Provider,{value:Ot,children:t})}var ro={home:ssr.House,arrowLeft:ssr.ArrowLeft,arrowRight:ssr.ArrowRight,arrowUp:ssr.ArrowUp,arrowDown:ssr.ArrowDown,menu:ssr.List,close:ssr.X,search:ssr.MagnifyingGlass,settings:ssr.Gear,externalLink:ssr.ArrowSquareOut,chevronLeft:ssr.CaretLeft,chevronRight:ssr.CaretRight,chevronDown:ssr.CaretDown,chevronUp:ssr.CaretUp,edit:ssr.Pencil,delete:ssr.Trash,add:ssr.Plus,remove:ssr.Minus,download:ssr.Download,upload:ssr.Upload,refresh:ssr.ArrowClockwise,save:ssr.FloppyDisk,copy:ssr.Copy,loader:ssr.SpinnerGap,success:ssr.CheckCircle,error:ssr.XCircle,alertCircle:ssr.WarningCircle,warning:ssr.WarningCircle,info:ssr.Info,check:ssr.Check,circle:ssr.Circle,helpCircle:ssr.Question,user:ssr.User,users:ssr.Users,userPlus:ssr.UserPlus,logIn:ssr.SignIn,logOut:ssr.SignOut,eye:ssr.Eye,eyeOff:ssr.EyeSlash,chart:ssr.ChartBar,barChart:ssr.ChartBar,trendingUp:ssr.TrendUp,activity:ssr.Pulse,database:ssr.Database,zap:ssr.Lightning,fileText:ssr.FileText,file:ssr.File,folder:ssr.Folder,book:ssr.Book,bookOpen:ssr.BookOpen,mail:ssr.Envelope,message:ssr.ChatCircle,phone:ssr.Phone,image:ssr.Image,video:ssr.Video,camera:ssr.Camera,smile:ssr.Smiley,frown:ssr.SmileySad,meh:ssr.SmileyMeh,lock:ssr.Lock,unlock:ssr.LockOpen,shield:ssr.Shield,wallet:ssr.Wallet,key:ssr.Key,clock:ssr.Clock,calendar:ssr.Calendar,calendarPlus:ssr.CalendarPlus,bell:ssr.Bell,heart:ssr.Heart,star:ssr.Star,bookmark:ssr.Bookmark,share:ssr.Share,monitor:ssr.Monitor,sun:ssr.Sun,moon:ssr.Moon,lightbulb:ssr.Lightbulb,brain:ssr.Brain,flag:ssr.Flag,square:ssr.Square,sparkle:ssr.Sparkle,sparkles:ssr.Sparkle,globe:ssr.Globe,smartphone:ssr.DeviceMobile,deviceMobile:ssr.DeviceMobile,floppyDisk:ssr.FloppyDisk,ticket:ssr.Ticket,clipboard:ssr.Clipboard,wifi:ssr.WifiHigh,wifiOff:ssr.WifiSlash,cpu:ssr.Cpu,mask:ssr.MaskHappy,bold:ssr.TextB,italic:ssr.TextItalic,strikethrough:ssr.TextStrikethrough,heading:ssr.TextHOne,link:ssr.Link,code:ssr.Code,fileCode:ssr.FileCode,quote:ssr.Quotes,list:ssr.List,listOrdered:ssr.ListNumbers,minus:ssr.Minus},oo={happy:"smile",sad:"frown",neutral:"meh",excited:"smile",angry:"frown",love:"heart",like:"heart",dislike:"frown"},no={loading:"loader",success:"success",error:"error",warning:"warning",info:"info",locked:"lock",unlocked:"unlock",visible:"eye",hidden:"eyeOff"};function ao(t){return !t||!/[-_]/.test(t)&&/^[a-z]/.test(t)?t:/^[A-Z]+$/.test(t)?t.toLowerCase():/^[A-Z]/.test(t)&&!/[-_]/.test(t)?t.charAt(0).toLowerCase()+t.slice(1):t.split(/[-_]/).map((e,r)=>r===0?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")}var J=null,ee=null;var so={home:{lucide:"Home",phosphor:"House",iconsax:"Home2"},"layout-dashboard":{lucide:"LayoutDashboard",phosphor:"SquaresFour"},folder:{lucide:"Folder",phosphor:"Folder",iconsax:"Folder"},"alert-circle":{lucide:"AlertCircle",phosphor:"WarningCircle",iconsax:"Danger"},alertCircle:{lucide:"AlertCircle",phosphor:"WarningCircle",iconsax:"Danger"},columns:{lucide:"Columns",phosphor:"Columns"},users:{lucide:"Users",phosphor:"Users",iconsax:"People"},settings:{lucide:"Settings",phosphor:"Gear"},menu:{lucide:"Menu",phosphor:"List",iconsax:"Menu"},close:{lucide:"X",phosphor:"X",iconsax:"CloseCircle"},chevronLeft:{lucide:"ChevronLeft",phosphor:"CaretLeft",iconsax:"ArrowLeft2"},chevronRight:{lucide:"ChevronRight",phosphor:"CaretRight",iconsax:"ArrowRight2"},chevronDown:{lucide:"ChevronDown",phosphor:"CaretDown",iconsax:"ArrowDown2"},chevronUp:{lucide:"ChevronUp",phosphor:"CaretUp",iconsax:"ArrowUp2"},arrowLeft:{lucide:"ArrowLeft",phosphor:"ArrowLeft",iconsax:"ArrowLeft"},arrowRight:{lucide:"ArrowRight",phosphor:"ArrowRight",iconsax:"ArrowRight"},arrowUp:{lucide:"ArrowUp",phosphor:"ArrowUp",iconsax:"ArrowUp"},arrowDown:{lucide:"ArrowDown",phosphor:"ArrowDown",iconsax:"ArrowDown"},add:{lucide:"Plus",phosphor:"Plus",iconsax:"Add"},edit:{lucide:"Edit",phosphor:"Pencil"},pencil:{lucide:"Pencil",phosphor:"Pencil"},delete:{lucide:"Trash2",phosphor:"Trash",iconsax:"Trash"},trash:{lucide:"Trash2",phosphor:"Trash",iconsax:"Trash"},upload:{lucide:"Upload",phosphor:"Upload",iconsax:"Upload"},download:{lucide:"Download",phosphor:"Download",iconsax:"Download"},x:{lucide:"X",phosphor:"X"},check:{lucide:"Check",phosphor:"Check",iconsax:"Check"},search:{lucide:"Search",phosphor:"MagnifyingGlass",iconsax:"SearchNormal"},share:{lucide:"Share",phosphor:"Share"},copy:{lucide:"Copy",phosphor:"Copy"},save:{lucide:"Save",phosphor:"FloppyDisk"},loader:{lucide:"Loader2",phosphor:"Spinner"},loader2:{lucide:"Loader2",phosphor:"Spinner"},"check-circle":{lucide:"CheckCircle",phosphor:"CheckCircle",iconsax:"TickCircle"},checkCircle:{lucide:"CheckCircle",phosphor:"CheckCircle",iconsax:"TickCircle"},success:{lucide:"CheckCircle",phosphor:"CheckCircle",iconsax:"TickCircle"},error:{lucide:"XCircle",phosphor:"XCircle",iconsax:"CloseCircle"},warning:{lucide:"AlertCircle",phosphor:"WarningCircle",iconsax:"Warning2"},info:{lucide:"Info",phosphor:"Info",iconsax:"InfoCircle"},refresh:{lucide:"RefreshCw",phosphor:"ArrowClockwise",iconsax:"Refresh"},refreshCw:{lucide:"RefreshCw",phosphor:"ArrowClockwise",iconsax:"Refresh"},bell:{lucide:"Bell",phosphor:"Bell",iconsax:"Bell"},heart:{lucide:"Heart",phosphor:"Heart",iconsax:"Heart"},star:{lucide:"Star",phosphor:"Star",iconsax:"Star"},bookmark:{lucide:"Bookmark",phosphor:"Bookmark"},user:{lucide:"User",phosphor:"User",iconsax:"User"},userPlus:{lucide:"UserPlus",phosphor:"UserPlus",iconsax:"UserAdd"},logIn:{lucide:"LogIn",phosphor:"SignIn",iconsax:"Login"},logOut:{lucide:"LogOut",phosphor:"SignOut",iconsax:"Logout"},chrome:{lucide:"Chrome",phosphor:"ChromeLogo",iconsax:"Chrome"},github:{lucide:"Github",phosphor:"GithubLogo"},message:{lucide:"MessageCircle",phosphor:"ChatCircle"},messageSquare:{lucide:"MessageSquare",phosphor:"ChatSquare"},"message-square":{lucide:"MessageSquare",phosphor:"ChatSquare"},inbox:{lucide:"Inbox",phosphor:"Inbox"},calendar:{lucide:"Calendar",phosphor:"Calendar"},calendarPlus:{lucide:"CalendarPlus",phosphor:"CalendarPlus"},checkSquare:{lucide:"CheckSquare",phosphor:"CheckSquare",iconsax:"TickSquare"},clock:{lucide:"Clock",phosphor:"Clock"},book:{lucide:"Book",phosphor:"Book",iconsax:"Book"},bookOpen:{lucide:"BookOpen",phosphor:"BookOpen",iconsax:"Book"},monitor:{lucide:"Monitor",phosphor:"Monitor",iconsax:"Monitor"},sun:{lucide:"Sun",phosphor:"Sun",iconsax:"Sun"},moon:{lucide:"Moon",phosphor:"Moon",iconsax:"Moon"},sparkle:{lucide:"Sparkle",phosphor:"Sparkle"},sparkles:{lucide:"Sparkles",phosphor:"Sparkle"},lightbulb:{lucide:"Lightbulb",phosphor:"Lightbulb"},brain:{lucide:"Brain",phosphor:"Brain"},zap:{lucide:"Zap",phosphor:"Lightning"},globe:{lucide:"Globe",phosphor:"Globe",iconsax:"Global"},deviceMobile:{lucide:"Smartphone",phosphor:"DeviceMobile"},smartphone:{lucide:"Smartphone",phosphor:"DeviceMobile"},floppyDisk:{lucide:"Save",phosphor:"FloppyDisk"},chart:{lucide:"BarChart3",phosphor:"ChartBar"},barChart:{lucide:"BarChart",phosphor:"ChartBar"},trendingUp:{lucide:"TrendingUp",phosphor:"TrendUp"},trendingDown:{lucide:"TrendingDown",phosphor:"TrendDown"},activity:{lucide:"Activity",phosphor:"Pulse"},database:{lucide:"Database",phosphor:"Database"},dollarSign:{lucide:"DollarSign",phosphor:"CurrencyDollar"},dollar:{lucide:"DollarSign",phosphor:"CurrencyDollar"},currency:{lucide:"DollarSign",phosphor:"CurrencyDollar"},layers:{lucide:"Layers",phosphor:"Stack"},ban:{lucide:"Ban",phosphor:"Prohibit"},lock:{lucide:"Lock",phosphor:"Lock",iconsax:"Lock"},unlock:{lucide:"Unlock",phosphor:"LockOpen",iconsax:"Unlock"},shield:{lucide:"Shield",phosphor:"Shield",iconsax:"Shield"},key:{lucide:"Key",phosphor:"Key"},play:{lucide:"Play",phosphor:"Play",iconsax:"Play"},pause:{lucide:"Pause",phosphor:"Pause",iconsax:"Pause"},image:{lucide:"Image",phosphor:"Image",iconsax:"Image"},video:{lucide:"Video",phosphor:"Video",iconsax:"Video"},camera:{lucide:"Camera",phosphor:"Camera",iconsax:"Camera"},fileText:{lucide:"FileText",phosphor:"FileText"},file:{lucide:"File",phosphor:"File"},externalLink:{lucide:"ExternalLink",phosphor:"ArrowSquareOut"},link:{lucide:"Link",phosphor:"Link",iconsax:"Link"},moreHorizontal:{lucide:"MoreHorizontal",phosphor:"DotsThreeOutline"},moreVertical:{lucide:"MoreVertical",phosphor:"DotsThreeVertical"},remove:{lucide:"Minus",phosphor:"Minus",iconsax:"Minus"},eye:{lucide:"Eye",phosphor:"Eye",iconsax:"Eye"},eyeOff:{lucide:"EyeOff",phosphor:"EyeSlash",iconsax:"EyeSlash"},smile:{lucide:"Smile",phosphor:"Smiley",iconsax:"EmojiHappy"},frown:{lucide:"Frown",phosphor:"SmileySad",iconsax:"EmojiSad"},meh:{lucide:"Meh",phosphor:"SmileyMeh",iconsax:"EmojiNormal"},mail:{lucide:"Mail",phosphor:"Envelope"},phone:{lucide:"Phone",phosphor:"Phone"},flag:{lucide:"Flag",phosphor:"Flag",iconsax:"Flag"},rocket:{lucide:"Rocket",phosphor:"Rocket",iconsax:"Rocket"},ticket:{lucide:"Ticket",phosphor:"Ticket",iconsax:"Ticket"},clipboard:{lucide:"ClipboardList",phosphor:"Clipboard",iconsax:"Sticker"},wifi:{lucide:"Wifi",phosphor:"WifiHigh",iconsax:"Wifi"},wifiOff:{lucide:"WifiOff",phosphor:"WifiSlash"},cpu:{lucide:"Cpu",phosphor:"Cpu",iconsax:"Computing"},mask:{lucide:"Drama",phosphor:"MaskHappy",iconsax:"EmojiHappy"},bold:{lucide:"Bold",phosphor:"TextB"},italic:{lucide:"Italic",phosphor:"TextItalic"},strikethrough:{lucide:"Strikethrough",phosphor:"TextStrikethrough"},heading:{lucide:"Heading",phosphor:"TextHOne"},code:{lucide:"Code",phosphor:"Code",iconsax:"Code"},fileCode:{lucide:"FileCode",phosphor:"FileCode"},quote:{lucide:"Quote",phosphor:"Quotes",iconsax:"QuoteUp"},list:{lucide:"List",phosphor:"List"},listOrdered:{lucide:"ListOrdered",phosphor:"ListNumbers"},minus:{lucide:"Minus",phosphor:"Minus",iconsax:"Minus"}};async function io(){if(typeof window=="undefined")return null;if(!J)try{J=await import('@phosphor-icons/react');}catch{return console.warn("Phosphor Icons not available. Install @phosphor-icons/react to use."),null}return J}async function lo(){if(typeof window=="undefined")return null;if(!ee)try{ee=await import('lucide-react');}catch{return console.warn("Lucide Icons not available. Install lucide-react to use lucide provider."),null}return ee}function Et(t,e="phosphor"){let r=so[t];if(!r)return ei(t,e);let o=r[e];switch(e){case "phosphor":return !o||!J?null:(J==null?void 0:J[o])||null;case "lucide":return !o||!ee?null:(ee==null?void 0:ee[o])||null;case "iconsax":{return null;}default:return null}}function ei(t,e){switch(e){case "phosphor":{if(!J)return null;let r=t.charAt(0).toUpperCase()+t.slice(1),o=t.split(/(?=[A-Z])/).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("");return (J==null?void 0:J[r])||(J==null?void 0:J[o])||(J==null?void 0:J[t])||null}case "lucide":{if(!ee)return null;let r=t.charAt(0).toUpperCase()+t.slice(1),o=t.replace(/([A-Z])/g,n=>n===t[0]?n.toLowerCase():n);return (ee==null?void 0:ee[r])||(ee==null?void 0:ee[t])||(ee==null?void 0:ee[o])||null}case "iconsax":{return null;}default:return null}}function co(t,e){let r=so[t];if(r){let o=r[e];if(o)return o}return t}var or={"arrow-left":"arrowLeft","arrow-right":"arrowRight","arrow-up":"arrowUp","arrow-down":"arrowDown","chevron-left":"chevronLeft","chevron-right":"chevronRight","chevron-up":"chevronUp","chevron-down":"chevronDown","external-link":"externalLink","more-horizontal":"moreHorizontal","more-vertical":"moreVertical","user-plus":"userPlus","log-in":"logIn","log-out":"logOut","check-circle":"checkCircle","check-square":"checkSquare","alert-circle":"alertCircle","eye-off":"eyeOff","file-text":"fileText","book-open":"bookOpen","bar-chart":"barChart","trending-up":"trendingUp","trending-down":"trendingDown","message-square":"messageSquare","calendar-plus":"calendarPlus","refresh-cw":"refreshCw","dollar-sign":"dollarSign","layout-dashboard":"layoutDashboard","device-mobile":"deviceMobile","floppy-disk":"floppyDisk",back:"arrowLeft",prev:"arrowLeft",previous:"arrowLeft",forward:"arrowRight",next:"arrowRight",close:"x",cancel:"x",remove:"delete",trash:"delete",plus:"add",new:"add",pencil:"edit",modify:"edit",store:"save",floppy:"save",magnify:"search",person:"user",account:"user",profile:"user",gear:"settings",config:"settings",preferences:"settings",house:"home",main:"home",done:"check",complete:"check",tick:"check",information:"info",help:"info",alert:"warning",caution:"warning",checkmark:"success",checkCircle:"success",fail:"error",cross:"error",xCircle:"error",spinner:"loader",loading:"loader",wait:"loader",reload:"refresh",update:"refresh",sync:"refresh",show:"eye",view:"eye",hide:"eyeOff",hidden:"eyeOff",secure:"lock",locked:"lock",unsecure:"unlock",unlocked:"unlock",get:"download",fetch:"download",post:"upload",send:"share",export:"share",duplicate:"copy",clone:"copy",email:"mail",envelope:"mail",chat:"message",comment:"message",talk:"message",date:"calendar",schedule:"calendar",time:"clock",watch:"clock",document:"fileText",doc:"fileText",text:"fileText",directory:"folder",dir:"folder",picture:"image",img:"image",movie:"video",film:"video",photo:"camera",capture:"camera",start:"play",run:"play",stop:"pause",halt:"pause",like:"heart",love:"heart",favorite:"star",saveBookmark:"bookmark",notification:"bell",notify:"bell",alarm:"bell",prefs:"settings",lookup:"search",dots:"moreHorizontal",moreMenu:"moreHorizontal",moreOptions:"moreVertical",external:"externalLink",outbound:"externalLink",open:"externalLink",url:"link",hyperlink:"link",graph:"barChart",stats:"barChart",analytics:"barChart",db:"database",storage:"database",pulse:"activity",monitor:"activity",up:"trendingUp",down:"trendingDown",lightning:"zap",bolt:"zap",flash:"zap",security:"shield",protect:"shield",password:"key",secret:"key",signin:"logIn",login:"logIn",enter:"logIn",signout:"logOut",logout:"logOut",exit:"logOut",people:"users",group:"users",team:"users",addUser:"userPlus",invite:"userPlus",read:"book",library:"book",reading:"bookOpen",openBook:"bookOpen",light:"sun",day:"sun",dark:"moon",night:"moon",screen:"monitor",display:"monitor",ai:"brain",intelligence:"brain",think:"brain",idea:"lightbulb",bulb:"lightbulb",inspiration:"lightbulb",magic:"sparkles",stars:"sparkles",glitter:"sparkles"};function uo(t){if(!t||typeof t!="string")return {normalized:t||"",wasAlias:false};let e=ao(t),r=or[t]||or[e];return r?{normalized:r,wasAlias:true,originalAlias:t}:{normalized:e,wasAlias:false}}var mo={set:"lucide",weight:"regular",size:20,color:"currentColor",strokeWidth:1.25,iconsaxVariant:"line"};var oi=le.createContext(mo);function po(){return le.useContext(oi)}var go=le__default.default.forwardRef(({name:t,size:e,className:r,emotion:o,status:n,provider:s,weight:c,animated:b=false,pulse:g=false,spin:l=false,bounce:x=false,variant:d="default","aria-label":m,"aria-hidden":v},u)=>{var $,q;let a=po(),h=s||a.set,p=e!=null?e:a.size,C=c||a.weight,f=a.color,y=($=a.strokeWidth)!=null?$:1.25,T=(q=a.iconsaxVariant)!=null?q:"line",[w,N]=le__default.default.useState(false),[B,R]=le__default.default.useState(false);le__default.default.useEffect(()=>{N(true),h==="lucide"?lo().then(()=>R(true)):h==="phosphor"?io().then(()=>R(true)):R(true);},[h]);let L=le__default.default.useMemo(()=>{let V=o?oo[o]:n?no[n]:t,{normalized:Y}=uo(V),de=co(Y,h);return {normalized:Y,providerName:de}},[t,o,n,h]),k=L.normalized,S=le__default.default.useMemo(()=>{return null},[h,L.providerName,w,T]),U=Vt({"text-current":d==="default","text-primary":d==="primary","text-muted-foreground":d==="secondary"||d==="muted","text-green-600 dark:text-green-400":d==="success","text-yellow-600 dark:text-yellow-400":d==="warning","text-destructive":d==="error"});if(!w)return jsxRuntime.jsx("span",{style:{width:p,height:p},className:i(U,r),"aria-hidden":v!==void 0?v:true,"aria-label":m});let O=null;if(h==="phosphor"?(O=ro[k]||null,!O&&B&&(O=Et(k,h))):h==="iconsax"?(O=S,O||(O=Et(k,h))):O=Et(k,h),!O)return h==="iconsax"&&true?process.env.NODE_ENV==="development"&&console.warn(`Icon "${k}" \u2014 iconsax resolver not registered. Use HuaProvider with icons.set='iconsax', or add: import '@hua-labs/ui/iconsax'`):console.warn(`Icon "${k}" not found for provider "${h}"`),jsxRuntime.jsx("span",{ref:u,className:i("inline-flex items-center justify-center rounded-full border-2 border-dashed border-border",U,r),style:{width:p,height:p},"aria-label":m||`\uC544\uC774\uCF58\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C: ${k}`,title:`Icon not found: ${k}`,children:jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground","aria-hidden":"true",children:"?"})});let F={size:typeof p=="number"?p:void 0,width:p,height:p,color:f};h==="phosphor"?F.weight=C:F.strokeWidth=y;let Q=Vt({"animate-pulse":g,"animate-spin":l,"animate-bounce":x,"transition-all duration-200 ease-in-out":b}),K={};return m?(K["aria-label"]=m,K["aria-hidden"]=false):v!==void 0?K["aria-hidden"]=v:K["aria-hidden"]=true,jsxRuntime.jsx("span",{ref:u,className:i("inline-flex items-center justify-center",Q,U,r),style:{width:p,height:p},...K,children:O&&le__default.default.createElement(O,{...F,className:U,"aria-hidden":true})})});go.displayName="Icon";var ni=le__default.default.memo(go,(t,e)=>t.name===e.name&&t.size===e.size&&t.className===e.className&&t.emotion===e.emotion&&t.status===e.status&&t.provider===e.provider&&t.animated===e.animated&&t.pulse===e.pulse&&t.spin===e.spin&&t.bounce===e.bounce&&t.variant===e.variant&&t.weight===e.weight&&t["aria-label"]===e["aria-label"]&&t["aria-hidden"]===e["aria-hidden"]),M=ni;M.displayName="Icon";var fo=le__default.default.forwardRef((t,e)=>jsxRuntime.jsx(M,{ref:e,name:"smile",...t}));fo.displayName="EmotionIcon";var bo=le__default.default.forwardRef((t,e)=>jsxRuntime.jsx(M,{ref:e,name:"info",...t}));bo.displayName="StatusIcon";var ho=le__default.default.forwardRef((t,e)=>jsxRuntime.jsx(M,{ref:e,name:"loader",status:"loading",spin:true,"aria-label":"\uB85C\uB529 \uC911",...t}));ho.displayName="LoadingIcon";var xo=le__default.default.forwardRef((t,e)=>jsxRuntime.jsx(M,{ref:e,name:"check",status:"success",variant:"success","aria-label":"\uC131\uACF5",...t}));xo.displayName="SuccessIcon";var vo=le__default.default.forwardRef((t,e)=>jsxRuntime.jsx(M,{ref:e,name:"alertCircle",status:"error",variant:"error","aria-label":"\uC624\uB958",...t}));vo.displayName="ErrorIcon";var $e=le__default.default.forwardRef(({onBack:t,backLink:e,className:r},o)=>{let{labels:n,isEditMode:s,formData:c}=Z();return jsxRuntime.jsx("header",{ref:o,className:i("flex items-center justify-between mb-8",r),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[e||t&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:"p-2 text-muted-foreground hover:text-foreground transition-colors","aria-label":"\uB4A4\uB85C\uAC00\uAE30",children:jsxRuntime.jsx(M,{name:"chevronLeft",size:24})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold text-foreground",children:s?n.editTitle:n.pageTitle}),s&&c.slug&&jsxRuntime.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.slugPrefix,c.slug]})]})]})})});$e.displayName="BlogEditorHeader";var ze=le__default.default.forwardRef(({className:t},e)=>{var y,T;let{formData:r,updateField:o,features:n,labels:s,variant:c,handleUploadImage:b,uploading:g,setSlugManuallyEdited:l}=Z(),[x,d]=le.useState(""),m=le.useRef(null),v=i("rounded-xl p-6 space-y-4",c==="glass"?"bg-white/10 backdrop-blur-sm border border-white/20 dark:bg-background/20 dark:border-border/50":c==="minimal"?"bg-transparent":"bg-background",t),u="w-full px-3 py-2 border border-border rounded-lg bg-background text-foreground focus:ring-1 focus:ring-ring focus:border-transparent transition-colors",a="block text-sm font-medium text-foreground mb-1",h=le.useCallback(w=>{let N=w.trim();N&&!r.tags.includes(N)&&o("tags",[...r.tags,N]),d("");},[r.tags,o]),p=le.useCallback(w=>{o("tags",r.tags.filter(N=>N!==w));},[r.tags,o]),C=le.useCallback(w=>{let N=w.target.value;if(N.includes(",")){let B=N.split(",");B.forEach((R,L)=>{L<B.length-1?h(R):d(R);});}else d(N);},[h]),f=le.useCallback(w=>{w.key==="Enter"?(w.preventDefault(),h(x)):w.key==="Backspace"&&!x&&r.tags.length>0&&p(r.tags[r.tags.length-1]);},[x,r.tags,h,p]);return jsxRuntime.jsxs("div",{ref:e,className:v,children:[jsxRuntime.jsx("h2",{className:"font-semibold text-foreground",children:s.basicInfo}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.enableSlug&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:a,children:[s.slug," *"]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground mr-1 text-sm",children:s.slugPrefix}),jsxRuntime.jsx("input",{type:"text",value:r.slug,onChange:w=>{o("slug",Ct(w.target.value)),l(true);},className:i(u,"flex-1"),placeholder:"my-post-slug"})]})]}),n.enableTags&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:a,children:s.tags}),jsxRuntime.jsxs("div",{className:i("flex flex-wrap items-center gap-2 min-h-[42px] px-3 py-2 border border-border rounded-lg bg-background focus-within:ring-1 focus-within:ring-ring focus-within:border-transparent transition-colors"),children:[r.tags.map(w=>jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary/10 text-primary text-sm rounded-md",children:[w,jsxRuntime.jsx("button",{type:"button",onClick:()=>p(w),className:"hover:text-primary transition-colors","aria-label":`${w} \uD0DC\uADF8 \uC0AD\uC81C`,children:jsxRuntime.jsx(M,{name:"x",size:14})})]},w)),jsxRuntime.jsx("input",{type:"text",value:x,onChange:C,onKeyDown:f,className:"flex-1 min-w-[100px] bg-transparent outline-none text-foreground text-sm",placeholder:r.tags.length===0?s.tagsPlaceholder:"\uD0DC\uADF8 \uCD94\uAC00..."})]}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"\uC27C\uD45C(,) \uB610\uB294 Enter\uB85C \uD0DC\uADF8 \uCD94\uAC00"})]})]}),n.enableCoverImage&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:a,children:s.coverImage}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[r.coverImage&&jsxRuntime.jsxs("div",{className:"relative w-full h-40 rounded-lg overflow-hidden bg-muted",children:[jsxRuntime.jsx("img",{src:r.coverImage,alt:"\uCEE4\uBC84 \uC774\uBBF8\uC9C0 \uBBF8\uB9AC\uBCF4\uAE30",className:"w-full h-full object-cover"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o("coverImage",""),className:"absolute top-2 right-2 p-1.5 bg-red-500 text-white rounded-full hover:bg-red-600 transition-colors","aria-label":"\uC774\uBBF8\uC9C0 \uC0AD\uC81C",children:jsxRuntime.jsx(M,{name:"x",size:14})})]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:r.coverImage,onChange:w=>o("coverImage",w.target.value),className:i(u,"flex-1"),placeholder:s.coverImagePlaceholder}),jsxRuntime.jsx("input",{ref:m,type:"file",accept:"image/*",className:"hidden",onChange:async w=>{var B;let N=(B=w.target.files)==null?void 0:B[0];if(N){let R=await b(N);R&&o("coverImage",R);}w.target.value="";}}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{var w;return (w=m.current)==null?void 0:w.click()},disabled:g,className:"px-3 py-2 border border-border rounded-lg hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",title:"\uC774\uBBF8\uC9C0 \uC5C5\uB85C\uB4DC",children:g?jsxRuntime.jsx(M,{name:"loader",size:20,spin:true}):jsxRuntime.jsx(M,{name:"upload",size:20})})]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.enablePublishDate&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:a,children:s.publishDate}),jsxRuntime.jsx("input",{type:"datetime-local",value:(y=r.publishedAt)!=null?y:"",onChange:w=>o("publishedAt",w.target.value||null),className:u}),jsxRuntime.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s.publishDateHint})]}),n.enableExpiresAt&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:a,children:s.expiresAt}),jsxRuntime.jsx("input",{type:"datetime-local",value:(T=r.expiresAt)!=null?T:"",onChange:w=>o("expiresAt",w.target.value||null),className:u}),jsxRuntime.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s.expiresAtHint})]})]})]})});ze.displayName="BlogEditorMetadata";var Oe=le__default.default.forwardRef(({className:t},e)=>{let{languages:r,activeLanguage:o,setActiveLanguage:n,showPreview:s,setShowPreview:c,features:b,labels:g}=Z();return jsxRuntime.jsxs("div",{ref:e,className:i("flex items-center border-b border-border sticky top-0 z-10 bg-background",t),role:"tablist","aria-label":"\uC5B8\uC5B4 \uC120\uD0DD",children:[jsxRuntime.jsx("div",{className:"flex flex-1",children:r.map(l=>{let x=o===l.key,d=l.isPrimary;return jsxRuntime.jsxs("button",{type:"button",role:"tab","aria-selected":x,"aria-controls":`tabpanel-${l.key}`,id:`tab-${l.key}`,onClick:()=>n(l.key),className:i("flex-1 px-4 py-3 text-sm font-medium transition-colors",x?"bg-primary/10 text-primary border-b-2 border-primary":"text-muted-foreground hover:bg-muted"),children:[l.flag&&jsxRuntime.jsx("span",{className:"mr-1.5",children:l.flag}),l.label,d&&" *"]},l.key)})}),b.enablePreview&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>c(!s),className:"inline-flex items-center gap-1.5 px-3 py-2 mx-2 text-sm border border-border rounded-lg hover:bg-muted transition-colors shrink-0",children:[jsxRuntime.jsx(M,{name:s?"pencil":"eye",size:14}),s?g.editMode:g.preview]})]})});Oe.displayName="BlogEditorLanguageTabs";var Fe=le__default.default.forwardRef(({className:t,textareaRef:e},r)=>{var f;let{formData:o,activeLanguage:n,updateMultilingualField:s,updateField:c,features:b,labels:g,languages:l,generateSlug:x,isEditMode:d,slugManuallyEdited:m}=Z(),v=((f=l.find(y=>y.isPrimary))==null?void 0:f.key)===n,u=l.find(y=>y.key===n),a="w-full px-3 py-2 border border-border rounded-lg bg-background text-foreground focus:ring-1 focus:ring-ring focus:border-transparent transition-colors",h="block text-sm font-medium text-foreground mb-1",p=y=>{s("title",n,y),n==="en"&&!d&&!m&&c("slug",x(y));},C=y=>v?`${y} *`:`${y} (${(u==null?void 0:u.label)||n})`;return jsxRuntime.jsxs("div",{ref:r,className:i("p-6 space-y-4",t),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:h,children:C(g.titleLabel)}),jsxRuntime.jsx("input",{type:"text",value:o.title[n]||"",onChange:y=>p(y.target.value),className:a,placeholder:g.titlePlaceholder})]}),b.enableExcerpt&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:h,children:C(g.excerpt)}),jsxRuntime.jsx("textarea",{value:o.excerpt[n]||"",onChange:y=>s("excerpt",n,y.target.value),rows:2,className:i(a,"resize-none"),placeholder:g.excerptPlaceholder})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:h,children:[C(g.contentLabel)," (\uB9C8\uD06C\uB2E4\uC6B4)"]}),jsxRuntime.jsx("textarea",{ref:e,value:o.content[n]||"",onChange:y=>s("content",n,y.target.value),rows:15,className:i(a,"font-mono text-sm resize-y min-h-[300px]"),placeholder:g.contentPlaceholder})]})]})});Fe.displayName="BlogEditorContent";function ui(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Lt(t){if(!t)return "";let e=t;return e=e.replace(/```(\w*)\n?([\s\S]*?)```/g,(r,o,n)=>`<pre class="bg-gray-100 dark:bg-gray-800 rounded-lg p-4 overflow-x-auto my-4"><code class="text-sm">${ui(n.trim())}</code></pre>`),e=e.replace(/`([^`]+)`/g,'<code class="bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded text-sm">$1</code>'),e=e.replace(/^######\s+(.+)$/gm,'<h6 class="text-base font-semibold mt-4 mb-2">$1</h6>'),e=e.replace(/^#####\s+(.+)$/gm,'<h5 class="text-lg font-semibold mt-4 mb-2">$1</h5>'),e=e.replace(/^####\s+(.+)$/gm,'<h4 class="text-xl font-semibold mt-5 mb-2">$1</h4>'),e=e.replace(/^###\s+(.+)$/gm,'<h3 class="text-2xl font-semibold mt-5 mb-3">$1</h3>'),e=e.replace(/^##\s+(.+)$/gm,'<h2 class="text-2xl font-bold mt-6 mb-3">$1</h2>'),e=e.replace(/^#\s+(.+)$/gm,'<h1 class="text-3xl font-bold mt-6 mb-4">$1</h1>'),e=e.replace(/^---+$/gm,'<hr class="my-6 border-gray-300 dark:border-gray-600" />'),e=e.replace(/^>\s+(.+)$/gm,'<blockquote class="border-l-4 border-gray-300 dark:border-gray-600 pl-4 my-4 italic text-gray-600 dark:text-gray-400">$1</blockquote>'),e=e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\*(.+?)\*/g,"<em>$1</em>"),e=e.replace(/~~(.+?)~~/g,'<del class="text-gray-500">$1</del>'),e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" class="text-cyan-600 hover:text-cyan-700 dark:text-cyan-400 dark:hover:text-cyan-300 underline" target="_blank" rel="noopener noreferrer">$1</a>'),e=e.replace(/^[-*]\s+(.+)$/gm,'<li class="ml-4">$1</li>'),e=e.replace(/(<li[^>]*>.*<\/li>\n?)+/g,r=>`<ul class="list-disc list-inside my-4 space-y-1">${r}</ul>`),e=e.replace(/\n(?!<)/g,`<br />
76
76
  `),e=e.replace(/(<br \/>[\n\s]*){3,}/g,`<br /><br />
77
77
  `),e}function ir(t){return t?t.replace(/```[\s\S]*?```/g,"").replace(/`[^`]+`/g,"").replace(/^#{1,6}\s+/gm,"").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/~~(.+?)~~/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^[-*]\s+/gm,"").replace(/^>\s+/gm,"").replace(/^---+$/gm,"").replace(/\n{3,}/g,`
78
78