import{K as n,j as o,A as e,w as s,Z as t,k as i,l,m as r,n as a,o as c,e as p,v as u,t as d,u as f,f as m}from"../../vendor.js";import{u as v}from"../../hooks.js";import{C as x}from"../Col/index.js";import{D as j}from"../Droppable/index.js";import{o as g}from"./index.options.js";import{s as b}from"./index.settings.js";var h=["element","parent"];function k(n,o){var e=d(n);if(f){var s=f(n);o&&(s=m(s).call(s,(function(o){return c(n,o).enumerable}))),e.push.apply(e,s)}return e}function y(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?k(Object(e),!0).forEach((function(o){i(n,o,e[o])})):l?r(n,l(e)):k(Object(e)).forEach((function(o){a(n,o,c(e,o))}))}return n}var D=function(i){var l,r,a,c,d=i.element,f=i.parent,m=n(i,h),g=v(),b=g.setElement,k=g.removeElement,D=g.moveElement,E=function(n,o){var e;p(e=d.cols).call(e,o?n:n+1,0,{content:[],id:u(),style:{},type:"col"}),b(d,{cols:d.cols})},C=function(n){var o;p(o=d.cols).call(o,n,1),b(d,{cols:d.cols}),d.cols.length<=0&&k(d,{parent:f})},N=function(n,o){D(o,d,{parent:f,position:n})};return o.exports.jsxs("div",y(y({},t(m,["builder"])),{},{style:d.style,children:[o.exports.jsx(j,{onDrop:N.bind(null,"before"),children:o.exports.jsx("div",{className:"oak-drop-zone oak-before"})}),o.exports.jsx("div",{className:e("oak-row-content",(null===(l=d.settings)||void 0===l?void 0:l.flexDirection)&&"oak-direction-"+d.settings.flexDirection,(null===(r=d.settings)||void 0===r?void 0:r.alignItems)&&"oak-align-"+d.settings.alignItems,(null===(a=d.settings)||void 0===a?void 0:a.justifyContent)&&"oak-justify-"+d.settings.justifyContent),children:null==d||null===(c=d.cols)||void 0===c?void 0:s(c).call(c,(function(n,e){return o.exports.jsx(x,{element:n,onPrepend:E.bind(null,e,!0),onAppend:E.bind(null,e,!1),onRemove:C.bind(null,e)},e)}))}),o.exports.jsx(j,{onDrop:N.bind(null,"after"),children:o.exports.jsx("div",{className:"oak-drop-zone oak-after"})})]}))};D.options=g,D.settings=b;export{D as R};
//# sourceMappingURL=index.js.map
