import{k as Qe,j as y,t as Ue,m as g,n as a,p as l,q as E,i as p,f as Ve,v as j,A as f,z as xe,e as $e,s as Ze,x as u,F as et}from"./web.Os7kOAdY.js";import{c as tt}from"./clipboard.BNxbz_oK.js";import{g as ce,t as it}from"./i18n-runtime._BAkvU05.js";var lt=f("<div class=panel style=display:flex;flex-direction:column;gap:16px><div style=display:flex;gap:8px><button>Box Shadow</button><button>Text Shadow</button></div><div class=panel style=padding:40px;display:flex;align-items:center;justify-content:center;background:var(--surface-2,#f8f8f8);border-radius:12px;min-height:180px></div><div style=display:flex;flex-direction:column;gap:12px><!$><!/><button class=tool-btn></button></div><div class=panel style=padding:12px><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:8px><span class=tool-label></span><button class=tool-btn></button></div><pre style=margin:0;padding:10px;background:var(--surface-2,#f5f5f5);border-radius:6px;font-size:13px;overflow-x:auto;white-space:pre-wrap;font-family:ui-monospace,monospace>"),nt=f("<div>"),st=f("<span>Shadow"),at=f('<div class=panel style=padding:12px;display:flex;flex-direction:column;gap:8px><div style=display:flex;align-items:center;justify-content:space-between><strong style=font-size:13px><!$><!/><!$><!/></strong><button class="tool-btn is-ghost"style="padding:2px 8px;font-size:12px"></button></div><div class=tool-grid-2 style=gap:8px><label class=tool-field style=gap:2px><span class=tool-label><!$><!/><!$><!/>px)</span><input type=range min=-50 max=50></label><label class=tool-field style=gap:2px><span class=tool-label><!$><!/><!$><!/>px)</span><input type=range min=-50 max=50></label><label class=tool-field style=gap:2px><span class=tool-label><!$><!/><!$><!/>px)</span><input type=range min=0 max=100></label><!$><!/></div><div style=display:flex;gap:12px;align-items:center><label style=display:flex;align-items:center;gap:6px;font-size:13px><span class=tool-label></span><input type=color style="width:36px;height:28px;border:1px solid var(--border);border-radius:4px"><input class=tool-input style=width:160px></label><!$><!/>'),ot=f("<label class=tool-field style=gap:2px><span class=tool-label><!$><!/><!$><!/>px)</span><input type=range min=-50 max=50>"),rt=f("<label style=display:flex;align-items:center;gap:4px;font-size:13px;cursor:pointer><input type=checkbox>Inset");let pt=1;function de(){return{id:pt++,x:4,y:4,blur:10,spread:0,color:"rgba(0,0,0,0.25)",inset:!1}}function dt(){const[be,I]=y(ce(),{equals:!1}),x=n=>it(n,be());Ue(()=>{const n=i=>{const t=i.detail?.locale;t&&I(t)};window.addEventListener("taitan:locale-change",n),I(ce()),Ze(()=>window.removeEventListener("taitan:locale-change",n))});const[r,M]=y("box"),[C,w]=y([de()]),[ue,N]=y(!1);function d(n,i){w(t=>t.map(c=>c.id===n?{...c,...i}:c))}function ge(n){w(i=>i.filter(t=>t.id!==n))}function fe(){w(n=>[...n,de()])}function q(){const n=C().map(t=>{const c=t.inset&&r()==="box"?"inset ":"";return r()==="box"?`${c}${t.x}px ${t.y}px ${t.blur}px ${t.spread}px ${t.color}`:`${t.x}px ${t.y}px ${t.blur}px ${t.color}`});return`${r()==="box"?"box-shadow":"text-shadow"}: ${n.join(`,
         `)};`}function F(){return C().map(i=>{const t=i.inset&&r()==="box"?"inset ":"";return r()==="box"?`${t}${i.x}px ${i.y}px ${i.blur}px ${i.spread}px ${i.color}`:`${i.x}px ${i.y}px ${i.blur}px ${i.color}`}).join(", ")}function _e(){tt(q()),N(!0),setTimeout(()=>N(!1),1500)}return(()=>{var n=g(lt),i=n.firstChild,t=i.firstChild,c=t.nextSibling,A=i.nextSibling,k=A.nextSibling,ve=k.firstChild,[B,Se]=a(ve.nextSibling),H=B.nextSibling,he=k.nextSibling,P=he.firstChild,R=P.firstChild,W=R.nextSibling,me=P.nextSibling;return t.$$click=()=>M("box"),c.$$click=()=>M("text"),l(A,(()=>{var e=E(()=>r()==="box");return()=>e()?(()=>{var o=g(nt);return p($=>xe(o,`width:200px;height:120px;border-radius:12px;background:#fff;box-shadow:${F()};transition:box-shadow .2s;`,$)),o})():(()=>{var o=g(st);return p($=>xe(o,`font-size:48px;font-weight:700;color:#333;text-shadow:${F()};transition:text-shadow .2s;`,$)),o})()})()),l(k,Ve(et,{get each(){return C()},children:e=>(()=>{var o=g(at),$=o.firstChild,v=$.firstChild,ye=v.firstChild,[X,Ce]=a(ye.nextSibling),we=X.nextSibling,[ke,Te]=a(we.nextSibling),Y=v.nextSibling,T=$.nextSibling,D=T.firstChild,S=D.firstChild,Le=S.firstChild,[G,ze]=a(Le.nextSibling),Ee=G.nextSibling,[J,je]=a(Ee.nextSibling);J.nextSibling;var K=S.nextSibling,O=D.nextSibling,h=O.firstChild,Ie=h.firstChild,[Q,Me]=a(Ie.nextSibling),Ne=Q.nextSibling,[U,qe]=a(Ne.nextSibling);U.nextSibling;var V=h.nextSibling,Z=O.nextSibling,m=Z.firstChild,Fe=m.firstChild,[ee,Ae]=a(Fe.nextSibling),Be=ee.nextSibling,[te,He]=a(Be.nextSibling);te.nextSibling;var ie=m.nextSibling,Pe=Z.nextSibling,[Re,We]=a(Pe.nextSibling),le=T.nextSibling,ne=le.firstChild,se=ne.firstChild,L=se.nextSibling,ae=L.nextSibling,Xe=ne.nextSibling,[Ye,De]=a(Xe.nextSibling);return l(v,()=>x("图层 #"),X,Ce),l(v,()=>e.id,ke,Te),Y.$$click=()=>ge(e.id),l(Y,()=>x("删除")),l(S,()=>x("X 偏移 ("),G,ze),l(S,()=>e.x,J,je),K.$$input=s=>d(e.id,{x:+s.currentTarget.value}),l(h,()=>x("Y 偏移 ("),Q,Me),l(h,()=>e.y,U,qe),V.$$input=s=>d(e.id,{y:+s.currentTarget.value}),l(m,()=>x("模糊 ("),ee,Ae),l(m,()=>e.blur,te,He),ie.$$input=s=>d(e.id,{blur:+s.currentTarget.value}),l(T,(()=>{var s=E(()=>r()==="box");return()=>s()&&(()=>{var _=g(ot),b=_.firstChild,z=b.firstChild,[oe,Ge]=a(z.nextSibling),Je=oe.nextSibling,[re,Ke]=a(Je.nextSibling);re.nextSibling;var pe=b.nextSibling;return l(b,()=>x("扩展 ("),oe,Ge),l(b,()=>e.spread,re,Ke),pe.$$input=Oe=>d(e.id,{spread:+Oe.currentTarget.value}),p(()=>u(pe,"value",e.spread)),j(),_})()})(),Re,We),l(se,()=>x("颜色")),L.$$input=s=>d(e.id,{color:s.currentTarget.value}),ae.$$input=s=>d(e.id,{color:s.currentTarget.value}),l(le,(()=>{var s=E(()=>r()==="box");return()=>s()&&(()=>{var _=g(rt),b=_.firstChild;return b.addEventListener("change",z=>d(e.id,{inset:z.currentTarget.checked})),p(()=>u(b,"checked",e.inset)),_})()})(),Ye,De),p(()=>u(K,"value",e.x)),p(()=>u(V,"value",e.y)),p(()=>u(ie,"value",e.blur)),p(()=>u(L,"value",e.color.startsWith("rgba")?"#000000":e.color)),p(()=>u(ae,"value",e.color)),j(),o})()}),B,Se),H.$$click=fe,l(H,()=>x("+ 添加图层")),l(R,()=>x("CSS 代码")),W.$$click=_e,l(W,()=>ue()?"已复制 ✓":"复制 CSS"),l(me,q),p(e=>{var o=`tool-btn ${r()==="box"?"":"is-ghost"}`,$=`tool-btn ${r()==="text"?"":"is-ghost"}`;return o!==e.e&&$e(t,e.e=o),$!==e.t&&$e(c,e.t=$),e},{e:void 0,t:void 0}),j(),n})()}Qe(["click","input"]);export{dt as default};
