tailwind-grid-layout 1.1.0-beta.0 → 1.1.0

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
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react");function r(e){var t,o,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(o=r(e[t]))&&(n&&(n+=" "),n+=o)}else for(o in e)e[o]&&(n&&(n+=" "),n+=o);return n}const o=e=>{const t=a(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),n(r,t)||s(e)},getConflictingClassGroupIds:(e,t)=>{const n=r[e]||[];return t&&o[e]?[...n,...o[e]]:n}}},n=(e,t)=>{var r;if(0===e.length)return t.classGroupId;const o=e[0],i=t.nextPart.get(o),s=i?n(e.slice(1),i):void 0;if(s)return s;if(0===t.validators.length)return;const a=e.join("-");return null==(r=t.validators.find((({validator:e})=>e(a))))?void 0:r.classGroupId},i=/^\[(.+)\]$/,s=e=>{if(i.test(e)){const t=i.exec(e)[1],r=null==t?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},a=e=>{const{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return u(Object.entries(e.classGroups),r).forEach((([e,r])=>{l(r,o,e,t)})),o},l=(e,t,r,o)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return d(e)?void l(e(o),t,r,o):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach((([e,n])=>{l(n,c(t,e),r,o)}))}else{(""===e?t:c(t,e)).classGroupId=r}}))},c=(e,t)=>{let r=e;return t.split("-").forEach((e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)})),r},d=e=>e.isThemeGetter,u=(e,t)=>t?e.map((([e,r])=>[e,r.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,r])=>[t+e,r]))):e))])):e,g=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const n=(n,i)=>{r.set(n,i),t++,t>e&&(t=0,o=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=o.get(e))?(n(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):n(e,t)}}},p=e=>{const{separator:t,experimentalParseClassName:r}=e,o=1===t.length,n=t[0],i=t.length,s=e=>{const r=[];let s,a=0,l=0;for(let u=0;u<e.length;u++){let c=e[u];if(0===a){if(c===n&&(o||e.slice(u,u+i)===t)){r.push(e.slice(l,u)),l=u+i;continue}if("/"===c){s=u;continue}}"["===c?a++:"]"===c&&a--}const c=0===r.length?e:e.substring(l),d=c.startsWith("!");return{modifiers:r,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:s&&s>l?s-l:void 0}};return r?e=>r({className:e,parseClassName:s}):s},m=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach((e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)})),t.push(...r.sort()),t},h=/\s+/;function f(){let e,t,r=0,o="";for(;r<arguments.length;)(e=arguments[r++])&&(t=b(e))&&(o&&(o+=" "),o+=t);return o}const b=e=>{if("string"==typeof e)return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=b(e[o]))&&(r&&(r+=" "),r+=t);return r};function x(e,...t){let r,n,i,s=function(l){const c=t.reduce(((e,t)=>t(e)),e());return r=(e=>({cache:g(e.cacheSize),parseClassName:p(e),...o(e)}))(c),n=r.cache.get,i=r.cache.set,s=a,a(l)};function a(e){const t=n(e);if(t)return t;const o=((e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n}=t,i=[],s=e.trim().split(h);let a="";for(let l=s.length-1;l>=0;l-=1){const e=s[l],{modifiers:t,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:u}=r(e);let g=Boolean(u),p=o(g?d.substring(0,u):d);if(!p){if(!g){a=e+(a.length>0?" "+a:a);continue}if(p=o(d),!p){a=e+(a.length>0?" "+a:a);continue}g=!1}const h=m(t).join(":"),f=c?h+"!":h,b=f+p;if(i.includes(b))continue;i.push(b);const x=n(p,g);for(let r=0;r<x.length;++r){const e=x[r];i.push(f+e)}a=e+(a.length>0?" "+a:a)}return a})(e,r);return i(e,o),o}return function(){return s(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)$/,S=/\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$/,P=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,k=/^(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),C=e=>V(e,"length",Y),D=e=>Boolean(e)&&!Number.isNaN(Number(e)),L=e=>V(e,"number",D),R=e=>Boolean(e)&&Number.isInteger(Number(e)),j=e=>e.endsWith("%")&&D(e.slice(0,-1)),N=e=>y.test(e),T=e=>M.test(e),H=new Set(["length","size","percentage"]),G=e=>V(e,H,Z),W=e=>V(e,"position",Z),O=new Set(["image","url"]),A=e=>V(e,O,F),B=e=>V(e,"",X),$=()=>!0,V=(e,t,r)=>{const o=y.exec(e);return!!o&&(o[1]?"string"==typeof t?o[1]===t:t.has(o[1]):r(o[2]))},Y=e=>S.test(e)&&!P.test(e),Z=()=>!1,X=e=>k.test(e),F=e=>E.test(e),U=x((()=>{const e=v("colors"),t=v("spacing"),r=v("blur"),o=v("brightness"),n=v("borderColor"),i=v("borderRadius"),s=v("borderSpacing"),a=v("borderWidth"),l=v("contrast"),c=v("grayscale"),d=v("hueRotate"),u=v("invert"),g=v("gap"),p=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"),S=v("space"),P=v("translate"),k=()=>["auto",N,t],E=()=>[N,t],H=()=>["",I,C],O=()=>["auto",D,N],V=()=>["","0",N],Y=()=>[D,N];return{cacheSize:500,separator:":",theme:{colors:[$],spacing:[I,C],blur:["none","",T,N],brightness:Y(),borderColor:[e],borderRadius:["none","","full",T,N],borderSpacing:E(),borderWidth:H(),contrast:Y(),grayscale:V(),hueRotate:Y(),invert:V(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[j,C],inset:k(),margin:k(),opacity:Y(),padding:E(),saturate:Y(),scale:Y(),sepia:V(),skew:Y(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],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",N]}],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",R,N]}],basis:[{basis:k()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",R,N]}],"grid-cols":[{"grid-cols":[$]}],"col-start-end":[{col:["auto",{span:["full",R,N]},N]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[$]}],"row-start-end":[{row:["auto",{span:[R,N]},N]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"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":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[T]},T]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",T,C]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",L]}],"font-family":[{font:[$]}],"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",N]}],"line-clamp":[{"line-clamp":["none",D,L]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",I,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"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,C]}],"underline-offset":[{"underline-offset":["auto",I,N]}],"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",N]}],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",N]}],"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",W]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",G]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},A]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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,N]}],"outline-w":[{outline:[I,C]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[I,C]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",T,B]}],"shadow-color":[{shadow:[$]}],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:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",T,N]}],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":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"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":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[R,N]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"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",N]}],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",N]}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[I,C,L]}],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 J(...e){return U(function(){for(var e,t,o=0,n="",i=arguments.length;o<i;o++)(e=arguments[o])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}(e))}function q(e,t,r,o,n,i,s){const a=e/(i/r),l=t/(o+(s?s[1]:n)),c=Math.floor(a+.3),d=Math.floor(l+.3);return{col:Math.max(0,c),row:Math.max(0,d)}}function Q(e,t,r,o,n,i,s){const a=i?i[0]:o,l=i?i[1]:o,c=s?s[0]:0,d=s?s[1]:0,u=(n-2*c-(t-1)*a)/t,g=c+e.x*(u+a),p=e.w*u+(e.w-1)*a;return{left:Math.round(g),top:d+e.y*(r+l),width:Math.round(p),height:e.h*r+(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,r="vertical"){if(!r)return e;const o=e.filter((e=>e.static)),n=[...e.filter((e=>!e.static))].sort(((e,t)=>"horizontal"===r?e.x===t.x?e.y-t.y:e.x-t.x:e.y===t.y?e.x-t.x:e.y-t.y)),i=[...o];return n.forEach((e=>{if("vertical"===r){let t=0,r=!1;for(let o=0;!r;o++){const n={...e,y:o,x:e.x};i.some((e=>_(n,e)))||(t=o,r=!0)}i.push({...e,y:t})}else if("horizontal"===r){let r=0,o=!1;for(let n=0;n<=t-e.w&&!o;n++){const t={...e,x:n,y:e.y};i.some((e=>_(t,e)))||(r=n,o=!0)}i.push({...e,x:r})}})),i}function ee(e,t,r){const o=e.x+e.w/2,n=e.y+e.h/2,i=t.x+t.w/2,s=t.y+t.h/2,a=e.y>r.y,l=e.y<r.y,c=e.x>r.x,d=e.x<r.x;return!!(a&&n>s)||(!!(l&&n<s)||(!!(c&&o>i)||!!(d&&o<i)))}function te(e,t,r,o){if(!o)return e;const n=[...e],i=n.findIndex((e=>e.id===t.id));-1!==i&&(n[i]={...t});const s=n.filter((e=>e.id!==t.id&&!e.static&&_(t,e))),a=t.y<o.y,l=t.y>o.y;for(const c of s){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,o)&&(n[e]={...c,x:o.x,y:o.y}))}return n}function re(e,t){return e.filter((e=>e.id!==t.id&&_(e,t)))}const oe=({position:t,onMouseDown:r,isActive:o=!0,isVisible:n=!0})=>{const i=e=>{e.stopPropagation(),r(e)},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 r=s[t];return e.jsx("span",{"data-testid":`resize-handle-${t}`,className:J("react-grid-layout__resize-handle","absolute w-5 h-5",o?r.cursor:"cursor-not-allowed opacity-50","z-50","touch-action-none"),onMouseDown:o?i:void 0,onTouchStart:o?i:void 0,onDoubleClick:e=>e.preventDefault(),style:{..."se"===t&&{bottom:"0px",right:"0px",cursor:"se-resize"},..."sw"===t&&{bottom:"0px",left:"0px",cursor:"sw-resize"},..."ne"===t&&{top:"0px",right:"0px",cursor:"ne-resize"},..."nw"===t&&{top:"0px",left:"0px",cursor:"nw-resize"},backgroundImage:'url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=")',backgroundPosition:"bottom right",backgroundRepeat:"no-repeat",backgroundOrigin:"content-box",boxSizing:"border-box",transform:r.transform,padding:"3px"}})}const a={n:"top-0 left-1/2 -translate-x-1/2 w-16 h-4 cursor-n-resize",s:"bottom-0 left-1/2 -translate-x-1/2 w-16 h-4 cursor-s-resize",e:"right-0 top-1/2 -translate-y-1/2 w-4 h-16 cursor-e-resize",w:"left-0 top-1/2 -translate-y-1/2 w-4 h-16 cursor-w-resize"},l={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize"};return a[t]?e.jsx("div",{"data-testid":`resize-handle-${t}`,className:J("absolute",a[t],!o&&"pointer-events-none","z-20","touch-action-none"),style:{cursor:o?l[t]:"not-allowed"},onMouseDown:o?i:void 0,onTouchStart:o?i:void 0,onDoubleClick:e=>e.preventDefault()}):null},ne=({item:t,position:r,isDragging:o,isResizing:n,isColliding:i=!1,isDraggable:s,isResizable:a,resizeHandles:l=["se"],draggableCancel:c,onDragStart:d,onResizeStart:u,children:g})=>{const p=e=>{if(t.static)return;const r=e.target,o=r.closest(".grid-drag-handle"),n=r.closest(".grid-actions, button, a");if(r.closest(".react-grid-layout__resize-handle")||r.closest('[data-testid^="resize-handle-"]'))return;const i=c&&r.closest(c);!s||!o&&r.closest(".grid-drag-handle")||n||i||("touches"in e&&e.preventDefault(),d(t.id,e))};return e.jsxs("div",{"data-grid-id":t.id,className:J("absolute isolate",!o&&"transition-all duration-200",o&&"opacity-80 z-50 cursor-grabbing shadow-2xl",n&&"z-40",i&&"ring-1 ring-gray-400 shadow-inner",!o&&!n&&"hover:z-30",!o&&(t.static?"cursor-not-allowed":s?"cursor-grab":"cursor-default"),t.className),style:{left:`${r.left}px`,top:`${r.top}px`,width:`${r.width}px`,height:`${r.height}px`,transform:o?"scale(1.02)":"scale(1)"},onMouseDown:p,onTouchStart:e=>{p(e),e.stopPropagation()},onDoubleClick:e=>e.preventDefault(),children:[e.jsx("div",{className:"relative z-0 h-full w-full",children:g}),a&&e.jsx(e.Fragment,{children:l.map((r=>e.jsx(oe,{position:r,onMouseDown:e=>u(t.id,r,e),isActive:!0,isVisible:["se","sw","ne","nw"].includes(r)},r)))})]})};function ie(e){if("pointerId"in e){const t=e;return{x:t.clientX,y:t.clientY}}if("touches"in e){const t=e,r=t.touches[0]||t.changedTouches[0];return r?{x:r.clientX,y:r.clientY}:null}return{x:e.clientX,y:e.clientY}}function se(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={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}};const de={isDragging:!1,draggedItem:null,dragOffset:{x:0,y:0},placeholder:null,originalPosition:null,currentMousePos:void 0};const ue=({cols:r=12,rowHeight:o=60,gap:n=16,margin:i,containerPadding:s=[16,16],maxRows:a,isDraggable:l=!0,isResizable:c=!0,preventCollision:d=!1,allowOverlap:u=!1,isBounded:g=!0,compactType:p="vertical",resizeHandles:m=["se"],draggableCancel:h,autoSize:f=!0,preserveInitialHeight:b=!1,verticalCompact:x=!0,transformScale:v=1,droppingItem:y,isExternalDragging:w=!1,onLayoutChange:z,onDragStart:M,onDrag:S,onDragStop:P,onResizeStart:k,onResize:E,onResizeStop:I,onDrop:C,items:D,children:L,className:R,style:j})=>{const N=t.useRef(null),[T,H]=t.useState(0),[G,W]=t.useState(D),O=t.useRef(null);if(b&&null===O.current){const e=i?i[1]:n,t=D.map((t=>(t.y+t.h)*(o+e)));O.current=t.length>0?Math.max(...t):0}t.useEffect((()=>{W((e=>{const t=new Set(e.map((e=>e.id))),o=new Set(D.map((e=>e.id))),n=D.some((e=>!t.has(e.id))),i=e.some((e=>!o.has(e.id)));if(n||i){const t=new Map(e.map((e=>[e.id,e])));return K(D.map((e=>{const r=t.get(e.id);return r?{...e,x:r.x,y:r.y,w:r.w,h:r.h}:e})),r,p)}return D}))}),[D,r,p]),t.useEffect((()=>{const e=()=>{N.current&&H(N.current.offsetWidth)};if(e(),"undefined"!=typeof ResizeObserver&&N.current){const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[s]);const A=t.useCallback((e=>{const t=K(e,r,p);W(t),null==z||z(t)}),[r,p,z]),{resizeState:B,handleResizeStart:$}=function({cols:e,rowHeight:r,gap:o,margin:n,containerPadding:i,containerWidth:s,layout:a,setLayout:l,updateLayout:c,containerRef:d,onResizeStart:u,onResize:g,onResizeStop:p}){const[m,h]=t.useState(ce),f=t.useRef(a);f.current=a;const b=t.useCallback((()=>{const t=n?n[0]:o,a=n?n[1]:o,l=(s-2*i[0]-t*(e-1))/e;return{horizontalMargin:t,verticalMargin:a,colWidth:l,gridUnitW:l+t,gridUnitH:r+a}}),[e,r,o,n,i,s]),x=t.useCallback(((e,t,o)=>{const n=f.current.find((t=>t.id===e)),i=ie(o.nativeEvent);if(!i)return;const{horizontalMargin:s,verticalMargin:a,colWidth:l,gridUnitW:c,gridUnitH:d}=b();if(h({isResizing:!0,resizedItem:e,resizeHandle:t,startSize:{w:n.w,h:n.h},startPos:{x:i.x,y:i.y},originalPos:{x:n.x,y:n.y},currentPixelSize:{w:n.w*l+(n.w-1)*s,h:n.h*r+(n.h-1)*a},currentPixelPos:{x:n.x*c,y:n.y*d}}),u){const e=o.currentTarget;u(f.current,n,n,{...n},o.nativeEvent,e)}o.preventDefault(),o.stopPropagation(),"touches"in o.nativeEvent&&le(o.nativeEvent)}),[b,u,r]),v=t.useCallback((t=>{var o,n,i,s,a,c,u,p,x;const v=f.current.find((e=>e.id===m.resizedItem));if(!v)return;const y=ie(t);if(!y)return;const{horizontalMargin:w,verticalMargin:z,colWidth:M,gridUnitW:S,gridUnitH:P}=b(),k=(y.x-m.startPos.x)/S,E=(y.y-m.startPos.y)/P;let I=m.startSize.w,C=m.startSize.h,D=(null==(o=m.originalPos)?void 0:o.x)??v.x,L=(null==(n=m.originalPos)?void 0:n.y)??v.y;switch(m.resizeHandle){case"se":I=Math.max(1,Math.round(m.startSize.w+k)),C=Math.max(1,Math.round(m.startSize.h+E));break;case"sw":{const e=Math.round(k),t=m.startSize.w-1,r=Math.min(e,t);D=Math.max(0,((null==(i=m.originalPos)?void 0:i.x)??v.x)+r),I=Math.max(1,m.startSize.w-r),C=Math.max(1,Math.round(m.startSize.h+E));break}case"ne":{const e=Math.round(E),t=m.startSize.h-1,r=Math.min(e,t);L=Math.max(0,((null==(s=m.originalPos)?void 0:s.y)??v.y)+r),I=Math.max(1,Math.round(m.startSize.w+k)),C=Math.max(1,m.startSize.h-r);break}case"nw":{const e=Math.round(k),t=Math.round(E),r=m.startSize.w-1,o=m.startSize.h-1,n=Math.min(e,r),i=Math.min(t,o);D=Math.max(0,((null==(a=m.originalPos)?void 0:a.x)??v.x)+n),L=Math.max(0,((null==(c=m.originalPos)?void 0:c.y)??v.y)+i),I=Math.max(1,m.startSize.w-n),C=Math.max(1,m.startSize.h-i);break}case"e":I=Math.max(1,Math.round(m.startSize.w+k));break;case"w":{const e=Math.round(k),t=m.startSize.w-1,r=Math.min(e,t);D=Math.max(0,((null==(u=m.originalPos)?void 0:u.x)??v.x)+r),I=Math.max(1,m.startSize.w-r);break}case"s":C=Math.max(1,Math.round(m.startSize.h+E));break;case"n":{const e=Math.round(E),t=m.startSize.h-1,r=Math.min(e,t);L=Math.max(0,((null==(p=m.originalPos)?void 0:p.y)??v.y)+r),C=Math.max(1,m.startSize.h-r);break}}D=Math.max(0,Math.min(e-I,D)),I=Math.min(I,e-D);const R=Math.min(Math.max(v.minW||1,I),v.maxW||1/0),j=Math.max(v.minH||1,Math.min(C,v.maxH||1/0)),N=Math.max(0,Math.min(e-R,D)),T=Math.max(0,L),H=f.current.filter((e=>e.static&&e.id!==v.id));let G=N,W=T,O=R,A=j,B=!1;for(const e of H){const t={...v,x:N,y:T,w:R,h:j};if(_(t,e))switch(B=!0,m.resizeHandle){case"se":t.x<e.x&&(O=Math.min(O,e.x-t.x)),t.y<e.y&&(A=Math.min(A,e.y-t.y));break;case"nw":if(e.x+e.w<=m.originalPos.x+m.startSize.w){const t=m.originalPos.x-(e.x+e.w);m.originalPos.x-N>t&&(G=e.x+e.w,O=m.originalPos.x+m.startSize.w-G)}if(e.y+e.h<=m.originalPos.y+m.startSize.h){const t=m.originalPos.y-(e.y+e.h);m.originalPos.y-T>t&&(W=e.y+e.h,A=m.originalPos.y+m.startSize.h-W)}break;case"sw":if(e.x+e.w<=m.originalPos.x+m.startSize.w){const t=m.originalPos.x-(e.x+e.w);m.originalPos.x-N>t&&(G=e.x+e.w,O=m.originalPos.x+m.startSize.w-G)}t.y<e.y&&(A=Math.min(A,e.y-t.y));break;case"ne":if(t.x<e.x&&(O=Math.min(O,e.x-t.x)),e.y+e.h<=m.originalPos.y+m.startSize.h){const t=m.originalPos.y-(e.y+e.h);m.originalPos.y-T>t&&(W=e.y+e.h,A=m.originalPos.y+m.startSize.h-W)}break;case"w":if(e.x+e.w<=m.originalPos.x+m.startSize.w){const t=m.originalPos.x-(e.x+e.w);m.originalPos.x-N>t&&(G=e.x+e.w,O=m.originalPos.x+m.startSize.w-G)}break;case"e":t.x<e.x&&(O=Math.min(O,e.x-t.x));break;case"n":if(e.y+e.h<=m.originalPos.y+m.startSize.h){const t=m.originalPos.y-(e.y+e.h);m.originalPos.y-T>t&&(W=e.y+e.h,A=m.originalPos.y+m.startSize.h-W)}break;case"s":t.y<e.y&&(A=Math.min(A,e.y-t.y))}}h((e=>({...e,isColliding:B})));const $=f.current.map((e=>e.id===m.resizedItem?{...e,x:G,y:W,w:O,h:A}:e));l($);const V=G*S,Y=W*P,Z=O*M+(O-1)*w,X=A*r+(A-1)*z;if(h((e=>({...e,currentPixelSize:{w:Z,h:X},currentPixelPos:{x:V,y:Y}}))),g&&m.originalPos){const e=null==(x=d.current)?void 0:x.querySelector(`[data-grid-id="${m.resizedItem}"]`);if(e){const r={...v,x:m.originalPos.x,y:m.originalPos.y,w:m.startSize.w,h:m.startSize.h},o={...v,x:G,y:W,w:O,h:A};g($,r,o,o,t,e)}}"touches"in t&&t.preventDefault()}),[m,e,r,b,l,g,d]),y=t.useCallback((e=>{var t;const r=f.current.find((e=>e.id===m.resizedItem));if(r&&p&&m.originalPos){const o=null==(t=d.current)?void 0:t.querySelector(`[data-grid-id="${m.resizedItem}"]`);if(o){const t={...r,x:m.originalPos.x,y:m.originalPos.y,w:m.startSize.w,h:m.startSize.h};p(f.current,t,r,r,e,o)}}c(f.current),h(ce)}),[m,c,p,d]);return t.useEffect((()=>{if(m.isResizing)return document.addEventListener("mousemove",v),document.addEventListener("mouseup",y),document.addEventListener("touchmove",v,ae),document.addEventListener("touchend",y,ae),document.addEventListener("touchcancel",y,ae),document.addEventListener("pointermove",v),document.addEventListener("pointerup",y),document.addEventListener("pointercancel",y),document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",y),document.removeEventListener("touchmove",v,ae),document.removeEventListener("touchend",y,ae),document.removeEventListener("touchcancel",y,ae),document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",y),document.removeEventListener("pointercancel",y),document.body.style.userSelect=""}}),[m.isResizing,v,y]),{resizeState:m,handleResizeStart:x}}({cols:r,rowHeight:o,gap:n,margin:i,containerPadding:s,containerWidth:T,layout:G,setLayout:W,updateLayout:A,containerRef:N,onResizeStart:k,onResize:E,onResizeStop:I}),{dragState:V,handleDragStart:Y}=function({cols:e,rowHeight:r,gap:o,margin:n,containerPadding:i,containerWidth:s,maxRows:a,preventCollision:l,allowOverlap:c,isBounded:d,compactType:u,layout:g,setLayout:p,updateLayout:m,containerRef:h,onDragStart:f,onDrag:b,onDragStop:x}){const[v,y]=t.useState(de),w=t.useRef(g);w.current=g;const z=t.useCallback(((e,t)=>{const r=w.current.find((t=>t.id===e)),o=t.currentTarget.getBoundingClientRect(),n=ie(t.nativeEvent);if(!n)return;const i={isDragging:!0,draggedItem:e,dragOffset:{x:n.x-o.left,y:n.y-o.top},placeholder:{...r},originalPosition:{...r},currentMousePos:{x:n.x,y:n.y}};if(y(i),f){const e=t.currentTarget;f(w.current,r,r,{...r},t.nativeEvent,e)}"touches"in t.nativeEvent||t.preventDefault()}),[f]),M=t.useCallback((t=>{var g;if(!h.current)return;const m=ie(t);if(!m)return;const f=h.current.getBoundingClientRect(),x=m.x-f.left-v.dragOffset.x-i[0],z=m.y-f.top-v.dragOffset.y-i[1],{col:M,row:S}=q(x,z,e,r,o,s,n),P=w.current.find((e=>e.id===v.draggedItem));if(!P||P.static)return;const k={x:Math.max(0,Math.min(e-P.w,M)),y:Math.max(0,S),w:P.w,h:P.h};a&&k.y+k.h>a&&(k.y=Math.max(0,a-k.h)),d&&(k.x=Math.max(0,Math.min(e-k.w,k.x)),k.y=Math.max(0,k.y));const E=w.current.map((e=>e.id===v.draggedItem?{...e,...k}:e));if(l&&!c&&re(E,{...P,...k}).length>0)return;let I=E;if(!l&&!c){const e={...P,...k},t=v.originalPosition;I=te(E,e,0,{...P,...t})}const C=K(I,e,u);if(p(C),y((e=>({...e,placeholder:k,currentMousePos:m}))),b&&v.originalPosition){const e=null==(g=h.current)?void 0:g.querySelector(`[data-grid-id="${v.draggedItem}"]`);e&&b(C,{...P,...v.originalPosition},{...P,...k},{...P,...k},t,e)}"touches"in t&&t.preventDefault()}),[v,e,r,o,s,i,l,c,d,u,n,a,b,p,h]),S=t.useCallback((e=>{var t;const r=w.current.find((e=>e.id===v.draggedItem));if(r&&x&&v.originalPosition){const o=null==(t=h.current)?void 0:t.querySelector(`[data-grid-id="${v.draggedItem}"]`);o&&x(w.current,{...r,...v.originalPosition},r,{...r,...v.placeholder},e,o)}m(w.current),y(de)}),[v,m,x,h]);return t.useEffect((()=>{if(v.isDragging)return document.addEventListener("mousemove",M),document.addEventListener("mouseup",S),document.addEventListener("touchmove",M,ae),document.addEventListener("touchend",S,ae),document.addEventListener("touchcancel",S,ae),document.addEventListener("pointermove",M),document.addEventListener("pointerup",S),document.addEventListener("pointercancel",S),document.body.style.cursor="grabbing",document.body.style.userSelect="none",document.body.classList.add("grid-dragging"),()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",S),document.removeEventListener("touchmove",M,ae),document.removeEventListener("touchend",S,ae),document.removeEventListener("touchcancel",S,ae),document.removeEventListener("pointermove",M),document.removeEventListener("pointerup",S),document.removeEventListener("pointercancel",S),document.body.style.cursor="",document.body.style.userSelect="",document.body.classList.remove("grid-dragging")}}),[v.isDragging,v.draggedItem,v.dragOffset,M,S]),{dragState:v,handleDragStart:z}}({cols:r,rowHeight:o,gap:n,margin:i,containerPadding:s,containerWidth:T,maxRows:a,preventCollision:d,allowOverlap:u,isBounded:g,compactType:p,layout:G,setLayout:W,updateLayout:A,containerRef:N,onDragStart:M,onDrag:S,onDragStop:P}),Z=i?i[1]:n,X=G.map((e=>(e.y+e.h)*(o+Z))),F=X.length>0?Math.max(...X):0,U=f?F+2*s[1]:void 0,ee=b&&null!==O.current?O.current+2*s[1]:void 0,oe=b&&!f&&void 0!==ee?{height:ee}:void 0!==U&&void 0!==ee?{minHeight:Math.max(U,ee)}:void 0!==U?{minHeight:U}:void 0!==ee?{minHeight:ee}:{};return e.jsxs("div",{ref:N,className:J("tailwind-grid-layout relative w-full overflow-auto",V.isDragging&&"dragging select-none",B.isResizing&&"resizing",R),style:{...oe,padding:`${s[1]}px ${s[0]}px`,...j},children:[G.map((t=>{const a=V.draggedItem===t.id,d=B.resizedItem===t.id;let u=Q(t,r,o,n,T,i,s);if(a&&V.currentMousePos&&N.current){const e=N.current.getBoundingClientRect();u={...u,left:V.currentMousePos.x-e.left-V.dragOffset.x-s[0],top:V.currentMousePos.y-e.top-V.dragOffset.y-s[1]}}return d&&B.currentPixelSize&&B.currentPixelPos&&(u={left:B.currentPixelPos.x,top:B.currentPixelPos.y,width:B.currentPixelSize.w,height:B.currentPixelSize.h}),e.jsx(ne,{item:t,position:u,isDragging:a,isResizing:d,isColliding:d&&B.isColliding,isDraggable:l&&!1!==t.isDraggable&&!t.static,isResizable:c&&!1!==t.isResizable&&!t.static,resizeHandles:m,draggableCancel:h,onDragStart:Y,onResizeStart:$,children:L(t)},t.id)})),V.isDragging&&V.placeholder&&e.jsx("div",{className:"absolute rounded-lg transition-all duration-300 pointer-events-none",style:{...Q(V.placeholder,r,o,n,T,i,s),zIndex:9,background:"rgba(59, 130, 246, 0.15)",border:"2px dashed rgb(59, 130, 246)",boxSizing:"border-box"}}),B.isResizing&&B.resizedItem&&(()=>{const t=G.find((e=>e.id===B.resizedItem));return t?e.jsx("div",{className:"absolute rounded-lg transition-all duration-200 pointer-events-none",style:{...Q(t,r,o,n,T,i,s),zIndex:8,background:"rgba(59, 130, 246, 0.1)",border:"2px dashed rgb(59, 130, 246)",boxSizing:"border-box"}}):null})(),y&&w&&!V.isDragging&&(()=>{const t=y.previewX??0,a=y.previewY??0,l=y.w||2,c=y.h||2,d=y.isValidPosition??!0,u=T>0?Q({x:t,y:a,w:l,h:c},r,o,n,T,i,s):{left:s[0],top:s[1],width:0,height:0};return e.jsx("div",{className:J("absolute border-2 border-dashed rounded opacity-75 pointer-events-none flex items-center justify-center transition-all duration-150",d?"bg-green-200 border-green-400":"bg-red-200 border-red-400"),style:{width:u.width,height:u.height,left:u.left,top:u.top,transform:"translate3d(0, 0, 0)"},children:e.jsx("span",{className:J("font-medium",d?"text-green-600":"text-red-600"),children:d?"Drop here":"Invalid position"})})})()]})},ge={lg:1200,md:996,sm:768,xs:480,xxs:0},pe={lg:12,md:10,sm:6,xs:4,xxs:2};function me(e,t){var r,o,n,i;"development"===process.env.NODE_ENV&&("touches"in t?console.log(`🔥 TOUCH EVENT: ${e}`,{type:t.type,touches:t.touches.length,targetTouches:(null==(r=t.targetTouches)?void 0:r.length)||0,changedTouches:(null==(o=t.changedTouches)?void 0:o.length)||0,target:null==(n=t.target)?void 0:n.tagName,timestamp:Date.now()}):console.log(`🖱️ MOUSE EVENT: ${e}`,{type:t.type,target:null==(i=t.target)?void 0:i.tagName,timestamp:Date.now()}))}exports.DroppableGridContainer=function({onDrop:r,droppingItem:o={w:2,h:2},className:n,...i}){const[s,a]=t.useState(!1),[l,c]=t.useState(null),[d,u]=t.useState(!0),g=t.useRef(null),p=t.useCallback((e=>{var t;e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),a(!0);const r=null==(t=g.current)?void 0:t.getBoundingClientRect();if(!r)return;const n=i.containerPadding||[0,0],s=e.clientX-r.left-n[0],l=e.clientY-r.top-n[1],d=i.cols||12,p=i.rowHeight||60,m=i.gap||16,h=i.margin||[m,m],f=(r.width-2*n[0]-(d-1)*h[0])/d,b=p+h[1],x=Math.floor(s/(f+h[0])),v=Math.floor(l/b),y=Math.max(0,Math.min(x,d-(o.w||2))),w=Math.max(0,v),z={id:"preview",x:y,y:w,w:o.w||2,h:o.h||2},M=re(i.items,z),S=i.preventCollision&&M.some((e=>e.static));u(!S),c({x:y,y:w})}),[i.items,i.cols,i.rowHeight,i.gap,i.margin,i.containerPadding,i.preventCollision,o.w,o.h]),m=t.useMemo((()=>function(e,t){let r=null,o=0;return(...n)=>{const i=Date.now(),s=t-(i-o);s<=0||s>t?(r&&(clearTimeout(r),r=null),o=i,e(...n)):r||(r=setTimeout((()=>{o=Date.now(),r=null,e(...n)}),s))}}(p,16)),[p]);return e.jsxs("div",{ref:g,className:J("relative",s&&"ring-2 ring-blue-500 ring-offset-2 rounded-lg",n),onDragOver:e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),a(!0),m(e)},onDragLeave:e=>{var t;const r=null==(t=g.current)?void 0:t.getBoundingClientRect();if(r){const{clientX:t,clientY:o}=e;(t<r.left||t>r.right||o<r.top||o>r.bottom)&&(a(!1),c(null),u(!0))}},onDrop:e=>{var t;e.preventDefault(),a(!1),c(null),u(!0);const n=e.dataTransfer.getData("application/json");if(n)try{const s=JSON.parse(n),a=null==(t=g.current)?void 0:t.getBoundingClientRect();if(!a)return;const l=e.clientX-a.left,c=e.clientY-a.top,d=i.cols||12,u=i.rowHeight||60,p=i.gap||16,m=a.width/d,h=u+p,f=Math.floor(l/m),b=Math.floor(c/h),x={id:s.id||`dropped-${Date.now()}`,x:Math.max(0,Math.min(f,d-(o.w||2))),y:Math.max(0,b),w:o.w||2,h:o.h||2,...s};null==r||r(x)}catch(s){console.error("Failed to parse dropped data:",s)}},children:[e.jsx(ue,{...i,droppingItem:s&&l?{...o,previewX:l.x,previewY:l.y,isValidPosition:d}:void 0,isExternalDragging:s}),s&&e.jsx("div",{className:"absolute inset-0 bg-blue-500/10 rounded-lg pointer-events-none"})]})},exports.GridContainer=ue,exports.GridItemComponent=ne,exports.ResizeHandle=oe,exports.ResponsiveGridContainer=function({layouts:r,breakpoints:o=ge,cols:n=pe,onLayoutChange:i,onBreakpointChange:s,width:a,...l}){const[c,d]=t.useState((()=>{var e;const t=a??window.innerWidth,r=Object.entries(o).sort(((e,t)=>t[1]-e[1]));for(const[o,n]of r)if(t>=n)return o;return(null==(e=r[r.length-1])?void 0:e[0])||"lg"})),[u,g]=t.useState((()=>("object"==typeof n?n[c]:void 0)||pe[c]||12)),p=t.useMemo((()=>Object.entries(o).sort(((e,t)=>t[1]-e[1]))),[o]),m=t.useMemo((()=>e=>{if(0===p.length)return"lg";let t=p[p.length-1][0];for(const[r,o]of p)if(e>=o){t=r;break}return t}),[p]),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]||pe[t]||12;g(e),null==s||s(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,p,s,a,m]),t.useEffect((()=>{s&&s(c,u)}),[]);const f=r[c]||[];return e.jsx(ue,{...l,items:f,cols:u,onLayoutChange:e=>{const t={...r,[c]:e};null==i||i(e,t)}})},exports.WidthProvider=function(r){return function(o){const{measureBeforeMount:n=!1,...i}=o,[s,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===s?e.jsx("div",{ref:l,style:{width:"100%"}}):e.jsx("div",{ref:l,style:{width:"100%"},children:e.jsx(r,{...i,width:s})})}},exports.calculateGridPosition=q,exports.checkCollision=_,exports.cn=J,exports.compactLayout=K,exports.enableTouchDebugging=function(){document.addEventListener("touchstart",(e=>me("touchstart",e)),{passive:!1}),document.addEventListener("touchmove",(e=>me("touchmove",e)),{passive:!1}),document.addEventListener("touchend",(e=>me("touchend",e)),{passive:!1}),document.addEventListener("mousedown",(e=>me("mousedown",e))),document.addEventListener("mousemove",(e=>me("mousemove",e))),document.addEventListener("mouseup",(e=>me("mouseup",e))),"development"===process.env.NODE_ENV&&console.log("🚀 Touch debugging enabled")},exports.findFreeSpace=function(e,t,r,o){const n=o?e.filter((e=>e.id!==o)):e;if(!n.some((e=>_(t,e))))return t;let i=t.y;for(;;){for(let e=0;e<=r-t.w;e++){const r={...t,x:e,y:i};if(!n.some((e=>_(r,e))))return r}i++}},exports.generateLayouts=function(e,t=["lg","md","sm","xs","xxs"]){return t.reduce(((t,r)=>(t[r]=e.map((e=>({...e}))),t)),{})},exports.generateResponsiveLayouts=function(e,t={lg:12,md:10,sm:6,xs:4,xxs:2}){const r={};return Object.entries(t).forEach((([t,o])=>{r[t]=e.map((e=>{const t=Math.min(e.w,o),r=e.x+t>o?o-t:e.x;return{...e,w:t,x:r}}))})),r},exports.getAllCollisions=re,exports.getControlPosition=ie,exports.getPixelPosition=Q,exports.getTouchIdentifier=se,exports.isPrimaryTouch=function(e){var t;return 1===e.touches.length||e.touches.length>1&&(null==(t=e.touches[0])?void 0:t.identifier)===se(e)},exports.moveItems=te,exports.preventDefaultTouchEvent=le,exports.shouldSwapItems=ee,exports.touchEventOptions=ae;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react");function r(e){var t,o,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(o=r(e[t]))&&(n&&(n+=" "),n+=o)}else for(o in e)e[o]&&(n&&(n+=" "),n+=o);return n}const o=e=>{const t=a(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),n(r,t)||s(e)},getConflictingClassGroupIds:(e,t)=>{const n=r[e]||[];return t&&o[e]?[...n,...o[e]]:n}}},n=(e,t)=>{var r;if(0===e.length)return t.classGroupId;const o=e[0],i=t.nextPart.get(o),s=i?n(e.slice(1),i):void 0;if(s)return s;if(0===t.validators.length)return;const a=e.join("-");return null==(r=t.validators.find(({validator:e})=>e(a)))?void 0:r.classGroupId},i=/^\[(.+)\]$/,s=e=>{if(i.test(e)){const t=i.exec(e)[1],r=null==t?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},a=e=>{const{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return u(Object.entries(e.classGroups),r).forEach(([e,r])=>{l(r,o,e,t)}),o},l=(e,t,r,o)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:c(t,e)).classGroupId=r)}if("function"==typeof e)return d(e)?void l(e(o),t,r,o):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,n])=>{l(n,c(t,e),r,o)})})},c=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},d=e=>e.isThemeGetter,u=(e,t)=>t?e.map(([e,r])=>[e,r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e)]):e,g=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const n=(n,i)=>{r.set(n,i),t++,t>e&&(t=0,o=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=o.get(e))?(n(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):n(e,t)}}},p=e=>{const{separator:t,experimentalParseClassName:r}=e,o=1===t.length,n=t[0],i=t.length,s=e=>{const r=[];let s,a=0,l=0;for(let u=0;u<e.length;u++){let c=e[u];if(0===a){if(c===n&&(o||e.slice(u,u+i)===t)){r.push(e.slice(l,u)),l=u+i;continue}if("/"===c){s=u;continue}}"["===c?a++:"]"===c&&a--}const c=0===r.length?e:e.substring(l),d=c.startsWith("!");return{modifiers:r,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:s&&s>l?s-l:void 0}};return r?e=>r({className:e,parseClassName:s}):s},m=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},h=/\s+/;function f(){let e,t,r=0,o="";for(;r<arguments.length;)(e=arguments[r++])&&(t=b(e))&&(o&&(o+=" "),o+=t);return o}const b=e=>{if("string"==typeof e)return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=b(e[o]))&&(r&&(r+=" "),r+=t);return r};function x(e,...t){let r,n,i,s=function(l){const c=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:g(e.cacheSize),parseClassName:p(e),...o(e)}))(c),n=r.cache.get,i=r.cache.set,s=a,a(l)};function a(e){const t=n(e);if(t)return t;const o=((e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n}=t,i=[],s=e.trim().split(h);let a="";for(let l=s.length-1;l>=0;l-=1){const e=s[l],{modifiers:t,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:u}=r(e);let g=Boolean(u),p=o(g?d.substring(0,u):d);if(!p){if(!g){a=e+(a.length>0?" "+a:a);continue}if(p=o(d),!p){a=e+(a.length>0?" "+a:a);continue}g=!1}const h=m(t).join(":"),f=c?h+"!":h,b=f+p;if(i.includes(b))continue;i.push(b);const x=n(p,g);for(let r=0;r<x.length;++r){const e=x[r];i.push(f+e)}a=e+(a.length>0?" "+a:a)}return a})(e,r);return i(e,o),o}return function(){return s(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)$/,S=/\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$/,P=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,k=/^(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),C=e=>V(e,"length",Y),D=e=>Boolean(e)&&!Number.isNaN(Number(e)),L=e=>V(e,"number",D),R=e=>Boolean(e)&&Number.isInteger(Number(e)),j=e=>e.endsWith("%")&&D(e.slice(0,-1)),N=e=>y.test(e),T=e=>M.test(e),H=new Set(["length","size","percentage"]),G=e=>V(e,H,Z),W=e=>V(e,"position",Z),O=new Set(["image","url"]),A=e=>V(e,O,F),B=e=>V(e,"",X),$=()=>!0,V=(e,t,r)=>{const o=y.exec(e);return!!o&&(o[1]?"string"==typeof t?o[1]===t:t.has(o[1]):r(o[2]))},Y=e=>S.test(e)&&!P.test(e),Z=()=>!1,X=e=>k.test(e),F=e=>E.test(e),U=x(()=>{const e=v("colors"),t=v("spacing"),r=v("blur"),o=v("brightness"),n=v("borderColor"),i=v("borderRadius"),s=v("borderSpacing"),a=v("borderWidth"),l=v("contrast"),c=v("grayscale"),d=v("hueRotate"),u=v("invert"),g=v("gap"),p=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"),S=v("space"),P=v("translate"),k=()=>["auto",N,t],E=()=>[N,t],H=()=>["",I,C],O=()=>["auto",D,N],V=()=>["","0",N],Y=()=>[D,N];return{cacheSize:500,separator:":",theme:{colors:[$],spacing:[I,C],blur:["none","",T,N],brightness:Y(),borderColor:[e],borderRadius:["none","","full",T,N],borderSpacing:E(),borderWidth:H(),contrast:Y(),grayscale:V(),hueRotate:Y(),invert:V(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[j,C],inset:k(),margin:k(),opacity:Y(),padding:E(),saturate:Y(),scale:Y(),sepia:V(),skew:Y(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],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",N]}],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",R,N]}],basis:[{basis:k()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",R,N]}],"grid-cols":[{"grid-cols":[$]}],"col-start-end":[{col:["auto",{span:["full",R,N]},N]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[$]}],"row-start-end":[{row:["auto",{span:[R,N]},N]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"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":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[T]},T]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",T,C]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",L]}],"font-family":[{font:[$]}],"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",N]}],"line-clamp":[{"line-clamp":["none",D,L]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",I,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"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,C]}],"underline-offset":[{"underline-offset":["auto",I,N]}],"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",N]}],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",N]}],"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",W]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",G]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},A]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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,N]}],"outline-w":[{outline:[I,C]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[I,C]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",T,B]}],"shadow-color":[{shadow:[$]}],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:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",T,N]}],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":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"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":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[R,N]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"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",N]}],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",N]}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[I,C,L]}],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 J(...e){return U(function(){for(var e,t,o=0,n="",i=arguments.length;o<i;o++)(e=arguments[o])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}(e))}function q(e,t,r,o,n,i,s){const a=e/(i/r),l=t/(o+(s?s[1]:n)),c=Math.floor(a+.3),d=Math.floor(l+.3);return{col:Math.max(0,c),row:Math.max(0,d)}}function Q(e,t,r,o,n,i,s){const a=i?i[0]:o,l=i?i[1]:o,c=s?s[0]:0,d=s?s[1]:0,u=(n-2*c-(t-1)*a)/t,g=c+e.x*(u+a),p=e.w*u+(e.w-1)*a;return{left:Math.round(g),top:d+e.y*(r+l),width:Math.round(p),height:e.h*r+(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,r="vertical"){if(!r)return e;const o=e.filter(e=>e.static),n=[...e.filter(e=>!e.static)].sort((e,t)=>"horizontal"===r?e.x===t.x?e.y-t.y:e.x-t.x:e.y===t.y?e.x-t.x:e.y-t.y),i=[...o];return n.forEach(e=>{if("vertical"===r){let t=0,r=!1;for(let o=0;!r;o++){const n={...e,y:o,x:e.x};i.some(e=>_(n,e))||(t=o,r=!0)}i.push({...e,y:t})}else if("horizontal"===r){let r=0,o=!1;for(let n=0;n<=t-e.w&&!o;n++){const t={...e,x:n,y:e.y};i.some(e=>_(t,e))||(r=n,o=!0)}i.push({...e,x:r})}}),i}function ee(e,t,r){const o=e.x+e.w/2,n=e.y+e.h/2,i=t.x+t.w/2,s=t.y+t.h/2,a=e.y>r.y,l=e.y<r.y,c=e.x>r.x,d=e.x<r.x;return!!(a&&n>s)||(!!(l&&n<s)||(!!(c&&o>i)||!!(d&&o<i)))}function te(e,t,r,o){if(!o)return e;const n=[...e],i=n.findIndex(e=>e.id===t.id);-1!==i&&(n[i]={...t});const s=n.filter(e=>e.id!==t.id&&!e.static&&_(t,e)),a=t.y<o.y,l=t.y>o.y;for(const c of s){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,o)&&(n[e]={...c,x:o.x,y:o.y}))}return n}function re(e,t){return e.filter(e=>e.id!==t.id&&_(e,t))}const oe=({position:t,onMouseDown:r,isActive:o=!0,isVisible:n=!0})=>{const i=e=>{e.stopPropagation(),r(e)},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 r=s[t];return e.jsx("span",{"data-testid":`resize-handle-${t}`,className:J("react-grid-layout__resize-handle","absolute w-5 h-5",o?r.cursor:"cursor-not-allowed opacity-50","z-50","touch-action-none"),onMouseDown:o?i:void 0,onTouchStart:o?i:void 0,onDoubleClick:e=>e.preventDefault(),style:{..."se"===t&&{bottom:"0px",right:"0px",cursor:"se-resize"},..."sw"===t&&{bottom:"0px",left:"0px",cursor:"sw-resize"},..."ne"===t&&{top:"0px",right:"0px",cursor:"ne-resize"},..."nw"===t&&{top:"0px",left:"0px",cursor:"nw-resize"},backgroundImage:'url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=")',backgroundPosition:"bottom right",backgroundRepeat:"no-repeat",backgroundOrigin:"content-box",boxSizing:"border-box",transform:r.transform,padding:"3px"}})}const a={n:"top-0 left-1/2 -translate-x-1/2 w-16 h-4 cursor-n-resize",s:"bottom-0 left-1/2 -translate-x-1/2 w-16 h-4 cursor-s-resize",e:"right-0 top-1/2 -translate-y-1/2 w-4 h-16 cursor-e-resize",w:"left-0 top-1/2 -translate-y-1/2 w-4 h-16 cursor-w-resize"},l={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize"};return a[t]?e.jsx("div",{"data-testid":`resize-handle-${t}`,className:J("absolute",a[t],!o&&"pointer-events-none","z-20","touch-action-none"),style:{cursor:o?l[t]:"not-allowed"},onMouseDown:o?i:void 0,onTouchStart:o?i:void 0,onDoubleClick:e=>e.preventDefault()}):null},ne=({item:t,position:r,isDragging:o,isResizing:n,isColliding:i=!1,isDraggable:s,isResizable:a,resizeHandles:l=["se"],draggableCancel:c,onDragStart:d,onResizeStart:u,children:g})=>{const p=e=>{if(t.static)return;const r=e.target,o=r.closest(".grid-drag-handle"),n=r.closest(".grid-actions, button, a");if(r.closest(".react-grid-layout__resize-handle")||r.closest('[data-testid^="resize-handle-"]'))return;const i=c&&r.closest(c);!s||!o&&r.closest(".grid-drag-handle")||n||i||("touches"in e&&e.preventDefault(),d(t.id,e))};return e.jsxs("div",{"data-grid-id":t.id,className:J("absolute isolate",!o&&"transition-all duration-200",o&&"opacity-80 z-50 cursor-grabbing shadow-2xl",n&&"z-40",i&&"ring-1 ring-gray-400 shadow-inner",!o&&!n&&"hover:z-30",!o&&(t.static?"cursor-not-allowed":s?"cursor-grab":"cursor-default"),t.className),style:{left:`${r.left}px`,top:`${r.top}px`,width:`${r.width}px`,height:`${r.height}px`,transform:o?"scale(1.02)":"scale(1)"},onMouseDown:p,onTouchStart:e=>{p(e),e.stopPropagation()},onDoubleClick:e=>e.preventDefault(),children:[e.jsx("div",{className:"relative z-0 h-full w-full",children:g}),a&&e.jsx(e.Fragment,{children:l.map(r=>e.jsx(oe,{position:r,onMouseDown:e=>u(t.id,r,e),isActive:!0,isVisible:["se","sw","ne","nw"].includes(r)},r))})]})};function ie(e){if("pointerId"in e){const t=e;return{x:t.clientX,y:t.clientY}}if("touches"in e){const t=e,r=t.touches[0]||t.changedTouches[0];return r?{x:r.clientX,y:r.clientY}:null}return{x:e.clientX,y:e.clientY}}function se(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={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}};const de={isDragging:!1,draggedItem:null,dragOffset:{x:0,y:0},placeholder:null,originalPosition:null,currentMousePos:void 0};const ue=({cols:r=12,rowHeight:o=60,gap:n=16,margin:i,containerPadding:s=[16,16],maxRows:a,isDraggable:l=!0,isResizable:c=!0,preventCollision:d=!1,allowOverlap:u=!1,isBounded:g=!0,compactType:p="vertical",resizeHandles:m=["se"],draggableCancel:h,autoSize:f=!0,preserveInitialHeight:b=!1,verticalCompact:x=!0,transformScale:v=1,droppingItem:y,isExternalDragging:w=!1,onLayoutChange:z,onDragStart:M,onDrag:S,onDragStop:P,onResizeStart:k,onResize:E,onResizeStop:I,onDrop:C,items:D,children:L,className:R,style:j})=>{const N=t.useRef(null),[T,H]=t.useState(0),[G,W]=t.useState(D),O=t.useRef(null);if(b&&null===O.current){const e=i?i[1]:n,t=D.map(t=>(t.y+t.h)*(o+e));O.current=t.length>0?Math.max(...t):0}t.useEffect(()=>{W(e=>{const t=new Set(e.map(e=>e.id)),o=new Set(D.map(e=>e.id)),n=D.some(e=>!t.has(e.id)),i=e.some(e=>!o.has(e.id));if(n||i){const t=new Map(e.map(e=>[e.id,e]));return K(D.map(e=>{const r=t.get(e.id);return r?{...e,x:r.x,y:r.y,w:r.w,h:r.h}:e}),r,p)}return D})},[D,r,p]),t.useEffect(()=>{const e=()=>{N.current&&H(N.current.offsetWidth)};if(e(),"undefined"!=typeof ResizeObserver&&N.current){const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[s]);const A=t.useCallback(e=>{const t=K(e,r,p);W(t),null==z||z(t)},[r,p,z]),{resizeState:B,handleResizeStart:$}=function({cols:e,rowHeight:r,gap:o,margin:n,containerPadding:i,containerWidth:s,layout:a,setLayout:l,updateLayout:c,containerRef:d,onResizeStart:u,onResize:g,onResizeStop:p}){const[m,h]=t.useState(ce),f=t.useRef(a);f.current=a;const b=t.useCallback(()=>{const t=n?n[0]:o,a=n?n[1]:o,l=(s-2*i[0]-t*(e-1))/e;return{horizontalMargin:t,verticalMargin:a,colWidth:l,gridUnitW:l+t,gridUnitH:r+a}},[e,r,o,n,i,s]),x=t.useCallback((e,t,o)=>{const n=f.current.find(t=>t.id===e),i=ie(o.nativeEvent);if(!i)return;const{horizontalMargin:s,verticalMargin:a,colWidth:l,gridUnitW:c,gridUnitH:d}=b();if(h({isResizing:!0,resizedItem:e,resizeHandle:t,startSize:{w:n.w,h:n.h},startPos:{x:i.x,y:i.y},originalPos:{x:n.x,y:n.y},currentPixelSize:{w:n.w*l+(n.w-1)*s,h:n.h*r+(n.h-1)*a},currentPixelPos:{x:n.x*c,y:n.y*d}}),u){const e=o.currentTarget;u(f.current,n,n,{...n},o.nativeEvent,e)}o.preventDefault(),o.stopPropagation(),"touches"in o.nativeEvent&&le(o.nativeEvent)},[b,u,r]),v=t.useCallback(t=>{var o,n,i,s,a,c,u,p,x;const v=f.current.find(e=>e.id===m.resizedItem);if(!v)return;const y=ie(t);if(!y)return;const{horizontalMargin:w,verticalMargin:z,colWidth:M,gridUnitW:S,gridUnitH:P}=b(),k=(y.x-m.startPos.x)/S,E=(y.y-m.startPos.y)/P;let I=m.startSize.w,C=m.startSize.h,D=(null==(o=m.originalPos)?void 0:o.x)??v.x,L=(null==(n=m.originalPos)?void 0:n.y)??v.y;switch(m.resizeHandle){case"se":I=Math.max(1,Math.round(m.startSize.w+k)),C=Math.max(1,Math.round(m.startSize.h+E));break;case"sw":{const e=Math.round(k),t=m.startSize.w-1,r=Math.min(e,t);D=Math.max(0,((null==(i=m.originalPos)?void 0:i.x)??v.x)+r),I=Math.max(1,m.startSize.w-r),C=Math.max(1,Math.round(m.startSize.h+E));break}case"ne":{const e=Math.round(E),t=m.startSize.h-1,r=Math.min(e,t);L=Math.max(0,((null==(s=m.originalPos)?void 0:s.y)??v.y)+r),I=Math.max(1,Math.round(m.startSize.w+k)),C=Math.max(1,m.startSize.h-r);break}case"nw":{const e=Math.round(k),t=Math.round(E),r=m.startSize.w-1,o=m.startSize.h-1,n=Math.min(e,r),i=Math.min(t,o);D=Math.max(0,((null==(a=m.originalPos)?void 0:a.x)??v.x)+n),L=Math.max(0,((null==(c=m.originalPos)?void 0:c.y)??v.y)+i),I=Math.max(1,m.startSize.w-n),C=Math.max(1,m.startSize.h-i);break}case"e":I=Math.max(1,Math.round(m.startSize.w+k));break;case"w":{const e=Math.round(k),t=m.startSize.w-1,r=Math.min(e,t);D=Math.max(0,((null==(u=m.originalPos)?void 0:u.x)??v.x)+r),I=Math.max(1,m.startSize.w-r);break}case"s":C=Math.max(1,Math.round(m.startSize.h+E));break;case"n":{const e=Math.round(E),t=m.startSize.h-1,r=Math.min(e,t);L=Math.max(0,((null==(p=m.originalPos)?void 0:p.y)??v.y)+r),C=Math.max(1,m.startSize.h-r);break}}D=Math.max(0,Math.min(e-I,D)),I=Math.min(I,e-D);const R=Math.min(Math.max(v.minW||1,I),v.maxW||1/0),j=Math.max(v.minH||1,Math.min(C,v.maxH||1/0)),N=Math.max(0,Math.min(e-R,D)),T=Math.max(0,L),H=f.current.filter(e=>e.static&&e.id!==v.id);let G=N,W=T,O=R,A=j,B=!1;for(const e of H){const t={...v,x:N,y:T,w:R,h:j};if(_(t,e))switch(B=!0,m.resizeHandle){case"se":t.x<e.x&&(O=Math.min(O,e.x-t.x)),t.y<e.y&&(A=Math.min(A,e.y-t.y));break;case"nw":if(e.x+e.w<=m.originalPos.x+m.startSize.w){const t=m.originalPos.x-(e.x+e.w);m.originalPos.x-N>t&&(G=e.x+e.w,O=m.originalPos.x+m.startSize.w-G)}if(e.y+e.h<=m.originalPos.y+m.startSize.h){const t=m.originalPos.y-(e.y+e.h);m.originalPos.y-T>t&&(W=e.y+e.h,A=m.originalPos.y+m.startSize.h-W)}break;case"sw":if(e.x+e.w<=m.originalPos.x+m.startSize.w){const t=m.originalPos.x-(e.x+e.w);m.originalPos.x-N>t&&(G=e.x+e.w,O=m.originalPos.x+m.startSize.w-G)}t.y<e.y&&(A=Math.min(A,e.y-t.y));break;case"ne":if(t.x<e.x&&(O=Math.min(O,e.x-t.x)),e.y+e.h<=m.originalPos.y+m.startSize.h){const t=m.originalPos.y-(e.y+e.h);m.originalPos.y-T>t&&(W=e.y+e.h,A=m.originalPos.y+m.startSize.h-W)}break;case"w":if(e.x+e.w<=m.originalPos.x+m.startSize.w){const t=m.originalPos.x-(e.x+e.w);m.originalPos.x-N>t&&(G=e.x+e.w,O=m.originalPos.x+m.startSize.w-G)}break;case"e":t.x<e.x&&(O=Math.min(O,e.x-t.x));break;case"n":if(e.y+e.h<=m.originalPos.y+m.startSize.h){const t=m.originalPos.y-(e.y+e.h);m.originalPos.y-T>t&&(W=e.y+e.h,A=m.originalPos.y+m.startSize.h-W)}break;case"s":t.y<e.y&&(A=Math.min(A,e.y-t.y))}}h(e=>({...e,isColliding:B}));const $=f.current.map(e=>e.id===m.resizedItem?{...e,x:G,y:W,w:O,h:A}:e);l($);const V=G*S,Y=W*P,Z=O*M+(O-1)*w,X=A*r+(A-1)*z;if(h(e=>({...e,currentPixelSize:{w:Z,h:X},currentPixelPos:{x:V,y:Y}})),g&&m.originalPos){const e=null==(x=d.current)?void 0:x.querySelector(`[data-grid-id="${m.resizedItem}"]`);if(e){const r={...v,x:m.originalPos.x,y:m.originalPos.y,w:m.startSize.w,h:m.startSize.h},o={...v,x:G,y:W,w:O,h:A};g($,r,o,o,t,e)}}"touches"in t&&t.preventDefault()},[m,e,r,b,l,g,d]),y=t.useCallback(e=>{var t;const r=f.current.find(e=>e.id===m.resizedItem);if(r&&p&&m.originalPos){const o=null==(t=d.current)?void 0:t.querySelector(`[data-grid-id="${m.resizedItem}"]`);if(o){const t={...r,x:m.originalPos.x,y:m.originalPos.y,w:m.startSize.w,h:m.startSize.h};p(f.current,t,r,r,e,o)}}c(f.current),h(ce)},[m,c,p,d]);return t.useEffect(()=>{if(m.isResizing)return document.addEventListener("mousemove",v),document.addEventListener("mouseup",y),document.addEventListener("touchmove",v,ae),document.addEventListener("touchend",y,ae),document.addEventListener("touchcancel",y,ae),document.addEventListener("pointermove",v),document.addEventListener("pointerup",y),document.addEventListener("pointercancel",y),document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",y),document.removeEventListener("touchmove",v,ae),document.removeEventListener("touchend",y,ae),document.removeEventListener("touchcancel",y,ae),document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",y),document.removeEventListener("pointercancel",y),document.body.style.userSelect=""}},[m.isResizing,v,y]),{resizeState:m,handleResizeStart:x}}({cols:r,rowHeight:o,gap:n,margin:i,containerPadding:s,containerWidth:T,layout:G,setLayout:W,updateLayout:A,containerRef:N,onResizeStart:k,onResize:E,onResizeStop:I}),{dragState:V,handleDragStart:Y}=function({cols:e,rowHeight:r,gap:o,margin:n,containerPadding:i,containerWidth:s,maxRows:a,preventCollision:l,allowOverlap:c,isBounded:d,compactType:u,layout:g,setLayout:p,updateLayout:m,containerRef:h,onDragStart:f,onDrag:b,onDragStop:x}){const[v,y]=t.useState(de),w=t.useRef(g);w.current=g;const z=t.useCallback((e,t)=>{const r=w.current.find(t=>t.id===e),o=t.currentTarget.getBoundingClientRect(),n=ie(t.nativeEvent);if(!n)return;const i={isDragging:!0,draggedItem:e,dragOffset:{x:n.x-o.left,y:n.y-o.top},placeholder:{...r},originalPosition:{...r},currentMousePos:{x:n.x,y:n.y}};if(y(i),f){const e=t.currentTarget;f(w.current,r,r,{...r},t.nativeEvent,e)}"touches"in t.nativeEvent||t.preventDefault()},[f]),M=t.useCallback(t=>{var g;if(!h.current)return;const m=ie(t);if(!m)return;const f=h.current.getBoundingClientRect(),x=m.x-f.left-v.dragOffset.x-i[0],z=m.y-f.top-v.dragOffset.y-i[1],{col:M,row:S}=q(x,z,e,r,o,s,n),P=w.current.find(e=>e.id===v.draggedItem);if(!P||P.static)return;const k={x:Math.max(0,Math.min(e-P.w,M)),y:Math.max(0,S),w:P.w,h:P.h};a&&k.y+k.h>a&&(k.y=Math.max(0,a-k.h)),d&&(k.x=Math.max(0,Math.min(e-k.w,k.x)),k.y=Math.max(0,k.y));const E=w.current.map(e=>e.id===v.draggedItem?{...e,...k}:e);if(l&&!c&&re(E,{...P,...k}).length>0)return;let I=E;if(!l&&!c){const e={...P,...k},t=v.originalPosition;I=te(E,e,0,{...P,...t})}const C=K(I,e,u);if(p(C),y(e=>({...e,placeholder:k,currentMousePos:m})),b&&v.originalPosition){const e=null==(g=h.current)?void 0:g.querySelector(`[data-grid-id="${v.draggedItem}"]`);e&&b(C,{...P,...v.originalPosition},{...P,...k},{...P,...k},t,e)}"touches"in t&&t.preventDefault()},[v,e,r,o,s,i,l,c,d,u,n,a,b,p,h]),S=t.useCallback(e=>{var t;const r=w.current.find(e=>e.id===v.draggedItem);if(r&&x&&v.originalPosition){const o=null==(t=h.current)?void 0:t.querySelector(`[data-grid-id="${v.draggedItem}"]`);o&&x(w.current,{...r,...v.originalPosition},r,{...r,...v.placeholder},e,o)}m(w.current),y(de)},[v,m,x,h]);return t.useEffect(()=>{if(v.isDragging)return document.addEventListener("mousemove",M),document.addEventListener("mouseup",S),document.addEventListener("touchmove",M,ae),document.addEventListener("touchend",S,ae),document.addEventListener("touchcancel",S,ae),document.addEventListener("pointermove",M),document.addEventListener("pointerup",S),document.addEventListener("pointercancel",S),document.body.style.cursor="grabbing",document.body.style.userSelect="none",document.body.classList.add("grid-dragging"),()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",S),document.removeEventListener("touchmove",M,ae),document.removeEventListener("touchend",S,ae),document.removeEventListener("touchcancel",S,ae),document.removeEventListener("pointermove",M),document.removeEventListener("pointerup",S),document.removeEventListener("pointercancel",S),document.body.style.cursor="",document.body.style.userSelect="",document.body.classList.remove("grid-dragging")}},[v.isDragging,v.draggedItem,v.dragOffset,M,S]),{dragState:v,handleDragStart:z}}({cols:r,rowHeight:o,gap:n,margin:i,containerPadding:s,containerWidth:T,maxRows:a,preventCollision:d,allowOverlap:u,isBounded:g,compactType:p,layout:G,setLayout:W,updateLayout:A,containerRef:N,onDragStart:M,onDrag:S,onDragStop:P}),Z=i?i[1]:n,X=G.map(e=>(e.y+e.h)*(o+Z)),F=X.length>0?Math.max(...X):0,U=f?F+2*s[1]:void 0,ee=b&&null!==O.current?O.current+2*s[1]:void 0,oe=b&&!f&&void 0!==ee?{height:ee}:void 0!==U&&void 0!==ee?{minHeight:Math.max(U,ee)}:void 0!==U?{minHeight:U}:void 0!==ee?{minHeight:ee}:{};return e.jsxs("div",{ref:N,className:J("tailwind-grid-layout relative w-full overflow-auto",V.isDragging&&"dragging select-none",B.isResizing&&"resizing",R),style:{...oe,padding:`${s[1]}px ${s[0]}px`,...j},children:[G.map(t=>{const a=V.draggedItem===t.id,d=B.resizedItem===t.id;let u=Q(t,r,o,n,T,i,s);if(a&&V.currentMousePos&&N.current){const e=N.current.getBoundingClientRect();u={...u,left:V.currentMousePos.x-e.left-V.dragOffset.x-s[0],top:V.currentMousePos.y-e.top-V.dragOffset.y-s[1]}}return d&&B.currentPixelSize&&B.currentPixelPos&&(u={left:B.currentPixelPos.x,top:B.currentPixelPos.y,width:B.currentPixelSize.w,height:B.currentPixelSize.h}),e.jsx(ne,{item:t,position:u,isDragging:a,isResizing:d,isColliding:d&&B.isColliding,isDraggable:l&&!1!==t.isDraggable&&!t.static,isResizable:c&&!1!==t.isResizable&&!t.static,resizeHandles:m,draggableCancel:h,onDragStart:Y,onResizeStart:$,children:L(t)},t.id)}),V.isDragging&&V.placeholder&&e.jsx("div",{className:"absolute rounded-lg transition-all duration-300 pointer-events-none",style:{...Q(V.placeholder,r,o,n,T,i,s),zIndex:9,background:"rgba(59, 130, 246, 0.15)",border:"2px dashed rgb(59, 130, 246)",boxSizing:"border-box"}}),B.isResizing&&B.resizedItem&&(()=>{const t=G.find(e=>e.id===B.resizedItem);return t?e.jsx("div",{className:"absolute rounded-lg transition-all duration-200 pointer-events-none",style:{...Q(t,r,o,n,T,i,s),zIndex:8,background:"rgba(59, 130, 246, 0.1)",border:"2px dashed rgb(59, 130, 246)",boxSizing:"border-box"}}):null})(),y&&w&&!V.isDragging&&(()=>{const t=y.previewX??0,a=y.previewY??0,l=y.w||2,c=y.h||2,d=y.isValidPosition??!0,u=T>0?Q({x:t,y:a,w:l,h:c},r,o,n,T,i,s):{left:s[0],top:s[1],width:0,height:0};return e.jsx("div",{className:J("absolute border-2 border-dashed rounded opacity-75 pointer-events-none flex items-center justify-center transition-all duration-150",d?"bg-green-200 border-green-400":"bg-red-200 border-red-400"),style:{width:u.width,height:u.height,left:u.left,top:u.top,transform:"translate3d(0, 0, 0)"},children:e.jsx("span",{className:J("font-medium",d?"text-green-600":"text-red-600"),children:d?"Drop here":"Invalid position"})})})()]})},ge={lg:1200,md:996,sm:768,xs:480,xxs:0},pe={lg:12,md:10,sm:6,xs:4,xxs:2};function me(e,t){var r,o,n,i;"development"===process.env.NODE_ENV&&("touches"in t?console.log(`🔥 TOUCH EVENT: ${e}`,{type:t.type,touches:t.touches.length,targetTouches:(null==(r=t.targetTouches)?void 0:r.length)||0,changedTouches:(null==(o=t.changedTouches)?void 0:o.length)||0,target:null==(n=t.target)?void 0:n.tagName,timestamp:Date.now()}):console.log(`🖱️ MOUSE EVENT: ${e}`,{type:t.type,target:null==(i=t.target)?void 0:i.tagName,timestamp:Date.now()}))}exports.DroppableGridContainer=function({onDrop:r,droppingItem:o={w:2,h:2},className:n,...i}){const[s,a]=t.useState(!1),[l,c]=t.useState(null),[d,u]=t.useState(!0),g=t.useRef(null),p=t.useCallback(e=>{var t;e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),a(!0);const r=null==(t=g.current)?void 0:t.getBoundingClientRect();if(!r)return;const n=i.containerPadding||[0,0],s=e.clientX-r.left-n[0],l=e.clientY-r.top-n[1],d=i.cols||12,p=i.rowHeight||60,m=i.gap||16,h=i.margin||[m,m],f=(r.width-2*n[0]-(d-1)*h[0])/d,b=p+h[1],x=Math.floor(s/(f+h[0])),v=Math.floor(l/b),y=Math.max(0,Math.min(x,d-(o.w||2))),w=Math.max(0,v),z={id:"preview",x:y,y:w,w:o.w||2,h:o.h||2},M=re(i.items,z),S=i.preventCollision&&M.some(e=>e.static);u(!S),c({x:y,y:w})},[i.items,i.cols,i.rowHeight,i.gap,i.margin,i.containerPadding,i.preventCollision,o.w,o.h]),m=t.useMemo(()=>function(e,t){let r=null,o=0;return(...n)=>{const i=Date.now(),s=t-(i-o);s<=0||s>t?(r&&(clearTimeout(r),r=null),o=i,e(...n)):r||(r=setTimeout(()=>{o=Date.now(),r=null,e(...n)},s))}}(p,16),[p]);return e.jsxs("div",{ref:g,className:J("relative",s&&"ring-2 ring-blue-500 ring-offset-2 rounded-lg",n),onDragOver:e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),a(!0),m(e)},onDragLeave:e=>{var t;const r=null==(t=g.current)?void 0:t.getBoundingClientRect();if(r){const{clientX:t,clientY:o}=e;(t<r.left||t>r.right||o<r.top||o>r.bottom)&&(a(!1),c(null),u(!0))}},onDrop:e=>{var t;e.preventDefault(),a(!1),c(null),u(!0);const n=e.dataTransfer.getData("application/json");if(n)try{const s=JSON.parse(n),a=null==(t=g.current)?void 0:t.getBoundingClientRect();if(!a)return;const l=e.clientX-a.left,c=e.clientY-a.top,d=i.cols||12,u=i.rowHeight||60,p=i.gap||16,m=a.width/d,h=u+p,f=Math.floor(l/m),b=Math.floor(c/h),x={id:s.id||`dropped-${Date.now()}`,x:Math.max(0,Math.min(f,d-(o.w||2))),y:Math.max(0,b),w:o.w||2,h:o.h||2,...s};null==r||r(x)}catch(s){console.error("Failed to parse dropped data:",s)}},children:[e.jsx(ue,{...i,droppingItem:s&&l?{...o,previewX:l.x,previewY:l.y,isValidPosition:d}:void 0,isExternalDragging:s}),s&&e.jsx("div",{className:"absolute inset-0 bg-blue-500/10 rounded-lg pointer-events-none"})]})},exports.GridContainer=ue,exports.GridItemComponent=ne,exports.ResizeHandle=oe,exports.ResponsiveGridContainer=function({layouts:r,breakpoints:o=ge,cols:n=pe,onLayoutChange:i,onBreakpointChange:s,width:a,...l}){const[c,d]=t.useState(()=>{var e;const t=a??window.innerWidth,r=Object.entries(o).sort((e,t)=>t[1]-e[1]);for(const[o,n]of r)if(t>=n)return o;return(null==(e=r[r.length-1])?void 0:e[0])||"lg"}),[u,g]=t.useState(()=>("object"==typeof n?n[c]:void 0)||pe[c]||12),p=t.useMemo(()=>Object.entries(o).sort((e,t)=>t[1]-e[1]),[o]),m=t.useMemo(()=>e=>{if(0===p.length)return"lg";let t=p[p.length-1][0];for(const[r,o]of p)if(e>=o){t=r;break}return t},[p]),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]||pe[t]||12;g(e),null==s||s(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,p,s,a,m]),t.useEffect(()=>{s&&s(c,u)},[]);const f=r[c]||[];return e.jsx(ue,{...l,items:f,cols:u,onLayoutChange:e=>{const t={...r,[c]:e};null==i||i(e,t)}})},exports.WidthProvider=function(r){return function(o){const{measureBeforeMount:n=!1,...i}=o,[s,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===s?e.jsx("div",{ref:l,style:{width:"100%"}}):e.jsx("div",{ref:l,style:{width:"100%"},children:e.jsx(r,{...i,width:s})})}},exports.calculateGridPosition=q,exports.checkCollision=_,exports.cn=J,exports.compactLayout=K,exports.enableTouchDebugging=function(){document.addEventListener("touchstart",e=>me("touchstart",e),{passive:!1}),document.addEventListener("touchmove",e=>me("touchmove",e),{passive:!1}),document.addEventListener("touchend",e=>me("touchend",e),{passive:!1}),document.addEventListener("mousedown",e=>me("mousedown",e)),document.addEventListener("mousemove",e=>me("mousemove",e)),document.addEventListener("mouseup",e=>me("mouseup",e)),"development"===process.env.NODE_ENV&&console.log("🚀 Touch debugging enabled")},exports.findFreeSpace=function(e,t,r,o){const n=o?e.filter(e=>e.id!==o):e;if(!n.some(e=>_(t,e)))return t;let i=t.y;for(;;){for(let e=0;e<=r-t.w;e++){const r={...t,x:e,y:i};if(!n.some(e=>_(r,e)))return r}i++}},exports.generateLayouts=function(e,t=["lg","md","sm","xs","xxs"]){return t.reduce((t,r)=>(t[r]=e.map(e=>({...e})),t),{})},exports.generateResponsiveLayouts=function(e,t={lg:12,md:10,sm:6,xs:4,xxs:2}){const r={};return Object.entries(t).forEach(([t,o])=>{r[t]=e.map(e=>{const t=Math.min(e.w,o),r=e.x+t>o?o-t:e.x;return{...e,w:t,x:r}})}),r},exports.getAllCollisions=re,exports.getControlPosition=ie,exports.getPixelPosition=Q,exports.getTouchIdentifier=se,exports.isPrimaryTouch=function(e){var t;return 1===e.touches.length||e.touches.length>1&&(null==(t=e.touches[0])?void 0:t.identifier)===se(e)},exports.moveItems=te,exports.preventDefaultTouchEvent=le,exports.shouldSwapItems=ee,exports.touchEventOptions=ae;
2
2
  //# sourceMappingURL=index.cjs.map