import{k as I,j as v,t as Q,h as Y,m as f,n as $,p as l,i as G,v as j,x as E,A as _,s as J}from"./web.Os7kOAdY.js";import{c as K}from"./clipboard.BNxbz_oK.js";import{g as O,t as V}from"./i18n-runtime._BAkvU05.js";var X=_('<div class=panel style=display:flex;flex-direction:column;gap:14px><div class=tool-field><span class=tool-label></span><textarea class="tool-textarea is-wrap"></textarea><span class=tool-hint><!$><!/><!$><!/> <!$><!/></span></div><table class=tool-table><thead><tr><th></th><th></th><th></th></tr></thead><tbody></tbody></table><p class=tool-hint>'),ee=_('<tr><td><strong></strong></td><td style=font-family:ui-monospace,monospace></td><td><button class="tool-btn is-ghost">'),te=_("<span class=tool-hint>");function le(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/[^A-Za-z0-9\u4e00-\u9fff]+/g," ").trim();return t?t.split(/\s+/):[]}const ae=[{key:"camel",name:"camelCase",example:"helloWorldFoo",fn:e=>e.map((t,a)=>a===0?t.toLowerCase():s(t)).join("")},{key:"pascal",name:"PascalCase",example:"HelloWorldFoo",fn:e=>e.map(s).join("")},{key:"snake",name:"snake_case",example:"hello_world_foo",fn:e=>e.map(t=>t.toLowerCase()).join("_")},{key:"constant",name:"CONSTANT_CASE",example:"HELLO_WORLD_FOO",fn:e=>e.map(t=>t.toUpperCase()).join("_")},{key:"kebab",name:"kebab-case",example:"hello-world-foo",fn:e=>e.map(t=>t.toLowerCase()).join("-")},{key:"header",name:"Header-Case",example:"Hello-World-Foo",fn:e=>e.map(s).join("-")},{key:"dot",name:"dot.case",example:"hello.world.foo",fn:e=>e.map(t=>t.toLowerCase()).join(".")},{key:"path",name:"path/case",example:"hello/world/foo",fn:e=>e.map(t=>t.toLowerCase()).join("/")},{key:"sentence",name:"Sentence case",example:"Hello world foo",fn:e=>e.length?s(e[0].toLowerCase())+(e.length>1?" "+e.slice(1).map(t=>t.toLowerCase()).join(" "):""):""},{key:"title",name:"Title Case",example:"Hello World Foo",fn:e=>e.map(s).join(" ")},{key:"upper",name:"UPPER CASE",example:"HELLO WORLD FOO",fn:e=>e.map(t=>t.toUpperCase()).join(" ")},{key:"lower",name:"lower case",example:"hello world foo",fn:e=>e.map(t=>t.toLowerCase()).join(" ")}];function s(e){return e&&e[0].toUpperCase()+e.slice(1).toLowerCase()}function ie(){const[e,t]=v(O(),{equals:!1}),a=o=>V(o,e());Q(()=>{const o=i=>{const n=i.detail?.locale;n&&t(n)};window.addEventListener("taitan:locale-change",o),t(O()),J(()=>window.removeEventListener("taitan:locale-change",o))});const[x,A]=v("helloWorld foo_bar BazQux"),h=Y(()=>le(x()));return(()=>{var o=f(X),i=o.firstChild,n=i.firstChild,c=n.nextSibling,r=c.nextSibling,H=r.firstChild,[g,T]=$(H.nextSibling),W=g.nextSibling,[u,F]=$(W.nextSibling),z=u.nextSibling,N=z.nextSibling,[P,R]=$(N.nextSibling),C=i.nextSibling,b=C.firstChild,U=b.firstChild,k=U.firstChild,Z=k.nextSibling,M=b.nextSibling,D=C.nextSibling;return l(n,()=>a("输入")),c.$$input=p=>A(p.currentTarget.value),l(r,()=>a("识别到"),g,T),l(r,()=>h().length,u,F),l(r,()=>a("个词块"),P,R),l(k,()=>a("风格")),l(Z,()=>a("结果")),l(M,()=>ae.map(p=>{const m=p.fn(h());return(()=>{var y=f(ee),S=y.firstChild,q=S.firstChild,L=S.nextSibling,B=L.nextSibling,d=B.firstChild;return l(q,()=>p.name),l(L,m||(()=>{var w=f(te);return l(w,()=>a("(空)")),w})()),d.$$click=()=>K(m),E(d,"disabled",!m),l(d,()=>a("复制")),j(),y})()})),l(D,()=>a("驼峰边界：小写→大写、连续大写→大写+小写均会被识别为分割点；中文字符不参与拆分。")),G(()=>E(c,"value",x())),j(),o})()}I(["input","click"]);export{ie as default};
