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