PageSourceSearch

https://sutra.co/assets/SideConfigurationsMenu-DKFbRHH2.js

js sutra.co collected 2026-10-09 22:17:49 UTC 512,554 bytes, 4 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BXnjdIrS.js","assets/react-DvQgDblV.js","assets/utils-BonhjxxM.js","assets/css/react-BONEgNez.css","assets/ResourceNode-xk2Yq_A2.js","assets/tiptap-DUDujSvN.js","assets/faPencil-D25iSljX.js","assets/index-Co5pXP6t.js","assets/media-Cu9cWWJY.js","assets/css/media-B5me1yE1.css","assets/analytics-DHfXAps4.js","assets/css/index-jK1C39St.css","assets/index-CDKSITm1.js","assets/faArrowRight-B1a-hn3V.js","assets/ui-BOK5fJXU.js","assets/faXmark-CiceLES1.js","assets/faListCheck-FyYHUHmX.js","assets/faScaleBalanced-XD6FpUP5.js","assets/faClipboardCheck-DmNjH1Po.js","assets/faHouse-DGwxyEMv.js","assets/default-BC_XZ5qa.js","assets/TrackMixpanel-BhARf-iB.js","assets/module-DwLaAfsp.js","assets/css/ResourceNode-CxHuEuyZ.css","assets/Helmet-DOztptXV.js"])))=>i.map(i=>d[i]);
2import{_ as Pn,a as Wn,e8 as Xt,e9 as Us,ea as Wu,eb as dr,j as Vr,ec as Ou,ed as Vs,ee as Mu,ef as En,S as Wc,eg as Zt,O as qt,ad as Vt,ae as an,eh as Nu,ei as $u,ej as Du,ek as Fu,el as Uo,em as Tn,en as Hu,eo as Uu,ep as Vu,eq as or,er as so,es as Ku,et as sr,d as Ks,eu as Kr,ev as pa,ew as rs,ex as is,ey as wo,ez as Oc,eA as dt,eB as qn,eC as xa,at as Mc,eD as Gu,eE as Yu,cv as qu,cu as Xu,d2 as Co,d3 as ls,d4 as rr,d5 as ir,eF as en,eG as Ts,eH as Zu,eI as Qu,eJ as Ju,eK as ga,cw as ma,H as ba,eL as ed,R as td,eM as nd,eN as Nc,eO as od,eP as sd,eQ as rd,eR as id,eS as ld,eT as ad,eU as ya,eV as cd,eW as $c,eX as Dc,eY as ud,dE as dd,dD as Vo,eZ as Fc,e_ as Hc,e$ as fd,f0 as xi,f1 as Bn,f2 as Uc,f3 as hd,f4 as va,f5 as pd,aV as gi,f6 as xd,f7 as gd,f8 as So,f9 as ja,fa as md,fb as bd,e as zn,aJ as yd,fc as Gs,fd as Vc,cK as Jo,fe as vd,ff as Kc,fg as jd,L as kd,fh as wd,fi as Cd,fj as Sd,fk as Td,fl as mi,aG as Ys,fm as ka,fn as Is,fo as Id,fp as _d,fq as Ad,fr as wa,fs as Bd,ft as Ca,fu as Rd,fv as Sa,fw as Ed,fx as Gr,fy as zd,fz as Ld,fA as Ta,fB as Pd,fC as Wd,fD as Od,fE as Md,fF as qs,fG as Eo,fH as Nd,fI as $d,dR as Dd,aW as Fd,aX as Hd,fJ as Ud,fK as Vd,fL as Kd,fM as Gd,ba as _s,e4 as Yd,fN as qd}from"./ResourceNode-xk2Yq_A2.js";import{R as ke,o as Dt,j as e,G as ye,B as p,N as Rt,r as l,T as N,n as at,F as Ue,w as rn,S as jt,L as es,m as vt,Q as Ve,e as We,z as Fe,y as Yr,aF as Ia,v as we,x as as,aG as ts,ag as Gc,am as bi,aj as Xd,V as Zd,a5 as yi,M as qr,O as ns,U as y,ad as Yo,h as As,i as Fs,k as Qd,a0 as Jd,X as ef,s as Yc,a9 as _a,I as tf}from"./react-DvQgDblV.js";import{f as ee,b as qc,a as Qn,w as sn,v as Yt,ap as qo,as as To,K as nf,bv as Aa,Q as of,bw as Ba,D as sf,bx as rf}from"./index-Co5pXP6t.js";import{F as Qe}from"./index-CDKSITm1.js";import{S as Ct}from"./ui-BOK5fJXU.js";import{c as Be,r as lf,B as af,L as cf,P as Ln,E as Xc,C as uf}from"./PresetCard-Cgbfwo0g.js";import{u as Qt,f as Xs,P as df}from"./faPencil-D25iSljX.js";import{T as Zc}from"./trash-Bhx3s0vv.js";import{a as ff,f as hf}from"./faXmark-CiceLES1.js";import{d as pf}from"./faListCheck-FyYHUHmX.js";import{r as xf}from"./dummyCursor-CP06GHir.js";import{u as gf,d as mf,I as bf,e as yf,f as vf,B as jf}from"./useHeaderAwareSidebarOffset-DcXpVPPv.js";import{B as kf}from"./BreadcrumbStrip-qDb31CRw.js";import{s as Ra}from"./scopeSelectionSync-B_ygGmBW.js";import{u as wf}from"./useChannel-DYX4_0a3.js";import{o as Bs}from"./UserMenu-c_vaM4Q4.js";import{f as Cf}from"./faEllipsis-Cs-Yqxn9.js";import{_ as Sf}from"./media-Cu9cWWJY.js";import{l as Tf}from"./tiptap-DUDujSvN.js";import"./utils-BonhjxxM.js";import"./faScaleBalanced-XD6FpUP5.js";import"./faClipboardCheck-DmNjH1Po.js";import"./faHouse-DGwxyEMv.js";import"./faArrowRight-B1a-hn3V.js";import"./default-BC_XZ5qa.js";import"./TrackMixpanel-BhARf-iB.js";import"./module-DwLaAfsp.js";import"./analytics-DHfXAps4.js";import"./headerLayout-CrCV1OYX.js";import"./resolveTargetDom-Cr56WY19.js";import"./faCloudArrowUp-CEe5z9JM.js";import"./faHouse-DEcXUuck.js";(function(){try{var t=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};t.SENTRY_RELEASE={id:"5e938a9f727041e40e3951a82e5b4d90634a94b4"};var n=new t.Error().stack;
2n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="ed2069f9-f5d7-49f1-ab70-79b598af2565",t._sentryDebugIdIdentifier="sentry-dbid-ed2069f9-f5d7-49f1-ab70-79b598af2565")}catch{}})();var If=["size","color"];function _f(t){var n=t.size,o=n===void 0?24:n,s=t.color,r=s===void 0?"currentColor":s,i=Pn(t,If);return ke.createElement("svg",Wn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-align-center",width:o,height:o,viewBox:"0 0 24 24",stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},i),ke.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ke.createElement("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),ke.createElement("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),ke.createElement("line",{x1:"6",y1:"18",x2:"18",y2:"18"}))}var Af=["size","color"];function Bf(t){var n=t.size,o=n===void 0?24:n,s=t.color,r=s===void 0?"currentColor":s,i=Pn(t,Af);return ke.createElement("svg",Wn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-align-left",width:o,height:o,viewBox:"0 0 24 24",stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},i),ke.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ke.createElement("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),ke.createElement("line",{x1:"4",y1:"12",x2:"14",y2:"12"}),ke.createElement("line",{x1:"4",y1:"18",x2:"18",y2:"18"}))}var Rf=["size","color"];function Ef(t){var n=t.size,o=n===void 0?24:n,s=t.color,r=s===void 0?"currentColor":s,i=Pn(t,Rf);return ke.createElement("svg",Wn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-align-right",width:o,height:o,viewBox:"0 0 24 24",stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},i),ke.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ke.createElement("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),ke.createElement("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),ke.createElement("line",{x1:"6",y1:"18",x2:"20",y2:"18"}))}var zf=["size","color"];function Lf(t){var n=t.size,o=n===void 0?24:n,s=t.color,r=s===void 0?"currentColor":s,i=Pn(t,zf);return ke.createElement("svg",Wn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-inner-shadow-right",width:o,height:o,viewBox:"0 0 24 24",stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},i),ke.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ke.createElement("path",{d:"M18.364 18.364a9 9 0 1 1 -12.728 -12.728a9 9 0 0 1 12.728 12.728z"}),ke.createElement("path",{d:"M16.243 7.757a6 6 0 0 1 0 8.486"}))}var Pf=["size","color"];function Wf(t){var n=t.size,o=n===void 0?24:n,s=t.color,r=s===void 0?"currentColor":s,i=Pn(t,Pf);return ke.createElement("svg",Wn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-inner-shadow-top",width:o,height:o,viewBox:"0 0 24 24",stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},i),ke.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ke.createElement("path",{d:"M5.636 5.636a9 9 0 1 0 12.728 12.728a9 9 0 0 0 -12.728 -12.728z"}),ke.createElement("path",{d:"M16.243 7.757a6 6 0 0 0 -8.486 0"}))}var Of=["size","color"];function Mf(t){var n=t.size,o=n===void 0?24:n,s=t.color,r=s===void 0?"currentColor":s,i=Pn(t,Of);return ke.createElement("svg",Wn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-pencil",width:o,height:o,viewBox:"0 0 24 24",stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},i),ke.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ke.createElement("path",{d:"M4 20h4l10.5 -10.5a1.5 1.5 0 0 0 -4 -4l-10.5 10.5v4"}),ke.createElement("line",{x1:"13.5",y1:"6.5",x2:"17.5",y2:"10.5"}))}var Nf=["size","color"];function $f(t){var n=t.size,o=n===void 0?24:n,s=t.color,r=s===void 0?"currentColor":s,i=Pn(t,Nf);return ke.createElement("svg",Wn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-shadow-off",width:o,height:o,viewBox:"0 0 24 24",stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},i),ke.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ke.createElement("path",{d:"M5.634 5.638a9 9 0 0 0 12.728 12.727m1.68 -2.32a9 9 0 0 0 -12.086 -12.088"}),ke.createElement("path",{d:"M16 12h2"}),ke.createElement("path",{d:"M13 15h2"}),ke.createElement("path",{d:"M13 18h1"}),ke.createElement("path",{d:"M13 9h4"}),ke.createElement("path",{d:"M13 6h1"}),ke.createElement("path",{d:"M3 3l18 18"}))}var Df=["size","color"];function Ff(t){var n=t.size,o=n===void 0?24:n,s=t.color,r=s===void 0?"currentColor":s,i=Pn(t,Df);return ke.createElement("svg",Wn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-shadow",width:o,height:o,viewBox:"0 0 24 24",stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},i),ke.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ke.createElement("circle",{cx:"12",cy:"12",r:"9"}),ke.createElement("path",{d:"M13 12h5"}),ke.createElement("path",{d:"M13 15h4"}),ke.createElement("path",{d:"M13 18h1"}),ke.createElement("path",{d:"M13 9h4"}),ke.createElement("path",{d:"M13 6h1"}))}const Hf="_uploadBtn_16e35_1",Uf="_closeBtn_16e35_19",Vf="_pinBtn_16e35_40",Kf="_pinBtnActive_16e35_61",Gf="_emojiTrigger_16e35_99",Yf="_imageRemoveOverlay_16e35_113",qf="_accordionItem_16e35_131",Xf="_accordionControl_16e35_139",Zf="_accordionLabel_16e35_148",Qf="_accordionChevron_16e35_160",Jf="_accordionPanel_16e35_168",eh="_accordionContent_16e35_172",th="_responsiveLocked_16e35_180",nh="_focusInput_16e35_200",oh="_scopeHeader_16e35_204",sh="_scopeTitle_16e35_215",rh="_scopeRenameButton_16e35_226",ih="_scopeRenameInput_16e35_248",Ze={uploadBtn:Hf,closeBtn:Uf,pinBtn:Vf,pinBtnActive:Kf,emojiTrigger:Gf,imageRemoveOverlay:Yf,accordionItem:qf,accordionControl:Xf,accordionLabel:Zf,accordionChevron:Qf,accordionPanel:Jf,accordionContent:eh,responsiveLocked:th,focusInput:nh,scopeHeader:oh,scopeTitle:sh,scopeRenameButton:rh,scopeRenameInput:ih},lh="_selectAllText_1pywf_21",ah="_selectAllTextActive_1pywf_35",Ea={selectAllText:lh,selectAllTextActive:ah},He=({label:t,value:n,onChange:o,min:s=0,max:r=100,unit:i="px",labelWidth:c="40px",step:u=1})=>{Dt();const a=r-s,f=a>0?((n||0)-s)/a*100:0,d=(String(u).split(".")[1]||"").length,h=x=>{const g=Math.max(s,Math.min(r,x)),w=Math.round((g-s)/u)*u+s;return parseFloat(w.toFixed(d))},m=x=>{const g=x.currentTarget.getBoundingClientRect(),w=x.clientX-g.left,b=Math.max(0,Math.min(1,w/g.width));o(h(s+b*(r-s)))};return e.jsxs(ye,{gap:8,align:"center",style:{width:"100%"},children:[e.jsx(p,{style:{fontSize:"11px",fontWeight:600,color:"#666",width:c,flexShrink:0,whiteSpace:"nowrap"},children:t}),e.jsx(p,{onMouseDown:m,style:{flex:1,height:"6px",backgroundColor:"#e5e5e5",borderRadius:"3px",cursor:"pointer",position:"relative",overflow:"hidden",userSelect:"none"},children:e.jsx(p,{style:{height:"100%",width:`${f}%`,backgroundColor:"#7950f2",borderRadius:"3px",transition:"width 0.1s ease"}})}),e.jsx(Rt,{value:n,onChange:o,min:s,max:r,step:u,decimalScale:d||void 0,hideControls:!0,size:"xs",style:{width:d?"52px":"44px","& input":{padding:"2px 4px",border:"1.5px solid #e0e0e0",borderRadius:"6px",fontSize:"11px",fontWeight:600,textAlign:"right",he
2ight:"26px",minHeight:"26px"}}}),e.jsx(p,{style:{fontSize:"10px",color:"#999",width:"20px",flexShrink:0,textAlign:"center"},children:i})]})},St=(t,n)=>Xt(t,n),be=(t,n,o)=>{const{node:s,pos:r}=St(t,n);if(!s||r==null)return!1;const{tr:i}=t.view.state;return i.setNodeMarkup(r,void 0,{...s.attrs,...o}),t.view.dispatch(i),!0},za=(t,n,o,s={})=>{const{node:r,pos:i}=St(t,n);if(!r||i==null)return!1;const c={...r.attrs};o.forEach(a=>{delete c[a]});const{tr:u}=t.view.state;return u.setNodeMarkup(i,void 0,{...c,...s}),t.view.dispatch(u),!0},ch=(t,n,o)=>{var h,m,x,g;const{node:s,pos:r}=St(t,n),i=(g=(x=(m=(h=t==null?void 0:t.view)==null?void 0:h.state)==null?void 0:m.schema)==null?void 0:x.marks)==null?void 0:g.textStyle;if(!s||r==null||!i||!Array.isArray(o)||o.length===0)return!1;const c=r+1,u=r+s.nodeSize-1;if(u<=c)return!1;const{state:a}=t.view,f=a.tr;let d=!1;return a.doc.nodesBetween(c,u,(w,b)=>{var C;if(!w.isText||!((C=w.marks)!=null&&C.length))return;const j=w.marks.find(I=>I.type===i);if(!j)return;const A={...j.attrs};let v=!1;if(o.forEach(I=>{A[I]!=null&&A[I]!==""&&(delete A[I],v=!0)}),!v)return;const k=b+w.nodeSize;f.removeMark(b,k,i),Object.values(A).some(I=>I!=null&&I!=="")&&f.addMark(b,k,i.create(A)),d=!0}),d?(t.view.dispatch(f),!0):!1};function ln({editor:t,styleTarget:n,nextStyles:o,element:s,saveNodeData:r,onStyleTargetSaved:i}){if(n){if(!t)return!1;const c=n.saveAttr||n.styleAttr||"styles",u=Us(t,n,{[c]:o||{}});return u&&(i==null||i()),u}return r==null||r({newStyles:o,_node:s},"styles"),!0}function $t({editor:t,styleTarget:n,attrs:o,element:s}){if(n)return t?Us(t,n,{attrs:o||{}}):!1;if(!t||!s)return!1;const{node:r,pos:i}=Xt(t,s);if(!r||i==null)return!1;const{tr:c}=t.view.state;return c.setNodeMarkup(i,void 0,{...r.attrs,...o||{}}),t.view.dispatch(c),!0}const uh=[{value:"no-radius",label:"Square",icon:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"0"})})},{value:"with-radius",label:"Round",icon:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"4"})})},{value:"circle-radius",label:"Circle",icon:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("circle",{cx:"12",cy:"12",r:"8"})})},{value:"custom",label:"Custom",icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M4 12 Q4 4 12 4"}),e.jsx("path",{d:"M20 12 Q20 8 16 4",opacity:"0.4"}),e.jsx("circle",{cx:"12",cy:"18",r:"2",opacity:"0.4"})]})}];function Rn(t){const n=ee(v=>v.tiptap),o=t.editor||(n==null?void 0:n.editor),s=l.useRef(null),r=l.useRef(!1),i=l.useRef(!1),c=t.radiusAttr||"radius",u=t.radiusCustomAttr||"radiusCustom",[a,f]=l.useState("no-radius"),[d,h]=l.useState({tl:0,tr:0,br:0,bl:0}),[m,x]=l.useState(!0);l.useEffect(()=>{if(t.element&&t.element.node.attrs&&(r.current||f(t.element.node.attrs[c]?t.element.node.attrs[c]:"no-radius"),!i.current)){h(t.element.node.attrs[u]||{tl:0,tr:0,br:0,bl:0});const v=t.element.node.attrs[u]||{tl:0,tr:0,br:0,bl:0};x(v.tl===v.tr&&v.tr===v.br&&v.br===v.bl)}},[t.element,u,c]),l.useEffect(()=>{if(r.current&&(r.current=!1,!(!t.element||!t.element.node.attrs)&&o)){if(t.styleTarget){if(!$t({editor:o,element:t.element,styleTarget:t.styleTarget,attrs:{[c]:a}}))return}else{const v=t.element.node.type.name;if(v.indexOf("grid")<0&&v!="column"&&v!="container"&&v!="box"&&v!="shareblock")o.commands.setCustomRadius(a);else{const{node:k,pos:C}=St(o,t.element);if(!k||C==null)return;const{tr:I}=o.view.state;I.setNodeMarkup(C,void 0,{...k.attrs,[c]:a}),o.view.dispatch(I)}}s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{var v;s.current=null,(v=t.styleTarget?t.onStyleTargetSaved:t.saveNodeData)==null||v()},2e3)}},[o,t.element,t.onStyleTargetSaved,t.saveNodeData,t.styleTarget,a,c]),l.useEffect(()=>{if(i.current&&(i.current=!1,!(!t.element||!t.element.node.attrs)&&o&&a==="custom")){if(t.styleTarget){if(!$t({editor:o,element:t.element,styleTarget:t.styleTarget,attrs:{[u]:d}}))return}else{const{node:v,pos:k}=St(o,t.element);if(!v||k==null)return;const{tr:C}=o.view.state;C.setNodeMarkup(k,void 0,{...v.attrs,[u]:d}),o.view.dispatch(C)}s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{var v;s.current=null,(v=t.styleTarget?t.onStyleTargetSaved:t.saveNodeData)==null||v()},2e3)}}
2,[o,t.element,t.onStyleTargetSaved,t.saveNodeData,t.styleTarget,a,d,u]);const g=v=>{r.current=!0,f(v),v==="custom"&&x(d.tl===d.tr&&d.tr===d.br&&d.br===d.bl)},w=(v,k)=>{i.current=!0;const C=Math.max(0,Math.min(100,parseInt(k)||0));m&&x(!1),h(I=>({...I,[v]:C}))},b=()=>{if(i.current=!0,m)x(!1);else{const v=Math.max(d.tl,d.tr,d.bl,d.br);h({tl:v,tr:v,bl:v,br:v}),x(!0)}},j=v=>{i.current=!0;const k=Math.max(0,Math.min(100,parseInt(v)||0));h({tl:k,tr:k,bl:k,br:k})},A=v=>({width:"32px",height:"22px",border:`1.5px solid ${v>0?"#7950f2":"#e0e0e0"}`,borderRadius:"4px",fontSize:"10px",fontWeight:600,textAlign:"center",color:v>0?"#7950f2":"#666",background:v>0?"rgba(121, 80, 242,0.08)":"white",outline:"none",MozAppearance:"textfield"});return e.jsxs(p,{children:[e.jsx(ye,{gap:6,grow:!0,children:uh.filter(v=>!(t.hideCustom&&v.value==="custom")).map(v=>e.jsx(Be,{icon:v.icon,label:v.label,value:v.value,active:a===v.value,onClick:()=>g(v.value)},v.value))}),a==="custom"&&e.jsxs(p,{mt:10,children:[e.jsxs(p,{style:{position:"relative",width:"100%",height:"80px"},children:[e.jsx(p,{style:{position:"absolute",top:14,left:28,right:28,bottom:14,background:"#f8f8f8",border:"1.5px solid #e0e0e0",borderRadius:`${d.tl}px ${d.tr}px ${d.br}px ${d.bl}px`,transition:"border-radius 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(N,{className:`${Ea.selectAllText} ${m?Ea.selectAllTextActive:""}`,onClick:b,children:"Select All"})}),[{key:"tl",style:{top:0,left:10}},{key:"tr",style:{top:0,right:10}},{key:"bl",style:{bottom:0,left:10}},{key:"br",style:{bottom:0,right:10}}].map(({key:v,style:k})=>e.jsx(p,{style:{position:"absolute",zIndex:3,...k},children:e.jsx("input",{type:"number",value:d[v],min:"0",max:"100",onChange:C=>w(v,C.target.value),style:A(d[v])})},v))]}),m&&e.jsx(He,{label:"All",value:d.tl,min:0,max:100,unit:"px",onChange:j})]})]})}const dh="_colorBtn_tka0r_1",fh={colorBtn:dh},hh="_focusInput_zbitd_1",ph={focusInput:hh},Qc=t=>{var n,o;return((o=(n=t==null?void 0:t.node)==null?void 0:n.type)==null?void 0:o.name)==="interactiveInput"},La=t=>{var o;const n=((o=t==null?void 0:t.node)==null?void 0:o.attrs)||{};return Qc(t)?Wu(n.buttonText,n.interactiveInputButtonTextCustomized):n.buttonText||""};function vi(t){const n=l.useRef(null),o=l.useRef(null),s=l.useRef(null),r=l.useRef(null),i=ee(m=>m.tiptap),c=t.editor||(i==null?void 0:i.editor),[u,a]=l.useState(""),f=()=>{n.current&&(clearTimeout(n.current),n.current=null);const m=s.current;if(!m)return;s.current=null;const x={buttonText:m.text};Qc(m.element)&&(x.interactiveInputButtonTextCustomized=!0),be(c,m.element,x)&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{o.current=null,t.saveNodeData()},2e3))};l.useEffect(()=>()=>{n.current&&clearTimeout(n.current),o.current&&clearTimeout(o.current)},[]),l.useEffect(()=>{if(!t.element||!t.element.node.attrs)return;const m=t.element.node.attrs.uid;r.current!==m&&(f(),r.current=m,a(La(t.element)))},[t.element]);const d=m=>{const x=m.currentTarget.value;a(x),s.current={element:t.element,text:x},n.current&&clearTimeout(n.current),n.current=setTimeout(f,500)},h=La(t.element);return e.jsx(at,{value:u,onChange:d,placeholder:h||"Button text",classNames:{input:ph.focusInput},styles:{input:{fontSize:"13px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})}const xh="_tabBtn_xomps_1",gh="_tabBtnActive_xomps_14",mh="_tabBtnInactive_xomps_19",bh="_focusInput_xomps_28",yh="_surveyActionButton_xomps_32",Xe={tabBtn:xh,tabBtnActive:gh,tabBtnInactive:mh,focusInput:bh,surveyActionButton:yh},vh=new Set(["checkout","registration","nothing","section","space","custom_url"]),jh=new Set(["next_space","auto","nothing","space","custom_url"]),kh=new Set(["section","space","custom_url"]);function Pa(t){var mt,ae,zt;const n=qc(),o=l.useRef(null),{t:s}=Qt(),r=l.useRef(!1),i=l.useRef(!1),c=Qn(),u=ee(V=>V.space),a=ee(V=>V.tiptap),f=t.editor||(a==null?void 0:a.editor),d=t.buttonType||"action",h=t.onButtonTypeChange||(()=>{}),[m,x]=l.useState(t.navigationOnly===!0?"nothing":"custom_url"),[g,w]=l.useState(""),[b,j]=l.useState("_current"),[A,v]=l.useState(!1),[k,C]=l.useState(!1),[I,_]=l.useState(!1),[R,F]=l.useState([]),[G,T]=l.useState(!1),[L,S]=l.useState(""),[W,E]=l.useState([]),[P,$]=l.useState(""),[X,q]=l.useState([]),[Q,B]=l.useState(""),[O,K]=l.useState("message"),Y=t.navigationOnly===!0,H=Y||t.element&&t.element.node.type.n
2ame=="actionbutton",D=V=>be(f,t.element,V),ne=(V,te)=>D({[V]:te}),Ie=V=>{const te=V||"";if(te==="{{checkout_resume_url}}")return te;const he=/^(https?:\/\/|mailto:|tel:)/i.test(te);return te&&!he&&te.indexOf("#jumpTo=")<0&&te.indexOf("/space/")<0?`https://${te}`:`${te}`},Ke=(V,te=d)=>(te==="mark_complete"?jh:vh).has(V),Oe=l.useRef(null),Ce=l.useRef(null),Re=l.useRef(null);l.useEffect(()=>()=>{Oe.current&&clearTimeout(Oe.current),Ce.current&&clearTimeout(Ce.current),o.current&&clearTimeout(o.current),i.current&&clearTimeout(i.current)},[]);const xe=(V,te,he)=>`${V}|${te}|${Ie(he)}`,Ee=(V,te=b,he=m)=>{const le=Ie(V),Ye=D({actionCallback:"link",actionCallbackValue:le,actionCallbackTarget:te,buttonAction:he});return Ye&&(Re.current=xe(he,te,V),t.saveNodeData()),Ye};l.useEffect(()=>{var V,te;(te=(V=t.element)==null?void 0:V.node)!=null&&te.attrs&&r.current==t.element.node.attrs.uid&&(Oe.current&&clearTimeout(Oe.current),Oe.current=setTimeout(()=>{var le,Ye;if(Oe.current=null,!((Ye=(le=t.element)==null?void 0:le.node)!=null&&Ye.attrs)||r.current!=t.element.node.attrs.uid)return;let he=!1;if(!H)typeof g=="string"&&(he=!0,D({actionCallback:O,actionCallbackValue:O==="link"||O==="space"?Ie(g):`${g}`,actionCallbackTarget:b}));else if(d==="survey")P&&P!=="new_survey"&&(he=!0,ne("actionCallbackValue",`survey:${P}`));else if(d==="bundle")L&&(he=!0,ne("actionCallbackValue",`/space/${u.slug}/gateway?bundles=${L}`));else if(!(d==="calendar_invite"||d==="invite")){if(m==="registration"){const ze=It(),xt=xe("registration","_current",ze);if(Re.current===xt){Re.current=null;return}const bt=t.element.node.attrs||{};(bt.buttonAction!=="registration"||bt.isMarkComplete||bt.actionCallback!=="link"||bt.actionCallbackValue!==ze||dr(bt.actionCallbackTarget||"_current")!=="_current")&&(he=!0,D({buttonAction:"registration",isMarkComplete:!1,actionCallback:"link",actionCallbackValue:ze,actionCallbackTarget:"_current"}))}else if(g||kh.has(m)){const ze=xe(m,b,g);if(Re.current===ze){Re.current=null;return}he=!0,D({actionCallback:"link",actionCallbackValue:Ie(g),actionCallbackTarget:b,buttonAction:m})}}he&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{o.current=null,t.saveNodeData()},2e3))},500))},[g,b,O,L,P,m]),l.useEffect(()=>{u&&u.slug&&v(window.$showMarkCompleteButton)},[u]),l.useEffect(()=>{!H||d!=="survey"||!(u!=null&&u.slug)||Vr.onFetch(u.slug,{page:1,per:100},V=>{const te=((V==null?void 0:V.data)||[]).map(he=>({value:`${he.id}`,label:he.title}));q([{value:"new_survey",label:"Create a new survey or quiz"},...te])},()=>{})},[H,d,u==null?void 0:u.slug]);const ht=V=>{v(V),window.$showMarkCompleteButton=V,Wc.onUpdate(u.slug,{pod_settings_attributes:{show_mark_complete_button_in_header:V}},()=>{},()=>{})},Tt=()=>(u==null?void 0:u.slug)||n.pathname.split("/")[2],It=()=>Ou(Tt()),pt=(V={})=>{const te=It();x("registration"),w(te),j("_current"),(V.buttonAction!=="registration"||V.isMarkComplete||V.actionCallback!=="link"||V.actionCallbackValue!==te||dr(V.actionCallbackTarget||"_current")!=="_current")&&D({buttonAction:"registration",isMarkComplete:!1,actionCallback:"link",actionCallbackValue:te,actionCallbackTarget:"_current"})&&(Re.current=xe("registration","_current",te),t.saveNodeData())},cn=V=>{if(x(V),!(!H||!r.current))if(k&&(C(!1),D({addIfPrivate:!1})),V==="auto"||V==="next_space")w(""),j(V==="next_space"?"_next_space":"_auto"),D({buttonAction:V,actionCallbackValue:"",actionCallbackTarget:V==="next_space"?"_next_space":"_auto"}),t.saveNodeData();else if(V==="nothing"){w(""),j("_nothing");const te={buttonAction:V,actionCallbackValue:"",actionCallbackTarget:"_nothing"};d==="action"&&(te.isMarkComplete=!1,te.actionCallback="link"),D(te),t.saveNodeData()}else if(V==="checkout"){const te=t.context==="broadcast"?"{{checkout_resume_url}}":`/space/${Tt()}/checkout`;w(te),j("_current"),D({buttonAction:"checkout",isMarkComplete:!1,actionCallback:"link",actionCallbackValue:te,actionCallbackTarget:"_current"}),t.saveNodeData()}else if(V==="registration"){const te=It();w(te),j("_current"),D({buttonAction:V,isMarkComplete:!1,actionCallback:"link",actionCallbackValue:te,actionCallbackTarget:"_current"}),t.saveNodeData()}else V==="section"?(j("_section"),w(""),D({buttonAction:V,isMarkComplete:!1,actionCallback:"link",actionCallbackValue:"",actionCallbackTarget:"_section"}),t.saveNodeData()):V==="space"?(w(""),j("_current"),D({buttonAction:V,actionCallback:"link",actionCallbackValue:"",actionCallbackTarget:"_current"}),t.saveNodeData()):V==="custom_url"&&(w(""),j("_current"),D({buttonAction:V,actionCallback:"link",actionCallbackValue:"",actionCallbackTarget:"_current"}),t.saveNodeData())},J=l.useRef(null);l.useEffect(()=>{if(t.element&&t.element.node.attrs.styles){const V=t.element.node.attrs,te=V.uid,he=[te,Vs(V),V.buttonAction,V.actionCallback,V.actionCallbackValue,V.actionCallbackTarget,V.isMarkComplete,V.inviteShareText,V.addIfPrivate].join("|");if(J.current===he)return;if(J.current=he,r.current=null,setTimeout(()=>{r.current=te},0),!H){K(t.element.node.attrs.actionCallback),w(t.element.node.attrs.actionCallbackValue),j(t.element.node.attrs.actionCallbackTarget),t.element.node.attrs.actionCallback==="space"&&de();return}const le=V;C(le.addIfPrivate===!0);const Ye=Vs(le);if(h(Ye),B(lf(le.inviteShareText,u==null?void 0:u.name)),Ye==="survey"){x("");const ze=le.actionCallbackValue?le.actionCallbackValue.replace("survey:",""):"";$(ze),M()}else if(Ye==="bundle"){x("");const ze=le.actionCallbackValue?le.actionCallbackValue.split("bundles=").pop():"";S(ze),Ne()}else(Ye==="calendar_invite"||Ye==="invite")&&(x(""),w(""),j("_nothing"));if(le.actionCallback!="bundle"&&le.actionCallback!="survey"&&le.buttonAction!="calendar_invite"&&le.buttonAction!="invite"){const ze=le.actionCallbackValue||"",xt=dr(le.actionCallbackTarget||"_current"),bt=Ke(le.buttonAction,le.isMarkComplete?"mark_complete":"action")?le.buttonAction:null;if(bt){if(bt==="registration"){pt(le);return}x(bt)}else if(le.isMarkComplete&&xt==="_next_space")x("next_space");else if(le.isMarkComplete&&xt==="_auto")x("auto");else if(le.isMarkComplete&&!ze)x("nothing");else if(!le.isMarkComplete&&Mu(ze,Tt())){pt(le);return}else if(!le.isMarkComplete&&!ze&&xt==="_current"){pt(le);return}else if(xt==="_nothing")x("nothing");else if(xt=="_section"||ze.indexOf("#jumpTo=")>=0)x("section");else if(ze&&(ze.indexOf("https://sutra.co/space")>=0||ze.startsWith("/space/")))x("space");else if(ze)x("custom_url");else if(le.isMarkComplete)x("nothing");else{pt(le);return}w(ze),j(xt)}}},[t.element,u==null?void 0:u.name]);const U=V=>{V!=t.element.node.attrs.actionCallbackValue&&w(V||"")},ie=V=>{const te=V.slice(0,240);B(te),ne("inviteShareText",te)&&(Ce.current&&clearTimeout(Ce.current),Ce.current=setTimeout(()=>{Ce.current=null,t.saveNodeData()},500))},ce=V=>{if(V===O)return;const te=V==="message"?"_nothing":"_current";K(V),w(""),j(te),D({actionCallback:V,actionCallbackValue:"",actionCallbackTarget:te}),t.saveNodeData(),V==="space"&&de()},me=V=>{_(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{de(V),_(!1)},1e3)},de=(V=null)=>{const te=["members","simple"],he=window.$fetchedTopSlug||window.$currentTopSlug;if(t.context!=="broadcast"&&he){const le=H?"order-context":"priority-context";te.push(`${le}-${he}`)}V&&te.push(`q=${V}`),sn.onFetchManaged(null,te,{page:1,per:10},le=>{const Ye=[];for(let ze=0;ze<le.length;ze++)Ye.push({value:`/space/${le[ze].slug}/${le[ze].version}`,label:`${le[ze].name} (${le[ze].slug})`});F(Ye)},()=>{})},Ne=()=>{af.onFetch(u.slug,V=>{const te=V.map(le=>({value:`${le.id}`,label:le.name})),he=[{value:"new_bundle",label:"Create a new bundle"},...te];E(he),L||S("new_bundle")},()=>{})},M=()=>{Vr.onFetch(u.slug,{page:1,per:100},V=>{const te=((V==null?void 0:V.data)||[]).map(le=>({value:`${le.id}`,label:le.title})),he=[{value:"new_survey",label:"Create a new survey or quiz"},...te];q(he),$(le=>le||"new_survey")},()=>{})},fe=m==="space"||m==="custom_url";if(!H)return e.jsx(p,{style:{display:"flex",flexDirection:"column",gap:"12px"}
2,children:t.element&&t.element.node.type.name.indexOf("interactive")<0&&e.jsxs(e.Fragment,{children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"60px"},children:"Type"}),e.jsx(Ue,{value:O,onChange:V=>ce(V.target.value),size:"xs",data:[{value:"message",label:"Pop up message"},{value:"link",label:"Redirect to custom link"},{value:"space",label:"Redirect to space"}],style:{flex:1},classNames:{input:Xe.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]}),O==="message"&&e.jsxs(p,{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"60px",paddingTop:"6px"},children:"Message"}),e.jsx(rn,{value:g,onChange:V=>w(V.currentTarget.value),placeholder:"Thank you for registering!",size:"xs",autosize:!0,minRows:1,maxRows:5,style:{flex:1},classNames:{input:Xe.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]}),O==="link"&&e.jsxs(e.Fragment,{children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"60px"},children:"URL"}),e.jsx(at,{value:g,onChange:V=>w(V.currentTarget.value),placeholder:"https://example.com",size:"xs",style:{flex:1},classNames:{input:Xe.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"60px"},children:"Open"}),e.jsxs("div",{style:{flex:1,display:"flex",gap:"6px"},children:[e.jsx(p,{onClick:()=>j("_current"),className:`${Xe.tabBtn} ${b==="_current"?Xe.tabBtnActive:Xe.tabBtnInactive}`,children:"Same tab"}),e.jsx(p,{onClick:()=>j("_blank"),className:`${Xe.tabBtn} ${b==="_blank"?Xe.tabBtnActive:Xe.tabBtnInactive}`,children:"New tab"})]})]})]}),O==="space"&&e.jsxs(e.Fragment,{children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"60px"},children:"Space"}),e.jsx(jt,{comboboxProps:{zIndex:99999},leftSection:I?e.jsx(es,{size:"xs"}):e.jsx(Qe,{icon:Xs.faSearch}),searchable:!0,limit:100,size:"xs",data:R,onChange:U,placeholder:"Search by name or slug",value:g,onSearchChange:me,style:{flex:1},classNames:{input:Xe.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"60px"},children:"Open"}),e.jsxs("div",{style:{flex:1,display:"flex",gap:"6px"},children:[e.jsx(p,{onClick:()=>j("_current"),className:`${Xe.tabBtn} ${b==="_current"?Xe.tabBtnActive:Xe.tabBtnInactive}`,children:"Same tab"}),e.jsx(p,{onClick:()=>j("_blank"),className:`${Xe.tabBtn} ${b==="_blank"?Xe.tabBtnActive:Xe.tabBtnInactive}`,children:"New tab"})]})]})]})]})});const lt={display:"flex",alignItems:"center",gap:"12px"},$e={fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"50px"},Je={input:Xe.focusInput},tt={input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}},Ge={input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}};return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[d==="calendar_invite"&&e.jsx(N,{size:"xs",c:"dimmed",children:"Set the event date, time, and details in the “Event details” panel below."}),d==="invite"&&e.jsx(rn,{label:"Default share message",description:"Members can personalize this before sharing.",value:Q,onChange:V=>ie(V.currentTarget.value),maxLength:240,autosize:!0,minRows:3,rightSection:e.jsxs(N,{size:"xs",c:"dimmed",style:{alignSelf:"flex-end",paddingBottom:8},children:[Q.length,"/240"]}),rightSectionWidth:52}),d==="action"&&e.jsxs(p,{style:lt,children:[e.jsx(N,{style:$e,children:"Action"}),e.jsx(Ue,{value:m,onChange:V=>cn(V.target.value),size:"xs",data:t.context==="broadcast"?[{value:"registration",label:"Link to this space"},...u!=null&&u.is_paid&&((mt=u==null?void 0:u.payment_settings)!=null&&mt.space_plans_enabled)?[{value:"checkout",label:"Link to checkout page"}]:[],{value:"nothing",label:"No action"},{value:"space",label:"Link to another space"},{value:"custom_url",label:"Custom URL"}]:Y?[{value:"nothing",label:"No action"},{value:"registration",label:"Register for this space"},...u!=null&&u.is_paid&&((ae=u==null?void 0:u.payment_settings)!=null&&ae.space_plans_enabled)?[{value:"checkout",label:"Link to checkout page"}]:[],{value:"section",label:"Jump to a section"},{value:"space",label:"Link to another space"},{value:"custom_url",label:"Custom URL"}]:[{value:"registration",label:"Register for this space"},...u!=null&&u.is_paid&&((zt=u==null?void 0:u.payment_settings)!=null&&zt.space_plans_enabled)?[{value:"checkout",label:"Link to checkout page"}]:[],{value:"nothing",label:"No action"},{value:"section",label:"Jump to a section"},{value:"space",label:"Link to another space"},{value:"custom_url",label:"Custom URL"}],style:{flex:1},classNames:Je,styles:tt})]}),d==="mark_complete"&&e.jsxs(p,{style:lt,children:[e.jsx(N,{style:$e,children:"After"}),e.jsx(Ue,{value:m,onChange:V=>cn(V.target.value),size:"xs",data:[...Array.isArray(u.parents_versions)&&(u.parents_versions.includes("course")||u.parents_versions.includes("section"))||u.version==="course"||u.version==="section"?[{value:"auto",label:"Auto (next section)"}]:[],{value:"nothing",label:"Nothing"},{value:"next_space",label:"Link to next space"},{value:"space",label:"Link to another space"},{value:"custom_url",label:"Custom URL"}],style:{flex:1},classNames:Je,styles:tt})]}),d==="mark_complete"&&["next_space","space"].includes(m)&&e.jsxs(p,{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:"Add if private"}),e.jsx(vt,{label:"Automatically adds the member to the next space if it’s private.",multiline:!0,w:240,withArrow:!0,position:"top",zIndex:999999,events:{hover:!0,focus:!0,touch:!0},children:e.jsx(p,{component:"span",tabIndex:0,"aria-label":"About Add if private",style:{display:"inline-flex",color:"#868e96",cursor:"help"},children:e.jsx(En,{size:17,strokeWidth:1.75,"aria-hidden":"true"})})})]}),e.jsx(Ve,{"aria-label":"Add if private",checked:k,onChange:V=>{const te=V.currentTarget.checked;C(te),D({addIfPrivate:te,buttonAction:m}),t.saveNodeData()},size:"md"})]}),d==="bundle"&&e.jsxs(p,{style:{display:"flex",alignItems:"flex-start",ga
2p:"12px"},children:[e.jsx(N,{style:{...$e,paddingTop:"6px"},children:"Bundle"}),e.jsxs(p,{style:{flex:1,display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(Ue,{value:L,onChange:V=>S(V.target.value),size:"xs",data:W,classNames:Je,styles:tt}),(!L||L==="new_bundle")&&e.jsx(We,{variant:"outline",radius:"xl",size:"xs",onClick:()=>{c(Yt({opened:"createBundle"}))},children:"Add bundle"})]})]}),d==="survey"&&e.jsxs(p,{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[e.jsx(N,{style:{...$e,paddingTop:"6px"},children:"Survey"}),e.jsxs(p,{style:{flex:1,display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(Ue,{value:P,onChange:V=>$(V.target.value),size:"xs",data:X,classNames:Je,styles:tt}),(!P||P==="new_survey")&&e.jsx(We,{variant:"outline",radius:"xl",size:"xs",className:Xe.surveyActionButton,onClick:()=>{c(Yt({opened:"createSurvey",option:{context:"actionbutton"}}))},children:"Create survey"}),P&&P!=="new_survey"&&e.jsxs(p,{style:{display:"flex",gap:"6px"},children:[e.jsx(We,{variant:"subtle",size:"compact-xs",className:Xe.surveyActionButton,onClick:()=>{c(Yt({opened:"showSurvey",option:{survey:{id:P}}}))},children:"View responses"}),e.jsx(We,{variant:"subtle",size:"compact-xs",className:Xe.surveyActionButton,onClick:()=>{c(Yt({opened:"createSurvey",option:{survey:{id:P},context:"actionbutton"}}))},children:"Edit survey"})]})]})]}),fe&&m==="space"&&e.jsxs(p,{style:lt,children:[e.jsx(N,{style:$e,children:"Space"}),e.jsx(jt,{comboboxProps:{zIndex:99999},leftSection:I?e.jsx(es,{size:"xs"}):e.jsx(Qe,{icon:Xs.faSearch}),searchable:!0,limit:100,size:"xs",data:R,onChange:V=>U(V),placeholder:"Search by name or slug",description:g&&`→ ${g}`,value:g,onSearchChange:V=>me(V),style:{flex:1},classNames:Je,styles:{...tt,description:{fontWeight:600,fontSize:"11px"}}})]}),fe&&m==="custom_url"&&e.jsxs(p,{style:lt,children:[e.jsx(N,{style:$e,children:"URL"}),e.jsx(at,{value:g,onChange:V=>w(V.currentTarget.value),placeholder:"https://example.com",size:"xs",style:{flex:1},classNames:Je,styles:Ge})]}),fe&&t.context!=="broadcast"&&e.jsxs(p,{style:lt,children:[e.jsx(N,{style:$e,children:"Open"}),e.jsxs("div",{style:{flex:1,display:"flex",gap:"6px"},children:[e.jsx(p,{onClick:()=>j("_current"),className:`${Xe.tabBtn} ${b==="_current"?Xe.tabBtnActive:Xe.tabBtnInactive}`,children:"Same tab"}),e.jsx(p,{onClick:()=>j("_blank"),className:`${Xe.tabBtn} ${b==="_blank"?Xe.tabBtnActive:Xe.tabBtnInactive}`,children:"New tab"})]})]}),m==="section"&&e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(N,{size:"xs",c:"dimmed",children:s("tiptap.components.sidebar.buttonAction.description5")}),e.jsx(We,{radius:"xl",size:"xs",color:G?"green":null,onClick:()=>{var te,he;const V=(he=(te=f==null?void 0:f.view)==null?void 0:te.state)==null?void 0:he.selection;V&&(window.$sectionParams={origin:{from:V.from,to:V.to},isSelection:!0,swalTitle:s("tiptap.components.sidebar.buttonAction.label5"),onUpdateLink:le=>{Ee(le,"_section","section"),w(le),j("_section"),T(!1)}},T(!0))},children:s(G?"tiptap.components.sidebar.buttonAction.label14":"tiptap.components.sidebar.buttonAction.selectSection")})]}),d==="mark_complete"&&n&&n.pathname.indexOf("/registration")<0&&e.jsxs(p,{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:"Show in header"}),e.jsx(vt,{label:"Show the mark complete button in the header.",multiline:!0,w:240,withArrow:!0,position:"top",zIndex:999999,events:{hover:!0,focus:!0,touch:!0},children:e.jsx(p,{component:"span",tabIndex:0,"aria-label":"About Show in header",style:{display:"inline-flex",color:"#868e96",cursor:"help"},children:e.jsx(En,{size:17,strokeWidth:1.75,"aria-hidden":"true"})})})]}),e.jsx(Ve,{checked:A,onChange:V=>ht(V.target.checked),size:"md"})]})]})}const zo=999999,Wa=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Sao_Paulo","Europe/London","Europe/Paris","Europe/Berlin","Europe/Madrid","Africa/Johannesburg","Asia/Dubai","Asia/Kolkata","Asia/Singapore","Asia/Tokyo","Australia/Sydney","Pacific/Auckland"],wh=t=>{let n=Wa;try{if(typeof Intl.supportedValuesOf=="function"){const o=Intl.supportedValuesOf("timeZone");Array.isArray(o)&&o.length&&(n=o)}}catch{n=Wa}return t&&!n.includes(t)&&(n=[t,...n]),n.map(o=>({value:o,label:o.replace(/_/g," ")}))},Xr=t=>{if(!t)return"";const n=String(t).trim();return/^\d{4}-\d{2}-\d{2}$/.test(n)?`${n} 00:00:00`:n.replace("T"," ")},ro=t=>{if(!t)return"";const n=String(t).trim().match(/^(\d{4}-\d{2}-\d{2})/);
2return n?n[1]:""},Lo=t=>String(t).padStart(2,"0"),Ch=t=>{const n=Xr(t);if(!n)return null;const[o,s="00:00:00"]=n.split(" "),[r,i,c]=o.split("-").map(Number),[u=0,a=0,f=0]=s.split(":").map(Number);if(!r||!i||!c)return null;const d=new Date(r,i-1,c,u,a,f);return Number.isNaN(d.getTime())?null:d},Sh=t=>`${t.getFullYear()}-${Lo(t.getMonth()+1)}-${Lo(t.getDate())} ${Lo(t.getHours())}:${Lo(t.getMinutes())}:${Lo(t.getSeconds())}`,Th=t=>{const n=Ch(t);return n?(n.setHours(n.getHours()+1),Sh(n)):""},Un={fontSize:"13px",color:"#868e96",fontWeight:500},In={input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}};function Ih(t){const n=ee(F=>F.tiptap),o=t.editor||(n==null?void 0:n.editor),s=l.useRef(null),r=l.useRef(null),i=l.useRef(null),[c,u]=l.useState(""),[a,f]=l.useState(""),[d,h]=l.useState(""),[m,x]=l.useState(""),[g,w]=l.useState(!1),[b,j]=l.useState(""),[A,v]=l.useState(""),k=l.useRef(null);l.useEffect(()=>{var T,L;const F=(L=(T=t.element)==null?void 0:T.node)==null?void 0:L.attrs;if(!F)return;const G=F.uid;k.current!==G&&(k.current=G,s.current=null,setTimeout(()=>{s.current=G},0),u(F.eventTitle||""),f(F.eventStart||""),h(F.eventEnd||""),x(F.eventTimezone||""),w(!!F.eventAllDay),j(F.eventLocation||""),v(F.eventDescription||""))},[t.element]),l.useEffect(()=>()=>{r.current&&clearTimeout(r.current),i.current&&clearTimeout(i.current)},[]),l.useEffect(()=>{var G,T;const F=(T=(G=t.element)==null?void 0:G.node)==null?void 0:T.attrs;F&&s.current===F.uid&&(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,be(o,t.element,{eventTitle:c,eventStart:a,eventEnd:d,eventTimezone:m,eventAllDay:g,eventLocation:b,eventDescription:A})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{var S;i.current=null,(S=t.saveNodeData)==null||S.call(t)},1500))},400))},[c,a,d,m,g,b,A]);const C=l.useMemo(()=>{const F=new Date;return new Date(F.getFullYear(),F.getMonth(),F.getDate())},[]),I=F=>{const G=F||"";f(G),G&&h(Th(G))},_=F=>{w(F),F?(f(G=>ro(G)),h(G=>ro(G))):(f(G=>{const T=ro(G);return T?`${T} 09:00:00`:""}),h(G=>{const T=ro(G);return T?`${T} 10:00:00`:""}))},R=l.useMemo(()=>wh(m),[m]);return e.jsxs(Fe,{gap:12,children:[e.jsxs(p,{children:[e.jsx(N,{style:Un,mb:4,children:"Event name"}),e.jsx(at,{value:c,onChange:F=>u(F.currentTarget.value),placeholder:"e.g. Live Q&A session",size:"xs",styles:In})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{style:Un,children:"All-day event"}),e.jsx(Ve,{checked:g,onChange:F=>_(F.currentTarget.checked),size:"md"})]}),e.jsxs(p,{children:[e.jsx(N,{style:Un,mb:4,children:"Starts"}),g?e.jsx(Yr,{value:ro(a)||null,onChange:F=>f(F||""),placeholder:"Pick a date",size:"xs",clearable:!0,minDate:C,popoverProps:{zIndex:zo},styles:In}):e.jsx(Ia,{value:Xr(a)||null,onChange:I,placeholder:"Pick date and time",size:"xs",clearable:!0,minDate:C,popoverProps:{zIndex:zo},styles:In})]}),e.jsxs(p,{children:[e.jsx(N,{style:Un,mb:4,children:"Ends"}),g?e.jsx(Yr,{value:ro(d)||null,onChange:F=>h(F||""),placeholder:"Same day",size:"xs",clearable:!0,minDate:C,popoverProps:{zIndex:zo},styles:In}):e.jsx(Ia,{value:Xr(d)||null,onChange:F=>h(F||""),placeholder:"Defaults to 1 hour after start",size:"xs",clearable:!0,minDate:C,popoverProps:{zIndex:zo},styles:In})]}),!g&&e.jsxs(p,{children:[e.jsx(N,{style:Un,mb:4,children:"Time zone"}),e.jsx(jt,{value:m||null,onChange:F=>x(F||""),data:R,placeholder:"Select time zone",size:"xs",searchable:!0,limit:100,nothingFoundMessage:"No time zone found",comboboxProps:{zIndex:zo},styles:In})]}),e.jsxs(p,{children:[e.jsx(N,{style:Un,mb:4,children:"Location"}),e.jsx(at,{value:b,onChange:F=>j(F.currentTarget.value),placeholder:"Address or meeting link",size:"xs",styles:In})]}),e.jsxs(p,{children:[e.jsx(N,{style:Un,mb:4,children:"Description"}),e.jsx(rn,{value:A,onChange:F=>v(F.currentTarget.value),placeholder:"What should attendees know?",size:"xs",autosize:!0,minRows:2,maxRows:6,styles:In})]})]})}const ft=(t,n="")=>{var r,i,c,u,a;const s=((i=(r=t==null?void 0:t.node)==null?void 0:r.attrs)==null?void 0:i.uid)||`${(c=t==null?void 0:t.pos)!=null?c:"unknown"}:${((a=(u=t==null?void 0:t.node)==null?void 0:u.type)==null?void 0:a.name)||"node"}`;return n?`${s}:${n}`:s},Nt=({currentKeyRef:t,nextKey:n,pendingValueRef:o,incomingValue:s})=>{const r=s!=null?s:"",i=t.current!==n;return t.current=n,i?(o.current=null,{shouldApply:!0,value:r}):o.current!==null?o.current===r?(o.current=null,{shouldApply:!0,value:r}):{shouldApply:!1,value:r}:{shouldApply:!0,value:r}},ji={position:"right-start",offset:15,zIndex:999999,width:264,withinPortal:!0,floatingStrategy:"fixed",middlewares:{shift:{padding:8},flip:{fallbackPlacements:["right-end","left-start","left-end","bottom-start"]}}},_h="_colorDotGroup_4k8wl_1",Ah="_colorDot_4k8wl_1",Bh="_colorDotTransparent_4k8wl_14",Rh="_colorLabel_4k8wl_30",Eh="_removeBtn_4k8wl_36",Po={colorDotGroup:_h,colorDot:Ah,colorDotTransparent:Bh,colorLabel:Rh,removeBtn:Eh},zh=t=>typeof t=="string"&&(t.includes("themed(")||t.startsWith("token:")||t.startsWith("gradient:")||t.startsWith("recipe:")||t.startsWith("tint:")),Lh=t=>{if(typeof t!="string")return!1;if(t.trim().toLowerCase()==="transparent")return!0;const n=qt(t);return n.isValid()&&n.getAlpha()===0};function wt({element:t,saveNodeData:n,editor:o,attrName:s,objectKey:r=null,swatchType:i="dark",fallbackColor:c="",clearLabel:u,clearValue:a="transparent",resolveHexLabel:f=!0}){var X;
2const d=Dt(),h=ee(q=>q.tiptap),m=ee(q=>q.colors),x=o||(h==null?void 0:h.editor),g=l.useRef(null),w=l.useRef(!1),b=l.useRef(null),j=l.useRef(null),[A,v]=l.useState(""),[k,C]=l.useState(!1),I=!!((X=t==null?void 0:t.node)!=null&&X.attrs),R=I?(q=>{var Q;return r?(Q=q==null?void 0:q[s])==null?void 0:Q[r]:q==null?void 0:q[s]})(t.node.attrs)||c||"":c||"",F=ft(t,r?`${s}.${r}`:s);l.useEffect(()=>{if(!I)return;const{shouldApply:q}=Nt({currentKeyRef:j,nextKey:F,pendingValueRef:b,incomingValue:R});q&&v(R)},[I,R,F]),l.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),l.useEffect(()=>{var Q;if(!w.current||!t||!t.node.attrs)return;let q;if(r){const{node:B}=St(x,t)||{},O=((Q=B==null?void 0:B.attrs)==null?void 0:Q[s])||t.node.attrs[s]||{};q={[s]:{...O,[r]:A}}}else q={[s]:A};be(x,t,q)&&(g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{g.current=null,w.current=!1,n()},2e3))},[x,s,r,A,t,n]);const G=q=>{const Q=q||"";w.current=!0,b.current=Q,v(Q)},T=()=>{w.current=!0,b.current=a,v(a),C(!1)},L=zh(A)?Zt(A,m):A,S=typeof L=="string"&&L.includes("gradient("),W=Lh(L),E=!L||L==="none"?"#ffffff":L,P=S?"Gradient":W?"Transparent":f?(qt(E).toHexString()||"#ffffff").toUpperCase():(A||"#FFFFFF").toUpperCase(),$=[Po.colorDot,W?Po.colorDotTransparent:""].filter(Boolean).join(" ");return e.jsxs(we,{...ji,opened:k,onChange:q=>{q||C(!1)},children:[e.jsx(we.Target,{children:e.jsxs(ye,{gap:10,className:Po.colorDotGroup,onClick:()=>C(q=>!q),role:"button",tabIndex:0,"aria-label":`Edit ${s} color`,onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),C(Q=>!Q))},children:[e.jsx(p,{className:$,style:W?void 0:{background:E}}),e.jsx(N,{className:Po.colorLabel,children:P})]})}),e.jsx(we.Dropdown,{style:{maxHeight:"calc(100vh - 16px)",overflowY:"auto"},children:e.jsxs("div",{className:"gradient-color-picker",children:[e.jsx(Vt,{value:A,onChange:G,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,width:240,height:160,presets:an(d,i)}),u&&e.jsx(p,{onClick:T,className:Po.removeBtn,children:u})]})})]})}const Ph="_colorDot_13ihj_1",Wh="_colorDotNone_13ihj_17",Oh="_removeBtn_13ihj_28",Mh="_toggleBtn_13ihj_45",Nh="_toggleBtnActive_13ihj_59",$h="_toggleBtnInactive_13ihj_64",fn={colorDot:Ph,colorDotNone:Wh,removeBtn:Oh,toggleBtn:Mh,toggleBtnActive:Nh,toggleBtnInactive:$h},Dh={position:"right-start",offset:15,zIndex:999999,width:264,withinPortal:!0,floatingStrategy:"fixed",middlewares:{shift:{padding:8},flip:{fallbackPlacements:["right-end","left-start","left-end","bottom-start"]}}};function Zr({element:t,saveNodeData:n,editor:o,hideWidthToggles:s,widthOnly:r,colorAttr:i="buttonBorderColor",widthAttr:c="buttonBorderWidth",backgroundAttr:u="buttonBackgroundColor",fallbackColor:a="none",equalBackgroundMeansNone:f=!0}){var Q;const d=Dt(),h=ee(B=>B.colors),m=ee(B=>B.tiptap),x=o||(m==null?void 0:m.editor),g=l.useRef(null),w=l.useRef(!1),b=l.useRef(!1),j=l.useRef(null),A=l.useRef(null),v=l.useRef(null),k=l.useRef(null),[C,I]=l.useState("none"),[_,R]=l.useState("1"),[F,G]=l.useState(!1),T=!!((Q=t==null?void 0:t.node)!=null&&Q.attrs),L=T?(()=>{const B=t.node.attrs[i]||a,O=u?t.node.attrs[u]:null;return!B||B==="none"||f&&B===O?"none":Zt(B,h)})():"none",S=T&&t.node.attrs[c]||"1",W=ft(t,i),E=ft(t,c);l.useEffect(()=>{if(!T)return;const{shouldApply:B}=Nt({currentKeyRef:v,nextKey:W,pendingValueRef:j,incomingValue:L});B&&I(L)},[W,T,L]),l.useEffect(()=>{if(!T)return;const{shouldApply:B}=Nt({currentKeyRef:k,nextKey:E,pendingValueRef:A,incomingValue:S});B&&R(S)},[T,S,E]),l.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),l.useEffect(()=>{w.current&&(!t||!t.node.attrs||be(x,t,{[i]:C})&&(g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{g.current=null,w.current=!1,b.current=!1,n()},2e3)))},[x,C,i,t,n]),l.useEffect(()=>{b.current&&(!t||!t.node.attrs||be(x,t,{[c]:_})&&(g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{g.current=null,b.current=!1,w.current=!1,n()},2e3)))},[x,_,t,n,c]);const P=!C||C==="none",$=B=>{if(!F)return;const O=B||"";w.current=!0,j.current=O,I(O)},X=()=>{w.current=!0,j.current="none",I("none"),G(!1)},q=B=>{b.current=!0,A.current=B,R(B)};return r?e.jsx(ye,{gap:6,grow:!0,children:["1","2","3","4"].map(B=>e.jsxs(p,{onClick:()=>q(B),className:`${fn.toggleBtn} ${_===B?fn.toggleBtnActive:fn.toggleBtnInactive}`,children:[B,"px"]},B))}):e.jsxs(p,{children:[e.jsxs(we,{...Dh,opened:F,onChange:B=>{B||G(!1)},children:[e.jsx(we.Target,{children:e.jsxs(ye,{gap:10,style:{cursor:"pointer"},onClick:()=>G(B=>!B),children:[e.jsx(p,{className:`${fn.colorDot} ${P?fn.colorDotNone:""}`,style:{background:P?"white":C}}),e.jsx(N,{style:{fontSize:11,color:"#aaa",fontWeight:500},children:P?"None":qt(C).getAlpha()<1?qt(C).toRgbString():qt(C).toHexString().toUpperCase()})]})}),e.jsx(we.Dropdown,{style:{maxHeight:"calc(100vh - 16px)",overflowY:"auto"},children:e.jsxs("div",{className:"gradient-color-picker",children:[e.jsx(Vt,{value:P?"#7950f2":C,onChange:$,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,hideGradientControls:!0,width:240,height:160,presets:an(d,"dark")}),e.jsx(p,{onClick:X,className:fn.removeBtn,children:"Remove border"})]})})]}),!s&&!P&&e.jsx(ye,{gap:6,grow:!0,mt:10,children:["1","2","3","4"].map(B=>e.jsxs(p,{onClick:()=>q(B),className:`${fn.toggleBtn} ${_===B?fn.toggleBtnActive:fn.toggleBtnInactive}`,children:[B,"px"]},B))})]})}const Fh=[{value:"none",label:"None",icon:e.jsx("svg",{width:"24",height:"14",viewBox:"0 0 24 14",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("rect",{x:"2",y:"1",width:"20",height:"12",rx:"3"})})},{value:"subtle",label:"Subtle",icon:e.jsxs("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",children:[e.jsx("rect",{x:"2",y:"1",width:"20",height:"12",rx:"3",stroke:"currentColor",strokeWidth:"2"}),e.jsx("rect",{x:"4",y:"5",width:"18",height:"10",rx:"3",fill:"
2currentColor",opacity:"0.12"})]})},{value:"strong",label:"Strong",icon:e.jsxs("svg",{width:"24",height:"18",viewBox:"0 0 24 18",fill:"none",children:[e.jsx("rect",{x:"2",y:"1",width:"20",height:"12",rx:"3",stroke:"currentColor",strokeWidth:"2"}),e.jsx("rect",{x:"5",y:"6",width:"18",height:"12",rx:"3",fill:"currentColor",opacity:"0.2"})]})}];function Hh({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("none");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.buttonShadow||"none")},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{buttonShadow:u})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u]);const f=d=>{c.current=!0,a(d)};return e.jsx(ye,{gap:6,grow:!0,children:Fh.map(d=>e.jsx(Be,{icon:d.icon,label:d.label,value:d.value,active:u===d.value,onClick:()=>f(d.value)},d.value))})}const Uh=2e3;function mn({element:t,saveNodeData:n,editor:o,attrName:s,defaultValue:r}){const i=ee(m=>m.tiptap),c=o||(i==null?void 0:i.editor),u=l.useRef(null),a=l.useRef(!1),[f,d]=l.useState(r);l.useEffect(()=>{if(!t||!t.node.attrs)return;const m=t.node.attrs[s];d(m==null?r:m),a.current=!1},[t,s]),l.useEffect(()=>{a.current&&(a.current=!1,!(!t||!t.node.attrs)&&c&&be(c,t,{[s]:f})&&(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,n==null||n()},Uh)))},[c,t,n,f,s]),l.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const h=l.useCallback(m=>{a.current=!0,d(m)},[]);return[f,h]}const Vh=[{value:"none",label:"None",icon:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("rect",{x:"3",y:"8",width:"18",height:"8",rx:"3"})})},{value:"auto",label:"Auto",icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"10",width:"18",height:"8",rx:"3"}),e.jsx("path",{d:"M12 2v3M6.5 4l1.6 2M17.5 4l-1.6 2",strokeLinecap:"round"})]})},{value:"darken",label:"Dark",icon:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("rect",{x:"3",y:"8",width:"18",height:"8",rx:"3",fill:"currentColor",fillOpacity:"0.35"})})},{value:"lift",label:"Lift",icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"12",width:"18",height:"7",rx:"3",opacity:"0.35"}),e.jsx("rect",{x:"3",y:"5",width:"18",height:"7",rx:"3",fill:"white"})]})},{value:"custom",label:"Custom",icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M5 5l2 2M17 17l2 2M19 5l-2 2M7 17l-2 2",strokeLinecap:"round"})]})}],Kh={none:"No hover feedback.",auto:"Derived from the fill — light fills darken, dark fills lighten, and transparent fills tint toward the text colour. This is the default.",darken:"Always darkens the fill, whatever it is. On a very dark fill there's little room left to darken — use Auto if you want it to lighten instead.",lift:"Rises 2px and deepens the shadow. The fill is left alone.",custom:null},Gh=[{value:"inherit",label:"Same as resting"},{value:"none",label:"None"},{value:"subtle",label:"Subtle"},{value:"strong",label:"Strong"}],Oa={fill:"",text:"",border:"none",lift:0,scale:100,shadow:"inherit",transition:120},Rs={fontSize:"12px",color:"#868e96",fontWeight:500,flexShrink:0,width:"52px"};function Yh({element:t,saveNodeData:n,editor:o}){const s=ee(m=>m.colors),[r,i]=mn({element:t,saveNodeData:n,editor:o,attrName:"buttonHover",defaultValue:Nu}),[c,u]=mn({element:t,saveNodeData:n,editor:o,attrName:"buttonHoverCustom",defaultValue:null}),a={...Oa,...c||{}},f=m=>x=>u({...a,[m]:x}),d=m=>{var x,g,w,b;m==="custom"&&!c&&u({...Oa,fill:Zt((g=(x=t==null?void 0:t.node)==null?void 0:x.attrs)==null?void 0:g.buttonBackgroundColor,s)||"",text:Zt((b=(w=t==null?void 0:t.node)==null?void 0:w.attrs)==null?void 0:b.buttonTextColor,s)||""}),i(m)},h=Kh[r];return e.jsxs(p,{children:[e.jsx(ye,{gap:4,grow:!0,children:Vh.map(m=>e.jsx(Be,{icon:m.icon,label:m.label,value:m.value,compact:!0,active:r===m.value,onClick:()=>d(m.value)},m.value))}),h&&e.jsx(N,{style:{fontSize:"11px",color:"#adb5bd",lineHeight:1.5,marginTop:"10px"},children:h}),r==="custom"&&e.jsxs(p,{mt:12,p:12,style:{border:"1px dashed #e0e0e0",borderRadius:"8px",background:"#fafafa"},children:[e.jsx(N,{style:{fontSize:"10px",fontWeight:700,letterSpacing:"0.08em",color:"#868e96",marginBottom:"10px"},children:"CUSTOM HOVER"}),e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx(N,{style:Rs,children:"Fill"}),e.jsx(wt,{attrName:"buttonHoverCustom",objectKey:"fill",saveNodeData:n,element:t,editor:o,swatchType:"dark",clearLabel:"Remove fill"})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx(N,{style:Rs,children:"Text"}),e.jsx(wt,{attrName:"buttonHoverCustom",objectKey:"text",saveNodeData:n,element:t,editor:o,swatchType:"light"})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx(N,{style:Rs,children:"Border"}),e.jsx(wt,{attrName:"buttonHoverCustom",objectKey:"border",saveNodeData:n,element:t,editor:o,swatchType:"dark",clearLabel:"Remove border",clearValue:"none"})]}),e.jsx(He,{label:"Lift",labelWidth:"52px",value:a.lift,min:0,max:8,onChange:f("lift")}),e.jsx(He,{label:"Scale",labelWidth:"52px",unit:"%",value:a.scale,min:90,max:115,onChange:f("scale")}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx(N,{style:Rs,children:"Shadow"}),e.jsx(Ue,{value:a.shadow,onChange:m=>f("shadow")(m.target.value),size:"xs",data:Gh,style:{flex:1}
2,classNames:{input:Ze.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]}),e.jsx(He,{label:"Speed",labelWidth:"52px",unit:"ms",value:a.transition,min:0,max:400,step:10,onChange:f("transition")})]})]})]})}const qh="_grid_hpx6u_1",Xh="_button_hpx6u_5",Zh="_buttonActive_hpx6u_29",Qh="_buttonDisabled_hpx6u_34",Es={grid:qh,button:Xh,buttonActive:Zh,buttonDisabled:Qh},Pe=({options:t,activeValue:n,onChange:o,columns:s=5})=>e.jsx(as,{cols:s,spacing:5,className:Es.grid,children:t.map((r,i)=>{var a;const c=n===r.value||r.value===null&&n===null,u=r.disabled===!0;return e.jsx(p,{onClick:()=>{u||o(r.value)},"aria-disabled":u||void 0,title:r.title,className:`${Es.button} ${c?Es.buttonActive:""} ${u?Es.buttonDisabled:""}`,style:{border:`1.5px solid ${c?"#7950f2":"#e0e0e0"}`,backgroundColor:c?"#7950f2":"white",color:c?"white":"#888"},children:r.label},(a=r.value)!=null?a:`preset-${i}`)})}),Ma=[{label:"S",value:"S"},{label:"M",value:"M"},{label:"L",value:"L"},{label:"XL",value:"XL"}],Jh={label:"CUSTOM",value:Uo};function Na({element:t,saveNodeData:n,editor:o,variant:s="button",allowCustom:r=!0}){const i=s==="badge",c=i?"badgePillSize":"buttonSize",u=i?"badgePillSizeCustom":"buttonSizeCustom",a=i?Du:Fu,[f,d]=mn({element:t,saveNodeData:n,editor:o,attrName:c,defaultValue:"M"}),[h,m]=mn({element:t,saveNodeData:n,editor:o,attrName:u,defaultValue:null}),x=l.useRef("M"),g=r?[...Ma,Jh]:Ma,w=f===Uo&&r,b=$u(h,a(x.current)),j=v=>{if(v===Uo){if(!w){const k=f&&f!==Uo?f:"M";x.current=k,m(a(k))}d(Uo);return}x.current=v,d(v)},A=v=>k=>{m({...b,[v]:k})};return e.jsxs(p,{children:[e.jsx(Pe,{options:g,activeValue:f,onChange:j,columns:g.length}),w&&e.jsxs(p,{mt:12,p:12,style:{border:"1px dashed #e0e0e0",borderRadius:"8px",background:"#fafafa"},children:[e.jsx(N,{style:{fontSize:"10px",fontWeight:700,letterSpacing:"0.08em",color:"#868e96",marginBottom:"10px"},children:"CUSTOM SIZE"}),e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(He,{label:"Pad Y",labelWidth:"46px",value:b.padY,min:Tn.padY.min,max:Tn.padY.max,onChange:A("padY")}),e.jsx(He,{label:"Pad X",labelWidth:"46px",value:b.padX,min:Tn.padX.min,max:Tn.padX.max,onChange:A("padX")}),e.jsx(He,{label:"Font",labelWidth:"46px",value:b.fontSize,min:Tn.fontSize.min,max:Tn.fontSize.max,onChange:A("fontSize")}),i&&e.jsx(He,{label:"Dot",labelWidth:"46px",value:b.dot,min:Tn.dot.min,max:Tn.dot.max,onChange:A("dot")})]}),e.jsxs(N,{onClick:()=>m(a(x.current)),style:{marginTop:"10px",fontSize:"11px",fontWeight:600,color:"#7950f2",cursor:"pointer",display:"inline-block"},children:["Reset to ",x.current]})]})]})}const ep=[{label:"Default",value:""},{label:"12px",value:"12px"},{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"},{label:"32px",value:"32px"},{label:"40px",value:"40px"},{label:"48px",value:"48px"},{label:"64px",value:"64px"},{label:"80px",value:"80px"}],tp=[{label:"Default",value:""},{label:"1.0",value:"1.0"},{label:"1.1",value:"1.1"},{label:"1.2",value:"1.2"},{label:"1.3",value:"1.3"},{label:"1.4",value:"1.4"},{label:"1.5",value:"1.5"},{label:"1.6",value:"1.6"},{label:"1.7",value:"1.7"},{label:"1.8",value:"1.8"},{label:"1.9",value:"1.9"},{label:"2.0",value:"2.0"}],np={100:"Thin",200:"Extra Light",300:"Light",400:"Regular",500:"Medium",600:"Semibold",700:"Bold",800:"Extrabold",900:"Black"},$a=[{label:"Default",value:""},{label:"100 Thin",value:"100"},{label:"200 Extra Light",value:"200"},{label:"300 Light",value:"300"},{label:"400 Regular",value:"400"},{label:"500 Medium",value:"500"},{label:"600 Semibold",value:"600"},{label:"700 Bold",value:"700"},{label:"800 Extrabold",value:"800"},{label:"900 Black",value:"900"}];function Jc(t){const n=String(t||"").split(",")[0].trim().replace(/^["']|["']$/g,""),o=Hu[n];if(!o)return $a;const s=new Set(o.map(String));return $a.filter(r=>r.value===""||s.has(r.value))}const cs="Default";function eu(t){return t.map(n=>n.value===""?{value:""}:n.value)}function tu(t,n){return t.some(o=>
2typeof o=="string"?o===n:o.value===n)}function os(t){return t===cs?"":t||""}function nu({options:t,search:n,limit:o}){const s=os(n).trim().toLowerCase(),r=t.some(c=>c.label.toLowerCase()===s),i=!s||r?t:t.filter(c=>c.label.toLowerCase().includes(s));return i.slice(0,o!=null?o:i.length)}function ou({option:t}){return t.value===""?cs:t.label}const op=new Map(sr.map(t=>[t.value,t.value||"inherit"])),sp=[{value:"none",label:"None"},{value:"uppercase",label:"UPPERCASE"},{value:"lowercase",label:"lowercase"},{value:"capitalize",label:"Capitalize"}],Da={input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}},fr={fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"60px"};function Fa({element:t,saveNodeData:n,editor:o,variant:s="button"}){var w,b;const r=s==="badge",i=r?"badgePillFont":"buttonFont",c=r?Uu:Vu,[u,a]=mn({element:t,saveNodeData:n,editor:o,attrName:i,defaultValue:null}),f={...c,...u||{}},d=j=>A=>{a({...f,[j]:A})},h=f.weight==null?"":String(f.weight),m=f.family===Ku?"":f.family||"",x=Jc(m).filter(j=>j.value!=="").map(j=>({value:j.value,label:`${np[j.value]} — ${j.value}`})),g=h!==""&&!x.some(j=>j.value===h);return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:fr,children:"Font"}),e.jsx(jt,{value:m,onChange:j=>d("family")(j||""),data:or,renderOption:({option:j})=>e.jsx(N,{size:"sm",style:{fontFamily:op.get(j.value)||"inherit"},children:j.label}),size:"xs",placeholder:"Default",searchable:!0,nothingFoundMessage:"No font found",maxDropdownHeight:300,comboboxProps:{zIndex:99999},style:{flex:1},classNames:{input:Ze.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px",fontFamily:m||"inherit"}}})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:fr,children:"Weight"}),e.jsx(Ue,{value:h,onChange:j=>d("weight")(j.target.value?Number(j.target.value):null),size:"xs",data:[...h===""?[{value:"",label:"Default"}]:[],...g?[{value:h,label:`${h} — not in this font`}]:[],...x],style:{flex:1},classNames:{input:Ze.focusInput},styles:Da})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:fr,children:"Case"}),e.jsx(Ue,{value:f.transform||"none",onChange:j=>d("transform")(j.target.value),size:"xs",data:sp,style:{flex:1},classNames:{input:Ze.focusInput},styles:Da})]}),e.jsxs(p,{p:12,style:{border:"1px dashed #e0e0e0",borderRadius:"8px",background:"#fafafa",display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(He,{label:"Letter spacing",labelWidth:"82px",unit:"em",value:(w=f.tracking)!=null?w:0,min:so.tracking.min,max:so.tracking.max,step:so.tracking.step,onChange:d("tracking")}),e.jsx(He,{label:"Line height",labelWidth:"82px",unit:"",value:(b=f.lineHeight)!=null?b:1.55,min:so.lineHeight.min,max:so.lineHeight.max,step:so.lineHeight.step,onChange:d("lineHeight")})]})]})}const rp="_input_1y8s8_1",ip={input:rp},lp=t=>{var o;return t!=null&&t.node?(t.node.attrs||{}).uid||t.uid||`${((o=t.node.type)==null?void 0:o.name)||"node"}:${t.pos}`:null};function ap(t){const n=l.useRef(null),o=l.useRef(!1),s=l.useRef(null),r=ee(f=>f.tiptap),i=t.editor||(r==null?void 0:r.editor),[c,u]=l.useState("");l.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),l.useEffect(()=>{var h,m;if(!((m=(h=t.element)==null?void 0:h.node)!=null&&m.attrs))return;const f=lp(t.element),d=t.element.node.attrs.text||"";if(s.current!==f){s.current=f,o.current=!1,u(d);return}o.current||u(d)},[t.element]);const a=f=>{if(!t.element||!t.element.node.attrs)return;const d=f.currentTarget.value;o.current=!0,u(d),be(i,t.element,{text:d})&&(n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,o.current=!1,t.saveNodeData()},2e3))};return e.jsx(at,{value:c,onChange:a,placeholder:"Badge text",classNames:{input:ip.input}})}const cp=[{id:"tip-orange",bg:"#ffe8cc",fg:"#e8590c",border:"none",label:"Tip"},{id:"info-blue",bg:"#dbe4ff",fg:"#364fc7",border:"none",label:"Info"},{id:"success-green",bg:"#d3f9d8",fg:"#2b8a3e",border:"none",label:"Success"},{id:"warning-red",bg:"#ffe3e3",fg:"#c92a2a",border:"none",label:"Warning"},{id:"note-yellow",bg:"#fff3bf",fg:"#e67700",border:"none",label:"Note"},{id:"quote-purple",bg:"#e8deee",fg:"#7048b6",border:"none",label:"Quote"},{id:"dark",bg:"#1a1a1a",fg:"#ffffff",border:"none",label:"Dark"},{id:"outline",bg:"transparent",fg:"#495057",border:"#495057",label:"Outline"}],su=[{color:"#e64980",label:"Pink"},{color:"#7950f2",label:"Violet"},{color:"#339af0",label:"Blue"},{color:"#40c057",label:"Green"},{color:"#fd7e14",label:"Orange"},{color:"#343a40",label:"Dark"}],up="_presetCard_1m24q_1",dp="_presetCardActive_1m24q_16",fp="_presetLabel_1m24q_24",hp="_presetLabelActive_1m24q_31",io={presetCard:up,presetCardActive:dp,presetLabel:fp,presetLabelActive:hp};function pp({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("tip-orange");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.badgePillPresetId||null)},[t]),l.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]);const f=d=>{c.current=!0,a(d.id);
2const h={badgePillPresetId:d.id,badgePillBackgroundColor:d.bg,badgePillTextColor:d.fg,badgePillBorderColor:d.border};be(r,t,h)&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,c.current=!1,n()},2e3))};return e.jsx(p,{children:e.jsx(as,{cols:4,spacing:6,children:cp.map(d=>e.jsxs(p,{onClick:()=>f(d),className:u===d.id?`${io.presetCard} ${io.presetCardActive}`:io.presetCard,children:[e.jsx(p,{style:{width:28,height:28,borderRadius:999,display:"flex",alignItems:"center",justifyContent:"center",background:d.bg==="transparent"?"#fff":d.bg,border:d.id==="outline"?`1.5px solid ${d.border}`:u===d.id?"2px solid #7950f2":"1px solid rgba(0,0,0,0.06)",fontSize:10,fontWeight:700,color:d.fg},children:"Aa"}),e.jsx(p,{className:u===d.id?`${io.presetLabel} ${io.presetLabelActive}`:io.presetLabel,children:d.label})]},d.id))})})}const xp=[{value:"none",label:"None",icon:e.jsx("svg",{width:"24",height:"14",viewBox:"0 0 24 14",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("rect",{x:"2",y:"1",width:"20",height:"12",rx:"3"})})},{value:"subtle",label:"Subtle",icon:e.jsxs("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",children:[e.jsx("rect",{x:"2",y:"1",width:"20",height:"12",rx:"3",stroke:"currentColor",strokeWidth:"2"}),e.jsx("rect",{x:"4",y:"5",width:"18",height:"10",rx:"3",fill:"currentColor",opacity:"0.12"})]})},{value:"strong",label:"Strong",icon:e.jsxs("svg",{width:"24",height:"18",viewBox:"0 0 24 18",fill:"none",children:[e.jsx("rect",{x:"2",y:"1",width:"20",height:"12",rx:"3",stroke:"currentColor",strokeWidth:"2"}),e.jsx("rect",{x:"5",y:"6",width:"18",height:"12",rx:"3",fill:"currentColor",opacity:"0.2"})]})}];function gp({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("none");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.badgePillShadow||"none")},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{badgePillShadow:u})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u]);const f=d=>{c.current=!0,a(d)};return e.jsx(ye,{gap:6,grow:!0,children:xp.map(d=>e.jsx(Be,{icon:d.icon,label:d.label,value:d.value,active:u===d.value,onClick:()=>f(d.value)},d.value))})}const mp=[{value:"text",label:"Text",icon:e.jsxs("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("path",{d:"M5 4h14"}),e.jsx("path",{d:"M12 4v9"})]})},{value:"icon",label:"Icon",icon:e.jsx("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 2.5 13.9 6.4 18.2 7 15.1 10 15.8 14.2 12 12.2 8.2 14.2 8.9 10 5.8 7 10.1 6.4z"})})}],Ha="⭐";function bp({element:t,saveNodeData:n,editor:o}){const s=ee(b=>b.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("text"),[f,d]=l.useState(Ha),[h,m]=l.useState(!1);l.useEffect(()=>{var b;(b=t==null?void 0:t.node)!=null&&b.attrs&&(a(t.node.attrs.badgePillContentType||"text"),d(t.node.attrs.badgePillIcon||Ha))},[t]),l.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]),l.useEffect(()=>{var j;if(!c.current||(c.current=!1,!((j=t==null?void 0:t.node)!=null&&j.attrs)))return;const b={badgePillContentType:u};u==="icon"&&(b.badgePillIcon=f),be(r,t,b)&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3))},[r,t,n,u,f]);const x=b=>{c.current=!0,a(b)},g=b=>{c.current=!0,d(b),m(!1)},w=()=>Ks(f);return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsx(ye,{gap:6,grow:!0,children:mp.map(b=>e.jsx(Be,{icon:b.icon,label:b.label,value:b.value,active:u===b.value,onClick:()=>x(b.value)},b.value))}),u==="icon"&&e.jsxs(we,{opened:h,onChange:m,position:"bottom",offset:10,withinPortal:!0,zIndex:1e5,children:[e.jsx(we.Target,{children:e.jsxs(p,{className:Ze.emojiTrigger,onClick:()=>m(b=>!b),children:[e.jsx(p,{style:{fontSize:"28px",lineHeight:1,display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"28px"},children:w()}),e.jsxs(p,{children:[e.jsx(N,{style:{fontSize:"12px",color:"#666",fontWeight:600},children:"Click to change"}),e.jsx(N,{style:{fontSize:"10px",color:"#999"},children:"Emoji · Icons · Numbers"})]})]})}),e.jsx(we.Dropdown,{children:e.jsx(Kr,{onSelect:g})})]}),u==="icon"&&e.jsx(N,{style:{fontSize:"11px",color:"#adb5bd",lineHeight:1.5},children:"The icon takes the badge's text colour. An icon badge is a square chip — use Corners to make it square, rounded or a circle."})]})}const yp=[{value:"disc",label:"Disc",icon:e.jsxs("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("circle",{cx:"5",cy:"8",r:"2.5",fill:"currentColor",stroke:"none"}),e.jsx("path",{d:"M11 8h10"})]})},{value:"circle",label:"Circle",icon:e.jsxs("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("circle",{cx:"5",cy:"8",r:"2.5"}),e.jsx("path",{d:"M11 8h10"})]})},{value:"square",label:"Square",icon:e.jsxs("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("rect",{x:"2.5",y:"5.5",width:"5",height:"5",fill:"currentColor",stroke:"none"}),e.jsx("path",{d:"M11 8h10"})]})},{value:"none",label:"None",icon:e.jsx("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M4 8h16"})})}],vp=["#1b1712","#868e96","#7950f2","#e64980","#12b886","#f59f00"];function jp({element:t,saveNodeData:n,editor:o}){const s=ee(b=>b.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState(null),[f,d]=l.useState(null),[h,m]=l.useState(!1);l.useEffect(()=>{var b;(b=t==null?void 0:t.node)!=null&&b.attrs&&(a(t.node.attrs.markerStyle||null),d(t.node.attrs.markerColor||null))},[t]),l.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]),l.useEffect(()=>{var b;c.current&&(c.current=!1,(b=t==null?void 0:t.node)!=null&&b.attrs&&be(r,t,{markerStyle:u,markerColor:f})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u,f]);const x=b=>{c.current=!0,a(j=>j===b?null:b)},g=b=>{c.current=!0,d(b),m(!1)},w=b=>({width:24,height:24,borderRadius:6,cursor:"pointer",backgroundColor:b,border:`1.5px solid ${f===b?"#7950f2":"#e0e0e0"}`,boxShadow:f===b?"0 0 0 2px rgba(121,80,242,0.15)":"none"});return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:12}
2,children:[e.jsx(ye,{gap:6,grow:!0,children:yp.map(b=>e.jsx(Be,{icon:b.icon,label:b.label,value:b.value,compact:!0,active:u===b.value,onClick:()=>x(b.value)},b.value))}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx(N,{style:{fontSize:"11px",color:"#666",fontWeight:600,flexShrink:0,width:"50px"},children:"Color"}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[vp.map(b=>e.jsx(p,{onClick:()=>g(b),style:w(b)},b)),e.jsxs(we,{opened:h,onChange:m,position:"bottom-start",withArrow:!0,zIndex:99999,children:[e.jsx(we.Target,{children:e.jsx(p,{onClick:()=>m(b=>!b),style:{width:24,height:24,borderRadius:6,cursor:"pointer",border:"1.5px dashed #d0d0d0",color:"#868e96",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14},children:"+"})}),e.jsx(we.Dropdown,{children:e.jsx("div",{className:"gradient-color-picker",children:e.jsx(Vt,{value:f||"#1b1712",onChange:b=>{c.current=!0,d(b||null)},hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,hideGradientAngle:!0,hideGradientStop:!0,hideGradientType:!0,hideGradientControls:!0,width:240,height:160})})})]}),f&&e.jsx(N,{onClick:()=>g(null),style:{fontSize:11,color:"#868e96",cursor:"pointer",marginLeft:2},children:"Reset"})]})]})]})}const kp="_colorSwatch_u2h80_1",wp="_colorSwatchNone_u2h80_17",Cp="_colorLabel_u2h80_31",Sp="_removeBtn_u2h80_37",Wo={colorSwatch:kp,colorSwatchNone:wp,c
2olorLabel:Cp,removeBtn:Sp};function Tp({element:t,saveNodeData:n,editor:o}){var S;const s=Dt(),r=ee(W=>W.tiptap),i=o||(r==null?void 0:r.editor),c=l.useRef(null),u=l.useRef(!1),a=l.useRef(!1),f=l.useRef(null),d=l.useRef(null),h=l.useRef(null),m=l.useRef(null),[x,g]=l.useState("none"),[w,b]=l.useState("1"),[j,A]=l.useState(!1),v=!!((S=t==null?void 0:t.node)!=null&&S.attrs),k=v?(()=>{const W=t.node.attrs.badgePillBorderColor;return!W||W==="none"?"none":W})():"none",C=v&&t.node.attrs.badgePillBorderWidth||"1",I=ft(t,"badgePillBorderColor"),_=ft(t,"badgePillBorderWidth");l.useEffect(()=>{if(!v)return;const{shouldApply:W}=Nt({currentKeyRef:h,nextKey:I,pendingValueRef:f,incomingValue:k});W&&g(k)},[I,v,k]),l.useEffect(()=>{if(!v)return;const{shouldApply:W}=Nt({currentKeyRef:m,nextKey:_,pendingValueRef:d,incomingValue:C});W&&b(C)},[v,C,_]),l.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),l.useEffect(()=>{u.current&&(!t||!t.node.attrs||be(i,t,{badgePillBorderColor:x})&&(c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,u.current=!1,a.current=!1,n()},2e3)))},[i,x,t,n]),l.useEffect(()=>{a.current&&(!t||!t.node.attrs||be(i,t,{badgePillBorderWidth:w})&&(c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,a.current=!1,u.current=!1,n()},2e3)))},[i,w,t,n]);const R=!x||x==="none",F=W=>({flex:"1 1 0",height:30,borderRadius:6,cursor:"pointer",background:W?"#7950f2":"#f1f3f5",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:500,color:W?"white":"#868e96",transition:"all 0.15s",border:"1.5px solid transparent"}),G=W=>{j&&(u.current=!0,f.current=W||"",g(W||""))},T=()=>{u.current=!0,f.current="none",g("none"),A(!1)},L=W=>{a.current=!0,d.current=W,b(W)};return e.jsxs(p,{children:[e.jsxs(we,{...ji,opened:j,onChange:W=>{W||A(!1)},children:[e.jsx(we.Target,{children:e.jsxs(ye,{gap:10,style:{cursor:"pointer"},onClick:()=>A(W=>!W),children:[e.jsx(p,{className:R?`${Wo.colorSwatch} ${Wo.colorSwatchNone}`:Wo.colorSwatch,style:R?void 0:{background:x}}),e.jsx(N,{className:Wo.colorLabel,children:R?"None":qt(x).getAlpha()<1?qt(x).toRgbString():qt(x).toHexString().toUpperCase()})]})}),e.jsx(we.Dropdown,{style:{maxHeight:"calc(100vh - 16px)",overflowY:"auto"},children:e.jsxs("div",{className:"gradient-color-picker",children:[e.jsx(Vt,{value:R?"#7950f2":x,onChange:G,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,hideColorTypeBtns:!0,hideGradientControls:!0,width:240,height:160,presets:an(s,"dark")}),e.jsx(p,{onClick:T,className:Wo.removeBtn,children:"Remove border"})]})})]}),!R&&e.jsx(ye,{gap:6,grow:!0,mt:10,children:["1","2","3","4"].map(W=>e.jsxs(p,{onClick:()=>L(W),style:F(w===W),children:[W,"px"]},W))})]})}const Ip="_swatchRow_hd1w4_1",_p="_noneSwatch_hd1w4_8",Ap="_noneSwatchActive_hd1w4_33",Bp="_dotSwatch_hd1w4_38",Rp="_dotSwatchActive_hd1w4_49",Ep="_customSwatch_hd1w4_54",zp="_customSwatchActive_hd1w4_74",Lp="_removeBtn_hd1w4_81",Kt={swatchRow:Ip,noneSwatch:_p,noneSwatchActive:Ap,dotSwatch:Bp,dotSwatchActive:Rp,customSwatch:Ep,customSwatchActive:zp,removeBtn:Lp},Pp=su.map(t=>t.color);function Wp({element:t,saveNodeData:n,editor:o}){var I;const s=Dt(),r=ee(_=>_.tiptap),i=o||(r==null?void 0:r.editor),c=l.useRef(null),u=l.useRef(!1),a=l.useRef(null),f=l.useRef(null),[d,h]=l.useState("none"),[m,x]=l.useState(!1),g=!!((I=t==null?void 0:t.node)!=null&&I.attrs),w=g&&t.node.attrs.badgePillDotColor||"none",b=ft(t,"badgePillDotColor");l.useEffect(()=>{if(!g)return;const{shouldApply:_}=Nt({currentKeyRef:f,nextKey:b,pendingValueRef:a,incomingValue:w});_&&h(w)},[g,w,b]),l.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),l.useEffect(()=>{u.current&&(!t||!t.node.attrs||be(i,t,{badgePillDotColor:d})&&(c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,u.current=!1,n()},2e3)))},[i,d,t,n]);const j=_=>{u.current=!0,a.current=_,h(_)},A=_=>{m&&j(_||"none")},v=()=>{j("none"),x(!1)},k=!d||d==="none",C=!k&&!Pp.includes(d);return e.jsxs(p,{className:Kt.swatchRow,children:[e.jsx(p,{onClick:()=>j("none"),className:k?`${Kt.noneSwatch} ${Kt.noneSwatchActive}`:Kt.noneSwatch,role:"button","aria-label":"No dot"}),su.map(_=>e.jsx(p,{onClick:()=>j(_.color),className:d===_.color?`${Kt.dotSwatch} ${Kt.dotSwatchActive}`:Kt.dotSwatch,style:{background:_.color},role:"button","aria-label":`${_.label} dot`},_.color)),e.jsxs(we,{...ji,opened:m,onChange:_=>{_||x(!1)},children:[e.jsx(we.Target,{children:e.jsx(p,{onClick:()=>x(_=>!_),className:C?`${Kt.customSwatch} ${Kt.customSwatchActive}`:Kt.customSwatch,style:C?{background:d}:void 0,role:"button","aria-label":"Custom dot color",children:!C&&"+"})}),e.jsx(we.Dropdown,{style:{maxHeight:"calc(100vh - 16px)",overflowY:"auto"},children:e.jsxs("div",{className:"gradient-color-picker",children:[e.jsx(Vt,{value:k?"#7950f2":d,onChange:A,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,hideColorTypeBtns:!0,hideGradientControls:!0,width:240,height:160,presets:an(s,"dark")}),e.jsx(p,{onClick:v,className:Kt.removeBtn,children:"Remove dot"})]})})]})]})}const Op=[{value:"solid",label:"Solid",icon:e.jsx("svg",{width:"32",height:"12",viewBox:"0 0 32 12",fill:"none",children:e.jsx("line",{x1:"2",y1:"6",x2:"30",y2:"6",stroke:"currentColor",strokeWidth:"2"})})},{value:"dashed",label:"Dashed",icon:e.jsx("svg",{width:"32",height:"12",viewBox:"0 0 32 12",fill:"none",children:e.jsx("line",{x1:"2",y1:"6",x2:"30",y2:"6",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"4 3"})})},{value:"dotted",label:"Dotted",icon:e.jsx("svg",{width:"32",height:"12",viewBox:"0 0 32 12",fill:"none",children:e.jsx("line",{x1:"2",y1:"6",x2:"30",y2:"6",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"1.5 3",strokeLinecap:"round"})})},{value:"double",label:"Double",icon:e.jsxs("svg",{width:"32",height:"12",viewBox:"0 0 32 12",fill:"none",children:[e.jsx("line",{x1:"2",y1:"4",x2:"30",y2:"4",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("line",{x1:"2",y1:"8",x2:"30",y2:"8",stroke:"currentColor",strokeWidth:"1.5"})]})}];function Mp({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("solid");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.dividerStyle||"solid")},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{dividerStyle:u})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u]);const f=d=>{c.current=!0,a(d)};return e.jsx(ye,{gap:6,grow:!0,children:Op.map(d=>e.jsx(Be,{icon:d.icon,label:d.label,value:d.value,active:u===d.value,onClick:()=>f(d.value)},d.value))})}const Np="_weightInput_yl4zi_1",$p={weightInput:Np};function Dp({element:t,saveNodeData:n,editor:o}){const s=ee(h=>h.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState(1);l.useEffect(()=>{!t||!t.node.attrs||a(parseInt(t.node.attrs.dividerWeight)||1)},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{dividerWeight:String(u)})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u]);const f=h=>{c.current=!0,a(h)},d=h=>{const m=Math.max(1,Math.min(10,h||1));c.current=!0,a(m)};return e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx(ts,{value:u,onChange:f,min:1,max:10,step:1,label:null,style:{flex:1}
2,styles:{track:{height:6},bar:{backgroundColor:"#7950f2"},thumb:{width:16,height:16,borderWidth:2,borderColor:"#7950f2",backgroundColor:"white"}}}),e.jsx(Rt,{value:u,onChange:d,min:1,max:10,size:"xs",hideControls:!0,style:{width:48},classNames:{input:$p.weightInput},styles:{input:{fontSize:"12px",fontWeight:600,textAlign:"right",border:"1.5px solid #e0e0e0",borderRadius:"6px",padding:"4px 6px"}}}),e.jsx(p,{style:{fontSize:"10px",color:"#999",width:"18px"},children:"px"})]})}const Fp="_outerWrap_1fgl4_1",Hp="_swatch_1fgl4_8",Up="_addButton_1fgl4_19",Vp="_pickerWrap_1fgl4_39",zs={outerWrap:Fp,swatch:Hp,addButton:Up,pickerWrap:Vp},Kp=["#e0e0e0","#999999","#333333","#7950f2","#7c3aed","#10b981"];function Gp({element:t,saveNodeData:n,editor:o}){var v;const s=ee(k=>k.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),u=l.useRef(null),a=l.useRef(null),[f,d]=l.useState("#e0e0e0"),[h,m]=l.useState(!1),x=!!((v=t==null?void 0:t.node)!=null&&v.attrs),g=x&&t.node.attrs.dividerColor||"#e0e0e0",w=ft(t,"dividerColor");l.useEffect(()=>{if(!x)return;const{shouldApply:k}=Nt({currentKeyRef:a,nextKey:w,pendingValueRef:u,incomingValue:g});k&&d(g)},[x,g,w]),l.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]),l.useEffect(()=>{c.current&&(!t||!t.node.attrs||be(r,t,{dividerColor:f})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,c.current=!1,n()},2e3)))},[r,f,t,n]);const b=k=>{c.current=!0,u.current=k,d(k),m(!1)},j=k=>{const C=k||"";c.current=!0,u.current=C,d(C)},A=k=>({width:24,height:24,backgroundColor:k,border:`1.5px solid ${f===k?"#7950f2":"#e0e0e0"}`,boxShadow:f===k?"0 0 0 2px rgba(121, 80, 242,0.15)":"none"});return e.jsxs("div",{className:zs.outerWrap,children:[Kp.map(k=>e.jsx(p,{onClick:()=>b(k),className:zs.swatch,style:A(k)},k)),e.jsxs(we,{opened:h,onChange:k=>{k||m(!1)},position:"bottom-start",withArrow:!0,zIndex:99999,children:[e.jsx(we.Target,{children:e.jsx("div",{onClick:()=>m(!h),className:zs.addButton,children:"+"})}),e.jsx(we.Dropdown,{children:e.jsx("div",{className:`${zs.pickerWrap} gradient-color-picker`,children:e.jsx(Vt,{value:f,onChange:j,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,hideGradientAngle:!0,hideGradientStop:!0,hideGradientType:!0,hideGradientControls:!0,width:240,height:160})})})]})]})}const Yp=[{value:"25",label:"25%"},{value:"50",label:"50%"},{value:"75",label:"75%"},{value:"100",label:"Full"}];function qp({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("100");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.dividerWidth||"100")},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{dividerWidth:u})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u]);const f=d=>{c.current=!0,a(d)};return e.jsx(Pe,{options:Yp,activeValue:u,onChange:f,columns:4})}const Xp=[{value:"none",label:"None",icon:e.jsxs("svg",{width:"32",height:"18",viewBox:"0 0 32 18",fill:"none",children:[e.jsx("rect",{x:"4",y:"2",width:"24",height:"3",rx:"1",fill:"currentColor",opacity:"0.2"}),e.jsx("line",{x1:"4",y1:"9",x2:"28",y2:"9",stroke:"currentColor",strokeWidth:"1"}),e.jsx("rect",{x:"4",y:"13",width:"24",height:"3",rx:"1",fill:"currentColor",opacity:"0.2"})]})},{value:"tight",label:"Tight",icon:e.jsxs("svg",{width:"32",height:"18",viewBox:"0 0 32 18",fill:"none",children:[e.jsx("rect",{x:"4",y:"1",width:"24",height:"3",rx:"1",fill:"currentColor",opacity:"0.2"}),e.jsx("line",{x1:"4",y1:"9",x2:"28",y2:"9",stroke:"currentColor",strokeWidth:"1"}),e.jsx("rect",{x:"4",y:"14",width:"24",height:"3",rx:"1",fill:"currentColor",opacity:"0.2"})]})},{value:"normal",label:"Normal",icon:e.jsxs("svg",{width:"32",height:"18",viewBox:"0 0 32 18",fill:"none",children:[e.jsx("rect",{x:"4",y:"0",width:"24",height:"3",rx:"1",fill:"currentColor",opacity:"0.2"}),e.jsx("line",{x1:"4",y1:"9",x2:"28",y2:"9",stroke:"currentColor",strokeWidth:"1"}),e.jsx("rect",{x:"4",y:"15",width:"24",height:"3",rx:"1",fill:"currentColor",opacity:"0.2"})]})},{value:"relaxed",label:"Relaxed",icon:e.jsxs("svg",{width:"32",height:"18",viewBox:"0 0 32 18",fill:"none",children:[e.jsx("rect",{x:"4",y:"0",width:"24",height:"2",rx:"1",fill:"currentColor",opacity:"0.2"}),e.jsx("line",{x1:"4",y1:"9",x2:"28",y2:"9",stroke:"currentColor",strokeWidth:"1"}),e.jsx("rect",{x:"4",y:"16",width:"24",height:"2",rx:"1",fill:"currentColor",opacity:"0.2"})]})}];function Zp({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("normal");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.dividerSpacing||"normal")},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{dividerSpacing:u})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u]);const f=d=>{c.current=!0,a(d)};return e.jsx(ye,{gap:6,grow:!0,children:Xp.map(d=>e.jsx(Be,{icon:d.icon,label:d.label,value:d.value,active:u===d.value,onClick:()=>f(d.value)},d.value))})}const Qp=[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}];function Jp({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("center");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.dividerAlign||"center")},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{dividerAlign:u})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,u,t,n]);const f=d=>{c.current=!0,a(d)};return e.jsx(Pe,{options:Qp,activeValue:u,onChange:f,columns:3})}const ex="_row_5cii6_1",tx="_clearSwatch_5cii6_7",Ua={row:ex,clearSwatch:tx},nx="_outerRow_4hiqn_1",ox="_label_4hiqn_7",sx="_swatchesRow_4hiqn_15",rx="_swatch_4hiqn_15",ix="_customButton_4hiqn_33",Oo={outerRow:nx,label:ox,swatchesRow:sx,swatch:rx,
2customButton:ix},lx=/^((?:repeating-)?(?:linear|radial|conic)-gradient)\((.*)\)$/is,ax=/\s[-+]?(?:\d*\.)?\d+(?:%|px|rem|em|vh|vw|vmin|vmax)\s*$/i;function cx(t){const n=[];let o=0,s=0;for(let r=0;r<t.length;r+=1){const i=t[r];if(i==="("&&(o+=1),i===")"&&(o-=1),o<0)return null;i===","&&o===0&&(n.push(t.slice(s,r).trim()),s=r+1)}return o!==0?null:(n.push(t.slice(s).trim()),n)}function ux(t,n){const o=t.toLowerCase();return o.includes("linear")?/^(?:to\b|[-+]?(?:\d*\.)?\d+(?:deg|grad|rad|turn)\b)/i.test(n):o.includes("radial")?/^(?:(?:circle|ellipse)\b|(?:closest|farthest)-|at\b)/i.test(n):/^(?:from\b|at\b)/i.test(n)}function dx(t,n){if(n<=1)return"0%";const o=t/(n-1)*100;return`${Number(o.toFixed(3))}%`}function fx(t,n="#000000"){const o=typeof t=="string"?t.trim():"";if(!o)return n;if(!o.toLowerCase().includes("gradient("))return o;const s=o.match(lx);if(!s)return n;const[,r,i]=s,c=cx(i);if(!c||c.some(h=>!h))return n;const u=ux(r,c[0])?1:0,a=c.slice(0,u),f=c.slice(u);if(f.length<2)return n;const d=f.map((h,m)=>{const x=h.replace(/\s+NaN%\s*$/i,"").trim();return ax.test(x)?x:`${x} ${dx(m,f.length)}`});return`${r}(${[...a,...d].join(", ")})`}const bn=({label:t,colors:n,value:o,onChange:s,hideGradientControls:r=!0,swatchSize:i=22})=>{const c=Dt(),[u,a]=l.useState(!1),f=n.some(g=>g===o),d=5,h={width:`${i}px`,height:`${i}px`,flexShrink:0},m=(g,w)=>g?"2.5px solid #7950f2":w?"1.5px solid #ddd":"2px solid transparent",x=g=>g?"inset 0 0 0 1.5px white":"none";return e.jsxs("div",{className:Oo.outerRow,children:[t&&e.jsx("div",{className:Oo.label,children:t}),e.jsxs("div",{className:Oo.swatchesRow,style:{gap:`${d}px`},children:[n.map(g=>{const w=o===g,b=g==="rgba(255,255,255,1)"||g==="#ffffff"||g==="#fff"||g==="white";return e.jsx(p,{onClick:()=>s(g),className:Oo.swatch,style:{...h,background:g,border:m(w,b),boxShadow:x(w)}},g)}),e.jsxs(we,{opened:u,onChange:g=>{g||a(!1)},offset:15,zIndex:999999,width:264,children:[e.jsx(we.Target,{children:e.jsx("div",{onClick:()=>a(!u),className:Oo.customButton,style:{...h,border:`1.5px dashed ${!f&&o?"#7950f2":"#ccc"}`,fontSize:"11px",color:!f&&o?"#7950f2":"#999",background:!f&&o?o:"transparent",boxShadow:!f&&o?"inset 0 0 0 1.5px white":"none"},children:"+"})}),e.jsx(we.Dropdown,{children:e.jsx("div",{className:"gradient-color-picker",children:e.jsx(Vt,{value:fx(o),onChange:s,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,hideGradientControls:r,width:240,height:160,presets:an(c,"light")})})})]})]})]})},hx=["#e9ecef","#fff3bf","#d0ebff","#c3fae8","#ffe8cc","#e8d0ff","#1a2332"];function px({element:t,saveNodeData:n,editor:o}){var w;const s=ee(b=>b.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),u=l.useRef(null),a=l.useRef(null),[f,d]=l.useState(""),h=!!((w=t==null?void 0:t.node)!=null&&w.attrs),m=h&&t.node.attrs.resourceColor||"",x=ft(t,"resourceColor");l.useEffect(()=>{if(!h)return;const{shouldApply:b}=Nt({currentKeyRef:a,nextKey:x,pendingValueRef:u,incomingValue:m});b&&d(m)},[h,m,x]),l.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]),l.useEffect(()=>{c.current&&(!t||!t.node.attrs||be(r,t,{resourceColor:f})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,c.current=!1,n()},2e3)))},[r,f,t,n]);const g=b=>{const j=b||"";c.current=!0,u.current=j,d(j)};return e.jsx(Fe,{gap:10,children:e.jsxs("div",{className:Ua.row,children:[e.jsx(p,{onClick:()=>g(""),className:Ua.clearSwatch,style:{width:"28px",height:"28px",border:!f||f===""?"2.5px solid #7950f2":"1.5px solid #ddd",boxShadow:!f||f===""?"inset 0 0 0 1.5px white":"none"},title:"Use theme default"}),e.jsx(bn,{label:"",colors:hx,value:f,onChange:g,hideGradientControls:!0,swatchSize:28})]})})}const xx="_row_5cii6_1",gx="_clearSwatch_5cii6_7",Zs={row:xx,clearSwatch:gx},mx=["#000000","#333333","#666666","rgba(255,255,255,1)","#f0f0f0"];function bx({element:t,saveNodeData:n,editor:o}){var w;const s=ee(b=>b.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),u=l.useRef(null),a=l.useRef(null),[f,d]=l.useState(""),h=!!((w=t==null?void 0:t.node)!=null&&w.attrs),m=h&&t.node.attrs.resourceTextColor||"",x=ft(t,"resourceTextColor");l.useEffect(()=>{if(!h)return;const{shouldApply:b}=Nt({currentKeyRef:a,nextKey:x,pendingValueRef:u,incomingValue:m});b&&d(m)},[h,m,x]),l.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]),l.useEffect(()=>{c.current&&(!t||!t.node.attrs||be(r,t,{resourceTextColor:f})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,c.current=!1,n()},2e3)))},[r,f,t,n]);const g=b=>{const j=b||"";c.current=!0,u.current=j,d(j)};return e.jsx(Fe,{gap:10,children:e.jsxs("div",{className:Zs.row,children:[e.jsx(p,{onClick:()=>g(""),className:Zs.clearSwatch,style:{width:"28px",height:"28px",border:!f||f===""?"2.5px solid #7950f2":"1.5px solid #ddd",boxShadow:!f||f===""?"inset 0 0 0 1.5px white":"none"},title:"Use theme default"}),e.jsx(bn,{label:"",colors:mx,value:f,onChange:g,hideGradientControls:!0,swatchSize:28})]})})}const yx=[{value:"plus",label:"Plus",icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})},{value:"chevron",label:"Chevron",icon:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})},{value:"none",label:"None",icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("line",{x1:"5",y1:"19",x2:"19",y2:"5"})]})}];function vx({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("plus");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.iconStyle||"plus")},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{iconStyle:u})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u]);const f=d=>{c.current=!0,a(d)};return e.jsx(ye,{gap:6,grow:!0,children:yx.map(d=>e.jsx(Be,{icon:d.icon,label:d.label,value:d.value,active:u===d.value,onClick:()=>f(d.value)},d.value))})}const jx=[{value:"left",label:"Left"},{value:"right",label:"Right"}];function kx({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("right");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.iconPosition||"right")},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{iconPosition:u})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u]);const f=d=>{c.current=!0,a(d)};return e.jsx(Pe,{options:jx,activeValue:u,onChange:f,columns:2})}const wx=[{value:"none",label:"None"},{value:"line",label:"Line"}];function Cx({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("none");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.divider||"none")},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{divider:u})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u]);const f=d=>{c.current=!0,a(d)};return e.jsx(Pe,{options:wx,activeValue:u,onChange:f,columns:2})}const Sx=[{value:"closed",label:"Collapsed"},{value:"open",label:"Expanded"}];function Tx({element:t,saveNodeData:n,editor:o}){const s=ee(d=>d.tiptap),r=o||(s==null?void 0:s.editor),i=l.useRef(null),c=l.useRef(!1),[u,a]=l.useState("closed");l.useEffect(()=>{!t||!t.node.attrs||a(t.node.attrs.open?"open":"closed")},[t]),l.useEffect(()=>{c.current&&(c.current=!1,!(!t||!t.node.attrs)&&be(r,t,{open:u==="open"})&&(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n()},2e3)))},[r,t,n,u]);const f=d=>{c.current=!0,a(d)};return e.jsx(Pe,{options:Sx,activeValue:u,onChange:f,columns:2})}function lr(t,n){var o,s;(s=(o=t.target).closest)!=null&&s.call(o,"button")||(t.preventDefault(),t.stopPropagation(),n())}function Ix(t,n,o=!1){var r,i;const s={newStyles:{...((i=(r=t==null?void 0:t.node)==null?void 0:r.attrs)==null?void 0:i.styles)||{},"font-family":n||""},_node:t,changedStyleKeys:["font-family"]};return o||(s.clearTextStyleAttrs=["fontFamily"]),s}const _x=new Map(sr.map(t=>[t.value,t.value||"inherit"])),ru=new Map;for(const t of sr)if(t.value){const n=t.value.split(",")[0].trim().toLowerCase();ru.set(n,t.value)}function Ax(t){if(!t)return"";if(sr.some(o=>o.value===t))return t;const n=t.split(",")[0].trim().toLowerCase();return ru.get(n)||t}function Bx(t){var r,i,c,u,a,f;const n=(i=(r=t==null?void 0:t.attrs)==null?void 0:r.styles)==null?void 0:i["font-family"];if(n)return n;const o=((c=t==null?void 0:t.content)==null?void 0:c.content)||[];let s=null;for(const d of o)if(((u=d.type)==null?void 0:u.name)==="text"&&d.text){const h=(a=d.marks)==null?void 0:a.find(x=>{var g;return((g=x.type)==null?void 0:g.name)==="textStyle"}),m=((f=h==null?void 0:h.attrs)==null?void 0:f.fontFamily)||null;if(s===null)s=m;else if(s!==m)return""}return s||""}function iu({element:t,saveNodeData:n,preserveTextStyleMarks:o=!1}){const[s,r]=l.useState(""),[i,c]=l.useState(!1);l.useEffect(()=>{if(t!=null&&t.node){const a=Bx(t.node);r(Ax(a))}},[t]);const u=a=>{const f=a||"";r(f),t!=null&&t.node&&n(Ix(t,f,o),"styles")};return e.jsxs(Fe,{gap:4,mb:10,children:[e.jsx(N,{size:"xs",fw:500,c:"dimmed",children:"Font"}),e.jsx(jt,{value:s,onChange:u,dropdownOpened:i,onDropdownOpen:()=>c(!0),onDropdownClose:()=>c(!1),data:or,renderOption:({option:a})=>{const f=_x.get(a.value)||"inherit";return e.jsx(N,{size:"sm",style:{fontFamily:f},children:a.label})},placeholder:"Default",clearable:!0,searchable:!0,nothingFoundMessage:"No font found",maxDropdownHeight:300,comboboxProps:{zIndex:99999},rightSectionPointerEvents:"auto",rightSectionProps:{onMouseDown:a=>lr(a,()=>c(f=>!f)),style:{cursor:"pointer"}},styles:{input:{fontFamily:s||"inherit"}}})]})}const lu=l.createContext({breakpoint:"desktop",setBreakpoint:()=>{},hasProvider:!1});function Rx({children:t}){const[n,o]=l.useState("desktop"),s=l.useRef(null);l.useEffect(()=>{const i=pa[n]||null;
2if(i)return Object.values(pa).forEach(c=>{c!==i&&document.body.classList.remove(c)}),document.body.classList.add(i),s.current=i,()=>{document.body.classList.remove(i),s.current===i&&(s.current=null)}},[n]);const r=l.useMemo(()=>({breakpoint:n,setBreakpoint:o,hasProvider:!0}),[n]);return e.jsx(lu.Provider,{value:r,children:t})}function Et(){return l.useContext(lu)}const au=t=>t==null||t==="",Ex=t=>{if(!t)return null;const n={...t};return n.styles&&Object.keys(n.styles).length===0&&delete n.styles,n.hidden!==!0&&delete n.hidden,Object.keys(n).length>0?n:null},ar=t=>{if(!t)return null;const n={};return["tablet","mobile"].forEach(o=>{const s=Ex(t[o]);s&&(n[o]=s)}),Object.keys(n).length>0?n:null};function cu(t,n,o){const s=t&&typeof t=="object"?t:{},r=s[n]&&typeof s[n]=="object"?s[n]:{},i={...r.styles||{}};return Object.entries(o||{}).forEach(([c,u])=>{au(u)?delete i[c]:i[c]=u}),ar({...s,[n]:{...r,styles:i}})}function uu(t,n,o){const s=t&&typeof t=="object"?t:{},r=s[n]&&typeof s[n]=="object"?{...s[n]}:{};return Object.entries(o||{}).forEach(([i,c])=>{i==="styles"||i==="hidden"||(au(c)?delete r[i]:r[i]=c)}),ar({...s,[n]:r})}function zx(t,n,o){const s={};return(o||[]).forEach(r=>{s[r]=null}),cu(t,n,s)}function Lx(t,n){if(!t||typeof t!="object")return null;const o={...t};return delete o[n],ar(o)}function Px(t,n,o){const s=t&&typeof t=="object"?t:{},r=s[n]&&typeof s[n]=="object"?s[n]:{};return ar({...s,[n]:{...r,hidden:o===!0?!0:void 0}})}function Wx(t){var s;if(!t)return!0;if((t.saveAttr||t.styleAttr||"styles")!=="styles"||t.storageSurface==="compound")return!1;const o=t.writeTargets||[];return!(o.length>1||(s=o[0])!=null&&s.transform)}const cr=(t,n,o)=>{const{node:s,pos:r}=Xt(t,n);if(!s||r==null)return!1;const{tr:i}=t.view.state;return i.setNodeMarkup(r,void 0,{...s.attrs,responsive:o}),t.view.dispatch(i),!0};function us(t,n,o,s){if(!t||o==="desktop")return!1;const{node:r}=Xt(t,n);if(!r)return!1;const i=cu(r.attrs.responsive,o,s);return cr(t,n,i)}function ur(t,n,o,s){if(!t||o==="desktop")return!1;const{node:r}=Xt(t,n);if(!r)return!1;const i=uu(r.attrs.responsive,o,s);return cr(t,n,i)}function ki(t,n,o,s){const r={};return(s||[]).forEach(i=>{r[i]=null}),ur(t,n,o,r)}function ds(t,n,o,s){if(!t||o==="desktop")return!1;const{node:r}=Xt(t,n);if(!r)return!1;const i=zx(r.attrs.responsive,o,s);return cr(t,n,i)}function Ox(t,n,o){if(!t||o==="desktop")return!1;const{node:s}=Xt(t,n);if(!s)return!1;const r=Lx(s.attrs.responsive,o);return cr(t,n,r)}function Mx(t,n,o,s){if(!t)return!1;const{node:r,pos:i}=Xt(t,n);if(!r||i==null)return!1;const{tr:c}=t.view.state;return o==="desktop"?c.setNodeMarkup(i,void 0,{...r.attrs,hidden:s===!0}):c.setNodeMarkup(i,void 0,{...r.attrs,responsive:Px(r.attrs.responsive,o,s)}),t.view.dispatch(c),!0}const du="#e64980",Nx="Overridden — this value no longer follows Desktop. Reset to Desktop to re-inherit.";function fu({tip:t,size:n=5}){return e.jsx(vt,{label:t||Nx,openDelay:200,multiline:!0,withArrow:!0,position:"top",withinPortal:!0,zIndex:999999,styles:{tooltip:{width:220,whiteSpace:"normal"}},children:e.jsx("span",{style:{width:n,height:n,borderRadius:"50%",background:du,display:"inline-block",marginLeft:5,verticalAlign:"middle",flexShrink:0,pointerEvents:"auto"}})})}const Qs=e.jsx(fu,{});function Js(t){return t?du:void 0}function Jn({onClick:t,style:n}){return e.jsx("button",{type:"button",onClick:t,style:{fontSize:11,fontWeight:600,color:"#7950f2",background:"#f3f0ff",border:0,borderRadius:6,padding:"3px 8px",cursor:"pointer",fontFamily:"inherit",...n},children:"↺ Reset to Desktop"})}function $x(t){var r,i,c,u,a,f;const n=(i=(r=t==null?void 0:t.attrs)==null?void 0:r.styles)==null?void 0:i["font-size"];if(n)return n;const o=((c=t==null?void 0:t.content)==null?void 0:c.content)||[];let s=null;for(const d of o)if(((u=d.type)==null?void 0:u.name)==="text"&&d.text){const h=(a=d.marks)==null?void 0:a.find(x=>{var g;return((g=x.type)==null?void 0:g.name)==="textStyle"}),m=((f=h==null?void 0:h.attrs)==null?void 0:f.fontSize)||null;if(s===null)s=m;else if(s!==m)return""}return s||""}function hu({element:t,saveNodeData:n,editor:o,breakpointOverride:s,preserveTextStyleMarks:r=!1}
2){var k,C,I;const i=l.useRef(null),c=l.useRef(null),[u,a]=l.useState(""),[f,d]=l.useState(()=>eu(ep)),[h,m]=l.useState(!1),{breakpoint:x}=Et(),g=s||x,w=((C=(k=t==null?void 0:t.node)==null?void 0:k.type)==null?void 0:C.name)||"",b=g!=="desktop"&&!!w&&rs(w).has("font-size"),j=b&&is((I=t==null?void 0:t.node)==null?void 0:I.attrs,"font-size",g);l.useEffect(()=>{if(t!=null&&t.node){const _=$x(t.node),R=os(b&&wo(t.node.attrs,"font-size",g)||_),{shouldApply:F}=Nt({currentKeyRef:c,nextKey:ft(t,`font-size:${g}`),pendingValueRef:i,incomingValue:R});if(!F)return;a(R),R&&d(G=>tu(G,R)?G:[...G,R])}},[t,g,b]);const A=_=>{const R=os(_);if(i.current=R,a(R),!(t!=null&&t.node))return;if(b){o&&us(o,t,g,{"font-size":R});return}const F={...t.node.attrs.styles};F["font-size"]=R;const G={newStyles:F,_node:t,changedStyleKeys:["font-size"]};r||(G.clearTextStyleAttrs=["fontSize"]),n(G,"styles")},v=()=>{!b||!o||(i.current=null,ds(o,t,g,["font-size"]))};return e.jsxs(Fe,{gap:4,mb:10,children:[e.jsxs(N,{size:"xs",fw:500,c:j?void 0:"dimmed",style:{color:Js(j)},children:["Size",j&&Qs]}),e.jsx(Gc,{value:u,onChange:A,dropdownOpened:h,onDropdownOpen:()=>m(!0),onDropdownClose:()=>m(!1),data:f,filter:nu,placeholder:cs,renderOption:ou,rightSection:e.jsx(bi.Chevron,{}),rightSectionPointerEvents:"auto",rightSectionProps:{onMouseDown:_=>lr(_,()=>m(R=>!R)),style:{cursor:"pointer"}},comboboxProps:{zIndex:99999},styles:{input:b&&!j?{color:"var(--mantine-color-gray-5)",fontStyle:"italic"}:void 0}}),j&&e.jsx("div",{style:{textAlign:"right"},children:e.jsx(Jn,{onClick:v})})]})}function pu({element:t,saveNodeData:n,editor:o,breakpointOverride:s}){var v,k,C;const r=l.useRef(null),i=l.useRef(null),[c,u]=l.useState(""),[a,f]=l.useState(()=>eu(tp)),[d,h]=l.useState(!1),{breakpoint:m}=Et(),x=s||m,g=((k=(v=t==null?void 0:t.node)==null?void 0:v.type)==null?void 0:k.name)||"",w=x!=="desktop"&&!!g&&rs(g).has("line-height"),b=w&&is((C=t==null?void 0:t.node)==null?void 0:C.attrs,"line-height",x);l.useEffect(()=>{var I;if(t!=null&&t.node){const _=(I=t.node.attrs.styles)==null?void 0:I["line-height"],R=os(w&&wo(t.node.attrs,"line-height",x)||_),{shouldApply:F}=Nt({currentKeyRef:i,nextKey:ft(t,`line-height:${x}`),pendingValueRef:r,incomingValue:R});if(!F)return;u(R),R&&f(G=>tu(G,R)?G:[...G,R])}},[t,x,w]);const j=I=>{const _=os(I);if(r.current=_,u(_),!(t!=null&&t.node))return;if(w){o&&us(o,t,x,{"line-height":_});return}const R={...t.node.attrs.styles};R["line-height"]=_,n({newStyles:R,_node:t,changedStyleKeys:["line-height"]},"styles")},A=()=>{!w||!o||(r.current=null,ds(o,t,x,["line-height"]))};return e.jsxs(Fe,{gap:4,mb:10,children:[e.jsxs(N,{size:"xs",fw:500,c:b?void 0:"dimmed",style:{color:Js(b)},children:["Line Height",b&&Qs]}),e.jsx(Gc,{value:c,onChange:j,dropdownOpened:d,onDropdownOpen:()=>h(!0),onDropdownClose:()=>h(!1),data:a,filter:nu,placeholder:cs,renderOption:ou,rightSection:e.jsx(bi.Chevron,{}),rightSectionPointerEvents:"auto",rightSectionProps:{onMouseDown:I=>lr(I,()=>h(_=>!_)),style:{cursor:"pointer"}},comboboxProps:{zIndex:99999},styles:{input:w&&!b?{color:"var(--mantine-color-gray-5)",fontStyle:"italic"}:void 0}}),b&&e.jsx("div",{style:{textAlign:"right"},children:e.jsx(Jn,{onClick:A})})]})}function Dx({element:t,saveNodeData:n,editor:o}){const s=l.useMemo(()=>{var c,u;const r=t==null?void 0:t.node;if(!r||typeof t.pos!="number")return null;const i=r.firstChild;return!i||((c=i.type)==null?void 0:c.name)!=="detailsSummary"?null:{node:i,pos:t.pos+1,uid:((u=i.attrs)==null?void 0:u.uid)||null}},[t]);return s?e.jsxs(e.Fragment,{children:[e.jsx(iu,{saveNodeData:n,element:s,editor:o}),e.jsxs(ye,{gap:8,grow:!0,wrap:"nowrap",align:"flex-start",children:[e.jsx(hu,{saveNodeData:n,element:s,editor:o}),e.jsx(pu,{saveNodeData:n,element:s})]})]}):null}function Bt(t){const n=l.useRef(null),o=l.useRef(!1),s=ee(c=>c.tiptap),[r,i]=l.useState(!1);return l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&o.current!=t.element.node.attrs.uid)return;if(t.element,t.element.node.attrs[`${t.attrName}`]!=r){const u={};u[`${t.attrName}
2`]=r,t.global?Oc(s.editor,t.element.node.type.name,u):s.editor.commands.updateAttributes(t.element.node.type.name,u),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t.saveNodeData(r)},2e3)}},[r]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.styles){o.current=null;const c=t.element.node.attrs.uid;setTimeout(()=>{o.current=c},0),i(t.element.node.attrs[`${t.attrName}`])}},[t.element]),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"12px"},children:[e.jsx(Ve,{checked:r,onChange:c=>i(c.currentTarget.checked),size:"md"}),e.jsx(N,{style:{fontSize:"13px",fontWeight:500},children:t.attrLabel})]})}const Fx=999999,Ko=()=>new Date(new Date().getTime()+9e7),Hx=t=>{if(typeof t=="string"){const o=t.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/);if(o)return`${o[1]}/${Number(o[2])}/${Number(o[3])}`}const n=t instanceof Date?t:new Date(t);return Number.isNaN(n.getTime())?Ko().toLocaleDateStringAbs():n.toLocaleDateStringAbs()};function Ux(t){const n=l.useRef(null),o=l.useRef(!1),{t:s}=Qt(),r=ee(h=>h.tiptap),[i,c]=l.useState("datetime"),[u,a]=l.useState(),[f,d]=l.useState();return l.useEffect(()=>{if(!(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&o.current!=t.element.node.attrs.uid)&&u){const h={};h.interactiveWaitValue=i=="datetime"?Hx(u):u,h.interactiveWaitValue.indexOf("NaN")>=0&&(h.interactiveWaitValue=Ko().toLocaleDateStringAbs()),h.interactiveWaitType=i,typeof f=="string"&&f==="pending"&&(h.interactiveWaitStatus="pending"),r.editor.commands.updateAttributes(t.element.node.type.name,h),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t.saveNodeData()},2e3)}},[u]),l.useEffect(()=>{i!=t.element.node.attrs.interactiveWaitType&&(i=="datetime"?a(Ko()):a("24h"))},[i]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.styles){o.current=null;const h=t.element.node.attrs.uid;setTimeout(()=>{o.current=h},0),c(t.element.node.attrs.interactiveWaitType),t.element.node.attrs.interactiveWaitType=="datetime"?t.element.node.attrs.interactiveWaitValue.indexOf("NaN")>=0?a(Ko()):a(t.element.node.attrs.interactiveWaitValue?new Date(t.element.node.attrs.interactiveWaitValue):""):a(t.element.node.attrs.interactiveWaitValue)}},[t.element]),e.jsxs(Fe,{mt:20,children:[e.jsx(Ue,{label:s("tiptap.components.sidebar.interactiveWaitTime.label1"),value:i,onChange:h=>c(h.currentTarget.value),data:[{label:s("tiptap.components.sidebar.interactiveWaitTime.label2"),value:"datetime"},{label:s("tiptap.components.sidebar.interactiveWaitTime.label3"),value:"days"}]}),i=="datetime"?e.jsx(Yr,{popoverProps:{zIndex:Fx},placeholder:s("tiptap.components.sidebar.interactiveWaitTime.placeholder"),label:s("tiptap.components.sidebar.interactiveWaitTime.label4"),minDate:Ko(),value:u,onChange:h=>{a(h),d("pending")}}):e.jsx(Ue,{value:u,onChange:h=>{a(h.currentTarget.value),d("pending")},data:[{label:s("tiptap.components.sidebar.interactiveWaitTime.label5"),value:"24h"},{label:s("tiptap.components.sidebar.interactiveWaitTime.label6"),value:"48h"},{label:s("tiptap.components.sidebar.interactiveWaitTime.label7"),value:"72h"},{label:s("tiptap.components.sidebar.interactiveWaitTime.label8"),value:"96h"},{label:s("tiptap.components.sidebar.interactiveWaitTime.label9"),value:"120h"},{label:s("tiptap.components.sidebar.interactiveWaitTime.label10"),value:"144h"},{label:s("tiptap.components.sidebar.interactiveWaitTime.label11"),value:"168h"},{label:s("tiptap.components.sidebar.interactiveWaitTime.label12"),value:"336h"},{label:s("tiptap.components.sidebar.interactiveWaitTime.label13"),value:"720h"}]})]})}function Va(t){const n=l.useRef(null),o=l.useRef(!1),s=ee(c=>c.tiptap),[r,i]=l.useState(!1);return l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&o.current!=t.element.node.attrs.uid)return;if(t.element,t.element.node.attrs[`${t.attrName}`]!=r){const u={};u[`${t.attrName}`]=r,s.editor.commands.updateAttributes(t.element.node.type.name,u),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t.saveNodeData()},2e3)}},[r]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.styles){o.current=null;const c=t.element.node.attrs.uid;setTimeout(()=>{o.current=c},0),i(t.element.node.attrs[`${t.attrName}`])}},[t.element]),e.jsx(Fe,{mt:20,children:e.jsx(rn,{autosize:!0,maxRows:5,placeholder:t.placeholder,label:t.label,onChange:c=>i(c.currentTarget.value),children:t.attrLabel})})}function Vx(t){const n=l.useRef(null),o=l.useRef(!1),s=ee(c=>c.tiptap),[r,i]=l.useState(!1);return l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&o.current!=t.element.node.attrs.uid)return;if(t.element,t.element.node.attrs[`${t.attrName}`]!=r){const u={};u[`${t.attrName}
2`]=r,s.editor.commands.updateAttributes(t.element.node.type.name,u),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t.saveNodeData()},2e3)}},[r]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.styles){o.current=null;const c=t.element.node.attrs.uid;setTimeout(()=>{o.current=c},0),i(t.element.node.attrs[`${t.attrName}`])}},[t.element]),e.jsx(Fe,{mt:20,children:Array.isArray(t.radioData)&&e.jsx(Xd,{value:t.element.node.attrs.interactiveWaitNotificationIncludeContentValue,onChange:i,styles:{label:{fontSize:14}},children:t.radioData.map((c,u)=>e.jsx(Zd,{value:c.value,label:c.label},u))})})}function Kx({element:t,transcription:n}){const o=l.useRef(!1),s=ee(a=>a.space),[r,i]=l.useState("");l.useEffect(()=>{var a,f,d,h;((f=(a=t==null?void 0:t.node)==null?void 0:a.attrs)!=null&&f.uid||n)&&(o.current=(h=(d=t==null?void 0:t.node)==null?void 0:d.attrs)==null?void 0:h.uid,c())},[t,n]);const c=()=>{var a,f,d,h,m;qo.onFetch(((d=(f=(a=t==null?void 0:t.node)==null?void 0:a.attrs)==null?void 0:f.uploader)==null?void 0:d.urlOutput)||((m=(h=t==null?void 0:t.node)==null?void 0:h.attrs)==null?void 0:m.src),s.slug,x=>{i((x==null?void 0:x.transcription)||"")},x=>{})},u=()=>{var a,f,d,h,m,x,g,w,b,j,A,v,k;qo.onTranscribe({file_id:(d=(f=(a=t==null?void 0:t.node)==null?void 0:a.attrs)==null?void 0:f.uploader)==null?void 0:d.id,url:((x=(m=(h=t==null?void 0:t.node)==null?void 0:h.attrs)==null?void 0:m.uploader)==null?void 0:x.urlOutput)||((w=(g=t==null?void 0:t.node)==null?void 0:g.attrs)==null?void 0:w.src),url_transcribe:((A=(j=(b=t==null?void 0:t.node)==null?void 0:b.attrs)==null?void 0:j.uploader)==null?void 0:A.url)||((k=(v=t==null?void 0:t.node)==null?void 0:v.attrs)==null?void 0:k.src),space_slug:s.slug},C=>{Ct.fire("In process","This process may take a few minutes","success")},C=>{})};return e.jsxs(Fe,{mt:20,children:[e.jsx(rn,{label:"Video transcript",readOnly:!0,value:r||""}),e.jsx(We,{radius:"xl",onClick:u,children:"Transcribe video"})]})}function Gx({element:t,saveNodeData:n,onConfigLoaded:o}){var q,Q,B,O;const s=ee(K=>K.tiptap),r=ee(K=>K.tiptapSidemenu),i=ee(K=>K.space),c=(r==null?void 0:r.editor)||s.editor,u=ee(K=>K.colors),a=((Q=(q=t==null?void 0:t.node)==null?void 0:q.attrs)==null?void 0:Q.circle_id)||(i==null?void 0:i.slug)||"",f=(u==null?void 0:u.default_text_color)||"#2d2d2d",[d,h]=l.useState("empty"),[m,x]=l.useState([]),[g,w]=l.useState(null),[b,j]=l.useState(!1),[A,v]=l.useState(!1),[k,C]=l.useState(""),[I,_]=l.useState(""),[R,F]=l.useState(null),G=l.useRef(null),T=l.useRef(0),L=(O=(B=t==null?void 0:t.node)==null?void 0:B.attrs)==null?void 0:O.navbarConfigId;l.useEffect(()=>{const K=++T.current,Y=()=>T.current===K;if(w(null),o(null),!a){h("empty");return}return dt.onFetchAll(a,H=>{Y()&&x(H)},()=>{}),L?(h("loading"),dt.onFetchById(L,a,H=>{if(!Y())return;const D=qn(H);if(!D){h("empty"),o(null);return}w(D),h("assigned"),o(D)},()=>{Y()&&h("empty")})):h("empty"),()=>{Y()&&(T.current+=1)}},[L,a]),l.useEffect(()=>()=>{T.current+=1},[]),l.useEffect(()=>{const K=Y=>{G.current&&!G.current.contains(Y.target)&&j(!1)};return b&&document.addEventListener("mousedown",K),()=>document.removeEventListener("mousedown",K)},[b]);const S=K=>console.error("NavBarPicker error:",K),W=K=>{const Y=++T.current,H=g;h("loading"),w(null),o(null),dt.onFetchById(K,a,D=>{if(T.current!==Y)return;const ne=qn(D);if(!ne){w(H),o(H),h(H?"assigned":"empty");return}w(ne),j(!1),h("assigned"),c.commands.updateAttributes("navbar",{navbarConfigId:ne.id,circle_id:a}),n(),o(ne),window.dispatchEvent(new Event("shareblock:save"))},D=>{T.current===Y&&(w(H),o(H),h(H?"assigned":"empty"),S(D))})},E=()=>{I.trim()&&dt.onCreate(a,I.trim(),K=>{const Y=qn(K);Y&&(w(Y),h("assigned"),_(""),c.commands.updateAttributes("navbar",{navbarConfigId:Y.id,circle_id:a}),n(),o(Y),dt.onFetchAll(a,x,S),window.dispatchEvent(new Event("shareblock:save")))},S,{defaultTextColor:f})},P=()=>{const K=g.id;dt.onDuplicate(K,a,Y=>{const H=qn(Y);H&&(w(H),c.commands.updateAttributes("navbar",{navbarConfigId:H.id,circle_id:a}),n(),o(H),dt.onFetchAll(a,x,S),window.dispatchEvent(new Event("shareblock:save")),dt.onDecrementUsage(K,a))},S)},$=()=>{k.trim()&&dt.onUpdate(g.id,a,{name:k.trim()},K=>{const Y=qn(K);Y&&(w(Y),v(!1),o(Y),dt.onFetchAll(a,x,S))},S)},X=K=>{dt.onDestroy(K,a,()=>{F(null),(g==null?void 0:g.id)===K&&(w(null),h("empty"),c.commands.updateAttributes("navbar",{navbarC
2onfigId:null}),n(),o(null)),dt.onFetchAll(a,x,S)},S)};if(d==="loading")return e.jsx("div",{style:{padding:"12px 0",textAlign:"center",fontSize:12,color:"#777"},children:"Loading navbar…"});if(d==="empty"){const K=m.length>0;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:12,textAlign:"center",padding:"8px 0"},children:[e.jsx("div",{style:{width:44,height:44,borderRadius:12,backgroundColor:"#F3F0FF66",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(xa,{size:22,color:"#7950f2"})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#2d2d2d",marginBottom:4},children:"Add a Navigation Bar"}),e.jsx("div",{style:{fontSize:12,color:"#777",lineHeight:1.4},children:K?"Choose an existing navbar to keep navigation consistent, or create a new one.":"Add a shared navigation bar to help visitors move between pages. Create one here and reuse it across your space."})]}),K&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{width:"100%",position:"relative"},ref:G,children:[e.jsxs("button",{onClick:()=>j(!b),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"10px 16px",fontSize:13,fontWeight:600,backgroundColor:"#7950f2",color:"#fff",border:"none",borderRadius:8,cursor:"pointer"},children:[e.jsx(cf,{size:13})," Use existing navbar"]}),b&&e.jsx(Ka,{navbars:m,onSelect:W,onCreateNew:()=>{j(!1),h("naming")},confirmDeleteId:R,setConfirmDeleteId:F,onDelete:X})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"0 4px"},children:[e.jsx("div",{style:{flex:1,height:1,backgroundColor:"#e0e0e0"}}),e.jsx("span",{style:{fontSize:11,color:"#777",fontWeight:500},children:"or"}),e.jsx("div",{style:{flex:1,height:1,backgroundColor:"#e0e0e0"}})]})]}),e.jsxs("button",{onClick:()=>h("naming"),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"10px 16px",fontSize:13,fontWeight:600,backgroundColor:"#fff",color:"#7950f2",border:"1.5px solid #e0e0e0",borderRadius:8,cursor:"pointer"},children:[e.jsx(Ln,{size:13})," Create new navbar"]})]})}return d==="naming"?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"8px 0"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,backgroundColor:"#F3F0FF66",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(Ln,{size:16,color:"#7950f2"})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#2d2d2d"},children:"New Navbar"}),e.jsx("div",{style:{fontSize:11,color:"#777"},children:"Give it a name so you can reuse it later"})]})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#777",marginBottom:5,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Name"}),e.jsx("input",{type:"text",value:I,onChange:K=>_(K.target.value),placeholder:"e.g. Main Site Nav, Course Nav...",autoFocus:!0,onKeyDown:K=>{K.key==="Enter"&&E()},style:{width:"100%",padding:"9px 12px",fontSize:13,border:"1.5px solid #7950f2",borderRadius:6,outline:"none",boxSizing:"border-box"}})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{onClick:()=>{h(L?"assigned":"empty"),_("")},style:{flex:1,padding:"9px 12px",fontSize:12,fontWeight:500,backgroundColor:"#fff",color:"#777",border:"1.5px solid #e0e0e0",borderRadius:8,cursor:"pointer"},children:"Back"}),e.jsx("button",{onClick:E,disabled:!I.trim(),style:{flex:2,padding:"9px 12px",fontSize:12,fontWeight:600,backgroundColor:I.trim()?"#7950f2":"#e9ecef",color:I.trim()?"#fff":"#777",border:"none",borderRadius:8,cursor:I.trim()?"pointer":"default"},children:"Create navbar"})]})]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"4px 0"},children:[e.jsxs("div",{style:{position:"relative"},ref:G,children:[e.jsxs("button",{onClick:()=>j(!b),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",fontSize:13,fontWeight:500,border:`1.5px solid ${b?"#7950f2":"#e0e0e0"}`,borderRadius:6,cursor:"pointer",backgroundColor:"#fff",color:"#2d2d2d",transition:"border-color 0.15s"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[e.jsx(xa,{size:13,color:"#7950f2"}),e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(g==null?void 0:g.name)||"Select a navbar..."})]}),e.jsx(Mc,{size:12,color:"#777"})]}),b&&e.jsx(Ka,{navbars:m,selectedId:g==null?void 0:g.id,onSelect:W,onCreateNew:()=>{j(!1),h("naming")},confirmDeleteId:R,setConfirmDeleteId:F,onDelete:X})]}),!A&&e.jsxs("div",{style:{display:"flex",gap:6},children:[e.jsxs("button",{onClick:()=>{C((g==null?void 0:g.name)||""),v(!0)},style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,padding:"6px 8px",fontSize:11,fontWeight:600,border:"1.5px solid #e0e0e0",borderRadius:6,cursor:"pointer",backgroundColor:"#fff",color:"#555"},children:[e.jsx(Xc,{size:11,color:"#777"})," Rename"]}),e.jsxs("button",{onClick:P,style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,padding:"6px 8px",fontSize:11,fontWeight:600,border:"1.5px solid #e0e0e0",borderRadius:6,cursor:"pointer",backgroundColor:"#fff",color:"#555"},children:[e.jsx(uf,{size:11,color:"#777"})," Duplicate"]})]}),A&&e.jsxs("div",{style:{display:"flex",gap:6,padding:"8px 10px",backgroundColor:"#f8f9fa",borderRadius:6,border:"1px solid #7950f2"},children:[e.jsx("input",{type:"text",value:k,onChange:K=>C(K.target.value),autoFocus:!0,onKeyDown:K=>{K.key==="Enter"&&$(),K.key==="Escape"&&v(!1)},style:{flex:1,padding:"5px 8px",fontSize:12,border:"1.5px solid #e0e0e0",borderRadius:6,outline:"none",boxSizing:"border-box"}}),e.jsx("button",{onClick:$,style:{padding:"5px 10px",fontSize:11,fontWeight:600,backgroundColor:"#7950f2",color:"#fff",border:"none",borderRadius:6,cursor:"pointer"},children:"Save"}),e.jsx("button",{onClick:()=>v(!1),style:{padding:"5px 8px",fontSize:11,backgroundColor:"#fff",color:"#777",border:"1px solid #e0e0e0",borderRadius:6,cursor:"pointer"},children:"Cancel"})]})]})}function Ka({navbars:t,selectedId:n,onSelect:o,onCreateNew:s,confirmDeleteId:r,setConfirmDeleteId:i,onDelete:c}){return e.jsxs("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,backgroundColor:"#fff",border:"1.5px solid #e0e0e0",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.12)",zIndex:100,overflow:"hidden"},children:[e.jsx("div",{style:{maxHeight:280,overflow:"auto"},children:t.map(u=>{const a=u.id===n;return r===u.id?e.jsxs("div",{style:{padding:"10px 14px",backgroundColor:"#fff5f5",borderBottom:"1px solid #fee"},children:[e.jsxs("div",{style:{fontSize:12,color:"#c92a2a",marginBottom:8,lineHeight:1.4},children:['Delete "',e.jsx("strong",{children:u.name}),'"? This removes it from all pages.']}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{onClick:d=>{d.stopPropagation(),c(u.id)},style:{flex:1,padding:"5px 0",fontSize:11,fontWeight:600,border:"none",borderRadius:4,cursor:"pointer",backgroundColor:"#e03131",color:"#fff"},children:"Delete"}),e.jsx("button",{onClick:d=>{d.stopPropagation(),i(null)},style:{flex:1,padding:"5px 0",fontSize:11,fontWeight:600,border:"1px solid #ddd",borderRadius:4,cursor:"pointer",backgroundColor:"#fff",color:"#555"},children:"Cancel"})]})]},u.id):e.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",backgroundColor:a?"#F3F0FF66":"transparent",transition:"background-color 0.1s",cursor:"pointer"},onMouseEnter:d=>{a||(d.currentTarget.style.backgroundColor="#f8f9fa")},onMouseLeave:d=>{a||(d.currentTarget.style.backgroundColor="transparent")},onClick:()=>o(u.id),children:[e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontSize:13,fontWeight:a?600:400,color:"#2d2d2d",marginBottom:2},children:u.name}),e.jsx("div",{style:{fontSize:11,color:"#777"},children:u.link_source==="sidebar"?"Linked to sidebar":`${u.links_count} ${u.links_count===1?"link":"links"}`})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexShrink:0},children:[a&&e.jsx("div",{style:{width:8,height:8,borderRadius:4,backgroundColor:"#7950f2"}}),e.jsx("button",{onClick:d=>{d.stopPropagation(),i(u.id)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,border:"none",borderRadius:4,cursor:"pointer",backgroundColor:"transparent",opacity:.3,transition:"opacity 0.15s"},onMouseEnter:d=>{d.currentTarget.style.opacity="1"},onMouseLeave:d=>{d.currentTarget.style.opacity="0.3"},children:e.jsx(Zc,{size:13,color:"#c92a2a"})})]})]},u.id)})}),e.jsx("div",{style:{height:1,backgroundColor:"#e0e0e0"}}),e.jsxs("button",{onClick:s,style:{width:"100%",display:"flex",alignItems:"center",gap:8,padding:"10px 14px",border:"none",cursor:"pointer",backgroundColor:"transparent",transition:"background-color 0.1s"},onMouseEnter:u=>{u.currentTarget.style.backgroundColor="#f8f9fa"},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(Ln,{size:13,color:"#7950f2"}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#7950f2"},children:"Create new navbar"})]})]})}
2function Yx({element:t,saveNodeData:n,navbarConfig:o,onConfigUpdated:s}){var $,X,q,Q;const r=ee(B=>B.tiptap),i=ee(B=>B.tiptapSidemenu),c=ee(B=>B.space),u=((X=($=t==null?void 0:t.node)==null?void 0:$.attrs)==null?void 0:X.circle_id)||(c==null?void 0:c.slug)||"",a=(Q=(q=t==null?void 0:t.node)==null?void 0:q.attrs)==null?void 0:Q.navbarConfigId,f=(i==null?void 0:i.editor)||r.editor,[d,h]=l.useState([]),[m,x]=l.useState(null),[g,w]=l.useState(null),b=l.useRef(null),j=l.useRef(a),A=l.useRef(null),v=l.useRef(0);l.useEffect(()=>{j.current=a,v.current+=1,b.current&&(clearTimeout(b.current),b.current=null),h([]),x(null),w(null),A.current=null},[a]),l.useEffect(()=>{String(o==null?void 0:o.id)===String(a)&&(h(Gu(o==null?void 0:o.links)),A.current=(o==null?void 0:o.revision)||null)},[a,o]),l.useEffect(()=>()=>{v.current+=1,b.current&&clearTimeout(b.current)},[]);const k=(B,{immediate:O=!1}={})=>{b.current&&clearTimeout(b.current);const K=a,Y=++v.current,H=()=>{b.current=null,dt.onUpdate(K,u,{links:B},D=>{String(j.current)!==String(K)||v.current!==Y||(A.current=(D==null?void 0:D.revision)||A.current,s(D),f.commands.updateAttributes("navbar",{_refreshKey:Date.now()}))},D=>{if(!(String(j.current)!==String(K)||v.current!==Y)){if(D!=null&&D.current&&String(D.current.id)===String(K)){const ne=qn(D.current);A.current=(ne==null?void 0:ne.revision)||null,h((ne==null?void 0:ne.links)||[]),x(null),s(ne)}console.error("NavBarLinks update error:",D)}},{baseRevision:A.current})};O?H():b.current=setTimeout(H,800)},C=B=>k(B),I=B=>{const O=d.filter(K=>K.id!==B);h(O),C(O)},_=()=>{const B=`l${Date.now()}`,O={id:B,label:"New Link",destination:{type:"space",value:""},displayAs:"link"},K=[...d,O];h(K),x(B),C(K)},R=(B,O,K)=>{const Y=d.map(H=>H.id===B?{...H,...O}:H);h(Y),x(null),k(Y,K)},F=(B,O)=>{w(O),B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",O)},G=(B,O)=>{if(B.preventDefault(),g===null||g===O)return;const K=[...d],[Y]=K.splice(g,1);K.splice(O,0,Y),h(K),w(O)},T=()=>{w(null),C(d)},L=Yu(o==null?void 0:o.style),S=L.linkSource||"custom",W=a,E=B=>{if(!B||!W)return;const O={...L,linkSource:B};dt.onUpdate(W,u,{style:O},K=>{s(K),f.commands.updateAttributes("navbar",{_refreshKey:Date.now()})},K=>console.error("NavBarLinks linkSource update error:",K))},P=(B,O)=>{if(!W)return;const K={...L,[B]:O};dt.onUpdate(W,u,{style:K},Y=>{s(Y),f.commands.updateAttributes("navbar",{_refreshKey:Date.now()})},Y=>console.error("NavBarLinks sidebar option update error:",Y))};return e.jsxs(Fe,{gap:4,style:{overflow:"hidden"},children:[e.jsx(jt,{value:S,onChange:E,data:[{label:"Custom links",value:"custom"},{label:"Sidebar links",value:"sidebar"}],size:"xs",comboboxProps:{withinPortal:!0,zIndex:99999},style:{marginBottom:8}}),S==="sidebar"&&e.jsxs(Fe,{gap:12,style:{padding:"4px 0"},children:[e.jsx(N,{size:"xs",c:"dimmed",children:"Links are automatically generated from your sidebar structure."}),e.jsx(Ve,{label:"Show home link",checked:L.showRootLink!==!1,onChange:B=>P("showRootLink",B.currentTarget.checked)}),L.showRootLink!==!1&&e.jsx(at,{label:"Home link label",size:"xs",placeholder:(c==null?void 0:c.name)||"Home",value:L.rootLinkLabel||"",onChange:B=>P("rootLinkLabel",B.currentTarget.value)})]}),S==="sidebar"&&d.length===0&&e.jsx(N,{size:"xs",c:"dimmed",style:{marginTop:12},children:"You can also add custom links that appear after your sidebar links."}),S==="sidebar"&&d.length>0&&e.jsx(N,{size:"xs",c:"dimmed",fw:500,style:{marginTop:12},children:"Additional links"}),d.map((B,O)=>m===B.id?e.jsx(Xx,{link:B,editor:f,onSave:(K,Y)=>R(B.id,K,Y),onCancel:()=>x(null)},B.id):e.jsx(qx,{link:B,index:O,onEdit:()=>x(B.id),onDelete:()=>I(B.id),onDragStart:F,onDragOver:G,onDragEnd:T,isDragging:g===O},B.id)),e.jsx(We,{variant:"outline",size:"xs",fullWidth:!0,onClick:_,style:{borderStyle:"dashed",borderColor:"#7950f2",color:"#7950f2",marginTop:4},leftSection:e.jsx(Ln,{size:14}),styles:{root:{paddingInlineStart:"var(--button-padding-x)"}},children:"Add link"})]})}function qx({link:t,index:n,onEdit:o,onDelete:s,onDragStart:r,onDragOver:i,onDragEnd:c,isDragging:u}){const a=t.destination||{},f=t.displayAs==="button";return e.jsxs("div",{draggable:!0,onDragStart:d=>r(d,n),onDragOver:d=>i(d,n),onDragEnd:c,style:{display:"flex",alignItems:"center",gap:6,padding:"8px 10px",borderRadius:6,border:"1px solid #e0e0e0",backgroundColor:u?"#f0f9ff":"#fff",opacity:u?.7:1,cursor:"default",transition:"background-color 0.1s",overflow:"hidden",maxWidth:"100%",boxSizing:"border-box"},children:[e.jsx("div",{style:{cursor:"grab",display:"flex",flexShrink:0,padding:"2px 0"},children:e.jsx(qu,{size:12,color:"#bbb"})}),e.jsxs("div",{style:{flex:"1 1 0",width:0,overflow:"hidden",cursor:"pointer"},onClick:o,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#2d2d2d",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:t.label}),f&&e.jsx("span",{style:{fontSize:9,fontWeight:700,padding:"1px 5px",borderRadius:3,backgroundColor:t.buttonBg||"#e86ade",color:t.buttonText||"#fff",textTransform:"uppercase",letterSpacing:"0.03em",flexShrink:0},children:"BTN"})]}),e.jsxs("div",{style:{fontSize:11,color:"#777",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:[a.type==="section"?"Linked to section":a.value||"No destination",t.target==="_blank"&&a.type!=="section"&&" ↗"]})]}),e.jsx("button",{onClick:o,style:{display:"flex",padding:4,backgroundColor:"transparent",border:"none",cursor:"pointer"},children:e.jsx(Mf,{size:12,color:"#777"})}),e.jsx("button",{onClick:s,style:{display:"flex",padding:4,backgroundColor:"transparent",border:"none",cursor:"pointer"},children:e.jsx(Zc,{size:12,color:"#ea5455"})})]})}function Ga({label:t,value:n,onChange:o}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx("span",{style:{fontSize:11,color:"#777"},children:t}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4}
2,children:[e.jsx("span",{style:{fontSize:10,color:"#777",fontFamily:"monospace"},children:n}),e.jsx("div",{style:{width:22,height:22,borderRadius:4,backgroundColor:n,border:"1.5px solid #e0e0e0",cursor:"pointer",position:"relative",overflow:"hidden"},children:e.jsx("input",{type:"color",value:n,onChange:s=>o(s.target.value),style:{position:"absolute",inset:-4,width:"150%",height:"150%",cursor:"pointer",border:"none",opacity:0}})})]})]})}function Xx({link:t,editor:n,onSave:o,onCancel:s}){var Q,B;const r=ee(O=>O.space),[i,c]=l.useState(t.label||""),[u,a]=l.useState(((Q=t.destination)==null?void 0:Q.type)||"space"),[f,d]=l.useState(((B=t.destination)==null?void 0:B.value)||""),[h,m]=l.useState(t.displayAs||"link"),[x,g]=l.useState(t.buttonBg||"#e86ade"),[w,b]=l.useState(t.buttonText||"#ffffff"),[j,A]=l.useState(t.buttonRadius||"pill"),v=t.target||(u==="url"?"_blank":"_self"),[k,C]=l.useState(v),[I,_]=l.useState(!1);l.useEffect(()=>{u==="url"?C("_blank"):u==="space"&&C("_self")},[u]);const R=r!=null&&r.slug&&(r!=null&&r.version)?{value:`/space/${r.slug}/${r.version}`,label:`${r.name||r.slug} (${r.slug})`}:null,[F,G]=l.useState(R?[R]:[]),[T,L]=l.useState(!1),S=l.useRef(null),W=O=>(R&&!O.some(K=>K.value===R.value)&&O.unshift(R),O),E=O=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{const K=["members","simple",`order-context-${window.$fetchedTopSlug}`];O&&K.push(`q=${O}`),sn.onFetchManaged(null,K,{page:1,per:10},Y=>{const H=Y.map(D=>({value:`/space/${D.slug}/${D.version}`,label:`${D.name} (${D.slug})`}));G(W(H)),L(!1)},()=>{G(W([])),L(!1)})},1e3),L(!0)};l.useEffect(()=>{u==="space"&&E("")},[u]);const P=()=>{var Y,H,D,ne;const O=(H=(Y=n==null?void 0:n.view)==null?void 0:Y.state)==null?void 0:H.selection;if(!O)return;const K=((ne=(D=O.node)==null?void 0:D.type)==null?void 0:ne.name)==="navbar"?O.from:null;window.$sectionParams={origin:{from:O.from,to:O.to},isSelection:!0,swalTitle:"Section linked",onUpdateLink:Ie=>{var Ke,Oe,Ce,Re;d(Ie),_(!1),o($(Ie),{immediate:!0}),K!=null&&((Oe=(Ke=n.commands)==null?void 0:Ke.setNodeSelection)==null||Oe.call(Ke,K),(Re=(Ce=n.view)==null?void 0:Ce.focus)==null||Re.call(Ce))}},_(!0)},$=(O=f)=>({label:i,destination:{type:u,value:O},displayAs:h,target:u==="section"?"_self":k,...h==="button"?{buttonBg:x,buttonText:w,buttonRadius:j}:{}}),X=()=>{o($())},q={fontSize:11,fontWeight:600,color:"#777",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:4};return e.jsx("div",{style:{padding:12,backgroundColor:"#f8f9fa",borderRadius:8,border:"1px solid #7950f2"},children:e.jsxs(Fe,{gap:10,children:[e.jsxs(p,{children:[e.jsx(N,{style:q,children:"Label"}),e.jsx(at,{value:i,onChange:O=>c(O.target.value),size:"xs",placeholder:"Link text"})]}),e.jsxs(p,{children:[e.jsx(N,{style:q,children:"Destination"}),e.jsx(Pe,{options:[{label:"Space",value:"space"},{label:"URL",value:"url"},{label:"Section",value:"section"}],activeValue:u,onChange:O=>{a(O),d(""),_(!1)},columns:3})]}),e.jsxs(p,{children:[u==="space"&&e.jsx(jt,{value:f,onChange:d,data:F,size:"xs",placeholder:"Search by name or slug",searchable:!0,onSearchChange:E,nothingFoundMessage:T?"Searching...":"No spaces found",comboboxProps:{zIndex:99999}}),u==="url"&&e.jsx(at,{value:f,onChange:O=>d(O.target.value),size:"xs",placeholder:"https://example.com"}),u==="section"&&e.jsxs(p,{children:[e.jsx(N,{size:"xs",c:"dimmed",mb:6,children:"Click the button below, then click on any section in the document."}),e.jsx(We,{radius:"xl",size:"xs",fullWidth:!0,variant:"outline",onClick:P,style:{borderColor:I?"#2d8a2d":"#7950f2",color:I?"#2d8a2d":"#7950f2"},children:I?"Click a section in the document...":"Select section"}),f&&e.jsx(N,{size:"xs",c:"dimmed",mt:4,style:{textAlign:"center"},children:"✓ Linked to section"})]})]}),u!=="section"&&e.jsxs(p,{children:[e.jsx(N,{style:q,children:"Opens in"}),e.jsx(Pe,{options:[{label:"This tab",value:"_self"},{label:"New tab",value:"_blank"}],activeValue:k,onChange:C,columns:2})]}),e.jsxs(p,{children:[e.jsx(N,{style:q,children:"Display as"}),e.jsx(Pe,{options:[{label:"Text link",value:"link"},{label:"Button",value:"button"}],activeValue:h,onChange:m,columns:2})]}),h==="button"&&e.jsxs("div",{style:{padding:10,backgroundColor:"#fff",borderRadius:6,border:"1px solid #e0e0e0",display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ga,{label:"Fill color",value:x,onChange:g}),e.jsx(Ga,{label:"Text color",value:w,onChange:b}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx("span",{style:{fontSize:11,color:"#777"},children:"Shape"}),e.jsx("div",{style:{display:"flex",gap:3},children:[{id:"square",r:2}
2,{id:"rounded",r:6},{id:"pill",r:20}].map(O=>e.jsx("div",{onClick:()=>A(O.id),style:{width:32,height:22,borderRadius:O.r,border:`1.5px solid ${j===O.id?"#7950f2":"#e0e0e0"}`,backgroundColor:j===O.id?"#7950f2":"#fff",cursor:"pointer",transition:"all 0.15s ease"}},O.id))})]})]}),e.jsxs(ye,{gap:8,justify:"flex-end",children:[e.jsx(We,{variant:"subtle",size:"compact-xs",style:{color:"#777"},onClick:s,children:"Cancel"}),e.jsx(We,{variant:"filled",size:"compact-xs",style:{backgroundColor:"#7950f2"},onClick:X,children:"Save"})]})]})})}const Zx="_colorSwatch_1c3mu_1",Qx="_colorSwatchEmpty_1c3mu_17",Jx="_removeColorBtn_1c3mu_30",hr={colorSwatch:Zx,colorSwatchEmpty:Qx,removeColorBtn:Jx},eg=[{label:"12px",value:"12px"},{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"}],tg={S:16,M:28,L:40};function Ya(t){var n;return typeof t=="number"&&Number.isFinite(t)?t:(n=tg[t])!=null?n:28}const ng=[{label:"Regular",value:"normal"},{label:"Medium",value:"500"},{label:"Semi-bold",value:"600"},{label:"Bold",value:"bold"}];function og(t){return typeof t=="string"&&(t.startsWith("themed(")||t.startsWith("token:")||t.startsWith("gradient:")||t.startsWith("recipe:")||t.startsWith("tint:"))}function Mo({label:t,value:n,onChange:o,clearable:s=!1,colors:r}){const i=Dt(),[c,u]=l.useState(!1),a=!n||n==="",f=og(n),d=f?Zt(n,r):n,h=a?"#ffffff":d,m=a?"":f?"THEME":qt(n).toHexString().toUpperCase();return e.jsxs(p,{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{style:{fontSize:13,color:"#2d2d2d"},children:t}),e.jsxs(we,{opened:c,onChange:x=>{x||u(!1)},offset:15,zIndex:999999,width:264,children:[e.jsx(we.Target,{children:e.jsxs(ye,{gap:8,style:{cursor:"pointer"},onClick:()=>u(x=>!x),children:[m&&e.jsx(N,{style:{fontSize:11,color:"#aaa",fontWeight:500,fontFamily:"monospace"},children:m}),e.jsx(p,{style:{width:28,background:h},className:`${hr.colorSwatch} ${a?hr.colorSwatchEmpty:""}`})]})}),e.jsxs(we.Dropdown,{children:[e.jsx("div",{className:"gradient-color-picker",children:e.jsx(Vt,{value:f?d:n||"",onChange:o,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,hideGradientControls:!0,width:240,height:160,presets:an(i,"light")})}),s&&e.jsx("div",{onClick:()=>{o(""),u(!1)},className:hr.removeColorBtn,children:"Remove color"})]})]})]})}function sg({element:t,saveNodeData:n,navbarConfig:o,onConfigUpdated:s}){var j,A,v,k;const r=ee(C=>C.tiptap),i=ee(C=>C.tiptapSidemenu),c=ee(C=>C.space),u=ee(C=>C.colors),a=((A=(j=t==null?void 0:t.node)==null?void 0:j.attrs)==null?void 0:A.circle_id)||(c==null?void 0:c.slug)||"";u!=null&&u.default_text_color;const f=(k=(v=t==null?void 0:t.node)==null?void 0:v.attrs)==null?void 0:k.navbarConfigId,d=(i==null?void 0:i.editor)||r.editor,[h,m]=l.useState({}),x=l.useRef(null);l.useEffect(()=>{o!=null&&o.style&&m(o.style)},[o]);const g=(C,I)=>{const _={...h,[C]:I};m(_),w({style:_})},w=C=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{dt.onUpdate(f,a,C,I=>{s(I),d.commands.updateAttributes("navbar",{_refreshKey:Date.now()})},I=>console.error("NavBarStyle update error:",I))},800)},b={fontSize:11,fontWeight:600,color:"#777",textTransform:"uppercase",letterSpacing:"0.04em"};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx(Mo,{label:"Text color",value:h.textColor||"",onChange:C=>g("textColor",C),colors:u}),e.jsx(Mo,{label:"Hover text color",value:h.hoverColor||"",onChange:C=>g("hoverColor",C),colors:u}),e.jsx(Mo,{label:"Hover background",value:h.hoverBgColor||"",onChange:C=>g("hoverBgColor",C),clearable:!0,colors:u}),e.jsx(Mo,{label:"Active text color",value:h.activeTextColor||"",onChange:C=>g("activeTextColor",C),clearable:!0,colors:u}),e.jsx(Mo,{label:"Active background",value:h.activeBgColor||"",onChange:C=>g("activeBgColor",C),clearable:!0,colors:u})]}),e.jsxs(p,{children:[e.jsx(N,{style:b,mb:6,children:"Font"}),e.jsx(jt,{value:h.fontFamily||"",onChange:C=>g("fontFamily",C||""),data:or,renderOption:({option:C})=>{const I=C.value||"inherit";return e.jsx(N,{size:"sm",style:{fontFamily:I},children:C.label})},placeholder:"Default",clearable:!0,searchable:!0,nothingFoundMessage:"No font found",comboboxProps:{maxDropdownHeight:300,zIndex:99999},size:"xs",styles:{input:{fontFamily:h.fontFamily||"inherit"}}})]}),e.jsxs(ye,{grow:!0,gap:8,children:[e.jsxs(p,{children:[e.jsx(N,{style:b,mb:6,children:"Size"}),e.jsx(jt,{value:h.fontSize||"14px",onChange:C=>g("fontSize",C||"14px"),data:eg,size:"xs",comboboxProps:{zIndex:99999}})]}),e.jsxs(p,{children:[e.jsx(N,{style:b,mb:6,children:"Weight"}),e.jsx(jt,{value:h.fontWeight||"normal",onChange:C=>g("fontWeight",C||"normal"),data:ng,size:"xs",comboboxProps:{zIndex:99999}})]})]}),e.jsxs(p,{children:[e.jsxs(N,{style:b,mb:6,children:["Spacing — ",Ya(h.spacing),"px"]}),e.jsx(ts,{min:0,max:64,step:1,value:Ya(h.spacing),onChange:C=>g("spacing",C),size:"sm",label:C=>`${C}px`})]}),e.jsxs(p,{children:[e.jsx(N,{style:b,mb:6,children:"Separator"}),e.jsx(Pe,{options:[{label:"None",value:"none"},{label:"·",value:"dot"},{label:"|",value:"pipe"},{label:"/",value:"slash"}],activeValue:h.separator||"none",onChange:C=>g("separator",C),columns:4})]}),e.jsxs(p,{children:[e.jsx(N,{style:b,mb:6,children:"Hover / active radius"}),e.jsx(Pe,{options:[{label:"Square",value:"4"},{label:"Rounded",value:"8"},{label:"Circle",value:"20"}],activeValue:h.hoverBgRadius||"6",onChange:C=>g("hoverBgRadius",C),columns:3})]}),e.jsxs(p,{children:[e.jsx(N,{style:b,mb:6,children:"Active page indicator"}),e.jsx(Pe,{options:[{label:"None",value:"none"},{label:"Underline",value:"underline"},{label:"Bold",value:"bold"}],activeValue:h.activeIndicator||"underline",onChange:C=>g("activeIndicator",C),columns:3})]})]})}
2function rg({element:t,saveNodeData:n,navbarConfig:o,onConfigUpdated:s}){var v,k,C,I;const r=ee(_=>_.tiptap),i=ee(_=>_.tiptapSidemenu),c=ee(_=>_.space),u=((k=(v=t==null?void 0:t.node)==null?void 0:v.attrs)==null?void 0:k.circle_id)||(c==null?void 0:c.slug)||"",a=(I=(C=t==null?void 0:t.node)==null?void 0:C.attrs)==null?void 0:I.navbarConfigId,f=(i==null?void 0:i.editor)||r.editor,[d,h]=l.useState("left"),[m,x]=l.useState(!1),g=l.useRef(null);l.useEffect(()=>{var _,R;(_=o==null?void 0:o.style)!=null&&_.alignment&&h(o.style.alignment),x(((R=o==null?void 0:o.style)==null?void 0:R.fullWidth)===!0)},[o]);const w=_=>{g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{dt.onUpdate(a,u,{style:_},R=>{s(R),f.commands.updateAttributes("navbar",{_refreshKey:Date.now()})},R=>console.error("NavBarLayout update error:",R))},800)},b=_=>{h(_),w({...o==null?void 0:o.style,alignment:_})},j=_=>{x(_),w({...o==null?void 0:o.style,fullWidth:_})},A={fontSize:11,fontWeight:600,color:"#777",textTransform:"uppercase",letterSpacing:"0.04em"};return e.jsxs(Fe,{gap:12,style:{padding:"0 0 4px"},children:[e.jsxs(p,{children:[e.jsx(N,{style:A,mb:4,children:"Alignment"}),e.jsx(Pe,{options:[{label:"Left",value:"left"},{label:"Center",value:"center"},{label:"Right",value:"right"}],activeValue:d,onChange:b,columns:3})]}),e.jsx(p,{mt:4,children:e.jsx(Ve,{label:"Extend to full width",checked:m,onChange:_=>j(_.currentTarget.checked)})})]})}const ig=[{label:"24px",value:"24"},{label:"32px",value:"32"},{label:"40px",value:"40"},{label:"48px",value:"48"},{label:"64px",value:"64"}],lg=[{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"},{label:"32px",value:"32px"}],ag=[{label:"Regular",value:"normal"},{label:"Medium",value:"500"},{label:"Semi-bold",value:"600"},{label:"Bold",value:"bold"}];function cg({onUploadComplete:t}){const[n,o]=l.useState(0);return rr(s=>o(s.completed)),ir(s=>{t(s.uploadResponse.data.file.url)}),n>0&&n<=100?e.jsx(yi,{color:"cyan",size:"sm",value:n,style:{marginTop:8}}):null}const ug=ls(t=>{const[n,o]=l.useState(!1);return e.jsx(p,{...t,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{width:"100%",height:70,borderRadius:8,border:`1.5px dashed ${n?"#7950f2":"#ccc"}`,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:n?"#f0faff":"#fafafa",transition:"all 0.15s ease"},children:e.jsxs(p,{style:{textAlign:"center"},children:[e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",stroke:"#999",strokeWidth:"1.5",style:{display:"block",margin:"0 auto 4px"},children:[e.jsx("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"2"}),e.jsx("circle",{cx:"5.5",cy:"5.5",r:"1.5"}),e.jsx("path",{d:"M1.5 11 L5 7.5 L8 10.5 L10.5 8 L14.5 12",strokeLinejoin:"round"})]}),e.jsx(p,{style:{fontSize:11,color:"#999",fontWeight:500},children:"Upload logo"})]})})});function dg({element:t,navbarConfig:n,onConfigUpdated:o}){var R,F,G,T,L;const s=ee(S=>S.tiptap),r=ee(S=>S.tiptapSidemenu),i=ee(S=>S.space),c=ee(S=>S.website),u=((F=(R=t==null?void 0:t.node)==null?void 0:R.attrs)==null?void 0:F.circle_id)||(i==null?void 0:i.slug)||"",a=(T=(G=t==null?void 0:t.node)==null?void 0:G.attrs)==null?void 0:T.navbarConfigId,f=(r==null?void 0:r.editor)||s.editor,[d,h]=l.useState({}),m=l.useRef(null);l.useEffect(()=>{n!=null&&n.style&&h(n.style)},[n]);const x=(S,W)=>{const E={...d,[S]:W};h(E),g({style:E})},g=S=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{dt.onUpdate(a,u,S,W=>{o(W),f.commands.updateAttributes("navbar",{_refreshKey:Date.now()})},W=>console.error("NavBarLogo update error:",W))},800)},w=S=>{x("logoUrl",S)},b=()=>{const S={...d,logoUrl:""};h(S),g({style:S})},j=!!d.showLogo,A=d.logoUrl||"",v=d.logoMaxHeight||40,k=(c==null?void 0:c.rootName)||(i==null?void 0:i.name)||"",C=!!d.showTitle,I=(L=d.titleText)!=null?L:k,_={fontSize:11,fontWeight:600,color:"#777",textTransform:"uppercase",letterSpacing:"0.04em"};return e.jsxs(Fe,{gap:12,children:[e.jsx(Ve,{label:"Show logo",checked:j,onChange:S=>x("showLogo",S.currentTarget.checked),size:"sm"}),j&&e.jsxs(Fe,{gap:10,children:[A?e.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[e.jsx("div",{style:{border:"1.5px solid #e0e0e0",borderRadius:8,padding:8,backgroundColor:"#fafafa",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("img",{src:A,alt:"Logo",style:{maxWidth:"100%",maxHeight:80,objectFit:"contain",display:"block"}})}),e.jsx("button",{onClick:b,style:{position:"absolute",top:-6,right:-6,width:20,height:20,borderRadius:10,backgroundColor:"#e03131",color:"#fff",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0},children:e.jsx(Xu,{size:12})})]}):e.jsxs(Co,{withCredentials:!0,destination:{url:`https://api.sutra.co/api/v4/spaces/${u}/upload_file`,headers:To()},accept:"image/*",children:[e.jsx(ug,{}),e.jsx(cg,{onUploadComplete:w})]}),e.jsxs("div",{children:[e.jsx("div",{style:_,children:"Max height"}),e.jsx(Ue,{data:ig,value:String(v),onChange:S=>x("logoMaxHeight",parseInt(S.currentTarget.value,10)),size:"xs",style:{marginTop:4}})]})]}),e.jsx(Ve,{label:"Show title",checked:C,onChange:S=>{const W=S.currentTarget.checked,E={...d,showTitle:W};W&&E.titleText===void 0&&(E.titleText=k),h(E),g({style:E})},size:"sm"}),C&&e.jsxs(Fe,{gap:10,children:[e.jsx(at,{label:"Title",size:"xs",placeholder:k,value:
2I,onChange:S=>x("titleText",S.currentTarget.value)}),e.jsxs(p,{children:[e.jsx(N,{style:_,mb:6,children:"Font"}),e.jsx(jt,{value:d.titleFontFamily||"",onChange:S=>x("titleFontFamily",S||""),data:or,renderOption:({option:S})=>e.jsx(N,{size:"sm",style:{fontFamily:S.value||"inherit"},children:S.label}),placeholder:"Default",clearable:!0,searchable:!0,nothingFoundMessage:"No font found",comboboxProps:{maxDropdownHeight:300,zIndex:99999},size:"xs",styles:{input:{fontFamily:d.titleFontFamily||"inherit"}}})]}),e.jsxs(ye,{grow:!0,gap:8,children:[e.jsxs(p,{children:[e.jsx(N,{style:_,mb:6,children:"Size"}),e.jsx(jt,{value:d.titleFontSize||"18px",onChange:S=>x("titleFontSize",S||"18px"),data:lg,size:"xs",comboboxProps:{zIndex:99999}})]}),e.jsxs(p,{children:[e.jsx(N,{style:_,mb:6,children:"Weight"}),e.jsx(jt,{value:d.titleFontWeight||"600",onChange:S=>x("titleFontWeight",S||"600"),data:ag,size:"xs",comboboxProps:{zIndex:99999}})]})]})]}),(j||C)&&e.jsx(Ve,{label:"Link logo and title to home",checked:!!d.linkLogo,onChange:S=>{const W={...d,linkLogo:S.currentTarget.checked,logoLinkId:""};h(W),g({style:W})},size:"sm"})]})}const fg="_colorSwatch_1c3mu_1",hg="_colorSwatchEmpty_1c3mu_17",pg="_removeColorBtn_1c3mu_30",pr={colorSwatch:fg,colorSwatchEmpty:hg,removeColorBtn:pg};function xg(t){return typeof t=="string"&&(t.startsWith("themed(")||t.startsWith("token:")||t.startsWith("gradient:")||t.startsWith("recipe:")||t.startsWith("tint:"))}function Ls({label:t,value:n,onChange:o,clearable:s=!1,colors:r}){const i=Dt(),[c,u]=l.useState(!1),a=!n||n==="",f=xg(n),d=f?Zt(n,r):n,h=a?"#ffffff":d,m=a?"":f?"THEME":qt(n).toHexString().toUpperCase();return e.jsxs(p,{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{style:{fontSize:13,color:"#2d2d2d"},children:t}),e.jsxs(we,{opened:c,onChange:x=>{x||u(!1)},offset:15,zIndex:999999,width:264,children:[e.jsx(we.Target,{children:e.jsxs(ye,{gap:8,style:{cursor:"pointer"},onClick:()=>u(x=>!x),children:[m&&e.jsx(N,{style:{fontSize:11,color:"#aaa",fontWeight:500,fontFamily:"monospace"},children:m}),e.jsx(p,{style:{width:28,background:h},className:`${pr.colorSwatch} ${a?pr.colorSwatchEmpty:""}`})]})}),e.jsxs(we.Dropdown,{children:[e.jsx("div",{className:"gradient-color-picker",children:e.jsx(Vt,{value:f?d:n||"",onChange:o,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,hideGradientControls:!0,width:240,height:160,presets:an(i,"light")})}),s&&e.jsx("div",{onClick:()=>{o(""),u(!1)},className:pr.removeColorBtn,children:"Remove color"})]})]})]})}function gg(t,n,o){const s=Zt(t||"#ffffff",o),r=Zt(n||"#222222",o),i=qt(s||"#ffffff"),c=i.isLight();return{highlightText:r||"#222222",highlightBg:c?i.darken(5).toString():i.lighten(10).toString()}}function mg({element:t,navbarConfig:n,onConfigUpdated:o}){var j,A,v,k;const s=ee(C=>C.tiptap),r=ee(C=>C.tiptapSidemenu),i=ee(C=>C.space),c=ee(C=>C.colors),u=((A=(j=t==null?void 0:t.node)==null?void 0:j.attrs)==null?void 0:A.circle_id)||(i==null?void 0:i.slug)||"",a=(k=(v=t==null?void 0:t.node)==null?void 0:v.attrs)==null?void 0:k.navbarConfigId,f=(r==null?void 0:r.editor)||s.editor,[d,h]=l.useState({}),m=l.useRef(null);l.useEffect(()=>{n!=null&&n.style&&h(n.style)},[n]);const x=(C,I)=>{const _={...d,[C]:I};h(_),w({style:_})},g=C=>{const I={...d,dropdownHover:C};if(C==="highlight"){const _=gg(d.dropdownBg,d.dropdownTextColor,c);I.dropdownHighlightText=_.highlightText,I.dropdownHighlightBg=_.highlightBg}h(I),w({style:I})},w=C=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{dt.onUpdate(a,u,C,I=>{o(I),f.commands.updateAttributes("navbar",{_refreshKey:Date.now()})},I=>console.error("NavBarDropdownMenu update error:",I))},800)},b={fontSize:11,fontWeight:600,color:"#777",textTransform:"uppercase",letterSpacing:"0.04em"};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[e.jsx(Ls,{label:"Background",value:d.dropdownBg||"#ffffff",onChange:C=>x("dropdownBg",C),colors:c}),e.jsx(Ls,{label:"Text",value:d.dropdownTextColor||"#222222",onChange:C=>x("dropdownTextColor",C),colors:c})]}),e.jsxs(p,{children:[e.jsx(N,{style:b,mb:6,children:"Border radius"}),e.jsx(Pe,{options:[{label:"Square",value:"4"},{label:"Rounded",value:"12"},{label:"Circle",value:"20"}],activeValue:d.dropdownRadius||"12",onChange:C=>x("dropdownRadius",C),columns:3})]}),e.jsxs(p,{children:[e.jsx(N,{style:b,mb:6,children:"Shadow"}),e.jsx(Pe,{options:[{label:"None",value:"none"},{label:"Subtle",value:"subtle"},{label:"Medium",value:"medium"},{label:"Bold",value:"bold"}],activeValue:d.dropdownShadow||"medium",onChange:C=>x("dropdownShadow",C),columns:4})]}),e.jsxs(p,{children:[e.jsx(N,{style:b,mb:6,children:"Border"}),e.jsx(Pe,{options:[{label:"None",value:"none"},{label:"Subtle",value:"subtle"},{label:"Strong",value:"strong"}],activeValue:d.dropdownBorder||"none",onChange:C=>
2x("dropdownBorder",C),columns:3})]}),e.jsxs(p,{children:[e.jsx(N,{style:b,mb:6,children:"Item hover"}),e.jsx(Pe,{options:[{label:"None",value:"none"},{label:"Highlight",value:"highlight"},{label:"Underline",value:"underline"}],activeValue:d.dropdownHover||"highlight",onChange:g,columns:3})]}),(d.dropdownHover||"highlight")==="highlight"&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[e.jsx(Ls,{label:"Highlight text",value:d.dropdownHighlightText||"",onChange:C=>x("dropdownHighlightText",C),clearable:!0,colors:c}),e.jsx(Ls,{label:"Highlight background",value:d.dropdownHighlightBg||"",onChange:C=>x("dropdownHighlightBg",C),clearable:!0,colors:c})]})]})}function bg({element:t,saveNodeData:n,editor:o,onConfigLoaded:s}){var X,q,Q,B,O,K;const r=Qn(),i=ee(Y=>Y.tiptap),c=o||(i==null?void 0:i.editor),u=ee(Y=>Y.space),a=ee(Y=>Y.website),f=((q=(X=t==null?void 0:t.node)==null?void 0:X.attrs)==null?void 0:q.shareBlockKind)||"generic",d=((B=(Q=t==null?void 0:t.node)==null?void 0:Q.attrs)==null?void 0:B.circle_id)||(u==null?void 0:u.slug)||"",[h,m]=l.useState("empty"),[x,g]=l.useState([]),[w,b]=l.useState(null),[j,A]=l.useState(!1),[v,k]=l.useState(!1),[C,I]=l.useState(""),[_,R]=l.useState(""),[F,G]=l.useState(null),T=l.useRef(null),L=(K=(O=t==null?void 0:t.node)==null?void 0:O.attrs)==null?void 0:K.shareBlockConfigId;l.useEffect(()=>{d&&(en.onFetchAll(d,Y=>g(Y),()=>{}),L?en.onFetchById(L,d,Y=>{b(Y),m("assigned"),s(Y)},()=>m("empty")):m("empty"))},[L,d]),l.useEffect(()=>{const Y=H=>{T.current&&!T.current.contains(H.target)&&A(!1)};return j&&document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[j]);const S=Y=>console.error("ShareBlockPicker error:",Y);if(f==="site_header"||f==="site_footer"){const Y=f==="site_header"?"Site Header":"Site Footer",H=f==="site_header"?a==null?void 0:a.headerConfig:a==null?void 0:a.footerConfig,D=f==="site_header"?"website_header_share_block_config_id":"website_footer_share_block_config_id",ne=x.filter(Oe=>Oe.kind===f),Ie=Oe=>{Wc.onUpdate(d,{pod_settings_attributes:{[D]:Oe}},Ce=>{var xe,Ee;r(nf((Ce==null?void 0:Ce.website)||{}));const Re=f==="site_header"?(xe=Ce==null?void 0:Ce.website)==null?void 0:xe.header_config:(Ee=Ce==null?void 0:Ce.website)==null?void 0:Ee.footer_config;s(Re||null)},S)},Ke=()=>{en.onCreate(d,Y,Oe=>Ie(Oe.id),S,{kind:f})};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"8px 0"},children:[e.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#2d2d2d"},children:Y}),e.jsx("div",{style:{fontSize:12,color:"#777",lineHeight:1.45},children:"This block is controlled by website mode and resolves from the active website root. Editing the content in this block updates it across the site."}),H?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px",border:"1px solid #e9ecef",borderRadius:8,backgroundColor:"#fafafa"},children:[e.jsx(Qe,{icon:Ts.faInfinity,style:{fontSize:12,color:"#7950f2"}}),e.jsxs("div",{style:{minWidth:0},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"#2d2d2d"},children:H.name}),e.jsx("div",{style:{fontSize:11,color:"#999"},children:"Shared across website pages"})]})]}):e.jsxs("button",{onClick:Ke,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"10px 16px",fontSize:13,fontWeight:600,backgroundColor:"#7950f2",color:"#fff",border:"none",borderRadius:8,cursor:"pointer"},children:[e.jsx(Ln,{size:13})," Create ",Y]}),ne.length>0&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#777",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Use Existing"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:ne.map(Oe=>{const Ce=(H==null?void 0:H.id)===Oe.id;return e.jsxs("button",{onClick:()=>Ie(Oe.id),disabled:Ce,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"9px 12px",fontSize:12,border:`1px solid ${Ce?"#7950f2":"#e0e0e0"}`,borderRadius:8,backgroundColor:Ce?"#F3F0FF33":"#fff",color:"#2d2d2d",cursor:Ce?"default":"pointer"},children:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Oe.name}),Ce&&e.jsx(Zu,{size:12,color:"#7950f2"})]},Oe.id)})})]})]})}const W=Y=>{en.onFetchById(Y,d,H=>{b(H),A(!1),m("assigned"),be(c,t,{shareBlockConfigId:H.id,circle_id:d})&&n(),s(H)},S)},E=()=>{_.trim()&&en.onCreate(d,_.trim(),Y=>{b(Y),m("assigned"),R(""),be(c,t,{shareBlockConfigId:Y.id,circle_id:d})&&n(),s(Y),en.onFetchAll(d,g,S)},S)},P=()=>{C.trim()&&en.onUpdate(w.id,d,{name:C.trim()},Y=>{b(Y),k(!1),s(Y),en.onFetchAll(d,g,S)},S)},$=Y=>{en.onDestroy(Y,d,()=>{G(null),(w==null?void 0:w.id)===Y&&(b(null),m("empty"),be(c,t,{shareBlockConfigId:null})&&n(),s(null)),en.onFetchAll(d,g,S)},S)};return h==="empty"?e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:12,textAlign:"center",padding:"8px 0"},children:[e.jsx("div",{style:{width:44,height:44,borderRadius:12,backgroundColor:"#F3F0FF66",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Qe,{icon:Ts.faInfinity,style:{fontSize:22,color:"#7950f2"}})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#2d2d2d",marginBottom:4},children:"Add a Share Block"}),e.jsx("div",{style:{fontSize:12,color:"#777",lineHeight:1.4},children:"Choose an existing share block to reuse content across spaces, or create a new one."})]}),x.length>0&&e.jsxs("div",{style:{width:"100%",position:"relative"},ref:T,children:[e.jsxs("button",{onClick:()=>A(!j),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"10px 16px",fontSize:13,fontWeight:600,backgroundColor:"#7950f2",color:"#fff",border:"none",borderRadius:8,cursor:"pointer"},children:[e.jsx(Qe,{icon:Ts.faInfinity,style:{fontSize:13}})," Use existing share block"]}),j&&e.jsx(qa,{blocks:x,onSelect:W,onCreateNew:()=>{A(!1),m("naming")},confirmDeleteId:F,setConfirmDeleteId:G,onDelete:$})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"0 4px"},children:[e.jsx("div",{style:{flex:1,height:1,backgroundColor:"#e0e0e0"}}),e.jsx("span",{style:{fontSize:11,color:"#777",fontWeight:500},children:"or"}),e.jsx("div",{style:{flex:1,height:1,backgroundColor:"#e0e0e0"}})]}),e.jsxs("button",{onClick:()=>m("naming"),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"10px 16px",fontSize:13,fontWeight:600,backgroundColor:"#fff",color:"#7950f2",border:"1.5px solid #e0e0e0",borderRadius:8,cursor:"pointer"},children:[e.jsx(Ln,{size:13})," Create new share block"]})]}):h==="naming"?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"8px 0"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,backgroundColor:"#F3F0FF66",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(Ln,{size:16,color:"#7950f2"})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#2d2d2d"},children:"New Share Block"}),e.jsx("div",{style:{fontSize:11,color:"#777"},children:"Give it a name so you can reuse it later"})]})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#777",marginBottom:5,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Name"}
2),e.jsx("input",{type:"text",value:_,onChange:Y=>R(Y.target.value),placeholder:"e.g. Site Header, Course Footer...",autoFocus:!0,onKeyDown:Y=>{Y.key==="Enter"&&E()},style:{width:"100%",padding:"9px 12px",fontSize:13,border:"1.5px solid #7950f2",borderRadius:6,outline:"none",boxSizing:"border-box"}})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{onClick:()=>{m(L?"assigned":"empty"),R("")},style:{flex:1,padding:"9px 12px",fontSize:12,fontWeight:500,backgroundColor:"#fff",color:"#777",border:"1.5px solid #e0e0e0",borderRadius:8,cursor:"pointer"},children:"Back"}),e.jsx("button",{onClick:E,disabled:!_.trim(),style:{flex:2,padding:"9px 12px",fontSize:12,fontWeight:600,backgroundColor:_.trim()?"#7950f2":"#e9ecef",color:_.trim()?"#fff":"#777",border:"none",borderRadius:8,cursor:_.trim()?"pointer":"default"},children:"Create share block"})]})]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"4px 0"},children:[e.jsxs("div",{style:{position:"relative"},ref:T,children:[e.jsxs("button",{onClick:()=>A(!j),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",fontSize:13,fontWeight:500,border:`1.5px solid ${j?"#7950f2":"#e0e0e0"}`,borderRadius:6,cursor:"pointer",backgroundColor:"#fff",color:"#2d2d2d",transition:"border-color 0.15s"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[e.jsx(Qe,{icon:Ts.faInfinity,style:{fontSize:13,color:"#7950f2"}}),e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(w==null?void 0:w.name)||"Select a share block..."})]}),e.jsx(Mc,{size:12,color:"#777"})]}),j&&e.jsx(qa,{blocks:x,selectedId:w==null?void 0:w.id,onSelect:W,onCreateNew:()=>{A(!1),m("naming")},confirmDeleteId:F,setConfirmDeleteId:G,onDelete:$})]}),!v&&e.jsx("div",{style:{display:"flex",gap:6},children:e.jsxs("button",{onClick:()=>{I((w==null?void 0:w.name)||""),k(!0)},style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,padding:"6px 8px",fontSize:11,fontWeight:600,border:"1.5px solid #e0e0e0",borderRadius:6,cursor:"pointer",backgroundColor:"#fff",color:"#555"},children:[e.jsx(Xc,{size:11,color:"#777"})," Rename"]})}),v&&e.jsxs("div",{style:{display:"flex",gap:6,padding:"8px 10px",backgroundColor:"#f8f9fa",borderRadius:6,border:"1px solid #7950f2"},children:[e.jsx("input",{type:"text",value:C,onChange:Y=>I(Y.target.value),autoFocus:!0,onKeyDown:Y=>{Y.key==="Enter"&&P(),Y.key==="Escape"&&k(!1)},style:{flex:1,padding:"5px 8px",fontSize:12,border:"1.5px solid #e0e0e0",borderRadius:6,outline:"none",boxSizing:"border-box"}}),e.jsx("button",{onClick:P,style:{padding:"5px 10px",fontSize:11,fontWeight:600,backgroundColor:"#7950f2",color:"#fff",border:"none",borderRadius:6,cursor:"pointer"},children:"Save"}),e.jsx("button",{onClick:()=>k(!1),style:{padding:"5px 8px",fontSize:11,backgroundColor:"#fff",color:"#777",border:"1px solid #e0e0e0",borderRadius:6,cursor:"pointer"},children:"Cancel"})]})]})}function qa({blocks:t,selectedId:n,onSelect:o,onCreateNew:s}){return e.jsxs("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,backgroundColor:"#fff",border:"1.5px solid #e0e0e0",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.12)",zIndex:100,overflow:"hidden"},children:[e.jsx("div",{style:{maxHeight:220,overflow:"auto"},children:t.map(r=>{const i=r.id===n;return e.jsxs("button",{onClick:()=>o(r.id),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",border:"none",cursor:"pointer",backgroundColor:i?"#F3F0FF66":"transparent",transition:"background-color 0.1s"},onMouseEnter:c=>{i||(c.currentTarget.style.backgroundColor="#f8f9fa")},onMouseLeave:c=>{i||(c.currentTarget.style.backgroundColor="transparent")},children:[e.jsx("div",{style:{textAlign:"left"},children:e.jsx("div",{style:{fontSize:13,fontWeight:i?600:400,color:"#2d2d2d",marginBottom:2},children:r.name})}),i&&e.jsx("div",{style:{width:8,height:8,borderRadius:4,backgroundColor:"#7950f2",flexShrink:0}})]},r.id)})}),e.jsx("div",{style:{height:1,backgroundColor:"#e0e0e0"}}),e.jsxs("button",{onClick:s,style:{width:"100%",display:"flex",alignItems:"center",gap:8,padding:"10px 14px",border:"none",cursor:"pointer",backgroundColor:"transparent",transition:"background-color 0.1s"},onMouseEnter:r=>{r.currentTarget.style.backgroundColor="#f8f9fa"},onMouseLeave:r=>{r.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(Ln,{size:13,color:"#7950f2"}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#7950f2"},children:"Create new share block"})]})]})}const yg="_propertyInput_cnelm_1",vg="_fieldLabelInput_cnelm_5",jg="_manageButton_cnelm_9",xr={propertyInput:yg,fieldLabelInput:vg,manageButton:jg},kg=Ju;function wg(t){const n=l.useRef(null),o=l.useRef(!1),s=l.useRef(null),r=Qn(),i=ee(B=>B.tiptap),c=ee(B=>B.tiptapSidemenu),u=t.editor||(c==null?void 0:c.editor)||(i==null?void 0:i.editor),a=ee(B=>B.space),f=l.useRef(u),d=l.useRef(t.element),h=l.useRef(t.saveNodeData),m=l.useRef([]);f.current=u,d.current=t.element,h.current=t.saveNodeData;const[x,g]=l.useState([]),[w,b]=l.useState([]),[j,A]=l.useState("stack"),[v,k]=l.useState("show"),[C,I]=l.useState("md"),[_,R]=l.useState("");l.useEffect(()=>{var B;if(t.element&&t.element.node.attrs){const O=t.element.node.attrs,K=`${((B=t.element.node.type)==null?void 0:B.name)||"node"}:${O.uid||t.element.pos}`,Y=s.current!==K;if(!Y&&o.current)return;Y&&(s.current=K,o.current=!1,n.current&&(clearTimeout(n.current),n.current=null));const H=O.fields,D=Qu(H);
2m.current=D,g(D),A(O.formLayout||"stack"),k(O.formLabels||"show"),I(O.fieldSpacing||"md"),R(O.labelColor||"")}},[t.element]),l.useEffect(()=>{(x.length>0||m.current.length===0)&&(m.current=x)},[x]);const F=l.useCallback(()=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{var B;n.current=null,o.current=!1,(B=h.current)==null||B.call(h)},2e3)},[]);l.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]);const G=(a==null?void 0:a.slug)||window.$fetchedTopSlug,T=l.useCallback(B=>{if(!Array.isArray(B))return;const O=B.filter(ne=>kg.includes(ne.format));b(O);const K=m.current,Y=ga(K,O);if(JSON.stringify(Y)===JSON.stringify(K))return;m.current=Y,g(Y);const H=f.current,D=d.current;H&&D&&be(H,D,{fields:Y})&&F()},[F]);l.useEffect(()=>{G&&ma.onFetch(G,T,()=>{})},[G,T]),l.useEffect(()=>{c&&c.opened==="filter-members-close"&&G&&ma.onFetch(G,T,()=>{})},[c,G,T]),l.useEffect(()=>{if(!o.current)return;const B=f.current,O=d.current;!B||!O||be(B,O,{fields:x})&&F()},[x,F]),l.useEffect(()=>{if(!o.current)return;const B=f.current,O=d.current;!B||!O||be(B,O,{formLayout:j})&&F()},[j,F]),l.useEffect(()=>{if(!o.current)return;const B=f.current,O=d.current;!B||!O||be(B,O,{formLabels:v})&&F()},[v,F]),l.useEffect(()=>{if(!o.current)return;const B=f.current,O=d.current;!B||!O||be(B,O,{fieldSpacing:C})&&F()},[C,F]),l.useEffect(()=>{if(!o.current)return;const B=f.current,O=d.current;!B||!O||be(B,O,{labelColor:_})&&F()},[_,F]);const L=x.some(B=>B.name==="last_name"),S=(B,O)=>{o.current=!0,g(K=>K.map(Y=>Y.name===B?{...Y,label:O}:Y))},W=(B,O)=>{var H;const K=x.find(D=>D.name===B),Y=(H=K==null?void 0:K.label)==null?void 0:H.trim();Y===(K==null?void 0:K.label)&&Y||S(B,Y||O)},E=B=>{if(o.current=!0,B){const O=x.findIndex(H=>H.name==="email"),K=[...x],Y={type:"builtin",name:"last_name",label:"Last name",placeholder:"Last name"};O>=0?K.splice(O,0,Y):K.push(Y),g(K)}else g(x.filter(O=>O.name!=="last_name"))},P=x.filter(B=>B.type==="custom_property").map(B=>String(B.pod_member_filter_id)),$=w.map(B=>({value:String(B.id),label:B.name})),X=B=>{o.current=!0;const O=x.filter(Y=>Y.type!=="custom_property"),K=B.map(Y=>{const H=parseInt(Y,10),D=x.find(Ie=>Ie.type==="custom_property"&&Ie.pod_member_filter_id===H),ne=w.find(Ie=>Ie.id===H);return D?ga([D],ne?[ne]:[]).find(Ie=>Ie.type==="custom_property")||D:ne?{type:"custom_property",name:`prop_${ne.id}`,pod_member_filter_id:ne.id,label:ne.name,placeholder:ne.name,format:ne.format,emojicon:ne.emojicon,options:ne.options||{}}:null}).filter(Boolean);g([...O,...K])},q=()=>{r(Yt({opened:"filter-members",option:window.$fetchedTopSlug}))},Q={fontSize:10,fontWeight:700,color:"#868e96",textTransform:"uppercase",letterSpacing:.6,marginBottom:6};return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx("div",{style:Q,children:"Layout"}),e.jsx(Pe,{options:[{label:"Single",value:"stack"},{label:"Two column",value:"grid"}],activeValue:j,onChange:B=>{o.current=!0,A(B)},columns:2}),e.jsx("div",{style:{...Q,marginTop:10},children:"Labels"}),e.jsx(Pe,{options:[{label:"Show",value:"show"},{label:"Hide",value:"hide"}],activeValue:v,onChange:B=>{o.current=!0,k(B)},columns:2}),v==="show"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{...Q,marginTop:10},children:"Label Color"}),e.jsx(bn,{colors:["#1a1a1a","#6b7280","#ffffff","#3b82f6","#8b5cf6","#ef4444"],value:_,onChange:B=>{o.current=!0,R(B)},swatchSize:20})]}),e.jsx("div",{style:{...Q,marginTop:10},children:"Spacing"}),e.jsx(Pe,{options:[{label:"Compact",value:"sm"},{label:"Default",value:"md"},{label:"Relaxed",value:"lg"}],activeValue:C,onChange:B=>{o.current=!0,I(B)},columns:3}),e.jsx("div",{style:{borderTop:"1px solid #eee",margin:"10px 0 4px"}}),e.jsx("div",{style:Q,children:"Fields"}),[{name:"name",fieldName:"First name",defaultLabel:"First name"},{name:"email",fieldName:"Email",defaultLabel:"Email"},...L?[{name:"last_name",fieldName:"Last name",defaultLabel:"Last name"}]:[]].map(({name:B,fieldName:O,defaultLabel:K})=>{var D,ne;const Y=x.find(Ie=>Ie.name===B),H=B==="last_name";return e.jsxs(p,{style:{display:"flex",alignItems:"flex-end",gap:"12px"},children:[e.jsx(Qe,{icon:H?ba.faToggleOn:pf.faLock,style:{fontSize:H?12:10,color:H?"#868e96":"#ccc",flexShrink:0,width:14,marginBottom:10}}),e.jsx(at,{label:O,"aria-label":`${O} field label`,value:(ne=(D=Y==null?void 0:Y.label)!=null?D:Y==null?void 0:Y.placeholder)!=null?ne:K,onChange:Ie=>S(B,Ie.currentTarget.value),onBlur:()=>W(B,K),placeholder:K,size:"xs",style:{flex:1},classNames:{input:xr.fieldLabelInput},styles:{label:{fontSize:"11px",color:"#868e96",fontWeight:500}
2,input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}}),H&&e.jsx(Ve,{checked:!0,onChange:Ie=>E(Ie.currentTarget.checked),"aria-label":"Disable last name field",size:"xs",color:"cyan",style:{marginBottom:7}})]},B)}),!L&&e.jsx(Ve,{checked:!1,onChange:B=>E(B.currentTarget.checked),size:"xs",color:"cyan",labelPosition:"left",label:e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(Qe,{icon:ba.faToggleOn,style:{fontSize:12,color:"#868e96",flexShrink:0,width:14}}),e.jsx(N,{style:{fontSize:"13px",color:"#333",fontWeight:500},children:"Last name"})]}),styles:{root:{width:"100%"},body:{width:"100%",minHeight:32,alignItems:"center",justifyContent:"space-between"},labelWrapper:{flex:1},label:{width:"100%",cursor:"pointer"},track:{flexShrink:0}}}),P.length>0&&x.filter(B=>B.type==="custom_property").map(B=>e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(Qe,{icon:ed.faSliders,style:{fontSize:10,color:"#868e96",flexShrink:0,width:14}}),e.jsx(N,{style:{fontSize:"13px",color:"#333",fontWeight:500,flex:1},children:B.label}),e.jsx(Qe,{icon:ff.faXmark,style:{fontSize:11,color:"#ccc",cursor:"pointer",padding:2},onClick:()=>{o.current=!0,g(x.filter(O=>O.name!==B.name))}})]},B.name)),w.length>0&&P.length<w.length&&e.jsx(qr,{data:$.filter(B=>!P.includes(B.value)),value:[],onChange:B=>{B.length>0&&X([...P,...B])},placeholder:"Add property",searchable:!0,nothingFoundMessage:"No properties found",size:"xs",comboboxProps:{withinPortal:!0,zIndex:99999},classNames:{input:xr.propertyInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px",cursor:"pointer"}}}),e.jsx(We,{variant:"default",onClick:q,leftSection:e.jsx(Qe,{icon:td.faCog,style:{fontSize:11,color:"#868e96"}}),size:"xs",fullWidth:!0,mt:5,classNames:{root:xr.manageButton},styles:{root:{border:"1.5px solid #e0e0e0",borderRadius:"6px",paddingInlineStart:"var(--button-padding-x)"},label:{fontSize:"12px",color:"#868e96",fontWeight:500}},children:w.length>0?"Manage properties":"Add custom properties"})]})}function Cg({element:t,editor:n,saveNodeData:o}){const s=ee(a=>a.tiptap),r=ee(a=>a.colors),i=n||(s==null?void 0:s.editor),c={display:"flex",alignItems:"center",gap:12},u={width:105,flexShrink:0,color:"#868e96",fontSize:13,fontWeight:500,whiteSpace:"nowrap"};return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs(p,{style:c,children:[e.jsx(N,{style:u,children:"Fill"}),e.jsx(wt,{attrName:"inputBackgroundColor",fallbackColor:"#FFFFFF",swatchType:"light",element:t,editor:i,saveNodeData:o})]}),e.jsxs(p,{style:c,children:[e.jsx(N,{style:u,children:"Text"}),e.jsx(wt,{attrName:"inputTextColor",fallbackColor:(r==null?void 0:r.default_text_color)||"#212529",swatchType:"light",element:t,editor:i,saveNodeData:o})]}),e.jsxs(p,{style:c,children:[e.jsx(N,{style:u,children:"Placeholder"}),e.jsx(wt,{attrName:"inputPlaceholderColor",fallbackColor:"#868E96",swatchType:"light",element:t,editor:i,saveNodeData:o})]}),e.jsxs(p,{style:{...c,alignItems:"flex-start"},children:[e.jsx(N,{style:{...u,marginTop:4},children:"Border"}),e.jsx(p,{style:{flex:1},children:e.jsx(Zr,{element:t,editor:i,saveNodeData:o,colorAttr:"inputBorderColor",widthAttr:"inputBorderWidth",backgroundAttr:"inputBackgroundColor",fallbackColor:"#CED4DA",equalBackgroundMeansNone:!1})})]})]})}const Sg="_colorSwatch_bk08m_1",Xa={colorSwatch:Sg},Za=[{name:"Default",bg:"#f0f4ff",color:"#7950f2"},{name:"Violet",bg:"#ede9fe",color:"#6d28d9"},{name:"Pink",bg:"#fce4ec",color:"#e64980"},{name:"Rose",bg:"#ffe4e6",color:"#e11d48"},{name:"Amber",bg:"#fff4e6",color:"#d97706"},{name:"Green",bg:"#e6f9ef",color:"#059669"},{name:"Teal",bg:"#e0f8f6",color:"#0d9488"},{name:"Blue",bg:"#e0f2ff",color:"#2563eb"},{name:"Slate",bg:"#f1f5f9",color:"#475569"},{name:"Dark",bg:"#1f2937",color:"#f9fafb"}],Qa=(t,n,o)=>{const s=(n||"").toLowerCase()===t.bg.toLowerCase(),r=(o||"").toLowerCase()===t.color.toLowerCase();return s&&r},Ja=t=>{if(!t||typeof t!="string")return null;const n=t.trim(),o=n.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(o){let r=o[1];return r.length===3&&(r=r.split("").map(i=>i+i).join("")),[0,2,4].map(i=>parseInt(r.slice(i,i+2),16))}const s=n.match(/^rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);return s?[s[1],s[2],s[3]].map(Number):null},Tg=(t,n)=>{const o=Ja(t),s=Ja(n);if(!o||!s)return null;const r=u=>{const[a,f,d]=u.map(h=>{const m=h/255;return m<=.03928?m/12.92:((m+.055)/1.055)**2.4});return .2126*a+.7152*f+.0722*d},i=r(o),c=r(s);return(Math.max(i,c)+.05)/(Math.min(i,c)+.05)},gr={bg:"#f0f4ff",color:"#7950f2"},Ig={position:"right-start",offset:15,zIndex:999999,width:264,withinPortal:!0,floatingStrategy:"fixed",middlewares:{shift:{padding:8},flip:{fallbackPlacements:["right-end","left-start","left-end","bottom-start"]}}},ec=({label:t,ariaLabel:n,swatchColor:o,active:s,onClick:r})=>e.jsxs(p,{role:"button","aria-label":n,onClick:r,style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"6px 8px",borderRadius:8,cursor:"pointer",border:`1.5px solid ${s?"#7950f2":"#e0e0e0"}`,backgroundColor:s?"#7950f2":"white",color:s?"white":"#888",fontSize:12,fontWeight:600,userSelect:"none"},children:[e.jsx(p,{style:{width:12,height:12,borderRadius:"50%",background:o,border:s?"1.5px solid rgba(255,255,255,0.7)":"1.5px solid rgba(0,0,0,0.12)",flexShrink:0}}),t]});function xu({activeBg:t,activeColor:n,onSelect:o}){const s=Dt(),[r,i]=l.useState(!1),[c,u]=l.useState("bg"),[a,f]=l.useState(gr),d=!!(t||n)&&!Za.some(g=>Qa(g,t,n)),h=()=>{r||(f({bg:t||gr.bg,color:n||gr.color}),u("bg")),i(g=>!g)},m=g=>{const w={...a,[c]:g};f(w),o==null||o({name:"Custom",bg:w.bg,color:w.color})},x=Tg(a.bg,a.color);return e.jsxs(ye,{gap:8,justify:"flex-start",children:[Za.map(g=>{const w=Qa(g,t,n);return e.jsx(vt,{label:g.name,withArrow:!0,position:"top",children:e.jsx(p,{role:"button","aria-label":g.name,onClick:()=>{i(!1),o==null||o(g)},style:{width:28,height:28,borderRadius:"50%",background:g.bg,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:w?"2px solid #333":"2px s
2olid transparent",boxShadow:w?"0 0 0 2px #fff inset":"none",transition:"transform 120ms ease"},className:Xa.colorSwatch,children:e.jsx(p,{style:{width:12,height:12,borderRadius:"50%",background:g.color}})})},g.name)}),e.jsxs(we,{...Ig,opened:r,onChange:g=>{g||i(!1)},children:[e.jsx(we.Target,{children:e.jsx(p,{role:"button","aria-label":"Custom",onClick:h,className:Xa.colorSwatch,style:{width:28,height:28,borderRadius:"50%",background:d?t:"white",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:`1.5px dashed ${d||r?"#7950f2":"#ccc"}`,boxShadow:d?"0 0 0 2px #fff inset":"none",color:"#999",fontSize:14,lineHeight:1,transition:"transform 120ms ease"},children:d?e.jsx(p,{style:{width:12,height:12,borderRadius:"50%",background:n||"transparent"}}):"+"})}),e.jsxs(we.Dropdown,{style:{maxHeight:"calc(100vh - 16px)",overflowY:"auto"},children:[e.jsxs(ye,{gap:6,mb:10,wrap:"nowrap",children:[e.jsx(ec,{label:"Background",ariaLabel:"Edit background color",swatchColor:a.bg,active:c==="bg",onClick:()=>u("bg")}),e.jsx(ec,{label:"Icon",ariaLabel:"Edit icon color",swatchColor:a.color,active:c==="color",onClick:()=>u("color")})]}),e.jsx("div",{className:"gradient-color-picker",children:e.jsx(Vt,{value:a[c]||"",onChange:m,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,hideGradientControls:!0,width:240,height:160,presets:an(s,c==="bg"?"light":"dark")})}),x!=null&&e.jsx(N,{mt:8,style:{fontSize:11,fontWeight:600,color:x>=3?"#2b8a3e":"#e8590c"},children:x>=3?`Contrast ${x.toFixed(1)}:1`:`Low contrast ${x.toFixed(1)}:1 — icon may be hard to see`})]})]})]})}const Xn={fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:"8px"},wi={width:24,height:20,viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:1.5},_g=({attrs:t,applyPreset:n})=>{const{key:o}=nd(t);return e.jsx(e.Fragment,{children:e.jsx(ye,{gap:6,grow:!0,align:"stretch",children:Object.entries(Nc).map(([s,r])=>{const i=s===o,c=r.styles["background-color"]==="transparent";return e.jsx(Be,{icon:e.jsxs("svg",{...wi,children:[e.jsx("rect",{x:"1",y:"2",width:"22",height:"16",rx:"3",opacity:c?.25:.45,strokeDasharray:c?"3 2":void 0,fill:c?"none":"currentColor"}),e.jsx("circle",{cx:"7",cy:"10",r:"2.6",fill:"currentColor",stroke:"none",opacity:"0.85"}),e.jsx("path",{d:"M12.5 8.5h7M12.5 11.5h4.5",strokeLinecap:"round",opacity:"0.7"})]}),label:r.label,value:s,active:i,onClick:()=>n(s)},s)})})})},Ag=({attrs:t,update:n,updateMany:o,iconSelector:s})=>{const r=t==null?void 0:t.iconImage,i=(t==null?void 0:t.iconShape)||od,c=t==null?void 0:t.icon,u=a=>{const{attrs:f,styles:d}=ad(a);o(f,d)};return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[s,e.jsxs(p,{children:[e.jsx(N,{style:Xn,children:"Quick presets"}),e.jsx(p,{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:sd.map(a=>{const f=a.key==="none",d=f?c==="none":c===a.icon;return e.jsxs(p,{onClick:()=>u(a),style:{padding:"9px 4px 7px",borderRadius:"10px",border:`1.5px solid ${d?"#7950f2":"#e0e0e0"}`,background:d?"#f0f9ff":"#fff",display:"flex",flexDirection:"column",alignItems:"center",gap:"5px",cursor:"pointer",transition:"all 0.15s ease"},children:[e.jsx(p,{style:{width:"30px",height:"30px",borderRadius:"50%",background:f?"#f1f3f5":a.fill,color:f?"#adb5bd":a.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px"},children:Ks(a.icon,a.color,f?15:void 0)}),e.jsx(N,{style:{fontSize:"9px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.4px",color:d?"#333":"#888",lineHeight:1},children:a.label})]},a.key)})})]}),e.jsxs(p,{children:[e.jsx(N,{style:Xn,children:"Shape"}),e.jsx(ye,{gap:6,grow:!0,children:rd.map(({value:a,label:f})=>e.jsx(Be,{icon:e.jsxs("svg",{...wi,children:[a!=="none"&&e.jsx("rect",{x:"3",y:"1",width:"18",height:"18",rx:a==="circle"?9:5,opacity:"0.35"}),e.jsx("circle",{cx:"12",cy:"10",r:"4",fill:"currentColor",stroke:"none",opacity:"0.65"})]}),label:f,value:a,active:i===a,onClick:()=>n("iconShape",a)},a))})]}),e.jsxs(p,{children:[e.jsx(N,{style:Xn,children:"Size"}),e.jsx(Pe,{options:ld,activeValue:(t==null?void 0:t.iconSize)||id,onChange:a=>n("iconSize",a),columns:5})]}),!r&&i!=="none"&&e.jsxs(p,{children:[e.jsx(N,{style:Xn,children:"Colour"}),e.jsx(xu,{activeBg:t==null?void 0:t.iconBg,activeColor:t==null?void 0:t.iconColor,onSelect:a=>o({iconBg:a.bg,iconColor:a.color})})]})]})},Bg=({attrs:t,update:n})=>{const o=(t==null?void 0:t.iconSide)||"left",s=o==="top",r=parseInt(t==null?void 0:t.gap,10)||0;return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[e.jsxs(p,{children:[e.jsx(N,{style:Xn,children:"Icon position"}),e.jsx(ye,{gap:6,grow:!0,children:[{value:"left",label:"Left"},{value:"right",label:"Right"},{value:"top",label:"Top"}].map(({value:i,label:c})=>e.jsx(Be,{icon:e.jsx("svg",{...wi,children:i==="top"?e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"9",y:"1",width:"6",height:"5",rx:"1.5",fill:"currentColor",stroke:"none",opacity:"0.7"}),e.jsx("path",{d:"M4 11h16M4 15h11",strokeLinecap:"round",opacity:"0.45"})]}):i==="right"?e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"17",y:"6",
2width:"6",height:"8",rx:"1.5",fill:"currentColor",stroke:"none",opacity:"0.7"}),e.jsx("path",{d:"M1 8h13M1 12h9",strokeLinecap:"round",opacity:"0.45"})]}):e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"1",y:"6",width:"6",height:"8",rx:"1.5",fill:"currentColor",stroke:"none",opacity:"0.7"}),e.jsx("path",{d:"M10 8h13M10 12h9",strokeLinecap:"round",opacity:"0.45"})]})}),label:c,value:i,active:o===i,onClick:()=>n("iconSide",i)},i))})]}),e.jsx(He,{label:"Gap",value:r,min:0,max:48,onChange:i=>n("gap",`${i}px`)}),!s&&e.jsxs(p,{children:[e.jsx(N,{style:Xn,children:"Align with text"}),e.jsx(Pe,{options:[{label:"Top",value:"flex-start"},{label:"Centre",value:"center"}],activeValue:(t==null?void 0:t.verticalAlign)||"flex-start",onChange:i=>n("verticalAlign",i),columns:2})]}),s&&e.jsxs(p,{children:[e.jsx(N,{style:Xn,children:"Icon alignment"}),e.jsx(Pe,{options:[{label:"Left",value:"left"},{label:"Centre",value:"center"},{label:"Right",value:"right"}],activeValue:(t==null?void 0:t.iconTopAlign)||"center",onChange:i=>n("iconTopAlign",i),columns:3})]})]})};function Rg(t,n){var o,s,r,i,c;return(t==null?void 0:t.nodeType)==="callout"&&(t!=null&&t.node)?{node:t.node,pos:t.pos,key:t.key,uid:(r=(s=t.uid)!=null?s:(o=t.node.attrs)==null?void 0:o.uid)!=null?r:null,uidIsStable:t.uidIsStable===!0,surface:t.surface||"self"}:((c=(i=n==null?void 0:n.node)==null?void 0:i.type)==null?void 0:c.name)==="callout"?n:null}function Eg(t){return $c(t)?"box":t==="column"?"column":Dc(t)?"grid":ud(t)?"callout":"block"}function zg(t){return $c(t)||Dc(t)?"wrapper":t==="column"?"real":"self"}function Lg(t,n){if(!t||!n||t.nodeType!==n.nodeType)return!1;const o=t.surface||"self",s=n.surface||"self";return o!==s?!1:t.uidIsStable&&n.uidIsStable&&n.uid&&t.uid?n.uid===t.uid:typeof n.pos=="number"&&typeof t.pos=="number"&&n.pos===t.pos}function Pg(t){var u,a;const n=(u=t==null?void 0:t.state)==null?void 0:u.doc;if(!n)return[];const o=[],s=new Map;n.descendants((f,d,h)=>{var m;if(f.isBlock&&f.type.name!=="doc"){o.push({node:f,pos:d,end:d+f.nodeSize,parent:h});const x=(m=f.attrs)==null?void 0:m.uid;x&&s.set(x,(s.get(x)||0)+1)}return!0});const r=[],i=[];for(const f of o){const d=((a=f.node.attrs)==null?void 0:a.uid)||null,h=!!d&&s.get(d)===1,x={entry:ya({node:f.node,pos:f.pos,nodeType:f.node.type.name,type:Eg(f.node.type.name),surface:zg(f.node.type.name),uid:d,uidIsStable:h,key:h?d:`${f.node.type.name}:pos-${f.pos}`,label:cd(f.node,{parentNode:f.parent,nodePos:f.pos}),selectable:f.node.type.spec.selectable!==!1}),item:f,children:[]};for(;i.length&&f.pos>=i[i.length-1].item.end;)i.pop();i.length?i[i.length-1].children.push(x):r.push(x),i.push(x)}return[{entry:ya({key:"__document__",nodeType:"doc",type:"page",label:"Document",selectable:!1,virtual:!0,uidIsStable:!1}),item:{node:n,pos:0,end:n.content.size},children:r}]}const Wg={doc:e.jsxs("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8Z"}),e.jsx("path",{d:"M14 3v5h5"})]}),box:e.jsx("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"})}),layout:e.jsxs("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.jsx("path",{d:"M3 9h18"})]}),text:e.jsx("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"M4 6h16M4 12h10M4 18h14"})}),deco:e.jsx("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"M12 3c2 4 7 5 7 9a7 7 0 1 1-14 0c0-4 5-5 7-9Z"})}),media:e.jsxs("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"}),e.jsx("path",{d:"m4 18 5-5 4 4 3-3 4 4"})]}),button:e.jsx("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("rect",{x:"3",y:"8",width:"18",height:"8",rx:"4"})}),generic:e.jsx("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("circle",{cx:"12",cy:"12",r:"8"})})};
2function Og(t){return t==="doc"?{icon:"doc",bg:"#eef1f4",color:"#5c6b7a"}:["box","container","shareblock"].includes(t)?{icon:"box",bg:"#e7f0ff",color:"#3b6cfe"}:["grid1","grid2","grid3","grid4","gridx","column"].includes(t)?{icon:"layout",bg:"#eafaf1",color:"#2f9e6f"}:["heading","paragraph","bulletList","orderedList","taskList","listItem","taskItem"].includes(t)?{icon:"text",bg:"#f3eefe",color:"#7048e8"}:["image","video","audio","file","embed","htmlEmbed","circle"].includes(t)?{icon:"media",bg:"#fff3e6",color:"#e8730c"}:["actionbutton","badgePill","interactiveButton","fancyLink"].includes(t)?{icon:"button",bg:"#e9f7f5",color:"#0ca789"}:{icon:"generic",bg:"#eef1f4",color:"#5c6b7a"}}function Mg(t){var o,s;const n=(s=(o=t==null?void 0:t.attrs)==null?void 0:o.styles)==null?void 0:s.position;return n==="absolute"?"ABS":n==="fixed"?"FIX":n==="sticky"?"STK":null}function Ng(t){const n=((t==null?void 0:t.label)||"content").toLowerCase();return`${/^[aeiou]/.test(n)?"an":"a"} ${n} block`}function Qr(t,n=[]){for(const o of t)n.push(o),Qr(o.children,n);return n}function $g(t,n,o){try{const{state:s,view:r}=t,i=s.doc.nodeAt(n);if(!i||o>=n&&o<=n+i.nodeSize)return;let c=s.tr.delete(n,n+i.nodeSize);const u=c.mapping.map(o);c=c.insert(u,i),r.dispatch(c)}catch{}}function gu({node:t,depth:n,ctx:o,flat:s}){var _;const{entry:r,item:i,children:c}=t,[u,a]=l.useState(!1),[f,d]=l.useState(r.label||""),h=c.length>0,m=o.collapsed.has(r.key),x=o.hoveredKey===r.key,g=Lg(r,o.selectedTarget),w=!!((_=i.node.attrs)!=null&&_.hidden),b=Og(r.nodeType),j=Vo(r),A=Mg(i.node),v=Fc(r),k=x||g,C=Math.max(0,n-1),I=()=>{Hc(o.editor,r,f),a(!1),o.refresh()};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{draggable:!u&&!r.virtual,onDragStart:R=>{R.dataTransfer.setData("text/plain",String(i.pos)),R.dataTransfer.effectAllowed="move",o.setDrag(i.pos)},onDragOver:R=>{R.preventDefault(),R.dataTransfer.dropEffect="move",o.dropKey!==r.key&&o.setDropKey(r.key)},onDragEnd:()=>o.setDropKey(null),onDrop:R=>{R.preventDefault(),o.onDrop(i.pos)},onMouseEnter:()=>o.onHover(r),onMouseLeave:o.onHoverEnd,onClick:()=>{r.virtual||o.onSelect(r)},style:{display:"flex",alignItems:"center",gap:6,height:32,paddingLeft:r.virtual?0:6+C*15,paddingRight:12,borderRadius:8,cursor:"pointer",position:"relative",userSelect:"none",background:g?"#fff2e2":x?"#eef4ff":void 0,boxShadow:o.dropKey===r.key?"inset 0 2px 0 #6c47e0":void 0},children:[e.jsx("span",{onClick:R=>{R.stopPropagation(),o.toggleCollapse(r.key)},style:{width:r.virtual?0:14,display:"grid",placeItems:"center",color:"#adb5bd",flex:"0 0 auto",overflow:"hidden",visibility:h&&!r.virtual?"visible":"hidden"},children:e.jsx("svg",{viewBox:"0 0 24 24",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2.4",style:{transform:m?"rotate(-90deg)":"none",transition:"transform .12s"},children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}),e.jsx("span",{style:{width:19,height:19,borderRadius:5,display:"grid",placeItems:"center",flex:"0 0 auto",background:j+"1f",color:j},children:Wg[b.icon]}),u?e.jsx("input",{value:f,autoFocus:!0,onChange:R=>d(R.target.value),onBlur:I,onKeyDown:R=>{R.key==="Enter"&&I(),R.key==="Escape"&&a(!1)},onClick:R=>R.stopPropagation(),style:{flex:1,minWidth:0,border:"none",outline:"none",background:"transparent",font:"inherit",fontSize:13}}):e.jsx("span",{onDoubleClick:R=>{v&&(R.stopPropagation(),d(r.label||""),a(!0))},style:{flex:1,minWidth:0,fontSize:13,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:g?600:500,color:w?"#adb5bd":g?"#1a1b2e":"#343a40",textDecoration:w?"line-through":void 0},children:r.label}),A&&e.jsx("span",{style:{fontSize:9.5,fontWeight:700,letterSpacing:".03em",padding:"2px 5px",borderRadius:5,background:"#fdeef4",color:"#d6336c",flex:"0 0 auto"},children:A}),k&&!r.virtual&&e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:1,flex:"0 0 auto"},children:[v&&e.jsx("button",{title:"Rename",onClick:R=>{R.stopPropagation(),d(r.label||""),a(!0)},style:{border:"none",background:"none",cursor:"pointer",color:"#adb5bd",display:"grid",placeItems:"center",padding:2},children:e.jsxs("svg",{viewBox:"0 0 24 24",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 20h9"}),e.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}),e.jsx("button",{title:"Settings",onClick:R=>{var F;R.stopPropagation(),(F=o.onOpenSettings)==null||F.call(o,r)},style:{border:"none",background:"none",cursor:"pointer",color:"#adb5bd",display:"grid",placeItems:"center",padding:2},children:e.jsxs("svg",{viewBox:"0 0 24 24",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19 12a7 7 0 0 0-.1-1l2-1.6-2-3.4-2.4 1a7 7 0 0 0-1.7-1l-.3-2.5h-4l-.3 2.5a7 7 0 0 0-1.7 1l-2.4-1-2 3.4 2 1.6a7 7 0 0 0 0 2l-2 1.6 2 3.4 2.4
2-1a7 7 0 0 0 1.7 1l.3 2.5h4l.3-2.5a7 7 0 0 0 1.7-1l2.4 1 2-3.4-2-1.6a7 7 0 0 0 .1-1Z"})]})}),e.jsx("span",{title:"Drag to reorder",style:{cursor:"grab",color:"#adb5bd",display:"grid",placeItems:"center",padding:2},children:e.jsxs("svg",{viewBox:"0 0 24 24",width:"13",height:"13",fill:"currentColor",children:[e.jsx("circle",{cx:"9",cy:"6",r:"1.4"}),e.jsx("circle",{cx:"15",cy:"6",r:"1.4"}),e.jsx("circle",{cx:"9",cy:"12",r:"1.4"}),e.jsx("circle",{cx:"15",cy:"12",r:"1.4"}),e.jsx("circle",{cx:"9",cy:"18",r:"1.4"}),e.jsx("circle",{cx:"15",cy:"18",r:"1.4"})]})}),e.jsx("button",{title:"Delete",onClick:R=>{var F;R.stopPropagation(),(F=o.onDelete)==null||F.call(o,t)},onMouseEnter:R=>{R.currentTarget.style.color="#e03131"},onMouseLeave:R=>{R.currentTarget.style.color="#adb5bd"},style:{border:"none",background:"none",cursor:"pointer",color:"#adb5bd",display:"grid",placeItems:"center",padding:2},children:e.jsxs("svg",{viewBox:"0 0 24 24",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 6h18"}),e.jsx("path",{d:"M8 6V4h8v2"}),e.jsx("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),e.jsx("path",{d:"M10 11v6M14 11v6"})]})})]}),e.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:j,flex:"0 0 auto"}})]}),h&&!m&&!s&&c.map(R=>e.jsx(gu,{node:R,depth:n+1,ctx:o,flat:s},R.entry.key))]})}function Dg({editor:t,scopedEditorId:n,selectedTarget:o,onHoverEntry:s,onHoverEnd:r,onOpenSettings:i,onSelectEntry:c,onNavigate:u}){const[a,f]=l.useState(0),[d,h]=l.useState(""),[m,x]=l.useState(()=>new Set),[g,w]=l.useState(null),[b,j]=l.useState(null),A=l.useRef(null),{deleteTarget:v}=dd(t,{editorId:n});l.useEffect(()=>{if(!t)return;const $=()=>f(X=>X+1);return t.on("update",$),t.on("selectionUpdate",$),()=>{t.off("update",$),t.off("selectionUpdate",$)}},[t]);const k=l.useMemo(()=>Pg(t),[t,a]),C=l.useCallback(()=>f($=>$+1),[]),I=l.useCallback($=>x(X=>{const q=new Set(X);return q.has($)?q.delete($):q.add($),q}),[]),_=()=>x(new Set(Qr(k).filter($=>!$.entry.virtual&&$.children.length).map($=>$.entry.key))),R=l.useCallback($=>{c==null||c($)},[c]),F=l.useCallback($=>{w($.key),$.virtual||s==null||s($)},[s]),G=l.useCallback(()=>{w(null),r==null||r()},[r]),T=l.useCallback($=>{const X=A.current;j(null),A.current=null,typeof X=="number"&&typeof $=="number"&&X!==$&&($g(t,X,$),C())},[t,C]),L=l.useCallback($=>{A.current=$},[]),S=l.useCallback(async({entry:$,item:X})=>{if(!t||$.virtual)return;const q=await v({sourceNode:X.node,sourcePos:X.pos,sourceNodeType:$.nodeType,sourceUid:$.uid,sourceUidIsStable:$.uidIsStable,sourceKey:$.key,sourceEditorId:n,sourceUi:"navigator",forceConfirmation:!0,confirmationOptions:{noun:Ng($)},onBeforeCommit:Q=>{var B,O,K,Y;return u==null?void 0:u((Y=(K=(B=Q==null?void 0:Q.nextScopeTarget)==null?void 0:B.key)!=null?K:(O=Q==null?void 0:Q.transactionMeta)==null?void 0:O.nextScopeKey)!=null?Y:null)}});if(q!=null&&q.ok){f(Q=>Q+1);return}["confirmation_canceled","action_queued"].includes(q==null?void 0:q.reason)||Ct.fire("Unable to delete this element",(q==null?void 0:q.message)||"The editor could not safely remove this element. Select it again and retry.","warning")},[v,t,u,n]),W=l.useMemo(()=>({editor:t,collapsed:m,hoveredKey:g,dropKey:b,selectedTarget:o,refresh:C,toggleCollapse:I,onSelect:R,onHover:F,onHoverEnd:G,onOpenSettings:i,onDelete:S,setDrag:L,setDropKey:j,onDrop:T}),[t,m,g,b,o,C,I,R,F,G,i,S,L,j,T]),E=d.trim().toLowerCase(),P=E?Qr(k).filter($=>!$.entry.virtual&&($.entry.label||"").toLowerCase().includes(E)):k;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",flex:1,minHeight:0},onMouseLeave:G,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px 8px"},children:[e.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:7,background:"#f1f3f5",border:"1px solid #e9ecef",borderRadius:8,padding:"6px 9px"},children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"#adb5bd",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("path",{d:"m21 21-4-4"})]}),e.jsx("input",{value:d,onChange:$=>h($.target.value),placeholder:"Search elements…",style:{flex:1,border:"none",outline:"none",background:"transparent",font:"inherit",fontSize:12.5,color:"#343a40"}})]}),e.jsx("button",{title:"Collapse all",onClick:_,style:{width:30,height:30,border:"1px solid #e9ecef",borderRadius:8,background:"#fff",cursor:"pointer",color:"#868e96",display:"grid",placeItems:"center"},children:e.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"M4 9h16M4 15h16"})})})]}),e.jsx("div",{style:{flex:1,minHeight:0,overflowY:"auto",padding:"0 12px 16px"},children:P.map($=>e.jsx(gu,{node:$,depth:0,ctx:W,flat:!!E},$.entry.key))})]})}function Fg({entry:t,onRename:n}){const[o,s]=l.useState(!1),[r,i]=l.useState(""),c=l.useRef(!1),u=Fc(t)&&typeof n=="function";if(l.useEffect(()=>{s(!1),i((t==null?void 0:t.label)||""),c.current=!1},[t==null?void 0:t.key,t==null?void 0:t.label]),!(t!=null&&t.selectable))return null;const a=()=>{u&&(c.current=!1,i(t.label||""),s(!0))},f=()=>{if(c.current){c.current=!1;return}n==null||n(r),s(!1)},d=()=>{c.current=!0,i(t.label||""),s(!1)};return e.jsxs("div",{className:Ze.scopeHeader,"data-testid":"active-scope-header",onDoubleClick:h=>{h.target.closest("button")||a()},children:[o?e.jsx("input",{autoFocus:!0,className:Ze.scopeRenameInput,"aria-label":"Component name",value:r,maxLength:fd,onChange:h=>i(h.currentTarget.value),onBlur:f,onKeyDown:h=>{h.key==="Enter"?(h.preventDefault(),f()):h.key==="Escape"&&(h.preventDefault(),d())}}):e.jsx("span",{className:Ze.scopeTitle,title:t.label,children:t.label}),u&&!o&&e.jsx("button",{type:"button",className:Ze.scopeRenameButton,onClick:a,title:"Rename component","aria-label":`Rename ${t.label}`,children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M12 20h9"}),e.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L8 18l-4 1 1-4Z"})]})})]})}const Hg=Object.freeze(["color","font-family","font-size","font-weight","line-height"]);Object.freeze([...Hg]);const lo=Object.freeze(["background-color","background-image","background-size","background-position","background-repeat","background-overlay-color","background-overlay-gradient","background-pattern","background-pattern-color","background-pattern-opacity","background-glow-position","background-glow-color","background-glow-intensity"]),ao=Object.freeze(["border-top-width","border-top-style","border-top-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-right-width","border-right-style","border-right-color","border-effect"]),co=Object.freeze(["box-shadow"]),mr=Object.freeze(["align-items"]),Ug=Object.freeze(["gap"]),Vg=Object.freeze(["columnGap","tabletColumnGap","mobileColumnGap"]),Kg=Object.freeze(["rowGap","tabletRowGap","mobileRowGap"]),Gg=Object.freeze(["preset","columns","tracks","minCardWidth","tabletMode","tabletLayout","mobileMode","mobileLayout","itemAlignment","stretchItems"]),br=Object.freeze(["flexLayout","flexGap","flexItemSizing","flexRowAlign"]),yr=Object.freeze(["fullWidth"]),Ps=Object.freeze(["minHeight"]),Yg=Object.freeze(["radiu
2s","radiusCustom"]),qg=Object.freeze(["width","minWidth","maxWidth","fullWidth","selfAlign"]),Xg=Object.freeze(["selfAlign"]),Zg=Object.freeze(["height","maxHeight"]),Qg=Object.freeze(["overflow"]),Jg=Object.freeze(["aspectRatio"]),em=Object.freeze(["box","container","grid1","grid2","grid3","grid4","gridx"]),Ws=Object.freeze(["buttonBackgroundColor","buttonTextColor","buttonBorderColor","buttonBorderWidth"]),tm=Object.freeze(["buttonSize","buttonSizeCustom","buttonFont","buttonHover","buttonHoverCustom","buttonShadow","radius","radiusCustom","class","textAlign"]),nm=Object.freeze(["badgePillBackgroundColor","badgePillTextColor","badgePillBorderColor","badgePillBorderWidth","badgePillDotColor","badgePillPresetId","badgePillSize","badgePillSizeCustom","badgePillFont","badgePillShadow","badgePillContentType","badgePillIcon","radius","radiusCustom","class","textAlign"]);Object.freeze({actionbutton:{button_style:[...Ws,...tm]},customform:{button_style:[...Ws,"buttonSize","radius","radiusCustom","class","textAlign"]},interactiveButton:{button_style:[...Ws,"buttonSize","buttonShadow","radius","radiusCustom","class","textAlign"]},survey:{button_style:[...Ws,"class","textAlign"]},badgePill:{badge_style:nm}
2,callout:{icon:["icon","iconImage","iconShape","iconBadgeSize","iconBg","iconColor","iconSize"],icon_layout:["iconSide","iconTopAlign","verticalAlign","gap"]},blockquote:{quote_style:["borderSide","borderColor","borderRadius","backgroundColor","hasBg","iconPosition"]},details:{toggle_style:["iconStyle","iconPosition","iconColor","divider","open","radius","radiusCustom"]},horizontalRule:{divider:["dividerStyle","dividerWeight","dividerColor","dividerWidth","dividerSpacing","dividerAlign"]},resource:{resource_style:["resourceColor","resourceTextColor"]},bulletList:{marker:["markerColor","markerStyle"]},image:{media:["resizeableWidth","resizeableHeight","resizeableParentHeight","textAlign","radius","radiusCustom","aspectRatio","tabletAspectRatio","mobileAspectRatio","objectPosition"]},video:{media:["resizeableWidth","resizeableHeight","resizeableParentHeight","textAlign","radius","radiusCustom"]},embed:{media:["resizeableWidth","resizeableHeight","resizeableParentHeight","textAlign","radius","radiusCustom"]},audio:{media:["resizeableWidth","resizeableHeight","resizeableParentHeight","textAlign"]},fancyLink:{media:["class","textAlign","radius","radiusCustom"]},htmlEmbed:{embed_frame:["heightMode","height","fullWidth"]},shareblock:{website_header:["header"]}});const ss=t=>{var n,o,s,r;return(r=(s=t==null?void 0:t.uid)!=null?s:(o=(n=t==null?void 0:t.node)==null?void 0:n.attrs)==null?void 0:o.uid)!=null?r:null},Zn=t=>(t==null?void 0:t.uidIsStable)===!0,om=t=>{var n,o;return(t==null?void 0:t.nodeType)||((o=(n=t==null?void 0:t.node)==null?void 0:n.type)==null?void 0:o.name)||null},sm=t=>{if(!t)return null;if(t.semanticType)return t.semanticType;const n=om(t);return t.isCallout||Uc(n)?"callout":t.type||null};function mu(t){const n=sm(t),o=!t||n==="block"||n==="callout";return{semanticType:n,canUseBlockSections:o,canUseAdminAI:o,usesBreadcrumbLayoutTarget:!!t&&!o}}function rm(t,n={}){var u;if(!(t!=null&&t.node))return null;const o=n.attr||"styles",s=n.surface||t.surface||"self",r=ss(t),i=Zn(t),c=((u=t.node.type)==null?void 0:u.name)||null;return xi({editorId:n.editorId,scopeKey:n.scopeKey||t.key,nodeType:c,uid:r,uidIsStable:i,pos:t.pos,surface:s,styleStorage:o,styleAttr:o,saveAttr:o,controlKind:n.controlKind,allowedKeys:n.keys||[],storageSurface:n.storageSurface||s,writeTargets:[{scopeKey:n.scopeKey||t.key,uid:r,uidIsStable:i,pos:t.pos,nodeType:c,surface:s,attr:o,keys:n.keys||[],mergeStrategy:n.mergeStrategy||"mergeStyles",attrsPatch:n.attrsPatch}]})}function tc(t){if(!(t!=null&&t.node))return null;const n=ss(t);return{...t,key:t.key||`box-content:${n||t.pos}`,uid:n,uidIsStable:Zn(t),surface:"boxContent",node:{...t.node,attrs:{...t.node.attrs,styles:t.node.attrs.columnStyles||{}}}}}function im(t,n={}){var u;if(!(t!=null&&t.node))return null;const o=((u=t.node.type)==null?void 0:u.name)||null,s=ss(t),r=typeof t.pos=="number"?t.pos:null,i=n.type||"block",c=n.keyPrefix||i;return{key:t.key||`${c}:${o||"node"}:${s||r}`,type:i,nodeType:o,surface:n.surface||t.surface||"self",node:t.node,pos:r,uid:s,uidIsStable:Zn(t),parentKey:t.parentKey,ownerBoxKey:t.ownerBoxKey}}function No(t,n={}){const o=im(t,n);if(!o)return null;const s={chain:[...n.chain||[],o]};return bu(s,o,{editorId:n.editorId})}function lm({grid:t,column:n,editorId:o}={}){var u,a,f,d;if(!(t!=null&&t.node)||!(n!=null&&n.node))return null;const s=ss(t),r=ss(n),i=t.key||`callout:${s||t.pos}`,c=n.key||`callout-content:${r||n.pos}`;return xi({editorId:o,scopeKey:`${i}:content-spacing`,nodeType:(u=t.node.type)==null?void 0:u.name,uid:s,uidIsStable:Zn(t),pos:t.pos,surface:"calloutContent",styleStorage:"styles",styleAttr:"styles",saveAttr:"styles",controlKind:"spacing",allowedKeys:Bn,storageSurface:"compound",payloadMode:"allSpacing",displayDomTarget:{uid:r,uidIsStable:Zn(n),pos:n.pos,nodeType:(a=n.node.type)==null?void 0:a.name,surface:"real",domSurface:"column"},writeTargets:[{scopeKey:i,uid:s,uidIsStable:Zn(t),pos:t.pos,nodeType:(f=t.node.type)==null?void 0:f.name,surface:"wrapper",attr:"styles",keys:Bn,mergeStrategy:"mergeStyles",transform:"calloutWrapperSpacing",attrsPatch:{customSpacing:!0}},{scopeKey:c,uid:r,uidIsStable:Zn(n),pos:n.pos,nodeType:(d=n.node.type)==null?void 0:d.name,surface:"real",attr:"styles",keys:Bn,mergeStrategy:"mergeStyles",transform:"calloutContentSpacing"}]})}function bu(t,n,o={}){var C,I,_,R,F,G;if(!t||!n)return null;const{chain:s}=t,{type:r,nodeType:i,surface:c,node:u,pos:a,key:f,uid:d,uidIsStable:h,ownerBoxKey:m}=n,x=T=>s.find(L=>L.key===T),g={uid:d||((C=u==null?void 0:u.attrs)==null?void 0:C.uid)||null,uidIsStable:h!=null?h:!1}
2,w=(T,L={})=>{var S,W,E,P,$;return{...T,key:(S=L.key)!=null?S:f,surface:(E=(W=L.surface)!=null?W:c)!=null?E:"self",uid:(P=L.uid)!=null?P:g.uid,uidIsStable:($=L.uidIsStable)!=null?$:g.uidIsStable}},b=(T,L={})=>{var S;return{...T,styleTarget:rm(T.element,{editorId:o.editorId,scopeKey:((S=T.element)==null?void 0:S.key)||f,...L})}},j=(T,L={})=>{var S;return b(T,{attr:"attrs",styleStorage:"attrs",saveAttr:"attrs",mergeStrategy:"mergeAttrs",storageSurface:((S=T.element)==null?void 0:S.surface)||c||"self",...L})},A=T=>j(T,{controlKind:"radius",keys:[T.radiusAttr||"radius",T.radiusCustomAttr||"radiusCustom"]}),v=(T,L,S)=>{var $,X,q,Q;const W=((q=(X=($=T.element)==null?void 0:$.node)==null?void 0:X.type)==null?void 0:q.name)||i,E=((Q=T.element)==null?void 0:Q.surface)||c||"self",P=va({nodeType:W,surface:E,controlKind:L});return P.styleStorage==="attrs"?j(T,{controlKind:L,keys:P.allowedAttrs||S}):b(T,{controlKind:L,keys:S,attr:P.styleAttr||P.styleStorage||"styles",surface:E,storageSurface:P.storageSurface||E,attrsPatch:W==="blockquote"&&L==="spacing"?{customPadding:!0}:void 0})},k={selectedType:r,selectedSurface:c,targetEntry:n,controlSyncKey:f,isBoxWrapper:r==="box"&&c==="wrapper",isVirtualBoxColumn:r==="column"&&c==="boxContent",isRealColumn:r==="column"&&c==="real",isGrid:r==="grid",isBlock:r==="block"};if(k.isBoxWrapper){const T=w({node:u,pos:a},{surface:"wrapper"});if(hd(i,u==null?void 0:u.attrs)){k.isSingleSurfaceBox=!0;const L=w({node:u,pos:a},{surface:"boxContent"});return k.controls={padding:b({element:L,type:"column"},{controlKind:"spacing",keys:Bn,attr:"styles",surface:"boxContent",storageSurface:"content"}),verticalAlignment:b({element:L},{controlKind:"verticalAlignment",keys:mr,attr:"styles",surface:"boxContent",storageSurface:"content"}),contentLayout:j({element:T,grid:T},{controlKind:"contentLayout",keys:br}),minHeight:j({element:T},{controlKind:"minHeight",keys:Ps}),border:b({element:T,saveTarget:"styles"},{controlKind:"border",keys:ao,surface:"wrapper",storageSurface:"wrapper"}),radius:A({element:T,radiusAttr:"radius",radiusCustomAttr:"radiusCustom"}),shadow:b({element:T,saveTarget:"styles"},{controlKind:"shadow",keys:co,surface:"wrapper",storageSurface:"wrapper"}),background:b({element:T,saveTarget:"styles"},{controlKind:"background",keys:lo,surface:"wrapper",storageSurface:"wrapper"}),fullWidth:j({element:T},{controlKind:"fullWidth",keys:yr})},k}return k.controls={padding:null,verticalAlignment:null,contentLayout:null,minHeight:j({element:T},{controlKind:"minHeight",keys:Ps}),border:b({element:T,saveTarget:"styles"},{controlKind:"border",keys:ao,surface:"wrapper",storageSurface:"wrapper"}),radius:A({element:T,radiusAttr:"radius",radiusCustomAttr:"radiusCustom"}),shadow:b({element:T,saveTarget:"styles"},{controlKind:"shadow",keys:co,surface:"wrapper",storageSurface:"wrapper"}),background:b({element:T,saveTarget:"styles"},{controlKind:"background",keys:lo,surface:"wrapper",storageSurface:"wrapper"}),fullWidth:j({element:T},{controlKind:"fullWidth",keys:yr})},k}if(k.isVirtualBoxColumn){const T=m?x(m):null,L=(T==null?void 0:T.node)||u,S=(I=T==null?void 0:T.pos)!=null?I:a,W={uid:((_=L==null?void 0:L.attrs)==null?void 0:_.uid)||g.uid,uidIsStable:(R=T==null?void 0:T.uidIsStable)!=null?R:g.uidIsStable},E=w({node:L,pos:S},{key:(T==null?void 0:T.key)||f,surface:"boxContent",...W}
2),P={node:{...L,attrs:{...L.attrs,styles:L.attrs.columnStyles||{}}},pos:S,key:(T==null?void 0:T.key)||f,surface:"boxContent",...W};return k.controls={padding:b({element:E,type:"column"},{controlKind:"spacing",keys:Bn,attr:"styles",surface:"boxContent",storageSurface:"content"}),verticalAlignment:b({element:E},{controlKind:"verticalAlignment",keys:mr,attr:"styles",surface:"boxContent",storageSurface:"content"}),contentLayout:j({element:E,grid:E},{controlKind:"contentLayout",keys:br}),minHeight:j({element:E},{controlKind:"minHeight",keys:Ps}),border:b({element:P,saveTarget:"columnStyles"},{controlKind:"border",keys:ao,attr:"columnStyles",surface:"boxContent",storageSurface:"content"}),radius:A({element:E,radiusAttr:"columnRadius",radiusCustomAttr:"columnRadiusCustom"}),shadow:b({element:P,saveTarget:"columnStyles"},{controlKind:"shadow",keys:co,attr:"columnStyles",surface:"boxContent",storageSurface:"content"}),background:b({element:P,saveTarget:"columnStyles"},{controlKind:"background",keys:lo,attr:"columnStyles",surface:"boxContent",storageSurface:"content"}),fullWidth:null},k}if(k.isRealColumn){const T=w({node:u,pos:a},{surface:"real"}),L=n.parentCalloutKey?x(n.parentCalloutKey):x(n.parentKey),S=n.isCalloutChild||!!L&&(L.isCallout||Uc(L.nodeType));return k.controls={padding:b({element:T,type:"column"},{controlKind:"spacing",keys:Bn,surface:"real",storageSurface:"column"}),verticalAlignment:b({element:T},{controlKind:"verticalAlignment",keys:mr,surface:"real",storageSurface:"column"}),contentLayout:j({element:T},{controlKind:"contentLayout",keys:br}),minHeight:null,border:b({element:T,saveTarget:"styles"},{controlKind:"border",keys:ao,surface:"real",storageSurface:"column"}),radius:A({element:T,radiusAttr:"radius",radiusCustomAttr:"radiusCustom"}),shadow:b({element:T,saveTarget:"styles"},{controlKind:"shadow",keys:co,surface:"real",storageSurface:"column"}),background:b({element:T,saveTarget:"styles",allowEffects:!S},{controlKind:"background",keys:lo,surface:"real",storageSurface:"column"}),fullWidth:null},k}if(k.isGrid){const T=i==="icontext",L=i==="infobox",S=i==="blockquote",W=pd(i),E=i==="gridx",P=i!=="grid1"&&!L&&!S&&!W&&!E,$=w({node:u,pos:a},{surface:"wrapper"});return k.controls={padding:b({element:$,type:"grid"},{controlKind:"spacing",keys:Bn,surface:W?"boxContent":"wrapper",storageSurface:W?"content":"wrapper",attrsPatch:T?{customPadding:!0}:void 0}),verticalAlignment:null,contentLayout:null,minHeight:!L&&!S?j({element:$},{controlKind:"minHeight",keys:Ps}):null,columnGap:E?j({element:$,attrName:"columnGap"},{controlKind:"columnGap",keys:Vg}):P?j({element:$},{controlKind:"columnGap",keys:Ug}):null,rowGap:E?j({element:$,attrName:"rowGap"},{controlKind:"rowGap",keys:Kg}):null,gridxLayout:E?j({element:$},{controlKind:"gridxLayout",keys:Gg}):null,border:!L&&!S?b({element:$,saveTarget:"styles"},{controlKind:"border",keys:ao,surface:"wrapper",storageSurface:"wrapper"}):null,radius:(F=u==null?void 0:u.attrs)!=null&&F.radius?A({element:$,radiusAttr:"radius",radiusCustomAttr:"radiusCustom"}):null,shadow:!L&&!S?b({element:$,saveTarget:"styles"},{controlKind:"shadow",keys:co,surface:"wrapper",storageSurface:"wrapper"}):null,background:b({element:$,saveTarget:"styles",allowEffects:!T&&!L&&!S},{controlKind:"background",keys:lo,surface:"wrapper",storageSurface:"wrapper"}),fullWidth:!L&&!S?j({element:$},{controlKind:"fullWidth",keys:yr}):null},k.isTargetIcontext=T,k}if(k.isBlock){const T=w({node:u,pos:a},{surface:"self"}),L=va({nodeType:i,surface:"self"}),S=L.styleStorage==="attrs";return k.controls={padding:S?null:v({element:T,type:"block"},"spacing",Bn),border:S?null:v({element:T,saveTarget:"styles"},"border",ao),radius:(G=u==null?void 0:u.attrs)!=null&&G.radius?A({element:T,radiusAttr:"radius",radiusCustomAttr:"radiusCustom"}):null,shadow:S||i==="codeBlock"?null:v({element:T,saveTarget:"styles"},"shadow",co),background:S?null:v({element:T,saveTarget:"styles",allowEffects:i!=="codeBlock"},"background",lo),dedicatedAttrs:S?j({element:T},{controlKind:"dedicatedAttrs",keys:L.allowedAttrs||Yg}):null},k}return k}function yu(t){return(t==null?void 0:t.nodeType)==="shareblock"&&(t==null?void 0:t.surface)!=="boxContent"}function am({resolvedSelectedScope:t,isFullDocumentScope:n,showBlockSections:o,activeTab:s,gridType:r,hasNode:i,nodeType:c}={}){return n?!1:yu(t)?!0:t?!1:o&&s==="block"&&r==="shareblock"&&!(i&&c==="navbar")}function cm({activeTab:t,resolvedSelectedScope:n,nodeType:o}={}){return t!=="block"?!1:n?n.nodeType==="navbar":o==="navbar"}const um={desktop:"base",tablet:"≤768px",mobile:"≤576px"},Xo={desktop:"Desktop",tablet:"Tablet",mobile:"Mobile"},vr=(t,n)=>e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:1,lineHeight:1.2,padding:"2px 0"},children:[e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontWeight:600},children:[Xo[t],n&&e.jsx(fu,{size:6,tip:`${Xo[t]} has overrides — values set there no longer follow Desktop.`})]}),e.jsx("span",{style:{fontSize:9,opacity:.65,fontWeight:500},children:um[t]})]});function dm({editor:t,element:n}){var E,P,$,X,q,Q,B,O,K,Y;const{breakpoint:o,setBreakpoint:s}=Et(),[,r]=l.useState(0),i=()=>r(H=>H+1);l.useEffect(()=>{if(!t)return;const H=()=>r(D=>D+1);return t.on("update",H),()=>t.off("update",H)},[t]);const c=St(t,n),u=c.node||(n==null?void 0:n.node)||null,a=(u==null?void 0:u.attrs)||{},{currentEditorId:f}=gi(),d=(X=($=(P=(E=t==null?void 0:t.options)==null?void 0:E.editorProps)==null?void 0:P.attributes)==null?void 0:$.editorId)!=null?X:f,h=typeof c.pos=="number"?c.pos:n==null?void 0:n.pos,m=u?xd({editorId:d,uid:a==null?void 0:a.uid,nodeType:(q=u==null?void 0:u.type)==null?void 0:q.name,pos:h}):null,x=gd(m);if(!u)return null;
2const g={desktop:a.hidden===!0,tablet:((B=(Q=a.responsive)==null?void 0:Q.tablet)==null?void 0:B.hidden)===!0,mobile:((K=(O=a.responsive)==null?void 0:O.mobile)==null?void 0:K.hidden)===!0},w=g[o],b=["desktop","tablet","mobile"].filter(H=>g[H]),j=()=>{Mx(t,n,o,!w)&&i()},A=()=>{o!=="desktop"&&Ox(t,n,o)&&i()},v=o==="desktop",k=o==="mobile"?"Tablet → Desktop":"Desktop",I=(((Y=u==null?void 0:u.type)==null?void 0:Y.name)||null)==="box"&&(a.flexLayout==="row"||a.flexLayout==="hspread"),_=["flexLayout","flexGap"].some(H=>So(a,H,"tablet")||So(a,H,"mobile")),R=o==="mobile"&&I&&!_,F=a.flexMobileLayout||"stack",G=H=>{be(t,n,{flexMobileLayout:H})&&i()},T=Number(a.flexGap)||0,L=a.flexMobileGap!=null&&a.flexMobileGap!=="",S=L?Number(a.flexMobileGap):T,W=H=>{const D=H===""||H==null?null:Number(H);be(t,n,{flexMobileGap:Number.isFinite(D)?D:null})&&i()};return e.jsxs(p,{children:[e.jsx(ns,{fullWidth:!0,size:"xs",value:o,onChange:s,data:[{value:"desktop",label:vr("desktop",!1)},{value:"tablet",label:vr("tablet",ja(a,"tablet"))},{value:"mobile",label:vr("mobile",ja(a,"mobile"))}],styles:{label:{padding:"4px 6px"}}}),!v&&e.jsxs(p,{mt:12,style:{background:"#f3f0ff",border:"1px solid #e5dbff",borderRadius:8,padding:"10px 12px"},children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[e.jsxs(N,{size:"sm",fw:700,style:{color:"#5f3dc4"},children:["Editing ",Xo[o]]}),e.jsx(We,{variant:"outline",color:"violet",size:"compact-xs",style:{whiteSpace:"nowrap",flexShrink:0},onClick:A,children:"Reset all"})]}),e.jsxs(N,{size:"xs",mt:2,style:{color:"#7048e8",opacity:.85},children:["Unset values inherit from ",k,"."]})]}),R&&e.jsxs(p,{mt:14,children:[e.jsx(N,{size:"sm",fw:500,mb:6,children:"Flex layout on mobile"}),e.jsx(ns,{fullWidth:!0,size:"xs",value:F,onChange:G,data:[{value:"stack",label:"Stack"},{value:"wrap",label:"Wrap"},{value:"row",label:"Row"}]}),e.jsx(N,{size:"xs",c:"dimmed",mt:4,children:"How this flex row behaves on phones (≤576px)."}),e.jsxs(p,{mt:10,style:{display:"flex",alignItems:"end",gap:8},children:[e.jsx(Rt,{label:"Gap on mobile",value:Number.isFinite(S)?S:T,onChange:W,min:0,max:240,step:1,suffix:" px",size:"xs",style:{flex:1}}),e.jsx(We,{variant:"subtle",color:"violet",size:"compact-xs",disabled:!L,onClick:()=>W(null),children:"Use desktop"})]}),e.jsx(N,{size:"xs",c:"dimmed",mt:4,children:L?"Overrides the desktop gap on phones.":`Inheriting ${T}px from desktop.`})]}),e.jsxs(p,{mt:14,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[e.jsxs(p,{children:[e.jsxs(N,{size:"sm",fw:500,children:["Hide on ",Xo[o].toLowerCase()]}),e.jsx(N,{size:"xs",c:"dimmed",mt:2,children:w?`This block won't render on ${Xo[o].toLowerCase()} screens`:b.length?`Hidden on: ${b.join(", ")}`:"Block is visible on all devices"})]}),e.jsx(Ve,{size:"md",color:"pink",checked:w,onChange:j,"aria-label":"Hide on this device"})]}),w&&m&&e.jsxs(p,{mt:10,children:[e.jsx(We,{variant:"outline",color:"violet",size:"compact-xs",onClick:()=>md(m,!x),children:x?"Collapse to strip":"Expand to edit"}),e.jsx(N,{size:"xs",c:"dimmed",mt:4,children:x?"Shown at full size on the canvas so you can edit it. It collapses again when you select another block.":"Shown as a one-line strip on the canvas. Expand it to edit the content in place."})]})]})}const At='stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"',fm=[{value:"none",label:"None",icon:e.jsx("svg",{width:"30",height:"22",viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:`<rect x="4" y="6" width="16" height="12" rx="2" ${At}/>`}})},{value:"fade",label:"Fade",icon:e.jsx("svg",{width:"30",height:"22",viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:`<rect x="4" y="6" width="16" height="12" rx="2" opacity="0.4" ${At}/>`}})},{value:"up",label:"Fade Up",icon:e.jsx("svg",{width:"30",height:"22",viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:`<rect x="5" y="9" width="14" height="9" rx="2" ${At}/><path d="M12 6l0-3M9.5 4.5L12 2l2.5 2.5" ${At}/>`}})},{value:"down",label:"Fade Dn",icon:e.jsx("svg",{width:"30",height:"22",viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:`<rect x="5" y="6" width="14" height="9" rx="2" ${At}/><path d="M12 18l0 3M9.5 19.5L12 22l2.5-2.5" ${At}/>`}})},{value:"zoom",label:"Zoom In",icon:e.jsx("svg",{width:"30",height:"22",viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:`<rect x="7" y="8" width="10" height="8" rx="2" ${At}/><path d="M3 3l3 1M3 3l1 3M21 3l-3 1M21 3l-1 3M3 21l3-1M3 21l1-3M21 21l-3-1M21 21l-1-3" ${At}/>`}})},{value:"left",label:"Slide L",icon:e.jsx("svg",{width:"30",height:"22",viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:`<rect x="9" y="6" width="12" height="12" rx="2" ${At}/><path d="M6 12H2M4 10l-2 2 2 2" ${At}/>`}})},{value:"right",label:"Slide R",icon:e.jsx("svg",{width:"30",height:"22",viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:`<rect x="3" y="6" width="12" height="12" rx="2" ${At}/><path d="M18 12h4M20 10l2 2-2 2" ${At}/>`}})},{value:"custom",label:"Custom",icon:e.jsx("svg",{width:"30",height:"22",viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:`<path d="M4 8h10M18 8h2M4 16h2M10 16h10" ${At}/><circle cx="16" cy="8" r="2" ${At}/><circle cx="8" cy="16" r="2" ${At}/>`}})}],nc={trigger:"scroll",duration:500,delay:0,distance:24,easing:"ease-out",once:!0},hm=new Set(["up","down","left","right"]),pm=[{value:"ease-out",label:"Ease out"},{value:"ease",label:"Ease"},{value:"linear",label:"Linear"},{value:"spring",label:"Spring"}],jr={fontSize:"10px",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9a9aa4",margin:"16px 0 9px"};function xm({element:t,saveNodeData:n,editor:o}){const[s,r]=mn({element:t,saveNodeData:n,editor:o,attrName:"animateIn",defaultValue:"none"}),[i,c]=mn({element:t,saveNodeData:n,editor:o,attrName:"animateInCustom",defaultValue:null}),u={...nc,...i||{}},a=g=>w=>c({...u,[g]:w}),f=g=>{g!=="none"&&!i&&c({...nc}),r(g)}
2,d=l.useRef(null);l.useEffect(()=>()=>window.clearTimeout(d.current),[]);const h=()=>{var A,v,k;if(!o||!t)return;let g;try{g=(A=St(o,t))==null?void 0:A.pos}catch{g=null}if(g==null)return;let w;try{w=o.view.nodeDOM(g)}catch{w=null}if(!w||w.nodeType!==1)return;const b=(v=w.matches)!=null&&v.call(w,"[data-animate]")?w:((k=w.querySelector)==null?void 0:k.call(w,"[data-animate]"))||w;b.setAttribute("data-animate-preview","true"),b.removeAttribute("data-inview"),b.offsetHeight,b.setAttribute("data-inview","true");const j=(Number(u.duration)||500)+(Number(u.delay)||0)+300;window.clearTimeout(d.current),d.current=window.setTimeout(()=>{b.removeAttribute("data-animate-preview"),b.removeAttribute("data-inview")},j)},m=s&&s!=="none",x=s==="custom"||hm.has(s);return e.jsxs(p,{children:[e.jsx(as,{cols:4,spacing:6,verticalSpacing:6,children:fm.map(g=>e.jsx(Be,{icon:g.icon,label:g.label,value:g.value,active:s===g.value,compact:!0,onClick:()=>f(g.value)},g.value))}),m&&e.jsxs(p,{children:[e.jsx(N,{style:jr,children:"Trigger"}),e.jsx(ns,{fullWidth:!0,size:"xs",value:u.trigger,onChange:a("trigger"),data:[{label:"On load",value:"load"},{label:"On scroll in",value:"scroll"}]}),e.jsx(N,{style:jr,children:"Timing"}),e.jsx(He,{label:"Speed",unit:"ms",labelWidth:"58px",value:u.duration,min:0,max:1200,step:10,onChange:a("duration")}),e.jsx(He,{label:"Delay",unit:"ms",labelWidth:"58px",value:u.delay,min:0,max:1e3,step:10,onChange:a("delay")}),x&&e.jsx(He,{label:"Distance",unit:"px",labelWidth:"58px",value:u.distance,min:0,max:120,onChange:a("distance")}),e.jsx(N,{style:jr,children:"Easing"}),e.jsx(Ue,{size:"xs",value:u.easing,onChange:g=>a("easing")(g.target.value),data:pm}),e.jsxs(ye,{justify:"space-between",mt:14,wrap:"nowrap",children:[e.jsxs(p,{children:[e.jsx(N,{style:{fontSize:"12.5px",fontWeight:600,color:"#3a3a42"},children:"Play once"}),e.jsx(N,{style:{fontSize:"11px",color:"#adb5bd"},children:"Off = replays each time it re-enters view"})]}),e.jsx(Ve,{checked:u.once,onChange:g=>a("once")(g.currentTarget.checked),color:"violet",size:"sm"})]}),e.jsx(We,{fullWidth:!0,variant:"light",color:"violet",size:"xs",mt:14,onClick:h,children:"▶ Preview animation"}),e.jsx(N,{style:{fontSize:"11px",color:"#a0a0aa",lineHeight:1.5,marginTop:"10px"},children:"Animations don’t play while editing — blocks render at rest. Visitors with reduced-motion on see no movement."})]})]})}const gm=new Set(["responsive","typography","v2-alignment","v2-padding","v2-callout-content-padding","v2-box-padding","v2-col-padding","v2-grid-padding","bc-padding","v2-box-size","v2-grid-size","bc-size","v2-gridx-layout","bc-gridx-layout","v2-box-layout","v2-box-vertical","v2-box-align","v2-grid-align","bc-align"]);function mm(t){return gm.has(t)}function vu(t,n,o){return l.Children.map(t,s=>{if(!l.isValidElement(s))return s;if(s.type===l.Fragment)return l.cloneElement(s,void 0,vu(s.props.children,n,o));if(s.type!==y.Item)return s;const r=s.props["data-responsive-aware"]===!0,i=n&&!r&&!mm(s.props.value),c=[s.props.className,i?o:null].filter(Boolean).join(" ")||void 0;return l.cloneElement(s,{className:c,inert:i||void 0,"aria-disabled":i||void 0,"data-responsive-locked":i?"true":void 0})})}function bm({children:t,lockedClassName:n,...o}){const{breakpoint:s}=Et(),r=s!=="desktop";return e.jsx(y,{...o,"data-responsive-breakpoint":s,children:vu(t,r,n)})}const ym=["textAlign","styles","customSpacing","customPadding","class","radius","radiusCustom","nestedRadius","nestedRadiusCustom","responsive","hidden","animateIn","animateInCustom"],vm=new Set(["actionbutton","audio","badgePill","blockquote","box","callout","circle","column","container","customform","details","embed","fancyLink","file","grid1","grid2","grid3","grid4","gridx","horizontalRule","htmlEmbed","icontext","image","infobox","interactiveButton","interactiveInput","interactiveWait","navbar","resource","shareblock","survey","tagsFeed","video","visionCircle","visionInput","visionVideo"]),jm=new Set(["uid","incrementor","breadcrumbLabel","circle_id"]),km={audio:["src","uploader"],box:["boxModel"],circle:["id"],column:["size","position"],details:["circle_id"],embed:["videoId","src","embedInputType","originalEmbedCode"],fancyLink:["link","uploader"],file:["src","name","size","extension","uploader"],gridx:["columns"],htmlEmbed:["html","css","js"],image:["src","uploader","markup"],interactiveButton:["isInteractive","interactivePosition"],interactiveInput:["id","isInteractive","interactivePosition"],interactiveWait:["isInteractive","interactivePosition"],navbar:["navbarConfigId"],resource:["id"],shareblock:["shareBlockConfigId","shareBlockKind"],survey:["id"],video:["media_file_id","media_id","src","zoom","uploader"],visionCircle:["title","description"],visionVideo:["src","uploader"]},wm={bulletList:["markerColor","markerStyle"]},Cm=["fontFamily","fontSize","color","textGradient"],Sm=t=>{var n;return["paragraph","heading","bulletList","orderedList","taskList"].includes((n=t==null?void 0:t.type)==null?void 0:n.name)},oc=t=>{var r;const n=(r=t==null?void 0:t.type)==null?void 0:r.name,o=(t==null?void 0:t.attrs)||{};if(!vm.has(n))return Array.from(new Set([...ym,...wm[n]||[]])).filter(i=>Object.prototype.hasOwnProperty.call(o,i));const s=new Set([...jm,...km[n]||[]]);return Object.keys(o).filter(i=>!s.has(i))},Tm=new Set(["paragraph","heading"]);function Im(t,n){if(!t||!n||n.empty||n.from===n.to)return[];if(n.node)return[];const o=[];return t.nodesBetween(n.from,n.to,(s,r)=>{var i;return s.isTextblock&&Tm.has((i=s.type)==null?void 0:i.name)?(o.push({node:s,pos:r}),!1):!0}),o}function ju(t,n){return Im(t,n).length>1}function _m(t,n,o){const s={},r=Array.isArray(o)&&o.length>0?o:Object.keys(t||{});for(const i of r)Object.prototype.hasOwnProperty.call(t||{},i)&&(o!=null&&o.length||t[i]!==(n==null?void 0:n[i]))&&(s[i]=t[i]);return s}const Am=new Set(["box","container","shareblock","column","infobox","blockquote","detailsSummary"]),Vn={SAVED:"saved",NO_STYLES:"no-styles",NO_EDITOR:"no-editor",TARGET_MISSING:"target-missing",WRITE_FAILED:"write-failed"};function Bm({state:t,element:n,target:o,changedProps:s}){var h,m;if(!t||!(o!=null&&o.node)||!s||Object.keys(s).length===0)return null;const r=((m=(h=n==null?void 0:n.node)==null?void 0:h.type)==null?void 0:m.name)||"";if(Am.has(r))return null;const{doc:i,selection:c}=t;if(!ju(i,c))return null;const u=[];
2if(i.nodesBetween(c.from,c.to,(x,g)=>{var w;x.isTextblock&&((w=x.attrs)!=null&&w.styles)&&u.push({node:x,pos:g})}),u.length<=1)return null;const a=o.pos,f=o.pos+o.node.nodeSize;return u.some(({node:x,pos:g})=>g<f&&g+x.nodeSize>a)?u:null}function Rm({state:t,tr:n,ranges:o,attrNames:s}){const r=t.schema.marks.textStyle;if(r)for(const i of o)t.doc.nodesBetween(i.from,i.to,(c,u)=>{var g;if(!c.isText||!((g=c.marks)!=null&&g.length))return;const a=c.marks.find(w=>w.type===r);if(!a)return;const f={...a.attrs};let d=!1;for(const w of s)f[w]!=null&&f[w]!==""&&(delete f[w],d=!0);if(!d)return;const h=u,m=u+c.nodeSize;n.removeMark(h,m,r),Object.values(f).some(w=>w!=null&&w!=="")&&n.addMark(h,m,r.create(f))})}function Em({editor:t,element:n,newStyles:o,changedStyleKeys:s,clearTextStyleAttrs:r,onFailure:i}={}){var m,x,g,w,b,j,A;const c=(v,k)=>(v!==Vn.SAVED&&v!==Vn.NO_STYLES&&(i==null||i({status:v,...k})),{status:v,...k});if(!o)return c(Vn.NO_STYLES,{});const u=(m=t==null?void 0:t.view)==null?void 0:m.state;if(!u||t!=null&&t.isDestroyed||!(n!=null&&n.node))return c(Vn.NO_EDITOR,{});const a=((x=n.node.type)==null?void 0:x.name)||"",f=Xt(t,n);if(!(f!=null&&f.node)||f.pos==null)return c(Vn.TARGET_MISSING,{uid:(w=(g=n.node.attrs)==null?void 0:g.uid)!=null?w:null,nodeType:a});const d=((b=n.node.attrs)==null?void 0:b.styles)||{},h=_m(o,d,s);try{const{tr:v}=u,k=[],C=Bm({state:u,element:n,target:f,changedProps:h}),I=[];if(C){const _=[...C].sort((R,F)=>F.pos-R.pos);for(const{node:R,pos:F}of _){const G={...R.attrs.styles,...h},T=R.type.name==="heading"&&(R.attrs.level===4||R.attrs.level===5),L=T?u.schema.nodes.paragraph:void 0,S=T?{...R.attrs,styles:G,level:void 0}:{...R.attrs,styles:G};v.setNodeMarkup(F,L,S),k.push({from:F+1,to:F+R.nodeSize-1}),I.push(F)}}else{const _=f.pos,R=f.node.attrs,F=a==="heading"&&(R.level===4||R.level===5),G=F?u.schema.nodes.paragraph:void 0,T=a==="blockquote"&&Object.keys(h).some(S=>S.indexOf("padding-")===0),L=F?{...R,styles:o,...T?{customPadding:!0}:{},level:void 0}:{...R,styles:o,...T?{customPadding:!0}:{}};v.setNodeMarkup(_,G,L),k.push({from:_+1,to:_+f.node.nodeSize-1}),I.push(_)}return Array.isArray(r)&&r.length>0&&Rm({state:u,tr:v,ranges:k,attrNames:r}),t.view.dispatch(v),{status:Vn.SAVED,writtenPositions:I,multiBlock:!!C}}catch(v){return c(Vn.WRITE_FAILED,{error:v,uid:(A=(j=n.node.attrs)==null?void 0:j.uid)!=null?A:null,nodeType:a})}}const zm=t=>({tab:{padding:0,height:"30px",fontSize:10},list:{marginBottom:-5},item:{borderBottom:"none"},control:{paddingTop:0,paddingBottom:10,paddingLeft:20,paddingRight:20,marginTop:16},icon:{},content:{backgroundColor:"var(--mantine-color-gray-0)",paddingLeft:20,paddingRight:20},contentInner:{paddingLeft:0,paddingRight:0},boxStyle:{border:"1px solid #dfdfdf",padding:"0 10px 20px 10px",marginTop:20,borderRadius:5}}),uo=t=>{if(t===null||typeof t!="object"||Array.isArray(t))return;const n={},o=Object.keys(t);for(let s=0;s<o.length;s++){const r=o[s],i=t[r];r.indexOf("padding")>=0?typeof i=="string"&&i.includes("px")?n[r]=parseInt(i.replace("px",""),10):n[r]=i:r==="background-image"?typeof i!="string"?n[r]=i:i==="none"||!i.trim()?n[r]=null:i.indexOf("https")>=0||i.indexOf("uploads")>=0?n[r]=i.replace("url(","").replace(")","").replaceAll("'",""):n[r]=i:n[r]=i}return n},Lm="_outlineBtn_fka7c_1",Pm="_appliedBtn_fka7c_11",Wm="_focusInput_fka7c_23",xo={outlineBtn:Lm,appliedBtn:Pm,focusInput:Wm},Om="_focusInput_zbitd_1",Mm={focusInput:Om};function Nm(t){const n=l.useRef(null),o=l.useRef(!1),s=ee(c=>c.tiptap),[r,i]=l.useState();return l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&o.current!=t.element.node.attrs.uid)return;t.element;const c=t.element.node.attrs[`${t.attrName}`]?r:null;if(c){const u={};u[`${t.attrName}`]=c,s.editor.commands.updateAttributes(t.element.node.type.name,u),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t.saveNodeData()},2e3)}},[r]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.styles){o.current=null;const c=t.element.node.attrs.uid;setTimeout(()=>{o.current=c},0),i(t.element.node.attrs[`${t.attrName}`])}},[t.element]),e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"4px",marginTop:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:t.attrLabel}),e.jsx(at,{value:r,onChange:c=>i(c.currentTarget.value),placeholder:`${t.attrPlaceholder}
2`,size:"xs",classNames:{input:Mm.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]})}function $m(t){return e.jsx(p,{style:{marginTop:"12px"},children:e.jsx(bd,{section:"settings",global:!0,type:"message",spaceId:t.element.node.attrs.id,tags:Array.isArray(t.tags)?t.tags:[],onUpdatedMessage:()=>{}})})}function tn({children:t,description:n}){const o=typeof t=="string"?t.trimEnd():t,s=typeof o=="string"?o.lastIndexOf(" "):-1,r=s>=0?o.slice(0,s+1):"",i=s>=0?o.slice(s+1):o;return e.jsxs(p,{component:"span",style:{display:"inline"},children:[r,e.jsxs("span",{style:{whiteSpace:"nowrap"},children:[i,e.jsx(vt,{label:n,multiline:!0,styles:{tooltip:{width:240}},withArrow:!0,position:"top",zIndex:999999,events:{hover:!0,focus:!0,touch:!0},children:e.jsx(p,{component:"span","aria-label":n,role:"img",tabIndex:0,style:{display:"inline-flex",verticalAlign:"middle",marginLeft:6,color:"#868e96",cursor:"pointer",fontSize:14},children:e.jsx(En,{size:17,strokeWidth:1.75,"aria-hidden":"true"})})})]})]})}function Dm({node:t,onSaveNodeData:n}){const o=l.useRef(null),s=l.useRef(!1),r=l.useRef(!1),i=ee(_=>_.tiptap),c=ee(_=>_.space),u=Array.isArray(c==null?void 0:c.parents_versions)&&(c.parents_versions.includes("course")||c.parents_versions.includes("section"))||(c==null?void 0:c.version)==="course"||(c==null?void 0:c.version)==="section",[a,f]=l.useState("nothing"),[d,h]=l.useState(""),[m,x]=l.useState(!1),[g,w]=l.useState([]);l.useEffect(()=>{t&&t.node.attrs.styles&&(r.current=t.node.attrs.uid,f(t.node.attrs.nextButtonAction||"nothing"),h(t.node.attrs.nextButtonActionValue||""))},[t]);const b=(_,R)=>{if(!i.editor||!t)return;let F=R;_==="custom_url"&&R&&R.indexOf("http://")<0&&R.indexOf("https://")<0&&(F=`https://${R}`),i.editor.commands.updateAttributes(t.node.type.name,{nextButtonAction:_,nextButtonActionValue:F}),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{o.current=null,n()},2e3)},j=_=>{f(_),_==="nothing"?(h(""),b(_,"")):b(_,d)},A=_=>{h(_),b(a,_)},v=_=>{x(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{k(_),x(!1)},1e3)},k=(_=null)=>{const R=["members","simple",`order-context-${window.$fetchedTopSlug}`];_&&R.push(`q=${_}`),sn.onFetchManaged(null,R,{page:1,per:10},F=>{w(F.map(G=>({value:`/space/${G.slug}/${G.version}`,label:`${G.name} (${G.slug})`})))},()=>{})},C={input:xo.focusInput},I={input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}};return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"10px",marginTop:"10px"},children:[e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:"Clicking next button will..."}),e.jsx(Ue,{value:a,onChange:_=>j(_.target.value),size:"xs",data:[{value:"nothing",label:u?"Move to next content or module":"Move on to the next content"},{value:"space",label:"Redirect to another space"},{value:"custom_url",label:"Redirect to custom URL"}],classNames:C,styles:I})]}),a==="space"&&e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:"Link to"}),e.jsx(jt,{comboboxProps:{zIndex:99999},leftSection:m?e.jsx(es,{size:"xs"}):e.jsx(Qe,{icon:Xs.faSearch}),searchable:!0,limit:100,size:"xs",data:g,onChange:_=>A(_),placeholder:"Search by name or slug",description:d&&`Redirecting to ${d}`,value:d,onSearchChange:_=>v(_),classNames:C,styles:{...I,description:{fontWeight:600,fontSize:"11px"}}})]}),a==="custom_url"&&e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:"Link to"}),e.jsx(at,{value:d,onChange:_=>A(_.currentTarget.value),placeholder:"https://example.com",size:"xs",classNames:C,styles:I})]})]})}function Fm({node:t,editor:n,tags:o,t:s,classes:r,onSaveNodeData:i,nodeType:c,isNodeType:u,onGenerateAiTags:a,onApplyAllTags:f,onCategorizeAllTags:d,onClearAllTags:h}){var b,j,A;const[m,x]=l.useState(!1),g=l.useRef(null);if(l.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),!(t!=null&&t.node)||!u("interactiveInput"))return null;const w=async()=>
2{if(!(await Ct.fire({title:"Apply settings to all prompts?",html:"This will replace the settings on every other discussion prompt on this page with the settings from the selected prompt.",showDenyButton:!0,confirmButtonText:"Apply settings",denyButtonText:"Cancel",confirmButtonColor:zn.blue,denyButtonColor:zn.gray})).isConfirmed)return;const k=t.node.attrs;Oc(n,t.node.type.name,{buttonText:k.buttonText,interactiveInputButtonTextCustomized:k.interactiveInputButtonTextCustomized,interactiveInputShowAll:k.interactiveInputShowAll,interactiveInputAllowMultipost:k.interactiveInputAllowMultipost,interactiveInputAllowSkip:k.interactiveInputAllowSkip,interactiveInputPreShowAll:k.interactiveInputPreShowAll,interactiveInputWithPrivacyCheck:k.interactiveInputWithPrivacyCheck,interactiveInputNotificationOnEachPost:k.interactiveInputNotificationOnEachPost,interactiveAdvancedEngagement:k.interactiveAdvancedEngagement,interactiveEmailMode:k.interactiveEmailMode,interactiveSummaryCustomMessage:k.interactiveSummaryCustomMessage,isBlocking:k.isBlocking,markCompleteOnNext:k.markCompleteOnNext,nextButtonAction:k.nextButtonAction,nextButtonActionValue:k.nextButtonActionValue}),i(),x(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{g.current=null,x(!1)},2500)};return e.jsxs(y.Item,{value:"interactive-input",children:[e.jsx(y.Control,{children:s("tiptap.components.sideConfigurationsMenu.label3")}),e.jsxs(y.Panel,{children:[e.jsx(Nm,{saveNodeData:i,element:t,attrPlaceholder:s("tiptap.components.sideConfigurationsMenu.attrPlaceholder1"),attrLabel:s("tiptap.components.sideConfigurationsMenu.attrLabel"),attrName:"interactiveInputPlaceholder"}),e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"4px",marginTop:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:"Button text"}),e.jsx(vi,{saveNodeData:i,element:t,editor:n})]}),e.jsx(Bt,{saveNodeData:v=>{n.commands.updateAttributes(c,{interactiveAdvancedEngagement:!!v}),i()},element:t,attrLabel:e.jsx(tn,{description:"Let participants read responses shared by others in this prompt.",children:s("tiptap.components.sideConfigurationsMenu.attrLabel2")}),attrName:"interactiveInputShowAll"}),t.node.attrs.interactiveInputShowAll&&e.jsxs(p,{style:{borderLeft:"2px solid #e9ecef",marginTop:"4px",marginLeft:"14px",paddingLeft:"12px"},children:[e.jsx(Bt,{saveNodeData:i,element:t,attrLabel:e.jsx(tn,{description:"Let participants choose whether to share their response with others or keep it private to managers and moderators.",children:s("tiptap.components.sideConfigurationsMenu.attrLabel4")}),attrName:"interactiveInputWithPrivacyCheck"}),e.jsx(Bt,{saveNodeData:i,element:t,attrLabel:e.jsx(tn,{description:"Let participants read shared responses before posting their own. When off, they must respond first.",children:s("tiptap.components.sideConfigurationsMenu.attrLabel3")}),attrName:"interactiveInputPreShowAll"}),e.jsx(Bt,{saveNodeData:i,element:t,attrLabel:e.jsx(tn,{description:"Show AI-selected highlights and a summary of the discussion alongside participant responses.",children:"Show AI highlights and summary"}),attrName:"interactiveAdvancedEngagement"}),!!((b=t.node.attrs)!=null&&b.interactiveAdvancedEngagement)&&e.jsx(e.Fragment,{children:e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"4px",marginTop:"10px"},children:[e.jsx(p,{style:{display:"flex",alignItems:"center",gap:"6px"},children:e.jsxs(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:[s("tiptap.components.sideConfigurationsMenu.attrLabel14"),e.jsx(vt,{label:"Pass custom instructions to the AI to shape things like the language, tone, or format of the response.",multiline:!0,styles:{tooltip:{width:220}},withArrow:!0,position:"top",zIndex:999999,children:e.jsx(En,{size:17,strokeWidth:1.75,style:{color:"#868e96",cursor:"pointer",fontSize:14,verticalAlign:"middle",marginLeft:6}})})]})}),e.jsx(at,{value:((j=t.node.attrs)==null?void 0:j.interactiveSummaryCustomMessage)||"",onChange:v=>{n.commands.updateAttributes(c,{interactiveSummaryCustomMessage:v.currentTarget.value}),i()},placeholder:s("tiptap.components.sideConfigurationsMenu.attrPlaceholder1"),size:"xs",classNames:{input:xo.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]})})]}),e.jsx(Bt,{saveNodeData:i,element:t,attrLabel:e.jsx(tn,{description:"Let each participant submit more than one response to this prompt.",children:s("tiptap.components.sideConfigurationsMenu.attrLabel5")}),attrName:"interactiveInputAllowMultipost"}),e.jsx(Bt,{saveNodeData:i,element:t,attrLabel:e.jsx(tn,{description:"Show a Skip button so participants can continue without submitting a response.",children:s("tiptap.components.sideConfigurationsMenu.attrLabel6")}),attrName:"interactiveInputAllowSkip"}),e.jsx(Bt,{saveNodeData:i,element:t,attrLabel:e.jsxs(p,{component:"span",style:{display:"inline"},children:[e.jsx("span",{children:"Hide next content"}
2),e.jsx(vt,{label:"When this setting is enabled, the user will not be able to see the next content on the page until they respond. This setting can also be used to hide the Next button.",multiline:!0,styles:{tooltip:{width:240}},withArrow:!0,position:"top",zIndex:999999,children:e.jsx(p,{component:"span","aria-label":"When this setting is enabled, the user will not be able to see the next content on the page until they respond. This setting can also be used to hide the Next button.",role:"img",tabIndex:0,style:{display:"inline-flex",verticalAlign:"middle",marginLeft:6,color:"#868e96",cursor:"pointer",fontSize:14},children:e.jsx(En,{size:17,strokeWidth:1.75,"aria-hidden":"true"})})})]}),attrName:"isBlocking"}),t.node.attrs.interactiveInputShowAll&&!!((A=t.node.attrs)!=null&&A.interactiveAdvancedEngagement)&&e.jsxs(e.Fragment,{children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"12px"},children:[e.jsx(Ve,{checked:t.node.attrs.markCompleteOnNext,onChange:v=>{n.commands.updateAttributes(c,{markCompleteOnNext:v.currentTarget.checked}),i()},size:"md"}),e.jsxs(N,{style:{fontSize:"13px",fontWeight:500},children:["Mark space complete on Next",e.jsx(vt,{label:"This space will be marked complete after the person clicks next if the discussion prompt is the last element on the page.",multiline:!0,styles:{tooltip:{width:220}},withArrow:!0,position:"top",zIndex:999999,children:e.jsx(En,{size:17,strokeWidth:1.75,style:{color:"#868e96",cursor:"pointer",fontSize:14,verticalAlign:"middle",marginLeft:6}})})]})]}),e.jsx(Dm,{node:t,onSaveNodeData:i})]}),e.jsx(Bt,{saveNodeData:v=>{n.commands.updateAttributes(c,{autoTagAI:!!v}),i()},element:t,attrLabel:e.jsx(tn,{description:"Automatically add tags to new responses using the tagging options below.",children:"Auto tag messages"}),attrName:"autoTag"}),t.node.attrs.autoTag&&e.jsxs(p,{style:{borderLeft:"2px solid #e9ecef",marginTop:"4px",marginLeft:"14px",paddingLeft:"12px"},children:[e.jsx(Bt,{saveNodeData:v=>{n.commands.updateAttributes(c,{autoTagAI:!1}),i()},element:t,attrLabel:e.jsx(tn,{description:"Add every tag selected below to each new response.",children:"Apply ALL tags to every new message as it is posted"}),attrName:"autoTagMessage"}),e.jsx(Bt,{saveNodeData:v=>{n.commands.updateAttributes(c,{autoTagMessage:!1}),i()},element:t,attrLabel:e.jsx(tn,{description:"Use AI to choose relevant tags for each new response from the tags selected below.",children:"Intelligently tag new messages with AI using the selection of created tags"}),attrName:"autoTagAI"}),e.jsx($m,{element:t,tags:o}),e.jsx(p,{style:{display:"flex",flexDirection:"column",gap:"6px",marginTop:"12px"},children:[{title:"Generate tags",onClick:a,label:"Automatically generate tag recommendations based on existing messages"},{title:"Apply to all",onClick:f,label:"Apply the selected tags to ALL messages in this discussion prompt"},{title:"Categorize all",onClick:d,label:"Automatically categorize all messages in this discussion prompt"},{title:"Clear all tags",onClick:h,label:"Remove ALL tags from ALL messages in this discussion prompt"}].map((v,k)=>e.jsx(vt,{label:v.label,withArrow:!0,multiline:!0,styles:{tooltip:{width:220}},zIndex:999999,children:e.jsx(We,{fullWidth:!0,radius:"xl",size:"xs",variant:"outline",onClick:C=>v.onClick(C),className:xo.outlineBtn,children:v.title})},k))})]}),e.jsx(Bt,{saveNodeData:i,element:t,attrLabel:e.jsx(tn,{description:"Notify managers and moderators when a new response is posted to this prompt.",children:s("tiptap.components.sideConfigurationsMenu.attrLabel7")}),attrName:"interactiveInputNotificationOnEachPost"}),e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"4px",marginTop:"10px"},children:[e.jsx(p,{style:{display:"flex",alignItems:"center",gap:"6px"},children:e.jsxs(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:["Email notifications for participants",e.jsx(vt,{label:"Controls what email notifications participants receive for new posts. Managers and moderators receive the full digest when 'Notify managers on each new post' is enabled, regardless of this setting.",multiline:!0,styles:{tooltip:{width:260}},withArrow:!0,position:"top",zIndex:999999,children:e.jsx(En,{size:17,strokeWidth:1.75,style:{color:"#868e96",cursor:"pointer",fontSize:14,verticalAlign:"middle",marginLeft:6}})})]})}),e.jsx(Ue,{value:t.node.attrs.interactiveEmailMode||"digest",onChange:v=>{n.commands.updateAttributes(c,{interactiveEmailMode:v.target.value}),i()},size:"xs",data:[{value:"digest",label:"Send digest of all posts"},{value:"highlights",label:"Send AI-curated highlights"},{value:"none",label:"No emails (bell notifications only)"}],classNames:{input:xo.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]}),e.jsx(vt,{label:"Copy this prompt's settings (Show All, AI highlights, notifications, email mode, blocking, etc.) to every other discussion prompt on this page.",multiline:!0,styles:{tooltip:{width:260}},withArrow:!0,position:"top",zIndex:999999,children:e.jsx(We,{fullWidth:!0,radius:"xl",size:"xs",variant:m?"filled":"outline",mt:16,onClick:w,className:m?xo.appliedBtn:xo.outlineBtn,"aria-live":"polite",children:m?"Settings applied":"Ap
2ply settings to all prompts on this page"})})]})]})}const Hm="_trimVideoBtn_1m107_1",Um="_surveyActionButton_1m107_9",Hs={trimVideoBtn:Hm,surveyActionButton:Um},Vm="_focusInput_zbitd_1",Km={focusInput:Vm};function Gm(t){qc();const n=l.useRef(null),o=l.useRef(!1),s=ee(c=>c.tiptap),[r,i]=l.useState("link");return l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&o.current!=t.element.node.attrs.uid)return;t.element;const c=r;let u=!1;c&&(u=!0,s.editor.commands.updateAttributes(t.element.node.type.name,{viewAs:c})),u&&(n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,r&&t.saveNodeData()},2e3))},[r]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.viewAs){o.current=null;const c=t.element.node.attrs.uid;setTimeout(()=>{o.current=c},0),i(t.element.node.attrs.viewAs)}},[t.element]),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"80px"},children:"Display as"}),e.jsx(Ue,{value:r,onChange:c=>i(c.target.value),placeholder:"Select a display option",size:"xs",style:{flex:1},data:[{value:"list",label:"List item"},{value:"vcard",label:"Vertical card"},{value:"hcard",label:"Horizontal card"},{value:"button",label:"Button"},{value:"link",label:"Link"}],classNames:{input:Km.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]})}const Ym="_outlineButton_71ldh_1",qm="_textInput_71ldh_6",Xm="_switchSection_71ldh_16",Zm="_switchRow_71ldh_25",Qm="_switchRoot_71ldh_32",Jm="_switchBody_71ldh_36",eb="_switchLabelWrapper_71ldh_40",tb="_switchTrack_71ldh_44",nb="_switchThumb_71ldh_48",ob="_switchText_71ldh_52",Mt={outlineButton:Ym,textInput:qm,switchSection:Xm,switchRow:Zm,switchRoot:Qm,switchBody:Jm,switchLabelWrapper:eb,switchTrack:tb,switchThumb:nb,switchText:ob},sb=t=>{const[n,o]=l.useState(0);return rr(s=>{o(s.completed)}),ir(s=>{var i,c;const r=(c=(i=s.uploadResponse)==null?void 0:i.data)==null?void 0:c.url;if(!r){o(0),Ct.fire("","Failed to upload image","error");return}t.onUploadCallback(r)}),vd(s=>{var i,c;o(0);const r=((c=(i=s.uploadResponse)==null?void 0:i.data)==null?void 0:c.error)||"Failed to upload image";Ct.fire("",r,"error")}),e.jsx(e.Fragment,{children:n>0&&n<=100?e.jsx(yi,{color:"green",size:"xl",mb:10,value:n}):""})},rb=ls(t=>{const{t:n}=Qt();return e.jsx(We,{variant:"outline",radius:"xl",size:"xs",leftSection:e.jsx(Qe,{size:"sm",icon:Jo.faImage}),fullWidth:!0,style:{borderColor:"#e0e0e0",color:"#555"},className:Mt.outlineButton,...t,styles:{root:{paddingInlineStart:"var(--button-padding-x)"}},children:window.$uploadMethodSidebutton=="header"?n("tiptap.components.sidebar.spaceAttrs.addCover"):"Add thumbnail"})}),ib={fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"80px"},sc={input:Mt.textInput},rc={root:Mt.switchRoot,body:Mt.switchBody,labelWrapper:Mt.switchLabelWrapper,track:Mt.switchTrack,thumb:Mt.switchThumb},lb=t=>t===!0||t==="true";function ab(t){var Y,H,D,ne,Ie,Ke,Oe,Ce,Re;const{t:n}=Qt(),o=Qn(),s=ee(xe=>xe.tiptap),r=t.editor||(s==null?void 0:s.editor),i="https://api.sutra.co",[c,u]=l.useState(),[a,f]=l.useState(""),[d,h]=l.useState(""),[m,x]=l.useState(!0),[g,w]=l.useState([]),[b,j]=l.useState([]),[A,v]=l.useState("header"),[k,C]=l.useState(!1),[I,_]=l.useState(!1),R=(D=(H=(Y=t.element)==null?void 0:Y.node)==null?void 0:H.attrs)==null?void 0:D.id,F=((Ke=(Ie=(ne=t.element)==null?void 0:ne.node)==null?void 0:Ie.attrs)==null?void 0:Ke.viewAs)||"",G=F=="vcard"||F=="hcard",T=l.useRef(),L=l.useRef(null),S=l.useRef(null);l.useEffect(()=>{if(!F)return;const xe=F.indexOf("card")>=0?"gallery_feature":"header";v(xe),window.$uploadMethodSidebutton=xe},[F]),l.useEffect(()=>{var xe,Ee,ht;_(lb((ht=(Ee=(xe=t.element)==null?void 0:xe.node)==null?void 0:Ee.attrs)==null?void 0:ht.hideTitleWithThumbnail))},[(Re=(Ce=(Oe=t.element)==null?void 0:Oe.node)==null?void 0:Ce.attrs)==null?void 0:Re.hideTitleWithThumbnail]),l.useEffect(()=>{if(R)return x(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{W(R)},500),()=>{T.current&&clearTimeout(T.current)}},[R]);const W=(xe=R)=>{xe&&sn.onFetch({id:xe,include:["members"]},Ee=>{var ht;u({...Ee.space,permissions:{...Ee.permissions},colors:{...Ee.colors}}),w(Ee.permissions&&Ee.permissions.can_upload_cover),f(Ee.space.name),h(Ee.abstract),C(!!(Ee!=null&&Ee.show_page_icon||(ht=Ee.space)!=null&&ht.show_page_icon)),x(!1)},Ee=>{})},E=xe=>{const Ee={...c};Ee[A].url=xe,u(Ee),O()},P=()=>{A=="header"?sn.onRemoveHeader(c.slug,xe=>{E(null),O()},xe=>{}
2):sn.onRemoveThumbnail(c.slug,xe=>{E(null),O()},xe=>{})},$=xe=>{f(xe),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{L.current=null,B({intention:xe})},1e3)},X=xe=>{B({abstract_text:xe})},q=xe=>{C(xe),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{L.current=null,B({show_page_icon:xe})},100)},Q=xe=>{var Ee,ht,Tt;_(xe),r&&((Tt=(ht=(Ee=t.element)==null?void 0:Ee.node)==null?void 0:ht.type)!=null&&Tt.name)&&(be(r,t.element,{hideTitleWithThumbnail:xe})||r.commands.updateAttributes(t.element.node.type.name,{hideTitleWithThumbnail:xe})),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{S.current=null,typeof t.saveNodeData=="function"&&t.saveNodeData()},100)},B=xe=>{sn.onUpdate(c.slug,xe,Ee=>{O()},Ee=>{})},O=()=>{o(Aa({slug:c.slug})),setTimeout(()=>{o(Aa({slug:c.slug}))},500)},K=yd(X,1e3);return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px",marginTop:"12px"},children:[c&&c.slug&&e.jsxs(e.Fragment,{children:[t.element&&t.element.node&&t.element.node.attrs.viewAs!="link"&&t.element.node.attrs.viewAs!="button"&&e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:ib,children:n("spaces.form.form.intention.label")}),e.jsx(at,{disabled:m,value:a,onChange:xe=>$(xe.currentTarget.value),size:"xs",style:{flex:1},classNames:sc})]}),t.element&&t.element.node&&t.element.node.attrs.viewAs.indexOf("card")>=0&&e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:n("spaces.form.form.abstract.label")}),e.jsx(rn,{value:d,onChange:xe=>{h(xe.currentTarget.value),K(xe.currentTarget.value)},size:"xs",autosize:!0,minRows:2,maxRows:5,classNames:sc})]})]}),t.element&&t.element.node&&t.element.node.attrs.viewAs!="link"&&t.element.node.attrs.viewAs!="button"&&(c&&c[A]&&!c[A].url?g[0]?e.jsxs(Co,{withCredentials:!0,destination:{url:`${i}/api/v4/spaces/${c.slug}/upload_${A=="header"?"header":"thumbnail"}`,headers:To()},accept:"image/*",fileFilter:xe=>xe.size>Gs?(Ct.fire("",`File is too large. Maximum size is ${Vc(Gs)}.`,"error"),!1):!0,children:[e.jsx(sb,{onUploadCallback:E}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(rb,{uploadMethod:A}),e.jsx(vt,{label:n(A=="header"?"tiptap.components.sidebar.spaceAttrs.text2":"tiptap.components.sidebar.spaceAttrs.textThumb"),multiline:!0,styles:{tooltip:{width:220}},withArrow:!0,position:"top",zIndex:999999,children:e.jsx(Qe,{icon:Bs.faCircleQuestion,style:{color:"#868e96",cursor:"pointer",fontSize:14}})})]})]}):e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(We,{variant:"outline",radius:"xl",size:"xs",fullWidth:!0,leftSection:e.jsx(Qe,{size:"sm",icon:Jo.faImage}),onClick:()=>j([!0,g[1],g[2]]),style:{borderColor:"#e0e0e0",color:"#555"},className:Mt.outlineButton,styles:{root:{paddingInlineStart:"var(--button-padding-x)"}},children:A=="header"?n("tiptap.components.sidebar.spaceAttrs.addCover2"):"Add thumbnail"}),e.jsx(vt,{label:n(A=="header"?"tiptap.components.sidebar.spaceAttrs.text2":"tiptap.components.sidebar.spaceAttrs.textThumb"),multiline:!0,styles:{tooltip:{width:220}},withArrow:!0,position:"top",zIndex:999999,children:e.jsx(Qe,{icon:Bs.faCircleQuestion,style:{color:"#868e96",cursor:"pointer",fontSize:14}})})]}):e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[c&&c[A]&&c[A].url&&e.jsx(Yo,{src:c[A].url,radius:"md"}),e.jsx(We,{disabled:m,variant:"outline",radius:"xl",size:"xs",leftSection:e.jsx(Qe,{size:"sm",icon:Jo.faImage}),onClick:()=>P(),style:{borderColor:"#e0e0e0",color:"#868e96"},className:Mt.outlineButton,children:A=="header"?n("tiptap.components.sidebar.spaceAttrs.removeCover"):"Remove thumbnail"})]})),t.children,!!c&&e.jsxs(p,{className:Mt.switchSection,children:[G&&e.jsxs(p,{className:Mt.switchRow,children:[e.jsx(Ve,{checked:I,onChange:xe=>Q(xe.currentTarget.checked),size:"sm",color:"sutrablue",classNames:rc}),e.jsx(N,{className:Mt.switchText,children:"Hide title text"}),e.jsx(vt,{label:"The space title will be hidden if a thumbnail is present.",multiline:!0,styles:{tooltip:{width:220}},withArrow:!0,position:"top",zIndex:999999,children:e.jsx(Qe,{icon:Bs.faCircleQuestion,style:{color:"#868e96",cursor:"pointer",fontSize:14}})})]}),e.jsxs(p,{className:Mt.switchRow,children:[e.jsx(Ve,{checked:k,onChange:xe=>q(xe.currentTarget.checked),size:"sm",color:"sutrablue",classNames:rc}),e.jsx(N,{className:Mt.switchText,children:"Show space icon on title"}),e.jsx(vt,{label:"The sidebar icon will be displayed next to the title on this page.",multiline:!0,styles:{tooltip:{width:220}},withArrow:!0,position:"top",zIndex:999999,children:e.jsx(Qe,{icon:Bs.faCircleQuestion,style:{color:"#868e96",cursor:"pointer",fontSize:14}})})]})]}),e.jsx(df,{opened:b,setOpened:j})]})}function cb(t){const n=ee(X=>
2X.tiptap),o=ee(X=>X.space),s=l.useRef(null),r=l.useRef(!1),i=l.useRef(!1),c=l.useRef(null),u=l.useRef([]),[a,f]=l.useState(!1),[d,h]=l.useState([]),[m,x]=l.useState([]),[g,w]=l.useState([]),[b,j]=l.useState([]),[A,v]=l.useState(!1),[k,C]=l.useState(!1),[I,_]=l.useState(!1),[R,F]=l.useState(!1),[G,T]=l.useState(!1),[L,S]=l.useState("5");l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&r.current!=t.element.node.attrs.uid)return;let X=!0;t.element.node.attrs.id!=m&&(X=!0,n.editor.commands.updateAttributes(t.element.node.type.name,{id:m}),c.current=null,P()),t.element.node.attrs.tagsFeedShowAll!=A&&n.editor.commands.updateAttributes(t.element.node.type.name,{tagsFeedShowAll:A}),t.element.node.attrs.tagsShowUser!=k&&n.editor.commands.updateAttributes(t.element.node.type.name,{tagsShowUser:k}),t.element.node.attrs.tagsDate!=I&&n.editor.commands.updateAttributes(t.element.node.type.name,{tagsDate:I}),t.element.node.attrs.tagsShowMessageActions!=R&&n.editor.commands.updateAttributes(t.element.node.type.name,{tagsShowMessageActions:R}),t.element.node.attrs.tagsShowMTagsOnEachMessage!=G&&n.editor.commands.updateAttributes(t.element.node.type.name,{tagsShowMTagsOnEachMessage:G}),t.element.node.attrs.tagsNumberOfPosts!=L&&n.editor.commands.updateAttributes(t.element.node.type.name,{tagsNumberOfPosts:L}),n.editor.commands.updateAttributes(t.element.node.type.name,{tags:g}),X&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,m&&(window.$reloadTagsFeed=m,t.saveNodeData())},2e3))},[m,A,k,I,g,R,G,L]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.styles){r.current=null;const X=t.element.node.attrs.uid;setTimeout(()=>{r.current=X},0),t.element.node.attrs.id instanceof Array?x(t.element.node.attrs.id):t.element.node.attrs.id instanceof String?x([t.element.node.attrs.id]):x([]),w(t.element.node.attrs.tags),v(t.element.node.attrs.tagsFeedShowAll),C(t.element.node.attrs.tagsShowUser),_(t.element.node.attrs.tagsDate),F(t.element.node.attrs.tagsShowMessageActions),T(t.element.node.attrs.tagsShowMTagsOnEachMessage),S(t.element.node.attrs.tagsNumberOfPosts),c.current=null,P(),E()}},[t.element]);const W=X=>{f(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{E(X),f(!1)},1e3)},E=(X=null)=>{sn.onFetchSpacesList({scope:"all_managed_discussions",term:X},q=>{if(Array.isArray(q)){const Q=q.map(B=>({value:B.slug,label:`${B.name} (${B.slug})`}));sn.onFetchAllCurrentSpaces({slug:o.slug,term:X},B=>{if(Array.isArray(B.data)){const O=B.data.map(Y=>({value:Y.slug,label:`${Y.intention} (${Y.slug})`})),K=$(O,Q,"value");h(K)}else h(Q)},B=>{h(Q)})}},q=>{})},P=()=>{c.current==null?c.current=0:c.current++;try{const X=t.element.node.attrs.id[c.current];if(!X)return;Kc.onFetch(X,q=>{u.current=$(u.current,q,"value"),j([...u.current]),P()},q=>{})}catch{}},$=(X,q,Q)=>{const B={};return X.forEach(K=>{B[K[Q]]=K}),q.forEach(K=>{B[K[Q]]=K}),Object.values(B)};return e.jsxs(Fe,{mt:20,children:[e.jsx(qr,{comboboxProps:{zIndex:99999},leftSection:a?e.jsx(es,{size:"xs"}):e.jsx(Qe,{icon:Xs.faSearch}),searchable:!0,limit:100,mt:L,data:d,onChange:X=>x(X),label:"Fetch tag messages from",placeholder:"Search by name or slug",description:"Select a chat or discussion prompt to fetch the messages from",value:m,onSearchChange:X=>W(X),styles:{description:{fontWeight:600},label:{whiteSpace:"normal"},defaultValue:{height:"unset"}}}),e.jsx(qr,{searchable:!0,value:g,onChange:w,data:b,comboboxProps:{zIndex:99999},label:"Select the tags to filter messages",placeholder:"Search tag",description:"Select tags to filter the messages in the feed",styles:{label:{whiteSpace:"normal"},defaultValue:{height:"unset"}}}),e.jsx(Ve,{checked:A,onChange:X=>v(X.target.checked),label:"Show posts from current user only",placeholder:"Toggle to show posts from current user only"}),e.jsx(Ve,{checked:k,onChange:X=>C(X.target.checked),label:"Show message username and avatar",placeholder:"Toggle to show the user username and avatar on each message"}),e.jsx(Ve,{checked:I,onChange:X=>_(X.target.checked),label:"Show message posted date",placeholder:"Toggle to show the date when the messages was posted"}),e.jsx(Ve,{checked:R,onChange:X=>F(X.target.checked),label:"Show message actions",placeholder:"Toggle to show actions for each message"}),e.jsx(Ve,{checked:G,onChange:X=>T(X.target.checked),label:"Show message tags",placeholder:"Toggle to show the tags of each  message"}),e.jsx(jt,{comboboxProps:{zIndex:99999},mt:5,data:[{value:"5",label:"5 posts"},{value:"10",label:"10 posts"},{value:"25",label:"25 posts"}],onChange:X=>S(X),label:"Number of posts",placeholder:"Select a number",description:"Select the number of post that will load initially",value:L,styles:{description:{fontWeight:600}}})]})}function ub(t){const n=l.useRef(null),o=l.useRef(!1),s=ee(a=>a.tiptap),[r,i]=l.useState("link");l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&o.current!=t.element.node.attrs.uid)return;const a=r;let f=!1;a&&(f=!0,a=="card"?u():s.editor.chain().updateAttributes(t.element.node.type.n
2ame,{viewAs:a}).setTextAlign("left").run()),f&&(n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,r&&t.saveNodeData()},2e3))},[r]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.viewAs){o.current=null;const a=t.element.node.attrs.uid;setTimeout(()=>{o.current=a},0),i(t.element.node.attrs.viewAs)}},[t.element]);const c=a=>{const f=a.match(/\/(\d+)\?h=(\w+)/);if(f&&f.length===3){const d=f[1],h=f[2];return`https://vimeo.com/${d}/${h}`}return a},u=()=>{if(t.element.node.type.name=="embed"){let a="",f=t.element.node.attrs.videoId;t.element.node.attrs.src.indexOf("youtube")>=0?a=`https://www.youtube.com/watch?v=${f}`:t.element.node.attrs.src.indexOf("vimeo")>=0?(f=t.element.node.attrs.src.split("/").pop(),a=c(`https://vimeo.com/${f}`)):t.element.node.attrs.src.indexOf("loom")>=0&&(f=t.element.node.attrs.src.split("/").pop(),a=`https://www.loom.com/share/${f}`),sn.onFetchLink(a,d=>{s.editor.chain().updateAttributes(t.element.node.type.name,{viewAs:"card",link:{url:a,target:"_modal",title:d.data.title,description:d.data.description,image:{url:d.data.image.url}}}).setTextAlign("left").run()},()=>{s.editor.chain().updateAttributes(t.element.node.type.name,{viewAs:"card",link:{url:a,target:"_modal",title:"Embeded video",description:"",image:{url:null}}}).setTextAlign("left").run()})}else{const a=t.element.node.attrs,f=a.link||{},d=jd(a,{includeFallback:!1}),h=typeof f.title=="string"&&f.title.trim()?f.title:"Direct upload";s.editor.chain().updateAttributes(t.element.node.type.name,{viewAs:"card",link:{...f,url:a.src,target:"_modal",title:h,description:f.description||"",thumbnail:{...f.thumbnail||{},url:d}}}).setTextAlign("left").run()}};return e.jsxs(Fe,{gap:6,children:[e.jsxs(ye,{justify:"space-between",align:"center",gap:8,wrap:"nowrap",children:[e.jsx(N,{style:{fontSize:14,fontWeight:400,color:"#000",lineHeight:1.35},children:"Display as"}),t.embedCodeMenu]}),e.jsx(Ue,{value:r,onChange:a=>i(a.target.value),placeholder:"Select a display option",data:[{value:"inline",label:"Embed"},{value:"embed-popup",label:"Embed + pop up"},{value:"card",label:"Card"}]})]})}const db="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",fb=t=>String(t||"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function hb(t){if(!t||typeof t!="string")return!1;try{const n=new URL(t.trim());return n.hostname==="adilo.bigcommand.com"&&n.pathname.startsWith("/watch/")}catch{return!1}}function pb(t){const n=typeof t=="string"?t.trim():"";if(!n)return"";const o=fb(n);return hb(n)?`<div style="width:100%;position:relative;padding-top:56.25%;">
3  <iframe src="${o}" style="position:absolute;top:0;left:0;width:100%;height:100%;" frameborder="0" scrolling="no" allowfullscreen></iframe>
4</div>`:`<iframe src="${o}" style="width:100%;height:320px;" frameborder="0" allow="${db}" allowfullscreen></iframe>`}function xb(t={}){const n=typeof t.originalEmbedCode=="string"?t.originalEmbedCode.trim():"";return n?{code:n,isGenerated:!1}:{code:pb(t.src),isGenerated:!0}}const gb="_trigger_tviws_1",mb={trigger:gb},bb=t=>{if(navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(t);const n=document.createElement("textarea");return n.value=t,n.style.position="fixed",n.style.left="-9999px",n.style.top="-9999px",document.body.appendChild(n),n.focus(),n.select(),new Promise((o,s)=>{try{const r=document.execCommand("copy");document.body.removeChild(n),r?o():s(new Error("Copy command failed"))}catch(r){document.body.removeChild(n),s(r)}})};function ic({element:t}){var c;const n=((c=t==null?void 0:t.node)==null?void 0:c.attrs)||{},{code:o}=xb(n),[s,r]=l.useState(!1);if(l.useEffect(()=>{if(!s)return;const u=setTimeout(()=>r(!1),1600);return()=>clearTimeout(u)},[s]),!o)return null;const i=()=>{bb(o).then(()=>r(!0)).catch(()=>r(!1))};return e.jsxs(As,{position:"bottom-end",offset:4,width:165,withinPortal:!1,trapFocus:!1,closeOnItemClick:!1,styles:{item:{padding:"7px 10px"}},children:[e.jsx(As.Target,{children:e.jsx(Fs,{variant:"transparent",size:"sm","aria-label":"Embed code options",className:mb.trigger,children:e.jsx(Qe,{icon:Cf.faEllipsis,style:{fontSize:13}})})}),e.jsx(As.Dropdown,{children:e.jsx(As.Item,{leftSection:e.jsx(Qe,{icon:s?hf.faCheck:kd.faCopy,style:{color:s?"#2b8a3e":"#868e96"}}),onClick:i,children:e.jsx(N,{style:{fontSize:12,color:s?"#2b8a3e":"#868e96"},children:s?"Embed code copied to clipboard":"Copy Embed Code"})})})]})}function yb({element:t,saveNodeData:n}){const o=l.useRef(null),s=l.useRef(!1),{t:r}=Qt(),i=ee(f=>f.tiptap),c=i==null?void 0:i.editor,[u,a]=l.useState("");return l.useEffect(()=>{if(!t||!t.node.attrs||t&&t.node.attrs&&s.current!=t.node.attrs.uid||!c||t
4ypeof u!="string"||u===(t.node.attrs.name||""))return;be(c,t,{name:u})||c.commands.updateAttributes(t.node.type.name,{name:u}),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{o.current=null,n()},2e3)},[u,t,c,n]),l.useEffect(()=>{if(t&&t.node.attrs.styles){s.current=null;const f=t.node.attrs.uid;setTimeout(()=>{s.current=f},0),a(t.node.attrs.name||"")}},[t]),e.jsx(Fe,{mt:20,children:e.jsx(at,{value:u,onChange:f=>a(f.currentTarget.value),placeholder:r("tiptap.components.sidebar.fileName.placeholder"),label:r("tiptap.components.sidebar.fileName.label"),styles:{label:{fontWeight:400,color:"#000"}}})})}const vb=15*1024*1024;function jb({element:t,saveNodeData:n}){const o=l.useRef(null),s=l.useRef(!1),r=ee(a=>a.tiptap),i=r==null?void 0:r.editor,[c,u]=l.useState("link");return l.useEffect(()=>{if(!t||!t.node.attrs||t&&t.node.attrs&&s.current!=t.node.attrs.uid)return;const a=c;let f=!1;i&&a&&a!==(t.node.attrs.displayAs||"link")&&(f=!0,be(i,t,{displayAs:a})||i.commands.updateAttributes(t.node.type.name,{displayAs:a})),f&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{o.current=null,c&&n()},2e3))},[c,t,i,n]),l.useEffect(()=>{if(t&&t.node.attrs){s.current=null;const a=t.node.attrs.uid;setTimeout(()=>{s.current=a},0),u(t.node.attrs.displayAs||"link")}},[t]),e.jsx(Fe,{children:e.jsx(Ue,{value:c,onChange:a=>{var h,m;const f=a.target.value,d=((m=(h=t==null?void 0:t.node)==null?void 0:h.attrs)==null?void 0:m.size)||0;if(f==="embed"&&d>vb){Ct.fire({text:"This PDF is too large to display as an embed. Only files up to 15mb are supported.",icon:"warning"});return}u(f)},label:"Display as",placeholder:"Select PDF display option",data:[{value:"link",label:"Download link"},{value:"embed",label:"Embedded PDF"}],styles:{label:{fontWeight:400,color:"#000"}}})})}function lc(t){const n=l.useRef(null),o=l.useRef(!1),s=ee(c=>c.tiptap),[r,i]=l.useState("");return l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&o.current!=t.element.node.attrs.uid)return;const c=t.element;typeof r=="string"&&r!==c.node.attrs.link.title&&(s.editor.commands.updateAttributes(t.element.node.type.name,{link:{url:t.element.node.attrs.link.url,target:t.element.node.attrs.link.target,title:r,description:t.element.node.attrs.link.description,image:{...t.element.node.attrs.link.image},thumbnail:{...t.element.node.attrs.link.thumbnail}}}),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t.saveNodeData()},2e3))},[r]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.styles){o.current=null;const c=t.element.node.attrs.uid;setTimeout(()=>{o.current=c},0),i(t.element.node.attrs.link.title)}},[t.element]),e.jsx(Fe,{mt:20,children:e.jsx(at,{value:r,onChange:c=>i(c.currentTarget.value),placeholder:"Title",label:"Card title",styles:{label:{fontWeight:400,color:"#000"}}})})}function ac(t){const n=l.useRef(null),{t:o,i18n:s}=Qt(),r=l.useRef(!1),i=ee(a=>a.tiptap),[c,u]=l.useState("");return l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&r.current!=t.element.node.attrs.uid)return;const a=t.element;typeof c=="string"&&c!==a.node.attrs.link.description&&(i.editor.commands.updateAttributes(t.element.node.type.name,{link:{url:t.element.node.attrs.link.url,target:t.element.node.attrs.link.target,title:t.element.node.attrs.link.title,description:c,image:{...t.element.node.attrs.link.image},thumbnail:{...t.element.node.attrs.link.thumbnail}}}),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t.saveNodeData()},2e3))},[c]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.styles){r.current=null;const a=t.element.node.attrs.uid;setTimeout(()=>{r.current=a},0),u(t.element.node.attrs.link.description)}},[t.element]),e.jsx(Fe,{mt:20,children:e.jsx(rn,{value:c,onChange:a=>u(a.currentTarget.value),placeholder:"Description",label:"Card description",styles:{label:{fontWeight:400,color:"#000"}}})})}const kb=1920,wb=.9,Cb="jpeg",Sb=.95,Tb=4;function Ib(t){const n=/^data:([^;,]+)/.exec(typeof t=="string"?t:"");return n?n[1].trim().toLowerCase():""}function _b(t){return t.trim().replace(/\s+/g," ").replace(/[^0-9A-Za-z.-]/g,"_").slice(0,255)}function Ab(t,n="image/jpeg"){const o=String(t).split(",")[1]||"",s=window.atob(o),r=new 
4Uint8Array(s.length);for(let i=0;i<s.length;i++)r[i]=s.charCodeAt(i);return new Blob([r],{type:n})}async function Bb(t){const n=(t==null?void 0:t.imageBase64)||"",o=Ib(n)||(t==null?void 0:t.mimeType)||"image/jpeg",s=_b((t==null?void 0:t.fullName)||"thumbnail.jpg"),r=new File([Ab(n,o)],s,{type:o});return wd(r,{maxWidth:kb,quality:wb})}function kr(t){l.useRef(null);const n=l.useRef(!1),o=t.compact?4:20,s=ee(v=>v.tiptap),[r,i]=l.useState(),[c,u]=l.useState(!1),a=l.useRef(),f=l.useRef(),[d,h]=l.useState(null),m=l.useCallback(async()=>{if(d)return d;try{const v=await Sf(()=>import("./index-BXnjdIrS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24])),k={Component:v.default,TABS:v.TABS,TOOLS:v.TOOLS};return h(k),k}catch{return null}},[d]);l.useEffect(()=>{!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&n.current!=t.element.node.attrs.uid||s.editor.commands.updateAttributes(t.element.node.type.name,{link:{...t.element.node.attrs.link,thumbnail:{url:r}}})},[r]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.styles){n.current=null;const v=t.element.node.attrs.uid;setTimeout(()=>{n.current=v},0),t.element.node.attrs.link.thumbnail&&i(t.element.node.attrs.link.thumbnail.url)}},[t.element]);const x=async v=>{try{const k=await Bb(v),C=await of(k);i(C),w()}catch(k){console.error("Error uploading thumbnail to S3",k),Ct.fire("","Failed to upload image","error")}},g=()=>{m(),u(!0)},w=()=>{u(!1),f.current&&(f.current.value="")},b=v=>{try{v.target.children[0].click()}catch{}},j=v=>{const k=v.target.files[0];if(A(k,v.target))if(a.current=document.createElement("img"),k){const C=new FileReader;C.addEventListener("load",function(){a.current.src=C.result,g()}),C.readAsDataURL(k)}else f.current&&(f.current.value="")},A=(v,k)=>v.size>Gs?(Ct.fire("",`Your image must be less than ${Vc(Gs)}`,"info"),k.value="",!1):!0;return e.jsxs(Fe,{mt:o,children:[r?e.jsxs(e.Fragment,{children:[e.jsx(Yo,{src:r,fallbackSrc:Cd}),e.jsx(Qd,{withCssVariables:!1,theme:{primaryShade:6},children:e.jsx(We,{mt:10,variant:"filled",color:"gray.6",radius:"xl",leftSection:e.jsx(Qe,{size:"sm",icon:Jo.faImage}),onClick:()=>i(""),children:"Remove thumbnail"})})]}):e.jsxs(We,{radius:"xl",fullWidth:!0,leftSection:e.jsx(Qe,{size:"sm",icon:Jo.faImage}),onClick:v=>b(v),styles:{root:{paddingInlineStart:"var(--button-padding-x)"}},children:[e.jsx("input",{ref:f,type:"file",style:{display:"none"},accept:"image/*",onChange:j}),"Change thumbnail"]}),e.jsx(Jd,{withCloseButton:!1,size:"xl",opened:c,onClose:()=>u(!1),title:"",zIndex:999999,children:(()=>{const v=d,k=v==null?void 0:v.Component,C=v==null?void 0:v.TABS,I=v==null?void 0:v.TOOLS;return!k||!C||!I?e.jsx(ef,{children:e.jsx(es,{})}):e.jsx(k,{source:a.current,onSave:(_,R)=>x(_),onClose:w,Rotate:{angle:90,componentType:"slider"},Crop:{ratio:160/120,ratioTitleKey:"Thumbnail",noPresets:!0,autoResize:!0},defaultSavedImageType:Cb,defaultSavedImageQuality:Sb,savingPixelRatio:Tb,backgroundColor:"#ffffff",defaultSavedImageName:"thumb",tabsIds:[C.ADJUST],defaultTabId:C.ADJUST,defaultToolId:I.TEXT,onBeforeSave:()=>!1,confirmationModalZIndex:9999999})})()})]})}function Rb(t){const{compact:n,editor:o,element:s,label:r,labelWidth:i,saveNodeData:c}=t,u=l.useRef(null),a=l.useRef(!1),f=ee(x=>x.tiptap),d=o||(f==null?void 0:f.editor),[h,m]=l.useState();return l.useEffect(()=>{if(!s||!s.node.attrs||s&&s.node.attrs&&a.current!=s.node.attrs.uid)return;const x=s,g=h;typeof g=="string"&&g!==(x.node.attrs.blockTitle||"")&&(d&&(be(d,s,{blockTitle:h})||d.commands.updateAttributes(s.node.type.name,{blockTitle:h})),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,c==null||c()},2e3))},[d,s,c,h]),l.useEffect(()=>{if(s&&s.node.attrs.styles){a.current=null;const x=s.node.attrs.uid;setTimeout(()=>{a.current=x},0),m(s.node.attrs.blockTitle)}},[s]),n?e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:i||"50px"},children:r||"Label"}),e.jsx(at,{value:h||"",onChange:x=>m(x.currentTarget.value),size:"xs",style:{flex:1},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]}):e.jsx(p,{mt:10,children:e.jsx(at,{value:h||"",onChange:x=>m(x.currentTarget.value),label:r||"Label",styles:{label:{fontWeight:400,color:"#000"}}})})}
4const Eb="_outerWrap_i8k5z_1",zb="_urlRow_i8k5z_8",Lb="_openRow_i8k5z_14",Pb="_toggleGroup_i8k5z_20",Wb="_toggleBtn_i8k5z_26",Ob="_toggleBtnInactive_i8k5z_39",Mb="_toggleBtnActive_i8k5z_48",Nb="_focusInput_i8k5z_53",Gt={outerWrap:Eb,urlRow:zb,openRow:Lb,toggleGroup:Pb,toggleBtn:Wb,toggleBtnInactive:Ob,toggleBtnActive:Mb,focusInput:Nb};function $b(t){const n=l.useRef(null),o=l.useRef(!1),s=ee(a=>a.tiptap),[r,i]=l.useState(""),[c,u]=l.useState("_current");return l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&o.current!=t.element.node.attrs.uid)return;const a=r,f=c,d={...t.element.node.attrs.link},h=/^(https?:\/\/|mailto:|tel:)/i.test(a),m=a?h?a:`https://${a}`:null,x=m?f:null,g=m!==(d.url||null)||x!==(d.target||null);g&&s.editor.commands.updateAttributes(t.element.node.type.name,{link:{...d,url:m,target:x}}),g&&(n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t.saveNodeData()},2e3))},[r,c]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.link){o.current=null;const a=t.element.node.attrs.uid;setTimeout(()=>{o.current=a},0),i(t.element.node.attrs.link.url),u(t.element.node.attrs.link.target)}},[t.element]),e.jsxs("div",{className:Gt.outerWrap,children:[e.jsxs("div",{className:Gt.urlRow,children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"42px"},children:"URL"}),e.jsx(at,{value:r||"",onChange:a=>i(a.currentTarget.value),placeholder:"https://",size:"xs",style:{flex:1},classNames:{input:Gt.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]}),t.context!=="broadcast"&&e.jsxs("div",{className:Gt.openRow,children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"42px"},children:"Open"}),e.jsxs("div",{className:Gt.toggleGroup,children:[e.jsx("div",{onClick:()=>u("_current"),className:`${Gt.toggleBtn} ${r&&c==="_current"?Gt.toggleBtnActive:Gt.toggleBtnInactive}`,children:"Same tab"}),e.jsx("div",{onClick:()=>u("_blank"),className:`${Gt.toggleBtn} ${r&&c==="_blank"?Gt.toggleBtnActive:Gt.toggleBtnInactive}`,children:"New tab"})]})]})]})}function Db({node:t,editor:n,onSaveNodeData:o}){var w,b,j,A;const s=Qn(),r=ee(v=>v.space),i=(r==null?void 0:r.slug)||((b=(w=t==null?void 0:t.node)==null?void 0:w.attrs)==null?void 0:b.circle_id)||window.$currentSlug,c=(A=(j=t==null?void 0:t.node)==null?void 0:j.attrs)!=null&&A.id?`${t.node.attrs.id}`:"",[u,a]=l.useState(c),[f,d]=l.useState([]);l.useEffect(()=>{a(c)},[c]),l.useEffect(()=>{i&&Vr.onFetch(i,{page:1,per:100},v=>{d(((v==null?void 0:v.data)||[]).map(k=>({value:`${k.id}`,label:k.title})))},()=>{})},[i]);const h=l.useMemo(()=>{const v=[{value:"new_survey",label:"Create a new survey or quiz"},...f];return u&&u!=="new_survey"&&!v.some(k=>k.value===u)&&v.push({value:u,label:`Current survey #${u}`}),v},[u,f]),m=(v={})=>{var k,C;return{context:"survey",targetUid:(C=(k=t==null?void 0:t.node)==null?void 0:k.attrs)==null?void 0:C.uid,targetPos:t==null?void 0:t.pos,...v}},x=v=>{if(v==="new_survey"){s(Yt({opened:"createSurvey",option:m(),editor:n}));return}if(a(v),!v||!n)return;be(n,t,{id:v,circle_id:i})&&typeof o=="function"&&o()},g=u&&u!=="new_survey"?{id:u}:null;return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsx(Rb,{saveNodeData:o,element:t,editor:n,compact:!0,label:"Label"}),e.jsxs(p,{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"50px",paddingTop:"6px"},children:"Survey"}),e.jsxs(p,{style:{flex:1,display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(Ue,{value:u||"new_survey",onChange:v=>x(v.currentTarget.value),size:"xs",data:h,styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}}),(!u||u==="new_survey")&&e.jsx(We,{variant:"filled",radius:"xl",size:"xs",className:Hs.surveyActionButton,onClick:()=>{s(Yt({opened:"createSurvey",option:m(),editor:n}))},children:"Create survey"}),g&&e.jsxs(p,{style:{display:"flex",gap:"6px"},children:[e.jsx(We,{variant:"filled",size:"compact-xs",radius:"xl",className:Hs.surveyActionButton,onClick:()=>{s(Yt({opened:"showSurvey",option:{survey:g}}))},children:"View responses"}),e.jsx(We,{variant:"filled",size:"compact-xs",radius:"xl",className:Hs.surveyActionButton,onClick:()=>{s(Yt({opened:"createSurvey",option:m({survey:g}),editor:n}))},children:"Edit survey"})]})]})]})]})}
4function Fb({node:t,editor:n}){var C,I,_,R,F,G,T;const o=ee(L=>L.space),s=((C=t==null?void 0:t.node)==null?void 0:C.attrs)||{},r=s==null?void 0:s.media_file_id,i=(s==null?void 0:s.pod_id)||((_=(I=n==null?void 0:n.storage)==null?void 0:I.pod)==null?void 0:_.id)||(o==null?void 0:o.id)||null,c=(s==null?void 0:s.circle_id)||((F=(R=n==null?void 0:n.storage)==null?void 0:R.pod)==null?void 0:F.slug)||(o==null?void 0:o.slug)||window.$currentSlug||null,u=((G=s==null?void 0:s.uploader)==null?void 0:G.urlOutput)||(s==null?void 0:s.src)||((T=s==null?void 0:s.uploader)==null?void 0:T.url)||null,[a,f]=l.useState(null),[d,h]=l.useState(!1),[m,x]=l.useState(!1),[g,w]=l.useState(!1),[b,j]=l.useState(!1),[A,v]=l.useState(!1);l.useEffect(()=>{if(h(!1),x(!1),w(!1),f(null),!r&&!(u&&c)||!i)return;let L=!1;j(!0);const S=W=>{if(!W){if(L)return;f(null),j(!1);return}f(W),qo.onDownloadInfo(W,i,E=>{L||(h(!!(E!=null&&E.allow_member_downloads)),x(!!(E!=null&&E.eligible)),w(!!(E!=null&&E.can_manage_downloads)),j(!1))},()=>{L||(h(!1),x(!1),w(!1),j(!1))},s==null?void 0:s.uid)};return r?S(r):qo.onFetch(u,c,W=>{L||S((W==null?void 0:W.media_file_id)||(W==null?void 0:W.id)||(W==null?void 0:W.media_id)||(W==null?void 0:W.public_id))},()=>{L||(f(null),h(!1),x(!1),w(!1),j(!1))}),()=>{L=!0}},[r,i,u,c,s==null?void 0:s.uid]);const k=L=>{if(!a)return;const S=L.currentTarget.checked,W=d;h(S),v(!0),qo.onUpdateDownloadSettings({mediaFileId:a,podId:i,nodeUid:s==null?void 0:s.uid,allowMemberDownloads:S},E=>{h(!!(E!=null&&E.allow_member_downloads)),x(!!(E!=null&&E.eligible)),w(!!(E!=null&&E.can_manage_downloads)),v(!1)},E=>{h(W),v(!1),Ct.fire({title:"",text:(E==null?void 0:E.message)||(E==null?void 0:E.error)||"Could not update video download setting",icon:"error"})})};return!a||!i||!g?null:e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:15},children:[e.jsx(Ve,{"aria-label":"Allow video downloads",checked:d,onChange:k,disabled:b||A||!m||!g,color:"green",size:"md"}),e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500},children:"Allow downloads"})]})}function Hb({node:t,hasNode:n,isNodeType:o,t:s,onSaveNodeData:r,onTrimVideo:i,editor:c,editorContext:u,colors:a}){var w,b,j,A,v,k;const f=(b=(w=t==null?void 0:t.node)==null?void 0:w.type)==null?void 0:b.name,d=()=>{var C,I,_;return typeof((I=(C=t==null?void 0:t.node)==null?void 0:C.attrs)==null?void 0:I.src)=="string"&&t.node.attrs.src.indexOf("m3u8")>=0&&((_=t.node.attrs.uploader)==null?void 0:_.status)==="completed"?e.jsx(We,{mt:15,fullWidth:!0,radius:"xl",leftSection:e.jsx(Qe,{icon:Sd.faCut}),className:Hs.trimVideoBtn,onClick:R=>i(R),styles:{root:{paddingInlineStart:"var(--button-padding-x)"}},children:"Trim video"}):null};if(!n)return null;const h=[];o("circle")&&h.push(e.jsxs(y.Item,{value:"media-circle",children:[e.jsx(y.Control,{children:s("tiptap.components.sideConfigurationsMenu.label1")}),e.jsxs(y.Panel,{children:[e.jsx(Gm,{saveNodeData:r,element:t}),e.jsx(ab,{saveNodeData:r,element:t,editor:c,children:o("circle")&&((A=(j=t==null?void 0:t.node)==null?void 0:j.attrs)==null?void 0:A.viewAs)=="button"&&e.jsx(vi,{label:t.node.attrs.viewAs=="link"?"Link text":s("tiptap.components.sidebar.buttonText.label"),saveNodeData:r,element:t,editor:c})})]})]},"media-circle")),o("tagsFeed")&&h.push(e.jsxs(y.Item,{value:"media-tagsfeed",children:[e.jsx(y.Control,{children:s("tiptap.components.sideConfigurationsMenu.label1")}),e.jsx(y.Panel,{children:e.jsx(cb,{saveNodeData:r,element:t})})]},"media-tagsFeed"));const m=(k=(v=t==null?void 0:t.node)==null?void 0:v.attrs)==null?void 0:k.src,x=["youtube","vimeo","loom","sutra","localhost","adilo","bigcommand"].some(C=>m==null?void 0:m.includes(C));return n&&m&&(o("video")||o("embed"))&&(o("embed")||x)&&h.push(e.jsxs(y.Item,{value:"media-display",children:[e.jsx(y.Control,{children:"Display options"}),e.jsxs(y.Panel,{children:[x?e.jsx(ub,{saveNodeData:r,element:t,embedCodeMenu:e.jsx(ic,{element:t})}):e.jsx(ye,{justify:"flex-end",children:e.jsx(ic,{element:t})}),e.jsx(Fb,{node:t,editor:c})]})]},"media-display")),o("file")&&h.push(e.jsxs(y.Item,{value:"media-file",children:[e.jsx(y.Control,{children:s("tiptap.components.sideConfigurationsMenu.label2")}),e.jsxs(y.Panel,{children:[e.jsx(yb,{saveNodeData:r,element:t}),t.node.attrs.displayAs&&t.node.attrs.extension==="pdf"&&e.jsx(jb,{saveNodeData:r,element:t}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px",marginTop:12},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"50px"},children:"Text"}),e.jsx(wt,{attrName:"fileTextColor",saveNodeData:r,element:t,editor:c,swatchType:"light",fallbackColor:(a==null?void 0:a.default_text_color)||"#000000"})]})]})]},"media-file")),n&&t.node.attrs.link&&(o("video")||o("embed"))&&t.node.attrs.viewAs.indexOf("card")>=0&&h.push(e.jsxs(y.Item,{value:"media-card",children:[e.jsx(y.Control,{children:"Card details"}),e.jsxs(y.Panel,{children:[e.jsx(lc,{saveNodeData:r,element:t}),e.jsx(ac,{saveNodeData:r,element:t}),e.jsx(kr,{saveNodeData:r,element:t,compact:!0}),e.jsx(d,{})]})]},"media-card")),o("survey")&&h.push(e.jsxs(y.Item,{value:"media-survey",children:[e.jsx(y.Control,{children:`${(f||"").charAt(0).toUpperCase()+(f||"").slice(1)} details`}),e.jsx(y.Panel,{children:e.jsx(Db,{node:t,editor:c,onSaveNodeData:r})})]},"media-survey")),n&&t.node.attrs.link&&o("video")&&t.node.attrs.viewAs.indexOf("card")<0&&h.push(e.jsxs(y.Item,{value:"media-video",children:[e.jsx(y.Control,{children:"Video details"}),e.jsxs(y.Panel,{children:[e.jsx(kr,{saveNodeData:r,element:t,compact:!0}),e.jsx(d,{})]})]},"media-video")),n&&t.node.attrs.link&&(o("image")||o("fancyLink"))&&h.push(e.jsxs(y.Item,{value:"media-link",children:[e.jsx(y.Control,{children:o("image")?"Link image":"Fancy link"}),e.jsxs(y.Panel,{children:[e.jsx($b,{saveNodeData:r,element:t,context:u}),o("fancyLink")&&e.jsxs(e.Fragment,{children:[e.jsx(lc,{saveNodeData:r,element:t}),e.jsx(ac,{saveNodeData:r,element:t}),e.jsx(kr,{saveNodeData:r,element:t})]})]})]},"media-link")),h}const cc=t=>typeof t=="string"&&/^clamp\(/i.test(t.trim()),ku=(t,n=0)=>
4{if(t==null||t==="")return n;if(typeof t=="number")return Number.isFinite(t)?t:n;const o=String(t).trim(),s=o.match(/^(-?\d*\.?\d+)(?:px)?$/i);if(s)return Number(s[1]);const r=o.match(/^clamp\(\s*[^,]+,\s*[^,]+,\s*(-?\d*\.?\d+)px\s*\)$/i);return r?Number(r[1]):n},_n=(t,n,o=0)=>ku(t==null?void 0:t[n],o),Ub=(t,n)=>({marginTop:_n(t,"margin-top"),marginBottom:_n(t,"margin-bottom"),marginLeft:_n(t,"margin-left"),marginRight:_n(t,"margin-right"),paddingTop:_n(t,"padding-top",n==="block"?10:0),paddingBottom:_n(t,"padding-bottom",n==="block"?8:0),paddingLeft:_n(t,"padding-left"),paddingRight:_n(t,"padding-right")}),Vb=[0,10,20,40,60,100,140,220],xn=36,wu=36,Jr=4,wr=4,Cr=188,Kb=new Set(["box","container","shareblock"]),Gb=[{key:"marginTop",type:"margin",position:"top",label:"Edit margin top"},{key:"marginBottom",type:"margin",position:"bottom",label:"Edit margin bottom"},{key:"marginLeft",type:"margin",position:"left",label:"Edit margin left"},{key:"marginRight",type:"margin",position:"right",label:"Edit margin right"},{key:"paddingTop",type:"padding",position:"top",label:"Edit padding top"},{key:"paddingBottom",type:"padding",position:"bottom",label:"Edit padding bottom"},{key:"paddingLeft",type:"padding",position:"left",label:"Edit padding left"},{key:"paddingRight",type:"padding",position:"right",label:"Edit padding right"}],gn={marginTop:"margin-top",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",paddingTop:"padding-top",paddingBottom:"padding-bottom",paddingLeft:"padding-left",paddingRight:"padding-right"},Yb=Object.entries(gn).reduce((t,[n,o])=>(t[o]=n,t),{}),qb=(t,n)=>{const o=t==="margin",s=o?0:xn+Jr,r=o?xn:wu;switch(n){case"top":return{top:s,left:s,right:s,height:r};case"bottom":return{bottom:s,left:s,right:s,height:r};case"left":return{top:s,bottom:s,left:s,width:r};case"right":return{top:s,bottom:s,right:s,width:r};default:return{}}},Xb=(t,n)=>t==="left"||t==="right"?n==="padding"?-30:-70:5,uc=t=>t==="column"?"real":t==="grid"?"wrapper":"self",Zb=(t,n,o,s={})=>(o==="allSpacing"?Object.keys(gn):[n]).reduce((i,c)=>{const u=gn[c];return u&&(o==="allSpacing"&&c!==n&&Object.prototype.hasOwnProperty.call(s,u)?i[u]=s[u]:i[u]=`${t[c]}px`),i},{}),Qb=(t,n)=>{const o=t==="margin";if(n==="top")return"0,0 100,0 86,100 14,100";if(n==="bottom")return"14,0 86,0 100,100 0,100";if(n==="left"){const s=o?20:33.33;return`0,0 100,${s} 100,${100-s} 0,100`}if(n==="right"){const s=o?20:33.33;return`0,${s} 100,0 100,100 0,${100-s}`}return""},Cu=ke.forwardRef(({type:t,position:n,isHovered:o,isActive:s,value:r,isFluid:i=!1,valueState:c="base",onClick:u,onMouseDown:a,onMouseEnter:f,onMouseLeave:d,onContextMenu:h},m)=>{const b=s?"var(--mantine-color-blue-1)":o?"var(--mantine-color-gray-1)":"var(--mantine-color-white)",j=c==="overridden"?"#e64980":c==="inherited"||c==="locked"?"var(--mantine-color-gray-5)":"var(--mantine-color-gray-7)";return e.jsxs("div",{ref:m,style:{width:"100%",height:"100%",position:"relative",cursor:c==="locked"?"not-allowed":"pointer",opacity:c==="locked"?.45:1},onMouseDown:a,onClick:u,onMouseEnter:f,onMouseLeave:d,onContextMenu:h,children:[e.jsx("svg",{viewBox:"0 0 100 100",width:"100%",height:"100%",style:{position:"absolute",top:0,left:0},preserveAspectRatio:"none",children:e.jsx("polygon",{points:Qb(t,n),style:{fill:b,transition:"fill 0.15s"}})}),e.jsxs("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:10,fontWeight:c==="overridden"?700:600,color:j,pointerEvents:"none",zIndex:1,whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",gap:3},children:[i?`≈${r}`:r,c==="overridden"&&e.jsx("span",{style:{width:4,height:4,borderRadius:"50%",background:"#e64980",display:"inline-block"}})]})]})});Cu.displayName="SpacingButton";function Jb(t){var cn;const{editor:n,editorId:o,type:s,element:r,saveNodeData:i,onStyleTargetSaved:c,controlSyncKey:u,allowedKeys:a,styleTarget:f}=t,d=(cn=a||(f==null?void 0:f.allowedKeys))==null?void 0:cn.map(J=>Yb[J]||J),h=l.useRef(null),m=l.useRef(null),x=l.useRef(null),g=l.useRef(!1),w=l.useRef(null),b=l.useRef(null),j=l.useCallback(()=>{h.current=null,m.current=null,g.current=!1,C(null)},[]),[A,v]=l.useState(null),[k,C]=l.useState(null),[I,_]=l.useState(null),[R,F]=l.useState({top:0,left:0}),[G,T]=l.useState(0);l.useLayoutEffect(()=>{const J=w.current;if(!J)return;const U=()=>T(J.offsetWidth);U();const ie=new ResizeObserver(U);return ie.observe(J),window.addEventListener("resize",U),()=>{ie.disconnect(),window.removeEventListener("resize",U)}},[]),l.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]);const[L,S]=l.useState({marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,paddingTop:s==="block"?10:0,paddingBottom:s==="block"?8:0,paddingLeft:0,paddingRight:0}),[W,E]=l.useState({...L}),[P,$]=l.useState({}),{setSpacingTarget:X,currentEditorId:q}=gi(),Q=o!=null?o:q,{breakpoint:B}=Et(),[O,K]=l.useState({overrides:{},capableKeys:[],targetOk:!1}),Y=B!=="desktop"&&O.targetOk,H=new Set(O.capableKeys),D=Y&&Object.values(O.overrides).some(Boolean),ne=l.useCallback(()=>{var ce,me,de,Ne,M,fe,lt;
4if(f){const $e=(r==null?void 0:r.node)||null;if(!$e)return{node:null,pos:null,elementTarget:null,styleTarget:null};const Je=typeof f.pos=="number"?f.pos:r==null?void 0:r.pos,tt=(Ne=(de=(ce=f.uid)!=null?ce:r==null?void 0:r.uid)!=null?de:(me=$e==null?void 0:$e.attrs)==null?void 0:me.uid)!=null?Ne:null,Ge={...r||{},node:$e,pos:Je,key:f.scopeKey||(r==null?void 0:r.key),uid:tt,uidIsStable:f.uidIsStable===!0||(r==null?void 0:r.uidIsStable)===!0,surface:f.surface||(r==null?void 0:r.surface)||uc(s)};return{node:$e,pos:Je,elementTarget:Ge,styleTarget:f}}const{node:J,pos:U}=Xt(n,r);if(!J)return{node:null,pos:null,elementTarget:null,styleTarget:null};const ie={...r||{},node:J,pos:U,uid:(lt=(fe=r==null?void 0:r.uid)!=null?fe:(M=J==null?void 0:J.attrs)==null?void 0:M.uid)!=null?lt:null,uidIsStable:(r==null?void 0:r.uidIsStable)===!0,surface:(r==null?void 0:r.surface)||uc(s)};return{node:J,pos:U,elementTarget:ie,styleTarget:null}},[n,r,f,s]);l.useEffect(()=>{if(!n)return;const J=()=>{var mt,ae,zt;const{node:ie,pos:ce}=ne(),me=u||(f==null?void 0:f.scopeKey)||ft({node:ie,pos:ce});if(g.current&&me!==h.current){const V=m.current,te=V&&(f?V.node:n.state.doc.nodeAt(V.pos));if(te&&((f==null?void 0:f.scopeKey)||ft({node:te,pos:V.pos}))===h.current)return;h.current=null,m.current=null,g.current=!1,C(null)}if(!((mt=ie==null?void 0:ie.attrs)!=null&&mt.styles))return;if(s==="grid"){const V=((ae=ie.type)==null?void 0:ae.name)||"";if(!(V.indexOf("grid")>=0||V==="infobox"||V==="box"||V==="container"||V==="shareblock"||V==="icontext"||V==="blockquote"))return}let de=ie.attrs.styles;if(Object.keys(de||{})[0]==="0"){const V=mi(Ys(de));if(f){const te=f.saveAttr||f.styleAttr||"styles";Us(n,f,{[te]:V})&&(c==null||c())}else i({newStyles:V,_node:{node:ie,pos:ce}},"styles");return}const M=Ub(de,s),fe=Object.entries(gn).reduce((V,[te,he])=>{const le=de==null?void 0:de[he];return cc(le)&&(V[te]=le),V},{}),lt=((zt=ie.type)==null?void 0:zt.name)||"",$e=Wx(f),Je=$e?rs(lt):new Set,tt=Object.entries(gn).filter(([,V])=>Je.has(V)).map(([V])=>V),Ge={};B!=="desktop"&&$e&&Object.entries(gn).forEach(([V,te])=>{if(!Je.has(te))return;const he=wo(ie.attrs,te,B),le=ku(he,null);le!=null&&(M[V]=le),cc(he)?fe[V]=he:delete fe[V],is(ie.attrs,te,B)&&(Ge[V]=!0)}),K(V=>{const te=Object.keys(Ge).length===Object.keys(V.overrides).length&&Object.keys(Ge).every(le=>V.overrides[le]),he=tt.length===V.capableKeys.length&&tt.every((le,Ye)=>V.capableKeys[Ye]===le);return te&&he&&V.targetOk===$e?V:{overrides:Ge,capableKeys:tt,targetOk:$e}}),S(V=>Object.keys(M).every(he=>V[he]===M[he])?V:M),E(V=>Object.keys(M).every(he=>V[he]===M[he])?V:M),$(V=>{const te=Object.keys(V),he=Object.keys(fe);return te.length===he.length&&he.every(Ye=>V[Ye]===fe[Ye])?V:fe})};J();const U=()=>J();return n.on("selectionUpdate",U),n.on("update",U),()=>{n.off("selectionUpdate",U),n.off("update",U)}},[n,s,r,i,c,u,ne,f,B]);const Ie=l.useCallback(()=>{Q!=null&&X(Q,null)},[Q,X]),Ke=l.useCallback((J,U)=>{var zt,V,te,he,le,Ye,ze,xt,bt,On,Mn,yn;if(Q==null||k)return;const{node:ie,pos:ce,elementTarget:me,styleTarget:de}=ne(),Ne=ft({node:ie,pos:ce}),M=(V=(zt=ie==null?void 0:ie.attrs)==null?void 0:zt.uid)!=null?V:Ne,fe=((te=de==null?void 0:de.displayDomTarget)==null?void 0:te.nodeType)||(de==null?void 0:de.nodeType)||((he=ie==null?void 0:ie.type)==null?void 0:he.name)||s,lt=J.startsWith("margin")?"margin":"padding",$e=Kb.has(fe)&&lt==="padding",Je=((le=de==null?void 0:de.displayDomTarget)==null?void 0:le.surface)||(de==null?void 0:de.surface)||(s==="column"?"real":(me==null?void 0:me.surface)||"wrapper"),tt=((Ye=de==null?void 0:de.displayDomTarget)==null?void 0:Ye.domSurface)||($e?"content":s==="column"?"column":Je==="boxContent"?"content":"self"),Ge=(de==null?void 0:de.storageSurface)||($e?"content":s==="column"?"column":"self"),mt={nodeUid:M,nodeSyncKey:Ne,nodeType:fe,pos:ce,surface:Je,spacingKind:lt,domSurface:tt,storageSurface:Ge,styleKey:J,key:J,value:U,source:"sidebar"},ae=Td({editorId:Q,ownerScopeTarget:{editorId:Q,key:(ze=me==null?void 0:me.key)!=null?ze:Ne,uid:M,uidIsStable:(me==null?void 0:me.uidIsStable)===!0,pos:ce,nodeType:fe,surface:Je},spacingStyleTarget:de,displayDomTarget:{uid:(bt=(xt=de==null?void 0:de.displayDomTarget)==null?void 0:xt.uid)!=null?bt:M,uidIsStable:((On=de==null?void 0:de.displayDomTarget)==null?void 0:On.uidIsStable)===!0||(me==null?void 0:me.uidIsStable)===!0,pos:(yn=(Mn=de==null?void 0:de.displayDomTarget)==null?void 0:Mn.pos)!=null?yn:ce,nodeType:fe,surface:Je,domSurface:tt},spacingKind:lt,styleKey:J,value:U,source:"sidebar",domSurface:tt,storageSurface:Ge});X(Q,U>0?{...ae,...mt}:null)},[Q,X,k,ne,s]);l.useEffect(()=>{k&&Ie()},[k,Ie]);const Oe=l.useCallback((J,U)=>{var lt,$e,Je;const ie=m.current;if(h.current==null||!ie||!((lt=n==null?void 0:n.state)!=null&&lt.doc))return;const ce=gn[U];if(!ce)return;if(B!=="desktop"&&O.targetOk&&O.capableKeys.includes(U)){us(n,ie,B,{[ce]:`${J[U]}px`})&&(K(Ge=>Ge.overrides[U]?Ge:{...Ge,overrides:{...Ge.overrides,[U]:!0}}),c==null||c());return}const me=x.current;if(me){const tt=me.saveAttr||me.styleAttr||"styles",Ge=((Je=($e=ie==null?void 0:ie.node)==null?void 0:$e.attrs)==null?void 0:Je[tt])||{},mt=Zb(J,U,me.payloadMode,Ge);Us(n,me,{[tt]:mt})&&(c==null||c());return}const de=Xt(n,ie),{node:Ne,pos:M}=de;if(!Ne||ft({node:Ne,pos:M})!==h.current)return;let fe=Ne.attrs.styles?{...Ne.attrs.styles}:{};fe[ce]=`${J[U]}px`,i({newStyles:fe,_node:{node:Ne,pos:M}},"styles")},[n,c,i,B,O]),Ce=l.useCallback((J,U)=>{S(ie=>{const ce={...ie,[J]:U};return Oe(ce,J),ce}),E(ie=>({...ie,[J]:U}))},[Oe]),Re=l.useCallback((J,U)=>{E(ie=>({...ie,[J]:U}))},[]),xe=l.useCallback(J=>{if(B==="desktop")return;const U=J.map(ce=>
4gn[ce]).filter(Boolean);if(U.length===0)return;const{elementTarget:ie}=ne();ie&&ds(n,ie,B,U)},[B,n,ne]),Ee=(J,U)=>{!Y||!O.overrides[J]||(U.preventDefault(),xe([J]))},ht=()=>{Y&&(j(),xe(Object.keys(gn).filter(J=>(!d||d.includes(J))&&H.has(J))))},Tt=(J,U)=>{var ie;if(!(Y&&!H.has(J)))if(k===J)j();else{const ce=U.currentTarget.getBoundingClientRect(),me=(ie=w.current)==null?void 0:ie.getBoundingClientRect();me&&F({top:ce.bottom-me.top,left:(ce.left+ce.right)/2-me.left});const{node:de,pos:Ne,elementTarget:M,styleTarget:fe}=ne();if(!de)return;h.current=u||(fe==null?void 0:fe.scopeKey)||ft({node:de,pos:Ne}),m.current={...M,node:de,pos:Ne},x.current=fe,g.current=!0,C(J)}},It=xn+Jr+wu,pt=xn+Jr;return e.jsxs(e.Fragment,{children:[Y&&D&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:6},children:e.jsx("button",{type:"button",onClick:ht,style:{fontSize:11,fontWeight:600,color:"#7950f2",background:"#f3f0ff",border:0,borderRadius:6,padding:"3px 8px",cursor:"pointer",fontFamily:"inherit"},children:"↺ Reset to Desktop"})}),e.jsxs("div",{ref:w,style:{position:"relative",width:"100%",height:Cr},children:[e.jsx(N,{style:{position:"absolute",top:4,left:16,fontSize:8,fontWeight:700,color:"var(--mantine-color-dark-7)",textTransform:"uppercase",zIndex:10,pointerEvents:"none"},children:"Margin"}),e.jsx(N,{style:{position:"absolute",top:pt+4,left:pt+16,fontSize:8,fontWeight:700,color:"var(--mantine-color-dark-7)",textTransform:"uppercase",zIndex:10,pointerEvents:"none"},children:"Padding"}),e.jsx("div",{style:{position:"absolute",top:xn,left:xn,right:xn,bottom:xn,backgroundColor:"var(--mantine-color-gray-2)",borderRadius:wr,pointerEvents:"none",zIndex:0}}),e.jsx("div",{style:{position:"absolute",top:It,left:It,right:It,bottom:It,backgroundColor:"var(--mantine-color-gray-2)",borderRadius:wr,pointerEvents:"none",zIndex:0}}),G>0&&e.jsx("svg",{width:G,height:Cr,style:{position:"absolute",top:0,left:0,pointerEvents:"none",zIndex:5},children:(()=>{const J=G,U=Cr,ie=xn,ce=pt,me=It,de=wr,M={stroke:"var(--mantine-color-dark-4)"};return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:.5,y:.5,width:J-1,height:U-1,rx:de,fill:"none",style:M,strokeWidth:1}),e.jsx("rect",{x:ie+.5,y:ie+.5,width:J-ie*2-1,height:U-ie*2-1,rx:de,fill:"none",style:M,strokeWidth:1}),e.jsx("rect",{x:ce+.5,y:ce+.5,width:J-ce*2-1,height:U-ce*2-1,rx:de,fill:"none",style:M,strokeWidth:1}),e.jsx("rect",{x:me+.5,y:me+.5,width:J-me*2-1,height:U-me*2-1,rx:de,fill:"none",style:M,strokeWidth:1}),(()=>{const fe=de*.293;return e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:fe,y1:fe,x2:ie+fe,y2:ie+fe,style:M,strokeWidth:1}),e.jsx("line",{x1:J-fe,y1:fe,x2:J-ie-fe,y2:ie+fe,style:M,strokeWidth:1}),e.jsx("line",{x1:fe,y1:U-fe,x2:ie+fe,y2:U-ie-fe,style:M,strokeWidth:1}),e.jsx("line",{x1:J-fe,y1:U-fe,x2:J-ie-fe,y2:U-ie-fe,style:M,strokeWidth:1}),e.jsx("line",{x1:ce+fe,y1:ce+fe,x2:me+fe,y2:me+fe,style:M,strokeWidth:1}),e.jsx("line",{x1:J-ce-fe,y1:ce+fe,x2:J-me-fe,y2:me+fe,style:M,strokeWidth:1}),e.jsx("line",{x1:ce+fe,y1:U-ce-fe,x2:me+fe,y2:U-me-fe,style:M,strokeWidth:1}),e.jsx("line",{x1:J-ce-fe,y1:U-ce-fe,x2:J-me-fe,y2:U-me-fe,style:M,strokeWidth:1})]})})()]})})()}),Gb.filter(({key:J})=>!d||d.includes(J)).map(({key:J,type:U,position:ie,label:ce})=>e.jsx("div",{style:{position:"absolute",zIndex:2,...qb(U,ie)},children:e.jsx(vt,{label:P[J]?`${ce} · Fluid: ${P[J]}`:ce,withArrow:!0,offset:Xb(ie,U),opened:A===J&&I===J&&!k,zIndex:999998,children:e.jsx(Cu,{type:U,position:ie,isHovered:I===J,isActive:k===J,value:L[J],isFluid:!!P[J],valueState:Y?H.has(J)?O.overrides[J]?"overridden":"inherited":"locked":"base",onContextMenu:me=>Ee(J,me),onMouseDown:me=>me.preventDefault(),onClick:me=>Tt(J,me),onMouseEnter:()=>{_(J),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{v(J)},1e3),k||Ke(J,L[J])},onMouseLeave:()=>{_(null),v(null),b.current&&clearTimeout(b.current),Ie()}})})},J)),k&&e.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:999998},onClick:j}),e.jsxs(we,{opened:!!k,onChange:J=>{J||j()},position:"bottom",withArrow:!0,width:260,zIndex:999999,styles:{dropdown:{padding:12}},children:[e.jsx(we.Target,{children:e.jsx("div",{style:{width:1,height:1,position:"absolute",top:R.top,left
4:R.left}})}),e.jsx(we.Dropdown,{children:k&&e.jsxs(p,{children:[e.jsxs(ye,{gap:8,mb:12,wrap:"nowrap",children:[e.jsx(p,{style:{flex:1},children:e.jsx(ts,{min:0,max:220,value:W[k],onChange:J=>Re(k,J),onChangeEnd:J=>Ce(k,J),size:"sm",styles:{markLabel:{display:"none"}}})}),e.jsx(Rt,{hideControls:!0,min:0,max:500,value:L[k],onChange:J=>{const U=Math.max(0,Math.min(500,J||0));Ce(k,U),E(ie=>({...ie,[k]:Math.min(220,U)}))},rightSection:e.jsx(N,{size:10,c:"dimmed",tt:"uppercase",children:"px"}),styles:{input:{width:60,padding:"6px 24px 6px 8px",fontSize:13,fontWeight:600,textAlign:"right",borderColor:"var(--mantine-color-gray-5)"}}})]}),e.jsx(as,{cols:4,spacing:6,children:Vb.map(J=>e.jsx(We,{size:"compact-sm",variant:L[k]===J?"filled":"outline",color:L[k]===J?"blue":"gray",onClick:()=>Ce(k,J),styles:{root:{height:32,fontSize:12,fontWeight:600,color:L[k]===J?"var(--mantine-color-white)":"var(--mantine-color-dark-9)",borderColor:L[k]===J?"var(--mantine-color-blue-6)":"var(--mantine-color-gray-5)",backgroundColor:L[k]===J?"var(--mantine-color-blue-6)":"var(--mantine-color-white)"}},children:J},J))}),Y&&O.overrides[k]&&e.jsx(N,{ta:"center",mt:10,children:e.jsx(We,{variant:"subtle",size:"compact-xs",color:"violet",onClick:()=>xe([k]),children:"↺ Reset to Desktop"})}),Y&&!O.overrides[k]&&e.jsxs(N,{size:"xs",c:"dimmed",ta:"center",mt:10,fs:"italic",children:["Inherited — editing creates a ",B," override"]})]})})]})]})]})}function go({type:t,withinGrid:n,editor:o,saveNodeData:s,onStyleTargetSaved:r,editorId:i,element:c,controlSyncKey:u,allowedKeys:a,styleTarget:f}){return e.jsx(Jb,{type:t,withinGrid:n,editor:o,saveNodeData:s,onStyleTargetSaved:r,editorId:i,element:c,controlSyncKey:u,allowedKeys:a,styleTarget:f})}const Sr={top:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"2",y:"1",width:"20",height:"18",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"6",y1:"5",x2:"18",y2:"5"}),e.jsx("line",{x1:"6",y1:"8.5",x2:"15",y2:"8.5"})]}),center:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"2",y:"1",width:"20",height:"18",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"6",y1:"8",x2:"18",y2:"8"}),e.jsx("line",{x1:"6",y1:"11.5",x2:"15",y2:"11.5"})]}),bottom:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"2",y:"1",width:"20",height:"18",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"6",y1:"11",x2:"18",y2:"11"}),e.jsx("line",{x1:"6",y1:"14.5",x2:"15",y2:"14.5"})]})};function ei({element:t,saveNodeData:n,editor:o,styleTarget:s,onStyleTargetSaved:r}){var x;const[i,c]=l.useState("flex-start"),u=l.useRef(!1),{breakpoint:a}=Et(),f=((x=t==null?void 0:t.node)==null?void 0:x.attrs)||{},d=a!=="desktop"&&is(f,"align-items",a);l.useEffect(()=>{if(!t||!t.node.attrs)return;u.current=null;const g=t.node.attrs.uid;setTimeout(()=>{u.current=g},0),c(wo(t.node.attrs,"align-items",a)||"flex-start")},[t,a]),l.useEffect(()=>{var w,b;if(a!=="desktop"||u.current!==((b=(w=t==null?void 0:t.node)==null?void 0:w.attrs)==null?void 0:b.uid))return;const g=t.node.attrs.styles?{...t.node.attrs.styles}:{};g["align-items"]=i,ln({editor:o,styleTarget:s,nextStyles:g,element:t,saveNodeData:n,onStyleTargetSaved:r})},[i,a,o,t,r,n,s]);const h=g=>{c(g),!(a==="desktop"||!o)&&us(o,t,a,{"align-items":g})&&(r==null||r())},m=()=>{if(a==="desktop"||!o||!ds(o,t,a,["align-items"]))return;c(wo(f,"align-items",a==="mobile"?"tablet":"desktop")||"flex-start"),r==null||r()};return e.jsxs(p,{children:[d&&e.jsx(p,{style:{display:"flex",justifyContent:"flex-end",marginBottom:6},children:e.jsx(Jn,{onClick:m})}),e.jsxs(ye,{gap:6,grow:!0,children:[e.jsx(Be,{icon:Sr.top,label:"Top",value:"flex-start",active:i==="flex-start",onClick:()=>h("flex-start")}),e.jsx(Be,{icon:Sr.center,label:"Center",value:"center",active:i==="center",onClick:()=>h("center")}),e.jsx(Be,{icon:Sr.bottom,label:"Bottom",value:"flex-end",active:i==="flex-end",onClick:()=>h("flex-end")})]})]})}const Tr=["flexLayout","flexGap","flexItemSizing","flexRowAlign"],Os={stack:e.jsxs("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"4",y:"2",width:"20",height:"5",rx:"1.5"}),e.jsx("rect",{x:"4",y:"9",width:"20",height:"5",rx:"1.5"}),e.jsx("rect",{x:"4",y:"16",width:"14",height:"4",rx:"1.5",opacity:"0.4"})]}),row:e.jsxs("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"2",y:"4",width:"7",height:"14",rx:"1.5"}),e.jsx("rect",{x:"10.5",y:"4",width:"7",height:"14",rx:"1.5"}),e.jsx("rect",{x:"19",y:"4",width:"7",height:"14",rx:"1.5"})]}),spread:e.jsxs("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"4",y:"2",width:"20",height:"4",rx:"1.5"}),e.jsx("rect",{x:"4",y:"16",width:"20",height:"4",rx:"1.5"}),e.jsx("line",{x1:"14",y1:"8",x2:"14",y2:"14",stroke:"currentColor",strokeDasharray:"2 2",opacity:"0.3"})]}),hspread:e.jsxs("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"2",y:"4",width:"7",height:"14",rx:"1.5"}),e.jsx("rect",{x:"19",y:"4",width:"7",height:"14",rx:"1.5"}),e.jsx("line",{x1:"11",y1:"11",x2:"17",y2:"11",stroke:"currentColor",strokeDasharray:"2 2",opacity:"0.3"})]})};function ti({element:t,editor:n,saveNodeData:o,hideVSpread:s,styleTarget:r,onStyleTargetSaved:i}){var S;const[c,u]=l.useState("stack"),[a,f]=l.useState(0),[d,h]=l.useState("equal"),[m,x]=l.useState("left"),[g,w]=l.useState(!1),b=l.useRef(!1),j=l.useRef(new Set),A=l.useRef(null),{breakpoint:v}=Et(),k=((S=t==null?void 0:t.node)==null?void 0:S.attrs)||{},C=v!=="desktop"&&Tr.some(W=>So(k,W,v));l.useEffect(()=>()=>clearTimeout(A.current),[]),l.useEffect(()=>{if(t&&t.node.attrs){const W=ka(t.node.attrs,v);u(W.layout),f(W.gap||0),h(W.itemSizing),x(W.rowAlign),w(W.layout==="row"||W.layout==="hs
4pread")}},[t,v]),l.useEffect(()=>{if(b.current&&(b.current=!1,!(!t||!n))){if(v!=="desktop"){const W={flexLayout:c,flexGap:a,flexItemSizing:d,flexRowAlign:m},E={};if(j.current.forEach(P=>{E[P]=W[P]}),j.current.clear(),Object.keys(E).length===0||!ur(n,t,v,E))return;clearTimeout(A.current),A.current=setTimeout(()=>i==null?void 0:i(),500);return}if(r){if(!$t({editor:n,element:t,styleTarget:r,attrs:{flexLayout:c,flexGap:a,flexItemSizing:d,flexRowAlign:m}}))return}else{const{node:W,pos:E}=St(n,t);if(!W||E==null)return;const{tr:P}=n.view.state;P.setNodeMarkup(E,void 0,{...W.attrs,flexLayout:c,flexGap:a,flexItemSizing:d,flexRowAlign:m}),n.view.dispatch(P)}clearTimeout(A.current),A.current=setTimeout(()=>{var W;(W=r?i:o)==null||W()},500)}},[c,a,d,m,v,n,t,i,o,r]);const I=W=>{j.current.add(W),b.current=!0},_=W=>{I("flexLayout"),u(W),w(W==="row"||W==="hspread")},R=W=>{I("flexItemSizing"),h(W||"equal")},F=W=>{I("flexRowAlign"),x(W||"left")},G=c==="row"||c==="hspread",T=c==="row",L=()=>{if(v==="desktop"||!n||!ki(n,t,v,Tr))return;const W=Object.fromEntries(Tr.map($=>[$,null])),E=uu(k.responsive,v,W),P=ka({...k,responsive:E},v);u(P.layout),f(P.gap||0),h(P.itemSizing),x(P.rowAlign),w(P.layout==="row"||P.layout==="hspread"),i==null||i()};return e.jsxs(p,{children:[C&&e.jsx(p,{style:{display:"flex",justifyContent:"flex-end",marginBottom:6},children:e.jsx(Jn,{onClick:L})}),e.jsxs(ye,{gap:6,grow:!0,children:[e.jsx(Be,{icon:Os.stack,label:"Stack",value:"stack",active:c==="stack",onClick:()=>_("stack")}),e.jsx(Be,{icon:Os.row,label:"Row",value:"row",active:c==="row",onClick:()=>_("row")}),!s&&e.jsx(Be,{icon:Os.spread,label:"V Spread",value:"spread",active:c==="spread",onClick:()=>_("spread")}),e.jsx(Be,{icon:Os.hspread,label:"H Spread",value:"hspread",active:c==="hspread",onClick:()=>_("hspread")})]}),g&&e.jsxs(e.Fragment,{children:[e.jsx(p,{mt:12,children:e.jsx(He,{label:"Gap",value:a,onChange:W=>{I("flexGap"),f(W)},min:0,max:60,unit:"px"})}),G&&e.jsxs(p,{mt:12,children:[e.jsx(N,{size:"xs",fw:700,mb:6,c:"#555",children:"Item width"}),e.jsx(Pe,{options:[{label:"Equal width",value:"equal"},{label:"Fit + wrap",value:"fit"},{label:"Fit + shrink",value:"fitShrink"}],activeValue:d,onChange:R,columns:3})]}),T&&e.jsxs(p,{mt:12,children:[e.jsx(N,{size:"xs",fw:700,mb:6,c:"#555",children:"Row align"}),e.jsx(Pe,{options:[{label:"Left",value:"left"},{label:"Center",value:"center"},{label:"Right",value:"right"}],activeValue:m,onChange:F,columns:3})]})]})]})}const ey="_sideIndicatorWrap_lsar5_1",ty="_sideIndicatorBar_lsar5_10",ny="_sideIndicatorBarDisabled_lsar5_15",oy="_selectAllText_lsar5_19",sy="_selectAllTextActive_lsar5_33",$o={sideIndicatorWrap:ey,sideIndicatorBar:ty,sideIndicatorBarDisabled:ny,selectAllText:oy,selectAllTextActive:sy},ry="_styleButton_pvgjc_1",iy="_styleButtonActive_pvgjc_18",ly="_lineIndicator_pvgjc_22",ay="_styleLabel_pvgjc_28",Ms={styleButton:ry,styleButtonActive:iy,lineIndicator:ly,styleLabel:ay},cy=[{value:"solid",label:"Solid",lineClass:"solid"},{value:"dashed",label:"Dashed",lineClass:"dashed"},{value:"dotted",label:"Dotted",lineClass:"dotted"}],uy=(t,n)=>{const o=n?"white":"#666";return t==="solid"?{background:o}:t==="dashed"?{background:`repeating-linear-gradient(90deg, ${o} 0px, ${o} 5px, transparent 5px, transparent 8px)`}:t==="dotted"?{background:`repeating-linear-gradient(90deg, ${o} 0px, ${o} 2px, transparent 2px, transparent 5px)`}:{}},dy=({value:t,onChange:n})=>e.jsx(ye,{gap:4,grow:!0,children:cy.map(o=>{const s=t===o.value;return e.jsxs("div",{onClick:()=>n(o.value),className:`${Ms.styleButton} ${s?Ms.styleButtonActive:""}`,style:{border:`1.5px solid ${s?"#7950f2":"#e0e0e0"}`,background:s?"#7950f2":"white"},children:[e.jsx("div",{className:Ms.lineIndicator,style:uy(o.value,s)}),e.jsx("div",{className:Ms.styleLabel,style:{color:s?"rgba(255,255,255,0.7)":"#999"},children:o.label})]},o.value)})}),fy=({value:t,active:n})=>{const o={width:"32px",height:"20px",borderRadius:"4px",background:n?"linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08))":"linear-gradient(135deg, #6b6b8a, #3d3d54)"};return t==="none"?e.jsx(p,{style:{...o,background:n?"rgba(255,255,255,0.10)":"white",border:n?"1px dashed rgba(255,255,255,0.7)":"1px dashed #999",opacity:n?1:.7}}):t==="glass"?e.jsx(p,{style:{...o,border:n?"1px solid rgba(255,255,255,0.30)":"1px solid rgba(255,255,255,0.10)",boxShadow:n?"inset 0 1.2px 0 rgba(255,255,255,0.85), inset 0 -1px 0 rgba(0,0,0,0.30)":"inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(0,0,0,0.30)"}}):t==="embossed"?e.jsx(p,{style:{...o,border:n?"1px solid rgba(255,255,255,0.25)":"1px solid rgba(255,255,255,0.12)",boxShadow:n?"inset 1px 1px 0 rgba(255,255,255,0.65), inset -1px -1px 0 rgba(0,0,0,0.32)":"inset 1px 1px 0 rgba(255,255,255,0.32), inset -1px -1px 0 rgba(0,0,0,0.32)"}}):e.jsx(p,{style:o})},hy=[{value:"none",label:"None"},{value:"glass",label:"Glass"},{value:"embossed",label:"Embossed"}],Kn=["top","bottom","left","right"],py=["#1a1a1a","#6b7280","#d1d5db","#ef4444","#3b82f6","#8b5cf6"],xy=t=>typeof t=="string"&&(t.includes("themed(")||t.startsWith("token:")||t.startsWith("gradient:")||t.startsWith("recipe:")||t.startsWith("tint:")),gy=(t,n)=>{const o=`border-${n}-width`,s=`border-${n}-style`,r=`border-${n}-color`,i=t[o],c=t[s];return{enabled:!!i&&i!=="0px"&&(!!c&&c!=="none"),width:parseInt(i)||1,style:c&&c!=="none"?c:"solid",color:t[r]||"#1a1a1a"}},my=(t,n,o)=>{const r=t==="left"||t==="right"?"180deg":"90deg",i=o||"#7950f2";return n==="solid"?{background:i}:n==="dashed"?{background:`repeating-linear-gradient(${r}, ${i} 0px, ${i}
4 6px, transparent 6px, transparent 10px)`}:n==="dotted"?{background:`repeating-linear-gradient(${r}, ${i} 0px, ${i} 3px, transparent 3px, transparent 6px)`}:{background:i}};function mo({element:t,saveNodeData:n,editor:o,styleTarget:s,onStyleTargetSaved:r}){var T,L;const i=ee(S=>S.colors),c=((L=(T=t==null?void 0:t.node)==null?void 0:T.type)==null?void 0:L.name)==="image",[u,a]=l.useState({top:{enabled:!1,width:1,style:"solid",color:"#1a1a1a"},bottom:{enabled:!1,width:1,style:"solid",color:"#1a1a1a"},left:{enabled:!1,width:1,style:"solid",color:"#1a1a1a"},right:{enabled:!1,width:1,style:"solid",color:"#1a1a1a"}}),[f,d]=l.useState("none"),h=l.useRef(null),m=l.useRef(!1),x=l.useRef(!1);l.useEffect(()=>{if(t&&t.node.attrs){h.current=t;const S=t.node.attrs.styles||{},W={};Kn.forEach(E=>{W[E]=gy(S,E)}),a(W),d(c&&S["border-effect"]||"none")}},[t,c]),l.useEffect(()=>{var W;if(!m.current||(m.current=!1,!t||!t.node.attrs||((W=h.current)==null?void 0:W.pos)!==t.pos))return;const S=t.node.attrs.styles?{...t.node.attrs.styles}:{};Kn.forEach(E=>{const P=u[E];P.enabled?(S[`border-${E}-width`]=`${P.width}px`,S[`border-${E}-style`]=P.style,S[`border-${E}-color`]=P.color):(S[`border-${E}-width`]="0px",S[`border-${E}-style`]="none",S[`border-${E}-color`]="")}),ln({editor:o,styleTarget:s,nextStyles:S,element:t,saveNodeData:n,onStyleTargetSaved:r})},[u,o,t,r,n,s]),l.useEffect(()=>{var W;if(!x.current||(x.current=!1,!c)||!t||!t.node.attrs||((W=h.current)==null?void 0:W.pos)!==t.pos)return;const S=t.node.attrs.styles?{...t.node.attrs.styles}:{};f&&f!=="none"?S["border-effect"]=f:s?S["border-effect"]="":delete S["border-effect"],ln({editor:o,styleTarget:s,nextStyles:S,element:t,saveNodeData:n,onStyleTargetSaved:r})},[f,c,o,t,r,n,s]);const g=S=>{x.current=!0,d(S)},w=S=>{m.current=!0,a(W=>({...W,[S]:{...W[S],enabled:!W[S].enabled}}))},b=()=>{const S=!v,W={};Kn.forEach(E=>{W[E]={...u[E],enabled:S}}),m.current=!0,a(W)},j=(S,W)=>{const E={};Kn.forEach(P=>{E[P]={...u[P],[S]:W}}),m.current=!0,a(E)},A=Kn.some(S=>u[S].enabled),v=Kn.every(S=>u[S].enabled),k=Kn.find(S=>u[S].enabled),C=k?u[k].width:1,I=k?u[k].style:"solid",_=k?u[k].color:"#1a1a1a",R=S=>xy(S)?Zt(S,i):S,F=R(_),G=(S,W)=>{const E=u[S].enabled,P=S==="left"||S==="right";let $;return E?$=my(S,u[S].style,R(u[S].color)):$={backgroundColor:"#ddd"},e.jsx(p,{onClick:()=>w(S),className:$o.sideIndicatorWrap,style:W,children:e.jsx(p,{className:`${$o.sideIndicatorBar} ${E?"":$o.sideIndicatorBarDisabled}`,style:{width:P?"3px":"100%",height:P?"100%":"3px",...$}})})};return e.jsxs(p,{children:[e.jsxs(p,{style:{position:"relative",width:"100%",height:"72px",marginBottom:"10px",backgroundColor:"transparent"},children:[e.jsx(p,{style:{position:"absolute",top:"14px",left:"14px",right:"14px",bottom:"14px",backgroundColor:"#f8f8f8",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",borderTop:u.top.enabled?`${u.top.width}px ${u.top.style} ${R(u.top.color)}`:"0px none transparent",borderBottom:u.bottom.enabled?`${u.bottom.width}px ${u.bottom.style} ${R(u.bottom.color)}`:"0px none transparent",borderLeft:u.left.enabled?`${u.left.width}px ${u.left.style} ${R(u.left.color)}`:"0px none transparent",borderRight:u.right.enabled?`${u.right.width}px ${u.right.style} ${R(u.right.color)}`:"0px none transparent",transition:"all 0.2s ease"},children:e.jsx(p,{onClick:b,className:`${$o.selectAllText} ${v?$o.selectAllTextActive:""}`,children:v?"Deselect All":"Select All"})}),G("top",{top:0,left:"28px",right:"28px",height:"14px"}),G("bottom",{bottom:0,left:"28px",right:"28px",height:"14px"}),G("left",{left:0,top:"28px",bottom:"28px",width:"14px"}),G("right",{right:0,top:"28px",bottom:"28px",width:"14px"})]}),e.jsx(p,{style:{overflow:"hidden",transition:"max-height 0.25s ease, opacity 0.2s ease",maxHeight:A?"300px":"0px",opacity:A?1:0,pointerEvents:A?"auto":"none"},children:A&&e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(dy,{value:I,onChange:S=>j("style",S)}),e.jsx(He,{label:"Width",value:C,onChange:S=>j("width",S),min:1,max:20,unit:"px"}),e.jsx(bn,{label:"Color",colors:py,value:F,onChange:S=>j("color",S)})]})}),c&&e.jsxs(p,{style:{marginTop:A?"16px":"0",paddingTop:A?"14px":"0",borderTop:A?"1px solid #ececec":"none"},children:[e.jsx(p,{style:{fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:"8px"},children:"Effect"}),e.jsx(ye,{gap:6,grow:!0,children:hy.map(S=>e.jsx(Be,{icon:e.jsx(fy,{value:S.value,active:f===S.value}),label:S.label,value:S.value,active:f===S.value,onClick:()=>g(S.value)},S.value))})]})]})}
4const by=["rgba(0,0,0,0.1)","rgba(0,0,0,0.25)","rgba(0,0,0,0.4)","rgba(0,0,0,1)","rgba(59,130,246,0.3)"],Ns={none:e.jsx($f,{size:22,strokeWidth:1.5}),subtle:e.jsx(Lf,{size:22,strokeWidth:1.5}),strong:e.jsx(Ff,{size:22,strokeWidth:1.5}),custom:e.jsx(Wf,{size:22,strokeWidth:1.5})},Do=t=>{if(!t||t==="none")return{x:0,y:4,blur:8,spread:0,color:"rgba(0,0,0,0.2)"};const n=/^(-?\d+)px\s+(-?\d+)px\s+(\d+)px\s+(-?\d+)px\s+(.+)$/,o=t.match(n);return o?{x:parseInt(o[1]),y:parseInt(o[2]),blur:parseInt(o[3]),spread:parseInt(o[4]),color:o[5]}:{x:0,y:4,blur:8,spread:0,color:"rgba(0,0,0,0.2)"}},yy=(t,n,o,s,r)=>`${t}px ${n}px ${o}px ${s}px ${r}`,vy=t=>{if(!t||t==="none")return"none";const n="0px 2px 4px 0px rgba(0,0,0,0.1)",o="0px 4px 12px 0px rgba(0,0,0,0.25)";return t===n?"subtle":t===o?"strong":"custom"};function bo({element:t,saveNodeData:n,editor:o,styleTarget:s,onStyleTargetSaved:r}){var b,j,A,v,k,C;const[i,c]=l.useState("none"),[u,a]=l.useState({x:0,y:4,blur:8,spread:0,color:"rgba(0,0,0,0.2)"}),f=l.useRef(!1),d=l.useRef(!1),h=!!((b=t==null?void 0:t.node)!=null&&b.attrs),m=(A=(j=t==null?void 0:t.node)==null?void 0:j.attrs)==null?void 0:A.uid,x=((C=(k=(v=t==null?void 0:t.node)==null?void 0:v.attrs)==null?void 0:k.styles)==null?void 0:C["box-shadow"])||"";l.useEffect(()=>{if(h){f.current=null;const I=m;setTimeout(()=>{f.current=I},0);const _=vy(x);c(_),_==="custom"?a(Do(x)):_==="subtle"?a(Do("0px 2px 4px 0px rgba(0,0,0,0.1)")):_==="strong"&&a(Do("0px 4px 12px 0px rgba(0,0,0,0.25)"))}},[m,h,x]),l.useEffect(()=>{if(!d.current||(d.current=!1,!t||!t.node.attrs||t&&t.node.attrs&&f.current!=t.node.attrs.uid))return;const I=t.node.attrs.styles?{...t.node.attrs.styles}:{};i==="none"?I["box-shadow"]="none":i==="subtle"?I["box-shadow"]="0px 2px 4px 0px rgba(0,0,0,0.1)":i==="strong"?I["box-shadow"]="0px 4px 12px 0px rgba(0,0,0,0.25)":i==="custom"&&(I["box-shadow"]=yy(u.x,u.y,u.blur,u.spread,u.color)),ln({editor:o,styleTarget:s,nextStyles:I,element:t,saveNodeData:n,onStyleTargetSaved:r})},[i,u,o,t,r,n,s]);const g=I=>{d.current=!0,c(I),I==="subtle"?a(Do("0px 2px 4px 0px rgba(0,0,0,0.1)")):I==="strong"&&a(Do("0px 4px 12px 0px rgba(0,0,0,0.25)"))},w=(I,_)=>{d.current=!0,a({...u,[I]:_}),c("custom")};return e.jsxs(p,{children:[e.jsxs(ye,{gap:6,grow:!0,mb:12,children:[e.jsx(Be,{icon:Ns.none,label:"None",value:"none",active:i==="none",onClick:()=>g("none")}),e.jsx(Be,{icon:Ns.subtle,label:"Subtle",value:"subtle",active:i==="subtle",onClick:()=>g("subtle")}),e.jsx(Be,{icon:Ns.strong,label:"Strong",value:"strong",active:i==="strong",onClick:()=>g("strong")}),e.jsx(Be,{icon:Ns.custom,label:"Custom",value:"custom",active:i==="custom",onClick:()=>g("custom")})]}),i==="custom"&&e.jsxs(p,{style:{padding:"10px",background:"#f8f8f8",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsxs(ye,{gap:6,grow:!0,children:[e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[e.jsx(p,{style:{fontSize:"9px",color:"#999",fontWeight:600,textTransform:"uppercase"},children:"X"}),e.jsx(Rt,{value:u.x,onChange:I=>w("x",I),min:-50,max:50,hideControls:!0,style:{"& input":{padding:"5px 4px",border:"1.5px solid #e0e0e0",borderRadius:"6px",fontSize:"12px",fontWeight:600,textAlign:"center"}}})]}),e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[e.jsx(p,{style:{fontSize:"9px",color:"#999",fontWeight:600,textTransform:"uppercase"},children:"Y"}),e.jsx(Rt,{value:u.y,onChange:I=>w("y",I),min:-50,max:50,hideControls:!0,style:{"& input":{padding:"5px 4px",border:"1.5px solid #e0e0e0",borderRadius:"6px",fontSize:"12px",fontWeight:600,textAlign:"center"}}})]}),e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[e.jsx(p,{style:{fontSize:"9px",color:"#999",fontWeight:600,textTransform:"uppercase"},children:"Blur"}),e.jsx(Rt,{value:u.blur,onChange:I=>w("blur",I),min:0,max:100,hideControls:!0,style:{"& input":{padding:"5px 4px",border:"1.5px solid #e0e0e0",borderRadius:"6px",fontSize:"12px",fontWeight:600,textAlign:"center"}}})]}),e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[e.jsx(p,{style:{fontSize:"9px",color:"#999",fontWeight:600,textTransform:"uppercase"},children:"Spread"}),e.jsx(Rt,{value:u.spread,onChange:I=>w("spread",I),min:-50,max:50,hideControls:!0,style:{"& input":{padding:"5px 4px",border:"1.5px solid #e0e0e0",borderRadius:"6px",fontSize:"12px",fontWeight:600,textAlign:"center"}}})]})]}),e.jsx(bn,{label:"Color",colors:by,value:u.color,onChange:I=>w("color",I)})]})]})}const jy="_alignBtn_1k8xx_1",ky="_alignBtnActive_1k8xx_7",wy="_alignBtnInactive_1k8xx_19",hn={alignBtn:jy,alignBtnActive:ky,alignBtnInactive:wy};function Cy({element:t,saveNodeData:n}){var m,x,g;const o=ee(w=>w.tiptap),[s,r]=l.useState("left"),i=l.useRef(!1),{breakpoint:c}
4=Et(),u=((x=(m=t==null?void 0:t.node)==null?void 0:m.type)==null?void 0:x.name)||"",a=c!=="desktop"&&!!u&&rs(u).has("text-align"),f=a&&is((g=t==null?void 0:t.node)==null?void 0:g.attrs,"text-align",c);l.useEffect(()=>{if(!(!t||!t.node.attrs)){if(a){r(wo(t.node.attrs,"text-align",c)||t.node.attrs.textAlign||"left");return}r(t.node.attrs.textAlign||"left")}},[t,c,a]),l.useEffect(()=>{if(!i.current||(i.current=!1,!t||!t.node.attrs)||!(o!=null&&o.editor))return;if(a){us(o.editor,t,c,{"text-align":s});return}const w=t.node.type.name;if(w.indexOf("grid")<0&&w!=="column"&&w!=="customform")o.editor.commands.setTextAlign(s);else{const b=o.editor.view.state.doc.nodeAt(t.pos);if(!b)return;const{tr:j}=o.editor.view.state;j.setNodeMarkup(t.pos,void 0,{...b.attrs,textAlign:s}),o.editor.view.dispatch(j)}clearTimeout(window._alignmentDebounce),window._alignmentDebounce=setTimeout(()=>n(),2e3)},[s]);const d=w=>{i.current=!0,r(w)},h=()=>{var w,b;!a||!(o!=null&&o.editor)||(ds(o.editor,t,c,["text-align"]),r(((b=(w=t==null?void 0:t.node)==null?void 0:w.attrs)==null?void 0:b.textAlign)||"left"))};return e.jsxs(e.Fragment,{children:[f&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:6},children:e.jsx(Jn,{onClick:h})}),e.jsxs(ye,{gap:6,grow:!0,wrap:"nowrap",children:[e.jsx(Fs,{onClick:()=>d("left"),variant:s==="left"?"filled":"outline",color:s==="left"?"sutrablue":"gray",className:`${hn.alignBtn} ${s==="left"?hn.alignBtnActive:hn.alignBtnInactive}`,children:e.jsx(Bf,{size:18,strokeWidth:1.5})}),e.jsx(Fs,{onClick:()=>d("center"),variant:s==="center"?"filled":"outline",color:s==="center"?"sutrablue":"gray",className:`${hn.alignBtn} ${s==="center"?hn.alignBtnActive:hn.alignBtnInactive}`,children:e.jsx(_f,{size:18,strokeWidth:1.5})}),e.jsx(Fs,{onClick:()=>d("right"),variant:s==="right"?"filled":"outline",color:s==="right"?"sutrablue":"gray",className:`${hn.alignBtn} ${s==="right"?hn.alignBtnActive:hn.alignBtnInactive}`,children:e.jsx(Ef,{size:18,strokeWidth:1.5})})]})]})}function Sy({editor:t,element:n,resizeable:o,saveNodeData:s}){const r=ee(b=>b.tiptap),i=t||(r==null?void 0:r.editor),[c,u]=l.useState("tiptap-size-100"),[a,f]=l.useState(!1),[d,h]=l.useState(100),m=l.useRef(!1),x=[{label:"Full",value:"tiptap-size-100"},{label:"75%",value:"tiptap-size-75"},{label:"50%",value:"tiptap-size-50"},{label:"Auto",value:"tiptap-size-actual"},{label:"Custom",value:"custom"}],g=b=>{b==="custom"?(f(!0),u("custom")):(m.current=!0,f(!1),u(b),b==="tiptap-size-100"?h(100):b==="tiptap-size-75"?h(75):b==="tiptap-size-50"&&h(50))},w=b=>{m.current=!0,h(b)};return l.useEffect(()=>{if(!m.current||(m.current=!1,!n||!n.node.attrs)||!i||i.isDestroyed)return;const b=n,j=b.node.type.name;if(j.indexOf("grid")<0&&j!=="column"&&j!=="customform")if(o&&c){let A;a?A=d:A=c.replace("tiptap-size-",""),i.commands.updateAttributes(j,{resizeableWidth:`${A}%`,resizeableHeight:"98%",resizeableParentHeight:"unset"})}else i.commands.setCustomSize(a?`tiptap-size-${d}`:c);else{const A=i.view.state.doc.nodeAt(b.pos);if(!A)return;const{tr:v}=i.view.state,k=a?`tiptap-size-${d}`:c;v.setNodeMarkup(b.pos,void 0,{...A.attrs,class:k}),i.view.dispatch(v)}clearTimeout(window._widthDebounce),window._widthDebounce=setTimeout(()=>s(),2e3)},[i,a,d,n,o,s,c]),l.useEffect(()=>{if(!n||!n.node.attrs)return;const b=n.node.attrs.resizeableWidth;if(b){const j=parseInt(b);j===100?(u("tiptap-size-100"),h(100),f(!1)):j===75?(u("tiptap-size-75"),h(75),f(!1)):j===50?(u("tiptap-size-50"),h(50),f(!1)):(u("custom"),h(j),f(!0))}else{const j=n.node.attrs.class||"tiptap-size-100";if(j==="tiptap-size-100"||j==="tiptap-size-75"||j==="tiptap-size-50"||j==="tiptap-size-25"||j==="tiptap-size-actual")u(j),f(!1);else{const A=j.match(/tiptap-size-(\d+)/);A?(u("custom"),h(parseInt(A[1])),f(!0)):(u(j),f(!1))}}},[n]),e.jsxs(p,{children:[e.jsx(Pe,{options:x,activeValue:a?"custom":c,onChange:g,columns:5}),a&&e.jsx(p,{mt:12,children:e.jsx(He,{label:"Width",value:d,onChange:w,min:1,max:100,unit:"%"})})]})}const Ty="_focalDot_mvpsw_1",Iy="_focalDotActive_mvpsw_13",_y="_ratioInput_mvpsw_24",Ay="_ratioInputField_mvpsw_27",Gn={focalDot:Ty,focalDotActive:Iy,ratioInput:_y,ratioInputField:Ay},Su=[{value:null,label:"Original",icon:e.jsx("span",{style:{fontSize:9,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1},children:"None"})},{value:"1/1",label:"Square",icon:e.jsx("svg",{viewBox:"0 0 32 22",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:e.jsx("rect",{x:"8",y:"3",width:"16",height:"16",rx:"2"})})},{value:"4/5",label:"Portrait",icon:e.jsx("svg",{viewBox:"0 0 32 22",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:e.jsx("rect",{x:"10",y:"2",width:"12",height:"18",rx:"2"})})},{value:"16/9",label:"Wide",icon:e.jsx("svg",{viewBox:"0 0 32 22",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:e.jsx("rect",{x:"3",y:"6",width:"26",height:"10",rx:"2"})})},{value:"custom",label:"Custom",icon:e.jsx("svg",{viewBox:"0 0 32 22",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:e.jsx("rect",{x:"6",y:"3",width:"20",height:"16",rx:"2",strokeDasharray:"3 2"})})}],dc=[{pos:"0% 0%",label:"Top left"},{pos:"50% 0%",label:"Center top"},{pos:"100% 0%",label:"Top right"},{pos:"0% 50%",label:"Center left"},{pos:"50% 50%",label:"Center"},{pos:"100% 50%",label:"Center right"},{pos:"0% 100%",label:"Bottom left"},{pos:"50% 100%",label:"Center bottom"},{pos:"100% 100%",label:"Bottom right"}];function fc(t){if(typeof t!="string"||!t)return{w:4,h:5};if(t==="custom")return{w:4,h:5};if(t.includes("/")){const[n,o]=t.split("/").map(s=>parseInt(s.trim(),10));if(n>0&&o>0)return{w:n,h:o}}return{w:4,h:5}}function Fo(t){if(typeof t!="string"||!t)return{x:50,y:50};const n=t.replace(/%/g,"").trim().split(/\s+/).map(Number);return n.length!==2||n.some(isNaN)?{x:50,y:50}:{x:Math.max(0,Math.min(100,Math.round(n[0]))),y:Math.max(0,Math.min(100,Math.round(n[1])))}}function hc(t){if(!t)return"original";for(const n of Su)if(n.value&&n.value!=="custom"&&n.value===t)return n.value;return"custom"}function By(t){var L,S,W;Dt();const n=ee(E=>E.tiptap),o=t.editor||(n==null?void 0:n.editor),s=l.useRef(null),r=l.useRef(!1),i=l.useRef(null),[c,u]=l.useState("original"),[a,f]=l.useState({w:4,h:5}),[d,h]=l.useState({x:50,y:50});l.useEffect(()=>{var Q,B;if(!((B=(Q=t.element)==null?void 0:Q.node)!=null&&B.attrs))return;const E=t.element.node.attrs,P=E.uid,$=P!==i.current;if(i.current=P,$){r.current=!1;const O=E.aspectRatio,K=hc(O);u(K==="original"?"original":K),f(fc(O)),h(Fo(E.objectPosition));return}if(r.current||c==="custom")return;const X=E.aspectRatio,q=hc(X);u(q==="original"?"original":q),f(fc(X)),h(Fo(E.objectPosition))},[t.element]),l.useEffect(()=>{var Q,B;if(!r.current||(r.current=!1,!((B=(Q=t.element)==null?void 0:Q.node)!=null&&B.attrs)||!o))return;const E=t.element,P=o.view.state.doc.nodeAt(E.pos);if(!P)return;let $=null;if(c==="custom"){const O=parseInt(a.w,10),K=parseInt(a.h,10);
4$=O>0&&K>0?`${O}/${K}`:null}else c!=="original"&&($=c);const X=$?`${d.x}% ${d.y}%`:null,{tr:q}=o.view.state;q.setNodeMarkup(E.pos,void 0,{...P.attrs,aspectRatio:$,objectPosition:X}),o.view.dispatch(q),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{var O;s.current=null,(O=t.saveNodeData)==null||O.call(t)},2e3)},[c,a,d]);const m=E=>{r.current=!0,u(E===null?"original":E)},x=(E,P)=>{r.current=!0;const $=Math.max(1,Math.min(100,parseInt(P,10)||1));f(X=>({...X,[E]:$}))},g=E=>{r.current=!0;const{x:P,y:$}=Fo(E);h({x:P,y:$})},w=(E,P)=>{r.current=!0;const $=Math.max(0,Math.min(100,parseInt(P,10)||0));h(X=>({...X,[E]:$}))},b=`${d.x}% ${d.y}%`,j=dc.find(E=>{const P=Fo(E.pos);return P.x===d.x&&P.y===d.y}),A=j?j.label:"Custom",v=c!=="original",k=typeof((W=(S=(L=t.element)==null?void 0:L.node)==null?void 0:S.attrs)==null?void 0:W.src)=="string"&&t.element.node.attrs.src.length>0?t.element.node.attrs.src:null;c==="custom"?`${a.w}${a.h}`:c!=="original"&&c.replace("/"," / ");const C=140,I=160,_=(()=>{if(c==="custom"){const E=parseInt(a.w,10),P=parseInt(a.h,10);return E>0&&P>0?E/P:1}if(c!=="original"){const[E,P]=c.split("/").map(Number);return E>0&&P>0?E/P:1}return 4/5})(),R=C/I,F=_>R,G=F?C:Math.round(I*_),T=F?Math.round(C/_):I;return e.jsxs(p,{children:[e.jsx(ye,{gap:6,grow:!0,children:Su.map(E=>
4e.jsx(Be,{icon:E.icon,label:null,value:E.value,active:E.value===null&&c==="original"||E.value===c,onClick:()=>m(E.value)},E.value||"original"))}),c==="custom"&&e.jsxs(p,{mt:10,style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(p,{style:{fontSize:"11px",color:"#666",width:"40px"},children:"Ratio"}),e.jsx(Rt,{value:a.w,onChange:E=>x("w",E),min:1,max:100,hideControls:!0,size:"xs",className:Gn.ratioInput,classNames:{input:Gn.ratioInputField}}),e.jsx(N,{style:{fontSize:"14px",fontWeight:700,color:"#888"},children:":"}),e.jsx(Rt,{value:a.h,onChange:E=>x("h",E),min:1,max:100,hideControls:!0,size:"xs",className:Gn.ratioInput,classNames:{input:Gn.ratioInputField}})]}),v&&e.jsxs(p,{mt:14,children:[e.jsx(p,{style:{fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",color:"#868e96",marginBottom:8},children:"Focus point"}),e.jsxs(p,{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12,alignItems:"center",background:"#fafafa",border:"1px solid #efefef",borderRadius:8,padding:"10px 12px"},children:[e.jsx(p,{style:{height:I,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsxs(p,{style:{position:"relative",width:G,height:T,background:"#f8f8f8",border:"1.5px solid #e0e0e0",borderRadius:"8px",overflow:"hidden",transition:"width 0.2s ease, height 0.2s ease"},children:[k?e.jsx(p,{style:{position:"absolute",inset:0,backgroundImage:`url(${k})`,backgroundSize:"cover",backgroundPosition:b,opacity:.55,transition:"background-position 0.25s ease"}}):null,e.jsx(p,{style:{position:"absolute",inset:0,display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr 1fr"},children:dc.map(E=>{const P=Fo(E.pos),$=P.x===d.x&&P.y===d.y;return e.jsx(p,{onClick:()=>g(E.pos),style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:e.jsx(p,{className:$?`${Gn.focalDot} ${Gn.focalDotActive}`:Gn.focalDot})},E.pos)})})]})}),e.jsxs(p,{style:{fontSize:"11px",color:"#666",lineHeight:1.55},children:[e.jsx(p,{style:{color:"#888",fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.4px",fontWeight:700,marginBottom:4},children:"Anchor"}),e.jsx(p,{children:A}),e.jsx(p,{style:{display:"inline-block",background:"rgba(121, 80, 242,0.10)",color:"#1a8fc4",padding:"1px 6px",borderRadius:4,fontSize:"10px",fontWeight:600,marginTop:4,fontFamily:"monospace"},children:b})]})]}),e.jsxs(p,{mt:12,children:[e.jsx(He,{label:"X",value:d.x,min:0,max:100,unit:"%",onChange:E=>w("x",E)}),e.jsx(p,{mt:6,children:e.jsx(He,{label:"Y",value:d.y,min:0,max:100,unit:"%",onChange:E=>w("y",E)})})]})]})]})}const ni=(t,n)=>n==="desktop"?t:`${n==="tablet"?"tablet":"mobile"}${t.charAt(0).toUpperCase()}${t.slice(1)}`,pc=(t,n,o)=>{var i,c,u;const s=(i=t==null?void 0:t[n])!=null?i:20;if(o==="desktop")return s;const r=(c=t==null?void 0:t[ni(n,"tablet")])!=null?c:s;return o==="tablet"?r:(u=t==null?void 0:t[ni(n,"mobile")])!=null?u:r};function er({element:t,editor:n,saveNodeData:o,styleTarget:s,onStyleTargetSaved:r,attr:i="gap"}){var k,C;const[c,u]=l.useState(20),[a,f]=l.useState(!1),d=l.useRef(!1),{breakpoint:h}=Et(),g=((C=(k=t==null?void 0:t.node)==null?void 0:k.type)==null?void 0:C.name)==="gridx"&&(i==="columnGap"||i==="rowGap")?h:"desktop",w=ni(i,g),b=i==="gap"?"_columnGapDebounce":`_columnGapDebounce_${w}`,j=[{label:"0",value:0},{label:"10",value:10},{label:"20",value:20},{label:"30",value:30},{label:"40",value:40},{label:"60",value:60}];l.useEffect(()=>{if(t&&t.node.attrs){const I=n!=null&&n.view?St(n,t).node:null,_=(I==null?void 0:I.attrs)||t.node.attrs,R=Number.parseFloat(pc(_,i,g));u(Number.isFinite(R)?R:20),f(g!=="desktop"&&(_==null?void 0:_[w])!=null)}},[t,n,i,w,g]),l.useEffect(()=>{!d.current||(d.current=!1,!(s?$t({editor:n,element:t,styleTarget:s,attrs:{[w]:c}}):be(n,t,{[w]:c})))||(g!=="desktop"&&f(!0),clearTimeout(window[b]),window[b]=setTimeout(()=>{var _;(_=s?r:o)==null||_()},2e3))},[c,n,t,r,o,s,w,g,b]);const A=I=>{d.current=!0,u(I)},v=()=>{var G;const I=n!=null&&n.view?St(n,t).node:null,_=(I==null?void 0:I.attrs)||((G=t==null?void 0:t.node)==null?void 0:G.attrs)||{};if(!(s?$t({editor:n,element:t,styleTarget:s,attrs:{[w]:null}}):be(n,t,{[w]:null})))return;const F=g==="mobile"?"tablet":"desktop";u(Number.parseFloat(pc(_,i,F))||0),f(!1),clearTimeout(window[b]),window[b]=setTimeout(()=>{var T;(T=s?r:o)==null||T()},2e3)};return e.jsxs(p,{children:[e.jsx(Pe,{options:j,activeValue:c,onChange:A,columns:6}),e.jsx(p,{mt:12,children:e.jsx(He,{label:"Gap",value:c,onChange:A,min:0,max:60,unit:"px"})}),g!=="desktop"&&a&&e.jsx(p,{mt:8,style:{textAlign:"right"},children:e.jsx(Yc,{component:"button",type:"button",size:"xs",onClick:v,children:g==="mobile"?"Use tablet/desktop gap":"Use desktop gap"})})]})}function Tu(t){return e.jsx(er,{...t,attr:"rowGap"})}const xc={tablet:[{id:"inherit",title:"Same as desktop",sub:"Keep the desktop column layout",mini:"row",isDefault:!0},{id:"stack",title:"Stack",sub:"Single column",mini:"stack"},{id:"custom",title:"Customize",sub:"Design a tablet-specific layout",mini:"row2"}],mobile:[{id:"stack",title:"Stack",sub:"Single column — the safe default",mini:"stack",isDefault:!0},{id:"inherit",title:"Same as desktop",sub:"Keep desktop columns (careful on small screens)",mini:"row"},{id:"custom",title:"Customize",sub:"Design a mobile-specific layout",mini:"row2"}]},Ir={background:"#e5dbff",borderRadius:2};function Ry({kind:t}){if(t==="stack")return e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:2,height:20,width:46,marginLeft:"auto",flexShrink:0},children:[e.jsx(p,{style:{...Ir,flex:1}}),e.jsx(p,{style:{...Ir,flex:1}})]});const n=t==="row2"?[2,1]:[1,1,1];return e.jsx(p,{style:{display:"flex",gap:2,height:20,width:46,marginLeft:"auto",flexShrink:0},children:n.map((o,s)=>e.jsx(p,{style:{...Ir,flex:o,height:"100%"}},s))})}function Ey({breakpoint:t="tablet",value:n,onChange:o}){const s=xc[t]||xc.tablet;return e.jsx(p,{style:{display:"flex",flexDirection:"column",gap:8},children:s.map(r=>{const i=n===r.id;return e.jsxs(p,{onClick:()=>
4o==null?void 0:o(r.id),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 11px",borderRadius:10,cursor:"pointer",border:`1.5px solid ${i?"#7950f2":"#e0e0e0"}`,backgroundColor:i?"#f3f0ff":"white"},children:[e.jsx(p,{style:{width:14,height:14,borderRadius:"50%",flexShrink:0,border:`2px solid ${i?"#7950f2":"#e0e0e0"}`,backgroundColor:"white",boxShadow:i?"inset 0 0 0 3px white, inset 0 0 0 8px #7950f2":"none"}}),e.jsxs(p,{style:{minWidth:0},children:[e.jsxs(p,{style:{fontSize:"12px",fontWeight:700,color:i?"#333":"#555"},children:[r.title,r.isDefault&&e.jsx("span",{style:{fontWeight:500,color:"#999"},children:" (default)"})]}),e.jsx(p,{style:{fontSize:"10.5px",color:"#999",fontWeight:500},children:r.sub})]}),e.jsx(Ry,{kind:r.mini})]},r.id)})})}const zy=[1,2,3,4,5,6].map(t=>({label:String(t),value:t})),Ly=[{id:"ratio",label:"Custom ratio",bars:[{flex:2},{flex:1}]},{id:"fixedLeft",label:"Fixed sidebar",bars:[{width:"26%"},{flex:1}]},{id:"fixedRight",label:"Fixed right",bars:[{flex:1},{width:"26%"}]},{id:"autoLeft",label:"Auto + flexible",bars:[{width:"16%"},{flex:1}]},{id:"autoFit",label:"Auto-fit cards",bars:[{flex:1},{flex:1},{flex:1}]},{id:"custom",label:"Custom tracks",bars:[{flex:1},{flex:3},{width:"18%"}]}],_r={fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},Ar=120,gc=480,mc=10;function Py({layout:t={},onEqualColumns:n,onPresetChange:o,onMinCardWidthChange:s}
4){const{preset:r="equal",columns:i=2,minCardWidth:c=240}=t,u=a=>{const f=Math.round((Number(a)||Ar)/mc)*mc;s==null||s(Math.min(Math.max(f,Ar),gc))};return e.jsxs(p,{children:[e.jsx(p,{style:_r,children:"Equal columns"}),e.jsx(Pe,{options:zy,activeValue:r==="equal"?i:void 0,onChange:a=>n==null?void 0:n(a),columns:6}),e.jsx(p,{style:{..._r,marginTop:14},children:"Presets"}),e.jsx(as,{cols:2,spacing:8,children:Ly.map(a=>{const f=r===a.id;return e.jsxs(p,{onClick:()=>o==null?void 0:o(a.id),style:{border:`1.5px solid ${f?"#7950f2":"#e0e0e0"}`,backgroundColor:f?"#f3f0ff":"white",borderRadius:10,padding:"9px 9px 8px",cursor:"pointer"},children:[e.jsx(p,{style:{display:"flex",gap:3,height:22,marginBottom:6},children:a.bars.map((d,h)=>e.jsx(p,{style:{...d,backgroundColor:f?"#7950f2":"#e5dbff",opacity:f?.55:1,borderRadius:3,height:"100%"}},h))}),e.jsx(p,{style:{fontSize:"11px",fontWeight:600,color:f?"#333":"#888"},children:a.label})]},a.id)})}),r==="autoFit"&&e.jsxs(p,{mt:14,children:[e.jsx(p,{style:_r,children:"Minimum card width"}),e.jsx(He,{label:"Min",value:c,onChange:u,min:Ar,max:gc,unit:"px"})]})]})}const Wy=[{value:"fr",label:"Flexible (fr)"},{value:"px",label:"Fixed (px)"},{value:"%",label:"Percent (%)"},{value:"auto",label:"Auto (content)"}],oi={fr:{min:.5,max:12,step:.5,seed:1},px:{min:40,max:1200,step:10,seed:200},"%":{min:1,max:100,step:1,seed:25}},bc=(t,n)=>{const o=oi[t];if(!o)return null;const s=Number.parseFloat(n);return Number.isFinite(s)?Math.min(Math.max(s,o.min),o.max):null};function Oy({tracks:t=[],onChange:n}){const o=u=>{u.every(Id)&&(n==null||n(u))},s=(u,a)=>{var d,h;if(!a)return;const f=t.map(m=>({...m}));f[u]=a==="auto"?{unit:"auto"}:{unit:a,value:(h=bc(a,(d=f[u])==null?void 0:d.value))!=null?h:oi[a].seed},o(f)},r=(u,a)=>{var m;const f=(m=t[u])==null?void 0:m.unit;if(f==="auto")return;const d=bc(f,a);if(d==null)return;const h=t.map(x=>({...x}));h[u]={unit:f,value:d},o(h)},i=u=>{t.length<=1||o(t.filter((a,f)=>f!==u).map(a=>({...a})))},c=()=>{t.length>=Is||o([...t.map(u=>({...u})),{unit:"fr",value:1}])};return e.jsxs(p,{children:[e.jsx(p,{style:{display:"flex",flexDirection:"column",gap:7},children:t.map((u,a)=>{const f=oi[u.unit];return e.jsxs(ye,{gap:7,wrap:"nowrap",align:"center",children:[e.jsx(p,{style:{fontSize:"11px",fontWeight:700,color:"#999",width:14,textAlign:"center",flexShrink:0},children:a+1}),e.jsx(jt,{data:Wy,value:u.unit,onChange:d=>s(a,d),size:"xs",allowDeselect:!1,comboboxProps:{withinPortal:!1},style:{flex:1,minWidth:0}}),e.jsx(Rt,{value:u.unit==="auto"?"":u.value,onChange:d=>r(a,d),disabled:u.unit==="auto",min:f==null?void 0:f.min,max:f==null?void 0:f.max,step:(f==null?void 0:f.step)||1,hideControls:!0,size:"xs",style:{width:60,flexShrink:0}}),e.jsx(_a,{onClick:()=>i(a),disabled:t.length<=1,title:"Remove track",style:{width:24,height:24,borderRadius:7,flexShrink:0,textAlign:"center",fontSize:"13px",lineHeight:"24px",color:t.length<=1?"#e0e0e0":"#999",cursor:t.length<=1?"default":"pointer"},children:"✕"})]},a)})}),e.jsx(_a,{onClick:c,disabled:t.length>=Is,style:{marginTop:9,width:"100%",padding:"7px 0",borderRadius:8,border:"1.5px dashed #e0e0e0",textAlign:"center",fontSize:"11px",fontWeight:600,color:t.length>=Is?"#ccc":"#888",cursor:t.length>=Is?"default":"pointer"},children:"+ Add track"})]})}const My=new Set(["ratio","fixedLeft","fixedRight","autoLeft","custom"]),Br={fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},Ny={width:6,height:6,borderRadius:"50%",background:"#e64980",display:"inline-block",flexShrink:0},$y=t=>Array.isArray(t)?t.map(n=>({...n})):null,Rr=(t,n)=>{const o={preset:t.preset||"equal",columns:t.columns||2,tracks:$y(t.tracks),minCardWidth:t.minCardWidth||240};return n==="mobile"&&o.preset==="equal"&&o.columns>2&&(o.columns=2),o};function Iu({element:t,editor:n,saveNodeData:o,styleTarget:s,onStyleTargetSaved:r}){var Y,H;const{t:i}=Qt(),{breakpoint:c,setBreakpoint:u,hasProvider:a}=Et(),[f,d]=l.useState("desktop"),h=a?c:f,m=a?u:d,[,x]=l.useState(0),g=l.useRef(null);l.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);
4const b=St(n,t).node||(t==null?void 0:t.node)||null,j=(b==null?void 0:b.attrs)||{},A=(Y=b==null?void 0:b.childCount)!=null?Y:0,v=()=>{g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{var D;g.current=null,(D=s?r:o)==null||D()},2e3)},k=D=>(s?$t({editor:n,element:t,styleTarget:s,attrs:D}):be(n,t,D))?(x(Ie=>Ie+1),v(),!0):!1,C=()=>{x(D=>D+1),v()},I=_d.includes(j.tabletMode)?j.tabletMode:"inherit",_=Ad.includes(j.mobileMode)?j.mobileMode:"stack",R=h==="tablet"?I:h==="mobile"?_:null,F={preset:j.preset||"equal",columns:j.columns||2,tracks:(H=j.tracks)!=null?H:null,minCardWidth:j.minCardWidth||240},G=h==="desktop"?F:j[`${h}Layout`]||Rr(j,h),T=h==="desktop"||R==="custom",L=T&&My.has(G.preset),S=L?G.tracks||wa(G.preset,G.columns)||[]:[],W=D=>{if(h==="desktop"){k(D);return}const ne=`${h}Layout`,Ie=j[ne]||Rr(j,h);k({[ne]:{...Ie,...D}})},E=D=>{if(h==="desktop")return;const ne=`${h}Mode`,Ie=`${h}Layout`,Ke={[ne]:D};D==="custom"&&!j[Ie]&&(Ke[Ie]=Rr(j,h)),k(Ke)},P=()=>{h==="tablet"?k({tabletMode:"inherit",tabletLayout:null,tabletColumnGap:null,tabletRowGap:null}):h==="mobile"&&k({mobileMode:"stack",mobileLayout:null,mobileColumnGap:null,mobileRowGap:null})},$=D=>{if(W({preset:"equal",columns:D,tracks:null}),h==="desktop"){const{pos:ne}=St(n,t);ne!=null&&Ca(n,ne,D)&&C()}},X=D=>{if(D==="autoFit"){W({preset:"autoFit",tracks:null});return}W({preset:D,tracks:wa(D,G.columns)})},q=D=>{W({minCardWidth:D})},Q=D=>{W({preset:"custom",tracks:D})},B=()=>{const{pos:D}=St(n,t);D!=null&&Rd(n,D)&&C()},O=()=>{const{pos:D}=St(n,t);D!=null&&A>1&&Ca(n,D,A-1)&&C()},K=(D,ne)=>e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5},children:[D,ne&&e.jsx("span",{style:Ny})]});return e.jsxs(p,{children:[e.jsx(ns,{fullWidth:!0,size:"xs",value:h,onChange:m,data:[{value:"desktop",label:K("Desktop",!1)},{value:"tablet",label:K("Tablet",I!=="inherit"||j.tabletColumnGap!=null||j.tabletRowGap!=null)},{value:"mobile",label:K("Mobile",_!=="stack"||j.mobileColumnGap!=null||j.mobileRowGap!=null)}]}),h!=="desktop"&&e.jsxs(p,{mt:14,children:[e.jsx(p,{style:Br,children:h==="tablet"?"On tablet (≤ 768px)":"On mobile (≤ 576px)"}),e.jsx(Ey,{breakpoint:h,value:R,onChange:E}),e.jsx(N,{size:"xs",c:"dimmed",mt:8,children:i("tiptap.components.sideConfigurationsMenu.gridxPreviewHint","Preview by resizing your browser or on device")})]}),T&&e.jsxs(p,{mt:14,children:[e.jsx(Py,{layout:G,onEqualColumns:$,onPresetChange:X,onMinCardWidthChange:q}),L&&e.jsxs(p,{mt:14,children:[e.jsx(p,{style:Br,children:"Tracks"}),e.jsx(Oy,{tracks:S,onChange:Q})]})]}),h==="desktop"&&e.jsxs(p,{mt:14,style:{display:"flex",gap:8},children:[e.jsxs(We,{variant:"default",size:"xs",style:{flex:1},onClick:B,disabled:A>=Bd,children:["+ Add column",A>0?` (${A})`:""]}),e.jsx(We,{variant:"default",size:"xs",style:{flex:1},onClick:O,disabled:A<=1,title:"Removes the last column — its content moves into the previous column",children:"− Remove column"})]}),h!=="desktop"&&e.jsx(p,{mt:12,style:{textAlign:"right"},children:e.jsx(Yc,{component:"button",type:"button",size:"xs",onClick:P,children:h==="tablet"?'Reset tablet to "Same as desktop"':'Reset mobile to "Stack"'})}),h==="desktop"?e.jsxs(p,{mt:14,pt:14,style:{borderTop:"1px solid #ececec"},children:[e.jsx(p,{style:Br,children:"Vertical alignment"}),e.jsx(ns,{fullWidth:!0,size:"xs",value:j.itemAlignment||(j.stretchItems===!1?"start":"stretch"),data:[{label:"Stretch",value:"stretch"},{label:"Top",value:"start"},{label:"Center",value:"center"},{label:"Bottom",value:"end"}],onChange:D=>k({itemAlignment:D,stretchItems:D==="stretch"})})]}):e.jsx(N,{size:"xs",c:"dimmed",mt:14,pt:14,style:{borderTop:"1px solid #ececec"},children:"Vertical column alignment follows Desktop."})]})}const Dy=["px"],Fy=400,Hy={flex:1,minWidth:0,"& input":{padding:"2px 6px",border:"1.5px solid #e0e0e0",borderRadius:"6px",fontSize:"11px",fontWeight:600,height:"26px",minHeight:"26px"}},Uy={width:"58px",flexShrink:0,"& select":{fontSize:"11px",fontWeight:600,height:"26px",minHeight:"26px",paddingLeft:"6px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}};function on({value:t,onChange:n,units:o=Dy,allowAuto:s=!1,placeholder:r="",label:i}){const[c,u]=l.useState(""),[a,f]=l.useState(o[0]),d=t==null||t==="auto",h=l.useRef(null),m=l.useRef(!1),x=l.useRef(null),g=l.useRef(t),w=l.useRef(!1),b=()=>{x.current!=null&&(clearTimeout(x.current),x.current=null)},j=T=>{const L=Sa(T);L?(u(L.value),o.includes(L.unit)&&f(L.unit)):(T==null||T==="auto")&&u("")};l.useEffect(()=>{if(g.current=t,m.current)return;const T=Sa(t);T?(u(T.value),o.includes(T.unit)&&f(T.unit)):(t==null||t==="auto")&&u("")},[t,o]),l.useEffect(()=>()=>b(),[]);const A=(T,L)=>{if(T===""||T==null||Number.isNaN(Number(T)))return null;const S=`${T}${L}`;if(Ed(S,{allowAuto:!1}))return S},v=(T,L,{allowEmpty:S=!1}
4={})=>{const W=A(T,L);return W===void 0||W===null&&!S?!1:(g.current=W,n==null||n(W),!0)},k=(T,L)=>{b(),A(T,L)!=null&&(x.current=setTimeout(()=>{x.current=null,v(T,L)},Fy))},C=T=>{u(T),k(T,a)},I=T=>{const L=T.target.value;f(L),b(),c!==""&&c!=null&&v(c,L)},_=()=>{m.current=!0},R=T=>{var L;if(!((L=h.current)!=null&&L.contains(T.relatedTarget))){if(m.current=!1,b(),w.current){w.current=!1;return}v(c,a,{allowEmpty:!0})}},F=T=>{T.key==="Enter"?(b(),T.currentTarget.blur()):T.key==="Escape"&&(b(),w.current=!0,j(g.current),T.currentTarget.blur())},G=()=>{if(b(),d){const T=c===""||c==null?100:c;u(T),v(T,a)}else u(""),g.current=null,n==null||n(null)};return e.jsxs(ye,{ref:h,gap:6,align:"center",wrap:"nowrap",style:{width:"100%"},onFocusCapture:_,onBlurCapture:R,children:[i&&e.jsx(p,{style:{fontSize:"11px",fontWeight:600,color:"#666",width:"40px",flexShrink:0,whiteSpace:"nowrap"},children:i}),e.jsx(Rt,{value:c,onChange:C,onKeyDown:F,placeholder:d&&s?"Auto":r,hideControls:!0,size:"xs",style:Hy}),e.jsx(Ue,{value:a,onChange:I,size:"xs",data:o.map(T=>({value:T,label:T})),style:Uy}),s&&e.jsx(p,{component:"button",type:"button",onClick:G,style:{height:"26px",padding:"0 8px",flexShrink:0,fontSize:"10px",fontWeight:700,letterSpacing:"0.05em",textTransform:"uppercase",borderRadius:"6px",cursor:"pointer",border:`1.5px solid ${d?"#7950f2":"#e0e0e0"}`,backgroundColor:d?"#f3f0ff":"white",color:d?"#7950f2":"#999",transition:"all 0.12s ease"},children:"Auto"})]})}const _u="100svh",Au="100%",Vy=["100vh","calc(100vh - 60px)"],Ky=[{label:"Auto",value:null},{label:"200px",value:"200px"},{label:"400px",value:"400px"},{label:"Fill",value:Au},{label:"Screen",value:_u},{label:"Custom",value:"custom"}],Gy=new Set(["box","container"]),Yy=(t,n)=>{var r,i,c,u,a,f;if(!Gy.has((i=(r=n==null?void 0:n.node)==null?void 0:r.type)==null?void 0:i.name))return!1;const{pos:o}=St(t,n),s=(u=(c=t==null?void 0:t.view)==null?void 0:c.state)==null?void 0:u.doc;if(o==null||!(s!=null&&s.resolve))return!1;try{const d=s.resolve(o);for(let h=d.depth;h>=0;h-=1)if(((f=(a=d.node(h))==null?void 0:a.type)==null?void 0:f.name)==="column")return!0}catch{return!1}return!1};function tr({element:t,editor:n,saveNodeData:o,styleTarget:s,onStyleTargetSaved:r,presets:i=Ky}){const[c,u]=l.useState(null),[a,f]=l.useState(!1),[d,h]=l.useState("200px"),m=l.useRef(!1),{breakpoint:x}=Et(),g=Yy(n,t),w=i.map(j=>j.value===Au?{...j,disabled:!g,title:g?"Fill the available column height":"Fill is available for boxes inside columns"}:j);l.useEffect(()=>{if(t&&t.node.attrs){const j=t.node.attrs.minHeight,A=Vy.includes(j)?_u:j;A==="custom"?(u("custom"),f(!0)):i.find(v=>v.value===A)?(u(A),f(!1)):(u("custom"),f(!0),j&&typeof j=="string"&&h(j))}},[t,i]),l.useEffect(()=>{if(!m.current||(m.current=!1,!n))return;let j=c;a&&(j=d),(s?$t({editor:n,element:t,styleTarget:s,attrs:{minHeight:j}}):be(n,t,{minHeight:j}))&&(clearTimeout(window._minHeightDebounce),window._minHeightDebounce=setTimeout(()=>{var v;(v=s?r:o)==null||v()},2e3))},[c,a,d,n,t,r,o,s]);const b=j=>{j==="custom"?(u("custom"),f(!0)):(m.current=!0,u(j),f(!1))};return x!=="desktop"?e.jsx(p,{style:{fontSize:"11px",color:"#868e96",background:"#f8f9fa",borderRadius:"8px",padding:"8px 10px",lineHeight:1.45},children:"Min height can’t vary per device yet — it follows the Desktop value."}):e.jsxs(p,{children:[e.jsx(Pe,{options:w,activeValue:a?"custom":c,onChange:b,columns:3}),a&&e.jsx(p,{mt:12,children:e.jsx(on,{label:"Height",value:d,onChange:j=>{m.current=!0,h(j)},units:Gr,placeholder:"200"})})]})}function Ci({editor:t,element:n,saveNodeData:o,styleTarget:s,onStyleTargetSaved:r,helperText:i="Grid will span the full screen width."}){const[c,u]=l.useState(!1),a=l.useRef(!1),f=l.useRef(null);l.useEffect(()=>{var h;(h=n==null?void 0:n.node)!=null&&h.attrs&&(a.current=!0,u(n.node.attrs.fullWidth===!0),setTimeout(()=>{a.current=!1},50))},[n]),l.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const d=l.useCallback(h=>{if(u(h),a.current)return;const m={fullWidth:h};(s?$t({editor:t,element:n,styleTarget:s,attrs:m}):be(t,n,m))&&(f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{var g;f.current=null,(g=s?r:o)==null||g()},2e3))},[t,n,r,o,s]);return e.jsxs(p,{mt:10,children:[e.jsx(Ve,{label:"Extend to full width",checked:c,onChange:h=>d(h.currentTarget.checked)}),c&&e.jsx(N,{size:"xs",c:"dimmed",mt:5,children:i})]})}const qy={position:"right-start",offset:15,zIndex:999999,width:264,withinPortal:!0,floatingStrategy:"fixed",middlewares:{shift:{padding:8},flip:{fallbackPlacements:["right-end","left-start","left-end","bottom-start"]}}};function Xy({label:t,value:n,onChange:o,swatchTheme:s="dark"}){const r=ee(d=>d.colors),i=Dt(),[c,u]=l.useState(!1),a=typeof n=="string"&&n.indexOf("linear-gradient")>=0,f=!n||n==="none";return e.jsxs(ye,{justify:"space-between",children:[e.jsx(N,{size:"sm",children:t}),e.jsxs(we,{...qy,opened:c,onChange:u,children:[e.jsx(we.Target,{children:e.jsx(We,{radius:"xl",onClick:()=>u(d=>!d),className:fh.colorBtn,style:{background:a?n:void 0,backgroundColor:a?void 0:f?"white":n,color:r==null?void 0:r.default_text_color,border:"1px solid var(--mantine-color-gray-6)"}},n)}),e.jsx(we.Dropdown,{style:{maxHeight:"calc(100vh - 16px)",overflowY:"auto"},children:e.jsx("div",{className:"gradient-color-picker",children:e.jsx(Vt,{value:n||"",onChange:o,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,width:240,height:160,presets:an(i,s)})})})]})]})}const Zy=[{label:"Default",value:"default"},{label:"Custom",value:"custom"}];function nr(t){var r;const n=t&&typeof t=="object"?t:{},o=n.background&&typeof n.background=="object"?n.background:{},s=n.scrolled&&typeof n.scrolled=="object"?n.scrolled:{};return{sticky:n.sticky===!0,background:{color:(r=o.color)!=null?r:null,opacity:typeof o.opacity=="number"?o.opacity:100,blur:o.blur===!0,blurAmount:typeof o.blurAmount=="number"?o.blurAmount:10}
4,contentWidth:n.contentWidth==="custom"?"custom":"default",contentWidthCustom:typeof n.contentWidthCustom=="number"?n.contentWidthCustom:1160,scrolled:{border:s.border===!0,shadow:s.shadow===!0,solidify:s.solidify===!0}}}function Er(t,n){const o=nr(t);for(const[s,r]of Object.entries(n))s.startsWith("background.")?o.background={...o.background,[s.slice(11)]:r}:s.startsWith("scrolled.")?o.scrolled={...o.scrolled,[s.slice(9)]:r}:o[s]=r;return o}function Qy(t){return nr(t).sticky===!0}const $s={fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},zr={marginTop:14,paddingTop:14,borderTop:"1px solid #ececec"};function Jy({element:t,editor:n,saveNodeData:o,onStyleTargetSaved:s}){var b;const r=((b=t==null?void 0:t.node)==null?void 0:b.attrs)||{},i=r.shareBlockKind==="site_footer"?"footer":"header",c=r.uid,u=Qn(),[a,f]=l.useState(()=>nr(r.header)),d=l.useRef(null);l.useEffect(()=>{var j,A;f(nr((A=(j=t==null?void 0:t.node)==null?void 0:j.attrs)==null?void 0:A.header))},[c]);const h=l.useCallback(()=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{var j;(j=s||o)==null||j()},800)},[s,o]);l.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const m=l.useCallback(j=>{f(j),u(Ba(i,j))},[u,i]),x=l.useCallback(j=>{f(j),u(Ba(i,j)),be(n,t,{header:j})&&h()},[u,i,n,t,h]),g=l.useCallback(j=>x(Er(a,j)),[x,a]),w=Qy(a);return e.jsxs(p,{children:[e.jsx(p,{style:$s,children:"Position"}),e.jsx(Pe,{columns:2,options:[{label:"Static",value:"static"},{label:"Sticky",value:"sticky"}],activeValue:a.sticky?"sticky":"static",onChange:j=>g({sticky:j==="sticky"})}),e.jsx(N,{size:"xs",c:"dimmed",mt:6,children:"Sticky keeps the header pinned to the top of the page as visitors scroll."}),e.jsxs(p,{style:zr,children:[e.jsx(p,{style:$s,children:"Content width"}),e.jsx(Pe,{columns:2,options:Zy,activeValue:a.contentWidth,onChange:j=>g({contentWidth:j})}),a.contentWidth==="custom"?e.jsx(p,{mt:10,children:e.jsx(on,{label:"Width",value:`${a.contentWidthCustom}px`,onChange:j=>{const A=parseInt(String(j).replace(/[^0-9]/g,""),10);Number.isFinite(A)&&g({contentWidthCustom:A})},units:["px"],placeholder:"1160"})}):e.jsx(N,{size:"xs",c:"dimmed",mt:6,children:"Matches your page width."})]}),e.jsxs(p,{style:zr,children:[e.jsx(p,{style:$s,children:"Backgroun
4d"}),e.jsx(Xy,{label:"Fill",value:a.background.color||"",onChange:j=>g({"background.color":j||null})}),e.jsx(N,{size:"xs",c:"dimmed",mt:4,children:"Leave empty to follow the theme background."}),e.jsxs(p,{mt:12,style:w?void 0:{opacity:.5,pointerEvents:"none"},children:[e.jsxs(N,{size:"xs",fw:500,mb:4,children:["Opacity — ",a.background.opacity,"%"]}),e.jsx(ts,{min:0,max:100,value:a.background.opacity,onChange:j=>m(Er(a,{"background.opacity":j})),onChangeEnd:j=>g({"background.opacity":j})}),e.jsx(Ve,{mt:12,label:"Backdrop blur",checked:a.background.blur,onChange:j=>g({"background.blur":j.currentTarget.checked})}),a.background.blur&&e.jsxs(p,{mt:8,children:[e.jsxs(N,{size:"xs",fw:500,mb:4,children:["Blur — ",a.background.blurAmount,"px"]}),e.jsx(ts,{min:0,max:24,value:a.background.blurAmount,onChange:j=>m(Er(a,{"background.blurAmount":j})),onChangeEnd:j=>g({"background.blurAmount":j})})]})]})]}),e.jsxs(p,{style:zr,children:[e.jsx(p,{style:$s,children:"On scroll"}),!w&&e.jsx(N,{size:"xs",c:"dimmed",mb:8,children:"Applies when the header is sticky."}),e.jsxs(p,{style:w?void 0:{opacity:.5,pointerEvents:"none"},children:[e.jsx(Ve,{label:"Show bottom border",checked:a.scrolled.border,onChange:j=>g({"scrolled.border":j.currentTarget.checked})}),e.jsx(Ve,{mt:8,label:"Show shadow",checked:a.scrolled.shadow,onChange:j=>g({"scrolled.shadow":j.currentTarget.checked})}),e.jsx(Ve,{mt:8,label:"Solidify background",checked:a.scrolled.solidify,onChange:j=>g({"scrolled.solidify":j.currentTarget.checked})})]})]})]})}const e0="_unsetSwatch_ug95j_1",t0="_imageToggleBtn_ug95j_30",yc={unsetSwatch:e0,imageToggleBtn:t0},n0=["rgba(255,255,255,1)","#e9ecef","#fff3bf","#d0ebff","#1a1a1a"],o0=t=>{var o,s;const n=(s=(o=t==null?void 0:t.node)==null?void 0:o.attrs)==null?void 0:s.styles;return n?n["background-image"]&&n["background-image"].indexOf("linear-gradient")>=0&&n["background-image"].indexOf("url(")<0?n["background-image"]:n["background-color"]||"":""},s0=t=>typeof t=="string"&&(t.includes("themed(")||t.startsWith("token:")||t.startsWith("gradient:")||t.startsWith("recipe:")||t.startsWith("tint:"));function yo({element:t,saveNodeData:n,editor:o,styleTarget:s,onStyleTargetSaved:r,onShowImage:i,showImageActive:c}){var v,k;const u=ee(C=>C.colors),[a,f]=l.useState("rgba(255,255,255,1)"),d=l.useRef(!1),h=l.useRef(!1),m=l.useRef(null),x=l.useRef(null),g=o0(t),w=ft(t,"background"),b=(k=(v=t==null?void 0:t.node)==null?void 0:v.attrs)==null?void 0:k.uid,j=s0(a)?Zt(a,u):a;l.useEffect(()=>{if(!h.current||!t||!t.node.attrs||t&&t.node.attrs&&d.current!=t.node.attrs.uid)return;const C=t;let I=C.node.attrs.styles?{...C.node.attrs.styles}:{};if(I){const _=Object.keys(I);if(_&&_[0]=="0"){I=mi(Ys(I)),typeof n=="function"&&ln({editor:o,styleTarget:s,nextStyles:I,element:C,saveNodeData:n,onStyleTargetSaved:r});return}}a&&a.indexOf("linear-gradient")>=0?(I["background-image"]=a,I["background-color"]=""):(I["background-color"]=a,c||(I["background-image"]="none")),I&&typeof n=="function"&&ln({editor:o,styleTarget:s,nextStyles:I,element:C,saveNodeData:n,onStyleTargetSaved:r}),h.current=!1},[a,o,t,r,n,c,s]),l.useEffect(()=>{var I;if(!((I=t==null?void 0:t.node)!=null&&I.attrs))return;const{shouldApply:C}=Nt({currentKeyRef:x,nextKey:w,pendingValueRef:m,incomingValue:g});C&&(d.current=null,f(g),setTimeout(()=>{d.current=b},0))},[t,b,g,w]);const A=C=>{const I=C||"";c&&I.includes("linear-gradient")&&i&&(h.current=!0,i()),h.current=!0,m.current=I,f(I)};return e.jsx(Fe,{gap:10,children:e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"6px"},children:[e.jsx(p,{onClick:()=>A(""),className:yc.unsetSwatch,style:{border:!a||a===""?"2.5px solid #7950f2":"1.5px solid #ddd",boxShadow:!a||a===""?"inset 0 0 0 1.5px white":"none"},title:"Remove background color"}),e.jsx(bn,{label:"",colors:n0,value:j,onChange:A,hideGradientControls:!1,swatchSize:28}),i&&e.jsx(p,{onClick:i,className:yc.imageToggleBtn,style:{border:`1.5px solid ${c?"#7950f2":"#e0e0e0"}`,backgroundColor:c?"#f0faff":"transparent"},children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:c?"#7950f2":"#888",strokeWidth:"1.5",children:[e.jsx("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"2"}),e.jsx("circle",{cx:"5.5",cy:"5.5",r:"1.5"}),e.jsx("path",{d:"M1.5 11 L5 7.5 L8 10.5 L10.5 8 L14.5 12",strokeLinejoin:"round"})]})})]})})}const r0="_compactUploadBtn_ig5pr_1",i0="_uploadBtnText_ig5pr_19",l0="_removeOverlay_ig5pr_25",a0="_overlaySwatch_ig5pr_44",c0="_overlaySwatchNone_ig5pr_59",Zo={compactUploadBtn:r0,uploadBtnText:i0,removeOverlay:l0,overlaySwatch:a0,overlaySwatchNone:c0},u0=new Set(["","none","url(null)","url(none)"]);function d0(t){if(typeof t!="string")return null;const n=t.trim();if(u0.has(n.toLowerCase()))return null;const o=[...n.matchAll(/url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*?))\s*\)/gi)];if(o.length===0)return null;const s=o[o.length-1];return(s[1]||s[2]||s[3]||"").trim()||null}function f0(t){var n;return typeof t!="string"||!t.includes(",")||!/url\(/i.test(t)?"":((n=t.match(/rgba?\([^)]+\)|hsla?\([^)]+\)|#[0-9a-fA-F]{3,8}/))==null?void 0:n[0])||""}const h0=["cover","contain","auto"],p0=["left top","left center","left bottom","right top","right center","right bottom","center top","center center","center bottom"],x0=/^(-?\d+(?:\.\d+)?)% (-?\d+(?:\.\d+)?)%$/,vc=[{value:"",label:"None"},{value:"rgba(0,0,0,0.25)",label:"Dark 25%"},{value:"rgba(0,0,0,0.45)",label:"Dark 45%"},{value:"rgba(0,0,0,0.65)",label:"Dark 65%"},{value:"rgba(255,255,255,0.35)",label:"Light 35%"},{value:"rgba(255,255,255,0.6)",label:"Light 60%"}],jc=t=>{const[n,o]=l.useState(0);return rr(s=>{o(s.completed)}),ir(s=>{t.onUploadCallback(s.uploadResponse.data.file.url)}),e.jsx(e.Fragment,{children:n>0&&n<=100?e.jsx(yi,{color:"green",size:"xl",mb:10,value:n}):""})},g0=ls(t=>{const{t:n}=Qt();return e.jsx(We,{radius:"xl",...t,children:n("tiptap.components.sidebar.backgroundImage.button")})}),m0=ls(t=>e.jsx(p,{...t,className:Zo.compactUploadBtn,children:e.jsxs(p,{style:{textAlign:"center"},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",stroke:"#999",strokeWidth:"1.5",style:{display:"block",margin:"0 auto 4px"},children:[e.jsx("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"2"}),e.jsx("circle",{cx:"5.5",cy:"5.5",r:"1.5"}),e.jsx("path",{d:"M1.5 11 L5 7.5 L8 10.5 L10.5 8 L14.5 12",strokeLinejoin:"round"})]}),e.jsx(p,{className:Zo.uploadBtnText,children:"Upload image"})]})}));function vo(t){const{t:n}=Qt(),o=Dt(),s=l.useRef(!1),r=l.useRef(!1),i=l.useRef({}),c=l.useRef(!1),u="https://api.sutra.co",a=ee(H=>H.space),[f,d]=l.useState(),[h,m]=l.useState(),[x,g]=l.useState(),[w,b]=l.useState(),[j,A]=l.useState(""),[v,k]=l.useState(""),[C,I]=l.useState(!1),_=t.compact,R=()=>{c.current=!0,r.current=!0};l.useEffect(()=>{i.current={editor:t.editor,element:t.element,onStyleTargetSaved:t.onStyleTargetSaved,saveNodeData:t.saveNodeData,styleTarget:t.styleTarget}});const F=H=>{if(R(),zd(H)){k(H.trim()),A("");return}k(""),A(H||"")};l.useEffect(()=>{const{editor:H,element:D,onStyleTargetSaved:ne,saveNodeData:Ie,styleTarget:Ke}=i.current;if(!D||!D.node.attrs)return;if(!c.current){if(s.current!=D.node.attrs.uid)return;if(!r.current){setTimeout(()=>{r.current=!0},500);return}}const Ce=D;
4let Re=Ce.node.attrs.styles?{...Ce.node.attrs.styles}:{};if(Re){const xe=Object.keys(Re);if(xe&&xe[0]=="0"){console.log(Re),console.log(Ys(Re)),Re=mi(Ys(Re)),console.log(Ce.node.type),console.log(Re),ln({editor:H,styleTarget:Ke,nextStyles:Re,element:Ce,saveNodeData:Ie,onStyleTargetSaved:ne});return}}f&&f!="none"?(Re["background-image"]=`url(${f})`,Re["background-size"]=h,Re["background-position"]=x,Re["background-repeat"]=w):(Re["background-image"]="",Re["background-size"]="",Re["background-position"]="",Re["background-repeat"]=""),Re["background-overlay-color"]=j||"",Re["background-overlay-gradient"]=v||"",Re&&ln({editor:H,styleTarget:Ke,nextStyles:Re,element:Ce,saveNodeData:Ie,onStyleTargetSaved:ne}),c.current=!1},[f,h,x,w,j,v]),l.useEffect(()=>{if(t.element&&t.element.node.attrs){const H=t.element.node.attrs.styles||{};s.current=null,r.current=!1;const D=t.element.node.attrs.uid;setTimeout(()=>{s.current=D},0);const ne=H["background-image"]||"";d(d0(ne)),m(H["background-size"]||"cover"),g(H["background-position"]||"center center"),b(H["background-repeat"]||"no-repeat"),A(H["background-overlay-color"]||f0(ne)),k(H["background-overlay-gradient"]||"")}},[t.element]);const G=!h||h0.includes(h)?h||"cover":"custom",T=H=>{R(),m(H==="custom"?"50%":H)},L=H=>{H&&(R(),m(H))},S=!x||p0.includes(x)?x||"center center":"custom",W=typeof x=="string"?x.match(x0):null,E=W?parseFloat(W[1]):50,P=W?parseFloat(W[2]):50,$=H=>{R(),g(H==="custom"?"50% 50%":H)},X=(H,D)=>{const ne=Math.max(0,Math.min(100,Number(D)||0));R(),g(H==="x"?`${ne}% ${P}%`:`${E}% ${ne}%`)},q=()=>e.jsx(p,{style:{marginTop:6},children:e.jsx(on,{value:h,onChange:L,units:["%","px"],placeholder:"50"})}),Q=()=>e.jsxs(p,{style:{marginTop:6,display:"flex",flexDirection:"column",gap:6},children:[e.jsx(He,{label:"Focal X",value:E,onChange:H=>X("x",H),min:0,max:100,unit:"%",labelWidth:"46px"}),e.jsx(He,{label:"Focal Y",value:P,onChange:H=>X("y",H),min:0,max:100,unit:"%",labelWidth:"46px"})]}),B=H=>{R(),d(H)},O=H=>{H&&H.stopPropagation(),R(),A(""),k(""),d(null)},K=v||j||"",Y=!!(v||j&&!vc.some(H=>H.value===j));return _?e.jsx(Fe,{gap:8,children:f&&f!="none"?e.jsxs(e.Fragment,{children:[e.jsxs(p,{style:{position:"relative",borderRadius:"8px",overflow:"hidden"},children:[e.jsx(Yo,{radius:"md",src:f,alt:"Background image",height:80,fit:"cover"}),e.jsx(p,{onClick:O,title:"Remove background image",className:Zo.removeOverlay,children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"white",strokeWidth:"1.8",strokeLinecap:"round",children:e.jsx("path",{d:"M1 1L9 9M9 1L1 9"})})})]}),e.jsxs(p,{style:{display:"flex",gap:"6px"},children:[e.jsx(Ue,{value:G,onChange:H=>T(H.target.value),size:"xs",style:{flex:1,"& select":{fontSize:"11px",height:"28px",minHeight:"28px",paddingLeft:"6px"}},data:[{value:"cover",label:"Cover"},{value:"contain",label:"Contain"},{value:"auto",label:"Auto"},{value:"custom",label:"Custom"}]}),e.jsx(Ue,{value:S,onChange:H=>$(H.target.value),size:"xs",style:{flex:1,"& select":{fontSize:"11px",height:"28px",minHeight:"28px",paddingLeft:"6px"}},data:[{value:"left top",label:"Left Top"},{value:"left center",label:"Left Center"},{value:"left bottom",label:"Left Bottom"},{value:"right top",label:"Right Top"},{value:"right center",label:"Right Center"},{value:"right bottom",label:"Right Bottom"},{value:"center top",label:"Center Top"},{value:"center center",label:"Center"},{value:"center bottom",label:"Center Bottom"},{value:"custom",label:"Custom focal point"}]}),e.jsx(Ue,{value:w,onChange:H=>{R(),b(H.target.value)},size:"xs",style:{flex:1,"& select":{fontSize:"11px",height:"28px",minHeight:"28px",paddingLeft:"6px"}},data:[{value:"no-repeat",label:"No Repeat"},{value:"repeat",label:"Repeat"},{value:"repeat-x",label:"Repeat X"},{value:"repeat-y",label:"Repeat Y"}]})]}),G==="custom"&&q(),S==="custom"&&Q(),e.jsxs(p,{children:[e.jsx(p,{style:{fontSize:"11px",color:"#666",fontWeight:600,marginBottom:"6px"},children:"Overlay"}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"nowrap"},children:[vc.map(H=>{const D=!v&&(j||"")===H.value,ne=H.value==="";return e.jsx(p,{onClick:()=>F(H.value),title:H.label,className:`${Zo.overlaySwatch} ${ne?Zo.overlaySwatchNone:""}`,style:{border:D?"2.5px solid #7950f2":"1.5px solid #ddd",boxShadow:D?"inset 0 0 0 1.5px white":"none",backgroundColor:"#fff",backgroundImage:ne?"none":`${H.value===""?"":`linear-gradient(${H.value}, ${H.value}), `}linear-gradient(45deg, #e6e6e6 25%, transparent 25%), linear-gradient(-45deg, #e6e6e6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e6e6e6 75%), linear-gradient(-45deg, transparent 75%, #e6e6e6 75%)`,backgroundSize:ne?"auto":"100% 100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px",backgroundPosition:ne?"auto":"0 0, 0 0, 0 4px, 4px -4px, -4px 0px"}},H.label)}),e.jsxs(we,{opened:C,onChange:H=>I(H),offset:15,zIndex:999999,width:264,children:[e.jsx(we.Target,{children:e.jsx(p,{onClick:()=>I(H=>!H),title:"Custom overlay color or gradient",style:{width:"28px",height:"28px",flexShrink:0,borderRadius:"6px",border:`1.5px dashed ${Y?"#7950f2":"#ccc"}`,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"11px",color:"#999",background:Y?K:"transparent",transition:"all 0.12s ease"},children:"+"})}),e.jsx(we.Dropdown,{children:e.jsx("div",{className:"gradient-color-picker",children:e.jsx(Vt,{value:K,onChange:H=>F(H),hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0,width:240,height:160,presets:an(o,"light")})})})]})]})]})]}):e.jsxs(Co,{withCredentials:!0,destination:{url:`${u}/api/v4/spaces/${a.slug}/upload_file`,headers:To()},accept:"image/*",children:[e.jsx(jc,{onUploadCallback:B}),e.jsx(m0,{})]})}):e.jsx(Fe,{children:f&&f!="none"?e.jsxs(e.Fragment,{children:[e.jsx(Yo,{radius:"md",src:f,alt:"Backgroun
4d image"}),e.jsx(We,{color:"red",onClick:H=>O(H),children:n("tiptap.components.sidebar.backgroundImage.removeButton")}),e.jsx(Ue,{value:G,onChange:H=>T(H.target.value),label:"Size",placeholder:"Pick one",data:[{value:"cover",label:"cover"},{value:"contain",label:"contain"},{value:"auto",label:"auto"},{value:"custom",label:"custom"}]}),G==="custom"&&q(),e.jsx(Ue,{value:S,onChange:H=>$(H.target.value),label:n("tiptap.components.sidebar.backgroundImage.label"),placeholder:n("tiptap.components.sidebar.backgroundImage.placeholder"),data:[{value:"left top",label:n("tiptap.components.sidebar.backgroundImage.leftTop")},{value:"left center",label:n("tiptap.components.sidebar.backgroundImage.leftCenter")},{value:"left bottom",label:n("tiptap.components.sidebar.backgroundImage.leftBottom")},{value:"right top",label:n("tiptap.components.sidebar.backgroundImage.rightTop")},{value:"right center",label:n("tiptap.components.sidebar.backgroundImage.rightCenter")},{value:"right bottom",label:n("tiptap.components.sidebar.backgroundImage.rightBottom")},{value:"center top",label:n("tiptap.components.sidebar.backgroundImage.centerTop")},{value:"center center",label:n("tiptap.components.sidebar.backgroundImage.centerCenter")},{value:"center bottom",label:n("tiptap.components.sidebar.backgroundImage.centerBottom")},{value:"custom",label:"Custom focal point"}]}),S==="custom"&&Q(),e.jsx(Ue,{value:w,onChange:H=>{R(),b(H.target.value)},label:n("tiptap.components.sidebar.backgroundImage.label2"),placeholder:n("tiptap.components.sidebar.backgroundImage.placeholder2"),data:[{value:"no-repeat",label:n("tiptap.components.sidebar.backgroundImage.noRepeat")},{value:"repeat",label:n("tiptap.components.sidebar.backgroundImage.repeat")},{value:"repeat-x",label:n("tiptap.components.sidebar.backgroundImage.repeat-x")},{value:"repeat-y",label:n("tiptap.components.sidebar.backgroundImage.repeat-y")},{value:"space",label:n("tiptap.components.sidebar.backgroundImage.space")},{value:"round",label:n("tiptap.components.sidebar.backgroundImage.round")}]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Yo,{width:260,height:100,src:null,alt:"No image",withPlaceholder:!0}),e.jsxs(Co,{withCredentials:!0,destination:{url:`${u}/api/v4/spaces/${a.slug}/upload_file`,headers:To()},accept:"image/*",children:[e.jsx(jc,{onUploadCallback:B}),e.jsx(g0,{})]})]})})}const b0="_noneSwatch_4p8sq_1",y0="_noneSwatchActive_4p8sq_16",Lr={noneSwatch:b0,noneSwatchActive:y0},v0=["#1a1a1a","#b088e0","#ff7eb8","#5cd6b6","#f5a682","#ffffff"],kc=[{value:"none",label:"None"},{value:"dots",label:"Dots"},{value:"fine",label:"Fine"},{value:"grid",label:"Grid"},{value:"hatch",label:"Hatch"},{value:"grain",label:"Grain"}],si="none",ri="#1a1a1a",ii=14,j0=(t,n)=>{if(!t.startsWith("#"))return t;const o=t.length===4?t.slice(1).split("").map(c=>c+c).join(""):t.slice(1),s=parseInt(o.slice(0,2),16),r=parseInt(o.slice(2,4),16),i=parseInt(o.slice(4,6),16);return`rgba(${s},${r},${i},${n})`},wc=({value:t,color:n,active:o})=>{const s=j0(n||"#1a1a1a",.6),r={width:"32px",height:"22px",borderRadius:"3px",backgroundColor:o?"rgba(255,255,255,0.95)":"#f5f5f5",border:o?"1px solid rgba(255,255,255,0.6)":"1px solid #e0e0e0",backgroundRepeat:"repeat"};return t==="none"?e.jsx(p,{className:o?`${Lr.noneSwatch} ${Lr.noneSwatchActive}`:Lr.noneSwatch,style:r}):t==="dots"?e.jsx(p,{style:{...r,backgroundImage:`radial-gradient(circle, ${s} 1px, transparent 1px)`,backgroundSize:"7px 7px"}}):t==="fine"?e.jsx(p,{style:{...r,backgroundImage:`radial-gradient(circle, ${s} 0.8px, transparent 0.8px)`,backgroundSize:"4px 4px"}}):t==="grid"?e.jsx(p,{style:{...r,backgroundImage:`linear-gradient(to right, ${s} 1px, transparent 1px), linear-gradient(to bottom, ${s} 1px, transparent 1px)`,backgroundSize:"8px 8px"}}):t==="hatch"?e.jsx(p,{style:{...r,backgroundImage:`repeating-linear-gradient(45deg, ${s} 0 1px, transparent 1px 5px)`}}):t==="grain"?e.jsx(p,{style:{...r,backgroundImage:`url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>")`,backgroundSize:"80px 80px"}}):e.jsx(p,{style:r})};function k0(t){var c,u;const n=((u=(c=t==null?void 0:t.node)==null?void 0:c.attrs)==null?void 0:u.styles)||{},o=n["background-pattern"]||si,s=n["background-pattern-color"]||ri,r=n["background-pattern-opacity"],i=r!=null?Math.round((parseFloat(r)||.14)*100):ii;return JSON.stringify({pat:o,col:s,pct:i})}function w0({element:t,saveNodeData:n,editor:o,styleTarget:s,onStyleTargetSaved:r}){const[i,c]=l.useState(si),[u,a]=l.useState(ri),[f,d]=l.useState(ii),h=l.useRef(null),m=l.useRef(null),x=ft(t,"pattern"),g=k0(t);ke.useEffect(()=>{const{shouldApply:v,value:k}=Nt({currentKeyRef:m,nextKey:x,pendingValueRef:h,incomingValue:g});if(v)try{const{pat:C,col:I,pct:_}=JSON.parse(k||g);c(C),a(I),d(_)}catch{c(si),a(ri),d(ii)}},[x,g]);const w=(v,k,C)=>{if(!t||!t.node||!t.node.attrs)return;
4const I=t.node.attrs.styles?{...t.node.attrs.styles}:{};v&&v!=="none"?(I["background-pattern"]=v,I["background-pattern-color"]=k,I["background-pattern-opacity"]=(C/100).toString()):s?(I["background-pattern"]="",I["background-pattern-color"]="",I["background-pattern-opacity"]=""):(delete I["background-pattern"],delete I["background-pattern-color"],delete I["background-pattern-opacity"]),h.current=JSON.stringify({pat:v,col:k,pct:C}),ln({editor:o,styleTarget:s,nextStyles:I,element:t,saveNodeData:n,onStyleTargetSaved:r})},b=v=>{c(v),w(v,u,f)},j=v=>{a(v),w(i,v,f)},A=v=>{d(v),w(i,u,v)};return e.jsxs(p,{children:[e.jsx(ye,{gap:6,grow:!0,mb:10,children:kc.slice(0,3).map(v=>e.jsx(Be,{icon:e.jsx(wc,{value:v.value,color:u,active:i===v.value}),label:v.label,value:v.value,active:i===v.value,onClick:()=>b(v.value)},v.value))}),e.jsx(ye,{gap:6,grow:!0,mb:12,children:kc.slice(3,6).map(v=>e.jsx(Be,{icon:e.jsx(wc,{value:v.value,color:u,active:i===v.value}),label:v.label,value:v.value,active:i===v.value,onClick:()=>b(v.value)},v.value))}),i!=="none"&&e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[e.jsx(bn,{label:"Color",colors:v0,value:u,onChange:j}),e.jsx(He,{label:"Opacity",value:f,onChange:A,min:2,max:50,unit:"%",labelWidth:"56px"})]})]})}const C0="_positionPad_6jzrx_1",S0="_positionCell_6jzrx_13",T0="_positionCellActive_6jzrx_24",I0="_controls_6jzrx_43",_0="_row_6jzrx_50",A0="_label_6jzrx_56",B0="_swatchGroup_6jzrx_64",R0="_offSwatch_6jzrx_70",pn={positionPad:C0,positionCell:S0,positionCellActive:T0,controls:I0,row:_0,label:A0,swatchGroup:B0,offSwatch:R0},E0=["#b088e0","#ff7eb8","#5cd6b6","#7ab8e8","#f5a682","#ffffff"],z0=["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"],li="none",ai="#b088e0",ci=18;function L0(t){var c,u;const n=((u=(c=t==null?void 0:t.node)==null?void 0:c.attrs)==null?void 0:u.styles)||{},o=n["background-glow-position"]||li,s=n["background-glow-color"]||ai,r=n["background-glow-intensity"],i=r!=null?Math.round((parseFloat(r)||.18)*100):ci;return JSON.stringify({pos:o,col:s,pct:i})}function P0({element:t,saveNodeData:n,editor:o,styleTarget:s,onStyleTargetSaved:r}){const[i,c]=l.useState(li),[u,a]=l.useState(ai),[f,d]=l.useState(ci),h=l.useRef(null),m=l.useRef(null),x=ft(t,"glow"),g=L0(t);ke.useEffect(()=>{const{shouldApply:k,value:C}=Nt({currentKeyRef:m,nextKey:x,pendingValueRef:h,incomingValue:g});if(k)try{const{pos:I,col:_,pct:R}=JSON.parse(C||g);c(I),a(_),d(R)}catch{c(li),a(ai),d(ci)}},[x,g]);const w=(k,C,I)=>{if(!t||!t.node||!t.node.attrs)return;const _=t.node.attrs.styles?{...t.node.attrs.styles}:{};k&&k!=="none"?(_["background-glow-position"]=k,_["background-glow-color"]=C,_["background-glow-intensity"]=(I/100).toString()):s?(_["background-glow-position"]="",_["background-glow-color"]="",_["background-glow-intensity"]=""):(delete _["background-glow-position"],delete _["background-glow-color"],delete _["background-glow-intensity"]),h.current=JSON.stringify({pos:k,col:C,pct:I}),ln({editor:o,styleTarget:s,nextStyles:_,element:t,saveNodeData:n,onStyleTargetSaved:r})},b=k=>{c(k),w(k,u,f)},j=k=>{a(k),w(i,k,f)},A=k=>{d(k),w(i,u,k)},v=i!=="none";return e.jsxs(p,{children:[e.jsx(p,{className:pn.positionPad,children:z0.map(k=>{const C=i===k;return e.jsx(p,{onClick:()=>b(k),className:C?`${pn.positionCell} ${pn.positionCellActive}`:pn.positionCell},k)})}),v&&e.jsxs(p,{className:pn.controls,children:[e.jsxs(p,{className:pn.row,children:[e.jsx(p,{className:pn.label,children:"Color"}),e.jsxs(p,{className:pn.swatchGroup,children:[e.jsx(p,{onClick:()=>b("none"),title:"Turn glow off",className:pn.offSwatch}),e.jsx(bn,{label:"",colors:E0,value:u,onChange:j})]})]}),e.jsx(He,{label:"Intensity",value:f,onChange:A,min:2,max:60,unit:"%",labelWidth:"56px"})]})]})}const nn={sm:{iconSize:20,badgeSize:40,iconVerticalOffset:18,iconOffset:18,contentOffset:70,contentVerticalOffset:20},md:{iconSize:30,badgeSize:50,iconVerticalOffset:18,iconOffset:18,contentOffset:80,contentVerticalOffset:30},lg:{iconSize:36,badgeSize:60,iconVerticalOffset:18,iconOffset:18,contentOffset:95,contentVerticalOffset:30}},W0=t=>{for(const[n,o]of Object.entries(nn))if(t.iconSize===o.iconSize&&t.badgeSize===o.badgeSize)return n;return"sm"},Yn=t=>e.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#868e96",marginBottom:6,textTransform:"uppercase",letterSpacing:.5},children:t}),fo=({icon:t,lbl:n,active:o,onClick:s,width:r})=>e.jsxs("div",{onClick:s,style:{flex:r?"none":"1 1 0",width:r||"auto",minWidth:0,padding:"8px 4px 6px",border:`1.5px solid ${o?"#7950f2":"#e0e0e0"}`,borderRadius:10,backgroundColor:o?"#7950f2":"#fff",cursor:"pointer",textAlign:"center",transition:"all 0.15s ease",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4},children:[e.jsx("div",{style:{color:o?"#fff":"#666",display:"flex",alignItems:"center",justifyContent:"center"},children:t}),n&&e.jsx("div",{style:{fontSize:9,fontWeight:700,textTransform:"uppercase",letterSpacing:.5,color:o?"#fff":"#888",lineHeight:1},children:n})]}),O0=({color:t,active:n,onClick:o,size:s=26})=>{const r=t==="#fff"||t==="#ffffff"||t==="white"||typeof t=="string"&&t.includes("255,255,255");return e.jsx("div",{onClick:o,style:{width:s,height:s,borderRadius:6,cursor:"pointer",background:t,border:n?"2.5px solid #7950f2":r?"1.5px solid #ddd":"2px solid transparent",boxShadow:n?"inset 0 0 0 1.5px white":"none",transition:"all 0.12s ease",flexShrink:0}})},Pr=(t,n,o)=>{const s={...t},r=o?"padding-left":"padding-right",i=o?"padding-right":"padding-left";return s[i]="25px",n.contentOffset>0&&(s[r]=`${n.contentOffset}px`),n.contentVerticalOffset>0&&(s["padding-top"]=`${n.contentVerticalOffset}px`,s["padding-bottom"]=`${n.contentVerticalOffset}px`),s};function M0({editor:t,element:n,column:o,syncSelection:s}){const[r,i]=l.useState(null),[c,u]=l.useState(null),[a,f]=l.useState(null),[d,h]=l.useState(null),[m,x]=l.useState(null),[g,w]=l.useState("sm"),[b,j]=l.useState(!1),[A,v]=l.useState(null),k=l.useRef(!1),C=l.useRef(null);l.useEffect(()=>()=>clearTimeout(C.current),[]);const I=P=>
4{k.current=!0,clearTimeout(C.current),C.current=setTimeout(()=>{k.current=!1},100),t.view.dispatch(P),typeof s=="function"&&requestAnimationFrame(()=>{s()})};l.useEffect(()=>{var P;if((P=n==null?void 0:n.node)!=null&&P.attrs){if(k.current)return;const $=n.node.attrs;i($.icon),u($.iconColor),f($.iconPosition),h($.iconVerticalAlign||"center"),x($.badgeShape),w(W0($))}},[n]);const _=P=>{var O;v(P.id);const{tr:$,doc:X}=t.view.state,q=nn[g]||nn.sm,Q=X.nodeAt(n.pos);if(!Q)return;const B={icon:P.icon,iconColor:P.iconColor,badgeBgColor:P.badgeBg,iconPosition:P.position,badgeShape:m||"circle",iconVerticalAlign:d||"center",iconSize:q.iconSize,badgeSize:q.badgeSize,iconOffset:q.iconOffset,iconVerticalOffset:q.iconVerticalOffset,contentOffset:q.contentOffset,contentVerticalOffset:q.contentVerticalOffset,badgeText:null,textFontSize:null,textOffset:null};if($.setNodeMarkup(n.pos,void 0,{...Q.attrs,...B}),o){const K=X.nodeAt(o.pos),Y=P.position==="left",H=Pr({...((O=K==null?void 0:K.attrs)==null?void 0:O.styles)||{},"background-color":P.bg},q,Y);$.setNodeMarkup(o.pos,void 0,{...(K==null?void 0:K.attrs)||o.node.attrs,styles:H})}I($),i(B.icon),u(B.iconColor),f(B.iconPosition),h(B.iconVerticalAlign),x(B.badgeShape)},R=()=>{var q;v(null);const{tr:P,doc:$}=t.view.state,X=$.nodeAt(n.pos);if(X){if(P.setNodeMarkup(n.pos,void 0,{...X.attrs,icon:null,badgeText:null,iconSize:null,badgeSize:null,textFontSize:null,iconOffset:null,iconVerticalOffset:null,textOffset:null,contentOffset:null,contentVerticalOffset:null}),o){const Q=$.nodeAt(o.pos),B={...((q=Q==null?void 0:Q.attrs)==null?void 0:q.styles)||{}};B["padding-top"]="20px",B["padding-bottom"]="20px",B["padding-left"]="25px",B["padding-right"]="25px",P.setNodeMarkup(o.pos,void 0,{...(Q==null?void 0:Q.attrs)||o.node.attrs,styles:B})}I(P),i(null)}},F=P=>{var B;v(null);const $=nn[g]||nn.sm,{tr:X,doc:q}=t.view.state,Q=q.nodeAt(n.pos);if(Q){if(X.setNodeMarkup(n.pos,void 0,{...Q.attrs,icon:r,iconColor:P.icon,iconPosition:a,iconVerticalAlign:d,badgeShape:m,badgeBgColor:P.badgeBg,badgeSize:$.badgeSize,iconSize:$.iconSize,iconOffset:$.iconOffset,iconVerticalOffset:$.iconVerticalOffset,contentOffset:$.contentOffset,contentVerticalOffset:$.contentVerticalOffset,badgeText:null,textFontSize:null,textOffset:null}),o){const O=q.nodeAt(o.pos),K={...((B=O==null?void 0:O.attrs)==null?void 0:B.styles)||{},"background-color":P.bg};X.setNodeMarkup(o.pos,void 0,{...(O==null?void 0:O.attrs)||o.node.attrs,styles:K})}I(X),u(P.icon)}},G=P=>{if(f(P),v(null),!(r&&r!=="none")||!o||!n)return;const X=nn[g]||nn.sm,{tr:q,doc:Q}=t.view.state,B=Q.nodeAt(n.pos),O=Q.nodeAt(o.pos);if(!B||!O)return;q.setNodeMarkup(n.pos,void 0,{...B.attrs,iconPosition:P});const K=P==="left",Y=Pr({...O.attrs.styles||{}},X,K);q.setNodeMarkup(o.pos,void 0,{...O.attrs,styles:Y}),I(q)},T=P=>{if(h(P),v(null),!n)return;const{tr:$,doc:X}=t.view.state,q=X.nodeAt(n.pos);q&&($.setNodeMarkup(n.pos,void 0,{...q.attrs,iconVerticalAlign:P}),I($))},L=P=>{if(i(P),v(null),!n)return;const{tr:$,doc:X}=t.view.state,q=X.nodeAt(n.pos);q&&($.setNodeMarkup(n.pos,void 0,{...q.attrs,icon:P}),I($))},S=P=>{if(u(P),v(null),!n)return;const{tr:$,doc:X}=t.view.state,q=X.nodeAt(n.pos);q&&($.setNodeMarkup(n.pos,void 0,{...q.attrs,iconColor:P}),I($))},W=P=>{w(P),v(null);const $=nn[P]||nn.sm;if(r&&r!=="none"&&o&&n){const{tr:q,doc:Q}=t.view.state,B=Q.nodeAt(n.pos),O=Q.nodeAt(o.pos);if(!B||!O)return;q.setNodeMarkup(n.pos,void 0,{...B.attrs,badgeSize:$.badgeSize,iconSize:$.iconSize,iconOffset:$.iconOffset,iconVerticalOffset:$.iconVerticalOffset,contentOffset:$.contentOffset,contentVerticalOffset:$.contentVerticalOffset});const K=a==="left",Y=Pr({...O.attrs.styles||{}},$,K);q.setNodeMarkup(o.pos,void 0,{...O.attrs,styles:Y}),I(q)}},E=r&&r!=="none"&&r!=="text";return e.jsxs("div",{children:[e.jsxs("div",{style:{marginBottom:12},children:[Yn("Quick Presets"),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:6},children:[Ld.map(P=>{var q;const $=A===P.id,X=(q=Ta[P.icon])==null?void 0:q.svg(P.iconColor,14);return e.jsxs("div",{onClick:()=>_(P),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,padding:"8px 4px 6px",borderRadius:10,cursor:"pointer",border:`1.5px solid ${$?"#7950f2":"#e0e0e0"}`,backgroundColor:$?"#f0f9ff":"#fff",transition:"all 0.15s ease"},children:[e.jsx("div",{style:{width:28,height:28,borderRadius:"50%",backgroundColor:P.bg,display:"flex",alignItems:"center",justifyContent:"center",border:$?"2px solid #7950f2":"1px solid rgba(0,0,0,0.06)"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:X})}),e.jsx("div",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:.3,color:$?"#7950f2":"#888"},children:P.label})]},P.id)}),e.jsxs("div",{onClick:R,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,padding:"8px 4px 6px",borderRadius:10,cursor:"pointer",border:`1.5px solid ${E?"#e0e0e0":"#7950f2"}`,backgroundColor:E?"#fff":"#f0f9ff",transition:"all 0.15s ease"},children:[e.jsx("div",{style:{width:28,height:28,borderRadius:"50%",backgroundColor:"#f1f3f5",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",stroke:"#ccc",strokeWidth:"2",fill:"none",children:[e.jsx("line",{x1:"4",y1:"4",x2:"20",y2:"20"}),e.jsx("circle",{cx:"12",cy:"12",r:"10"})]})}),e.jsx("div",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:.3,color:E?"#888":"#7950f2"},children:"None"})]})]})]}),e.jsxs("div",{style:{marginBottom:12},children:[Yn("Color"),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:Pd.map(P=>{var q,Q,B;const $=(B=(Q=(q=o==null?void 0:o.node)==null?void 0:q.attrs)==null?void 0:Q.styles)==null?void 0:B["background-color"],X=c===P.icon&&$===P.bg;return e.jsx("div",{onClick:()=>F(P),title:P.label,style:{width:26,height:26,borderRadius:6,background:P.bg,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:X?"2.5px solid #7950f2":"1.5px solid #e0e0e0",boxShadow:X?"inset 0 0 0 1px white":"none",transition:"all 0.12s ease"},children:e.jsx(Wd,{name:r||"quote",color:P.icon,size:12})},P.label)})})]}),e.jsxs("div",{style:{marginBottom:12},children:[Yn("Size"),e.jsx("div",{style:{display:"flex",gap:6},children:Object.entries(nn).map(([P])=>e.jsx(fo,{lbl:P.toUpperCase(),active:g===P,onClick:()=>W(P),icon:e.jsx("div",{style:{width:P==="sm"?14:P==="md"?18:22,he
4ight:P==="sm"?14:P==="md"?18:22,borderRadius:"50%",border:`2px solid ${g===P?"#fff":"#888"}`,background:g===P?"rgba(255,255,255,0.3)":"#f1f3f5"}})},P))})]}),e.jsxs("div",{onClick:()=>j(!b),style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 0",cursor:"pointer",borderTop:"1px solid #f1f3f5",borderBottom:b?"1px solid #f1f3f5":"none",userSelect:"none",marginBottom:b?12:0},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"#495057"},children:"Customize"}),e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#adb5bd",strokeWidth:"2",style:{transform:b?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"},children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),b&&e.jsxs("div",{children:[Yn("Icon"),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:5,marginBottom:14},children:Object.entries(Ta).map(([P,{svg:$}])=>e.jsx(fo,{icon:$(r===P?"#fff":"#666",20),active:r===P,onClick:()=>L(P)},P))}),Yn("Side"),e.jsxs("div",{style:{display:"flex",gap:6,marginBottom:14},children:[e.jsx(fo,{lbl:"Left",active:a==="left",onClick:()=>G("left"),icon:e.jsxs("svg",{width:"24",height:"18",viewBox:"0 0 28 20",fill:"none",stroke:a==="left"?"#fff":"#666",strokeWidth:"1.5",children:[e.jsx("rect",{x:"6",y:"2",width:"20",height:"16",rx:"3"}),e.jsx("circle",{cx:"6",cy:"10",r:"4",fill:a==="left"?"rgba(255,255,255,0.3)":"#e9ecef",stroke:a==="left"?"#fff":"#666"})]})}),e.jsx(fo,{lbl:"Right",active:a==="right",onClick:()=>G("right"),icon:e.jsxs("svg",{width:"24",height:"18",viewBox:"0 0 28 20",fill:"none",stroke:a==="right"?"#fff":"#666",strokeWidth:"1.5",children:[e.jsx("rect",{x:"2",y:"2",width:"20",height:"16",rx:"3"}),e.jsx("circle",{cx:"22",cy:"10",r:"4",fill:a==="right"?"rgba(255,255,255,0.3)":"#e9ecef",stroke:a==="right"?"#fff":"#666"})]})})]}),Yn("Vertical Alignment"),e.jsxs("div",{style:{display:"flex",gap:6,marginBottom:14},children:[e.jsx(fo,{lbl:"Top",active:d==="top",onClick:()=>T("top"),icon:e.jsxs("svg",{width:"24",height:"18",viewBox:"0 0 28 20",fill:"none",stroke:d==="top"?"#fff":"#666",strokeWidth:"1.5",children:[e.jsx("rect",{x:"4",y:"2",width:"20",height:"16",rx:"3"}),e.jsx("circle",{cx:"4",cy:"6",r:"3",fill:d==="top"?"rgba(255,255,255,0.3)":"#e9ecef",stroke:d==="top"?"#fff":"#666"})]})}),e.jsx(fo,{lbl:"Center",active:d==="center",onClick:()=>T("center"),icon:e.jsxs("svg",{width:"24",height:"18",viewBox:"0 0 28 20",fill:"none",stroke:d==="center"?"#fff":"#666",strokeWidth:"1.5",children:[e.jsx("rect",{x:"4",y:"2",width:"20",height:"16",rx:"3"}),e.jsx("circle",{cx:"4",cy:"10",r:"3",fill:d==="center"?"rgba(255,255,255,0.3)":"#e9ecef",stroke:d==="center"?"#fff":"#666"})]})})]}),Yn("Icon Color"),e.jsx("div",{style:{display:"flex",gap:5,marginBottom:12,flexWrap:"wrap"},children:Od.map(P=>e.jsx(O0,{color:P,active:c===P,onClick:()=>S(P)},P))})]})]})}const N0=[{value:"none",label:"None",icon:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"})})},{value:"shadow",label:"Shadow",icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"7",y:"15",width:"12",height:"4",rx:"2",fill:"currentColor",stroke:"none",opacity:"0.28"}),e.jsx("rect",{x:"5",y:"5",width:"14",height:"10",rx:"2",fill:"white"})]})},{value:"lift",label:"Lift",icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"5",y:"12",width:"15",height:"8",rx:"2",opacity:"0.35"}),e.jsx("rect",{x:"4",y:"4",width:"16",height:"9",rx:"2",fill:"white"})]})},{value:"custom",label:"Custom",icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M5 5l2 2M17 17l2 2M19 5l-2 2M7 17l-2 2",strokeLinecap:"round"})]})}],$0={none:"No hover response. This is the default — boxes aren't clickable, so hover on one is decoration rather than a cue that something will happen.",shadow:"Deepens the shadow on hover — an elevation cue with no movement. Colours are left alone.",lift:"Rises a couple of pixels and deepens the shadow. Colours are left alone, so backgrounds and borders come through untouched.",custom:null},D0=[{value:"inherit",label:"Same as resting"},{value:"none",label:"None"},{value:"subtle",label:"Subtle"},{value:"medium",label:"Medium"},{value:"strong",label:"Strong"}],Cc={fill:"",border:"",lift:0,scale:100,shadow:"inherit",transition:180},Wr={fontSize:"12px",color:"#868e96",fontWeight:500,flexShrink:0,width:"52px"};function Bu({element:t,saveNodeData:n,editor:o}){const[s,r]=mn({element:t,saveNodeData:n,editor:o,attrName:"boxHover",defaultValue:Md}),[i,c]=mn({element:t,saveNodeData:n,editor:o,attrName:"boxHoverCustom",defaultValue:null}),u={...Cc,...i||{}},a=h=>m=>c({...u,[h]:m}),f=h=>{h==="custom"&&!i&&c({...Cc,lift:2}),r(h)},d=$0[s];return e.jsxs(p,{children:[e.jsx(ye,{gap:4,grow:!0,children:N0.map(h=>e.jsx(Be,{icon:h.icon,label:h.label,value:h.value,active:s===h.value,onClick:()=>f(h.value)},h.value))}),d&&e.jsx(N,{style:{fontSize:"11px",color:"#adb5bd",lineHeight:1.5,marginTop:"10px"},children:d}),s==="custom"&&e.jsxs(p,{mt:12,p:12,style:{border:"1px dashed #e0e0e0",borderRadius:"8px",background:"#fafafa"},children:[e.jsx(N,{style:{fontSize:"10px",fontWeight:700,letterSpacing:"0.08em",color:"#868e96",marginBottom:"10px"},children:"CUSTOM HOVER"}),e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx(N,{style:Wr,children:"Fill"}),e.jsx(wt,{attrName:"boxHoverCustom",objectKey:"fill",saveNodeData:n,element:t,editor:o,swatchType:"dark",clearLabel:"Remove fill",clearValue:""})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx(N,{style:Wr,children:"Border"}),e.jsx(wt,{attrName:"boxHoverCustom",objectKey:"border",saveNodeData:n,element:t,editor:o,swatchType:"dark",clearLabel:"Remove border",clearValue:""})]}),e.jsx(He,{label:"Lift",labelWidth:"52px",value:u.lift,min:0,max:16,onChange:a("lift")}),e.jsx(He,{label:"Scale",labelWidth:"52px",unit:"%",value:u.scale,min:95,max:110,onChange:a("scale")}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx(N,{style:Wr,children:"Shadow"}),e.jsx(Ue,{value:u.shadow,onChange:h=>a("shadow")(h.target.value),size:"xs",data:D0,style:{flex:1}
4,classNames:{input:Ze.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]}),e.jsx(He,{label:"Speed",labelWidth:"52px",unit:"ms",value:u.transition,min:0,max:500,step:10,onChange:a("transition")})]}),e.jsx(N,{style:{fontSize:"11px",color:"#adb5bd",lineHeight:1.5,marginTop:"10px"},children:"Leave Fill or Border empty to keep the box's resting colour on hover."})]})]})}const F0=[{label:"Classic",borderColor:"#6b7280",bg:"#f8f9fa"},{label:"Ocean",borderColor:"#4f6df5",bg:"#f0f4ff"},{label:"Warm",borderColor:"#ca8a04",bg:"#fefce8"},{label:"Nature",borderColor:"#16a34a",bg:"#f0fdf4"},{label:"Rose",borderColor:"#e11d48",bg:"#fff1f2"},{label:"Violet",borderColor:"#8b5cf6",bg:"#faf5ff"},{label:"Ember",borderColor:"#ea580c",bg:"#fff7ed"},{label:"Teal",borderColor:"#0d9488",bg:"#f0fdfa"}],Or=({color:t,size:n})=>e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:t,opacity:"0.4",children:e.jsx("path",{d:"M4.583 17.321C3.553 16.227 3 15 3 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 01-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179zm10 0C13.553 16.227 13 15 13 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 01-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"})}),Ho=t=>e.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#868e96",marginBottom:6,textTransform:"uppercase",letterSpacing:.5},children:t}),An=({icon:t,lbl:n,active:o,onClick:s})=>e.jsxs("div",{onClick:s,style:{flex:"1 1 0",minWidth:0,padding:"8px 4px 6px",border:`1.5px solid ${o?"#7950f2":"#e0e0e0"}`,borderRadius:10,backgroundColor:o?"#7950f2":"#fff",cursor:"pointer",textAlign:"center",transition:"all 0.15s ease",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4},children:[e.jsx("div",{style:{color:o?"#fff":"#666",display:"flex",alignItems:"center",justifyContent:"center"},children:t}),n&&e.jsx("div",{style:{fontSize:9,fontWeight:700,textTransform:"uppercase",letterSpacing:.5,color:o?"#fff":"#888",lineHeight:1},children:n})]}),H0=(t,n)=>({left:e.jsxs("svg",{width:"22",height:"16",viewBox:"0 0 24 18",fill:"none",children:[e.jsx("rect",{x:"6",y:"1",width:"16",height:"16",rx:"3",stroke:n,strokeWidth:"1.5",fill:"none"}),e.jsx("line",{x1:"3",y1:"3",x2:"3",y2:"15",stroke:n,strokeWidth:"3",strokeLinecap:"round"})]}),right:e.jsxs("svg",{width:"22",height:"16",viewBox:"0 0 24 18",fill:"none",children:[e.jsx("rect",{x:"2",y:"1",width:"16",height:"16",rx:"3",stroke:n,strokeWidth:"1.5",fill:"none"}),e.jsx("line",{x1:"21",y1:"3",x2:"21",y2:"15",stroke:n,strokeWidth:"3",strokeLinecap:"round"})]}),top:e.jsxs("svg",{width:"22",height:"16",viewBox:"0 0 24 18",fill:"none",children:[e.jsx("rect",{x:"4",y:"5",width:"16",height:"12",rx:"3",stroke:n,strokeWidth:"1.5",fill:"none"}),e.jsx("line",{x1:"6",y1:"2",x2:"18",y2:"2",stroke:n,strokeWidth:"3",strokeLinecap:"round"})]}),bottom:e.jsxs("svg",{width:"22",height:"16",viewBox:"0 0 24 18",fill:"none",children:[e.jsx("rect",{x:"4",y:"1",width:"16",height:"12",rx:"3",stroke:n,strokeWidth:"1.5",fill:"none"}),e.jsx("line",{x1:"6",y1:"16",x2:"18",y2:"16",stroke:n,strokeWidth:"3",strokeLinecap:"round"})]})})[t],Sc=46,ho="20px",U0=["top","right","bottom","left"],V0=(t,n,o,s,r,i)=>{const c={...t};return U0.forEach(u=>{c[`border-${u}-width`]="0px",c[`border-${u}-style`]="none",c[`border-${u}-color`]="transparent"}),c[`border-${n}-width`]="4px",c[`border-${n}-style`]="solid",c[`border-${n}-color`]=o,c["background-color"]=r?s:"transparent",i==="none"?(c["padding-left"]=ho,c["padding-right"]=ho):i==="left"?(c["padding-left"]=`${Sc}px`,c["padding-right"]=ho):(c["padding-left"]=ho,c["padding-right"]=`${Sc}px`),c["padding-top"]||(c["padding-top"]=ho),c["padding-bottom"]||(c["padding-bottom"]=ho),c};function K0({editor:t,element:n,column:o,saveNodeData:s}){const[r,i]=l.useState("left"),[c,u]=l.useState("#6b7280"),[a,f]=l.useState("curved"),[d,h]=l.useState("#f8f9fa"),[m,x]=l.useState(!0),[g,w]=l.useState("left"),b=l.useRef(!1),j=l.useRef(null);l.useEffect(()=>()=>clearTimeout(j.current),[]),l.useEffect(()=>{var R;if((R=n==null?void 0:n.node)!=null&&R.attrs){if(b.current)return;const F=n.node.attrs;i(F.borderSide||"left"),u(F.borderColor||"#6b7280"),f(F.borderRadius||"curved"),h(F.backgroundColor||"#f8f9fa"),x(F.hasBg!==!1),w(F.iconPosition||"left")}},[n]);const A=R=>{const{tr:F,doc:G}=t.view.state,T=G.nodeAt(n.pos);if(!T)return;const L={...T.attrs,...R};if(F.setNodeMarkup(n.pos,void 0,L),o){const S=G.nodeAt(o.pos);if(S){const W=V0(S.attrs.styles||{},L.borderSide||"left",L.borderColor||"#6b7280",L.backgroundColor||"#f8f9fa",L.hasBg!==!1,L.iconPosition||"left");F.setNodeMarkup(o.pos,void 0,{...S.attrs,styles:W,radius:L.borderRadius==="curved"?"with-radius":"no-radius"})}}
4b.current=!0,clearTimeout(j.current),j.current=setTimeout(()=>{b.current=!1},100),t.view.dispatch(F),s&&s()},v=R=>{u(R.borderColor),h(R.bg),A({borderColor:R.borderColor,backgroundColor:R.bg})},k=R=>{i(R),A({borderSide:R})},C=R=>{w(R),A({iconPosition:R})},I=R=>{f(R),A({borderRadius:R})},_=R=>{x(R),A({hasBg:R})};return e.jsxs("div",{children:[e.jsxs("div",{style:{marginBottom:12},children:[Ho("Accent Color"),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:6},children:F0.map(R=>{const F=c===R.borderColor;return e.jsxs("div",{onClick:()=>v(R),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,padding:"8px 4px 6px",borderRadius:10,cursor:"pointer",border:`1.5px solid ${F?"#7950f2":"#e0e0e0"}`,backgroundColor:F?"#f0f9ff":"#fff",transition:"all 0.15s ease"},children:[e.jsx("div",{style:{width:40,height:28,borderRadius:4,background:R.bg,borderLeft:`3px solid ${R.borderColor}`,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Or,{color:R.borderColor,size:14})}),e.jsx("div",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:.3,color:F?"#7950f2":"#888"},children:R.label})]},R.label)})})]}),e.jsxs("div",{style:{marginBottom:12},children:[Ho("Border Side"),e.jsx("div",{style:{display:"flex",gap:6},children:["left","right","top","bottom"].map(R=>e.jsx(An,{lbl:R.charAt(0).toUpperCase()+R.slice(1),active:r===R,onClick:()=>k(R),icon:H0(R,r===R?"#fff":"#666")},R))})]}),e.jsxs("div",{style:{marginBottom:12},children:[Ho("Quote Icon"),e.jsxs("div",{style:{display:"flex",gap:6},children:[e.jsx(An,{lbl:"Left",active:g==="left",onClick:()=>C("left"),icon:e.jsx(Or,{color:g==="left"?"#fff":"#666",size:16})}),e.jsx(An,{lbl:"Right",active:g==="right",onClick:()=>C("right"),icon:e.jsx(Or,{color:g==="right"?"#fff":"#666",size:16})}),e.jsx(An,{lbl:"None",active:g==="none",onClick:()=>C("none"),icon:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:g==="none"?"#fff":"#666",strokeWidth:"2",children:[e.jsx("line",{x1:"4",y1:"4",x2:"20",y2:"20"}),e.jsx("circle",{cx:"12",cy:"12",r:"10"})]})})]})]}),e.jsxs("div",{style:{marginBottom:12},children:[Ho("Corners"),e.jsxs("div",{style:{display:"flex",gap:6},children:[e.jsx(An,{lbl:"Curved",active:a==="curved",onClick:()=>I("curved"),icon:e.jsx("svg",{width:"22",height:"16",viewBox:"0 0 24 18",fill:"none",children:e.jsx("rect",{x:"3",y:"1",width:"18",height:"16",rx:"4",stroke:a==="curved"?"#fff":"#666",strokeWidth:"1.5",fill:"none"})})}),e.jsx(An,{lbl:"Straight",active:a==="straight",onClick:()=>I("straight"),icon:e.jsx("svg",{width:"22",height:"16",viewBox:"0 0 24 18",fill:"none",children:e.jsx("rect",{x:"3",y:"1",width:"18",height:"16",rx:"0",stroke:a==="straight"?"#fff":"#666",strokeWidth:"1.5",fill:"none"})})})]})]}),e.jsxs("div",{style:{marginBottom:0},children:[Ho("Background"),e.jsxs("div",{style:{display:"flex",gap:6},children:[e.jsx(An,{lbl:"Filled",active:m,onClick:()=>_(!0),icon:e.jsx("svg",{width:"22",height:"16",viewBox:"0 0 24 18",fill:"none",children:e.jsx("rect",{x:"3",y:"1",width:"18",height:"16",rx:"3",fill:m?"rgba(255,255,255,0.3)":"#e9ecef",stroke:m?"#fff":"#666",strokeWidth:"1.5"})})}),e.jsx(An,{lbl:"None",active:!m,onClick:()=>_(!1),icon:e.jsx("svg",{width:"22",height:"16",viewBox:"0 0 24 18",fill:"none",children:e.jsx("rect",{x:"3",y:"1",width:"18",height:"16",rx:"3",stroke:m?"#666":"#fff",strokeWidth:"1.5",strokeDasharray:"3 2"})})})]})]})]})}const ui="fullpage",di="auto",fi="custom",G0="65ch",Mr=[{label:"Auto",value:di},{label:"Full",value:ui},{label:"Narrow",value:G0},{label:"Custom",value:fi}],Y0="720px",po={fontSize:"11px",fontWeight:600,color:"#666",marginBottom:6},Nr={fontSize:"11px",color:"#868e96",background:"#f8f9fa",borderRadius:"8px",padding:"8px 10px",marginTop:10,lineHeight:1.45};function q0({element:t,editor:n,saveNodeData:o,styleTarget:s,onStyleTargetSaved:r}){var R,F,G;const[i,c]=l.useState(null),[u,a]=l.useState(!1),[f,d]=l.useState(null),[h,m]=l.useState(null),[x,g]=l.useState(!1),w=l.useRef(!1);l.useEffect(()=>{if(t&&t.node.attrs){const T=t.node.attrs,L=T.width||null;L&&!Mr.find(S=>S.value===L)?(c(L),a(!0)):(c(L),a(!1)),d(T.minWidth||null),m(T.maxWidth||null),g(T.fullWidth===!0)}},[t]),l.useEffect(()=>{if(!w.current||(w.current=!1,!n))return;const T=x?{fullWidth:!0,width:null,minWidth:null,maxWidth:null,selfAlign:"stretch"}:{fullWidth:!1,width:i,minWidth:f,maxWidth:h};(s?$t({editor:n,element:t,styleTarget:s,attrs:T}):be(n,t,T))&&(clearTimeout(window._widthSettingsDebounce),window._widthSettingsDebounce=setTimeout(()=>{var S;(S=s?r:o)==null||S()},2e3))},[i,f,h,x,n,t,r,o,s]);const b=T=>{if(w.current=!0,T===ui){a(!1),g(!0),c(null),d(null),m(null);return}g(!1),T===fi?(a(!0),c(L=>L||Y0)):(a(!1),T===di?(c(null),d(null),m(null)):c(T))},j=x?ui:u?fi:i==null?di:Mr.find(T=>T.value===i)?i:null,{breakpoint:A}=Et(),v=((R=t==null?void 0:t.node)==null?void 0:R.attrs)||null,k=((G=(F=t==null?void 0:t.node)==null?void 0:F.type)==null?void 0:G.name)||"",C=A!=="desktop"&&k?rs(k,{attrs:v}):null,I=!!C&&C.has("width"),_=!!C&&C.has("maxWidth");if(A!=="desktop"){if(!I&&!_)return e.jsx(p,{children:e.jsx(p,{style:Nr,children:v!=null&&v.fullWidth?"Full-page blocks span every device — per-device width overrides don’t apply.":"Per-device width needs an explicit Desktop size first — switch to Desktop and set Width to Narrow or Custom (or a max width)."})});const T=So(v,"width",A),L=So(v,"maxWidth",A),S=T||L,W=qs(v,"width",A)||null,E=qs(v,"maxWidth",A)||(v!=null&&v.width?"100%":null),P=(X,q)=>{n&&ur(n,t,A,{[X]:q||null})},$=()=>{n&&ki(n,t,A,["width","maxWidth"])};return e.jsxs(p,{children:[S&&e.jsx(p,{style:{display:"flex",justifyContent:"flex-end",marginBottom:6},children:e.jsx(Jn,{onClick:$})}),I&&e.jsxs(e.Fragment,{children:[e.jsxs(p,{style:{...po,color:Js(T)||po.color},children:["Width",T&&Qs]}),e.jsx(on,{value:W,onChange:X=>P("width",X),units:Eo,placeholder:"720"})]}),_&&e.jsxs(e.Fragment,{children:[e.jsxs(p,{style:{...po,marginTop:I?14:0,color:Js(L)||po.color},children:["Max width",L&&Qs]}),e.jsx(on,{value:E,onChange:X=>P("maxWidth",X),units:Eo,placeholder:"Max"})]}),e.jsx(p,{style:Nr,children:S?"Overridden for this device — other sizing options (Full, min width, alignment) follow Desktop.":"Inherited from Desktop — editing creates a "+A+" override."})]})}return e.jsxs(p,{children:[e.jsx(p,{style:po,children:"Width"}),e.jsx(Pe,{options:Mr,activeValue:j,onChange:b,columns:4}),u&&!x&&e.jsx(p,{mt:12,children:e.jsx(on,{value:i,onChange:T=>
4{w.current=!0,c(T)},units:Eo,placeholder:"720"})}),e.jsx(p,{style:{...po,marginTop:14},children:"Min / max width"}),e.jsx(p,{style:x?{opacity:.45,pointerEvents:"none"}:void 0,children:e.jsxs(p,{style:{display:"flex",gap:8},children:[e.jsx(p,{style:{flex:1,minWidth:0},children:e.jsx(on,{value:f,onChange:T=>{w.current=!0,d(T)},units:Eo,placeholder:"Min"})}),e.jsx(p,{style:{flex:1,minWidth:0},children:e.jsx(on,{value:h,onChange:T=>{w.current=!0,m(T)},units:Eo,placeholder:"Max"})})]})}),x&&e.jsx(p,{style:Nr,children:"The block spans the full page — min / max width don't apply."})]})}const X0=[{label:"Left",value:"left"},{label:"Center",value:"center"},{label:"Right",value:"right"},{label:"Stretch",value:"stretch"}],Z0={fontSize:"11px",color:"#868e96",background:"#f8f9fa",borderRadius:"8px",padding:"8px 10px",marginTop:10,lineHeight:1.45};function Q0({element:t,editor:n,saveNodeData:o,styleTarget:s,onStyleTargetSaved:r}){var g;const[i,c]=l.useState("stretch"),u=l.useRef(!1),{breakpoint:a}=Et(),f=((g=t==null?void 0:t.node)==null?void 0:g.attrs)||{},d=f.fullWidth===!0,h=a!=="desktop"&&So(f,"selfAlign",a);l.useEffect(()=>{t&&t.node.attrs&&c(qs(t.node.attrs,"selfAlign",a)||"stretch")},[t,a]),l.useEffect(()=>{if(!u.current||(u.current=!1,!n))return;if(a!=="desktop"){if(!ur(n,t,a,{selfAlign:i}))return;r==null||r();return}(s?$t({editor:n,element:t,styleTarget:s,attrs:{selfAlign:i}}):be(n,t,{selfAlign:i}))&&(clearTimeout(window._selfAlignmentDebounce),window._selfAlignmentDebounce=setTimeout(()=>{var b;(b=s?r:o)==null||b()},2e3))},[i,a,n,t,r,o,s]);const m=w=>{u.current=!0,c(w)},x=()=>{if(a==="desktop"||!n||!ki(n,t,a,["selfAlign"]))return;c(qs(f,"selfAlign",a==="mobile"?"tablet":"desktop")||"stretch"),r==null||r()};return e.jsxs(p,{children:[h&&e.jsx(p,{style:{display:"flex",justifyContent:"flex-end",marginBottom:6},children:e.jsx(Jn,{onClick:x})}),e.jsx(p,{style:d?{opacity:.45,pointerEvents:"none"}:void 0,children:e.jsx(Pe,{options:X0,activeValue:i,onChange:m,columns:4})}),d&&e.jsxs(p,{style:Z0,children:["The block spans the full page — switch the Size section off ",e.jsx("b",{children:"Full"})," ","to align it."]})]})}const J0={fontSize:"11px",fontWeight:600,color:"#666",marginBottom:6},e1={fontSize:"11px",color:"#997404",background:"#fff9db",borderRadius:"8px",padding:"8px 10px",marginTop:10,lineHeight:1.45};function t1({element:t,editor:n,saveNodeData:o,styleTarget:s,onStyleTargetSaved:r}){var h,m;const[i,c]=l.useState(null),[u,a]=l.useState(null),f=l.useRef(!1),d=((m=(h=t==null?void 0:t.node)==null?void 0:h.attrs)==null?void 0:m.overflow)||null;return l.useEffect(()=>{t&&t.node.attrs&&(c(t.node.attrs.height||null),a(t.node.attrs.maxHeight||null))},[t]),l.useEffect(()=>{!f.current||(f.current=!1,!n)||!(s?$t({editor:n,element:t,styleTarget:s,attrs:{height:i,maxHeight:u}}):be(n,t,{height:i,maxHeight:u}))||(clearTimeout(window._heightSettingsDebounce),window._heightSettingsDebounce=setTimeout(()=>{var g;(g=s?r:o)==null||g()},2e3))},[i,u,n,t,r,o,s]),e.jsxs(p,{children:[e.jsx(p,{style:J0,children:"Height / max height"}),e.jsxs(p,{style:{display:"flex",gap:8},children:[e.jsx(p,{style:{flex:1,minWidth:0},children:e.jsx(on,{value:i,onChange:x=>{f.current=!0,c(x)},units:Gr,placeholder:"Height"})}),e.jsx(p,{style:{flex:1,minWidth:0},children:e.jsx(on,{value:u,onChange:x=>{f.current=!0,a(x)},units:Gr,placeholder:"Max"})})]}),(i||u)&&d!=="hidden"&&e.jsxs(p,{style:e1,children:["Content taller than a fixed height will spill out — set"," ",e.jsx("b",{children:"Overflow"})," to Hidden below to clip it."]})]})}const n1=[{label:"Auto",value:null},{label:"Visible",value:"visible"},{label:"Hidden",value:"hidden"}];function o1({element:t,editor:n,saveNodeData:o,styleTarget:s,onStyleTargetSaved:r}){const[i,c]=l.useState(null),u=l.useRef(!1);l.useEffect(()=>{t&&t.node.attrs&&c(t.node.attrs.overflow||null)},[t]),l.useEffect(()=>{!u.current||(u.current=!1,!n)||!(s?$t({editor:n,element:t,styleTarget:s,attrs:{overflow:i}}):be(n,t,{overflow:i}))||(clearTimeout(window._overflowSettingDebounce),window._overflowSettingDebounce=setTimeout(()=>{var d;(d=s?r:o)==null||d()},2e3))},[i,n,t,r,o,s]);const a=f=>
4{u.current=!0,c(f)};return e.jsx(p,{children:e.jsx(Pe,{options:n1,activeValue:i,onChange:a,columns:3})})}const $r=[{label:"Auto",value:null},{label:"1:1",value:"1/1"},{label:"4:3",value:"4/3"},{label:"16:9",value:"16/9"},{label:"21:9",value:"21/9"},{label:"Custom",value:"custom"}],Tc={flex:1,minWidth:0,"& input":{padding:"2px 6px",border:"1.5px solid #e0e0e0",borderRadius:"6px",fontSize:"11px",fontWeight:600,height:"26px",minHeight:"26px"}},Ru={fontSize:"11px",color:"#868e96",background:"#f8f9fa",borderRadius:"8px",padding:"8px 10px",marginTop:10,lineHeight:1.45},s1={...Ru,color:"#997404",background:"#fff9db"},r1=t=>{if(typeof t!="string")return null;const n=t.trim().match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);return n?{w:parseFloat(n[1]),h:parseFloat(n[2])}:null};function i1({element:t,editor:n,saveNodeData:o,styleTarget:s,onStyleTargetSaved:r}){var A,v;const[i,c]=l.useState(null),[u,a]=l.useState(!1),[f,d]=l.useState(3),[h,m]=l.useState(2),x=l.useRef(!1),g=!!((v=(A=t==null?void 0:t.node)==null?void 0:A.attrs)!=null&&v.height);l.useEffect(()=>{if(t&&t.node.attrs){const k=t.node.attrs.aspectRatio||null;if(k&&!$r.find(C=>C.value===k)){const C=r1(k);c(k),a(!0),C&&(d(C.w),m(C.h))}else c(k),a(!1)}},[t]),l.useEffect(()=>{!x.current||(x.current=!1,!n)||!(s?$t({editor:n,element:t,styleTarget:s,attrs:{aspectRatio:i}}):be(n,t,{aspectRatio:i}))||(clearTimeout(window._aspectRatioDebounce),window._aspectRatioDebounce=setTimeout(()=>{var C;(C=s?r:o)==null||C()},2e3))},[i,n,t,r,o,s]);const w=k=>{x.current=!0,k==="custom"?(a(!0),c(`${f||1}/${h||1}`)):(a(!1),c(k))},b=(k,C)=>{x.current=!0,c(`${k||1}/${C||1}`)},j=u?"custom":$r.find(k=>k.value===i)?i:null;return e.jsxs(p,{children:[e.jsx(Pe,{options:$r,activeValue:j,onChange:w,columns:3}),u&&e.jsxs(p,{style:{display:"flex",gap:8,alignItems:"center",marginTop:12},children:[e.jsx(Rt,{value:f,onChange:k=>{d(k),b(k,h)},min:1,hideControls:!0,size:"xs",placeholder:"W",style:Tc}),e.jsx(p,{style:{fontSize:"11px",fontWeight:700,color:"#999",flexShrink:0},children:":"}),e.jsx(Rt,{value:h,onChange:k=>{m(k),b(f,k)},min:1,hideControls:!0,size:"xs",placeholder:"H",style:Tc})]}),i&&g&&e.jsxs(p,{style:s1,children:["An explicit ",e.jsx("b",{children:"Height"})," is set — it overrides the aspect ratio. Clear it to let the ratio drive height."]}),i&&e.jsxs(p,{style:Ru,children:["The ratio is a preference — taller content still stretches the box. Pair with ",e.jsx("b",{children:"Overflow: Hidden"})," for cropped media frames."]})]})}function l1(t){var r,i,c,u,a,f,d;const n=(i=(r=t==null?void 0:t.attrs)==null?void 0:r.styles)==null?void 0:i["font-family"];if(n)return n;const o=((c=t==null?void 0:t.content)==null?void 0:c.content)||[];let s=null;for(const h of o)if(((u=h.type)==null?void 0:u.name)==="text"&&h.text){const m=((d=(f=(a=h.marks)==null?void 0:a.find(x=>{var g;return((g=x.type)==null?void 0:g.name)==="textStyle"}))==null?void 0:f.attrs)==null?void 0:d.fontFamily)||null;if(s===null)s=m;else if(s!==m)return""}return s||""}function a1({element:t,saveNodeData:n}){const[o,s]=l.useState(""),[r,i]=l.useState(!1),c=l.useMemo(()=>Jc(l1(t==null?void 0:t.node)),[t]);l.useEffect(()=>{var d;if(!(t!=null&&t.node))return;const f=(d=t.node.attrs.styles)==null?void 0:d["font-weight"];s(f?String(f):"")},[t]);const u=o!==""&&!c.some(f=>f.value===o),a=f=>{const d=f||"";if(s(d),!(t!=null&&t.node))return;const h={...t.node.attrs.styles};h["font-weight"]=d,n({newStyles:h,_node:t,changedStyleKeys:["font-weight"]},"styles")};return e.jsxs(Fe,{gap:4,mb:10,children:[e.jsx(N,{size:"xs",fw:500,c:"dimmed",children:"Weight"}),e.jsx(jt,{value:u?null:o,onChange:a,dropdownOpened:r,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),data:c,placeholder:u?`${o} — not in this font`:cs,renderOption:({option:f})=>e.jsx(N,{size:"sm",style:{fontWeight:f.value||"inherit"},children:f.label}),rightSection:e.jsx(bi.Chevron,{}),rightSectionPointerEvents:"auto",rightSectionProps:{onMouseDown:f=>lr(f,()=>i(d=>!d)),style:{cursor:"pointer"}},comboboxProps:{zIndex:99999},allowDeselect:!1})]})}function c1(t){var s;const n=[],o=r=>{var c,u,a;if(!(r!=null&&r.isText)&&((c=r==null?void 0:r.type)==null?void 0:c.name)!=="text"||!r.text)return;const i=(u=r.marks)==null?void 0:u.find(f=>{var d;return((d=f.type)==null?void 0:d.name)==="textStyle"});n.push(((a=i==null?void 0:i.attrs)==null?void 0:a.color)||null)};if(typeof(t==null?void 0:t.descendants)=="function")t.descendants(r=>o(r));else{const r=i=>{var c;o(i);for(const u of((c=i==null?void 0:i.content)==null?void 0:c.content)||[])r(u)};for(const i of((s=t==null?void 0:t.content)==null?void 0:s.content)||[])r(i)}return n}function Eu(t){var s,r;
4const n=c1(t),o=n.filter(Boolean);return o.length>0?n.length===o.length&&n.every(i=>i===n[0])?n[0]:"":((r=(s=t==null?void 0:t.attrs)==null?void 0:s.styles)==null?void 0:r.color)||""}function u1(t,n){var c,u,a,f,d;const o=(u=(c=t==null?void 0:t.view)==null?void 0:c.state)==null?void 0:u.doc;if(!o||!(n!=null&&n.node))return null;const s=(a=n.node.type)==null?void 0:a.name;if(typeof n.pos=="number"){const h=o.nodeAt(n.pos);if(h&&(!s||((f=h.type)==null?void 0:f.name)===s))return{node:h,pos:n.pos}}const r=(d=n.node.attrs)==null?void 0:d.uid;if(!r)return null;let i=null;return o.descendants((h,m)=>{var x,g;return((x=h.type)==null?void 0:x.name)===s&&((g=h.attrs)==null?void 0:g.uid)===r?(i={node:h,pos:m},!1):!0}),i}function zu(t,n){var d,h;const o=u1(t,n),s=(h=(d=t==null?void 0:t.view)==null?void 0:d.state)==null?void 0:h.selection;if(!o||!s)return null;const r=o.pos+1,i=o.pos+o.node.nodeSize-1,c=Math.max(r,s.from),u=Math.min(i,s.to),a=s instanceof Tf&&!s.empty&&c<u,f=a&&(s.from<r||s.to>i);return{...o,range:a?f?{from:s.from,to:s.to}:{from:c,to:u}:{from:r,to:i},usesSelection:a}}function Ic(t,n){var r,i;const o=zu(t,n);if(!o)return Eu(n==null?void 0:n.node);const s=Nd(t.view.state.doc,o.range);return s.colorMixed||s.textGradientMixed?"":s.color?s.color:((i=(r=o.node.attrs)==null?void 0:r.styles)==null?void 0:i.color)||""}function d1(t,n){var i,c;if(!n||n.usesSelection)return;const o=(i=t==null?void 0:t.view)==null?void 0:i.state,s=(c=n.node.attrs)==null?void 0:c.styles;if(!o||!(s!=null&&s.color))return;const r={...s};delete r.color,t.view.dispatch(o.tr.setNodeMarkup(n.pos,void 0,{...n.node.attrs,styles:r}))}function f1(t,n,o){const s=zu(t,n);return s?(d1(t,s),$d(t,s.range,{color:o||null,textGradient:null})):!1}function h1(t,n,o=!1){var r,i;const s={newStyles:{...((i=(r=t==null?void 0:t.node)==null?void 0:r.attrs)==null?void 0:i.styles)||{},color:n||""},_node:t,changedStyleKeys:["color"]};return o||(s.clearTextStyleAttrs=["color","textGradient"]),s}const p1=["#000000","#333333","#666666","rgba(255,255,255,1)","#f0f0f0"],x1=t=>typeof t=="string"&&(t.includes("themed(")||t.startsWith("token:")||t.startsWith("gradient:")||t.startsWith("recipe:")||t.startsWith("tint:"));function g1({element:t,saveNodeData:n,editor:o,preserveTextStyleMarks:s=!1}){var x,g,w,b,j;const r=ee(A=>A.colors),i=(g=(x=t==null?void 0:t.key)!=null?x:t==null?void 0:t.uid)!=null?g:null,c=l.useRef(t);c.current=t;const u=!s&&!!o,a=s?((j=(b=(w=t==null?void 0:t.node)==null?void 0:w.attrs)==null?void 0:b.styles)==null?void 0:j.color)||"":o?null:Eu(t==null?void 0:t.node),[f,d]=l.useState(()=>u?Ic(o,t):a||"");l.useEffect(()=>{u||d(a||"")},[u,a,i]),l.useEffect(()=>{if(!u)return;const A=()=>d(v=>{const k=Ic(o,c.current);return v===k?v:k});if(A(),!!o.on)return o.on("transaction",A),o.on("selectionUpdate",A),()=>{var v,k;(v=o.off)==null||v.call(o,"transaction",A),(k=o.off)==null||k.call(o,"selectionUpdate",A)}},[o,u,i]);const h=A=>{const v=A||"";if(d(v),!!(t!=null&&t.node)){if(!s&&o){f1(o,t,v);return}typeof n=="function"&&n(h1(t,v,s),"styles")}},m=x1(f)?Zt(f,r):f;return e.jsxs(Fe,{gap:5,mb:10,children:[e.jsx(N,{size:"xs",fw:500,c:"dimmed",children:"Text color"}),e.jsxs(p,{className:Zs.row,children:[e.jsx(p,{"aria-label":"Use inherited text color",onClick:()=>h(""),className:Zs.clearSwatch,style:{width:"28px",height:"28px",border:f?"1.5px solid #ddd":"2.5px solid #7950f2",boxShadow:f?"none":"inset 0 0 0 1.5px white"},title:"Use inherited text color"}),e.jsx(bn,{label:"",colors:p1,value:m,onChange:h,hideGradientControls:!0,swatchSize:28})]})]})}function Lu({node:t,saveNodeData:n,editor:o,forceDesktop:s=!1,preserveTextStyleMarks:r=!1}){const{breakpoint:i}=Et(),c=s?"desktop":i;return e.jsxs(e.Fragment,{children:[c==="desktop"?e.jsxs(ye,{gap:8,grow:!0,wrap:"nowrap",align:"flex-start",children:[e.jsx(iu,{saveNodeData:n,element:t,editor:o,preserveTextStyleMarks:r}),e.jsx(a1,{saveNodeData:n,element:t})]}):e.jsx(p,{mb:10,p:"xs",style:{borderRadius:8,background:"#f8f9fa"},children:e.jsx(N,{size:"xs",c:"dimmed",children:"Font family and weight follow Desktop."})}),e.jsxs(ye,{gap:8,grow:!0,wrap:"nowrap",align:"flex-start",children:[e.jsx(hu,{saveNodeData:n,element:t,editor:o,breakpointOverride:c,preserveTextStyleMarks:r}),e.jsx(pu,{saveNodeData:n,element:t,editor:o,breakpointOverride:c})]}),e.jsx(g1,{element:t,saveNodeData:n,editor:o,preserveTextStyleMarks:r})]})}function Pu({element:t,saveNodeData:n,editor:o}){return e.jsx(Lu,{node:t,saveNodeData:n,editor:o,preserveTextStyleMarks:!0})}const m1=new Set(["infobox","blockquote","icontext","codeBlock"]),b1=[{label:"Auto",value:null},{label:"75px",value:"75px"},{label:"Custom",value:"custom"}];function _c(t){var n,o;return(t==null?void 0:t.nodeType)==="shareblock"&&((o=(n=t==null?void 0:t.node)==null?void 0:n.attrs)==null?void 0:o.shareBlockKind)==="site_header"}const y1=new Set(["badgePill","file","image","video","embed","resource","detailsSummary"]);function v1(t,n=!0){var o,s;return n!==!1&&!m1.has((s=(o=t==null?void 0:t.node)==null?void 0:o.type)==null?void 0:s.name)}const j1=new Set(["","none","url(none)","url(null)"]);function k1(t,n="color"){const o=t==null?void 0:t["background-image"];if(typeof o!="string")return n;const s=o.trim();return j1.has(s.toLowerCase())?"color":/url\(/i.test(s)?"image":"color"}function jo({element:t,saveNodeData:n,editor:o,allowEffects:s=!0,styleTarget:r,onStyleTargetSaved:i}){return v1(t,s)?e.jsxs(e.Fragment,{children:[e.jsxs(p,{style:{marginTop:14,paddingTop:14,borderTop:"1px solid #ececec"},children:[e.jsx(p,{style:{fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},children:"Pattern"}),e.jsx(w0,{element:t,saveNodeData:n,editor:o,styleTarget:r,onStyleTargetSaved:i})]}),e.jsxs(p,{style:{marginTop:14,paddingTop:14,borderTop:"1px solid #ececec"},children:[e.jsx(p,{style:{fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},children:"Glow position"}),e.jsx(P0,{element:t,saveNodeData:n,editor:o,styleTarget:r,onStyleTargetSaved:i})]})]}):null}const w1=["margin-top","margin-bottom","margin-left","margin-right"],C1=["padding-top","padding-bottom","padding-left","padding-right"],S1=Object.freeze({"margin-top":"0px","margin-bottom":"0px","margin-left":"0px","margin-right":"0px"}),Ds=(t,n,o="0px")=>{const s=t==null?void 0:t[n];return s==null||s===""?o:s},Ac=t=>{if(t==null||t==="")return!0;const n=parseInt(String(t).replace("px",""),10);return Number.isFinite(n)?n===0:t==="0px"},T1=(t,n)=>{var i,c,u,a;if(!t||!n)return n;const o=((c=(i=t.node)==null?void 0:i.attrs)==null?void 0:c.styles)||{},s=((a=(u=n.node)==null?void 0:u.attrs)==null?void 0:a.styles)||{},r={...s,...S1};return w1.forEach(f=>{const d=f==="margin-top"?"10px":"0px",h=Ds(o,f,null),m=Ds(s,f,null);r[f]=Ac(h)&&!Ac(m)?m:Ds(o,f,d)}),C1.forEach(f=>{r[f]=Ds(s,f,"0px")}),{...n,node:{...n.node,attrs:{...n.node.attrs,styles:r}}}},hi=t=>em.includes(t),Bc=t=>{var n,o;return["box","container"].includes((o=(n=t==null?void 0:t.node)==null?void 0:n.type)==null?void 0:o.name)};function Go(t,{editorId:n,controlKind:o,keys:s}){var a,f,d,h;if(!(t!=null&&t.node))return null;const r=(d=(f=t.uid)!=null?f:(a=t.node.attrs)==null?void 0:a.uid)!=null?d:null,i=t.uidIsStable===!0,c=((h=t.node.type)==null?void 0:h.name)||null,u=t.
4surface||"wrapper";return xi({editorId:n,scopeKey:t.key,nodeType:c,uid:r,uidIsStable:i,pos:t.pos,surface:u,styleStorage:"attrs",styleAttr:"attrs",saveAttr:"attrs",controlKind:o,allowedKeys:s,storageSurface:u,writeTargets:[{scopeKey:t.key,uid:r,uidIsStable:i,pos:t.pos,nodeType:c,surface:u,attr:"attrs",keys:s,mergeStrategy:"mergeAttrs"}]})}const Dr={fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},Fr={marginTop:14,paddingTop:14,borderTop:"1px solid #ececec"};function I1({children:t}){const{breakpoint:n}=Et(),o=n!=="desktop";return e.jsxs(p,{"data-responsive-locked-subsection":o?"true":void 0,children:[o&&e.jsx(p,{style:{fontSize:"11px",color:"#868e96",background:"#f8f9fa",borderRadius:8,padding:"8px 10px",marginTop:14,lineHeight:1.45},children:"Height, aspect ratio, and overflow follow Desktop."}),e.jsx(p,{inert:o||void 0,"aria-disabled":o||void 0,style:o?{opacity:.45,pointerEvents:"none"}:void 0,children:t})]})}function ko({keyPrefix:t,element:n,editorId:o,editor:s,saveNodeData:r,onSaveNodeData:i,minHeightControl:c,includeWidth:u=!0,includeInnerDimensions:a=!0}){return n!=null&&n.node?e.jsxs(y.Item,{value:`${t}-size`,children:[e.jsx(y.Control,{children:"Size"}),e.jsxs(y.Panel,{children:[u&&e.jsx(q0,{element:n,editor:s,saveNodeData:r,styleTarget:Go(n,{editorId:o,controlKind:"size",keys:qg}),onStyleTargetSaved:i}),a&&e.jsxs(I1,{children:[e.jsxs(p,{style:u?Fr:void 0,children:[e.jsx(p,{style:Dr,children:"Height"}),c&&e.jsxs(e.Fragment,{children:[e.jsx(p,{style:{fontSize:"11px",fontWeight:600,color:"#666",marginBottom:6},children:"Min height"}),e.jsx(tr,{element:c.element||n,editor:s,saveNodeData:r,styleTarget:c.styleTarget,onStyleTargetSaved:i})]}),e.jsx(p,{style:c?{marginTop:14}:void 0,children:e.jsx(t1,{element:n,editor:s,saveNodeData:r,styleTarget:Go(n,{editorId:o,controlKind:"height",keys:Zg}),onStyleTargetSaved:i})})]}),e.jsxs(p,{style:Fr,children:[e.jsx(p,{style:Dr,children:"Aspect ratio"}),e.jsx(i1,{element:n,editor:s,saveNodeData:r,styleTarget:Go(n,{editorId:o,controlKind:"aspectRatio",keys:Jg}),onStyleTargetSaved:i})]}),e.jsxs(p,{style:Fr,children:[e.jsx(p,{style:Dr,children:"Overflow"}),e.jsx(o1,{element:n,editor:s,saveNodeData:r,styleTarget:Go(n,{editorId:o,controlKind:"overflow",keys:Qg}),onStyleTargetSaved:i})]})]})]})]},`${t}-size`):null}function Qo({keyPrefix:t,element:n,editorId:o,editor:s,saveNodeData:r,onSaveNodeData:i}){return n!=null&&n.node?e.jsxs(y.Item,{value:`${t}-align`,children:[e.jsx(y.Control,{children:"Alignment"}),e.jsx(y.Panel,{children:e.jsx(Q0,{element:n,editor:s,saveNodeData:r,styleTarget:Go(n,{editorId:o,controlKind:"selfAlign",keys:Xg}),onStyleTargetSaved:i})})]},`${t}-align`):null}function _1({activeTab:t,node:n,grid:o,column:s,outerGrid:r,hasNode:i,isNodeType:c,isGridType:u,t:a,onSaveNodeData:f,saveNodeData:d,editor:h,editorId:m,bgType:x,columnBgType:g,gridBgType:w,setBgType:b,setColumnBgType:j,setGridBgType:A,TypographySection:v,saveIconTextNodeData:k,editorContext:C,mode:I,selectedScope:_,selectionContext:R,breadcrumbBgTypeMap:F,setBreadcrumbBgType:G}){var Ce,Re,xe,Ee,ht,Tt,It,pt,cn,J,U,ie,ce,me,de,Ne,M,fe,lt,$e,Je,tt,Ge,mt,ae,zt,V,te,he,le,Ye,ze,xt,bt,On,Mn,yn,fs,hs,Lt,oe,ve,ps,_t,eo,vn,xs,jn,kt,Nn,$n,Io,kn,Se,Ft,_e,to,gs,ms,bs,Ht,wn,_o,ys,vs,Dn,un,Fn,no,re,dn,et,js,ks,ws,Hn,Cs,Cn,Ss;if(!i)return[];const T=C==="broadcast",L=mu(_);if(_&&R&&L.usesBreadcrumbLayoutTarget)return A1({selectedScope:_,selectionContext:R,editor:h,editorId:m,t:a,onSaveNodeData:f,saveNodeData:d,isBroadcast:T,breadcrumbBgTypeMap:F,setBreadcrumbBgType:G});const S=(Re=(Ce=n==null?void 0:n.node)==null?void 0:Ce.type)==null?void 0:Re.name,W=u("box")||u("container")||u("shareblock"),E=u("infobox"),P=u("icontext"),$=u("blockquote"),X=_==null?void 0:_.nodeType,q=_,Q=q?X==="infobox":E,B=q?X==="icontext":P,O=q?X==="blockquote":$,K=Q||O,H=S==="paragraph"||S==="heading"||(S==="bulletList"||S==="orderedList"||S==="taskList"),D=[],ne=K&&o&&s?T1(o,s):s,Ie=K&&o&&s?lm({grid:o,column:s,editorId:m}):null,Ke=W&&!!r,Oe=(u("icontext")||u("blockquote")||u("infobox"))&&!!r;if(t==="block"){const Te=B?o:n,Me=Te?No(Te,{type:B?"grid":"block",surface:B?"wrapper":"self",editorId:m}):null,ge=(Me==null?void 0:Me.controls)||{},nt=K&&s?No(s,{type:"column",surface:"real",editorId:m}):null,ot=(nt==null?void 0:nt.controls)||{};if(Q&&o&&D.push(e.jsxs(y.Item,{value:"v2-infobox-badge",children:[e.jsx(y.Control,{children:"Icon / Badge"}),e.jsx(y.Panel,{children:e.jsx(M0,{editor:h,element:o,column:s,saveNodeData:d,syncSelection:f})})]},"v2-infobox-badge")),O&&o&&D.push(e.jsxs(y.Item,{value:"v2-blockquote-settings",children:[e.jsx(y.Control,{children:"Quote Style"}),e.jsx(y.Panel,{children:e.jsx(K0,{editor:h,element:o,column:s,saveNodeData:f})})]},"v2-blockquote-settings")),K&&s&&D.push(e.jsxs(y.Item,{value:"v2-callout-content-padding",children:[e.jsx(y.Control,{children:"Spacing"}),e.jsx(y.Panel,{children:e.jsx(go,{type:"column",element:ne,saveNodeData:d,onStyleTargetSaved:f,withinGrid:!0,editor:h,editorId:m,styleTarget:Ie})})]},"v2-callout-content-padding")),!Q&&!O&&ge.padding){const st=B?o:n;
4D.push(e.jsxs(y.Item,{value:"v2-padding",children:[e.jsx(y.Control,{children:"Spacing"}),e.jsx(y.Panel,{children:e.jsx(go,{type:B?"grid":"block",element:st,saveNodeData:B?k:d,onStyleTargetSaved:f,withinGrid:!!o&&!W,editor:h,editorId:m,controlSyncKey:Me==null?void 0:Me.controlSyncKey,styleTarget:(xe=ge.padding)==null?void 0:xe.styleTarget,allowedKeys:(Ee=ge.padding)==null?void 0:Ee.allowedKeys})})]},"v2-padding"))}if(v){const st=v();st&&D.push(st)}(S==="box"||S==="container")&&D.push(e.jsxs(y.Item,{value:"typography",children:[e.jsx(y.Control,{children:"Typography"}),e.jsx(y.Panel,{children:e.jsx(Pu,{element:n,saveNodeData:d,editor:h})})]},"v2-typography")),n.node.attrs.textAlign&&(!c("circle")||c("circle")&&n.node.attrs.viewAs=="button")&&D.push(e.jsxs(y.Item,{value:"v2-alignment",children:[e.jsx(y.Control,{children:"Alignment"}),e.jsx(y.Panel,{children:e.jsx(Cy,{saveNodeData:f,element:n})})]},"v2-alignment")),K&&s&&(D.push(e.jsxs(y.Item,{value:"v2-callout-border",children:[e.jsx(y.Control,{children:"Border"}),e.jsx(y.Panel,{children:e.jsx(mo,{element:((ht=ot.border)==null?void 0:ht.element)||s,saveNodeData:d,editor:h,styleTarget:(Tt=ot.border)==null?void 0:Tt.styleTarget,onStyleTargetSaved:f})})]},"v2-callout-border")),D.push(e.jsxs(y.Item,{value:"v2-callout-radius",children:[e.jsx(y.Control,{children:"Border Radius"}),e.jsx(y.Panel,{children:e.jsx(Rn,{saveNodeData:f,element:((It=ot.radius)==null?void 0:It.element)||s,editor:h,styleTarget:(pt=ot.radius)==null?void 0:pt.styleTarget,onStyleTargetSaved:f})})]},"v2-callout-radius")),T||D.push(e.jsxs(y.Item,{value:"v2-callout-shadow",children:[e.jsx(y.Control,{children:"Drop Shadow"}),e.jsx(y.Panel,{children:e.jsx(bo,{element:((cn=ot.shadow)==null?void 0:cn.element)||s,saveNodeData:d,editor:h,styleTarget:(J=ot.shadow)==null?void 0:J.styleTarget,onStyleTargetSaved:f})})]},"v2-callout-shadow")),D.push(e.jsxs(y.Item,{value:"v2-callout-background",children:[e.jsx(y.Control,{children:"Backgroun
4d"}),e.jsx(y.Panel,{children:e.jsxs(p,{children:[e.jsx(yo,{saveNodeData:d,element:((U=ot.background)==null?void 0:U.element)||s,editor:h,styleTarget:(ie=ot.background)==null?void 0:ie.styleTarget,onStyleTargetSaved:f,onShowImage:()=>j(g==="image"?"color":"image"),showImageActive:g==="image"}),g==="image"&&e.jsx(p,{style:{marginTop:10},children:e.jsx(vo,{saveNodeData:d,element:((ce=ot.background)==null?void 0:ce.element)||s,editor:h,styleTarget:(me=ot.background)==null?void 0:me.styleTarget,onStyleTargetSaved:f,compact:!0})}),e.jsx(jo,{element:((de=ot.background)==null?void 0:de.element)||s,saveNodeData:d,editor:h,allowEffects:!1,styleTarget:(Ne=ot.background)==null?void 0:Ne.styleTarget,onStyleTargetSaved:f})]})})]},"v2-callout-background"))),(n.node.attrs.class||n.node.attrs.resizeableWidth)&&!c("file")&&(!c("circle")||c("circle")&&n.node.attrs.viewAs=="button")&&D.push(e.jsxs(y.Item,{value:"v2-width",children:[e.jsx(y.Control,{children:"Width"}),e.jsx(y.Panel,{children:e.jsx(Sy,{grid:o,resizeable:n.node.attrs.resizeableWidth!=null,saveNodeData:f,element:n,editor:h})})]},"v2-width"));const Pt=(M=n==null?void 0:n.node)==null?void 0:M.attrs;c("image")&&typeof(Pt==null?void 0:Pt.src)=="string"&&Pt.src.length>0&&!Pt.markup&&D.push(e.jsxs(y.Item,{value:"v2-image-crop",children:[e.jsx(y.Control,{children:"Crop & focus"}),e.jsx(y.Panel,{children:e.jsx(By,{saveNodeData:f,element:n,editor:h})})]},"v2-image-crop")),n.node.attrs.radius&&!n.node.attrs.buttonBackgroundColor&&S!=="badgePill"&&!c("audio")&&!c("file")&&!Q&&!H&&D.push(e.jsxs(y.Item,{value:"v2-radius",children:[e.jsx(y.Control,{children:"Border Radius"}),e.jsx(y.Panel,{children:e.jsx(Rn,{saveNodeData:f,element:((fe=ge.radius)==null?void 0:fe.element)||n,editor:h,styleTarget:(lt=ge.radius)==null?void 0:lt.styleTarget,onStyleTargetSaved:f})})]},"v2-radius")),ge.border&&S!=="actionbutton"&&S!=="badgePill"&&S!=="file"&&!Q&&!O&&!H&&D.push(e.jsxs(y.Item,{value:"v2-border",children:[e.jsx(y.Control,{children:"Border"}),e.jsx(y.Panel,{children:e.jsx(mo,{saveNodeData:d,element:ge.border.element||n,editor:h,styleTarget:ge.border.styleTarget,onStyleTargetSaved:f})})]},"v2-border")),ge.shadow&&S!=="codeBlock"&&!T&&S!=="actionbutton"&&S!=="badgePill"&&S!=="file"&&!Q&&!O&&!H&&D.push(e.jsxs(y.Item,{value:"v2-shadow",children:[e.jsx(y.Control,{children:"Drop Shadow"}),e.jsx(y.Panel,{children:e.jsx(bo,{saveNodeData:d,element:ge.shadow.element||n,editor:h,styleTarget:ge.shadow.styleTarget,onStyleTargetSaved:f})})]},"v2-shadow")),ge.background&&!Q&&!O&&!n.node.attrs.buttonBackgroundColor&&!H&&!y1.has(S)&&D.push(e.jsxs(y.Item,{value:"v2-background",children:[e.jsx(y.Control,{children:"Backgroun
4d"}),e.jsx(y.Panel,{children:e.jsxs(p,{children:[e.jsx(yo,{saveNodeData:d,element:ge.background.element||n,editor:h,styleTarget:ge.background.styleTarget,onStyleTargetSaved:f,onShowImage:()=>b(x==="image"?"color":"image"),showImageActive:x==="image"}),x==="image"&&e.jsx(p,{style:{marginTop:10},children:e.jsx(vo,{saveNodeData:d,element:ge.background.element||n,editor:h,styleTarget:ge.background.styleTarget,onStyleTargetSaved:f,compact:!0})}),e.jsx(jo,{element:ge.background.element||n,saveNodeData:d,editor:h,styleTarget:ge.background.styleTarget,onStyleTargetSaved:f})]})})]},"v2-background")),(S==="box"||S==="container")&&!Q&&!O&&D.push(e.jsxs(y.Item,{value:"v2-block-hover",children:[e.jsx(y.Control,{children:"Hover"}),e.jsx(y.Panel,{children:e.jsx(Bu,{element:n,saveNodeData:d,editor:h})})]},"v2-block-hover"))}if(t==="box"&&Ke&&o){const Te=o,Me=No(Te,{type:"column",surface:"boxContent",editorId:m}),ge=(Me==null?void 0:Me.controls)||{},nt=(($e=ge.border)==null?void 0:$e.element)||tc(Te);D.push(e.jsxs(y.Item,{value:"v2-box-padding",children:[e.jsx(y.Control,{children:"Spacing"}),e.jsx(y.Panel,{children:e.jsx(go,{type:"column",element:((Je=ge.padding)==null?void 0:Je.element)||Te,saveNodeData:d,onStyleTargetSaved:f,withinGrid:!0,editor:h,editorId:m,controlSyncKey:Me==null?void 0:Me.controlSyncKey,styleTarget:(tt=ge.padding)==null?void 0:tt.styleTarget,allowedKeys:(Ge=ge.padding)==null?void 0:Ge.allowedKeys})})]},"v2-box-padding"));const ot=hi((ae=(mt=Te==null?void 0:Te.node)==null?void 0:mt.type)==null?void 0:ae.name),Pt={keyPrefix:"v2-box",element:Te,editorId:m,editor:h,saveNodeData:d,onSaveNodeData:f};D.push(e.jsxs(y.Item,{value:"v2-box-layout",children:[e.jsx(y.Control,{children:"Content Layout"}),e.jsx(y.Panel,{children:e.jsx(ti,{editor:h,element:((zt=ge.contentLayout)==null?void 0:zt.element)||Te,grid:o,saveNodeData:d,hideVSpread:T,styleTarget:(V=ge.contentLayout)==null?void 0:V.styleTarget,onStyleTargetSaved:f})})]},"v2-box-layout")),D.push(e.jsxs(y.Item,{value:"v2-box-vertical",children:[e.jsx(y.Control,{children:a("tiptap.components.sideConfigurationsMenu.label10")}),e.jsx(y.Panel,{children:e.jsx(ei,{saveNodeData:d,element:((te=ge.verticalAlignment)==null?void 0:te.element)||Te,editor:h,styleTarget:(he=ge.verticalAlignment)==null?void 0:he.styleTarget,onStyleTargetSaved:f})})]},"v2-box-vertical")),!T&&ot&&D.push(Qo(Pt)),!T&&ot?D.push(ko({...Pt,minHeightControl:{element:((le=ge.minHeight)==null?void 0:le.element)||Te,styleTarget:(Ye=ge.minHeight)==null?void 0:Ye.styleTarget}})):T||D.push(e.jsxs(y.Item,{value:"v2-box-minheight",children:[e.jsx(y.Control,{children:"Min Height"}),e.jsx(y.Panel,{children:e.jsx(tr,{element:((ze=ge.minHeight)==null?void 0:ze.element)||Te,editor:h,saveNodeData:d,styleTarget:(xt=ge.minHeight)==null?void 0:xt.styleTarget,onStyleTargetSaved:f})})]},"v2-box-minheight")),D.push(e.jsxs(y.Item,{value:"v2-box-border",children:[e.jsx(y.Control,{children:"Border"}),e.jsx(y.Panel,{children:e.jsx(mo,{element:nt,saveNodeData:d,editor:h,styleTarget:(bt=ge.border)==null?void 0:bt.styleTarget,onStyleTargetSaved:f})})]},"v2-box-border")),D.push(e.jsxs(y.Item,{value:"v2-box-radius",children:[e.jsx(y.Control,{children:"Border Radius"}),e.jsx(y.Panel,{children:e.jsx(Rn,{saveNodeData:f,element:((On=ge.radius)==null?void 0:On.element)||Te,editor:h,radiusAttr:((Mn=ge.radius)==null?void 0:Mn.radiusAttr)||"columnRadius",radiusCustomAttr:((yn=ge.radius)==null?void 0:yn.radiusCustomAttr)||"columnRadiusCustom",styleTarget:(fs=ge.radius)==null?void 0:fs.styleTarget,onStyleTargetSaved:f})})]},"v2-box-radius")),T||D.push(e.jsxs(y.Item,{value:"v2-box-shadow",children:[e.jsx(y.Control,{children:"Drop Shadow"}),e.jsx(y.Panel,{children:e.jsx(bo,{element:nt,saveNodeData:d,editor:h,styleTarget:(hs=ge.shadow)==null?void 0:hs.styleTarget,onStyleTargetSaved:f})})]},"v2-box-shadow")),D.push(e.jsxs(y.Item,{value:"v2-box-background",children:[e.jsx(y.Control,{children:"Backgroun
4d"}),e.jsx(y.Panel,{children:e.jsxs(p,{children:[e.jsx(yo,{saveNodeData:d,element:nt,editor:h,styleTarget:(Lt=ge.background)==null?void 0:Lt.styleTarget,onStyleTargetSaved:f,onShowImage:()=>j(g==="image"?"color":"image"),showImageActive:g==="image"}),g==="image"&&e.jsx(p,{style:{marginTop:10},children:e.jsx(vo,{saveNodeData:d,element:nt,editor:h,styleTarget:(oe=ge.background)==null?void 0:oe.styleTarget,onStyleTargetSaved:f,compact:!0})}),e.jsx(jo,{element:nt,saveNodeData:d,editor:h,styleTarget:(ve=ge.background)==null?void 0:ve.styleTarget,onStyleTargetSaved:f})]})})]},"v2-box-background"))}if(t==="column"&&s){const Te=W&&!r,Me=No(s,{type:"column",surface:Te?"boxContent":"real",editorId:m}),ge=(Me==null?void 0:Me.controls)||{},nt=((ps=ge.border)==null?void 0:ps.element)||(Te?tc(s):s);D.push(e.jsxs(y.Item,{value:"v2-col-padding",children:[e.jsx(y.Control,{children:"Spacing"}),e.jsx(y.Panel,{children:e.jsx(go,{type:"column",element:((_t=ge.padding)==null?void 0:_t.element)||s,saveNodeData:d,onStyleTargetSaved:f,withinGrid:!0,editor:h,editorId:m,controlSyncKey:Me==null?void 0:Me.controlSyncKey,styleTarget:(eo=ge.padding)==null?void 0:eo.styleTarget,allowedKeys:(vn=ge.padding)==null?void 0:vn.allowedKeys})})]},"v2-col-padding")),!Q&&!O&&D.push(e.jsxs(y.Item,{value:"v2-col-vertical",children:[e.jsx(y.Control,{children:a("tiptap.components.sideConfigurationsMenu.label10")}),e.jsx(y.Panel,{children:e.jsx(ei,{saveNodeData:d,element:((xs=ge.verticalAlignment)==null?void 0:xs.element)||s,editor:h,styleTarget:(jn=ge.verticalAlignment)==null?void 0:jn.styleTarget,onStyleTargetSaved:f})})]},"v2-col-vertical")),!Q&&!O&&D.push(e.jsxs(y.Item,{value:"v2-col-layout",children:[e.jsx(y.Control,{children:"Content Layout"}),e.jsx(y.Panel,{children:e.jsx(ti,{editor:h,element:((kt=ge.contentLayout)==null?void 0:kt.element)||s,grid:Ke||Oe?r:o,saveNodeData:d,hideVSpread:T,styleTarget:(Nn=ge.contentLayout)==null?void 0:Nn.styleTarget,onStyleTargetSaved:f})})]},"v2-col-layout")),D.push(e.jsxs(y.Item,{value:"v2-col-border",children:[e.jsx(y.Control,{children:"Border"}),e.jsx(y.Panel,{children:e.jsx(mo,{element:nt,saveNodeData:d,editor:h,styleTarget:($n=ge.border)==null?void 0:$n.styleTarget,onStyleTargetSaved:f})})]},"v2-col-border")),D.push(e.jsxs(y.Item,{value:"v2-col-radius",children:[e.jsx(y.Control,{children:"Border Radius"}),e.jsx(y.Panel,{children:e.jsx(Rn,{saveNodeData:f,element:((Io=ge.radius)==null?void 0:Io.element)||s,editor:h,radiusAttr:((kn=ge.radius)==null?void 0:kn.radiusAttr)||(Te?"columnRadius":void 0),radiusCustomAttr:((Se=ge.radius)==null?void 0:Se.radiusCustomAttr)||(Te?"columnRadiusCustom":void 0),styleTarget:(Ft=ge.radius)==null?void 0:Ft.styleTarget,onStyleTargetSaved:f})})]},"v2-col-radius")),T||D.push(e.jsxs(y.Item,{value:"v2-col-shadow",children:[e.jsx(y.Control,{children:"Drop Shadow"}),e.jsx(y.Panel,{children:e.jsx(bo,{element:nt,saveNodeData:d,editor:h,styleTarget:(_e=ge.shadow)==null?void 0:_e.styleTarget,onStyleTargetSaved:f})})]},"v2-col-shadow")),D.push(e.jsxs(y.Item,{value:"v2-col-background",children:[e.jsx(y.Control,{children:"Backgroun
4d"}),e.jsx(y.Panel,{children:e.jsxs(p,{children:[e.jsx(yo,{saveNodeData:d,element:nt,editor:h,styleTarget:(to=ge.background)==null?void 0:to.styleTarget,onStyleTargetSaved:f,onShowImage:()=>j(g==="image"?"color":"image"),showImageActive:g==="image"}),g==="image"&&e.jsx(p,{style:{marginTop:10},children:e.jsx(vo,{saveNodeData:d,element:nt,editor:h,styleTarget:(gs=ge.background)==null?void 0:gs.styleTarget,onStyleTargetSaved:f,compact:!0})}),e.jsx(jo,{element:nt,saveNodeData:d,editor:h,allowEffects:!Q&&!O&&!B,styleTarget:(ms=ge.background)==null?void 0:ms.styleTarget,onStyleTargetSaved:f})]})})]},"v2-col-background"))}if(t==="grid"){const Te=Ke||Oe?r:o;if(!Te)return D;const Me=(Ht=(bs=Te==null?void 0:Te.node)==null?void 0:bs.type)==null?void 0:Ht.name,ge=Me==="icontext",nt=Me==="infobox",ot=Me==="blockquote",Pt=Me==="box"||Me==="container"||Me==="shareblock",oo=Me==="gridx";if(ge)return D;const Jt=No(Te,{type:"grid",surface:"wrapper",editorId:m}),st=(Jt==null?void 0:Jt.controls)||{};oo&&(D.push(e.jsxs(y.Item,{value:"v2-gridx-layout",children:[e.jsx(y.Control,{children:"Layout"}),e.jsx(y.Panel,{children:e.jsx(Iu,{element:Te,editor:h,saveNodeData:d,styleTarget:(wn=st.gridxLayout)==null?void 0:wn.styleTarget,onStyleTargetSaved:f})})]},"v2-gridx-layout")),D.push(e.jsxs(y.Item,{value:"v2-gridx-colgap",children:[e.jsx(y.Control,{children:"Column Gap"}),e.jsx(y.Panel,{children:e.jsx(er,{element:Te,editor:h,saveNodeData:d,attr:"columnGap",styleTarget:(_o=st.columnGap
4)==null?void 0:_o.styleTarget,onStyleTargetSaved:f})})]},"v2-gridx-colgap")),D.push(e.jsxs(y.Item,{value:"v2-gridx-rowgap",children:[e.jsx(y.Control,{children:"Row Gap"}),e.jsx(y.Panel,{children:e.jsx(Tu,{element:Te,editor:h,saveNodeData:d,styleTarget:(ys=st.rowGap)==null?void 0:ys.styleTarget,onStyleTargetSaved:f})})]},"v2-gridx-rowgap"))),Pt||D.push(e.jsxs(y.Item,{value:"v2-grid-padding",children:[e.jsx(y.Control,{children:"Spacing"}),e.jsx(y.Panel,{children:e.jsx(go,{type:"grid",element:Te,saveNodeData:d,onStyleTargetSaved:f,withinGrid:!0,editor:h,editorId:m,controlSyncKey:Jt==null?void 0:Jt.controlSyncKey,styleTarget:(vs=st.padding)==null?void 0:vs.styleTarget,allowedKeys:(Dn=st.padding)==null?void 0:Dn.allowedKeys})})]},"v2-grid-padding")),!nt&&!ot&&!Pt&&!oo&&Me!=="grid1"&&D.push(e.jsxs(y.Item,{value:"v2-grid-gap",children:[e.jsx(y.Control,{children:"Column Gap"}),e.jsx(y.Panel,{children:e.jsx(er,{element:Te,editor:h,saveNodeData:d,styleTarget:(un=st.columnGap)==null?void 0:un.styleTarget,onStyleTargetSaved:f})})]},"v2-grid-gap"));const Ao=hi(Me);if(!T&&Ao){const Bo={keyPrefix:"v2-grid",element:Te,editorId:m,editor:h,saveNodeData:d,onSaveNodeData:f};D.push(Qo(Bo),ko({...Bo,minHeightControl:{element:((Fn=st.minHeight)==null?void 0:Fn.element)||Te,styleTarget:(no=st.minHeight)==null?void 0:no.styleTarget}}))}else!T&&!nt&&!ot&&D.push(e.jsxs(y.Item,{value:"v2-grid-minheight",children:[e.jsx(y.Control,{children:"Min Height"}),e.jsx(y.Panel,{children:e.jsx(tr,{element:Te,editor:h,saveNodeData:d,styleTarget:(re=st.minHeight)==null?void 0:re.styleTarget,onStyleTargetSaved:f})})]},"v2-grid-minheight"));!T&&!nt&&!ot&&!Ao&&D.push(e.jsxs(y.Item,{value:"v2-grid-fullwidth",children:[e.jsx(y.Control,{children:"Full Width"}),e.jsx(y.Panel,{children:e.jsx(Ci,{element:Te,editor:h,saveNodeData:d,styleTarget:(dn=st.fullWidth)==null?void 0:dn.styleTarget,onStyleTargetSaved:f})})]},"v2-grid-fullwidth")),!nt&&!ot&&D.push(e.jsxs(y.Item,{value:"v2-grid-border",children:[e.jsx(y.Control,{children:"Border"}),e.jsx(y.Panel,{children:e.jsx(mo,{element:Te,saveNodeData:d,editor:h,styleTarget:(et=st.border)==null?void 0:et.styleTarget,onStyleTargetSaved:f})})]},"v2-grid-border")),(ks=(js=Te==null?void 0:Te.node)==null?void 0:js.attrs)!=null&&ks.radius&&D.push(e.jsxs(y.Item,{value:"v2-grid-radius",children:[e.jsx(y.Control,{children:"Border Radius"}),e.jsx(y.Panel,{children:e.jsx(Rn,{saveNodeData:f,element:Te,editor:h,styleTarget:(ws=st.radius)==null?void 0:ws.styleTarget,onStyleTargetSaved:f})})]},"v2-grid-radius")),!T&&!nt&&!ot&&D.push(e.jsxs(y.Item,{value:"v2-grid-shadow",children:[e.jsx(y.Control,{children:"Drop Shadow"}),e.jsx(y.Panel,{children:e.jsx(bo,{element:Te,saveNodeData:d,editor:h,styleTarget:(Hn=st.shadow)==null?void 0:Hn.styleTarget,onStyleTargetSaved:f})})]},"v2-grid-shadow")),D.push(e.jsxs(y.Item,{value:"v2-grid-background",children:[e.jsx(y.Control,{children:"Backgroun
4d"}),e.jsx(y.Panel,{children:e.jsxs(p,{children:[e.jsx(yo,{saveNodeData:d,element:Te,editor:h,styleTarget:(Cs=st.background)==null?void 0:Cs.styleTarget,onStyleTargetSaved:f,onShowImage:()=>A(w==="image"?"color":"image"),showImageActive:w==="image"}),w==="image"&&e.jsx(p,{style:{marginTop:10},children:e.jsx(vo,{saveNodeData:d,element:Te,editor:h,styleTarget:(Cn=st.background)==null?void 0:Cn.styleTarget,onStyleTargetSaved:f,compact:!0})}),e.jsx(jo,{element:Te,saveNodeData:d,editor:h,allowEffects:!nt&&!ot&&!ge,styleTarget:(Ss=st.background)==null?void 0:Ss.styleTarget,onStyleTargetSaved:f})]})})]},"v2-grid-background"))}return D}function A1({selectedScope:t,selectionContext:n,editor:o,editorId:s,t:r,onSaveNodeData:i,saveNodeData:c,isBroadcast:u,breadcrumbBgTypeMap:a,setBreadcrumbBgType:f}){var R,F,G,T;const d=bu(n,t,{editorId:s});if(!d)return[];const h=[],m=t.key,{controls:x}=d;if(!x)return h;const g=((t==null?void 0:t.nodeType)==="box"||(t==null?void 0:t.nodeType)==="container")&&(d.isSingleSurfaceBox||d.isBoxWrapper)&&!d.isVirtualBoxColumn,w={node:t.node,pos:t.pos,key:t.key,uid:t.uid,uidIsStable:t.uidIsStable,surface:t.surface},b=k1((T=(G=(F=(R=x.background)==null?void 0:R.element)==null?void 0:F.node)==null?void 0:G.attrs)==null?void 0:T.styles),j=(a==null?void 0:a[m])||b,A=()=>f==null?void 0:f(m,j==="image"?"color":"image"),v=hi(t.nodeType),k=!u&&v,C=k,I=k?{keyPrefix:"bc",element:{node:t.node,pos:t.pos,key:t.key,uid:t.uid,uidIsStable:t.uidIsStable,surface:t.surface},editorId:s,editor:o,saveNodeData:c,onSaveNodeData:i}:null,_=x.verticalAlignment?e.jsxs(y.Item,{value:"bc-vertical","data-responsive-aware":Bc(x.verticalAlignment.element)||void 0,children:[e.jsx(y.Control,{children:r("tiptap.components.sideConfigurationsMenu.label10")}),e.jsx(y.Panel,{children:e.jsx(ei,{saveNodeData:c,element:x.verticalAlignment.element,editor:o,styleTarget:x.verticalAlignment.styleTarget,onStyleTargetSaved:i})})]},"bc-vertical"):null;return x.gridxLayout&&h.push(e.jsxs(y.Item,{value:"bc-gridx-layout",children:[e.jsx(y.Control,{children:"Layout"}),e.jsx(y.Panel,{children:e.jsx(Iu,{element:x.gridxLayout.element,editor:o,saveNodeData:c,styleTarget:x.gridxLayout.styleTarget,onStyleTargetSaved:i})})]},"bc-gridx-layout")),x.padding&&h.push(e.jsxs(y.Item,{value:"bc-padding",children:[e.jsx(y.Control,{children:"Spacing"}),e.jsx(y.Panel,{children:e.jsx(go,{type:x.padding.type||"block",element:x.padding.element,saveNodeData:c,onStyleTargetSaved:i,withinGrid:!0,editor:o,editorId:s,controlSyncKey:d.controlSyncKey,allowedKeys:x.padding.allowedKeys,styleTarget:x.padding.styleTarget})})]},"bc-padding")),x.contentLayout&&h.push(e.jsxs(y.Item,{value:"bc-layout","data-responsive-aware":Bc(x.contentLayout.element)||void 0,children:[e.jsx(y.Control,{children:"Content Layout"}),e.jsx(y.Panel,{children:e.jsx(ti,{editor:o,element:x.contentLayout.element,grid:x.contentLayout.grid||x.contentLayout.element,saveNodeData:c,hideVSpread:u,styleTarget:x.contentLayout.styleTarget,onStyleTargetSaved:i})})]},"bc-layout")),k&&d.isSingleSurfaceBox?(_&&h.push(_),h.push(Qo(I)),h.push(ko({...I,minHeightControl:x.minHeight}))):k&&d.isVirtualBoxColumn?(_&&h.push(_),h.push(ko({...I,minHeightControl:x.minHeight,includeWidth:!1}))):_&&!d.isGrid&&h.push(_),x.columnGap&&h.push(e.jsxs(y.Item,{value:"bc-gap",children:[e.jsx(y.Control,{children:"Column Gap"}),e.jsx(y.Panel,{children:e.jsx(er,{element:x.columnGap.element,editor:o,saveNodeData:c,attr:x.columnGap.attrName||"gap",styleTarget:x.columnGap.styleTarget,onStyleTargetSaved:i})})]},"bc-gap")),x.rowGap&&h.push(e.jsxs(y.Item,{value:"bc-rowgap",children:[e.jsx(y.Control,{children:"Row Gap"}),e.jsx(y.Panel,{children:e.jsx(Tu,{element:x.rowGap.element,editor:o,saveNodeData:c,styleTarget:x.rowGap.styleTarget,onStyleTargetSaved:i})})]},"bc-rowgap")),_c(t)&&h.push(e.jsxs(y.Item,{value:"bc-website-header",children:[e.jsx(y.Control,{children:"Website Header"}),e.jsx(y.Panel,{children:e.jsx(Jy,{element:{node:t.node,pos:t.pos,key:t.key,uid:t.uid,uidIsStable:t.uidIsStable,surface:t.surface},editor:o,saveNodeData:c,onStyleTargetSaved:i})})]}
4,"bc-website-header")),x.minHeight&&!u&&!C&&h.push(e.jsxs(y.Item,{value:"bc-minheight",children:[e.jsx(y.Control,{children:"Min Height"}),e.jsx(y.Panel,{children:e.jsx(tr,{element:x.minHeight.element,editor:o,saveNodeData:c,styleTarget:x.minHeight.styleTarget,onStyleTargetSaved:i,presets:_c(t)?b1:void 0})})]},"bc-minheight")),k&&d.isBoxWrapper&&!d.isSingleSurfaceBox&&h.push(Qo(I),ko({...I,includeInnerDimensions:!1})),k&&d.isGrid&&(_&&h.push(_),h.push(Qo(I)),h.push(ko({...I,minHeightControl:x.minHeight}))),g&&h.push(e.jsxs(y.Item,{value:"typography",children:[e.jsx(y.Control,{children:"Typography"}),e.jsx(y.Panel,{children:e.jsx(Pu,{element:w,saveNodeData:c,editor:o})})]},"bc-typography")),x.fullWidth&&!u&&!v&&h.push(e.jsxs(y.Item,{value:"bc-fullwidth",children:[e.jsx(y.Control,{children:"Full Width"}),e.jsx(y.Panel,{children:e.jsx(Ci,{element:x.fullWidth.element,editor:o,saveNodeData:c,styleTarget:x.fullWidth.styleTarget,onStyleTargetSaved:i})})]},"bc-fullwidth")),x.border&&h.push(e.jsxs(y.Item,{value:"bc-border",children:[e.jsx(y.Control,{children:"Border"}),e.jsx(y.Panel,{children:e.jsx(mo,{element:x.border.element,saveNodeData:c,editor:o,styleTarget:x.border.styleTarget,onStyleTargetSaved:i})})]},"bc-border")),x.radius&&h.push(e.jsxs(y.Item,{value:"bc-radius",children:[e.jsx(y.Control,{children:"Border Radius"}),e.jsx(y.Panel,{children:e.jsx(Rn,{saveNodeData:i,element:x.radius.element,editor:o,radiusAttr:x.radius.radiusAttr,radiusCustomAttr:x.radius.radiusCustomAttr,styleTarget:x.radius.styleTarget,onStyleTargetSaved:i})})]},"bc-radius")),x.shadow&&(t==null?void 0:t.nodeType)!=="codeBlock"&&!u&&h.push(e.jsxs(y.Item,{value:"bc-shadow",children:[e.jsx(y.Control,{children:"Drop Shadow"}),e.jsx(y.Panel,{children:e.jsx(bo,{element:x.shadow.element,saveNodeData:c,editor:o,styleTarget:x.shadow.styleTarget,onStyleTargetSaved:i})})]},"bc-shadow")),x.background&&h.push(e.jsxs(y.Item,{value:"bc-background",children:[e.jsx(y.Control,{children:"Backgroun
4d"}),e.jsx(y.Panel,{children:e.jsxs(p,{children:[e.jsx(yo,{saveNodeData:c,element:x.background.element,editor:o,styleTarget:x.background.styleTarget,onStyleTargetSaved:i,onShowImage:A,showImageActive:j==="image"}),j==="image"&&e.jsx(p,{style:{marginTop:10},children:e.jsx(vo,{saveNodeData:c,element:x.background.element,editor:o,styleTarget:x.background.styleTarget,onStyleTargetSaved:i,compact:!0})}),e.jsx(jo,{element:x.background.element,saveNodeData:c,editor:o,allowEffects:x.background.allowEffects,styleTarget:x.background.styleTarget,onStyleTargetSaved:i})]})})]},"bc-background")),g&&!u&&h.push(e.jsxs(y.Item,{value:"bc-box-hover",children:[e.jsx(y.Control,{children:"Hover"}),e.jsx(y.Panel,{children:e.jsx(Bu,{element:w,saveNodeData:c,editor:o})})]},"bc-box-hover")),h}function B1(t){const n=l.useRef(null),o=l.useRef(!1),{t:s}=Qt(),r=ee(u=>u.tiptap),[i,c]=l.useState();return l.useEffect(()=>{if(!t.element||!t.element.node.attrs||t.element&&t.element.node.attrs&&o.current!=t.element.node.attrs.uid)return;const u=t.element,a=u.node.attrs.blockId!=null?i||"":null;a!==null&&a!==(u.node.attrs.blockId||"")&&(r.editor.commands.setCustomBlockId(a),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t.saveNodeData()},2e3))},[i]),l.useEffect(()=>{if(t.element&&t.element.node.attrs.blockId!=null){o.current=null;const u=t.element.node.attrs.uid;setTimeout(()=>{o.current=u},0),c(t.element.node.attrs.blockId)}},[t.element]),e.jsx(Fe,{mt:20,children:e.jsx(at,{value:i||"",onChange:u=>c(u.currentTarget.value),placeholder:s("tiptap.components.sidebar.blockId.placeholder"),label:s("tiptap.components.sidebar.blockId.label"),description:s("tiptap.components.sidebar.blockId.description"),styles:{label:{fontWeight:400,color:"#000"}}})})}function R1({userIsAdmin:t,node:n,hasNode:o,onSaveNodeData:s}){var r,i;return!t||!o||((i=(r=n==null?void 0:n.node)==null?void 0:r.attrs)==null?void 0:i.blockId)==null?null:e.jsxs(y.Item,{value:"admin-ai",children:[e.jsx(y.Control,{children:"AI (Admins only)"}),e.jsx(y.Panel,{children:e.jsx(B1,{saveNodeData:s,element:n})})]})}function E1({t,onReset:n,label:o}){const s=o||t("tiptap.components.sideConfigurationsMenu.resetBlock"),r=async()=>{(await Ct.fire({title:`${s}?`,text:"This will restore every setting for this block to its defaults. The block's content will not be removed.",icon:"warning",showCancelButton:!0,confirmButtonText:"Yes, reset",cancelButtonText:"Cancel",confirmButtonColor:zn.red,cancelButtonColor:zn.gray})).isConfirmed&&n()};return e.jsxs(y.Item,{value:"reset-section",children:[e.jsx(y.Control,{children:t("tiptap.components.sideConfigurationsMenu.label17")}),e.jsx(y.Panel,{children:e.jsx(We,{mt:10,style:{width:"100%"},radius:"xl",variant:"outline",color:"dark",onClick:r,children:s})})]})}function Rc({node:t,hasNode:n,isNodeType:o,t:s,saveNodeData:r,editor:i,forceDesktop:c=!1}){return!n||!(o("paragraph")||o("heading")||o("taskList")||o("bulletList")||o("orderedList"))?null:e.jsxs(y.Item,{value:"typography",children:[e.jsx(y.Control,{children:s("tiptap.components.sideConfigurationsMenu.typography")||"Typography"}),e.jsx(y.Panel,{children:e.jsx(Lu,{node:t,saveNodeData:r,editor:i,forceDesktop:c})})]})}const Hr={input:{fontFamily:"ui-monospace, Menlo, monospace",fontSize:12}};function z1({editor:t,element:n,saveNodeData:o}){var _,R,F;const s=((_=n==null?void 0:n.node)==null?void 0:_.attrs)||{},[r,i]=l.useState(s.html||""),[c,u]=l.useState(s.css||""),[a,f]=l.useState(s.js||""),[d,h]=l.useState(s.heightMode||"auto"),[m,x]=l.useState(s.height||400),[g,w]=l.useState(s.caption||""),[b,j]=l.useState(!!(s.css||s.js)),A=l.useRef(!1),v=l.useRef({}),k=l.useRef(null),C=(F=(R=n==null?void 0:n.node)==null?void 0:R.attrs)==null?void 0:F.uid;l.useEffect(()=>{A.current=!0,i(s.html||""),u(s.css||""),f(s.js||""),h(s.heightMode||"auto"),x(s.height||400),w(s.caption||""),j(!!(s.css||s.js));const G=setTimeout(()=>{A.current=!1},50);return()=>clearTimeout(G)},[C]),l.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]);const I=l.useCallback(G=>{v.current={...v.current,...G},!A.current&&(k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{k.current=null;const T=v.current;v.current={},be(t,n,T)&&(o==null||o())},600))},[t,n,o]);return e.jsxs(p,{children:[e.jsx(N,{size:"xs",fw:600,mb:4,children:"HTML"}),e.jsx(rn,{value:r,onChange:G=>{const T=G.currentTarget.value;i(T),I({html:T})},placeholder:"<div>…</div> — paste an embed snippet or write your own markup",autosize:!0,minRows:6,maxRows:20,styles:Hr}),e.jsx(Ve,{mt:12,label:"Add CSS & JavaScript",checked:b,onChange:G=>j(G.currentTarget.checked)}),b&&e.jsxs(e.Fragment,{children:[e.jsx(N,{size:"xs",fw:600,mt:12,mb:4,children:"CSS"}),e.jsx(rn,{value:c,onChange:G=>{const T=G.currentTarget.value;u(T),I({css:T})},placeholder:"/* applied inside the embed */",autosize:!0,minRows:4,maxRows:16,styles:Hr}),e.jsx(N,{size:"xs",fw:600,mt:12,mb:4,children:"JavaScript"}),e.jsx(rn,{value:a,onChange:G=>{const T=G.currentTarget.value;f(T),I({js:T})},placeholder:"// runs sandboxed, isolated from Sutra",autosize:!0,minRows:4,maxRows:16,styles:Hr})]}),e.jsx(N,{size:"xs",fw:600,mt:14,mb:4,children:"Height"}),e.jsx(Ue,{value:d,data:[{value:"auto",label:"Auto — fit content"},{value:"fixed",label:"Fixed height"}],onChange:G=>{const T=G.currentTarget.value;h(T),I({heightMode:T})}}),d==="fixed"&&e.jsx(Rt,{mt:6,value:m,min:40,max:1e4,suffix:"px",onChange:G=>{const T=Number(G)||400;x(T),I({height:T})}}),e.jsx(N,{size:"xs",fw:600,mt:14,mb:4,children:"Accessibility label (optional)"}),e.jsx(at,{value:g,onChange:G=>{const T=G.currentTarget.value;w(T),I({caption:T})},placeholder:"Describe this embed for screen readers"}),e.jsx(N,{size:"xs",c:"dimmed",mt:12,style:{lineHeight:1.4},children:"Runs in a sandboxed frame on a separate domain — it can't access your members' Sutra session."})]})}function L1({node:t,isNodeType:n,editor:o,onSaveNodeData:s}){return!n||!n("htmlEmbed")||!(t!=null&&t.node)?null:e.jsxs(e.Fragment,{children:[e.jsxs(y.Item,{value:"HTML embed",children:[e.jsx(y.Control,{children:"HTML embed"}),e.jsx(y.Panel,{children:e.jsx(z1,{editor:o,element:t,saveNodeData:s})})]}),e.jsxs(y.Item,{value:"HTML embed full width",children:[e.jsx(y.Control,{children:"Full Width"}),e.jsx(y.Panel,{children:e.jsx(Ci,{element:t,editor:o,saveNodeData:s,helperText:"This block will span the full screen width."})})]})]})}
4const Ec=".png,.jpg,.jpeg,.gif,image/png,image/jpeg,image/gif",P1=["png","jpg","jpeg","gif"],W1=["image/png","image/jpeg","image/gif"],O1=t=>{var s;if(!t)return!1;const n=(t.type||"").toLowerCase(),o=((s=(t.name||"").split(".").pop())==null?void 0:s.toLowerCase())||"";return W1.includes(n)||P1.includes(o)},zc=t=>O1(t)?!0:(Ct.fire({icon:"info",title:"Unsupported image",text:"Only PNG, JPG, and GIF images are supported here. Please choose a supported image file.",confirmButtonText:"Ok"}),!1),Lc=({onUpload:t})=>{const[n,o]=l.useState(0);return rr(s=>o(s.completed)),ir(s=>{t(s.uploadResponse.data.file.url),o(0)}),n>0&&n<=100?e.jsx(p,{style:{height:"4px",backgroundColor:"#e5e5e5",borderRadius:"2px",overflow:"hidden"},children:e.jsx(p,{style:{height:"100%",width:`${n}%`,backgroundColor:"#7950f2",transition:"width 0.2s ease"}})}):null},Pc=ls(t=>e.jsx(p,{...t,className:Ze.uploadBtn,children:e.jsxs(p,{style:{textAlign:"center"},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",stroke:"#999",strokeWidth:"1.5",style:{display:"block",margin:"0 auto 4px"},children:[e.jsx("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"2"}),e.jsx("circle",{cx:"5.5",cy:"5.5",r:"1.5"}),e.jsx("path",{d:"M1.5 11 L5 7.5 L8 10.5 L10.5 8 L14.5 12",strokeLinejoin:"round"})]}),e.jsx(p,{style:{fontSize:"11px",color:"#999",fontWeight:500},children:"Upload image"})]})})),Ur=(t={})=>{const n=t.primary_button_background_color||"#7950f2";return{buttonBackgroundColor:n,buttonBorderColor:n,buttonTextColor:t.primary_button_text_color||"#FFFFFF"}},M1=(t,n)=>{var r,i,c;const o=(r=t==null?void 0:t.type)==null?void 0:r.name,s=((c=(i=t==null?void 0:t.type)==null?void 0:i.defaultAttrs)==null?void 0:c.styles)||{};if(o==="infobox")return{...bf,styles:mf(s)};if(o==="blockquote")return{customSpacing:!0,styles:yf(s)};if(o==="actionbutton"){const u=typeof window!="undefined"&&window.location.pathname.includes("/registration")?"_current":"_blank";return{...Ur(n),class:"tiptap-size-actual",radius:"circle-radius",buttonText:"Register",buttonAction:"registration",actionCallbackValue:"",actionCallbackTarget:u}}return o==="interactiveButton"?{...Ur(n),class:"tiptap-size-actual",radius:"circle-radius",buttonText:"Continue"}:o==="customform"?{...Ur(n),radius:"circle-radius",buttonText:"Register",actionCallback:"message",actionCallbackValue:"Thank you for registering!"}:{}},N1=(t,n)=>{var s,r;return t==="infobox"?{size:12,position:1,styles:{...vf}}:{size:12,position:1,radius:"with-radius",styles:{...((r=(s=n==null?void 0:n.type)==null?void 0:s.defaultAttrs)==null?void 0:r.styles)||{},...jf}}},pi=(t,n)=>{var f,d,h,m,x,g,w,b;const o=(d=(f=t==null?void 0:t.view)==null?void 0:f.state)==null?void 0:d.doc;if(!o||!(n!=null&&n.node))return null;const s=(h=n.node.type)==null?void 0:h.name;if(!s)return null;const r=typeof n.pos=="number"?n.pos:null;if(r!=null&&r>=0&&r<o.content.size){const j=o.nodeAt(r);if(((m=j==null?void 0:j.type)==null?void 0:m.name)===s)return{node:j,pos:r}}const i=(x=t.view.state.selection)==null?void 0:x.node,c=(g=t.view.state.selection)==null?void 0:g.from;if(((w=i==null?void 0:i.type)==null?void 0:w.name)===s&&typeof c=="number")return{node:i,pos:c};const u=(b=n.node.attrs)==null?void 0:b.uid;if(!u)return null;let a=null;return o.descendants((j,A)=>{var v;if(j.type.name===s&&((v=j.attrs)==null?void 0:v.uid)===u)return a={node:j,pos:A},!1}),a},$1=(t,n)=>{var s,r;const o=pi(t,n);return((r=(s=o==null?void 0:o.node)==null?void 0:s.type)==null?void 0:r.name)==="actionbutton"?o.pos:null},D1=t=>{var oo,Jt,st,Ao,Bo,Si,Ti,Ii,_i,Ai,Bi,Ri,Ei,zi,Li,Pi,Wi,Oi,Mi,Ni,$i,Di,Fi,Hi,Ui,Vi,Ki,Gi,Yi,qi,Xi,Zi,Qi,Ji,el,tl,nl,ol,sl,rl,il,ll,al,cl,ul,dl,fl,hl,pl,xl,gl,ml,bl,yl,vl,jl,kl,wl,Cl,Sl,Tl,Il,_l,Al,Bl,Rl,El,zl,Ll,Pl,Wl,Ol,Ml,Nl,$l,Dl,Fl,Hl,Ul,Vl,Kl,Gl,Yl,ql,Xl,Zl,Ql,Jl,ea,ta,na,oa,sa,ra,ia,la,aa,ca,ua,da,fa,ha;const{t:n}=Qt(),o=Qn();Dt();const s=zm(),r=l.useRef(!1),i=l.useRef(null),c=l.useRef(null),u=ee(z=>z.tiptapSidemenu),a=(oo=u==null?void 0:u.editor)!=null?oo:t.editor,f=(Bo=(Ao=(st=(Jt=a==null?void 0:a.options)==null?void 0:Jt.editorProps)==null?void 0:st.attributes)==null?void 0:Ao.editorId)!=null?Bo:null,d=l.useRef(a);d.current=a;const h=ee(z=>{var Z;return(Z=z.user)==null?void 0:Z.is_admin}),[m,x]=l.useState("settings"),g=l.useRef(null),w=l.useCallback(z=>{g.current={key:z!=null?z:null}},[]),b=ee(z=>z.space),j=ee(z=>z.colors),{getAncestorContext:A,getSelectedScopeKey:v,setSelectedScopeKey:k,setAncestorContext:C,setHoveredScopeTarget:I,setSelectedScopeTarget:_,currentEditorId:R}=gi(),[F,G]=l.useState({}),T=l.useCallback((z,Z)=>{G(se=>({...se,[z]:Z}
4))},[]),L=f!=null?f:R,S=A(L),W=v(L);l.useEffect(()=>{const z=g.current;z&&(g.current=null,z.key===(W!=null?W:null))||x(Z=>Z==="navigator"?"settings":Z)},[W]);const E=l.useMemo(()=>{if(!(S!=null&&S.chain))return null;if(W){const z=S.chain.find(Z=>Z.key===W);if(z)return z}return S.leaf?S.chain.find(z=>z.key===S.leaf.key):null},[S,W]),P=l.useCallback(z=>{var se,ue,je,Le;if(!L)return;k(L,z);const Z=(se=S==null?void 0:S.chain)==null?void 0:se.find(pe=>pe.key===z);if(Z){const pe=(je=(ue=S==null?void 0:S.chain)==null?void 0:ue.findIndex(Ut=>Ut.key===z))!=null?je:-1,gt=(Le=S==null?void 0:S.leaf)!=null&&Le.key?S.chain.findIndex(Ut=>Ut.key===S.leaf.key):-1;pe>=0&&gt>pe||Ra(a,Z),_(L,{key:Z.key,uid:Z.uid,uidIsStable:Z.uidIsStable,pos:Z.pos,nodeType:Z.nodeType,surface:Z.surface,type:Z.type,color:Vo(Z)})}else _(L,null)},[S,a,L,k,_]),$=l.useCallback(z=>{var Le;if(!a||!z)return null;const Z=Dd(a,z),se=typeof(Z==null?void 0:Z.pos)=="number"?Z.pos:null;if(!(Z!=null&&Z.node)||se===null)return null;const ue=Fd(a,{targetPos:se});if(!ue)return null;const je=Hd(ue==null?void 0:ue.chain,{node:Z==null?void 0:Z.node,pos:se,nodeType:z.nodeType,uid:z.uid,surface:z.surface})||(ue!=null&&ue.leaf?(Le=ue.chain)==null?void 0:Le.find(pe=>pe.key===ue.leaf.key):null);return je?{chain:ue,scopeEntry:je}:null},[a]),X=l.useCallback((z,{keepNavigatorOpen:Z=!1}={})=>{if(!a||!L||!z)return!1;const se=$(z);return se?(Z&&w(se.scopeEntry.key),Ra(a,z,{scrollIntoView:!0}),se.chain&&C(L,se.chain),k(L,se.scopeEntry.key),_(L,{key:se.scopeEntry.key,uid:se.scopeEntry.uid,uidIsStable:se.scopeEntry.uidIsStable,pos:se.scopeEntry.pos,nodeType:se.scopeEntry.nodeType,surface:se.scopeEntry.surface,type:se.scopeEntry.type,color:Vo(se.scopeEntry)}),x(Z?"navigator":"settings"),!0):!1},[a,w,$,L,C,k,_]),q=l.useCallback(z=>{X(z,{keepNavigatorOpen:!0})},[X]),Q=l.useCallback(z=>{X(z)},[X]),B=l.useCallback(z=>E?Hc(a,E,z):!1,[a,E]),O=t.mode==="inline",[K,Y]=l.useState(!1),H=!O&&(u==null?void 0:u.opened)==="configuration"&&(u==null?void 0:u.pinned)===!0,D=gf({enabled:K&&!O}),ne=`calc(var(--app-height, 100vh) - ${D}px)`,[Ie,Ke]=l.useState("color"),[Oe,Ce]=l.useState("color"),[Re,xe]=l.useState("color"),[Ee,ht]=l.useState(!1),[Tt,It]=l.useState(null),pt=l.useCallback(z=>{It(qn(z))},[]),[cn,J]=l.useState(null),[U,ie]=l.useState(),[ce,me]=l.useState(),[de,Ne]=l.useState(),[M,fe]=l.useState(),[lt,$e]=l.useState([]),[Je,tt]=l.useState(null),[Ge,mt]=l.useState("action"),[ae,zt]=l.useState("block"),[V,te]=l.useState(!1),[he,le]=l.useState("emoji"),[Ye,ze]=l.useState(!1),[xt,bt]=l.useState(!1),On=(Ii=(Ti=(Si=a==null?void 0:a.options)==null?void 0:Si.editorProps)==null?void 0:Ti.attributes)==null?void 0:Ii.editorContext,Mn=["broadcast","pending_page","help","help_article","resource_article"].includes(On),yn=typeof window!="undefined"&&window.location.pathname.includes("/registration"),fs=!Mn&&!yn||Ge==="invite",hs=l.useCallback(()=>{O||o(Yt({...u||{},opened:"configuration",editor:a,pinned:!H}))},[o,a,O,H,u]),Lt=l.useMemo(()=>{var z,Z;return(Z=(z=M==null?void 0:M.node)==null?void 0:z.type)==null?void 0:Z.name},[M]),oe=z=>Lt===z,ve=!!(M!=null&&M.node),ps=Lt==="navbar"?(Ai=(_i=M==null?void 0:M.node)==null?void 0:_i.attrs)==null?void 0:Ai.navbarConfigId:null,_t=Tt&&String(Tt.id)===String(ps)?Tt:null,eo=((Ri=(Bi=M==null?void 0:M.node)==null?void 0:Bi.attrs)==null?void 0:Ri.badgePillContentType)==="icon",vn=(zi=(Ei=M==null?void 0:M.node)==null?void 0:Ei.attrs)==null?void 0:zi.src,xs=["youtube","vimeo","loom","sutra"].some(z=>vn==null?void 0:vn.includes(z))||/^https?:\/\/localhost([/:?]|$)/.test(vn),jn=(Pi=(Li=U==null?void 0:U.node)==null?void 0:Li.type)==null?void 0:Pi.name,kt=z=>jn===z,Nn=kt("box")||kt("container")||kt("shareblock"),$n=l.useMemo(()=>{const z=["block"];return Nn&&ce?(z.push("box"),de&&z.push("column"),z.push("grid")):Nn?(de&&z.push("column"),z.push("grid")):U&&(kt("icontext")||kt("callout"))?ce&&(de&&z.push("column"),z.push("grid")):U&&(kt("blockquote")||kt("infobox"))?ce&&z.push("grid"):(de&&z.push("column"),U&&z.push("grid")),z},[U,de,ce,jn]);l.useMemo(()=>{var se,ue,je,Le,pe,gt,Wt,Ut,Ae,it,De,yt,ct,ut,qe,rt,Sn,Ro;if(!U)return"";const z=(ue=(se=U.node)==null?void 0:se.type)==null?void 0:ue.name;if((z==="box"||z==="container"||z==="shareblock"||z==="blockquote")&&(Lt==="box"||Lt==="container"||Lt==="shareblock"||Lt==="blockquote")){if(ce){const Ot=(Le=(je=ce.node)==null?void 0:je.type)==null?void 0:Le.name;return Ot==="infobox"?"inside infobox":Ot==="shareblock"?"inside share block":`inside ${((pe=ce.node.content)==null?void 0:pe.childCount)||2}-column grid`}return""}let Z="";if(z==="shareblock")Z="inside share block";else if(z==="box"||z==="container")Z="inside box",ce&&(((Wt=(gt=ce.node)==null?void 0:gt.type)==null?void 0:Wt.name)==="infobox"?Z+=" inside infobox":Z+=` inside ${((Ut=ce.node.content)==null?void 0:Ut.childCount)||2}-column grid`);else if(z==="infobox"){if(Z="inside infobox",ce){const Ot=(it=(Ae=ce.n
4ode)==null?void 0:Ae.type)==null?void 0:it.name;Ot==="infobox"?Z+=" inside infobox":Ot==="shareblock"?Z+=" inside share block":Z+=` inside ${((De=ce.node.content)==null?void 0:De.childCount)||2}-column grid`}}else if(z==="icontext"||z==="callout"){if(Z=z==="callout"?"inside callout":"inside icon text",ce){const Ot=(ct=(yt=ce.node)==null?void 0:yt.type)==null?void 0:ct.name;Ot==="infobox"?Z+=" inside infobox":Ot==="shareblock"?Z+=" inside share block":Z+=` inside ${((ut=ce.node.content)==null?void 0:ut.childCount)||2}-column grid`}}else if(z==="blockquote"){if(Z="inside quote block",ce){const Ot=(rt=(qe=ce.node)==null?void 0:qe.type)==null?void 0:rt.name;Ot==="infobox"?Z+=" inside infobox":Ot==="shareblock"?Z+=" inside share block":Z+=` inside ${((Sn=ce.node.content)==null?void 0:Sn.childCount)||2}-column grid`}}else Z=`inside ${((Ro=U.node.content)==null?void 0:Ro.childCount)||2}-column grid`;return Z},[U,ce,Lt,jn]),l.useEffect(()=>{$n.includes(ae)||zt("block")},[$n]),l.useEffect(()=>{const z=(u==null?void 0:u.opened)==="configuration"?u==null?void 0:u.activeTab:null;z&&$n.includes(z)&&ae!==z&&zt(z)},[ae,$n,u==null?void 0:u.activeTab,u==null?void 0:u.opened]);const Io=l.useMemo(()=>mu(E),[E]),kn=Lt==="doc"||(E==null?void 0:E.nodeType)==="doc"||(E==null?void 0:E.type)==="page",Se=!kn&&Io.canUseBlockSections,Ft=Se&&ae==="block"&&U&&kt("icontext")&&(E==null?void 0:E.nodeType)==="icontext",_e=l.useMemo(()=>Rg(E,U),[E,U]),to=Se&&ae==="block"&&!!_e,gs=yu(E),ms=am({resolvedSelectedScope:E,isFullDocumentScope:kn,showBlockSections:Se,activeTab:ae,gridType:jn,hasNode:ve,nodeType:Lt}),bs=cm({activeTab:ae,resolvedSelectedScope:E,nodeType:Lt}),Ht=l.useMemo(()=>E!=null&&E.node?{node:E.node,pos:E.pos,key:E.key,uid:E.uid,uidIsStable:E.uidIsStable}:ae==="column"?de||null:ae==="grid"||ae==="box"?U||null:M||U||null,[E,ae,de,U,M]),wn=((Oi=(Wi=Ht==null?void 0:Ht.node)==null?void 0:Wi.type)==null?void 0:Oi.name)||null,_o=!kn&&!xt&&!!wn&&Ud.includes(wn)&&!Vd.has(wn),ys=_o&&wn!=="codeBlock",vs=(($i=(Ni=(Mi=a==null?void 0:a.options)==null?void 0:Mi.editorProps)==null?void 0:Ni.attributes)==null?void 0:$i.editorContext)!=="broadcast"&&["box","container","column"].includes(wn),Dn=gs?{node:E.node,pos:E.pos,key:E.key,uid:E.uid,uidIsStable:E.uidIsStable,surface:E.surface}:U?{node:U.node,pos:U.pos}:M,un=ve&&(((Di=M.node.attrs)==null?void 0:Di.id)||((Hi=(Fi=M.node.attrs)==null?void 0:Fi.uploader)==null?void 0:Hi.space_slug))||null;wf(un?{channel:"LabelsChannel",pod_slug:un}:null,{received:z=>{z.action==="tags_generated"&&z.space_slug===un||z.action==="messages_categorized"&&z.space_slug===un?no():z.action==="transcription_completed"&&z.space_slug===un&&tt((z==null?void 0:z.transcription)||"")}},[un]);const Fn=l.useCallback(()=>{var pe,gt,Wt,Ut,Ae,it,De,yt,ct;if(!(S!=null&&S.chain)||!E)return!1;const z=Kd(S,E);let Z=(z==null?void 0:z.node)||(E.node?{node:E.node,pos:E.pos}:null);if(!(Z!=null&&Z.node))return!1;Z=pi(d.current,Z)||Z,r.current=!0;const se=(pe=Z.pos)!=null?pe:E.pos;typeof se=="number"&&(c.current={from:se,to:se+(Z.node.nodeSize||0),time:new Date().getTime()});const ue=uo((Ut=(Wt=(gt=z==null?void 0:z.column)==null?void 0:gt.node)==null?void 0:Wt.attrs)==null?void 0:Ut.styles),je=uo((De=(it=(Ae=z==null?void 0:z.grid)==null?void 0:Ae.node)==null?void 0:it.attrs)==null?void 0:De.styles),Le=uo((ct=(yt=Z.node)==null?void 0:yt.attrs)==null?void 0:ct.styles);return ue&&ue["background-image"]&&xe(ue["background-image"].indexOf("https")>=0||ue["background-image"].indexOf("uploads")>=0?"image":"color"),je&&je["background-image"]&&Ce(je["background-image"].indexOf("https")>=0||je["background-image"].indexOf("uploads")>=0?"image":"color"),Le&&Le["background-image"]&&Ke(Le["background-image"].indexOf("https")>=0||Le["background-image"].indexOf("uploads")>=0?"image":"color"),Ne((z==null?void 0:z.column)||null),ie((z==null?void 0:z.grid)||null),me((z==null?void 0:z.outerGrid)||null),requestAnimationFrame(()=>{try{if(fe(Z),Z.node.type.name==="actionbutton"){const ut=Z.node.attrs;mt(Vs(ut))}}finally{r.current=!1}}),!0},[S,E]);l.useEffect(()=>{const z=d.current;if(!z||z.isDestroyed)return;const Z=()=>
4{if(!z.isEditable||z.isDestroyed)return;const se=z.view.state.selection,ue=c.current;ue&&se.from===ue.from&&se.to===ue.to||(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,ht(!0)},100))};return z.on("selectionUpdate",Z),()=>{z.off("selectionUpdate",Z),i.current&&clearTimeout(i.current)}},[a]),l.useEffect(()=>{Ee&&(re(),ht(!1))},[Ee]),l.useEffect(()=>{u&&u.opened=="configuration"?(Y(!0),re()):O||Y(!1)},[u]),l.useEffect(()=>{K||!O&&u.opened=="configuration"&&(o(Yt({opened:null,editor:null})),xf())},[K]),l.useEffect(()=>{K&&Fn()},[K,Fn]),l.useEffect(()=>{ve&&oe("interactiveInput")&&no()},[M]);const no=()=>{Kc.onFetch(M.node.attrs.id,z=>{Array.isArray(z)&&$e(z)},z=>{})},re=l.useCallback(()=>{var Ut;if(!a||a.isDestroyed)return;const{selection:z,doc:Z}=a.view.state,se=ju(Z,z);if(bt(se),!se&&Fn())return;c.current={from:z.from,to:z.to,time:new Date().getTime()},r.current=!0;const{$anchor:ue,node:je}=z,{parent:Le}=ue;let pe=je?{node:je,pos:z.anchor}:{node:Le,pos:ue.pos};if(pe.node.type.name.indexOf("grid")>=0||pe.node.type.name==="column"){r.current=!1;return}if(!O&&(pe.node.isTextblock||pe.node.isText)&&!pe.node.textContent){let Ae=!1;for(let it=ue.depth;it>0;it--){const De=ue.node(it).type.name;if(De==="box"||De==="container"||De==="shareblock"||De==="infobox"||De==="icontext"||De==="callout"||De==="blockquote"||De.indexOf("grid")>=0){Ae=!0;break}}if(!Ae){Y(!1),r.current=!1;return}}const gt=Ae=>{let it=null,De=null,yt=null,ct=null;for(let ut=ue.depth;ut>0;ut--){const qe=ue.node(ut);if(Ae.includes(qe.type.name))continue;!it&&qe.type.name==="column"&&(it=qe,De=ue.before(ut)),(qe.type.name.indexOf("grid")>=0||qe.type.name==="infobox"||qe.type.name==="box"||qe.type.name==="container"||qe.type.name==="shareblock")&&!yt&&(yt=qe,ct=ue.before(ut))}return{parentColumn:it,parentColumnPos:De,parentGrid:yt,parentGridPos:ct}};if(pe.node.type.name==="box"||pe.node.type.name==="container"||pe.node.type.name==="shareblock"){const{parentColumn:Ae,parentColumnPos:it,parentGrid:De,parentGridPos:yt}=gt([pe.node.type.name]);Ne(Ae?{node:Ae,pos:it}:null),ie({node:pe.node,pos:pe.pos}),me(De?{node:De,pos:yt}:null)}else if(pe.node.type.name==="infobox"||pe.node.type.name==="blockquote"){let Ae=null,it=null,De=null,yt=null;pe.node.forEach((ut,qe)=>{ut.type.name==="column"&&!Ae&&(Ae=ut,it=pe.pos+1+qe,ut.forEach((rt,Sn)=>{!De&&rt.isTextblock&&(De=rt,yt=it+1+Sn)}))}),Ne(Ae?{node:Ae,pos:it}:null),ie({node:pe.node,pos:pe.pos});const ct=gt([pe.node.type.name]);me(ct.parentGrid?{node:ct.parentGrid,pos:ct.parentGridPos}:null),De&&(pe={node:De,pos:yt})}else if(pe.node.type.name==="icontext"||pe.node.type.name==="callout"){const Ae=gt([pe.node.type.name]);Ne(Ae.parentColumn?{node:Ae.parentColumn,pos:Ae.parentColumnPos}:null),ie({node:pe.node,pos:pe.pos}),me(Ae.parentGrid?{node:Ae.parentGrid,pos:Ae.parentGridPos}:null)}else if(ue.depth>=1){let Ae=null,it=null,De=null,yt=null,ct=null,ut=null;for(let qe=ue.depth;qe>0;qe--){const rt=ue.node(qe);!ct&&rt.type.name==="column"&&(ct=rt,ut=ue.before(qe)),(rt.type.name.indexOf("grid")>=0||rt.type.name==="infobox"||rt.type.name==="blockquote"||rt.type.name==="box"||rt.type.name==="container"||rt.type.name==="shareblock"||rt.type.name==="icontext"||rt.type.name==="callout")&&(Ae?!De&&(Ae.type.name==="box"||Ae.type.name==="container"||Ae.type.name==="shareblock"||Ae.type.name==="icontext"||Ae.type.name==="callout"||Ae.type.name==="blockquote"||Ae.type.name==="infobox")&&(De=rt,yt=ue.before(qe)):(Ae=rt,it=ue.before(qe)))}if(Ae){const qe=uo((Ut=ct==null?void 0:ct.attrs)==null?void 0:Ut.styles),rt=uo(Ae.attrs.styles);qe&&qe["background-image"]&&xe(qe["background-image"].indexOf("https")>=0||qe["background-image"].indexOf("uploads")>=0?"image":"color"),rt&&rt["background-image"]&&Ce(rt["background-image"].indexOf("https")>=0||rt["background-image"].indexOf("uploads")>=0?"image":"color");const Sn=Ae.type.name==="box"||Ae.type.name==="container"||Ae.type.name==="shareblock",Ro=ct!=null?ct:Sn?Ae:null,Ot=ut!=null?ut:Sn?it:null;Ne(Ro?{node:Ro,pos:Ot}:null),ie({node:Ae,pos:it}),me(De?{node:De,pos:yt}:null)}else Ne(null),ie(null),me(null)}else Ne(null),ie(null),me(null);const Wt=uo(je||Le);Wt&&Wt["background-image"]&&Ke(Wt["background-image"].indexOf("https")>=0||Wt["background-image"].indexOf("uploads")>=0?"image":"color"),requestAnimationFrame(()=>
4{try{if(fe(pe),pe&&pe.node&&pe.node.type.name==="actionbutton"){const Ae=pe.node.attrs;mt(Vs(Ae))}}finally{r.current=!1}})},[a,Fn]),dn=l.useCallback(z=>{var je,Le;const Z=(je=_e==null?void 0:_e.pos)!=null?je:U==null?void 0:U.pos,se=(Le=a==null?void 0:a.view)==null?void 0:Le.state;if(!se)return;const ue=se.doc.nodeAt(Z);ue&&a.view.dispatch(se.tr.setNodeMarkup(Z,void 0,{...ue.attrs,...z})),re()},[_e,U,a,re]),et=l.useCallback((z,Z)=>{dn({[z]:Z})},[dn]),js=l.useCallback(({newStyles:z,_node:Z}={},se)=>{var pe,gt;if(!z||se!=="styles")return;const ue=(pe=_e==null?void 0:_e.pos)!=null?pe:U==null?void 0:U.pos,je=(gt=a==null?void 0:a.view)==null?void 0:gt.state;if(!je)return;const Le=je.doc.nodeAt(ue);Le&&a.view.dispatch(je.tr.setNodeMarkup(ue,void 0,{...Le.attrs,styles:z,customPadding:!0})),re()},[_e,U,a,re]),ks=l.useCallback((z,Z)=>{var Le,pe;if(!Z||Object.keys(Z).length===0){dn(z);return}const se=(Le=_e==null?void 0:_e.pos)!=null?Le:U==null?void 0:U.pos,ue=(pe=a==null?void 0:a.view)==null?void 0:pe.state;if(!ue)return;const je=ue.doc.nodeAt(se);je&&(a.view.dispatch(ue.tr.setNodeMarkup(se,void 0,{...je.attrs,...z,styles:{...je.attrs.styles||{},...Z}})),re())},[_e,U,a,re,dn]),ws=l.useCallback(z=>{var Le,pe;const Z=Nc[z];if(!Z)return;const se=(Le=_e==null?void 0:_e.pos)!=null?Le:U==null?void 0:U.pos,ue=(pe=a==null?void 0:a.view)==null?void 0:pe.state;if(!ue)return;const je=ue.doc.nodeAt(se);je&&(a.view.dispatch(ue.tr.setNodeMarkup(se,void 0,{...je.attrs,...Z.attrs,styles:{...je.attrs.styles||{},...Z.styles}})),re())},[_e,U,a,re]);l.useEffect(()=>{var se,ue;const z=_e||U,Z=(ue=(se=z==null?void 0:z.node)==null?void 0:se.type)==null?void 0:ue.name;(Z==="icontext"||Z==="callout")&&le(z.node.attrs.iconImage?"image":"emoji")},[_e,U]);const Hn=l.useCallback(({newStyles:z,_node:Z,clearTextStyleAttrs:se,changedStyleKeys:ue}={},je)=>{r.current||!z||je!=="styles"||(Em({editor:a,element:Z,newStyles:z,changedStyleKeys:ue,clearTextStyleAttrs:se,onFailure:({status:Le,uid:pe,nodeType:gt,error:Wt})=>{console.error("[sidebar] style write dropped:",Le,{uid:pe,nodeType:gt},Wt),rf({status:Le,uid:pe,nodeType:gt,error:Wt,source:"sidebar-styles"})}}),re())},[a,re]),Cs=l.useCallback(z=>{if(!a||a.isDestroyed||!(M!=null&&M.node)||M.node.type.name!=="actionbutton")return;const Z=$1(a,M);if(Z==null)return;const se=a.view.state.doc.nodeAt(Z);if(!se||se.type.name!=="actionbutton")return;const ue=(b==null?void 0:b.slug)||(typeof window!="undefined"?window.location.pathname.split("/")[2]:""),je={...se.attrs,...Gd(z,ue,se.attrs)},Le=a.view.state.tr.setNodeMarkup(Z,void 0,je);a.view.dispatch(Le);const pe=a.view.state.doc.nodeAt(Z);pe&&fe({node:pe,pos:Z}),mt(z),re()},[a,M,b==null?void 0:b.slug,re]),Cn=l.useCallback(z=>{var je;if(!(z!=null&&z.node)||!a)return;const Z=pi(a,z);if(!Z)return;const se=Z.node.type.name;if(za(a,Z,oc(Z.node),M1(Z.node,j))&&(Sm(Z.node)&&ch(a,Z,Cm),se==="infobox"||se==="blockquote")){const Le=Z.pos+1,pe=a.view.state.doc.nodeAt(Le);((je=pe==null?void 0:pe.type)==null?void 0:je.name)==="column"&&za(a,{node:pe,pos:Le},oc(pe),N1(se,pe))}},[j,a]),Ss=l.useCallback(()=>{if(E){const z=E;z.node&&z.pos!=null&&Cn({node:z.node,pos:z.pos});return}if(ae==="column")Cn(de||M||null);else if(ae==="grid"){const z=ce&&(Nn||kt("icontext")||kt("callout")||kt("blockquote")||kt("infobox"));Cn(z?ce:U||null)}else Cn(M||null)},[ae,E,M,de,U,ce,Nn,jn,Cn]),Te=l.useCallback(()=>{var z,Z;(Z=(z=M==null?void 0:M.node)==null?void 0:z.attrs)!=null&&Z.id&&_s.onGenerateAiTags(M.node.attrs.id,se=>{Ct.fire({title:"Success",text:"Generating tags...",confirmButtonColor:zn.blue}).then(ue=>{})},se=>{console.log(se)})},[(Vi=(Ui=M==null?void 0:M.node)==null?void 0:Ui.attrs)==null?void 0:Vi.id]),Me=l.useCallback(()=>{var z,Z;(Z=(z=M==null?void 0:M.node)==null?void 0:z.attrs)!=null&&Z.id&&_s.onApplyAllTags(M.node.attrs.id,se=>{Ct.fire({title:"Success",text:"Message tags successfully created.",confirmButtonColor:zn.blue}).then(ue=>{})},se=>{console.log(se)})},[(Gi=(Ki=M==null?void 0:M.node)==null?void 0:Ki.attrs)==null?void 0:Gi.id]),ge=l.useCallback(()=>{var z,Z;(Z=(z=M==null?void 0:M.node)==null?void 0:z.attrs)!=null&&Z.id&&_s.onCategorizeAllTags(M.node.attrs.id,se=>{Ct.fire({title:"Success",text:"Categorizing messages with AI...",confirmButtonColor:zn.blue}).then(ue=>{})},se=>{console.log(se)})},[(qi=(Yi=M==null?void 0:M.node)==null?void 0:Yi.attrs)==null?void 0:qi.id]),nt=l.useCallback(()=>{var z,Z;(Z=(z=M==null?void 0:M.node)==null?void 0:z.attrs)!=null&&Z.id&&_s.onClearAllTags(M.node.attrs.id,se=>{Ct.fire({title:"Success",text:"Message tags successfully cleared.",confirmButtonColor:zn.blue}).then(ue=>{})},se=>{console.log(se)})},[(Zi=(Xi=M==null?void 0:M.node)==null?void 0:Xi.attrs)==null?void 0:Zi.id]),ot=l.useCallback(z=>{z.preventDefault(),z.stopPropagation(),Y(!1),ve&&a&&(M!=null&&M.node)&&sf.send("open_TrimVideo",document.body,{node:{...M.node},editor:a})},[ve,M,a]),Pt=K?e.jsxs(Rx,{children:[e.jsxs(p,{style:{flexShrink:0},children:[e.jsxs(p,{style:{padding:"10px 14px 0 14px",display:"flex",alignItems:"flex-end",justifyContent:"space-between",gap:8,borderBottom:"1px solid #e8e8e8",background:"#fff"},children:[e.jsx(p,{style:{display:"flex",gap:4,flex:1,maxWidth:320,marginBottom:-1},children:[["settings","Settings"],["navigator","Navigator"]].map(([z,Z])=>{const se=m===z;return e.jsx(p,{component:"button",onClick:()=>x(z),style:{flex:1,textAlign:"center",padding:"9px 12px",fontSize:13,fontWeight:600,cursor:"pointer",borderRadius:"8px 8px 0 0",color:se?"#1a1b2e":"#868e96",background:se?"#fff":"#f1f3f5",border:"1px solid "+(se?"#e9ecef":"transparent"),borderBottom:se?"1px solid #fff":"1px solid #e9ecef"},children:Z},z)})}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:6,marginBottom:8},children:[!O&&e.jsx(p,{component:"button",onClick:hs,className:`${Ze.pinBtn} ${H?Ze.pinBtnActive:""}`,title:H?"Unpin panel":"Pin panel","aria-label":H?"Unpin settings panel":"Pin settings panel","aria-pressed":H,children:e.jsx(Qe,{icon:Yd.faThumbtack})}),e.jsx(p,{component:"button",onClick:()=>Y(!1),className:Ze.closeBtn,title:"Close panel",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),(()=>{var ue;const z=A(L);if(!z||!z.chain||z.chain.filter(je=>je.selectable).length<=1)return null;const se=v(L);return e.jsx(p,{style:{background:"#fff",borderBottom:"1px solid #e8e8e8",padding:"8px 12px 6px 10px"},children:e.jsx(kf,{chain:z.chain,selectedKey:se||((ue=z.leaf)==null?void 0:ue.key),onSelect:P,variant:"sidebar",onHoverStart:je=>L&&I(L,{key:je.key,uid:je.uid,uidIsStable:je.uidIsStable,pos:je.pos,nodeType:je.nodeType,surface:je.surface,color:Vo(je)}),onHoverEnd:()=>L&&I(L,null)})})})()]}),m==="navigator"&&e.jsx(p,{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:e.jsx(Dg,{editor:a,scopedEditorId:L,selectedTarget:E,onSelectEntry:q,onOpenSettings:Q,onNavigate:w,onHoverEntry:z=>L&&I(L,{key:z.key,uid:z.uid,uidIsStable:z.uidIsStable,pos:z.pos,nodeType:z.nodeType,surface:z.surface,type:z.type,color:Vo(z)}),onHoverEnd:()=>L&&I(L,null)})}),e.jsxs(p,{style:{flex:1,minHeight:0,overflowY:"auto",display:m==="navigator"?"none":void 0},children:[!kn&&e.jsx(Fg,{entry:E,onRename:B}),kn?e.jsx(p,{style:{margin:"2px 20px 20px",padding:"12px 14px",borderRadius:8,border:"1px solid #eceff3",background:"#f8f9fb",color:"#6b7280",fontSize:"12px",lineHeight:1.45},children:"Please select a specific element to adjust block settings."}):e.jsxs(p,{children:[_o&&e.jsx(p,{style:{padding:"14px 20px 12px",borderBottom:"1px solid #f0f
40f0"},children:e.jsx(dm,{editor:a,element:Ht})}),e.jsxs(bm,{multiple:!0,defaultValue:["Icon","Icon style","Icon size","Icon background","Gap","Side","Alignment","Progress bar","Callout icon","Callout layout","Form fields","Input style","Button text","Button action","Complete action","Event details","Button style","Hover","On click action","Size","Text","Corners","Shadow","Content","Badge text","Badge style","Text style","Bullets","Line style","Spacing","Collapsible Fill","Collapsible Text","Toggle icon","Toggle rows","Title font","Nav Bar","Links","Logo and title","Layout","Style","Dropdown menu","Share Block","Transcripts",n("tiptap.components.sideConfigurationsMenu.label22"),n("tiptap.components.sideConfigurationsMenu.label4"),"admin-ai","interactive-input","reset-section","typography","media-card","media-circle","media-display","media-file","media-link","media-survey","media-tagsfeed","media-video","HTML embed","HTML embed full width","bc-background","bc-border","bc-fullwidth","bc-gap","bc-layout","bc-minheight","bc-padding","bc-radius","bc-shadow","bc-vertical","bc-box-hover","bc-website-header","bc-size","bc-align","v2-block-hover","v2-alignment","v2-background","v2-blockquote-settings","v2-border","v2-image-crop","v2-infobox-badge","v2-padding","v2-radius","v2-shadow","v2-width","v2-box-background","v2-box-border","v2-box-layout","v2-box-minheight","v2-box-padding","v2-box-radius","v2-box-shadow","v2-box-vertical","v2-box-size","v2-box-align","v2-callout-background","v2-callout-border","v2-callout-content-padding","v2-callout-radius","v2-callout-shadow","v2-col-background","v2-col-border","v2-col-layout","v2-col-padding","v2-col-radius","v2-col-shadow","v2-col-vertical","v2-grid-background","v2-grid-border","v2-grid-fullwidth","v2-grid-gap","v2-grid-minheight","v2-grid-padding","v2-grid-radius","v2-grid-shadow","v2-grid-size","v2-grid-align","v2-gridx-layout","v2-gridx-colgap","v2-gridx-rowgap","bc-gridx-layout","bc-rowgap"],mb:200,lockedClassName:Ze.responsiveLocked,classNames:{item:Ze.accordionItem,control:Ze.accordionControl,label:Ze.accordionLabel,chevron:Ze.accordionChevron,panel:Ze.accordionPanel,content:Ze.accordionContent},children:[xt&&e.jsx(Rc,{node:M,hasNode:ve,isNodeType:oe,t:n,saveNodeData:Hn,editor:a,forceDesktop:!0}),!xt&&e.jsxs(e.Fragment,{children:[to&&e.jsxs(y.Item,{value:"Style",children:[e.jsx(y.Control,{children:"Style"}),e.jsx(y.Panel,{children:e.jsx(_g,{attrs:((Qi=_e==null?void 0:_e.node)==null?void 0:Qi.attrs)||{},applyPreset:ws})})]}),to&&e.jsxs(y.Item,{value:"Callout icon",children:[e.jsx(y.Control,{children:"Icon"}),e.jsx(y.Panel,{children:e.jsx(Ag,{attrs:((Ji=_e==null?void 0:_e.node)==null?void 0:Ji.attrs)||{},update:et,updateMany:ks,iconSelector:e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsxs(ye,{gap:6,grow:!0,children:[e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("circle",{cx:"12",cy:"10",r:"8"}),e.jsx("circle",{cx:"9",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),e.jsx("circle",{cx:"15",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),e.jsx("path",{d:"M8.5 12.5 Q12 15.5 15.5 12.5",strokeLinecap:"round",fill:"none"})]}),label:"Emoji",value:"emoji",active:he==="emoji",onClick:()=>{var z,Z;le("emoji"),(Z=(z=_e==null?void 0:_e.node)==null?void 0:z.attrs)!=null&&Z.iconImage&&et("iconImage",null)}}),e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"3",y:"2",width:"18",height:"16",rx:"2"}),e.jsx("circle",{cx:"9",cy:"8",r:"2"}),e.jsx("path",{d:"M3 14 L8 9.5 L12 13 L15 10 L21 15",strokeLinejoin:"round"})]}),label:"Image",value:"image",active:he==="image",onClick:()=>le("image")})]}),he==="emoji"&&e.jsxs(we,{opened:Ye,onChange:z=>ze(z),position:"bottom",offset:10,withinPortal:!0,zIndex:1e5,children:[e.jsx(we.Target,{children:e.jsxs(p,{className:Ze.emojiTrigger,onClick:()=>ze(z=>!z),children:[e.jsx(p,{style:{fontSize:"28px",lineHeight:1,display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"28px"},children:Ks((tl=(el=_e==null?void 0:_e.node)==null?void 0:el.attrs)==null?void 0:tl.icon,(ol=(nl=_e==null?void 0:_e.node)==null?void 0:nl.attrs)==null?void 0:ol.iconColor)}),e.jsxs(p,{children:[e.jsx(N,{style:{fontSize:"12px",color:"#666",fontWeight:600},children:"Click to change"}),e.jsx(N,{style:{fontSize:"10px",color:"#999"},children:"Emoji · Icons · Numbers"})]})]})}),e.jsx(we.Dropdown,{children:e.jsx(Kr,{onSelect:z=>{dn({icon:z,iconImage:null}),ze(!1)}})})]}),he==="image"&&e.jsx(e.Fragment,{children:(rl=(sl=_e==null?void 0:_e.node)==null?void 0:sl.attrs)!=null&&rl.iconImage?e.jsxs(p,{style:{position:"relative",display:"inline-block"},children:[e.jsx("img",{src:_e.node.attrs.iconImage,alt:"",style:{width:"80px",height:"80px",objectFit:"cover",borderRadius:"10px",border:"1.5px solid #e0e0e0"}}),e.jsx(p,{onClick:()=>et("iconImage",null),className:Ze.imageRemoveOverlay,children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"white",strokeWidth:"1.8",strokeLinecap:"round",children:e.jsx("path",{d:"M1 1L9 9M9 1L1 9"})})})]}):e.jsxs(Co,{withCredentials:!0,accept:Ec,fileFilter:zc,multiple:!1,destination:{url:`https://api.sutra.co/api/v4/spaces/${b==null?void 0:b.slug}/upload_file`,headers:To()},children:[e.jsx(Lc,{onUpload:z=>et("iconImage",z)}),e.jsx(Pc,{})]})})]})})})]}),to&&e.jsxs(y.Item,{value:"Callout layout",children:[e.jsx(y.Control,{children:"Layout"}),e.jsx(y.Panel,{children:e.jsx(Bg,{attrs:((il=_e==null?void 0:_e.node)==null?void 0:il.attrs)||{},update:et})})]}),Ft&&e.jsxs(y.Item,{value:"Icon",children:[e.jsx(y.Control,{children:"Icon"}),e.jsx(y.Panel,{children:e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsxs(ye,{gap:6,grow:!0,children:[e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("circle",{cx:"12",cy:"10",r:"8"}),e.jsx("circle",{cx:"9",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),e.jsx("circle",{cx:"15",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),e.jsx("path",{d:"M8.5 12.5 Q12 15.5 15.5 12.5",strokeLinecap:"round",fill:"none"})]}),label:"Emoji",value:"emoji",active:he==="emoji",onClick:()=>{var z,Z;le("emoji"),(Z=(z=U==null?void 0:U.node)==null?void 0:z.attrs)!=null&&Z.iconImage&&et("iconImage",null)}}),e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"3",y:"2",width:"18",height:"16",rx:"2"}),e.jsx("circle",{cx:"9",cy:"8",r:"2"}),e.jsx("path",{d:"M3 14 L8 9.5 L12 13 L15 10 L21 15",strokeLinejoin:"round"})]}),label:"Image",value:"image",active:he==="image",onClick:()=>le("image")})]}),he==="emoji"&&e.jsxs(we,{opened:V,onChange:z=>te(z),position:"bottom",offset:10,withinPortal:!0,zIndex:1e5,children:[e.jsx(we.Target,{children:e.jsxs(p,{className:Ze.emojiTrigger,onClick:()=>te(z=>!z),children:[e.jsx(p,{style:{fontSize:"28px",lineHeight:1,display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"28px"},children:Ks(((al=(ll=U==null?void 0:U.node)==null?void 0:ll.attrs)==null?void 0:al.icon)||"👍")}),e.jsxs(p,{children:[e.jsx(N,{style:{fontSize:"12px",color:"#666",fontWeight:600},children:"Click to change"}),e.jsx(N,{style:{fontSize:"10px",color:"#999"},children:"Emoji · Icons · Numbers"})]})]})}),e.jsx(we.Dropdown,{children:e.jsx(Kr,{onSelect:z=>{et("icon",z),te(!1)}})})]}),he==="image"&&e.jsx(e.Fragment,{children:(ul=(cl=U==null?void 0:U.node)==null?void 0:cl.attrs)!=null&&ul.iconImage?e.jsxs(p,{style:{position:"relative",display:"inline-block"},children:[e.jsx("img",{src:U.node.attrs.iconImage,alt:"",style:{width:"80px",height:"80px",objectFit:"cover",borderRadius:"10px",border:"1.5px solid #e0e0e0"}}),e.jsx(p,{onClick:()=>et("iconImage",null),className:Ze.imageRemoveOverlay,children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"white",strokeWidth:"1.8",strokeLinecap:"round",children:e.jsx("path",{d:"M1 1L9 9M9 1L1 9"})})})]}):e.jsxs(Co,{withCredentials:!0,accept:Ec,fileFilter:zc,multiple:!1,destination:{url:`https://api.sutra.co/api/v4/spaces/${b==null?void 0:b.slug}/upload_file`,headers:To()},children:[e.jsx(Lc,{onUpload:z=>et("iconImage",z)}),e.jsx(Pc,{})]})})]})})]}),Ft&&e.jsxs(y.Item,{value:"Icon style",children:[e.jsx(y.Control,{children:"Icon style"}),e.jsx(y.Panel,{children:e.jsxs(ye,{gap:6,grow:!0,children:[e.jsx(Be,{icon:e.jsx("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:e.jsx("circle",{cx:"12",cy:"10",r:"5",fill:"currentColor",stroke:"none",opacity:"0.6"})}),label:"Plain",value:"plain",active:(((fl=(dl=U==null?void 0:U.node)==null?void 0:dl.attrs)==null?void 0:fl.iconStyle)||"badge")==="plain",onClick:()=>et("iconStyle","plain")}),e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"2",y:"1",width:"20",height:"18",rx:"4",opacity:"0.3"}
4),e.jsx("circle",{cx:"12",cy:"10",r:"4",fill:"currentColor",stroke:"none",opacity:"0.6"})]}),label:"Badge",value:"badge",active:(((pl=(hl=U==null?void 0:U.node)==null?void 0:hl.attrs)==null?void 0:pl.iconStyle)||"badge")==="badge",onClick:()=>et("iconStyle","badge")}),e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("circle",{cx:"12",cy:"10",r:"9",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"10",r:"4",fill:"currentColor",stroke:"none",opacity:"0.6"})]}),label:"Circle",value:"circle",active:(((gl=(xl=U==null?void 0:U.node)==null?void 0:xl.attrs)==null?void 0:gl.iconStyle)||"badge")==="circle",onClick:()=>et("iconStyle","circle")})]})})]}),Ft&&e.jsxs(y.Item,{value:"Icon size",children:[e.jsx(y.Control,{children:"Icon size"}),e.jsx(y.Panel,{children:e.jsx(Pe,{options:[{label:"S",value:"20px"},{label:"M",value:"28px"},{label:"L",value:"40px"},{label:"XL",value:"60px"},{label:"XXL",value:"80px"}],activeValue:((bl=(ml=U==null?void 0:U.node)==null?void 0:ml.attrs)==null?void 0:bl.iconSize)||"28px",onChange:z=>et("iconSize",z),columns:5})})]}),Ft&&!((vl=(yl=U==null?void 0:U.node)==null?void 0:yl.attrs)!=null&&vl.iconImage)&&(((kl=(jl=U==null?void 0:U.node)==null?void 0:jl.attrs)==null?void 0:kl.iconStyle)||"badge")!=="plain"&&e.jsxs(y.Item,{value:"Icon background",children:[e.jsx(y.Control,{children:"Icon background"}),e.jsx(y.Panel,{children:e.jsx(xu,{activeBg:(Cl=(wl=U==null?void 0:U.node)==null?void 0:wl.attrs)==null?void 0:Cl.iconBg,activeColor:(Tl=(Sl=U==null?void 0:U.node)==null?void 0:Sl.attrs)==null?void 0:Tl.iconColor,onSelect:z=>{dn({iconBg:z.bg,iconColor:z.color})}})})]}),Ft&&e.jsxs(y.Item,{value:"Gap",children:[e.jsx(y.Control,{children:"Gap"}),e.jsx(y.Panel,{children:e.jsx(He,{label:"",labelWidth:"0px",value:parseInt(((_l=(Il=U==null?void 0:U.node)==null?void 0:Il.attrs)==null?void 0:_l.gap)||"16",10)||16,onChange:z=>{z!=null&&et("gap",`${z}px`)},min:0,max:48,unit:"px"})})]}),Ft&&e.jsxs(y.Item,{value:"Side",children:[e.jsx(y.Control,{children:"Side"}),e.jsx(y.Panel,{children:e.jsxs(ye,{gap:6,grow:!0,children:[e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"2",y:"4",width:"6",height:"12",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"11",y1:"7",x2:"22",y2:"7"}),e.jsx("line",{x1:"11",y1:"10.5",x2:"19",y2:"10.5"}),e.jsx("line",{x1:"11",y1:"14",x2:"20",y2:"14"})]}),label:"Left",value:"left",active:(((Bl=(Al=U==null?void 0:U.node)==null?void 0:Al.attrs)==null?void 0:Bl.iconSide)||"left")==="left",onClick:()=>et("iconSide","left")}),e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"16",y:"4",width:"6",height:"12",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"2",y1:"7",x2:"13",y2:"7"}),e.jsx("line",{x1:"2",y1:"10.5",x2:"11",y2:"10.5"}),e.jsx("line",{x1:"2",y1:"14",x2:"12",y2:"14"})]}),label:"Right",value:"right",active:(((El=(Rl=U==null?void 0:U.node)==null?void 0:Rl.attrs)==null?void 0:El.iconSide)||"left")==="right",onClick:()=>et("iconSide","right")}),e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"9",y:"1",width:"6",height:"6",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"4",y1:"11",x2:"20",y2:"11"}),e.jsx("line",{x1:"6",y1:"14.5",x2:"18",y2:"14.5"}),e.jsx("line",{x1:"8",y1:"18",x2:"16",y2:"18"})]}),label:"Top",value:"top",active:(((Ll=(zl=U==null?void 0:U.node)==null?void 0:zl.attrs)==null?void 0:Ll.iconSide)||"left")==="top",onClick:()=>et("iconSide","top")})]})})]}),Ft&&(((Wl=(Pl=U==null?void 0:U.node)==null?void 0:Pl.attrs)==null?void 0:Wl.
4iconSide)||"left")!=="top"&&e.jsxs(y.Item,{value:"Alignment",children:[e.jsx(y.Control,{children:"Alignment"}),e.jsx(y.Panel,{children:e.jsxs(ye,{gap:6,grow:!0,children:[e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"2",y:"1",width:"20",height:"18",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"6",y1:"5",x2:"18",y2:"5"}),e.jsx("line",{x1:"6",y1:"8.5",x2:"15",y2:"8.5"})]}),label:"Top",value:"flex-start",active:(((Ml=(Ol=U==null?void 0:U.node)==null?void 0:Ol.attrs)==null?void 0:Ml.verticalAlign)||"center")==="flex-start",onClick:()=>et("verticalAlign","flex-start")}),e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"2",y:"1",width:"20",height:"18",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"6",y1:"8",x2:"18",y2:"8"}),e.jsx("line",{x1:"6",y1:"11.5",x2:"15",y2:"11.5"})]}),label:"Center",value:"center",active:((($l=(Nl=U==null?void 0:U.node)==null?void 0:Nl.attrs)==null?void 0:$l.verticalAlign)||"center")==="center",onClick:()=>et("verticalAlign","center")})]})})]}),Ft&&(((Fl=(Dl=U==null?void 0:U.node)==null?void 0:Dl.attrs)==null?void 0:Fl.iconSide)||"left")==="top"&&e.jsxs(y.Item,{value:"Alignment",children:[e.jsx(y.Control,{children:"Alignment"}),e.jsx(y.Panel,{children:e.jsxs(ye,{gap:6,grow:!0,children:[e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"3",y:"2",width:"6",height:"6",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"3",y1:"15.5",x2:"17",y2:"15.5"})]}),label:"Left",value:"left",active:(((Ul=(Hl=U==null?void 0:U.node)==null?void 0:Hl.attrs)==null?void 0:Ul.iconTopAlign)||"center")==="left",onClick:()=>et("iconTopAlign","left")}),e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"9",y:"2",width:"6",height:"6",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),e.jsx("line",{x1:"6",y1:"15.5",x2:"18",y2:"15.5"})]}),label:"Center",value:"center",active:(((Kl=(Vl=U==null?void 0:U.node)==null?void 0:Vl.attrs)==null?void 0:Kl.iconTopAlign)||"center")==="center",onClick:()=>et("iconTopAlign","center")}),e.jsx(Be,{icon:e.jsxs("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("rect",{x:"15",y:"2",width:"6",height:"6",rx:"2",opacity:"0.3"}),e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"7",y1:"15.5",x2:"21",y2:"15.5"})]}),label:"Right",value:"right",active:(((Yl=(Gl=U==null?void 0:U.node)==null?void 0:Gl.attrs)==null?void 0:Yl.iconTopAlign)||"center")==="right",onClick:()=>et("iconTopAlign","right")})]})})]}),Ft&&e.jsxs(p,{style:{fontSize:"11px",color:"#999",fontStyle:"italic",lineHeight:1.4,padding:"8px 25px"},children:["Wrap in an ",e.jsx("strong",{children:"InfoBox"})," for background, border, radius, or shadow."]}),Se&&ae==="block"&&Hb({node:M,hasNode:ve,isNodeType:oe,t:n,onSaveNodeData:re,onTrimVideo:ot,editor:a,editorContext:(Zl=(Xl=(ql=a==null?void 0:a.options)==null?void 0:ql.editorProps)==null?void 0:Xl.attributes)==null?void 0:Zl.editorContext,colors:j}),Se&&ae==="block"&&L1({node:M,isNodeType:oe,editor:a,onSaveNodeData:re}),Se&&ae==="block"&&e.jsx(Fm,{node:M,editor:a,tags:lt,t:n,classes:s,onSaveNodeData:re,nodeType:Lt,isNodeType:oe,onGenerateAiTags:Te,onApplyAllTags:Me,onCategorizeAllTags:ge,onClearAllTags:nt}),Se&&ae==="block"&&ve&&oe("interactiveInput")&&e.jsxs(y.Item,{value:"Progress bar",children:[e.jsx(y.Control,{children:"Progress bar"}),e.jsx(y.Panel,{children:e.jsx(Bt,{saveNodeData:re,element:M,attrLabel:e.jsxs(p,{component:"span",style:{display:"inline"},children:[e.jsx("span",{children:"Show progress bar"}),e.jsx(vt,{label:"Show a progress bar at the top of the page.",multiline:!0,styles:{tooltip:{width:240}},withArrow:!0,position:"top",zIndex:999999,events:{hover:!0,focus:!0,touch:!0},children:e.jsx(p,{component:"span","aria-label":"Show a progress bar at the top of the page.",role:"img",tabIndex:0,style:{display:"inline-flex",verticalAlign:"middle",marginLeft:6,color:"#868e96",cursor:"pointer",fontSize:14},children:e.jsx(En,{size:17,strokeWidth:1.75,"aria-hidden":"true"})})})]}),attrName:"showProgressBar",global:!0})})]}),Se&&ae==="block"&&ve&&oe("interactiveWait")&&e.jsxs(y.Item,{value:n("tiptap.components.sideConfigurationsMenu.label22"),children:[e.jsx(y.Control,{children:n("tiptap.components.sideConfigurationsMenu.label22")}),e.jsxs(y.Panel,{children:[e.jsx(Bt,{saveNodeData:re,element:M,attrLabel:n("tiptap.components.sideConfigurationsMenu.label23"),attrName:"interactiveWaitSendNotificationEmail"}),M.node.attrs.interactiveWaitSendNotificationEmail&&e.jsxs(e.Fragment,{children:[e.jsx(Bt,{saveNodeData:re,element:M,attrLabel:n("tiptap.components.sideConfigurationsMenu.attrLabel8"),attrName:"interactiveWaitNotificationIncludeCustomMessage"}),M.node.attrs.interactiveWaitNotificationIncludeCustomMessage&&e.jsx(Va,{saveNodeData:re,element:M,placeholder:n("tiptap.components.sideConfigurationsMenu.attrPlaceholder1"),label:n("tiptap.components.sideConfigurationsMenu.attrLabel12"),attrLabel:M.node.attrs.interactiveWaitNotificationCustomSubject?M.node.attrs.interactiveWaitNotificationCustomSubject:n("tiptap.components.sideConfigurationsMenu.defaultWaitLabel"),attrName:"interactiveWaitNotificationCustomSubject"}),M.node.attrs.interactiveWaitNotificationIncludeCustomMessage&&e.jsx(Va,{saveNodeData:re,element:M,placeholder:n("tiptap.components.sideConfigurationsMenu.attrPlaceholder1"),label:n("tiptap.components.sideConfigurationsMenu.attrLabel13"),attrLabel:M.node.attrs.interactiveWaitNotificationCustomMessage?M.node.attrs.interactiveWaitNotificationCustomMessage:n("tiptap.components.sideConfigurationsMenu.defaultWaitMessage"),attrName:"interactiveWaitNotificationCustomMessage"}),e.jsx(Bt,{saveNodeData:re,element:M,attrLabel:n("tiptap.components.sideConfigurationsMenu.attrLabel9"),attrName:"interactiveWaitNotificationIncludeContent"}),M.node.attrs.interactiveWaitNotificationIncludeContent&&e.jsx(p,{style:{border:"1px solid #dfdfdf",padding:"10px 10px 20px 20px",marginTop:20,borderRadius:5},children:e.jsx(Vx,{saveNodeData:re,element:M,radioData:[{label:n("tiptap.components.sideConfigurationsMenu.attrLabel10"),value:"full"},{label:n("tiptap.components.sideConfigurationsMenu.attrLabel11"),value:"short"}],attrName:"interactiveWaitNotificationIncludeContentValue"})})]})]})]}),Se&&ae==="block"&&ve&&oe("interactiveWait")&&e.jsxs(y.Item,{value:n("tiptap.components.sideConfigurationsMenu.label4"),children:[e.jsx(y.Control,{children:n("tiptap.components.sideConfigurationsMenu.label4")}),e.jsx(y.Panel,{children:e.jsx(Ux,{saveNodeData:re,element:M})})]}),Se&&ae==="block"&&ve&&oe("customform")&&e.jsxs(y.Item,{value:"Form fields",children:[e.jsx(y.Control,{children:"Form fields"}),e.jsx(y.Panel,{children:e.jsx(wg,{saveNodeData:re,element:M,editor:a})})]}
4),Se&&ae==="block"&&ve&&M.node.attrs.buttonBackgroundColor&&(!oe("circle")||oe("circle")&&M.node.attrs.viewAs=="button")&&!oe("circle")&&!oe("interactiveInput")&&e.jsxs(y.Item,{value:"Button text",children:[e.jsx(y.Control,{children:"Button text"}),e.jsx(y.Panel,{children:e.jsx(vi,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&M.node.attrs.buttonBackgroundColor&&(!oe("circle")||oe("circle")&&M.node.attrs.viewAs=="button")&&!oe("circle")&&!oe("survey")&&!oe("interactiveInput")&&!oe("interactiveButton")&&e.jsxs(y.Item,{value:oe("customform")?"Complete action":"Button action",children:[e.jsx(y.Control,{children:oe("customform")?"Complete action":"Button action"}),e.jsxs(y.Panel,{children:[oe("actionbutton")&&((ea=(Jl=(Ql=a==null?void 0:a.options)==null?void 0:Ql.editorProps)==null?void 0:Jl.attributes)==null?void 0:ea.editorContext)!=="broadcast"&&e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"8px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"50px"},children:"Type"}),e.jsx(Ue,{value:Ge,onChange:z=>Cs(z.target.value),size:"xs",data:qd({showInvite:fs,isRegistration:yn}),style:{flex:1},classNames:{input:Ze.focusInput},styles:{input:{fontSize:"12px",border:"1.5px solid #e0e0e0",borderRadius:"6px"}}})]}),e.jsx(Pa,{saveNodeData:re,element:M,editor:a,buttonType:((oa=(na=(ta=a==null?void 0:a.options)==null?void 0:ta.editorProps)==null?void 0:na.attributes)==null?void 0:oa.editorContext)==="broadcast"&&Ge!=="calendar_invite"?"action":Ge,onButtonTypeChange:mt,context:(ia=(ra=(sa=a==null?void 0:a.options)==null?void 0:sa.editorProps)==null?void 0:ra.attributes)==null?void 0:ia.editorContext})]})]}),Se&&ae==="block"&&ve&&oe("actionbutton")&&Ge==="calendar_invite"&&e.jsxs(y.Item,{value:"Event details",children:[e.jsx(y.Control,{children:"Event details"}),e.jsx(y.Panel,{children:e.jsx(Ih,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&M.node.attrs.buttonBackgroundColor&&(oe("actionbutton")||oe("customform")||oe("interactiveButton"))&&e.jsxs(y.Item,{value:"Button style",children:[e.jsx(y.Control,{children:"Button style"}),e.jsx(y.Panel,{children:e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"105px",whiteSpace:"nowrap"},children:"Fill"}),e.jsx(wt,{attrName:"buttonBackgroundColor",saveNodeData:re,element:M,editor:a,swatchType:"dark",clearLabel:"Remove fill"})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"105px",whiteSpace:"nowrap"},children:"Text"}),e.jsx(wt,{attrName:"buttonTextColor",saveNodeData:re,element:M,editor:a,swatchType:"light"})]}),(oe("actionbutton")||oe("interactiveButton")||oe("customform"))&&e.jsxs(p,{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"105px",whiteSpace:"nowrap",marginTop:4},children:"Border"}),e.jsx(p,{style:{flex:1},children:e.jsx(Zr,{saveNodeData:re,element:M,editor:a})})]})]})})]}),Se&&ae==="block"&&ve&&oe("customform")&&e.jsxs(y.Item,{value:"Input style",children:[e.jsx(y.Control,{children:"Input style"}),e.jsx(y.Panel,{children:e.jsx(Cg,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&M.node.attrs.buttonBackgroundColor&&(!oe("circle")||oe("circle")&&M.node.attrs.viewAs=="button")&&!oe("actionbutton")&&!oe("customform")&&!oe("interactiveInput")&&!oe("interactiveButton")&&e.jsxs(y.Item,{value:"Button style",children:[e.jsx(y.Control,{children:"Button style"}),e.jsx(y.Panel,{children:e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"105px",whiteSpace:"nowrap"},children:"Fill"}
4),e.jsx(wt,{attrName:"buttonBackgroundColor",saveNodeData:re,element:M,editor:a,swatchType:"dark",clearLabel:"Remove fill"})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"105px",whiteSpace:"nowrap"},children:"Text"}),e.jsx(wt,{attrName:"buttonTextColor",saveNodeData:re,element:M,editor:a,swatchType:"light"})]}),e.jsxs(p,{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"105px",whiteSpace:"nowrap",marginTop:4},children:"Border"}),e.jsx(p,{style:{flex:1},children:e.jsx(Zr,{saveNodeData:re,element:M,editor:a})})]})]})})]}),Se&&ae==="block"&&ve&&M.node.attrs.buttonBackgroundColor&&oe("actionbutton")&&e.jsxs(y.Item,{value:"Hover",children:[e.jsx(y.Control,{children:"Hover"}),e.jsx(y.Panel,{children:e.jsx(Yh,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&M.node.attrs.buttonBackgroundColor&&(!oe("circle")||oe("circle")&&M.node.attrs.viewAs=="button")&&!oe("interactiveInput")&&!oe("survey")&&e.jsxs(y.Item,{value:"Size",children:[e.jsx(y.Control,{children:"Size"}),e.jsx(y.Panel,{children:e.jsx(Na,{variant:"button",allowCustom:oe("actionbutton"),saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&M.node.attrs.buttonBackgroundColor&&oe("actionbutton")&&e.jsxs(y.Item,{value:"Text",children:[e.jsx(y.Control,{children:"Text"}),e.jsx(y.Panel,{children:e.jsx(Fa,{variant:"button",saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&M.node.attrs.buttonBackgroundColor&&(!oe("circle")||oe("circle")&&M.node.attrs.viewAs=="button")&&!oe("interactiveInput")&&!oe("survey")&&e.jsxs(y.Item,{value:"Corners",children:[e.jsx(y.Control,{children:"Corners"}),e.jsx(y.Panel,{children:e.jsx(Rn,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&M.node.attrs.buttonBackgroundColor&&(!oe("circle")||oe("circle")&&M.node.attrs.viewAs=="button")&&!oe("interactiveInput")&&!oe("survey")&&!oe("customform")&&e.jsxs(y.Item,{value:"Shadow",children:[e.jsx(y.Control,{children:"Shadow"}),e.jsx(y.Panel,{children:e.jsx(Hh,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("badgePill")&&e.jsxs(y.Item,{value:"Content",children:[e.jsx(y.Control,{children:"Content"}),e.jsx(y.Panel,{children:e.jsx(bp,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("badgePill")&&!eo&&e.jsxs(y.Item,{value:"Badge text",children:[e.jsx(y.Control,{children:"Badge text"}),e.jsx(y.Panel,{children:e.jsx(ap,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("badgePill")&&e.jsxs(y.Item,{value:"Badge style",children:[e.jsx(y.Control,{children:"Badge style"}),e.jsx(y.Panel,{children:e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsx(pp,{saveNodeData:re,element:M,editor:a}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"50px"},children:"Fill"}),e.jsx(wt,{attrName:"badgePillBackgroundColor",saveNodeData:re,element:M,editor:a,swatchType:"dark"})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"50px"},children:"Text"}),e.jsx(wt,{attrName:"badgePillTextColor",saveNodeData:re,element:M,editor:a,swatchType:"light"})]}),e.jsxs(p,{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"50px",marginTop:4},children:"Border"}),e.jsx(p,{style:{flex:1},children:e.jsx(Tp,{saveNodeData:re,element:M,editor:a})})]}),!eo&&e.jsxs(p,{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"13px",color:"#868e96",fontWeight:500,flexShrink:0,width:"50px",marginTop:4},children:"Dot"}),e.jsx(p,{style:{flex:1},children:e.jsx(Wp,{saveNodeData:re,element:M,editor:a})})]})]})})]}),Se&&ae==="block"&&ve&&oe("badgePill")&&e.jsxs(y.Item,{value:"Size",children:[e.jsx(y.Control,{children:"Size"}),e.jsx(y.Panel,{children:e.jsx(Na,{variant:"badge",saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("badgePill")&&!eo&&e.jsxs(y.Item,{value:"Text style",children:[e.jsx(y.Control,{children:"Text style"}),e.jsx(y.Panel,{children:e.jsx(Fa,{variant:"badge",saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("badgePill")&&e.jsxs(y.Item,{value:"Corners",children:[e.jsx(y.Control,{children:"Corners"}),e.jsx(y.Panel,{children:e.jsx(Rn,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("badgePill")&&e.jsxs(y.Item,{value:"Shadow",children:[e.jsx(y.Control,{children:"Shadow"}),e.jsx(y.Panel,{children:e.jsx(gp,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("bulletList")&&e.jsxs(y.Item,{value:"Bullets",children:[e.jsx(y.Control,{children:"Bullets"}),e.jsx(y.Panel,{children:e.jsx(jp,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("horizontalRule")&&e.jsxs(y.Item,{value:"Line style",children:[e.jsx(y.Control,{children:"Line style"}),e.jsx(y.Panel,{children:e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsx(Mp,{saveNodeData:re,element:M,editor:a}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"11px",color:"#666",fontWeight:600,flexShrink:0,width:"50px"},children:"Weight"}),e.jsx(p,{style:{flex:1},children:e.jsx(Dp,{saveNodeData:re,element:M,editor:a})})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"11px",color:"#666",fontWeight:600,flexShrink:0,width:"50px"},children:"Color"}),e.jsx(p,{style:{flex:1},children:e.jsx(Gp,{saveNodeData:re,element:M,editor:a})})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"11px",color:"#666",fontWeight:600,flexShrink:0,width:"50px"},children:"Width"}),e.jsx(p,{style:{flex:1},children:e.jsx(qp,{saveNodeData:re,element:M,editor:a})})]}),e.jsxs(p,{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(N,{style:{fontSize:"11px",color:"#666",fontWeight:600,flexShrink:0,width:"50px"},children:"Align"}),e.jsx(p,{style:{flex:1},children:e.jsx(Jp,{saveNodeData:re,element:M,editor:a})})]})]})})]}),Se&&ae==="block"&&ve&&oe("horizontalRule")&&e.jsxs(y.Item,{value:"Spacing",children:[e.jsx(y.Control,{children:"Spacing"}),e.jsx(y.Panel,{children:e.jsx(Zp,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("resource")&&e.jsxs(y.Item,{value:"Collapsible Fill",children:[e.jsx(y.Control,{children:"Collapsible Fill"}),e.jsx(y.Panel,{children:e.jsx(px,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("resource")&&e.jsxs(y.Item,{value:"Collapsible Text",children:[e.jsx(y.Control,{children:"Collapsible Text"}),e.jsx(y.Panel,{children:e.jsx(bx,{saveNodeData:re,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("details")&&e.jsxs(y.Item,{value:"Toggle icon",children:[e.jsx(y.Control,{children:"Toggle icon"}),e.jsx(y.Panel,{children:e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[e.jsxs(p,{children:[e.jsx(p,{style:{fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},children:"Style"}),e.jsx(vx,{saveNodeData:re,element:M,editor:a})]}),e.jsxs(p,{children:[e.jsx(p,{style:{fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},children:"Side"}),e.jsx(kx,{saveNodeData:re,element:M,editor:a})]}),e.jsxs(p,{children:[e.jsx(p,{style:{fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},children:"Color"}),e.jsx(wt,{element:M,saveNodeData:re,editor:a,attrName:"iconColor",swatchType:"dark",fallbackColor:"token:text",clearLabel:"Theme default",clearValue:"token:text",resolveHexLabel:!0})]})]})})]}),Se&&ae==="block"&&ve&&oe("details")&&e.jsxs(y.Item,{value:"Toggle rows",children:[e.jsx(y.Control,{children:"Toggle rows"}),e.jsx(y.Panel,{children:e.jsxs(p,{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[e.jsxs(p,{children:[e.jsx(p,{style:{fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},children:"Divider"}),e.jsx(Cx,{saveNodeData:re,element:M,editor:a})]}),e.jsxs(p,{children:[e.jsx(p,{style:{fontSize:"9px",fontWeight:700,color:"#999",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:8},children:"Default state"}),e.jsx(Tx,{saveNodeData:re,element:M,editor:a})]})]})})]}),Se&&ae==="block"&&ve&&oe("details")&&e.jsxs(y.Item,{value:"Title font",children:[e.jsx(y.Control,{children:"Title font"}),e.jsx(y.Panel,{children:e.jsx(Dx,{saveNodeData:Hn,element:M,editor:a})})]}),Se&&ae==="block"&&ve&&oe("navbar")&&e.jsxs(y.Item,{value:"Nav Bar",children:[e.jsx(y.Control,{children:"Nav Bar"}),e.jsx(y.Panel,{children:e.jsx(Gx,{element:M,saveNodeData:re,onConfigLoaded:pt})})]}),Se&&ae==="block"&&ve&&oe("navbar")&&_t&&e.jsxs(y.Item,{value:"Links",children:[e.jsx(y.Control,{children:"Links"}),e.jsx(y.Panel,{children:e.jsx(Yx,{element:M,saveNodeData:re,navbarConfig:_t,onConfigUpdated:pt})})]}),Se&&ae==="block"&&ve&&oe("navbar")&&_t&&e.jsxs(y.Item,{value:"Logo and title",children:[e.jsx(y.Control,{children:"Logo and title"}),e.jsx(y.Panel,{children:e.jsx(dg,{element:M,saveNodeData:re,navbarConfig:_t,onConfigUpdated:pt})})]}),Se&&ae==="block"&&ve&&oe("navbar")&&_t&&e.jsxs(y.Item,{value:"Layout",children:[e.jsx(y.Control,{children:"Layout"}),e.jsx(y.Panel,{children:e.jsx(rg,{element:M,saveNodeData:re,navbarConfig:_t,onConfigUpdated:pt})})]}),Se&&ae==="block"&&ve&&oe("navbar")&&_t&&e.jsxs(y.Item,{value:"Style",children:[e.jsx(y.Control,{children:"Style"}),e.jsx(y.Panel,{children:e.jsx(sg,{element:M,saveNodeData:re,navbarConfig:_t,onConfigUpdated:pt})})]}),Se&&ae==="block"&&ve&&oe("navbar")&&((la=_t==null?void 0:_t.style)==null?void 0:la.linkSource)==="sidebar"&&e.jsxs(y.Item,{value:"Dropdown menu",children:[e.jsx(y.Control,{children:"Dropdown menu"}),e.jsx(y.Panel,{children:e.jsx(mg,{element:M,saveNodeData:re,navbarConfig:_t,onConfigUpdated:pt})})]}),ms&&(Dn==null?void 0:Dn.node)&&e.jsxs(y.Item,{value:"Share Block",children:[e.jsx(y.Control,{children:"Share Block"}),e.jsx(y.Panel,{children:e.jsx(bg,{element:Dn,saveNodeData:re,editor:a,onConfigLoaded:J})})]}),!bs&&_1({activeTab:ae,node:M,grid:U,column:de,outerGrid:ce,hasNode:ve,isNodeType:oe,isGridType:kt,t:n,onSaveNodeData:re,saveNodeData:Hn,saveIconTextNodeData:js,editorId:(ua=(ca=(aa=a==null?void 0:a.options)==null?void 0:aa.editorProps)==null?void 0:ca.attributes)==null?void 0:ua.editorId,editor:a,editorContext:(ha=(fa=(da=a==null?void 0:a.options)==null?void 0:da.editorProps)==null?void 0:fa.attributes)==null?void 0:ha.editorContext,bgType:Ie,columnBgType:Re,gridBgType:Oe,setBgType:Ke,setColumnBgType:xe,setGridBgType:Ce,mode:"breadcrumb",selectedScope:E,selectionContext:S,breadcrumbBgTypeMap:F,setBreadcrumbBgType:T,TypographySection:()=>Rc({node:M,hasNode:ve,isNodeType:oe,t:n,saveNodeData:Hn,editor:a})}),ys&&e.jsxs(p,{style:{padding:"14px 20px 12px",borderBottom:"1px solid #eeeeee"},children:[e.jsx(N,{style:{fontSize:"14.5px",fontWeight:650,color:"#1f1f27",marginBottom:10},children:"Animation"}),e.jsx(xm,{editor:a,element:Ht})]}),vs&&(Ht==null?void 0:Ht.node)&&e.jsxs(y.Item,{value:"On click action",children:[e.jsx(y.Control,{children:"On click action"}),e.jsx(y.Panel,{children:e.jsx(Pa,{saveNodeData:re,element:Ht,editor:a,buttonType:"action",navigationOnly:!0})})]}),E1({t:n,onReset:Ss,label:E?`Reset ${E.label}`:ae==="box"?"Reset Box":ae==="column"?"Reset Column":ae==="grid"?"Reset Grid":n("tiptap.components.sideConfigurationsMenu.resetBlock")}),Io.canUseAdminAI&&R1({userIsAdmin:h,node:M,hasNode:ve,onSaveNodeData:re}),Se&&ae==="block"&&ve&&vn&&(oe("video")||oe("embed"))&&xs&&e.jsxs(y.Item,{value:"Transcripts",children:[e.jsx(y.Control,{children:"Transcripts"}),e.jsx(y.Panel,{children:e.jsx(Kx,{element:M,transcription:Je})})]})]})]})]})]})]}):null;return O?e.jsx(p,{style:{width:340,display:K?"flex":"none",flexDirection:"column",borderRight:"1px solid #e0e0e0",height:"100%",overflow:"hidden",background:"#fff",gridRow:"1 / 2",gridColumn:"1 / 2",zIndex:1},children:Pt}):e.jsx(tf,{position:"left",opened:K,onClose:()=>Y(!1),withCloseButton:!1,size:"340px",withOverlay:!1,lockScroll:!1,closeOnClickOutside:!1,overlayProps:{backgroundOpacity:.1},zIndex:99999,padding:0,styles:{inner:{top:D,bottom:0,height:ne},header:{display:"none"},content:{height:ne,maxHeight:ne,display:"flex",flexDirection:"column",overflow:"hidden"},body:{flex:1,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden"}},children:Pt})},vv=ke.memo(D1);export{vv as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.