dash_kit 2.0.2 → 2.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.
- checksums.yaml +4 -4
- data/Rakefile +1 -2
- data/app/assets/builds/dash_kit/dashboard_grid.css +1 -1
- data/app/assets/builds/dash_kit/dashboard_grid.js +3 -3
- data/app/controllers/dash_kit/dashboards_controller.rb +13 -0
- data/app/helpers/dash_kit/dashboard_helper.rb +2 -1
- data/app/models/dash_kit/dashboard.rb +36 -0
- data/lib/dash_kit/the_local/agents/dash_kit-develop.md +1 -1
- data/lib/dash_kit/the_local/agents/dash_kit-install.md +1 -1
- data/lib/dash_kit/version.rb +1 -1
- data/lib/dash_kit/widget_registry.rb +12 -1
- data/lib/dash_kit.rb +0 -1
- metadata +5 -9
- data/lib/dash_kit/the_local.rb +0 -34
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0cfb78242c30e17c1eaedd518a9f5fd1af0886d019506d04f6959c4bf91d7ef0
|
|
4
|
+
data.tar.gz: 45f2cb90222190e06ee5310754abd3e8e265c50c91f54dbdfc9f148717bac89a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 88d1e0a9aa4ac99d547c55e4605ad8d422e2301c35809dded1601a4f7b82d9c830afb2afa6a723c8d9f445b9e8f8e134176d40233fe01b0e812acf78c06ef758
|
|
7
|
+
data.tar.gz: d7556f33269eff33c48bf9fc37f86e9fae047744e6e8a6c75ee07c43d3f3f94ce961a7ae3be50fd552c9fba65ada04237a0ebf6090f8a35b188957f1b5b86ddd
|
data/Rakefile
CHANGED
|
@@ -3,10 +3,9 @@ require "bundler/gem_tasks"
|
|
|
3
3
|
require "rake/testtask"
|
|
4
4
|
|
|
5
5
|
begin
|
|
6
|
-
require "dash_kit/the_local"
|
|
7
6
|
require "the_local/rake"
|
|
8
7
|
rescue LoadError
|
|
9
|
-
# the_local provides
|
|
8
|
+
# the_local provides its authoring tasks when present.
|
|
10
9
|
end
|
|
11
10
|
|
|
12
11
|
Rake::TestTask.new(:test) do |t|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.react-grid-layout{position:relative;transition:height .2s ease}.react-grid-item{transition:all .2s ease;transition-property:left,top,width,height}.react-grid-item img{pointer-events:none;user-select:none}.react-grid-item.cssTransforms{transition-property:transform,width,height}.react-grid-item.resizing{transition:none;z-index:1;will-change:width,height}.react-grid-item.react-draggable-dragging{transition:none;z-index:3;will-change:transform}.react-grid-item.dropping{visibility:hidden}.react-grid-item.react-grid-placeholder{background:red;opacity:.2;transition-duration:.1s;z-index:2;user-select:none}.react-grid-item.react-grid-placeholder.placeholder-resizing{transition:none}.react-grid-item>.react-resizable-handle{position:absolute;width:20px;height:20px;opacity:0}.react-grid-item:hover>.react-resizable-handle{opacity:1}.react-grid-item>.react-resizable-handle:after{content:"";position:absolute;right:3px;bottom:3px;width:5px;height:5px;border-right:2px solid rgba(0,0,0,.4);border-bottom:2px solid rgba(0,0,0,.4)}.react-resizable-hide>.react-resizable-handle{display:none}.react-grid-item>.react-resizable-handle.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-w,.react-grid-item>.react-resizable-handle.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-n,.react-grid-item>.react-resizable-handle.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}@media(hover:none){.react-grid-item>.react-resizable-handle{opacity:1}}[data-block
|
|
1
|
+
.react-grid-layout{position:relative;transition:height .2s ease}.react-grid-item{transition:all .2s ease;transition-property:left,top,width,height}.react-grid-item img{pointer-events:none;user-select:none}.react-grid-item.cssTransforms{transition-property:transform,width,height}.react-grid-item.resizing{transition:none;z-index:1;will-change:width,height}.react-grid-item.react-draggable-dragging{transition:none;z-index:3;will-change:transform}.react-grid-item.dropping{visibility:hidden}.react-grid-item.react-grid-placeholder{background:red;opacity:.2;transition-duration:.1s;z-index:2;user-select:none}.react-grid-item.react-grid-placeholder.placeholder-resizing{transition:none}.react-grid-item>.react-resizable-handle{position:absolute;width:20px;height:20px;opacity:0}.react-grid-item:hover>.react-resizable-handle{opacity:1}.react-grid-item>.react-resizable-handle:after{content:"";position:absolute;right:3px;bottom:3px;width:5px;height:5px;border-right:2px solid rgba(0,0,0,.4);border-bottom:2px solid rgba(0,0,0,.4)}.react-resizable-hide>.react-resizable-handle{display:none}.react-grid-item>.react-resizable-handle.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-w,.react-grid-item>.react-resizable-handle.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-n,.react-grid-item>.react-resizable-handle.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}@media(hover:none){.react-grid-item>.react-resizable-handle{opacity:1}}[data-block]{touch-action:pan-y}[data-block]:hover,[data-block]:focus-within{z-index:2}.ks-remove-target{position:fixed;bottom:1rem;left:50%;transform:translate(-50%);z-index:50;display:grid;place-items:center;width:3rem;height:3rem;background-color:Canvas;border:2px dashed currentColor;border-radius:9999px;opacity:.9;user-select:none}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(()=>{var os=Object.create;var rn=Object.defineProperty;var ss=Object.getOwnPropertyDescriptor;var as=Object.getOwnPropertyNames;var is=Object.getPrototypeOf,ls=Object.prototype.hasOwnProperty;var Dr=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var Mt=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Cr=(t,e)=>{for(var n in e)rn(t,n,{get:e[n],enumerable:!0})},Rr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of as(e))!ls.call(t,o)&&o!==n&&rn(t,o,{get:()=>e[o],enumerable:!(r=ss(e,o))||r.enumerable});return t};var on=(t,e,n)=>(n=t!=null?os(is(t)):{},Rr(e||!t||!t.__esModule?rn(n,"default",{value:t,enumerable:!0}):n,t)),ge=t=>Rr(rn({},"__esModule",{value:!0}),t);var On={};Cr(On,{createPortal:()=>cs,createRoot:()=>zn,default:()=>_e,flushSync:()=>us,hydrateRoot:()=>ds,preconnect:()=>fs,prefetchDNS:()=>ps,preinit:()=>hs,preinitModule:()=>gs,preload:()=>ms,preloadModule:()=>ys,requestFormReset:()=>bs,unstable_batchedUpdates:()=>vs,useFormState:()=>ws,useFormStatus:()=>Ss,version:()=>xs});var Er,_e,cs,zn,us,ds,fs,ps,hs,gs,ms,ys,bs,vs,ws,Ss,xs,Ce=Dr(()=>{Er=globalThis.ReactDOM,_e=Er,{createPortal:cs,createRoot:zn,flushSync:us,hydrateRoot:ds,preconnect:fs,prefetchDNS:ps,preinit:hs,preinitModule:gs,preload:ms,preloadModule:ys,requestFormReset:bs,unstable_batchedUpdates:vs,useFormState:ws,useFormStatus:Ss,version:xs}=Er});var ne={};Cr(ne,{Children:()=>Te,Component:()=>je,Fragment:()=>Ds,PureComponent:()=>Cs,StrictMode:()=>Rs,Suspense:()=>Es,cloneElement:()=>He,createContext:()=>zs,createElement:()=>Pn,createRef:()=>Os,default:()=>p,forwardRef:()=>Ps,isValidElement:()=>ks,lazy:()=>Ms,memo:()=>Ls,startTransition:()=>Ns,useCallback:()=>U,useContext:()=>_s,useDebugValue:()=>Ts,useDeferredValue:()=>js,useEffect:()=>It,useId:()=>Hs,useImperativeHandle:()=>Bs,useLayoutEffect:()=>Ws,useMemo:()=>Ct,useReducer:()=>As,useRef:()=>I,useState:()=>st,useSyncExternalStore:()=>qs,useTransition:()=>Is});var zr,p,Te,je,Ds,Cs,Rs,Es,He,zs,Pn,Os,Ps,ks,Ms,Ls,Ns,U,_s,Ts,js,It,Hs,Bs,Ws,Ct,As,I,st,qs,Is,ct=Dr(()=>{zr=globalThis.React,p=zr,{Children:Te,Component:je,Fragment:Ds,PureComponent:Cs,StrictMode:Rs,Suspense:Es,cloneElement:He,createContext:zs,createElement:Pn,createRef:Os,forwardRef:Ps,isValidElement:ks,lazy:Ms,memo:Ls,startTransition:Ns,useCallback:U,useContext:_s,useDebugValue:Ts,useDeferredValue:js,useEffect:It,useId:Hs,useImperativeHandle:Bs,useLayoutEffect:Ws,useMemo:Ct,useReducer:As,useRef:I,useState:st,useSyncExternalStore:qs,useTransition:Is}=zr});var Gr=Mt((cn,$r)=>{(function(t,e){typeof cn=="object"&&typeof $r<"u"?e(cn):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["fast-equals"]={}))})(cn,(function(t){"use strict";function e(d){return function(k,y,x,D,j,F,W){return d(k,y,W)}}function n(d){return function(k,y,x,D){if(!k||!y||typeof k!="object"||typeof y!="object")return d(k,y,x,D);var j=D.get(k),F=D.get(y);if(j&&F)return j===y&&F===k;D.set(k,y),D.set(y,k);var W=d(k,y,x,D);return D.delete(k),D.delete(y),W}}function r(d,m){var k={};for(var y in d)k[y]=d[y];for(var y in m)k[y]=m[y];return k}function o(d){return d.constructor===Object||d.constructor==null}function a(d){return typeof d.then=="function"}function s(d,m){return d===m||d!==d&&m!==m}var i="[object Arguments]",l="[object Boolean]",c="[object Date]",f="[object RegExp]",u="[object Map]",g="[object Number]",z="[object Object]",w="[object Set]",P="[object String]",S=Object.prototype.toString;function b(d){var m=d.areArraysEqual,k=d.areDatesEqual,y=d.areMapsEqual,x=d.areObjectsEqual,D=d.areRegExpsEqual,j=d.areSetsEqual,F=d.createIsNestedEqual,W=F(ot);function ot(M,N,pt){if(M===N)return!0;if(!M||!N||typeof M!="object"||typeof N!="object")return M!==M&&N!==N;if(o(M)&&o(N))return x(M,N,W,pt);var X=Array.isArray(M),B=Array.isArray(N);if(X||B)return X===B&&m(M,N,W,pt);var $=S.call(M);return $!==S.call(N)?!1:$===c?k(M,N,W,pt):$===f?D(M,N,W,pt):$===u?y(M,N,W,pt):$===w?j(M,N,W,pt):$===z||$===i?a(M)||a(N)?!1:x(M,N,W,pt):$===l||$===g||$===P?s(M.valueOf(),N.valueOf()):!1}return ot}function K(d,m,k,y){var x=d.length;if(m.length!==x)return!1;for(;x-- >0;)if(!k(d[x],m[x],x,x,d,m,y))return!1;return!0}var J=n(K);function at(d,m){return s(d.valueOf(),m.valueOf())}function ut(d,m,k,y){var x=d.size===m.size;if(!x)return!1;if(!d.size)return!0;var D={},j=0;return d.forEach(function(F,W){if(x){var ot=!1,M=0;m.forEach(function(N,pt){!ot&&!D[M]&&(ot=k(W,pt,j,M,d,m,y)&&k(F,N,W,pt,d,m,y))&&(D[M]=!0),M++}),j++,x=ot}}),x}var it=n(ut),rt="_owner",et=Object.prototype.hasOwnProperty;function lt(d,m,k,y){var x=Object.keys(d),D=x.length;if(Object.keys(m).length!==D)return!1;for(var j;D-- >0;){if(j=x[D],j===rt){var F=!!d.$$typeof,W=!!m.$$typeof;if((F||W)&&F!==W)return!1}if(!et.call(m,j)||!k(d[j],m[j],j,j,d,m,y))return!1}return!0}var Rt=n(lt);function Wt(d,m){return d.source===m.source&&d.flags===m.flags}function C(d,m,k,y){var x=d.size===m.size;if(!x)return!1;if(!d.size)return!0;var D={};return d.forEach(function(j,F){if(x){var W=!1,ot=0;m.forEach(function(M,N){!W&&!D[ot]&&(W=k(j,M,F,N,d,m,y))&&(D[ot]=!0),ot++}),x=W}}),x}var R=n(C),Y=Object.freeze({areArraysEqual:K,areDatesEqual:at,areMapsEqual:ut,areObjectsEqual:lt,areRegExpsEqual:Wt,areSetsEqual:C,createIsNestedEqual:e}),Ot=Object.freeze({areArraysEqual:J,areDatesEqual:at,areMapsEqual:it,areObjectsEqual:Rt,areRegExpsEqual:Wt,areSetsEqual:R,createIsNestedEqual:e}),xt=b(Y);function Et(d,m){return xt(d,m,void 0)}var ue=b(r(Y,{createIsNestedEqual:function(){return s}}));function de(d,m){return ue(d,m,void 0)}var Nt=b(Ot);function Vt(d,m){return Nt(d,m,new WeakMap)}var Kt=b(r(Ot,{createIsNestedEqual:function(){return s}}));function fe(d,m){return Kt(d,m,new WeakMap)}function pe(d){return b(r(Y,d(Y)))}function he(d){var m=b(r(Ot,d(Ot)));return(function(k,y,x){return x===void 0&&(x=new WeakMap),m(k,y,x)})}t.circularDeepEqual=Vt,t.circularShallowEqual=fe,t.createCustomCircularEqual=he,t.createCustomEqual=pe,t.deepEqual=Et,t.sameValueZeroEqual=s,t.shallowEqual=de,Object.defineProperty(t,"__esModule",{value:!0})}))});var Ur=Mt((il,Fr)=>{"use strict";var ia="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Fr.exports=ia});var Zr=Mt((ll,Jr)=>{"use strict";var la=Ur();function Vr(){}function Kr(){}Kr.resetWarningCache=Vr;Jr.exports=function(){function t(r,o,a,s,i,l){if(l!==la){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Kr,resetWarningCache:Vr};return n.PropTypes=n,n}});var me=Mt((dl,Qr)=>{Qr.exports=Zr()();var cl,ul});var uo=Mt((Sl,Zn)=>{function co(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=co(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function lo(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=co(t))&&(r&&(r+=" "),r+=e);return r}Zn.exports=lo,Zn.exports.clsx=lo});var xo=Mt((xl,So)=>{"use strict";var Ma=Object.create,fn=Object.defineProperty,La=Object.getOwnPropertyDescriptor,Na=Object.getOwnPropertyNames,_a=Object.getPrototypeOf,Ta=Object.prototype.hasOwnProperty,ja=(t,e)=>{for(var n in e)fn(t,n,{get:e[n],enumerable:!0})},yo=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Na(e))!Ta.call(t,o)&&o!==n&&fn(t,o,{get:()=>e[o],enumerable:!(r=La(e,o))||r.enumerable});return t},Pe=(t,e,n)=>(n=t!=null?Ma(_a(t)):{},yo(e||!t||!t.__esModule?fn(n,"default",{value:t,enumerable:!0}):n,t)),Ha=t=>yo(fn({},"__esModule",{value:!0}),t),bo={};ja(bo,{DraggableCore:()=>ve,default:()=>pn});So.exports=Ha(bo);var dn=Pe((ct(),ge(ne))),V=Pe(me()),Ba=Pe((Ce(),ge(On))),Wa=uo();function ar(t,e){for(let n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]}function fo(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function $e(t){return typeof t=="number"&&!isNaN(t)}function vt(t){return parseInt(t,10)}function Oe(t,e,n){if(t[e])return new Error(`Invalid prop ${e} passed to ${n} - do not set this, set it on the child.`)}var Qn=["Moz","Webkit","O","ms"];function Aa(t="transform"){var e,n;if(typeof window>"u")return"";let r=(n=(e=window.document)==null?void 0:e.documentElement)==null?void 0:n.style;if(!r||t in r)return"";for(let o=0;o<Qn.length;o++)if(vo(t,Qn[o])in r)return Qn[o];return""}function vo(t,e){return e?`${e}${qa(t)}`:t}function qa(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):t[r]==="-"?n=!0:e+=t[r];return e}var Ia=Aa(),tr="";function Ya(t,e){var n;tr||(tr=(n=ar(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(o){return fo(t[o])}))!=null?n:"");let r=t[tr];return fo(r)?!!r.call(t,e):!1}function po(t,e,n){let r=t;do{if(Ya(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function er(t,e,n,r){if(!t)return;let o={capture:!0,...r},a=n;t.addEventListener?t.addEventListener(e,a,o):t.attachEvent?t.attachEvent("on"+e,a):t["on"+e]=a}function be(t,e,n,r){if(!t)return;let o={capture:!0,...r},a=n;t.removeEventListener?t.removeEventListener(e,a,o):t.detachEvent?t.detachEvent("on"+e,a):t["on"+e]=null}function Xa(t){let e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=vt(n.borderTopWidth),e+=vt(n.borderBottomWidth),e}function $a(t){let e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=vt(n.borderLeftWidth),e+=vt(n.borderRightWidth),e}function Ga(t){let e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=vt(n.paddingTop),e-=vt(n.paddingBottom),e}function Fa(t){let e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=vt(n.paddingLeft),e-=vt(n.paddingRight),e}function Ua(t,e,n){let o=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),a=(t.clientX+e.scrollLeft-o.left)/n,s=(t.clientY+e.scrollTop-o.top)/n;return{x:a,y:s}}function Va(t,e){let n=wo(t,e,"px");return{[vo("transform",Ia)]:n}}function Ka(t,e){return wo(t,e,"")}function wo({x:t,y:e},n,r){let o=`translate(${t}${r},${e}${r})`;if(n){let a=`${typeof n.x=="string"?n.x:n.x+r}`,s=`${typeof n.y=="string"?n.y:n.y+r}`;o=`translate(${a}, ${s})`+o}return o}function Ja(t,e){return t.targetTouches&&ar(t.targetTouches,n=>e===n.identifier)||t.changedTouches&&ar(t.changedTouches,n=>e===n.identifier)}function Za(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function Qa(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0}function ti(t,e){if(!t)return;let n=t.getElementById("react-draggable-style-el");if(!n){n=t.createElement("style"),n.type="text/css",n.id="react-draggable-style-el";let r=e??Qa();r&&n.setAttribute("nonce",r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
1
|
+
(()=>{var ds=Object.create;var on=Object.defineProperty;var fs=Object.getOwnPropertyDescriptor;var ps=Object.getOwnPropertyNames;var hs=Object.getPrototypeOf,gs=Object.prototype.hasOwnProperty;var Dr=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var Nt=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Cr=(t,e)=>{for(var n in e)on(t,n,{get:e[n],enumerable:!0})},Rr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ps(e))!gs.call(t,o)&&o!==n&&on(t,o,{get:()=>e[o],enumerable:!(r=fs(e,o))||r.enumerable});return t};var sn=(t,e,n)=>(n=t!=null?ds(hs(t)):{},Rr(e||!t||!t.__esModule?on(n,"default",{value:t,enumerable:!0}):n,t)),ge=t=>Rr(on({},"__esModule",{value:!0}),t);var On={};Cr(On,{createPortal:()=>ms,createRoot:()=>zn,default:()=>Te,flushSync:()=>ys,hydrateRoot:()=>bs,preconnect:()=>vs,prefetchDNS:()=>ws,preinit:()=>xs,preinitModule:()=>Ss,preload:()=>Ds,preloadModule:()=>Cs,requestFormReset:()=>Rs,unstable_batchedUpdates:()=>Es,useFormState:()=>zs,useFormStatus:()=>Os,version:()=>Ps});var Er,Te,ms,zn,ys,bs,vs,ws,xs,Ss,Ds,Cs,Rs,Es,zs,Os,Ps,Ce=Dr(()=>{Er=globalThis.ReactDOM,Te=Er,{createPortal:ms,createRoot:zn,flushSync:ys,hydrateRoot:bs,preconnect:vs,prefetchDNS:ws,preinit:xs,preinitModule:Ss,preload:Ds,preloadModule:Cs,requestFormReset:Rs,unstable_batchedUpdates:Es,useFormState:zs,useFormStatus:Os,version:Ps}=Er});var ie={};Cr(ie,{Children:()=>je,Component:()=>Be,Fragment:()=>ks,PureComponent:()=>Ms,StrictMode:()=>Ls,Suspense:()=>_s,cloneElement:()=>He,createContext:()=>Ns,createElement:()=>Pn,createRef:()=>Ts,default:()=>f,forwardRef:()=>js,isValidElement:()=>Bs,lazy:()=>Hs,memo:()=>Ws,startTransition:()=>As,useCallback:()=>J,useContext:()=>qs,useDebugValue:()=>Is,useDeferredValue:()=>Ys,useEffect:()=>Ht,useId:()=>Xs,useImperativeHandle:()=>$s,useLayoutEffect:()=>Gs,useMemo:()=>Ot,useReducer:()=>Fs,useRef:()=>M,useState:()=>ot,useSyncExternalStore:()=>Us,useTransition:()=>Vs});var zr,f,je,Be,ks,Ms,Ls,_s,He,Ns,Pn,Ts,js,Bs,Hs,Ws,As,J,qs,Is,Ys,Ht,Xs,$s,Gs,Ot,Fs,M,ot,Us,Vs,dt=Dr(()=>{zr=globalThis.React,f=zr,{Children:je,Component:Be,Fragment:ks,PureComponent:Ms,StrictMode:Ls,Suspense:_s,cloneElement:He,createContext:Ns,createElement:Pn,createRef:Ts,forwardRef:js,isValidElement:Bs,lazy:Hs,memo:Ws,startTransition:As,useCallback:J,useContext:qs,useDebugValue:Is,useDeferredValue:Ys,useEffect:Ht,useId:Xs,useImperativeHandle:$s,useLayoutEffect:Gs,useMemo:Ot,useReducer:Fs,useRef:M,useState:ot,useSyncExternalStore:Us,useTransition:Vs}=zr});var Gr=Nt((un,$r)=>{(function(t,e){typeof un=="object"&&typeof $r<"u"?e(un):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["fast-equals"]={}))})(un,(function(t){"use strict";function e(u){return function(z,y,D,C,B,K,q){return u(z,y,q)}}function n(u){return function(z,y,D,C){if(!z||!y||typeof z!="object"||typeof y!="object")return u(z,y,D,C);var B=C.get(z),K=C.get(y);if(B&&K)return B===y&&K===z;C.set(z,y),C.set(y,z);var q=u(z,y,D,C);return C.delete(z),C.delete(y),q}}function r(u,m){var z={};for(var y in u)z[y]=u[y];for(var y in m)z[y]=m[y];return z}function o(u){return u.constructor===Object||u.constructor==null}function a(u){return typeof u.then=="function"}function s(u,m){return u===m||u!==u&&m!==m}var i="[object Arguments]",l="[object Boolean]",c="[object Date]",p="[object RegExp]",d="[object Map]",h="[object Number]",E="[object Object]",S="[object Set]",P="[object String]",x=Object.prototype.toString;function b(u){var m=u.areArraysEqual,z=u.areDatesEqual,y=u.areMapsEqual,D=u.areObjectsEqual,C=u.areRegExpsEqual,B=u.areSetsEqual,K=u.createIsNestedEqual,q=K(it);function it(k,_,gt){if(k===_)return!0;if(!k||!_||typeof k!="object"||typeof _!="object")return k!==k&&_!==_;if(o(k)&&o(_))return D(k,_,q,gt);var G=Array.isArray(k),A=Array.isArray(_);if(G||A)return G===A&&m(k,_,q,gt);var F=x.call(k);return F!==x.call(_)?!1:F===c?z(k,_,q,gt):F===p?C(k,_,q,gt):F===d?y(k,_,q,gt):F===S?B(k,_,q,gt):F===E||F===i?a(k)||a(_)?!1:D(k,_,q,gt):F===l||F===h||F===P?s(k.valueOf(),_.valueOf()):!1}return it}function lt(u,m,z,y){var D=u.length;if(m.length!==D)return!1;for(;D-- >0;)if(!z(u[D],m[D],D,D,u,m,y))return!1;return!0}var V=n(lt);function ct(u,m){return s(u.valueOf(),m.valueOf())}function nt(u,m,z,y){var D=u.size===m.size;if(!D)return!1;if(!u.size)return!0;var C={},B=0;return u.forEach(function(K,q){if(D){var it=!1,k=0;m.forEach(function(_,gt){!it&&!C[k]&&(it=z(q,gt,B,k,u,m,y)&&z(K,_,q,gt,u,m,y))&&(C[k]=!0),k++}),B++,D=it}}),D}var at=n(nt),ut="_owner",$=Object.prototype.hasOwnProperty;function st(u,m,z,y){var D=Object.keys(u),C=D.length;if(Object.keys(m).length!==C)return!1;for(var B;C-- >0;){if(B=D[C],B===ut){var K=!!u.$$typeof,q=!!m.$$typeof;if((K||q)&&K!==q)return!1}if(!$.call(m,B)||!z(u[B],m[B],B,B,u,m,y))return!1}return!0}var Dt=n(st);function Pt(u,m){return u.source===m.source&&u.flags===m.flags}function Tt(u,m,z,y){var D=u.size===m.size;if(!D)return!1;if(!u.size)return!0;var C={};return u.forEach(function(B,K){if(D){var q=!1,it=0;m.forEach(function(k,_){!q&&!C[it]&&(q=z(B,k,K,_,u,m,y))&&(C[it]=!0),it++}),D=q}}),D}var W=n(Tt),j=Object.freeze({areArraysEqual:lt,areDatesEqual:ct,areMapsEqual:nt,areObjectsEqual:st,areRegExpsEqual:Pt,areSetsEqual:Tt,createIsNestedEqual:e}),Et=Object.freeze({areArraysEqual:V,areDatesEqual:ct,areMapsEqual:at,areObjectsEqual:Dt,areRegExpsEqual:Pt,areSetsEqual:W,createIsNestedEqual:e}),ft=b(j);function bt(u,m){return ft(u,m,void 0)}var Vt=b(r(j,{createIsNestedEqual:function(){return s}}));function Kt(u,m){return Vt(u,m,void 0)}var kt=b(Et);function It(u,m){return kt(u,m,new WeakMap)}var Yt=b(r(Et,{createIsNestedEqual:function(){return s}}));function Jt(u,m){return Yt(u,m,new WeakMap)}function w(u){return b(r(j,u(j)))}function X(u){var m=b(r(Et,u(Et)));return(function(z,y,D){return D===void 0&&(D=new WeakMap),m(z,y,D)})}t.circularDeepEqual=It,t.circularShallowEqual=Jt,t.createCustomCircularEqual=X,t.createCustomEqual=w,t.deepEqual=bt,t.sameValueZeroEqual=s,t.shallowEqual=Kt,Object.defineProperty(t,"__esModule",{value:!0})}))});var Ur=Nt((Rl,Fr)=>{"use strict";var ha="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Fr.exports=ha});var Zr=Nt((El,Jr)=>{"use strict";var ga=Ur();function Vr(){}function Kr(){}Kr.resetWarningCache=Vr;Jr.exports=function(){function t(r,o,a,s,i,l){if(l!==ga){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Kr,resetWarningCache:Vr};return n.PropTypes=n,n}});var me=Nt((Pl,Qr)=>{Qr.exports=Zr()();var zl,Ol});var uo=Nt((Wl,Zn)=>{function co(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=co(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function lo(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=co(t))&&(r&&(r+=" "),r+=e);return r}Zn.exports=lo,Zn.exports.clsx=lo});var So=Nt((Al,xo)=>{"use strict";var Ha=Object.create,pn=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,Aa=Object.getOwnPropertyNames,qa=Object.getPrototypeOf,Ia=Object.prototype.hasOwnProperty,Ya=(t,e)=>{for(var n in e)pn(t,n,{get:e[n],enumerable:!0})},yo=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Aa(e))!Ia.call(t,o)&&o!==n&&pn(t,o,{get:()=>e[o],enumerable:!(r=Wa(e,o))||r.enumerable});return t},Pe=(t,e,n)=>(n=t!=null?Ha(qa(t)):{},yo(e||!t||!t.__esModule?pn(n,"default",{value:t,enumerable:!0}):n,t)),Xa=t=>yo(pn({},"__esModule",{value:!0}),t),bo={};Ya(bo,{DraggableCore:()=>ve,default:()=>hn});xo.exports=Xa(bo);var fn=Pe((dt(),ge(ie))),Z=Pe(me()),$a=Pe((Ce(),ge(On))),Ga=uo();function ar(t,e){for(let n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]}function fo(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function Ge(t){return typeof t=="number"&&!isNaN(t)}function St(t){return parseInt(t,10)}function Oe(t,e,n){if(t[e])return new Error(`Invalid prop ${e} passed to ${n} - do not set this, set it on the child.`)}var Qn=["Moz","Webkit","O","ms"];function Fa(t="transform"){var e,n;if(typeof window>"u")return"";let r=(n=(e=window.document)==null?void 0:e.documentElement)==null?void 0:n.style;if(!r||t in r)return"";for(let o=0;o<Qn.length;o++)if(vo(t,Qn[o])in r)return Qn[o];return""}function vo(t,e){return e?`${e}${Ua(t)}`:t}function Ua(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):t[r]==="-"?n=!0:e+=t[r];return e}var Va=Fa(),tr="";function Ka(t,e){var n;tr||(tr=(n=ar(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(o){return fo(t[o])}))!=null?n:"");let r=t[tr];return fo(r)?!!r.call(t,e):!1}function po(t,e,n){let r=t;do{if(Ka(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function er(t,e,n,r){if(!t)return;let o={capture:!0,...r},a=n;t.addEventListener?t.addEventListener(e,a,o):t.attachEvent?t.attachEvent("on"+e,a):t["on"+e]=a}function be(t,e,n,r){if(!t)return;let o={capture:!0,...r},a=n;t.removeEventListener?t.removeEventListener(e,a,o):t.detachEvent?t.detachEvent("on"+e,a):t["on"+e]=null}function Ja(t){let e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=St(n.borderTopWidth),e+=St(n.borderBottomWidth),e}function Za(t){let e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=St(n.borderLeftWidth),e+=St(n.borderRightWidth),e}function Qa(t){let e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=St(n.paddingTop),e-=St(n.paddingBottom),e}function ti(t){let e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=St(n.paddingLeft),e-=St(n.paddingRight),e}function ei(t,e,n){let o=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),a=(t.clientX+e.scrollLeft-o.left)/n,s=(t.clientY+e.scrollTop-o.top)/n;return{x:a,y:s}}function ni(t,e){let n=wo(t,e,"px");return{[vo("transform",Va)]:n}}function ri(t,e){return wo(t,e,"")}function wo({x:t,y:e},n,r){let o=`translate(${t}${r},${e}${r})`;if(n){let a=`${typeof n.x=="string"?n.x:n.x+r}`,s=`${typeof n.y=="string"?n.y:n.y+r}`;o=`translate(${a}, ${s})`+o}return o}function oi(t,e){return t.targetTouches&&ar(t.targetTouches,n=>e===n.identifier)||t.changedTouches&&ar(t.changedTouches,n=>e===n.identifier)}function si(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function ai(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0}function ii(t,e){if(!t)return;let n=t.getElementById("react-draggable-style-el");if(!n){n=t.createElement("style"),n.type="text/css",n.id="react-draggable-style-el";let r=e??ai();r&&n.setAttribute("nonce",r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
2
2
|
`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
3
|
-
`,t.getElementsByTagName("head")[0].appendChild(n)}t.body&&ei(t.body,"react-draggable-transparent-selection")}function ho(t){window.requestAnimationFrame?window.requestAnimationFrame(()=>{go(t)}):go(t)}function go(t){if(t)try{t.body&&ni(t.body,"react-draggable-transparent-selection");let e=t.selection;if(e)e.empty();else{let n=(t.defaultView||window).getSelection();n&&n.type!=="Caret"&&n.removeAllRanges()}}catch{}}function ei(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp(`(?:^|\\s)${e}(?!\\S)`))||(t.className+=` ${e}`)}function ni(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g"),"")}function ri(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:ai(r);let o=ir(t);if(typeof r=="string"){let{ownerDocument:a}=o,s=a.defaultView;if(!s)throw new Error("Cannot resolve the owner window of the draggable node.");let i;if(r==="parent"?i=o.parentNode:i=o.getRootNode().querySelector(r),!(i instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');let l=i,c=s.getComputedStyle(o),f=s.getComputedStyle(l);r={left:-o.offsetLeft+vt(f.paddingLeft)+vt(c.marginLeft),top:-o.offsetTop+vt(f.paddingTop)+vt(c.marginTop),right:Fa(l)-$a(o)-o.offsetLeft+vt(f.paddingRight)-vt(c.marginRight),bottom:Ga(l)-Xa(o)-o.offsetTop+vt(f.paddingBottom)-vt(c.marginBottom)}}return $e(r.right)&&(e=Math.min(e,r.right)),$e(r.bottom)&&(n=Math.min(n,r.bottom)),$e(r.left)&&(e=Math.max(e,r.left)),$e(r.top)&&(n=Math.max(n,r.top)),[e,n]}function mo(t,e,n){let r=Math.round(e/t[0])*t[0],o=Math.round(n/t[1])*t[1];return[r,o]}function oi(t){return t.props.axis==="both"||t.props.axis==="x"}function si(t){return t.props.axis==="both"||t.props.axis==="y"}function nr(t,e,n){let r=typeof e=="number"?Ja(t,e):null;if(typeof e=="number"&&!r)return null;let o=ir(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return Ua(r||t,a,n.props.scale)}function rr(t,e,n){let r=!$e(t.lastX),o=ir(t);return r?{node:o,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:o,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function or(t,e){let n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function ai(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function ir(t){let e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}var sr=Pe((ct(),ge(ne))),bt=Pe(me()),ii=Pe((Ce(),ge(On))),li=typeof process<"u"&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Xt=li,Bt={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},le=Bt.mouse,ve=class extends sr.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&(typeof t.button=="number"&&t.button!==0||t.ctrlKey))return!1;let e=this.findDOMNode();if(!e||!e.ownerDocument||!e.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:n}=e;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!po(t.target,this.props.handle,e)||this.props.cancel&&po(t.target,this.props.cancel,e))return;t.type==="touchstart"&&!this.props.allowMobileScroll&&t.preventDefault();let r=Za(t);this.touchIdentifier=r;let o=nr(t,r,this);if(o==null)return;let{x:a,y:s}=o,i=rr(this,a,s);Xt("DraggableCore: handleDragStart: %j",i),Xt("calling",this.props.onStart),!(this.props.onStart(t,i)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ti(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=s,er(n,le.move,this.handleDrag),er(n,le.stop,this.handleDragStop))},this.handleDrag=t=>{let e=nr(t,this.touchIdentifier,this);if(e==null)return;let{x:n,y:r}=e;if(Array.isArray(this.props.grid)){let s=n-this.lastX,i=r-this.lastY;if([s,i]=mo(this.props.grid,s,i),!s&&!i)return;n=this.lastX+s,r=this.lastY+i}let o=rr(this,n,r);if(Xt("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{let s=document.createEvent("MouseEvents");s.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(s)}return}this.lastX=n,this.lastY=r},this.handleDragStop=t=>{if(!this.dragging)return;let e=nr(t,this.touchIdentifier,this);if(e==null)return;let{x:n,y:r}=e;if(Array.isArray(this.props.grid)){let i=n-this.lastX||0,l=r-this.lastY||0;[i,l]=mo(this.props.grid,i,l),n=this.lastX+i,r=this.lastY+l}let o=rr(this,n,r);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;let s=this.findDOMNode();s&&this.props.enableUserSelectHack&&ho(s.ownerDocument),Xt("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&(Xt("DraggableCore: Removing handlers"),be(s.ownerDocument,le.move,this.handleDrag),be(s.ownerDocument,le.stop,this.handleDragStop))},this.onMouseDown=t=>(le=Bt.mouse,this.handleDragStart(t)),this.onMouseUp=t=>(le=Bt.mouse,this.handleDragStop(t)),this.onTouchStart=t=>(le=Bt.touch,this.handleDragStart(t)),this.onTouchEnd=t=>(le=Bt.touch,this.handleDragStop(t))}componentDidMount(){this.mounted=!0;let t=this.findDOMNode();t&&er(t,Bt.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let t=this.findDOMNode();if(t){let{ownerDocument:e}=t;be(e,Bt.mouse.move,this.handleDrag),be(e,Bt.touch.move,this.handleDrag),be(e,Bt.mouse.stop,this.handleDragStop),be(e,Bt.touch.stop,this.handleDragStop),be(t,Bt.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&ho(e)}}findDOMNode(){var t;if((t=this.props)!=null&&t.nodeRef)return this.props.nodeRef.current;let e=ii.default;return typeof e.findDOMNode=="function"?e.findDOMNode(this):(Xt("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return sr.cloneElement(sr.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};ve.displayName="DraggableCore";ve.propTypes={allowAnyClick:bt.default.bool,allowMobileScroll:bt.default.bool,children:bt.default.node.isRequired,disabled:bt.default.bool,enableUserSelectHack:bt.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:bt.default.arrayOf(bt.default.number),handle:bt.default.string,cancel:bt.default.string,nodeRef:bt.default.object,nonce:bt.default.string,onStart:bt.default.func,onDrag:bt.default.func,onStop:bt.default.func,onMouseDown:bt.default.func,scale:bt.default.number,className:Oe,style:Oe,transform:Oe};ve.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var pn=class extends dn.Component{constructor(t){super(t),this.onDragStart=(e,n)=>{if(Xt("Draggable: onDragStart: %j",n),this.props.onStart(e,or(this,n))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,n)=>{if(!this.state.dragging)return!1;Xt("Draggable: onDrag: %j",n);let r=or(this,n),o={x:r.x,y:r.y,slackX:0,slackY:0};if(this.props.bounds){let{x:s,y:i}=o;o.x+=this.state.slackX,o.y+=this.state.slackY;let[l,c]=ri(this,o.x,o.y);o.x=l,o.y=c,o.slackX=this.state.slackX+(s-o.x),o.slackY=this.state.slackY+(i-o.y),r.x=o.x,r.y=o.y,r.deltaX=o.x-this.state.x,r.deltaY=o.y-this.state.y}if(this.props.onDrag(e,r)===!1)return!1;this.setState(o)},this.onDragStop=(e,n)=>{if(!this.state.dragging||this.props.onStop(e,or(this,n))===!1)return!1;Xt("Draggable: onDragStop: %j",n);let o={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){let{x:s,y:i}=this.props.position;o.x=s,o.y=i}this.setState(o)},this.state={dragging:!1,dragged:!1,x:t.position?t.position.x:t.defaultPosition.x,y:t.position?t.position.y:t.defaultPosition.y,prevPropsPosition:{...t.position},slackX:0,slackY:0,isElementSVG:!1},t.position&&!(t.onDrag||t.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:t},{prevPropsPosition:e}){return t&&(!e||t.x!==e.x||t.y!==e.y)?(Xt("Draggable: getDerivedStateFromProps %j",{position:t,prevPropsPosition:e}),{x:t.x,y:t.y,prevPropsPosition:{...t}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var t;if((t=this.props)!=null&&t.nodeRef)return this.props.nodeRef.current;let e=Ba.default;return typeof e.findDOMNode=="function"?e.findDOMNode(this):null}render(){let{axis:t,bounds:e,children:n,defaultPosition:r,defaultClassName:o,defaultClassNameDragging:a,defaultClassNameDragged:s,position:i,positionOffset:l,scale:c,...f}=this.props,u={},g=null,w=!!!i||this.state.dragging,P=i||r,S={x:oi(this)&&w?this.state.x:P.x,y:si(this)&&w?this.state.y:P.y};this.state.isElementSVG?g=Ka(S,l):u=Va(S,l);let b=dn.Children.only(n),K=(0,Wa.clsx)(b.props.className||"",o,{[a]:this.state.dragging,[s]:this.state.dragged});return dn.createElement(ve,{...f,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},dn.cloneElement(b,{className:K,style:{...b.props.style,...u},transform:g}))}};pn.displayName="Draggable";pn.propTypes={...ve.propTypes,axis:V.default.oneOf(["both","x","y","none"]),bounds:V.default.oneOfType([V.default.shape({left:V.default.number,right:V.default.number,top:V.default.number,bottom:V.default.number}),V.default.string,V.default.oneOf([!1])]),defaultClassName:V.default.string,defaultClassNameDragging:V.default.string,defaultClassNameDragged:V.default.string,defaultPosition:V.default.shape({x:V.default.number,y:V.default.number}),positionOffset:V.default.shape({x:V.default.oneOfType([V.default.number,V.default.string]),y:V.default.oneOfType([V.default.number,V.default.string])}),position:V.default.shape({x:V.default.number,y:V.default.number}),className:Oe,style:Oe,transform:Oe};pn.defaultProps={...ve.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1}});var cr=Mt((Rl,hn)=>{"use strict";var lr=xo(),ci=lr.DraggableCore,Do=lr.default||lr;hn.exports=Do;hn.exports.default=Do;hn.exports.DraggableCore=ci});var Eo=Mt(ur=>{"use strict";ur.__esModule=!0;ur.cloneElement=gi;var ui=di((ct(),ge(ne)));function di(t){return t&&t.__esModule?t:{default:t}}function Co(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Ro(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(n),!0).forEach(function(r){fi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Co(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function fi(t,e,n){return(e=pi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pi(t){var e=hi(t,"string");return typeof e=="symbol"?e:e+""}function hi(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gi(t,e){return e.style&&t.props.style&&(e.style=Ro(Ro({},t.props.style),e.style)),e.className&&t.props.className&&(e.className=t.props.className+" "+e.className),ui.default.cloneElement(t,e)}});var dr=Mt(gn=>{"use strict";gn.__esModule=!0;gn.resizableProps=void 0;var E=mi(me()),zl=cr();function mi(t){return t&&t.__esModule?t:{default:t}}var Ol=gn.resizableProps={axis:E.default.oneOf(["both","x","y","none"]),className:E.default.string,children:E.default.element.isRequired,draggableOpts:E.default.shape({allowAnyClick:E.default.bool,cancel:E.default.string,children:E.default.node,disabled:E.default.bool,enableUserSelectHack:E.default.bool,offsetParent:typeof Element<"u"?E.default.instanceOf(Element):E.default.any,grid:E.default.arrayOf(E.default.number),handle:E.default.string,nodeRef:E.default.object,onStart:E.default.func,onDrag:E.default.func,onStop:E.default.func,onMouseDown:E.default.func,scale:E.default.number}),height:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];let r=e[0];return r.axis==="both"||r.axis==="y"?E.default.number.isRequired(...e):E.default.number(...e)},handle:E.default.oneOfType([E.default.node,E.default.func]),handleSize:E.default.arrayOf(E.default.number),lockAspectRatio:E.default.bool,maxConstraints:E.default.arrayOf(E.default.number),minConstraints:E.default.arrayOf(E.default.number),onResizeStop:E.default.func,onResizeStart:E.default.func,onResize:E.default.func,resizeHandles:E.default.arrayOf(E.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:E.default.number,width:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];let r=e[0];return r.axis==="both"||r.axis==="x"?E.default.number.isRequired(...e):E.default.number(...e)}}});var hr=Mt(mn=>{"use strict";mn.__esModule=!0;mn.default=void 0;var ke=Oo((ct(),ge(ne))),yi=cr(),bi=Eo(),vi=dr(),wi=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Oo(t,e){if(typeof WeakMap=="function")var n=new WeakMap,r=new WeakMap;return(Oo=function(o,a){if(!a&&o&&o.__esModule)return o;var s,i,l={__proto__:null,default:o};if(o===null||typeof o!="object"&&typeof o!="function")return l;if(s=a?r:n){if(s.has(o))return s.get(o);s.set(o,l)}for(let c in o)c!=="default"&&{}.hasOwnProperty.call(o,c)&&((i=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(o,c))&&(i.get||i.set)?s(l,c,i):l[c]=o[c]);return l})(t,e)}function pr(){return pr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pr.apply(null,arguments)}function Si(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function zo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function fr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?zo(Object(n),!0).forEach(function(r){xi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function xi(t,e,n){return(e=Di(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Di(t){var e=Ci(t,"string");return typeof e=="symbol"?e:e+""}function Ci(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ge=class extends ke.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(e,n){let r=this.props,o=r.minConstraints,a=r.maxConstraints,s=r.lockAspectRatio;if(!o&&!a&&!s)return[e,n];if(s){let g=this.props.width/this.props.height,z=e-this.props.width,w=n-this.props.height;Math.abs(z)>Math.abs(w*g)?n=e/g:e=n*g}let i=e,l=n,c=this.slack||[0,0],f=c[0],u=c[1];return e+=f,n+=u,o&&(e=Math.max(o[0],e),n=Math.max(o[1],n)),a&&(e=Math.min(a[0],e),n=Math.min(a[1],n)),this.slack=[f+(i-e),u+(l-n)],[e,n]}resizeHandler(e,n){return(r,o)=>{var a,s,i,l;let c=o.node,f=o.deltaX,u=o.deltaY;e==="onResizeStart"&&this.resetData();let g=(this.props.axis==="both"||this.props.axis==="x")&&n!=="n"&&n!=="s",z=(this.props.axis==="both"||this.props.axis==="y")&&n!=="e"&&n!=="w";if(!g&&!z)return;let w=n[0],P=n[n.length-1],S=c.getBoundingClientRect();if(this.lastHandleRect!=null){if(P==="w"){let Rt=S.left-this.lastHandleRect.left;f+=Rt}if(w==="n"){let Rt=S.top-this.lastHandleRect.top;u+=Rt}}this.lastHandleRect=S,P==="w"&&(f=-f),w==="n"&&(u=-u);let b=(a=(s=this.lastSize)==null?void 0:s.width)!=null?a:this.props.width,K=(i=(l=this.lastSize)==null?void 0:l.height)!=null?i:this.props.height,J=b+(g?f/this.props.transformScale:0),at=K+(z?u/this.props.transformScale:0);var ut=this.runConstraints(J,at);if(J=ut[0],at=ut[1],e==="onResizeStop"&&this.lastSize){var it=this.lastSize;J=it.width,at=it.height}let rt=J!==b||at!==K;e!=="onResizeStop"&&(this.lastSize={width:J,height:at});let et=typeof this.props[e]=="function"?this.props[e]:null;et&&!(e==="onResize"&&!rt)&&(r.persist==null||r.persist(),et(r,{node:c,size:{width:J,height:at},handle:n})),e==="onResizeStop"&&this.resetData()}}renderResizeHandle(e,n){let r=this.props.handle;if(!r)return ke.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+e,ref:n});if(typeof r=="function")return r(e,n);let o=typeof r.type=="string",a=fr({ref:n},o?{}:{handleAxis:e});return ke.cloneElement(r,a)}render(){let e=this.props,n=e.children,r=e.className,o=e.draggableOpts,a=e.width,s=e.height,i=e.handle,l=e.handleSize,c=e.lockAspectRatio,f=e.axis,u=e.minConstraints,g=e.maxConstraints,z=e.onResize,w=e.onResizeStop,P=e.onResizeStart,S=e.resizeHandles,b=e.transformScale,K=Si(e,wi);return(0,bi.cloneElement)(n,fr(fr({},K),{},{className:(r?r+" ":"")+"react-resizable",children:[...ke.Children.toArray(n.props.children),...S.map(J=>{var at;let ut=(at=this.handleRefs[J])!=null?at:this.handleRefs[J]=ke.createRef();return ke.createElement(yi.DraggableCore,pr({},o,{nodeRef:ut,key:"resizableHandle-"+J,onStop:this.resizeHandler("onResizeStop",J),onStart:this.resizeHandler("onResizeStart",J),onDrag:this.resizeHandler("onResize",J)}),this.renderResizeHandle(J,ut))})]}))}};mn.default=Ge;Ge.propTypes=vi.resizableProps;Ge.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var Lo=Mt(vn=>{"use strict";vn.__esModule=!0;vn.default=void 0;var gr=Mo((ct(),ge(ne))),Ri=ko(me()),Ei=ko(hr()),zi=dr(),Oi=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function ko(t){return t&&t.__esModule?t:{default:t}}function Mo(t,e){if(typeof WeakMap=="function")var n=new WeakMap,r=new WeakMap;return(Mo=function(o,a){if(!a&&o&&o.__esModule)return o;var s,i,l={__proto__:null,default:o};if(o===null||typeof o!="object"&&typeof o!="function")return l;if(s=a?r:n){if(s.has(o))return s.get(o);s.set(o,l)}for(let c in o)c!=="default"&&{}.hasOwnProperty.call(o,c)&&((i=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(o,c))&&(i.get||i.set)?s(l,c,i):l[c]=o[c]);return l})(t,e)}function mr(){return mr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},mr.apply(null,arguments)}function Po(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function yn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Po(Object(n),!0).forEach(function(r){Pi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Po(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Pi(t,e,n){return(e=ki(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ki(t){var e=Mi(t,"string");return typeof e=="symbol"?e:e+""}function Mi(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Li(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var bn=class extends gr.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(e,n)=>{let r=n.size;this.props.onResize?(e.persist==null||e.persist(),this.setState(r,()=>this.props.onResize&&this.props.onResize(e,n))):this.setState(r)}}static getDerivedStateFromProps(e,n){return n.propsWidth!==e.width||n.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null}render(){let e=this.props,n=e.handle,r=e.handleSize,o=e.onResize,a=e.onResizeStart,s=e.onResizeStop,i=e.draggableOpts,l=e.minConstraints,c=e.maxConstraints,f=e.lockAspectRatio,u=e.axis,g=e.width,z=e.height,w=e.resizeHandles,P=e.style,S=e.transformScale,b=Li(e,Oi);return gr.createElement(Ei.default,{axis:u,draggableOpts:i,handle:n,handleSize:r,height:this.state.height,lockAspectRatio:f,maxConstraints:c,minConstraints:l,onResizeStart:a,onResize:this.onResize,onResizeStop:s,resizeHandles:w,transformScale:S,width:this.state.width},gr.createElement("div",mr({},b,{style:yn(yn({},P),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};vn.default=bn;bn.propTypes=yn(yn({},zi.resizableProps),{},{children:Ri.default.element})});var No=Mt((Ll,wn)=>{"use strict";wn.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};wn.exports.Resizable=hr().default;wn.exports.ResizableBox=Lo().default});Ce();ct();function oe(t){let{margin:e,containerPadding:n,containerWidth:r,cols:o}=t;return(r-e[0]*(o-1)-n[0]*2)/o}function jt(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function We(t,e,n,r,o,a,s){let{margin:i,containerPadding:l,rowHeight:c}=t,f=oe(t),u,g,z,w;if(s?(u=Math.round(s.width),g=Math.round(s.height)):(u=jt(r,f,i[0]),g=jt(o,c,i[1])),a?(z=Math.round(a.top),w=Math.round(a.left)):s?(z=Math.round(s.top),w=Math.round(s.left)):(z=Math.round((c+i[1])*n+l[1]),w=Math.round((f+i[0])*e+l[0])),!a&&!s){if(Number.isFinite(r)){let S=Math.round((f+i[0])*(e+r)+l[0])-w-u;S!==i[0]&&(u+=S-i[0])}if(Number.isFinite(o)){let S=Math.round((c+i[1])*(n+o)+l[1])-z-g;S!==i[1]&&(g+=S-i[1])}}return{top:z,left:w,width:u,height:g}}function Pr(t,e,n,r,o){let{margin:a,containerPadding:s,cols:i,rowHeight:l,maxRows:c}=t,f=oe(t),u=Math.round((n-s[0])/(f+a[0])),g=Math.round((e-s[1])/(l+a[1]));return u=Be(u,0,i-r),g=Be(g,0,c-o),{x:u,y:g}}function Ae(t,e,n){let{margin:r,containerPadding:o,rowHeight:a}=t,s=oe(t),i=Math.round((n-o[0])/(s+r[0])),l=Math.round((e-o[1])/(a+r[1]));return{x:i,y:l}}function kr(t,e,n){let{margin:r,rowHeight:o}=t,a=oe(t),s=Math.max(1,Math.round((e+r[0])/(a+r[0]))),i=Math.max(1,Math.round((n+r[1])/(o+r[1])));return{w:s,h:i}}function Be(t,e,n){return Math.max(Math.min(t,n),e)}function an(t,e){return!(t.i===e.i||t.x+t.w<=e.x||t.x>=e.x+e.w||t.y+t.h<=e.y||t.y>=e.y+e.h)}function se(t,e){for(let n=0;n<t.length;n++){let r=t[n];if(r!==void 0&&an(r,e))return r}}function kn(t,e){return t.filter(n=>an(n,e))}function Ys(t,e){return e==="horizontal"?Mn(t):e==="vertical"||e==="wrap"?sn(t):[...t]}function sn(t){return[...t].sort((e,n)=>e.y!==n.y?e.y-n.y:e.x-n.x)}function Mn(t){return[...t].sort((e,n)=>e.x!==n.x?e.x-n.x:e.y-n.y)}function qe(t){let e=0;for(let n=0;n<t.length;n++){let r=t[n];if(r!==void 0){let o=r.y+r.h;o>e&&(e=o)}}return e}function ae(t,e){for(let n=0;n<t.length;n++){let r=t[n];if(r!==void 0&&r.i===e)return r}}function Ie(t){return t.filter(e=>e.static===!0)}function Gt(t){return{i:t.i,x:t.x,y:t.y,w:t.w,h:t.h,minW:t.minW,maxW:t.maxW,minH:t.minH,maxH:t.maxH,moved:!!t.moved,static:!!t.static,isDraggable:t.isDraggable,isResizable:t.isResizable,resizeHandles:t.resizeHandles,constraints:t.constraints,isBounded:t.isBounded}}function Re(t){let e=new Array(t.length);for(let n=0;n<t.length;n++){let r=t[n];r!==void 0&&(e[n]=Gt(r))}return e}function Xs(t,e){let n=new Array(t.length);for(let r=0;r<t.length;r++){let o=t[r];o!==void 0&&(e.i===o.i?n[r]=e:n[r]=o)}return n}function Mr(t,e,n){let r=ae(t,e);return r?(r=n(Gt(r)),[Xs(t,r),r]):[[...t],null]}function Ln(t,e){let n=Ie(t);for(let r=0;r<t.length;r++){let o=t[r];if(o!==void 0)if(o.x+o.w>e.cols&&(o.x=e.cols-o.w),o.x<0&&(o.x=0,o.w=e.cols),!o.static)n.push(o);else for(;se(n,o);)o.y++}return t}function re(t,e,n,r,o,a,s,i,l){if(e.static&&e.isDraggable!==!0)return[...t];if(e.y===r&&e.x===n)return[...t];let c=e.x,f=e.y;typeof n=="number"&&(e.x=n),typeof r=="number"&&(e.y=r),e.moved=!0;let u=Ys(t,s);(s==="vertical"&&typeof r=="number"?f>=r:s==="horizontal"&&typeof n=="number"&&c>=n)&&(u=u.reverse());let z=kn(u,e),w=z.length>0;if(w&&l)return Re(t);if(w&&a)return e.x=c,e.y=f,e.moved=!1,t;let P=[...t];for(let S=0;S<z.length;S++){let b=z[S];b!==void 0&&(b.moved||(b.static?P=Or(P,b,e,o,s):P=Or(P,e,b,o,s)))}return P}function Or(t,e,n,r,o,a){let s=o==="horizontal",i=o==="vertical",l=e.static;if(r){r=!1;let u={x:s?Math.max(e.x-n.w,0):n.x,y:i?Math.max(e.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},g=se(t,u),z=g!==void 0&&g.y+g.h>e.y,w=g!==void 0&&e.x+e.w>g.x;if(!g)return re(t,n,s?u.x:void 0,i?u.y:void 0,r,l,o);if(z&&i)return re(t,n,void 0,n.y+1,r,l,o);if(z&&o===null)return e.y=n.y,n.y=n.y+n.h,[...t];if(w&&s)return re(t,e,n.x,void 0,r,l,o)}let c=s?n.x+1:void 0,f=i?n.y+1:void 0;return c===void 0&&f===void 0?[...t]:re(t,n,c,f,r,l,o)}function Ee(t,e,n){return Math.max(e,Math.min(n,t))}var $s={name:"gridBounds",constrainPosition(t,e,n,{cols:r,maxRows:o}){return{x:Ee(e,0,Math.max(0,r-t.w)),y:Ee(n,0,Math.max(0,o-t.h))}},constrainSize(t,e,n,r,{cols:o,maxRows:a}){let s=r==="w"||r==="nw"||r==="sw"?t.x+t.w:o-t.x,i=r==="n"||r==="nw"||r==="ne"?t.y+t.h:a-t.y;return{w:Ee(e,1,Math.max(1,s)),h:Ee(n,1,Math.max(1,i))}}},Gs={name:"minMaxSize",constrainSize(t,e,n){return{w:Ee(e,t.minW??1,t.maxW??1/0),h:Ee(n,t.minH??1,t.maxH??1/0)}}};var Nn=[$s,Gs];function Ye(t,e,n,r,o){let a={x:n,y:r};for(let s of t)s.constrainPosition&&(a=s.constrainPosition(e,a.x,a.y,o));if(e.constraints)for(let s of e.constraints)s.constrainPosition&&(a=s.constrainPosition(e,a.x,a.y,o));return a}function Lr(t,e,n,r,o,a){let s={w:n,h:r};for(let i of t)i.constrainSize&&(s=i.constrainSize(e,s.w,s.h,o,a));if(e.constraints)for(let i of e.constraints)i.constrainSize&&(s=i.constrainSize(e,s.w,s.h,o,a));return s}function _n({top:t,left:e,width:n,height:r}){let o=`translate(${e}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${n}px`,height:`${r}px`,position:"absolute"}}function Nr({top:t,left:e,width:n,height:r}){return{top:`${t}px`,left:`${e}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function Tn(t){return t*100+"%"}function Fs(t,e,n,r){return t+n>r?e:n}function _r(t,e,n){return t<0?e:n}function Us(t){return Math.max(0,t)}function ln(t){return Math.max(0,t)}var jn=(t,e,n)=>{let{left:r,height:o,width:a}=e,s=t.top-(o-t.height);return{left:r,width:a,height:_r(s,t.height,o),top:ln(s)}},Hn=(t,e,n)=>{let{top:r,left:o,height:a,width:s}=e;return{top:r,height:a,width:Fs(t.left,t.width,s,n),left:Us(o)}},Bn=(t,e,n)=>{let{top:r,height:o,width:a}=e,s=t.left+t.width-a;return s<0?{height:o,width:t.left+t.width,top:ln(r),left:0}:{height:o,width:a,top:ln(r),left:s}},Wn=(t,e,n)=>{let{top:r,left:o,height:a,width:s}=e;return{width:s,left:o,height:_r(r,t.height,a),top:ln(r)}},Vs=(t,e,n)=>jn(t,Hn(t,e,n)),Ks=(t,e,n)=>jn(t,Bn(t,e)),Js=(t,e,n)=>Wn(t,Hn(t,e,n)),Zs=(t,e,n)=>Wn(t,Bn(t,e)),Qs={n:jn,ne:Vs,e:Hn,se:Js,s:Wn,sw:Zs,w:Bn,nw:Ks};function Tr(t,e,n,r){let o=Qs[t];return o?o(e,{...e,...n},r):n}var ta={type:"transform",scale:1,calcStyle(t){return _n(t)}};var jr=ta,Hr={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Br={enabled:!0,bounded:!1,threshold:3},Wr={enabled:!0,handles:["se"]},Ar={enabled:!1,defaultItem:{w:1,h:1}};function An(t,e,n,r,o){let a=r==="x"?"w":"h";e[r]+=1;let s=t.findIndex(l=>l.i===e.i),i=o??Ie(t).length>0;for(let l=s+1;l<t.length;l++){let c=t[l];if(c!==void 0&&!c.static){if(!i&&c.y>e.y+e.h)break;an(e,c)&&An(t,c,n+e[a],r,i)}}e[r]=n}function ea(t,e,n,r){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0),e.y=Math.min(r,e.y);e.y>0&&!se(t,e);)e.y--;let o;for(;(o=se(t,e))!==void 0;)An(n,e,o.y+o.h,"y");return e.y=Math.max(e.y,0),e}function na(t,e,n,r){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0);e.x>0&&!se(t,e);)e.x--;let o;for(;(o=se(t,e))!==void 0;)if(An(r,e,o.x+o.w,"x"),e.x+e.w>n)for(e.x=n-e.w,e.y++;e.x>0&&!se(t,e);)e.x--;return e.x=Math.max(e.x,0),e}var qr={type:"vertical",allowOverlap:!1,compact(t,e){let n=Ie(t),r=qe(n),o=sn(t),a=new Array(t.length);for(let s=0;s<o.length;s++){let i=o[s];if(i===void 0)continue;let l=Gt(i);l.static||(l=ea(n,l,o,r),r=Math.max(r,l.y+l.h),n.push(l));let c=t.indexOf(i);a[c]=l,l.moved=!1}return a}},Ir={type:"horizontal",allowOverlap:!1,compact(t,e){let n=Ie(t),r=Mn(t),o=new Array(t.length);for(let a=0;a<r.length;a++){let s=r[a];if(s===void 0)continue;let i=Gt(s);i.static||(i=na(n,i,e,r),n.push(i));let l=t.indexOf(s);o[l]=i,i.moved=!1}return o}},Yr={type:null,allowOverlap:!1,compact(t,e){return Re(t)}},ra={...qr,allowOverlap:!0,compact(t,e){return Re(t)}},oa={...Ir,allowOverlap:!0,compact(t,e){return Re(t)}},sa={...Yr,allowOverlap:!0};function Xr(t,e=!1,n=!1){let r;return e?t==="vertical"?r=ra:t==="horizontal"?r=oa:r=sa:t==="vertical"?r=qr:t==="horizontal"?r=Ir:r=Yr,n?{...r,preventCollision:n}:r}ct();function aa(t){let e=typeof globalThis.getComputedStyle=="function"?globalThis.getComputedStyle(t):null;if(!e)return t.clientWidth;let n=o=>{let a=Number.parseFloat(o);return Number.isFinite(a)?a:0},r=Number.parseFloat(e.width);return Number.isFinite(r)?Math.max(0,r):Math.max(0,t.clientWidth-n(e.paddingLeft)-n(e.paddingRight))}function qn(t={}){let{measureBeforeMount:e=!1,initialWidth:n=1280}=t,[r,o]=st(n),[a,s]=st(!e),i=I(null),l=I(null),c=U(()=>{let f=i.current;if(f){let u=Math.round(aa(f));o(g=>g===u?g:u),a||s(!0)}},[a]);return It(()=>{let f=i.current;if(f){if(c(),typeof ResizeObserver<"u"){let u=null;return l.current=new ResizeObserver(g=>{let z=g[0];if(z){let w=Math.round(z.contentRect.width);u!==null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{o(P=>P===w?P:w),u=null})}}),l.current.observe(f),()=>{u!==null&&cancelAnimationFrame(u),l.current&&(l.current.disconnect(),l.current=null)}}return()=>{l.current&&(l.current.disconnect(),l.current=null)}}},[c]),{width:r,mounted:a,containerRef:i,measureWidth:c}}ct();ct();var G=on(me(),1);Ce();function to(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=to(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function In(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=to(t))&&(r&&(r+=" "),r+=e);return r}var Yn=In;ct();var gt=on(me(),1);Ce();function Kn(t,e){for(let n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]}function eo(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function Xe(t){return typeof t=="number"&&!isNaN(t)}function yt(t){return parseInt(t,10)}function ze(t,e,n){if(t[e])return new Error(`Invalid prop ${e} passed to ${n} - do not set this, set it on the child.`)}var Xn=["Moz","Webkit","O","ms"];function ca(t="transform"){var e,n;if(typeof window>"u")return"";let r=(n=(e=window.document)==null?void 0:e.documentElement)==null?void 0:n.style;if(!r||t in r)return"";for(let o=0;o<Xn.length;o++)if(ao(t,Xn[o])in r)return Xn[o];return""}function ao(t,e){return e?`${e}${ua(t)}`:t}function ua(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):t[r]==="-"?n=!0:e+=t[r];return e}var da=ca(),$n="";function fa(t,e){var n;$n||($n=(n=Kn(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(o){return eo(t[o])}))!=null?n:"");let r=t[$n];return eo(r)?!!r.call(t,e):!1}function no(t,e,n){let r=t;do{if(fa(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Gn(t,e,n,r){if(!t)return;let o={capture:!0,...r},a=n;t.addEventListener?t.addEventListener(e,a,o):t.attachEvent?t.attachEvent("on"+e,a):t["on"+e]=a}function ye(t,e,n,r){if(!t)return;let o={capture:!0,...r},a=n;t.removeEventListener?t.removeEventListener(e,a,o):t.detachEvent?t.detachEvent("on"+e,a):t["on"+e]=null}function pa(t){let e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=yt(n.borderTopWidth),e+=yt(n.borderBottomWidth),e}function ha(t){let e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=yt(n.borderLeftWidth),e+=yt(n.borderRightWidth),e}function ga(t){let e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=yt(n.paddingTop),e-=yt(n.paddingBottom),e}function ma(t){let e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=yt(n.paddingLeft),e-=yt(n.paddingRight),e}function ya(t,e,n){let o=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),a=(t.clientX+e.scrollLeft-o.left)/n,s=(t.clientY+e.scrollTop-o.top)/n;return{x:a,y:s}}function ba(t,e){let n=io(t,e,"px");return{[ao("transform",da)]:n}}function va(t,e){return io(t,e,"")}function io({x:t,y:e},n,r){let o=`translate(${t}${r},${e}${r})`;if(n){let a=`${typeof n.x=="string"?n.x:n.x+r}`,s=`${typeof n.y=="string"?n.y:n.y+r}`;o=`translate(${a}, ${s})`+o}return o}function wa(t,e){return t.targetTouches&&Kn(t.targetTouches,n=>e===n.identifier)||t.changedTouches&&Kn(t.changedTouches,n=>e===n.identifier)}function Sa(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function xa(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0}function Da(t,e){if(!t)return;let n=t.getElementById("react-draggable-style-el");if(!n){n=t.createElement("style"),n.type="text/css",n.id="react-draggable-style-el";let r=e??xa();r&&n.setAttribute("nonce",r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
3
|
+
`,t.getElementsByTagName("head")[0].appendChild(n)}t.body&&li(t.body,"react-draggable-transparent-selection")}function ho(t){window.requestAnimationFrame?window.requestAnimationFrame(()=>{go(t)}):go(t)}function go(t){if(t)try{t.body&&ci(t.body,"react-draggable-transparent-selection");let e=t.selection;if(e)e.empty();else{let n=(t.defaultView||window).getSelection();n&&n.type!=="Caret"&&n.removeAllRanges()}}catch{}}function li(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp(`(?:^|\\s)${e}(?!\\S)`))||(t.className+=` ${e}`)}function ci(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g"),"")}function ui(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:pi(r);let o=ir(t);if(typeof r=="string"){let{ownerDocument:a}=o,s=a.defaultView;if(!s)throw new Error("Cannot resolve the owner window of the draggable node.");let i;if(r==="parent"?i=o.parentNode:i=o.getRootNode().querySelector(r),!(i instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');let l=i,c=s.getComputedStyle(o),p=s.getComputedStyle(l);r={left:-o.offsetLeft+St(p.paddingLeft)+St(c.marginLeft),top:-o.offsetTop+St(p.paddingTop)+St(c.marginTop),right:ti(l)-Za(o)-o.offsetLeft+St(p.paddingRight)-St(c.marginRight),bottom:Qa(l)-Ja(o)-o.offsetTop+St(p.paddingBottom)-St(c.marginBottom)}}return Ge(r.right)&&(e=Math.min(e,r.right)),Ge(r.bottom)&&(n=Math.min(n,r.bottom)),Ge(r.left)&&(e=Math.max(e,r.left)),Ge(r.top)&&(n=Math.max(n,r.top)),[e,n]}function mo(t,e,n){let r=Math.round(e/t[0])*t[0],o=Math.round(n/t[1])*t[1];return[r,o]}function di(t){return t.props.axis==="both"||t.props.axis==="x"}function fi(t){return t.props.axis==="both"||t.props.axis==="y"}function nr(t,e,n){let r=typeof e=="number"?oi(t,e):null;if(typeof e=="number"&&!r)return null;let o=ir(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return ei(r||t,a,n.props.scale)}function rr(t,e,n){let r=!Ge(t.lastX),o=ir(t);return r?{node:o,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:o,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function or(t,e){let n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function pi(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function ir(t){let e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}var sr=Pe((dt(),ge(ie))),xt=Pe(me()),hi=Pe((Ce(),ge(On))),gi=typeof process<"u"&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Ft=gi,qt={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},pe=qt.mouse,ve=class extends sr.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&(typeof t.button=="number"&&t.button!==0||t.ctrlKey))return!1;let e=this.findDOMNode();if(!e||!e.ownerDocument||!e.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:n}=e;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!po(t.target,this.props.handle,e)||this.props.cancel&&po(t.target,this.props.cancel,e))return;t.type==="touchstart"&&!this.props.allowMobileScroll&&t.preventDefault();let r=si(t);this.touchIdentifier=r;let o=nr(t,r,this);if(o==null)return;let{x:a,y:s}=o,i=rr(this,a,s);Ft("DraggableCore: handleDragStart: %j",i),Ft("calling",this.props.onStart),!(this.props.onStart(t,i)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ii(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=s,er(n,pe.move,this.handleDrag),er(n,pe.stop,this.handleDragStop))},this.handleDrag=t=>{let e=nr(t,this.touchIdentifier,this);if(e==null)return;let{x:n,y:r}=e;if(Array.isArray(this.props.grid)){let s=n-this.lastX,i=r-this.lastY;if([s,i]=mo(this.props.grid,s,i),!s&&!i)return;n=this.lastX+s,r=this.lastY+i}let o=rr(this,n,r);if(Ft("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{let s=document.createEvent("MouseEvents");s.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(s)}return}this.lastX=n,this.lastY=r},this.handleDragStop=t=>{if(!this.dragging)return;let e=nr(t,this.touchIdentifier,this);if(e==null)return;let{x:n,y:r}=e;if(Array.isArray(this.props.grid)){let i=n-this.lastX||0,l=r-this.lastY||0;[i,l]=mo(this.props.grid,i,l),n=this.lastX+i,r=this.lastY+l}let o=rr(this,n,r);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;let s=this.findDOMNode();s&&this.props.enableUserSelectHack&&ho(s.ownerDocument),Ft("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&(Ft("DraggableCore: Removing handlers"),be(s.ownerDocument,pe.move,this.handleDrag),be(s.ownerDocument,pe.stop,this.handleDragStop))},this.onMouseDown=t=>(pe=qt.mouse,this.handleDragStart(t)),this.onMouseUp=t=>(pe=qt.mouse,this.handleDragStop(t)),this.onTouchStart=t=>(pe=qt.touch,this.handleDragStart(t)),this.onTouchEnd=t=>(pe=qt.touch,this.handleDragStop(t))}componentDidMount(){this.mounted=!0;let t=this.findDOMNode();t&&er(t,qt.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let t=this.findDOMNode();if(t){let{ownerDocument:e}=t;be(e,qt.mouse.move,this.handleDrag),be(e,qt.touch.move,this.handleDrag),be(e,qt.mouse.stop,this.handleDragStop),be(e,qt.touch.stop,this.handleDragStop),be(t,qt.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&ho(e)}}findDOMNode(){var t;if((t=this.props)!=null&&t.nodeRef)return this.props.nodeRef.current;let e=hi.default;return typeof e.findDOMNode=="function"?e.findDOMNode(this):(Ft("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return sr.cloneElement(sr.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};ve.displayName="DraggableCore";ve.propTypes={allowAnyClick:xt.default.bool,allowMobileScroll:xt.default.bool,children:xt.default.node.isRequired,disabled:xt.default.bool,enableUserSelectHack:xt.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:xt.default.arrayOf(xt.default.number),handle:xt.default.string,cancel:xt.default.string,nodeRef:xt.default.object,nonce:xt.default.string,onStart:xt.default.func,onDrag:xt.default.func,onStop:xt.default.func,onMouseDown:xt.default.func,scale:xt.default.number,className:Oe,style:Oe,transform:Oe};ve.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var hn=class extends fn.Component{constructor(t){super(t),this.onDragStart=(e,n)=>{if(Ft("Draggable: onDragStart: %j",n),this.props.onStart(e,or(this,n))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,n)=>{if(!this.state.dragging)return!1;Ft("Draggable: onDrag: %j",n);let r=or(this,n),o={x:r.x,y:r.y,slackX:0,slackY:0};if(this.props.bounds){let{x:s,y:i}=o;o.x+=this.state.slackX,o.y+=this.state.slackY;let[l,c]=ui(this,o.x,o.y);o.x=l,o.y=c,o.slackX=this.state.slackX+(s-o.x),o.slackY=this.state.slackY+(i-o.y),r.x=o.x,r.y=o.y,r.deltaX=o.x-this.state.x,r.deltaY=o.y-this.state.y}if(this.props.onDrag(e,r)===!1)return!1;this.setState(o)},this.onDragStop=(e,n)=>{if(!this.state.dragging||this.props.onStop(e,or(this,n))===!1)return!1;Ft("Draggable: onDragStop: %j",n);let o={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){let{x:s,y:i}=this.props.position;o.x=s,o.y=i}this.setState(o)},this.state={dragging:!1,dragged:!1,x:t.position?t.position.x:t.defaultPosition.x,y:t.position?t.position.y:t.defaultPosition.y,prevPropsPosition:{...t.position},slackX:0,slackY:0,isElementSVG:!1},t.position&&!(t.onDrag||t.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:t},{prevPropsPosition:e}){return t&&(!e||t.x!==e.x||t.y!==e.y)?(Ft("Draggable: getDerivedStateFromProps %j",{position:t,prevPropsPosition:e}),{x:t.x,y:t.y,prevPropsPosition:{...t}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var t;if((t=this.props)!=null&&t.nodeRef)return this.props.nodeRef.current;let e=$a.default;return typeof e.findDOMNode=="function"?e.findDOMNode(this):null}render(){let{axis:t,bounds:e,children:n,defaultPosition:r,defaultClassName:o,defaultClassNameDragging:a,defaultClassNameDragged:s,position:i,positionOffset:l,scale:c,...p}=this.props,d={},h=null,S=!!!i||this.state.dragging,P=i||r,x={x:di(this)&&S?this.state.x:P.x,y:fi(this)&&S?this.state.y:P.y};this.state.isElementSVG?h=ri(x,l):d=ni(x,l);let b=fn.Children.only(n),lt=(0,Ga.clsx)(b.props.className||"",o,{[a]:this.state.dragging,[s]:this.state.dragged});return fn.createElement(ve,{...p,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},fn.cloneElement(b,{className:lt,style:{...b.props.style,...d},transform:h}))}};hn.displayName="Draggable";hn.propTypes={...ve.propTypes,axis:Z.default.oneOf(["both","x","y","none"]),bounds:Z.default.oneOfType([Z.default.shape({left:Z.default.number,right:Z.default.number,top:Z.default.number,bottom:Z.default.number}),Z.default.string,Z.default.oneOf([!1])]),defaultClassName:Z.default.string,defaultClassNameDragging:Z.default.string,defaultClassNameDragged:Z.default.string,defaultPosition:Z.default.shape({x:Z.default.number,y:Z.default.number}),positionOffset:Z.default.shape({x:Z.default.oneOfType([Z.default.number,Z.default.string]),y:Z.default.oneOfType([Z.default.number,Z.default.string])}),position:Z.default.shape({x:Z.default.number,y:Z.default.number}),className:Oe,style:Oe,transform:Oe};hn.defaultProps={...ve.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1}});var cr=Nt((Yl,gn)=>{"use strict";var lr=So(),mi=lr.DraggableCore,Do=lr.default||lr;gn.exports=Do;gn.exports.default=Do;gn.exports.DraggableCore=mi});var Eo=Nt(ur=>{"use strict";ur.__esModule=!0;ur.cloneElement=Si;var yi=bi((dt(),ge(ie)));function bi(t){return t&&t.__esModule?t:{default:t}}function Co(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Ro(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(n),!0).forEach(function(r){vi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Co(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function vi(t,e,n){return(e=wi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wi(t){var e=xi(t,"string");return typeof e=="symbol"?e:e+""}function xi(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Si(t,e){return e.style&&t.props.style&&(e.style=Ro(Ro({},t.props.style),e.style)),e.className&&t.props.className&&(e.className=t.props.className+" "+e.className),yi.default.cloneElement(t,e)}});var dr=Nt(mn=>{"use strict";mn.__esModule=!0;mn.resizableProps=void 0;var R=Di(me()),$l=cr();function Di(t){return t&&t.__esModule?t:{default:t}}var Gl=mn.resizableProps={axis:R.default.oneOf(["both","x","y","none"]),className:R.default.string,children:R.default.element.isRequired,draggableOpts:R.default.shape({allowAnyClick:R.default.bool,cancel:R.default.string,children:R.default.node,disabled:R.default.bool,enableUserSelectHack:R.default.bool,offsetParent:typeof Element<"u"?R.default.instanceOf(Element):R.default.any,grid:R.default.arrayOf(R.default.number),handle:R.default.string,nodeRef:R.default.object,onStart:R.default.func,onDrag:R.default.func,onStop:R.default.func,onMouseDown:R.default.func,scale:R.default.number}),height:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];let r=e[0];return r.axis==="both"||r.axis==="y"?R.default.number.isRequired(...e):R.default.number(...e)},handle:R.default.oneOfType([R.default.node,R.default.func]),handleSize:R.default.arrayOf(R.default.number),lockAspectRatio:R.default.bool,maxConstraints:R.default.arrayOf(R.default.number),minConstraints:R.default.arrayOf(R.default.number),onResizeStop:R.default.func,onResizeStart:R.default.func,onResize:R.default.func,resizeHandles:R.default.arrayOf(R.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:R.default.number,width:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];let r=e[0];return r.axis==="both"||r.axis==="x"?R.default.number.isRequired(...e):R.default.number(...e)}}});var hr=Nt(yn=>{"use strict";yn.__esModule=!0;yn.default=void 0;var ke=Oo((dt(),ge(ie))),Ci=cr(),Ri=Eo(),Ei=dr(),zi=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Oo(t,e){if(typeof WeakMap=="function")var n=new WeakMap,r=new WeakMap;return(Oo=function(o,a){if(!a&&o&&o.__esModule)return o;var s,i,l={__proto__:null,default:o};if(o===null||typeof o!="object"&&typeof o!="function")return l;if(s=a?r:n){if(s.has(o))return s.get(o);s.set(o,l)}for(let c in o)c!=="default"&&{}.hasOwnProperty.call(o,c)&&((i=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(o,c))&&(i.get||i.set)?s(l,c,i):l[c]=o[c]);return l})(t,e)}function pr(){return pr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pr.apply(null,arguments)}function Oi(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function zo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function fr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?zo(Object(n),!0).forEach(function(r){Pi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Pi(t,e,n){return(e=ki(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ki(t){var e=Mi(t,"string");return typeof e=="symbol"?e:e+""}function Mi(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Fe=class extends ke.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(e,n){let r=this.props,o=r.minConstraints,a=r.maxConstraints,s=r.lockAspectRatio;if(!o&&!a&&!s)return[e,n];if(s){let h=this.props.width/this.props.height,E=e-this.props.width,S=n-this.props.height;Math.abs(E)>Math.abs(S*h)?n=e/h:e=n*h}let i=e,l=n,c=this.slack||[0,0],p=c[0],d=c[1];return e+=p,n+=d,o&&(e=Math.max(o[0],e),n=Math.max(o[1],n)),a&&(e=Math.min(a[0],e),n=Math.min(a[1],n)),this.slack=[p+(i-e),d+(l-n)],[e,n]}resizeHandler(e,n){return(r,o)=>{var a,s,i,l;let c=o.node,p=o.deltaX,d=o.deltaY;e==="onResizeStart"&&this.resetData();let h=(this.props.axis==="both"||this.props.axis==="x")&&n!=="n"&&n!=="s",E=(this.props.axis==="both"||this.props.axis==="y")&&n!=="e"&&n!=="w";if(!h&&!E)return;let S=n[0],P=n[n.length-1],x=c.getBoundingClientRect();if(this.lastHandleRect!=null){if(P==="w"){let Dt=x.left-this.lastHandleRect.left;p+=Dt}if(S==="n"){let Dt=x.top-this.lastHandleRect.top;d+=Dt}}this.lastHandleRect=x,P==="w"&&(p=-p),S==="n"&&(d=-d);let b=(a=(s=this.lastSize)==null?void 0:s.width)!=null?a:this.props.width,lt=(i=(l=this.lastSize)==null?void 0:l.height)!=null?i:this.props.height,V=b+(h?p/this.props.transformScale:0),ct=lt+(E?d/this.props.transformScale:0);var nt=this.runConstraints(V,ct);if(V=nt[0],ct=nt[1],e==="onResizeStop"&&this.lastSize){var at=this.lastSize;V=at.width,ct=at.height}let ut=V!==b||ct!==lt;e!=="onResizeStop"&&(this.lastSize={width:V,height:ct});let $=typeof this.props[e]=="function"?this.props[e]:null;$&&!(e==="onResize"&&!ut)&&(r.persist==null||r.persist(),$(r,{node:c,size:{width:V,height:ct},handle:n})),e==="onResizeStop"&&this.resetData()}}renderResizeHandle(e,n){let r=this.props.handle;if(!r)return ke.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+e,ref:n});if(typeof r=="function")return r(e,n);let o=typeof r.type=="string",a=fr({ref:n},o?{}:{handleAxis:e});return ke.cloneElement(r,a)}render(){let e=this.props,n=e.children,r=e.className,o=e.draggableOpts,a=e.width,s=e.height,i=e.handle,l=e.handleSize,c=e.lockAspectRatio,p=e.axis,d=e.minConstraints,h=e.maxConstraints,E=e.onResize,S=e.onResizeStop,P=e.onResizeStart,x=e.resizeHandles,b=e.transformScale,lt=Oi(e,zi);return(0,Ri.cloneElement)(n,fr(fr({},lt),{},{className:(r?r+" ":"")+"react-resizable",children:[...ke.Children.toArray(n.props.children),...x.map(V=>{var ct;let nt=(ct=this.handleRefs[V])!=null?ct:this.handleRefs[V]=ke.createRef();return ke.createElement(Ci.DraggableCore,pr({},o,{nodeRef:nt,key:"resizableHandle-"+V,onStop:this.resizeHandler("onResizeStop",V),onStart:this.resizeHandler("onResizeStart",V),onDrag:this.resizeHandler("onResize",V)}),this.renderResizeHandle(V,nt))})]}))}};yn.default=Fe;Fe.propTypes=Ei.resizableProps;Fe.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var Lo=Nt(wn=>{"use strict";wn.__esModule=!0;wn.default=void 0;var gr=Mo((dt(),ge(ie))),Li=ko(me()),_i=ko(hr()),Ni=dr(),Ti=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function ko(t){return t&&t.__esModule?t:{default:t}}function Mo(t,e){if(typeof WeakMap=="function")var n=new WeakMap,r=new WeakMap;return(Mo=function(o,a){if(!a&&o&&o.__esModule)return o;var s,i,l={__proto__:null,default:o};if(o===null||typeof o!="object"&&typeof o!="function")return l;if(s=a?r:n){if(s.has(o))return s.get(o);s.set(o,l)}for(let c in o)c!=="default"&&{}.hasOwnProperty.call(o,c)&&((i=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(o,c))&&(i.get||i.set)?s(l,c,i):l[c]=o[c]);return l})(t,e)}function mr(){return mr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},mr.apply(null,arguments)}function Po(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function bn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Po(Object(n),!0).forEach(function(r){ji(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Po(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ji(t,e,n){return(e=Bi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bi(t){var e=Hi(t,"string");return typeof e=="symbol"?e:e+""}function Hi(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wi(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var vn=class extends gr.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(e,n)=>{let r=n.size;this.props.onResize?(e.persist==null||e.persist(),this.setState(r,()=>this.props.onResize&&this.props.onResize(e,n))):this.setState(r)}}static getDerivedStateFromProps(e,n){return n.propsWidth!==e.width||n.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null}render(){let e=this.props,n=e.handle,r=e.handleSize,o=e.onResize,a=e.onResizeStart,s=e.onResizeStop,i=e.draggableOpts,l=e.minConstraints,c=e.maxConstraints,p=e.lockAspectRatio,d=e.axis,h=e.width,E=e.height,S=e.resizeHandles,P=e.style,x=e.transformScale,b=Wi(e,Ti);return gr.createElement(_i.default,{axis:d,draggableOpts:i,handle:n,handleSize:r,height:this.state.height,lockAspectRatio:p,maxConstraints:c,minConstraints:l,onResizeStart:a,onResize:this.onResize,onResizeStop:s,resizeHandles:S,transformScale:x,width:this.state.width},gr.createElement("div",mr({},b,{style:bn(bn({},P),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};wn.default=vn;vn.propTypes=bn(bn({},Ni.resizableProps),{},{children:Li.default.element})});var _o=Nt((Kl,xn)=>{"use strict";xn.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};xn.exports.Resizable=hr().default;xn.exports.ResizableBox=Lo().default});Ce();dt();function ce(t){let{margin:e,containerPadding:n,containerWidth:r,cols:o}=t;return(r-e[0]*(o-1)-n[0]*2)/o}function Wt(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function Ae(t,e,n,r,o,a,s){let{margin:i,containerPadding:l,rowHeight:c}=t,p=ce(t),d,h,E,S;if(s?(d=Math.round(s.width),h=Math.round(s.height)):(d=Wt(r,p,i[0]),h=Wt(o,c,i[1])),a?(E=Math.round(a.top),S=Math.round(a.left)):s?(E=Math.round(s.top),S=Math.round(s.left)):(E=Math.round((c+i[1])*n+l[1]),S=Math.round((p+i[0])*e+l[0])),!a&&!s){if(Number.isFinite(r)){let x=Math.round((p+i[0])*(e+r)+l[0])-S-d;x!==i[0]&&(d+=x-i[0])}if(Number.isFinite(o)){let x=Math.round((c+i[1])*(n+o)+l[1])-E-h;x!==i[1]&&(h+=x-i[1])}}return{top:E,left:S,width:d,height:h}}function Pr(t,e,n,r,o){let{margin:a,containerPadding:s,cols:i,rowHeight:l,maxRows:c}=t,p=ce(t),d=Math.round((n-s[0])/(p+a[0])),h=Math.round((e-s[1])/(l+a[1]));return d=We(d,0,i-r),h=We(h,0,c-o),{x:d,y:h}}function qe(t,e,n){let{margin:r,containerPadding:o,rowHeight:a}=t,s=ce(t),i=Math.round((n-o[0])/(s+r[0])),l=Math.round((e-o[1])/(a+r[1]));return{x:i,y:l}}function kr(t,e,n){let{margin:r,rowHeight:o}=t,a=ce(t),s=Math.max(1,Math.round((e+r[0])/(a+r[0]))),i=Math.max(1,Math.round((n+r[1])/(o+r[1])));return{w:s,h:i}}function We(t,e,n){return Math.max(Math.min(t,n),e)}function ln(t,e){return!(t.i===e.i||t.x+t.w<=e.x||t.x>=e.x+e.w||t.y+t.h<=e.y||t.y>=e.y+e.h)}function ue(t,e){for(let n=0;n<t.length;n++){let r=t[n];if(r!==void 0&&ln(r,e))return r}}function kn(t,e){return t.filter(n=>ln(n,e))}function Ks(t,e){return e==="horizontal"?Mn(t):e==="vertical"||e==="wrap"?an(t):[...t]}function an(t){return[...t].sort((e,n)=>e.y!==n.y?e.y-n.y:e.x-n.x)}function Mn(t){return[...t].sort((e,n)=>e.x!==n.x?e.x-n.x:e.y-n.y)}function Ie(t){let e=0;for(let n=0;n<t.length;n++){let r=t[n];if(r!==void 0){let o=r.y+r.h;o>e&&(e=o)}}return e}function de(t,e){for(let n=0;n<t.length;n++){let r=t[n];if(r!==void 0&&r.i===e)return r}}function Ye(t){return t.filter(e=>e.static===!0)}function Qt(t){return{i:t.i,x:t.x,y:t.y,w:t.w,h:t.h,minW:t.minW,maxW:t.maxW,minH:t.minH,maxH:t.maxH,moved:!!t.moved,static:!!t.static,isDraggable:t.isDraggable,isResizable:t.isResizable,resizeHandles:t.resizeHandles,constraints:t.constraints,isBounded:t.isBounded}}function Re(t){let e=new Array(t.length);for(let n=0;n<t.length;n++){let r=t[n];r!==void 0&&(e[n]=Qt(r))}return e}function Js(t,e){let n=new Array(t.length);for(let r=0;r<t.length;r++){let o=t[r];o!==void 0&&(e.i===o.i?n[r]=e:n[r]=o)}return n}function Mr(t,e,n){let r=de(t,e);return r?(r=n(Qt(r)),[Js(t,r),r]):[[...t],null]}function Ln(t,e){let n=Ye(t);for(let r=0;r<t.length;r++){let o=t[r];if(o!==void 0)if(o.x+o.w>e.cols&&(o.x=e.cols-o.w),o.x<0&&(o.x=0,o.w=e.cols),!o.static)n.push(o);else for(;ue(n,o);)o.y++}return t}function le(t,e,n,r,o,a,s,i,l){if(e.static&&e.isDraggable!==!0)return[...t];if(e.y===r&&e.x===n)return[...t];let c=e.x,p=e.y;typeof n=="number"&&(e.x=n),typeof r=="number"&&(e.y=r),e.moved=!0;let d=Ks(t,s);(s==="vertical"&&typeof r=="number"?p>=r:s==="horizontal"&&typeof n=="number"&&c>=n)&&(d=d.reverse());let E=kn(d,e),S=E.length>0;if(S&&l)return Re(t);if(S&&a)return e.x=c,e.y=p,e.moved=!1,t;let P=[...t];for(let x=0;x<E.length;x++){let b=E[x];b!==void 0&&(b.moved||(b.static?P=Or(P,b,e,o,s):P=Or(P,e,b,o,s)))}return P}function Or(t,e,n,r,o,a){let s=o==="horizontal",i=o==="vertical",l=e.static;if(r){r=!1;let d={x:s?Math.max(e.x-n.w,0):n.x,y:i?Math.max(e.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=ue(t,d),E=h!==void 0&&h.y+h.h>e.y,S=h!==void 0&&e.x+e.w>h.x;if(!h)return le(t,n,s?d.x:void 0,i?d.y:void 0,r,l,o);if(E&&i)return le(t,n,void 0,n.y+1,r,l,o);if(E&&o===null)return e.y=n.y,n.y=n.y+n.h,[...t];if(S&&s)return le(t,e,n.x,void 0,r,l,o)}let c=s?n.x+1:void 0,p=i?n.y+1:void 0;return c===void 0&&p===void 0?[...t]:le(t,n,c,p,r,l,o)}function Ee(t,e,n){return Math.max(e,Math.min(n,t))}var Zs={name:"gridBounds",constrainPosition(t,e,n,{cols:r,maxRows:o}){return{x:Ee(e,0,Math.max(0,r-t.w)),y:Ee(n,0,Math.max(0,o-t.h))}},constrainSize(t,e,n,r,{cols:o,maxRows:a}){let s=r==="w"||r==="nw"||r==="sw"?t.x+t.w:o-t.x,i=r==="n"||r==="nw"||r==="ne"?t.y+t.h:a-t.y;return{w:Ee(e,1,Math.max(1,s)),h:Ee(n,1,Math.max(1,i))}}},Qs={name:"minMaxSize",constrainSize(t,e,n){return{w:Ee(e,t.minW??1,t.maxW??1/0),h:Ee(n,t.minH??1,t.maxH??1/0)}}};var _n=[Zs,Qs];function Xe(t,e,n,r,o){let a={x:n,y:r};for(let s of t)s.constrainPosition&&(a=s.constrainPosition(e,a.x,a.y,o));if(e.constraints)for(let s of e.constraints)s.constrainPosition&&(a=s.constrainPosition(e,a.x,a.y,o));return a}function Lr(t,e,n,r,o,a){let s={w:n,h:r};for(let i of t)i.constrainSize&&(s=i.constrainSize(e,s.w,s.h,o,a));if(e.constraints)for(let i of e.constraints)i.constrainSize&&(s=i.constrainSize(e,s.w,s.h,o,a));return s}function Nn({top:t,left:e,width:n,height:r}){let o=`translate(${e}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${n}px`,height:`${r}px`,position:"absolute"}}function _r({top:t,left:e,width:n,height:r}){return{top:`${t}px`,left:`${e}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function Tn(t){return t*100+"%"}function ta(t,e,n,r){return t+n>r?e:n}function Nr(t,e,n){return t<0?e:n}function ea(t){return Math.max(0,t)}function cn(t){return Math.max(0,t)}var jn=(t,e,n)=>{let{left:r,height:o,width:a}=e,s=t.top-(o-t.height);return{left:r,width:a,height:Nr(s,t.height,o),top:cn(s)}},Bn=(t,e,n)=>{let{top:r,left:o,height:a,width:s}=e;return{top:r,height:a,width:ta(t.left,t.width,s,n),left:ea(o)}},Hn=(t,e,n)=>{let{top:r,height:o,width:a}=e,s=t.left+t.width-a;return s<0?{height:o,width:t.left+t.width,top:cn(r),left:0}:{height:o,width:a,top:cn(r),left:s}},Wn=(t,e,n)=>{let{top:r,left:o,height:a,width:s}=e;return{width:s,left:o,height:Nr(r,t.height,a),top:cn(r)}},na=(t,e,n)=>jn(t,Bn(t,e,n)),ra=(t,e,n)=>jn(t,Hn(t,e)),oa=(t,e,n)=>Wn(t,Bn(t,e,n)),sa=(t,e,n)=>Wn(t,Hn(t,e)),aa={n:jn,ne:na,e:Bn,se:oa,s:Wn,sw:sa,w:Hn,nw:ra};function Tr(t,e,n,r){let o=aa[t];return o?o(e,{...e,...n},r):n}var ia={type:"transform",scale:1,calcStyle(t){return Nn(t)}};var jr=ia,Br={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Hr={enabled:!0,bounded:!1,threshold:3},Wr={enabled:!0,handles:["se"]},Ar={enabled:!1,defaultItem:{w:1,h:1}};function An(t,e,n,r,o){let a=r==="x"?"w":"h";e[r]+=1;let s=t.findIndex(l=>l.i===e.i),i=o??Ye(t).length>0;for(let l=s+1;l<t.length;l++){let c=t[l];if(c!==void 0&&!c.static){if(!i&&c.y>e.y+e.h)break;ln(e,c)&&An(t,c,n+e[a],r,i)}}e[r]=n}function la(t,e,n,r){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0),e.y=Math.min(r,e.y);e.y>0&&!ue(t,e);)e.y--;let o;for(;(o=ue(t,e))!==void 0;)An(n,e,o.y+o.h,"y");return e.y=Math.max(e.y,0),e}function ca(t,e,n,r){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0);e.x>0&&!ue(t,e);)e.x--;let o;for(;(o=ue(t,e))!==void 0;)if(An(r,e,o.x+o.w,"x"),e.x+e.w>n)for(e.x=n-e.w,e.y++;e.x>0&&!ue(t,e);)e.x--;return e.x=Math.max(e.x,0),e}var qr={type:"vertical",allowOverlap:!1,compact(t,e){let n=Ye(t),r=Ie(n),o=an(t),a=new Array(t.length);for(let s=0;s<o.length;s++){let i=o[s];if(i===void 0)continue;let l=Qt(i);l.static||(l=la(n,l,o,r),r=Math.max(r,l.y+l.h),n.push(l));let c=t.indexOf(i);a[c]=l,l.moved=!1}return a}},Ir={type:"horizontal",allowOverlap:!1,compact(t,e){let n=Ye(t),r=Mn(t),o=new Array(t.length);for(let a=0;a<r.length;a++){let s=r[a];if(s===void 0)continue;let i=Qt(s);i.static||(i=ca(n,i,e,r),n.push(i));let l=t.indexOf(s);o[l]=i,i.moved=!1}return o}},Yr={type:null,allowOverlap:!1,compact(t,e){return Re(t)}},ua={...qr,allowOverlap:!0,compact(t,e){return Re(t)}},da={...Ir,allowOverlap:!0,compact(t,e){return Re(t)}},fa={...Yr,allowOverlap:!0};function Xr(t,e=!1,n=!1){let r;return e?t==="vertical"?r=ua:t==="horizontal"?r=da:r=fa:t==="vertical"?r=qr:t==="horizontal"?r=Ir:r=Yr,n?{...r,preventCollision:n}:r}dt();function pa(t){let e=typeof globalThis.getComputedStyle=="function"?globalThis.getComputedStyle(t):null;if(!e)return t.clientWidth;let n=o=>{let a=Number.parseFloat(o);return Number.isFinite(a)?a:0},r=Number.parseFloat(e.width);return Number.isFinite(r)?Math.max(0,r):Math.max(0,t.clientWidth-n(e.paddingLeft)-n(e.paddingRight))}function qn(t={}){let{measureBeforeMount:e=!1,initialWidth:n=1280}=t,[r,o]=ot(n),[a,s]=ot(!e),i=M(null),l=M(null),c=J(()=>{let p=i.current;if(p){let d=Math.round(pa(p));o(h=>h===d?h:d),a||s(!0)}},[a]);return Ht(()=>{let p=i.current;if(p){if(c(),typeof ResizeObserver<"u"){let d=null;return l.current=new ResizeObserver(h=>{let E=h[0];if(E){let S=Math.round(E.contentRect.width);d!==null&&cancelAnimationFrame(d),d=requestAnimationFrame(()=>{o(P=>P===S?P:S),d=null})}}),l.current.observe(p),()=>{d!==null&&cancelAnimationFrame(d),l.current&&(l.current.disconnect(),l.current=null)}}return()=>{l.current&&(l.current.disconnect(),l.current=null)}}},[c]),{width:r,mounted:a,containerRef:i,measureWidth:c}}dt();dt();var U=sn(me(),1);Ce();function to(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=to(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function In(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=to(t))&&(r&&(r+=" "),r+=e);return r}var Yn=In;dt();var yt=sn(me(),1);Ce();function Kn(t,e){for(let n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]}function eo(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function $e(t){return typeof t=="number"&&!isNaN(t)}function wt(t){return parseInt(t,10)}function ze(t,e,n){if(t[e])return new Error(`Invalid prop ${e} passed to ${n} - do not set this, set it on the child.`)}var Xn=["Moz","Webkit","O","ms"];function ma(t="transform"){var e,n;if(typeof window>"u")return"";let r=(n=(e=window.document)==null?void 0:e.documentElement)==null?void 0:n.style;if(!r||t in r)return"";for(let o=0;o<Xn.length;o++)if(ao(t,Xn[o])in r)return Xn[o];return""}function ao(t,e){return e?`${e}${ya(t)}`:t}function ya(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):t[r]==="-"?n=!0:e+=t[r];return e}var ba=ma(),$n="";function va(t,e){var n;$n||($n=(n=Kn(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(o){return eo(t[o])}))!=null?n:"");let r=t[$n];return eo(r)?!!r.call(t,e):!1}function no(t,e,n){let r=t;do{if(va(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Gn(t,e,n,r){if(!t)return;let o={capture:!0,...r},a=n;t.addEventListener?t.addEventListener(e,a,o):t.attachEvent?t.attachEvent("on"+e,a):t["on"+e]=a}function ye(t,e,n,r){if(!t)return;let o={capture:!0,...r},a=n;t.removeEventListener?t.removeEventListener(e,a,o):t.detachEvent?t.detachEvent("on"+e,a):t["on"+e]=null}function wa(t){let e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=wt(n.borderTopWidth),e+=wt(n.borderBottomWidth),e}function xa(t){let e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=wt(n.borderLeftWidth),e+=wt(n.borderRightWidth),e}function Sa(t){let e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=wt(n.paddingTop),e-=wt(n.paddingBottom),e}function Da(t){let e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=wt(n.paddingLeft),e-=wt(n.paddingRight),e}function Ca(t,e,n){let o=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),a=(t.clientX+e.scrollLeft-o.left)/n,s=(t.clientY+e.scrollTop-o.top)/n;return{x:a,y:s}}function Ra(t,e){let n=io(t,e,"px");return{[ao("transform",ba)]:n}}function Ea(t,e){return io(t,e,"")}function io({x:t,y:e},n,r){let o=`translate(${t}${r},${e}${r})`;if(n){let a=`${typeof n.x=="string"?n.x:n.x+r}`,s=`${typeof n.y=="string"?n.y:n.y+r}`;o=`translate(${a}, ${s})`+o}return o}function za(t,e){return t.targetTouches&&Kn(t.targetTouches,n=>e===n.identifier)||t.changedTouches&&Kn(t.changedTouches,n=>e===n.identifier)}function Oa(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function Pa(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0}function ka(t,e){if(!t)return;let n=t.getElementById("react-draggable-style-el");if(!n){n=t.createElement("style"),n.type="text/css",n.id="react-draggable-style-el";let r=e??Pa();r&&n.setAttribute("nonce",r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
4
4
|
`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
5
|
-
`,t.getElementsByTagName("head")[0].appendChild(n)}t.body&&Ca(t.body,"react-draggable-transparent-selection")}function ro(t){window.requestAnimationFrame?window.requestAnimationFrame(()=>{oo(t)}):oo(t)}function oo(t){if(t)try{t.body&&Ra(t.body,"react-draggable-transparent-selection");let e=t.selection;if(e)e.empty();else{let n=(t.defaultView||window).getSelection();n&&n.type!=="Caret"&&n.removeAllRanges()}}catch{}}function Ca(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp(`(?:^|\\s)${e}(?!\\S)`))||(t.className+=` ${e}`)}function Ra(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g"),"")}function Ea(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:Pa(r);let o=Jn(t);if(typeof r=="string"){let{ownerDocument:a}=o,s=a.defaultView;if(!s)throw new Error("Cannot resolve the owner window of the draggable node.");let i;if(r==="parent"?i=o.parentNode:i=o.getRootNode().querySelector(r),!(i instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');let l=i,c=s.getComputedStyle(o),f=s.getComputedStyle(l);r={left:-o.offsetLeft+yt(f.paddingLeft)+yt(c.marginLeft),top:-o.offsetTop+yt(f.paddingTop)+yt(c.marginTop),right:ma(l)-ha(o)-o.offsetLeft+yt(f.paddingRight)-yt(c.marginRight),bottom:ga(l)-pa(o)-o.offsetTop+yt(f.paddingBottom)-yt(c.marginBottom)}}return Xe(r.right)&&(e=Math.min(e,r.right)),Xe(r.bottom)&&(n=Math.min(n,r.bottom)),Xe(r.left)&&(e=Math.max(e,r.left)),Xe(r.top)&&(n=Math.max(n,r.top)),[e,n]}function so(t,e,n){let r=Math.round(e/t[0])*t[0],o=Math.round(n/t[1])*t[1];return[r,o]}function za(t){return t.props.axis==="both"||t.props.axis==="x"}function Oa(t){return t.props.axis==="both"||t.props.axis==="y"}function Fn(t,e,n){let r=typeof e=="number"?wa(t,e):null;if(typeof e=="number"&&!r)return null;let o=Jn(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return ya(r||t,a,n.props.scale)}function Un(t,e,n){let r=!Xe(t.lastX),o=Jn(t);return r?{node:o,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:o,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function Vn(t,e){let n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function Pa(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function Jn(t){let e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}var ka=typeof process<"u"&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Yt=ka,Ht={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},ie=Ht.mouse,Ft=class extends je{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&(typeof t.button=="number"&&t.button!==0||t.ctrlKey))return!1;let e=this.findDOMNode();if(!e||!e.ownerDocument||!e.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:n}=e;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!no(t.target,this.props.handle,e)||this.props.cancel&&no(t.target,this.props.cancel,e))return;t.type==="touchstart"&&!this.props.allowMobileScroll&&t.preventDefault();let r=Sa(t);this.touchIdentifier=r;let o=Fn(t,r,this);if(o==null)return;let{x:a,y:s}=o,i=Un(this,a,s);Yt("DraggableCore: handleDragStart: %j",i),Yt("calling",this.props.onStart),!(this.props.onStart(t,i)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&Da(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=s,Gn(n,ie.move,this.handleDrag),Gn(n,ie.stop,this.handleDragStop))},this.handleDrag=t=>{let e=Fn(t,this.touchIdentifier,this);if(e==null)return;let{x:n,y:r}=e;if(Array.isArray(this.props.grid)){let s=n-this.lastX,i=r-this.lastY;if([s,i]=so(this.props.grid,s,i),!s&&!i)return;n=this.lastX+s,r=this.lastY+i}let o=Un(this,n,r);if(Yt("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{let s=document.createEvent("MouseEvents");s.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(s)}return}this.lastX=n,this.lastY=r},this.handleDragStop=t=>{if(!this.dragging)return;let e=Fn(t,this.touchIdentifier,this);if(e==null)return;let{x:n,y:r}=e;if(Array.isArray(this.props.grid)){let i=n-this.lastX||0,l=r-this.lastY||0;[i,l]=so(this.props.grid,i,l),n=this.lastX+i,r=this.lastY+l}let o=Un(this,n,r);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;let s=this.findDOMNode();s&&this.props.enableUserSelectHack&&ro(s.ownerDocument),Yt("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&(Yt("DraggableCore: Removing handlers"),ye(s.ownerDocument,ie.move,this.handleDrag),ye(s.ownerDocument,ie.stop,this.handleDragStop))},this.onMouseDown=t=>(ie=Ht.mouse,this.handleDragStart(t)),this.onMouseUp=t=>(ie=Ht.mouse,this.handleDragStop(t)),this.onTouchStart=t=>(ie=Ht.touch,this.handleDragStart(t)),this.onTouchEnd=t=>(ie=Ht.touch,this.handleDragStop(t))}componentDidMount(){this.mounted=!0;let t=this.findDOMNode();t&&Gn(t,Ht.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let t=this.findDOMNode();if(t){let{ownerDocument:e}=t;ye(e,Ht.mouse.move,this.handleDrag),ye(e,Ht.touch.move,this.handleDrag),ye(e,Ht.mouse.stop,this.handleDragStop),ye(e,Ht.touch.stop,this.handleDragStop),ye(t,Ht.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&ro(e)}}findDOMNode(){var t;if((t=this.props)!=null&&t.nodeRef)return this.props.nodeRef.current;let e=_e;return typeof e.findDOMNode=="function"?e.findDOMNode(this):(Yt("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return He(Te.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Ft.displayName="DraggableCore";Ft.propTypes={allowAnyClick:gt.default.bool,allowMobileScroll:gt.default.bool,children:gt.default.node.isRequired,disabled:gt.default.bool,enableUserSelectHack:gt.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:gt.default.arrayOf(gt.default.number),handle:gt.default.string,cancel:gt.default.string,nodeRef:gt.default.object,nonce:gt.default.string,onStart:gt.default.func,onDrag:gt.default.func,onStop:gt.default.func,onMouseDown:gt.default.func,scale:gt.default.number,className:ze,style:ze,transform:ze};Ft.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var un=class extends je{constructor(t){super(t),this.onDragStart=(e,n)=>{if(Yt("Draggable: onDragStart: %j",n),this.props.onStart(e,Vn(this,n))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,n)=>{if(!this.state.dragging)return!1;Yt("Draggable: onDrag: %j",n);let r=Vn(this,n),o={x:r.x,y:r.y,slackX:0,slackY:0};if(this.props.bounds){let{x:s,y:i}=o;o.x+=this.state.slackX,o.y+=this.state.slackY;let[l,c]=Ea(this,o.x,o.y);o.x=l,o.y=c,o.slackX=this.state.slackX+(s-o.x),o.slackY=this.state.slackY+(i-o.y),r.x=o.x,r.y=o.y,r.deltaX=o.x-this.state.x,r.deltaY=o.y-this.state.y}if(this.props.onDrag(e,r)===!1)return!1;this.setState(o)},this.onDragStop=(e,n)=>{if(!this.state.dragging||this.props.onStop(e,Vn(this,n))===!1)return!1;Yt("Draggable: onDragStop: %j",n);let o={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){let{x:s,y:i}=this.props.position;o.x=s,o.y=i}this.setState(o)},this.state={dragging:!1,dragged:!1,x:t.position?t.position.x:t.defaultPosition.x,y:t.position?t.position.y:t.defaultPosition.y,prevPropsPosition:{...t.position},slackX:0,slackY:0,isElementSVG:!1},t.position&&!(t.onDrag||t.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:t},{prevPropsPosition:e}){return t&&(!e||t.x!==e.x||t.y!==e.y)?(Yt("Draggable: getDerivedStateFromProps %j",{position:t,prevPropsPosition:e}),{x:t.x,y:t.y,prevPropsPosition:{...t}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var t;if((t=this.props)!=null&&t.nodeRef)return this.props.nodeRef.current;let e=_e;return typeof e.findDOMNode=="function"?e.findDOMNode(this):null}render(){let{axis:t,bounds:e,children:n,defaultPosition:r,defaultClassName:o,defaultClassNameDragging:a,defaultClassNameDragged:s,position:i,positionOffset:l,scale:c,...f}=this.props,u={},g=null,w=!!!i||this.state.dragging,P=i||r,S={x:za(this)&&w?this.state.x:P.x,y:Oa(this)&&w?this.state.y:P.y};this.state.isElementSVG?g=va(S,l):u=ba(S,l);let b=Te.only(n),K=In(b.props.className||"",o,{[a]:this.state.dragging,[s]:this.state.dragged});return Pn(Ft,{...f,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},He(b,{className:K,style:{...b.props.style,...u},transform:g}))}};un.displayName="Draggable";un.propTypes={...Ft.propTypes,axis:G.default.oneOf(["both","x","y","none"]),bounds:G.default.oneOfType([G.default.shape({left:G.default.number,right:G.default.number,top:G.default.number,bottom:G.default.number}),G.default.string,G.default.oneOf([!1])]),defaultClassName:G.default.string,defaultClassNameDragging:G.default.string,defaultClassNameDragged:G.default.string,defaultPosition:G.default.shape({x:G.default.number,y:G.default.number}),positionOffset:G.default.shape({x:G.default.oneOfType([G.default.number,G.default.string]),y:G.default.oneOfType([G.default.number,G.default.string])}),position:G.default.shape({x:G.default.number,y:G.default.number}),className:ze,style:ze,transform:ze};un.defaultProps={...Ft.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1};var Bo=on(No(),1);var _o=globalThis.React,Nl=_o.Fragment,ce=(t,e,n)=>_o.createElement(t,n===void 0?e:{...e,key:n}),To=ce;var we=on(Gr(),1);function yr(t){let{children:e,cols:n,containerWidth:r,margin:o,containerPadding:a,rowHeight:s,maxRows:i,isDraggable:l,isResizable:c,isBounded:f,static:u,useCSSTransforms:g=!0,usePercentages:z=!1,transformScale:w=1,positionStrategy:P,dragThreshold:S=0,droppingPosition:b,className:K="",style:J,handle:at="",cancel:ut="",x:it,y:rt,w:et,h:lt,minW:Rt=1,maxW:Wt=1/0,minH:C=1,maxH:R=1/0,i:Y,resizeHandles:Ot,resizeHandle:xt,constraints:Et=Nn,layoutItem:ue,layout:de=[],onDragStart:Nt,onDrag:Vt,onDragStop:Kt,onResizeStart:fe,onResize:pe,onResizeStop:he}=t,[d,m]=st(!1),[k,y]=st(!1),x=I(null),D=I({left:0,top:0}),j=I({top:0,left:0,width:0,height:0}),F=I(void 0),W=I(de);W.current=de;let ot=I(null),M=I(null),N=I(!1),pt=I({x:0,y:0}),X=I(!1),B=Ct(()=>({cols:n,containerPadding:a,containerWidth:r,margin:o,maxRows:i,rowHeight:s}),[n,a,r,o,i,s]),$=Ct(()=>({cols:n,maxRows:i,containerWidth:r,containerHeight:0,rowHeight:s,margin:o,layout:[]}),[n,i,r,s,o]),ht=U(()=>({...$,layout:W.current}),[$]),_t=Ct(()=>ue??{i:Y,x:it,y:rt,w:et,h:lt,minW:Rt,maxW:Wt,minH:C,maxH:R},[ue,Y,it,rt,et,lt,Rt,Wt,C,R]),Ue=U(_=>{if(P?.calcStyle)return P.calcStyle(_);if(g)return _n(_);let H=Nr(_);return z?{...H,left:Tn(_.left/r),width:Tn(_.width/r)}:H},[P,g,z,r]),At=U((_,{node:H})=>{if(!Nt)return;let{offsetParent:nt}=H;if(!nt)return;let A=nt.getBoundingClientRect(),dt=H.getBoundingClientRect(),wt=dt.left/w,Dt=A.left/w,St=dt.top/w,Pt=A.top/w,kt;if(P?.calcDragPosition){let O=_;kt=P.calcDragPosition(O.clientX,O.clientY,O.clientX-dt.left,O.clientY-dt.top)}else kt={left:wt-Dt+nt.scrollLeft,top:St-Pt+nt.scrollTop};if(D.current=kt,S>0){let O=_;pt.current={x:O.clientX,y:O.clientY},N.current=!0,X.current=!1,m(!0);return}m(!0);let te=Ae(B,kt.top,kt.left),{x:ee,y:h}=Ye(Et,_t,te.x,te.y,ht());Nt(Y,ee,h,{e:_,node:H,newPosition:kt})},[Nt,w,B,P,S,Et,_t,ht,Y]),Se=U((_,{node:H,deltaX:nt,deltaY:A})=>{if(!Vt||!d)return;let dt=_;if(N.current&&!X.current){let ee=dt.clientX-pt.current.x,h=dt.clientY-pt.current.y;if(Math.hypot(ee,h)<S)return;if(X.current=!0,N.current=!1,Nt){let v=Ae(B,D.current.top,D.current.left),{x:L,y:q}=Ye(Et,_t,v.x,v.y,ht());Nt(Y,L,q,{e:_,node:H,newPosition:D.current})}}let wt=D.current.top+A,Dt=D.current.left+nt;if(f){let{offsetParent:ee}=H;if(ee){let h=ee.clientHeight-jt(lt,s,o[1]);wt=Be(wt,0,h);let O=oe(B),v=r-jt(et,O,o[0]);Dt=Be(Dt,0,v)}}let St={top:wt,left:Dt};D.current=St;let Pt=Ae(B,wt,Dt),{x:kt,y:te}=Ye(Et,_t,Pt.x,Pt.y,ht());Vt(Y,kt,te,{e:_,node:H,newPosition:St})},[Vt,Nt,d,S,f,lt,s,o,B,r,et,Y,Et,_t,ht]),Jt=U((_,{node:H})=>{if(!Kt||!d)return;let nt=N.current;if(N.current=!1,X.current=!1,pt.current={x:0,y:0},nt){m(!1),D.current={left:0,top:0};return}let{left:A,top:dt}=D.current,wt={top:dt,left:A};m(!1),D.current={left:0,top:0};let Dt=Ae(B,dt,A),{x:St,y:Pt}=Ye(Et,_t,Dt.x,Dt.y,ht());Kt(Y,St,Pt,{e:_,node:H,newPosition:wt})},[Kt,d,B,Et,_t,ht,Y]);ot.current=At,M.current=Se;let Tt=U((_,{node:H,size:nt,handle:A},dt,wt)=>{let Dt=wt==="onResizeStart"?fe:wt==="onResize"?pe:he;if(!Dt)return;let St;H?St=Tr(A,dt,nt,r):St={...nt,top:dt.top,left:dt.left},j.current=St;let Pt=kr(B,St.width,St.height),{w:kt,h:te}=Lr(Et,_t,Pt.w,Pt.h,A,ht());Dt(Y,kt,te,{e:_.nativeEvent??_,node:H,size:St,handle:A})},[fe,pe,he,r,B,Y,Et,_t,ht]),xe=U((_,H)=>{y(!0);let nt=We(B,it,rt,et,lt),A={...H,handle:H.handle};Tt(_,A,nt,"onResizeStart")},[Tt,B,it,rt,et,lt]),De=U((_,H)=>{let nt=We(B,it,rt,et,lt),A={...H,handle:H.handle};Tt(_,A,nt,"onResize")},[Tt,B,it,rt,et,lt]),Zt=U((_,H)=>{y(!1),j.current={top:0,left:0,width:0,height:0};let nt=We(B,it,rt,et,lt),A={...H,handle:H.handle};Tt(_,A,nt,"onResizeStop")},[Tt,B,it,rt,et,lt]);It(()=>{if(!b)return;let _=x.current;if(!_)return;let H=F.current||{left:0,top:0},nt=d&&(b.left!==H.left||b.top!==H.top);if(d){if(nt){let A=b.left-D.current.left,dt=b.top-D.current.top,wt={node:_,deltaX:A,deltaY:dt,lastX:D.current.left,lastY:D.current.top,x:b.left,y:b.top};M.current?.(b.e,wt)}}else{let A={node:_,deltaX:b.left,deltaY:b.top,lastX:0,lastY:0,x:b.left,y:b.top};ot.current?.(b.e,A)}F.current=b},[b,d,Y]);let qt=We(B,it,rt,et,lt,d?D.current:null,k?j.current:null),Me=p.Children.only(e),Le=oe(B),Ve=[jt(Rt,Le,o[0]),jt(C,s,o[1])],Ke=[jt(Wt,Le,o[0]),jt(R,s,o[1])],zt=Me.props,Cn=zt.className,Je=zt.style,Qt=p.cloneElement(Me,{ref:x,className:Yn("react-grid-item",Cn,K,{static:u,resizing:k,"react-draggable":l,"react-draggable-dragging":d,dropping:!!b,cssTransforms:g}),style:{...J,...Je,...Ue(qt)}}),Ze=xt;return Qt=ce(Bo.Resizable,{draggableOpts:{disabled:!c},className:c?void 0:"react-resizable-hide",width:qt.width,height:qt.height,minConstraints:Ve,maxConstraints:Ke,onResizeStart:xe,onResize:De,onResizeStop:Zt,transformScale:w,resizeHandles:Ot,handle:Ze,children:Qt}),Qt=ce(Ft,{disabled:!l,onStart:At,onDrag:Se,onStop:Jt,handle:at,cancel:".react-resizable-handle"+(ut?","+ut:""),scale:w,nodeRef:x,children:Qt}),Qt}var Ut=()=>{},jo="react-grid-layout",Wo=!1;try{Wo=/firefox/i.test(navigator.userAgent)}catch{}function Ni(t,e){let n=p.Children.toArray(t),r=p.Children.toArray(e);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++){let a=n[o],s=r[o];if(a?.key!==s?.key)return!1}return!0}function Ho(t,e,n,r){let o=[],a=new Set;p.Children.forEach(e,i=>{if(!p.isValidElement(i)||i.key===null)return;let l=String(i.key);a.add(l);let c=t.find(f=>f.i===l);if(c)o.push(Gt(c));else{let u=i.props["data-grid"];u?o.push({i:l,x:u.x??0,y:u.y??0,w:u.w??1,h:u.h??1,minW:u.minW,maxW:u.maxW,minH:u.minH,maxH:u.maxH,static:u.static,isDraggable:u.isDraggable,isResizable:u.isResizable,resizeHandles:u.resizeHandles,isBounded:u.isBounded}):o.push({i:l,x:0,y:qe(o),w:1,h:1})}});let s=Ln(o,{cols:n});return r.compact(s,n)}function Fe(t){let{children:e,width:n,gridConfig:r,dragConfig:o,resizeConfig:a,dropConfig:s,positionStrategy:i=jr,compactor:l,constraints:c=Nn,layout:f=[],droppingItem:u,autoSize:g=!0,className:z="",style:w={},innerRef:P,onLayoutChange:S=Ut,onDragStart:b=Ut,onDrag:K=Ut,onDragStop:J=Ut,onResizeStart:at=Ut,onResize:ut=Ut,onResizeStop:it=Ut,onDrop:rt=Ut,onDropDragOver:et=Ut}=t,lt=Ct(()=>({...Hr,...r}),[r]),Rt=Ct(()=>({...Br,...o}),[o]),Wt=Ct(()=>({...Wr,...a}),[a]),C=Ct(()=>({...Ar,...s}),[s]),{cols:R,rowHeight:Y,maxRows:Ot,margin:xt,containerPadding:Et}=lt,{enabled:ue,bounded:de,handle:Nt,cancel:Vt,threshold:Kt}=Rt,{enabled:fe,handles:pe,handleComponent:he}=Wt,{enabled:d,defaultItem:m,onDragOver:k}=C,y=l??Xr("vertical"),x=y.type,D=y.allowOverlap,j=y.preventCollision??!1,F=Ct(()=>u??{i:"__dropping-elem__",...m},[u,m]),W=i.type==="transform",ot=i.scale,M=Et??xt,[N,pt]=st(!1),[X,B]=st(()=>Ho(f,e,R,y)),[$,ht]=st(null),[_t,Ue]=st(!1),[At,Se]=st(null),[Jt,Tt]=st(),xe=I(null),De=I(null),Zt=I(null),qt=I(0),Me=I(X),Le=I(f),Ve=I(e),Ke=I(x),zt=I(X);zt.current=X,It(()=>{pt(!0),(0,we.deepEqual)(X,f)||S(X)},[]),It(()=>{if($||At)return;let h=!(0,we.deepEqual)(f,Le.current),O=!Ni(e,Ve.current),v=x!==Ke.current;if(h||O||v){let q=Ho(h?f:X,e,R,y);(0,we.deepEqual)(q,X)||B(q)}Le.current=f,Ve.current=e,Ke.current=x},[f,e,R,x,y,$,At,X]),It(()=>{if(!$&&!(0,we.deepEqual)(X,Me.current)){Me.current=X;let h=X.filter(O=>O.i!==F.i);S(h)}},[X,$,S,F.i]);let Cn=Ct(()=>{if(!g)return;let h=qe(X),O=M[1];return h*Y+(h-1)*xt[1]+O*2+"px"},[g,X,Y,xt,M]),Je=U((h,O,v,L)=>{let q=zt.current,T=ae(q,h);if(!T)return;let Z={w:T.w,h:T.h,x:T.x,y:T.y,i:h};xe.current=Gt(T),Zt.current=q,ht(Z),b(q,T,T,null,L.e,L.node)},[b]),Qt=U((h,O,v,L)=>{let q=zt.current,T=xe.current,Z=ae(q,h);if(!Z)return;let ft={w:Z.w,h:Z.h,x:Z.x,y:Z.y,i:h},Q=re(q,Z,O,v,!0,j,x,R,D);K(Q,T,Z,ft,L.e,L.node),B(y.compact(Q,R)),ht(ft)},[j,x,R,D,y,K]),Ze=U((h,O,v,L)=>{if(!$)return;let q=zt.current,T=xe.current,Z=ae(q,h);if(!Z)return;let ft=re(q,Z,O,v,!0,j,x,R,D),Q=y.compact(ft,R);J(Q,T,Z,null,L.e,L.node);let mt=Zt.current;xe.current=null,Zt.current=null,ht(null),B(Q),mt&&!(0,we.deepEqual)(mt,Q)&&S(Q)},[$,j,x,R,D,y,J,S]),_=U((h,O,v,L)=>{let q=zt.current,T=ae(q,h);T&&(De.current=Gt(T),Zt.current=q,Ue(!0),at(q,T,T,null,L.e,L.node))},[at]),H=U((h,O,v,L)=>{let q=zt.current,T=De.current,{handle:Z}=L,ft=!1,Q,mt,[Qe,$t]=Mr(q,h,tt=>(Q=tt.x,mt=tt.y,["sw","w","nw","n","ne"].includes(Z)&&(["sw","nw","w"].includes(Z)&&(Q=tt.x+(tt.w-O),O=tt.x!==Q&&Q<0?tt.w:O,Q=Q<0?0:Q),["ne","n","nw"].includes(Z)&&(mt=tt.y+(tt.h-v),v=tt.y!==mt&&mt<0?tt.h:v,mt=mt<0?0:mt),ft=!0),j&&!D&&kn(q,{...tt,w:O,h:v,x:Q??tt.x,y:mt??tt.y}).filter(en=>en.i!==tt.i).length>0&&(mt=tt.y,v=tt.h,Q=tt.x,O=tt.w,ft=!1),tt.w=O,tt.h=v,tt));if(!$t)return;let Ne=Qe;ft&&Q!==void 0&&mt!==void 0&&(Ne=re(Qe,$t,Q,mt,!0,j,x,R,D));let tn={w:$t.w,h:$t.h,x:$t.x,y:$t.y,i:h,static:!0};ut(Ne,T,$t,tn,L.e,L.node),B(y.compact(Ne,R)),ht(tn)},[j,x,R,D,y,ut]),nt=U((h,O,v,L)=>{let q=zt.current,T=De.current,Z=ae(q,h),ft=y.compact(q,R);it(ft,T,Z??null,null,L.e,L.node);let Q=Zt.current;De.current=null,Zt.current=null,ht(null),Ue(!1),B(ft),Q&&!(0,we.deepEqual)(Q,ft)&&S(ft)},[R,y,it,S]),A=U(()=>{let h=zt.current;if(!h.some(L=>L.i===F.i)){Se(null),ht(null),Tt(void 0);return}let v=y.compact(h.filter(L=>L.i!==F.i),R);B(v),Se(null),ht(null),Tt(void 0)},[F.i,R,y]),dt=U(h=>{if(h.preventDefault(),h.stopPropagation(),Wo&&!h.nativeEvent.target?.classList.contains(jo))return!1;let O=k?k(h.nativeEvent):et(h);if(O===!1)return At&&A(),!1;let{dragOffsetX:v=0,dragOffsetY:L=0,...q}=O??{},T={...F,...q},Z=h.currentTarget.getBoundingClientRect(),ft={cols:R,margin:xt,maxRows:Ot,rowHeight:Y,containerWidth:n,containerPadding:M},Q=oe(ft),mt=jt(T.w,Q,xt[0]),Qe=jt(T.h,Y,xt[1]),$t=mt/2,Ne=Qe/2,tn=h.clientX-Z.left+v-$t,tt=h.clientY-Z.top+L-Ne,Rn=Math.max(0,tn),en=Math.max(0,tt),nn={left:Rn/ot,top:en/ot,e:h.nativeEvent};if(At)Jt&&(Jt.left!==nn.left||Jt.top!==nn.top)&&Tt(nn);else{let En=Pr(ft,en,Rn,T.w,T.h);Se(ce("div",{},T.i)),Tt(nn);let ns=zt.current.filter(rs=>rs.i!==T.i);B([...ns,{...T,x:En.x,y:En.y,static:!1,isDraggable:!0}])}},[At,Jt,F,k,et,A,ot,R,xt,Ot,Y,n,M]),wt=U(h=>{h.preventDefault(),h.stopPropagation(),qt.current--,qt.current<0&&(qt.current=0),qt.current===0&&A()},[A]),Dt=U(h=>{h.preventDefault(),h.stopPropagation(),qt.current++},[]),St=U(h=>{h.preventDefault(),h.stopPropagation();let O=zt.current,v=O.find(L=>L.i===F.i);qt.current=0,A(),rt(O,v,h.nativeEvent)},[F.i,A,rt]),Pt=U((h,O)=>{if(!h||!h.key)return null;let v=ae(X,String(h.key));if(!v)return null;let L=typeof v.isDraggable=="boolean"?v.isDraggable:!v.static&&ue,q=typeof v.isResizable=="boolean"?v.isResizable:!v.static&&fe,T=v.resizeHandles||[...pe],Z=L&&de&&v.isBounded!==!1,ft=he;return ce(yr,{containerWidth:n,cols:R,margin:xt,containerPadding:M,maxRows:Ot,rowHeight:Y,cancel:Vt,handle:Nt,onDragStart:Je,onDrag:Qt,onDragStop:Ze,onResizeStart:_,onResize:H,onResizeStop:nt,isDraggable:L,isResizable:q,isBounded:Z,useCSSTransforms:W&&N,usePercentages:!N,transformScale:ot,positionStrategy:i,dragThreshold:Kt,w:v.w,h:v.h,x:v.x,y:v.y,i:v.i,minH:v.minH,minW:v.minW,maxH:v.maxH,maxW:v.maxW,static:v.static,droppingPosition:O?Jt:void 0,resizeHandles:T,resizeHandle:ft,constraints:c,layoutItem:v,layout:X,children:h},v.i)},[X,n,R,xt,M,Ot,Y,Vt,Nt,Je,Qt,Ze,_,H,nt,ue,fe,de,W,N,ot,i,Kt,Jt,pe,he,c]),kt=()=>$?ce(yr,{w:$.w,h:$.h,x:$.x,y:$.y,i:$.i,className:`react-grid-placeholder ${_t?"placeholder-resizing":""}`,containerWidth:n,cols:R,margin:xt,containerPadding:M,maxRows:Ot,rowHeight:Y,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:W,transformScale:ot,constraints:c,layout:X,children:ce("div",{})}):null,te=Yn(jo,z),ee={height:Cn,...w};return To("div",{ref:P,className:te,style:ee,onDrop:d?St:void 0,onDragLeave:d?wt:void 0,onDragEnter:d?Dt:void 0,onDragOver:d?dt:void 0,children:[p.Children.map(e,h=>p.isValidElement(h)?Pt(h):null),d&&At&&Pt(At,!0),kt()]})}ct();var Lt=(...t)=>t.filter(Boolean).join(" ");var Ti=({type:t="info",title:e,message:n,onDismiss:r,className:o})=>p.createElement("div",{className:Lt("ks-alert",`ks-alert-${t}`,o),role:"alert"},p.createElement("div",{className:"ks-alert-body"},p.createElement("div",{className:"ks-alert-content"},e&&p.createElement("p",{className:"ks-alert-title"},e),p.createElement("p",{className:e?"ks-alert-message-titled":"ks-alert-message"},n)),r&&p.createElement("button",{type:"button",className:"ks-alert-dismiss","aria-label":"Dismiss",onClick:r},"\xD7"))),Ao=Ti;ct();var ji={primary:"ks-button-primary",secondary:"ks-button-secondary",danger:"ks-button-danger"},Hi={sm:"ks-button-sm",md:"ks-button-md",lg:"ks-button-lg"},Bi=({variant:t="primary",size:e="md",className:n,children:r,...o})=>{let a=o.href?"a":"button";return p.createElement(a,{...o,className:Lt("ks-button",ji[t],Hi[e],n)},r)},br=Bi;ct();var Wi=({as:t="input",disabled:e,className:n,...r})=>p.createElement(t,{...r,disabled:e,className:Lt("ks-input",e&&"ks-input-disabled",n)}),vr=Wi;ct();var Sn=(t,e)=>({className:n,children:r,...o})=>p.createElement(t,{...o,className:Lt(e,n)},r),wr=Sn("label","ks-label"),dc=Sn("p","ks-hint"),fc=Sn("p","ks-error"),pc=Sn("span","ks-required");ct();var Ai=({as:t="div",className:e,children:n,...r})=>p.createElement(t,{...r,className:Lt("ks-panel",e)},n),qo=Ai;ct();var qi=({title:t,subtitle:e,action:n,spacing:r="md",className:o,children:a})=>p.createElement("div",{className:Lt(`ks-section-${r}`,o)},t&&p.createElement("div",{className:"ks-section-header"},p.createElement("div",null,p.createElement("h2",{className:"ks-section-title"},t),e&&p.createElement("p",{className:"ks-section-subtitle"},e)),n&&p.createElement("a",{href:n.href,className:"ks-section-action"},n.label)),a),Io=qi;ct();var Ii="Your change was not saved because the server could not be reached.",Yo=({base:t,token:e,fetch:n,version:r,layout:o,onLayout:a,onError:s})=>{let i=r??o?.version,l=o,c=Promise.resolve(),f=async(u,g,z)=>{let w=await n(t+u,{method:g,headers:{"Content-Type":"application/json","X-CSRF-Token":e},body:z&&JSON.stringify({...z,version:i})}).catch(()=>null);if(!w)return s(Ii),l&&a({...l});let P=await w.json().catch(()=>({}));s(w.ok?null:P.error);let S=await(await n(t+"/layout",{headers:{Accept:"application/json"}})).json();i=S.version,l=S,a(S)};return(u,g,z)=>c=c.then(()=>f(u,g,z))};var Yi=(t,e,n)=>{let[r,o]=st(n),[a,s]=st(null),i=Ct(()=>Yo({base:t,token:e,fetch:(...l)=>window.fetch(...l),layout:n,onLayout:o,onError:s}),[t,e]);return{layout:r,error:a,send:i}},Xo=Yi;var $o=(t,e)=>t("/blocks","POST",{type:e}),Go=(t,e,{x:n,y:r})=>t("/blocks","POST",{type:e,x:n,y:r}),Sr=(t,e)=>t("/blocks","PATCH",{layout:e.map(({i:n,x:r,y:o,w:a,h:s})=>({id:n,x:r,y:o,w:a,h:s}))}),Fo=(t,e,n)=>t(`/blocks/${e}`,"PATCH",{content:n}),Uo=(t,e)=>t(`/blocks/${e}`,"DELETE"),Vo=(t,e)=>t.map(({id:n,x:r,y:o,w:a,h:s,type:i})=>{let l=e.find(u=>u.key===i)??{},c={minW:l.min_width,maxW:l.max_width,minH:l.min_height,maxH:l.max_height},f=Object.fromEntries(Object.entries(c).filter(([,u])=>u!=null));return{i:n,x:r,y:o,w:a,h:s,...f,...l.resizable===!1&&{isResizable:!1},...l.fixed&&{isDraggable:!1}}});var Xi={columns:12,row_height:60,gap:10},$i=["e","s","se"],xn=(t,e)=>t.find(n=>n.key===e),Gi=(t,e)=>xn(t,e)?.name??`Unknown block type (${e})`,Fi=(t,e)=>t.filter(n=>n.name.toLowerCase().includes(e.trim().toLowerCase())),Ui=t=>t.reduce((e,n)=>{let r=n.group??"";return(e.find(a=>a.name===r)??e[e.push({name:r,types:[]})-1]).types.push(n),e},[]),Vi=(t,e)=>{let n=document.createElement("div");return n.dataset.blockContent=t,n.innerHTML=e,n},Ki=({id:t,name:e,html:n})=>{let r=I(null),[o,a]=st(!1);return It(()=>{let s=document.querySelector(`[data-block-content="${t}"]`)??(n?Vi(t,n):null);s&&s.parentElement!==r.current&&r.current.appendChild(s),a(!!s)},[t,n]),p.createElement(p.Fragment,null,o?null:e,p.createElement("div",{ref:r,className:"grow"}))},Ko=(t,e)=>t.once&&e.some(n=>n.type===t.key);function xr({base:t,token:e,emptyMessage:n,...r}){let{layout:o,error:a,send:s}=Xo(t,e,r),{block_types:i=[],blocks:l=[],grid:c={},contents:f={}}=o,{columns:u,row_height:g,gap:z}={...Xi,...c},{width:w,containerRef:P,mounted:S}=qn({measureBeforeMount:!0}),b=Vo(l,i),K=I(null),[J,at]=st(""),[ut,it]=st(null),rt=l.find(C=>C.id===ut),et=xn(i,rt?.type)?.fields??[],lt=C=>R=>{K.current=C,R.dataTransfer.setData("text/plain",C.key)},Rt={enabled:!0,onDragOver:()=>K.current?{w:K.current.width,h:K.current.height}:!1},Wt=(C,R)=>{K.current&&Go(s,K.current.key,R),K.current=null};return p.createElement("div",{className:"lg:grid lg:grid-cols-[16rem_minmax(0,1fr)] lg:gap-6"},p.createElement(Io,{title:"Blocks",spacing:"sm"},p.createElement(wr,{htmlFor:"ks-blocks-search"},"Search blocks"),p.createElement(vr,{id:"ks-blocks-search",type:"search",value:J,onChange:C=>at(C.target.value),className:"mb-2"}),i.length===0?p.createElement("p",null,"There are no blocks to add."):Ui(Fi(i,J)).map(C=>p.createElement(p.Fragment,{key:C.name},C.name&&p.createElement("h3",{className:"ks-section-title"},C.name),p.createElement("ul",null,C.types.map(R=>p.createElement("li",{key:R.key,"data-block-type":R.key,className:"flex items-center justify-between gap-2 py-1",draggable:"true",onDragStart:lt(R)},p.createElement("span",null,R.name,R.description&&p.createElement("span",{className:"ks-section-subtitle block"},R.description)),p.createElement(br,{variant:"secondary",size:"sm",type:"button",disabled:Ko(R,l),onClick:()=>$o(s,R.key)},Ko(R,l)?"Added":"Add"))))))),p.createElement(qo,{"data-block-grid-panel":!0},a&&p.createElement(Ao,{type:"error",message:a,className:"mb-3"}),l.length===0&&p.createElement("p",null,n),et.length>0&&p.createElement("div",{"data-block-fields":!0,className:"mb-3"},et.map(C=>p.createElement("div",{key:C.key,className:"mb-2"},p.createElement(wr,{htmlFor:`ks-block-field-${C.key}`},C.label),p.createElement(vr,{key:`${ut}-${C.key}`,id:`ks-block-field-${C.key}`,type:"text",defaultValue:rt.content?.[C.key]??"",onBlur:R=>Fo(s,ut,{...rt.content,[C.key]:R.target.value})})))),p.createElement("div",{ref:P,"data-block-grid":!0,style:{overflow:"hidden",visibility:S?"visible":"hidden"}},p.createElement(Fe,{width:w,layout:b,gridConfig:{cols:u,rowHeight:g,margin:[z,z]},resizeConfig:{enabled:!0,handles:$i},dragConfig:{handle:"[data-block-handle]",cancel:"[data-remove-block]"},dropConfig:Rt,onDrop:Wt,onDragStop:C=>Sr(s,C),onResizeStop:C=>Sr(s,C)},l.map(C=>p.createElement("div",{key:C.id,"data-block":C.id,onClick:()=>it(C.id),className:"ks-panel p-3 flex items-start justify-between gap-2"},!xn(i,C.type)?.fixed&&p.createElement("span",{"data-block-handle":!0,className:"ks-block-handle","aria-hidden":"true"},"\u283F"),p.createElement(Ki,{id:C.id,name:Gi(i,C.type),html:f[C.id]}),!xn(i,C.type)?.fixed&&p.createElement(br,{variant:"secondary",size:"sm",type:"button","data-remove-block":!0,onClick:()=>Uo(s,C.id)},"Remove")))))))}ct();var Jo=new Map,Dn=new Map,Zo=(t,e)=>Jo.set(t,e),Qo=()=>{Dn.forEach(t=>t.unmount()),Dn.clear()},ts=(t,e)=>t.querySelectorAll("[data-react-ui]").forEach(n=>{if(Dn.has(n))return;let r=Jo.get(n.dataset.reactUi),o=e(n);Dn.set(n,o),o.render(p.createElement(r,JSON.parse(n.dataset.props)))});var es=(t,e)=>{let n=()=>ts(t,e);t.addEventListener("turbo:load",n),t.addEventListener("turbo:frame-load",n),t.addEventListener("turbo:before-cache",Qo),t.readyState==="loading"?t.addEventListener("DOMContentLoaded",n):n()};Zo("dash_kit/dashboard-grid",xr);es(document,zn);})();
|
|
5
|
+
`,t.getElementsByTagName("head")[0].appendChild(n)}t.body&&Ma(t.body,"react-draggable-transparent-selection")}function ro(t){window.requestAnimationFrame?window.requestAnimationFrame(()=>{oo(t)}):oo(t)}function oo(t){if(t)try{t.body&&La(t.body,"react-draggable-transparent-selection");let e=t.selection;if(e)e.empty();else{let n=(t.defaultView||window).getSelection();n&&n.type!=="Caret"&&n.removeAllRanges()}}catch{}}function Ma(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp(`(?:^|\\s)${e}(?!\\S)`))||(t.className+=` ${e}`)}function La(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g"),"")}function _a(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:ja(r);let o=Jn(t);if(typeof r=="string"){let{ownerDocument:a}=o,s=a.defaultView;if(!s)throw new Error("Cannot resolve the owner window of the draggable node.");let i;if(r==="parent"?i=o.parentNode:i=o.getRootNode().querySelector(r),!(i instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');let l=i,c=s.getComputedStyle(o),p=s.getComputedStyle(l);r={left:-o.offsetLeft+wt(p.paddingLeft)+wt(c.marginLeft),top:-o.offsetTop+wt(p.paddingTop)+wt(c.marginTop),right:Da(l)-xa(o)-o.offsetLeft+wt(p.paddingRight)-wt(c.marginRight),bottom:Sa(l)-wa(o)-o.offsetTop+wt(p.paddingBottom)-wt(c.marginBottom)}}return $e(r.right)&&(e=Math.min(e,r.right)),$e(r.bottom)&&(n=Math.min(n,r.bottom)),$e(r.left)&&(e=Math.max(e,r.left)),$e(r.top)&&(n=Math.max(n,r.top)),[e,n]}function so(t,e,n){let r=Math.round(e/t[0])*t[0],o=Math.round(n/t[1])*t[1];return[r,o]}function Na(t){return t.props.axis==="both"||t.props.axis==="x"}function Ta(t){return t.props.axis==="both"||t.props.axis==="y"}function Fn(t,e,n){let r=typeof e=="number"?za(t,e):null;if(typeof e=="number"&&!r)return null;let o=Jn(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return Ca(r||t,a,n.props.scale)}function Un(t,e,n){let r=!$e(t.lastX),o=Jn(t);return r?{node:o,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:o,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function Vn(t,e){let n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function ja(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function Jn(t){let e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}var Ba=typeof process<"u"&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Gt=Ba,At={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},fe=At.mouse,te=class extends Be{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&(typeof t.button=="number"&&t.button!==0||t.ctrlKey))return!1;let e=this.findDOMNode();if(!e||!e.ownerDocument||!e.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:n}=e;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!no(t.target,this.props.handle,e)||this.props.cancel&&no(t.target,this.props.cancel,e))return;t.type==="touchstart"&&!this.props.allowMobileScroll&&t.preventDefault();let r=Oa(t);this.touchIdentifier=r;let o=Fn(t,r,this);if(o==null)return;let{x:a,y:s}=o,i=Un(this,a,s);Gt("DraggableCore: handleDragStart: %j",i),Gt("calling",this.props.onStart),!(this.props.onStart(t,i)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ka(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=s,Gn(n,fe.move,this.handleDrag),Gn(n,fe.stop,this.handleDragStop))},this.handleDrag=t=>{let e=Fn(t,this.touchIdentifier,this);if(e==null)return;let{x:n,y:r}=e;if(Array.isArray(this.props.grid)){let s=n-this.lastX,i=r-this.lastY;if([s,i]=so(this.props.grid,s,i),!s&&!i)return;n=this.lastX+s,r=this.lastY+i}let o=Un(this,n,r);if(Gt("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{let s=document.createEvent("MouseEvents");s.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(s)}return}this.lastX=n,this.lastY=r},this.handleDragStop=t=>{if(!this.dragging)return;let e=Fn(t,this.touchIdentifier,this);if(e==null)return;let{x:n,y:r}=e;if(Array.isArray(this.props.grid)){let i=n-this.lastX||0,l=r-this.lastY||0;[i,l]=so(this.props.grid,i,l),n=this.lastX+i,r=this.lastY+l}let o=Un(this,n,r);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;let s=this.findDOMNode();s&&this.props.enableUserSelectHack&&ro(s.ownerDocument),Gt("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&(Gt("DraggableCore: Removing handlers"),ye(s.ownerDocument,fe.move,this.handleDrag),ye(s.ownerDocument,fe.stop,this.handleDragStop))},this.onMouseDown=t=>(fe=At.mouse,this.handleDragStart(t)),this.onMouseUp=t=>(fe=At.mouse,this.handleDragStop(t)),this.onTouchStart=t=>(fe=At.touch,this.handleDragStart(t)),this.onTouchEnd=t=>(fe=At.touch,this.handleDragStop(t))}componentDidMount(){this.mounted=!0;let t=this.findDOMNode();t&&Gn(t,At.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let t=this.findDOMNode();if(t){let{ownerDocument:e}=t;ye(e,At.mouse.move,this.handleDrag),ye(e,At.touch.move,this.handleDrag),ye(e,At.mouse.stop,this.handleDragStop),ye(e,At.touch.stop,this.handleDragStop),ye(t,At.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&ro(e)}}findDOMNode(){var t;if((t=this.props)!=null&&t.nodeRef)return this.props.nodeRef.current;let e=Te;return typeof e.findDOMNode=="function"?e.findDOMNode(this):(Gt("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return He(je.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};te.displayName="DraggableCore";te.propTypes={allowAnyClick:yt.default.bool,allowMobileScroll:yt.default.bool,children:yt.default.node.isRequired,disabled:yt.default.bool,enableUserSelectHack:yt.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:yt.default.arrayOf(yt.default.number),handle:yt.default.string,cancel:yt.default.string,nodeRef:yt.default.object,nonce:yt.default.string,onStart:yt.default.func,onDrag:yt.default.func,onStop:yt.default.func,onMouseDown:yt.default.func,scale:yt.default.number,className:ze,style:ze,transform:ze};te.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var dn=class extends Be{constructor(t){super(t),this.onDragStart=(e,n)=>{if(Gt("Draggable: onDragStart: %j",n),this.props.onStart(e,Vn(this,n))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,n)=>{if(!this.state.dragging)return!1;Gt("Draggable: onDrag: %j",n);let r=Vn(this,n),o={x:r.x,y:r.y,slackX:0,slackY:0};if(this.props.bounds){let{x:s,y:i}=o;o.x+=this.state.slackX,o.y+=this.state.slackY;let[l,c]=_a(this,o.x,o.y);o.x=l,o.y=c,o.slackX=this.state.slackX+(s-o.x),o.slackY=this.state.slackY+(i-o.y),r.x=o.x,r.y=o.y,r.deltaX=o.x-this.state.x,r.deltaY=o.y-this.state.y}if(this.props.onDrag(e,r)===!1)return!1;this.setState(o)},this.onDragStop=(e,n)=>{if(!this.state.dragging||this.props.onStop(e,Vn(this,n))===!1)return!1;Gt("Draggable: onDragStop: %j",n);let o={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){let{x:s,y:i}=this.props.position;o.x=s,o.y=i}this.setState(o)},this.state={dragging:!1,dragged:!1,x:t.position?t.position.x:t.defaultPosition.x,y:t.position?t.position.y:t.defaultPosition.y,prevPropsPosition:{...t.position},slackX:0,slackY:0,isElementSVG:!1},t.position&&!(t.onDrag||t.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:t},{prevPropsPosition:e}){return t&&(!e||t.x!==e.x||t.y!==e.y)?(Gt("Draggable: getDerivedStateFromProps %j",{position:t,prevPropsPosition:e}),{x:t.x,y:t.y,prevPropsPosition:{...t}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var t;if((t=this.props)!=null&&t.nodeRef)return this.props.nodeRef.current;let e=Te;return typeof e.findDOMNode=="function"?e.findDOMNode(this):null}render(){let{axis:t,bounds:e,children:n,defaultPosition:r,defaultClassName:o,defaultClassNameDragging:a,defaultClassNameDragged:s,position:i,positionOffset:l,scale:c,...p}=this.props,d={},h=null,S=!!!i||this.state.dragging,P=i||r,x={x:Na(this)&&S?this.state.x:P.x,y:Ta(this)&&S?this.state.y:P.y};this.state.isElementSVG?h=Ea(x,l):d=Ra(x,l);let b=je.only(n),lt=In(b.props.className||"",o,{[a]:this.state.dragging,[s]:this.state.dragged});return Pn(te,{...p,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},He(b,{className:lt,style:{...b.props.style,...d},transform:h}))}};dn.displayName="Draggable";dn.propTypes={...te.propTypes,axis:U.default.oneOf(["both","x","y","none"]),bounds:U.default.oneOfType([U.default.shape({left:U.default.number,right:U.default.number,top:U.default.number,bottom:U.default.number}),U.default.string,U.default.oneOf([!1])]),defaultClassName:U.default.string,defaultClassNameDragging:U.default.string,defaultClassNameDragged:U.default.string,defaultPosition:U.default.shape({x:U.default.number,y:U.default.number}),positionOffset:U.default.shape({x:U.default.oneOfType([U.default.number,U.default.string]),y:U.default.oneOfType([U.default.number,U.default.string])}),position:U.default.shape({x:U.default.number,y:U.default.number}),className:ze,style:ze,transform:ze};dn.defaultProps={...te.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1};var Ho=sn(_o(),1);var No=globalThis.React,Jl=No.Fragment,he=(t,e,n)=>No.createElement(t,n===void 0?e:{...e,key:n}),To=he;var we=sn(Gr(),1);function yr(t){let{children:e,cols:n,containerWidth:r,margin:o,containerPadding:a,rowHeight:s,maxRows:i,isDraggable:l,isResizable:c,isBounded:p,static:d,useCSSTransforms:h=!0,usePercentages:E=!1,transformScale:S=1,positionStrategy:P,dragThreshold:x=0,droppingPosition:b,className:lt="",style:V,handle:ct="",cancel:nt="",x:at,y:ut,w:$,h:st,minW:Dt=1,maxW:Pt=1/0,minH:Tt=1,maxH:W=1/0,i:j,resizeHandles:Et,resizeHandle:ft,constraints:bt=_n,layoutItem:Vt,layout:Kt=[],onDragStart:kt,onDrag:It,onDragStop:Yt,onResizeStart:Jt,onResize:w,onResizeStop:X}=t,[u,m]=ot(!1),[z,y]=ot(!1),D=M(null),C=M({left:0,top:0}),B=M({top:0,left:0,width:0,height:0}),K=M(void 0),q=M(Kt);q.current=Kt;let it=M(null),k=M(null),_=M(!1),gt=M({x:0,y:0}),G=M(!1),A=Ot(()=>({cols:n,containerPadding:a,containerWidth:r,margin:o,maxRows:i,rowHeight:s}),[n,a,r,o,i,s]),F=Ot(()=>({cols:n,maxRows:i,containerWidth:r,containerHeight:0,rowHeight:s,margin:o,layout:[]}),[n,i,r,s,o]),mt=J(()=>({...F,layout:q.current}),[F]),jt=Ot(()=>Vt??{i:j,x:at,y:ut,w:$,h:st,minW:Dt,maxW:Pt,minH:Tt,maxH:W},[Vt,j,at,ut,$,st,Dt,Pt,Tt,W]),Ve=J(N=>{if(P?.calcStyle)return P.calcStyle(N);if(h)return Nn(N);let H=_r(N);return E?{...H,left:Tn(N.left/r),width:Tn(N.width/r)}:H},[P,h,E,r]),Xt=J((N,{node:H})=>{if(!kt)return;let{offsetParent:rt}=H;if(!rt)return;let I=rt.getBoundingClientRect(),pt=H.getBoundingClientRect(),Ct=pt.left/S,zt=I.left/S,Rt=pt.top/S,Lt=I.top/S,_t;if(P?.calcDragPosition){let O=N;_t=P.calcDragPosition(O.clientX,O.clientY,O.clientX-pt.left,O.clientY-pt.top)}else _t={left:Ct-zt+rt.scrollLeft,top:Rt-Lt+rt.scrollTop};if(C.current=_t,x>0){let O=N;gt.current={x:O.clientX,y:O.clientY},_.current=!0,G.current=!1,m(!0);return}m(!0);let se=qe(A,_t.top,_t.left),{x:ae,y:g}=Xe(bt,jt,se.x,se.y,mt());kt(j,ae,g,{e:N,node:H,newPosition:_t})},[kt,S,A,P,x,bt,jt,mt,j]),xe=J((N,{node:H,deltaX:rt,deltaY:I})=>{if(!It||!u)return;let pt=N;if(_.current&&!G.current){let ae=pt.clientX-gt.current.x,g=pt.clientY-gt.current.y;if(Math.hypot(ae,g)<x)return;if(G.current=!0,_.current=!1,kt){let v=qe(A,C.current.top,C.current.left),{x:L,y:Y}=Xe(bt,jt,v.x,v.y,mt());kt(j,L,Y,{e:N,node:H,newPosition:C.current})}}let Ct=C.current.top+I,zt=C.current.left+rt;if(p){let{offsetParent:ae}=H;if(ae){let g=ae.clientHeight-Wt(st,s,o[1]);Ct=We(Ct,0,g);let O=ce(A),v=r-Wt($,O,o[0]);zt=We(zt,0,v)}}let Rt={top:Ct,left:zt};C.current=Rt;let Lt=qe(A,Ct,zt),{x:_t,y:se}=Xe(bt,jt,Lt.x,Lt.y,mt());It(j,_t,se,{e:N,node:H,newPosition:Rt})},[It,kt,u,x,p,st,s,o,A,r,$,j,bt,jt,mt]),ne=J((N,{node:H})=>{if(!Yt||!u)return;let rt=_.current;if(_.current=!1,G.current=!1,gt.current={x:0,y:0},rt){m(!1),C.current={left:0,top:0};return}let{left:I,top:pt}=C.current,Ct={top:pt,left:I};m(!1),C.current={left:0,top:0};let zt=qe(A,pt,I),{x:Rt,y:Lt}=Xe(bt,jt,zt.x,zt.y,mt());Yt(j,Rt,Lt,{e:N,node:H,newPosition:Ct})},[Yt,u,A,bt,jt,mt,j]);it.current=Xt,k.current=xe;let Bt=J((N,{node:H,size:rt,handle:I},pt,Ct)=>{let zt=Ct==="onResizeStart"?Jt:Ct==="onResize"?w:X;if(!zt)return;let Rt;H?Rt=Tr(I,pt,rt,r):Rt={...rt,top:pt.top,left:pt.left},B.current=Rt;let Lt=kr(A,Rt.width,Rt.height),{w:_t,h:se}=Lr(bt,jt,Lt.w,Lt.h,I,mt());zt(j,_t,se,{e:N.nativeEvent??N,node:H,size:Rt,handle:I})},[Jt,w,X,r,A,j,bt,jt,mt]),Se=J((N,H)=>{y(!0);let rt=Ae(A,at,ut,$,st),I={...H,handle:H.handle};Bt(N,I,rt,"onResizeStart")},[Bt,A,at,ut,$,st]),De=J((N,H)=>{let rt=Ae(A,at,ut,$,st),I={...H,handle:H.handle};Bt(N,I,rt,"onResize")},[Bt,A,at,ut,$,st]),re=J((N,H)=>{y(!1),B.current={top:0,left:0,width:0,height:0};let rt=Ae(A,at,ut,$,st),I={...H,handle:H.handle};Bt(N,I,rt,"onResizeStop")},[Bt,A,at,ut,$,st]);Ht(()=>{if(!b)return;let N=D.current;if(!N)return;let H=K.current||{left:0,top:0},rt=u&&(b.left!==H.left||b.top!==H.top);if(u){if(rt){let I=b.left-C.current.left,pt=b.top-C.current.top,Ct={node:N,deltaX:I,deltaY:pt,lastX:C.current.left,lastY:C.current.top,x:b.left,y:b.top};k.current?.(b.e,Ct)}}else{let I={node:N,deltaX:b.left,deltaY:b.top,lastX:0,lastY:0,x:b.left,y:b.top};it.current?.(b.e,I)}K.current=b},[b,u,j]);let $t=Ae(A,at,ut,$,st,u?C.current:null,z?B.current:null),Le=f.Children.only(e),_e=ce(A),Ke=[Wt(Dt,_e,o[0]),Wt(Tt,s,o[1])],Je=[Wt(Pt,_e,o[0]),Wt(W,s,o[1])],Mt=Le.props,Cn=Mt.className,Ze=Mt.style,oe=f.cloneElement(Le,{ref:D,className:Yn("react-grid-item",Cn,lt,{static:d,resizing:z,"react-draggable":l,"react-draggable-dragging":u,dropping:!!b,cssTransforms:h}),style:{...V,...Ze,...Ve($t)}}),Qe=ft;return oe=he(Ho.Resizable,{draggableOpts:{disabled:!c},className:c?void 0:"react-resizable-hide",width:$t.width,height:$t.height,minConstraints:Ke,maxConstraints:Je,onResizeStart:Se,onResize:De,onResizeStop:re,transformScale:S,resizeHandles:Et,handle:Qe,children:oe}),oe=he(te,{disabled:!l,onStart:Xt,onDrag:xe,onStop:ne,handle:ct,cancel:".react-resizable-handle"+(nt?","+nt:""),scale:S,nodeRef:D,children:oe}),oe}var ee=()=>{},jo="react-grid-layout",Wo=!1;try{Wo=/firefox/i.test(navigator.userAgent)}catch{}function Ai(t,e){let n=f.Children.toArray(t),r=f.Children.toArray(e);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++){let a=n[o],s=r[o];if(a?.key!==s?.key)return!1}return!0}function Bo(t,e,n,r){let o=[],a=new Set;f.Children.forEach(e,i=>{if(!f.isValidElement(i)||i.key===null)return;let l=String(i.key);a.add(l);let c=t.find(p=>p.i===l);if(c)o.push(Qt(c));else{let d=i.props["data-grid"];d?o.push({i:l,x:d.x??0,y:d.y??0,w:d.w??1,h:d.h??1,minW:d.minW,maxW:d.maxW,minH:d.minH,maxH:d.maxH,static:d.static,isDraggable:d.isDraggable,isResizable:d.isResizable,resizeHandles:d.resizeHandles,isBounded:d.isBounded}):o.push({i:l,x:0,y:Ie(o),w:1,h:1})}});let s=Ln(o,{cols:n});return r.compact(s,n)}function Ue(t){let{children:e,width:n,gridConfig:r,dragConfig:o,resizeConfig:a,dropConfig:s,positionStrategy:i=jr,compactor:l,constraints:c=_n,layout:p=[],droppingItem:d,autoSize:h=!0,className:E="",style:S={},innerRef:P,onLayoutChange:x=ee,onDragStart:b=ee,onDrag:lt=ee,onDragStop:V=ee,onResizeStart:ct=ee,onResize:nt=ee,onResizeStop:at=ee,onDrop:ut=ee,onDropDragOver:$=ee}=t,st=Ot(()=>({...Br,...r}),[r]),Dt=Ot(()=>({...Hr,...o}),[o]),Pt=Ot(()=>({...Wr,...a}),[a]),Tt=Ot(()=>({...Ar,...s}),[s]),{cols:W,rowHeight:j,maxRows:Et,margin:ft,containerPadding:bt}=st,{enabled:Vt,bounded:Kt,handle:kt,cancel:It,threshold:Yt}=Dt,{enabled:Jt,handles:w,handleComponent:X}=Pt,{enabled:u,defaultItem:m,onDragOver:z}=Tt,y=l??Xr("vertical"),D=y.type,C=y.allowOverlap,B=y.preventCollision??!1,K=Ot(()=>d??{i:"__dropping-elem__",...m},[d,m]),q=i.type==="transform",it=i.scale,k=bt??ft,[_,gt]=ot(!1),[G,A]=ot(()=>Bo(p,e,W,y)),[F,mt]=ot(null),[jt,Ve]=ot(!1),[Xt,xe]=ot(null),[ne,Bt]=ot(),Se=M(null),De=M(null),re=M(null),$t=M(0),Le=M(G),_e=M(p),Ke=M(e),Je=M(D),Mt=M(G);Mt.current=G,Ht(()=>{gt(!0),(0,we.deepEqual)(G,p)||x(G)},[]),Ht(()=>{if(F||Xt)return;let g=!(0,we.deepEqual)(p,_e.current),O=!Ai(e,Ke.current),v=D!==Je.current;if(g||O||v){let Y=Bo(g?p:G,e,W,y);(0,we.deepEqual)(Y,G)||A(Y)}_e.current=p,Ke.current=e,Je.current=D},[p,e,W,D,y,F,Xt,G]),Ht(()=>{if(!F&&!(0,we.deepEqual)(G,Le.current)){Le.current=G;let g=G.filter(O=>O.i!==K.i);x(g)}},[G,F,x,K.i]);let Cn=Ot(()=>{if(!h)return;let g=Ie(G),O=k[1];return g*j+(g-1)*ft[1]+O*2+"px"},[h,G,j,ft,k]),Ze=J((g,O,v,L)=>{let Y=Mt.current,T=de(Y,g);if(!T)return;let Q={w:T.w,h:T.h,x:T.x,y:T.y,i:g};Se.current=Qt(T),re.current=Y,mt(Q),b(Y,T,T,null,L.e,L.node)},[b]),oe=J((g,O,v,L)=>{let Y=Mt.current,T=Se.current,Q=de(Y,g);if(!Q)return;let ht={w:Q.w,h:Q.h,x:Q.x,y:Q.y,i:g},tt=le(Y,Q,O,v,!0,B,D,W,C);lt(tt,T,Q,ht,L.e,L.node),A(y.compact(tt,W)),mt(ht)},[B,D,W,C,y,lt]),Qe=J((g,O,v,L)=>{if(!F)return;let Y=Mt.current,T=Se.current,Q=de(Y,g);if(!Q)return;let ht=le(Y,Q,O,v,!0,B,D,W,C),tt=y.compact(ht,W);V(tt,T,Q,null,L.e,L.node);let vt=re.current;Se.current=null,re.current=null,mt(null),A(tt),vt&&!(0,we.deepEqual)(vt,tt)&&x(tt)},[F,B,D,W,C,y,V,x]),N=J((g,O,v,L)=>{let Y=Mt.current,T=de(Y,g);T&&(De.current=Qt(T),re.current=Y,Ve(!0),ct(Y,T,T,null,L.e,L.node))},[ct]),H=J((g,O,v,L)=>{let Y=Mt.current,T=De.current,{handle:Q}=L,ht=!1,tt,vt,[tn,Zt]=Mr(Y,g,et=>(tt=et.x,vt=et.y,["sw","w","nw","n","ne"].includes(Q)&&(["sw","nw","w"].includes(Q)&&(tt=et.x+(et.w-O),O=et.x!==tt&&tt<0?et.w:O,tt=tt<0?0:tt),["ne","n","nw"].includes(Q)&&(vt=et.y+(et.h-v),v=et.y!==vt&&vt<0?et.h:v,vt=vt<0?0:vt),ht=!0),B&&!C&&kn(Y,{...et,w:O,h:v,x:tt??et.x,y:vt??et.y}).filter(nn=>nn.i!==et.i).length>0&&(vt=et.y,v=et.h,tt=et.x,O=et.w,ht=!1),et.w=O,et.h=v,et));if(!Zt)return;let Ne=tn;ht&&tt!==void 0&&vt!==void 0&&(Ne=le(tn,Zt,tt,vt,!0,B,D,W,C));let en={w:Zt.w,h:Zt.h,x:Zt.x,y:Zt.y,i:g,static:!0};nt(Ne,T,Zt,en,L.e,L.node),A(y.compact(Ne,W)),mt(en)},[B,D,W,C,y,nt]),rt=J((g,O,v,L)=>{let Y=Mt.current,T=De.current,Q=de(Y,g),ht=y.compact(Y,W);at(ht,T,Q??null,null,L.e,L.node);let tt=re.current;De.current=null,re.current=null,mt(null),Ve(!1),A(ht),tt&&!(0,we.deepEqual)(tt,ht)&&x(ht)},[W,y,at,x]),I=J(()=>{let g=Mt.current;if(!g.some(L=>L.i===K.i)){xe(null),mt(null),Bt(void 0);return}let v=y.compact(g.filter(L=>L.i!==K.i),W);A(v),xe(null),mt(null),Bt(void 0)},[K.i,W,y]),pt=J(g=>{if(g.preventDefault(),g.stopPropagation(),Wo&&!g.nativeEvent.target?.classList.contains(jo))return!1;let O=z?z(g.nativeEvent):$(g);if(O===!1)return Xt&&I(),!1;let{dragOffsetX:v=0,dragOffsetY:L=0,...Y}=O??{},T={...K,...Y},Q=g.currentTarget.getBoundingClientRect(),ht={cols:W,margin:ft,maxRows:Et,rowHeight:j,containerWidth:n,containerPadding:k},tt=ce(ht),vt=Wt(T.w,tt,ft[0]),tn=Wt(T.h,j,ft[1]),Zt=vt/2,Ne=tn/2,en=g.clientX-Q.left+v-Zt,et=g.clientY-Q.top+L-Ne,Rn=Math.max(0,en),nn=Math.max(0,et),rn={left:Rn/it,top:nn/it,e:g.nativeEvent};if(Xt)ne&&(ne.left!==rn.left||ne.top!==rn.top)&&Bt(rn);else{let En=Pr(ht,nn,Rn,T.w,T.h);xe(he("div",{},T.i)),Bt(rn);let cs=Mt.current.filter(us=>us.i!==T.i);A([...cs,{...T,x:En.x,y:En.y,static:!1,isDraggable:!0}])}},[Xt,ne,K,z,$,I,it,W,ft,Et,j,n,k]),Ct=J(g=>{g.preventDefault(),g.stopPropagation(),$t.current--,$t.current<0&&($t.current=0),$t.current===0&&I()},[I]),zt=J(g=>{g.preventDefault(),g.stopPropagation(),$t.current++},[]),Rt=J(g=>{g.preventDefault(),g.stopPropagation();let O=Mt.current,v=O.find(L=>L.i===K.i);$t.current=0,I(),ut(O,v,g.nativeEvent)},[K.i,I,ut]),Lt=J((g,O)=>{if(!g||!g.key)return null;let v=de(G,String(g.key));if(!v)return null;let L=typeof v.isDraggable=="boolean"?v.isDraggable:!v.static&&Vt,Y=typeof v.isResizable=="boolean"?v.isResizable:!v.static&&Jt,T=v.resizeHandles||[...w],Q=L&&Kt&&v.isBounded!==!1,ht=X;return he(yr,{containerWidth:n,cols:W,margin:ft,containerPadding:k,maxRows:Et,rowHeight:j,cancel:It,handle:kt,onDragStart:Ze,onDrag:oe,onDragStop:Qe,onResizeStart:N,onResize:H,onResizeStop:rt,isDraggable:L,isResizable:Y,isBounded:Q,useCSSTransforms:q&&_,usePercentages:!_,transformScale:it,positionStrategy:i,dragThreshold:Yt,w:v.w,h:v.h,x:v.x,y:v.y,i:v.i,minH:v.minH,minW:v.minW,maxH:v.maxH,maxW:v.maxW,static:v.static,droppingPosition:O?ne:void 0,resizeHandles:T,resizeHandle:ht,constraints:c,layoutItem:v,layout:G,children:g},v.i)},[G,n,W,ft,k,Et,j,It,kt,Ze,oe,Qe,N,H,rt,Vt,Jt,Kt,q,_,it,i,Yt,ne,w,X,c]),_t=()=>F?he(yr,{w:F.w,h:F.h,x:F.x,y:F.y,i:F.i,className:`react-grid-placeholder ${jt?"placeholder-resizing":""}`,containerWidth:n,cols:W,margin:ft,containerPadding:k,maxRows:Et,rowHeight:j,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:q,transformScale:it,constraints:c,layout:G,children:he("div",{})}):null,se=Yn(jo,E),ae={height:Cn,...S};return To("div",{ref:P,className:se,style:ae,onDrop:u?Rt:void 0,onDragLeave:u?Ct:void 0,onDragEnter:u?zt:void 0,onDragOver:u?pt:void 0,children:[f.Children.map(e,g=>f.isValidElement(g)?Lt(g):null),u&&Xt&&Lt(Xt,!0),_t()]})}dt();var Ut=(...t)=>t.filter(Boolean).join(" ");var Ii=({type:t="info",title:e,message:n,onDismiss:r,className:o})=>f.createElement("div",{className:Ut("ks-alert",`ks-alert-${t}`,o),role:"alert"},f.createElement("div",{className:"ks-alert-body"},f.createElement("div",{className:"ks-alert-content"},e&&f.createElement("p",{className:"ks-alert-title"},e),f.createElement("p",{className:e?"ks-alert-message-titled":"ks-alert-message"},n)),r&&f.createElement("button",{type:"button",className:"ks-alert-dismiss","aria-label":"Dismiss",onClick:r},"\xD7"))),Ao=Ii;dt();var Yi={primary:"ks-button-primary",secondary:"ks-button-secondary",danger:"ks-button-danger"},Xi={sm:"ks-button-sm",md:"ks-button-md",lg:"ks-button-lg"},$i=({variant:t="primary",size:e="md",className:n,children:r,...o})=>{let a=o.href?"a":"button";return f.createElement(a,{...o,className:Ut("ks-button",Yi[t],Xi[e],n)},r)},Me=$i;dt();var Gi=({as:t="input",disabled:e,className:n,...r})=>f.createElement(t,{...r,disabled:e,className:Ut("ks-input",e&&"ks-input-disabled",n)}),br=Gi;dt();var Sn=(t,e)=>({className:n,children:r,...o})=>f.createElement(t,{...o,className:Ut(e,n)},r),vr=Sn("label","ks-label"),Pc=Sn("p","ks-hint"),kc=Sn("p","ks-error"),Mc=Sn("span","ks-required");dt();var Fi=({title:t,subtitle:e,action:n,spacing:r="md",className:o,children:a})=>f.createElement("div",{className:Ut(`ks-section-${r}`,o)},t&&f.createElement("div",{className:"ks-section-header"},f.createElement("div",null,f.createElement("h2",{className:"ks-section-title"},t),e&&f.createElement("p",{className:"ks-section-subtitle"},e)),n&&f.createElement("a",{href:n.href,className:"ks-section-action"},n.label)),a),qo=Fi;dt();var Ui="Your change was not saved because the server could not be reached.",Io=({base:t,token:e,fetch:n,version:r,layout:o,onLayout:a,onError:s})=>{let i=r??o?.version,l=o,c=Promise.resolve(),p=async(d,h,E)=>{let S=await n(t+d,{method:h,headers:{"Content-Type":"application/json","X-CSRF-Token":e},body:E&&JSON.stringify({...E,version:i})}).catch(()=>null);if(!S)return s(Ui),l&&a({...l});let P=await S.json().catch(()=>({}));s(S.ok?null:P.error);let x=await(await n(t+"/layout",{headers:{Accept:"application/json"}})).json();i=x.version,l=x,a(x)};return(d,h,E)=>c=c.then(()=>p(d,h,E))};var Vi=(t,e,n)=>{let[r,o]=ot(n),[a,s]=ot(null),i=Ot(()=>Io({base:t,token:e,fetch:(...l)=>window.fetch(...l),layout:n,onLayout:o,onError:s}),[t,e]);return{layout:r,error:a,send:i}},Yo=Vi;var Ki=(t,e)=>t("/blocks","POST",{type:e}),Xo=(t,e,n)=>{Ki(t,n),e()},$o=(t,e,{x:n,y:r})=>t("/blocks","POST",{type:e,x:n,y:r}),wr=(t,e)=>t("/blocks","PATCH",{layout:e.map(({i:n,x:r,y:o,w:a,h:s})=>({id:n,x:r,y:o,w:a,h:s}))}),Go=(t,e,n)=>t(`/blocks/${e}`,"PATCH",{content:n}),Fo=(t,e)=>t(`/blocks/${e}`,"DELETE"),xr=({type:t},e)=>{let n=e.find(r=>r.key===t)??{};return{moved:!n.fixed,resized:n.resizable!==!1,removed:!n.fixed}},Uo=(t,e)=>t.map(({id:n,x:r,y:o,w:a,h:s,type:i})=>{let l=e.find(h=>h.key===i)??{},c={minW:l.min_width,maxW:l.max_width,minH:l.min_height,maxH:l.max_height},p=Object.fromEntries(Object.entries(c).filter(([,h])=>h!=null)),d=xr({type:i},e);return{i:n,x:r,y:o,w:a,h:s,...p,...d.resized?{}:{isResizable:!1},...d.moved?{}:{isDraggable:!1}}});var Ji={columns:12,row_height:60,gap:10},Zi=640,Qi=t=>({columns:t.narrow_columns??t.columns,rowHeight:t.narrow_row_height??t.row_height,gap:t.narrow_gap??t.gap,narrow:!0}),tl=t=>({columns:t.columns,rowHeight:t.row_height,gap:t.gap,narrow:!1}),el=t=>typeof t=="number"&&t>0,Vo=(t,e)=>{let n={...Ji,...e};return el(t)&&t<(n.narrow_below??Zi)?Qi(n):tl(n)},nl=(t,e)=>({w:t?.narrow_width??e,h:t?.narrow_height??t?.height??1}),rl=t=>[...t].sort((e,n)=>e.y-n.y||e.x-n.x),ol=(t,e)=>({x:0,y:t.y+t.tallest,tallest:e.h}),sl=(t,e)=>({x:t.x,y:t.y,tallest:Math.max(t.tallest,e.h)}),al=(t,e,n)=>t.x+e.w<=n?sl(t,e):ol(t,e),Ko=(t,e,n)=>rl(t).reduce((r,o)=>{let a={...o,...nl(e.find(i=>i.key===o.type),n)},s=al(r.row,a,n);return{placed:[...r.placed,{...a,x:s.x,y:s.y}],row:{...s,x:s.x+a.w}}},{placed:[],row:{x:0,y:0,tallest:0}}).placed;dt();var Jo=500,il=(t,e=Jo)=>{let n=null,r=!1,o=()=>{clearTimeout(n),n=null};return{onPointerDown:()=>{n=setTimeout(()=>{r=!0,t()},e)},onPointerUp:o,onPointerLeave:o,onPointerCancel:o,onClickCapture:a=>{r&&(r=!1,a.stopPropagation(),a.preventDefault())}}},Zo=()=>({onClickCapture:t=>{t.stopPropagation(),t.preventDefault()}}),Qo=(t,e=Jo)=>{let n=M(t);n.current=t;let r=M(null);return r.current??(r.current=il(()=>n.current(),e)),r.current};var ts=(t,e,n)=>{t&&e!=null&&e!==n&&(t.innerHTML=e)};var ll=(t,{clientX:e,clientY:n})=>!!t&&e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,es=({layout:t,item:e,pointer:n,target:r,fixed:o})=>ll(r,n)&&!o?{remove:e.i}:{place:t};var cl=["se"],rs=(t,e)=>t.find(n=>n.key===e),ul=(t,e)=>rs(t,e)?.name??`Unknown block type (${e})`,dl=(t,e)=>t.filter(n=>n.name.toLowerCase().includes(e.trim().toLowerCase())),fl=t=>t.reduce((e,n)=>{let r=n.group??"";return(e.find(a=>a.name===r)??e[e.push({name:r,types:[]})-1]).types.push(n),e},[]),pl=(t,e)=>{let n=document.createElement("div");return n.dataset.blockContent=t,n.innerHTML=e,n},hl=({id:t,name:e,html:n})=>{let r=M(null),o=M(null),[a,s]=ot(!1);return Ht(()=>{let i=document.querySelector(`[data-block-content="${t}"]`)??(n?pl(t,n):null);i&&i.parentElement!==r.current&&r.current.appendChild(i),ts(i,n,o.current),o.current=n,s(!!i)},[t,n]),f.createElement(f.Fragment,null,a?null:e,f.createElement("div",{ref:r}))},ns=(t,e)=>t.once&&e.some(n=>n.type===t.key);function Sr({base:t,token:e,emptyMessage:n,editing:r=!1,...o}){let{layout:a,error:s,send:i}=Yo(t,e,o),{block_types:l=[],blocks:c=[],grid:p={},contents:d={}}=a,h=a.limits??l,{width:E,containerRef:S,mounted:P}=qn({measureBeforeMount:!0}),{columns:x,rowHeight:b,gap:lt,narrow:V}=Vo(E,p),ct=Uo(V?Ko(c,h,x):c,h),nt=M(null),at=M(null),ut=M(null),[$,st]=ot(r),[Dt,Pt]=ot(!1),[Tt,W]=ot(""),[j,Et]=ot(null),ft=c.find(w=>w.id===j),bt=rs(l,ft?.type)?.fields??[],Vt=w=>X=>{nt.current=w,X.dataTransfer.setData("text/plain",w.key)},Kt={enabled:!0,onDragOver:()=>nt.current?{w:nt.current.width,h:nt.current.height}:!1},kt=Qo(()=>st(!0)),It=$?Zo():{...kt,"data-hold-to-edit":!0};Ht(()=>{let w=ut.current;w&&(Dt&&!w.open&&w.showModal?.(),!Dt&&w.open&&w.close?.())},[Dt]);let Yt=(w,X,u)=>{let m=es({layout:w,item:X,pointer:u,target:at.current?.getBoundingClientRect(),fixed:!xr(c.find(z=>z.id===X.i)??{},h).removed});m.remove?Fo(i,m.remove):wr(i,m.place)},Jt=(w,X)=>{nt.current&&$o(i,nt.current.key,X),nt.current=null};return f.createElement("div",null,$&&f.createElement("dialog",{ref:ut,"data-blocks-dialog":!0,onClose:()=>Pt(!1)},f.createElement(qo,{title:"Blocks",spacing:"sm"},f.createElement(vr,{htmlFor:"ks-blocks-search"},"Search blocks"),f.createElement(br,{id:"ks-blocks-search",type:"search",value:Tt,onChange:w=>W(w.target.value),className:"mb-2"}),l.length===0?f.createElement("p",null,"There are no blocks to add."):fl(dl(l,Tt)).map(w=>f.createElement(f.Fragment,{key:w.name},w.name&&f.createElement("h3",{className:"ks-section-title"},w.name),f.createElement("ul",null,w.types.map(X=>f.createElement("li",{key:X.key,"data-block-type":X.key,className:"flex items-center justify-between gap-2 py-1",draggable:"true",onDragStart:Vt(X)},f.createElement("span",null,X.name,X.description&&f.createElement("span",{className:"ks-section-subtitle block"},X.description)),f.createElement(Me,{variant:"secondary",size:"sm",type:"button",disabled:ns(X,c),onClick:()=>Xo(i,()=>Pt(!1),X.key)},ns(X,c)?"Added":"Add"))))))),f.createElement(Me,{variant:"secondary",size:"sm",type:"button","data-close-blocks":!0,onClick:()=>Pt(!1)},"Close")),s&&f.createElement(Ao,{type:"error",message:s,className:"mb-3"}),$?f.createElement(f.Fragment,null,f.createElement(Me,{variant:"secondary",size:"sm",type:"button","data-open-blocks":!0,onClick:()=>Pt(!0)},"Add a block"),f.createElement(Me,{variant:"secondary",size:"sm",type:"button","data-stop-editing":!0,onClick:()=>st(!1)},"Done")):f.createElement(Me,{variant:"secondary",size:"sm",type:"button","data-start-editing":!0,onClick:()=>st(!0)},"Edit"),c.length===0&&f.createElement("p",null,n),bt.length>0&&f.createElement("div",{"data-block-fields":!0,className:"mb-3"},bt.map(w=>f.createElement("div",{key:w.key,className:"mb-2"},f.createElement(vr,{htmlFor:`ks-block-field-${w.key}`},w.label),f.createElement(br,{key:`${j}-${w.key}`,id:`ks-block-field-${w.key}`,type:"text",defaultValue:ft.content?.[w.key]??"",onBlur:X=>Go(i,j,{...ft.content,[w.key]:X.target.value})})))),$&&f.createElement("div",{ref:at,"data-remove-target":!0,className:"ks-remove-target","aria-label":"Drop a block here to remove it"},"\u2715"),f.createElement("div",{ref:S,"data-block-grid":!0,style:{overflow:"hidden",visibility:P?"visible":"hidden"}},f.createElement(Ue,{width:E,layout:ct,gridConfig:{cols:x,rowHeight:b,margin:[lt,lt]},resizeConfig:{enabled:$&&!V,handles:cl},dragConfig:{enabled:$&&!V},dropConfig:Kt,onDrop:Jt,onDragStop:(w,X,u,m,z)=>Yt(w,u,z),onResizeStop:w=>wr(i,w)},c.map(w=>f.createElement("div",{key:w.id,"data-block":w.id,...It,onClick:()=>Et(w.id)},f.createElement(hl,{id:w.id,name:ul(h,w.type),html:d[w.id]}))))))}dt();var os=new Map,Dn=new Map,ss=(t,e)=>os.set(t,e),as=()=>{Dn.forEach(t=>t.unmount()),Dn.clear()},is=(t,e)=>t.querySelectorAll("[data-react-ui]").forEach(n=>{if(Dn.has(n))return;let r=os.get(n.dataset.reactUi),o=e(n);Dn.set(n,o),o.render(f.createElement(r,JSON.parse(n.dataset.props)))});var ls=(t,e)=>{let n=()=>is(t,e);t.addEventListener("turbo:load",n),t.addEventListener("turbo:frame-load",n),t.addEventListener("turbo:before-cache",as),t.readyState==="loading"?t.addEventListener("DOMContentLoaded",n):n()};ss("dash_kit/dashboard-grid",Sr);ls(document,zn);})();
|
|
@@ -8,6 +8,15 @@ module DashKit
|
|
|
8
8
|
|
|
9
9
|
before_action :require_editable!, only: %i[add_block place_blocks remove_block save_filters create_definition update_definition destroy_definition]
|
|
10
10
|
|
|
11
|
+
def block_content(block)
|
|
12
|
+
helpers.dash_kit_block_frame(block_layout_record, block)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def place_blocks
|
|
16
|
+
block_layout_record.place_blocks(placed_order, version: params[:version])
|
|
17
|
+
head :no_content
|
|
18
|
+
end
|
|
19
|
+
|
|
11
20
|
def index
|
|
12
21
|
@dashboards = dashboard_scope.all
|
|
13
22
|
end
|
|
@@ -106,6 +115,10 @@ module DashKit
|
|
|
106
115
|
)
|
|
107
116
|
end
|
|
108
117
|
|
|
118
|
+
def placed_order
|
|
119
|
+
params.require(:layout).map { |position| position.permit(:id, :x, :y).to_h }
|
|
120
|
+
end
|
|
121
|
+
|
|
109
122
|
def block_layout_record
|
|
110
123
|
widget_dashboard
|
|
111
124
|
end
|
|
@@ -75,7 +75,8 @@ module DashKit
|
|
|
75
75
|
def dash_kit_block_frame(config, block)
|
|
76
76
|
return dash_kit_widget_frame(block["type"], dashboard_id: config.id) unless block["type"] == WidgetRegistry::BUILT_WIDGET.to_s
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
definition = config.widget_definitions.find_by(id: block.dig("content", "definition_id"))
|
|
79
|
+
definition ? dash_kit_widget_definition_frame(definition) : dash_kit_loading_skeleton
|
|
79
80
|
end
|
|
80
81
|
|
|
81
82
|
def dash_kit_widget_frame(widget_key, dashboard_id: nil, &block)
|
|
@@ -15,6 +15,16 @@ module DashKit
|
|
|
15
15
|
dashboard_type.to_sym
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
def layout_data
|
|
19
|
+
room_blocks_from_their_types!
|
|
20
|
+
KsBlocks.layout_data(blocks, kind: block_layout_kind, grid: declared_grid, offered: block_layout_offered)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def room_blocks_from_their_types!
|
|
24
|
+
roomed = roomed_blocks
|
|
25
|
+
update!(blocks: roomed) unless roomed == blocks
|
|
26
|
+
end
|
|
27
|
+
|
|
18
28
|
def add_built_widget(definition, x: nil, y: nil)
|
|
19
29
|
built = KsBlocks.registry.block_types(kind: block_layout_kind).find { |type| type.key == WidgetRegistry::BUILT_WIDGET }
|
|
20
30
|
add_block(built, x: x, y: y)
|
|
@@ -49,5 +59,31 @@ module DashKit
|
|
|
49
59
|
copy.save!
|
|
50
60
|
copy
|
|
51
61
|
end
|
|
62
|
+
|
|
63
|
+
private
|
|
64
|
+
|
|
65
|
+
def roomed_blocks
|
|
66
|
+
rooms = block_layout_types.index_by { |block_type| block_type.key.to_s }
|
|
67
|
+
|
|
68
|
+
blocks.map do |block|
|
|
69
|
+
room = rooms[block["type"]]
|
|
70
|
+
room ? block.merge("w" => room.width, "h" => room.height) : block
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def declared_grid
|
|
75
|
+
declared = DashKit.registry.grid_for(dashboard_type)
|
|
76
|
+
columns = declared.fetch(:columns, KsBlocks::Grid::COLUMNS)
|
|
77
|
+
row_height = declared.fetch(:row_height, KsBlocks::Grid::ROW_HEIGHT)
|
|
78
|
+
gap = declared.fetch(:gap, KsBlocks::Grid::GAP)
|
|
79
|
+
|
|
80
|
+
{
|
|
81
|
+
columns: columns, row_height: row_height, gap: gap,
|
|
82
|
+
narrow_columns: declared[:narrow_columns] || columns,
|
|
83
|
+
narrow_row_height: declared[:narrow_row_height] || row_height,
|
|
84
|
+
narrow_gap: declared[:narrow_gap] || gap,
|
|
85
|
+
narrow_below: declared.fetch(:narrow_below, KsBlocks::Grid::NARROW_BELOW)
|
|
86
|
+
}
|
|
87
|
+
end
|
|
52
88
|
end
|
|
53
89
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dash_kit-develop
|
|
3
|
-
description: Use to build dashboards and widgets with DashKit in a host app: register widget types, write widget partials, render and lazy-load them, and persist per-owner visibility, order, and filters correctly.
|
|
3
|
+
description: "Use to build dashboards and widgets with DashKit in a host app: register widget types, write widget partials, render and lazy-load them, and persist per-owner visibility, order, and filters correctly."
|
|
4
4
|
tools: Read, Edit, Write, Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dash_kit-install
|
|
3
|
-
description: Use to set DashKit up in a host Rails app: add the gem, run the install generator, mount the engine, configure the initializer, wire the owner association, importmap, and Stimulus controllers.
|
|
3
|
+
description: "Use to set DashKit up in a host Rails app: add the gem, run the install generator, mount the engine, configure the initializer, wire the owner association, importmap, and Stimulus controllers."
|
|
4
4
|
tools: Read, Edit, Write, Bash
|
|
5
5
|
---
|
|
6
6
|
|
data/lib/dash_kit/version.rb
CHANGED
|
@@ -8,12 +8,14 @@ module DashKit
|
|
|
8
8
|
|
|
9
9
|
def initialize
|
|
10
10
|
@dashboards = {}
|
|
11
|
+
@grids = {}
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
def register(dashboard_type, &block)
|
|
14
15
|
builder = DashboardBuilder.new
|
|
15
16
|
block.call(builder)
|
|
16
17
|
@dashboards[dashboard_type.to_sym] = builder.widgets.freeze
|
|
18
|
+
@grids[dashboard_type.to_sym] = builder.grid_shape.freeze
|
|
17
19
|
register_block_types(dashboard_type)
|
|
18
20
|
end
|
|
19
21
|
|
|
@@ -39,6 +41,10 @@ module DashKit
|
|
|
39
41
|
@dashboards.keys
|
|
40
42
|
end
|
|
41
43
|
|
|
44
|
+
def grid_for(dashboard_type)
|
|
45
|
+
@grids.fetch(dashboard_type.to_sym, {})
|
|
46
|
+
end
|
|
47
|
+
|
|
42
48
|
private
|
|
43
49
|
|
|
44
50
|
def register_block_types(dashboard_type)
|
|
@@ -54,13 +60,18 @@ module DashKit
|
|
|
54
60
|
end
|
|
55
61
|
|
|
56
62
|
class DashboardBuilder
|
|
57
|
-
attr_reader :widgets
|
|
63
|
+
attr_reader :widgets, :grid_shape
|
|
58
64
|
|
|
59
65
|
def initialize
|
|
60
66
|
@widgets = {}
|
|
67
|
+
@grid_shape = {}
|
|
61
68
|
@position = 0
|
|
62
69
|
end
|
|
63
70
|
|
|
71
|
+
def grid(**shape)
|
|
72
|
+
@grid_shape = shape
|
|
73
|
+
end
|
|
74
|
+
|
|
64
75
|
def widget(key, label:, partial:, **options)
|
|
65
76
|
@position += 1
|
|
66
77
|
@widgets[key.to_sym] = { label: label, partial: partial, position: @position }.merge(options)
|
data/lib/dash_kit.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dash_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tyler Schneider
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rails
|
|
@@ -58,14 +57,14 @@ dependencies:
|
|
|
58
57
|
requirements:
|
|
59
58
|
- - ">="
|
|
60
59
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 0.
|
|
60
|
+
version: 0.6.0
|
|
62
61
|
type: :runtime
|
|
63
62
|
prerelease: false
|
|
64
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
64
|
requirements:
|
|
66
65
|
- - ">="
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: 0.
|
|
67
|
+
version: 0.6.0
|
|
69
68
|
description: DashKit provides a presentation layer for building reusable dashboards.
|
|
70
69
|
Register widgets, persist user configuration, and render dashboards without coupling
|
|
71
70
|
to any specific data backend.
|
|
@@ -107,7 +106,6 @@ files:
|
|
|
107
106
|
- lib/dash_kit/reference.rb
|
|
108
107
|
- lib/dash_kit/reference/guide.md
|
|
109
108
|
- lib/dash_kit/renderer_registry.rb
|
|
110
|
-
- lib/dash_kit/the_local.rb
|
|
111
109
|
- lib/dash_kit/the_local/agents/dash_kit-develop.md
|
|
112
110
|
- lib/dash_kit/the_local/agents/dash_kit-info.md
|
|
113
111
|
- lib/dash_kit/the_local/agents/dash_kit-install.md
|
|
@@ -125,7 +123,6 @@ metadata:
|
|
|
125
123
|
homepage_uri: https://github.com/DYB-Development/dash_kit
|
|
126
124
|
source_code_uri: https://github.com/DYB-Development/dash_kit
|
|
127
125
|
changelog_uri: https://github.com/DYB-Development/dash_kit/blob/main/CHANGELOG.md
|
|
128
|
-
post_install_message:
|
|
129
126
|
rdoc_options: []
|
|
130
127
|
require_paths:
|
|
131
128
|
- lib
|
|
@@ -140,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
140
137
|
- !ruby/object:Gem::Version
|
|
141
138
|
version: '0'
|
|
142
139
|
requirements: []
|
|
143
|
-
rubygems_version:
|
|
144
|
-
signing_key:
|
|
140
|
+
rubygems_version: 4.0.20
|
|
145
141
|
specification_version: 4
|
|
146
142
|
summary: A Rails engine for composable, configurable dashboards and widgets.
|
|
147
143
|
test_files: []
|
data/lib/dash_kit/the_local.rb
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "dash_kit/reference"
|
|
4
|
-
|
|
5
|
-
begin
|
|
6
|
-
require "the_local"
|
|
7
|
-
|
|
8
|
-
TheLocal.register(
|
|
9
|
-
"dash_kit",
|
|
10
|
-
prefix: "dash_kit",
|
|
11
|
-
scope: "composable, configurable Rails dashboards and widgets",
|
|
12
|
-
agents_dir: File.expand_path("the_local/agents", __dir__)
|
|
13
|
-
) do |c|
|
|
14
|
-
c.agent "info",
|
|
15
|
-
description: "Use to learn what DashKit is, what it does and does not do, and its architecture (widget registry, Dashboard, helpers, routes).",
|
|
16
|
-
tools: "Read",
|
|
17
|
-
body: "You explain DashKit, answering only from the reference: what it is, what it deliberately is not, its widget registry, the Dashboard model, the WidgetManagement concern, the renderer registry and runtime widget builder (WidgetDefinition records built from a source and visualization), the view helpers, the engine routes, and the Turbo lazy-load data flow that hands both registered and built widgets the dashboard's filter_state. You make no changes.",
|
|
18
|
-
knowledge: DashKit::Reference.content
|
|
19
|
-
|
|
20
|
-
c.agent "install",
|
|
21
|
-
description: "Use to set DashKit up in a host Rails app: add the gem, run the install generator, mount the engine, configure the initializer, wire the owner association, importmap, and Stimulus controllers.",
|
|
22
|
-
tools: "Read, Edit, Write, Bash",
|
|
23
|
-
body: "You install DashKit into a host Rails app, following only the reference's installation steps. You add the gem, run the install generator, migrate, mount the engine, then complete the manual wiring: the polymorphic owner association, the Stimulus controller registration, and the initializer (parent_controller, current_owner_method, and registered dashboards/widgets). You set up a dashboard controller and view that scope to the current owner. You do not invent configuration the reference does not describe.",
|
|
24
|
-
knowledge: DashKit::Reference.content
|
|
25
|
-
|
|
26
|
-
c.agent "develop",
|
|
27
|
-
description: "Use to build dashboards and widgets with DashKit in a host app: register widget types, write widget partials, render and lazy-load them, and persist per-owner visibility, order, and filters correctly.",
|
|
28
|
-
tools: "Read, Edit, Write, Bash",
|
|
29
|
-
body: "You build dashboards and widgets with DashKit, following the reference's conventions. You register dashboard types and widgets in DashKit.configure, write self-contained widget partials that fetch their own data, render through dash_kit_render_widgets so widgets lazy-load in Turbo Frames, and always scope dashboards to the current owner via Dashboard.for_owner. You enable the runtime widget builder by setting DashKit.available_sources_for and registering a renderer per visualization with DashKit.register_renderer, writing renderer partials that read filter_state just like registered widgets, and persisting built widgets through the create_definition/update_definition/destroy_definition routes rather than writing WidgetDefinition rows by hand. You persist preferences through the WidgetManagement methods and engine routes rather than writing JSON columns by hand. You never make DashKit query data or enforce metric semantics — those belong to the host.",
|
|
30
|
-
knowledge: DashKit::Reference.content
|
|
31
|
-
end
|
|
32
|
-
rescue LoadError
|
|
33
|
-
# the_local is a build-time-only dependency; the gem works without it.
|
|
34
|
-
end
|