tailwind-grid-layout
Version:
A modern, Tailwind CSS-based grid layout system for React. A lightweight alternative to react-grid-layout with full feature parity.
3 lines (2 loc) • 42.1 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react");function o(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=o(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}const r=e=>{const t=a(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const o=e.split("-");return""===o[0]&&1!==o.length&&o.shift(),n(o,t)||i(e)},getConflictingClassGroupIds:(e,t)=>{const n=o[e]||[];return t&&r[e]?[...n,...r[e]]:n}}},n=(e,t)=>{var o;if(0===e.length)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),i=s?n(e.slice(1),s):void 0;if(i)return i;if(0===t.validators.length)return;const a=e.join("-");return null==(o=t.validators.find((({validator:e})=>e(a))))?void 0:o.classGroupId},s=/^\[(.+)\]$/,i=e=>{if(s.test(e)){const t=s.exec(e)[1],o=null==t?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},a=e=>{const{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return u(Object.entries(e.classGroups),o).forEach((([e,o])=>{l(o,r,e,t)})),r},l=(e,t,o,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return d(e)?void l(e(r),t,o,r):void t.validators.push({validator:e,classGroupId:o});Object.entries(e).forEach((([e,n])=>{l(n,c(t,e),o,r)}))}else{(""===e?t:c(t,e)).classGroupId=o}}))},c=(e,t)=>{let o=e;return t.split("-").forEach((e=>{o.nextPart.has(e)||o.nextPart.set(e,{nextPart:new Map,validators:[]}),o=o.nextPart.get(e)})),o},d=e=>e.isThemeGetter,u=(e,t)=>t?e.map((([e,o])=>[e,o.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,o])=>[t+e,o]))):e))])):e,p=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map;const n=(n,s)=>{o.set(n,s),t++,t>e&&(t=0,r=o,o=new Map)};return{get(e){let t=o.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(n(e,t),t):void 0},set(e,t){o.has(e)?o.set(e,t):n(e,t)}}},g=e=>{const{separator:t,experimentalParseClassName:o}=e,r=1===t.length,n=t[0],s=t.length,i=e=>{const o=[];let i,a=0,l=0;for(let u=0;u<e.length;u++){let c=e[u];if(0===a){if(c===n&&(r||e.slice(u,u+s)===t)){o.push(e.slice(l,u)),l=u+s;continue}if("/"===c){i=u;continue}}"["===c?a++:"]"===c&&a--}const c=0===o.length?e:e.substring(l),d=c.startsWith("!");return{modifiers:o,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return o?e=>o({className:e,parseClassName:i}):i},m=e=>{if(e.length<=1)return e;const t=[];let o=[];return e.forEach((e=>{"["===e[0]?(t.push(...o.sort(),e),o=[]):o.push(e)})),t.push(...o.sort()),t},h=/\s+/;function f(){let e,t,o=0,r="";for(;o<arguments.length;)(e=arguments[o++])&&(t=b(e))&&(r&&(r+=" "),r+=t);return r}const b=e=>{if("string"==typeof e)return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=b(e[r]))&&(o&&(o+=" "),o+=t);return o};function x(e,...t){let o,n,s,i=function(l){const c=t.reduce(((e,t)=>t(e)),e());return o=(e=>({cache:p(e.cacheSize),parseClassName:g(e),...r(e)}))(c),n=o.cache.get,s=o.cache.set,i=a,a(l)};function a(e){const t=n(e);if(t)return t;const r=((e,t)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:n}=t,s=[],i=e.trim().split(h);let a="";for(let l=i.length-1;l>=0;l-=1){const e=i[l],{modifiers:t,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:u}=o(e);let p=Boolean(u),g=r(p?d.substring(0,u):d);if(!g){if(!p){a=e+(a.length>0?" "+a:a);continue}if(g=r(d),!g){a=e+(a.length>0?" "+a:a);continue}p=!1}const h=m(t).join(":"),f=c?h+"!":h,b=f+g;if(s.includes(b))continue;s.push(b);const x=n(g,p);for(let o=0;o<x.length;++o){const e=x[o];s.push(f+e)}a=e+(a.length>0?" "+a:a)}return a})(e,o);return s(e,r),r}return function(){return i(f.apply(null,arguments))}}const v=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},y=/^\[(?:([a-z-]+):)?(.+)\]$/i,w=/^\d+\/\d+$/,z=new Set(["px","full","screen"]),M=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,P=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,k=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,S=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,E=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I=e=>D(e)||z.has(e)||w.test(e),L=e=>$(e,"length",V),D=e=>Boolean(e)&&!Number.isNaN(Number(e)),C=e=>$(e,"number",D),j=e=>Boolean(e)&&Number.isInteger(Number(e)),N=e=>e.endsWith("%")&&D(e.slice(0,-1)),R=e=>y.test(e),T=e=>M.test(e),G=new Set(["length","size","percentage"]),O=e=>$(e,G,Y),A=e=>$(e,"position",Y),H=new Set(["image","url"]),W=e=>$(e,H,X),B=e=>$(e,"",F),Z=()=>!0,$=(e,t,o)=>{const r=y.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):o(r[2]))},V=e=>P.test(e)&&!k.test(e),Y=()=>!1,F=e=>S.test(e),X=e=>E.test(e),J=x((()=>{const e=v("colors"),t=v("spacing"),o=v("blur"),r=v("brightness"),n=v("borderColor"),s=v("borderRadius"),i=v("borderSpacing"),a=v("borderWidth"),l=v("contrast"),c=v("grayscale"),d=v("hueRotate"),u=v("invert"),p=v("gap"),g=v("gradientColorStops"),m=v("gradientColorStopPositions"),h=v("inset"),f=v("margin"),b=v("opacity"),x=v("padding"),y=v("saturate"),w=v("scale"),z=v("sepia"),M=v("skew"),P=v("space"),k=v("translate"),S=()=>["auto",R,t],E=()=>[R,t],G=()=>["",I,L],H=()=>["auto",D,R],$=()=>["","0",R],V=()=>[D,R];return{cacheSize:500,separator:":",theme:{colors:[Z],spacing:[I,L],blur:["none","",T,R],brightness:V(),borderColor:[e],borderRadius:["none","","full",T,R],borderSpacing:E(),borderWidth:G(),contrast:V(),grayscale:$(),hueRotate:V(),invert:$(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[N,L],inset:S(),margin:S(),opacity:V(),padding:E(),saturate:V(),scale:V(),sepia:$(),skew:V(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",R]}],container:["container"],columns:[{columns:[T]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",R]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",j,R]}],basis:[{basis:S()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",R]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",j,R]}],"grid-cols":[{"grid-cols":[Z]}],"col-start-end":[{col:["auto",{span:["full",j,R]},R]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[Z]}],"row-start-end":[{row:["auto",{span:[j,R]},R]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",R]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",R]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],mt:[{mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",R,t]}],"min-w":[{"min-w":[R,t,"min","max","fit"]}],"max-w":[{"max-w":[R,t,"none","full","min","max","fit","prose",{screen:[T]},T]}],h:[{h:[R,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[R,t,"auto","min","max","fit"]}],"font-size":[{text:["base",T,L]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",C]}],"font-family":[{font:[Z]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",R]}],"line-clamp":[{"line-clamp":["none",D,C]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",I,R]}],"list-image":[{"list-image":["none",R]}],"list-style-type":[{list:["none","disc","decimal",R]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",I,L]}],"underline-offset":[{"underline-offset":["auto",I,R]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",R]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",R]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",A]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",O]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},W]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[I,R]}],"outline-w":[{outline:[I,L]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[I,L]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",T,B]}],"shadow-color":[{shadow:[Z]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",T,R]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[y]}],sepia:[{sepia:[z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",R]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",R]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",R]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[j,R]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",R]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",R]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",R]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[I,L,C]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}));function q(...e){return J(function(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=o(e))&&(n&&(n+=" "),n+=t);return n}(e))}function Q(e,t,o,r,n,s,i){const a=e/(s/o),l=t/(r+(i?i[1]:n)),c=Math.floor(a+.3),d=Math.floor(l+.3);return{col:Math.max(0,c),row:Math.max(0,d)}}function U(e,t,o,r,n,s,i){const a=s?s[0]:r,l=s?s[1]:r,c=i?i[0]:0,d=i?i[1]:0,u=(n-2*c-(t-1)*a)/t,p=c+e.x*(u+a),g=e.w*u+(e.w-1)*a;return{left:Math.round(p),top:d+e.y*(o+l),width:Math.round(g),height:e.h*o+(e.h-1)*l}}function _(e,t){return!(e.x+e.w<=t.x||t.x+t.w<=e.x||e.y+e.h<=t.y||t.y+t.h<=e.y)}function K(e,t,o="vertical"){if(!o)return e;const r=e.filter((e=>e.static)),n=[...e.filter((e=>!e.static))].sort(((e,t)=>"horizontal"===o?e.x===t.x?e.y-t.y:e.x-t.x:e.y===t.y?e.x-t.x:e.y-t.y)),s=[...r];return n.forEach((e=>{if("vertical"===o){let t=0,o=!1;for(let r=0;!o;r++){const n={...e,y:r,x:e.x};s.some((e=>_(n,e)))||(t=r,o=!0)}s.push({...e,y:t})}else if("horizontal"===o){let o=0,r=!1;for(let n=0;n<=t-e.w&&!r;n++){const t={...e,x:n,y:e.y};s.some((e=>_(t,e)))||(o=n,r=!0)}s.push({...e,x:o})}})),s}function ee(e,t,o){const r=e.x+e.w/2,n=e.y+e.h/2,s=t.x+t.w/2,i=t.y+t.h/2,a=e.y>o.y,l=e.y<o.y,c=e.x>o.x,d=e.x<o.x;return!!(a&&n>i)||(!!(l&&n<i)||(!!(c&&r>s)||!!(d&&r<s)))}function te(e,t,o,r){if(!r)return e;const n=[...e],s=n.findIndex((e=>e.id===t.id));-1!==s&&(n[s]={...t});const i=n.filter((e=>e.id!==t.id&&!e.static&&_(t,e))),a=t.y<r.y,l=t.y>r.y;for(const c of i){const e=n.findIndex((e=>e.id===c.id));-1!==e&&(a?n[e]={...c,y:t.y+t.h}:l?n[e]={...c,y:Math.max(0,t.y-c.h)}:ee(t,c,r)&&(n[e]={...c,x:r.x,y:r.y}))}return n}function oe(e,t){return e.filter((e=>e.id!==t.id&&_(e,t)))}const re=({position:t,onMouseDown:o,isActive:r=!0,isVisible:n=!0})=>{const s={se:{className:"bottom-0 right-0",cursor:"cursor-se-resize",backgroundPosition:"bottom right",transform:void 0},sw:{className:"bottom-0 left-0",cursor:"cursor-sw-resize",backgroundPosition:"bottom left",transform:"scaleX(-1)"},ne:{className:"top-0 right-0",cursor:"cursor-ne-resize",backgroundPosition:"top right",transform:"scaleY(-1)"},nw:{className:"top-0 left-0",cursor:"cursor-nw-resize",backgroundPosition:"top left",transform:"scale(-1, -1)"}};if(s[t]&&n){const n=s[t];return e.jsx("span",{className:q("react-grid-layout__resize-handle","absolute w-5 h-5",r?n.cursor:"cursor-not-allowed opacity-50","z-20","touch-action-none"),onMouseDown:r?o:void 0,onTouchStart:r?o:void 0,onPointerDown:r?o:void 0,onDoubleClick:e=>e.preventDefault(),style:{..."se"===t&&{bottom:"0px",right:"0px"},..."sw"===t&&{bottom:"0px",left:"0px"},..."ne"===t&&{top:"0px",right:"0px"},..."nw"===t&&{top:"0px",left:"0px"},backgroundImage:'url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=")',backgroundPosition:"bottom right",backgroundRepeat:"no-repeat",backgroundOrigin:"content-box",boxSizing:"border-box",transform:n.transform,padding:"3px"}})}const i={sw:"bottom-0 left-0 cursor-sw-resize",ne:"top-0 right-0 cursor-ne-resize",nw:"top-0 left-0 cursor-nw-resize",n:"top-0 left-1/2 -translate-x-1/2 w-10 h-2 cursor-n-resize",s:"bottom-0 left-1/2 -translate-x-1/2 w-10 h-2 cursor-s-resize",e:"right-0 top-1/2 -translate-y-1/2 w-2 h-10 cursor-e-resize",w:"left-0 top-1/2 -translate-y-1/2 w-2 h-10 cursor-w-resize"};return!n&&i[t]?e.jsx("div",{className:q("absolute",i[t],!r&&"pointer-events-none",["n","s","e","w"].includes(t)?"":"w-5 h-5","z-20","touch-action-none"),onMouseDown:r?o:void 0,onTouchStart:r?o:void 0,onPointerDown:r?o:void 0,onDoubleClick:e=>e.preventDefault()}):null},ne=({item:t,position:o,isDragging:r,isResizing:n,isDraggable:s,isResizable:i,resizeHandles:a=["se"],draggableCancel:l,onDragStart:c,onResizeStart:d,children:u})=>{const p=e=>{if(t.static)return;const o=e.target,r=o.closest(".grid-drag-handle"),n=o.closest(".grid-actions, button, a"),i=l&&o.closest(l);!s||!r&&o.closest(".grid-drag-handle")||n||i||("touches"in e&&e.preventDefault(),c(t.id,e))};return e.jsxs("div",{"data-grid-id":t.id,className:q("absolute",!r&&"transition-all duration-200",r&&"opacity-80 z-50 cursor-grabbing shadow-2xl",n&&"z-40",!r&&!n&&"hover:z-30",t.static&&"cursor-not-allowed",t.className),style:{left:`${o.left}px`,top:`${o.top}px`,width:`${o.width}px`,height:`${o.height}px`,transform:r?"scale(1.02)":"scale(1)",cursor:s?"grab":"default"},onMouseDown:p,onTouchStart:e=>{p(e),e.stopPropagation()},onPointerDown:p,onDoubleClick:e=>e.preventDefault(),children:[u,i&&e.jsx(e.Fragment,{children:a.map((o=>e.jsx(re,{position:o,onMouseDown:e=>d(t.id,o,e),isActive:!0,isVisible:["se","sw","ne","nw"].includes(o)},o)))})]})};function se(e){if("pointerId"in e){const t=e;return{x:t.clientX,y:t.clientY}}if("touches"in e){const t=e,o=t.touches[0]||t.changedTouches[0];return o?{x:o.clientX,y:o.clientY}:null}return{x:e.clientX,y:e.clientY}}function ie(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:null}const ae={passive:!1,capture:!0};function le(e){e.cancelable&&e.preventDefault()}const ce=({cols:o=12,rowHeight:r=60,gap:n=16,margin:s,containerPadding:i=[16,16],maxRows:a,isDraggable:l=!0,isResizable:c=!0,preventCollision:d=!1,allowOverlap:u=!1,isBounded:p=!0,compactType:g="vertical",resizeHandles:m=["se"],draggableCancel:h,autoSize:f=!0,verticalCompact:b=!0,transformScale:x=1,droppingItem:v,onLayoutChange:y,onDragStart:w,onDrag:z,onDragStop:M,onResizeStart:P,onResize:k,onResizeStop:S,onDrop:E,items:I,children:L,className:D,style:C})=>{const j=t.useRef(null),[N,R]=t.useState(0),[T,G]=t.useState(I);t.useEffect((()=>{G((e=>{const t=new Set(e.map((e=>e.id))),r=new Set(I.map((e=>e.id))),n=I.some((e=>!t.has(e.id))),s=e.some((e=>!r.has(e.id)));if(n||s){const t=new Map(e.map((e=>[e.id,e])));return K(I.map((e=>{const o=t.get(e.id);return o?{...e,x:o.x,y:o.y,w:o.w,h:o.h}:e})),o,g)}return I}))}),[I,o,g]),t.useEffect((()=>{const e=()=>{j.current&&R(j.current.offsetWidth)};if(e(),"undefined"!=typeof ResizeObserver&&j.current){const t=new ResizeObserver(e);return t.observe(j.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[i]);const[O,A]=t.useState({isDragging:!1,draggedItem:null,dragOffset:{x:0,y:0},placeholder:null,originalPosition:null,currentMousePos:void 0}),[H,W]=t.useState({isResizing:!1,resizedItem:null,resizeHandle:null,startSize:{w:0,h:0},startPos:{x:0,y:0},currentPixelSize:{w:0,h:0},currentPixelPos:{x:0,y:0}});t.useEffect((()=>{const e=()=>{j.current&&R(j.current.offsetWidth)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[i]);const B=t.useCallback((e=>{const t=K(e,o,g);G(t),null==y||y(t)}),[o,g,y]),Z=t.useCallback(((e,t)=>{const o=T.find((t=>t.id===e)),r=t.currentTarget.getBoundingClientRect(),n=se(t.nativeEvent);if(!n)return;const s={isDragging:!0,draggedItem:e,dragOffset:{x:n.x-r.left,y:n.y-r.top},placeholder:{...o},originalPosition:{...o},currentMousePos:{x:n.x,y:n.y}};if(A(s),w){const e=t.currentTarget;w(T,o,o,{...o},t.nativeEvent,e)}"touches"in t.nativeEvent||t.preventDefault()}),[T,w]),$=t.useCallback((e=>{var t;if(!j.current)return;const l=se(e);if(!l)return;const c=j.current.getBoundingClientRect(),m=l.x-c.left-O.dragOffset.x-i[0],h=l.y-c.top-O.dragOffset.y-i[1],{col:f,row:b}=Q(m,h,o,r,n,N,s),x=T.find((e=>e.id===O.draggedItem));if(!x||x.static)return;const v={x:Math.max(0,Math.min(o-x.w,f)),y:Math.max(0,b),w:x.w,h:x.h};a&&v.y+v.h>a&&(v.y=Math.max(0,a-v.h)),p&&(v.x=Math.max(0,Math.min(o-v.w,v.x)),v.y=Math.max(0,v.y));const y=T.map((e=>e.id===O.draggedItem?{...e,...v}:e));if(d&&!u){if(oe(y,{...x,...v}).filter((e=>e.static)).length>0)return}let w=y;if(!d&&!u){const e={...x,...v},t=O.originalPosition;w=te(y,e,0,{...x,...t})}const M=K(w,o,g);if(G(M),A((e=>({...e,placeholder:v,currentMousePos:l}))),z&&O.originalPosition){const o=null==(t=j.current)?void 0:t.querySelector(`[data-grid-id="${O.draggedItem}"]`);o&&z(M,{...x,...O.originalPosition},{...x,...v},{...x,...v},e,o)}"touches"in e&&e.preventDefault()}),[O,T,o,r,n,N,i,d,u,p,g,s,a,z]),V=t.useCallback((e=>{var t;const o=T.find((e=>e.id===O.draggedItem));if(o&&M&&O.originalPosition){const r=null==(t=j.current)?void 0:t.querySelector(`[data-grid-id="${O.draggedItem}"]`);r&&M(T,{...o,...O.originalPosition},o,{...o,...O.placeholder},e,r)}B(T),A({isDragging:!1,draggedItem:null,dragOffset:{x:0,y:0},placeholder:null,originalPosition:null,currentMousePos:void 0})}),[O,T,B,M]),Y=t.useCallback(((e,t,a)=>{const l=T.find((t=>t.id===e)),c=se(a.nativeEvent);if(!c)return;const d=s?s[0]:n,u=s?s[1]:n,p=(N-2*i[0]-d*(o-1))/o,g=p+d,m=r+u;if(W({isResizing:!0,resizedItem:e,resizeHandle:t,startSize:{w:l.w,h:l.h},startPos:{x:c.x,y:c.y},originalPos:{x:l.x,y:l.y},currentPixelSize:{w:l.w*p+(l.w-1)*d,h:l.h*r+(l.h-1)*u},currentPixelPos:{x:l.x*g,y:l.y*m}}),P){const e=a.currentTarget;P(T,l,l,{...l},a.nativeEvent,e)}a.preventDefault(),a.stopPropagation(),"touches"in a.nativeEvent&&le(a.nativeEvent)}),[T,P]),F=t.useCallback((e=>{var t,a,l,c,d,u,p,g,m;const h=T.find((e=>e.id===H.resizedItem));if(!h)return;const f=se(e);if(!f)return;const b=s?s[0]:n,x=s?s[1]:n,v=(N-2*i[0]-b*(o-1))/o,y=v+b,w=r+x,z=f.x-H.startPos.x,M=f.y-H.startPos.y,P=H.currentPixelSize.w,S=H.currentPixelSize.h,E=H.currentPixelPos.x,I=H.currentPixelPos.y;let L=E,D=I,C=P,R=S;const O=z/y,A=M/w;let B=H.startSize.w,Z=H.startSize.h,$=(null==(t=H.originalPos)?void 0:t.x)||h.x,V=(null==(a=H.originalPos)?void 0:a.y)||h.y;switch(H.resizeHandle){case"se":B=Math.max(1,Math.round(H.startSize.w+O)),Z=Math.max(1,Math.round(H.startSize.h+A));break;case"sw":{const e=Math.round(O);$=Math.max(0,((null==(l=H.originalPos)?void 0:l.x)||h.x)+e),B=Math.max(1,H.startSize.w-e),Z=Math.max(1,Math.round(H.startSize.h+A));break}case"ne":{const e=Math.round(A);V=Math.max(0,((null==(c=H.originalPos)?void 0:c.y)||h.y)+e),B=Math.max(1,Math.round(H.startSize.w+O)),Z=Math.max(1,H.startSize.h-e);break}case"nw":{const e=Math.round(O),t=Math.round(A);$=Math.max(0,((null==(d=H.originalPos)?void 0:d.x)||h.x)+e),V=Math.max(0,((null==(u=H.originalPos)?void 0:u.y)||h.y)+t),B=Math.max(1,H.startSize.w-e),Z=Math.max(1,H.startSize.h-t);break}case"e":B=Math.max(1,Math.round(H.startSize.w+O));break;case"w":{const e=Math.round(O);$=Math.max(0,((null==(p=H.originalPos)?void 0:p.x)||h.x)+e),B=Math.max(1,H.startSize.w-e);break}case"s":Z=Math.max(1,Math.round(H.startSize.h+A));break;case"n":{const e=Math.round(A);V=Math.max(0,((null==(g=H.originalPos)?void 0:g.y)||h.y)+e),Z=Math.max(1,H.startSize.h-e);break}}$=Math.max(0,Math.min(o-B,$)),B=Math.min(B,o-$),L=$*y,D=V*w,C=B*v+(B-1)*b,R=Z*r+(Z-1)*x;const Y=Math.min(Math.max(h.minW||1,B),h.maxW||1/0),F=Math.max(h.minH||1,Math.min(Z,h.maxH||1/0)),X=Math.max(0,Math.min(o-Y,$)),J=Math.max(0,V),q=T.map((e=>e.id===H.resizedItem?{...e,x:X,y:J,w:Y,h:F}:e));if(G(q),W((e=>({...e,currentPixelSize:{w:C,h:R},currentPixelPos:{x:L,y:D}}))),k&&H.originalPos){const t=null==(m=j.current)?void 0:m.querySelector(`[data-grid-id="${H.resizedItem}"]`);if(t){const o={...h,x:H.originalPos.x,y:H.originalPos.y,w:H.startSize.w,h:H.startSize.h},r={...h,x:X,y:J,w:Y,h:F};k(q,o,r,r,e,t)}}"touches"in e&&e.preventDefault()}),[H,T,N,o,r,n,s,k]),X=t.useCallback((e=>{var t;const o=T.find((e=>e.id===H.resizedItem));if(o&&S&&H.originalPos){const r=null==(t=j.current)?void 0:t.querySelector(`[data-grid-id="${H.resizedItem}"]`);if(r){const t={...o,x:H.originalPos.x,y:H.originalPos.y,w:H.startSize.w,h:H.startSize.h};S(T,t,o,o,e,r)}}B(T),W({isResizing:!1,resizedItem:null,resizeHandle:null,startSize:{w:0,h:0},startPos:{x:0,y:0},currentPixelSize:{w:0,h:0},currentPixelPos:{x:0,y:0}})}),[H,T,B,S]);t.useEffect((()=>{if(O.isDragging)return document.addEventListener("mousemove",$),document.addEventListener("mouseup",V),document.addEventListener("touchmove",$,ae),document.addEventListener("touchend",V,ae),document.addEventListener("touchcancel",V,ae),document.addEventListener("pointermove",$),document.addEventListener("pointerup",V),document.addEventListener("pointercancel",V),document.body.style.cursor="grabbing",document.body.style.userSelect="none",document.body.classList.add("grid-dragging"),()=>{document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",V),document.removeEventListener("touchmove",$,ae),document.removeEventListener("touchend",V,ae),document.removeEventListener("touchcancel",V,ae),document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",V),document.removeEventListener("pointercancel",V),document.body.style.cursor="",document.body.style.userSelect="",document.body.classList.remove("grid-dragging")}}),[O.isDragging,O.draggedItem,O.dragOffset,$,V]),t.useEffect((()=>{if(H.isResizing)return document.addEventListener("mousemove",F),document.addEventListener("mouseup",X),document.addEventListener("touchmove",F,ae),document.addEventListener("touchend",X,ae),document.addEventListener("touchcancel",X,ae),document.addEventListener("pointermove",F),document.addEventListener("pointerup",X),document.addEventListener("pointercancel",X),document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",X),document.removeEventListener("touchmove",F,ae),document.removeEventListener("touchend",X,ae),document.removeEventListener("touchcancel",X,ae),document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.body.style.userSelect=""}}),[H.isResizing,F,X]);const J=s?s[1]:n,_=T.map((e=>(e.y+e.h)*(r+J))),ee=_.length>0?Math.max(..._):0,re=f?ee:void 0;return e.jsxs("div",{ref:j,className:q("tailwind-grid-layout relative w-full overflow-auto",O.isDragging&&"dragging select-none",H.isResizing&&"resizing",D),style:{...void 0!==re&&{minHeight:re+2*i[1]},padding:`${i[1]}px ${i[0]}px`,...C},children:[T.map((t=>{const a=O.draggedItem===t.id,d=H.resizedItem===t.id;let u=U(t,o,r,n,N,s,i);if(a&&O.currentMousePos&&j.current){const e=j.current.getBoundingClientRect();u={...u,left:O.currentMousePos.x-e.left-O.dragOffset.x-i[0],top:O.currentMousePos.y-e.top-O.dragOffset.y-i[1]}}return d&&H.currentPixelSize&&H.currentPixelPos&&(u={left:H.currentPixelPos.x,top:H.currentPixelPos.y,width:H.currentPixelSize.w,height:H.currentPixelSize.h}),e.jsx(ne,{item:t,position:u,isDragging:a,isResizing:d,isDraggable:l&&!1!==t.isDraggable,isResizable:c&&!1!==t.isResizable,resizeHandles:m,draggableCancel:h,onDragStart:Z,onResizeStart:Y,children:L(t)},t.id)})),O.isDragging&&O.placeholder&&e.jsx("div",{className:"absolute rounded-lg transition-all duration-300 pointer-events-none",style:{...U(O.placeholder,o,r,n,N,s,i),zIndex:9,background:"rgba(59, 130, 246, 0.15)",border:"2px dashed rgb(59, 130, 246)",boxSizing:"border-box"}}),H.isResizing&&H.resizedItem&&(()=>{const t=T.find((e=>e.id===H.resizedItem));return t?e.jsx("div",{className:"absolute rounded-lg transition-all duration-200 pointer-events-none",style:{...U(t,o,r,n,N,s,i),zIndex:8,background:"rgba(59, 130, 246, 0.1)",border:"2px dashed rgb(59, 130, 246)",boxSizing:"border-box"}}):null})(),v&&!O.isDragging&&e.jsx("div",{className:"absolute bg-gray-200 border-2 border-dashed border-gray-400 rounded opacity-75 pointer-events-none flex items-center justify-center",style:{width:(v.w||1)*(N-2*i[0])/o-n,height:(v.h||1)*r-n,left:i[0],top:i[1]},children:e.jsx("span",{className:"text-gray-600 font-medium",children:"Drop here"})})]})},de={lg:1200,md:996,sm:768,xs:480,xxs:0},ue={lg:12,md:10,sm:6,xs:4,xxs:2};function pe(e,t){var o,r,n,s;"development"===process.env.NODE_ENV&&("touches"in t?console.log(`🔥 TOUCH EVENT: ${e}`,{type:t.type,touches:t.touches.length,targetTouches:(null==(o=t.targetTouches)?void 0:o.length)||0,changedTouches:(null==(r=t.changedTouches)?void 0:r.length)||0,target:null==(n=t.target)?void 0:n.tagName,timestamp:Date.now()}):console.log(`🖱️ MOUSE EVENT: ${e}`,{type:t.type,target:null==(s=t.target)?void 0:s.tagName,timestamp:Date.now()}))}exports.DroppableGridContainer=function({onDrop:o,droppingItem:r={w:2,h:2},className:n,...s}){const[i,a]=t.useState(!1),l=t.useRef(null);return e.jsxs("div",{ref:l,className:q("relative",i&&"ring-2 ring-blue-500 ring-offset-2 rounded-lg",n),onDragOver:e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),a(!0)},onDragLeave:e=>{var t;const o=null==(t=l.current)?void 0:t.getBoundingClientRect();if(o){const{clientX:t,clientY:r}=e;(t<o.left||t>o.right||r<o.top||r>o.bottom)&&a(!1)}},onDrop:e=>{var t;e.preventDefault(),a(!1);const n=e.dataTransfer.getData("application/json");if(n)try{const i=JSON.parse(n),a=null==(t=l.current)?void 0:t.getBoundingClientRect();if(!a)return;const c=e.clientX-a.left,d=e.clientY-a.top,u=s.cols||12,p=s.rowHeight||60,g=s.gap||16,m=a.width/u,h=p+g,f=Math.floor(c/m),b=Math.floor(d/h),x={id:i.id||`dropped-${Date.now()}`,x:Math.max(0,Math.min(f,u-(r.w||2))),y:Math.max(0,b),w:r.w||2,h:r.h||2,...i};null==o||o(x)}catch(i){console.error("Failed to parse dropped data:",i)}},children:[e.jsx(ce,{...s,droppingItem:i?r:void 0}),i&&e.jsx("div",{className:"absolute inset-0 bg-blue-500/10 rounded-lg pointer-events-none"})]})},exports.GridContainer=ce,exports.GridItemComponent=ne,exports.ResizeHandle=re,exports.ResponsiveGridContainer=function({layouts:o,breakpoints:r=de,cols:n=ue,onLayoutChange:s,onBreakpointChange:i,width:a,...l}){const[c,d]=t.useState((()=>{var e;const t=a??window.innerWidth,o=Object.entries(r).sort(((e,t)=>t[1]-e[1]));for(const[r,n]of o)if(t>=n)return r;return(null==(e=o[o.length-1])?void 0:e[0])||"lg"})),[u,p]=t.useState((()=>("object"==typeof n?n[c]:void 0)||ue[c]||12)),g=t.useMemo((()=>Object.entries(r).sort(((e,t)=>t[1]-e[1]))),[r]),m=t.useMemo((()=>e=>{if(0===g.length)return"lg";let t=g[g.length-1][0];for(const[o,r]of g)if(e>=r){t=o;break}return t}),[g]),h=t.useRef(null);t.useEffect((()=>{const e=()=>{const e=a??window.innerWidth,t=m(e);if(t!==c){d(t);const e="object"==typeof n&&n[t]||ue[t]||12;p(e),null==i||i(t,e)}},t=()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(e,150)};if(e(),void 0===a)return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),h.current&&clearTimeout(h.current)};e()}),[c,n,g,i,a,m]),t.useEffect((()=>{i&&i(c,u)}),[]);const f=o[c]||[];return e.jsx(ce,{...l,items:f,cols:u,onLayoutChange:e=>{const t={...o,[c]:e};null==s||s(e,t)}})},exports.WidthProvider=function(o){return function(r){const{measureBeforeMount:n=!1,...s}=r,[i,a]=t.useState(n?void 0:1280),l=t.useRef(null),c=t.useRef(!1);return t.useEffect((()=>{c.current=!0;const e=()=>{const e=l.current;if(!e)return;const t=e.offsetWidth;a(t)};n||e();let t=null;return l.current&&"ResizeObserver"in window?(t=new ResizeObserver(e),t.observe(l.current)):window.addEventListener("resize",e),()=>{c.current=!1,t?t.disconnect():window.removeEventListener("resize",e)}}),[n]),n&&void 0===i?e.jsx("div",{ref:l,style:{width:"100%"}}):e.jsx("div",{ref:l,style:{width:"100%"},children:e.jsx(o,{...s,width:i})})}},exports.calculateGridPosition=Q,exports.checkCollision=_,exports.cn=q,exports.compactLayout=K,exports.enableTouchDebugging=function(){document.addEventListener("touchstart",(e=>pe("touchstart",e)),{passive:!1}),document.addEventListener("touchmove",(e=>pe("touchmove",e)),{passive:!1}),document.addEventListener("touchend",(e=>pe("touchend",e)),{passive:!1}),document.addEventListener("mousedown",(e=>pe("mousedown",e))),document.addEventListener("mousemove",(e=>pe("mousemove",e))),document.addEventListener("mouseup",(e=>pe("mouseup",e))),"development"===process.env.NODE_ENV&&console.log("🚀 Touch debugging enabled")},exports.findFreeSpace=function(e,t,o,r){const n=r?e.filter((e=>e.id!==r)):e;if(!n.some((e=>_(t,e))))return t;let s=t.y;for(;;){for(let e=0;e<=o-t.w;e++){const o={...t,x:e,y:s};if(!n.some((e=>_(o,e))))return o}s++}},exports.generateLayouts=function(e,t=["lg","md","sm","xs","xxs"]){return t.reduce(((t,o)=>(t[o]=e.map((e=>({...e}))),t)),{})},exports.generateResponsiveLayouts=function(e,t={lg:12,md:10,sm:6,xs:4,xxs:2}){const o={};return Object.entries(t).forEach((([t,r])=>{o[t]=e.map((e=>{const t=Math.min(e.w,r),o=e.x+t>r?r-t:e.x;return{...e,w:t,x:o}}))})),o},exports.getAllCollisions=oe,exports.getControlPosition=se,exports.getPixelPosition=U,exports.getTouchIdentifier=ie,exports.isPrimaryTouch=function(e){var t;return 1===e.touches.length||e.touches.length>1&&(null==(t=e.touches[0])?void 0:t.identifier)===ie(e)},exports.moveItems=te,exports.preventDefaultTouchEvent=le,exports.shouldSwapItems=ee,exports.touchEventOptions=ae;
//# sourceMappingURL=index.cjs.map
;