lf-pagebuilder-vue 0.0.111 → 0.0.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -117,7 +117,7 @@ img.ProseMirror-separator {
117
117
  1. Must only contain digits, lowercase ASCII letters or "-"
118
118
  2. Cannot start or end with "-"
119
119
  3. "-" cannot repeat`);O2.customSchemes.push([o,e])}function $S(){O2.scanner=CS(O2.customSchemes);for(let o=0;o<O2.tokenQueue.length;o++)O2.tokenQueue[o][1]({scanner:O2.scanner});O2.parser=wS(O2.scanner.tokens);for(let o=0;o<O2.pluginQueue.length;o++)O2.pluginQueue[o][1]({scanner:O2.scanner,parser:O2.parser});return O2.initialized=!0,O2}function mc(o){return O2.initialized||$S(),xS(O2.parser.start,o,Td(O2.scanner.start,o))}mc.scan=Td;function Zd(o,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const n=new pc(t),r=mc(o),i=[];for(let a=0;a<r.length;a++){const l=r[a];l.isLink&&(!e||l.t===e)&&n.check(l)&&i.push(l.toFormattedObject(n))}return i}const hc="[\0-   ᠎ -\u2029  ]",MS=new RegExp(hc),QS=new RegExp(`${hc}$`),PS=new RegExp(hc,"g");function LS(o){return o.length===1?o[0].isLink:o.length===3&&o[1].isLink?["()","[]"].includes(o[0].value+o[2].value):!1}function TS(o){return new R2({key:new G2("autolink"),appendTransaction:(e,t,n)=>{const r=e.some(s=>s.docChanged)&&!t.doc.eq(n.doc),i=e.some(s=>s.getMeta("preventAutolink"));if(!r||i)return;const{tr:a}=n,l=og(t.doc,[...e]);if(cg(l).forEach(({newRange:s})=>{const c=rg(n.doc,s,h=>h.isTextblock);let d,p;if(c.length>1)d=c[0],p=n.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(c.length){const h=n.doc.textBetween(s.from,s.to," "," ");if(!QS.test(h))return;d=c[0],p=n.doc.textBetween(d.pos,s.to,void 0," ")}if(d&&p){const h=p.split(MS).filter(Boolean);if(h.length<=0)return!1;const u=h[h.length-1],f=d.pos+p.lastIndexOf(u);if(!u)return!1;const g=mc(u).map(b=>b.toObject(o.defaultProtocol));if(!LS(g))return!1;g.filter(b=>b.isLink).map(b=>({...b,from:f+b.start+1,to:f+b.end+1})).filter(b=>n.schema.marks.code?!n.doc.rangeHasMark(b.from,b.to,n.schema.marks.code):!0).filter(b=>o.validate(b.value)).filter(b=>o.shouldAutoLink(b.value)).forEach(b=>{ys(b.from,b.to,n.doc).some(v=>v.mark.type===o.type)||a.addMark(b.from,b.to,o.type.create({href:b.href}))})}}),!!a.steps.length)return a}})}function ES(o){return new R2({key:new G2("handleClickLink"),props:{handleClick:(e,t,n)=>{var r,i;if(n.button!==0||!e.editable)return!1;let a=n.target;const l=[];for(;a.nodeName!=="DIV";)l.push(a),a=a.parentNode;if(!l.find(h=>h.nodeName==="A"))return!1;const s=L7(e.state,o.type.name),c=n.target,d=(r=c==null?void 0:c.href)!==null&&r!==void 0?r:s.href,p=(i=c==null?void 0:c.target)!==null&&i!==void 0?i:s.target;return c&&d?(window.open(d,p),!0):!1}}})}function ZS(o){return new R2({key:new G2("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:r}=e,{selection:i}=r,{empty:a}=i;if(a)return!1;let l="";n.content.forEach(c=>{l+=c.textContent});const s=Zd(l,{defaultProtocol:o.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!s?!1:o.editor.commands.setMark(o.type,{href:s.href})}}})}function f0(o,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const r=typeof n=="string"?n:n.scheme;r&&t.push(r)}),!o||o.replace(PS,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const AS=Ne.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(o=>{if(typeof o=="string"){k6(o);return}k6(o.scheme,o.optionalSlashes)})},onDestroy(){SS()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(o,e)=>!!f0(o,e.protocols),validate:o=>!!o,shouldAutoLink:o=>!!o}},addAttributes(){return{href:{default:null,parseHTML(o){return o.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:o=>{const e=o.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!f0(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:o}){return this.options.isAllowedUri(o.href,{defaultValidate:e=>!!f0(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",v2(this.options.HTMLAttributes,o),0]:["a",v2(this.options.HTMLAttributes,{...o,href:""}),0]},addCommands(){return{setLink:o=>({chain:e})=>{const{href:t}=o;return this.options.isAllowedUri(t,{defaultValidate:n=>!!f0(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,o).setMeta("preventAutolink",!0).run():!1},toggleLink:o=>({chain:e})=>{const{href:t}=o;return this.options.isAllowedUri(t,{defaultValidate:n=>!!f0(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,o,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:o})=>o().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[o0({find:o=>{const e=[];if(o){const{protocols:t,defaultProtocol:n}=this.options,r=Zd(o).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:a=>!!f0(a,t),protocols:t,defaultProtocol:n}));r.length&&r.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:o=>{var e;return{href:(e=o.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const o=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&o.push(TS({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:r=>!!f0(r,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&o.push(ES({type:this.type})),this.options.linkOnPaste&&o.push(ZS({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),o}}),VS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,NS=N2.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:o}){return["img",v2(this.options.HTMLAttributes,o)]},addCommands(){return{setImage:o=>({commands:e})=>e.insertContent({type:this.name,attrs:o})}},addInputRules(){return[T7({find:VS,type:this.type,getAttributes:o=>{const[,,e,t,n]=o;return{src:t,alt:e,title:n}}})]}}),RS=V2.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new R2({key:new G2("placeholder"),props:{decorations:({doc:o,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,r=[];if(!t)return null;const i=this.editor.isEmpty;return o.descendants((a,l)=>{const s=n>=l&&n<=l+a.nodeSize,c=!a.isLeaf&&ni(a);if((s||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);const p=Ie.node(l,l+a.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:s}):this.options.placeholder});r.push(p)}return this.options.includeChildren}),k2.create(o,r)}}})]}}),BS=V2.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:o=>{const e=o.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:o=>o.textAlign?{style:`text-align: ${o.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:o=>({commands:e})=>this.options.alignments.includes(o)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:o})).every(t=>t):!1,unsetTextAlign:()=>({commands:o})=>this.options.types.map(e=>o.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:o=>({editor:e,commands:t})=>this.options.alignments.includes(o)?e.isActive({textAlign:o})?t.unsetTextAlign():t.setTextAlign(o):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),zS=o=>{if(!o.children.length)return;const e=o.querySelectorAll("span");e&&e.forEach(t=>{var n,r;const i=t.getAttribute("style"),a=(r=(n=t.parentElement)===null||n===void 0?void 0:n.closest("span"))===null||r===void 0?void 0:r.getAttribute("style");t.setAttribute("style",`${a};${i}`)})},DS=Ne.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:o=>o.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&zS(o),{}):!1}]},renderHTML({HTMLAttributes:o}){return["span",v2(this.options.HTMLAttributes,o),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:o})=>{const{selection:e}=o;return o.doc.nodesBetween(e.from,e.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(r=>r.type===this.type).some(r=>Object.values(r.attrs).some(i=>!!i))||o.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),jS=V2.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:o=>{var e;return(e=o.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:o=>o.color?{style:`color: ${o.color}`}:{}}}}]},addCommands(){return{setColor:o=>({chain:e})=>e().setMark("textStyle",{color:o}).run(),unsetColor:()=>({chain:o})=>o().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),XS=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,IS=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,HS=Ne.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:o=>o.getAttribute("data-color")||o.style.backgroundColor,renderHTML:o=>o.color?{"data-color":o.color,style:`background-color: ${o.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:o}){return["mark",v2(this.options.HTMLAttributes,o),0]},addCommands(){return{setHighlight:o=>({commands:e})=>e.setMark(this.name,o),toggleHighlight:o=>({commands:e})=>e.toggleMark(this.name,o),unsetHighlight:()=>({commands:o})=>o.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[V0({find:XS,type:this.type})]},addPasteRules(){return[o0({find:IS,type:this.type})]}});let Wl,ql;if(typeof WeakMap<"u"){let o=new WeakMap;Wl=e=>o.get(e),ql=(e,t)=>(o.set(e,t),t)}else{const o=[];let e=0;Wl=t=>{for(let n=0;n<o.length;n+=2)if(o[n]==t)return o[n+1]},ql=(t,n)=>(e==10&&(e=0),o[e++]=t,o[e++]=n)}var M2=class{constructor(o,e,t,n){this.width=o,this.height=e,this.map=t,this.problems=n}findCell(o){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=o)continue;const n=e%this.width,r=e/this.width|0;let i=n+1,a=r+1;for(let l=1;i<this.width&&this.map[e+l]==t;l++)i++;for(let l=1;a<this.height&&this.map[e+this.width*l]==t;l++)a++;return{left:n,top:r,right:i,bottom:a}}throw new RangeError(`No cell with offset ${o} found`)}colCount(o){for(let e=0;e<this.map.length;e++)if(this.map[e]==o)return e%this.width;throw new RangeError(`No cell with offset ${o} found`)}nextCell(o,e,t){const{left:n,right:r,top:i,bottom:a}=this.findCell(o);return e=="horiz"?(t<0?n==0:r==this.width)?null:this.map[i*this.width+(t<0?n-1:r)]:(t<0?i==0:a==this.height)?null:this.map[n+this.width*(t<0?i-1:a)]}rectBetween(o,e){const{left:t,right:n,top:r,bottom:i}=this.findCell(o),{left:a,right:l,top:s,bottom:c}=this.findCell(e);return{left:Math.min(t,a),top:Math.min(r,s),right:Math.max(n,l),bottom:Math.max(i,c)}}cellsInRect(o){const e=[],t={};for(let n=o.top;n<o.bottom;n++)for(let r=o.left;r<o.right;r++){const i=n*this.width+r,a=this.map[i];t[a]||(t[a]=!0,!(r==o.left&&r&&this.map[i-1]==a||n==o.top&&n&&this.map[i-this.width]==a)&&e.push(a))}return e}positionAt(o,e,t){for(let n=0,r=0;;n++){const i=r+t.child(n).nodeSize;if(n==o){let a=e+o*this.width;const l=(o+1)*this.width;for(;a<l&&this.map[a]<r;)a++;return a==l?i-1:this.map[a]}r=i}}static get(o){return Wl(o)||ql(o,WS(o))}};function WS(o){if(o.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+o.type.name);const e=qS(o),t=o.childCount,n=[];let r=0,i=null;const a=[];for(let c=0,d=e*t;c<d;c++)n[c]=0;for(let c=0,d=0;c<t;c++){const p=o.child(c);d++;for(let f=0;;f++){for(;r<n.length&&n[r]!=0;)r++;if(f==p.childCount)break;const g=p.child(f),{colspan:b,rowspan:v,colwidth:w}=g.attrs;for(let O=0;O<v;O++){if(O+c>=t){(i||(i=[])).push({type:"overlong_rowspan",pos:d,n:v-O});break}const C=r+O*e;for(let x=0;x<b;x++){n[C+x]==0?n[C+x]=d:(i||(i=[])).push({type:"collision",row:c,pos:d,n:b-x});const y=w&&w[x];if(y){const k=(C+x)%e*2,$=a[k];$==null||$!=y&&a[k+1]==1?(a[k]=y,a[k+1]=1):$==y&&a[k+1]++}}}r+=b,d+=g.nodeSize}const h=(c+1)*e;let u=0;for(;r<h;)n[r++]==0&&u++;u&&(i||(i=[])).push({type:"missing",row:c,n:u}),d++}(e===0||t===0)&&(i||(i=[])).push({type:"zero_sized"});const l=new M2(e,t,n,i);let s=!1;for(let c=0;!s&&c<a.length;c+=2)a[c]!=null&&a[c+1]<t&&(s=!0);return s&&YS(l,a,o),l}function qS(o){let e=-1,t=!1;for(let n=0;n<o.childCount;n++){const r=o.child(n);let i=0;if(t)for(let a=0;a<n;a++){const l=o.child(a);for(let s=0;s<l.childCount;s++){const c=l.child(s);a+c.attrs.rowspan>n&&(i+=c.attrs.colspan)}}for(let a=0;a<r.childCount;a++){const l=r.child(a);i+=l.attrs.colspan,l.attrs.rowspan>1&&(t=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function YS(o,e,t){o.problems||(o.problems=[]);const n={};for(let r=0;r<o.map.length;r++){const i=o.map[r];if(n[i])continue;n[i]=!0;const a=t.nodeAt(i);if(!a)throw new RangeError(`No cell with offset ${i} found`);let l=null;const s=a.attrs;for(let c=0;c<s.colspan;c++){const d=e[(r+c)%o.width*2];d!=null&&(!s.colwidth||s.colwidth[c]!=d)&&((l||(l=FS(s)))[c]=d)}l&&o.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}function FS(o){if(o.colwidth)return o.colwidth.slice();const e=[];for(let t=0;t<o.colspan;t++)e.push(0);return e}function oe(o){let e=o.cached.tableNodeTypes;if(!e){e=o.cached.tableNodeTypes={};for(const t in o.nodes){const n=o.nodes[t],r=n.spec.tableRole;r&&(e[r]=n)}}return e}const Yt=new G2("selectingCells");function z0(o){for(let e=o.depth-1;e>0;e--)if(o.node(e).type.spec.tableRole=="row")return o.node(0).resolve(o.before(e+1));return null}function GS(o){for(let e=o.depth;e>0;e--){const t=o.node(e).type.spec.tableRole;if(t==="cell"||t==="header_cell")return o.node(e)}return null}function Ye(o){const e=o.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function xi(o){const e=o.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=z0(e.$head)||_S(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function _S(o){for(let e=o.nodeAfter,t=o.pos;e;e=e.firstChild,t++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return o.doc.resolve(t)}for(let e=o.nodeBefore,t=o.pos;e;e=e.lastChild,t--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return o.doc.resolve(t-e.nodeSize)}}function Yl(o){return o.parent.type.spec.tableRole=="row"&&!!o.nodeAfter}function US(o){return o.node(0).resolve(o.pos+o.nodeAfter.nodeSize)}function uc(o,e){return o.depth==e.depth&&o.pos>=e.start(-1)&&o.pos<=e.end(-1)}function Ad(o,e,t){const n=o.node(-1),r=M2.get(n),i=o.start(-1),a=r.nextCell(o.pos-i,e,t);return a==null?null:o.node(0).resolve(i+a)}function D0(o,e,t=1){const n={...o,colspan:o.colspan-t};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,t),n.colwidth.some(r=>r>0)||(n.colwidth=null)),n}function Vd(o,e,t=1){const n={...o,colspan:o.colspan+t};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let r=0;r<t;r++)n.colwidth.splice(e,0,0)}return n}function KS(o,e,t){const n=oe(e.type.schema).header_cell;for(let r=0;r<o.height;r++)if(e.nodeAt(o.map[t+r*o.width]).type!=n)return!1;return!0}var C2=class Ct extends J{constructor(e,t=e){const n=e.node(-1),r=M2.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),l=e.node(0),s=r.cellsInRect(a).filter(d=>d!=t.pos-i);s.unshift(t.pos-i);const c=s.map(d=>{const p=n.nodeAt(d);if(!p)throw new RangeError(`No cell with offset ${d} found`);const h=i+d+1;return new v9(l.resolve(h),l.resolve(h+p.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(e,t){const n=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(Yl(n)&&Yl(r)&&uc(n,r)){const i=this.$anchorCell.node(-1)!=n.node(-1);return i&&this.isRowSelection()?Ct.rowSelection(n,r):i&&this.isColSelection()?Ct.colSelection(n,r):new Ct(n,r)}return G.between(n,r)}content(){const e=this.$anchorCell.node(-1),t=M2.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let s=r.top;s<r.bottom;s++){const c=[];for(let d=s*t.width+r.left,p=r.left;p<r.right;p++,d++){const h=t.map[d];if(i[h])continue;i[h]=!0;const u=t.findCell(h);let f=e.nodeAt(h);if(!f)throw new RangeError(`No cell with offset ${h} found`);const g=r.left-u.left,b=u.right-r.right;if(g>0||b>0){let v=f.attrs;if(g>0&&(v=D0(v,0,g)),b>0&&(v=D0(v,v.colspan-b,b)),u.left<r.left){if(f=f.type.createAndFill(v),!f)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(v)}`)}else f=f.type.create(v,f.content)}if(u.top<r.top||u.bottom>r.bottom){const v={...f.attrs,rowspan:Math.min(u.bottom,r.bottom)-Math.max(u.top,r.top)};u.top<r.top?f=f.type.createAndFill(v):f=f.type.create(v,f.content)}c.push(f)}a.push(e.child(s).copy(Q.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new V(Q.from(l),1,1)}replace(e,t=V.empty){const n=e.steps.length,r=this.ranges;for(let a=0;a<r.length;a++){const{$from:l,$to:s}=r[a],c=e.mapping.slice(n);e.replace(c.map(l.pos),c.map(s.pos),a?V.empty:t)}const i=J.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new V(Q.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=M2.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let a=0;a<i.length;a++)e(t.nodeAt(i[a]),r+i[a])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const n=e.node(-1),r=M2.get(n),i=e.start(-1),a=r.findCell(e.pos-i),l=r.findCell(t.pos-i),s=e.node(0);return a.top<=l.top?(a.top>0&&(e=s.resolve(i+r.map[a.left])),l.bottom<r.height&&(t=s.resolve(i+r.map[r.width*(r.height-1)+l.right-1]))):(l.top>0&&(t=s.resolve(i+r.map[l.left])),a.bottom<r.height&&(e=s.resolve(i+r.map[r.width*(r.height-1)+a.right-1]))),new Ct(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=M2.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;const a=r+this.$anchorCell.nodeAfter.attrs.colspan,l=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,l)==t.width}eq(e){return e instanceof Ct&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const n=e.node(-1),r=M2.get(n),i=e.start(-1),a=r.findCell(e.pos-i),l=r.findCell(t.pos-i),s=e.node(0);return a.left<=l.left?(a.left>0&&(e=s.resolve(i+r.map[a.top*r.width])),l.right<r.width&&(t=s.resolve(i+r.map[r.width*(l.top+1)-1]))):(l.left>0&&(t=s.resolve(i+r.map[l.top*r.width])),a.right<r.width&&(e=s.resolve(i+r.map[r.width*(a.top+1)-1]))),new Ct(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new Ct(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new Ct(e.resolve(t),e.resolve(n))}getBookmark(){return new JS(this.$anchorCell.pos,this.$headCell.pos)}};C2.prototype.visible=!1;J.jsonID("cell",C2);var JS=class Nd{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Nd(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&uc(t,n)?new C2(t,n):J.near(n,1)}};function e$(o){if(!(o.selection instanceof C2))return null;const e=[];return o.selection.forEachCell((t,n)=>{e.push(Ie.node(n,n+t.nodeSize,{class:"selectedCell"}))}),k2.create(o.doc,e)}function t$({$from:o,$to:e}){if(o.pos==e.pos||o.pos<e.pos-6)return!1;let t=o.pos,n=e.pos,r=o.depth;for(;r>=0&&!(o.after(r+1)<o.end(r));r--,t++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,n--);return t==n&&/row|table/.test(o.node(r).type.spec.tableRole)}function o$({$from:o,$to:e}){let t,n;for(let r=o.depth;r>0;r--){const i=o.node(r);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){t=i;break}}for(let r=e.depth;r>0;r--){const i=e.node(r);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}return t!==n&&e.parentOffset===0}function n$(o,e,t){const n=(e||o).selection,r=(e||o).doc;let i,a;if(n instanceof F&&(a=n.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")i=C2.create(r,n.from);else if(a=="row"){const l=r.resolve(n.from+1);i=C2.rowSelection(l,l)}else if(!t){const l=M2.get(n.node),s=n.from+1,c=s+l.map[l.width*l.height-1];i=C2.create(r,s+1,c)}}else n instanceof G&&t$(n)?i=G.create(r,n.from):n instanceof G&&o$(n)&&(i=G.create(r,n.$from.start(),n.$from.end()));return i&&(e||(e=o.tr)).setSelection(i),e}const r$=new G2("fix-tables");function Rd(o,e,t,n){const r=o.childCount,i=e.childCount;e:for(let a=0,l=0;a<i;a++){const s=e.child(a);for(let c=l,d=Math.min(r,a+3);c<d;c++)if(o.child(c)==s){l=c+1,t+=s.nodeSize;continue e}n(s,t),l<r&&o.child(l).sameMarkup(s)?Rd(o.child(l),s,t+1,n):s.nodesBetween(0,s.content.size,n,t+1),t+=s.nodeSize}}function Bd(o,e){let t;const n=(r,i)=>{r.type.spec.tableRole=="table"&&(t=i$(o,r,i,t))};return e?e.doc!=o.doc&&Rd(e.doc,o.doc,0,n):o.doc.descendants(n),t}function i$(o,e,t,n){const r=M2.get(e);if(!r.problems)return n;n||(n=o.tr);const i=[];for(let s=0;s<r.height;s++)i.push(0);for(let s=0;s<r.problems.length;s++){const c=r.problems[s];if(c.type=="collision"){const d=e.nodeAt(c.pos);if(!d)continue;const p=d.attrs;for(let h=0;h<p.rowspan;h++)i[c.row+h]+=c.n;n.setNodeMarkup(n.mapping.map(t+1+c.pos),null,D0(p,p.colspan-c.n,c.n))}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const d=e.nodeAt(c.pos);if(!d)continue;n.setNodeMarkup(n.mapping.map(t+1+c.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const d=e.nodeAt(c.pos);if(!d)continue;n.setNodeMarkup(n.mapping.map(t+1+c.pos),null,{...d.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const d=n.mapping.map(t);n.delete(d,d+e.nodeSize)}}let a,l;for(let s=0;s<i.length;s++)i[s]&&(a==null&&(a=s),l=s);for(let s=0,c=t+1;s<r.height;s++){const d=e.child(s),p=c+d.nodeSize,h=i[s];if(h>0){let u="cell";d.firstChild&&(u=d.firstChild.type.spec.tableRole);const f=[];for(let b=0;b<h;b++){const v=oe(o.schema)[u].createAndFill();v&&f.push(v)}const g=(s==0||a==s-1)&&l==s?c+1:p-1;n.insert(n.mapping.map(g),f)}c=p}return n.setMeta(r$,{fixTables:!0})}function mt(o){const e=o.selection,t=xi(o),n=t.node(-1),r=t.start(-1),i=M2.get(n);return{...e instanceof C2?i.rectBetween(e.$anchorCell.pos-r,e.$headCell.pos-r):i.findCell(t.pos-r),tableStart:r,map:i,table:n}}function zd(o,{map:e,tableStart:t,table:n},r){let i=r>0?-1:0;KS(e,n,r+i)&&(i=r==0||r==e.width?null:0);for(let a=0;a<e.height;a++){const l=a*e.width+r;if(r>0&&r<e.width&&e.map[l-1]==e.map[l]){const s=e.map[l],c=n.nodeAt(s);o.setNodeMarkup(o.mapping.map(t+s),null,Vd(c.attrs,r-e.colCount(s))),a+=c.attrs.rowspan-1}else{const s=i==null?oe(n.type.schema).cell:n.nodeAt(e.map[l+i]).type,c=e.positionAt(a,r,n);o.insert(o.mapping.map(t+c),s.createAndFill())}}return o}function a$(o,e){if(!Ye(o))return!1;if(e){const t=mt(o);e(zd(o.tr,t,t.left))}return!0}function l$(o,e){if(!Ye(o))return!1;if(e){const t=mt(o);e(zd(o.tr,t,t.right))}return!0}function s$(o,{map:e,table:t,tableStart:n},r){const i=o.mapping.maps.length;for(let a=0;a<e.height;){const l=a*e.width+r,s=e.map[l],c=t.nodeAt(s),d=c.attrs;if(r>0&&e.map[l-1]==s||r<e.width-1&&e.map[l+1]==s)o.setNodeMarkup(o.mapping.slice(i).map(n+s),null,D0(d,r-e.colCount(s)));else{const p=o.mapping.slice(i).map(n+s);o.delete(p,p+c.nodeSize)}a+=d.rowspan}}function c$(o,e){if(!Ye(o))return!1;if(e){const t=mt(o),n=o.tr;if(t.left==0&&t.right==t.map.width)return!1;for(let r=t.right-1;s$(n,t,r),r!=t.left;r--){const i=t.tableStart?n.doc.nodeAt(t.tableStart-1):n.doc;if(!i)throw new RangeError("No table found");t.table=i,t.map=M2.get(i)}e(n)}return!0}function d$(o,e,t){var n;const r=oe(e.type.schema).header_cell;for(let i=0;i<o.width;i++)if(((n=e.nodeAt(o.map[i+t*o.width]))===null||n===void 0?void 0:n.type)!=r)return!1;return!0}function Dd(o,{map:e,tableStart:t,table:n},r){let i=t;for(let c=0;c<r;c++)i+=n.child(c).nodeSize;const a=[];let l=r>0?-1:0;d$(e,n,r+l)&&(l=r==0||r==e.height?null:0);for(let c=0,d=e.width*r;c<e.width;c++,d++)if(r>0&&r<e.height&&e.map[d]==e.map[d-e.width]){const p=e.map[d],h=n.nodeAt(p).attrs;o.setNodeMarkup(t+p,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var s;const p=l==null?oe(n.type.schema).cell:(s=n.nodeAt(e.map[d+l*e.width]))===null||s===void 0?void 0:s.type,h=p==null?void 0:p.createAndFill();h&&a.push(h)}return o.insert(i,oe(n.type.schema).row.create(null,a)),o}function p$(o,e){if(!Ye(o))return!1;if(e){const t=mt(o);e(Dd(o.tr,t,t.top))}return!0}function m$(o,e){if(!Ye(o))return!1;if(e){const t=mt(o);e(Dd(o.tr,t,t.bottom))}return!0}function h$(o,{map:e,table:t,tableStart:n},r){let i=0;for(let c=0;c<r;c++)i+=t.child(c).nodeSize;const a=i+t.child(r).nodeSize,l=o.mapping.maps.length;o.delete(i+n,a+n);const s=new Set;for(let c=0,d=r*e.width;c<e.width;c++,d++){const p=e.map[d];if(!s.has(p)){if(s.add(p),r>0&&p==e.map[d-e.width]){const h=t.nodeAt(p).attrs;o.setNodeMarkup(o.mapping.slice(l).map(p+n),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(r<e.height&&p==e.map[d+e.width]){const h=t.nodeAt(p),u=h.attrs,f=h.type.create({...u,rowspan:h.attrs.rowspan-1},h.content),g=e.positionAt(r+1,c,t);o.insert(o.mapping.slice(l).map(n+g),f),c+=u.colspan-1}}}}function u$(o,e){if(!Ye(o))return!1;if(e){const t=mt(o),n=o.tr;if(t.top==0&&t.bottom==t.map.height)return!1;for(let r=t.bottom-1;h$(n,t,r),r!=t.top;r--){const i=t.tableStart?n.doc.nodeAt(t.tableStart-1):n.doc;if(!i)throw new RangeError("No table found");t.table=i,t.map=M2.get(t.table)}e(n)}return!0}function S6(o){const e=o.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function f$({width:o,height:e,map:t},n){let r=n.top*o+n.left,i=r,a=(n.bottom-1)*o+n.left,l=r+(n.right-n.left-1);for(let s=n.top;s<n.bottom;s++){if(n.left>0&&t[i]==t[i-1]||n.right<o&&t[l]==t[l+1])return!0;i+=o,l+=o}for(let s=n.left;s<n.right;s++){if(n.top>0&&t[r]==t[r-o]||n.bottom<e&&t[a]==t[a+o])return!0;r++,a++}return!1}function $6(o,e){const t=o.selection;if(!(t instanceof C2)||t.$anchorCell.pos==t.$headCell.pos)return!1;const n=mt(o),{map:r}=n;if(f$(r,n))return!1;if(e){const i=o.tr,a={};let l=Q.empty,s,c;for(let d=n.top;d<n.bottom;d++)for(let p=n.left;p<n.right;p++){const h=r.map[d*r.width+p],u=n.table.nodeAt(h);if(!(a[h]||!u))if(a[h]=!0,s==null)s=h,c=u;else{S6(u)||(l=l.append(u.content));const f=i.mapping.map(h+n.tableStart);i.delete(f,f+u.nodeSize)}}if(s==null||c==null)return!0;if(i.setNodeMarkup(s+n.tableStart,null,{...Vd(c.attrs,c.attrs.colspan,n.right-n.left-c.attrs.colspan),rowspan:n.bottom-n.top}),l.size>0){const d=s+1+c.content.size,p=S6(c)?s+1:d;i.replaceWith(p+n.tableStart,d+n.tableStart,l)}i.setSelection(new C2(i.doc.resolve(s+n.tableStart))),e(i)}return!0}function M6(o,e){const t=oe(o.schema);return g$(({node:n})=>t[n.type.spec.tableRole])(o,e)}function g$(o){return(e,t)=>{const n=e.selection;let r,i;if(n instanceof C2){if(n.$anchorCell.pos!=n.$headCell.pos)return!1;r=n.$anchorCell.nodeAfter,i=n.$anchorCell.pos}else{var a;if(r=GS(n.$from),!r)return!1;i=(a=z0(n.$from))===null||a===void 0?void 0:a.pos}if(r==null||i==null||r.attrs.colspan==1&&r.attrs.rowspan==1)return!1;if(t){let l=r.attrs;const s=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const d=mt(e),p=e.tr;for(let u=0;u<d.right-d.left;u++)s.push(c?{...l,colwidth:c&&c[u]?[c[u]]:null}:l);let h;for(let u=d.top;u<d.bottom;u++){let f=d.map.positionAt(u,d.left,d.table);u==d.top&&(f+=r.nodeSize);for(let g=d.left,b=0;g<d.right;g++,b++)g==d.left&&u==d.top||p.insert(h=p.mapping.map(f+d.tableStart,1),o({node:r,row:u,col:g}).createAndFill(s[b]))}p.setNodeMarkup(i,o({node:r,row:d.top,col:d.left}),s[0]),n instanceof C2&&p.setSelection(new C2(p.doc.resolve(n.$anchorCell.pos),h?p.doc.resolve(h):void 0)),t(p)}return!0}}function b$(o,e){return function(t,n){if(!Ye(t))return!1;const r=xi(t);if(r.nodeAfter.attrs[o]===e)return!1;if(n){const i=t.tr;t.selection instanceof C2?t.selection.forEachCell((a,l)=>{a.attrs[o]!==e&&i.setNodeMarkup(l,null,{...a.attrs,[o]:e})}):i.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[o]:e}),n(i)}return!0}}function C$(o){return function(e,t){if(!Ye(e))return!1;if(t){const n=oe(e.schema),r=mt(e),i=e.tr,a=r.map.cellsInRect(o=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:o=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),l=a.map(s=>r.table.nodeAt(s));for(let s=0;s<a.length;s++)l[s].type==n.header_cell&&i.setNodeMarkup(r.tableStart+a[s],n.cell,l[s].attrs);if(i.steps.length===0)for(let s=0;s<a.length;s++)i.setNodeMarkup(r.tableStart+a[s],n.header_cell,l[s].attrs);t(i)}return!0}}function Q6(o,e,t){const n=e.map.cellsInRect({left:0,top:0,right:o=="row"?e.map.width:1,bottom:o=="column"?e.map.height:1});for(let r=0;r<n.length;r++){const i=e.table.nodeAt(n[r]);if(i&&i.type!==t.header_cell)return!1}return!0}function Ln(o,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?C$(o):function(t,n){if(!Ye(t))return!1;if(n){const r=oe(t.schema),i=mt(t),a=t.tr,l=Q6("row",i,r),s=Q6("column",i,r),c=(o==="column"?l:o==="row"&&s)?1:0,d=o=="column"?{left:0,top:c,right:1,bottom:i.map.height}:o=="row"?{left:c,top:0,right:i.map.width,bottom:1}:i,p=o=="column"?s?r.cell:r.header_cell:o=="row"?l?r.cell:r.header_cell:r.cell;i.map.cellsInRect(d).forEach(h=>{const u=h+i.tableStart,f=a.doc.nodeAt(u);f&&a.setNodeMarkup(u,p,f.attrs)}),n(a)}return!0}}Ln("row",{useDeprecatedLogic:!0});Ln("column",{useDeprecatedLogic:!0});const O$=Ln("cell",{useDeprecatedLogic:!0});function v$(o,e){if(e<0){const t=o.nodeBefore;if(t)return o.pos-t.nodeSize;for(let n=o.index(-1)-1,r=o.before();n>=0;n--){const i=o.node(-1).child(n),a=i.lastChild;if(a)return r-1-a.nodeSize;r-=i.nodeSize}}else{if(o.index()<o.parent.childCount-1)return o.pos+o.nodeAfter.nodeSize;const t=o.node(-1);for(let n=o.indexAfter(-1),r=o.after();n<t.childCount;n++){const i=t.child(n);if(i.childCount)return r+1;r+=i.nodeSize}}return null}function P6(o){return function(e,t){if(!Ye(e))return!1;const n=v$(xi(e),o);if(n==null)return!1;if(t){const r=e.doc.resolve(n);t(e.tr.setSelection(G.between(r,US(r))).scrollIntoView())}return!0}}function w$(o,e){const t=o.selection.$anchor;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="table")return e&&e(o.tr.delete(t.before(n),t.after(n)).scrollIntoView()),!0;return!1}function hr(o,e){const t=o.selection;if(!(t instanceof C2))return!1;if(e){const n=o.tr,r=oe(o.schema).cell.createAndFill().content;t.forEachCell((i,a)=>{i.content.eq(r)||n.replace(n.mapping.map(a+1),n.mapping.map(a+i.nodeSize-1),new V(r,0,0))}),n.docChanged&&e(n)}return!0}function x$(o){if(o.size===0)return null;let{content:e,openStart:t,openEnd:n}=o;for(;e.childCount==1&&(t>0&&n>0||e.child(0).type.spec.tableRole=="table");)t--,n--,e=e.child(0).content;const r=e.child(0),i=r.type.spec.tableRole,a=r.type.schema,l=[];if(i=="row")for(let s=0;s<e.childCount;s++){let c=e.child(s).content;const d=s?0:Math.max(0,t-1),p=s<e.childCount-1?0:Math.max(0,n-1);(d||p)&&(c=Fl(oe(a).row,new V(c,d,p)).content),l.push(c)}else if(i=="cell"||i=="header_cell")l.push(t||n?Fl(oe(a).row,new V(e,t,n)).content:e);else return null;return y$(a,l)}function y$(o,e){const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(let a=i.childCount-1;a>=0;a--){const{rowspan:l,colspan:s}=i.child(a).attrs;for(let c=r;c<r+l;c++)t[c]=(t[c]||0)+s}}let n=0;for(let r=0;r<t.length;r++)n=Math.max(n,t[r]);for(let r=0;r<t.length;r++)if(r>=e.length&&e.push(Q.empty),t[r]<n){const i=oe(o).cell.createAndFill(),a=[];for(let l=t[r];l<n;l++)a.push(i);e[r]=e[r].append(Q.from(a))}return{height:e.length,width:n,rows:e}}function Fl(o,e){const t=o.createAndFill();return new ns(t).replace(0,t.content.size,e).doc}function k$({width:o,height:e,rows:t},n,r){if(o!=n){const i=[],a=[];for(let l=0;l<t.length;l++){const s=t[l],c=[];for(let d=i[l]||0,p=0;d<n;p++){let h=s.child(p%s.childCount);d+h.attrs.colspan>n&&(h=h.type.createChecked(D0(h.attrs,h.attrs.colspan,d+h.attrs.colspan-n),h.content)),c.push(h),d+=h.attrs.colspan;for(let u=1;u<h.attrs.rowspan;u++)i[l+u]=(i[l+u]||0)+h.attrs.colspan}a.push(Q.from(c))}t=a,o=n}if(e!=r){const i=[];for(let a=0,l=0;a<r;a++,l++){const s=[],c=t[l%e];for(let d=0;d<c.childCount;d++){let p=c.child(d);a+p.attrs.rowspan>r&&(p=p.type.create({...p.attrs,rowspan:Math.max(1,r-p.attrs.rowspan)},p.content)),s.push(p)}i.push(Q.from(s))}t=i,e=r}return{width:o,height:e,rows:t}}function S$(o,e,t,n,r,i,a){const l=o.doc.type.schema,s=oe(l);let c,d;if(r>e.width)for(let p=0,h=0;p<e.height;p++){const u=t.child(p);h+=u.nodeSize;const f=[];let g;u.lastChild==null||u.lastChild.type==s.cell?g=c||(c=s.cell.createAndFill()):g=d||(d=s.header_cell.createAndFill());for(let b=e.width;b<r;b++)f.push(g);o.insert(o.mapping.slice(a).map(h-1+n),f)}if(i>e.height){const p=[];for(let f=0,g=(e.height-1)*e.width;f<Math.max(e.width,r);f++){const b=f>=e.width?!1:t.nodeAt(e.map[g+f]).type==s.header_cell;p.push(b?d||(d=s.header_cell.createAndFill()):c||(c=s.cell.createAndFill()))}const h=s.row.create(null,Q.from(p)),u=[];for(let f=e.height;f<i;f++)u.push(h);o.insert(o.mapping.slice(a).map(n+t.nodeSize-2),u)}return!!(c||d)}function L6(o,e,t,n,r,i,a,l){if(a==0||a==e.height)return!1;let s=!1;for(let c=r;c<i;c++){const d=a*e.width+c,p=e.map[d];if(e.map[d-e.width]==p){s=!0;const h=t.nodeAt(p),{top:u,left:f}=e.findCell(p);o.setNodeMarkup(o.mapping.slice(l).map(p+n),null,{...h.attrs,rowspan:a-u}),o.insert(o.mapping.slice(l).map(e.positionAt(a,f,t)),h.type.createAndFill({...h.attrs,rowspan:u+h.attrs.rowspan-a})),c+=h.attrs.colspan-1}}return s}function T6(o,e,t,n,r,i,a,l){if(a==0||a==e.width)return!1;let s=!1;for(let c=r;c<i;c++){const d=c*e.width+a,p=e.map[d];if(e.map[d-1]==p){s=!0;const h=t.nodeAt(p),u=e.colCount(p),f=o.mapping.slice(l).map(p+n);o.setNodeMarkup(f,null,D0(h.attrs,a-u,h.attrs.colspan-(a-u))),o.insert(f+h.nodeSize,h.type.createAndFill(D0(h.attrs,0,a-u))),c+=h.attrs.rowspan-1}}return s}function E6(o,e,t,n,r){let i=t?o.doc.nodeAt(t-1):o.doc;if(!i)throw new Error("No table found");let a=M2.get(i);const{top:l,left:s}=n,c=s+r.width,d=l+r.height,p=o.tr;let h=0;function u(){if(i=t?p.doc.nodeAt(t-1):p.doc,!i)throw new Error("No table found");a=M2.get(i),h=p.mapping.maps.length}S$(p,a,i,t,c,d,h)&&u(),L6(p,a,i,t,s,c,l,h)&&u(),L6(p,a,i,t,s,c,d,h)&&u(),T6(p,a,i,t,l,d,s,h)&&u(),T6(p,a,i,t,l,d,c,h)&&u();for(let f=l;f<d;f++){const g=a.positionAt(f,s,i),b=a.positionAt(f,c,i);p.replace(p.mapping.slice(h).map(g+t),p.mapping.slice(h).map(b+t),new V(r.rows[f-l],0,0))}u(),p.setSelection(new C2(p.doc.resolve(t+a.positionAt(l,s,i)),p.doc.resolve(t+a.positionAt(d-1,c-1,i)))),e(p)}const $$=hs({ArrowLeft:ur("horiz",-1),ArrowRight:ur("horiz",1),ArrowUp:ur("vert",-1),ArrowDown:ur("vert",1),"Shift-ArrowLeft":fr("horiz",-1),"Shift-ArrowRight":fr("horiz",1),"Shift-ArrowUp":fr("vert",-1),"Shift-ArrowDown":fr("vert",1),Backspace:hr,"Mod-Backspace":hr,Delete:hr,"Mod-Delete":hr});function Zr(o,e,t){return t.eq(o.selection)?!1:(e&&e(o.tr.setSelection(t).scrollIntoView()),!0)}function ur(o,e){return(t,n,r)=>{if(!r)return!1;const i=t.selection;if(i instanceof C2)return Zr(t,n,J.near(i.$headCell,e));if(o!="horiz"&&!i.empty)return!1;const a=jd(r,o,e);if(a==null)return!1;if(o=="horiz")return Zr(t,n,J.near(t.doc.resolve(i.head+e),e));{const l=t.doc.resolve(a),s=Ad(l,o,e);let c;return s?c=J.near(s,1):e<0?c=J.near(t.doc.resolve(l.before(-1)),-1):c=J.near(t.doc.resolve(l.after(-1)),1),Zr(t,n,c)}}}function fr(o,e){return(t,n,r)=>{if(!r)return!1;const i=t.selection;let a;if(i instanceof C2)a=i;else{const s=jd(r,o,e);if(s==null)return!1;a=new C2(t.doc.resolve(s))}const l=Ad(a.$headCell,o,e);return l?Zr(t,n,new C2(a.$anchorCell,l)):!1}}function M$(o,e){const t=o.state.doc,n=z0(t.resolve(e));return n?(o.dispatch(o.state.tr.setSelection(new C2(n))),!0):!1}function Q$(o,e,t){if(!Ye(o.state))return!1;let n=x$(t);const r=o.state.selection;if(r instanceof C2){n||(n={width:1,height:1,rows:[Q.from(Fl(oe(o.state.schema).cell,t))]});const i=r.$anchorCell.node(-1),a=r.$anchorCell.start(-1),l=M2.get(i).rectBetween(r.$anchorCell.pos-a,r.$headCell.pos-a);return n=k$(n,l.right-l.left,l.bottom-l.top),E6(o.state,o.dispatch,a,l,n),!0}else if(n){const i=xi(o.state),a=i.start(-1);return E6(o.state,o.dispatch,a,M2.get(i.node(-1)).findCell(i.pos-a),n),!0}else return!1}function P$(o,e){var t;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=Z6(o,e.target);let r;if(e.shiftKey&&o.state.selection instanceof C2)i(o.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(r=z0(o.state.selection.$anchor))!=null&&((t=ka(o,e))===null||t===void 0?void 0:t.pos)!=r.pos)i(r,e),e.preventDefault();else if(!n)return;function i(s,c){let d=ka(o,c);const p=Yt.getState(o.state)==null;if(!d||!uc(s,d))if(p)d=s;else return;const h=new C2(s,d);if(p||!o.state.selection.eq(h)){const u=o.state.tr.setSelection(h);p&&u.setMeta(Yt,s.pos),o.dispatch(u)}}function a(){o.root.removeEventListener("mouseup",a),o.root.removeEventListener("dragstart",a),o.root.removeEventListener("mousemove",l),Yt.getState(o.state)!=null&&o.dispatch(o.state.tr.setMeta(Yt,-1))}function l(s){const c=s,d=Yt.getState(o.state);let p;if(d!=null)p=o.state.doc.resolve(d);else if(Z6(o,c.target)!=n&&(p=ka(o,e),!p))return a();p&&i(p,c)}o.root.addEventListener("mouseup",a),o.root.addEventListener("dragstart",a),o.root.addEventListener("mousemove",l)}function jd(o,e,t){if(!(o.state.selection instanceof G))return null;const{$head:n}=o.state.selection;for(let r=n.depth-1;r>=0;r--){const i=n.node(r);if((t<0?n.index(r):n.indexAfter(r))!=(t<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const a=n.before(r),l=e=="vert"?t>0?"down":"up":t>0?"right":"left";return o.endOfTextblock(l)?a:null}}return null}function Z6(o,e){for(;e&&e!=o.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function ka(o,e){const t=o.posAtCoords({left:e.clientX,top:e.clientY});if(!t)return null;let{inside:n,pos:r}=t;return n>=0&&z0(o.state.doc.resolve(n))||z0(o.state.doc.resolve(r))}var L$=class{constructor(o,e){this.node=o,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Gl(o,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(o){return o.type!=this.node.type?!1:(this.node=o,Gl(o,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(o){return o.type=="attributes"&&(o.target==this.table||this.colgroup.contains(o.target))}};function Gl(o,e,t,n,r,i){let a=0,l=!0,s=e.firstChild;const c=o.firstChild;if(c){for(let p=0,h=0;p<c.childCount;p++){const{colspan:u,colwidth:f}=c.child(p).attrs;for(let g=0;g<u;g++,h++){const b=r==h?i:f&&f[g],v=b?b+"px":"";if(a+=b||n,b||(l=!1),s)s.style.width!=v&&(s.style.width=v),s=s.nextSibling;else{const w=document.createElement("col");w.style.width=v,e.appendChild(w)}}}for(;s;){var d;const p=s.nextSibling;(d=s.parentNode)===null||d===void 0||d.removeChild(s),s=p}l?(t.style.width=a+"px",t.style.minWidth=""):(t.style.width="",t.style.minWidth=a+"px")}}const xe=new G2("tableColumnResizing");function T$({handleWidth:o=5,cellMinWidth:e=25,defaultCellMinWidth:t=100,View:n=L$,lastColumnResizable:r=!0}={}){const i=new R2({key:xe,state:{init(a,l){var s;const c=(s=i.spec)===null||s===void 0||(s=s.props)===null||s===void 0?void 0:s.nodeViews,d=oe(l.schema).table.name;return n&&c&&(c[d]=(p,h)=>new n(p,t,h)),new E$(-1,!1)},apply(a,l){return l.apply(a)}},props:{attributes:a=>{const l=xe.getState(a);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,l)=>{Z$(a,l,o,r)},mouseleave:a=>{A$(a)},mousedown:(a,l)=>{V$(a,l,e,t)}},decorations:a=>{const l=xe.getState(a);if(l&&l.activeHandle>-1)return D$(a,l.activeHandle)},nodeViews:{}}});return i}var E$=class Ar{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,n=e.getMeta(xe);if(n&&n.setHandle!=null)return new Ar(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new Ar(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){let r=e.mapping.map(t.activeHandle,-1);return Yl(e.doc.resolve(r))||(r=-1),new Ar(r,t.dragging)}return t}};function Z$(o,e,t,n){if(!o.editable)return;const r=xe.getState(o.state);if(r&&!r.dragging){const i=R$(e.target);let a=-1;if(i){const{left:l,right:s}=i.getBoundingClientRect();e.clientX-l<=t?a=A6(o,e,"left",t):s-e.clientX<=t&&(a=A6(o,e,"right",t))}if(a!=r.activeHandle){if(!n&&a!==-1){const l=o.state.doc.resolve(a),s=l.node(-1),c=M2.get(s),d=l.start(-1);if(c.colCount(l.pos-d)+l.nodeAfter.attrs.colspan-1==c.width-1)return}Xd(o,a)}}}function A$(o){if(!o.editable)return;const e=xe.getState(o.state);e&&e.activeHandle>-1&&!e.dragging&&Xd(o,-1)}function V$(o,e,t,n){var r;if(!o.editable)return!1;const i=(r=o.dom.ownerDocument.defaultView)!==null&&r!==void 0?r:window,a=xe.getState(o.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const l=o.state.doc.nodeAt(a.activeHandle),s=N$(o,a.activeHandle,l.attrs);o.dispatch(o.state.tr.setMeta(xe,{setDragging:{startX:e.clientX,startWidth:s}}));function c(p){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",d);const h=xe.getState(o.state);h!=null&&h.dragging&&(B$(o,h.activeHandle,V6(h.dragging,p,t)),o.dispatch(o.state.tr.setMeta(xe,{setDragging:null})))}function d(p){if(!p.which)return c(p);const h=xe.getState(o.state);if(h&&h.dragging){const u=V6(h.dragging,p,t);N6(o,h.activeHandle,u,n)}}return N6(o,a.activeHandle,s,n),i.addEventListener("mouseup",c),i.addEventListener("mousemove",d),e.preventDefault(),!0}function N$(o,e,{colspan:t,colwidth:n}){const r=n&&n[n.length-1];if(r)return r;const i=o.domAtPos(e);let a=i.node.childNodes[i.offset].offsetWidth,l=t;if(n)for(let s=0;s<t;s++)n[s]&&(a-=n[s],l--);return a/l}function R$(o){for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.classList&&o.classList.contains("ProseMirror")?null:o.parentNode;return o}function A6(o,e,t,n){const r=t=="right"?-n:n,i=o.posAtCoords({left:e.clientX+r,top:e.clientY});if(!i)return-1;const{pos:a}=i,l=z0(o.state.doc.resolve(a));if(!l)return-1;if(t=="right")return l.pos;const s=M2.get(l.node(-1)),c=l.start(-1),d=s.map.indexOf(l.pos-c);return d%s.width==0?-1:c+s.map[d-1]}function V6(o,e,t){const n=e.clientX-o.startX;return Math.max(t,o.startWidth+n)}function Xd(o,e){o.dispatch(o.state.tr.setMeta(xe,{setHandle:e}))}function B$(o,e,t){const n=o.state.doc.resolve(e),r=n.node(-1),i=M2.get(r),a=n.start(-1),l=i.colCount(n.pos-a)+n.nodeAfter.attrs.colspan-1,s=o.state.tr;for(let c=0;c<i.height;c++){const d=c*i.width+l;if(c&&i.map[d]==i.map[d-i.width])continue;const p=i.map[d],h=r.nodeAt(p).attrs,u=h.colspan==1?0:l-i.colCount(p);if(h.colwidth&&h.colwidth[u]==t)continue;const f=h.colwidth?h.colwidth.slice():z$(h.colspan);f[u]=t,s.setNodeMarkup(a+p,null,{...h,colwidth:f})}s.docChanged&&o.dispatch(s)}function N6(o,e,t,n){const r=o.state.doc.resolve(e),i=r.node(-1),a=r.start(-1),l=M2.get(i).colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1;let s=o.domAtPos(r.start(-1)).node;for(;s&&s.nodeName!="TABLE";)s=s.parentNode;s&&Gl(i,s.firstChild,s,n,l,t)}function z$(o){return Array(o).fill(0)}function D$(o,e){const t=[],n=o.doc.resolve(e),r=n.node(-1);if(!r)return k2.empty;const i=M2.get(r),a=n.start(-1),l=i.colCount(n.pos-a)+n.nodeAfter.attrs.colspan-1;for(let c=0;c<i.height;c++){const d=l+c*i.width;if((l==i.width-1||i.map[d]!=i.map[d+1])&&(c==0||i.map[d]!=i.map[d-i.width])){var s;const p=i.map[d],h=a+p+r.nodeAt(p).nodeSize-1,u=document.createElement("div");u.className="column-resize-handle",!((s=xe.getState(o))===null||s===void 0)&&s.dragging&&t.push(Ie.node(a+p,a+p+r.nodeAt(p).nodeSize,{class:"column-resize-dragging"})),t.push(Ie.widget(h,u))}}return k2.create(o.doc,t)}function j$({allowTableNodeSelection:o=!1}={}){return new R2({key:Yt,state:{init(){return null},apply(e,t){const n=e.getMeta(Yt);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;const{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:e$,handleDOMEvents:{mousedown:P$},createSelectionBetween(e){return Yt.getState(e.state)!=null?e.state.selection:null},handleTripleClick:M$,handleKeyDown:$$,handlePaste:Q$},appendTransaction(e,t,n){return n$(n,Bd(n,t),o)}})}function _l(o,e){return e?["width",`${Math.max(e,o)}px`]:["min-width",`${o}px`]}function R6(o,e,t,n,r,i){var a;let l=0,s=!0,c=e.firstChild;const d=o.firstChild;if(d!==null)for(let p=0,h=0;p<d.childCount;p+=1){const{colspan:u,colwidth:f}=d.child(p).attrs;for(let g=0;g<u;g+=1,h+=1){const b=r===h?i:f&&f[g],v=b?`${b}px`:"";if(l+=b||n,b||(s=!1),c){if(c.style.width!==v){const[w,O]=_l(n,b);c.style.setProperty(w,O)}c=c.nextSibling}else{const w=document.createElement("col"),[O,C]=_l(n,b);w.style.setProperty(O,C),e.appendChild(w)}}}for(;c;){const p=c.nextSibling;(a=c.parentNode)===null||a===void 0||a.removeChild(c),c=p}s?(t.style.width=`${l}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${l}px`)}class X${constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),R6(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,R6(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function I$(o,e,t,n){let r=0,i=!0;const a=[],l=o.firstChild;if(!l)return{};for(let d=0,p=0;d<l.childCount;d+=1){const{colspan:h,colwidth:u}=l.child(d).attrs;for(let f=0;f<h;f+=1,p+=1){const g=t===p?n:u&&u[f];r+=g||e,g||(i=!1);const[b,v]=_l(e,g);a.push(["col",{style:`${b}: ${v}`}])}}const s=i?`${r}px`:"",c=i?"":`${r}px`;return{colgroup:["colgroup",{},...a],tableWidth:s,tableMinWidth:c}}function B6(o,e){return o.createAndFill()}function H$(o){if(o.cached.tableNodeTypes)return o.cached.tableNodeTypes;const e={};return Object.keys(o.nodes).forEach(t=>{const n=o.nodes[t];n.spec.tableRole&&(e[n.spec.tableRole]=n)}),o.cached.tableNodeTypes=e,e}function W$(o,e,t,n,r){const i=H$(o),a=[],l=[];for(let c=0;c<t;c+=1){const d=B6(i.cell);if(d&&l.push(d),n){const p=B6(i.header_cell);p&&a.push(p)}}const s=[];for(let c=0;c<e;c+=1)s.push(i.row.createChecked(null,n&&c===0?a:l));return i.table.createChecked(null,s)}function q$(o){return o instanceof C2}const gr=({editor:o})=>{const{selection:e}=o.state;if(!q$(e))return!1;let t=0;const n=P7(e.ranges[0].$from,r=>r.type.name==="table");return n==null||n.node.descendants(r=>{if(r.type.name==="table")return!1;["tableCell","tableHeader"].includes(r.type.name)&&(t+=1)}),t===e.ranges.length?(o.commands.deleteTable(),!0):!1},Y$=N2.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:X$,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:o,HTMLAttributes:e}){const{colgroup:t,tableWidth:n,tableMinWidth:r}=I$(o,this.options.cellMinWidth),i=["table",v2(this.options.HTMLAttributes,e,{style:n?`width: ${n}`:`min-width: ${r}`}),t,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},i]:i},addCommands(){return{insertTable:({rows:o=3,cols:e=3,withHeaderRow:t=!0}={})=>({tr:n,dispatch:r,editor:i})=>{const a=W$(i.schema,o,e,t);if(r){const l=n.selection.from+1;n.replaceSelectionWith(a).scrollIntoView().setSelection(G.near(n.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:o,dispatch:e})=>a$(o,e),addColumnAfter:()=>({state:o,dispatch:e})=>l$(o,e),deleteColumn:()=>({state:o,dispatch:e})=>c$(o,e),addRowBefore:()=>({state:o,dispatch:e})=>p$(o,e),addRowAfter:()=>({state:o,dispatch:e})=>m$(o,e),deleteRow:()=>({state:o,dispatch:e})=>u$(o,e),deleteTable:()=>({state:o,dispatch:e})=>w$(o,e),mergeCells:()=>({state:o,dispatch:e})=>$6(o,e),splitCell:()=>({state:o,dispatch:e})=>M6(o,e),toggleHeaderColumn:()=>({state:o,dispatch:e})=>Ln("column")(o,e),toggleHeaderRow:()=>({state:o,dispatch:e})=>Ln("row")(o,e),toggleHeaderCell:()=>({state:o,dispatch:e})=>O$(o,e),mergeOrSplit:()=>({state:o,dispatch:e})=>$6(o,e)?!0:M6(o,e),setCellAttribute:(o,e)=>({state:t,dispatch:n})=>b$(o,e)(t,n),goToNextCell:()=>({state:o,dispatch:e})=>P6(1)(o,e),goToPreviousCell:()=>({state:o,dispatch:e})=>P6(-1)(o,e),fixTables:()=>({state:o,dispatch:e})=>(e&&Bd(o),!0),setCellSelection:o=>({tr:e,dispatch:t})=>{if(t){const n=C2.create(e.doc,o.anchorCell,o.headCell);e.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:gr,"Mod-Backspace":gr,Delete:gr,"Mod-Delete":gr}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[T$({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],j$({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(o){const e={name:o.name,options:o.options,storage:o.storage};return{tableRole:o2(I(o,"tableRole",e))}}}),F$=N2.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:o}){return["tr",v2(this.options.HTMLAttributes,o),0]}}),G$=N2.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:o=>{const e=o.getAttribute("colwidth");return e?e.split(",").map(t=>parseInt(t,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:o}){return["td",v2(this.options.HTMLAttributes,o),0]}}),_$=N2.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:o=>{const e=o.getAttribute("colwidth");return e?e.split(",").map(t=>parseInt(t,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:o}){return["th",v2(this.options.HTMLAttributes,o),0]}}),d2={bold:'<svg fill="none" class="lf-svg-icon" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.9814 5C9.9325 5 9 5.90729 9 7.13044V15H16C18.5582 15 20.7143 12.808 20.7143 10C20.7143 7.19205 18.5582 5 16 5H10.9814ZM7 7.13044C7 4.89579 8.7371 3 10.9814 3H16C19.7536 3 22.7143 6.18055 22.7143 10C22.7143 13.8195 19.7536 17 16 17H7V7.13044Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 15H18.2857C22.0393 15 25 18.1806 25 22C25 25.8194 22.0393 29 18.2857 29H10.3529C8.45575 29 7 27.3996 7 25.5294V15ZM9 17V25.5294C9 26.3881 9.65116 27 10.3529 27H18.2857C20.8439 27 23 24.8079 23 22C23 19.1921 20.8439 17 18.2857 17H9Z" fill="currentColor"/></svg>',italic:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><script xmlns="" id="datalayer-checker-script"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.6434 3.00027H12.3333C11.781 3.00027 11.3333 3.44798 11.3333 4.00027C11.3333 4.55255 11.781 5.00027 12.3333 5.00027H18.3155L11.5932 27.0003H5C4.44772 27.0003 4 27.448 4 28.0003C4 28.5525 4.44772 29.0003 5 29.0003H12.3108C12.3261 29.0006 12.3414 29.0006 12.3566 29.0003H19.6667C20.219 29.0003 20.6667 28.5525 20.6667 28.0003C20.6667 27.448 20.219 27.0003 19.6667 27.0003H13.6845L20.4068 5.00027H27C27.5523 5.00027 28 4.55255 28 4.00027C28 3.44798 27.5523 3.00027 27 3.00027H19.6893C19.6739 2.99991 19.6586 2.99991 19.6434 3.00027Z" fill="currentColor"/></svg>',underline:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 28C4 27.4477 4.44772 27 5 27H27C27.5523 27 28 27.4477 28 28C28 28.5523 27.5523 29 27 29H5C4.44772 29 4 28.5523 4 28Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5 3C5.55228 3 6 3.44772 6 4V12.1429C6 17.5746 10.4648 22 16 22C21.5352 22 26 17.5746 26 12.1429V4C26 3.44772 26.4477 3 27 3C27.5523 3 28 3.44772 28 4V12.1429C28 18.7037 22.6151 24 16 24C9.38495 24 4 18.7037 4 12.1429V4C4 3.44772 4.44772 3 5 3Z" fill="currentColor"/></svg>',strikethrough:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.75 28C8.75 27.4477 9.19772 27 9.75 27H22.25C22.8023 27 23.25 27.4477 23.25 28C23.25 28.5523 22.8023 29 22.25 29H9.75C9.19772 29 8.75 28.5523 8.75 28Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M10.9278 3C10.9518 3 10.9759 3 11 3L21.0722 3C22.1891 2.99995 23.1331 2.99991 23.8851 3.10776C24.6891 3.22306 25.4176 3.4788 25.9973 4.09711C26.5684 4.70628 26.7965 5.45642 26.9006 6.28222C27.0001 7.07116 27 8.0665 27 9.26755V10.6C27 11.1523 26.5523 11.6 26 11.6C25.4477 11.6 25 11.1523 25 10.6V9.33334C25 8.04971 24.9981 7.18138 24.9163 6.53233C24.8373 5.90579 24.6994 5.63687 24.5382 5.46501C24.3857 5.30227 24.1588 5.16748 23.6012 5.08751C23.0078 5.00241 22.2086 5 21 5H17V12C17 12.5523 16.5523 13 16 13C15.4477 13 15 12.5523 15 12V5H11C9.79139 5 8.99214 5.00241 8.39878 5.08751C7.84116 5.16748 7.61434 5.30226 7.46178 5.46499C7.30066 5.63685 7.16265 5.90579 7.08368 6.53233C7.00187 7.18138 7 8.04971 7 9.33334V10.6C7 11.1523 6.55229 11.6 6 11.6C5.44772 11.6 5 11.1523 5 10.6L5 9.26756C4.99997 8.06651 4.99994 7.07116 5.09938 6.28222C5.20347 5.45643 5.43159 4.70629 6.0027 4.09712C6.58237 3.4788 7.31092 3.22306 8.11486 3.10776C8.86692 2.99991 9.81094 2.99995 10.9278 3ZM16 19C16.5523 19 17 19.4477 17 20V28C17 28.5523 16.5523 29 16 29C15.4477 29 15 28.5523 15 28V20C15 19.4477 15.4477 19 16 19Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5 16C5 15.4477 5.44772 15 6 15H26C26.5523 15 27 15.4477 27 16C27 16.5523 26.5523 17 26 17H6C5.44772 17 5 16.5523 5 16Z" fill="currentColor"/></svg>',heading:'<svg viewBox="0 0 24 24"><path d="M6 4v16"/><path d="M18 4v16"/><path d="M6 12h12"/></svg>',bulletList:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 16C8 15.4477 8.44772 15 9 15H28C28.5523 15 29 15.4477 29 16C29 16.5523 28.5523 17 28 17H9C8.44772 17 8 16.5523 8 16Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5.0001 15.4477 5.0001 16C5.0001 16.5523 4.55238 17 4.0001 17C3.44782 17 3 16.5523 3 16Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 9C3 8.44772 3.44772 8 4 8C4.55228 8 5.0001 8.44772 5.0001 9C5.0001 9.55228 4.55238 10 4.0001 10C3.44782 10 3 9.55228 3 9Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 9C8 8.44772 8.44772 8 9 8H28C28.5523 8 29 8.44772 29 9C29 9.55228 28.5523 10 28 10H9C8.44772 10 8 9.55228 8 9Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 23C3 22.4477 3.44772 22 4 22C4.55228 22 5.0001 22.4477 5.0001 23C5.0001 23.5523 4.55238 24 4.0001 24C3.44782 24 3 23.5523 3 23Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 23C8 22.4477 8.44772 22 9 22H28C28.5523 22 29 22.4477 29 23C29 23.5523 28.5523 24 28 24H9C8.44772 24 8 23.5523 8 23Z" fill="currentColor"/></svg>',orderedList:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 9a1 1 0 0 1 1-1h16a1 1 0 1 1 0 2H13a1 1 0 0 1-1-1Zm0 7a1 1 0 0 1 1-1h16a1 1 0 1 1 0 2H13a1 1 0 0 1-1-1Zm0 7a1 1 0 0 1 1-1h16a1 1 0 1 1 0 2H13a1 1 0 0 1-1-1Z" fill="currentColor"></path><text x="7" y="7" font-size="10" text-anchor="middle" dominant-baseline="central" fill="currentColor" font-family="system-ui, sans-serif" font-weight="bold">1</text><text x="7" y="15" font-size="10" text-anchor="middle" dominant-baseline="central" fill="currentColor" font-family="system-ui, sans-serif" font-weight="bold">2</text><text x="7" y="23" font-size="10" text-anchor="middle" dominant-baseline="central" fill="currentColor" font-family="system-ui, sans-serif" font-weight="bold">3</text></svg>',link:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M19.0218 3.02184C17.1786 3.19701 15.5136 3.87009 14.0647 5.0257C13.6203 5.38015 12.4056 6.57322 12.2494 6.80868C11.6675 7.6857 12.6077 8.78401 13.5742 8.3563C13.685 8.30725 13.9475 8.07326 14.5001 7.53098C15.499 6.55064 15.9279 6.22727 16.7676 5.82147C19.1359 4.67697 21.9777 4.96341 24.0914 6.55971C24.477 6.8509 25.1777 7.55962 25.4621 7.94599C26.4425 9.27785 26.9111 10.779 26.8554 12.4091C26.8236 13.3385 26.6459 14.1319 26.2779 14.9866C25.8846 15.9002 25.4705 16.472 24.4496 17.5107C23.6469 18.3276 23.579 18.423 23.5467 18.7799C23.4678 19.65 24.4557 20.2317 25.1872 19.7459C25.4171 19.5933 26.6006 18.3854 26.9644 17.9322C29.9113 14.2605 29.6295 9.00337 26.308 5.68432C24.8906 4.26798 23.1397 3.38671 21.1439 3.08509C20.6322 3.00778 19.519 2.97459 19.0218 3.02184ZM7.1387 12.0952C6.88575 12.1548 6.66998 12.33 5.96326 13.0496C5.20886 13.8178 4.95398 14.1205 4.54041 14.7393C2.86973 17.2393 2.53547 20.4142 3.64816 23.2137C4.46045 25.2573 6.00726 26.9611 7.96898 27.9732C9.21426 28.6156 10.4372 28.9377 11.8408 28.993C14.0409 29.0796 16.1953 28.3627 17.9353 26.965C18.3883 26.6011 19.5957 25.4171 19.7483 25.187C20.2339 24.4552 19.6524 23.4669 18.7827 23.5458C18.4259 23.5782 18.3306 23.6461 17.514 24.4492C17.0774 24.8787 16.6088 25.3043 16.4078 25.4539C13.8767 27.3384 10.5047 27.3416 7.95326 25.4621C7.56704 25.1776 6.85862 24.4765 6.56755 24.0908C4.64943 21.5489 4.65839 18.074 6.58965 15.5212C6.69538 15.3814 7.12233 14.9198 7.53842 14.4955C8.41022 13.6065 8.44577 13.5527 8.44363 13.1259C8.44258 12.924 8.42374 12.8132 8.37023 12.6947C8.28056 12.496 8.0509 12.2627 7.84865 12.1647C7.66578 12.0762 7.35046 12.0453 7.1387 12.0952ZM18.5803 12.1018C18.4962 12.1245 18.3586 12.1911 18.2747 12.2498C18.1908 12.3084 16.7988 13.6836 15.1814 15.3056C12.9416 17.552 12.224 18.2913 12.1704 18.4077C11.8084 19.1946 12.4951 20.0735 13.3383 19.9025C13.4484 19.8801 13.6072 19.818 13.6912 19.7644C13.879 19.6447 19.6974 13.8181 19.7948 13.6524C19.8332 13.587 19.8828 13.4402 19.905 13.3262C20.0114 12.78 19.6604 12.2274 19.1273 12.1018C18.897 12.0476 18.7812 12.0476 18.5803 12.1018Z" fill="currentColor"/></svg>',image:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.1005 3.02622C10.2614 3.07765 8.95935 3.21821 7.94664 3.47462C5.57009 4.07638 4.0814 5.5652 3.47969 7.94196C3.09628 9.45648 3 11.073 3 15.996C3 20.9191 3.09628 22.5356 3.47969 24.0501C3.81691 25.3822 4.46823 26.4913 5.34571 27.2279C6.58187 28.2655 8.05491 28.7256 10.7164 28.9055C12.5807 29.0315 19.4194 29.0315 21.2837 28.9055C23.1635 28.7785 24.3846 28.5217 25.3899 28.0421C27.0231 27.2629 28.0642 25.9158 28.5404 23.9654C28.9076 22.4616 28.9998 20.8585 29 15.9806C29.0001 11.137 28.9072 9.529 28.5404 8.02669C27.9456 5.59084 26.4604 4.08409 24.0534 3.47462C23.0048 3.20912 21.8061 3.0835 19.7586 3.02459C18.5906 2.99098 13.321 2.99212 12.1005 3.02622ZM12.1952 4.95413C8.81991 5.06646 7.41271 5.42249 6.42006 6.41525C5.89358 6.94174 5.5679 7.56708 5.34325 8.48276C5.0848 9.53625 4.98307 10.7261 4.9498 13.0844L4.93023 14.4709L5.1584 14.2697C5.64767 13.8384 5.84515 13.6961 6.21956 13.5056C6.69401 13.2641 7.35654 13.0998 7.85573 13.0998C8.6475 13.0998 9.48041 13.3726 10.1172 13.8406C10.2953 13.9714 11.2481 14.9003 13.1349 16.7824C15.345 18.9872 15.9242 19.549 16.0537 19.6136C16.2898 19.7314 16.5956 19.7954 16.8165 19.7735C17.1423 19.741 17.3173 19.6638 17.8068 19.3365C18.5163 18.8622 18.9788 18.6558 19.6287 18.5237C20.6009 18.3262 21.6715 18.4655 22.5622 18.9055C23.0651 19.1539 23.3485 19.3834 25.1039 20.9645C26.4146 22.145 26.8338 22.5063 26.8487 22.4685C26.8764 22.3979 26.9605 21.4833 27.0061 20.7563C27.0613 19.878 27.0606 12.1421 27.0053 11.2357C26.84 8.52648 26.4827 7.31801 25.58 6.41525C24.6878 5.52296 23.5175 5.17085 20.8523 4.99286C20.3792 4.96128 12.9761 4.92815 12.1952 4.95413ZM20.4214 7.83443C19.8841 7.89097 19.2666 8.13601 18.8163 8.47133C18.0828 9.01764 17.6268 9.77867 17.4778 10.7052C17.4268 11.0226 17.4558 11.6507 17.5366 11.9752C17.8407 13.1975 18.7983 14.1552 20.0205 14.4594C20.345 14.5401 20.9731 14.5692 21.2904 14.5181C22.0088 14.4026 22.6145 14.1106 23.114 13.639C24.5038 12.327 24.5399 10.1471 23.1942 8.80125C22.6468 8.25383 21.9482 7.91993 21.1693 7.83351C20.8384 7.79681 20.7782 7.79687 20.4214 7.83443ZM20.498 9.77525C20.1067 9.85169 19.7051 10.1778 19.5153 10.5733C19.4062 10.8006 19.4043 10.8107 19.4043 11.1895C19.4043 11.5652 19.4069 11.5799 19.5096 11.7903C19.5772 11.929 19.6817 12.0729 19.8022 12.1935C19.9228 12.314 20.0667 12.4185 20.2054 12.4862C20.4159 12.5889 20.4302 12.5914 20.8077 12.5914C21.1914 12.5914 21.1963 12.5905 21.4239 12.4778C21.8693 12.2574 22.1654 11.8595 22.2329 11.3911C22.3761 10.3972 21.4985 9.57984 20.498 9.77525ZM7.45072 15.0906C7.1041 15.1735 6.89362 15.3226 5.89 16.1963L4.93442 17.0282L4.95109 18.6612C4.97719 21.2195 5.07343 22.4095 5.34325 23.5093C5.5679 24.425 5.89358 25.0503 6.42006 25.5768C7.32275 26.4796 8.53111 26.837 11.2401 27.0023C12.1556 27.0582 19.8444 27.0582 20.7599 27.0023C22.7192 26.8827 23.7763 26.6802 24.6264 26.2614C25.2896 25.9347 25.8328 25.4143 26.2009 24.7527L26.2746 24.6204L26.1668 24.5234C26.1075 24.4701 25.1892 23.6439 24.1262 22.6875C23.0632 21.731 22.1413 20.9102 22.0775 20.8634C21.8644 20.7074 21.5636 20.5604 21.2837 20.4757C21.0364 20.4008 20.9563 20.3916 20.5443 20.3902C20.1904 20.389 20.0352 20.4016 19.8819 20.444C19.5664 20.5313 19.2192 20.7085 18.8029 20.9945C18.0337 21.523 17.5335 21.6974 16.7702 21.703C16.1864 21.7073 15.6733 21.5956 15.2144 21.3643C14.7661 21.1384 14.6783 21.0567 11.7947 18.1839C9.1832 15.5821 8.94311 15.3512 8.7415 15.2474C8.62113 15.1854 8.43397 15.1138 8.32559 15.0883C8.08211 15.0309 7.69602 15.0319 7.45072 15.0906Z" fill="currentColor"/></svg>',blockquote:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path d="M12.692 12.274c0-.989-.012-1.778-.028-2.4-.019-.731-.528-1.255-1.226-1.285a66.885 66.885 0 0 0-2.823-.053c-1.07 0-1.893.02-2.518.045-.57.024-.991.413-1.057 1.014l-.008.124C5.014 10.369 5 11.215 5 12.3c0 1.006.012 1.806.028 2.435l.01.132c.067.603.485 1.027 1.067 1.095l.128.009.863.017c.32.004.673.007 1.061.009a.992.992 0 0 1 .71.305c.187.194.29.456.286.728-.045 3.042-2.46 4.327-3.613 4.767h-.003c.094.548.285 1.176.639 1.617.001.002.01.014.047.028.039.014.1.026.177.02 3.45-.238 6.258-2.644 6.291-6.447l.001-4.742Zm2 4.75c-.04 5.067-3.862 8.174-8.156 8.47-.633.044-1.397-.152-1.91-.792-.716-.893-.98-2.012-1.085-2.709-.16-1.067.591-1.832 1.297-2.101.757-.289 1.712-.844 2.117-1.87-.282-.005-.54-.01-.773-.016-1.71-.044-3.022-1.34-3.145-3.05l-.009-.166A97.099 97.099 0 0 1 3 12.3c0-1.102.014-1.968.033-2.64.048-1.69 1.277-3.042 2.98-3.113A62.623 62.623 0 0 1 8.616 6.5c1.201 0 2.16.024 2.906.056 1.765.075 3.097 1.48 3.143 3.264.017.642.028 1.45.028 2.454v4.75ZM27 12.274c0-.989-.012-1.778-.028-2.4-.02-.731-.529-1.255-1.226-1.285a66.876 66.876 0 0 0-2.823-.053c-1.07 0-1.893.02-2.519.045-.57.024-.99.413-1.056 1.014l-.008.124c-.018.65-.032 1.496-.032 2.582 0 1.006.012 1.806.028 2.435.019.717.514 1.218 1.205 1.236.513.013 1.147.023 1.924.026a.992.992 0 0 1 .71.305c.187.194.29.456.286.728-.045 3.042-2.46 4.327-3.613 4.767h-.003c.093.547.284 1.176.637 1.617l.048.028c.04.014.1.026.178.02 3.45-.238 6.258-2.643 6.291-6.447L27 12.274Zm1.999 4.75c-.039 5.067-3.861 8.174-8.155 8.47-.594.041-1.302-.129-1.81-.677l-.1-.115c-.716-.893-.98-2.011-1.085-2.709-.16-1.067.591-1.832 1.296-2.1.758-.29 1.711-.845 2.117-1.872a75.264 75.264 0 0 1-.773-.015c-1.764-.046-3.107-1.426-3.153-3.216a96.952 96.952 0 0 1-.028-2.49c0-1.102.013-1.969.032-2.64l.023-.313c.181-1.542 1.36-2.733 2.958-2.8l1.138-.034a76.18 76.18 0 0 1 1.464-.013c1.201 0 2.16.024 2.906.056 1.765.075 3.096 1.48 3.143 3.264.016.642.028 1.45.028 2.454l-.001 4.75Z" fill="currentColor"/></svg>',horizontalRule:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 16C3 15.4477 3.44772 15 4 15H28C28.5523 15 29 15.4477 29 16C29 16.5523 28.5523 17 28 17H4C3.44772 17 3 16.5523 3 16Z" fill="currentColor"/></svg>',undo:'<svg viewBox="0 0 24 24"><path d="M3 7v6h6"/><path d="M21 17a9 9 0 00-9-9 9 9 0 00-6.69 3L3 13"/></svg>',redo:'<svg viewBox="0 0 24 24"><path d="M21 7v6h-6"/><path d="M3 17a9 9 0 019-9 9 9 0 016.69 3L21 13"/></svg>',highlight:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path d="M4 8L8 4L23 19L26 26L19 23Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 29a1 1 0 0 1 1-1h24a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1Z" fill="currentColor"/></svg>',alignLeft:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 8.5C3 7.94772 3.47513 7.5 4.06122 7.5H27.9388C28.5249 7.5 29 7.94772 29 8.5C29 9.05228 28.5249 9.5 27.9388 9.5H4.06122C3.47513 9.5 3 9.05228 3 8.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 13.5C3 12.9477 3.47513 12.5 4.06122 12.5H19.9796C20.5657 12.5 21.0408 12.9477 21.0408 13.5C21.0408 14.0523 20.5657 14.5 19.9796 14.5H4.06122C3.47513 14.5 3 14.0523 3 13.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 18.5C3 17.9477 3.47513 17.5 4.06122 17.5H27.9388C28.5249 17.5 29 17.9477 29 18.5C29 19.0523 28.5249 19.5 27.9388 19.5H4.06122C3.47513 19.5 3 19.0523 3 18.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 23.5C3 22.9477 3.47513 22.5 4.06122 22.5H19.9796C20.5657 22.5 21.0408 22.9477 21.0408 23.5C21.0408 24.0523 20.5657 24.5 19.9796 24.5H4.06122C3.47513 24.5 3 24.0523 3 23.5Z" fill="currentColor"/></svg>',alignCenter:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 8.5C3 7.94772 3.47513 7.5 4.06122 7.5H27.9388C28.5249 7.5 29 7.94772 29 8.5C29 9.05228 28.5249 9.5 27.9388 9.5H4.06122C3.47513 9.5 3 9.05228 3 8.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7.2449 13.5C7.2449 12.9477 7.72002 12.5 8.30612 12.5H24.2245C24.8106 12.5 25.2857 12.9477 25.2857 13.5C25.2857 14.0523 24.8106 14.5 24.2245 14.5H8.30612C7.72002 14.5 7.2449 14.0523 7.2449 13.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 18.5C3 17.9477 3.47513 17.5 4.06122 17.5H27.9388C28.5249 17.5 29 17.9477 29 18.5C29 19.0523 28.5249 19.5 27.9388 19.5H4.06122C3.47513 19.5 3 19.0523 3 18.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7.2449 23.5C7.2449 22.9477 7.72002 22.5 8.30612 22.5H24.2245C24.8106 22.5 25.2857 22.9477 25.2857 23.5C25.2857 24.0523 24.8106 24.5 24.2245 24.5H8.30612C7.72002 24.5 7.2449 24.0523 7.2449 23.5Z" fill="currentColor"/></svg>',alignRight:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M29 8.5C29 7.94772 28.5249 7.5 27.9388 7.5H4.06123C3.47513 7.5 3 7.94772 3 8.5C3 9.05228 3.47513 9.5 4.06123 9.5H27.9388C28.5249 9.5 29 9.05228 29 8.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M29 13.5C29 12.9477 28.5249 12.5 27.9388 12.5H12.0204C11.4343 12.5 10.9592 12.9477 10.9592 13.5C10.9592 14.0523 11.4343 14.5 12.0204 14.5H27.9388C28.5249 14.5 29 14.0523 29 13.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M29 18.5C29 17.9477 28.5249 17.5 27.9388 17.5H4.06123C3.47513 17.5 3 17.9477 3 18.5C3 19.0523 3.47513 19.5 4.06123 19.5H27.9388C28.5249 19.5 29 19.0523 29 18.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M29 23.5C29 22.9477 28.5249 22.5 27.9388 22.5H12.0204C11.4343 22.5 10.9592 22.9477 10.9592 23.5C10.9592 24.0523 11.4343 24.5 12.0204 24.5H27.9388C28.5249 24.5 29 24.0523 29 23.5Z" fill="currentColor"/></svg>',alignJustify:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 8.5C3 7.94772 3.44772 7.5 4 7.5H28C28.5523 7.5 29 7.94772 29 8.5C29 9.05228 28.5523 9.5 28 9.5H4C3.44772 9.5 3 9.05228 3 8.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 13.5C3 12.9477 3.44772 12.5 4 12.5H28C28.5523 12.5 29 12.9477 29 13.5C29 14.0523 28.5523 14.5 28 14.5H4C3.44772 14.5 3 14.0523 3 13.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 18.5C3 17.9477 3.44772 17.5 4 17.5H28C28.5523 17.5 29 17.9477 29 18.5C29 19.0523 28.5523 19.5 28 19.5H4C3.44772 19.5 3 19.0523 3 18.5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 23.5C3 22.9477 3.44772 22.5 4 22.5H28C28.5523 22.5 29 22.9477 29 23.5C29 24.0523 28.5523 24.5 28 24.5H4C3.44772 24.5 3 24.0523 3 23.5Z" fill="currentColor"/></svg>',table:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><rect x="2" y="4" width="8" height="7" rx="1.5" fill="currentColor"/><rect x="12" y="4" width="8" height="7" rx="1.5" fill="currentColor"/><rect x="22" y="4" width="8" height="7" rx="1.5" fill="currentColor"/><rect x="2" y="13" width="8" height="7" rx="1.5" fill="currentColor"/><rect x="12" y="13" width="8" height="7" rx="1.5" fill="currentColor"/><rect x="22" y="13" width="8" height="7" rx="1.5" fill="currentColor"/><rect x="2" y="22" width="8" height="7" rx="1.5" fill="currentColor"/><rect x="12" y="22" width="8" height="7" rx="1.5" fill="currentColor"/><rect x="22" y="22" width="8" height="7" rx="1.5" fill="currentColor"/></svg>',html:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M18.398 5.02411C18.1189 5.093 17.8042 5.3417 17.6907 5.58309C17.6582 5.65225 16.4357 10.2061 14.9741 15.7027C12.4992 25.0099 12.3165 25.7155 12.3166 25.9711C12.3166 26.1886 12.3325 26.2761 12.3929 26.3929C12.5042 26.6082 12.6929 26.8043 12.8889 26.9083C13.0381 26.9875 13.1017 26.9997 13.3669 27C13.6428 27.0003 13.6907 26.9903 13.8549 26.8985C14.0736 26.7763 14.2721 26.5579 14.3463 26.3579C14.4587 26.0549 19.681 6.30938 19.6971 6.12652C19.7276 5.78159 19.5232 5.36688 19.231 5.18073C18.9846 5.0238 18.6524 4.96133 18.398 5.02411ZM9.02654 8.84822C8.9577 8.87302 8.855 8.92294 8.79837 8.95913C8.61447 9.07664 5.49898 11.921 4.83896 12.5739C3.74838 13.6528 3.31904 14.2757 3.06524 15.147C3.01364 15.3241 3.00021 15.4795 3.00001 15.9018C2.99977 16.391 3.00745 16.4582 3.09614 16.7412C3.35334 17.5622 3.81422 18.2201 4.8393 19.2296C5.36851 19.7508 8.54485 22.6539 8.76696 22.8194C9.15211 23.1065 9.80163 23.0311 10.133 22.6609C10.3513 22.417 10.4086 22.2674 10.4091 21.9399C10.4098 21.4219 10.4434 21.4626 8.71182 19.888C5.91734 17.347 5.47512 16.8938 5.20188 16.2915C5.02909 15.9106 5.12522 15.5002 5.50605 14.9926C5.76519 14.6472 6.86318 13.5877 8.50582 12.0979C9.36586 11.3179 10.1334 10.5966 10.2115 10.4949C10.4506 10.1839 10.4905 9.74776 10.3123 9.39292C10.2034 9.17602 9.92927 8.92551 9.72334 8.8547C9.5327 8.78914 9.19905 8.78602 9.02654 8.84822ZM22.2656 8.8548C22.0702 8.92736 21.795 9.18495 21.6905 9.39292C21.5125 9.74742 21.552 10.1807 21.7911 10.4957C21.8693 10.5987 22.637 11.3205 23.497 12.0996C25.1864 13.63 26.2426 14.6519 26.5073 15.0122C26.8861 15.528 26.9739 15.9103 26.801 16.2915C26.5276 16.8941 26.0861 17.3464 23.2855 19.893C21.5522 21.4691 21.5931 21.4197 21.5938 21.9399C21.5942 22.2674 21.6515 22.417 21.8698 22.6609C22.2012 23.0311 22.8507 23.1065 23.2359 22.8194C23.458 22.6539 26.6343 19.7508 27.1635 19.2296C28.1896 18.2192 28.6618 17.5441 28.9086 16.7348C28.9923 16.4603 29.0004 16.3847 29 15.8846C28.9995 15.3766 28.9924 15.314 28.9044 15.0441C28.6236 14.1832 28.2214 13.6154 27.1304 12.5396C26.2788 11.6998 23.3445 9.04418 23.1336 8.92229C22.9869 8.83755 22.9154 8.81991 22.6842 8.81147C22.4977 8.80468 22.363 8.81864 22.2656 8.8548Z" fill="currentColor"/></svg>',clean:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M19.2876 3.03972C18.3659 3.21441 17.518 3.7185 16.3181 4.8051C15.7952 5.27869 5.75787 15.2975 5.06984 16.0326C3.86759 17.3173 3.32729 18.1312 3.09197 19.0122C3.01514 19.2999 3.00219 19.4191 3.00015 19.8578C2.99766 20.3956 3.026 20.5858 3.17537 21.0324C3.36276 21.5928 3.75015 22.2212 4.35078 22.939C5.14848 23.8924 8.02183 26.7637 8.97588 27.5609C9.66704 28.1383 10.3156 28.5428 10.8327 28.7188C10.9452 28.7571 11.2255 28.836 11.4557 28.8942L11.8742 29L20.0415 28.9911L28.2088 28.9823L28.3688 28.9084C28.5694 28.8158 28.8249 28.5634 28.9078 28.3761C29.1774 27.7664 28.831 27.0499 28.1941 26.9001C28.0414 26.8642 26.8231 26.8553 21.9552 26.8549L15.9061 26.8544L20.9963 21.7729C23.796 18.9782 26.3556 16.4081 26.6843 16.0616C27.7206 14.9695 28.1669 14.3931 28.5162 13.6954C28.8334 13.0619 28.9176 12.7216 28.9206 12.0612C28.9231 11.5234 28.8948 11.3332 28.7454 10.8866C28.558 10.3262 28.1706 9.69779 27.57 8.97995C26.7723 8.02658 23.8989 5.15527 22.9449 4.35814C21.8037 3.40466 21.0015 3.0359 19.9978 3.00342C19.6929 2.99355 19.4715 3.00485 19.2876 3.03972ZM19.4867 5.04921C19.0616 5.16558 18.5206 5.52774 17.7604 6.20489C17.5293 6.4107 15.7566 8.15667 13.8211 10.0848L10.302 13.5905L14.3151 17.6022L18.3283 21.6139L21.8206 18.1143C25.3386 14.5888 25.893 14.0125 26.3418 13.4147C27.2436 12.2133 27.1354 11.5092 25.8194 10.0143C25.4348 9.57727 22.3472 6.49183 21.9099 6.10745C21.2353 5.51449 20.717 5.17648 20.2897 5.05091C20.0682 4.98582 19.7211 4.98507 19.4867 5.04921ZM7.60225 16.3085C6.23176 17.707 5.94188 18.0216 5.57903 18.5046C4.67714 19.705 4.78542 20.4099 6.10133 21.9047C6.48599 22.3417 9.57362 25.4272 10.0109 25.8115C10.5187 26.2579 10.9002 26.5337 11.2556 26.7112L11.5763 26.8714L12.0563 26.8609L12.5363 26.8504L12.8088 26.7167C13.3855 26.4338 13.9761 25.924 15.7389 24.1876L16.8973 23.0466L12.8941 19.0434C10.6923 16.8417 8.88052 15.0402 8.86795 15.0402C8.85534 15.0402 8.28578 15.6109 7.60225 16.3085Z" fill="currentColor"/></svg>',h2:'<svg viewBox="0 0 24 24"><text x="0" y="18" font-size="18" font-weight="bold" fill="currentColor" stroke="none" font-family="system-ui, sans-serif">H2</text></svg>',h3:'<svg viewBox="0 0 24 24"><text x="0" y="18" font-size="18" font-weight="bold" fill="currentColor" stroke="none" font-family="system-ui, sans-serif">H3</text></svg>',h4:'<svg viewBox="0 0 24 24"><text x="0" y="18" font-size="18" font-weight="bold" fill="currentColor" stroke="none" font-family="system-ui, sans-serif">H4</text></svg>',fontColor:'<svg viewBox="0 0 24 24"><path d="M9.3 4h5.4L20 17h-2.5l-1.2-3H7.7l-1.2 3H4L9.3 4zM8.5 12h7L12 4.8 8.5 12z" fill="currentColor" stroke="none"/><rect x="3" y="19" width="18" height="3" rx="1" fill="currentColor" stroke="none" class="le-color-bar"/></svg>',highlightColor:'<svg viewBox="0 0 24 24"><path d="M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/><rect x="3" y="20" width="18" height="3" rx="1" fill="#fef08a" stroke="none" class="le-color-bar"/></svg>',maximize:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.1005 3.02622C10.2614 3.07765 8.95935 3.21821 7.94664 3.47462C5.57009 4.07638 4.0814 5.5652 3.47969 7.94196C3.09628 9.45648 3 11.073 3 15.996C3 20.9191 3.09628 22.5356 3.47969 24.0501C3.81691 25.3822 4.46823 26.4913 5.34571 27.2279C6.58187 28.2655 8.05491 28.7256 10.7164 28.9055C12.5807 29.0315 19.4194 29.0315 21.2837 28.9055C23.1635 28.7785 24.3846 28.5217 25.3899 28.0421C27.0231 27.2629 28.0642 25.9158 28.5404 23.9654C28.9076 22.4616 28.9998 20.8585 29 15.9806C29.0001 11.137 28.9072 9.529 28.5404 8.02669C27.9456 5.59084 26.4604 4.08409 24.0534 3.47462C23.0048 3.20912 21.8061 3.0835 19.7586 3.02459C18.5906 2.99098 13.321 2.99212 12.1005 3.02622ZM12.1952 4.95413C8.81991 5.06646 7.41271 5.42249 6.42006 6.41525C5.51735 7.31801 5.16003 8.52648 4.99472 11.2357C4.93886 12.1513 4.93886 19.8408 4.99472 20.7563C5.16003 23.4656 5.51735 24.6741 6.42006 25.5768C7.32275 26.4796 8.53111 26.837 11.2401 27.0023C12.1556 27.0582 19.8444 27.0582 20.7599 27.0023C23.469 26.837 24.6773 26.4796 25.58 25.5768C26.4827 24.6741 26.84 23.4656 27.0053 20.7563C27.0612 19.8408 27.0612 12.1513 27.0053 11.2357C26.84 8.52648 26.4827 7.31801 25.58 6.41525C24.6878 5.52296 23.5175 5.17085 20.8523 4.99286C20.3792 4.96128 12.9761 4.92815 12.1952 4.95413ZM18.1849 9.04339C17.8704 9.11247 17.56 9.40903 17.4762 9.7205C17.4242 9.9134 17.4522 10.2257 17.5359 10.3884C17.6322 10.5754 17.8009 10.7463 17.9872 10.8456C18.1404 10.9272 18.1451 10.9277 18.909 10.9373L19.6767 10.947L18.3513 12.2776C17.6224 13.0094 16.9974 13.6567 16.9625 13.716C16.7563 14.0659 16.8279 14.5727 17.1256 14.8704C17.4313 15.1762 17.9332 15.2405 18.292 15.0199C18.3616 14.9772 19.0103 14.3518 19.7335 13.6303L21.0486 12.3184L21.0583 13.0865C21.0679 13.8508 21.0684 13.8555 21.1501 14.0087C21.3195 14.3268 21.6136 14.5239 21.9467 14.5427C22.196 14.5568 22.3594 14.5144 22.5509 14.3857C22.7672 14.2404 22.9189 14.0067 22.9618 13.7525C22.9858 13.6098 22.9938 12.9594 22.9874 11.6513L22.9781 9.75682L22.8976 9.58736C22.8533 9.49416 22.7632 9.36401 22.6974 9.29814C22.6315 9.23226 22.5014 9.14214 22.4082 9.09787L22.2387 9.01736L20.2978 9.01147C18.8603 9.00713 18.3123 9.01542 18.1849 9.04339ZM13.9483 16.8696C13.862 16.8915 13.7442 16.9416 13.6864 16.9809C13.6288 17.0202 12.9898 17.6422 12.2665 18.363L10.9515 19.6737L10.9418 18.9056C10.9321 18.1413 10.9316 18.1366 10.85 17.9834C10.6806 17.6653 10.3865 17.4682 10.0533 17.4494C9.80402 17.4353 9.64064 17.4777 9.44917 17.6063C9.23289 17.7516 9.08116 17.9854 9.03843 18.2392C9.01455 18.3811 9.00657 19.037 9.01283 20.3404L9.02195 22.2353L9.10245 22.4047C9.20483 22.6203 9.37637 22.7918 9.5919 22.8942L9.76135 22.9747L11.6557 22.984C13.7943 22.9944 13.8691 22.9892 14.1267 22.8097C14.6294 22.4597 14.6998 21.7865 14.2798 21.3468C14.2177 21.2818 14.0976 21.1917 14.0129 21.1465C13.8596 21.0649 13.855 21.0644 13.0908 21.0547L12.3227 21.045L13.6345 19.7299C14.3559 19.0065 14.9812 18.3578 15.024 18.2882C15.0668 18.2187 15.1182 18.0781 15.1383 17.976C15.2722 17.2952 14.6289 16.6971 13.9483 16.8696Z" fill="currentColor"/></svg>',minimize:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.1013 3.02622C10.2621 3.07765 8.95986 3.21821 7.94707 3.47462C5.57031 4.07638 4.0815 5.5652 3.47973 7.94196C3.09628 9.45648 3 11.073 3 15.996C3 20.9191 3.09628 22.5356 3.47973 24.0501C3.81698 25.3822 4.46836 26.4913 5.34592 27.2279C6.58218 28.2655 8.05534 28.7256 10.7171 28.9055C12.5815 29.0315 19.4208 29.0315 21.2852 28.9055C23.1653 28.7785 24.3865 28.5217 25.3919 28.0421C27.0252 27.2629 28.0663 25.9158 28.5426 23.9654C28.9098 22.4616 29.0021 20.8585 29.0023 15.9806C29.0024 11.137 28.9095 9.529 28.5426 8.02669C27.9478 5.59084 26.4625 4.08409 24.0552 3.47462C23.0066 3.20912 21.8077 3.0835 19.7601 3.02459C18.592 2.99098 13.3219 2.99212 12.1013 3.02622ZM12.196 4.95413C8.82041 5.06646 7.41309 5.42249 6.42036 6.41525C5.51757 7.31801 5.16022 8.52648 4.99489 11.2357C4.93903 12.1513 4.93903 19.8408 4.99489 20.7563C5.16022 23.4656 5.51757 24.6741 6.42036 25.5768C7.32312 26.4796 8.53159 26.837 11.2409 27.0023C12.1564 27.0582 19.8459 27.0582 20.7615 27.0023C23.4707 26.837 24.6792 26.4796 25.582 25.5768C26.4847 24.6741 26.8421 23.4656 27.0074 20.7563C27.0633 19.8408 27.0633 12.1513 27.0074 11.2357C26.8421 8.52648 26.4847 7.31801 25.582 6.41525C24.6897 5.52296 23.5193 5.17085 20.8539 4.99286C20.3807 4.96128 12.9769 4.92815 12.196 4.95413ZM21.835 9.03406C21.5561 9.08921 21.4633 9.16913 20.1088 10.52L18.7782 11.847L18.7685 11.0946C18.7593 10.3859 18.7546 10.3333 18.6879 10.1882C18.3464 9.44551 17.2953 9.43232 16.9349 10.1662L16.8485 10.3422V12.3758V14.4093L16.9292 14.5814C17.0318 14.8002 17.197 14.9654 17.4158 15.068L17.5879 15.1487H19.6214C21.6479 15.1487 21.6555 15.1485 21.8009 15.0814C21.8811 15.0443 22.0143 14.9464 22.0968 14.8639C22.5707 14.39 22.4228 13.5916 21.809 13.3093C21.6639 13.2426 21.6113 13.2379 20.9029 13.2287L20.1509 13.219L21.479 11.8884C22.6442 10.721 22.8173 10.5354 22.8907 10.3748C23.0563 10.0125 22.979 9.57809 22.6991 9.29814C22.4836 9.08268 22.1322 8.97527 21.835 9.03406ZM10.3673 16.8605C10.186 16.8969 9.99033 17.0164 9.8572 17.1719C9.44036 17.6589 9.60828 18.4138 10.1933 18.6828C10.3384 18.7495 10.391 18.7542 11.0997 18.7634L11.8521 18.7731L10.5235 20.1036C9.3547 21.2741 9.18475 21.4563 9.11121 21.6176C8.8209 22.2546 9.27404 22.9633 9.97447 22.9679C10.3961 22.9706 10.3865 22.9781 11.8936 21.4738L13.2241 20.1458L13.2338 20.8978C13.243 21.6062 13.2477 21.6588 13.3144 21.8039C13.5967 22.4177 14.3951 22.5656 14.869 22.0917C14.9516 22.0092 15.0494 21.876 15.0865 21.7958C15.1536 21.6504 15.1539 21.6428 15.1539 19.6163V17.5828L15.0731 17.4107C14.9705 17.1919 14.8053 17.0267 14.5865 16.9241L14.4144 16.8433L12.4579 16.8385C11.3818 16.8358 10.441 16.8457 10.3673 16.8605Z" fill="currentColor"/></svg>',fontSize:'<svg viewBox="0 0 24 24"><text x="0" y="15" font-size="20" font-weight="bold" fill="currentColor" stroke="none" font-family="system-ui">A</text><text x="13" y="22" font-size="14" fill="currentColor" stroke="none" font-family="system-ui">A</text></svg>',fontFamily:'<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.4297 3H21.5703C22.8067 2.99996 23.8358 2.99993 24.6523 3.11101C25.5142 3.22826 26.2868 3.48574 26.9058 4.11208C27.5232 4.73679 27.7755 5.51372 27.8906 6.38022C28.0001 7.20406 28 8.24329 28 9.49616V10.887C28 11.4392 27.5523 11.887 27 11.887C26.4477 11.887 26 11.4392 26 10.887V9.56522C26 8.22554 25.9979 7.32021 25.908 6.64366C25.8218 5.99467 25.6713 5.70824 25.4833 5.51795C25.2968 5.32929 25.0185 5.17925 24.3827 5.09275C23.7169 5.00218 22.8249 5 21.5 5H17V28C17 28.5523 16.5523 29 16 29C15.4477 29 15 28.5523 15 28V5H10.5C9.17504 5 8.2831 5.00218 7.6173 5.09275C6.9815 5.17925 6.70317 5.32928 6.51673 5.51794C6.32867 5.70822 6.17821 5.99467 6.09197 6.64365C6.00208 7.32021 6 8.22554 6 9.56522V10.887C6 11.4392 5.55229 11.887 5 11.887C4.44772 11.887 4 11.4392 4 10.887L4 9.49609C3.99996 8.24325 3.99993 7.20405 4.1094 6.38023C4.22453 5.51373 4.47681 4.73679 5.0942 4.11209C5.7132 3.48574 6.48579 3.22826 7.3477 3.11101C8.1642 2.99993 9.19325 2.99996 10.4297 3Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 28C8 27.4477 8.44772 27 9 27H23C23.5523 27 24 27.4477 24 28C24 28.5523 23.5523 29 23 29H9C8.44772 29 8 28.5523 8 28Z" fill="currentColor"/></svg>'},X1={minimal:["bold","italic","|","link"],basic:["bold","italic","underline","|","bulletList","orderedList","|","link"],standard:["h2","h3","h4","|","fontSize","fontFamily","|","bold","italic","underline","strikethrough","|","bulletList","orderedList","|","link","image","blockquote","horizontalRule","|","undo","redo"],full:["h2","h3","h4","|","fontSize","fontFamily","|","bold","italic","underline","strikethrough","highlight","fontColor","|","alignLeft","alignCenter","alignRight","alignJustify","|","bulletList","orderedList","|","link","image","blockquote","horizontalRule","table","|","clean","|","undo","redo"]},an={bold:{icon:d2.bold,title:"Negrita",action:o=>o.chain().focus().toggleBold().run(),isActive:o=>o.isActive("bold")},italic:{icon:d2.italic,title:"Cursiva",action:o=>o.chain().focus().toggleItalic().run(),isActive:o=>o.isActive("italic")},underline:{icon:d2.underline,title:"Subrayado",action:o=>o.chain().focus().toggleUnderline().run(),isActive:o=>o.isActive("underline")},strikethrough:{icon:d2.strikethrough,title:"Tachado",action:o=>o.chain().focus().toggleStrike().run(),isActive:o=>o.isActive("strike")},highlight:{icon:d2.highlightColor,title:"Resaltar",type:"color",colorMode:"highlight"},heading:{icon:d2.heading,title:"Encabezado",type:"dropdown",items:[{label:"Párrafo",action:o=>o.chain().focus().setParagraph().run()},{label:"Título 1",action:o=>o.chain().focus().toggleHeading({level:1}).run()},{label:"Título 2",action:o=>o.chain().focus().toggleHeading({level:2}).run()},{label:"Título 3",action:o=>o.chain().focus().toggleHeading({level:3}).run()},{label:"Título 4",action:o=>o.chain().focus().toggleHeading({level:4}).run()}]},h2:{icon:d2.h2,title:"Título 2",cssClass:"le-btn-heading",action:o=>{const{from:e,to:t}=o.state.selection;if(e!==t){const n=o.state.doc.textBetween(e,t,"","");return o.chain().focus().deleteSelection().insertContent({type:"heading",attrs:{level:2},content:[{type:"text",text:n}]}).run()}return o.chain().focus().toggleHeading({level:2}).run()},isActive:o=>o.isActive("heading",{level:2})},h3:{icon:d2.h3,title:"Título 3",cssClass:"le-btn-heading",action:o=>{const{from:e,to:t}=o.state.selection;if(e!==t){const n=o.state.doc.textBetween(e,t,"","");return o.chain().focus().deleteSelection().insertContent({type:"heading",attrs:{level:3},content:[{type:"text",text:n}]}).run()}return o.chain().focus().toggleHeading({level:3}).run()},isActive:o=>o.isActive("heading",{level:3})},h4:{icon:d2.h4,title:"Título 4",cssClass:"le-btn-heading",action:o=>{const{from:e,to:t}=o.state.selection;if(e!==t){const n=o.state.doc.textBetween(e,t,"","");return o.chain().focus().deleteSelection().insertContent({type:"heading",attrs:{level:4},content:[{type:"text",text:n}]}).run()}return o.chain().focus().toggleHeading({level:4}).run()},isActive:o=>o.isActive("heading",{level:4})},bulletList:{icon:d2.bulletList,title:"Lista",action:o=>o.chain().focus().toggleBulletList().run(),isActive:o=>o.isActive("bulletList")},orderedList:{icon:d2.orderedList,title:"Lista numerada",action:o=>o.chain().focus().toggleOrderedList().run(),isActive:o=>o.isActive("orderedList")},link:{icon:d2.link,title:"Enlace",type:"link",isActive:o=>o.isActive("link")},image:{icon:d2.image,title:"Imagen",action:o=>{const e=prompt("URL de la imagen:");e&&o.chain().focus().setImage({src:e}).run()}},blockquote:{icon:d2.blockquote,title:"Cita",action:o=>o.chain().focus().toggleBlockquote().run(),isActive:o=>o.isActive("blockquote")},horizontalRule:{icon:d2.horizontalRule,title:"Línea horizontal",action:o=>o.chain().focus().setHorizontalRule().run()},alignLeft:{icon:d2.alignLeft,title:"Alinear izquierda",action:o=>o.chain().focus().setTextAlign("left").run(),isActive:o=>o.isActive({textAlign:"left"})},alignCenter:{icon:d2.alignCenter,title:"Centrar",action:o=>o.chain().focus().setTextAlign("center").run(),isActive:o=>o.isActive({textAlign:"center"})},alignRight:{icon:d2.alignRight,title:"Alinear derecha",action:o=>o.chain().focus().setTextAlign("right").run(),isActive:o=>o.isActive({textAlign:"right"})},alignJustify:{icon:d2.alignJustify,title:"Alinear justificado",action:o=>o.chain().focus().setTextAlign("justify").run(),isActive:o=>o.isActive({textAlign:"justify"})},table:{icon:d2.table,title:"Tabla",action:o=>o.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()},fontSize:{icon:d2.fontSize,title:"Tamaño de fuente",type:"dropdown",items:[{label:"8px",action:o=>o.chain().focus().setFontSize("8px").run()},{label:"10px",action:o=>o.chain().focus().setFontSize("10px").run()},{label:"12px",action:o=>o.chain().focus().setFontSize("12px").run()},{label:"14px",action:o=>o.chain().focus().setFontSize("14px").run()},{label:"16px",action:o=>o.chain().focus().setFontSize("16px").run()},{label:"18px",action:o=>o.chain().focus().setFontSize("18px").run()},{label:"20px",action:o=>o.chain().focus().setFontSize("20px").run()},{label:"24px",action:o=>o.chain().focus().setFontSize("24px").run()},{label:"28px",action:o=>o.chain().focus().setFontSize("28px").run()},{label:"32px",action:o=>o.chain().focus().setFontSize("32px").run()},{label:"36px",action:o=>o.chain().focus().setFontSize("36px").run()},{label:"48px",action:o=>o.chain().focus().setFontSize("48px").run()},{label:"Por defecto",action:o=>o.chain().focus().unsetFontSize().run()}]},fontFamily:{icon:d2.fontFamily,title:"Familia de fuente",type:"dropdown",items:[{label:"Arial",style:"font-family: Arial, sans-serif",action:o=>o.chain().focus().setFontFamily("Arial, sans-serif").run()},{label:"Helvetica",style:"font-family: Helvetica, sans-serif",action:o=>o.chain().focus().setFontFamily("Helvetica, sans-serif").run()},{label:"Times New Roman",style:"font-family: Times New Roman, serif",action:o=>o.chain().focus().setFontFamily("Times New Roman, serif").run()},{label:"Georgia",style:"font-family: Georgia, serif",action:o=>o.chain().focus().setFontFamily("Georgia, serif").run()},{label:"Courier New",style:"font-family: Courier New, monospace",action:o=>o.chain().focus().setFontFamily("Courier New, monospace").run()},{label:"Verdana",style:"font-family: Verdana, sans-serif",action:o=>o.chain().focus().setFontFamily("Verdana, sans-serif").run()},{label:"Trebuchet MS",style:"font-family: Trebuchet MS, sans-serif",action:o=>o.chain().focus().setFontFamily("Trebuchet MS, sans-serif").run()},{label:"Tahoma",style:"font-family: Tahoma, sans-serif",action:o=>o.chain().focus().setFontFamily("Tahoma, sans-serif").run()},{label:"Comic Sans MS",style:"font-family: Comic Sans MS, cursive",action:o=>o.chain().focus().setFontFamily("Comic Sans MS, cursive").run()},{label:"Por defecto",action:o=>o.chain().focus().unsetFontFamily().run()}]},clean:{icon:d2.clean,title:"Limpiar formato",action:o=>o.chain().focus().clearNodes().unsetAllMarks().run()},undo:{icon:d2.undo,title:"Deshacer",action:o=>o.chain().focus().undo().run()},redo:{icon:d2.redo,title:"Rehacer",action:o=>o.chain().focus().redo().run()},fontColor:{icon:d2.fontColor,title:"Color de texto",type:"color",colorMode:"text"},htmlSource:{icon:d2.html,title:"Editar HTML",type:"htmlToggle",isActive:()=>!1}},z6=["div","section","aside","article","header","footer","figure","details","nav","main"],U$=N2.create({name:"styledElement",group:"block",content:"block+",defining:!0,addAttributes(){return{tag:{default:"div",parseHTML:o=>o.tagName.toLowerCase(),renderHTML:()=>({})},elStyle:{default:"",parseHTML:o=>o.getAttribute("style")||"",renderHTML:o=>o.elStyle?{style:o.elStyle}:{}}}},parseHTML(){return[{tag:"[data-le-el]",priority:80}]},renderHTML({node:o}){const e=z6.includes(o.attrs.tag)?o.attrs.tag:"div",t={"data-le-el":""};return o.attrs.elStyle&&(t.style=o.attrs.elStyle),[e,t,0]},addCommands(){return{insertStyledElement:(o="div",e="",t="")=>({editor:n,tr:r,dispatch:i})=>{const{schema:a}=n,l=a.nodes.styledElement;if(!l)return!1;const s=z6.includes(o)?o:"div",c=t?[a.text(t)]:[],d=a.nodes.paragraph.create(null,c),p=l.create({tag:s,elStyle:e},[d]);return i&&i(r.replaceSelectionWith(p)),!0}}}}),K$=V2.create({name:"fontSize",addGlobalAttributes(){return[{types:["textStyle"],attributes:{fontSize:{default:null,parseHTML:o=>{var e;return((e=o.style.fontSize)==null?void 0:e.replace(/['"]+/g,""))||null},renderHTML:o=>o.fontSize?{style:`font-size: ${o.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:o=>({chain:e})=>e().setMark("textStyle",{fontSize:o}).run(),unsetFontSize:()=>({chain:o})=>o().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),J$=V2.create({name:"fontFamily",addGlobalAttributes(){return[{types:["textStyle"],attributes:{fontFamily:{default:null,parseHTML:o=>{var e;return((e=o.style.fontFamily)==null?void 0:e.replace(/['"]+/g,""))||null},renderHTML:o=>o.fontFamily?{style:`font-family: ${o.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:o=>({chain:e})=>e().setMark("textStyle",{fontFamily:o}).run(),unsetFontFamily:()=>({chain:o})=>o().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}});class eM{constructor(e,t={}){this.element=typeof e=="string"?document.querySelector(e):e,this.options=Object.assign({...Be,content:"",customButtons:{},customExtensions:[],onChange:null,onReady:null},t),this._customButtons={},this._popups=[],this.init(),this._initDocumentClickClose()}init(){Object.entries(this.options.customButtons).forEach(([t,n])=>{this._customButtons[t]=n}),this.container=document.createElement("div"),this.container.className="le-editor-container",this.options.theme&&this.container.classList.add(this.options.theme),this._toolbarWrapper=document.createElement("div"),this._toolbarWrapper.className="le-toolbar-wrapper",this.container.appendChild(this._toolbarWrapper),this.toolbarEl=document.createElement("div"),this.toolbarEl.className="le-toolbar",this._toolbarWrapper.appendChild(this.toolbarEl),this._fullscreenBtn=document.createElement("button"),this._fullscreenBtn.type="button",this._fullscreenBtn.className="le-btn-fullscreen",this._fullscreenBtn.title="Pantalla completa",this._fullscreenBtn.innerHTML=d2.maximize,this._fullscreenBtn.addEventListener("click",t=>{t.preventDefault(),this._toggleFullscreen()}),this._toolbarWrapper.appendChild(this._fullscreenBtn),this.editorEl=document.createElement("div"),this.editorEl.className="le-editor-content",this.container.appendChild(this.editorEl),this.options.showStatusBar&&(this.statusBarEl=document.createElement("div"),this.statusBarEl.className="le-statusbar",this.container.appendChild(this.statusBarEl),this._initStatusBar()),this.element.appendChild(this.container),this.textarea=this.element.querySelector("textarea"),this.textarea&&(this.textarea.style.display="none"),this.options.minHeight&&this.editorEl.style.setProperty("--le-editor-min-height",this.options.minHeight),this.options.maxHeight&&(this.editorEl.style.maxHeight=this.options.maxHeight),this._rawContent=this.textarea?this.textarea.value:this.options.content||"";const e=[Ib.configure({heading:{levels:[1,2,3,4]}}),cS,AS.configure({openOnClick:!1}),NS,RS.configure({placeholder:this.options.placeholder}),BS.configure({types:["heading","paragraph"]}),DS,K$,J$,jS,HS.configure({multicolor:!0}),Y$.configure({resizable:!0}),F$,G$,_$,U$,...this.options.customExtensions];if(this.editor=new Xg({element:this.editorEl,extensions:e,content:this.options.content||(this.textarea?this.textarea.value:""),onUpdate:({editor:t})=>{if(this._htmlMode)return;const n=t.getHTML();this.textarea&&(this.textarea.value=n),this._updateToolbar(),this._updateStatusBar(),this._updateAiBtn(),this.options.onChange&&this.options.onChange(n,t.getJSON())},onSelectionUpdate:()=>this._updateToolbar()}),this._buildToolbar(),this._updateStatusBar(),this._updateAiBtn(),this.options.onReady&&this.options.onReady(this),this._rawContent&&this._hasContentLoss(this._rawContent)){this._autoHtmlMode=!0;const t=this.toolbarEl.querySelector('button[data-btn="htmlSource"]');t&&t.click()}}_resolveToolbar(){let e=this.options.toolbar;return typeof e=="string"&&(e=X1[e]||X1.standard),e}_buildToolbar(){const e=this._resolveToolbar();let t=document.createElement("div");if(t.className="le-toolbar-group",e.forEach(a=>{if(a==="|"){this.toolbarEl.appendChild(t);const s=document.createElement("div");s.className="le-toolbar-separator",this.toolbarEl.appendChild(s),t=document.createElement("div"),t.className="le-toolbar-group";return}const l=this._customButtons[a]||an[a];if(l)if(l.type==="htmlToggle")t.appendChild(this._createHtmlToggleButton(a,l));else if(l.type==="dropdown")t.appendChild(this._createDropdownButton(a,l));else if(l.type==="color")t.appendChild(this._createColorButton(a,l));else if(l.type==="link")t.appendChild(this._createLinkButton(a,l));else if(l.render){const s=l.render(this.editor,this);s&&t.appendChild(s)}else{const s=this._createButton(a,l);t.appendChild(s)}}),this.toolbarEl.appendChild(t),this.options.htmlSource){const a=document.createElement("div");a.className="le-toolbar-separator",this.toolbarEl.appendChild(a);const l=document.createElement("div");l.className="le-toolbar-group",l.appendChild(this._createHtmlToggleButton("htmlSource",an.htmlSource)),this.toolbarEl.appendChild(l)}const n=this.options.aiTools??[],r=n.includes("improve-stream"),i=n.includes("improve");if(r||i){this._aiUseStream=r;const a=document.createElement("div");a.className="le-toolbar-separator",this.toolbarEl.appendChild(a);const l=document.createElement("div");l.className="le-toolbar-group",l.appendChild(this._createAiImproveButton());const s={};n.forEach(c=>{c!=="improve"&&c!=="improve-stream"&&s[c]&&l.appendChild(s[c]())}),this.toolbarEl.appendChild(l)}}_createButton(e,t){const n=document.createElement("button");return n.type="button",n.innerHTML=t.icon||e,n.title=t.title||e,n.dataset.btn=e,t.cssClass&&n.classList.add(t.cssClass),n.addEventListener("click",r=>{r.preventDefault(),t.action&&t.action(this.editor,this)!==!1&&this.editor.commands.focus()}),n}_createDropdownButton(e,t){const n=document.createElement("div");n.style.position="relative";const r=this._createButton(e,t);return r.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this._closePopups();const a=document.createElement("div");a.className="le-heading-dropdown",t.items.length>10&&a.classList.add("le-dropdown-scroll"),t.items.forEach(l=>{const s=document.createElement("button");s.type="button",s.textContent=l.label,l.style&&(s.style.cssText=l.style),s.addEventListener("click",c=>{c.preventDefault(),l.action(this.editor),a.remove()}),a.appendChild(s)}),n.appendChild(a),this._popups.push(a)}),n.appendChild(r),n}_createColorButton(e,t){const n=t.colorMode==="highlight",r=n?[{label:"Amarillo",value:"#fef08a"},{label:"Verde claro",value:"#bbf7d0"},{label:"Azul claro",value:"#bfdbfe"},{label:"Rosa claro",value:"#fbcfe8"},{label:"Naranja claro",value:"#fed7aa"},{label:"Violeta claro",value:"#ddd6fe"},{label:"Rojo claro",value:"#fecaca"},{label:"Cyan claro",value:"#a5f3fc"},{label:"Amarillo fuerte",value:"#facc15"},{label:"Verde",value:"#4ade80"},{label:"Azul",value:"#60a5fa"},{label:"Rosa",value:"#f472b6"}]:[{label:"Negro",value:"#000000"},{label:"Gris oscuro",value:"#4b5563"},{label:"Gris",value:"#9ca3af"},{label:"Rojo",value:"#dc2626"},{label:"Naranja",value:"#ea580c"},{label:"Ámbar",value:"#d97706"},{label:"Verde",value:"#16a34a"},{label:"Azul",value:"#2563eb"},{label:"Índigo",value:"#4f46e5"},{label:"Violeta",value:"#7c3aed"},{label:"Rosa",value:"#db2777"},{label:"Marrón",value:"#92400e"}],i=n?"Sin resaltado":"Sin color",a="",l=document.createElement("div");l.style.position="relative";const s=this._createButton(e,{...t,action:()=>{}}),c=()=>{const d=s.querySelector(".le-color-bar");if(d)if(n){const p=this.editor.getAttributes("highlight");d.setAttribute("fill",p.color||"#fef08a")}else{const p=this.editor.getAttributes("textStyle");d.setAttribute("fill",p.color||"currentColor")}};return s.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),this._closePopups();const p=document.createElement("div");p.className="le-color-popup";const h=document.createElement("div");h.className="le-color-grid",r.forEach(({label:f,value:g})=>{const b=document.createElement("button");b.type="button",b.className="le-color-swatch",b.style.background=g,b.title=f,b.addEventListener("click",v=>{v.preventDefault(),n?this.editor.chain().focus().toggleHighlight({color:g}).run():this.editor.chain().focus().setColor(g).run(),c(),p.remove()}),h.appendChild(b)}),p.appendChild(h);const u=document.createElement("button");u.type="button",u.className="le-color-unset",u.title=i,u.innerHTML=a+" "+i,u.addEventListener("click",f=>{f.preventDefault(),n?this.editor.chain().focus().unsetHighlight().run():this.editor.chain().focus().unsetColor().run(),c(),p.remove()}),p.appendChild(u),l.appendChild(p),this._popups.push(p)}),l.appendChild(s),l}_createLinkButton(e,t){const n=this._createButton(e,{...t,action:()=>{if(this._closePopups(),this.editor.isActive("link")){this.editor.chain().focus().unsetLink().run();return}const{from:r,to:i}=this.editor.state.selection,a=r!==i,l=document.createElement("div");l.className="le-link-popup";const s=document.createElement("input");s.type="url",s.placeholder="https://...";const c=document.createElement("button");c.type="button",c.textContent="OK",c.addEventListener("click",()=>{const p=s.value.trim();p&&(a?this.editor.chain().focus().setTextSelection({from:r,to:i}).setLink({href:p,target:"_blank"}).run():this.editor.chain().focus().insertContent(`<a href="${p}" target="_blank">${p}</a>`).run()),l.remove()}),s.addEventListener("keydown",p=>{p.key==="Enter"&&(p.preventDefault(),c.click()),p.key==="Escape"&&l.remove()}),l.appendChild(s),l.appendChild(c);const d=n.getBoundingClientRect();return l.style.position="fixed",l.style.top=d.bottom+4+"px",l.style.left=d.left+"px",l.style.zIndex="999999",document.body.appendChild(l),this._popups.push(l),setTimeout(()=>s.focus(),50),!1}});return n}_createAiImproveButton(){const e=document.createElement("button");return e.type="button",e.dataset.btn="aiImprove",e.title="Mejorar redacción con IA",e.classList.add("le-btn-ai"),e.innerHTML='<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><script xmlns="" id="datalayer-checker-script"/><path d="M11.838 3.322c.374-1.096 1.95-1.096 2.324 0l1.726 5.054a4.046 4.046 0 0 0 2.158 2.369l4.743 2.16a1.199 1.199 0 0 1 0 2.19l-4.743 2.16a4.046 4.046 0 0 0-2.158 2.37l-1.726 5.053c-.374 1.096-1.95 1.096-2.324 0l-1.726-5.053a4.046 4.046 0 0 0-2.158-2.37l-4.743-2.16a1.199 1.199 0 0 1 0-2.19l4.743-2.16a4.046 4.046 0 0 0 2.158-2.37l1.726-5.053Zm10.998 14.607c.214-.572 1.114-.572 1.328 0l.986 2.637c.205.546.65.993 1.234 1.236l2.71 1.127c.541.225.541.917 0 1.143l-2.71 1.126c-.583.243-1.03.69-1.234 1.236l-.986 2.637c-.214.572-1.114.572-1.328 0l-.986-2.637c-.205-.546-.65-.993-1.234-1.236l-2.71-1.127c-.541-.225-.541-.917 0-1.143l2.71-1.126c.583-.243 1.03-.69 1.234-1.236l.986-2.637Z" fill="white"/></svg>',e.addEventListener("click",()=>{this._aiAbortController?this._aiAbortController.abort():this._runImprove(e)}),this._aiBtn=e,e}async _runImprove(e){if(this._aiCooldownUntil&&Date.now()<this._aiCooldownUntil||e.disabled)return;const{state:t}=this.editor,{from:n,to:r,empty:i}=t.selection;if(!t.doc.textContent.trim())return;const a=i?this.editor.getHTML():(()=>{const P=document.createElement("div");return t.doc.nodesBetween(n,r,Z=>{Z.isText&&P.append(Z.text)}),P.innerHTML||P.textContent})();e.disabled=!0;const l=this.container.querySelector(".ProseMirror"),s=(l==null?void 0:l.parentElement)??this.container;l&&(l.style.transition="opacity 0.25s ease",l.style.opacity="0.2");const c=document.createElement("div");if(c.className="le-ai-stream-overlay",l){const P=l.getBoundingClientRect(),Z=s.getBoundingClientRect(),U=window.getComputedStyle(l);Object.assign(c.style,{position:"absolute",top:P.top-Z.top+s.scrollTop+"px",left:P.left-Z.left+s.scrollLeft+"px",width:P.width+"px",minHeight:P.height+"px",zIndex:"10",background:"transparent",padding:U.padding,fontSize:U.fontSize,fontFamily:U.fontFamily,lineHeight:U.lineHeight,color:U.color,whiteSpace:"pre-wrap",wordBreak:"break-word",overflowY:"auto",borderRadius:U.borderRadius,boxSizing:"border-box"})}const d='<svg class="le-ai-spin" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"/></svg><span>Mejorando redacción...</span>';let p=document.createElement("div");p.className="le-ai-thinking",p.innerHTML=d,c.appendChild(p);const h=document.createElement("span");if(h.className="le-ai-cursor",h.style.cssText="display:inline-block;width:2px;height:1.1em;background:currentColor;vertical-align:text-bottom;animation:le-blink 0.8s step-end infinite;margin-left:1px;",s.style.position="relative",s.appendChild(c),!document.getElementById("le-ai-stream-styles")){const P=document.createElement("style");P.id="le-ai-stream-styles",P.textContent=["@keyframes le-blink{0%,100%{opacity:1}50%{opacity:0}}","@keyframes le-ai-spin{to{transform:rotate(360deg)}}",".le-ai-thinking{display:flex;align-items:center;gap:7px;color:var(--le-accent,#4a6cf7);padding:4px 0;font-style:italic;}",".le-ai-spin{flex-shrink:0;animation:le-ai-spin 1s linear infinite;}"].join(""),document.head.appendChild(P)}const u=[];let f="",g=!1,b=null;const v=P=>{const Z=/<[a-z][\s\S]*>/i.test(P);i?this.editor.commands.setContent(Z?P:`<p>${P.replace(/\n{2,}/g,"</p><p>").replace(/\n/g,"<br>")}</p>`,!0):this.editor.chain().focus().deleteSelection().insertContent(P).run(),this.textarea&&(this.textarea.value=this.editor.getHTML())},w={"Content-Type":"application/json"};if(this.options.aiToken&&(w.Authorization=`Bearer ${this.options.aiToken}`),!this._aiUseStream){try{const P=await fetch(this.options.aiBaseUrl+"/improve",{method:"POST",headers:w,body:JSON.stringify({texto:a})});if(!P.ok)throw new Error(`HTTP ${P.status}`);const Z=await P.json(),U=Z.oResultado??Z.result??null;U&&v(U)}catch(P){console.error("[Ledithor AI] Error al mejorar redacción:",P)}finally{c.remove(),l&&(l.style.opacity="",l.style.transition=""),this._startAiCooldown(e,60)}return}l&&(l.style.opacity="0");const O=this.editor.state.doc.textContent;c.innerHTML="",p=document.createElement("div"),p.className="le-ai-thinking",p.innerHTML=d;const C=document.createElement("span"),x=document.createElement("span");x.style.opacity="0.25",x.textContent=O,C.style.display="none",h.style.display="none",x.style.display="none",c.appendChild(p),c.appendChild(C),c.appendChild(h),c.appendChild(x),e.disabled=!1;const y=e.innerHTML,k=e.title;e.innerHTML='<svg class="lf-svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.29289 7.2929C7.68341 6.90237 8.31657 6.90237 8.7071 7.29289L16.0001 14.5857L23.2929 7.29296C23.6834 6.90243 24.3166 6.90243 24.7071 7.29296C25.0976 7.68348 25.0976 8.31665 24.7071 8.70717L17.4143 15.9999L24.7071 23.2926C25.0976 23.6831 25.0976 24.3162 24.7071 24.7068C24.3166 25.0973 23.6834 25.0973 23.2929 24.7068L16.0001 17.4142L8.70717 24.7071C8.31665 25.0976 7.68348 25.0976 7.29296 24.7071C6.90243 24.3166 6.90243 23.6834 7.29296 23.2929L14.5859 16L7.2929 8.70711C6.90237 8.31659 6.90237 7.68343 7.29289 7.2929Z" fill="currentColor"/></svg>',e.title="Cancelar",e.classList.add("le-btn-ai--streaming");const $=new AbortController;this._aiAbortController=$;const T=()=>{this._aiAbortController=null,e.innerHTML=y,e.title=k,e.classList.remove("le-btn-ai--streaming")},N=P=>{b&&clearInterval(b),b=setInterval(()=>{if(u.length>0){!f&&p.parentNode&&(p.remove(),C.style.display="",h.style.display="",x.style.display=""),f+=u.shift();let Z="",U=!1;for(const e2 of f){if(e2==="<"){U=!0;continue}if(e2===">"){U=!1;continue}U||(Z+=e2)}C.textContent=Z,x.textContent=O.substring(Z.length)}else g&&(clearInterval(b),b=null,c.remove(),l&&(l.style.opacity="",l.style.transition=""),T(),f&&v(f),this._startAiCooldown(e,60))},P)};try{const P=await fetch(this.options.aiBaseUrl+"/improve-stream",{method:"POST",headers:w,body:JSON.stringify({texto:a}),signal:$.signal});if(!P.ok)throw new Error(`HTTP ${P.status}`);N(20);const Z=P.body.getReader(),U=new TextDecoder;let e2="";e:for(;;){const{value:D,done:M}=await Z.read();if(M)break;e2+=U.decode(D,{stream:!0});const H=e2.split(`
120
- `);e2=H.pop()??"";for(const K of H){const l2=K.trim();if(!l2.startsWith("data: "))continue;const w2=l2.slice(6);if(w2==="[DONE]")break e;try{const r2=JSON.parse(w2);if(r2.error)throw new Error(r2.error);if(r2.chunk)for(const h2 of r2.chunk)u.push(h2)}catch(r2){if(r2.message!=="Unexpected end of JSON input")throw r2}}}g=!0,u.length>0&&N(3)}catch(P){b&&(clearInterval(b),b=null),c.remove(),l&&(l.style.opacity="",l.style.transition=""),T(),P.name==="AbortError"?e.disabled=!1:(console.error("[Ledithor AI] Error en stream de mejora:",P),this._startAiCooldown(e,60))}}_startAiCooldown(e,t){this._aiCooldownUntil=Date.now()+t*1e3;const n=e.innerHTML,r=()=>{const i=Math.ceil((this._aiCooldownUntil-Date.now())/1e3);if(i<=0){this._aiCooldownUntil=0,e.innerHTML=n,e.classList.remove("le-btn-ai--cooldown"),this._updateAiBtn();return}e.disabled=!0,e.classList.add("le-btn-ai--cooldown"),e.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg> ${i}s`,e.title=`Disponible en ${i}s`,setTimeout(r,1e3)};r()}_createHtmlToggleButton(e,t){const n=document.createElement("button");return n.type="button",n.innerHTML=t.icon||e,n.title=t.title||"HTML",n.dataset.btn=e,n.classList.add("le-btn-html"),this._htmlMode=!1,this._htmlSourceEl=null,n.addEventListener("click",r=>{r.preventDefault(),this._toggleHtmlSource(n)}),n}_toggleHtmlSource(e){if(this._htmlMode=!this._htmlMode,this._htmlMode){let t;this._autoHtmlMode&&this._rawContent?(t=this._rawContent,this._autoHtmlMode=!1):(t=this.editor.getHTML(),t==="<p></p>"&&(t="")),this._htmlSourceEl=document.createElement("div"),this._htmlSourceEl.className="le-html-source";const n=l=>{const s=parseInt(l,10);return isNaN(s)?null:s},r=this.editorEl.getBoundingClientRect(),i=n(this.options.minHeight)||Math.max(r.height,200),a=n(this.options.maxHeight);this.editorEl.style.display="none",this.container.insertBefore(this._htmlSourceEl,this.editorEl.nextSibling),this._htmlSourceEditor=sS(this._htmlSourceEl,t,{minHeight:i,maxHeight:a,onChange:l=>{this.textarea&&(this.textarea.value=l)}}),this.textarea&&(this.textarea.value=t),this.toolbarEl.querySelectorAll("button[data-btn]").forEach(l=>{l.dataset.btn!=="htmlSource"&&(l.disabled=!0,l.style.opacity="0.4")}),e.classList.add("is-active")}else{if(this._htmlSourceEditor){const t=this._htmlSourceEditor.getValue();if(this._hasContentLoss(t)){this._htmlMode=!0,this._showHtmlOnlyNotice();return}this._htmlSourceEditor.destroy(),this._htmlSourceEditor=null,t.trim()===""?(this.editor.commands.clearContent(!1),this.textarea&&(this.textarea.value="")):(this.editor.commands.setContent(t,!1),this.textarea&&(this.textarea.value=this.editor.getHTML())),this._htmlSourceEl.remove(),this._htmlSourceEl=null}this.editorEl.style.display="",this.toolbarEl.querySelectorAll("button[data-btn]").forEach(t=>{t.disabled=!1,t.style.opacity=""}),e.classList.remove("is-active"),this._updateToolbar()}}_hasContentLoss(e){const t=e.slice(0,500).toLowerCase();if(t.includes("<!doctype")||t.includes("<html"))return!0;const n=document.createElement("div");n.innerHTML=e;const{schema:r}=this.editor,i=St.fromSchema(r).parse(n),a=s0.fromSchema(r).serializeFragment(i.content),l=document.createElement("div");l.appendChild(a);const s=n.textContent.replace(/\s+/g,""),c=l.textContent.replace(/\s+/g,"");if(s.length>0&&(s.length-c.length)/s.length>.05)return!0;const d=n.querySelectorAll("*").length,p=l.querySelectorAll("*").length;return d>0&&(d-p)/d>.3}_showHtmlOnlyNotice(){this._htmlNotice||(this._htmlNotice=document.createElement("div"),this._htmlNotice.className="le-html-notice",this._htmlNotice.textContent="Este contenido incluye elementos que el editor visual no soporta. Solo puede editarse en modo código.",this._htmlSourceEl.insertBefore(this._htmlNotice,this._htmlSourceEl.firstChild),setTimeout(()=>{this._htmlNotice&&(this._htmlNotice.remove(),this._htmlNotice=null)},4e3))}_updateToolbar(){this.editor&&this.toolbarEl.querySelectorAll("button[data-btn]").forEach(e=>{const t=e.dataset.btn,n=this._customButtons[t]||an[t];n&&n.isActive&&e.classList.toggle("is-active",n.isActive(this.editor))})}_initStatusBar(){if(!this.statusBarEl)return;this.statusBarEl.innerHTML="";const e=document.createElement("div");e.className="le-statusbar-left",this.statusBarEl.appendChild(e);const t=document.createElement("div");t.className="le-statusbar-center",t.innerHTML='<svg viewBox="0 0 48 52" fill="currentColor" aria-hidden="true"><path d="M29.0863 15.2704H24.9419V36.7321H37.5259V33.1048H29.0863V15.2704Z"/><path d="M18.1601 33.1048H9.72056V36.7321H22.3045V15.2704H18.1601V33.1048Z"/><path d="M44.0063 51.846L3.16483 50.1834C1.35636 50.1834 0 48.5965 0 46.8584V4.99294C0 3.33041 1.65777 1.8946 3.31554 1.81903L44.157 0.1565C46.2669 0.0809304 48 1.74346 48 3.8594V47.8408C48 50.0323 46.1915 51.846 43.9309 51.7704H44.0063V51.846ZM4.89796 46.405L42.9513 47.4629C43.4788 47.4629 44.0063 47.0095 44.0063 46.4805V5.21965C44.0063 4.69066 43.6295 4.31282 43.102 4.31282L4.82261 5.67307C4.14443 5.67307 3.61695 6.27762 3.61695 6.95775V45.1203C3.61695 45.8004 4.14443 46.3294 4.82261 46.405H4.89796Z"/></svg><span>Ledithor</span>',this.statusBarEl.appendChild(t),this._statusBarCounter=document.createElement("div"),this._statusBarCounter.className="le-statusbar-right",this.statusBarEl.appendChild(this._statusBarCounter)}_updateStatusBar(){if(!this._statusBarCounter||!this.editor)return;const e=this.editor.state.doc.textContent,t=e.trim()?e.trim().split(/\s+/).length:0;this._statusBarCounter.textContent=t+" palabra"+(t!==1?"s":"")+" · "+e.length+" caracteres"}_updateAiBtn(){if(!this.editor||!this._aiBtn||this._aiCooldownUntil&&Date.now()<this._aiCooldownUntil||this._aiAbortController)return;const e=!!this.editor.state.doc.textContent.trim();this._aiBtn.disabled=!e,this._aiBtn.classList.toggle("le-btn-ai--empty",!e),this._aiBtn.title=e?"Mejorar redacción con IA":"Escribe algo para usar la IA"}_closePopups(){this._popups.forEach(e=>e.remove()),this._popups=[]}_initDocumentClickClose(){document.addEventListener("click",e=>{!this._popups.length||this._popups.some(t=>t.contains(e.target))||this.toolbarEl&&this.toolbarEl.contains(e.target)||this._closePopups()})}_toggleFullscreen(){if(this._isFullscreen=!this._isFullscreen,this._isFullscreen){this._overlay=document.createElement("div"),this._overlay.className="le-fullscreen-overlay",this._originalParent=this.container.parentNode,this._originalNext=this.container.nextSibling,this._overlay.appendChild(this.container),document.body.appendChild(this._overlay),this.container.classList.add("le-fullscreen"),this._fullscreenBtn.innerHTML=d2.minimize,this._fullscreenBtn.title="Salir de pantalla completa",this._savedEditorMaxH=this.editorEl.style.maxHeight,this.editorEl.style.maxHeight="none";const e=this.editorEl.querySelector(".tiptap");e&&(this._savedMinH=e.style.minHeight,this._savedMaxH=e.style.maxHeight,e.style.minHeight="",e.style.maxHeight=""),this._escHandler=t=>{t.key==="Escape"&&this._toggleFullscreen()},document.addEventListener("keydown",this._escHandler)}else{this.container.classList.remove("le-fullscreen"),this._originalNext?this._originalParent.insertBefore(this.container,this._originalNext):this._originalParent.appendChild(this.container),this._overlay&&(this._overlay.remove(),this._overlay=null),this._fullscreenBtn.innerHTML=d2.maximize,this._fullscreenBtn.title="Pantalla completa",this.editorEl.style.maxHeight=this._savedEditorMaxH||"";const e=this.editorEl.querySelector(".tiptap");e&&(this._savedMinH&&(e.style.minHeight=this._savedMinH),this._savedMaxH&&(e.style.maxHeight=this._savedMaxH)),this._escHandler&&(document.removeEventListener("keydown",this._escHandler),this._escHandler=null)}this.editor.commands.focus()}getHTML(){return this.editor.getHTML()}getJSON(){return this.editor.getJSON()}getText(){return this.editor.state.doc.textContent}setContent(e){this.editor.commands.setContent(e),this.textarea&&(this.textarea.value=this.editor.getHTML())}isEmpty(){return this.editor.isEmpty}focus(){this.editor.commands.focus()}setEditable(e){this.editor.setEditable(e)}destroy(){this.editor.destroy(),this.container.remove()}registerButton(e,t){this._customButtons[e]=t}getTiptapEditor(){return this.editor}}const xt={create(o,e){try{return new eM(o,e)}catch(t){return console.warn("[Ledithor] Error al inicializar el editor, mostrando fallback.",t),xt._showFallback(o),null}},_showFallback(o){var e;const t=o instanceof Element?o.querySelector("textarea"):(e=document.querySelector(o))==null?void 0:e.querySelector("textarea");t&&(t.style.display="",t.style.width="100%",t.style.minHeight="150px")},registerGlobalButton(o,e){an[o]=e},registerPreset(o,e){X1[o]=e},initElement(o){if(o._ledithor)return o._ledithor;const e={};return o.dataset.toolbar&&(e.toolbar=o.dataset.toolbar),o.dataset.placeholder&&(e.placeholder=o.dataset.placeholder),o.dataset.theme&&(e.theme=o.dataset.theme),o.dataset.minHeight&&(e.minHeight=o.dataset.minHeight),o.dataset.maxHeight&&(e.maxHeight=o.dataset.maxHeight),o.dataset.statusbar!==void 0&&(e.showStatusBar=!0),o.dataset.htmlSource!==void 0&&(e.htmlSource=!0),o.dataset.aiBaseUrl&&(e.aiBaseUrl=o.dataset.aiBaseUrl),o.dataset.aiToken&&(e.aiToken=o.dataset.aiToken),o.dataset.aiTools&&(e.aiTools=JSON.parse(o.dataset.aiTools)),o._ledithor=xt.create(o,e),o._ledithor},autoInit(){document.querySelectorAll("[data-ledithor]").forEach(o=>xt.initElement(o))},observe(){this._observer||(this._observer=new MutationObserver(o=>{o.forEach(e=>{e.addedNodes.forEach(t=>{var n;t.nodeType===1&&(t.matches("[data-ledithor]")&&xt.initElement(t),(n=t.querySelectorAll)==null||n.call(t,"[data-ledithor]").forEach(r=>xt.initElement(r)))})})}),this._observer.observe(document.body,{childList:!0,subtree:!0}))},presets:X1,buttons:an,icons:d2,prompt(o,e={}){return new Promise(t=>{const n=e.placeholder||"",r=e.confirmText||"Aceptar",i=e.cancelText||"Cancelar",a=document.createElement("div");a.className="le-prompt-overlay";const l=document.createElement("div");l.className="le-prompt-dialog";const s=document.createElement("label");s.className="le-prompt-label",s.textContent=o,l.appendChild(s);const c=document.createElement("input");c.type="text",c.className="le-prompt-input",c.placeholder=n,l.appendChild(c);const d=document.createElement("div");d.className="le-prompt-actions";const p=document.createElement("button");p.type="button",p.className="le-prompt-btn le-prompt-btn-cancel",p.textContent=i;const h=document.createElement("button");h.type="button",h.className="le-prompt-btn le-prompt-btn-confirm",h.textContent=r,d.appendChild(p),d.appendChild(h),l.appendChild(d),a.appendChild(l),document.body.appendChild(a),setTimeout(()=>c.focus(),50);const u=f=>{a.remove(),t(f)};h.addEventListener("click",()=>u(c.value)),p.addEventListener("click",()=>u(null)),a.addEventListener("click",f=>{f.target===a&&u(null)}),c.addEventListener("keydown",f=>{f.key==="Enter"&&(f.preventDefault(),u(c.value)),f.key==="Escape"&&u(null)})})}};typeof document<"u"&&document.addEventListener("DOMContentLoaded",()=>{xt.autoInit(),xt.observe()});const tM=["value","placeholder"],oM={__name:"LedithorEditor",props:{modelValue:{type:String,default:""},toolbar:{type:String,default:Be.toolbar},theme:{type:String,default:Be.theme},placeholder:{type:String,default:Be.placeholder},minHeight:{type:String,default:Be.minHeight},maxHeight:{type:String,default:Be.maxHeight},statusbar:{type:Boolean,default:Be.showStatusBar},htmlSource:{type:Boolean,default:Be.htmlSource},aiBaseUrl:{type:String,default:Be.aiBaseUrl},aiToken:{type:String,default:Be.aiToken},aiTools:{type:Array,default:()=>Be.aiTools}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,n=e,r=m.ref(null),i=m.shallowRef(null),a=m.ref(!1),l=m.computed(()=>({width:"100%",minHeight:t.minHeight??"150px",maxHeight:t.maxHeight??void 0}));return m.onMounted(()=>{console.warn("[LedithorEditor] onMounted — containerRef:",r.value),console.warn("[LedithorEditor] Ledithor object:",xt),console.warn("[LedithorEditor] props:",{...t});try{if(i.value=xt.create(r.value,{toolbar:t.toolbar,theme:t.theme,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,showStatusBar:t.statusbar,htmlSource:t.htmlSource,aiBaseUrl:t.aiBaseUrl,aiToken:t.aiToken,aiTools:t.aiTools,content:t.modelValue,onChange:s=>n("update:modelValue",s)}),console.warn("[LedithorEditor] instancia creada:",i.value),!i.value){console.warn("[LedithorEditor] create() devolvió null — activando fallback"),a.value=!0;return}console.warn("[LedithorEditor] editor listo")}catch(s){console.warn("[LedithorEditor] Fallback activado:",s.message),console.error("[LedithorEditor] Stack:",s),a.value=!0}}),m.onBeforeUnmount(()=>{var s;return(s=i.value)==null?void 0:s.destroy()}),m.watch(()=>t.modelValue,s=>{i.value&&s!==i.value.getHTML()&&i.value.setContent(s)}),(s,c)=>a.value?(m.openBlock(),m.createElementBlock("textarea",{key:1,value:o.modelValue,placeholder:o.placeholder,style:m.normalizeStyle(l.value),onInput:c[0]||(c[0]=d=>n("update:modelValue",d.target.value))},null,44,tM)):(m.openBlock(),m.createElementBlock("div",{key:0,ref_key:"containerRef",ref:r},null,512))}},nM={class:"mecano:space-y-2"},rM={key:0,class:"mecano:flex mecano:gap-2 mecano:items-center"},iM=["value","onInput"],aM=["value","onChange"],lM=["value"],sM=["value","onInput"],cM=["checked","onChange"],dM={key:4,class:"mecano:flex-1 mecano:space-y-2"},pM=["id","mandatory-crops","has-file","existing-url","onLimbo:change"],mM={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},hM=["src","alt"],uM=["onClick"],fM={key:1},gM={class:"mecano:flex mecano:justify-between mecano:items-center mecano:mb-2"},bM={class:"mecano:text-xs mecano:font-semibold mecano:text-slate-500 mecano:bg-slate-100 mecano:px-2 mecano:py-0.5 mecano:rounded mecano:uppercase mecano:tracking-wide"},CM=["onClick"],OM={class:"subfields-cq-container"},vM={class:"subfields-cq-grid"},wM={class:"mecano:block mecano:text-xs mecano:text-slate-500 mecano:mb-1"},xM={key:0,class:"mecano:text-xs mecano:text-slate-400 mecano:mb-1"},yM=["value","onInput"],kM=["value","onChange"],SM=["value"],$M=["value","onInput"],MM=["checked","onChange"],QM={key:5,class:"mecano:space-y-2"},PM=["id","mandatory-crops","has-file","existing-url","onLimbo:change"],LM={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},TM=["src","alt"],EM=m.defineComponent({__name:"ListField",props:{field:{},modelValue:{},instanceId:{}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,n=t.instanceId??Math.random().toString(36).slice(2),r=e,i=m.computed(()=>t.modelValue??[]),a=m.computed(()=>{var C;return((C=t.field.items)==null?void 0:C.type)==="object"}),l=()=>t.field.items.type==="boolean"?t.field.items.example_value??!1:t.field.items.example_value??"",s=()=>{var C;return Object.fromEntries((((C=t.field.items)==null?void 0:C.fields)??[]).map(x=>[x.name,x.example_value??(x.type==="boolean"?!1:"")]))};m.onMounted(()=>{var C;i.value.length===0&&(a.value?(((C=t.field.items)==null?void 0:C.fields)??[]).some(y=>y.example_value!==void 0):t.field.items.example_value!==void 0)&&c()});const c=()=>{const C=a.value?s():l();r("update:modelValue",[...i.value,C])},d=C=>{const x=[...i.value];x.splice(C,1),r("update:modelValue",x)},p=(C,x)=>{const y=[...i.value];y[C]=x,r("update:modelValue",y)},h=(C,x,y)=>{const k=[...i.value];k[C]={...k[C],[x]:y},r("update:modelValue",k)},u=/\/preview-comp\//,f=C=>u.test(C),g=C=>{var x;if(!C||typeof C!="string")return"";try{const y=C.replace(/&quot;/g,'"').replace(/&amp;/g,"&"),k=JSON.parse(y),$=k.images??[],T=$.find(P=>(P==null?void 0:P.url)&&!P.url.startsWith("blob:"));if(T!=null&&T.url)return T.url;const N=$.find(P=>P==null?void 0:P.url);return N!=null&&N.url?N.url:(x=k.original)!=null&&x.url?k.original.url:""}catch{return!C.startsWith("http")&&!C.startsWith("/files/")||f(C)?"":C}},b=C=>{var x;if(C==null||C===!1)return!1;if(typeof C=="string"){const y=C.trim();if(!y||y==="[]"||y==="{}"||y==="null")return!1;try{const k=JSON.parse(y);if(Array.isArray(k))return k.length>0;if(k&&typeof k=="object"){const $=((x=k.original)==null?void 0:x.url)??"";return $&&!f($)?!0:(Array.isArray(k.images)?k.images:[]).some(N=>(N==null?void 0:N.url)&&!f(N.url))}}catch{}return!y.startsWith("http")&&!y.startsWith("/")?!1:!f(y)}return Array.isArray(C)?C.length>0:!0},v=C=>{var y,k,$,T;if(!C||typeof C!="object")return{};const x=C;if(x.original!==void 0||x.images!==void 0)return x;if(Array.isArray(x.crops)&&x.crops.length>0){const N=x.asset?{url:x.asset.url||x.asset.urlSigned||null,width:x.asset.width??null,height:x.asset.height??null,assetId:x.asset.id??null}:null,P=x.crops.map(Z=>({url:Z.url||Z.urlSigned||null,width:Z.width??null,height:Z.height??null,name:Z.name||Z.filename||null}));return{original:N,images:P}}return(y=x.master)!=null&&y.urlSigned||(k=x.master)!=null&&k.url?{original:{url:x.master.urlSigned||x.master.url||null,width:x.width??(($=x.master)==null?void 0:$.width)??null,height:x.height??((T=x.master)==null?void 0:T.height)??null,assetId:x.assetId??null},images:[]}:x.url||x.urlSigned?{original:{url:x.url||x.urlSigned||null,width:x.width??null,height:x.height??null,assetId:x.assetId??x.id??null},images:[]}:x},w=(C,x)=>{const y=x.detail,k=JSON.stringify(v(y==null?void 0:y.data));p(C,k)},O=(C,x,y)=>{const k=y.detail,$=JSON.stringify(v(k==null?void 0:k.data));h(C,x,$)};return(C,x)=>(m.openBlock(),m.createElementBlock("div",nM,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i.value,(y,k)=>(m.openBlock(),m.createElementBlock("div",{key:k,class:"mecano:border mecano:border-slate-300 mecano:rounded-lg mecano:p-3 mecano:bg-gradient-to-br mecano:from-indigo-50 mecano:to-slate-200 mecano:shadow-sm mecano:ring-1 mecano:ring-slate-100"},[a.value?(m.openBlock(),m.createElementBlock("div",fM,[m.createElementVNode("div",gM,[m.createElementVNode("span",bM,"Elemento "+m.toDisplayString(k+1),1),m.createElementVNode("button",{type:"button",class:"mecano:text-red-400 mecano:hover:text-red-600 mecano:transition-colors mecano:text-sm mecano:cursor-pointer",onClick:$=>d(k)},"🗑️",8,CM)]),m.createElementVNode("div",OM,[m.createElementVNode("div",vM,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(o.field.items.fields,$=>(m.openBlock(),m.createElementBlock("div",{key:$.name,class:m.normalizeClass(["mecano:mb-2 mecano:last:mb-0",["textArea","image"].includes($.type)?"subfield-full":"subfield-half"])},[m.createElementVNode("label",wM,m.toDisplayString($.label),1),$.help?(m.openBlock(),m.createElementBlock("p",xM,m.toDisplayString($.help),1)):m.createCommentVNode("",!0),$.type==="text"?(m.openBlock(),m.createElementBlock("input",{key:1,type:"text",class:"mecano:w-full mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm",value:y[$.name],onInput:T=>h(k,$.name,T.target.value)},null,40,yM)):$.type==="select"?(m.openBlock(),m.createElementBlock("select",{key:2,class:"mecano:w-full mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm",value:y[$.name],onChange:T=>h(k,$.name,T.target.value)},[x[4]||(x[4]=m.createElementVNode("option",{disabled:"",value:""},"Seleccione una opción",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList($.options??[],(T,N)=>{var P;return m.openBlock(),m.createElementBlock("option",{key:N,value:T},m.toDisplayString(((P=$.options_labels)==null?void 0:P[N])??T),9,SM)}),128))],40,kM)):$.type==="textArea"?(m.openBlock(),m.createElementBlock("textarea",{key:3,class:"mecano:w-full mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm mecano:resize-y mecano:min-h-[60px]",value:y[$.name],onInput:T=>h(k,$.name,T.target.value)},null,40,$M)):$.type==="boolean"?(m.openBlock(),m.createElementBlock("input",{key:4,type:"checkbox",class:"mecano:h-4 mecano:w-4 mecano:text-blue-600 mecano:focus:ring-blue-500 mecano:border-slate-300 mecano:rounded",checked:y[$.name],onChange:T=>h(k,$.name,T.target.checked)},null,40,MM)):$.type==="image"?(m.openBlock(),m.createElementBlock("div",QM,[m.createElementVNode("limbo-selector",{id:`lf-${m.unref(n)}-${o.field.name}-${k}-${$.name}`,accept:"image/*","return-format":"json","mandatory-crops":$.image_cuts?JSON.stringify($.image_cuts):void 0,"has-file":b(y[$.name])?"":void 0,"existing-url":g(y[$.name])||void 0,"onLimbo:change":T=>O(k,$.name,T)},null,40,PM),g(y[$.name])?(m.openBlock(),m.createElementBlock("div",LM,[m.createElementVNode("img",{src:g(y[$.name]),alt:$.label,class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",onError:x[1]||(x[1]=T=>T.target.style.display="none")},null,40,TM),x[5]||(x[5]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Imagen seleccionada",-1))])):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0)],2))),128))])])])):(m.openBlock(),m.createElementBlock("div",rM,[o.field.items.type==="text"?(m.openBlock(),m.createElementBlock("input",{key:0,type:"text",class:"mecano:flex-1 mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm",value:y,onInput:$=>p(k,$.target.value)},null,40,iM)):o.field.items.type==="select"?(m.openBlock(),m.createElementBlock("select",{key:1,class:"mecano:flex-1 mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm",value:y,onChange:$=>p(k,$.target.value)},[x[2]||(x[2]=m.createElementVNode("option",{disabled:"",value:""},"Seleccione una opción",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(o.field.items.options??[],($,T)=>{var N;return m.openBlock(),m.createElementBlock("option",{key:T,value:$},m.toDisplayString(((N=o.field.items.options_labels)==null?void 0:N[T])??$),9,lM)}),128))],40,aM)):o.field.items.type==="textArea"?(m.openBlock(),m.createElementBlock("textarea",{key:2,class:"mecano:flex-1 mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm mecano:resize-y mecano:min-h-[60px]",value:y,onInput:$=>p(k,$.target.value)},null,40,sM)):o.field.items.type==="boolean"?(m.openBlock(),m.createElementBlock("input",{key:3,type:"checkbox",class:"mecano:h-4 mecano:w-4 mecano:text-blue-600 mecano:focus:ring-blue-500 mecano:border-slate-300 mecano:rounded",checked:y,onChange:$=>p(k,$.target.checked)},null,40,cM)):o.field.items.type==="image"?(m.openBlock(),m.createElementBlock("div",dM,[m.createElementVNode("limbo-selector",{id:`lf-${m.unref(n)}-${o.field.name}-${k}`,accept:"image/*","return-format":"json","mandatory-crops":o.field.items.image_cuts?JSON.stringify(o.field.items.image_cuts):void 0,"has-file":b(y)?"":void 0,"existing-url":g(y)||void 0,"onLimbo:change":$=>w(k,$)},null,40,pM),g(y)?(m.openBlock(),m.createElementBlock("div",mM,[m.createElementVNode("img",{src:g(y),alt:o.field.label,class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",onError:x[0]||(x[0]=$=>$.target.style.display="none")},null,40,hM),x[3]||(x[3]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Imagen seleccionada",-1))])):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0),m.createElementVNode("button",{type:"button",class:"mecano:text-red-400 mecano:hover:text-red-600 mecano:transition-colors mecano:text-lg mecano:leading-none mecano:flex-shrink-0 mecano:cursor-pointer",onClick:$=>d(k)},"🗑️",8,uM)]))]))),128)),m.createElementVNode("button",{type:"button",class:"mecano:w-full mecano:py-2.5 mecano:px-3 mecano:rounded-lg mecano:text-sm mecano:font-semibold mecano:bg-blue-600 mecano:text-white mecano:border mecano:border-blue-700 mecano:hover:bg-blue-700 mecano:active:bg-blue-800 mecano:transition-all mecano:duration-150 mecano:cursor-pointer mecano:flex mecano:items-center mecano:justify-center mecano:gap-1.5 mecano:shadow-sm",onClick:c},[...x[6]||(x[6]=[m.createElementVNode("span",{class:"mecano:text-base mecano:leading-none"},"+",-1),m.createTextVNode(" Añadir elemento ",-1)])])]))}}),ZM=I1(EM,[["__scopeId","data-v-9839d911"]]),AM={key:0,class:"mecano:absolute mecano:top-0 mecano:left-0 mecano:bg-white/90 mecano:w-full mecano:h-full z-100"},VM={class:"mecano:w-full mecano:flex mecano:justify-end mecano:p-4"},NM={key:0,class:"mecano:flex mecano:flex-col mecano:items-center mecano:justify-center mecano:gap-2 mecano:py-8 mecano:text-slate-400"},RM={class:"mecano:text-xs mecano:font-semibold mecano:text-slate-400 mecano:uppercase mecano:tracking-wider mecano:mb-2"},BM={class:"mecano:flex mecano:gap-1 mecano:mb-3 mecano:bg-slate-100 mecano:rounded-lg mecano:p-1"},zM=["onClick"],DM=["for"],jM={key:0,class:"mecano:text-red-500"},XM={key:0,class:"mecano:text-xs mecano:text-slate-400 mecano:mb-1"},IM={key:1,class:"mecano:space-y-2"},HM=["id","mandatory-crops","has-file","existing-url","onLimbo:change"],WM={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},qM=["src","alt"],YM={key:2,class:"mecano:space-y-2"},FM=["placeholder","required","value","onInput"],GM=["id","has-file","existing-url","onLimbo:change"],_M={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},UM=["src"],KM={class:"fields-cq-container"},JM={class:"fields-cq-grid"},eQ=["for"],tQ={key:0,class:"mecano:text-red-500"},oQ={key:0,class:"mecano:text-xs mecano:text-slate-400 mecano:mb-1"},nQ=["id","name","placeholder","required","value","onInput"],rQ={key:2,class:"mecano:space-y-2"},iQ=["id","mandatory-crops","has-file","existing-url","onLimbo:change"],aQ={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},lQ=["src","alt"],sQ={key:3,class:"mecano:space-y-2"},cQ=["placeholder","required","value","onInput"],dQ=["id","has-file","existing-url","onLimbo:change"],pQ={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},mQ=["src"],hQ=["id","name","required","value","onInput"],uQ=["value"],fQ=["id","name","required","checked","onChange"],gQ=m.defineComponent({__name:"FieldsForm",props:{object:{type:Object,required:!0},toggleShowForm:{type:Function,required:!0},showForm:{type:Boolean,default:!1},ateneaToken:{type:String,default:void 0},ledithorAiTools:{type:Array,default:void 0}},emits:["fieldUpdated","exclusiveFieldChanged"],setup(o,{emit:e}){const t=o,n=e,r=m.computed(()=>{const w={};for(const O of t.object.fields||[])O.exclusive_group&&(w[O.exclusive_group]||(w[O.exclusive_group]=[]),w[O.exclusive_group].push(O));return w}),i=m.reactive({}),a=()=>{var w;for(const[O,C]of Object.entries(r.value)){if(!i[O]){const x=C.find(y=>y.example_value&&String(y.example_value).trim()!=="");i[O]=x?x.name:((w=C[0])==null?void 0:w.name)||""}n("exclusiveFieldChanged",O,i[O])}},l=(w,O)=>{i[w]=O,n("exclusiveFieldChanged",w,O)},s=m.computed(()=>(t.object.fields||[]).filter(w=>!w.exclusive_group)),c=(w,O)=>{const C=O.find(x=>x.exclusive_group_label);return C!=null&&C.exclusive_group_label?C.exclusive_group_label:w.replace(/_/g," ").replace(/^\w/,x=>x.toUpperCase())},d=/\/preview-comp\//,p=w=>d.test(w),h=w=>{const O=w.example_value;if(typeof O!="string")return"";const C=O.trim();return!C||!C.startsWith("http")&&!C.startsWith("/")||p(C)?"":C},u=w=>{var C;const O=w.example_value;if(!O)return"";try{const x=O.replace(/&quot;/g,'"').replace(/&amp;/g,"&"),y=JSON.parse(x),k=y.images??[],$=k.find(N=>(N==null?void 0:N.url)&&!N.url.startsWith("blob:"));if($!=null&&$.url)return $.url;const T=k.find(N=>N==null?void 0:N.url);return T!=null&&T.url?T.url:(C=y.original)!=null&&C.url?y.original.url:""}catch{return!O.startsWith("http")&&!O.startsWith("/files/")||p(O)?"":O}},f=w=>{var O;if(w==null||w===!1)return!1;if(typeof w=="string"){const C=w.trim();if(!C||C==="[]"||C==="{}"||C==="null")return!1;try{const x=JSON.parse(C);if(Array.isArray(x))return x.length>0;if(x&&typeof x=="object"){const y=((O=x.original)==null?void 0:O.url)??"";return y&&!p(y)?!0:(Array.isArray(x.images)?x.images:[]).some($=>($==null?void 0:$.url)&&!p($.url))}}catch{}return!C.startsWith("http")&&!C.startsWith("/")?!1:!p(C)}return Array.isArray(w)?w.length>0:!0},g=(w,O)=>{const C=(t.object.fields||[]).find(x=>x.name===w);C&&(C.example_value=O,n("fieldUpdated",w,O))},b=w=>{var C,x,y,k;if(!w||typeof w!="object")return{};const O=w;if(O.original!==void 0||O.images!==void 0)return O;if(Array.isArray(O.crops)&&O.crops.length>0){const $=O.asset?{url:O.asset.url||O.asset.urlSigned||null,width:O.asset.width??null,height:O.asset.height??null,assetId:O.asset.id??null}:null,T=O.crops.map(N=>({url:N.url||N.urlSigned||null,width:N.width??null,height:N.height??null,name:N.name||N.filename||null}));return{original:$,images:T}}return(C=O.master)!=null&&C.urlSigned||(x=O.master)!=null&&x.url?{original:{url:O.master.urlSigned||O.master.url||null,width:O.width??((y=O.master)==null?void 0:y.width)??null,height:O.height??((k=O.master)==null?void 0:k.height)??null,assetId:O.assetId??null},images:[]}:O.url||O.urlSigned?{original:{url:O.url||O.urlSigned||null,width:O.width??null,height:O.height??null,assetId:O.assetId??O.id??null},images:[]}:O},v=(w,O,C)=>{const x=O.detail,y=C==="url"?(x==null?void 0:x.url)||"":JSON.stringify(b(x==null?void 0:x.data));g(w.name,y)};return m.onMounted(()=>{a()}),(w,O)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[o.showForm?(m.openBlock(),m.createElementBlock("div",AM)):m.createCommentVNode("",!0),m.createElementVNode("div",{class:m.normalizeClass(o.showForm?"mecano:relative mecano:top-0 mecano:w-full mecano:text-slate-600 mecano:border-1 mecano:my-2 mecano:px-4 mecano:pt-2 mecano:pb-3 mecano:w-full mecano:border-slate-200 mecano:bg-slate-50 mecano:inline-block mecano:rounded-lg mecano:flex mecano:flex-col z-101":"mecano:hidden")},[m.createElementVNode("div",VM,[m.createElementVNode("span",{onClick:O[0]||(O[0]=(...C)=>o.toggleShowForm&&o.toggleShowForm(...C)),class:"mecano:cursor-pointer mecano:hover:scale-125 mecano:transition-all mecano:duration-300"},"❌")]),m.createElementVNode("form",null,[Object.keys(r.value).length===0&&s.value.length===0?(m.openBlock(),m.createElementBlock("div",NM,[...O[5]||(O[5]=[m.createElementVNode("span",{class:"mecano:text-3xl"},"⚙️",-1),m.createElementVNode("span",{class:"mecano:text-sm"},"Este componente no tiene parámetros configurables",-1)])])):m.createCommentVNode("",!0),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(r.value,(C,x)=>(m.openBlock(),m.createElementBlock("div",{key:"group-"+x,class:"mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:p-3 mecano:mb-4 mecano:bg-white"},[m.createElementVNode("div",RM,m.toDisplayString(c(x,C)),1),m.createElementVNode("div",BM,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C,y=>(m.openBlock(),m.createElementBlock("button",{key:y.name,type:"button",class:m.normalizeClass(["mecano:flex-1 mecano:py-1.5 mecano:px-3 mecano:rounded-md mecano:text-sm mecano:font-medium mecano:transition-all mecano:cursor-pointer",i[x]===y.name?y.type==="image"?"mecano:bg-blue-500 mecano:text-white mecano:shadow-sm":"mecano:bg-purple-500 mecano:text-white mecano:shadow-sm":"mecano:text-slate-500 mecano:hover:text-slate-700 mecano:hover:bg-white/50"]),onClick:k=>l(x,y.name)},m.toDisplayString(y.type==="image"?"Imagen":"Video"),11,zM))),128))]),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C,y=>m.withDirectives((m.openBlock(),m.createElementBlock("div",{key:"gf-"+y.name},[m.createElementVNode("label",{for:`${o.object.id}-${y.name}-eg`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:mb-1"},[m.createTextVNode(m.toDisplayString(y.label)+" ",1),y.mandatory?(m.openBlock(),m.createElementBlock("span",jM,"*")):m.createCommentVNode("",!0)],8,DM),y.help?(m.openBlock(),m.createElementBlock("p",XM,m.toDisplayString(y.help),1)):m.createCommentVNode("",!0),y.type==="image"?(m.openBlock(),m.createElementBlock("div",IM,[m.createElementVNode("limbo-selector",{id:`${o.object.id}-${y.name}-eg`,accept:"image/*","return-format":"json","mandatory-crops":y.image_cuts?JSON.stringify(y.image_cuts):void 0,"has-file":f(y.example_value)?"":void 0,"existing-url":u(y)||void 0,"onLimbo:change":k=>v(y,k,"json")},null,40,HM),u(y)?(m.openBlock(),m.createElementBlock("div",WM,[m.createElementVNode("img",{src:u(y),alt:y.label,class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",onError:O[1]||(O[1]=k=>k.target.style.display="none")},null,40,qM),O[6]||(O[6]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Imagen seleccionada",-1))])):m.createCommentVNode("",!0)])):y.type==="video"?(m.openBlock(),m.createElementBlock("div",YM,[m.createElementVNode("input",{type:"text",class:"mecano:w-full mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-purple-400",placeholder:y.label,required:y.mandatory,value:y.example_value,onInput:k=>g(y.name,k.target.value)},null,40,FM),m.createElementVNode("limbo-selector",{id:`${o.object.id}-${y.name}-eg`,accept:"video/*","return-format":"url","has-file":h(y)?"":void 0,"existing-url":h(y)||void 0,"onLimbo:change":k=>v(y,k,"url")},null,40,GM),h(y)?(m.openBlock(),m.createElementBlock("div",_M,[m.createElementVNode("video",{src:h(y),class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",muted:"",onError:O[2]||(O[2]=k=>k.target.style.display="none")},null,40,UM),O[7]||(O[7]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Vídeo seleccionado",-1))])):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0)],512)),[[m.vShow,i[x]===y.name]])),128))]))),128)),m.createElementVNode("div",KM,[m.createElementVNode("div",JM,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(s.value,(C,x)=>(m.openBlock(),m.createElementBlock("div",{key:x,class:m.normalizeClass(["mecano:mb-4",["textArea","image","video","list"].includes(C.type)?"field-full":"field-half"])},[m.createElementVNode("label",{for:`${o.object.id}-${C.name}-${x}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:mb-1"},[m.createTextVNode(m.toDisplayString(C.label)+" ",1),C.mandatory?(m.openBlock(),m.createElementBlock("span",tQ,"*")):m.createCommentVNode("",!0)],8,eQ),C.help?(m.openBlock(),m.createElementBlock("p",oQ,m.toDisplayString(C.help),1)):m.createCommentVNode("",!0),C.type==="text"?(m.openBlock(),m.createElementBlock("input",{key:1,id:`${o.object.id}-${C.name}-${x}`,name:`${o.object.id}-${C.name}-${x}`,type:"text",class:"mecano:w-full mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400",placeholder:C.label,required:C.mandatory,value:C.example_value,onInput:y=>g(C.name,y.target.value)},null,40,nQ)):C.type==="image"?(m.openBlock(),m.createElementBlock("div",rQ,[m.createElementVNode("limbo-selector",{id:`${o.object.id}-${C.name}-${x}`,accept:"image/*","return-format":"json","mandatory-crops":C.image_cuts?JSON.stringify(C.image_cuts):void 0,"has-file":f(C.example_value)?"":void 0,"existing-url":u(C)||void 0,"onLimbo:change":y=>v(C,y,"json")},null,40,iQ),u(C)?(m.openBlock(),m.createElementBlock("div",aQ,[m.createElementVNode("img",{src:u(C),alt:C.label,class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",onError:O[3]||(O[3]=y=>y.target.style.display="none")},null,40,lQ),O[8]||(O[8]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Imagen seleccionada",-1))])):m.createCommentVNode("",!0)])):C.type==="video"?(m.openBlock(),m.createElementBlock("div",sQ,[m.createElementVNode("input",{type:"text",class:"mecano:w-full mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-purple-400",placeholder:C.label,required:C.mandatory,value:C.example_value,onInput:y=>g(C.name,y.target.value)},null,40,cQ),m.createElementVNode("limbo-selector",{id:`${o.object.id}-${C.name}-${x}`,accept:"video/*","return-format":"url","has-file":h(C)?"":void 0,"existing-url":h(C)||void 0,"onLimbo:change":y=>v(C,y,"url")},null,40,dQ),h(C)?(m.openBlock(),m.createElementBlock("div",pQ,[m.createElementVNode("video",{src:h(C),class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",muted:"",onError:O[4]||(O[4]=y=>y.target.style.display="none")},null,40,mQ),O[9]||(O[9]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Vídeo seleccionado",-1))])):m.createCommentVNode("",!0)])):C.type==="textArea"?(m.openBlock(),m.createBlock(m.unref(oM),m.mergeProps({key:4,ref_for:!0},t.ateneaToken?{"ai-token":t.ateneaToken,"ai-tools":t.ledithorAiTools??[]}:{},{"ai-base-url":"https://led-dev-atenea-dev.eu.els.local/api","model-value":C.example_value,"onUpdate:modelValue":y=>C.example_value=y}),null,16,["model-value","onUpdate:modelValue"])):C.type==="select"?(m.openBlock(),m.createElementBlock("select",{key:5,id:`${o.object.id}-${C.name}-${x}`,name:`${o.object.id}-${C.name}-${x}`,class:"mecano:w-full mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400",required:C.mandatory,value:C.example_value,onInput:y=>g(C.name,y.target.value)},[O[10]||(O[10]=m.createElementVNode("option",{disabled:"",value:""},"Seleccione una opción",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.options||[],(y,k)=>(m.openBlock(),m.createElementBlock("option",{key:k,value:y},m.toDisplayString(y),9,uQ))),128))],40,hQ)):C.type==="boolean"?(m.openBlock(),m.createElementBlock("input",{key:6,id:`${o.object.id}-${C.name}-${x}`,name:`${o.object.id}-${C.name}-${x}`,type:"checkbox",class:"mecano:h-4 mecano:w-4 mecano:text-blue-600 mecano:focus:ring-blue-500 mecano:border-slate-300 mecano:rounded mecano:inline-block",required:C.mandatory,checked:C.example_value,onChange:y=>g(C.name,y.target.checked)},null,40,fQ)):C.type==="list"?(m.openBlock(),m.createBlock(ZM,{key:7,field:C,"model-value":C.example_value??[],"instance-id":`${o.object.id}-${C.name}`,"onUpdate:modelValue":y=>g(C.name,y)},null,8,["field","model-value","instance-id","onUpdate:modelValue"])):m.createCommentVNode("",!0)],2))),128))])])])],2)],64))}}),Ul=I1(gQ,[["__scopeId","data-v-689b1665"]]),bQ={class:"mecano:space-y-4"},CQ=["disabled"],OQ=["value"],vQ={class:"mecano:space-y-3"},wQ={key:0,class:"mecano:overflow-y-auto mecano:space-y-3"},xQ={class:"mecano:block mecano:text-sm mecano:font-semibold mecano:text-slate-600 mecano:mb-2"},yQ=["onChange","disabled"],kQ=["value"],SQ=["onChange","disabled"],$Q=["onInput","disabled","placeholder"],MQ=["disabled"],QQ={key:0,class:"mecano:animate-spin"},PQ={key:1},Id=m.defineComponent({__name:"SourceFilter",props:{onSubmit:{type:Function,required:!0},updateFeedCriteria:{type:Function,required:!0},onLoadingChange:{type:Function,default:null},isProduction:{type:Boolean,default:!1}},setup(o){const e=o,t=m.ref(!1),n=m.ref(null),r=m.ref({}),i=m.computed(()=>{const d=e.isProduction;return[{id:"origen1",name:"El Derecho",apiUrl:d?"https://elderecho.com/feed":"https://led-dev-elderecho-dev.eu.els.local/feed",filters:[{id:"title",label:"Título del Post",type:"text"},{id:"category",label:"Slug de la Categoría",type:"text"},{id:"tax",label:"Slug de la Etiqueta",type:"text"},{id:"limit",label:"Número de Posts",type:"text"},{id:"last",label:"Últimas X horas",type:"text"},{id:"type",label:"Tipo de Post",type:"select",options:["noticias","tribunas","foros","caraacara"]},{id:"fecha",label:"Fecha dd/mm/yyyy",type:"text"}]},{id:"origen2",name:"Formación",apiUrl:d?"https://lefebvre.es/formacion/feed":"http://led-dev-lefebvre-dev.eu.els.local/formacion/feed",filters:[{id:"id",label:"ID del curso",type:"text"},{id:"title",label:"Título del Post",type:"text"},{id:"featured",label:"Destacado",type:"select",options:["1","0"]},{id:"page",label:"Página a mostrar",type:"text"},{id:"limit",label:"Número de cursos",type:"text"}]},{id:"origen3",name:"Genia-L",apiUrl:d?"https://lefebvre.es/genia-l/feed/":"https://led-dev-lefebvre-dev.eu.els.local/genia-l/feed/",filters:[{id:"limit",label:"Límite",type:"text"},{id:"categoria",label:"Categoría",type:"select",options:["ia-para-abogados","genia-l-y-lefebvre","redaccion-y-documentos-juridicos","asistente-juridico-con-ia","busqueda-y-analisis-juridico","automatizacion-juridica","legaltech-e-innovacion"]},{id:"titulo",label:"Título",type:"text"}]},{id:"origen4",name:"EspacioAsesoría",apiUrl:d?"https://espacioasesoria.com/feed":"https://led-dev-espacioasesoria-dev.eu.els.local/feed",filters:[]},{id:"origen5",name:"EspacioPymes",apiUrl:d?"https://espaciopymes.com/feed":"https://led-dev-espaciopymes-dev.eu.els.local/feed",filters:[]},{id:"origen6",name:"Derecholocal",apiUrl:d?"https://derecholocal.es/feed":"https://led-dev-derecholocal-dev.eu.els.local/feed",filters:[]}]}),a=m.computed(()=>{if(!n.value)return[];const d=i.value.find(p=>p.id===n.value);return d?d.filters:[]}),l=(d,p)=>{r.value[d]=p},s=()=>{r.value={}},c=async()=>{var h,u;t.value=!0,(h=e.onLoadingChange)==null||h.call(e,!0);const d=i.value.find(f=>f.id===n.value);if(!d){console.error("Origen no encontrado"),t.value=!1;return}const p=new URL(d.apiUrl);Object.keys(r.value).forEach(f=>{r.value[f]&&p.searchParams.append(f,r.value[f])});try{const g=await(await fetch(p.toString(),{method:"GET",headers:{Accept:"text/xml, application/xml"}})).text(),v=new DOMParser().parseFromString(g,"text/xml"),w=Array.from(v.querySelectorAll("item")).map(O=>{const C={};return Array.from(O.children).forEach(x=>{x.children.length>0?Array.from(x.children).forEach(y=>{const k=`${x.nodeName}_${y.nodeName}`;C[k]=y.textContent||"",Array.from(y.attributes).forEach($=>{C[`${x.nodeName}_${y.nodeName}_${$.name}`]=$.value})}):C[x.nodeName]=x.textContent||"",Array.from(x.attributes).forEach(y=>{C[`${x.nodeName}_${y.name}`]=y.value})}),C});e.onSubmit(w)}catch(f){console.error("Error al aplicar filtros:",f),e.onSubmit([])}finally{const f={name:d.name,url:p.toString()};e.updateFeedCriteria(f),t.value=!1,(u=e.onLoadingChange)==null||u.call(e,!1)}};return(d,p)=>(m.openBlock(),m.createElementBlock("div",bQ,[m.createElementVNode("div",null,[p[1]||(p[1]=m.createElementVNode("label",{class:"mecano:block mecano:text-sm mecano:font-semibold mecano:text-slate-600 mecano:mb-2"},"Seleccionar origen:",-1)),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":p[0]||(p[0]=h=>n.value=h),class:"mecano:w-full mecano:px-3 mecano:py-2.5 mecano:bg-white mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:shadow-sm mecano:focus:border-emerald-400 mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:transition-all mecano:duration-200 mecano:disabled:bg-slate-100 mecano:disabled:cursor-not-allowed mecano:cursor-pointer",onChange:s,disabled:t.value},[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i.value,h=>(m.openBlock(),m.createElementBlock("option",{key:h.id,value:h.id},m.toDisplayString(h.name),9,OQ))),128))],40,CQ),[[m.vModelSelect,n.value]])]),m.createElementVNode("div",vQ,[a.value.length>0?(m.openBlock(),m.createElementBlock("div",wQ,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.value,h=>(m.openBlock(),m.createElementBlock("div",{key:h.id,class:"mecano:bg-gradient-to-br mecano:from-slate-50 mecano:to-white mecano:p-4 mecano:rounded-xl mecano:border mecano:border-slate-200"},[m.createElementVNode("label",xQ,m.toDisplayString(h.label)+":",1),h.type==="select"?(m.openBlock(),m.createElementBlock("select",{key:0,class:"mecano:w-full mecano:px-3 mecano:py-2.5 mecano:bg-white mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:shadow-sm mecano:focus:border-emerald-400 mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:transition-all mecano:duration-200 mecano:disabled:bg-slate-100 mecano:disabled:cursor-not-allowed mecano:cursor-pointer",onChange:u=>l(h.id,u.target.value),disabled:t.value},[p[2]||(p[2]=m.createElementVNode("option",{value:""},"Seleccionar...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(h.options,u=>(m.openBlock(),m.createElementBlock("option",{key:u,value:u},m.toDisplayString(u),9,kQ))),128))],40,yQ)):h.type==="date"?(m.openBlock(),m.createElementBlock("input",{key:1,type:"date",class:"mecano:w-full mecano:px-3 mecano:py-2.5 mecano:bg-white mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:shadow-sm mecano:focus:border-emerald-400 mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:transition-all mecano:duration-200 mecano:disabled:bg-slate-100 mecano:disabled:cursor-not-allowed",onChange:u=>l(h.id,u.target.value),disabled:t.value},null,40,SQ)):h.type==="text"?(m.openBlock(),m.createElementBlock("input",{key:2,type:"text",class:"mecano:w-full mecano:px-3 mecano:py-2.5 mecano:bg-white mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:shadow-sm mecano:focus:border-emerald-400 mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:transition-all mecano:duration-200 mecano:disabled:bg-slate-100 mecano:disabled:cursor-not-allowed",onInput:u=>l(h.id,u.target.value),disabled:t.value,placeholder:h.label},null,40,$Q)):m.createCommentVNode("",!0)]))),128))])):m.createCommentVNode("",!0),m.createElementVNode("button",{type:"button",onClick:c,class:"mecano:cursor-pointer mecano:w-full mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:text-white mecano:font-semibold mecano:px-4 mecano:py-3 mecano:rounded-xl mecano:shadow-md mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:hover:shadow-lg mecano:transform mecano:hover:-translate-y-0.5 mecano:transition-all mecano:duration-200 mecano:disabled:from-slate-300 mecano:disabled:to-slate-400 mecano:disabled:cursor-not-allowed mecano:disabled:transform-none mecano:disabled:shadow-none mecano:flex mecano:items-center mecano:justify-center mecano:gap-2",disabled:t.value},[t.value?(m.openBlock(),m.createElementBlock("span",QQ,"⏳")):(m.openBlock(),m.createElementBlock("span",PQ,"🔍")),m.createTextVNode(" "+m.toDisplayString(t.value?"Conectando con el feed...":"Aplicar Filtros"),1)],8,MQ)])]))}}),LQ={class:"mecano:fixed mecano:top-0 mecano:left-0 mecano:w-full mecano:h-full mecano:bg-gradient-to-br mecano:from-slate-50 mecano:via-white mecano:to-slate-100 mecano:flex mecano:flex-col z-9999 mecano:p-6"},TQ={key:0,class:"mecano:absolute mecano:inset-0 mecano:z-50 mecano:flex mecano:flex-col mecano:items-center mecano:justify-center mecano:bg-white/70 mecano:backdrop-blur-sm mecano:rounded-none"},EQ={class:"mecano:w-full mecano:flex mecano:justify-between mecano:items-center mecano:mb-4"},ZQ={class:"mecano:w-full mecano:flex-1 mecano:bg-white/60 mecano:rounded-2xl mecano:flex mecano:gap-5 mecano:p-5 mecano:overflow-hidden mecano:backdrop-blur-sm mecano:border mecano:border-slate-200 mecano:shadow-inner"},AQ={class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:gap-5"},VQ={class:"mecano:flex mecano:flex-col mecano:bg-white mecano:rounded-2xl mecano:shadow-lg mecano:border mecano:border-slate-200 mecano:p-5 mecano:overflow-y-auto"},NQ={key:0,class:"mecano:mb-4 mecano:p-4 mecano:bg-gradient-to-br mecano:from-emerald-50 mecano:to-teal-50 mecano:rounded-xl mecano:border mecano:border-emerald-200 mecano:w-full mecano:flex-shrink-0 mecano:text-sm mecano:font-medium mecano:text-emerald-700"},RQ={class:"mecano:list-none mecano:mt-3 mecano:space-y-2 mecano:text-slate-600"},BQ={class:"mecano:flex mecano:items-start mecano:gap-2"},zQ={class:"mecano:font-semibold mecano:text-slate-700"},DQ={class:"mecano:flex mecano:items-start mecano:gap-2"},jQ={class:"mecano:font-semibold mecano:text-slate-700"},XQ={class:"mecano:font-semibold mecano:text-slate-700"},IQ={class:"mecano:flex mecano:items-start mecano:gap-2"},HQ={class:"mecano:flex mecano:flex-wrap mecano:gap-2 mecano:mt-1"},WQ={class:"mecano:font-semibold mecano:text-slate-700"},qQ={class:"mecano:text-emerald-600"},YQ={class:"mecano:flex mecano:flex-col mecano:gap-4 mecano:w-full"},FQ={class:"mecano:flex mecano:items-center mecano:gap-3 mecano:cursor-pointer mecano:group"},GQ={key:0,class:"mecano:flex mecano:flex-col mecano:gap-4 mecano:ml-8 mecano:p-4 mecano:bg-gradient-to-br mecano:from-slate-50 mecano:to-white mecano:rounded-xl mecano:border mecano:border-slate-200"},_Q={class:"mecano:flex mecano:flex-col mecano:gap-2"},UQ={class:"mecano:flex mecano:flex-col mecano:gap-2"},KQ={class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:bg-white mecano:rounded-2xl mecano:shadow-lg mecano:border mecano:border-slate-200 mecano:p-5 mecano:overflow-y-auto mecano:min-h-[400px]"},JQ={class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:bg-white mecano:rounded-2xl mecano:shadow-lg mecano:border mecano:border-slate-200 mecano:p-5 mecano:overflow-y-auto"},eP={key:0,class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:items-center mecano:justify-center mecano:text-slate-400"},tP={key:1,class:"mecano:space-y-3"},oP=["onClick"],nP={class:"mecano:font-bold mecano:text-slate-800 mecano:mb-2"},rP={class:"mecano:text-sm mecano:text-slate-600 line-clamp-2"},iP={class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:bg-white mecano:rounded-2xl mecano:shadow-lg mecano:border mecano:border-slate-200 mecano:p-5 mecano:overflow-y-auto"},aP={key:0,class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:items-center mecano:justify-center mecano:text-slate-400"},lP={key:1,class:"mecano:space-y-3"},sP={class:"mecano:block mecano:text-sm mecano:font-bold mecano:text-slate-700 mecano:mb-2 mecano:flex mecano:items-center mecano:gap-2"},cP=["onUpdate:modelValue"],dP=["value"],pP={key:0,class:"mecano:mt-3 mecano:p-3 mecano:bg-gradient-to-br mecano:from-emerald-50 mecano:to-teal-50 mecano:rounded-lg mecano:border mecano:border-emerald-200"},mP={class:"mecano:mt-1 mecano:text-sm mecano:font-medium mecano:text-slate-700 mecano:break-words"},Hd=m.defineComponent({__name:"FeedComponent",props:{object:{type:Object,required:!0},toggleFeedSection:{type:Function,required:!0},updateObjectByFeedContent:{type:Function,required:!0},isProduction:{type:Boolean,default:!1},feedState:{type:Object,required:!0}},setup(o){const e=o,t=m.ref(!1),n=m.ref(e.feedState.apiResponse),r=m.ref(e.feedState.selectedContenido),i=m.ref(!1),a=m.ref(1),l=m.ref("horizontal"),s=m.ref({}),c=m.ref(null),d=v=>{n.value=v,e.feedState.apiResponse=v},p=v=>{r.value=v,e.feedState.selectedContenido=v},h=()=>{const v=e.object.fields.filter(w=>w.mappedTo).map(w=>{var O;return{fieldName:w.name,mappedTo:w.mappedTo,value:((O=r.value)==null?void 0:O[w.mappedTo])??null}});c.value={...s.value,dynamicUpdate:i.value,elementCount:a.value,orientation:l.value,mapping:v.map(({fieldName:w,mappedTo:O})=>({fieldName:w,mappedTo:O}))},e.updateObjectByFeedContent&&e.updateObjectByFeedContent(v,c.value),e.toggleFeedSection()},u=v=>{s.value=v},f=()=>{var v;(v=e.object)!=null&&v.repeat_data&&(c.value=e.object.repeat_data,i.value=e.object.repeat_data.dynamicUpdate||!1,a.value=e.object.repeat_data.elementCount||1,l.value=e.object.repeat_data.orientation||"horizontal",s.value={name:e.object.repeat_data.name,url:e.object.repeat_data.url},(e.object.repeat_data.mapping||[]).forEach(({fieldName:O,mappedTo:C})=>{const x=e.object.fields.find(y=>y.name===O);x&&(x.mappedTo=C)}))},g=()=>{c.value=null,i.value=!1,a.value=1,l.value="horizontal",s.value={},e.updateObjectByFeedContent&&e.updateObjectByFeedContent([],null)},b=()=>{var v;c.value&&(c.value={...c.value,dynamicUpdate:i.value,elementCount:a.value,orientation:l.value},e.updateObjectByFeedContent&&e.updateObjectByFeedContent(((v=c.value.mapping)==null?void 0:v.map(w=>({fieldName:w.fieldName,mappedTo:w.mappedTo,value:null})))||[],c.value))};return m.onMounted(()=>{f()}),m.watch(()=>{var v;return(v=e.object)==null?void 0:v.repeat_data},v=>{v!==c.value&&f()},{deep:!0}),(v,w)=>(m.openBlock(),m.createElementBlock("div",LQ,[m.createVNode(m.Transition,{name:"fade"},{default:m.withCtx(()=>[t.value?(m.openBlock(),m.createElementBlock("div",TQ,[...w[4]||(w[4]=[m.createElementVNode("div",{class:"mecano:w-12 mecano:h-12 mecano:border-4 mecano:border-emerald-200 mecano:border-t-emerald-500 mecano:rounded-full mecano:animate-spin mecano:mb-4"},null,-1),m.createElementVNode("p",{class:"mecano:text-sm mecano:font-semibold mecano:text-slate-600"},"Conectando con el feed...",-1)])])):m.createCommentVNode("",!0)]),_:1}),m.createElementVNode("div",EQ,[w[6]||(w[6]=m.createElementVNode("h2",{class:"mecano:text-xl mecano:font-bold mecano:bg-gradient-to-r mecano:from-slate-700 mecano:to-slate-500 mecano:bg-clip-text mecano:text-transparent mecano:flex mecano:items-center mecano:gap-3"},[m.createElementVNode("span",{class:"mecano:text-xl"},"🍺"),m.createTextVNode(" Configuración de Feed ")],-1)),m.createElementVNode("button",{onClick:w[0]||(w[0]=(...O)=>o.toggleFeedSection&&o.toggleFeedSection(...O)),class:"mecano:cursor-pointer mecano:group mecano:w-10 mecano:h-10 mecano:flex mecano:items-center mecano:justify-center mecano:bg-white mecano:hover:bg-red-50 mecano:border mecano:border-red-200 mecano:hover:border-red-400 mecano:text-red-400 mecano:hover:text-red-600 mecano:rounded-full mecano:font-semibold mecano:shadow-sm mecano:hover:shadow-lg mecano:transition-all mecano:duration-200"},[...w[5]||(w[5]=[m.createElementVNode("span",{class:"mecano:text-lg"},"✕",-1)])])]),m.createElementVNode("div",ZQ,[m.createElementVNode("div",AQ,[m.createElementVNode("div",VQ,[c.value&&c.value.dynamicUpdate?(m.openBlock(),m.createElementBlock("div",NQ,[m.createElementVNode("div",{class:"mecano:flex mecano:justify-between mecano:items-start"},[w[9]||(w[9]=m.createElementVNode("p",{class:"mecano:flex mecano:items-center mecano:gap-2"},[m.createElementVNode("span",{class:"mecano:text-emerald-500"},"✓"),m.createTextVNode(" Hay un criterio de feed establecido: ")],-1)),m.createElementVNode("div",{class:"mecano:flex mecano:items-center mecano:gap-2"},[m.createElementVNode("button",{onClick:b,class:"mecano:cursor-pointer mecano:px-3 mecano:py-1.5 mecano:bg-white mecano:hover:bg-emerald-50 mecano:text-emerald-500 mecano:hover:text-emerald-600 mecano:border mecano:border-emerald-200 mecano:hover:border-emerald-300 mecano:rounded-lg mecano:text-xs mecano:font-semibold mecano:transition-all mecano:duration-200 mecano:flex mecano:items-center mecano:gap-1 mecano:shadow-sm"},[...w[7]||(w[7]=[m.createElementVNode("span",null,"💾",-1),m.createTextVNode(" Guardar ",-1)])]),m.createElementVNode("button",{onClick:g,class:"mecano:cursor-pointer mecano:px-3 mecano:py-1.5 mecano:bg-white mecano:hover:bg-red-50 mecano:text-red-500 mecano:hover:text-red-600 mecano:border mecano:border-red-200 mecano:hover:border-red-300 mecano:rounded-lg mecano:text-xs mecano:font-semibold mecano:transition-all mecano:duration-200 mecano:flex mecano:items-center mecano:gap-1 mecano:shadow-sm"},[...w[8]||(w[8]=[m.createElementVNode("span",null,"✕",-1),m.createTextVNode(" Borrar ",-1)])])])]),m.createElementVNode("ul",RQ,[m.createElementVNode("li",BQ,[w[10]||(w[10]=m.createElementVNode("span",{class:"mecano:text-emerald-400"},"→",-1)),w[11]||(w[11]=m.createTextVNode(" Conectar con ",-1)),m.createElementVNode("span",zQ,m.toDisplayString(c.value.name),1)]),m.createElementVNode("li",DQ,[w[12]||(w[12]=m.createElementVNode("span",{class:"mecano:text-emerald-400"},"→",-1)),w[13]||(w[13]=m.createTextVNode(" Recuperar ",-1)),m.createElementVNode("span",jQ,m.toDisplayString(c.value.elementCount),1),w[14]||(w[14]=m.createTextVNode(" items (",-1)),m.createElementVNode("span",XQ,m.toDisplayString(c.value.orientation),1),w[15]||(w[15]=m.createTextVNode(")",-1))]),m.createElementVNode("li",IQ,[w[18]||(w[18]=m.createElementVNode("span",{class:"mecano:text-emerald-400"},"→",-1)),m.createElementVNode("div",null,[w[17]||(w[17]=m.createTextVNode(" Mapeo: ",-1)),m.createElementVNode("div",HQ,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(c.value.mapping,(O,C)=>(m.openBlock(),m.createElementBlock("span",{key:C,class:"mecano:inline-flex mecano:items-center mecano:gap-1 mecano:px-2 mecano:py-0.5 mecano:bg-white mecano:rounded-full mecano:text-xs mecano:border mecano:border-slate-200"},[m.createElementVNode("span",WQ,m.toDisplayString(O.fieldName),1),w[16]||(w[16]=m.createElementVNode("span",{class:"mecano:text-slate-400"},"←",-1)),m.createElementVNode("span",qQ,m.toDisplayString(O.mappedTo),1)]))),128))])])])])])):m.createCommentVNode("",!0),m.createElementVNode("div",YQ,[m.createElementVNode("label",FQ,[m.withDirectives(m.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":w[1]||(w[1]=O=>i.value=O),class:"mecano:w-5 mecano:h-5 mecano:text-emerald-500 mecano:border-2 mecano:border-slate-300 mecano:rounded mecano:focus:ring-emerald-500 mecano:cursor-pointer"},null,512),[[m.vModelCheckbox,i.value]]),w[19]||(w[19]=m.createElementVNode("span",{class:"mecano:font-medium mecano:text-slate-700 mecano:group-hover:text-slate-900 mecano:transition-colors"},"Actualizar dinámicamente según criterios del feed",-1))]),i.value?(m.openBlock(),m.createElementBlock("div",GQ,[w[23]||(w[23]=m.createElementVNode("div",{class:"mecano:p-3 mecano:bg-gradient-to-r mecano:from-amber-50 mecano:to-yellow-50 mecano:rounded-lg mecano:border mecano:border-amber-200 mecano:text-sm mecano:text-amber-700"},[m.createElementVNode("div",{class:"mecano:flex mecano:items-start mecano:gap-2"},[m.createElementVNode("span",{class:"mecano:text-amber-500 mecano:mt-0.5"},"ℹ️"),m.createElementVNode("p",null,[m.createElementVNode("strong",null,"Nota:"),m.createTextVNode(" Los valores que verás al relacionar campos son solo un ejemplo de referencia. En el momento de renderizar, se mostrarán los datos reales obtenidos del feed según los criterios configurados. ")])])],-1)),m.createElementVNode("div",_Q,[w[20]||(w[20]=m.createElementVNode("label",{class:"mecano:text-sm mecano:font-semibold mecano:text-slate-600"},"Cantidad de elementos:",-1)),m.withDirectives(m.createElementVNode("input",{type:"number","onUpdate:modelValue":w[2]||(w[2]=O=>a.value=O),min:"1",class:"mecano:w-32 mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:transition-colors"},null,512),[[m.vModelText,a.value,void 0,{number:!0}]])]),m.createElementVNode("div",UQ,[w[22]||(w[22]=m.createElementVNode("label",{class:"mecano:text-sm mecano:font-semibold mecano:text-slate-600"},"Orientación:",-1)),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":w[3]||(w[3]=O=>l.value=O),class:"mecano:w-48 mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-white mecano:transition-colors mecano:cursor-pointer"},[...w[21]||(w[21]=[m.createElementVNode("option",{value:"horizontal",selected:""},"Horizontal",-1),m.createElementVNode("option",{value:"vertical"},"Vertical",-1)])],512),[[m.vModelSelect,l.value]])])])):m.createCommentVNode("",!0)])]),m.createElementVNode("div",KQ,[w[24]||(w[24]=m.createElementVNode("h3",{class:"mecano:text-lg mecano:font-bold mecano:mb-5 mecano:text-slate-700 mecano:pb-2 mecano:flex mecano:items-center mecano:gap-2 mecano:border-b mecano:border-slate-100"},[m.createElementVNode("span",{class:"mecano:text-xl"},"🔍"),m.createTextVNode(" Orígenes y Filtros ")],-1)),m.createVNode(Id,{onSubmit:d,updateFeedCriteria:u,isProduction:o.isProduction,onLoadingChange:O=>t.value=O},null,8,["isProduction","onLoadingChange"])])]),m.createElementVNode("div",JQ,[w[26]||(w[26]=m.createElementVNode("h3",{class:"mecano:text-lg mecano:font-bold mecano:mb-5 mecano:text-slate-700 mecano:pb-2 mecano:flex mecano:items-center mecano:gap-2 mecano:border-b mecano:border-slate-100"},[m.createElementVNode("span",{class:"mecano:text-xl"},"📰"),m.createTextVNode(" Contenidos ")],-1)),!n.value||n.value.length===0?(m.openBlock(),m.createElementBlock("div",eP,[...w[25]||(w[25]=[m.createElementVNode("span",{class:"mecano:text-5xl mecano:mb-3 mecano:opacity-50"},"📭",-1),m.createElementVNode("p",{class:"mecano:text-sm mecano:font-medium"},"No hay contenidos disponibles",-1),m.createElementVNode("p",{class:"mecano:text-xs mecano:mt-1 mecano:text-slate-300"},"Selecciona un origen para cargar contenidos",-1)])])):(m.openBlock(),m.createElementBlock("ul",tP,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(n.value,(O,C)=>(m.openBlock(),m.createElementBlock("li",{key:C,class:"mecano:p-4 mecano:bg-gradient-to-br mecano:from-slate-50 mecano:to-white mecano:rounded-xl mecano:shadow-sm mecano:hover:shadow-md mecano:cursor-pointer mecano:hover:scale-[1.01] mecano:transition-all mecano:duration-200 mecano:border mecano:border-slate-200 mecano:hover:border-emerald-300",onClick:x=>p(O)},[m.createElementVNode("h4",nP,m.toDisplayString(O.title||O.titulo||"Sin título"),1),m.createElementVNode("p",rP,m.toDisplayString(O.description||O.descripcion||O.content||"Sin descripción"),1)],8,oP))),128))]))]),m.createElementVNode("div",iP,[w[32]||(w[32]=m.createElementVNode("h3",{class:"mecano:text-lg mecano:font-bold mecano:mb-5 mecano:text-slate-700 mecano:pb-2 mecano:flex mecano:items-center mecano:gap-2 mecano:border-b mecano:border-slate-100"},[m.createElementVNode("span",{class:"mecano:text-xl"},"🔗"),m.createTextVNode(" Relacionar Contenido ")],-1)),r.value?(m.openBlock(),m.createElementBlock("div",lP,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(o.object.fields,(O,C)=>(m.openBlock(),m.createElementBlock("div",{key:C,class:"mecano:p-4 mecano:bg-gradient-to-br mecano:from-slate-50 mecano:to-white mecano:rounded-xl mecano:border mecano:border-slate-200"},[m.createElementVNode("label",sP,[w[28]||(w[28]=m.createElementVNode("span",{class:"mecano:text-base"},"⚙️",-1)),m.createTextVNode(" "+m.toDisplayString(O.name),1)]),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":x=>O.mappedTo=x,class:"mecano:w-full mecano:px-3 mecano:py-2.5 mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:transition-all mecano:bg-white mecano:cursor-pointer"},[w[29]||(w[29]=m.createElementVNode("option",{value:""},"-- Seleccionar campo --",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(r.value,(x,y)=>(m.openBlock(),m.createElementBlock("option",{key:y,value:y},m.toDisplayString(y),9,dP))),128))],8,cP),[[m.vModelSelect,O.mappedTo]]),O.mappedTo?(m.openBlock(),m.createElementBlock("div",pP,[w[30]||(w[30]=m.createElementVNode("span",{class:"mecano:text-xs mecano:font-semibold mecano:text-emerald-600 mecano:uppercase mecano:tracking-wide"},"Vista previa:",-1)),m.createElementVNode("p",mP,m.toDisplayString(r.value[O.mappedTo]),1)])):m.createCommentVNode("",!0)]))),128)),m.createElementVNode("button",{onClick:h,class:"mecano:cursor-pointer mecano:w-full mecano:mt-4 mecano:px-5 mecano:py-3 mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:text-white mecano:font-semibold mecano:rounded-xl mecano:shadow-md mecano:hover:shadow-lg mecano:transition-all mecano:duration-200 mecano:transform mecano:hover:scale-[1.01] mecano:flex mecano:items-center mecano:justify-center mecano:gap-2"},[...w[31]||(w[31]=[m.createElementVNode("span",{class:"mecano:text-lg"},"✓",-1),m.createElementVNode("span",null,"Alimentar el componente",-1)])])])):(m.openBlock(),m.createElementBlock("div",aP,[...w[27]||(w[27]=[m.createElementVNode("span",{class:"mecano:text-5xl mecano:mb-3 mecano:opacity-50"},"👆",-1),m.createElementVNode("p",{class:"mecano:text-sm mecano:font-medium mecano:text-center"},[m.createTextVNode("Selecciona un contenido"),m.createElementVNode("br"),m.createTextVNode("para relacionar")],-1)])]))])])]))}}),hP={class:"mecano:absolute mecano:-top-2.5 mecano:left-3 mecano:text-[11px] mecano:font-medium mecano:tracking-wide mecano:bg-gradient-to-r mecano:from-slate-700 mecano:to-slate-600 mecano:text-white mecano:px-3 mecano:py-0.5 mecano:rounded-full mecano:shadow-sm"},uP={class:"mecano:w-full mecano:text-right mecano:flex mecano:justify-between mecano:items-center mecano:mt-1"},fP={class:"mecano:flex mecano:gap-3 mecano:items-center"},gP={class:"mecano:bg-rose-50 mecano:border mecano:border-rose-200 mecano:text-rose-500 mecano:px-2 mecano:py-0.5 mecano:text-[10px] mecano:font-semibold mecano:uppercase mecano:tracking-wider mecano:rounded-md"},bP={key:0,class:"mecano:flex-1 mecano:flex mecano:justify-center mecano:gap-2"},CP={class:"mecano:flex mecano:justify-end mecano:items-center mecano:gap-3"},OP={class:"mecano:bg-violet-50 mecano:border mecano:border-violet-200 mecano:text-violet-600 mecano:rounded-md mecano:px-2 mecano:py-0.5 mecano:text-[10px] mecano:font-semibold mecano:uppercase mecano:tracking-wider"},vP={key:0,class:"mecano:flex mecano:gap-1 mecano:bg-slate-50 mecano:rounded-lg mecano:p-1"},wP={key:0,class:"mecano:text-[10px] mecano:bg-amber-100 mecano:text-amber-700 mecano:px-1.5 mecano:rounded-full mecano:font-medium"},xP={class:"mecano:mt-2 mecano:flex mecano:items-center"},yP={class:"mecano:font-medium mecano:text-slate-700"},kP={key:0},SP={key:1},$P={key:0,class:"mecano:mt-3 mecano:p-3 mecano:bg-gradient-to-r mecano:from-sky-50 mecano:to-blue-50 mecano:rounded-lg mecano:text-sm mecano:text-slate-600 mecano:border mecano:border-sky-100"},MP={class:"mecano:mt-3 mecano:flex mecano:gap-1.5 mecano:flex-wrap"},QP={class:"mecano:absolute mecano:top-2 mecano:right-2 mecano:group/info mecano:z-10 mecano:pointer-events-auto"},PP={class:"mecano:absolute mecano:top-6 mecano:right-0 mecano:w-64 mecano:p-3 mecano:bg-white mecano:rounded-lg mecano:shadow-lg mecano:border mecano:border-slate-200 mecano:opacity-0 mecano:invisible mecano:group-hover/info:opacity-100 mecano:group-hover/info:visible mecano:transition-all mecano:duration-200 mecano:text-xs mecano:text-slate-600 mecano:leading-relaxed"},LP={class:"mecano:flex mecano:flex-wrap mecano:justify-center mecano:content-center mecano:h-full mecano:items-center mecano:p-4 mecano:gap-3 mecano:pointer-events-auto mecano:overflow-y-auto"},TP={key:0,title:"Mover componente",class:"handle mecano:cursor-grab mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-sky-500 mecano:hover:border-sky-500 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},EP={key:1,class:"mecano:flex-1 mecano:flex mecano:justify-center mecano:items-center mecano:gap-3"},ZP={class:"mecano:flex mecano:flex-col mecano:items-center"},AP={key:0,class:"mecano:text-[10px] mecano:mt-0.5 mecano:opacity-70"},VP={key:0,class:"mecano:flex mecano:flex-col mecano:items-center mecano:gap-2 mecano:bg-white mecano:border mecano:border-red-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:shadow-sm"},NP={class:"mecano:flex mecano:gap-2"},RP=["id"],fc=m.defineComponent({__name:"InitialComponent",props:{object:{type:Object,required:!0},columnToInsert:Object,isComponentMode:Boolean,fullwidthMode:Boolean,addComponentToColumn:Function,removeComponent:Function,cloneComponent:Function,section:String,renderApiDomain:String,insideComponentBox:{type:Boolean,default:!1},isProduction:{type:Boolean,default:!1},ateneaToken:String,ledithorAiTools:Array,previewWidth:String},setup(o){const e=["Contenido de Texto","Contenido de Imagen","Contenido con listas","Imagen"],t=o,n={DEV:"https://led-dev-limbo-dev.eu.els.local",PROD:"https://limbo.lefebvre.es"},r=D=>D?D.startsWith("/files/")?(t.isProduction?n.PROD:n.DEV)+D:D:"",i=D=>{var H,K;if(!D)return"";const M=D.replace(/&quot;/g,'"').replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#39;/g,"'");try{const l2=JSON.parse(M),w2=h2=>h2&&!h2.startsWith("blob:"),r2=(H=l2.images)==null?void 0:H.find(h2=>w2(h2==null?void 0:h2.url));return r2?r(r2.url):w2((K=l2.original)==null?void 0:K.url)?r(l2.original.url):w2(l2.url)?r(l2.url):""}catch{return M.startsWith("blob:")?"":M.startsWith("/files/")?r(M):M.startsWith("http")||M.startsWith("/")?M:D.startsWith("{")?"":D}},a=Math.random().toString(36).substring(2,15),l=m.ref(!1),s=m.ref(!1),c=m.ref(!1),d=m.ref(!1),p=m.ref(null),h=m.ref(null),u=m.ref(!1),f=m.ref(!1),g=m.reactive({apiResponse:null,selectedContenido:null}),b=m.ref({}),v=m.computed(()=>e.length>0&&e.includes(t.object.category??""));m.watch(()=>t.isComponentMode,D=>{D||w()}),m.watch(()=>t.object,()=>{w()},{deep:!0}),m.watch(u,async D=>{D&&(await m.nextTick(),e2())});const w=()=>{p.value&&clearTimeout(p.value),p.value=setTimeout(()=>{e2()},500)},O=()=>{if(t.isComponentMode)return;const D=new IntersectionObserver(M=>{M.forEach(H=>{H.isIntersecting&&!u.value&&(u.value=!0,D.disconnect())})},{threshold:.1});h.value&&D.observe(h.value)},C=(D,M)=>{const H=(t.object.fields||[]).find(K=>K.name===D);H&&(H.example_value=M)},x=(D,M)=>{D.forEach(H=>{H.value!==void 0&&C(H.fieldName,H.value)}),t.object.repeat_data=M},y=()=>{d.value=!d.value},k=()=>{f.value=!f.value},$=(D,M)=>{console.log("[InitialComponent] Field updated from FieldsForm:",D,M),w()},T=(D,M)=>{b.value[D]=M,w()},N=()=>{const M={desktop:1200,tablet:768,mobile:375}[t.previewWidth??"desktop"]??1200;e2(!0).then(H=>{const K=window.open("","Preview",`width=${M},height=800`);if(!K){alert("El navegador bloqueó la ventana emergente. Por favor, permite los popups para este sitio.");return}K.document.body.innerHTML=U(H);const l2=K.document.createElement("style");l2.textContent="body { container-type: inline-size; }",K.document.head.appendChild(l2),K.document.querySelectorAll("script").forEach(r2=>{var X2;const h2=K.document.createElement("script");r2.src?h2.src=r2.src:h2.textContent=r2.textContent,(X2=r2.parentNode)==null||X2.replaceChild(h2,r2)}),K.document.close()})},P=D=>{const M=new Set;for(const K of D.fields||[])if(K.exclusive_group){const l2=b.value[K.exclusive_group];l2&&l2!==K.name&&M.add(K.name)}const H=D.fields.map(K=>{if(M.has(K.name))return{...K,example_value:""};if(K.type==="image"&&typeof K.example_value=="string"){const l2=i(K.example_value);return{...K,example_value:l2||K.example_value}}return K.type==="video"?{...K}:K});return{...D,fields:H}},Z=D=>{var H;const M=document.getElementById(a);(H=M==null?void 0:M.contentWindow)==null||H.scrollBy({top:D.deltaY,left:D.deltaX})},U=D=>{let M=D.replace(/\bclass=(["'])([^"']*)\1/g,(H,K,l2)=>{const w2=l2.replace(/(^|\s)((?:2xl|xl|lg|md|sm):)/g,"$1@$2");return`class=${K}${w2}${K}`});return M=M.replace(/(<style[^>]*>)([\s\S]*?)(<\/style>)/gi,(H,K,l2,w2)=>{const r2=l2.replace(/@media\s*\(\s*min-width\s*:\s*(\d+(?:\.\d+)?px)\s*\)/g,"@container (min-width: $1)").replace(/\.((?:2xl|xl|lg|md|sm)\\:)/g,".\\@$1");return K+r2+w2}),M},e2=(D=!1)=>{var l2;if(!((l2=t.object)!=null&&l2.category)||t.object.category==="Repetidor"){const w2='<div style="color:white; padding: 1em 2em;background-color:#001978;border-radius:1em;border:4px solid #711978;">Componente que contiene elementos repetidos: TODO: GENERAR PREVIEW DE REPETIDORES</div>';if(D)return Promise.resolve(w2);const r2=document.getElementById(a);return r2&&(r2.srcdoc=w2),Promise.resolve("")}const M=t.renderApiDomain?t.renderApiDomain+"/api/preview-comp/":"http://localhost:8003/api/preview-comp/",H=P(t.object),K=JSON.stringify({obj:H},null,2);return fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:K}).then(w2=>w2.text()).then(w2=>{if(D)return w2;const r2=document.getElementById(a);return r2&&(r2.srcdoc=w2,r2.onload=()=>{var Se;const X2=((Se=r2.contentDocument)==null?void 0:Se.documentElement.scrollHeight)??500;r2.style.height=Math.min(X2,500)+"px"}),""})};return m.onMounted(()=>{O()}),(D,M)=>(m.openBlock(),m.createElementBlock("div",null,[f.value?(m.openBlock(),m.createBlock(Hd,{key:0,updateObjectByFeedContent:x,toggleFeedSection:k,object:o.object,isProduction:o.isProduction,feedState:g},null,8,["object","isProduction","feedState"])):m.createCommentVNode("",!0),m.createElementVNode("div",{ref_key:"rootElement",ref:h,class:m.normalizeClass(["mecano:min-h-[100px] mecano:relative mecano:group/component mecano:hover:shadow-lg mecano:hover:shadow-slate-200/50 mecano:duration-300 mecano:ease-out js-draggable-element mecano:text-slate-600 mecano:border mecano:border-slate-200 mecano:hover:border-slate-300 mecano:px-5 mecano:pt-3 mecano:pb-4 mecano:w-full mecano:bg-white mecano:inline-block mecano:rounded-xl mecano:flex mecano:flex-col mecano:mt-4 z-0 shadow-sm",[{"mecano:overflow-hidden":!o.isComponentMode},d.value?"mecano:border-amber-400 mecano:ring-2 mecano:ring-amber-300 mecano:shadow-amber-100":"mecano:border-slate-200 mecano:hover:border-slate-300"]])},[o.isComponentMode?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.createElementVNode("span",hP,m.toDisplayString(o.object.component_name),1),m.createElementVNode("div",uP,[m.createElementVNode("div",fP,[M[19]||(M[19]=m.createElementVNode("div",{class:"handle mecano:cursor-grab mecano:text-slate-400 mecano:hover:text-slate-600 mecano:text-lg mecano:transition-colors"},[m.createElementVNode("svg",{class:"mecano:w-5 mecano:h-5",fill:"currentColor",viewBox:"0 0 20 20"},[m.createElementVNode("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})])],-1)),m.createElementVNode("span",gP,m.toDisplayString(o.object.category),1)]),o.fullwidthMode?(m.openBlock(),m.createElementBlock("div",bP,[m.createElementVNode("div",{class:"mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:text-white mecano:rounded-lg mecano:px-4 mecano:py-1.5 mecano:text-xs mecano:font-medium mecano:cursor-pointer mecano:shadow-sm mecano:hover:shadow mecano:transition-all mecano:duration-200",onClick:M[0]||(M[0]=H=>{var K;return(K=o.addComponentToColumn)==null?void 0:K.call(o,o.object)})},"Seleccionar"),m.createElementVNode("div",{class:"mecano:bg-white mecano:border mecano:border-slate-200 mecano:hover:bg-slate-50 mecano:text-slate-600 mecano:rounded-lg mecano:px-4 mecano:py-1.5 mecano:text-xs mecano:font-medium mecano:cursor-pointer mecano:shadow-sm mecano:hover:shadow mecano:transition-all mecano:duration-200",onClick:M[1]||(M[1]=H=>N()),title:"Ver preview en ventana nueva"},"🔍 Previsualizar")])):m.createCommentVNode("",!0),m.createElementVNode("div",CP,[m.createElementVNode("span",OP,m.toDisplayString(o.object.framework),1),o.insideComponentBox?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",vP,[m.createElementVNode("div",{title:"Previsualizar Dummy",onClick:M[2]||(M[2]=H=>N()),class:"mecano:p-1.5 mecano:rounded-md mecano:hover:bg-white mecano:hover:shadow-sm mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-base"},"🔍"),m.createElementVNode("div",{title:"Editar configuración",onClick:M[3]||(M[3]=H=>d.value=!d.value),class:"mecano:p-1.5 mecano:rounded-md mecano:hover:bg-white mecano:hover:shadow-sm mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-base"},"⚙️"),v.value?(m.openBlock(),m.createElementBlock("div",{key:0,title:"Beber de contenido",onClick:k,class:"mecano:p-1.5 mecano:rounded-md mecano:hover:bg-sky-50 mecano:hover:shadow-sm mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-base mecano:flex mecano:items-center mecano:gap-1"},[M[20]||(M[20]=m.createTextVNode("⚡ ",-1)),o.object.repeat_data?(m.openBlock(),m.createElementBlock("span",wP,m.toDisplayString(o.object.repeat_data.elementCount),1)):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0),o.cloneComponent?(m.openBlock(),m.createElementBlock("div",{key:1,title:"Clonar componente",onClick:M[4]||(M[4]=H=>o.cloneComponent(o.object,o.section||"")),class:"mecano:p-1.5 mecano:rounded-md mecano:hover:bg-sky-50 mecano:hover:shadow-sm mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-base"},"📋")):m.createCommentVNode("",!0),o.removeComponent?(m.openBlock(),m.createElementBlock(m.Fragment,{key:2},[s.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[M[21]||(M[21]=m.createElementVNode("span",{class:"mecano:text-[10px] mecano:text-red-600 mecano:font-medium mecano:self-center mecano:px-1"},"¿Eliminar?",-1)),m.createElementVNode("div",{onClick:M[5]||(M[5]=H=>{o.removeComponent(o.object,o.section||""),s.value=!1}),class:"mecano:p-1.5 mecano:rounded-md mecano:bg-red-500 mecano:text-white mecano:hover:bg-red-600 mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-[10px] mecano:font-medium"},"Sí"),m.createElementVNode("div",{onClick:M[6]||(M[6]=H=>s.value=!1),class:"mecano:p-1.5 mecano:rounded-md mecano:bg-slate-100 mecano:hover:bg-slate-200 mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-[10px] mecano:font-medium"},"No")],64)):(m.openBlock(),m.createElementBlock("div",{key:1,title:"Eliminar componente",onClick:M[7]||(M[7]=H=>s.value=!0),class:"mecano:p-1.5 mecano:rounded-md mecano:hover:bg-red-50 mecano:hover:shadow-sm mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-base"},"🗑️"))],64)):m.createCommentVNode("",!0)]))])]),m.createVNode(Ul,{toggleShowForm:y,object:o.object,showForm:d.value,ateneaToken:t.ateneaToken,ledithorAiTools:t.ledithorAiTools,onFieldUpdated:$,onExclusiveFieldChanged:T},null,8,["object","showForm","ateneaToken","ledithorAiTools"]),m.createElementVNode("div",xP,[m.createElementVNode("span",yP,m.toDisplayString(o.object.name),1),m.createElementVNode("button",{type:"button",onClick:M[8]||(M[8]=H=>l.value=!l.value),class:"mecano:ms-2 mecano:cursor-pointer mecano:text-xs mecano:text-slate-400 mecano:hover:text-slate-600 mecano:transition-colors mecano:w-5 mecano:h-5 mecano:rounded-full mecano:hover:bg-slate-100 mecano:flex mecano:items-center mecano:justify-center"},[l.value?(m.openBlock(),m.createElementBlock("span",SP,"▲")):(m.openBlock(),m.createElementBlock("span",kP,"▼"))])]),l.value?(m.openBlock(),m.createElementBlock("div",$P,m.toDisplayString(o.object.description),1)):m.createCommentVNode("",!0),m.createElementVNode("div",MP,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(o.object.tags,(H,K)=>(m.openBlock(),m.createElementBlock("span",{key:K,class:"mecano:bg-slate-50 mecano:text-slate-500 mecano:px-2.5 mecano:py-1 mecano:rounded-full mecano:text-[11px] mecano:font-medium mecano:border mecano:border-slate-100 mecano:hover:border-slate-200 mecano:hover:bg-slate-100 mecano:transition-colors mecano:cursor-default"},m.toDisplayString(H),1))),128))])],64)):u.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:1},[m.createElementVNode("div",{class:m.normalizeClass(["mecano:absolute mecano:top-0 mecano:left-0 mecano:w-full mecano:h-full mecano:opacity-0 mecano:bg-gradient-to-br mecano:from-white/90 mecano:via-slate-50/95 mecano:to-slate-100/90 mecano:backdrop-blur-[2px] z-99 mecano:transition-all mecano:duration-300 mecano:rounded-xl",!c.value&&"mecano:group-hover/component:opacity-100"])},[m.createElementVNode("div",QP,[M[23]||(M[23]=m.createElementVNode("div",{class:"mecano:w-5 mecano:h-5 mecano:rounded-full mecano:bg-slate-100 mecano:hover:bg-sky-100 mecano:border mecano:border-slate-200 mecano:hover:border-sky-300 mecano:flex mecano:items-center mecano:justify-center mecano:cursor-help mecano:transition-colors mecano:duration-200"},[m.createElementVNode("svg",{class:"mecano:w-3 mecano:h-3 mecano:text-slate-400 mecano:group-hover/info:text-sky-500",fill:"currentColor",viewBox:"0 0 20 20"},[m.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})])],-1)),m.createElementVNode("div",PP,[m.createElementVNode("b",null,m.toDisplayString(o.object.component_name),1),M[22]||(M[22]=m.createElementVNode("br",null,null,-1)),m.createTextVNode(m.toDisplayString(o.object.description),1)])]),m.createElementVNode("div",LP,[o.insideComponentBox&&!o.fullwidthMode||!o.insideComponentBox?(m.openBlock(),m.createElementBlock("div",TP,[...M[24]||(M[24]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("svg",{class:"mecano:w-6 mecano:h-6 mecano:mb-1 mecano:text-slate-400 mecano:group-hover/btn:text-white",fill:"currentColor",viewBox:"0 0 20 20"},[m.createElementVNode("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})]),m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Mover")],-1)])])):m.createCommentVNode("",!0),o.insideComponentBox&&o.fullwidthMode?(m.openBlock(),m.createElementBlock("div",EP,[m.createElementVNode("div",{title:"Agregar componente a la columna",onClick:M[9]||(M[9]=H=>{var K;return(K=o.addComponentToColumn)==null?void 0:K.call(o,o.object)}),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:text-white mecano:px-6 mecano:py-3 mecano:rounded-xl mecano:shadow-md mecano:hover:shadow-lg mecano:transition-all mecano:duration-200"},[...M[25]||(M[25]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-2xl mecano:mb-1"},"🚀"),m.createElementVNode("span",{class:"mecano:text-sm mecano:font-medium"},"Seleccionar")],-1)])]),m.createElementVNode("div",{title:"Ver preview en ventana nueva",onClick:M[10]||(M[10]=H=>N()),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:hover:bg-slate-50 mecano:text-slate-600 mecano:px-6 mecano:py-3 mecano:rounded-xl mecano:shadow-md mecano:hover:shadow-lg mecano:transition-all mecano:duration-200"},[...M[26]||(M[26]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-2xl mecano:mb-1"},"🔍"),m.createElementVNode("span",{class:"mecano:text-sm mecano:font-medium"},"Previsualizar")],-1)])])])):m.createCommentVNode("",!0),o.insideComponentBox?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock(m.Fragment,{key:2},[m.createElementVNode("div",{title:"Ver preview en ventana nueva",onClick:M[11]||(M[11]=H=>N()),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-sky-500 mecano:hover:border-sky-500 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},[...M[27]||(M[27]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-xl mecano:mb-1"},"🔍"),m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Previsualizar")],-1)])]),m.createElementVNode("div",{title:"Configurar componente",onClick:M[12]||(M[12]=H=>d.value=!d.value),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-sky-500 mecano:hover:border-sky-500 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},[...M[28]||(M[28]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-xl mecano:mb-1"},"⚙️"),m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Configurar")],-1)])]),v.value?(m.openBlock(),m.createElementBlock("div",{key:0,title:"Configurar componente",onClick:k,class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-sky-500 mecano:hover:border-sky-500 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},[m.createElementVNode("div",ZP,[M[29]||(M[29]=m.createElementVNode("span",{class:"mecano:text-xl mecano:mb-1"},"⚡",-1)),M[30]||(M[30]=m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Beber de contenido",-1)),o.object.repeat_data&&o.object.repeat_data.dynamicUpdate?(m.openBlock(),m.createElementBlock("span",AP,"Carga "+m.toDisplayString(o.object.repeat_data.elementCount)+" elementos",1)):m.createCommentVNode("",!0)])])):m.createCommentVNode("",!0),o.cloneComponent?(m.openBlock(),m.createElementBlock("div",{key:1,title:"Clonar componente",onClick:M[13]||(M[13]=H=>o.cloneComponent(o.object,o.section||"")),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-sky-500 mecano:hover:border-sky-500 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},[...M[31]||(M[31]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-xl mecano:mb-1"},"📋"),m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Clonar")],-1)])])):m.createCommentVNode("",!0),o.removeComponent?(m.openBlock(),m.createElementBlock(m.Fragment,{key:2},[s.value?(m.openBlock(),m.createElementBlock("div",VP,[M[32]||(M[32]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-red-600 mecano:font-medium"},"¿Eliminar?",-1)),m.createElementVNode("div",NP,[m.createElementVNode("div",{onClick:M[14]||(M[14]=H=>{o.removeComponent(o.object,o.section||""),s.value=!1}),class:"mecano:cursor-pointer mecano:bg-red-500 mecano:hover:bg-red-600 mecano:text-white mecano:px-3 mecano:py-1 mecano:rounded-lg mecano:text-xs mecano:font-medium mecano:transition-all mecano:duration-200"},"Sí"),m.createElementVNode("div",{onClick:M[15]||(M[15]=H=>s.value=!1),class:"mecano:cursor-pointer mecano:bg-slate-100 mecano:hover:bg-slate-200 mecano:text-slate-600 mecano:px-3 mecano:py-1 mecano:rounded-lg mecano:text-xs mecano:font-medium mecano:transition-all mecano:duration-200"},"No")])])):(m.openBlock(),m.createElementBlock("div",{key:1,title:"Eliminar componente",onClick:M[16]||(M[16]=H=>s.value=!0),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-red-500 mecano:text-white mecano:border mecano:border-red-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-red-700 mecano:hover:border-red-800 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},[...M[33]||(M[33]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-xl mecano:mb-1"},"🗑️"),m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Eliminar")],-1)])]))],64)):m.createCommentVNode("",!0)],64))]),m.createElementVNode("div",{class:"mecano:absolute mecano:bottom-2 mecano:left-1/2 mecano:-translate-x-1/2 mecano:flex mecano:items-center mecano:gap-1.5 mecano:bg-white/80 mecano:border mecano:border-slate-200 mecano:rounded-full mecano:px-3 mecano:py-1.5 mecano:cursor-ns-resize mecano:select-none mecano:text-slate-500 mecano:text-xs mecano:hover:bg-white mecano:hover:text-slate-700 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:whitespace-nowrap",onWheel:m.withModifiers(Z,["prevent"]),onMouseenter:M[17]||(M[17]=H=>c.value=!0),onMouseleave:M[18]||(M[18]=H=>c.value=!1),title:"Scroll aquí para navegar el preview"},[...M[34]||(M[34]=[m.createElementVNode("svg",{class:"mecano:w-3 mecano:h-3 mecano:flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 16V4m0 0L3 8m4-4l4 4M17 8v12m0 0l4-4m-4 4l-4-4"})],-1),m.createElementVNode("span",null,"Scroll preview",-1)])],32)],2),m.createVNode(Ul,{toggleShowForm:y,object:o.object,showForm:d.value,ateneaToken:t.ateneaToken,ledithorAiTools:t.ledithorAiTools,onFieldUpdated:$,onExclusiveFieldChanged:T},null,8,["object","showForm","ateneaToken","ledithorAiTools"]),m.createElementVNode("iframe",{id:m.unref(a),class:"mecano:w-full mecano:block",style:{"min-height":"60px",border:"none"}},null,8,RP)],64)):m.createCommentVNode("",!0)],2)]))}}),BP={class:"mecano:absolute mecano:top-1 mecano:left-2 mecano:px-2 mecano:flex mecano:gap-3 mecano:items-center"},zP={key:0,class:"mecano:text-[10px] mecano:font-medium mecano:text-slate-400 mecano:bg-white/80 mecano:backdrop-blur-sm mecano:px-2 mecano:py-0.5 mecano:rounded-full mecano:shadow-sm"},DP={class:"mecano:text-slate-600"},jP={key:1,class:"mecano:text-[10px] mecano:font-medium mecano:text-slate-400 mecano:bg-white/80 mecano:backdrop-blur-sm mecano:px-2 mecano:py-0.5 mecano:rounded-full mecano:shadow-sm"},XP={class:"mecano:text-slate-600"},IP={key:2,class:"mecano:text-[10px] mecano:font-medium mecano:text-slate-400 mecano:bg-white/80 mecano:backdrop-blur-sm mecano:px-2 mecano:py-0.5 mecano:rounded-full mecano:shadow-sm"},HP={class:"mecano:text-slate-600"},WP={key:3,class:"text-[10px] font-medium text-slate-400 bg-white/80 backdrop-blur-sm px-2 py-0.5 rounded-full shadow-sm flex items-center gap-1.5"},qP={key:0,class:"mecano:mt-12 mecano:mb-4 mecano:w-full mecano:rounded-xl mecano:bg-white mecano:border mecano:border-slate-200 mecano:p-4 mecano:z-10 mecano:hidden mecano:group-hover:block mecano:shadow-lg"},YP={class:"mecano:p-4 mecano:bg-gradient-to-br mecano:from-slate-50 mecano:to-white mecano:rounded-lg mecano:w-full"},FP={class:"mecano:flex mecano:flex-col"},GP=["for"],_P=["id"],UP=["value"],KP={class:"mecano:flex mecano:flex-col"},JP=["for"],eL=["id"],tL=["value"],oL={class:"mecano:flex mecano:flex-col"},nL=["for"],rL=["id"],iL=["value"],aL={class:"mecano:flex mecano:flex-col"},lL={class:"mecano:flex mecano:items-center mecano:gap-2"},sL={class:"mecano:flex mecano:items-center mecano:gap-1.5 mecano:cursor-pointer"},cL=["id"],dL={class:"mecano:flex mecano:flex-col mecano:gap-0.5"},pL={class:"mecano:flex mecano:items-center mecano:gap-1"},mL={key:1,class:"mecano:text-xs mecano:text-slate-400 mecano:italic"},hL={class:"mecano:absolute mecano:top-0 mecano:flex mecano:flex-col mecano:gap-1 mecano:w-full mecano:opacity-0 mecano:transition-all mecano:duration-300 mecano:group-hover:opacity-100"},uL={class:"mecano:flex mecano:flex-wrap mecano:justify-center mecano:gap-2 mecano:bg-white/90 mecano:backdrop-blur-sm mecano:rounded-b-xl mecano:px-3 mecano:py-1.5 mecano:shadow-sm mecano:border mecano:border-t-0 mecano:border-slate-200"},fL={class:"mecano:flex mecano:gap-1"},gL={class:"mecano:flex mecano:gap-4 mecano:ms-4"},bL=["title"],Wd=m.defineComponent({__name:"ColConfig",props:{globalPageConfiguration:Array,rowIndex:{type:Number,required:!0},columnIndex:{type:Number,required:!0},fullwidthMode:Boolean,addCol:Function,updateColConfig:Function,removeCol:Function,addComponentFunction:Function,moveCol:Function,section:String,isHidden:{type:Boolean,default:!1}},emits:["toggle-visibility","config-open"],setup(o,{emit:e}){function t(w){const O=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(w);return O?{r:parseInt(O[1],16),g:parseInt(O[2],16),b:parseInt(O[3],16)}:{r:255,g:255,b:255}}function n(w){const O=w.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\s*\)/);if(!O)return{hex:"#ffffff",alpha:100};const C=x=>parseInt(x).toString(16).padStart(2,"0");return{hex:`#${C(O[1])}${C(O[2])}${C(O[3])}`,alpha:O[4]!==void 0?Math.round(parseFloat(O[4])*100):100}}const r=e,i=o,a={width:[{label:"Ancho completo",value:"full"},{label:"1/2",value:"1/2"},{label:"1/3",value:"1/3"},{label:"2/3",value:"2/3"},{label:"1/4",value:"1/4"},{label:"3/4",value:"3/4"},{label:"1/5",value:"1/5"},{label:"2/5",value:"2/5"},{label:"3/5",value:"3/5"},{label:"4/5",value:"4/5"}],gap:[{label:"Ninguno",value:"0"},{label:"Leve",value:"1"},{label:"Moderado",value:"2"},{label:"Alto",value:"4"},{label:"Muy alto",value:"8"}],flexDirection:[{label:"Columna (componentes unos encima de otros)",value:"flex-col"},{label:"Fila (componentes unos al lado de otros)",value:"flex-row"}]},l=m.ref(""),s=m.ref(""),c=m.ref(""),d=m.ref("#ffffff"),p=m.ref(100),h=m.ref(!1),u=m.ref(!1),f=m.ref(!1);m.watch(u,w=>{if(r("config-open",w),w){const O=b.value;if(O.backgroundColor){h.value=!0;const{hex:C,alpha:x}=n(O.backgroundColor);d.value=C,p.value=x}else h.value=!1,d.value="#ffffff",p.value=100}});const g=m.computed(()=>{const{r:w,g:O,b:C}=t(d.value),x=p.value/100;return`rgba(${w}, ${O}, ${C}, ${x})`}),b=m.computed(()=>{var C,x,y,k;const w=(C=i.globalPageConfiguration)==null?void 0:C.find($=>$.section===i.section),O=(k=(y=(x=w==null?void 0:w.rows)==null?void 0:x[i.rowIndex])==null?void 0:y.columns)==null?void 0:k[i.columnIndex];return(O==null?void 0:O.config)||{}}),v=(w,O)=>{var $;const C=l.value||a.width[0].value,x=s.value||a.gap[0].value,y=c.value||"",k=h.value?g.value:"";($=i.updateColConfig)==null||$.call(i,w,O,i.section||"",C,x,y,k),u.value=!1};return(w,O)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createElementVNode("div",BP,[b.value.width!==void 0?(m.openBlock(),m.createElementBlock("span",zP,[O[19]||(O[19]=m.createTextVNode(" Ancho: ",-1)),m.createElementVNode("span",DP,m.toDisplayString(b.value.width),1)])):m.createCommentVNode("",!0),b.value.gap!==void 0?(m.openBlock(),m.createElementBlock("span",jP,[O[20]||(O[20]=m.createTextVNode(" Gap: ",-1)),m.createElementVNode("span",XP,m.toDisplayString(b.value.gap),1)])):m.createCommentVNode("",!0),b.value.flexDirection!==void 0?(m.openBlock(),m.createElementBlock("span",IP,[O[21]||(O[21]=m.createTextVNode(" Flex: ",-1)),m.createElementVNode("span",HP,m.toDisplayString(b.value.flexDirection),1)])):m.createCommentVNode("",!0),b.value.backgroundColor?(m.openBlock(),m.createElementBlock("span",WP,[O[22]||(O[22]=m.createTextVNode(" Fondo: ",-1)),m.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full border border-slate-300",style:m.normalizeStyle({backgroundColor:b.value.backgroundColor})},null,4)])):m.createCommentVNode("",!0)]),u.value?(m.openBlock(),m.createElementBlock("div",qP,[m.createElementVNode("div",YP,[m.createElementVNode("form",{onSubmit:O[8]||(O[8]=m.withModifiers(()=>{},["prevent"])),class:"mecano:flex mecano:gap-5 mecano:w-full mecano:justify-center mecano:items-end mecano:flex-wrap"},[m.createElementVNode("div",FP,[m.createElementVNode("label",{for:`colwidth-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Ancho:",8,GP),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":O[0]||(O[0]=C=>l.value=C),id:`colwidth-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-white mecano:hover:border-slate-300 mecano:transition-colors"},[O[23]||(O[23]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.width,C=>(m.openBlock(),m.createElementBlock("option",{key:C.value,value:C.value},m.toDisplayString(C.label),9,UP))),128))],8,_P),[[m.vModelSelect,l.value]])]),m.createElementVNode("div",KP,[m.createElementVNode("label",{for:`colgap-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Gap:",8,JP),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":O[1]||(O[1]=C=>s.value=C),id:`colgap-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-white mecano:hover:border-slate-300 mecano:transition-colors"},[O[24]||(O[24]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.gap,C=>(m.openBlock(),m.createElementBlock("option",{key:C.value,value:C.value},m.toDisplayString(C.label),9,tL))),128))],8,eL),[[m.vModelSelect,s.value]])]),m.createElementVNode("div",oL,[m.createElementVNode("label",{for:`flexdir-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Dirección:",8,nL),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":O[2]||(O[2]=C=>c.value=C),id:`flexdir-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-white mecano:hover:border-slate-300 mecano:transition-colors"},[O[25]||(O[25]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.flexDirection,C=>(m.openBlock(),m.createElementBlock("option",{key:C.value,value:C.value},m.toDisplayString(C.label),9,iL))),128))],8,rL),[[m.vModelSelect,c.value]])]),m.createElementVNode("div",aL,[O[28]||(O[28]=m.createElementVNode("label",{class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Color de fondo:",-1)),m.createElementVNode("div",lL,[m.createElementVNode("label",sL,[m.withDirectives(m.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":O[3]||(O[3]=C=>h.value=C),class:"mecano:rounded mecano:border-slate-300 mecano:text-emerald-500 mecano:focus:ring-emerald-500/20"},null,512),[[m.vModelCheckbox,h.value]]),O[26]||(O[26]=m.createElementVNode("span",{class:"mecano:text-sm mecano:text-slate-500"},"Activar",-1))]),h.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.withDirectives(m.createElementVNode("input",{type:"color","onUpdate:modelValue":O[4]||(O[4]=C=>d.value=C),id:`colbgcolor-${o.rowIndex}-${o.columnIndex}`,class:"mecano:w-10 mecano:h-9 mecano:rounded mecano:border mecano:border-slate-200 mecano:cursor-pointer mecano:p-0.5 mecano:bg-slate-50",title:"Seleccionar color de fondo"},null,8,cL),[[m.vModelText,d.value]]),m.createElementVNode("div",dL,[m.withDirectives(m.createElementVNode("input",{type:"range","onUpdate:modelValue":O[5]||(O[5]=C=>p.value=C),min:"0",max:"100",step:"0.1",class:"mecano:w-24 mecano:accent-emerald-500",title:"Opacidad"},null,512),[[m.vModelText,p.value,void 0,{number:!0}]]),m.createElementVNode("div",pL,[m.withDirectives(m.createElementVNode("input",{type:"number","onUpdate:modelValue":O[6]||(O[6]=C=>p.value=C),min:"0",max:"100",step:"0.1",class:"mecano:w-14 mecano:text-xs mecano:border mecano:border-slate-200 mecano:rounded mecano:px-1 mecano:py-0.5 mecano:text-center"},null,512),[[m.vModelText,p.value,void 0,{number:!0}]]),O[27]||(O[27]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-400"},"%",-1))])]),m.createElementVNode("span",{class:"inline-block w-6 h-6 rounded border border-slate-300 flex-shrink-0",style:m.normalizeStyle({backgroundColor:g.value}),title:"Vista previa"},null,4)],64)):(m.openBlock(),m.createElementBlock("span",mL,"Sin color"))])]),m.createElementVNode("button",{type:"button",class:"mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:text-white mecano:px-5 mecano:py-2 mecano:rounded-lg mecano:font-medium mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:cursor-pointer",onClick:O[7]||(O[7]=C=>{v(o.rowIndex,o.columnIndex),u.value=!1})}," Guardar ")],32)])])):m.createCommentVNode("",!0),m.createElementVNode("div",hL,[m.createElementVNode("div",{class:m.normalizeClass(["mecano:flex mecano:flex-row",{"mecano:justify-between":o.section&&o.section!=="Sidebar","mecano:justify-center":o.section==="Sidebar"}])},[o.section&&o.section!=="Sidebar"?(m.openBlock(),m.createElementBlock("button",{key:0,type:"button",title:"Añadir columna a la izquierda",onClick:O[9]||(O[9]=C=>{var x;return(x=o.addCol)==null?void 0:x.call(o,o.rowIndex,o.columnIndex,o.section,"left")}),class:"mecano:group/addbtn-left mecano:relative mecano:ms-2 mecano:bg-white mecano:px-3 mecano:py-1 mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:border-slate-200 mecano:hover:bg-emerald-500 mecano:hover:border-emerald-500 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md mecano:font-medium"},[...O[29]||(O[29]=[m.createElementVNode("span",{class:"mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-left:opacity-0"},"+",-1),m.createElementVNode("span",{class:"mecano:absolute mecano:inset-0 mecano:flex mecano:items-center mecano:justify-center mecano:opacity-0 mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-left:opacity-100"},"←",-1)])])):m.createCommentVNode("",!0),m.createElementVNode("div",uL,[m.createElementVNode("button",{type:"button",title:"Configurar columna",onClick:O[10]||(O[10]=C=>u.value=!u.value),class:m.normalizeClass(["mecano:px-2.5 mecano:py-1 mecano:rounded-lg mecano:cursor-pointer mecano:transition-all mecano:duration-200",u.value?"mecano:bg-amber-100 mecano:text-amber-700 mecano:shadow-sm":"mecano:bg-slate-100 mecano:text-slate-600 mecano:hover:bg-blue-500 mecano:hover:text-white"])},"⚙️",2),m.createElementVNode("div",fL,[o.section&&o.section!=="Sidebar"?(m.openBlock(),m.createElementBlock("span",{key:0,title:"Mover columna a la izquierda",onClick:O[11]||(O[11]=C=>{var x;return(x=o.moveCol)==null?void 0:x.call(o,o.rowIndex,o.columnIndex,o.section,"left")}),class:"mecano:bg-slate-100 mecano:px-2.5 mecano:py-1 mecano:cursor-pointer mecano:rounded-lg mecano:transition-all mecano:duration-200 mecano:text-slate-400 mecano:hover:bg-blue-500 mecano:hover:text-white"},"◁")):m.createCommentVNode("",!0),o.fullwidthMode?(m.openBlock(),m.createElementBlock("span",{key:1,title:"Añadir componente",onClick:O[12]||(O[12]=C=>{var x;return(x=o.addComponentFunction)==null?void 0:x.call(o,o.rowIndex,o.columnIndex,o.section||"")}),class:"mecano:bg-slate-100 mecano:px-2.5 mecano:py-1 mecano:cursor-pointer mecano:rounded-lg mecano:transition-all mecano:duration-200 mecano:text-slate-400 mecano:hover:bg-blue-500 mecano:hover:text-white"}," 📦 ")):m.createCommentVNode("",!0),o.section&&o.section!=="Sidebar"?(m.openBlock(),m.createElementBlock("span",{key:2,title:"Mover columna a la derecha",onClick:O[13]||(O[13]=C=>{var x;return(x=o.moveCol)==null?void 0:x.call(o,o.rowIndex,o.columnIndex,o.section,"right")}),class:"mecano:bg-slate-100 mecano:px-2.5 mecano:py-1 mecano:cursor-pointer mecano:rounded-lg mecano:transition-all mecano:duration-200 mecano:text-slate-400 mecano:hover:bg-blue-500 mecano:hover:text-white"},"▷ ")):m.createCommentVNode("",!0)]),m.createElementVNode("div",gL,[m.createElementVNode("button",{type:"button",title:o.isHidden?"Mostrar componentes":"Ocultar componentes",onClick:O[14]||(O[14]=C=>w.$emit("toggle-visibility")),class:m.normalizeClass([o.isHidden?"mecano:bg-amber-100 mecano:text-amber-600 mecano:hover:bg-amber-500 mecano:hover:text-white":"mecano:bg-slate-100 mecano:text-slate-600 mecano:hover:bg-blue-500 mecano:hover:text-white","mecano:px-2.5 mecano:py-1 mecano:rounded-lg mecano:cursor-pointer mecano:transition-all mecano:duration-200"])},m.toDisplayString(o.isHidden?"🙈":"👁️"),11,bL),f.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[O[30]||(O[30]=m.createElementVNode("span",{class:"mecano:px-2 mecano:py-1 mecano:text-xs mecano:text-red-600 mecano:font-medium mecano:self-center"},"¿Eliminar?",-1)),m.createElementVNode("button",{type:"button",title:"Sí, eliminar",onClick:O[15]||(O[15]=C=>{var x;(x=o.removeCol)==null||x.call(o,o.rowIndex,o.columnIndex,o.section||""),f.value=!1}),class:"mecano:bg-red-500 mecano:text-white mecano:px-2.5 mecano:py-1 mecano:rounded-lg mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:hover:bg-red-600 mecano:text-xs mecano:font-medium"},"Sí"),m.createElementVNode("button",{type:"button",title:"Cancelar",onClick:O[16]||(O[16]=C=>f.value=!1),class:"mecano:bg-slate-100 mecano:text-slate-600 mecano:px-2.5 mecano:py-1 mecano:rounded-lg mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:hover:bg-slate-200 mecano:text-xs mecano:font-medium"},"No")],64)):(m.openBlock(),m.createElementBlock("button",{key:1,type:"button",title:"Eliminar columna",onClick:O[17]||(O[17]=C=>f.value=!0),class:"mecano:bg-slate-100 mecano:px-2.5 mecano:py-1 mecano:rounded-lg mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-slate-600 mecano:hover:bg-red-500 mecano:hover:text-white"},"🗑️"))])]),o.section&&o.section!=="Sidebar"?(m.openBlock(),m.createElementBlock("button",{key:1,type:"button",title:"Añadir columna a la derecha",onClick:O[18]||(O[18]=C=>{var x;return(x=o.addCol)==null?void 0:x.call(o,o.rowIndex,o.columnIndex,o.section,"right")}),class:"mecano:group/addbtn-right mecano:relative mecano:me-2 mecano:bg-white mecano:px-3 mecano:py-1 mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:border-slate-200 mecano:hover:bg-emerald-500 mecano:hover:border-emerald-500 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md mecano:font-medium"},[...O[31]||(O[31]=[m.createElementVNode("span",{class:"mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-right:opacity-0"},"+",-1),m.createElementVNode("span",{class:"mecano:absolute mecano:inset-0 mecano:flex mecano:items-center mecano:justify-center mecano:opacity-0 mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-right:opacity-100"},"→",-1)])])):m.createCommentVNode("",!0)],2)])],64))}}),CL={class:"mecano:absolute mecano:-top-1 mecano:px-2 mecano:gap-4 mecano:w-full mecano:justify-center mecano:hidden mecano:group-hover/row:flex css-pb-row-config"},OL={class:"mecano:flex mecano:flex-wrap mecano:gap-4 mecano:items-center mecano:justify-center"},vL={class:"mecano:inline-block"},wL={key:0,class:"mecano:text-xs mecano:font-medium mecano:text-slate-400 mecano:bg-slate-50 mecano:px-2 mecano:py-1 mecano:rounded-full"},xL={class:"mecano:text-slate-600"},yL={key:1,class:"mecano:text-xs mecano:font-medium mecano:text-slate-400 mecano:bg-slate-50 mecano:px-2 mecano:py-1 mecano:rounded-full"},kL={class:"mecano:text-slate-600"},SL={key:2,class:"mecano:text-xs mecano:font-medium mecano:text-slate-400 mecano:bg-slate-50 mecano:px-2 mecano:py-1 mecano:rounded-full"},$L={class:"mecano:text-slate-600"},ML={key:3,class:"mecano:text-xs mecano:font-medium mecano:text-slate-400 mecano:bg-slate-50 mecano:px-2 mecano:py-1 mecano:rounded-full mecano:flex mecano:items-center mecano:gap-1.5"},QL={class:"mecano:inline-flex mecano:items-center mecano:gap-1"},PL={class:"mecano:absolute mecano:bottom-2 mecano:px-2 mecano:gap-4 mecano:w-full mecano:justify-start mecano:hidden mecano:group-hover/row:flex css-pb-row-config"},LL={class:"mecano:flex mecano:gap-1.5"},TL={key:0,class:"mecano:z-1"},EL={class:"mecano:p-5 mecano:bg-white mecano:rounded-xl mecano:shadow-lg mecano:border mecano:border-slate-100 mecano:w-full mecano:mt-8"},ZL={class:"mecano:flex mecano:flex-col"},AL=["for"],VL=["id"],NL=["value"],RL={class:"mecano:flex mecano:flex-col"},BL=["for"],zL=["id"],DL=["value"],jL={class:"mecano:flex mecano:flex-col"},XL=["for"],IL=["id"],HL=["value"],WL={class:"mecano:flex mecano:flex-col"},qL={class:"mecano:flex mecano:items-center mecano:gap-2"},YL={class:"mecano:flex mecano:items-center mecano:gap-1.5 mecano:cursor-pointer"},FL=["id"],GL={class:"mecano:flex mecano:flex-col mecano:gap-0.5"},_L={class:"mecano:flex mecano:items-center mecano:gap-1"},UL={key:1,class:"mecano:text-xs mecano:text-slate-400 mecano:italic"},qd=m.defineComponent({__name:"RowConfig",props:{rowIndex:{type:Number,required:!0},updateRowConfig:Function,removeRow:Function,addRow:Function,globalPageConfiguration:Array,section:String,moveRow:Function},emits:["config-open"],setup(o,{emit:e}){const t=e;function n(O){const C=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(O);return C?{r:parseInt(C[1],16),g:parseInt(C[2],16),b:parseInt(C[3],16)}:{r:255,g:255,b:255}}function r(O){const C=O.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\s*\)/);if(!C)return{hex:"#ffffff",alpha:100};const x=y=>parseInt(y).toString(16).padStart(2,"0");return{hex:`#${x(C[1])}${x(C[2])}${x(C[3])}`,alpha:C[4]!==void 0?Math.round(parseFloat(C[4])*100):100}}const i=o,a={padding:[{label:"Ninguno",value:"0"},{label:"Leve",value:"4"},{label:"Tibio",value:"6"},{label:"Moderado",value:"8"},{label:"Intenso",value:"9"},{label:"Alto",value:"12"}],gap:[{label:"Ninguno",value:"0"},{label:"Leve",value:"2"},{label:"Moderado",value:"4"},{label:"Alto",value:"8"},{label:"Muy alto",value:"12"}],width:[{label:"Ancho completo",value:"full"},{label:"1/2",value:"1/2"},{label:"1/3",value:"1/3"},{label:"2/3",value:"2/3"},{label:"1/4",value:"1/4"},{label:"3/4",value:"3/4"},{label:"1/5",value:"1/5"},{label:"2/5",value:"2/5"},{label:"3/5",value:"3/5"},{label:"4/5",value:"4/5"}]},l=m.ref(""),s=m.ref(""),c=m.ref(""),d=m.ref("#ffffff"),p=m.ref(100),h=m.ref(!1),u=m.ref(!1),f=m.ref(!1),g=m.ref(!1);m.watch(u,O=>{if(t("config-open",O),O){const C=v.value;if(C.backgroundColor){h.value=!0;const{hex:x,alpha:y}=r(C.backgroundColor);d.value=x,p.value=y}else h.value=!1,d.value="#ffffff",p.value=100}});const b=m.computed(()=>{const{r:O,g:C,b:x}=n(d.value),y=p.value/100;return`rgba(${O}, ${C}, ${x}, ${y})`}),v=m.computed(()=>{var C,x;const O=(C=i.globalPageConfiguration)==null?void 0:C.find(y=>y.section===i.section);return(x=O==null?void 0:O.rows)!=null&&x[i.rowIndex]?O.rows[i.rowIndex].config||{}:{}}),w=O=>{var $;const C=l.value||a.padding[0].value,x=s.value||a.gap[0].value,y=c.value||a.width[0].value,k=h.value?b.value:"";($=i.updateRowConfig)==null||$.call(i,O,i.section||"",C,x,y,k),u.value=!1};return(O,C)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createElementVNode("div",CL,[m.createElementVNode("div",OL,[m.createElementVNode("div",vL,[m.createElementVNode("button",{type:"button",title:"Configurar la fila",onClick:C[0]||(C[0]=x=>u.value=!u.value),class:m.normalizeClass(["mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:px-3 mecano:py-1 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md",u.value?"mecano:bg-amber-100 mecano:border-amber-300 mecano:text-amber-700":"mecano:bg-white mecano:border-slate-200 mecano:text-slate-600 mecano:hover:bg-blue-500 mecano:hover:border-blue-500 mecano:hover:text-white"])},"⚙️",2)]),v.value.padding!==void 0?(m.openBlock(),m.createElementBlock("span",wL,[C[16]||(C[16]=m.createTextVNode(" Padding: ",-1)),m.createElementVNode("span",xL,m.toDisplayString(v.value.padding),1)])):m.createCommentVNode("",!0),v.value.gap!==void 0?(m.openBlock(),m.createElementBlock("span",yL,[C[17]||(C[17]=m.createTextVNode(" Gap: ",-1)),m.createElementVNode("span",kL,m.toDisplayString(v.value.gap),1)])):m.createCommentVNode("",!0),v.value.width!==void 0?(m.openBlock(),m.createElementBlock("span",SL,[C[18]||(C[18]=m.createTextVNode(" Ancho: ",-1)),m.createElementVNode("span",$L,m.toDisplayString(v.value.width),1)])):m.createCommentVNode("",!0),v.value.backgroundColor?(m.openBlock(),m.createElementBlock("span",ML,[C[19]||(C[19]=m.createTextVNode(" Fondo: ",-1)),m.createElementVNode("span",{class:"mecano:inline-block mecano:w-3 mecano:h-3 mecano:rounded-full mecano:border mecano:border-slate-300",style:m.normalizeStyle({backgroundColor:v.value.backgroundColor})},null,4)])):m.createCommentVNode("",!0),m.createElementVNode("div",QL,[g.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[C[20]||(C[20]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-red-600 mecano:font-medium mecano:px-1"},"¿Eliminar?",-1)),m.createElementVNode("button",{type:"button",title:"Sí, eliminar",onClick:C[1]||(C[1]=x=>{var y;(y=o.removeRow)==null||y.call(o,o.rowIndex,o.section||""),g.value=!1,f.value=!1}),class:"mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:border-red-500 mecano:bg-red-500 mecano:px-3 mecano:py-1 mecano:text-white mecano:hover:bg-red-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:text-xs mecano:font-medium"},"Sí"),m.createElementVNode("button",{type:"button",title:"Cancelar",onClick:C[2]||(C[2]=x=>g.value=!1),class:"mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:border-slate-200 mecano:bg-white mecano:px-3 mecano:py-1 mecano:text-slate-600 mecano:hover:bg-slate-100 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:text-xs mecano:font-medium"},"No")],64)):(m.openBlock(),m.createElementBlock("button",{key:1,type:"button",title:"Eliminar fila",onClick:C[3]||(C[3]=x=>g.value=!0),class:"mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:border-slate-200 mecano:bg-white mecano:hover:bg-red-500 mecano:hover:border-red-500 mecano:px-3 mecano:py-1 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md"},"🗑️"))])])]),m.createElementVNode("div",PL,[m.createElementVNode("div",null,[m.createElementVNode("div",LL,[m.createElementVNode("button",{type:"button",title:"Agregar fila",onClick:C[4]||(C[4]=x=>{var y;(y=o.addRow)==null||y.call(o,o.rowIndex,o.section||""),f.value=!1}),class:"mecano:group/addbtn-row mecano:relative mecano:cursor-pointer mecano:rounded-lg mecano:border mecano:border-b-0 mecano:border-slate-200 mecano:bg-white mecano:hover:bg-emerald-500 mecano:hover:border-emerald-500 mecano:px-3 mecano:py-1 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md mecano:font-medium"},[...C[21]||(C[21]=[m.createElementVNode("span",{class:"mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-row:opacity-0"},"+",-1),m.createElementVNode("span",{class:"mecano:absolute mecano:inset-0 mecano:flex mecano:items-center mecano:justify-center mecano:opacity-0 mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-row:opacity-100"},"↓",-1)])]),m.createElementVNode("button",{type:"button",title:"Mover fila hacia arriba",onClick:C[5]||(C[5]=x=>{var y;(y=o.moveRow)==null||y.call(o,o.rowIndex,o.section||"","up"),f.value=!1}),class:"mecano:cursor-pointer mecano:rounded-lg mecano:border mecano:border-b-0 mecano:border-slate-200 mecano:bg-white mecano:hover:bg-blue-500 mecano:hover:border-blue-500 mecano:px-3 mecano:py-1 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md"},"△"),m.createElementVNode("button",{type:"button",title:"Mover fila hacia abajo",onClick:C[6]||(C[6]=x=>{var y;(y=o.moveRow)==null||y.call(o,o.rowIndex,o.section||"","down"),f.value=!1}),class:"mecano:cursor-pointer mecano:rounded-lg mecano:border mecano:border-b-0 mecano:border-slate-200 mecano:bg-white mecano:hover:bg-blue-500 mecano:hover:border-blue-500 mecano:px-3 mecano:py-1 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md"},"▽")])])]),u.value?(m.openBlock(),m.createElementBlock("div",TL,[m.createElementVNode("div",EL,[m.createElementVNode("form",{onSubmit:C[15]||(C[15]=m.withModifiers(()=>{},["prevent"])),class:"mecano:flex mecano:gap-6 mecano:w-full mecano:justify-center mecano:items-end mecano:flex-wrap"},[m.createElementVNode("div",ZL,[m.createElementVNode("label",{for:`padding-${o.rowIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Padding:",8,AL),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":C[7]||(C[7]=x=>l.value=x),id:`padding-${o.rowIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-slate-50 mecano:hover:bg-white mecano:transition-colors"},[C[22]||(C[22]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.padding,x=>(m.openBlock(),m.createElementBlock("option",{key:x.value,value:x.value},m.toDisplayString(x.label),9,NL))),128))],8,VL),[[m.vModelSelect,l.value]])]),m.createElementVNode("div",RL,[m.createElementVNode("label",{for:`gap-${o.rowIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Gap:",8,BL),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":C[8]||(C[8]=x=>s.value=x),id:`gap-${o.rowIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-slate-50 mecano:hover:bg-white mecano:transition-colors"},[C[23]||(C[23]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.gap,x=>(m.openBlock(),m.createElementBlock("option",{key:x.value,value:x.value},m.toDisplayString(x.label),9,DL))),128))],8,zL),[[m.vModelSelect,s.value]])]),m.createElementVNode("div",jL,[m.createElementVNode("label",{for:`width-${o.rowIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Ancho:",8,XL),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":C[9]||(C[9]=x=>c.value=x),id:`width-${o.rowIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-slate-50 mecano:hover:bg-white mecano:transition-colors"},[C[24]||(C[24]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.width,x=>(m.openBlock(),m.createElementBlock("option",{key:x.value,value:x.value},m.toDisplayString(x.label),9,HL))),128))],8,IL),[[m.vModelSelect,c.value]])]),m.createElementVNode("div",WL,[C[27]||(C[27]=m.createElementVNode("label",{class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Color de fondo:",-1)),m.createElementVNode("div",qL,[m.createElementVNode("label",YL,[m.withDirectives(m.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":C[10]||(C[10]=x=>h.value=x),class:"mecano:rounded mecano:border-slate-300 mecano:text-emerald-500 mecano:focus:ring-emerald-500/20"},null,512),[[m.vModelCheckbox,h.value]]),C[25]||(C[25]=m.createElementVNode("span",{class:"mecano:text-sm mecano:text-slate-500"},"Activar",-1))]),h.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.withDirectives(m.createElementVNode("input",{type:"color","onUpdate:modelValue":C[11]||(C[11]=x=>d.value=x),id:`bgcolor-${o.rowIndex}`,class:"mecano:w-10 mecano:h-9 mecano:rounded mecano:border mecano:border-slate-200 mecano:cursor-pointer mecano:p-0.5 mecano:bg-slate-50",title:"Seleccionar color de fondo"},null,8,FL),[[m.vModelText,d.value]]),m.createElementVNode("div",GL,[m.withDirectives(m.createElementVNode("input",{type:"range","onUpdate:modelValue":C[12]||(C[12]=x=>p.value=x),min:"0",max:"100",step:"0.1",class:"mecano:w-24 mecano:accent-emerald-500",title:"Opacidad"},null,512),[[m.vModelText,p.value,void 0,{number:!0}]]),m.createElementVNode("div",_L,[m.withDirectives(m.createElementVNode("input",{type:"number","onUpdate:modelValue":C[13]||(C[13]=x=>p.value=x),min:"0",max:"100",step:"0.1",class:"mecano:w-14 mecano:text-xs mecano:border mecano:border-slate-200 mecano:rounded mecano:px-1 mecano:py-0.5 mecano:text-center"},null,512),[[m.vModelText,p.value,void 0,{number:!0}]]),C[26]||(C[26]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-400"},"%",-1))])]),m.createElementVNode("span",{class:"inline-block w-6 h-6 rounded border border-slate-300 flex-shrink-0",style:m.normalizeStyle({backgroundColor:b.value}),title:"Vista previa"},null,4)],64)):(m.openBlock(),m.createElementBlock("span",UL,"Sin color"))])]),m.createElementVNode("button",{type:"button",class:"mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:text-white mecano:px-5 mecano:py-2 mecano:rounded-lg mecano:font-medium mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:cursor-pointer",onClick:C[14]||(C[14]=x=>{w(o.rowIndex),f.value=!1})}," Guardar ")],32)])])):m.createCommentVNode("",!0)],64))}}),KL=["id"],JL={class:"mecano:flex mecano:flex-row mecano:w-full mecano:gap-3 mecano:mt-6"},eT=["id"],tT={key:0,class:"mecano:flex mecano:flex-col mecano:items-center mecano:justify-center mecano:gap-2 mecano:w-full mecano:h-full mecano:min-h-[120px] mecano:mt-4 mecano:rounded-lg mecano:border-2 mecano:border-dashed mecano:border-amber-300 mecano:bg-amber-50 mecano:text-amber-600"},oT={class:"mecano:text-sm mecano:font-medium"},Yd=m.defineComponent({__name:"BodySection",props:{isComponentMode:Boolean,fullwidthMode:Boolean,globalPageConfiguration:Array,sectionSelected:String,removeComponent:Function,cloneComponent:Function,addComponentFunction:Function,addCol:Function,addRow:Function,removeRow:Function,removeCol:Function,moveCol:Function,moveRow:Function,updateColConfig:Function,updateRowConfig:Function,renderApiDomain:String,isProduction:{type:Boolean,default:!1},ateneaToken:String,ledithorAiTools:Array},setup(o){const e=o,t=m.ref(!1),n=m.ref(new Set),r=m.ref(null),i=m.ref(null),a=(p,h)=>n.value.has(`${p}-${h}`),l=(p,h)=>{const u=`${p}-${h}`,f=new Set(n.value);f.has(u)?f.delete(u):f.add(u),n.value=f},s=(p,h,u,f)=>{var v;const g=f==="left"?h:h+1,b=new Set;for(const w of n.value){const[O,C]=w.split("-").map(Number);b.add(O===p&&C>=g?`${O}-${C+1}`:w)}n.value=b,(v=e.addCol)==null||v.call(e,p,h,u,f)},c=(p,h,u)=>{var g;const f=new Set;for(const b of n.value){const[v,w]=b.split("-").map(Number);v===p?(w<h&&f.add(b),w>h&&f.add(`${v}-${w-1}`)):f.add(b)}n.value=f,(g=e.removeCol)==null||g.call(e,p,h,u)},d=m.computed(()=>{var h;const p=(h=e.globalPageConfiguration)==null?void 0:h.find(u=>u.section===e.sectionSelected);return(p==null?void 0:p.rows)||[]});return(p,h)=>(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(d.value,(u,f)=>{var g;return m.openBlock(),m.createElementBlock("div",{key:"row-"+f,id:"row-"+o.sectionSelected+"-"+f,class:m.normalizeClass(["mecano:flex mecano:flex-col mecano:gap-3 mecano:w-full mecano:pt-5 mecano:px-5 mecano:pb-14 mecano:border mecano:rounded-lg js-row relative mecano:items-center mecano:hover:shadow-lg mecano:transition-all mecano:duration-300 css-pb-row mecano:group/row",r.value===f?"mecano:border-amber-400 mecano:ring-2 mecano:ring-amber-300 mecano:shadow-amber-100 mecano:shadow-lg":"mecano:border-slate-200 mecano:hover:border-slate-300"]),style:m.normalizeStyle((g=u.config)!=null&&g.backgroundColor?{backgroundColor:u.config.backgroundColor}:{backgroundColor:"#ffffff"})},[m.createVNode(qd,{moveRow:o.moveRow,addRow:o.addRow,removeRow:o.removeRow,globalPageConfiguration:o.globalPageConfiguration,updateRowConfig:o.updateRowConfig,rowIndex:f,section:o.sectionSelected,onConfigOpen:b=>r.value=b?f:null},null,8,["moveRow","addRow","removeRow","globalPageConfiguration","updateRowConfig","rowIndex","section","onConfigOpen"]),m.createElementVNode("div",JL,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(u.columns,(b,v)=>{var w,O;return m.openBlock(),m.createElementBlock("div",{class:m.normalizeClass(["mecano:hover:shadow-md mecano:overflow-hidden dragging-zone mecano:border mecano:relative mecano:shadow-sm mecano:w-full mecano:p-5 mecano:pt-10 mecano:min-h-[200px] mecano:rounded-xl mecano:flex mecano:flex-col mecano:gap-3 mecano:items-center mecano:before:content-['Columna'] mecano:before:absolute mecano:before:text-slate-300 mecano:before:text-7xl mecano:before:font-bold mecano:before:bottom-4 mecano:before:left-2 mecano:before:-rotate-12 mecano:before:opacity-30 mecano:before:duration-300 mecano:before:transition-opacity mecano:group mecano:hover:before:opacity-50 mecano:transition-all mecano:duration-300",i.value===`${f}-${v}`?"mecano:border-amber-400 mecano:ring-2 mecano:ring-amber-300 mecano:shadow-amber-100":t.value?"mecano:border-emerald-300":"mecano:border-slate-200",(w=b.config)!=null&&w.backgroundColor?"":t.value?"mecano:bg-gradient-to-b mecano:from-emerald-50 mecano:to-emerald-100":"mecano:bg-gradient-to-b mecano:from-slate-50 mecano:to-slate-100"]),style:m.normalizeStyle((O=b.config)!=null&&O.backgroundColor?{backgroundColor:b.config.backgroundColor}:{}),key:"column-"+v,id:"col-"+o.sectionSelected+"-"+f+"-"+v},[m.createVNode(Wd,{section:o.sectionSelected,globalPageConfiguration:o.globalPageConfiguration,updateColConfig:o.updateColConfig,addComponentFunction:o.addComponentFunction,fullwidthMode:o.fullwidthMode,addCol:s,removeCol:c,moveCol:o.moveCol,rowIndex:f,columnIndex:Number(v),isHidden:a(f,Number(v)),onToggleVisibility:C=>l(f,Number(v)),onConfigOpen:C=>i.value=C?`${f}-${v}`:null},null,8,["section","globalPageConfiguration","updateColConfig","addComponentFunction","fullwidthMode","moveCol","rowIndex","columnIndex","isHidden","onToggleVisibility","onConfigOpen"]),a(f,Number(v))?(m.openBlock(),m.createElementBlock("div",tT,[h[2]||(h[2]=m.createElementVNode("span",{class:"mecano:text-2xl"},"🙈",-1)),m.createElementVNode("span",oT,m.toDisplayString(b.components.length>0?`${b.components.length} componente${b.components.length!==1?"s":""} oculto${b.components.length!==1?"s":""}`:"Columna oculta (sin componentes)"),1)])):(m.openBlock(),m.createBlock(m.unref(j6),{key:1,class:"mecano:h-full mecano:w-full mecano:mt-4",list:b.components,group:{name:"draggingGroup",pull:!0,put:!0},"item-key":"id",handle:".handle",onStart:h[0]||(h[0]=C=>t.value=!0),onEnd:h[1]||(h[1]=C=>t.value=!1)},{item:m.withCtx(({element:C})=>[m.createVNode(fc,{renderApiDomain:o.renderApiDomain,object:C,"is-component-mode":o.isComponentMode,removeComponent:o.removeComponent,cloneComponent:o.cloneComponent,section:o.sectionSelected,isProduction:o.isProduction,ateneaToken:o.ateneaToken,ledithorAiTools:o.ledithorAiTools},null,8,["renderApiDomain","object","is-component-mode","removeComponent","cloneComponent","section","isProduction","ateneaToken","ledithorAiTools"])]),_:1},8,["list"]))],14,eT)}),128))])],14,KL)}),128))}}),nT={class:"mecano:flex mecano:justify-between mecano:items-center mecano:mb-4"},rT={class:"mecano:text-xs"},iT=["title"],aT={class:"mecano:text-xs mecano:text-slate-400"},lT={class:"mecano:flex mecano:flex-wrap mecano:gap-2 mecano:mb-4 mecano:bg-white mecano:border mecano:border-slate-200 mecano:p-4 mecano:rounded-xl mecano:shadow-sm"},sT=["value","checked"],cT={class:"mecano:my-3"},dT={class:"mecano:relative"},pT={key:0,class:"mecano:text-center mecano:py-8 mecano:text-slate-400"},Kl=m.defineComponent({__name:"ComponentsBox",props:{isComponentMode:{type:Boolean},fullwidthMode:{type:Boolean},columnToInsert:{},addComponentToColumn:{type:Function},renderApiDomain:{},toggleComponentModeFunction:{type:Function},isProduction:{type:Boolean},components:{},excludedCategories:{}},setup(o){const e=o,t=["CTA","Contenido de Texto","Contenido de Imagen","Contenido con listas","Separador","Header","Footer","Imagen","Repetidor","Formulario","Título","TEST","SEO"],n=m.computed(()=>!e.excludedCategories||e.excludedCategories.length===0?t:t.filter(f=>!e.excludedCategories.includes(f))),r=m.ref(!0),i=m.ref([]),a=m.ref(""),l=["desktop","tablet","mobile"],s=m.ref("desktop"),c={desktop:{label:"Desktop",icon:"🖥️",size:"100%",width:"100%"},tablet:{label:"Tablet",icon:"📲",size:"768px",width:"768px"},mobile:{label:"Mobile",icon:"📱",size:"375px",width:"375px"}},d=()=>{const f=l.indexOf(s.value);s.value=l[(f+1)%l.length]},p=m.computed(()=>{const f=a.value.toLowerCase(),g=Object.values(e.components),b=v=>(v.name.toLowerCase()+v.component_name.toLowerCase()+v.description.toLowerCase()+v.tags.join(" ").toLowerCase()).includes(f);return i.value.length>0?g.filter(v=>i.value.includes(v.category)&&b(v)):g.filter(b)}),h=f=>{a.value=f.target.value},u=f=>{const g=f.target,b=g.value;g.checked?i.value.includes(b)||i.value.push(b):i.value=i.value.filter(v=>v!==b)};return(f,g)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[g[6]||(g[6]=m.createElementVNode("h1",{class:"mecano:text-center mecano:text-2xl mecano:font-semibold mecano:mb-4 mecano:text-slate-700 mecano:tracking-tight"},"Componentes",-1)),m.createElementVNode("div",nT,[m.createElementVNode("button",{type:"button",onClick:g[0]||(g[0]=b=>r.value=!r.value),class:"mecano:mb-3 mecano:px-4 mecano:py-2 mecano:bg-white mecano:rounded-lg mecano:border mecano:border-slate-200 mecano:hover:border-slate-300 mecano:hover:shadow-sm mecano:transition-all mecano:duration-200 mecano:cursor-pointer mecano:text-slate-600 mecano:font-medium mecano:flex mecano:items-center mecano:gap-2"},[g[2]||(g[2]=m.createElementVNode("svg",{class:"mecano:w-4 mecano:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})],-1)),g[3]||(g[3]=m.createElementVNode("span",null,"Filtros",-1)),m.createElementVNode("span",rT,m.toDisplayString(r.value?"▲":"▼"),1)]),o.fullwidthMode?(m.openBlock(),m.createElementBlock("button",{key:0,type:"button",onClick:d,title:`Vista actual: ${c[s.value].label} — clic para cambiar`,class:"mecano:cursor-pointer mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:py-1.5 mecano:px-3 mecano:text-sm mecano:font-medium mecano:transition-all mecano:duration-200 mecano:bg-white mecano:hover:bg-slate-100 mecano:flex mecano:items-center mecano:gap-2"},[m.createElementVNode("span",null,m.toDisplayString(c[s.value].icon),1),m.createElementVNode("span",null,m.toDisplayString(c[s.value].label),1),m.createElementVNode("span",aT,m.toDisplayString(c[s.value].size),1)],8,iT)):m.createCommentVNode("",!0),m.createElementVNode("button",{type:"button",class:m.normalizeClass([[o.isComponentMode?"mecano:bg-gradient-to-r mecano:from-slate-600 mecano:to-slate-700 mecano:border-slate-700 mecano:text-white mecano:shadow-md":"mecano:bg-white mecano:hover:bg-slate-100"],"mecano:cursor-pointer mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:py-1.5 mecano:px-3 mecano:text-sm mecano:font-medium mecano:transition-all mecano:duration-200"]),onClick:g[1]||(g[1]=b=>{var v;return(v=o.toggleComponentModeFunction)==null?void 0:v.call(o)})},m.toDisplayString(o.isComponentMode?"⚒️ Modo Configuración":"👁️ Modo Visual"),3)]),m.withDirectives(m.createElementVNode("div",lT,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(n.value,b=>(m.openBlock(),m.createElementBlock("label",{key:b,class:m.normalizeClass(["mecano:flex mecano:items-center mecano:gap-2 mecano:text-xs mecano:bg-slate-50 mecano:hover:bg-slate-100 mecano:px-3 mecano:py-2 mecano:rounded-lg mecano:cursor-pointer mecano:transition-colors mecano:duration-200 mecano:border mecano:border-transparent mecano:hover:border-slate-200",{"mecano:bg-emerald-50 mecano:border-emerald-200 mecano:text-emerald-700":i.value.includes(b)}])},[m.createElementVNode("input",{type:"checkbox",value:b,checked:i.value.includes(b),onInput:u,class:"mecano:w-4 mecano:h-4 mecano:rounded mecano:border-slate-300 mecano:text-emerald-500 mecano:focus:ring-emerald-500"},null,40,sT),m.createTextVNode(" "+m.toDisplayString(b),1)],2))),128))],512),[[m.vShow,r.value]]),m.createElementVNode("div",cT,[m.createElementVNode("div",dT,[g[4]||(g[4]=m.createElementVNode("svg",{class:"mecano:absolute mecano:left-3 mecano:top-1/2 mecano:-translate-y-1/2 mecano:w-5 mecano:h-5 mecano:text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),m.createElementVNode("input",{onInput:h,type:"text",placeholder:"Buscar componente...",class:"mecano:duration-300 mecano:border mecano:border-slate-200 mecano:bg-white mecano:rounded-xl mecano:py-3 mecano:px-8 mecano:pl-11 mecano:w-full mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:hover:border-slate-300 mecano:shadow-sm"},null,32)])]),m.createElementVNode("div",{class:"component-library dragging-zone mecano:p-5 mecano:min-h-[200px] mecano:border mecano:border-slate-200 mecano:bg-white mecano:rounded-xl mecano:flex mecano:flex-col mecano:gap-4 mecano:items-center mecano:shadow-sm mecano:mx-auto mecano:transition-all mecano:duration-300",style:m.normalizeStyle({width:c[s.value].width})},[m.createVNode(m.unref(j6),{class:"mecano:w-full mecano:flex mecano:flex-col mecano:gap-4",list:p.value,group:{name:"draggingGroup",pull:"clone",put:!1},itemKey:"name",clone:b=>JSON.parse(JSON.stringify(b))},{item:m.withCtx(({element:b})=>[m.createVNode(fc,{renderApiDomain:o.renderApiDomain,object:b,"is-component-mode":o.isComponentMode,fullwidthMode:o.fullwidthMode,columnToInsert:o.columnToInsert,addComponentToColumn:o.addComponentToColumn,insideComponentBox:!0,isProduction:o.isProduction,previewWidth:s.value},null,8,["renderApiDomain","object","is-component-mode","fullwidthMode","columnToInsert","addComponentToColumn","isProduction","previewWidth"])]),_:1},8,["list","clone"]),p.value.length===0?(m.openBlock(),m.createElementBlock("div",pT,[...g[5]||(g[5]=[m.createElementVNode("svg",{class:"mecano:w-12 mecano:h-12 mecano:mx-auto mecano:mb-3 mecano:opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),m.createElementVNode("p",{class:"mecano:text-sm mecano:font-medium"},"No se encontraron componentes",-1),m.createElementVNode("p",{class:"mecano:text-xs mecano:mt-1"},"Intenta con otros filtros o términos de búsqueda",-1)])])):m.createCommentVNode("",!0)],4)],64))}}),mT={},hT={class:"mecano:w-full mecano:px-4"};function uT(o,e){return m.openBlock(),m.createElementBlock("div",hT,[...e[0]||(e[0]=[m.createStaticVNode(`<div class="mecano:rounded-lg lb:flex lb:items-center lb:justify-center lb:gap-2 lb:py-2 lb:px-4 lb:border-t lb:h-8 lb:border-brand-purple-200 lb:bg-brand-purple-50 lb:rounded-b-md lb:mt-3" style="background:linear-gradient(90deg, rgb(0, 25, 120), rgb(33, 52, 241) 50%, rgb(248, 27, 189) 95%);color:white;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 52" fill="currentColor" class="lb:w-5 lb:h-5 lb:text-white" aria-hidden="true"><path d="M29.0863 15.2704H24.9419V36.7321H37.5259V33.1048H29.0863V15.2704Z"></path><path d="M18.1601 33.1048H9.72056V36.7321H22.3045V15.2704H18.1601V33.1048Z"></path><path d="M44.0063 51.846L3.16483 50.1834C1.35636 50.1834 0 48.5965 0 46.8584V4.99294C0 \r
120
+ `);e2=H.pop()??"";for(const K of H){const l2=K.trim();if(!l2.startsWith("data: "))continue;const w2=l2.slice(6);if(w2==="[DONE]")break e;try{const r2=JSON.parse(w2);if(r2.error)throw new Error(r2.error);if(r2.chunk)for(const h2 of r2.chunk)u.push(h2)}catch(r2){if(r2.message!=="Unexpected end of JSON input")throw r2}}}g=!0,u.length>0&&N(3)}catch(P){b&&(clearInterval(b),b=null),c.remove(),l&&(l.style.opacity="",l.style.transition=""),T(),P.name==="AbortError"?e.disabled=!1:(console.error("[Ledithor AI] Error en stream de mejora:",P),this._startAiCooldown(e,60))}}_startAiCooldown(e,t){this._aiCooldownUntil=Date.now()+t*1e3;const n=e.innerHTML,r=()=>{const i=Math.ceil((this._aiCooldownUntil-Date.now())/1e3);if(i<=0){this._aiCooldownUntil=0,e.innerHTML=n,e.classList.remove("le-btn-ai--cooldown"),this._updateAiBtn();return}e.disabled=!0,e.classList.add("le-btn-ai--cooldown"),e.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg> ${i}s`,e.title=`Disponible en ${i}s`,setTimeout(r,1e3)};r()}_createHtmlToggleButton(e,t){const n=document.createElement("button");return n.type="button",n.innerHTML=t.icon||e,n.title=t.title||"HTML",n.dataset.btn=e,n.classList.add("le-btn-html"),this._htmlMode=!1,this._htmlSourceEl=null,n.addEventListener("click",r=>{r.preventDefault(),this._toggleHtmlSource(n)}),n}_toggleHtmlSource(e){if(this._htmlMode=!this._htmlMode,this._htmlMode){let t;this._autoHtmlMode&&this._rawContent?(t=this._rawContent,this._autoHtmlMode=!1):(t=this.editor.getHTML(),t==="<p></p>"&&(t="")),this._htmlSourceEl=document.createElement("div"),this._htmlSourceEl.className="le-html-source";const n=l=>{const s=parseInt(l,10);return isNaN(s)?null:s},r=this.editorEl.getBoundingClientRect(),i=n(this.options.minHeight)||Math.max(r.height,200),a=n(this.options.maxHeight);this.editorEl.style.display="none",this.container.insertBefore(this._htmlSourceEl,this.editorEl.nextSibling),this._htmlSourceEditor=sS(this._htmlSourceEl,t,{minHeight:i,maxHeight:a,onChange:l=>{this.textarea&&(this.textarea.value=l)}}),this.textarea&&(this.textarea.value=t),this.toolbarEl.querySelectorAll("button[data-btn]").forEach(l=>{l.dataset.btn!=="htmlSource"&&(l.disabled=!0,l.style.opacity="0.4")}),e.classList.add("is-active")}else{if(this._htmlSourceEditor){const t=this._htmlSourceEditor.getValue();if(this._hasContentLoss(t)){this._htmlMode=!0,this._showHtmlOnlyNotice();return}this._htmlSourceEditor.destroy(),this._htmlSourceEditor=null,t.trim()===""?(this.editor.commands.clearContent(!1),this.textarea&&(this.textarea.value="")):(this.editor.commands.setContent(t,!1),this.textarea&&(this.textarea.value=this.editor.getHTML())),this._htmlSourceEl.remove(),this._htmlSourceEl=null}this.editorEl.style.display="",this.toolbarEl.querySelectorAll("button[data-btn]").forEach(t=>{t.disabled=!1,t.style.opacity=""}),e.classList.remove("is-active"),this._updateToolbar()}}_hasContentLoss(e){const t=e.slice(0,500).toLowerCase();if(t.includes("<!doctype")||t.includes("<html"))return!0;const n=document.createElement("div");n.innerHTML=e;const{schema:r}=this.editor,i=St.fromSchema(r).parse(n),a=s0.fromSchema(r).serializeFragment(i.content),l=document.createElement("div");l.appendChild(a);const s=n.textContent.replace(/\s+/g,""),c=l.textContent.replace(/\s+/g,"");if(s.length>0&&(s.length-c.length)/s.length>.05)return!0;const d=n.querySelectorAll("*").length,p=l.querySelectorAll("*").length;return d>0&&(d-p)/d>.3}_showHtmlOnlyNotice(){this._htmlNotice||(this._htmlNotice=document.createElement("div"),this._htmlNotice.className="le-html-notice",this._htmlNotice.textContent="Este contenido incluye elementos que el editor visual no soporta. Solo puede editarse en modo código.",this._htmlSourceEl.insertBefore(this._htmlNotice,this._htmlSourceEl.firstChild),setTimeout(()=>{this._htmlNotice&&(this._htmlNotice.remove(),this._htmlNotice=null)},4e3))}_updateToolbar(){this.editor&&this.toolbarEl.querySelectorAll("button[data-btn]").forEach(e=>{const t=e.dataset.btn,n=this._customButtons[t]||an[t];n&&n.isActive&&e.classList.toggle("is-active",n.isActive(this.editor))})}_initStatusBar(){if(!this.statusBarEl)return;this.statusBarEl.innerHTML="";const e=document.createElement("div");e.className="le-statusbar-left",this.statusBarEl.appendChild(e);const t=document.createElement("div");t.className="le-statusbar-center",t.innerHTML='<svg viewBox="0 0 48 52" fill="currentColor" aria-hidden="true"><path d="M29.0863 15.2704H24.9419V36.7321H37.5259V33.1048H29.0863V15.2704Z"/><path d="M18.1601 33.1048H9.72056V36.7321H22.3045V15.2704H18.1601V33.1048Z"/><path d="M44.0063 51.846L3.16483 50.1834C1.35636 50.1834 0 48.5965 0 46.8584V4.99294C0 3.33041 1.65777 1.8946 3.31554 1.81903L44.157 0.1565C46.2669 0.0809304 48 1.74346 48 3.8594V47.8408C48 50.0323 46.1915 51.846 43.9309 51.7704H44.0063V51.846ZM4.89796 46.405L42.9513 47.4629C43.4788 47.4629 44.0063 47.0095 44.0063 46.4805V5.21965C44.0063 4.69066 43.6295 4.31282 43.102 4.31282L4.82261 5.67307C4.14443 5.67307 3.61695 6.27762 3.61695 6.95775V45.1203C3.61695 45.8004 4.14443 46.3294 4.82261 46.405H4.89796Z"/></svg><span>Ledithor</span>',this.statusBarEl.appendChild(t),this._statusBarCounter=document.createElement("div"),this._statusBarCounter.className="le-statusbar-right",this.statusBarEl.appendChild(this._statusBarCounter)}_updateStatusBar(){if(!this._statusBarCounter||!this.editor)return;const e=this.editor.state.doc.textContent,t=e.trim()?e.trim().split(/\s+/).length:0;this._statusBarCounter.textContent=t+" palabra"+(t!==1?"s":"")+" · "+e.length+" caracteres"}_updateAiBtn(){if(!this.editor||!this._aiBtn||this._aiCooldownUntil&&Date.now()<this._aiCooldownUntil||this._aiAbortController)return;const e=!!this.editor.state.doc.textContent.trim();this._aiBtn.disabled=!e,this._aiBtn.classList.toggle("le-btn-ai--empty",!e),this._aiBtn.title=e?"Mejorar redacción con IA":"Escribe algo para usar la IA"}_closePopups(){this._popups.forEach(e=>e.remove()),this._popups=[]}_initDocumentClickClose(){document.addEventListener("click",e=>{!this._popups.length||this._popups.some(t=>t.contains(e.target))||this.toolbarEl&&this.toolbarEl.contains(e.target)||this._closePopups()})}_toggleFullscreen(){if(this._isFullscreen=!this._isFullscreen,this._isFullscreen){this._overlay=document.createElement("div"),this._overlay.className="le-fullscreen-overlay",this._originalParent=this.container.parentNode,this._originalNext=this.container.nextSibling,this._overlay.appendChild(this.container),document.body.appendChild(this._overlay),this.container.classList.add("le-fullscreen"),this._fullscreenBtn.innerHTML=d2.minimize,this._fullscreenBtn.title="Salir de pantalla completa",this._savedEditorMaxH=this.editorEl.style.maxHeight,this.editorEl.style.maxHeight="none";const e=this.editorEl.querySelector(".tiptap");e&&(this._savedMinH=e.style.minHeight,this._savedMaxH=e.style.maxHeight,e.style.minHeight="",e.style.maxHeight=""),this._escHandler=t=>{t.key==="Escape"&&this._toggleFullscreen()},document.addEventListener("keydown",this._escHandler)}else{this.container.classList.remove("le-fullscreen"),this._originalNext?this._originalParent.insertBefore(this.container,this._originalNext):this._originalParent.appendChild(this.container),this._overlay&&(this._overlay.remove(),this._overlay=null),this._fullscreenBtn.innerHTML=d2.maximize,this._fullscreenBtn.title="Pantalla completa",this.editorEl.style.maxHeight=this._savedEditorMaxH||"";const e=this.editorEl.querySelector(".tiptap");e&&(this._savedMinH&&(e.style.minHeight=this._savedMinH),this._savedMaxH&&(e.style.maxHeight=this._savedMaxH)),this._escHandler&&(document.removeEventListener("keydown",this._escHandler),this._escHandler=null)}this.editor.commands.focus()}getHTML(){return this.editor.getHTML()}getJSON(){return this.editor.getJSON()}getText(){return this.editor.state.doc.textContent}setContent(e){this.editor.commands.setContent(e),this.textarea&&(this.textarea.value=this.editor.getHTML())}isEmpty(){return this.editor.isEmpty}focus(){this.editor.commands.focus()}setEditable(e){this.editor.setEditable(e)}destroy(){this.editor.destroy(),this.container.remove()}registerButton(e,t){this._customButtons[e]=t}getTiptapEditor(){return this.editor}}const xt={create(o,e){try{return new eM(o,e)}catch(t){return console.warn("[Ledithor] Error al inicializar el editor, mostrando fallback.",t),xt._showFallback(o),null}},_showFallback(o){var e;const t=o instanceof Element?o.querySelector("textarea"):(e=document.querySelector(o))==null?void 0:e.querySelector("textarea");t&&(t.style.display="",t.style.width="100%",t.style.minHeight="150px")},registerGlobalButton(o,e){an[o]=e},registerPreset(o,e){X1[o]=e},initElement(o){if(o._ledithor)return o._ledithor;const e={};return o.dataset.toolbar&&(e.toolbar=o.dataset.toolbar),o.dataset.placeholder&&(e.placeholder=o.dataset.placeholder),o.dataset.theme&&(e.theme=o.dataset.theme),o.dataset.minHeight&&(e.minHeight=o.dataset.minHeight),o.dataset.maxHeight&&(e.maxHeight=o.dataset.maxHeight),o.dataset.statusbar!==void 0&&(e.showStatusBar=!0),o.dataset.htmlSource!==void 0&&(e.htmlSource=!0),o.dataset.aiBaseUrl&&(e.aiBaseUrl=o.dataset.aiBaseUrl),o.dataset.aiToken&&(e.aiToken=o.dataset.aiToken),o.dataset.aiTools&&(e.aiTools=JSON.parse(o.dataset.aiTools)),o._ledithor=xt.create(o,e),o._ledithor},autoInit(){document.querySelectorAll("[data-ledithor]").forEach(o=>xt.initElement(o))},observe(){this._observer||(this._observer=new MutationObserver(o=>{o.forEach(e=>{e.addedNodes.forEach(t=>{var n;t.nodeType===1&&(t.matches("[data-ledithor]")&&xt.initElement(t),(n=t.querySelectorAll)==null||n.call(t,"[data-ledithor]").forEach(r=>xt.initElement(r)))})})}),this._observer.observe(document.body,{childList:!0,subtree:!0}))},presets:X1,buttons:an,icons:d2,prompt(o,e={}){return new Promise(t=>{const n=e.placeholder||"",r=e.confirmText||"Aceptar",i=e.cancelText||"Cancelar",a=document.createElement("div");a.className="le-prompt-overlay";const l=document.createElement("div");l.className="le-prompt-dialog";const s=document.createElement("label");s.className="le-prompt-label",s.textContent=o,l.appendChild(s);const c=document.createElement("input");c.type="text",c.className="le-prompt-input",c.placeholder=n,l.appendChild(c);const d=document.createElement("div");d.className="le-prompt-actions";const p=document.createElement("button");p.type="button",p.className="le-prompt-btn le-prompt-btn-cancel",p.textContent=i;const h=document.createElement("button");h.type="button",h.className="le-prompt-btn le-prompt-btn-confirm",h.textContent=r,d.appendChild(p),d.appendChild(h),l.appendChild(d),a.appendChild(l),document.body.appendChild(a),setTimeout(()=>c.focus(),50);const u=f=>{a.remove(),t(f)};h.addEventListener("click",()=>u(c.value)),p.addEventListener("click",()=>u(null)),a.addEventListener("click",f=>{f.target===a&&u(null)}),c.addEventListener("keydown",f=>{f.key==="Enter"&&(f.preventDefault(),u(c.value)),f.key==="Escape"&&u(null)})})}};typeof document<"u"&&document.addEventListener("DOMContentLoaded",()=>{xt.autoInit(),xt.observe()});const tM=["value","placeholder"],oM={__name:"LedithorEditor",props:{modelValue:{type:String,default:""},toolbar:{type:String,default:Be.toolbar},theme:{type:String,default:Be.theme},placeholder:{type:String,default:Be.placeholder},minHeight:{type:String,default:Be.minHeight},maxHeight:{type:String,default:Be.maxHeight},statusbar:{type:Boolean,default:Be.showStatusBar},htmlSource:{type:Boolean,default:Be.htmlSource},aiBaseUrl:{type:String,default:Be.aiBaseUrl},aiToken:{type:String,default:Be.aiToken},aiTools:{type:Array,default:()=>Be.aiTools}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,n=e,r=m.ref(null),i=m.shallowRef(null),a=m.ref(!1),l=m.computed(()=>({width:"100%",minHeight:t.minHeight??"150px",maxHeight:t.maxHeight??void 0}));return m.onMounted(()=>{console.warn("[LedithorEditor] onMounted — containerRef:",r.value),console.warn("[LedithorEditor] Ledithor object:",xt),console.warn("[LedithorEditor] props:",{...t});try{if(i.value=xt.create(r.value,{toolbar:t.toolbar,theme:t.theme,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,showStatusBar:t.statusbar,htmlSource:t.htmlSource,aiBaseUrl:t.aiBaseUrl,aiToken:t.aiToken,aiTools:t.aiTools,content:t.modelValue,onChange:s=>n("update:modelValue",s)}),console.warn("[LedithorEditor] instancia creada:",i.value),!i.value){console.warn("[LedithorEditor] create() devolvió null — activando fallback"),a.value=!0;return}console.warn("[LedithorEditor] editor listo")}catch(s){console.warn("[LedithorEditor] Fallback activado:",s.message),console.error("[LedithorEditor] Stack:",s),a.value=!0}}),m.onBeforeUnmount(()=>{var s;return(s=i.value)==null?void 0:s.destroy()}),m.watch(()=>t.modelValue,s=>{i.value&&s!==i.value.getHTML()&&i.value.setContent(s)}),(s,c)=>a.value?(m.openBlock(),m.createElementBlock("textarea",{key:1,value:o.modelValue,placeholder:o.placeholder,style:m.normalizeStyle(l.value),onInput:c[0]||(c[0]=d=>n("update:modelValue",d.target.value))},null,44,tM)):(m.openBlock(),m.createElementBlock("div",{key:0,ref_key:"containerRef",ref:r},null,512))}},nM={class:"mecano:space-y-2"},rM={key:0,class:"mecano:flex mecano:gap-2 mecano:items-center"},iM=["value","onInput"],aM=["value","onChange"],lM=["value"],sM=["value","onInput"],cM=["checked","onChange"],dM={key:4,class:"mecano:flex-1 mecano:space-y-2"},pM=["id","mandatory-crops","has-file","existing-url","onLimbo:change"],mM={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},hM=["src","alt"],uM=["onClick"],fM={key:1},gM={class:"mecano:flex mecano:justify-between mecano:items-center mecano:mb-2"},bM={class:"mecano:text-xs mecano:font-semibold mecano:text-slate-500 mecano:bg-slate-100 mecano:px-2 mecano:py-0.5 mecano:rounded mecano:uppercase mecano:tracking-wide"},CM=["onClick"],OM={class:"subfields-cq-container"},vM={class:"subfields-cq-grid"},wM={class:"mecano:block mecano:text-xs mecano:text-slate-500 mecano:mb-1"},xM={key:0,class:"mecano:text-xs mecano:text-slate-400 mecano:mb-1"},yM=["value","onInput"],kM=["value","onChange"],SM=["value"],$M=["value","onInput"],MM=["checked","onChange"],QM={key:5,class:"mecano:space-y-2"},PM=["id","mandatory-crops","has-file","existing-url","onLimbo:change"],LM={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},TM=["src","alt"],EM=m.defineComponent({__name:"ListField",props:{field:{},modelValue:{},instanceId:{}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,n=t.instanceId??Math.random().toString(36).slice(2),r=e,i=m.computed(()=>t.modelValue??[]),a=m.computed(()=>{var C;return((C=t.field.items)==null?void 0:C.type)==="object"}),l=()=>t.field.items.type==="boolean"?t.field.items.example_value??!1:t.field.items.example_value??"",s=()=>{var C;return Object.fromEntries((((C=t.field.items)==null?void 0:C.fields)??[]).map(x=>[x.name,x.example_value??(x.type==="boolean"?!1:"")]))};m.onMounted(()=>{var C;i.value.length===0&&(a.value?(((C=t.field.items)==null?void 0:C.fields)??[]).some(y=>y.example_value!==void 0):t.field.items.example_value!==void 0)&&c()});const c=()=>{const C=a.value?s():l();r("update:modelValue",[...i.value,C])},d=C=>{const x=[...i.value];x.splice(C,1),r("update:modelValue",x)},p=(C,x)=>{const y=[...i.value];y[C]=x,r("update:modelValue",y)},h=(C,x,y)=>{const k=[...i.value];k[C]={...k[C],[x]:y},r("update:modelValue",k)},u=/\/preview-comp\//,f=C=>u.test(C),g=C=>{var x;if(!C||typeof C!="string")return"";try{const y=C.replace(/&quot;/g,'"').replace(/&amp;/g,"&"),k=JSON.parse(y),$=k.images??[],T=$.find(P=>(P==null?void 0:P.url)&&!P.url.startsWith("blob:"));if(T!=null&&T.url)return T.url;const N=$.find(P=>P==null?void 0:P.url);return N!=null&&N.url?N.url:(x=k.original)!=null&&x.url?k.original.url:""}catch{return!C.startsWith("http")&&!C.startsWith("/files/")||f(C)?"":C}},b=C=>{var x;if(C==null||C===!1)return!1;if(typeof C=="string"){const y=C.trim();if(!y||y==="[]"||y==="{}"||y==="null")return!1;try{const k=JSON.parse(y);if(Array.isArray(k))return k.length>0;if(k&&typeof k=="object"){const $=((x=k.original)==null?void 0:x.url)??"";return $&&!f($)?!0:(Array.isArray(k.images)?k.images:[]).some(N=>(N==null?void 0:N.url)&&!f(N.url))}}catch{}return!y.startsWith("http")&&!y.startsWith("/")?!1:!f(y)}return Array.isArray(C)?C.length>0:!0},v=C=>{var y,k,$,T;if(!C||typeof C!="object")return{};const x=C;if(x.original!==void 0||x.images!==void 0)return x;if(Array.isArray(x.crops)&&x.crops.length>0){const N=x.asset?{url:x.asset.url||x.asset.urlSigned||null,width:x.asset.width??null,height:x.asset.height??null,assetId:x.asset.id??null}:null,P=x.crops.map(Z=>({url:Z.url||Z.urlSigned||null,width:Z.width??null,height:Z.height??null,name:Z.name||Z.filename||null}));return{original:N,images:P}}return(y=x.master)!=null&&y.urlSigned||(k=x.master)!=null&&k.url?{original:{url:x.master.urlSigned||x.master.url||null,width:x.width??(($=x.master)==null?void 0:$.width)??null,height:x.height??((T=x.master)==null?void 0:T.height)??null,assetId:x.assetId??null},images:[]}:x.url||x.urlSigned?{original:{url:x.url||x.urlSigned||null,width:x.width??null,height:x.height??null,assetId:x.assetId??x.id??null},images:[]}:x},w=(C,x)=>{const y=x.detail,k=JSON.stringify(v(y==null?void 0:y.data));p(C,k)},O=(C,x,y)=>{const k=y.detail,$=JSON.stringify(v(k==null?void 0:k.data));h(C,x,$)};return(C,x)=>(m.openBlock(),m.createElementBlock("div",nM,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i.value,(y,k)=>(m.openBlock(),m.createElementBlock("div",{key:k,class:"mecano:border mecano:border-slate-300 mecano:rounded-lg mecano:p-3 mecano:bg-gradient-to-br mecano:from-indigo-50 mecano:to-slate-200 mecano:shadow-sm mecano:ring-1 mecano:ring-slate-100"},[a.value?(m.openBlock(),m.createElementBlock("div",fM,[m.createElementVNode("div",gM,[m.createElementVNode("span",bM,"Elemento "+m.toDisplayString(k+1),1),m.createElementVNode("button",{type:"button",class:"mecano:text-red-400 mecano:hover:text-red-600 mecano:transition-colors mecano:text-sm mecano:cursor-pointer",onClick:$=>d(k)},"🗑️",8,CM)]),m.createElementVNode("div",OM,[m.createElementVNode("div",vM,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(o.field.items.fields,$=>(m.openBlock(),m.createElementBlock("div",{key:$.name,class:m.normalizeClass(["mecano:mb-2 mecano:last:mb-0",["textArea","image"].includes($.type)?"subfield-full":"subfield-half"])},[m.createElementVNode("label",wM,m.toDisplayString($.label),1),$.help?(m.openBlock(),m.createElementBlock("p",xM,m.toDisplayString($.help),1)):m.createCommentVNode("",!0),$.type==="text"?(m.openBlock(),m.createElementBlock("input",{key:1,type:"text",class:"mecano:w-full mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm",value:y[$.name],onInput:T=>h(k,$.name,T.target.value)},null,40,yM)):$.type==="select"?(m.openBlock(),m.createElementBlock("select",{key:2,class:"mecano:w-full mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm",value:y[$.name],onChange:T=>h(k,$.name,T.target.value)},[x[4]||(x[4]=m.createElementVNode("option",{disabled:"",value:""},"Seleccione una opción",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList($.options??[],(T,N)=>{var P;return m.openBlock(),m.createElementBlock("option",{key:N,value:T},m.toDisplayString(((P=$.options_labels)==null?void 0:P[N])??T),9,SM)}),128))],40,kM)):$.type==="textArea"?(m.openBlock(),m.createElementBlock("textarea",{key:3,class:"mecano:w-full mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm mecano:resize-y mecano:min-h-[60px]",value:y[$.name],onInput:T=>h(k,$.name,T.target.value)},null,40,$M)):$.type==="boolean"?(m.openBlock(),m.createElementBlock("input",{key:4,type:"checkbox",class:"mecano:h-4 mecano:w-4 mecano:text-blue-600 mecano:focus:ring-blue-500 mecano:border-slate-300 mecano:rounded",checked:y[$.name],onChange:T=>h(k,$.name,T.target.checked)},null,40,MM)):$.type==="image"?(m.openBlock(),m.createElementBlock("div",QM,[m.createElementVNode("limbo-selector",{id:`lf-${m.unref(n)}-${o.field.name}-${k}-${$.name}`,accept:"image/*","return-format":"json","mandatory-crops":$.image_cuts?JSON.stringify($.image_cuts):void 0,"has-file":b(y[$.name])?"":void 0,"existing-url":g(y[$.name])||void 0,"onLimbo:change":T=>O(k,$.name,T)},null,40,PM),g(y[$.name])?(m.openBlock(),m.createElementBlock("div",LM,[m.createElementVNode("img",{src:g(y[$.name]),alt:$.label,class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",onError:x[1]||(x[1]=T=>T.target.style.display="none")},null,40,TM),x[5]||(x[5]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Imagen seleccionada",-1))])):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0)],2))),128))])])])):(m.openBlock(),m.createElementBlock("div",rM,[o.field.items.type==="text"?(m.openBlock(),m.createElementBlock("input",{key:0,type:"text",class:"mecano:flex-1 mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm",value:y,onInput:$=>p(k,$.target.value)},null,40,iM)):o.field.items.type==="select"?(m.openBlock(),m.createElementBlock("select",{key:1,class:"mecano:flex-1 mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm",value:y,onChange:$=>p(k,$.target.value)},[x[2]||(x[2]=m.createElementVNode("option",{disabled:"",value:""},"Seleccione una opción",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(o.field.items.options??[],($,T)=>{var N;return m.openBlock(),m.createElementBlock("option",{key:T,value:$},m.toDisplayString(((N=o.field.items.options_labels)==null?void 0:N[T])??$),9,lM)}),128))],40,aM)):o.field.items.type==="textArea"?(m.openBlock(),m.createElementBlock("textarea",{key:2,class:"mecano:flex-1 mecano:px-3 mecano:py-1.5 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400 mecano:text-sm mecano:resize-y mecano:min-h-[60px]",value:y,onInput:$=>p(k,$.target.value)},null,40,sM)):o.field.items.type==="boolean"?(m.openBlock(),m.createElementBlock("input",{key:3,type:"checkbox",class:"mecano:h-4 mecano:w-4 mecano:text-blue-600 mecano:focus:ring-blue-500 mecano:border-slate-300 mecano:rounded",checked:y,onChange:$=>p(k,$.target.checked)},null,40,cM)):o.field.items.type==="image"?(m.openBlock(),m.createElementBlock("div",dM,[m.createElementVNode("limbo-selector",{id:`lf-${m.unref(n)}-${o.field.name}-${k}`,accept:"image/*","return-format":"json","mandatory-crops":o.field.items.image_cuts?JSON.stringify(o.field.items.image_cuts):void 0,"has-file":b(y)?"":void 0,"existing-url":g(y)||void 0,"onLimbo:change":$=>w(k,$)},null,40,pM),g(y)?(m.openBlock(),m.createElementBlock("div",mM,[m.createElementVNode("img",{src:g(y),alt:o.field.label,class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",onError:x[0]||(x[0]=$=>$.target.style.display="none")},null,40,hM),x[3]||(x[3]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Imagen seleccionada",-1))])):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0),m.createElementVNode("button",{type:"button",class:"mecano:text-red-400 mecano:hover:text-red-600 mecano:transition-colors mecano:text-lg mecano:leading-none mecano:flex-shrink-0 mecano:cursor-pointer",onClick:$=>d(k)},"🗑️",8,uM)]))]))),128)),m.createElementVNode("button",{type:"button",class:"mecano:w-full mecano:py-2.5 mecano:px-3 mecano:rounded-lg mecano:text-sm mecano:font-semibold mecano:bg-blue-600 mecano:text-white mecano:border mecano:border-blue-700 mecano:hover:bg-blue-700 mecano:active:bg-blue-800 mecano:transition-all mecano:duration-150 mecano:cursor-pointer mecano:flex mecano:items-center mecano:justify-center mecano:gap-1.5 mecano:shadow-sm",onClick:c},[...x[6]||(x[6]=[m.createElementVNode("span",{class:"mecano:text-base mecano:leading-none"},"+",-1),m.createTextVNode(" Añadir elemento ",-1)])])]))}}),ZM=I1(EM,[["__scopeId","data-v-9839d911"]]),AM={key:0,class:"mecano:absolute mecano:top-0 mecano:left-0 mecano:bg-white/90 mecano:w-full mecano:h-full z-100"},VM={class:"mecano:w-full mecano:flex mecano:justify-end mecano:p-4"},NM={key:0,class:"mecano:flex mecano:flex-col mecano:items-center mecano:justify-center mecano:gap-2 mecano:py-8 mecano:text-slate-400"},RM={class:"mecano:text-xs mecano:font-semibold mecano:text-slate-400 mecano:uppercase mecano:tracking-wider mecano:mb-2"},BM={class:"mecano:flex mecano:gap-1 mecano:mb-3 mecano:bg-slate-100 mecano:rounded-lg mecano:p-1"},zM=["onClick"],DM=["for"],jM={key:0,class:"mecano:text-red-500"},XM={key:0,class:"mecano:text-xs mecano:text-slate-400 mecano:mb-1"},IM={key:1,class:"mecano:space-y-2"},HM=["id","mandatory-crops","has-file","existing-url","onLimbo:change"],WM={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},qM=["src","alt"],YM={key:2,class:"mecano:space-y-2"},FM=["placeholder","required","value","onInput"],GM=["id","has-file","existing-url","onLimbo:change"],_M={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},UM=["src"],KM={class:"fields-cq-container"},JM={class:"fields-cq-grid"},eQ=["for"],tQ={key:0,class:"mecano:text-red-500"},oQ={key:0,class:"mecano:text-xs mecano:text-slate-400 mecano:mb-1"},nQ=["id","name","placeholder","required","value","onInput"],rQ={key:2,class:"mecano:space-y-2"},iQ=["id","mandatory-crops","has-file","existing-url","onLimbo:change"],aQ={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},lQ=["src","alt"],sQ={key:3,class:"mecano:space-y-2"},cQ=["placeholder","required","value","onInput"],dQ=["id","has-file","existing-url","onLimbo:change"],pQ={key:0,class:"mecano:flex mecano:items-center mecano:gap-2 mecano:p-2 mecano:bg-slate-100 mecano:rounded"},mQ=["src"],hQ=["id","name","required","value","onInput"],uQ=["value"],fQ=["id","name","required","checked","onChange"],gQ=m.defineComponent({__name:"FieldsForm",props:{object:{type:Object,required:!0},toggleShowForm:{type:Function,required:!0},showForm:{type:Boolean,default:!1},ateneaToken:{type:String,default:void 0},ledithorAiTools:{type:Array,default:void 0}},emits:["fieldUpdated","exclusiveFieldChanged"],setup(o,{emit:e}){const t=o,n=e,r=m.computed(()=>{const w={};for(const O of t.object.fields||[])O.exclusive_group&&(w[O.exclusive_group]||(w[O.exclusive_group]=[]),w[O.exclusive_group].push(O));return w}),i=m.reactive({}),a=()=>{var w;for(const[O,C]of Object.entries(r.value)){if(!i[O]){const x=C.find(y=>y.example_value&&String(y.example_value).trim()!=="");i[O]=x?x.name:((w=C[0])==null?void 0:w.name)||""}n("exclusiveFieldChanged",O,i[O])}},l=(w,O)=>{i[w]=O,n("exclusiveFieldChanged",w,O)},s=m.computed(()=>(t.object.fields||[]).filter(w=>!w.exclusive_group)),c=(w,O)=>{const C=O.find(x=>x.exclusive_group_label);return C!=null&&C.exclusive_group_label?C.exclusive_group_label:w.replace(/_/g," ").replace(/^\w/,x=>x.toUpperCase())},d=/\/preview-comp\//,p=w=>d.test(w),h=w=>{const O=w.example_value;if(typeof O!="string")return"";const C=O.trim();return!C||!C.startsWith("http")&&!C.startsWith("/")||p(C)?"":C},u=w=>{var C;const O=w.example_value;if(!O)return"";try{const x=O.replace(/&quot;/g,'"').replace(/&amp;/g,"&"),y=JSON.parse(x),k=y.images??[],$=k.find(N=>(N==null?void 0:N.url)&&!N.url.startsWith("blob:"));if($!=null&&$.url)return $.url;const T=k.find(N=>N==null?void 0:N.url);return T!=null&&T.url?T.url:(C=y.original)!=null&&C.url?y.original.url:""}catch{return!O.startsWith("http")&&!O.startsWith("/files/")||p(O)?"":O}},f=w=>{var O;if(w==null||w===!1)return!1;if(typeof w=="string"){const C=w.trim();if(!C||C==="[]"||C==="{}"||C==="null")return!1;try{const x=JSON.parse(C);if(Array.isArray(x))return x.length>0;if(x&&typeof x=="object"){const y=((O=x.original)==null?void 0:O.url)??"";return y&&!p(y)?!0:(Array.isArray(x.images)?x.images:[]).some($=>($==null?void 0:$.url)&&!p($.url))}}catch{}return!C.startsWith("http")&&!C.startsWith("/")?!1:!p(C)}return Array.isArray(w)?w.length>0:!0},g=(w,O)=>{const C=(t.object.fields||[]).find(x=>x.name===w);C&&(C.example_value=O,n("fieldUpdated",w,O))},b=w=>{var C,x,y,k;if(!w||typeof w!="object")return{};const O=w;if(O.original!==void 0||O.images!==void 0)return O;if(Array.isArray(O.crops)&&O.crops.length>0){const $=O.asset?{url:O.asset.url||O.asset.urlSigned||null,width:O.asset.width??null,height:O.asset.height??null,assetId:O.asset.id??null}:null,T=O.crops.map(N=>({url:N.url||N.urlSigned||null,width:N.width??null,height:N.height??null,name:N.name||N.filename||null}));return{original:$,images:T}}return(C=O.master)!=null&&C.urlSigned||(x=O.master)!=null&&x.url?{original:{url:O.master.urlSigned||O.master.url||null,width:O.width??((y=O.master)==null?void 0:y.width)??null,height:O.height??((k=O.master)==null?void 0:k.height)??null,assetId:O.assetId??null},images:[]}:O.url||O.urlSigned?{original:{url:O.url||O.urlSigned||null,width:O.width??null,height:O.height??null,assetId:O.assetId??O.id??null},images:[]}:O},v=(w,O,C)=>{const x=O.detail,y=C==="url"?(x==null?void 0:x.url)||"":JSON.stringify(b(x==null?void 0:x.data));g(w.name,y)};return m.onMounted(()=>{a()}),(w,O)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[o.showForm?(m.openBlock(),m.createElementBlock("div",AM)):m.createCommentVNode("",!0),m.createElementVNode("div",{class:m.normalizeClass(o.showForm?"mecano:relative mecano:top-0 mecano:w-full mecano:text-slate-600 mecano:border-1 mecano:my-2 mecano:px-4 mecano:pt-2 mecano:pb-3 mecano:w-full mecano:border-slate-200 mecano:bg-slate-50 mecano:inline-block mecano:rounded-lg mecano:flex mecano:flex-col z-101":"mecano:hidden")},[m.createElementVNode("div",VM,[m.createElementVNode("span",{onClick:O[0]||(O[0]=(...C)=>o.toggleShowForm&&o.toggleShowForm(...C)),class:"mecano:cursor-pointer mecano:hover:scale-125 mecano:transition-all mecano:duration-300"},"❌")]),m.createElementVNode("form",null,[Object.keys(r.value).length===0&&s.value.length===0?(m.openBlock(),m.createElementBlock("div",NM,[...O[5]||(O[5]=[m.createElementVNode("span",{class:"mecano:text-3xl"},"⚙️",-1),m.createElementVNode("span",{class:"mecano:text-sm"},"Este componente no tiene parámetros configurables",-1)])])):m.createCommentVNode("",!0),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(r.value,(C,x)=>(m.openBlock(),m.createElementBlock("div",{key:"group-"+x,class:"mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:p-3 mecano:mb-4 mecano:bg-white"},[m.createElementVNode("div",RM,m.toDisplayString(c(x,C)),1),m.createElementVNode("div",BM,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C,y=>(m.openBlock(),m.createElementBlock("button",{key:y.name,type:"button",class:m.normalizeClass(["mecano:flex-1 mecano:py-1.5 mecano:px-3 mecano:rounded-md mecano:text-sm mecano:font-medium mecano:transition-all mecano:cursor-pointer",i[x]===y.name?y.type==="image"?"mecano:bg-blue-500 mecano:text-white mecano:shadow-sm":"mecano:bg-purple-500 mecano:text-white mecano:shadow-sm":"mecano:text-slate-500 mecano:hover:text-slate-700 mecano:hover:bg-white/50"]),onClick:k=>l(x,y.name)},m.toDisplayString(y.type==="image"?"Imagen":"Video"),11,zM))),128))]),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C,y=>m.withDirectives((m.openBlock(),m.createElementBlock("div",{key:"gf-"+y.name},[m.createElementVNode("label",{for:`${o.object.id}-${y.name}-eg`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:mb-1"},[m.createTextVNode(m.toDisplayString(y.label)+" ",1),y.mandatory?(m.openBlock(),m.createElementBlock("span",jM,"*")):m.createCommentVNode("",!0)],8,DM),y.help?(m.openBlock(),m.createElementBlock("p",XM,m.toDisplayString(y.help),1)):m.createCommentVNode("",!0),y.type==="image"?(m.openBlock(),m.createElementBlock("div",IM,[m.createElementVNode("limbo-selector",{id:`${o.object.id}-${y.name}-eg`,accept:"image/*","return-format":"json","mandatory-crops":y.image_cuts?JSON.stringify(y.image_cuts):void 0,"has-file":f(y.example_value)?"":void 0,"existing-url":u(y)||void 0,"onLimbo:change":k=>v(y,k,"json")},null,40,HM),u(y)?(m.openBlock(),m.createElementBlock("div",WM,[m.createElementVNode("img",{src:u(y),alt:y.label,class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",onError:O[1]||(O[1]=k=>k.target.style.display="none")},null,40,qM),O[6]||(O[6]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Imagen seleccionada",-1))])):m.createCommentVNode("",!0)])):y.type==="video"?(m.openBlock(),m.createElementBlock("div",YM,[m.createElementVNode("input",{type:"text",class:"mecano:w-full mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-purple-400",placeholder:y.label,required:y.mandatory,value:y.example_value,onInput:k=>g(y.name,k.target.value)},null,40,FM),m.createElementVNode("limbo-selector",{id:`${o.object.id}-${y.name}-eg`,accept:"video/*","return-format":"url","has-file":h(y)?"":void 0,"existing-url":h(y)||void 0,"onLimbo:change":k=>v(y,k,"url")},null,40,GM),h(y)?(m.openBlock(),m.createElementBlock("div",_M,[m.createElementVNode("video",{src:h(y),class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",muted:"",onError:O[2]||(O[2]=k=>k.target.style.display="none")},null,40,UM),O[7]||(O[7]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Vídeo seleccionado",-1))])):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0)],512)),[[m.vShow,i[x]===y.name]])),128))]))),128)),m.createElementVNode("div",KM,[m.createElementVNode("div",JM,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(s.value,(C,x)=>(m.openBlock(),m.createElementBlock("div",{key:x,class:m.normalizeClass(["mecano:mb-4",["textArea","image","video","list"].includes(C.type)?"field-full":"field-half"])},[m.createElementVNode("label",{for:`${o.object.id}-${C.name}-${x}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:mb-1"},[m.createTextVNode(m.toDisplayString(C.label)+" ",1),C.mandatory?(m.openBlock(),m.createElementBlock("span",tQ,"*")):m.createCommentVNode("",!0)],8,eQ),C.help?(m.openBlock(),m.createElementBlock("p",oQ,m.toDisplayString(C.help),1)):m.createCommentVNode("",!0),C.type==="text"?(m.openBlock(),m.createElementBlock("input",{key:1,id:`${o.object.id}-${C.name}-${x}`,name:`${o.object.id}-${C.name}-${x}`,type:"text",class:"mecano:w-full mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400",placeholder:C.label,required:C.mandatory,value:C.example_value,onInput:y=>g(C.name,y.target.value)},null,40,nQ)):C.type==="image"?(m.openBlock(),m.createElementBlock("div",rQ,[m.createElementVNode("limbo-selector",{id:`${o.object.id}-${C.name}-${x}`,accept:"image/*","return-format":"json","mandatory-crops":C.image_cuts?JSON.stringify(C.image_cuts):void 0,"has-file":f(C.example_value)?"":void 0,"existing-url":u(C)||void 0,"onLimbo:change":y=>v(C,y,"json")},null,40,iQ),u(C)?(m.openBlock(),m.createElementBlock("div",aQ,[m.createElementVNode("img",{src:u(C),alt:C.label,class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",onError:O[3]||(O[3]=y=>y.target.style.display="none")},null,40,lQ),O[8]||(O[8]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Imagen seleccionada",-1))])):m.createCommentVNode("",!0)])):C.type==="video"?(m.openBlock(),m.createElementBlock("div",sQ,[m.createElementVNode("input",{type:"text",class:"mecano:w-full mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-purple-400",placeholder:C.label,required:C.mandatory,value:C.example_value,onInput:y=>g(C.name,y.target.value)},null,40,cQ),m.createElementVNode("limbo-selector",{id:`${o.object.id}-${C.name}-${x}`,accept:"video/*","return-format":"url","has-file":h(C)?"":void 0,"existing-url":h(C)||void 0,"onLimbo:change":y=>v(C,y,"url")},null,40,dQ),h(C)?(m.openBlock(),m.createElementBlock("div",pQ,[m.createElementVNode("video",{src:h(C),class:"mecano:w-16 mecano:h-16 mecano:object-cover mecano:rounded mecano:border mecano:border-slate-200",muted:"",onError:O[4]||(O[4]=y=>y.target.style.display="none")},null,40,mQ),O[9]||(O[9]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-500 mecano:truncate"},"Vídeo seleccionado",-1))])):m.createCommentVNode("",!0)])):C.type==="textArea"?(m.openBlock(),m.createBlock(m.unref(oM),m.mergeProps({key:4,ref_for:!0},t.ateneaToken?{"ai-token":t.ateneaToken,"ai-tools":t.ledithorAiTools??[]}:{},{"ai-base-url":"https://led-dev-atenea-dev.eu.els.local/api","model-value":C.example_value,"onUpdate:modelValue":y=>C.example_value=y}),null,16,["model-value","onUpdate:modelValue"])):C.type==="select"?(m.openBlock(),m.createElementBlock("select",{key:5,id:`${o.object.id}-${C.name}-${x}`,name:`${o.object.id}-${C.name}-${x}`,class:"mecano:w-full mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-300 mecano:rounded mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-blue-400",required:C.mandatory,value:C.example_value,onInput:y=>g(C.name,y.target.value)},[O[10]||(O[10]=m.createElementVNode("option",{disabled:"",value:""},"Seleccione una opción",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.options||[],(y,k)=>(m.openBlock(),m.createElementBlock("option",{key:k,value:y},m.toDisplayString(y),9,uQ))),128))],40,hQ)):C.type==="boolean"?(m.openBlock(),m.createElementBlock("input",{key:6,id:`${o.object.id}-${C.name}-${x}`,name:`${o.object.id}-${C.name}-${x}`,type:"checkbox",class:"mecano:h-4 mecano:w-4 mecano:text-blue-600 mecano:focus:ring-blue-500 mecano:border-slate-300 mecano:rounded mecano:inline-block",required:C.mandatory,checked:C.example_value,onChange:y=>g(C.name,y.target.checked)},null,40,fQ)):C.type==="list"?(m.openBlock(),m.createBlock(ZM,{key:7,field:C,"model-value":C.example_value??[],"instance-id":`${o.object.id}-${C.name}`,"onUpdate:modelValue":y=>g(C.name,y)},null,8,["field","model-value","instance-id","onUpdate:modelValue"])):m.createCommentVNode("",!0)],2))),128))])])])],2)],64))}}),Ul=I1(gQ,[["__scopeId","data-v-689b1665"]]),bQ={class:"mecano:space-y-4"},CQ=["disabled"],OQ=["value"],vQ={class:"mecano:space-y-3"},wQ={key:0,class:"mecano:overflow-y-auto mecano:space-y-3"},xQ={class:"mecano:block mecano:text-sm mecano:font-semibold mecano:text-slate-600 mecano:mb-2"},yQ=["onChange","disabled"],kQ=["value"],SQ=["onChange","disabled"],$Q=["onInput","disabled","placeholder"],MQ=["disabled"],QQ={key:0,class:"mecano:animate-spin"},PQ={key:1},Id=m.defineComponent({__name:"SourceFilter",props:{onSubmit:{type:Function,required:!0},updateFeedCriteria:{type:Function,required:!0},onLoadingChange:{type:Function,default:null},isProduction:{type:Boolean,default:!1}},setup(o){const e=o,t=m.ref(!1),n=m.ref(null),r=m.ref({}),i=m.computed(()=>{const d=e.isProduction;return[{id:"origen1",name:"El Derecho",apiUrl:d?"https://elderecho.com/feed":"https://led-dev-elderecho-dev.eu.els.local/feed",filters:[{id:"title",label:"Título del Post",type:"text"},{id:"category",label:"Slug de la Categoría",type:"text"},{id:"tax",label:"Slug de la Etiqueta",type:"text"},{id:"limit",label:"Número de Posts",type:"text"},{id:"last",label:"Últimas X horas",type:"text"},{id:"type",label:"Tipo de Post",type:"select",options:["noticias","tribunas","foros","caraacara"]},{id:"fecha",label:"Fecha dd/mm/yyyy",type:"text"}]},{id:"origen2",name:"Formación",apiUrl:d?"https://lefebvre.es/formacion/feed":"http://led-dev-lefebvre-dev.eu.els.local/formacion/feed",filters:[{id:"id",label:"ID del curso",type:"text"},{id:"title",label:"Título del Post",type:"text"},{id:"featured",label:"Destacado",type:"select",options:["1","0"]},{id:"page",label:"Página a mostrar",type:"text"},{id:"limit",label:"Número de cursos",type:"text"}]},{id:"origen3",name:"Genia-L",apiUrl:d?"https://lefebvre.es/genia-l/feed/":"https://led-dev-lefebvre-dev.eu.els.local/genia-l/feed/",filters:[{id:"limit",label:"Límite",type:"text"},{id:"categoria",label:"Categoría",type:"select",options:["ia-para-abogados","genia-l-y-lefebvre","redaccion-y-documentos-juridicos","asistente-juridico-con-ia","busqueda-y-analisis-juridico","automatizacion-juridica","legaltech-e-innovacion"]},{id:"titulo",label:"Título",type:"text"}]},{id:"origen4",name:"EspacioAsesoría",apiUrl:d?"https://espacioasesoria.com/feed":"https://led-dev-espacioasesoria-dev.eu.els.local/feed",filters:[]},{id:"origen5",name:"EspacioPymes",apiUrl:d?"https://espaciopymes.com/feed":"https://led-dev-espaciopymes-dev.eu.els.local/feed",filters:[]},{id:"origen6",name:"Derecholocal",apiUrl:d?"https://derecholocal.es/feed":"https://led-dev-derecholocal-dev.eu.els.local/feed",filters:[]}]}),a=m.computed(()=>{if(!n.value)return[];const d=i.value.find(p=>p.id===n.value);return d?d.filters:[]}),l=(d,p)=>{r.value[d]=p},s=()=>{r.value={}},c=async()=>{var h,u;t.value=!0,(h=e.onLoadingChange)==null||h.call(e,!0);const d=i.value.find(f=>f.id===n.value);if(!d){console.error("Origen no encontrado"),t.value=!1;return}const p=new URL(d.apiUrl);Object.keys(r.value).forEach(f=>{r.value[f]&&p.searchParams.append(f,r.value[f])});try{const g=await(await fetch(p.toString(),{method:"GET",headers:{Accept:"text/xml, application/xml"}})).text(),v=new DOMParser().parseFromString(g,"text/xml"),w=Array.from(v.querySelectorAll("item")).map(O=>{const C={};return Array.from(O.children).forEach(x=>{x.children.length>0?Array.from(x.children).forEach(y=>{const k=`${x.nodeName}_${y.nodeName}`;C[k]=y.textContent||"",Array.from(y.attributes).forEach($=>{C[`${x.nodeName}_${y.nodeName}_${$.name}`]=$.value})}):C[x.nodeName]=x.textContent||"",Array.from(x.attributes).forEach(y=>{C[`${x.nodeName}_${y.name}`]=y.value})}),C});e.onSubmit(w)}catch(f){console.error("Error al aplicar filtros:",f),e.onSubmit([])}finally{const f={name:d.name,url:p.toString()};e.updateFeedCriteria(f),t.value=!1,(u=e.onLoadingChange)==null||u.call(e,!1)}};return(d,p)=>(m.openBlock(),m.createElementBlock("div",bQ,[m.createElementVNode("div",null,[p[1]||(p[1]=m.createElementVNode("label",{class:"mecano:block mecano:text-sm mecano:font-semibold mecano:text-slate-600 mecano:mb-2"},"Seleccionar origen:",-1)),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":p[0]||(p[0]=h=>n.value=h),class:"mecano:w-full mecano:px-3 mecano:py-2.5 mecano:bg-white mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:shadow-sm mecano:focus:border-emerald-400 mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:transition-all mecano:duration-200 mecano:disabled:bg-slate-100 mecano:disabled:cursor-not-allowed mecano:cursor-pointer",onChange:s,disabled:t.value},[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i.value,h=>(m.openBlock(),m.createElementBlock("option",{key:h.id,value:h.id},m.toDisplayString(h.name),9,OQ))),128))],40,CQ),[[m.vModelSelect,n.value]])]),m.createElementVNode("div",vQ,[a.value.length>0?(m.openBlock(),m.createElementBlock("div",wQ,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.value,h=>(m.openBlock(),m.createElementBlock("div",{key:h.id,class:"mecano:bg-gradient-to-br mecano:from-slate-50 mecano:to-white mecano:p-4 mecano:rounded-xl mecano:border mecano:border-slate-200"},[m.createElementVNode("label",xQ,m.toDisplayString(h.label)+":",1),h.type==="select"?(m.openBlock(),m.createElementBlock("select",{key:0,class:"mecano:w-full mecano:px-3 mecano:py-2.5 mecano:bg-white mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:shadow-sm mecano:focus:border-emerald-400 mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:transition-all mecano:duration-200 mecano:disabled:bg-slate-100 mecano:disabled:cursor-not-allowed mecano:cursor-pointer",onChange:u=>l(h.id,u.target.value),disabled:t.value},[p[2]||(p[2]=m.createElementVNode("option",{value:""},"Seleccionar...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(h.options,u=>(m.openBlock(),m.createElementBlock("option",{key:u,value:u},m.toDisplayString(u),9,kQ))),128))],40,yQ)):h.type==="date"?(m.openBlock(),m.createElementBlock("input",{key:1,type:"date",class:"mecano:w-full mecano:px-3 mecano:py-2.5 mecano:bg-white mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:shadow-sm mecano:focus:border-emerald-400 mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:transition-all mecano:duration-200 mecano:disabled:bg-slate-100 mecano:disabled:cursor-not-allowed",onChange:u=>l(h.id,u.target.value),disabled:t.value},null,40,SQ)):h.type==="text"?(m.openBlock(),m.createElementBlock("input",{key:2,type:"text",class:"mecano:w-full mecano:px-3 mecano:py-2.5 mecano:bg-white mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:shadow-sm mecano:focus:border-emerald-400 mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:transition-all mecano:duration-200 mecano:disabled:bg-slate-100 mecano:disabled:cursor-not-allowed",onInput:u=>l(h.id,u.target.value),disabled:t.value,placeholder:h.label},null,40,$Q)):m.createCommentVNode("",!0)]))),128))])):m.createCommentVNode("",!0),m.createElementVNode("button",{type:"button",onClick:c,class:"mecano:cursor-pointer mecano:w-full mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:text-white mecano:font-semibold mecano:px-4 mecano:py-3 mecano:rounded-xl mecano:shadow-md mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:hover:shadow-lg mecano:transform mecano:hover:-translate-y-0.5 mecano:transition-all mecano:duration-200 mecano:disabled:from-slate-300 mecano:disabled:to-slate-400 mecano:disabled:cursor-not-allowed mecano:disabled:transform-none mecano:disabled:shadow-none mecano:flex mecano:items-center mecano:justify-center mecano:gap-2",disabled:t.value},[t.value?(m.openBlock(),m.createElementBlock("span",QQ,"⏳")):(m.openBlock(),m.createElementBlock("span",PQ,"🔍")),m.createTextVNode(" "+m.toDisplayString(t.value?"Conectando con el feed...":"Aplicar Filtros"),1)],8,MQ)])]))}}),LQ={class:"mecano:fixed mecano:top-0 mecano:left-0 mecano:w-full mecano:h-full mecano:bg-gradient-to-br mecano:from-slate-50 mecano:via-white mecano:to-slate-100 mecano:flex mecano:flex-col z-9999 mecano:p-6"},TQ={key:0,class:"mecano:absolute mecano:inset-0 mecano:z-50 mecano:flex mecano:flex-col mecano:items-center mecano:justify-center mecano:bg-white/70 mecano:backdrop-blur-sm mecano:rounded-none"},EQ={class:"mecano:w-full mecano:flex mecano:justify-between mecano:items-center mecano:mb-4"},ZQ={class:"mecano:w-full mecano:flex-1 mecano:bg-white/60 mecano:rounded-2xl mecano:flex mecano:gap-5 mecano:p-5 mecano:overflow-hidden mecano:backdrop-blur-sm mecano:border mecano:border-slate-200 mecano:shadow-inner"},AQ={class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:gap-5"},VQ={class:"mecano:flex mecano:flex-col mecano:bg-white mecano:rounded-2xl mecano:shadow-lg mecano:border mecano:border-slate-200 mecano:p-5 mecano:overflow-y-auto"},NQ={key:0,class:"mecano:mb-4 mecano:p-4 mecano:bg-gradient-to-br mecano:from-emerald-50 mecano:to-teal-50 mecano:rounded-xl mecano:border mecano:border-emerald-200 mecano:w-full mecano:flex-shrink-0 mecano:text-sm mecano:font-medium mecano:text-emerald-700"},RQ={class:"mecano:list-none mecano:mt-3 mecano:space-y-2 mecano:text-slate-600"},BQ={class:"mecano:flex mecano:items-start mecano:gap-2"},zQ={class:"mecano:font-semibold mecano:text-slate-700"},DQ={class:"mecano:flex mecano:items-start mecano:gap-2"},jQ={class:"mecano:font-semibold mecano:text-slate-700"},XQ={class:"mecano:font-semibold mecano:text-slate-700"},IQ={class:"mecano:flex mecano:items-start mecano:gap-2"},HQ={class:"mecano:flex mecano:flex-wrap mecano:gap-2 mecano:mt-1"},WQ={class:"mecano:font-semibold mecano:text-slate-700"},qQ={class:"mecano:text-emerald-600"},YQ={class:"mecano:flex mecano:flex-col mecano:gap-4 mecano:w-full"},FQ={class:"mecano:flex mecano:items-center mecano:gap-3 mecano:cursor-pointer mecano:group"},GQ={key:0,class:"mecano:flex mecano:flex-col mecano:gap-4 mecano:ml-8 mecano:p-4 mecano:bg-gradient-to-br mecano:from-slate-50 mecano:to-white mecano:rounded-xl mecano:border mecano:border-slate-200"},_Q={class:"mecano:flex mecano:flex-col mecano:gap-2"},UQ={class:"mecano:flex mecano:flex-col mecano:gap-2"},KQ={class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:bg-white mecano:rounded-2xl mecano:shadow-lg mecano:border mecano:border-slate-200 mecano:p-5 mecano:overflow-y-auto mecano:min-h-[400px]"},JQ={class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:bg-white mecano:rounded-2xl mecano:shadow-lg mecano:border mecano:border-slate-200 mecano:p-5 mecano:overflow-y-auto"},eP={key:0,class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:items-center mecano:justify-center mecano:text-slate-400"},tP={key:1,class:"mecano:space-y-3"},oP=["onClick"],nP={class:"mecano:font-bold mecano:text-slate-800 mecano:mb-2"},rP={class:"mecano:text-sm mecano:text-slate-600 line-clamp-2"},iP={class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:bg-white mecano:rounded-2xl mecano:shadow-lg mecano:border mecano:border-slate-200 mecano:p-5 mecano:overflow-y-auto"},aP={key:0,class:"mecano:flex-1 mecano:flex mecano:flex-col mecano:items-center mecano:justify-center mecano:text-slate-400"},lP={key:1,class:"mecano:space-y-3"},sP={class:"mecano:block mecano:text-sm mecano:font-bold mecano:text-slate-700 mecano:mb-2 mecano:flex mecano:items-center mecano:gap-2"},cP=["onUpdate:modelValue"],dP=["value"],pP={key:0,class:"mecano:mt-3 mecano:p-3 mecano:bg-gradient-to-br mecano:from-emerald-50 mecano:to-teal-50 mecano:rounded-lg mecano:border mecano:border-emerald-200"},mP={class:"mecano:mt-1 mecano:text-sm mecano:font-medium mecano:text-slate-700 mecano:break-words"},Hd=m.defineComponent({__name:"FeedComponent",props:{object:{type:Object,required:!0},toggleFeedSection:{type:Function,required:!0},updateObjectByFeedContent:{type:Function,required:!0},isProduction:{type:Boolean,default:!1},feedState:{type:Object,required:!0}},setup(o){const e=o,t=m.ref(!1),n=m.ref(e.feedState.apiResponse),r=m.ref(e.feedState.selectedContenido),i=m.ref(!1),a=m.ref(1),l=m.ref("horizontal"),s=m.ref({}),c=m.ref(null),d=v=>{n.value=v,e.feedState.apiResponse=v},p=v=>{r.value=v,e.feedState.selectedContenido=v},h=()=>{const v=e.object.fields.filter(w=>w.mappedTo).map(w=>{var O;return{fieldName:w.name,mappedTo:w.mappedTo,value:((O=r.value)==null?void 0:O[w.mappedTo])??null}});c.value={...s.value,dynamicUpdate:i.value,elementCount:a.value,orientation:l.value,mapping:v.map(({fieldName:w,mappedTo:O})=>({fieldName:w,mappedTo:O}))},e.updateObjectByFeedContent&&e.updateObjectByFeedContent(v,c.value),e.toggleFeedSection()},u=v=>{s.value=v},f=()=>{var v;(v=e.object)!=null&&v.repeat_data&&(c.value=e.object.repeat_data,i.value=e.object.repeat_data.dynamicUpdate||!1,a.value=e.object.repeat_data.elementCount||1,l.value=e.object.repeat_data.orientation||"horizontal",s.value={name:e.object.repeat_data.name,url:e.object.repeat_data.url},(e.object.repeat_data.mapping||[]).forEach(({fieldName:O,mappedTo:C})=>{const x=e.object.fields.find(y=>y.name===O);x&&(x.mappedTo=C)}))},g=()=>{c.value=null,i.value=!1,a.value=1,l.value="horizontal",s.value={},e.updateObjectByFeedContent&&e.updateObjectByFeedContent([],null)},b=()=>{var v;c.value&&(c.value={...c.value,dynamicUpdate:i.value,elementCount:a.value,orientation:l.value},e.updateObjectByFeedContent&&e.updateObjectByFeedContent(((v=c.value.mapping)==null?void 0:v.map(w=>({fieldName:w.fieldName,mappedTo:w.mappedTo,value:null})))||[],c.value))};return m.onMounted(()=>{f()}),m.watch(()=>{var v;return(v=e.object)==null?void 0:v.repeat_data},v=>{v!==c.value&&f()},{deep:!0}),(v,w)=>(m.openBlock(),m.createElementBlock("div",LQ,[m.createVNode(m.Transition,{name:"fade"},{default:m.withCtx(()=>[t.value?(m.openBlock(),m.createElementBlock("div",TQ,[...w[4]||(w[4]=[m.createElementVNode("div",{class:"mecano:w-12 mecano:h-12 mecano:border-4 mecano:border-emerald-200 mecano:border-t-emerald-500 mecano:rounded-full mecano:animate-spin mecano:mb-4"},null,-1),m.createElementVNode("p",{class:"mecano:text-sm mecano:font-semibold mecano:text-slate-600"},"Conectando con el feed...",-1)])])):m.createCommentVNode("",!0)]),_:1}),m.createElementVNode("div",EQ,[w[6]||(w[6]=m.createElementVNode("h2",{class:"mecano:text-xl mecano:font-bold mecano:bg-gradient-to-r mecano:from-slate-700 mecano:to-slate-500 mecano:bg-clip-text mecano:text-transparent mecano:flex mecano:items-center mecano:gap-3"},[m.createElementVNode("span",{class:"mecano:text-xl"},"🍺"),m.createTextVNode(" Configuración de Feed ")],-1)),m.createElementVNode("button",{onClick:w[0]||(w[0]=(...O)=>o.toggleFeedSection&&o.toggleFeedSection(...O)),class:"mecano:cursor-pointer mecano:group mecano:w-10 mecano:h-10 mecano:flex mecano:items-center mecano:justify-center mecano:bg-white mecano:hover:bg-red-50 mecano:border mecano:border-red-200 mecano:hover:border-red-400 mecano:text-red-400 mecano:hover:text-red-600 mecano:rounded-full mecano:font-semibold mecano:shadow-sm mecano:hover:shadow-lg mecano:transition-all mecano:duration-200"},[...w[5]||(w[5]=[m.createElementVNode("span",{class:"mecano:text-lg"},"✕",-1)])])]),m.createElementVNode("div",ZQ,[m.createElementVNode("div",AQ,[m.createElementVNode("div",VQ,[c.value&&c.value.dynamicUpdate?(m.openBlock(),m.createElementBlock("div",NQ,[m.createElementVNode("div",{class:"mecano:flex mecano:justify-between mecano:items-start"},[w[9]||(w[9]=m.createElementVNode("p",{class:"mecano:flex mecano:items-center mecano:gap-2"},[m.createElementVNode("span",{class:"mecano:text-emerald-500"},"✓"),m.createTextVNode(" Hay un criterio de feed establecido: ")],-1)),m.createElementVNode("div",{class:"mecano:flex mecano:items-center mecano:gap-2"},[m.createElementVNode("button",{onClick:b,class:"mecano:cursor-pointer mecano:px-3 mecano:py-1.5 mecano:bg-white mecano:hover:bg-emerald-50 mecano:text-emerald-500 mecano:hover:text-emerald-600 mecano:border mecano:border-emerald-200 mecano:hover:border-emerald-300 mecano:rounded-lg mecano:text-xs mecano:font-semibold mecano:transition-all mecano:duration-200 mecano:flex mecano:items-center mecano:gap-1 mecano:shadow-sm"},[...w[7]||(w[7]=[m.createElementVNode("span",null,"💾",-1),m.createTextVNode(" Guardar ",-1)])]),m.createElementVNode("button",{onClick:g,class:"mecano:cursor-pointer mecano:px-3 mecano:py-1.5 mecano:bg-white mecano:hover:bg-red-50 mecano:text-red-500 mecano:hover:text-red-600 mecano:border mecano:border-red-200 mecano:hover:border-red-300 mecano:rounded-lg mecano:text-xs mecano:font-semibold mecano:transition-all mecano:duration-200 mecano:flex mecano:items-center mecano:gap-1 mecano:shadow-sm"},[...w[8]||(w[8]=[m.createElementVNode("span",null,"✕",-1),m.createTextVNode(" Borrar ",-1)])])])]),m.createElementVNode("ul",RQ,[m.createElementVNode("li",BQ,[w[10]||(w[10]=m.createElementVNode("span",{class:"mecano:text-emerald-400"},"→",-1)),w[11]||(w[11]=m.createTextVNode(" Conectar con ",-1)),m.createElementVNode("span",zQ,m.toDisplayString(c.value.name),1)]),m.createElementVNode("li",DQ,[w[12]||(w[12]=m.createElementVNode("span",{class:"mecano:text-emerald-400"},"→",-1)),w[13]||(w[13]=m.createTextVNode(" Recuperar ",-1)),m.createElementVNode("span",jQ,m.toDisplayString(c.value.elementCount),1),w[14]||(w[14]=m.createTextVNode(" items (",-1)),m.createElementVNode("span",XQ,m.toDisplayString(c.value.orientation),1),w[15]||(w[15]=m.createTextVNode(")",-1))]),m.createElementVNode("li",IQ,[w[18]||(w[18]=m.createElementVNode("span",{class:"mecano:text-emerald-400"},"→",-1)),m.createElementVNode("div",null,[w[17]||(w[17]=m.createTextVNode(" Mapeo: ",-1)),m.createElementVNode("div",HQ,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(c.value.mapping,(O,C)=>(m.openBlock(),m.createElementBlock("span",{key:C,class:"mecano:inline-flex mecano:items-center mecano:gap-1 mecano:px-2 mecano:py-0.5 mecano:bg-white mecano:rounded-full mecano:text-xs mecano:border mecano:border-slate-200"},[m.createElementVNode("span",WQ,m.toDisplayString(O.fieldName),1),w[16]||(w[16]=m.createElementVNode("span",{class:"mecano:text-slate-400"},"←",-1)),m.createElementVNode("span",qQ,m.toDisplayString(O.mappedTo),1)]))),128))])])])])])):m.createCommentVNode("",!0),m.createElementVNode("div",YQ,[m.createElementVNode("label",FQ,[m.withDirectives(m.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":w[1]||(w[1]=O=>i.value=O),class:"mecano:w-5 mecano:h-5 mecano:text-emerald-500 mecano:border-2 mecano:border-slate-300 mecano:rounded mecano:focus:ring-emerald-500 mecano:cursor-pointer"},null,512),[[m.vModelCheckbox,i.value]]),w[19]||(w[19]=m.createElementVNode("span",{class:"mecano:font-medium mecano:text-slate-700 mecano:group-hover:text-slate-900 mecano:transition-colors"},"Actualizar dinámicamente según criterios del feed",-1))]),i.value?(m.openBlock(),m.createElementBlock("div",GQ,[w[23]||(w[23]=m.createElementVNode("div",{class:"mecano:p-3 mecano:bg-gradient-to-r mecano:from-amber-50 mecano:to-yellow-50 mecano:rounded-lg mecano:border mecano:border-amber-200 mecano:text-sm mecano:text-amber-700"},[m.createElementVNode("div",{class:"mecano:flex mecano:items-start mecano:gap-2"},[m.createElementVNode("span",{class:"mecano:text-amber-500 mecano:mt-0.5"},"ℹ️"),m.createElementVNode("p",null,[m.createElementVNode("strong",null,"Nota:"),m.createTextVNode(" Los valores que verás al relacionar campos son solo un ejemplo de referencia. En el momento de renderizar, se mostrarán los datos reales obtenidos del feed según los criterios configurados. ")])])],-1)),m.createElementVNode("div",_Q,[w[20]||(w[20]=m.createElementVNode("label",{class:"mecano:text-sm mecano:font-semibold mecano:text-slate-600"},"Cantidad de elementos:",-1)),m.withDirectives(m.createElementVNode("input",{type:"number","onUpdate:modelValue":w[2]||(w[2]=O=>a.value=O),min:"1",class:"mecano:w-32 mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:transition-colors"},null,512),[[m.vModelText,a.value,void 0,{number:!0}]])]),m.createElementVNode("div",UQ,[w[22]||(w[22]=m.createElementVNode("label",{class:"mecano:text-sm mecano:font-semibold mecano:text-slate-600"},"Orientación:",-1)),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":w[3]||(w[3]=O=>l.value=O),class:"mecano:w-48 mecano:px-3 mecano:py-2 mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-white mecano:transition-colors mecano:cursor-pointer"},[...w[21]||(w[21]=[m.createElementVNode("option",{value:"horizontal",selected:""},"Horizontal",-1),m.createElementVNode("option",{value:"vertical"},"Vertical",-1)])],512),[[m.vModelSelect,l.value]])])])):m.createCommentVNode("",!0)])]),m.createElementVNode("div",KQ,[w[24]||(w[24]=m.createElementVNode("h3",{class:"mecano:text-lg mecano:font-bold mecano:mb-5 mecano:text-slate-700 mecano:pb-2 mecano:flex mecano:items-center mecano:gap-2 mecano:border-b mecano:border-slate-100"},[m.createElementVNode("span",{class:"mecano:text-xl"},"🔍"),m.createTextVNode(" Orígenes y Filtros ")],-1)),m.createVNode(Id,{onSubmit:d,updateFeedCriteria:u,isProduction:o.isProduction,onLoadingChange:O=>t.value=O},null,8,["isProduction","onLoadingChange"])])]),m.createElementVNode("div",JQ,[w[26]||(w[26]=m.createElementVNode("h3",{class:"mecano:text-lg mecano:font-bold mecano:mb-5 mecano:text-slate-700 mecano:pb-2 mecano:flex mecano:items-center mecano:gap-2 mecano:border-b mecano:border-slate-100"},[m.createElementVNode("span",{class:"mecano:text-xl"},"📰"),m.createTextVNode(" Contenidos ")],-1)),!n.value||n.value.length===0?(m.openBlock(),m.createElementBlock("div",eP,[...w[25]||(w[25]=[m.createElementVNode("span",{class:"mecano:text-5xl mecano:mb-3 mecano:opacity-50"},"📭",-1),m.createElementVNode("p",{class:"mecano:text-sm mecano:font-medium"},"No hay contenidos disponibles",-1),m.createElementVNode("p",{class:"mecano:text-xs mecano:mt-1 mecano:text-slate-300"},"Selecciona un origen para cargar contenidos",-1)])])):(m.openBlock(),m.createElementBlock("ul",tP,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(n.value,(O,C)=>(m.openBlock(),m.createElementBlock("li",{key:C,class:"mecano:p-4 mecano:bg-gradient-to-br mecano:from-slate-50 mecano:to-white mecano:rounded-xl mecano:shadow-sm mecano:hover:shadow-md mecano:cursor-pointer mecano:hover:scale-[1.01] mecano:transition-all mecano:duration-200 mecano:border mecano:border-slate-200 mecano:hover:border-emerald-300",onClick:x=>p(O)},[m.createElementVNode("h4",nP,m.toDisplayString(O.title||O.titulo||"Sin título"),1),m.createElementVNode("p",rP,m.toDisplayString(O.description||O.descripcion||O.content||"Sin descripción"),1)],8,oP))),128))]))]),m.createElementVNode("div",iP,[w[32]||(w[32]=m.createElementVNode("h3",{class:"mecano:text-lg mecano:font-bold mecano:mb-5 mecano:text-slate-700 mecano:pb-2 mecano:flex mecano:items-center mecano:gap-2 mecano:border-b mecano:border-slate-100"},[m.createElementVNode("span",{class:"mecano:text-xl"},"🔗"),m.createTextVNode(" Relacionar Contenido ")],-1)),r.value?(m.openBlock(),m.createElementBlock("div",lP,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(o.object.fields,(O,C)=>(m.openBlock(),m.createElementBlock("div",{key:C,class:"mecano:p-4 mecano:bg-gradient-to-br mecano:from-slate-50 mecano:to-white mecano:rounded-xl mecano:border mecano:border-slate-200"},[m.createElementVNode("label",sP,[w[28]||(w[28]=m.createElementVNode("span",{class:"mecano:text-base"},"⚙️",-1)),m.createTextVNode(" "+m.toDisplayString(O.name),1)]),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":x=>O.mappedTo=x,class:"mecano:w-full mecano:px-3 mecano:py-2.5 mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:transition-all mecano:bg-white mecano:cursor-pointer"},[w[29]||(w[29]=m.createElementVNode("option",{value:""},"-- Seleccionar campo --",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(r.value,(x,y)=>(m.openBlock(),m.createElementBlock("option",{key:y,value:y},m.toDisplayString(y),9,dP))),128))],8,cP),[[m.vModelSelect,O.mappedTo]]),O.mappedTo?(m.openBlock(),m.createElementBlock("div",pP,[w[30]||(w[30]=m.createElementVNode("span",{class:"mecano:text-xs mecano:font-semibold mecano:text-emerald-600 mecano:uppercase mecano:tracking-wide"},"Vista previa:",-1)),m.createElementVNode("p",mP,m.toDisplayString(r.value[O.mappedTo]),1)])):m.createCommentVNode("",!0)]))),128)),m.createElementVNode("button",{onClick:h,class:"mecano:cursor-pointer mecano:w-full mecano:mt-4 mecano:px-5 mecano:py-3 mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:text-white mecano:font-semibold mecano:rounded-xl mecano:shadow-md mecano:hover:shadow-lg mecano:transition-all mecano:duration-200 mecano:transform mecano:hover:scale-[1.01] mecano:flex mecano:items-center mecano:justify-center mecano:gap-2"},[...w[31]||(w[31]=[m.createElementVNode("span",{class:"mecano:text-lg"},"✓",-1),m.createElementVNode("span",null,"Alimentar el componente",-1)])])])):(m.openBlock(),m.createElementBlock("div",aP,[...w[27]||(w[27]=[m.createElementVNode("span",{class:"mecano:text-5xl mecano:mb-3 mecano:opacity-50"},"👆",-1),m.createElementVNode("p",{class:"mecano:text-sm mecano:font-medium mecano:text-center"},[m.createTextVNode("Selecciona un contenido"),m.createElementVNode("br"),m.createTextVNode("para relacionar")],-1)])]))])])]))}}),hP={class:"mecano:absolute mecano:-top-2.5 mecano:left-3 mecano:text-[11px] mecano:font-medium mecano:tracking-wide mecano:bg-gradient-to-r mecano:from-slate-700 mecano:to-slate-600 mecano:text-white mecano:px-3 mecano:py-0.5 mecano:rounded-full mecano:shadow-sm"},uP={class:"mecano:w-full mecano:text-right mecano:flex mecano:justify-between mecano:items-center mecano:mt-1"},fP={class:"mecano:flex mecano:gap-3 mecano:items-center"},gP={class:"mecano:bg-rose-50 mecano:border mecano:border-rose-200 mecano:text-rose-500 mecano:px-2 mecano:py-0.5 mecano:text-[10px] mecano:font-semibold mecano:uppercase mecano:tracking-wider mecano:rounded-md"},bP={key:0,class:"mecano:flex-1 mecano:flex mecano:justify-center mecano:gap-2"},CP={class:"mecano:flex mecano:justify-end mecano:items-center mecano:gap-3"},OP={class:"mecano:bg-violet-50 mecano:border mecano:border-violet-200 mecano:text-violet-600 mecano:rounded-md mecano:px-2 mecano:py-0.5 mecano:text-[10px] mecano:font-semibold mecano:uppercase mecano:tracking-wider"},vP={key:0,class:"mecano:flex mecano:gap-1 mecano:bg-slate-50 mecano:rounded-lg mecano:p-1"},wP={key:0,class:"mecano:text-[10px] mecano:bg-amber-100 mecano:text-amber-700 mecano:px-1.5 mecano:rounded-full mecano:font-medium"},xP={class:"mecano:mt-2 mecano:flex mecano:items-center"},yP={class:"mecano:font-medium mecano:text-slate-700"},kP={key:0},SP={key:1},$P={key:0,class:"mecano:mt-3 mecano:p-3 mecano:bg-gradient-to-r mecano:from-sky-50 mecano:to-blue-50 mecano:rounded-lg mecano:text-sm mecano:text-slate-600 mecano:border mecano:border-sky-100"},MP={class:"mecano:mt-3 mecano:flex mecano:gap-1.5 mecano:flex-wrap"},QP={class:"mecano:absolute mecano:top-2 mecano:right-2 mecano:group/info mecano:z-10 mecano:pointer-events-auto"},PP={class:"mecano:absolute mecano:top-6 mecano:right-0 mecano:w-64 mecano:p-3 mecano:bg-white mecano:rounded-lg mecano:shadow-lg mecano:border mecano:border-slate-200 mecano:opacity-0 mecano:invisible mecano:group-hover/info:opacity-100 mecano:group-hover/info:visible mecano:transition-all mecano:duration-200 mecano:text-xs mecano:text-slate-600 mecano:leading-relaxed"},LP={class:"mecano:flex mecano:flex-wrap mecano:justify-center mecano:content-center mecano:h-full mecano:items-center mecano:p-4 mecano:gap-3 mecano:pointer-events-auto mecano:overflow-y-auto"},TP={key:0,title:"Mover componente",class:"handle mecano:cursor-grab mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-sky-500 mecano:hover:border-sky-500 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},EP={key:1,class:"mecano:flex-1 mecano:flex mecano:justify-center mecano:items-center mecano:gap-3"},ZP={class:"mecano:flex mecano:flex-col mecano:items-center"},AP={key:0,class:"mecano:text-[10px] mecano:mt-0.5 mecano:opacity-70"},VP={key:0,class:"mecano:flex mecano:flex-col mecano:items-center mecano:gap-2 mecano:bg-white mecano:border mecano:border-red-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:shadow-sm"},NP={class:"mecano:flex mecano:gap-2"},RP=["id"],fc=m.defineComponent({__name:"InitialComponent",props:{object:{type:Object,required:!0},columnToInsert:Object,isComponentMode:Boolean,fullwidthMode:Boolean,addComponentToColumn:Function,removeComponent:Function,cloneComponent:Function,section:String,renderApiDomain:String,insideComponentBox:{type:Boolean,default:!1},isProduction:{type:Boolean,default:!1},ateneaToken:String,ledithorAiTools:Array,previewWidth:String},setup(o){const e=["Contenido de Texto","Contenido de Imagen"],t=o,n={DEV:"https://led-dev-limbo-dev.eu.els.local",PROD:"https://limbo.lefebvre.es"},r=D=>D?D.startsWith("/files/")?(t.isProduction?n.PROD:n.DEV)+D:D:"",i=D=>{var H,K;if(!D)return"";const M=D.replace(/&quot;/g,'"').replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#39;/g,"'");try{const l2=JSON.parse(M),w2=h2=>h2&&!h2.startsWith("blob:"),r2=(H=l2.images)==null?void 0:H.find(h2=>w2(h2==null?void 0:h2.url));return r2?r(r2.url):w2((K=l2.original)==null?void 0:K.url)?r(l2.original.url):w2(l2.url)?r(l2.url):""}catch{return M.startsWith("blob:")?"":M.startsWith("/files/")?r(M):M.startsWith("http")||M.startsWith("/")?M:D.startsWith("{")?"":D}},a=Math.random().toString(36).substring(2,15),l=m.ref(!1),s=m.ref(!1),c=m.ref(!1),d=m.ref(!1),p=m.ref(null),h=m.ref(null),u=m.ref(!1),f=m.ref(!1),g=m.reactive({apiResponse:null,selectedContenido:null}),b=m.ref({}),v=m.computed(()=>e.length>0&&e.includes(t.object.category??""));m.watch(()=>t.isComponentMode,D=>{D||w()}),m.watch(()=>t.object,()=>{w()},{deep:!0}),m.watch(u,async D=>{D&&(await m.nextTick(),e2())});const w=()=>{p.value&&clearTimeout(p.value),p.value=setTimeout(()=>{e2()},500)},O=()=>{if(t.isComponentMode)return;const D=new IntersectionObserver(M=>{M.forEach(H=>{H.isIntersecting&&!u.value&&(u.value=!0,D.disconnect())})},{threshold:.1});h.value&&D.observe(h.value)},C=(D,M)=>{const H=(t.object.fields||[]).find(K=>K.name===D);H&&(H.example_value=M)},x=(D,M)=>{D.forEach(H=>{H.value!==void 0&&C(H.fieldName,H.value)}),t.object.repeat_data=M},y=()=>{d.value=!d.value},k=()=>{f.value=!f.value},$=(D,M)=>{console.log("[InitialComponent] Field updated from FieldsForm:",D,M),w()},T=(D,M)=>{b.value[D]=M,w()},N=()=>{const M={desktop:1200,tablet:768,mobile:375}[t.previewWidth??"desktop"]??1200;e2(!0).then(H=>{const K=window.open("","Preview",`width=${M},height=800`);if(!K){alert("El navegador bloqueó la ventana emergente. Por favor, permite los popups para este sitio.");return}K.document.body.innerHTML=U(H);const l2=K.document.createElement("style");l2.textContent="body { container-type: inline-size; }",K.document.head.appendChild(l2),K.document.querySelectorAll("script").forEach(r2=>{var X2;const h2=K.document.createElement("script");r2.src?h2.src=r2.src:h2.textContent=r2.textContent,(X2=r2.parentNode)==null||X2.replaceChild(h2,r2)}),K.document.close()})},P=D=>{const M=new Set;for(const K of D.fields||[])if(K.exclusive_group){const l2=b.value[K.exclusive_group];l2&&l2!==K.name&&M.add(K.name)}const H=D.fields.map(K=>{if(M.has(K.name))return{...K,example_value:""};if(K.type==="image"&&typeof K.example_value=="string"){const l2=i(K.example_value);return{...K,example_value:l2||K.example_value}}return K.type==="video"?{...K}:K});return{...D,fields:H}},Z=D=>{var H;const M=document.getElementById(a);(H=M==null?void 0:M.contentWindow)==null||H.scrollBy({top:D.deltaY,left:D.deltaX})},U=D=>{let M=D.replace(/\bclass=(["'])([^"']*)\1/g,(H,K,l2)=>{const w2=l2.replace(/(^|\s)((?:2xl|xl|lg|md|sm):)/g,"$1@$2");return`class=${K}${w2}${K}`});return M=M.replace(/(<style[^>]*>)([\s\S]*?)(<\/style>)/gi,(H,K,l2,w2)=>{const r2=l2.replace(/@media\s*\(\s*min-width\s*:\s*(\d+(?:\.\d+)?px)\s*\)/g,"@container (min-width: $1)").replace(/\.((?:2xl|xl|lg|md|sm)\\:)/g,".\\@$1");return K+r2+w2}),M},e2=(D=!1)=>{var l2;if(!((l2=t.object)!=null&&l2.category)||t.object.category==="Repetidor"){const w2='<div style="color:white; padding: 1em 2em;background-color:#001978;border-radius:1em;border:4px solid #711978;">Componente que contiene elementos repetidos: TODO: GENERAR PREVIEW DE REPETIDORES</div>';if(D)return Promise.resolve(w2);const r2=document.getElementById(a);return r2&&(r2.srcdoc=w2),Promise.resolve("")}const M=t.renderApiDomain?t.renderApiDomain+"/api/preview-comp/":"http://localhost:8003/api/preview-comp/",H=P(t.object),K=JSON.stringify({obj:H},null,2);return fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:K}).then(w2=>w2.text()).then(w2=>{if(D)return w2;const r2=document.getElementById(a);return r2&&(r2.srcdoc=w2,r2.onload=()=>{var Se;const X2=((Se=r2.contentDocument)==null?void 0:Se.documentElement.scrollHeight)??500;r2.style.height=Math.min(X2,500)+"px"}),""})};return m.onMounted(()=>{O()}),(D,M)=>(m.openBlock(),m.createElementBlock("div",null,[f.value?(m.openBlock(),m.createBlock(Hd,{key:0,updateObjectByFeedContent:x,toggleFeedSection:k,object:o.object,isProduction:o.isProduction,feedState:g},null,8,["object","isProduction","feedState"])):m.createCommentVNode("",!0),m.createElementVNode("div",{ref_key:"rootElement",ref:h,class:m.normalizeClass(["mecano:min-h-[100px] mecano:relative mecano:group/component mecano:hover:shadow-lg mecano:hover:shadow-slate-200/50 mecano:duration-300 mecano:ease-out js-draggable-element mecano:text-slate-600 mecano:border mecano:border-slate-200 mecano:hover:border-slate-300 mecano:px-5 mecano:pt-3 mecano:pb-4 mecano:w-full mecano:bg-white mecano:inline-block mecano:rounded-xl mecano:flex mecano:flex-col mecano:mt-4 z-0 shadow-sm",[{"mecano:overflow-hidden":!o.isComponentMode},d.value?"mecano:border-amber-400 mecano:ring-2 mecano:ring-amber-300 mecano:shadow-amber-100":"mecano:border-slate-200 mecano:hover:border-slate-300"]])},[o.isComponentMode?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.createElementVNode("span",hP,m.toDisplayString(o.object.component_name),1),m.createElementVNode("div",uP,[m.createElementVNode("div",fP,[M[19]||(M[19]=m.createElementVNode("div",{class:"handle mecano:cursor-grab mecano:text-slate-400 mecano:hover:text-slate-600 mecano:text-lg mecano:transition-colors"},[m.createElementVNode("svg",{class:"mecano:w-5 mecano:h-5",fill:"currentColor",viewBox:"0 0 20 20"},[m.createElementVNode("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})])],-1)),m.createElementVNode("span",gP,m.toDisplayString(o.object.category),1)]),o.fullwidthMode?(m.openBlock(),m.createElementBlock("div",bP,[m.createElementVNode("div",{class:"mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:text-white mecano:rounded-lg mecano:px-4 mecano:py-1.5 mecano:text-xs mecano:font-medium mecano:cursor-pointer mecano:shadow-sm mecano:hover:shadow mecano:transition-all mecano:duration-200",onClick:M[0]||(M[0]=H=>{var K;return(K=o.addComponentToColumn)==null?void 0:K.call(o,o.object)})},"Seleccionar"),m.createElementVNode("div",{class:"mecano:bg-white mecano:border mecano:border-slate-200 mecano:hover:bg-slate-50 mecano:text-slate-600 mecano:rounded-lg mecano:px-4 mecano:py-1.5 mecano:text-xs mecano:font-medium mecano:cursor-pointer mecano:shadow-sm mecano:hover:shadow mecano:transition-all mecano:duration-200",onClick:M[1]||(M[1]=H=>N()),title:"Ver preview en ventana nueva"},"🔍 Previsualizar")])):m.createCommentVNode("",!0),m.createElementVNode("div",CP,[m.createElementVNode("span",OP,m.toDisplayString(o.object.framework),1),o.insideComponentBox?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",vP,[m.createElementVNode("div",{title:"Previsualizar Dummy",onClick:M[2]||(M[2]=H=>N()),class:"mecano:p-1.5 mecano:rounded-md mecano:hover:bg-white mecano:hover:shadow-sm mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-base"},"🔍"),m.createElementVNode("div",{title:"Editar configuración",onClick:M[3]||(M[3]=H=>d.value=!d.value),class:"mecano:p-1.5 mecano:rounded-md mecano:hover:bg-white mecano:hover:shadow-sm mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-base"},"⚙️"),v.value?(m.openBlock(),m.createElementBlock("div",{key:0,title:"Beber de contenido",onClick:k,class:"mecano:p-1.5 mecano:rounded-md mecano:hover:bg-sky-50 mecano:hover:shadow-sm mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-base mecano:flex mecano:items-center mecano:gap-1"},[M[20]||(M[20]=m.createTextVNode("⚡ ",-1)),o.object.repeat_data?(m.openBlock(),m.createElementBlock("span",wP,m.toDisplayString(o.object.repeat_data.elementCount),1)):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0),o.cloneComponent?(m.openBlock(),m.createElementBlock("div",{key:1,title:"Clonar componente",onClick:M[4]||(M[4]=H=>o.cloneComponent(o.object,o.section||"")),class:"mecano:p-1.5 mecano:rounded-md mecano:hover:bg-sky-50 mecano:hover:shadow-sm mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-base"},"📋")):m.createCommentVNode("",!0),o.removeComponent?(m.openBlock(),m.createElementBlock(m.Fragment,{key:2},[s.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[M[21]||(M[21]=m.createElementVNode("span",{class:"mecano:text-[10px] mecano:text-red-600 mecano:font-medium mecano:self-center mecano:px-1"},"¿Eliminar?",-1)),m.createElementVNode("div",{onClick:M[5]||(M[5]=H=>{o.removeComponent(o.object,o.section||""),s.value=!1}),class:"mecano:p-1.5 mecano:rounded-md mecano:bg-red-500 mecano:text-white mecano:hover:bg-red-600 mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-[10px] mecano:font-medium"},"Sí"),m.createElementVNode("div",{onClick:M[6]||(M[6]=H=>s.value=!1),class:"mecano:p-1.5 mecano:rounded-md mecano:bg-slate-100 mecano:hover:bg-slate-200 mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-[10px] mecano:font-medium"},"No")],64)):(m.openBlock(),m.createElementBlock("div",{key:1,title:"Eliminar componente",onClick:M[7]||(M[7]=H=>s.value=!0),class:"mecano:p-1.5 mecano:rounded-md mecano:hover:bg-red-50 mecano:hover:shadow-sm mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-base"},"🗑️"))],64)):m.createCommentVNode("",!0)]))])]),m.createVNode(Ul,{toggleShowForm:y,object:o.object,showForm:d.value,ateneaToken:t.ateneaToken,ledithorAiTools:t.ledithorAiTools,onFieldUpdated:$,onExclusiveFieldChanged:T},null,8,["object","showForm","ateneaToken","ledithorAiTools"]),m.createElementVNode("div",xP,[m.createElementVNode("span",yP,m.toDisplayString(o.object.name),1),m.createElementVNode("button",{type:"button",onClick:M[8]||(M[8]=H=>l.value=!l.value),class:"mecano:ms-2 mecano:cursor-pointer mecano:text-xs mecano:text-slate-400 mecano:hover:text-slate-600 mecano:transition-colors mecano:w-5 mecano:h-5 mecano:rounded-full mecano:hover:bg-slate-100 mecano:flex mecano:items-center mecano:justify-center"},[l.value?(m.openBlock(),m.createElementBlock("span",SP,"▲")):(m.openBlock(),m.createElementBlock("span",kP,"▼"))])]),l.value?(m.openBlock(),m.createElementBlock("div",$P,m.toDisplayString(o.object.description),1)):m.createCommentVNode("",!0),m.createElementVNode("div",MP,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(o.object.tags,(H,K)=>(m.openBlock(),m.createElementBlock("span",{key:K,class:"mecano:bg-slate-50 mecano:text-slate-500 mecano:px-2.5 mecano:py-1 mecano:rounded-full mecano:text-[11px] mecano:font-medium mecano:border mecano:border-slate-100 mecano:hover:border-slate-200 mecano:hover:bg-slate-100 mecano:transition-colors mecano:cursor-default"},m.toDisplayString(H),1))),128))])],64)):u.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:1},[m.createElementVNode("div",{class:m.normalizeClass(["mecano:absolute mecano:top-0 mecano:left-0 mecano:w-full mecano:h-full mecano:opacity-0 mecano:bg-gradient-to-br mecano:from-white/90 mecano:via-slate-50/95 mecano:to-slate-100/90 mecano:backdrop-blur-[2px] z-99 mecano:transition-all mecano:duration-300 mecano:rounded-xl",!c.value&&"mecano:group-hover/component:opacity-100"])},[m.createElementVNode("div",QP,[M[23]||(M[23]=m.createElementVNode("div",{class:"mecano:w-5 mecano:h-5 mecano:rounded-full mecano:bg-slate-100 mecano:hover:bg-sky-100 mecano:border mecano:border-slate-200 mecano:hover:border-sky-300 mecano:flex mecano:items-center mecano:justify-center mecano:cursor-help mecano:transition-colors mecano:duration-200"},[m.createElementVNode("svg",{class:"mecano:w-3 mecano:h-3 mecano:text-slate-400 mecano:group-hover/info:text-sky-500",fill:"currentColor",viewBox:"0 0 20 20"},[m.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})])],-1)),m.createElementVNode("div",PP,[m.createElementVNode("b",null,m.toDisplayString(o.object.component_name),1),M[22]||(M[22]=m.createElementVNode("br",null,null,-1)),m.createTextVNode(m.toDisplayString(o.object.description),1)])]),m.createElementVNode("div",LP,[o.insideComponentBox&&!o.fullwidthMode||!o.insideComponentBox?(m.openBlock(),m.createElementBlock("div",TP,[...M[24]||(M[24]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("svg",{class:"mecano:w-6 mecano:h-6 mecano:mb-1 mecano:text-slate-400 mecano:group-hover/btn:text-white",fill:"currentColor",viewBox:"0 0 20 20"},[m.createElementVNode("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})]),m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Mover")],-1)])])):m.createCommentVNode("",!0),o.insideComponentBox&&o.fullwidthMode?(m.openBlock(),m.createElementBlock("div",EP,[m.createElementVNode("div",{title:"Agregar componente a la columna",onClick:M[9]||(M[9]=H=>{var K;return(K=o.addComponentToColumn)==null?void 0:K.call(o,o.object)}),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:text-white mecano:px-6 mecano:py-3 mecano:rounded-xl mecano:shadow-md mecano:hover:shadow-lg mecano:transition-all mecano:duration-200"},[...M[25]||(M[25]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-2xl mecano:mb-1"},"🚀"),m.createElementVNode("span",{class:"mecano:text-sm mecano:font-medium"},"Seleccionar")],-1)])]),m.createElementVNode("div",{title:"Ver preview en ventana nueva",onClick:M[10]||(M[10]=H=>N()),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:hover:bg-slate-50 mecano:text-slate-600 mecano:px-6 mecano:py-3 mecano:rounded-xl mecano:shadow-md mecano:hover:shadow-lg mecano:transition-all mecano:duration-200"},[...M[26]||(M[26]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-2xl mecano:mb-1"},"🔍"),m.createElementVNode("span",{class:"mecano:text-sm mecano:font-medium"},"Previsualizar")],-1)])])])):m.createCommentVNode("",!0),o.insideComponentBox?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock(m.Fragment,{key:2},[m.createElementVNode("div",{title:"Ver preview en ventana nueva",onClick:M[11]||(M[11]=H=>N()),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-sky-500 mecano:hover:border-sky-500 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},[...M[27]||(M[27]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-xl mecano:mb-1"},"🔍"),m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Previsualizar")],-1)])]),m.createElementVNode("div",{title:"Configurar componente",onClick:M[12]||(M[12]=H=>d.value=!d.value),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-sky-500 mecano:hover:border-sky-500 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},[...M[28]||(M[28]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-xl mecano:mb-1"},"⚙️"),m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Configurar")],-1)])]),v.value?(m.openBlock(),m.createElementBlock("div",{key:0,title:"Configurar componente",onClick:k,class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-sky-500 mecano:hover:border-sky-500 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},[m.createElementVNode("div",ZP,[M[29]||(M[29]=m.createElementVNode("span",{class:"mecano:text-xl mecano:mb-1"},"⚡",-1)),M[30]||(M[30]=m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Beber de contenido",-1)),o.object.repeat_data&&o.object.repeat_data.dynamicUpdate?(m.openBlock(),m.createElementBlock("span",AP,"Carga "+m.toDisplayString(o.object.repeat_data.elementCount)+" elementos",1)):m.createCommentVNode("",!0)])])):m.createCommentVNode("",!0),o.cloneComponent?(m.openBlock(),m.createElementBlock("div",{key:1,title:"Clonar componente",onClick:M[13]||(M[13]=H=>o.cloneComponent(o.object,o.section||"")),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-white mecano:border mecano:border-slate-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-sky-500 mecano:hover:border-sky-500 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},[...M[31]||(M[31]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-xl mecano:mb-1"},"📋"),m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Clonar")],-1)])])):m.createCommentVNode("",!0),o.removeComponent?(m.openBlock(),m.createElementBlock(m.Fragment,{key:2},[s.value?(m.openBlock(),m.createElementBlock("div",VP,[M[32]||(M[32]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-red-600 mecano:font-medium"},"¿Eliminar?",-1)),m.createElementVNode("div",NP,[m.createElementVNode("div",{onClick:M[14]||(M[14]=H=>{o.removeComponent(o.object,o.section||""),s.value=!1}),class:"mecano:cursor-pointer mecano:bg-red-500 mecano:hover:bg-red-600 mecano:text-white mecano:px-3 mecano:py-1 mecano:rounded-lg mecano:text-xs mecano:font-medium mecano:transition-all mecano:duration-200"},"Sí"),m.createElementVNode("div",{onClick:M[15]||(M[15]=H=>s.value=!1),class:"mecano:cursor-pointer mecano:bg-slate-100 mecano:hover:bg-slate-200 mecano:text-slate-600 mecano:px-3 mecano:py-1 mecano:rounded-lg mecano:text-xs mecano:font-medium mecano:transition-all mecano:duration-200"},"No")])])):(m.openBlock(),m.createElementBlock("div",{key:1,title:"Eliminar componente",onClick:M[16]||(M[16]=H=>s.value=!0),class:"mecano:cursor-pointer mecano:flex mecano:items-center mecano:bg-red-500 mecano:text-white mecano:border mecano:border-red-200 mecano:px-4 mecano:py-2 mecano:rounded-xl mecano:hover:bg-red-700 mecano:hover:border-red-800 mecano:hover:text-white mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:group/btn"},[...M[33]||(M[33]=[m.createElementVNode("div",{class:"mecano:flex mecano:flex-col mecano:items-center"},[m.createElementVNode("span",{class:"mecano:text-xl mecano:mb-1"},"🗑️"),m.createElementVNode("span",{class:"mecano:text-xs mecano:font-medium"},"Eliminar")],-1)])]))],64)):m.createCommentVNode("",!0)],64))]),m.createElementVNode("div",{class:"mecano:absolute mecano:bottom-2 mecano:left-1/2 mecano:-translate-x-1/2 mecano:flex mecano:items-center mecano:gap-1.5 mecano:bg-white/80 mecano:border mecano:border-slate-200 mecano:rounded-full mecano:px-3 mecano:py-1.5 mecano:cursor-ns-resize mecano:select-none mecano:text-slate-500 mecano:text-xs mecano:hover:bg-white mecano:hover:text-slate-700 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:whitespace-nowrap",onWheel:m.withModifiers(Z,["prevent"]),onMouseenter:M[17]||(M[17]=H=>c.value=!0),onMouseleave:M[18]||(M[18]=H=>c.value=!1),title:"Scroll aquí para navegar el preview"},[...M[34]||(M[34]=[m.createElementVNode("svg",{class:"mecano:w-3 mecano:h-3 mecano:flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 16V4m0 0L3 8m4-4l4 4M17 8v12m0 0l4-4m-4 4l-4-4"})],-1),m.createElementVNode("span",null,"Scroll preview",-1)])],32)],2),m.createVNode(Ul,{toggleShowForm:y,object:o.object,showForm:d.value,ateneaToken:t.ateneaToken,ledithorAiTools:t.ledithorAiTools,onFieldUpdated:$,onExclusiveFieldChanged:T},null,8,["object","showForm","ateneaToken","ledithorAiTools"]),m.createElementVNode("iframe",{id:m.unref(a),class:"mecano:w-full mecano:block",style:{"min-height":"60px",border:"none"}},null,8,RP)],64)):m.createCommentVNode("",!0)],2)]))}}),BP={class:"mecano:absolute mecano:top-1 mecano:left-2 mecano:px-2 mecano:flex mecano:gap-3 mecano:items-center"},zP={key:0,class:"mecano:text-[10px] mecano:font-medium mecano:text-slate-400 mecano:bg-white/80 mecano:backdrop-blur-sm mecano:px-2 mecano:py-0.5 mecano:rounded-full mecano:shadow-sm"},DP={class:"mecano:text-slate-600"},jP={key:1,class:"mecano:text-[10px] mecano:font-medium mecano:text-slate-400 mecano:bg-white/80 mecano:backdrop-blur-sm mecano:px-2 mecano:py-0.5 mecano:rounded-full mecano:shadow-sm"},XP={class:"mecano:text-slate-600"},IP={key:2,class:"mecano:text-[10px] mecano:font-medium mecano:text-slate-400 mecano:bg-white/80 mecano:backdrop-blur-sm mecano:px-2 mecano:py-0.5 mecano:rounded-full mecano:shadow-sm"},HP={class:"mecano:text-slate-600"},WP={key:3,class:"text-[10px] font-medium text-slate-400 bg-white/80 backdrop-blur-sm px-2 py-0.5 rounded-full shadow-sm flex items-center gap-1.5"},qP={key:0,class:"mecano:mt-12 mecano:mb-4 mecano:w-full mecano:rounded-xl mecano:bg-white mecano:border mecano:border-slate-200 mecano:p-4 mecano:z-10 mecano:hidden mecano:group-hover:block mecano:shadow-lg"},YP={class:"mecano:p-4 mecano:bg-gradient-to-br mecano:from-slate-50 mecano:to-white mecano:rounded-lg mecano:w-full"},FP={class:"mecano:flex mecano:flex-col"},GP=["for"],_P=["id"],UP=["value"],KP={class:"mecano:flex mecano:flex-col"},JP=["for"],eL=["id"],tL=["value"],oL={class:"mecano:flex mecano:flex-col"},nL=["for"],rL=["id"],iL=["value"],aL={class:"mecano:flex mecano:flex-col"},lL={class:"mecano:flex mecano:items-center mecano:gap-2"},sL={class:"mecano:flex mecano:items-center mecano:gap-1.5 mecano:cursor-pointer"},cL=["id"],dL={class:"mecano:flex mecano:flex-col mecano:gap-0.5"},pL={class:"mecano:flex mecano:items-center mecano:gap-1"},mL={key:1,class:"mecano:text-xs mecano:text-slate-400 mecano:italic"},hL={class:"mecano:absolute mecano:top-0 mecano:flex mecano:flex-col mecano:gap-1 mecano:w-full mecano:opacity-0 mecano:transition-all mecano:duration-300 mecano:group-hover:opacity-100"},uL={class:"mecano:flex mecano:flex-wrap mecano:justify-center mecano:gap-2 mecano:bg-white/90 mecano:backdrop-blur-sm mecano:rounded-b-xl mecano:px-3 mecano:py-1.5 mecano:shadow-sm mecano:border mecano:border-t-0 mecano:border-slate-200"},fL={class:"mecano:flex mecano:gap-1"},gL={class:"mecano:flex mecano:gap-4 mecano:ms-4"},bL=["title"],Wd=m.defineComponent({__name:"ColConfig",props:{globalPageConfiguration:Array,rowIndex:{type:Number,required:!0},columnIndex:{type:Number,required:!0},fullwidthMode:Boolean,addCol:Function,updateColConfig:Function,removeCol:Function,addComponentFunction:Function,moveCol:Function,section:String,isHidden:{type:Boolean,default:!1}},emits:["toggle-visibility","config-open"],setup(o,{emit:e}){function t(w){const O=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(w);return O?{r:parseInt(O[1],16),g:parseInt(O[2],16),b:parseInt(O[3],16)}:{r:255,g:255,b:255}}function n(w){const O=w.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\s*\)/);if(!O)return{hex:"#ffffff",alpha:100};const C=x=>parseInt(x).toString(16).padStart(2,"0");return{hex:`#${C(O[1])}${C(O[2])}${C(O[3])}`,alpha:O[4]!==void 0?Math.round(parseFloat(O[4])*100):100}}const r=e,i=o,a={width:[{label:"Ancho completo",value:"full"},{label:"1/2",value:"1/2"},{label:"1/3",value:"1/3"},{label:"2/3",value:"2/3"},{label:"1/4",value:"1/4"},{label:"3/4",value:"3/4"},{label:"1/5",value:"1/5"},{label:"2/5",value:"2/5"},{label:"3/5",value:"3/5"},{label:"4/5",value:"4/5"}],gap:[{label:"Ninguno",value:"0"},{label:"Leve",value:"1"},{label:"Moderado",value:"2"},{label:"Alto",value:"4"},{label:"Muy alto",value:"8"}],flexDirection:[{label:"Columna (componentes unos encima de otros)",value:"flex-col"},{label:"Fila (componentes unos al lado de otros)",value:"flex-row"}]},l=m.ref(""),s=m.ref(""),c=m.ref(""),d=m.ref("#ffffff"),p=m.ref(100),h=m.ref(!1),u=m.ref(!1),f=m.ref(!1);m.watch(u,w=>{if(r("config-open",w),w){const O=b.value;if(O.backgroundColor){h.value=!0;const{hex:C,alpha:x}=n(O.backgroundColor);d.value=C,p.value=x}else h.value=!1,d.value="#ffffff",p.value=100}});const g=m.computed(()=>{const{r:w,g:O,b:C}=t(d.value),x=p.value/100;return`rgba(${w}, ${O}, ${C}, ${x})`}),b=m.computed(()=>{var C,x,y,k;const w=(C=i.globalPageConfiguration)==null?void 0:C.find($=>$.section===i.section),O=(k=(y=(x=w==null?void 0:w.rows)==null?void 0:x[i.rowIndex])==null?void 0:y.columns)==null?void 0:k[i.columnIndex];return(O==null?void 0:O.config)||{}}),v=(w,O)=>{var $;const C=l.value||a.width[0].value,x=s.value||a.gap[0].value,y=c.value||"",k=h.value?g.value:"";($=i.updateColConfig)==null||$.call(i,w,O,i.section||"",C,x,y,k),u.value=!1};return(w,O)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createElementVNode("div",BP,[b.value.width!==void 0?(m.openBlock(),m.createElementBlock("span",zP,[O[19]||(O[19]=m.createTextVNode(" Ancho: ",-1)),m.createElementVNode("span",DP,m.toDisplayString(b.value.width),1)])):m.createCommentVNode("",!0),b.value.gap!==void 0?(m.openBlock(),m.createElementBlock("span",jP,[O[20]||(O[20]=m.createTextVNode(" Gap: ",-1)),m.createElementVNode("span",XP,m.toDisplayString(b.value.gap),1)])):m.createCommentVNode("",!0),b.value.flexDirection!==void 0?(m.openBlock(),m.createElementBlock("span",IP,[O[21]||(O[21]=m.createTextVNode(" Flex: ",-1)),m.createElementVNode("span",HP,m.toDisplayString(b.value.flexDirection),1)])):m.createCommentVNode("",!0),b.value.backgroundColor?(m.openBlock(),m.createElementBlock("span",WP,[O[22]||(O[22]=m.createTextVNode(" Fondo: ",-1)),m.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full border border-slate-300",style:m.normalizeStyle({backgroundColor:b.value.backgroundColor})},null,4)])):m.createCommentVNode("",!0)]),u.value?(m.openBlock(),m.createElementBlock("div",qP,[m.createElementVNode("div",YP,[m.createElementVNode("form",{onSubmit:O[8]||(O[8]=m.withModifiers(()=>{},["prevent"])),class:"mecano:flex mecano:gap-5 mecano:w-full mecano:justify-center mecano:items-end mecano:flex-wrap"},[m.createElementVNode("div",FP,[m.createElementVNode("label",{for:`colwidth-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Ancho:",8,GP),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":O[0]||(O[0]=C=>l.value=C),id:`colwidth-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-white mecano:hover:border-slate-300 mecano:transition-colors"},[O[23]||(O[23]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.width,C=>(m.openBlock(),m.createElementBlock("option",{key:C.value,value:C.value},m.toDisplayString(C.label),9,UP))),128))],8,_P),[[m.vModelSelect,l.value]])]),m.createElementVNode("div",KP,[m.createElementVNode("label",{for:`colgap-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Gap:",8,JP),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":O[1]||(O[1]=C=>s.value=C),id:`colgap-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-white mecano:hover:border-slate-300 mecano:transition-colors"},[O[24]||(O[24]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.gap,C=>(m.openBlock(),m.createElementBlock("option",{key:C.value,value:C.value},m.toDisplayString(C.label),9,tL))),128))],8,eL),[[m.vModelSelect,s.value]])]),m.createElementVNode("div",oL,[m.createElementVNode("label",{for:`flexdir-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Dirección:",8,nL),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":O[2]||(O[2]=C=>c.value=C),id:`flexdir-${o.rowIndex}-${o.columnIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-white mecano:hover:border-slate-300 mecano:transition-colors"},[O[25]||(O[25]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.flexDirection,C=>(m.openBlock(),m.createElementBlock("option",{key:C.value,value:C.value},m.toDisplayString(C.label),9,iL))),128))],8,rL),[[m.vModelSelect,c.value]])]),m.createElementVNode("div",aL,[O[28]||(O[28]=m.createElementVNode("label",{class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Color de fondo:",-1)),m.createElementVNode("div",lL,[m.createElementVNode("label",sL,[m.withDirectives(m.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":O[3]||(O[3]=C=>h.value=C),class:"mecano:rounded mecano:border-slate-300 mecano:text-emerald-500 mecano:focus:ring-emerald-500/20"},null,512),[[m.vModelCheckbox,h.value]]),O[26]||(O[26]=m.createElementVNode("span",{class:"mecano:text-sm mecano:text-slate-500"},"Activar",-1))]),h.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.withDirectives(m.createElementVNode("input",{type:"color","onUpdate:modelValue":O[4]||(O[4]=C=>d.value=C),id:`colbgcolor-${o.rowIndex}-${o.columnIndex}`,class:"mecano:w-10 mecano:h-9 mecano:rounded mecano:border mecano:border-slate-200 mecano:cursor-pointer mecano:p-0.5 mecano:bg-slate-50",title:"Seleccionar color de fondo"},null,8,cL),[[m.vModelText,d.value]]),m.createElementVNode("div",dL,[m.withDirectives(m.createElementVNode("input",{type:"range","onUpdate:modelValue":O[5]||(O[5]=C=>p.value=C),min:"0",max:"100",step:"0.1",class:"mecano:w-24 mecano:accent-emerald-500",title:"Opacidad"},null,512),[[m.vModelText,p.value,void 0,{number:!0}]]),m.createElementVNode("div",pL,[m.withDirectives(m.createElementVNode("input",{type:"number","onUpdate:modelValue":O[6]||(O[6]=C=>p.value=C),min:"0",max:"100",step:"0.1",class:"mecano:w-14 mecano:text-xs mecano:border mecano:border-slate-200 mecano:rounded mecano:px-1 mecano:py-0.5 mecano:text-center"},null,512),[[m.vModelText,p.value,void 0,{number:!0}]]),O[27]||(O[27]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-400"},"%",-1))])]),m.createElementVNode("span",{class:"inline-block w-6 h-6 rounded border border-slate-300 flex-shrink-0",style:m.normalizeStyle({backgroundColor:g.value}),title:"Vista previa"},null,4)],64)):(m.openBlock(),m.createElementBlock("span",mL,"Sin color"))])]),m.createElementVNode("button",{type:"button",class:"mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:text-white mecano:px-5 mecano:py-2 mecano:rounded-lg mecano:font-medium mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:cursor-pointer",onClick:O[7]||(O[7]=C=>{v(o.rowIndex,o.columnIndex),u.value=!1})}," Guardar ")],32)])])):m.createCommentVNode("",!0),m.createElementVNode("div",hL,[m.createElementVNode("div",{class:m.normalizeClass(["mecano:flex mecano:flex-row",{"mecano:justify-between":o.section&&o.section!=="Sidebar","mecano:justify-center":o.section==="Sidebar"}])},[o.section&&o.section!=="Sidebar"?(m.openBlock(),m.createElementBlock("button",{key:0,type:"button",title:"Añadir columna a la izquierda",onClick:O[9]||(O[9]=C=>{var x;return(x=o.addCol)==null?void 0:x.call(o,o.rowIndex,o.columnIndex,o.section,"left")}),class:"mecano:group/addbtn-left mecano:relative mecano:ms-2 mecano:bg-white mecano:px-3 mecano:py-1 mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:border-slate-200 mecano:hover:bg-emerald-500 mecano:hover:border-emerald-500 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md mecano:font-medium"},[...O[29]||(O[29]=[m.createElementVNode("span",{class:"mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-left:opacity-0"},"+",-1),m.createElementVNode("span",{class:"mecano:absolute mecano:inset-0 mecano:flex mecano:items-center mecano:justify-center mecano:opacity-0 mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-left:opacity-100"},"←",-1)])])):m.createCommentVNode("",!0),m.createElementVNode("div",uL,[m.createElementVNode("button",{type:"button",title:"Configurar columna",onClick:O[10]||(O[10]=C=>u.value=!u.value),class:m.normalizeClass(["mecano:px-2.5 mecano:py-1 mecano:rounded-lg mecano:cursor-pointer mecano:transition-all mecano:duration-200",u.value?"mecano:bg-amber-100 mecano:text-amber-700 mecano:shadow-sm":"mecano:bg-slate-100 mecano:text-slate-600 mecano:hover:bg-blue-500 mecano:hover:text-white"])},"⚙️",2),m.createElementVNode("div",fL,[o.section&&o.section!=="Sidebar"?(m.openBlock(),m.createElementBlock("span",{key:0,title:"Mover columna a la izquierda",onClick:O[11]||(O[11]=C=>{var x;return(x=o.moveCol)==null?void 0:x.call(o,o.rowIndex,o.columnIndex,o.section,"left")}),class:"mecano:bg-slate-100 mecano:px-2.5 mecano:py-1 mecano:cursor-pointer mecano:rounded-lg mecano:transition-all mecano:duration-200 mecano:text-slate-400 mecano:hover:bg-blue-500 mecano:hover:text-white"},"◁")):m.createCommentVNode("",!0),o.fullwidthMode?(m.openBlock(),m.createElementBlock("span",{key:1,title:"Añadir componente",onClick:O[12]||(O[12]=C=>{var x;return(x=o.addComponentFunction)==null?void 0:x.call(o,o.rowIndex,o.columnIndex,o.section||"")}),class:"mecano:bg-slate-100 mecano:px-2.5 mecano:py-1 mecano:cursor-pointer mecano:rounded-lg mecano:transition-all mecano:duration-200 mecano:text-slate-400 mecano:hover:bg-blue-500 mecano:hover:text-white"}," 📦 ")):m.createCommentVNode("",!0),o.section&&o.section!=="Sidebar"?(m.openBlock(),m.createElementBlock("span",{key:2,title:"Mover columna a la derecha",onClick:O[13]||(O[13]=C=>{var x;return(x=o.moveCol)==null?void 0:x.call(o,o.rowIndex,o.columnIndex,o.section,"right")}),class:"mecano:bg-slate-100 mecano:px-2.5 mecano:py-1 mecano:cursor-pointer mecano:rounded-lg mecano:transition-all mecano:duration-200 mecano:text-slate-400 mecano:hover:bg-blue-500 mecano:hover:text-white"},"▷ ")):m.createCommentVNode("",!0)]),m.createElementVNode("div",gL,[m.createElementVNode("button",{type:"button",title:o.isHidden?"Mostrar componentes":"Ocultar componentes",onClick:O[14]||(O[14]=C=>w.$emit("toggle-visibility")),class:m.normalizeClass([o.isHidden?"mecano:bg-amber-100 mecano:text-amber-600 mecano:hover:bg-amber-500 mecano:hover:text-white":"mecano:bg-slate-100 mecano:text-slate-600 mecano:hover:bg-blue-500 mecano:hover:text-white","mecano:px-2.5 mecano:py-1 mecano:rounded-lg mecano:cursor-pointer mecano:transition-all mecano:duration-200"])},m.toDisplayString(o.isHidden?"🙈":"👁️"),11,bL),f.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[O[30]||(O[30]=m.createElementVNode("span",{class:"mecano:px-2 mecano:py-1 mecano:text-xs mecano:text-red-600 mecano:font-medium mecano:self-center"},"¿Eliminar?",-1)),m.createElementVNode("button",{type:"button",title:"Sí, eliminar",onClick:O[15]||(O[15]=C=>{var x;(x=o.removeCol)==null||x.call(o,o.rowIndex,o.columnIndex,o.section||""),f.value=!1}),class:"mecano:bg-red-500 mecano:text-white mecano:px-2.5 mecano:py-1 mecano:rounded-lg mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:hover:bg-red-600 mecano:text-xs mecano:font-medium"},"Sí"),m.createElementVNode("button",{type:"button",title:"Cancelar",onClick:O[16]||(O[16]=C=>f.value=!1),class:"mecano:bg-slate-100 mecano:text-slate-600 mecano:px-2.5 mecano:py-1 mecano:rounded-lg mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:hover:bg-slate-200 mecano:text-xs mecano:font-medium"},"No")],64)):(m.openBlock(),m.createElementBlock("button",{key:1,type:"button",title:"Eliminar columna",onClick:O[17]||(O[17]=C=>f.value=!0),class:"mecano:bg-slate-100 mecano:px-2.5 mecano:py-1 mecano:rounded-lg mecano:cursor-pointer mecano:transition-all mecano:duration-200 mecano:text-slate-600 mecano:hover:bg-red-500 mecano:hover:text-white"},"🗑️"))])]),o.section&&o.section!=="Sidebar"?(m.openBlock(),m.createElementBlock("button",{key:1,type:"button",title:"Añadir columna a la derecha",onClick:O[18]||(O[18]=C=>{var x;return(x=o.addCol)==null?void 0:x.call(o,o.rowIndex,o.columnIndex,o.section,"right")}),class:"mecano:group/addbtn-right mecano:relative mecano:me-2 mecano:bg-white mecano:px-3 mecano:py-1 mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:border-slate-200 mecano:hover:bg-emerald-500 mecano:hover:border-emerald-500 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md mecano:font-medium"},[...O[31]||(O[31]=[m.createElementVNode("span",{class:"mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-right:opacity-0"},"+",-1),m.createElementVNode("span",{class:"mecano:absolute mecano:inset-0 mecano:flex mecano:items-center mecano:justify-center mecano:opacity-0 mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-right:opacity-100"},"→",-1)])])):m.createCommentVNode("",!0)],2)])],64))}}),CL={class:"mecano:absolute mecano:-top-1 mecano:px-2 mecano:gap-4 mecano:w-full mecano:justify-center mecano:hidden mecano:group-hover/row:flex css-pb-row-config"},OL={class:"mecano:flex mecano:flex-wrap mecano:gap-4 mecano:items-center mecano:justify-center"},vL={class:"mecano:inline-block"},wL={key:0,class:"mecano:text-xs mecano:font-medium mecano:text-slate-400 mecano:bg-slate-50 mecano:px-2 mecano:py-1 mecano:rounded-full"},xL={class:"mecano:text-slate-600"},yL={key:1,class:"mecano:text-xs mecano:font-medium mecano:text-slate-400 mecano:bg-slate-50 mecano:px-2 mecano:py-1 mecano:rounded-full"},kL={class:"mecano:text-slate-600"},SL={key:2,class:"mecano:text-xs mecano:font-medium mecano:text-slate-400 mecano:bg-slate-50 mecano:px-2 mecano:py-1 mecano:rounded-full"},$L={class:"mecano:text-slate-600"},ML={key:3,class:"mecano:text-xs mecano:font-medium mecano:text-slate-400 mecano:bg-slate-50 mecano:px-2 mecano:py-1 mecano:rounded-full mecano:flex mecano:items-center mecano:gap-1.5"},QL={class:"mecano:inline-flex mecano:items-center mecano:gap-1"},PL={class:"mecano:absolute mecano:bottom-2 mecano:px-2 mecano:gap-4 mecano:w-full mecano:justify-start mecano:hidden mecano:group-hover/row:flex css-pb-row-config"},LL={class:"mecano:flex mecano:gap-1.5"},TL={key:0,class:"mecano:z-1"},EL={class:"mecano:p-5 mecano:bg-white mecano:rounded-xl mecano:shadow-lg mecano:border mecano:border-slate-100 mecano:w-full mecano:mt-8"},ZL={class:"mecano:flex mecano:flex-col"},AL=["for"],VL=["id"],NL=["value"],RL={class:"mecano:flex mecano:flex-col"},BL=["for"],zL=["id"],DL=["value"],jL={class:"mecano:flex mecano:flex-col"},XL=["for"],IL=["id"],HL=["value"],WL={class:"mecano:flex mecano:flex-col"},qL={class:"mecano:flex mecano:items-center mecano:gap-2"},YL={class:"mecano:flex mecano:items-center mecano:gap-1.5 mecano:cursor-pointer"},FL=["id"],GL={class:"mecano:flex mecano:flex-col mecano:gap-0.5"},_L={class:"mecano:flex mecano:items-center mecano:gap-1"},UL={key:1,class:"mecano:text-xs mecano:text-slate-400 mecano:italic"},qd=m.defineComponent({__name:"RowConfig",props:{rowIndex:{type:Number,required:!0},updateRowConfig:Function,removeRow:Function,addRow:Function,globalPageConfiguration:Array,section:String,moveRow:Function},emits:["config-open"],setup(o,{emit:e}){const t=e;function n(O){const C=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(O);return C?{r:parseInt(C[1],16),g:parseInt(C[2],16),b:parseInt(C[3],16)}:{r:255,g:255,b:255}}function r(O){const C=O.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\s*\)/);if(!C)return{hex:"#ffffff",alpha:100};const x=y=>parseInt(y).toString(16).padStart(2,"0");return{hex:`#${x(C[1])}${x(C[2])}${x(C[3])}`,alpha:C[4]!==void 0?Math.round(parseFloat(C[4])*100):100}}const i=o,a={padding:[{label:"Ninguno",value:"0"},{label:"Leve",value:"4"},{label:"Tibio",value:"6"},{label:"Moderado",value:"8"},{label:"Intenso",value:"9"},{label:"Alto",value:"12"}],gap:[{label:"Ninguno",value:"0"},{label:"Leve",value:"2"},{label:"Moderado",value:"4"},{label:"Alto",value:"8"},{label:"Muy alto",value:"12"}],width:[{label:"Ancho completo",value:"full"},{label:"1/2",value:"1/2"},{label:"1/3",value:"1/3"},{label:"2/3",value:"2/3"},{label:"1/4",value:"1/4"},{label:"3/4",value:"3/4"},{label:"1/5",value:"1/5"},{label:"2/5",value:"2/5"},{label:"3/5",value:"3/5"},{label:"4/5",value:"4/5"}]},l=m.ref(""),s=m.ref(""),c=m.ref(""),d=m.ref("#ffffff"),p=m.ref(100),h=m.ref(!1),u=m.ref(!1),f=m.ref(!1),g=m.ref(!1);m.watch(u,O=>{if(t("config-open",O),O){const C=v.value;if(C.backgroundColor){h.value=!0;const{hex:x,alpha:y}=r(C.backgroundColor);d.value=x,p.value=y}else h.value=!1,d.value="#ffffff",p.value=100}});const b=m.computed(()=>{const{r:O,g:C,b:x}=n(d.value),y=p.value/100;return`rgba(${O}, ${C}, ${x}, ${y})`}),v=m.computed(()=>{var C,x;const O=(C=i.globalPageConfiguration)==null?void 0:C.find(y=>y.section===i.section);return(x=O==null?void 0:O.rows)!=null&&x[i.rowIndex]?O.rows[i.rowIndex].config||{}:{}}),w=O=>{var $;const C=l.value||a.padding[0].value,x=s.value||a.gap[0].value,y=c.value||a.width[0].value,k=h.value?b.value:"";($=i.updateRowConfig)==null||$.call(i,O,i.section||"",C,x,y,k),u.value=!1};return(O,C)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createElementVNode("div",CL,[m.createElementVNode("div",OL,[m.createElementVNode("div",vL,[m.createElementVNode("button",{type:"button",title:"Configurar la fila",onClick:C[0]||(C[0]=x=>u.value=!u.value),class:m.normalizeClass(["mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:px-3 mecano:py-1 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md",u.value?"mecano:bg-amber-100 mecano:border-amber-300 mecano:text-amber-700":"mecano:bg-white mecano:border-slate-200 mecano:text-slate-600 mecano:hover:bg-blue-500 mecano:hover:border-blue-500 mecano:hover:text-white"])},"⚙️",2)]),v.value.padding!==void 0?(m.openBlock(),m.createElementBlock("span",wL,[C[16]||(C[16]=m.createTextVNode(" Padding: ",-1)),m.createElementVNode("span",xL,m.toDisplayString(v.value.padding),1)])):m.createCommentVNode("",!0),v.value.gap!==void 0?(m.openBlock(),m.createElementBlock("span",yL,[C[17]||(C[17]=m.createTextVNode(" Gap: ",-1)),m.createElementVNode("span",kL,m.toDisplayString(v.value.gap),1)])):m.createCommentVNode("",!0),v.value.width!==void 0?(m.openBlock(),m.createElementBlock("span",SL,[C[18]||(C[18]=m.createTextVNode(" Ancho: ",-1)),m.createElementVNode("span",$L,m.toDisplayString(v.value.width),1)])):m.createCommentVNode("",!0),v.value.backgroundColor?(m.openBlock(),m.createElementBlock("span",ML,[C[19]||(C[19]=m.createTextVNode(" Fondo: ",-1)),m.createElementVNode("span",{class:"mecano:inline-block mecano:w-3 mecano:h-3 mecano:rounded-full mecano:border mecano:border-slate-300",style:m.normalizeStyle({backgroundColor:v.value.backgroundColor})},null,4)])):m.createCommentVNode("",!0),m.createElementVNode("div",QL,[g.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[C[20]||(C[20]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-red-600 mecano:font-medium mecano:px-1"},"¿Eliminar?",-1)),m.createElementVNode("button",{type:"button",title:"Sí, eliminar",onClick:C[1]||(C[1]=x=>{var y;(y=o.removeRow)==null||y.call(o,o.rowIndex,o.section||""),g.value=!1,f.value=!1}),class:"mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:border-red-500 mecano:bg-red-500 mecano:px-3 mecano:py-1 mecano:text-white mecano:hover:bg-red-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:text-xs mecano:font-medium"},"Sí"),m.createElementVNode("button",{type:"button",title:"Cancelar",onClick:C[2]||(C[2]=x=>g.value=!1),class:"mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:border-slate-200 mecano:bg-white mecano:px-3 mecano:py-1 mecano:text-slate-600 mecano:hover:bg-slate-100 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:text-xs mecano:font-medium"},"No")],64)):(m.openBlock(),m.createElementBlock("button",{key:1,type:"button",title:"Eliminar fila",onClick:C[3]||(C[3]=x=>g.value=!0),class:"mecano:cursor-pointer mecano:rounded-b-lg mecano:border mecano:border-t-0 mecano:border-slate-200 mecano:bg-white mecano:hover:bg-red-500 mecano:hover:border-red-500 mecano:px-3 mecano:py-1 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md"},"🗑️"))])])]),m.createElementVNode("div",PL,[m.createElementVNode("div",null,[m.createElementVNode("div",LL,[m.createElementVNode("button",{type:"button",title:"Agregar fila",onClick:C[4]||(C[4]=x=>{var y;(y=o.addRow)==null||y.call(o,o.rowIndex,o.section||""),f.value=!1}),class:"mecano:group/addbtn-row mecano:relative mecano:cursor-pointer mecano:rounded-lg mecano:border mecano:border-b-0 mecano:border-slate-200 mecano:bg-white mecano:hover:bg-emerald-500 mecano:hover:border-emerald-500 mecano:px-3 mecano:py-1 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md mecano:font-medium"},[...C[21]||(C[21]=[m.createElementVNode("span",{class:"mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-row:opacity-0"},"+",-1),m.createElementVNode("span",{class:"mecano:absolute mecano:inset-0 mecano:flex mecano:items-center mecano:justify-center mecano:opacity-0 mecano:transition-opacity mecano:duration-150 mecano:group-hover/addbtn-row:opacity-100"},"↓",-1)])]),m.createElementVNode("button",{type:"button",title:"Mover fila hacia arriba",onClick:C[5]||(C[5]=x=>{var y;(y=o.moveRow)==null||y.call(o,o.rowIndex,o.section||"","up"),f.value=!1}),class:"mecano:cursor-pointer mecano:rounded-lg mecano:border mecano:border-b-0 mecano:border-slate-200 mecano:bg-white mecano:hover:bg-blue-500 mecano:hover:border-blue-500 mecano:px-3 mecano:py-1 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md"},"△"),m.createElementVNode("button",{type:"button",title:"Mover fila hacia abajo",onClick:C[6]||(C[6]=x=>{var y;(y=o.moveRow)==null||y.call(o,o.rowIndex,o.section||"","down"),f.value=!1}),class:"mecano:cursor-pointer mecano:rounded-lg mecano:border mecano:border-b-0 mecano:border-slate-200 mecano:bg-white mecano:hover:bg-blue-500 mecano:hover:border-blue-500 mecano:px-3 mecano:py-1 mecano:hover:text-white mecano:text-slate-600 mecano:transition-all mecano:duration-200 mecano:shadow-sm mecano:hover:shadow-md"},"▽")])])]),u.value?(m.openBlock(),m.createElementBlock("div",TL,[m.createElementVNode("div",EL,[m.createElementVNode("form",{onSubmit:C[15]||(C[15]=m.withModifiers(()=>{},["prevent"])),class:"mecano:flex mecano:gap-6 mecano:w-full mecano:justify-center mecano:items-end mecano:flex-wrap"},[m.createElementVNode("div",ZL,[m.createElementVNode("label",{for:`padding-${o.rowIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Padding:",8,AL),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":C[7]||(C[7]=x=>l.value=x),id:`padding-${o.rowIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-slate-50 mecano:hover:bg-white mecano:transition-colors"},[C[22]||(C[22]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.padding,x=>(m.openBlock(),m.createElementBlock("option",{key:x.value,value:x.value},m.toDisplayString(x.label),9,NL))),128))],8,VL),[[m.vModelSelect,l.value]])]),m.createElementVNode("div",RL,[m.createElementVNode("label",{for:`gap-${o.rowIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Gap:",8,BL),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":C[8]||(C[8]=x=>s.value=x),id:`gap-${o.rowIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-slate-50 mecano:hover:bg-white mecano:transition-colors"},[C[23]||(C[23]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.gap,x=>(m.openBlock(),m.createElementBlock("option",{key:x.value,value:x.value},m.toDisplayString(x.label),9,DL))),128))],8,zL),[[m.vModelSelect,s.value]])]),m.createElementVNode("div",jL,[m.createElementVNode("label",{for:`width-${o.rowIndex}`,class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Ancho:",8,XL),m.withDirectives(m.createElementVNode("select",{"onUpdate:modelValue":C[9]||(C[9]=x=>c.value=x),id:`width-${o.rowIndex}`,class:"mecano:block mecano:w-full mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:px-3 mecano:py-2 mecano:text-sm mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:bg-slate-50 mecano:hover:bg-white mecano:transition-colors"},[C[24]||(C[24]=m.createElementVNode("option",{value:""},"Selecciona...",-1)),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(a.width,x=>(m.openBlock(),m.createElementBlock("option",{key:x.value,value:x.value},m.toDisplayString(x.label),9,HL))),128))],8,IL),[[m.vModelSelect,c.value]])]),m.createElementVNode("div",WL,[C[27]||(C[27]=m.createElementVNode("label",{class:"mecano:block mecano:text-sm mecano:font-medium mecano:text-slate-600 mecano:mb-1.5"},"Color de fondo:",-1)),m.createElementVNode("div",qL,[m.createElementVNode("label",YL,[m.withDirectives(m.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":C[10]||(C[10]=x=>h.value=x),class:"mecano:rounded mecano:border-slate-300 mecano:text-emerald-500 mecano:focus:ring-emerald-500/20"},null,512),[[m.vModelCheckbox,h.value]]),C[25]||(C[25]=m.createElementVNode("span",{class:"mecano:text-sm mecano:text-slate-500"},"Activar",-1))]),h.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.withDirectives(m.createElementVNode("input",{type:"color","onUpdate:modelValue":C[11]||(C[11]=x=>d.value=x),id:`bgcolor-${o.rowIndex}`,class:"mecano:w-10 mecano:h-9 mecano:rounded mecano:border mecano:border-slate-200 mecano:cursor-pointer mecano:p-0.5 mecano:bg-slate-50",title:"Seleccionar color de fondo"},null,8,FL),[[m.vModelText,d.value]]),m.createElementVNode("div",GL,[m.withDirectives(m.createElementVNode("input",{type:"range","onUpdate:modelValue":C[12]||(C[12]=x=>p.value=x),min:"0",max:"100",step:"0.1",class:"mecano:w-24 mecano:accent-emerald-500",title:"Opacidad"},null,512),[[m.vModelText,p.value,void 0,{number:!0}]]),m.createElementVNode("div",_L,[m.withDirectives(m.createElementVNode("input",{type:"number","onUpdate:modelValue":C[13]||(C[13]=x=>p.value=x),min:"0",max:"100",step:"0.1",class:"mecano:w-14 mecano:text-xs mecano:border mecano:border-slate-200 mecano:rounded mecano:px-1 mecano:py-0.5 mecano:text-center"},null,512),[[m.vModelText,p.value,void 0,{number:!0}]]),C[26]||(C[26]=m.createElementVNode("span",{class:"mecano:text-xs mecano:text-slate-400"},"%",-1))])]),m.createElementVNode("span",{class:"inline-block w-6 h-6 rounded border border-slate-300 flex-shrink-0",style:m.normalizeStyle({backgroundColor:b.value}),title:"Vista previa"},null,4)],64)):(m.openBlock(),m.createElementBlock("span",UL,"Sin color"))])]),m.createElementVNode("button",{type:"button",class:"mecano:bg-gradient-to-r mecano:from-emerald-500 mecano:to-teal-500 mecano:hover:from-emerald-600 mecano:hover:to-teal-600 mecano:text-white mecano:px-5 mecano:py-2 mecano:rounded-lg mecano:font-medium mecano:shadow-sm mecano:hover:shadow-md mecano:transition-all mecano:duration-200 mecano:cursor-pointer",onClick:C[14]||(C[14]=x=>{w(o.rowIndex),f.value=!1})}," Guardar ")],32)])])):m.createCommentVNode("",!0)],64))}}),KL=["id"],JL={class:"mecano:flex mecano:flex-row mecano:w-full mecano:gap-3 mecano:mt-6"},eT=["id"],tT={key:0,class:"mecano:flex mecano:flex-col mecano:items-center mecano:justify-center mecano:gap-2 mecano:w-full mecano:h-full mecano:min-h-[120px] mecano:mt-4 mecano:rounded-lg mecano:border-2 mecano:border-dashed mecano:border-amber-300 mecano:bg-amber-50 mecano:text-amber-600"},oT={class:"mecano:text-sm mecano:font-medium"},Yd=m.defineComponent({__name:"BodySection",props:{isComponentMode:Boolean,fullwidthMode:Boolean,globalPageConfiguration:Array,sectionSelected:String,removeComponent:Function,cloneComponent:Function,addComponentFunction:Function,addCol:Function,addRow:Function,removeRow:Function,removeCol:Function,moveCol:Function,moveRow:Function,updateColConfig:Function,updateRowConfig:Function,renderApiDomain:String,isProduction:{type:Boolean,default:!1},ateneaToken:String,ledithorAiTools:Array},setup(o){const e=o,t=m.ref(!1),n=m.ref(new Set),r=m.ref(null),i=m.ref(null),a=(p,h)=>n.value.has(`${p}-${h}`),l=(p,h)=>{const u=`${p}-${h}`,f=new Set(n.value);f.has(u)?f.delete(u):f.add(u),n.value=f},s=(p,h,u,f)=>{var v;const g=f==="left"?h:h+1,b=new Set;for(const w of n.value){const[O,C]=w.split("-").map(Number);b.add(O===p&&C>=g?`${O}-${C+1}`:w)}n.value=b,(v=e.addCol)==null||v.call(e,p,h,u,f)},c=(p,h,u)=>{var g;const f=new Set;for(const b of n.value){const[v,w]=b.split("-").map(Number);v===p?(w<h&&f.add(b),w>h&&f.add(`${v}-${w-1}`)):f.add(b)}n.value=f,(g=e.removeCol)==null||g.call(e,p,h,u)},d=m.computed(()=>{var h;const p=(h=e.globalPageConfiguration)==null?void 0:h.find(u=>u.section===e.sectionSelected);return(p==null?void 0:p.rows)||[]});return(p,h)=>(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(d.value,(u,f)=>{var g;return m.openBlock(),m.createElementBlock("div",{key:"row-"+f,id:"row-"+o.sectionSelected+"-"+f,class:m.normalizeClass(["mecano:flex mecano:flex-col mecano:gap-3 mecano:w-full mecano:pt-5 mecano:px-5 mecano:pb-14 mecano:border mecano:rounded-lg js-row relative mecano:items-center mecano:hover:shadow-lg mecano:transition-all mecano:duration-300 css-pb-row mecano:group/row",r.value===f?"mecano:border-amber-400 mecano:ring-2 mecano:ring-amber-300 mecano:shadow-amber-100 mecano:shadow-lg":"mecano:border-slate-200 mecano:hover:border-slate-300"]),style:m.normalizeStyle((g=u.config)!=null&&g.backgroundColor?{backgroundColor:u.config.backgroundColor}:{backgroundColor:"#ffffff"})},[m.createVNode(qd,{moveRow:o.moveRow,addRow:o.addRow,removeRow:o.removeRow,globalPageConfiguration:o.globalPageConfiguration,updateRowConfig:o.updateRowConfig,rowIndex:f,section:o.sectionSelected,onConfigOpen:b=>r.value=b?f:null},null,8,["moveRow","addRow","removeRow","globalPageConfiguration","updateRowConfig","rowIndex","section","onConfigOpen"]),m.createElementVNode("div",JL,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(u.columns,(b,v)=>{var w,O;return m.openBlock(),m.createElementBlock("div",{class:m.normalizeClass(["mecano:hover:shadow-md mecano:overflow-hidden dragging-zone mecano:border mecano:relative mecano:shadow-sm mecano:w-full mecano:p-5 mecano:pt-10 mecano:min-h-[200px] mecano:rounded-xl mecano:flex mecano:flex-col mecano:gap-3 mecano:items-center mecano:before:content-['Columna'] mecano:before:absolute mecano:before:text-slate-300 mecano:before:text-7xl mecano:before:font-bold mecano:before:bottom-4 mecano:before:left-2 mecano:before:-rotate-12 mecano:before:opacity-30 mecano:before:duration-300 mecano:before:transition-opacity mecano:group mecano:hover:before:opacity-50 mecano:transition-all mecano:duration-300",i.value===`${f}-${v}`?"mecano:border-amber-400 mecano:ring-2 mecano:ring-amber-300 mecano:shadow-amber-100":t.value?"mecano:border-emerald-300":"mecano:border-slate-200",(w=b.config)!=null&&w.backgroundColor?"":t.value?"mecano:bg-gradient-to-b mecano:from-emerald-50 mecano:to-emerald-100":"mecano:bg-gradient-to-b mecano:from-slate-50 mecano:to-slate-100"]),style:m.normalizeStyle((O=b.config)!=null&&O.backgroundColor?{backgroundColor:b.config.backgroundColor}:{}),key:"column-"+v,id:"col-"+o.sectionSelected+"-"+f+"-"+v},[m.createVNode(Wd,{section:o.sectionSelected,globalPageConfiguration:o.globalPageConfiguration,updateColConfig:o.updateColConfig,addComponentFunction:o.addComponentFunction,fullwidthMode:o.fullwidthMode,addCol:s,removeCol:c,moveCol:o.moveCol,rowIndex:f,columnIndex:Number(v),isHidden:a(f,Number(v)),onToggleVisibility:C=>l(f,Number(v)),onConfigOpen:C=>i.value=C?`${f}-${v}`:null},null,8,["section","globalPageConfiguration","updateColConfig","addComponentFunction","fullwidthMode","moveCol","rowIndex","columnIndex","isHidden","onToggleVisibility","onConfigOpen"]),a(f,Number(v))?(m.openBlock(),m.createElementBlock("div",tT,[h[2]||(h[2]=m.createElementVNode("span",{class:"mecano:text-2xl"},"🙈",-1)),m.createElementVNode("span",oT,m.toDisplayString(b.components.length>0?`${b.components.length} componente${b.components.length!==1?"s":""} oculto${b.components.length!==1?"s":""}`:"Columna oculta (sin componentes)"),1)])):(m.openBlock(),m.createBlock(m.unref(j6),{key:1,class:"mecano:h-full mecano:w-full mecano:mt-4",list:b.components,group:{name:"draggingGroup",pull:!0,put:!0},"item-key":"id",handle:".handle",onStart:h[0]||(h[0]=C=>t.value=!0),onEnd:h[1]||(h[1]=C=>t.value=!1)},{item:m.withCtx(({element:C})=>[m.createVNode(fc,{renderApiDomain:o.renderApiDomain,object:C,"is-component-mode":o.isComponentMode,removeComponent:o.removeComponent,cloneComponent:o.cloneComponent,section:o.sectionSelected,isProduction:o.isProduction,ateneaToken:o.ateneaToken,ledithorAiTools:o.ledithorAiTools},null,8,["renderApiDomain","object","is-component-mode","removeComponent","cloneComponent","section","isProduction","ateneaToken","ledithorAiTools"])]),_:1},8,["list"]))],14,eT)}),128))])],14,KL)}),128))}}),nT={class:"mecano:flex mecano:justify-between mecano:items-center mecano:mb-4"},rT={class:"mecano:text-xs"},iT=["title"],aT={class:"mecano:text-xs mecano:text-slate-400"},lT={class:"mecano:flex mecano:flex-wrap mecano:gap-2 mecano:mb-4 mecano:bg-white mecano:border mecano:border-slate-200 mecano:p-4 mecano:rounded-xl mecano:shadow-sm"},sT=["value","checked"],cT={class:"mecano:my-3"},dT={class:"mecano:relative"},pT={key:0,class:"mecano:text-center mecano:py-8 mecano:text-slate-400"},Kl=m.defineComponent({__name:"ComponentsBox",props:{isComponentMode:{type:Boolean},fullwidthMode:{type:Boolean},columnToInsert:{},addComponentToColumn:{type:Function},renderApiDomain:{},toggleComponentModeFunction:{type:Function},isProduction:{type:Boolean},components:{},excludedCategories:{}},setup(o){const e=o,t=["CTA","Contenido de Texto","Contenido de Imagen","Contenido con listas","Separador","Header","Footer","Imagen","Repetidor","Formulario","Título","TEST","SEO"],n=m.computed(()=>!e.excludedCategories||e.excludedCategories.length===0?t:t.filter(f=>!e.excludedCategories.includes(f))),r=m.ref(!0),i=m.ref([]),a=m.ref(""),l=["desktop","tablet","mobile"],s=m.ref("desktop"),c={desktop:{label:"Desktop",icon:"🖥️",size:"100%",width:"100%"},tablet:{label:"Tablet",icon:"📲",size:"768px",width:"768px"},mobile:{label:"Mobile",icon:"📱",size:"375px",width:"375px"}},d=()=>{const f=l.indexOf(s.value);s.value=l[(f+1)%l.length]},p=m.computed(()=>{const f=a.value.toLowerCase(),g=Object.values(e.components),b=v=>(v.name.toLowerCase()+v.component_name.toLowerCase()+v.description.toLowerCase()+v.tags.join(" ").toLowerCase()).includes(f);return i.value.length>0?g.filter(v=>i.value.includes(v.category)&&b(v)):g.filter(b)}),h=f=>{a.value=f.target.value},u=f=>{const g=f.target,b=g.value;g.checked?i.value.includes(b)||i.value.push(b):i.value=i.value.filter(v=>v!==b)};return(f,g)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[g[6]||(g[6]=m.createElementVNode("h1",{class:"mecano:text-center mecano:text-2xl mecano:font-semibold mecano:mb-4 mecano:text-slate-700 mecano:tracking-tight"},"Componentes",-1)),m.createElementVNode("div",nT,[m.createElementVNode("button",{type:"button",onClick:g[0]||(g[0]=b=>r.value=!r.value),class:"mecano:mb-3 mecano:px-4 mecano:py-2 mecano:bg-white mecano:rounded-lg mecano:border mecano:border-slate-200 mecano:hover:border-slate-300 mecano:hover:shadow-sm mecano:transition-all mecano:duration-200 mecano:cursor-pointer mecano:text-slate-600 mecano:font-medium mecano:flex mecano:items-center mecano:gap-2"},[g[2]||(g[2]=m.createElementVNode("svg",{class:"mecano:w-4 mecano:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})],-1)),g[3]||(g[3]=m.createElementVNode("span",null,"Filtros",-1)),m.createElementVNode("span",rT,m.toDisplayString(r.value?"▲":"▼"),1)]),o.fullwidthMode?(m.openBlock(),m.createElementBlock("button",{key:0,type:"button",onClick:d,title:`Vista actual: ${c[s.value].label} — clic para cambiar`,class:"mecano:cursor-pointer mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:py-1.5 mecano:px-3 mecano:text-sm mecano:font-medium mecano:transition-all mecano:duration-200 mecano:bg-white mecano:hover:bg-slate-100 mecano:flex mecano:items-center mecano:gap-2"},[m.createElementVNode("span",null,m.toDisplayString(c[s.value].icon),1),m.createElementVNode("span",null,m.toDisplayString(c[s.value].label),1),m.createElementVNode("span",aT,m.toDisplayString(c[s.value].size),1)],8,iT)):m.createCommentVNode("",!0),m.createElementVNode("button",{type:"button",class:m.normalizeClass([[o.isComponentMode?"mecano:bg-gradient-to-r mecano:from-slate-600 mecano:to-slate-700 mecano:border-slate-700 mecano:text-white mecano:shadow-md":"mecano:bg-white mecano:hover:bg-slate-100"],"mecano:cursor-pointer mecano:border mecano:border-slate-200 mecano:rounded-lg mecano:py-1.5 mecano:px-3 mecano:text-sm mecano:font-medium mecano:transition-all mecano:duration-200"]),onClick:g[1]||(g[1]=b=>{var v;return(v=o.toggleComponentModeFunction)==null?void 0:v.call(o)})},m.toDisplayString(o.isComponentMode?"⚒️ Modo Configuración":"👁️ Modo Visual"),3)]),m.withDirectives(m.createElementVNode("div",lT,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(n.value,b=>(m.openBlock(),m.createElementBlock("label",{key:b,class:m.normalizeClass(["mecano:flex mecano:items-center mecano:gap-2 mecano:text-xs mecano:bg-slate-50 mecano:hover:bg-slate-100 mecano:px-3 mecano:py-2 mecano:rounded-lg mecano:cursor-pointer mecano:transition-colors mecano:duration-200 mecano:border mecano:border-transparent mecano:hover:border-slate-200",{"mecano:bg-emerald-50 mecano:border-emerald-200 mecano:text-emerald-700":i.value.includes(b)}])},[m.createElementVNode("input",{type:"checkbox",value:b,checked:i.value.includes(b),onInput:u,class:"mecano:w-4 mecano:h-4 mecano:rounded mecano:border-slate-300 mecano:text-emerald-500 mecano:focus:ring-emerald-500"},null,40,sT),m.createTextVNode(" "+m.toDisplayString(b),1)],2))),128))],512),[[m.vShow,r.value]]),m.createElementVNode("div",cT,[m.createElementVNode("div",dT,[g[4]||(g[4]=m.createElementVNode("svg",{class:"mecano:absolute mecano:left-3 mecano:top-1/2 mecano:-translate-y-1/2 mecano:w-5 mecano:h-5 mecano:text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),m.createElementVNode("input",{onInput:h,type:"text",placeholder:"Buscar componente...",class:"mecano:duration-300 mecano:border mecano:border-slate-200 mecano:bg-white mecano:rounded-xl mecano:py-3 mecano:px-8 mecano:pl-11 mecano:w-full mecano:focus:outline-none mecano:focus:ring-2 mecano:focus:ring-emerald-500/20 mecano:focus:border-emerald-400 mecano:hover:border-slate-300 mecano:shadow-sm"},null,32)])]),m.createElementVNode("div",{class:"component-library dragging-zone mecano:p-5 mecano:min-h-[200px] mecano:border mecano:border-slate-200 mecano:bg-white mecano:rounded-xl mecano:flex mecano:flex-col mecano:gap-4 mecano:items-center mecano:shadow-sm mecano:mx-auto mecano:transition-all mecano:duration-300",style:m.normalizeStyle({width:c[s.value].width})},[m.createVNode(m.unref(j6),{class:"mecano:w-full mecano:flex mecano:flex-col mecano:gap-4",list:p.value,group:{name:"draggingGroup",pull:"clone",put:!1},itemKey:"name",clone:b=>JSON.parse(JSON.stringify(b))},{item:m.withCtx(({element:b})=>[m.createVNode(fc,{renderApiDomain:o.renderApiDomain,object:b,"is-component-mode":o.isComponentMode,fullwidthMode:o.fullwidthMode,columnToInsert:o.columnToInsert,addComponentToColumn:o.addComponentToColumn,insideComponentBox:!0,isProduction:o.isProduction,previewWidth:s.value},null,8,["renderApiDomain","object","is-component-mode","fullwidthMode","columnToInsert","addComponentToColumn","isProduction","previewWidth"])]),_:1},8,["list","clone"]),p.value.length===0?(m.openBlock(),m.createElementBlock("div",pT,[...g[5]||(g[5]=[m.createElementVNode("svg",{class:"mecano:w-12 mecano:h-12 mecano:mx-auto mecano:mb-3 mecano:opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),m.createElementVNode("p",{class:"mecano:text-sm mecano:font-medium"},"No se encontraron componentes",-1),m.createElementVNode("p",{class:"mecano:text-xs mecano:mt-1"},"Intenta con otros filtros o términos de búsqueda",-1)])])):m.createCommentVNode("",!0)],4)],64))}}),mT={},hT={class:"mecano:w-full mecano:px-4"};function uT(o,e){return m.openBlock(),m.createElementBlock("div",hT,[...e[0]||(e[0]=[m.createStaticVNode(`<div class="mecano:rounded-lg lb:flex lb:items-center lb:justify-center lb:gap-2 lb:py-2 lb:px-4 lb:border-t lb:h-8 lb:border-brand-purple-200 lb:bg-brand-purple-50 lb:rounded-b-md lb:mt-3" style="background:linear-gradient(90deg, rgb(0, 25, 120), rgb(33, 52, 241) 50%, rgb(248, 27, 189) 95%);color:white;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 52" fill="currentColor" class="lb:w-5 lb:h-5 lb:text-white" aria-hidden="true"><path d="M29.0863 15.2704H24.9419V36.7321H37.5259V33.1048H29.0863V15.2704Z"></path><path d="M18.1601 33.1048H9.72056V36.7321H22.3045V15.2704H18.1601V33.1048Z"></path><path d="M44.0063 51.846L3.16483 50.1834C1.35636 50.1834 0 48.5965 0 46.8584V4.99294C0 \r
121
121
  3.33041 1.65777 1.8946 3.31554 1.81903L44.157 0.1565C46.2669 0.0809304 48 1.74346 48 \r
122
122
  3.8594V47.8408C48 50.0323 46.1915 51.846 43.9309 51.7704H44.0063V51.846ZM4.89796 46.405L42.9513 \r
123
123
  47.4629C43.4788 47.4629 44.0063 47.0095 44.0063 46.4805V5.21965C44.0063 4.69066 43.6295 4.31282 \r