@blockbite/libraries 0.11.6 → 0.11.7

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.
@@ -1,14 +1,6 @@
1
- (function(Ot,It){typeof exports=="object"&&typeof module<"u"?It(exports):typeof define=="function"&&define.amd?define(["exports"],It):(Ot=typeof globalThis<"u"?globalThis:Ot||self,It(Ot.BlockBiteLibraries={}))})(this,(function(Ot){"use strict";function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},It.apply(null,arguments)}var kt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ir,Cr={exports:{}};/*!
1
+ (function(je,ue){typeof exports=="object"&&typeof module<"u"?ue(exports):typeof define=="function"&&define.amd?define(["exports"],ue):(je=typeof globalThis<"u"?globalThis:je||self,ue(je.BlockBiteLibraries={}))})(this,(function(je){"use strict";function ue(){return ue=Object.assign?Object.assign.bind():function(u){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(u[r]=i[r])}return u},ue.apply(null,arguments)}var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pe(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var It,xt={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
5
- */var mr,Pr,jr,rn=(Ir||(Ir=1,mr=Cr,(function(){var e={}.hasOwnProperty;function t(){for(var n=[],s=0;s<arguments.length;s++){var f=arguments[s];if(f){var _=typeof f;if(_==="string"||_==="number")n.push(f);else if(Array.isArray(f)){if(f.length){var E=t.apply(null,f);E&&n.push(E)}}else if(_==="object")if(f.toString===Object.prototype.toString)for(var g in f)e.call(f,g)&&f[g]&&n.push(g);else n.push(f.toString())}}return n.join(" ")}mr.exports?(t.default=t,mr.exports=t):window.classNames=t})()),Cr.exports),vr=sr(rn),Mr,dt=sr((function(){if(jr)return Pr;jr=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,s=/^0o[0-7]+$/i,f=parseInt,_=Object.prototype.toString;function E(i){var l=typeof i;return!!i&&(l=="object"||l=="function")}function g(i){if(typeof i=="number")return i;if((function(p){return typeof p=="symbol"||(function(y){return!!y&&typeof y=="object"})(p)&&_.call(p)=="[object Symbol]"})(i))return NaN;if(E(i)){var l=typeof i.valueOf=="function"?i.valueOf():i;i=E(l)?l+"":l}if(typeof i!="string")return i===0?i:+i;i=i.replace(e,"");var d=n.test(i);return d||s.test(i)?f(i.slice(2),d?2:8):t.test(i)?NaN:+i}return Pr=function(i,l,d){return d===void 0&&(d=l,l=void 0),d!==void 0&&(d=(d=g(d))==d?d:0),l!==void 0&&(l=(l=g(l))==l?l:0),(function(p,y,R){return p==p&&(R!==void 0&&(p=p<=R?p:R),y!==void 0&&(p=p>=y?p:y)),p})(g(i),l,d)}})()),gr={exports:{}},nn=(Mr||(Mr=1,(function(e,t){var n="__lodash_hash_undefined__",s=9007199254740991,f="[object Arguments]",_="[object Array]",E="[object Boolean]",g="[object Date]",i="[object Error]",l="[object Function]",d="[object Map]",p="[object Number]",y="[object Object]",R="[object Promise]",b="[object RegExp]",j="[object Set]",N="[object String]",S="[object Symbol]",P="[object WeakMap]",u="[object ArrayBuffer]",M="[object DataView]",K=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,w={};w["[object Float32Array]"]=w["[object Float64Array]"]=w["[object Int8Array]"]=w["[object Int16Array]"]=w["[object Int32Array]"]=w["[object Uint8Array]"]=w["[object Uint8ClampedArray]"]=w["[object Uint16Array]"]=w["[object Uint32Array]"]=!0,w[f]=w[_]=w[u]=w[E]=w[M]=w[g]=w[i]=w[l]=w[d]=w[p]=w[y]=w[b]=w[j]=w[N]=w[P]=!1;var Z=typeof kt=="object"&&kt&&kt.Object===Object&&kt,Me=typeof self=="object"&&self&&self.Object===Object&&self,ie=Z||Me||Function("return this")(),Ye=t&&!t.nodeType&&t,I=Ye&&e&&!e.nodeType&&e,W=I&&I.exports===Ye,ne=W&&Z.process,X=(function(){try{return ne&&ne.binding&&ne.binding("util")}catch{}})(),q=X&&X.isTypedArray;function ee(r,a){for(var v=-1,C=r==null?0:r.length;++v<C;)if(a(r[v],v,r))return!0;return!1}function fe(r){var a=-1,v=Array(r.size);return r.forEach(function(C,te){v[++a]=[te,C]}),v}function We(r){var a=-1,v=Array(r.size);return r.forEach(function(C){v[++a]=C}),v}var $e,ce,Ae,F=Array.prototype,Oe=Function.prototype,Xe=Object.prototype,tt=ie["__core-js_shared__"],Re=Oe.toString,V=Xe.hasOwnProperty,A=($e=/[^.]+$/.exec(tt&&tt.keys&&tt.keys.IE_PROTO||""))?"Symbol(src)_1."+$e:"",se=Xe.toString,Q=RegExp("^"+Re.call(V).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=W?ie.Buffer:void 0,De=ie.Symbol,he=ie.Uint8Array,Jt=Xe.propertyIsEnumerable,Tt=F.splice,pt=De?De.toStringTag:void 0,ft=Object.getOwnPropertySymbols,ur=Vt?Vt.isBuffer:void 0,Ht=(ce=Object.keys,Ae=Object,function(r){return ce(Ae(r))}),Ge=Ve(ie,"DataView"),st=Ve(ie,"Map"),$t=Ve(ie,"Promise"),Zt=Ve(ie,"Set"),ae=Ve(ie,"WeakMap"),Ke=Ve(Object,"create"),St=Pe(Ge),ve=Pe(st),ye=Pe($t),At=Pe(Zt),Ct=Pe(ae),Rt=De?De.prototype:void 0,ht=Rt?Rt.valueOf:void 0;function Ne(r){var a=-1,v=r==null?0:r.length;for(this.clear();++a<v;){var C=r[a];this.set(C[0],C[1])}}function Ce(r){var a=-1,v=r==null?0:r.length;for(this.clear();++a<v;){var C=r[a];this.set(C[0],C[1])}}function ot(r){var a=-1,v=r==null?0:r.length;for(this.clear();++a<v;){var C=r[a];this.set(C[0],C[1])}}function wt(r){var a=-1,v=r==null?0:r.length;for(this.__data__=new ot;++a<v;)this.add(r[a])}function Le(r){var a=this.__data__=new Ce(r);this.size=a.size}function Pt(r,a){var v=Mt(r),C=!v&&Gt(r),te=!v&&!C&&Yt(r),B=!v&&!C&&!te&&Xt(r),ue=v||C||te||B,we=ue?(function(me,Fe){for(var Te=-1,be=Array(me);++Te<me;)be[Te]=Fe(Te);return be})(r.length,String):[],Be=we.length;for(var re in r)!V.call(r,re)||ue&&(re=="length"||te&&(re=="offset"||re=="parent")||B&&(re=="buffer"||re=="byteLength"||re=="byteOffset")||qt(re,Be))||we.push(re);return we}function mt(r,a){for(var v=r.length;v--;)if(_t(r[v][0],a))return v;return-1}function ke(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":pt&&pt in Object(r)?(function(a){var v=V.call(a,pt),C=a[pt];try{a[pt]=void 0;var te=!0}catch{}var B=se.call(a);return te&&(v?a[pt]=C:delete a[pt]),B})(r):(function(a){return se.call(a)})(r)}function Bt(r){return yt(r)&&ke(r)==f}function Qe(r,a,v,C,te){return r===a||(r==null||a==null||!yt(r)&&!yt(a)?r!=r&&a!=a:(function(B,ue,we,Be,re,me){var Fe=Mt(B),Te=Mt(ue),be=Fe?_:Ue(B),ze=Te?_:Ue(ue),bt=(be=be==f?y:be)==y,zt=(ze=ze==f?y:ze)==y,c=be==ze;if(c&&Yt(B)){if(!Yt(ue))return!1;Fe=!0,bt=!1}if(c&&!bt)return me||(me=new Le),Fe||Xt(B)?Ft(B,ue,we,Be,re,me):(function(U,T,_e,de,je,oe,Ee){switch(_e){case M:if(U.byteLength!=T.byteLength||U.byteOffset!=T.byteOffset)return!1;U=U.buffer,T=T.buffer;case u:return!(U.byteLength!=T.byteLength||!oe(new he(U),new he(T)));case E:case g:case p:return _t(+U,+T);case i:return U.name==T.name&&U.message==T.message;case b:case N:return U==T+"";case d:var xt=fe;case j:var ct=1&de;if(xt||(xt=We),U.size!=T.size&&!ct)return!1;var Et=Ee.get(U);if(Et)return Et==T;de|=2,Ee.set(U,T);var lr=Ft(xt(U),xt(T),de,je,oe,Ee);return Ee.delete(U),lr;case S:if(ht)return ht.call(U)==ht.call(T)}return!1})(B,ue,be,we,Be,re,me);if(!(1&we)){var O=bt&&V.call(B,"__wrapped__"),He=zt&&V.call(ue,"__wrapped__");if(O||He){var Je=O?B.value():B,lt=He?ue.value():ue;return me||(me=new Le),re(Je,lt,we,Be,me)}}return!!c&&(me||(me=new Le),(function(U,T,_e,de,je,oe){var Ee=1&_e,xt=vt(U),ct=xt.length,Et=vt(T),lr=Et.length;if(ct!=lr&&!Ee)return!1;for(var tr=ct;tr--;){var Lt=xt[tr];if(!(Ee?Lt in T:V.call(T,Lt)))return!1}var wr=oe.get(U);if(wr&&oe.get(T))return wr==T;var rr=!0;oe.set(U,T),oe.set(T,U);for(var Ut=Ee;++tr<ct;){var Kt=U[Lt=xt[tr]],Qt=T[Lt];if(de)var cr=Ee?de(Qt,Kt,Lt,T,U,oe):de(Kt,Qt,Lt,U,T,oe);if(!(cr===void 0?Kt===Qt||je(Kt,Qt,_e,de,oe):cr)){rr=!1;break}Ut||(Ut=Lt=="constructor")}if(rr&&!Ut){var nr=U.constructor,ir=T.constructor;nr==ir||!("constructor"in U)||!("constructor"in T)||typeof nr=="function"&&nr instanceof nr&&typeof ir=="function"&&ir instanceof ir||(rr=!1)}return oe.delete(U),oe.delete(T),rr})(B,ue,we,Be,re,me))})(r,a,v,C,Qe,te))}function ge(r){return!(!xe(r)||(function(a){return!!A&&A in a})(r))&&(Wt(r)?Q:K).test(Pe(r))}function jt(r){if(v=(a=r)&&a.constructor,C=typeof v=="function"&&v.prototype||Xe,a!==C)return Ht(r);var a,v,C,te=[];for(var B in Object(r))V.call(r,B)&&B!="constructor"&&te.push(B);return te}function Ft(r,a,v,C,te,B){var ue=1&v,we=r.length,Be=a.length;if(we!=Be&&!(ue&&Be>we))return!1;var re=B.get(r);if(re&&B.get(a))return re==a;var me=-1,Fe=!0,Te=2&v?new wt:void 0;for(B.set(r,a),B.set(a,r);++me<we;){var be=r[me],ze=a[me];if(C)var bt=ue?C(ze,be,me,a,r,B):C(be,ze,me,r,a,B);if(bt!==void 0){if(bt)continue;Fe=!1;break}if(Te){if(!ee(a,function(zt,c){if(O=c,!Te.has(O)&&(be===zt||te(be,zt,v,C,B)))return Te.push(c);var O})){Fe=!1;break}}else if(be!==ze&&!te(be,ze,v,C,B)){Fe=!1;break}}return B.delete(r),B.delete(a),Fe}function vt(r){return(function(a,v,C){var te=v(a);return Mt(a)?te:(function(B,ue){for(var we=-1,Be=ue.length,re=B.length;++we<Be;)B[re+we]=ue[we];return B})(te,C(a))})(r,Nt,gt)}function at(r,a){var v,C,te=r.__data__;return((C=typeof(v=a))=="string"||C=="number"||C=="symbol"||C=="boolean"?v!=="__proto__":v===null)?te[typeof a=="string"?"string":"hash"]:te.map}function Ve(r,a){var v=(function(C,te){return C==null?void 0:C[te]})(r,a);return ge(v)?v:void 0}Ne.prototype.clear=function(){this.__data__=Ke?Ke(null):{},this.size=0},Ne.prototype.delete=function(r){var a=this.has(r)&&delete this.__data__[r];return this.size-=a?1:0,a},Ne.prototype.get=function(r){var a=this.__data__;if(Ke){var v=a[r];return v===n?void 0:v}return V.call(a,r)?a[r]:void 0},Ne.prototype.has=function(r){var a=this.__data__;return Ke?a[r]!==void 0:V.call(a,r)},Ne.prototype.set=function(r,a){var v=this.__data__;return this.size+=this.has(r)?0:1,v[r]=Ke&&a===void 0?n:a,this},Ce.prototype.clear=function(){this.__data__=[],this.size=0},Ce.prototype.delete=function(r){var a=this.__data__,v=mt(a,r);return!(v<0||(v==a.length-1?a.pop():Tt.call(a,v,1),--this.size,0))},Ce.prototype.get=function(r){var a=this.__data__,v=mt(a,r);return v<0?void 0:a[v][1]},Ce.prototype.has=function(r){return mt(this.__data__,r)>-1},Ce.prototype.set=function(r,a){var v=this.__data__,C=mt(v,r);return C<0?(++this.size,v.push([r,a])):v[C][1]=a,this},ot.prototype.clear=function(){this.size=0,this.__data__={hash:new Ne,map:new(st||Ce),string:new Ne}},ot.prototype.delete=function(r){var a=at(this,r).delete(r);return this.size-=a?1:0,a},ot.prototype.get=function(r){return at(this,r).get(r)},ot.prototype.has=function(r){return at(this,r).has(r)},ot.prototype.set=function(r,a){var v=at(this,r),C=v.size;return v.set(r,a),this.size+=v.size==C?0:1,this},wt.prototype.add=wt.prototype.push=function(r){return this.__data__.set(r,n),this},wt.prototype.has=function(r){return this.__data__.has(r)},Le.prototype.clear=function(){this.__data__=new Ce,this.size=0},Le.prototype.delete=function(r){var a=this.__data__,v=a.delete(r);return this.size=a.size,v},Le.prototype.get=function(r){return this.__data__.get(r)},Le.prototype.has=function(r){return this.__data__.has(r)},Le.prototype.set=function(r,a){var v=this.__data__;if(v instanceof Ce){var C=v.__data__;if(!st||C.length<199)return C.push([r,a]),this.size=++v.size,this;v=this.__data__=new ot(C)}return v.set(r,a),this.size=v.size,this};var gt=ft?function(r){return r==null?[]:(r=Object(r),(function(a,v){for(var C=-1,te=a==null?0:a.length,B=0,ue=[];++C<te;){var we=a[C];v(we,C,a)&&(ue[B++]=we)}return ue})(ft(r),function(a){return Jt.call(r,a)}))}:function(){return[]},Ue=ke;function qt(r,a){return!!(a=a??s)&&(typeof r=="number"||le.test(r))&&r>-1&&r%1==0&&r<a}function Pe(r){if(r!=null){try{return Re.call(r)}catch{}try{return r+""}catch{}}return""}function _t(r,a){return r===a||r!=r&&a!=a}(Ge&&Ue(new Ge(new ArrayBuffer(1)))!=M||st&&Ue(new st)!=d||$t&&Ue($t.resolve())!=R||Zt&&Ue(new Zt)!=j||ae&&Ue(new ae)!=P)&&(Ue=function(r){var a=ke(r),v=a==y?r.constructor:void 0,C=v?Pe(v):"";if(C)switch(C){case St:return M;case ve:return d;case ye:return R;case At:return j;case Ct:return P}return a});var Gt=Bt((function(){return arguments})())?Bt:function(r){return yt(r)&&V.call(r,"callee")&&!Jt.call(r,"callee")},Mt=Array.isArray,Yt=ur||function(){return!1};function Wt(r){if(!xe(r))return!1;var a=ke(r);return a==l||a=="[object GeneratorFunction]"||a=="[object AsyncFunction]"||a=="[object Proxy]"}function ut(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=s}function xe(r){var a=typeof r;return r!=null&&(a=="object"||a=="function")}function yt(r){return r!=null&&typeof r=="object"}var Xt=q?(function(r){return function(a){return r(a)}})(q):function(r){return yt(r)&&ut(r.length)&&!!w[ke(r)]};function Nt(r){return(a=r)!=null&&ut(a.length)&&!Wt(a)?Pt(r):jt(r);var a}e.exports=function(r,a){return Qe(r,a)}})(gr,gr.exports)),gr.exports),sn=sr(nn);function Nr(e,t,n){return e[t]?e[t][0]?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function on(e){e===void 0&&(e={});var t=e.onResize,n=window.React.useRef(void 0);n.current=t;var s=e.round||Math.round,f=window.React.useRef(),_=window.React.useState({width:void 0,height:void 0}),E=_[0],g=_[1],i=window.React.useRef(!1);window.React.useEffect(function(){return i.current=!1,function(){i.current=!0}},[]);var l=window.React.useRef({width:void 0,height:void 0}),d=(function(p,y){var R=window.React.useRef(null),b=window.React.useRef(null);b.current=y;var j=window.React.useRef(null);window.React.useEffect(function(){N()});var N=window.React.useCallback(function(){var S=j.current,P=b.current,u=S||(P?P instanceof Element?P:P.current:null);R.current&&R.current.element===u&&R.current.subscriber===p||(R.current&&R.current.cleanup&&R.current.cleanup(),R.current={element:u,subscriber:p,cleanup:u?p(u):void 0})},[p]);return window.React.useEffect(function(){return function(){R.current&&R.current.cleanup&&(R.current.cleanup(),R.current=null)}},[]),window.React.useCallback(function(S){j.current=S,N()},[N])})(window.React.useCallback(function(p){return f.current&&f.current.box===e.box&&f.current.round===s||(f.current={box:e.box,round:s,instance:new ResizeObserver(function(y){var R=y[0],b=e.box==="border-box"?"borderBoxSize":e.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",j=Nr(R,b,"inlineSize"),N=Nr(R,b,"blockSize"),S=j?s(j):void 0,P=N?s(N):void 0;if(l.current.width!==S||l.current.height!==P){var u={width:S,height:P};l.current.width=S,l.current.height=P,n.current?n.current(u):i.current||g(u)}})}),f.current.instance.observe(p,{box:e.box}),function(){f.current&&f.current.instance.unobserve(p)}},[e.box,s]),e.ref);return window.React.useMemo(function(){return{ref:d,width:E.width,height:E.height}},[d,E.width,E.height])}var an="allotment-module_splitView__L-yRc",un="allotment-module_sashContainer__fzwJF",ln="allotment-module_splitViewContainer__rQnVa",Lr="allotment-module_splitViewView__MGZ6O",cn="allotment-module_vertical__WSwwa",dn="allotment-module_horizontal__7doS8",pn="allotment-module_separatorBorder__x-rDS";let or,Dr=!1,Or=!1;typeof navigator=="object"&&(or=navigator.userAgent,Or=or.indexOf("Macintosh")>=0,Dr=(or.indexOf("Macintosh")>=0||or.indexOf("iPad")>=0||or.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);const kr=Dr,fn=Or,Vr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?window.React.useLayoutEffect:window.React.useEffect;class hn{constructor(){this._size=void 0}getSize(){return this._size}setSize(t){this._size=t}}function dr(e,t){const n=e.length,s=n-t.length;return s>=0&&e.slice(s,n)===t}var Tr,Hr={exports:{}},$r,Ar,wn=(Tr||(Tr=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function s(){}function f(i,l,d){this.fn=i,this.context=l,this.once=d||!1}function _(i,l,d,p,y){if(typeof d!="function")throw new TypeError("The listener must be a function");var R=new f(d,p||i,y),b=n?n+l:l;return i._events[b]?i._events[b].fn?i._events[b]=[i._events[b],R]:i._events[b].push(R):(i._events[b]=R,i._eventsCount++),i}function E(i,l){--i._eventsCount==0?i._events=new s:delete i._events[l]}function g(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1)),g.prototype.eventNames=function(){var i,l,d=[];if(this._eventsCount===0)return d;for(l in i=this._events)t.call(i,l)&&d.push(n?l.slice(1):l);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(i)):d},g.prototype.listeners=function(i){var l=n?n+i:i,d=this._events[l];if(!d)return[];if(d.fn)return[d.fn];for(var p=0,y=d.length,R=new Array(y);p<y;p++)R[p]=d[p].fn;return R},g.prototype.listenerCount=function(i){var l=n?n+i:i,d=this._events[l];return d?d.fn?1:d.length:0},g.prototype.emit=function(i,l,d,p,y,R){var b=n?n+i:i;if(!this._events[b])return!1;var j,N,S=this._events[b],P=arguments.length;if(S.fn){switch(S.once&&this.removeListener(i,S.fn,void 0,!0),P){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,l),!0;case 3:return S.fn.call(S.context,l,d),!0;case 4:return S.fn.call(S.context,l,d,p),!0;case 5:return S.fn.call(S.context,l,d,p,y),!0;case 6:return S.fn.call(S.context,l,d,p,y,R),!0}for(N=1,j=new Array(P-1);N<P;N++)j[N-1]=arguments[N];S.fn.apply(S.context,j)}else{var u,M=S.length;for(N=0;N<M;N++)switch(S[N].once&&this.removeListener(i,S[N].fn,void 0,!0),P){case 1:S[N].fn.call(S[N].context);break;case 2:S[N].fn.call(S[N].context,l);break;case 3:S[N].fn.call(S[N].context,l,d);break;case 4:S[N].fn.call(S[N].context,l,d,p);break;default:if(!j)for(u=1,j=new Array(P-1);u<P;u++)j[u-1]=arguments[u];S[N].fn.apply(S[N].context,j)}}return!0},g.prototype.on=function(i,l,d){return _(this,i,l,d,!1)},g.prototype.once=function(i,l,d){return _(this,i,l,d,!0)},g.prototype.removeListener=function(i,l,d,p){var y=n?n+i:i;if(!this._events[y])return this;if(!l)return E(this,y),this;var R=this._events[y];if(R.fn)R.fn!==l||p&&!R.once||d&&R.context!==d||E(this,y);else{for(var b=0,j=[],N=R.length;b<N;b++)(R[b].fn!==l||p&&!R[b].once||d&&R[b].context!==d)&&j.push(R[b]);j.length?this._events[y]=j.length===1?j[0]:j:E(this,y)}return this},g.prototype.removeAllListeners=function(i){var l;return i?(l=n?n+i:i,this._events[l]&&E(this,l)):(this._events=new s,this._eventsCount=0),this},g.prototype.off=g.prototype.removeListener,g.prototype.addListener=g.prototype.on,g.prefixed=n,g.EventEmitter=g,e.exports=g})(Hr)),Hr.exports),_r=sr(wn);function Br(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.unshift(t))}function br(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.push(t))}function rt(e,t,n=1){const s=Math.max(0,Math.ceil((t-e)/n)),f=new Array(s);let _=-1;for(;++_<s;)f[_]=e+_*n;return f}var mn=sr((function(){if(Ar)return $r;Ar=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,s=/^0o[0-7]+$/i,f=parseInt,_=typeof kt=="object"&&kt&&kt.Object===Object&&kt,E=typeof self=="object"&&self&&self.Object===Object&&self,g=_||E||Function("return this")(),i=Object.prototype.toString,l=Math.max,d=Math.min,p=function(){return g.Date.now()};function y(b){var j=typeof b;return!!b&&(j=="object"||j=="function")}function R(b){if(typeof b=="number")return b;if((function(S){return typeof S=="symbol"||(function(P){return!!P&&typeof P=="object"})(S)&&i.call(S)=="[object Symbol]"})(b))return NaN;if(y(b)){var j=typeof b.valueOf=="function"?b.valueOf():b;b=y(j)?j+"":j}if(typeof b!="string")return b===0?b:+b;b=b.replace(e,"");var N=n.test(b);return N||s.test(b)?f(b.slice(2),N?2:8):t.test(b)?NaN:+b}return $r=function(b,j,N){var S,P,u,M,K,le,w=0,Z=!1,Me=!1,ie=!0;if(typeof b!="function")throw new TypeError("Expected a function");function Ye(q){var ee=S,fe=P;return S=P=void 0,w=q,M=b.apply(fe,ee)}function I(q){var ee=q-le;return le===void 0||ee>=j||ee<0||Me&&q-w>=u}function W(){var q=p();if(I(q))return ne(q);K=setTimeout(W,(function(ee){var fe=j-(ee-le);return Me?d(fe,u-(ee-w)):fe})(q))}function ne(q){return K=void 0,ie&&S?Ye(q):(S=P=void 0,M)}function X(){var q=p(),ee=I(q);if(S=arguments,P=this,le=q,ee){if(K===void 0)return(function(fe){return w=fe,K=setTimeout(W,j),Z?Ye(fe):M})(le);if(Me)return K=setTimeout(W,j),Ye(le)}return K===void 0&&(K=setTimeout(W,j)),M}return j=R(j)||0,y(N)&&(Z=!!N.leading,u=(Me="maxWait"in N)?l(R(N.maxWait)||0,j):u,ie="trailing"in N?!!N.trailing:ie),X.cancel=function(){K!==void 0&&clearTimeout(K),w=0,S=le=P=K=void 0},X.flush=function(){return K===void 0?M:ne(p())},X}})()),vn="sash-module_sash__K-9lB",gn="sash-module_disabled__Hm-wx",_n="sash-module_mac__Jf6OJ",Fr="sash-module_vertical__pB-rs",bn="sash-module_minimum__-UKxp",zn="sash-module_maximum__TCWxD",Yr="sash-module_horizontal__kFbiw",zr="sash-module_hover__80W6I",Sr="sash-module_active__bJspD";let nt=(function(e){return e.Vertical="VERTICAL",e.Horizontal="HORIZONTAL",e})({}),et=(function(e){return e.Disabled="DISABLED",e.Minimum="MINIMUM",e.Maximum="MAXIMUM",e.Enabled="ENABLED",e})({}),Wr=kr?20:8;const Xr=new _r;class Ur extends _r{get state(){return this._state}set state(t){this._state!==t&&(this.el.classList.toggle(gn,t===et.Disabled),this.el.classList.toggle("sash-disabled",t===et.Disabled),this.el.classList.toggle(bn,t===et.Minimum),this.el.classList.toggle("sash-minimum",t===et.Minimum),this.el.classList.toggle(zn,t===et.Maximum),this.el.classList.toggle("sash-maximum",t===et.Maximum),this._state=t,this.emit("enablementChange",t))}constructor(t,n,s){var f;super(),this.el=void 0,this.layoutProvider=void 0,this.orientation=void 0,this.size=void 0,this.hoverDelay=300,this.hoverDelayer=mn(_=>_.classList.add("sash-hover",zr),this.hoverDelay),this._state=et.Enabled,this.onPointerStart=_=>{const E=_.pageX,g=_.pageY,i={startX:E,currentX:E,startY:g,currentY:g};this.el.classList.add("sash-active",Sr),this.emit("start",i),this.el.setPointerCapture(_.pointerId);const l=p=>{p.preventDefault();const y={startX:E,currentX:p.pageX,startY:g,currentY:p.pageY};this.emit("change",y)},d=p=>{p.preventDefault(),this.el.classList.remove("sash-active",Sr),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(p.pointerId),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",d)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",d)},this.onPointerDoublePress=()=>{this.emit("reset")},this.onMouseEnter=()=>{this.el.classList.contains(Sr)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",zr)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",zr)},this.el=document.createElement("div"),this.el.classList.add("sash",vn),this.el.dataset.testid="sash",t.append(this.el),fn&&this.el.classList.add("sash-mac",_n),this.el.addEventListener("pointerdown",this.onPointerStart),this.el.addEventListener("dblclick",this.onPointerDoublePress),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave),typeof s.size=="number"?(this.size=s.size,s.orientation===nt.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=Wr,Xr.on("onDidChangeGlobalSize",_=>{this.size=_,this.layout()})),this.layoutProvider=n,this.orientation=(f=s.orientation)!=null?f:nt.Vertical,this.orientation===nt.Horizontal?(this.el.classList.add("sash-horizontal",Yr),this.el.classList.remove("sash-vertical",Fr)):(this.el.classList.remove("sash-horizontal",Yr),this.el.classList.add("sash-vertical",Fr)),this.layout()}layout(){if(this.orientation===nt.Vertical){const t=this.layoutProvider;this.el.style.left=t.getVerticalSashLeft(this)-this.size/2+"px",t.getVerticalSashTop&&(this.el.style.top=t.getVerticalSashTop(this)+"px"),t.getVerticalSashHeight&&(this.el.style.height=t.getVerticalSashHeight(this)+"px")}else{const t=this.layoutProvider;this.el.style.top=t.getHorizontalSashTop(this)-this.size/2+"px",t.getHorizontalSashLeft&&(this.el.style.left=t.getHorizontalSashLeft(this)+"px"),t.getHorizontalSashWidth&&(this.el.style.width=t.getHorizontalSashWidth(this)+"px")}}dispose(){this.el.removeEventListener("pointerdown",this.onPointerStart),this.el.removeEventListener("dblclick",this.onPointerDoublePress),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",()=>this.onMouseLeave),this.el.remove()}}let pr;var Rr;(Rr=pr||(pr={})).Distribute={type:"distribute"},Rr.Split=function(e){return{type:"split",index:e}},Rr.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};let it=(function(e){return e.Normal="NORMAL",e.Low="LOW",e.High="HIGH",e})({});class Jr{constructor(t,n,s){this.container=void 0,this.view=void 0,this._size=void 0,this._cachedVisibleSize=void 0,this.container=t,this.view=n,this.container.classList.add("split-view-view",Lr),this.container.dataset.testid="split-view-view",typeof s=="number"?(this._size=s,this._cachedVisibleSize=void 0,t.classList.add("split-view-view-visible")):(this._size=0,this._cachedVisibleSize=s.cachedVisibleSize)}set size(t){this._size=t}get size(){return this._size}get priority(){return this.view.priority}get snap(){return!!this.view.snap}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return this._cachedVisibleSize===void 0}setVisible(t,n){t!==this.visible&&(t?(this.size=dt(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof n=="number"?n:this.size,this.size=0),this.container.classList.toggle("split-view-view-visible",t),this.view.setVisible&&this.view.setVisible(t))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}set enabled(t){this.container.style.pointerEvents=t?"":"none"}layout(t){this.layoutContainer(t),this.view.layout(this.size,t)}}class Sn extends Jr{layoutContainer(t){this.container.style.left=`${t}px`,this.container.style.width=`${this.size}px`}}class Rn extends Jr{layoutContainer(t){this.container.style.top=`${t}px`,this.container.style.height=`${this.size}px`}}class yn extends _r{get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(t){this._startSnappingEnabled!==t&&(this._startSnappingEnabled=t,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(t){this._endSnappingEnabled!==t&&(this._endSnappingEnabled=t,this.updateSashEnablement())}constructor(t,n={},s,f,_){var E,g;if(super(),this.onDidChange=void 0,this.onDidDragStart=void 0,this.onDidDragEnd=void 0,this.orientation=void 0,this.sashContainer=void 0,this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.sashDragState=void 0,this.proportionalLayout=void 0,this.getSashOrthogonalSize=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onSashEnd=i=>{this.emit("sashchange",i),this.saveProportions();for(const l of this.viewItems)l.enabled=!0},this.orientation=(E=n.orientation)!=null?E:nt.Vertical,this.proportionalLayout=(g=n.proportionalLayout)!=null?g:!0,this.getSashOrthogonalSize=n.getSashOrthogonalSize,s&&(this.onDidChange=s),f&&(this.onDidDragStart=f),_&&(this.onDidDragEnd=_),this.sashContainer=document.createElement("div"),this.sashContainer.classList.add("sash-container",un),t.prepend(this.sashContainer),n.descriptor){this.size=n.descriptor.size;for(const[i,l]of n.descriptor.views.entries()){const d=l.size,p=l.container,y=l.view;this.addView(p,y,d,i,!0)}this.contentSize=this.viewItems.reduce((i,l)=>i+l.size,0),this.saveProportions()}}addView(t,n,s,f=this.viewItems.length,_){let E;E=typeof s=="number"?s:s.type==="split"?this.getViewSize(s.index)/2:s.type==="invisible"?{cachedVisibleSize:s.cachedVisibleSize}:n.minimumSize;const g=this.orientation===nt.Vertical?new Rn(t,n,E):new Sn(t,n,E);if(this.viewItems.splice(f,0,g),this.viewItems.length>1){const i=this.orientation===nt.Vertical?new Ur(this.sashContainer,{getHorizontalSashTop:p=>this.getSashPosition(p),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:nt.Horizontal}):new Ur(this.sashContainer,{getVerticalSashLeft:p=>this.getSashPosition(p),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:nt.Vertical}),l=this.orientation===nt.Vertical?p=>({sash:i,start:p.startY,current:p.currentY}):p=>({sash:i,start:p.startX,current:p.currentX});i.on("start",p=>{var y;this.emit("sashDragStart"),this.onSashStart(l(p));const R=this.viewItems.map(b=>b.size);(y=this.onDidDragStart)==null||y.call(this,R)}),i.on("change",p=>this.onSashChange(l(p))),i.on("end",()=>{var p;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(R=>R.sash===i));const y=this.viewItems.map(R=>R.size);(p=this.onDidDragEnd)==null||p.call(this,y)}),i.on("reset",()=>{const p=this.sashItems.findIndex(N=>N.sash===i),y=rt(p,-1,-1),R=rt(p+1,this.viewItems.length),b=this.findFirstSnapIndex(y),j=this.findFirstSnapIndex(R);(typeof b!="number"||this.viewItems[b].visible)&&(typeof j!="number"||this.viewItems[j].visible)&&this.emit("sashreset",p)});const d={sash:i};this.sashItems.splice(f-1,0,d)}_||this.relayout(),_||typeof s=="number"||s.type!=="distribute"||this.distributeViewSizes()}removeView(t,n){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");const s=this.viewItems.splice(t,1)[0].view;if(this.viewItems.length>=1){const f=Math.max(t-1,0);this.sashItems.splice(f,1)[0].sash.dispose()}return this.relayout(),n&&n.type==="distribute"&&this.distributeViewSizes(),s}moveView(t,n,s){const f=this.getViewCachedVisibleSize(n),_=f===void 0?this.getViewSize(n):pr.Invisible(f),E=this.removeView(n);this.addView(t,E,_,s)}getViewCachedVisibleSize(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].cachedVisibleSize}layout(t=this.size){const n=Math.max(this.size,this.contentSize);if(this.size=t,this.proportions)for(let s=0;s<this.viewItems.length;s++){const f=this.viewItems[s];f.size=dt(Math.round(this.proportions[s]*t),f.minimumSize,f.maximumSize)}else{const s=rt(0,this.viewItems.length),f=s.filter(E=>this.viewItems[E].priority===it.Low),_=s.filter(E=>this.viewItems[E].priority===it.High);this.resize(this.viewItems.length-1,t-n,void 0,f,_)}this.distributeEmptySpace(),this.layoutViews()}resizeView(t,n){if(t<0||t>=this.viewItems.length)return;const s=rt(0,this.viewItems.length).filter(g=>g!==t),f=[...s.filter(g=>this.viewItems[g].priority===it.Low),t],_=s.filter(g=>this.viewItems[g].priority===it.High),E=this.viewItems[t];n=Math.round(n),n=dt(n,E.minimumSize,Math.min(E.maximumSize,this.size)),E.size=n,this.relayout(f,_)}resizeViews(t){for(let n=0;n<t.length;n++){const s=this.viewItems[n];let f=t[n];f=Math.round(f),f=dt(f,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=f}this.contentSize=this.viewItems.reduce((n,s)=>n+s.size,0),this.saveProportions(),this.layout(this.size)}getViewSize(t){return t<0||t>=this.viewItems.length?-1:this.viewItems[t].size}isViewVisible(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].visible}setViewVisible(t,n){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[t].setVisible(n),this.distributeEmptySpace(t),this.layoutViews(),this.saveProportions()}distributeViewSizes(){const t=[];let n=0;for(const g of this.viewItems)g.maximumSize-g.minimumSize>0&&(t.push(g),n+=g.size);const s=Math.floor(n/t.length);for(const g of t)g.size=dt(s,g.minimumSize,g.maximumSize);const f=rt(0,this.viewItems.length),_=f.filter(g=>this.viewItems[g].priority===it.Low),E=f.filter(g=>this.viewItems[g].priority===it.High);this.relayout(_,E)}dispose(){this.sashItems.forEach(t=>t.sash.dispose()),this.sashItems=[],this.sashContainer.remove()}relayout(t,n){const s=this.viewItems.reduce((f,_)=>f+_.size,0);this.resize(this.viewItems.length-1,this.size-s,void 0,t,n),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}onSashStart({sash:t,start:n}){const s=this.sashItems.findIndex(f=>f.sash===t);(f=>{const _=this.viewItems.map(P=>P.size);let E,g,i=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;const d=rt(s,-1,-1),p=rt(s+1,this.viewItems.length),y=d.reduce((P,u)=>P+(this.viewItems[u].minimumSize-_[u]),0),R=d.reduce((P,u)=>P+(this.viewItems[u].viewMaximumSize-_[u]),0),b=p.length===0?Number.POSITIVE_INFINITY:p.reduce((P,u)=>P+(_[u]-this.viewItems[u].minimumSize),0),j=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((P,u)=>P+(_[u]-this.viewItems[u].viewMaximumSize),0);i=Math.max(y,j),l=Math.min(b,R);const N=this.findFirstSnapIndex(d),S=this.findFirstSnapIndex(p);if(typeof N=="number"){const P=this.viewItems[N],u=Math.floor(P.viewMinimumSize/2);E={index:N,limitDelta:P.visible?i-u:i+u,size:P.size}}if(typeof S=="number"){const P=this.viewItems[S],u=Math.floor(P.viewMinimumSize/2);g={index:S,limitDelta:P.visible?l+u:l-u,size:P.size}}this.sashDragState={start:f,current:f,index:s,sizes:_,minDelta:i,maxDelta:l,snapBefore:E,snapAfter:g}})(n)}onSashChange({current:t}){const{index:n,start:s,sizes:f,minDelta:_,maxDelta:E,snapBefore:g,snapAfter:i}=this.sashDragState;this.sashDragState.current=t;const l=t-s;this.resize(n,l,f,void 0,void 0,_,E,g,i),this.distributeEmptySpace(),this.layoutViews()}getSashPosition(t){let n=0;for(let s=0;s<this.sashItems.length;s++)if(n+=this.viewItems[s].size,this.sashItems[s].sash===t)return n;return 0}resize(t,n,s=this.viewItems.map(d=>d.size),f,_,E=Number.NEGATIVE_INFINITY,g=Number.POSITIVE_INFINITY,i,l){if(t<0||t>=this.viewItems.length)return 0;const d=rt(t,-1,-1),p=rt(t+1,this.viewItems.length);if(_)for(const w of _)Br(d,w),Br(p,w);if(f)for(const w of f)br(d,w),br(p,w);const y=d.map(w=>this.viewItems[w]),R=d.map(w=>s[w]),b=p.map(w=>this.viewItems[w]),j=p.map(w=>s[w]),N=d.reduce((w,Z)=>w+(this.viewItems[Z].minimumSize-s[Z]),0),S=d.reduce((w,Z)=>w+(this.viewItems[Z].maximumSize-s[Z]),0),P=p.length===0?Number.POSITIVE_INFINITY:p.reduce((w,Z)=>w+(s[Z]-this.viewItems[Z].minimumSize),0),u=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((w,Z)=>w+(s[Z]-this.viewItems[Z].maximumSize),0),M=Math.max(N,u,E),K=Math.min(P,S,g);let le=!1;if(i){const w=this.viewItems[i.index],Z=n>=i.limitDelta;le=Z!==w.visible,w.setVisible(Z,i.size)}if(!le&&l){const w=this.viewItems[l.index],Z=n<l.limitDelta;le=Z!==w.visible,w.setVisible(Z,l.size)}if(le)return this.resize(t,n,s,f,_,E,g);for(let w=0,Z=n=dt(n,M,K);w<y.length;w++){const Me=y[w],ie=dt(R[w]+Z,Me.minimumSize,Me.maximumSize);Z-=ie-R[w],Me.size=ie}for(let w=0,Z=n;w<b.length;w++){const Me=b[w],ie=dt(j[w]-Z,Me.minimumSize,Me.maximumSize);Z+=ie-j[w],Me.size=ie}return n}distributeEmptySpace(t){const n=this.viewItems.reduce((l,d)=>l+d.size,0);let s=this.size-n;const f=rt(0,this.viewItems.length),_=[],E=f.filter(l=>this.viewItems[l].priority===it.Low),g=f.filter(l=>this.viewItems[l].priority===it.Normal),i=f.filter(l=>this.viewItems[l].priority===it.High);_.push(...i,...g,...E),typeof t=="number"&&br(_,t);for(let l=0;s!==0&&l<_.length;l++){const d=this.viewItems[_[l]],p=dt(d.size+s,d.minimumSize,d.maximumSize);s-=p-d.size,d.size=p}}layoutViews(){var t;this.contentSize=this.viewItems.reduce((s,f)=>s+f.size,0);let n=0;for(const s of this.viewItems)s.layout(n),n+=s.size;(t=this.onDidChange)!=null&&t.call(this,this.viewItems.map(s=>s.size)),this.sashItems.forEach(s=>s.sash.layout()),this.updateSashEnablement()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(t=>t.size/this.contentSize))}updateSashEnablement(){let t=!1;const n=this.viewItems.map(i=>t=i.size-i.minimumSize>0||t);t=!1;const s=this.viewItems.map(i=>t=i.maximumSize-i.size>0||t),f=[...this.viewItems].reverse();t=!1;const _=f.map(i=>t=i.size-i.minimumSize>0||t).reverse();t=!1;const E=f.map(i=>t=i.maximumSize-i.size>0||t).reverse();let g=0;for(let i=0;i<this.sashItems.length;i++){const{sash:l}=this.sashItems[i];g+=this.viewItems[i].size;const d=!(n[i]&&E[i+1]),p=!(s[i]&&_[i+1]);if(d&&p){const y=rt(i,-1,-1),R=rt(i+1,this.viewItems.length),b=this.findFirstSnapIndex(y),j=this.findFirstSnapIndex(R),N=typeof b=="number"&&!this.viewItems[b].visible,S=typeof j=="number"&&!this.viewItems[j].visible;N&&_[i]&&(g>0||this.startSnappingEnabled)?l.state=et.Minimum:S&&n[i]&&(g<this.contentSize||this.endSnappingEnabled)?l.state=et.Maximum:l.state=et.Disabled}else l.state=d&&!p?et.Minimum:!d&&p?et.Maximum:et.Enabled}}findFirstSnapIndex(t){for(const n of t){const s=this.viewItems[n];if(s.visible&&s.snap)return n}for(const n of t){const s=this.viewItems[n];if(s.visible&&s.maximumSize-s.minimumSize>0)return;if(!s.visible&&s.snap)return n}}}class er{constructor(t){this.size=void 0,this.size=t}getPreferredSize(){return this.size}}class Zr{constructor(t,n){this.proportion=void 0,this.layoutService=void 0,this.proportion=t,this.layoutService=n}getPreferredSize(){return this.proportion*this.layoutService.getSize()}}class fr{getPreferredSize(){}}class qr{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(t){if(typeof t=="number")this.layoutStrategy=new er(t);else if(typeof t=="string"){const n=t.trim();if(dr(n,"%")){const s=Number(n.slice(0,-1))/100;this.layoutStrategy=new Zr(s,this.layoutService)}else if(dr(n,"px")){const s=Number(n.slice(0,-2))/100;this.layoutStrategy=new er(s)}else if(typeof Number.parseFloat(n)=="number"){const s=Number.parseFloat(n);this.layoutStrategy=new er(s)}else this.layoutStrategy=new fr}else this.layoutStrategy=new fr}constructor(t,n){var s;if(this.minimumSize=0,this.maximumSize=Number.POSITIVE_INFINITY,this.element=void 0,this.priority=void 0,this.snap=void 0,this.layoutService=void 0,this.layoutStrategy=void 0,this.layoutService=t,this.element=n.element,this.minimumSize=typeof n.minimumSize=="number"?n.minimumSize:30,this.maximumSize=typeof n.maximumSize=="number"?n.maximumSize:Number.POSITIVE_INFINITY,typeof n.preferredSize=="number")this.layoutStrategy=new er(n.preferredSize);else if(typeof n.preferredSize=="string"){const f=n.preferredSize.trim();if(dr(f,"%")){const _=Number(f.slice(0,-1))/100;this.layoutStrategy=new Zr(_,this.layoutService)}else if(dr(f,"px")){const _=Number(f.slice(0,-2));this.layoutStrategy=new er(_)}else if(typeof Number.parseFloat(f)=="number"){const _=Number.parseFloat(f);this.layoutStrategy=new er(_)}else this.layoutStrategy=new fr}else this.layoutStrategy=new fr;this.priority=(s=n.priority)!=null?s:it.Normal,this.snap=typeof n.snap=="boolean"&&n.snap}layout(t){}}function Gr(e){return e.minSize!==void 0||e.maxSize!==void 0||e.preferredSize!==void 0||e.priority!==void 0||e.visible!==void 0}const yr=window.React.forwardRef(({className:e,children:t},n)=>window.React.createElement("div",{ref:n,className:vr("split-view-view",Lr,e)},t));yr.displayName="Allotment.Pane";const Kr=window.React.forwardRef(({children:e,className:t,id:n,maxSize:s=1/0,minSize:f=30,proportionalLayout:_=!0,separator:E=!0,sizes:g,defaultSizes:i=g,snap:l=!1,vertical:d=!1,onChange:p,onReset:y,onVisibleChange:R,onDragStart:b,onDragEnd:j},N)=>{const S=window.React.useRef(null),P=window.React.useRef([]),u=window.React.useRef(new Map),M=window.React.useRef(null),K=window.React.useRef(new Map),le=window.React.useRef(new hn),w=window.React.useRef([]),[Z,Me]=window.React.useState(!1),ie=window.React.useMemo(()=>window.React.Children.toArray(e).filter(window.React.isValidElement),[e]),Ye=window.React.useCallback(I=>{var W,ne;const X=(W=w.current)==null?void 0:W[I];return typeof(X==null?void 0:X.preferredSize)=="number"&&((ne=M.current)!=null&&ne.resizeView(I,Math.round(X.preferredSize)),!0)},[]);return window.React.useImperativeHandle(N,()=>({reset:()=>{if(y)y();else{var I;(I=M.current)==null||I.distributeViewSizes();for(let W=0;W<w.current.length;W++)Ye(W)}},resize:I=>{var W;(W=M.current)==null||W.resizeViews(I)}})),Vr(()=>{let I=!0;i&&K.current.size!==i.length&&(I=!1,console.warn(`Expected ${i.length} children based on defaultSizes but found ${K.current.size}`)),I&&i&&(P.current=ie.map(X=>X.key));const W=It({orientation:d?nt.Vertical:nt.Horizontal,proportionalLayout:_},I&&i&&{descriptor:{size:i.reduce((X,q)=>X+q,0),views:i.map((X,q)=>{var ee,fe,We,$e;const ce=u.current.get(P.current[q]),Ae=new qr(le.current,It({element:document.createElement("div"),minimumSize:(ee=ce==null?void 0:ce.minSize)!=null?ee:f,maximumSize:(fe=ce==null?void 0:ce.maxSize)!=null?fe:s,priority:(We=ce==null?void 0:ce.priority)!=null?We:it.Normal},(ce==null?void 0:ce.preferredSize)&&{preferredSize:ce==null?void 0:ce.preferredSize},{snap:($e=ce==null?void 0:ce.snap)!=null?$e:l}));return w.current.push(Ae),{container:[...K.current.values()][q],size:X,view:Ae}})}});M.current=new yn(S.current,W,p,b,j),M.current.on("sashDragStart",()=>{var X;(X=S.current)==null||X.classList.add("split-view-sash-dragging")}),M.current.on("sashDragEnd",()=>{var X;(X=S.current)==null||X.classList.remove("split-view-sash-dragging")}),M.current.on("sashchange",X=>{if(R&&M.current){const q=ie.map(ee=>ee.key);for(let ee=0;ee<q.length;ee++){const fe=u.current.get(q[ee]);(fe==null?void 0:fe.visible)!==void 0&&fe.visible!==M.current.isViewVisible(ee)&&R(ee,M.current.isViewVisible(ee))}}}),M.current.on("sashreset",X=>{if(y)y();else{var q;if(Ye(X)||Ye(X+1))return;(q=M.current)==null||q.distributeViewSizes()}});const ne=M.current;return()=>{ne.dispose()}},[]),Vr(()=>{if(Z){const F=ie.map(V=>V.key),Oe=[...P.current],Xe=F.filter(V=>!P.current.includes(V)),tt=F.filter(V=>P.current.includes(V)),Re=P.current.map(V=>!F.includes(V));for(let V=Re.length-1;V>=0;V--){var I;Re[V]&&((I=M.current)!=null&&I.removeView(V),Oe.splice(V,1),w.current.splice(V,1))}for(const V of Xe){var W,ne,X,q,ee;const A=u.current.get(V),se=new qr(le.current,It({element:document.createElement("div"),minimumSize:(W=A==null?void 0:A.minSize)!=null?W:f,maximumSize:(ne=A==null?void 0:A.maxSize)!=null?ne:s,priority:(X=A==null?void 0:A.priority)!=null?X:it.Normal},(A==null?void 0:A.preferredSize)&&{preferredSize:A==null?void 0:A.preferredSize},{snap:(q=A==null?void 0:A.snap)!=null?q:l}));(ee=M.current)!=null&&ee.addView(K.current.get(V),se,pr.Distribute,F.findIndex(Q=>Q===V)),Oe.splice(F.findIndex(Q=>Q===V),0,V),w.current.splice(F.findIndex(Q=>Q===V),0,se)}for(;!sn(F,Oe);)for(const[V,A]of F.entries()){const se=Oe.findIndex(Q=>Q===A);if(se!==V){var fe;(fe=M.current)==null||fe.moveView(K.current.get(A),se,V);const Q=Oe[se];Oe.splice(se,1),Oe.splice(V,0,Q);break}}for(const V of Xe){var We;const A=F.findIndex(Q=>Q===V),se=w.current[A].preferredSize;se!==void 0&&((We=M.current)==null||We.resizeView(A,se))}for(const V of[...Xe,...tt]){var $e,ce;const A=u.current.get(V),se=F.findIndex(Q=>Q===V);A&&Gr(A)&&A.visible!==void 0&&(($e=M.current)==null?void 0:$e.isViewVisible(se))!==A.visible&&((ce=M.current)==null||ce.setViewVisible(se,A.visible))}for(const V of tt){const A=u.current.get(V),se=F.findIndex(Q=>Q===V);if(A&&Gr(A)){var Ae;A.preferredSize!==void 0&&w.current[se].preferredSize!==A.preferredSize&&(w.current[se].preferredSize=A.preferredSize);let Q=!1;A.minSize!==void 0&&w.current[se].minimumSize!==A.minSize&&(w.current[se].minimumSize=A.minSize,Q=!0),A.maxSize!==void 0&&w.current[se].maximumSize!==A.maxSize&&(w.current[se].maximumSize=A.maxSize,Q=!0),Q&&((Ae=M.current)==null||Ae.layout())}}(Xe.length>0||Re.length>0)&&(P.current=F)}},[ie,Z,s,f,l]),window.React.useEffect(()=>{M.current&&(M.current.onDidChange=p)},[p]),window.React.useEffect(()=>{M.current&&(M.current.onDidDragStart=b)},[b]),window.React.useEffect(()=>{M.current&&(M.current.onDidDragEnd=j)},[j]),on({ref:S,onResize:({width:I,height:W})=>{var ne;I&&W&&((ne=M.current)!=null&&ne.layout(d?W:I),le.current.setSize(d?W:I),Me(!0))}}),window.React.useEffect(()=>{kr&&xn(20)},[]),window.React.createElement("div",{ref:S,className:vr("split-view",d?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":E},an,d?cn:dn,{[pn]:E},t),id:n},window.React.createElement("div",{className:vr("split-view-container",ln)},window.React.Children.toArray(e).map(I=>{if(!window.React.isValidElement(I))return null;const W=I.key;return I.type.displayName==="Allotment.Pane"?(u.current.set(W,I.props),window.React.cloneElement(I,{key:W,ref:ne=>{const X=I.ref;X&&(X.current=ne),ne?K.current.set(W,ne):K.current.delete(W)}})):window.React.createElement(yr,{key:W,ref:ne=>{ne?K.current.set(W,ne):K.current.delete(W)}},I)})))});function xn(e){const t=dt(e,4,20),n=dt(e,1,8);document.documentElement.style.setProperty("--sash-size",t+"px"),document.documentElement.style.setProperty("--sash-hover-size",n+"px"),(function(s){Wr=s,Xr.emit("onDidChangeGlobalSize",s)})(t)}Kr.displayName="Allotment";var En=Object.assign(Kr,{Pane:yr});(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.grid-drag-resize{display:grid}.grid-drag-resize--dropping{background-color:#d8e9f666}.grid-drag-resize__item{position:relative}.grid-drag-resize__item--draggable-full{cursor:move;-webkit-user-select:none;user-select:none}.grid-drag-resize__item--dragging{opacity:.6}.grid-drag-resize__item--shadow{background-color:#bacbd74d}.grid-drag-resize__item--resizing>.grid-drag-resize__item__adjust{display:block}.grid-drag-resize__item--resizing>.grid-drag-resize__item__remove{transform:translate(-14px)}.grid-drag-resize__item--resizing>.grid-drag-resize__item__drop{transform:translate(-16px)}.grid-drag-resize__item__group{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%}.grid-drag-resize__item__mask{position:absolute;z-index:2;top:0;left:0;width:100%;height:100%;-webkit-user-select:none;user-select:none}.grid-drag-resize__item__border{display:none;position:absolute;z-index:3;background-color:#71c4ef}.grid-drag-resize__item__border--top{top:0;width:100%;height:2px}.grid-drag-resize__item__border--right{right:0;width:2px;height:100%}.grid-drag-resize__item__border--bottom{bottom:0;width:100%;height:2px}.grid-drag-resize__item__border--left{left:0;width:2px;height:100%}.grid-drag-resize__item--selected>.grid-drag-resize__item__border{display:block}.grid-drag-resize__item__adjust{display:none;position:absolute;z-index:4;width:10px;height:10px;border:1px solid #666;background-color:#fff;box-shadow:1px 1px 2px #0003}.grid-drag-resize__item__adjust--top{left:calc(50% - 5px);cursor:ns-resize}.grid-drag-resize__item__adjust--right{top:calc(50% - 5px);cursor:ew-resize}.grid-drag-resize__item__adjust--bottom{left:calc(50% - 5px);cursor:ns-resize}.grid-drag-resize__item__adjust--left{top:calc(50% - 5px);cursor:ew-resize}.grid-drag-resize__item__adjust--top-left{cursor:nwse-resize}.grid-drag-resize__item__adjust--top-right,.grid-drag-resize__item__adjust--bottom-left{cursor:nesw-resize}.grid-drag-resize__item__adjust--bottom-right{cursor:nwse-resize}.grid-drag-resize__item__remove{position:absolute;z-index:5;top:0;right:0;width:0;height:0;overflow:hidden;transition:transform .3s ease-in-out;border:0 solid rgba(255,0,0,.6);border-radius:50%;opacity:.8;background-color:#fff;box-shadow:0 0 2px #0003;cursor:pointer}.grid-drag-resize__item__remove:hover{opacity:1}.grid-drag-resize__item__remove:before,.grid-drag-resize__item__remove:after{content:"";display:block;position:absolute;top:5px;left:1px;width:9px;height:1px;transform-origin:center;background-color:#f009}.grid-drag-resize__item__remove:before{transform:rotate(-45deg)}.grid-drag-resize__item__remove:after{transform:rotate(45deg)}.grid-drag-resize__item__drop{position:absolute;z-index:5;left:calc(50% - 9px);width:0;height:0;overflow:hidden;transition:transform .3s ease-in-out;border:0 solid #666;border-radius:50%;opacity:.8;background-color:#fff;cursor:grab}.grid-drag-resize__item__drop:hover{opacity:1}.grid-drag-resize__item--hover>.grid-drag-resize__item__remove{width:13px;height:13px;border-width:1px}.grid-drag-resize__item--hover>.grid-drag-resize__item__drop{width:18px;height:18px;border-width:1px}.grid-drag-resize--sub{min-width:100%;min-height:100%}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();var Qr={exports:{}},ar={};/**
6
- * @license React
7
- * react-jsx-runtime.production.min.js
8
- *
9
- * Copyright (c) Facebook, Inc. and its affiliates.
10
- *
11
- * This source code is licensed under the MIT license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- */var en;function In(){if(en)return ar;en=1;var e=window.React,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,f=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_={key:!0,ref:!0,__self:!0,__source:!0};function E(g,i,l){var d,p={},y=null,R=null;l!==void 0&&(y=""+l),i.key!==void 0&&(y=""+i.key),i.ref!==void 0&&(R=i.ref);for(d in i)s.call(i,d)&&!_.hasOwnProperty(d)&&(p[d]=i[d]);if(g&&g.defaultProps)for(d in i=g.defaultProps,i)p[d]===void 0&&(p[d]=i[d]);return{$$typeof:t,type:g,key:y,ref:R,props:p,_owner:f.current}}return ar.Fragment=n,ar.jsx=E,ar.jsxs=E,ar}Qr.exports=In();var Se=Qr.exports;const hr=window.React.createContext(void 0);function tn(e){var t,n,s,f,_,E,g,i,l,d,p,y,R,b,j,N,S,P,u,M,K,le,w,Z,Me,ie,Ye;const I=window.React.useContext(hr),W=window.React.useRef(1),ne=window.React.useRef(1),X=window.React.useRef(1),q=window.React.useRef(2),ee=window.React.useRef(1),fe=window.React.useRef(2),We=window.React.useRef(),$e=window.React.useRef(),ce=window.React.useRef(),Ae=window.React.useRef(),F=window.React.useRef(),Oe=window.React.useRef(),Xe=window.React.useRef(),tt=window.React.useRef(),Re=window.React.useRef(),V=window.React.useRef(),A=window.React.useRef(),se=window.React.useRef(),Q=window.React.useRef(),Vt=window.React.useRef(),De=window.React.useRef(),he=window.React.useRef(),Jt=window.React.useRef();window.React.useEffect(()=>{var c,O,He,Je,lt,U,T,_e,de,je,oe;W.current=e.columns||1,ne.current=e.rows||1,X.current=(e.columnStart??0)<1?1:e.columnStart,q.current=(e.columnEnd??0)<2?2:e.columnEnd,ee.current=(e.rowStart??0)<1?1:e.rowStart,fe.current=(e.rowEnd??0)<2?2:e.rowEnd,Re.current=e.mask??!1,We.current=e.dragHandler||((c=e.parentProps)==null?void 0:c.dragHandler),$e.current=e.dropOutHandler||((O=e.parentProps)==null?void 0:O.dropOutHandler),ce.current=e.removeHandler||((He=e.parentProps)==null?void 0:He.removeHandler),Ae.current=e.overflow||((Je=e.parentProps)==null?void 0:Je.overflow),F.current=e.readonly??((lt=e.parentProps)==null?void 0:lt.readonly),Oe.current=F.current?!1:e.draggable??((U=e.parentProps)==null?void 0:U.draggable),Q.current=Oe.current??!0,Xe.current=F.current?!1:e.resizable??((T=e.parentProps)==null?void 0:T.resizable),Vt.current=Xe.current??!0,tt.current=F.current?!1:e.removable??((_e=e.parentProps)==null?void 0:_e.removable),De.current=tt.current??!0,Re.current=e.mask??((de=e.parentProps)==null?void 0:de.mask),he.current=Re.current??!1,V.current=F.current?!1:e.droppableOut??((je=e.parentProps)==null?void 0:je.droppableOut),Jt.current=V.current??!0,A.current=e.debug??((oe=e.parentProps)==null?void 0:oe.debug),se.current={...e.parentProps}},[e]);const[Tt,pt]=window.React.useState(Jt.current),[ft,ur]=window.React.useState($e.current),[Ht,Ge]=window.React.useState(ce.current),[st,$t]=window.React.useState(De.current),[Zt,ae]=window.React.useState(Ae.current),[Ke,St]=window.React.useState(We.current),[ve,ye]=window.React.useState(Q.current),[At,Ct]=window.React.useState(X.current),[Rt,ht]=window.React.useState(q.current),[Ne,Ce]=window.React.useState(ee.current),[ot,wt]=window.React.useState(fe.current),[Le,Pt]=window.React.useState(ne.current),[mt,ke]=window.React.useState(W.current),[Bt,Qe]=window.React.useState(he.current);window.React.useEffect(()=>{pt(V.current??!0)},[e.droppableOut,(t=e.parentProps)==null?void 0:t.droppableOut]),window.React.useEffect(()=>{ur($e.current)},[e.dropOutHandler,(n=e.parentProps)==null?void 0:n.dropOutHandler]),window.React.useEffect(()=>{Ge(ce.current)},[e.removeHandler,(s=e.parentProps)==null?void 0:s.removeHandler]),window.React.useEffect(()=>{$t(tt.current??!0)},[e.removable,(f=e.parentProps)==null?void 0:f.removable]),window.React.useEffect(()=>{Qe(Re.current??!1)},[e.mask,(_=e.parentProps)==null?void 0:_.mask]),window.React.useEffect(()=>{ae(Ae.current)},[e.overflow,(E=e.parentProps)==null?void 0:E.overflow]),window.React.useEffect(()=>{St(We.current)},[e.dragHandler,(g=e.parentProps)==null?void 0:g.dragHandler]),window.React.useEffect(()=>{ye(Oe.current??!0)},[e.draggable,(i=e.parentProps)==null?void 0:i.draggable]),window.React.useEffect(()=>{Ct(X.current)},[e.columnStart]),window.React.useEffect(()=>{ht(q.current)},[e.columnEnd]),window.React.useEffect(()=>{Ce(ee.current)},[e.rowStart]),window.React.useEffect(()=>{wt(fe.current)},[e.rowEnd]),window.React.useEffect(()=>{Pt(ne.current)},[e.rows]),window.React.useEffect(()=>{ke(W.current)},[e.columns]);const ge=window.React.useRef(null),[jt,Ft]=window.React.useState(ge.current),vt=window.React.useRef(null),[at,Ve]=window.React.useState(vt.current);window.React.useEffect(()=>{Ft(ge.current)},[]),window.React.useEffect(()=>{Ve(vt.current)},[Bt]);const[gt,Ue]=window.React.useState(se.current),qt=window.React.useRef({...se.current});window.React.useEffect(()=>{qt.current={...se.current,dragHandler:We.current,dropOutHandler:$e.current,removeHandler:ce.current,overflow:Ae.current,readonly:F.current,draggable:Oe.current,resizable:Xe.current,removable:tt.current,mask:Re.current,droppableIn:e.droppableIn,droppableOut:V.current,debug:A.current},Ue(qt.current)},[e.dragHandler,(l=e.parentProps)==null?void 0:l.dragHandler,e.dropOutHandler,(d=e.parentProps)==null?void 0:d.dropOutHandler,e.removeHandler,(p=e.parentProps)==null?void 0:p.removeHandler,e.overflow,(y=e.parentProps)==null?void 0:y.overflow,e.readonly,(R=e.parentProps)==null?void 0:R.readonly,e.draggable,(b=e.parentProps)==null?void 0:b.draggable,e.resizable,(j=e.parentProps)==null?void 0:j.resizable,e.removable,(N=e.parentProps)==null?void 0:N.removable,e.mask,(S=e.parentProps)==null?void 0:S.mask,e.droppableIn,(P=e.parentProps)==null?void 0:P.droppableIn,e.droppableOut,(u=e.parentProps)==null?void 0:u.droppableOut,e.debug,(M=e.parentProps)==null?void 0:M.debug]),A.current&&console.log(qt);const[Pe,_t]=window.React.useState(((K=e.parentProps)==null?void 0:K.gap)??0);window.React.useEffect(()=>{var c;const O=((c=e.parentProps)==null?void 0:c.gap)??0;_t(O<5?O:5)},[(le=e.parentProps)==null?void 0:le.gap]);const[Gt,Mt]=window.React.useState(((w=e.parentProps)==null?void 0:w.gap)??0);window.React.useEffect(()=>{var c;const O=((c=e.parentProps)==null?void 0:c.gap)??0;Mt(O<6.5?O:6.5)},[(Z=e.parentProps)==null?void 0:Z.gap]);const[Yt,Wt]=window.React.useState(((Me=e.parentProps)==null?void 0:Me.gap)??0);window.React.useEffect(()=>{var c;const O=((c=e.parentProps)==null?void 0:c.gap)??0;Wt(O<8?O:8)},[(ie=e.parentProps)==null?void 0:ie.gap]);const[ut,xe]=window.React.useState(I==null?void 0:I.state.hoverEle),[yt,Xt]=window.React.useState(ut===jt);window.React.useEffect(()=>{Xt(ut!==void 0&&(ut===jt||ut===at))},[ut,jt,at]),window.React.useEffect(()=>{xe(I==null?void 0:I.state.hoverEle)},[I==null?void 0:I.state.hoverEle]);const Nt=window.React.useMemo(()=>({gridColumnStart:At??"",gridColumnEnd:Rt??"",gridRowStart:Ne??"",gridRowEnd:ot??""}),[At,Rt,Ne,ot]);window.React.useEffect(()=>{var c;e.rows!==Le&&((c=e.updateRows)==null||c.call(e,Le))},[e,Le]),window.React.useEffect(()=>{var c;e.columns!==mt&&((c=e.updateColumns)==null||c.call(e,mt))},[e,mt]),window.React.useEffect(()=>{var c,O,He,Je,lt,U;let T=e.columnStart??0,_e=e.columnEnd??0,de=e.columns??0,je=e.rowStart??0,oe=e.rowEnd??0,Ee=e.rows??0;(T<1&&_e<1||T>0&&_e>0&&_e<=T)&&(T=0,_e=0),de<1&&(de=1),(je<1&&oe<1||oe<=je&&je>0&&oe>1)&&(je=0,oe=0),Ee<1&&(Ee=1),T<1&&_e<1&&je<1&&oe<1||(T<1&&(T=1),_e<T&&(de<1?_e=T+1:_e=T+de),je<1&&(je=1),oe<je&&(Ee<1?oe=je+1:oe=je+Ee),(de<1||de<_e-T)&&T!==void 0&&_e!==void 0&&(de=_e-T),(Ee<1||Ee<oe-je)&&oe!==void 0&&je!==void 0&&(Ee=oe-je)),(c=e.updateColumnStart)==null||c.call(e,T),(O=e.updateColumnEnd)==null||O.call(e,_e),(He=e.updateColumns)==null||He.call(e,de),(Je=e.updateRowStart)==null||Je.call(e,je),(lt=e.updateRowEnd)==null||lt.call(e,oe),(U=e.updateRows)==null||U.call(e,Ee)},[e]);const r=window.React.useCallback(c=>{var O,He;Q.current&&((He=e.startDrag)==null||He.call(e,{event:c,rect:((O=ge==null?void 0:ge.current)==null?void 0:O.getBoundingClientRect())??{height:0,width:0,x:0,y:0,bottom:0,right:0}}))},[e]),a=window.React.useCallback(()=>{var c;(c=e.dropEnd)==null||c.call(e)},[e]),v=window.React.useCallback(()=>{var c;(c=e.dropStart)==null||c.call(e,{ele:ge.current,remove:()=>{var O;De.current&&((O=e.remove)==null||O.call(e))}})},[e]),C=window.React.useCallback(c=>{var O;c.stopPropagation(),(O=e.remove)==null||O.call(e)},[e]);window.React.useEffect(()=>{if(ve&&Ke&&ge.current){const c=ge.current.querySelector(Ke);c instanceof HTMLElement&&(c.style.cursor="move",c.addEventListener("mousedown",r))}return()=>{window.removeEventListener("mousedown",r)}},[ve,Ke,r]);const te=window.React.useRef(),B=window.React.useRef(),ue=window.React.useRef(),we=window.React.useRef(),Be=window.React.useRef();window.React.useEffect(()=>{if(Tt&&ft&&ge.current){const c=ge.current.querySelector(ft);c instanceof HTMLElement&&(c.style.cursor="grab",c.setAttribute("draggable","true"),te.current&&c.removeEventListener("mousedown",te.current),B.current&&c.removeEventListener("mousemove",B.current),ue.current&&c.removeEventListener("mouseup",ue.current),we.current&&c.removeEventListener("dragstart",we.current),Be.current&&c.removeEventListener("dragend",Be.current),te.current=O=>{O.stopPropagation(),v()},c.addEventListener("mousedown",te.current),B.current=O=>{O.stopPropagation()},c.addEventListener("mousemove",B.current),ue.current=O=>{O.stopPropagation()},c.addEventListener("mouseup",ue.current),we.current=O=>{O.stopPropagation()},c.addEventListener("dragstart",we.current),Be.current=O=>{O.stopPropagation(),a()},c.addEventListener("dragend",Be.current))}},[ft,Tt,a,v]);const re=window.React.useRef(),me=window.React.useRef(),Fe=window.React.useRef(),Te=window.React.useRef();window.React.useEffect(()=>{if(st&&Ht&&ge.current){const c=ge.current.querySelector(Ht);c instanceof HTMLElement&&(c.style.cursor="pointer",re.current&&c.removeEventListener("click",re.current),me.current&&c.removeEventListener("mousedown",me.current),Fe.current&&c.removeEventListener("mousemove",Fe.current),Te.current&&c.removeEventListener("mouseup",Te.current),re.current=O=>{C(O)},c.addEventListener("click",re.current),me.current=O=>{O.stopPropagation()},c.addEventListener("mousedown",me.current),Fe.current=O=>{O.stopPropagation()},c.addEventListener("mousemove",Fe.current),Te.current=O=>{O.stopPropagation()},c.addEventListener("mouseup",Te.current))}},[st,Ht,C]);const be=window.React.useCallback(c=>{var O,He;F.current||(c.stopPropagation(),(O=e.select)==null||O.call(e)),Vt.current&&(c.stopPropagation(),(He=e.selectResizing)==null||He.call(e))},[e]),ze=window.React.useCallback((c,O)=>{var He,Je;Vt.current&&(c.stopPropagation(),(Je=e.startResize)==null||Je.call(e,{event:c,rect:((He=ge==null?void 0:ge.current)==null?void 0:He.getBoundingClientRect())??{height:0,width:0,x:0,y:0,bottom:0,right:0},cursor:c.target instanceof HTMLElement?getComputedStyle(c.target).cursor:"",direction:O}))},[e]),bt=window.React.useCallback(c=>{c.currentTarget instanceof HTMLElement&&I&&(I.state.hoverEle=c.currentTarget,I.setState({...I.state}))},[I]),zt=window.React.useCallback(()=>{I&&(I.state.hoverEle=void 0,I.setState({...I.state}))},[I]);return Se.jsxs("div",{className:`grid-drag-resize__item ${[...ve?["grid-drag-resize__item--draggable"]:[],...ve&&!Ke?["grid-drag-resize__item--draggable-full"]:[],...yt&&!(I!=null&&I.state.dragging)&&!(I!=null&&I.state.resizing)?["grid-drag-resize__item--hover"]:[],...e.className?[e.className]:[]].join(" ")}`,style:{...e.style,...Nt},onMouseDown:c=>Ke?void 0:r(c),onClick:be,onMouseOverCapture:bt,onMouseLeave:zt,ref:ge,children:[Se.jsx("div",{className:"grid-drag-resize__item__group",style:{overflow:Zt},children:e.grid?Se.jsx(Er,{...e.grid,droppingChild:I==null?void 0:I.state.droppingChild,parentProps:gt,updateCells:()=>{var c;return(c=gt==null?void 0:gt.updateCells)==null?void 0:c.call(gt,[...(gt==null?void 0:gt.cells)??[]])}}):(Ye=e.render)==null?void 0:Ye.call(e,e)}),Bt&&Se.jsx("div",{className:"grid-drag-resize__item__mask",onMouseDown:c=>Ke?void 0:r(c),onClick:be,onMouseOverCapture:bt,onMouseLeave:zt,ref:vt}),Se.jsx("b",{className:"grid-drag-resize__item__border grid-drag-resize__item__border--top"}),Se.jsx("b",{className:"grid-drag-resize__item__border grid-drag-resize__item__border--bottom"}),Se.jsx("b",{className:"grid-drag-resize__item__border grid-drag-resize__item__border--left"}),Se.jsx("b",{className:"grid-drag-resize__item__border grid-drag-resize__item__border--right"}),Se.jsx("i",{className:"grid-drag-resize__item__adjust grid-drag-resize__item__adjust--top",style:{top:`${-Pe}px`},onMouseDown:c=>ze(c,"top")}),Se.jsx("i",{className:"grid-drag-resize__item__adjust grid-drag-resize__item__adjust--right",style:{right:`${-Pe}px`},onMouseDown:c=>ze(c,"right")}),Se.jsx("i",{className:"grid-drag-resize__item__adjust grid-drag-resize__item__adjust--bottom",style:{bottom:`${-Pe}px`},onMouseDown:c=>ze(c,"bottom")}),Se.jsx("i",{className:"grid-drag-resize__item__adjust grid-drag-resize__item__adjust--left",style:{left:`${-Pe}px`},onMouseDown:c=>ze(c,"left")}),Se.jsx("i",{className:"grid-drag-resize__item__adjust grid-drag-resize__item__adjust--top-left",style:{top:`${-Pe}px`,left:`${-Pe}px`},onMouseDown:c=>ze(c,"top-left")}),Se.jsx("i",{className:"grid-drag-resize__item__adjust grid-drag-resize__item__adjust--top-right",style:{top:`${-Pe}px`,right:`${-Pe}px`},onMouseDown:c=>ze(c,"top-right")}),Se.jsx("i",{className:"grid-drag-resize__item__adjust grid-drag-resize__item__adjust--bottom-left",style:{bottom:`${-Pe}px`,left:`${-Pe}px`},onMouseDown:c=>ze(c,"bottom-left")}),Se.jsx("i",{className:"grid-drag-resize__item__adjust grid-drag-resize__item__adjust--bottom-right",style:{bottom:`${-Pe}px`,right:`${-Pe}px`},onMouseDown:c=>ze(c,"bottom-right")}),st&&!Ht&&Se.jsx("span",{className:"grid-drag-resize__item__remove",style:{top:`${-Gt}px`,right:`${-Gt}px`},onClick:C,onMouseDown:c=>c.stopPropagation(),onMouseMove:c=>c.stopPropagation(),onMouseUp:c=>c.stopPropagation()}),Tt&&!ft&&Se.jsx("div",{className:"grid-drag-resize__item__drop",style:{top:Tt?`${-Yt}px`:""},draggable:"true",onMouseDown:c=>{c.stopPropagation(),v()},onMouseMove:c=>c.stopPropagation(),onMouseUp:c=>c.stopPropagation(),onDragStart:c=>c.stopPropagation(),onDragEnd:c=>c.stopPropagation()})]})}let Cn=0;const xr=new Map;function Pn(e){if(xr.has(e))return xr.get(e);{const t=++Cn;return xr.set(e,t),t}}function jn(e){var t,n,s,f,_,E,g,i,l,d,p,y,R,b,j,N,S,P;const u=window.React.useContext(hr),M=window.React.useMemo(()=>e.parentProps!==void 0,[e.parentProps]),K=window.React.useRef(1),le=window.React.useRef(1),w=window.React.useRef(0),Z=window.React.useRef(),Me=window.React.useRef(),ie=window.React.useRef(),Ye=window.React.useRef(),I=window.React.useRef(),W=window.React.useRef(),ne=window.React.useRef(),X=window.React.useRef(),q=window.React.useRef(),ee=window.React.useRef(),fe=window.React.useRef(),We=window.React.useRef(),$e=window.React.useRef(),ce=window.React.useRef(),Ae=window.React.useRef("div"),F=window.React.useRef(),Oe=window.React.useRef();window.React.useEffect(()=>{var o,m,h,x,H,z,D,Y,G,J,k,L,$,pe,Ie;K.current=e.columns||1,le.current=e.rows||1,w.current=e.gap||0,Z.current=e.overflow||((o=e.parentProps)==null?void 0:o.overflow),Me.current=e.dragHandler||((m=e.parentProps)==null?void 0:m.dragHandler),ie.current=e.dropOutHandler||((h=e.parentProps)==null?void 0:h.dropOutHandler),Ye.current=e.removeHandler||((x=e.parentProps)==null?void 0:x.removeHandler),I.current=e.readonly??((H=e.parentProps)==null?void 0:H.readonly),W.current=I.current?!1:e.draggable??((z=e.parentProps)==null?void 0:z.draggable),ne.current=I.current?!1:e.resizable??((D=e.parentProps)==null?void 0:D.resizable),X.current=I.current?!1:e.removable??((Y=e.parentProps)==null?void 0:Y.removable),q.current=I.current?!1:e.droppableOut??((G=e.parentProps)==null?void 0:G.droppableOut),ee.current=e.mask??((J=e.parentProps)==null?void 0:J.mask),fe.current=e.debug??((k=e.parentProps)==null?void 0:k.debug),We.current=I.current?!1:e.droppableIn??((L=e.parentProps)==null?void 0:L.droppableIn),Oe.current=We.current??!0,$e.current=e.beforeDrop??(($=e.parentProps)==null?void 0:$.beforeDrop),ce.current=e.suffixClass||((pe=e.parentProps)==null?void 0:pe.suffixClass),Ae.current=e.tagName||((Ie=e.parentProps)==null?void 0:Ie.tagName)||"div"},[e]),window.React.useEffect(()=>{F.current=u.state.droppingChild??e.droppingChild},[u.state.droppingChild,e.droppingChild]);const[Xe,tt]=window.React.useState(Ae.current),[Re,V]=window.React.useState(F.current),[A,se]=window.React.useState(ce.current),[Q,Vt]=window.React.useState(w.current);window.React.useEffect(()=>{tt(Ae.current)},[e.tagName,(t=e.parentProps)==null?void 0:t.tagName]),window.React.useEffect(()=>{V(F.current)},[e.droppingChild,u.state.droppingChild]),window.React.useEffect(()=>{se(ce.current)},[e.suffixClass]),window.React.useEffect(()=>{Vt(w.current)},[e.gap]);const De=window.React.useRef(null),[he,Jt]=window.React.useState(De.current);window.React.useEffect(()=>{Jt(De.current)},[]);const[Tt,pt]=window.React.useState(),ft=window.React.useRef();window.React.useEffect(()=>{ft.current={...e,dragHandler:Me.current,dropOutHandler:ie.current,removeHandler:Ye.current,overflow:Z.current,readonly:I.current,draggable:W.current,resizable:ne.current,removable:X.current,droppableOut:q.current,mask:ee.current,debug:fe.current,droppableIn:We.current,beforeDrop:$e.current,suffixClass:ce.current,tagName:Ae.current},pt(ft.current)},[e.dragHandler,(n=e.parentProps)==null?void 0:n.dragHandler,e.dropOutHandler,(s=e.parentProps)==null?void 0:s.dropOutHandler,e.removeHandler,(f=e.parentProps)==null?void 0:f.removeHandler,e.overflow,(_=e.parentProps)==null?void 0:_.overflow,e.readonly,(E=e.parentProps)==null?void 0:E.readonly,e.draggable,(g=e.parentProps)==null?void 0:g.draggable,e.resizable,(i=e.parentProps)==null?void 0:i.resizable,e.removable,(l=e.parentProps)==null?void 0:l.removable,e.droppableOut,(d=e.parentProps)==null?void 0:d.droppableOut,e.mask,(p=e.parentProps)==null?void 0:p.mask,e.debug,(y=e.parentProps)==null?void 0:y.debug,e.droppableIn,(R=e.parentProps)==null?void 0:R.droppableIn,e.beforeDrop,(b=e.parentProps)==null?void 0:b.beforeDrop,e.suffixClass,(j=e.parentProps)==null?void 0:j.suffixClass,e.tagName,(N=e.parentProps)==null?void 0:N.tagName]),fe.current&&console.log(ft);const[ur,Ht]=window.React.useState({columnStart:1,columnEnd:2,rowStart:1,rowEnd:2});window.React.useEffect(()=>{Ht({columnStart:(Re==null?void 0:Re.columnStart)??1,columnEnd:(Re==null?void 0:Re.columnEnd)??2,rowStart:(Re==null?void 0:Re.rowStart)??1,rowEnd:(Re==null?void 0:Re.rowEnd)??2})},[Re]);const[Ge,st]=window.React.useState();window.React.useEffect(()=>{var o,m;u.state.droppingChildRaw&&he?st(((o=e.cells)==null?void 0:o.includes(u.state.droppingChildRaw))||((m=u.state.droppingChildEle)==null?void 0:m.contains(he))):st(!1)},[u.state.droppingChildRaw,u.state.droppingChildEle,he,e.cells]);const[$t,Zt]=window.React.useState(!1);window.React.useEffect(()=>{Zt(u.state.droppingEle===he&&!Ge)},[u.state.droppingEle,he,Ge]);const ae=window.React.useRef(),[Ke,St]=window.React.useState(),ve=window.React.useRef(1),ye=window.React.useRef(1),[At,Ct]=window.React.useState(le.current),[Rt,ht]=window.React.useState(K.current);window.React.useEffect(()=>{ve.current=e.rows||1,ye.current=e.columns||1},[e.rows,e.columns]),window.React.useEffect(()=>{Ct(ve.current),ht(ye.current)},[e.rows,e.columns]);const Ne=window.React.useMemo(()=>e.rowExpandable&&!Ge,[e.rowExpandable,Ge]),Ce=window.React.useMemo(()=>e.columnExpandable&&!Ge,[e.columnExpandable,Ge]),ot=window.React.useMemo(()=>({gridTemplateColumns:mt(Rt,e.columnExpandable??!1,e.columnSize,e.columnTemplate),gridTemplateRows:mt(At,e.rowExpandable??!1,e.rowSize,e.rowTemplate),gridGap:Q>0?`${Q}px ${Q}px`:""}),[Rt,e.columnSize,e.rowSize,At,Q,e.columnTemplate,e.rowTemplate,Ce,Ne]);window.React.useEffect(()=>{u.state.droppingChild!==e.droppingChild&&(u.state.droppingChild={...e.droppingChild},u.setState({...u.state}))},[e.droppingChild]);const wt=window.React.useCallback(()=>{var o;(o=e.updateDroppingChild)==null||o.call(e,void 0),u.state.droppingChild=void 0,u.state.droppingChildEle=void 0,u.state.droppingChildRaw=void 0,u.state.droppingEle=void 0,u.state.droppingChildRemove=void 0,u.setState({...u.state})},[u,e]),Le=window.React.useCallback(o=>{o?u.state.actionEle=De.current??void 0:u.state.actionEle=void 0},[u.state]);function Pt(o,m,h){const x=re(o),H=m-x.length,z=Number.isInteger(h)?`${h}px`:"1fr";return o+(H>0?` repeat(${H},${z})`:"")}function mt(o,m,h,x){return x?m?Pt(x,o,h):x:`repeat(${o},${Number.isInteger(h)?`${h}px`:"1fr"})`}const ke=window.React.useCallback((o,m,h=[])=>{const x=[...e.cells??[],...h].reduce((H,z)=>{const D={rows:z.rowEnd,columns:z.columnEnd}[o];D&&D>1&&D-1>H&&(H=D-1);const Y={rows:z.rows,columns:z.columns}[o]??1;return Math.max(H,Y)},1);return m===void 0||m<x?x:m},[e.cells]);window.React.useEffect(()=>{var o,m;const h=ke("rows",Math.max(le.current,re(e.rowTemplate??"").length));ve.current!==h&&(ve.current=h,Ct(ve.current),(o=e.updateRows)==null||o.call(e,ve.current));const x=ke("columns",Math.max(K.current,re(e.columnTemplate??"").length));ye.current!==x&&(ye.current=x,ht(ye.current),(m=e.updateColumns)==null||m.call(e,ye.current))},[e,ke]),window.React.useEffect(()=>{var o,m;const h=(o=e.cells)==null?void 0:o.find(x=>[x.columns,x.columnStart,x.columnEnd,x.rows,x.rowStart,x.rowEnd].every(H=>H!==void 0)&&x.columns>0&&x.columnStart<1&&x.columnEnd<1&&x.rows>0&&x.rowStart<1&&x.rowEnd<1);if(h&&e.cells){const x=e.cells.filter(J=>[J.columnStart,J.columnEnd,J.rowStart,J.rowEnd].every(k=>k!==void 0)&&J.columnEnd>J.columnStart&&J.rowEnd>J.rowStart);let H=!0,z=1,D=z+h.columns,Y=1,G=Y+h.rows;for(;H;Y++)for(G=Y+h.rows,z=1;z+h.columns<=ye.current+1&&H;z++){D=z+h.columns;let J=!1;for(const k of x)if(!(!(z>=k.columnStart&&z<k.columnEnd||D>k.columnStart&&D<=k.columnEnd)||!(Y>=k.rowStart&&Y<k.rowEnd||G>k.rowStart&&G<=k.rowEnd))){J=!0;break}J||(H=!1)}H||(z=z-1,Y=Y-1,h.columnStart=z,h.columnEnd=D,h.rowStart=Y,h.rowEnd=G,(m=e.updateCells)==null||m.call(e,e.cells?[...e.cells]:[]))}},[e,Rt]);function Bt(o,m,h,x){const H=x.filter(D=>/\d+px/.test(D)),z=H.map(D=>parseInt(D)+h).reduce((D,Y)=>D+Y,0);return(o-z-h*(m-1-H.length))/(m-H.length)}const Qe=window.React.useCallback(()=>{let o=((he==null?void 0:he.getBoundingClientRect())??{width:0}).width;return he&&(o=o-[parseInt(window.getComputedStyle(he).paddingLeft),parseInt(window.getComputedStyle(he).paddingRight)].filter(m=>!isNaN(m)).reduce((m,h)=>m+h,0)),e.columnSize||Bt(o,ye.current,Q,e.columnTemplate?re(e.columnTemplate):[])},[Rt,Q,e.columnSize,he,e.columnTemplate]),ge=window.React.useCallback(()=>{let o=((he==null?void 0:he.getBoundingClientRect())??{height:0}).height;return he&&(o=o-[parseInt(window.getComputedStyle(he).paddingTop),parseInt(window.getComputedStyle(he).paddingBottom)].filter(m=>!isNaN(m)).reduce((m,h)=>m+h,0)),e.rowSize||Bt(o,ve.current,Q,e.rowTemplate?re(e.rowTemplate):[])},[At,Q,e.rowSize,he,e.rowTemplate]),jt=window.React.useRef(0),Ft=window.React.useRef(0),vt=window.React.useRef(0),at=window.React.useRef(0),Ve=window.React.useRef(),gt=window.React.useRef(),Ue=window.React.useRef(""),[qt,Pe]=window.React.useState(Ue.current),_t=window.React.useRef(""),Gt=window.React.useRef(),Mt=window.React.useRef(0),Yt=window.React.useRef(0),Wt=window.React.useRef(0),ut=window.React.useRef(0),xe=window.React.useRef(),[yt,Xt]=window.React.useState(xe.current),Nt=window.React.useRef(),r=window.React.useRef(),a=window.React.useRef(),v=window.React.useRef(0),C=window.React.useRef(0),te=window.React.useRef(0),B=window.React.useRef(0),ue=window.React.useRef(0),we=window.React.useRef(0);function Be(o){const m=o.match(/repeat\((\d+),(\d+(fr|px))\)/);return m?new Array(parseInt(m[1])).fill(m[2]):[o]}function re(o){return o.trim().replace(/ {2,}/," ").replace(/, /,",").split(" ").map(m=>Be(m)).reduce((m,h)=>m.concat(h),[])}function me(o){const{size:m,gap:h,span:x,max:H,offset:z,startBefore:D,expandable:Y,template:G}=o;if(G){const J=re(G).map($=>/\d+px/.test($)?parseInt($):m);let k=0,L=0;for(;L<J.length&&L<D&&!(L>D);L++)k+=J[L]+h;if(z>0){let $=k;for(;L<J.length&&($+=J[L]+h,!(k+z<$));L++);if(Y&&k+z>$){const Ie=Math.round((k+z-$)/(m+h));L+=Ie}let pe=L;return!Y&&pe+x>H+1&&(pe=H+1-x),{start:pe,end:pe+x}}else{let $=0,pe=D-2,Ie=0;for(;pe>=0&&($+=J[pe]+h,!($>Math.abs(z)));pe--,Ie++);let Dt=D-Ie;return Dt<1&&(Dt=1),{start:Dt,end:Dt+x}}}else{const J=m+h?Math.round(z/(m+h)):0;let k=D+J;return k<1&&(k=1),Y||k+x>H&&(k=H-x+1),{start:k,end:k+x}}}function Fe(o){const{size:m,gap:h,span:x,max:H,pos:z,expandable:D,template:Y}=o;if(Y){const G=re(Y).map($=>/\d+px/.test($)?parseInt($):m);let J=0,k=0;for(;k<G.length&&(J+=G[k]+h,!(z<J));k++);if(D&&z-J>0){const $=Math.floor((z-J)/(m+h));k+=$}let L=k+1;return!D&&L+x>H+1&&(L=H+1-x),{start:L,end:L+x}}else{let G=m+h?Math.ceil((z+h/2)/(m+h)):0;return G<1&&(G=1),D||G+x>H&&(G=H-x+1),{start:G,end:G+x}}}function Te(o){const{size:m,gap:h,max:x,offset:H,startBefore:z,endBefore:D,target:Y,expandable:G,template:J}=o;if(J){const k=re(J).map(L=>/\d+px/.test(L)?parseInt(L):m);if(Y==="start")if(H>0){let L=0,$=0;for(;$<k.length&&$<z-1&&!($>z-1);$++)L+=k[$]+h;let pe=L;for(;$<k.length&&(pe+=k[$]+h,!(L+H<pe));$++);let Ie=$+1;return Ie+1>D&&(Ie=D-1),{start:Ie,end:D}}else{let L=0,$=z-2,pe=0;for(;$>=0&&(L+=k[$]+h,!(L>Math.abs(H)));$--,pe++);let Ie=z-pe;return Ie+1>D&&(Ie=D-1),{start:Ie,end:D}}else if(H>0){let L=0,$=0;for(;$<k.length&&$<D-1&&!($>D-1);$++)L+=k[$]+h;let pe=L;for(;$<k.length&&(pe+=k[$]+h,!(L+H<pe));$++);if(G&&L+H>pe){const Dt=Math.round((L+H-pe)/(m+h));$+=Dt}const Ie=$+1;return{start:z,end:Ie}}else{let L=0,$=D-2,pe=0;for(;$>=0&&(L+=k[$]+h,!(L>Math.abs(H)));$--,pe++);let Ie=D-pe;return Ie<z&&(Ie=z),{start:z,end:Ie}}}else{const k=m+h?Math.round(H/(m+h)):0;if(Y==="start"){let L=z+k;return L<1&&(L=1),L>=D&&(L=D-1),{start:L,end:D}}else{let L=D+k;return G||L>x&&(L=x+1),L<=z&&(L=z+1),{start:z,end:L}}}}const be=window.React.useCallback(()=>{u.state.resizing=!1,u.setState({...u.state}),Le(!1),Ve.current=void 0,gt.current=void 0,Ue.current="",Pe(Ue.current),_t.current="",document.body.style.cursor=""},[u,Le]),ze=window.React.useCallback(()=>{u.state.dragging=!1,u.setState({...u.state}),Le(!1),xe.current=void 0,Xt(xe.current),Nt.current=void 0,r.current=void 0,a.current=void 0},[u,Le]);function bt(o){const m=o.getBoundingClientRect();return m.top>=0&&m.left>=0&&m.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&m.right<=(window.innerWidth||document.documentElement.clientWidth)}const zt=window.React.useCallback(o=>{o&&(bt(o)||o.scrollIntoView())},[]),c=(o,m)=>{const{event:h,rect:x}=o;h&&h.currentTarget instanceof HTMLElement&&He(m,x,h.currentTarget)},O=window.React.useCallback((...o)=>{const m=o[0],{event:h,rect:x,cursor:H,direction:z}=m;h&&h.currentTarget instanceof HTMLElement&&h.currentTarget.parentElement instanceof HTMLElement&&(Gt.current=h.currentTarget.parentElement),jt.current=h.clientX,Ft.current=h.clientY,Mt.current=h.clientX,Yt.current=h.clientY,ze(),u.state.resizing=!0,u.setState({...u.state}),Le(!0),gt.current=x,Ue.current=H,Pe(Ue.current),_t.current=z,document.body.style.cursor=H,Ve.current={...ae.current}},[u,ze,Le]);function He(o,m,h){xe.current=o,Xt(xe.current),Nt.current={...o},r.current=m,a.current=h}const Je=window.React.useRef(e.rowTemplate),lt=window.React.useRef(e.columnTemplate),U=window.React.useCallback(o=>{jt.current=o.clientX,Ft.current=o.clientY,I.current||xe.current&&r.current&&(be(),u.state.dragging=!0,u.setState({...u.state}),Le(!0),v.current=o.clientX,C.current=o.clientY,Je.current=e.rowTemplate?Pt(e.rowTemplate,ve.current,ge()):"",lt.current=e.columnTemplate?Pt(e.columnTemplate,ye.current,Qe()):"")},[u,be,Le]),T=window.React.useCallback(o=>{var m,h,x,H,z,D,Y,G,J,k,L,$,pe,Ie,Dt;if(u.state.dragging&&xe.current){B.current=o.clientX-v.current,te.current=o.clientY-C.current;let Ze=(xe.current.rowEnd??xe.current.rowStart??1)-(xe.current.rowStart??1),qe=(xe.current.columnEnd??xe.current.columnStart??1)-(xe.current.columnStart??1);Ze<=0&&(Ze=1),qe<=0&&(qe=1);const{start:Nn,end:Ln}=me({size:ge(),gap:w.current,span:Ze,max:ve.current??1,offset:te.current,startBefore:((m=Nt.current)==null?void 0:m.rowStart)??1,direction:ue.current,expandable:Ne??!1,template:Je.current});Ne&&(ve.current=ke("rows",le.current),Ct(ve.current));const{start:Dn,end:On}=me({size:Qe(),gap:w.current,span:qe,max:ye.current??1,offset:B.current,startBefore:((h=Nt.current)==null?void 0:h.columnStart)??1,direction:we.current,expandable:Ce??!1,template:lt.current});Ce&&(ye.current=ke("columns",K.current),ht(ye.current)),xe.current.columnStart=Dn,xe.current.columnEnd=On,xe.current.rowStart=Nn,xe.current.rowEnd=Ln,(x=e.updateCells)==null||x.call(e,e.cells?[...e.cells]:[]),zt(a.current)}if(u.state.resizing&&ae.current){if(ut.current=o.clientX-Mt.current,Wt.current=o.clientY-Yt.current,ae.current){if(_t.current.startsWith("top")){const{start:Ze,end:qe}=Te({size:ge(),gap:w.current,max:ve.current??1,offset:Wt.current,startBefore:((H=Ve.current)==null?void 0:H.rowStart)??1,endBefore:((z=Ve.current)==null?void 0:z.rowEnd)??1,target:"start",expandable:Ne??!1,template:Je.current});ae.current.rows=qe-Ze,ae.current.rowStart=Ze,ae.current.rowEnd=qe,St(ae.current),(D=e.updateCells)==null||D.call(e,e.cells?[...e.cells]:[])}else if(_t.current.startsWith("bottom")){const{start:Ze,end:qe}=Te({size:ge(),gap:w.current,max:ve.current??1,offset:Wt.current,startBefore:((Y=Ve.current)==null?void 0:Y.rowStart)??1,endBefore:((G=Ve.current)==null?void 0:G.rowEnd)??1,target:"end",expandable:Ne??!1,template:Je.current});ae.current.rows=qe-Ze,ae.current.rowStart=Ze,ae.current.rowEnd=qe,St(ae.current),(J=e.updateCells)==null||J.call(e,e.cells?[...e.cells]:[]),Ne&&(ve.current=ke("rows",le.current),Ct(ve.current))}if(_t.current.endsWith("left")){const{start:Ze,end:qe}=Te({size:Qe(),gap:w.current,max:ye.current??1,offset:ut.current,startBefore:((k=Ve.current)==null?void 0:k.columnStart)??1,endBefore:((L=Ve.current)==null?void 0:L.columnEnd)??1,target:"start",expandable:Ce??!1,template:lt.current});ae.current.columns=qe-Ze,ae.current.columnStart=Ze,ae.current.columnEnd=qe,St(ae.current),($=e.updateCells)==null||$.call(e,e.cells?[...e.cells]:[])}else if(_t.current.endsWith("right")){const{start:Ze,end:qe}=Te({size:Qe(),gap:w.current,max:ye.current??1,offset:ut.current,startBefore:((pe=Ve.current)==null?void 0:pe.columnStart)??1,endBefore:((Ie=Ve.current)==null?void 0:Ie.columnEnd)??1,target:"end",expandable:Ce??!1,template:lt.current});ae.current.columns=qe-Ze,ae.current.columnStart=Ze,ae.current.columnEnd=qe,St(ae.current),(Dt=e.updateCells)==null||Dt.call(e,e.cells?[...e.cells]:[]),Ce&&(ye.current=ke("columns",K.current),ht(ye.current))}}zt(Gt.current)}},[ke,Ce,u.state.dragging,u.state.resizing,e,Ne,zt,Qe,ge]),_e=window.React.useCallback(o=>{vt.current=o.clientX-jt.current,at.current=o.clientY-Ft.current,be(),ze()},[ze,be]),de=window.React.useCallback(()=>{var o,m;Math.abs(vt.current)<5&&Math.abs(at.current)<5&&(u.state.selectedChild=void 0,u.setState({...u.state}),(o=e.updateSelectedChild)==null||o.call(e,void 0),(m=e.select)==null||m.call(e,void 0),ae.current=void 0,St(ae.current)),be(),ze()},[u,ze,e,be]),je=window.React.useCallback(o=>{var m,h;Math.abs(vt.current)<5&&Math.abs(at.current)<5&&(u.state.selectedChild=o,u.setState({...u.state}),(m=e.updateSelectedChild)==null||m.call(e,o),(h=e.select)==null||h.call(e,o))},[u,e]),oe=o=>{Math.abs(vt.current)<5&&Math.abs(at.current)<5&&(ae.current=o,St(ae.current),xe.current=void 0,Xt(xe.current),Nt.current=void 0,r.current=void 0,a.current=void 0)};window.React.useEffect(()=>(window.addEventListener("mousedown",U),()=>{window.removeEventListener("mousedown",U)}),[U]),window.React.useEffect(()=>(window.addEventListener("mousemove",T),()=>{window.removeEventListener("mousemove",T)}),[T]),window.React.useEffect(()=>(window.addEventListener("mouseup",_e),()=>{window.removeEventListener("mouseup",_e)}),[_e]),window.React.useEffect(()=>(window.addEventListener("click",de),()=>{window.removeEventListener("click",de)}),[de]);const Ee=window.React.useCallback(o=>{var m,h,x;if(Oe.current&&(o.stopPropagation(),o.preventDefault(),u.state.droppingEle!==De.current&&(u.state.droppingEle=De.current??void 0,u.setState({...u.state})),F.current)){const H=((m=F.current)==null?void 0:m.rows)??1,z=((h=F.current)==null?void 0:h.columns)??1,D=((x=De==null?void 0:De.current)==null?void 0:x.getBoundingClientRect())??{height:0,width:0,x:0,y:0};let Y=o.clientY-D.y;Y<0?Y=0:!Ne&&Y>D.height&&(Y=D.height);let G=o.clientX-D.x;G<0?G=0:!Ce&&G>D.width&&(G=D.width);const{start:J,end:k}=Fe({size:ge(),gap:w.current,span:H,max:ve.current??1,pos:Y,expandable:Ne??!1,template:Qt.current});F.current&&(F.current.rowStart=J,F.current.rowEnd=k,V({...F.current})),Ne&&(ve.current=ke("rows",le.current,F.current?[F.current]:[]),Ct(ve.current));const{start:L,end:$}=Fe({size:Qe(),gap:w.current,span:z,max:ye.current??1,pos:G,expandable:Ce??!1,template:cr.current});F.current&&(F.current.columnStart=L,F.current.columnEnd=$,V({...F.current})),Ce&&(ye.current=ke("columns",K.current,F.current?[F.current]:[]),ht(ye.current))}},[u,ke,Ce,Ne,Qe,ge]),xt=window.React.useCallback(o=>{var m,h,x,H,z,D;if(Oe.current){if(o.stopPropagation(),o.preventDefault(),F.current&&!Ge){(h=(m=u.state).droppingChildRemove)==null||h.call(m);let Y={...F.current};if($e.current instanceof Function){const G=$e.current(Y);G instanceof Promise?G.then(J=>{var k,L;Y=J??Y,(k=e.cells)==null||k.push(Y),(L=e.updateCells)==null||L.call(e,e.cells?[...e.cells]:[])}).catch(J=>{console.error(J)}):(Y=G??Y,(x=e.cells)==null||x.push(Y),(H=e.updateCells)==null||H.call(e,e.cells?[...e.cells]:[]))}else(z=e.cells)==null||z.push(Y),(D=e.updateCells)==null||D.call(e,e.cells?[...e.cells]:[])}wt()}},[u.state,wt,Ge,e]);window.React.useEffect(()=>(M||window.addEventListener("dragover",Ee),()=>{M||window.removeEventListener("dragover",Ee)}),[M,Ee]);const ct=window.React.useMemo(()=>he&&u.state&&u.state.actionEle?!u.state.actionEle.contains(he)||u.state.actionEle===he:!0,[u.state,he]),Et=window.React.useRef(!1),lr=window.React.useCallback(o=>{Et.current=o.target===De.current,M&&ct&&!Et.current&&(o.stopPropagation(),U(o))},[M,U,ct]),tr=window.React.useCallback(o=>{M&&ct&&!Et.current&&(o.stopPropagation(),T(o))},[T,ct,M]),Lt=window.React.useCallback(o=>{M&&ct&&!Et.current&&(o.stopPropagation(),_e(o)),Et.current=!1},[_e,ct,M]),wr=window.React.useCallback(o=>{M&&o.target!==De.current&&(o.stopPropagation(),de())},[M,de]),rr=window.React.useCallback(o=>{var m;if(e.cells){const h=e.cells.findIndex(x=>x===o);h>-1&&(e.cells.splice(h,1),(m=e.updateCells)==null||m.call(e,e.cells?[...e.cells]:[]))}},[e]),Ut=window.React.useCallback(o=>{const m={};for(const h in o)Array.isArray(o[h])?m[h]=o[h].map(x=>Ut(x)):o[h]instanceof Function?m[h]=o[h]:o[h]instanceof Object?m[h]=Ut(o[h]):m[h]=o[h];return m},[]),Kt=window.React.useCallback((o,m)=>{var h;u.state.droppingChild=Ut(o),u.state.droppingChildEle=m.ele??void 0,u.state.droppingChildRaw=o,u.state.droppingChildRemove=m.remove,u.setState({...u.state}),(h=e.updateDroppingChild)==null||h.call(e,u.state.droppingChild)},[u,Ut,e]),Qt=window.React.useRef(e.rowTemplate),cr=window.React.useRef(e.columnTemplate),nr=window.React.useCallback((o,m)=>{Kt(m,o),Qt.current=e.rowTemplate?Pt(e.rowTemplate,ve.current,ge()):"",cr.current=e.columnTemplate?Pt(e.columnTemplate,ye.current,Qe()):""},[Kt,e.rowTemplate,e.columnTemplate,ge,Qe]),ir=window.React.useCallback(o=>{M&&Oe.current&&(o.stopPropagation(),Ee(o))},[Ee,M]),Mn=window.React.useCallback(()=>{de(),wt()},[de,wt]);return e.children?window.React.createElement(Xe,{className:`grid-drag-resize ${[...A?[A]:[],...M?["grid-drag-resize--sub"]:[],...e.className?[e.className]:[]].join(" ")}`,ref:De,style:{...e.style}},e.children):window.React.createElement(Xe,{className:`grid-drag-resize ${[...A?[A]:[],...M?["grid-drag-resize--sub"]:[],...Re&&$t?["grid-drag-resize--dropping"]:[],...e.className?[e.className]:[]].join(" ")}`,ref:De,style:{...e.style,...ot},onDragOver:ir,onDrop:xt,onMouseDown:lr,onMouseMove:tr,onMouseUp:Lt,onClick:wr},Se.jsxs(Se.Fragment,{children:[(S=e.cells)==null?void 0:S.map((o,m)=>{var h,x;const H=Pn(o);return Se.jsx(tn,{...o,columnStart:o.columnStart,columnEnd:o.columnEnd,rowStart:o.rowStart,rowEnd:o.rowEnd,rows:o.rows,columns:o.columns,updateColumnStart:z=>{o.columnStart=z},updateColumnEnd:z=>{o.columnEnd=z},updateRowStart:z=>{o.rowStart=z},updateRowEnd:z=>{o.rowEnd=z},updateRows:z=>{o.rows=z},updateColumns:z=>{o.columns=z},startDrag:z=>{c(z,o)},select:()=>{je(o)},selectResizing:()=>{oe(o)},startResize:z=>{O(z)},remove:()=>{rr(o)},dropStart:z=>{nr(z,o)},dropEnd:()=>{Mn()},className:[...yt===o?["grid-drag-resize__item--dragging"]:[],...u.state.selectedChild===o?["grid-drag-resize__item--selected"]:[],...u.state.selectedChild===o&&Ke===o?["grid-drag-resize__item--resizing"]:[]].join(" "),style:{zIndex:yt===o?(((h=e.cells)==null?void 0:h.length)??0)+2:u.state.selectedChild===o?(((x=e.cells)==null?void 0:x.length)??0)+1:m+1,cursor:qt},parentProps:Tt},H)}),Re&&$t&&Se.jsx(tn,{draggable:!1,resizable:!1,...ur,className:"grid-drag-resize__item--shadow",style:{zIndex:(((P=e.cells)==null?void 0:P.length)??0)+3}},0)]}))}function Er(e){const[t,n]=window.React.useState({dragging:!1,resizing:!1,droppingChild:e.droppingChild,droppingChildRaw:e.droppingChild,selectedChild:e.selectedChild}),s=window.React.useContext(hr)??{state:t,setState:n};return Se.jsx(hr.Provider,{value:s,children:Se.jsx(jn,{...e,parentProps:{...e.parentProps,...e}})})}Ot.Allotment=En,Ot.GridDragResize=Er,Ot.default=Er,Object.defineProperties(Ot,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
5
+ */var ot,Et,Vt,di=(It||(It=1,ot=xt,(function(){var u={}.hasOwnProperty;function e(){for(var i=[],r=0;r<arguments.length;r++){var l=arguments[r];if(l){var m=typeof l;if(m==="string"||m==="number")i.push(l);else if(Array.isArray(l)){if(l.length){var g=e.apply(null,l);g&&i.push(g)}}else if(m==="object")if(l.toString===Object.prototype.toString)for(var d in l)u.call(l,d)&&l[d]&&i.push(d);else i.push(l.toString())}}return i.join(" ")}ot.exports?(e.default=e,ot.exports=e):window.classNames=e})()),xt.exports),at=Pe(di),jt,re=Pe((function(){if(Vt)return Et;Vt=1;var u=/^\s+|\s+$/g,e=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,r=/^0o[0-7]+$/i,l=parseInt,m=Object.prototype.toString;function g(n){var o=typeof n;return!!n&&(o=="object"||o=="function")}function d(n){if(typeof n=="number")return n;if((function(a){return typeof a=="symbol"||(function(y){return!!y&&typeof y=="object"})(a)&&m.call(a)=="[object Symbol]"})(n))return NaN;if(g(n)){var o=typeof n.valueOf=="function"?n.valueOf():n;n=g(o)?o+"":o}if(typeof n!="string")return n===0?n:+n;n=n.replace(u,"");var c=i.test(n);return c||r.test(n)?l(n.slice(2),c?2:8):e.test(n)?NaN:+n}return Et=function(n,o,c){return c===void 0&&(c=o,o=void 0),c!==void 0&&(c=(c=d(c))==c?c:0),o!==void 0&&(o=(o=d(o))==o?o:0),(function(a,y,w){return a==a&&(w!==void 0&&(a=a<=w?a:w),y!==void 0&&(a=a>=y?a:y)),a})(d(n),o,c)}})()),ut={exports:{}},mi=(jt||(jt=1,(function(u,e){var i="__lodash_hash_undefined__",r=9007199254740991,l="[object Arguments]",m="[object Array]",g="[object Boolean]",d="[object Date]",n="[object Error]",o="[object Function]",c="[object Map]",a="[object Number]",y="[object Object]",w="[object Promise]",v="[object RegExp]",z="[object Set]",S="[object String]",p="[object Symbol]",_="[object WeakMap]",I="[object ArrayBuffer]",E="[object DataView]",C=/^\[object .+?Constructor\]$/,X=/^(?:0|[1-9]\d*)$/,h={};h["[object Float32Array]"]=h["[object Float64Array]"]=h["[object Int8Array]"]=h["[object Int16Array]"]=h["[object Int32Array]"]=h["[object Uint8Array]"]=h["[object Uint8ClampedArray]"]=h["[object Uint16Array]"]=h["[object Uint32Array]"]=!0,h[l]=h[m]=h[I]=h[g]=h[E]=h[d]=h[n]=h[o]=h[c]=h[a]=h[y]=h[v]=h[z]=h[S]=h[_]=!1;var L=typeof ve=="object"&&ve&&ve.Object===Object&&ve,K=typeof self=="object"&&self&&self.Object===Object&&self,F=L||K||Function("return this")(),oe=e&&!e.nodeType&&e,O=oe&&u&&!u.nodeType&&u,D=O&&O.exports===oe,k=D&&L.process,R=(function(){try{return k&&k.binding&&k.binding("util")}catch{}})(),N=R&&R.isTypedArray;function A(t,s){for(var f=-1,b=t==null?0:t.length;++f<b;)if(s(t[f],f,t))return!0;return!1}function W(t){var s=-1,f=Array(t.size);return t.forEach(function(b,T){f[++s]=[T,b]}),f}function ze(t){var s=-1,f=Array(t.size);return t.forEach(function(b){f[++s]=b}),f}var pe,J,we,Q=Array.prototype,le=Function.prototype,ce=Object.prototype,Le=F["__core-js_shared__"],Oe=le.toString,x=ce.hasOwnProperty,V=(pe=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||""))?"Symbol(src)_1."+pe:"",$=ce.toString,B=RegExp("^"+Oe.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kt=D?F.Buffer:void 0,Ge=F.Symbol,Zt=F.Uint8Array,Qt=ce.propertyIsEnumerable,Ci=Q.splice,Se=Ge?Ge.toStringTag:void 0,qt=Object.getOwnPropertySymbols,Ti=Kt?Kt.isBuffer:void 0,Fi=(J=Object.keys,we=Object,function(t){return J(we(t))}),vt=Re(F,"DataView"),Ce=Re(F,"Map"),pt=Re(F,"Promise"),wt=Re(F,"Set"),yt=Re(F,"WeakMap"),Te=Re(Object,"create"),ki=Ee(vt),$i=Ee(Ce),Hi=Ee(pt),Bi=Ee(wt),Yi=Ee(yt),ei=Ge?Ge.prototype:void 0,gt=ei?ei.valueOf:void 0;function Ie(t){var s=-1,f=t==null?0:t.length;for(this.clear();++s<f;){var b=t[s];this.set(b[0],b[1])}}function he(t){var s=-1,f=t==null?0:t.length;for(this.clear();++s<f;){var b=t[s];this.set(b[0],b[1])}}function xe(t){var s=-1,f=t==null?0:t.length;for(this.clear();++s<f;){var b=t[s];this.set(b[0],b[1])}}function Ue(t){var s=-1,f=t==null?0:t.length;for(this.__data__=new xe;++s<f;)this.add(t[s])}function ye(t){var s=this.__data__=new he(t);this.size=s.size}function Wi(t,s){var f=Ke(t),b=!f&&Ki(t),T=!f&&!b&&bt(t),j=!f&&!b&&!T&&li(t),H=f||b||T||j,Y=H?(function(U,ae){for(var fe=-1,Z=Array(U);++fe<U;)Z[fe]=ae(fe);return Z})(t.length,String):[],se=Y.length;for(var G in t)!x.call(t,G)||H&&(G=="length"||T&&(G=="offset"||G=="parent")||j&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||Ji(G,se))||Y.push(G);return Y}function Xe(t,s){for(var f=t.length;f--;)if(si(t[f][0],s))return f;return-1}function Fe(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Se&&Se in Object(t)?(function(s){var f=x.call(s,Se),b=s[Se];try{s[Se]=void 0;var T=!0}catch{}var j=$.call(s);return T&&(f?s[Se]=b:delete s[Se]),j})(t):(function(s){return $.call(s)})(t)}function ti(t){return ke(t)&&Fe(t)==l}function ii(t,s,f,b,T){return t===s||(t==null||s==null||!ke(t)&&!ke(s)?t!=t&&s!=s:(function(j,H,Y,se,G,U){var ae=Ke(j),fe=Ke(H),Z=ae?m:ge(j),de=fe?m:ge(H),Ne=(Z=Z==l?y:Z)==y,Ze=(de=de==l?y:de)==y,Me=Z==de;if(Me&&bt(j)){if(!bt(H))return!1;ae=!0,Ne=!1}if(Me&&!Ne)return U||(U=new ye),ae||li(j)?ni(j,H,Y,se,G,U):(function(P,M,Qe,be,_t,ne,me){switch(Qe){case E:if(P.byteLength!=M.byteLength||P.byteOffset!=M.byteOffset)return!1;P=P.buffer,M=M.buffer;case I:return!(P.byteLength!=M.byteLength||!ne(new Zt(P),new Zt(M)));case g:case d:case a:return si(+P,+M);case n:return P.name==M.name&&P.message==M.message;case v:case S:return P==M+"";case c:var _e=W;case z:var He=1&be;if(_e||(_e=ze),P.size!=M.size&&!He)return!1;var qe=me.get(P);if(qe)return qe==M;be|=2,me.set(P,M);var zt=ni(_e(P),_e(M),be,_t,ne,me);return me.delete(P),zt;case p:if(gt)return gt.call(P)==gt.call(M)}return!1})(j,H,Z,Y,se,G,U);if(!(1&Y)){var $e=Ne&&x.call(j,"__wrapped__"),ci=Ze&&x.call(H,"__wrapped__");if($e||ci){var Qi=$e?j.value():j,qi=ci?H.value():H;return U||(U=new ye),G(Qi,qi,Y,se,U)}}return!!Me&&(U||(U=new ye),(function(P,M,Qe,be,_t,ne){var me=1&Qe,_e=ri(P),He=_e.length,qe=ri(M),zt=qe.length;if(He!=zt&&!me)return!1;for(var et=He;et--;){var Ve=_e[et];if(!(me?Ve in M:x.call(M,Ve)))return!1}var hi=ne.get(P);if(hi&&ne.get(M))return hi==M;var tt=!0;ne.set(P,M),ne.set(M,P);for(var St=me;++et<He;){var it=P[Ve=_e[et]],nt=M[Ve];if(be)var fi=me?be(nt,it,Ve,M,P,ne):be(it,nt,Ve,P,M,ne);if(!(fi===void 0?it===nt||_t(it,nt,Qe,be,ne):fi)){tt=!1;break}St||(St=Ve=="constructor")}if(tt&&!St){var rt=P.constructor,st=M.constructor;rt==st||!("constructor"in P)||!("constructor"in M)||typeof rt=="function"&&rt instanceof rt&&typeof st=="function"&&st instanceof st||(tt=!1)}return ne.delete(P),ne.delete(M),tt})(j,H,Y,se,G,U))})(t,s,f,b,ii,T))}function Gi(t){return!(!ui(t)||(function(s){return!!V&&V in s})(t))&&(oi(t)?B:C).test(Ee(t))}function Ui(t){if(f=(s=t)&&s.constructor,b=typeof f=="function"&&f.prototype||ce,s!==b)return Fi(t);var s,f,b,T=[];for(var j in Object(t))x.call(t,j)&&j!="constructor"&&T.push(j);return T}function ni(t,s,f,b,T,j){var H=1&f,Y=t.length,se=s.length;if(Y!=se&&!(H&&se>Y))return!1;var G=j.get(t);if(G&&j.get(s))return G==s;var U=-1,ae=!0,fe=2&f?new Ue:void 0;for(j.set(t,s),j.set(s,t);++U<Y;){var Z=t[U],de=s[U];if(b)var Ne=H?b(de,Z,U,s,t,j):b(Z,de,U,t,s,j);if(Ne!==void 0){if(Ne)continue;ae=!1;break}if(fe){if(!A(s,function(Ze,Me){if($e=Me,!fe.has($e)&&(Z===Ze||T(Z,Ze,f,b,j)))return fe.push(Me);var $e})){ae=!1;break}}else if(Z!==de&&!T(Z,de,f,b,j)){ae=!1;break}}return j.delete(t),j.delete(s),ae}function ri(t){return(function(s,f,b){var T=f(s);return Ke(s)?T:(function(j,H){for(var Y=-1,se=H.length,G=j.length;++Y<se;)j[G+Y]=H[Y];return j})(T,b(s))})(t,Zi,Xi)}function Je(t,s){var f,b,T=t.__data__;return((b=typeof(f=s))=="string"||b=="number"||b=="symbol"||b=="boolean"?f!=="__proto__":f===null)?T[typeof s=="string"?"string":"hash"]:T.map}function Re(t,s){var f=(function(b,T){return b==null?void 0:b[T]})(t,s);return Gi(f)?f:void 0}Ie.prototype.clear=function(){this.__data__=Te?Te(null):{},this.size=0},Ie.prototype.delete=function(t){var s=this.has(t)&&delete this.__data__[t];return this.size-=s?1:0,s},Ie.prototype.get=function(t){var s=this.__data__;if(Te){var f=s[t];return f===i?void 0:f}return x.call(s,t)?s[t]:void 0},Ie.prototype.has=function(t){var s=this.__data__;return Te?s[t]!==void 0:x.call(s,t)},Ie.prototype.set=function(t,s){var f=this.__data__;return this.size+=this.has(t)?0:1,f[t]=Te&&s===void 0?i:s,this},he.prototype.clear=function(){this.__data__=[],this.size=0},he.prototype.delete=function(t){var s=this.__data__,f=Xe(s,t);return!(f<0||(f==s.length-1?s.pop():Ci.call(s,f,1),--this.size,0))},he.prototype.get=function(t){var s=this.__data__,f=Xe(s,t);return f<0?void 0:s[f][1]},he.prototype.has=function(t){return Xe(this.__data__,t)>-1},he.prototype.set=function(t,s){var f=this.__data__,b=Xe(f,t);return b<0?(++this.size,f.push([t,s])):f[b][1]=s,this},xe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ie,map:new(Ce||he),string:new Ie}},xe.prototype.delete=function(t){var s=Je(this,t).delete(t);return this.size-=s?1:0,s},xe.prototype.get=function(t){return Je(this,t).get(t)},xe.prototype.has=function(t){return Je(this,t).has(t)},xe.prototype.set=function(t,s){var f=Je(this,t),b=f.size;return f.set(t,s),this.size+=f.size==b?0:1,this},Ue.prototype.add=Ue.prototype.push=function(t){return this.__data__.set(t,i),this},Ue.prototype.has=function(t){return this.__data__.has(t)},ye.prototype.clear=function(){this.__data__=new he,this.size=0},ye.prototype.delete=function(t){var s=this.__data__,f=s.delete(t);return this.size=s.size,f},ye.prototype.get=function(t){return this.__data__.get(t)},ye.prototype.has=function(t){return this.__data__.has(t)},ye.prototype.set=function(t,s){var f=this.__data__;if(f instanceof he){var b=f.__data__;if(!Ce||b.length<199)return b.push([t,s]),this.size=++f.size,this;f=this.__data__=new xe(b)}return f.set(t,s),this.size=f.size,this};var Xi=qt?function(t){return t==null?[]:(t=Object(t),(function(s,f){for(var b=-1,T=s==null?0:s.length,j=0,H=[];++b<T;){var Y=s[b];f(Y,b,s)&&(H[j++]=Y)}return H})(qt(t),function(s){return Qt.call(t,s)}))}:function(){return[]},ge=Fe;function Ji(t,s){return!!(s=s??r)&&(typeof t=="number"||X.test(t))&&t>-1&&t%1==0&&t<s}function Ee(t){if(t!=null){try{return Oe.call(t)}catch{}try{return t+""}catch{}}return""}function si(t,s){return t===s||t!=t&&s!=s}(vt&&ge(new vt(new ArrayBuffer(1)))!=E||Ce&&ge(new Ce)!=c||pt&&ge(pt.resolve())!=w||wt&&ge(new wt)!=z||yt&&ge(new yt)!=_)&&(ge=function(t){var s=Fe(t),f=s==y?t.constructor:void 0,b=f?Ee(f):"";if(b)switch(b){case ki:return E;case $i:return c;case Hi:return w;case Bi:return z;case Yi:return _}return s});var Ki=ti((function(){return arguments})())?ti:function(t){return ke(t)&&x.call(t,"callee")&&!Qt.call(t,"callee")},Ke=Array.isArray,bt=Ti||function(){return!1};function oi(t){if(!ui(t))return!1;var s=Fe(t);return s==o||s=="[object GeneratorFunction]"||s=="[object AsyncFunction]"||s=="[object Proxy]"}function ai(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}function ui(t){var s=typeof t;return t!=null&&(s=="object"||s=="function")}function ke(t){return t!=null&&typeof t=="object"}var li=N?(function(t){return function(s){return t(s)}})(N):function(t){return ke(t)&&ai(t.length)&&!!h[Fe(t)]};function Zi(t){return(s=t)!=null&&ai(s.length)&&!oi(s)?Wi(t):Ui(t);var s}u.exports=function(t,s){return ii(t,s)}})(ut,ut.exports)),ut.exports),vi=Pe(mi);function Dt(u,e,i){return u[e]?u[e][0]?u[e][0][i]:u[e][i]:e==="contentBoxSize"?u.contentRect[i==="inlineSize"?"width":"height"]:void 0}function pi(u){u===void 0&&(u={});var e=u.onResize,i=window.React.useRef(void 0);i.current=e;var r=u.round||Math.round,l=window.React.useRef(),m=window.React.useState({width:void 0,height:void 0}),g=m[0],d=m[1],n=window.React.useRef(!1);window.React.useEffect(function(){return n.current=!1,function(){n.current=!0}},[]);var o=window.React.useRef({width:void 0,height:void 0}),c=(function(a,y){var w=window.React.useRef(null),v=window.React.useRef(null);v.current=y;var z=window.React.useRef(null);window.React.useEffect(function(){S()});var S=window.React.useCallback(function(){var p=z.current,_=v.current,I=p||(_?_ instanceof Element?_:_.current:null);w.current&&w.current.element===I&&w.current.subscriber===a||(w.current&&w.current.cleanup&&w.current.cleanup(),w.current={element:I,subscriber:a,cleanup:I?a(I):void 0})},[a]);return window.React.useEffect(function(){return function(){w.current&&w.current.cleanup&&(w.current.cleanup(),w.current=null)}},[]),window.React.useCallback(function(p){z.current=p,S()},[S])})(window.React.useCallback(function(a){return l.current&&l.current.box===u.box&&l.current.round===r||(l.current={box:u.box,round:r,instance:new ResizeObserver(function(y){var w=y[0],v=u.box==="border-box"?"borderBoxSize":u.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",z=Dt(w,v,"inlineSize"),S=Dt(w,v,"blockSize"),p=z?r(z):void 0,_=S?r(S):void 0;if(o.current.width!==p||o.current.height!==_){var I={width:p,height:_};o.current.width=p,o.current.height=_,i.current?i.current(I):n.current||d(I)}})}),l.current.instance.observe(a,{box:u.box}),function(){l.current&&l.current.instance.unobserve(a)}},[u.box,r]),u.ref);return window.React.useMemo(function(){return{ref:c,width:g.width,height:g.height}},[c,g.width,g.height])}var wi="allotment-module_splitView__L-yRc",yi="allotment-module_sashContainer__fzwJF",gi="allotment-module_splitViewContainer__rQnVa",Lt="allotment-module_splitViewView__MGZ6O",bi="allotment-module_vertical__WSwwa",_i="allotment-module_horizontal__7doS8",zi="allotment-module_separatorBorder__x-rDS";let Ae,Ot=!1,Rt=!1;typeof navigator=="object"&&(Ae=navigator.userAgent,Rt=Ae.indexOf("Macintosh")>=0,Ot=(Ae.indexOf("Macintosh")>=0||Ae.indexOf("iPad")>=0||Ae.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);const Nt=Ot,Si=Rt,Mt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?window.React.useLayoutEffect:window.React.useEffect;class Ii{constructor(){this._size=void 0}getSize(){return this._size}setSize(e){this._size=e}}function Be(u,e){const i=u.length,r=i-e.length;return r>=0&&u.slice(r,i)===e}var Pt,At={exports:{}},Ct,Tt,xi=(Pt||(Pt=1,(function(u){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function l(n,o,c){this.fn=n,this.context=o,this.once=c||!1}function m(n,o,c,a,y){if(typeof c!="function")throw new TypeError("The listener must be a function");var w=new l(c,a||n,y),v=i?i+o:o;return n._events[v]?n._events[v].fn?n._events[v]=[n._events[v],w]:n._events[v].push(w):(n._events[v]=w,n._eventsCount++),n}function g(n,o){--n._eventsCount==0?n._events=new r:delete n._events[o]}function d(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(i=!1)),d.prototype.eventNames=function(){var n,o,c=[];if(this._eventsCount===0)return c;for(o in n=this._events)e.call(n,o)&&c.push(i?o.slice(1):o);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(n)):c},d.prototype.listeners=function(n){var o=i?i+n:n,c=this._events[o];if(!c)return[];if(c.fn)return[c.fn];for(var a=0,y=c.length,w=new Array(y);a<y;a++)w[a]=c[a].fn;return w},d.prototype.listenerCount=function(n){var o=i?i+n:n,c=this._events[o];return c?c.fn?1:c.length:0},d.prototype.emit=function(n,o,c,a,y,w){var v=i?i+n:n;if(!this._events[v])return!1;var z,S,p=this._events[v],_=arguments.length;if(p.fn){switch(p.once&&this.removeListener(n,p.fn,void 0,!0),_){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,o),!0;case 3:return p.fn.call(p.context,o,c),!0;case 4:return p.fn.call(p.context,o,c,a),!0;case 5:return p.fn.call(p.context,o,c,a,y),!0;case 6:return p.fn.call(p.context,o,c,a,y,w),!0}for(S=1,z=new Array(_-1);S<_;S++)z[S-1]=arguments[S];p.fn.apply(p.context,z)}else{var I,E=p.length;for(S=0;S<E;S++)switch(p[S].once&&this.removeListener(n,p[S].fn,void 0,!0),_){case 1:p[S].fn.call(p[S].context);break;case 2:p[S].fn.call(p[S].context,o);break;case 3:p[S].fn.call(p[S].context,o,c);break;case 4:p[S].fn.call(p[S].context,o,c,a);break;default:if(!z)for(I=1,z=new Array(_-1);I<_;I++)z[I-1]=arguments[I];p[S].fn.apply(p[S].context,z)}}return!0},d.prototype.on=function(n,o,c){return m(this,n,o,c,!1)},d.prototype.once=function(n,o,c){return m(this,n,o,c,!0)},d.prototype.removeListener=function(n,o,c,a){var y=i?i+n:n;if(!this._events[y])return this;if(!o)return g(this,y),this;var w=this._events[y];if(w.fn)w.fn!==o||a&&!w.once||c&&w.context!==c||g(this,y);else{for(var v=0,z=[],S=w.length;v<S;v++)(w[v].fn!==o||a&&!w[v].once||c&&w[v].context!==c)&&z.push(w[v]);z.length?this._events[y]=z.length===1?z[0]:z:g(this,y)}return this},d.prototype.removeAllListeners=function(n){var o;return n?(o=i?i+n:n,this._events[o]&&g(this,o)):(this._events=new r,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prefixed=i,d.EventEmitter=d,u.exports=d})(At)),At.exports),lt=Pe(xi);function Ft(u,e){const i=u.indexOf(e);i>-1&&(u.splice(i,1),u.unshift(e))}function ct(u,e){const i=u.indexOf(e);i>-1&&(u.splice(i,1),u.push(e))}function ee(u,e,i=1){const r=Math.max(0,Math.ceil((e-u)/i)),l=new Array(r);let m=-1;for(;++m<r;)l[m]=u+m*i;return l}var Ei=Pe((function(){if(Tt)return Ct;Tt=1;var u=/^\s+|\s+$/g,e=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,r=/^0o[0-7]+$/i,l=parseInt,m=typeof ve=="object"&&ve&&ve.Object===Object&&ve,g=typeof self=="object"&&self&&self.Object===Object&&self,d=m||g||Function("return this")(),n=Object.prototype.toString,o=Math.max,c=Math.min,a=function(){return d.Date.now()};function y(v){var z=typeof v;return!!v&&(z=="object"||z=="function")}function w(v){if(typeof v=="number")return v;if((function(p){return typeof p=="symbol"||(function(_){return!!_&&typeof _=="object"})(p)&&n.call(p)=="[object Symbol]"})(v))return NaN;if(y(v)){var z=typeof v.valueOf=="function"?v.valueOf():v;v=y(z)?z+"":z}if(typeof v!="string")return v===0?v:+v;v=v.replace(u,"");var S=i.test(v);return S||r.test(v)?l(v.slice(2),S?2:8):e.test(v)?NaN:+v}return Ct=function(v,z,S){var p,_,I,E,C,X,h=0,L=!1,K=!1,F=!0;if(typeof v!="function")throw new TypeError("Expected a function");function oe(N){var A=p,W=_;return p=_=void 0,h=N,E=v.apply(W,A)}function O(N){var A=N-X;return X===void 0||A>=z||A<0||K&&N-h>=I}function D(){var N=a();if(O(N))return k(N);C=setTimeout(D,(function(A){var W=z-(A-X);return K?c(W,I-(A-h)):W})(N))}function k(N){return C=void 0,F&&p?oe(N):(p=_=void 0,E)}function R(){var N=a(),A=O(N);if(p=arguments,_=this,X=N,A){if(C===void 0)return(function(W){return h=W,C=setTimeout(D,z),L?oe(W):E})(X);if(K)return C=setTimeout(D,z),oe(X)}return C===void 0&&(C=setTimeout(D,z)),E}return z=w(z)||0,y(S)&&(L=!!S.leading,I=(K="maxWait"in S)?o(w(S.maxWait)||0,z):I,F="trailing"in S?!!S.trailing:F),R.cancel=function(){C!==void 0&&clearTimeout(C),h=0,p=X=_=C=void 0},R.flush=function(){return C===void 0?E:k(a())},R}})()),Vi="sash-module_sash__K-9lB",ji="sash-module_disabled__Hm-wx",Di="sash-module_mac__Jf6OJ",kt="sash-module_vertical__pB-rs",Li="sash-module_minimum__-UKxp",Oi="sash-module_maximum__TCWxD",$t="sash-module_horizontal__kFbiw",ht="sash-module_hover__80W6I",ft="sash-module_active__bJspD";let te=(function(u){return u.Vertical="VERTICAL",u.Horizontal="HORIZONTAL",u})({}),q=(function(u){return u.Disabled="DISABLED",u.Minimum="MINIMUM",u.Maximum="MAXIMUM",u.Enabled="ENABLED",u})({}),Ht=Nt?20:8;const Bt=new lt;class Yt extends lt{get state(){return this._state}set state(e){this._state!==e&&(this.el.classList.toggle(ji,e===q.Disabled),this.el.classList.toggle("sash-disabled",e===q.Disabled),this.el.classList.toggle(Li,e===q.Minimum),this.el.classList.toggle("sash-minimum",e===q.Minimum),this.el.classList.toggle(Oi,e===q.Maximum),this.el.classList.toggle("sash-maximum",e===q.Maximum),this._state=e,this.emit("enablementChange",e))}constructor(e,i,r){var l;super(),this.el=void 0,this.layoutProvider=void 0,this.orientation=void 0,this.size=void 0,this.hoverDelay=300,this.hoverDelayer=Ei(m=>m.classList.add("sash-hover",ht),this.hoverDelay),this._state=q.Enabled,this.onPointerStart=m=>{const g=m.pageX,d=m.pageY,n={startX:g,currentX:g,startY:d,currentY:d};this.el.classList.add("sash-active",ft),this.emit("start",n),this.el.setPointerCapture(m.pointerId);const o=a=>{a.preventDefault();const y={startX:g,currentX:a.pageX,startY:d,currentY:a.pageY};this.emit("change",y)},c=a=>{a.preventDefault(),this.el.classList.remove("sash-active",ft),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(a.pointerId),window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",c)};window.addEventListener("pointermove",o),window.addEventListener("pointerup",c)},this.onPointerDoublePress=()=>{this.emit("reset")},this.onMouseEnter=()=>{this.el.classList.contains(ft)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",ht)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",ht)},this.el=document.createElement("div"),this.el.classList.add("sash",Vi),this.el.dataset.testid="sash",e.append(this.el),Si&&this.el.classList.add("sash-mac",Di),this.el.addEventListener("pointerdown",this.onPointerStart),this.el.addEventListener("dblclick",this.onPointerDoublePress),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave),typeof r.size=="number"?(this.size=r.size,r.orientation===te.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=Ht,Bt.on("onDidChangeGlobalSize",m=>{this.size=m,this.layout()})),this.layoutProvider=i,this.orientation=(l=r.orientation)!=null?l:te.Vertical,this.orientation===te.Horizontal?(this.el.classList.add("sash-horizontal",$t),this.el.classList.remove("sash-vertical",kt)):(this.el.classList.remove("sash-horizontal",$t),this.el.classList.add("sash-vertical",kt)),this.layout()}layout(){if(this.orientation===te.Vertical){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}dispose(){this.el.removeEventListener("pointerdown",this.onPointerStart),this.el.removeEventListener("dblclick",this.onPointerDoublePress),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",()=>this.onMouseLeave),this.el.remove()}}let Ye;var dt;(dt=Ye||(Ye={})).Distribute={type:"distribute"},dt.Split=function(u){return{type:"split",index:u}},dt.Invisible=function(u){return{type:"invisible",cachedVisibleSize:u}};let ie=(function(u){return u.Normal="NORMAL",u.Low="LOW",u.High="HIGH",u})({});class Wt{constructor(e,i,r){this.container=void 0,this.view=void 0,this._size=void 0,this._cachedVisibleSize=void 0,this.container=e,this.view=i,this.container.classList.add("split-view-view",Lt),this.container.dataset.testid="split-view-view",typeof r=="number"?(this._size=r,this._cachedVisibleSize=void 0,e.classList.add("split-view-view-visible")):(this._size=0,this._cachedVisibleSize=r.cachedVisibleSize)}set size(e){this._size=e}get size(){return this._size}get priority(){return this.view.priority}get snap(){return!!this.view.snap}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return this._cachedVisibleSize===void 0}setVisible(e,i){e!==this.visible&&(e?(this.size=re(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof i=="number"?i:this.size,this.size=0),this.container.classList.toggle("split-view-view-visible",e),this.view.setVisible&&this.view.setVisible(e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}set enabled(e){this.container.style.pointerEvents=e?"":"none"}layout(e){this.layoutContainer(e),this.view.layout(this.size,e)}}class Ri extends Wt{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}class Ni extends Wt{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Mi extends lt{get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,i={},r,l,m){var g,d;if(super(),this.onDidChange=void 0,this.onDidDragStart=void 0,this.onDidDragEnd=void 0,this.orientation=void 0,this.sashContainer=void 0,this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.sashDragState=void 0,this.proportionalLayout=void 0,this.getSashOrthogonalSize=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onSashEnd=n=>{this.emit("sashchange",n),this.saveProportions();for(const o of this.viewItems)o.enabled=!0},this.orientation=(g=i.orientation)!=null?g:te.Vertical,this.proportionalLayout=(d=i.proportionalLayout)!=null?d:!0,this.getSashOrthogonalSize=i.getSashOrthogonalSize,r&&(this.onDidChange=r),l&&(this.onDidDragStart=l),m&&(this.onDidDragEnd=m),this.sashContainer=document.createElement("div"),this.sashContainer.classList.add("sash-container",yi),e.prepend(this.sashContainer),i.descriptor){this.size=i.descriptor.size;for(const[n,o]of i.descriptor.views.entries()){const c=o.size,a=o.container,y=o.view;this.addView(a,y,c,n,!0)}this.contentSize=this.viewItems.reduce((n,o)=>n+o.size,0),this.saveProportions()}}addView(e,i,r,l=this.viewItems.length,m){let g;g=typeof r=="number"?r:r.type==="split"?this.getViewSize(r.index)/2:r.type==="invisible"?{cachedVisibleSize:r.cachedVisibleSize}:i.minimumSize;const d=this.orientation===te.Vertical?new Ni(e,i,g):new Ri(e,i,g);if(this.viewItems.splice(l,0,d),this.viewItems.length>1){const n=this.orientation===te.Vertical?new Yt(this.sashContainer,{getHorizontalSashTop:a=>this.getSashPosition(a),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:te.Horizontal}):new Yt(this.sashContainer,{getVerticalSashLeft:a=>this.getSashPosition(a),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:te.Vertical}),o=this.orientation===te.Vertical?a=>({sash:n,start:a.startY,current:a.currentY}):a=>({sash:n,start:a.startX,current:a.currentX});n.on("start",a=>{var y;this.emit("sashDragStart"),this.onSashStart(o(a));const w=this.viewItems.map(v=>v.size);(y=this.onDidDragStart)==null||y.call(this,w)}),n.on("change",a=>this.onSashChange(o(a))),n.on("end",()=>{var a;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(w=>w.sash===n));const y=this.viewItems.map(w=>w.size);(a=this.onDidDragEnd)==null||a.call(this,y)}),n.on("reset",()=>{const a=this.sashItems.findIndex(S=>S.sash===n),y=ee(a,-1,-1),w=ee(a+1,this.viewItems.length),v=this.findFirstSnapIndex(y),z=this.findFirstSnapIndex(w);(typeof v!="number"||this.viewItems[v].visible)&&(typeof z!="number"||this.viewItems[z].visible)&&this.emit("sashreset",a)});const c={sash:n};this.sashItems.splice(l-1,0,c)}m||this.relayout(),m||typeof r=="number"||r.type!=="distribute"||this.distributeViewSizes()}removeView(e,i){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");const r=this.viewItems.splice(e,1)[0].view;if(this.viewItems.length>=1){const l=Math.max(e-1,0);this.sashItems.splice(l,1)[0].sash.dispose()}return this.relayout(),i&&i.type==="distribute"&&this.distributeViewSizes(),r}moveView(e,i,r){const l=this.getViewCachedVisibleSize(i),m=l===void 0?this.getViewSize(i):Ye.Invisible(l),g=this.removeView(i);this.addView(e,g,m,r)}getViewCachedVisibleSize(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].cachedVisibleSize}layout(e=this.size){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.proportions)for(let r=0;r<this.viewItems.length;r++){const l=this.viewItems[r];l.size=re(Math.round(this.proportions[r]*e),l.minimumSize,l.maximumSize)}else{const r=ee(0,this.viewItems.length),l=r.filter(g=>this.viewItems[g].priority===ie.Low),m=r.filter(g=>this.viewItems[g].priority===ie.High);this.resize(this.viewItems.length-1,e-i,void 0,l,m)}this.distributeEmptySpace(),this.layoutViews()}resizeView(e,i){if(e<0||e>=this.viewItems.length)return;const r=ee(0,this.viewItems.length).filter(d=>d!==e),l=[...r.filter(d=>this.viewItems[d].priority===ie.Low),e],m=r.filter(d=>this.viewItems[d].priority===ie.High),g=this.viewItems[e];i=Math.round(i),i=re(i,g.minimumSize,Math.min(g.maximumSize,this.size)),g.size=i,this.relayout(l,m)}resizeViews(e){for(let i=0;i<e.length;i++){const r=this.viewItems[i];let l=e[i];l=Math.round(l),l=re(l,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=l}this.contentSize=this.viewItems.reduce((i,r)=>i+r.size,0),this.saveProportions(),this.layout(this.size)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}isViewVisible(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].visible}setViewVisible(e,i){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[e].setVisible(i),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}distributeViewSizes(){const e=[];let i=0;for(const d of this.viewItems)d.maximumSize-d.minimumSize>0&&(e.push(d),i+=d.size);const r=Math.floor(i/e.length);for(const d of e)d.size=re(r,d.minimumSize,d.maximumSize);const l=ee(0,this.viewItems.length),m=l.filter(d=>this.viewItems[d].priority===ie.Low),g=l.filter(d=>this.viewItems[d].priority===ie.High);this.relayout(m,g)}dispose(){this.sashItems.forEach(e=>e.sash.dispose()),this.sashItems=[],this.sashContainer.remove()}relayout(e,i){const r=this.viewItems.reduce((l,m)=>l+m.size,0);this.resize(this.viewItems.length-1,this.size-r,void 0,e,i),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}onSashStart({sash:e,start:i}){const r=this.sashItems.findIndex(l=>l.sash===e);(l=>{const m=this.viewItems.map(_=>_.size);let g,d,n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;const c=ee(r,-1,-1),a=ee(r+1,this.viewItems.length),y=c.reduce((_,I)=>_+(this.viewItems[I].minimumSize-m[I]),0),w=c.reduce((_,I)=>_+(this.viewItems[I].viewMaximumSize-m[I]),0),v=a.length===0?Number.POSITIVE_INFINITY:a.reduce((_,I)=>_+(m[I]-this.viewItems[I].minimumSize),0),z=a.length===0?Number.NEGATIVE_INFINITY:a.reduce((_,I)=>_+(m[I]-this.viewItems[I].viewMaximumSize),0);n=Math.max(y,z),o=Math.min(v,w);const S=this.findFirstSnapIndex(c),p=this.findFirstSnapIndex(a);if(typeof S=="number"){const _=this.viewItems[S],I=Math.floor(_.viewMinimumSize/2);g={index:S,limitDelta:_.visible?n-I:n+I,size:_.size}}if(typeof p=="number"){const _=this.viewItems[p],I=Math.floor(_.viewMinimumSize/2);d={index:p,limitDelta:_.visible?o+I:o-I,size:_.size}}this.sashDragState={start:l,current:l,index:r,sizes:m,minDelta:n,maxDelta:o,snapBefore:g,snapAfter:d}})(i)}onSashChange({current:e}){const{index:i,start:r,sizes:l,minDelta:m,maxDelta:g,snapBefore:d,snapAfter:n}=this.sashDragState;this.sashDragState.current=e;const o=e-r;this.resize(i,o,l,void 0,void 0,m,g,d,n),this.distributeEmptySpace(),this.layoutViews()}getSashPosition(e){let i=0;for(let r=0;r<this.sashItems.length;r++)if(i+=this.viewItems[r].size,this.sashItems[r].sash===e)return i;return 0}resize(e,i,r=this.viewItems.map(c=>c.size),l,m,g=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY,n,o){if(e<0||e>=this.viewItems.length)return 0;const c=ee(e,-1,-1),a=ee(e+1,this.viewItems.length);if(m)for(const h of m)Ft(c,h),Ft(a,h);if(l)for(const h of l)ct(c,h),ct(a,h);const y=c.map(h=>this.viewItems[h]),w=c.map(h=>r[h]),v=a.map(h=>this.viewItems[h]),z=a.map(h=>r[h]),S=c.reduce((h,L)=>h+(this.viewItems[L].minimumSize-r[L]),0),p=c.reduce((h,L)=>h+(this.viewItems[L].maximumSize-r[L]),0),_=a.length===0?Number.POSITIVE_INFINITY:a.reduce((h,L)=>h+(r[L]-this.viewItems[L].minimumSize),0),I=a.length===0?Number.NEGATIVE_INFINITY:a.reduce((h,L)=>h+(r[L]-this.viewItems[L].maximumSize),0),E=Math.max(S,I,g),C=Math.min(_,p,d);let X=!1;if(n){const h=this.viewItems[n.index],L=i>=n.limitDelta;X=L!==h.visible,h.setVisible(L,n.size)}if(!X&&o){const h=this.viewItems[o.index],L=i<o.limitDelta;X=L!==h.visible,h.setVisible(L,o.size)}if(X)return this.resize(e,i,r,l,m,g,d);for(let h=0,L=i=re(i,E,C);h<y.length;h++){const K=y[h],F=re(w[h]+L,K.minimumSize,K.maximumSize);L-=F-w[h],K.size=F}for(let h=0,L=i;h<v.length;h++){const K=v[h],F=re(z[h]-L,K.minimumSize,K.maximumSize);L+=F-z[h],K.size=F}return i}distributeEmptySpace(e){const i=this.viewItems.reduce((o,c)=>o+c.size,0);let r=this.size-i;const l=ee(0,this.viewItems.length),m=[],g=l.filter(o=>this.viewItems[o].priority===ie.Low),d=l.filter(o=>this.viewItems[o].priority===ie.Normal),n=l.filter(o=>this.viewItems[o].priority===ie.High);m.push(...n,...d,...g),typeof e=="number"&&ct(m,e);for(let o=0;r!==0&&o<m.length;o++){const c=this.viewItems[m[o]],a=re(c.size+r,c.minimumSize,c.maximumSize);r-=a-c.size,c.size=a}}layoutViews(){var e;this.contentSize=this.viewItems.reduce((r,l)=>r+l.size,0);let i=0;for(const r of this.viewItems)r.layout(i),i+=r.size;(e=this.onDidChange)!=null&&e.call(this,this.viewItems.map(r=>r.size)),this.sashItems.forEach(r=>r.sash.layout()),this.updateSashEnablement()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.size/this.contentSize))}updateSashEnablement(){let e=!1;const i=this.viewItems.map(n=>e=n.size-n.minimumSize>0||e);e=!1;const r=this.viewItems.map(n=>e=n.maximumSize-n.size>0||e),l=[...this.viewItems].reverse();e=!1;const m=l.map(n=>e=n.size-n.minimumSize>0||e).reverse();e=!1;const g=l.map(n=>e=n.maximumSize-n.size>0||e).reverse();let d=0;for(let n=0;n<this.sashItems.length;n++){const{sash:o}=this.sashItems[n];d+=this.viewItems[n].size;const c=!(i[n]&&g[n+1]),a=!(r[n]&&m[n+1]);if(c&&a){const y=ee(n,-1,-1),w=ee(n+1,this.viewItems.length),v=this.findFirstSnapIndex(y),z=this.findFirstSnapIndex(w),S=typeof v=="number"&&!this.viewItems[v].visible,p=typeof z=="number"&&!this.viewItems[z].visible;S&&m[n]&&(d>0||this.startSnappingEnabled)?o.state=q.Minimum:p&&i[n]&&(d<this.contentSize||this.endSnappingEnabled)?o.state=q.Maximum:o.state=q.Disabled}else o.state=c&&!a?q.Minimum:!c&&a?q.Maximum:q.Enabled}}findFirstSnapIndex(e){for(const i of e){const r=this.viewItems[i];if(r.visible&&r.snap)return i}for(const i of e){const r=this.viewItems[i];if(r.visible&&r.maximumSize-r.minimumSize>0)return;if(!r.visible&&r.snap)return i}}}class De{constructor(e){this.size=void 0,this.size=e}getPreferredSize(){return this.size}}class Gt{constructor(e,i){this.proportion=void 0,this.layoutService=void 0,this.proportion=e,this.layoutService=i}getPreferredSize(){return this.proportion*this.layoutService.getSize()}}class We{getPreferredSize(){}}class Ut{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(e){if(typeof e=="number")this.layoutStrategy=new De(e);else if(typeof e=="string"){const i=e.trim();if(Be(i,"%")){const r=Number(i.slice(0,-1))/100;this.layoutStrategy=new Gt(r,this.layoutService)}else if(Be(i,"px")){const r=Number(i.slice(0,-2))/100;this.layoutStrategy=new De(r)}else if(typeof Number.parseFloat(i)=="number"){const r=Number.parseFloat(i);this.layoutStrategy=new De(r)}else this.layoutStrategy=new We}else this.layoutStrategy=new We}constructor(e,i){var r;if(this.minimumSize=0,this.maximumSize=Number.POSITIVE_INFINITY,this.element=void 0,this.priority=void 0,this.snap=void 0,this.layoutService=void 0,this.layoutStrategy=void 0,this.layoutService=e,this.element=i.element,this.minimumSize=typeof i.minimumSize=="number"?i.minimumSize:30,this.maximumSize=typeof i.maximumSize=="number"?i.maximumSize:Number.POSITIVE_INFINITY,typeof i.preferredSize=="number")this.layoutStrategy=new De(i.preferredSize);else if(typeof i.preferredSize=="string"){const l=i.preferredSize.trim();if(Be(l,"%")){const m=Number(l.slice(0,-1))/100;this.layoutStrategy=new Gt(m,this.layoutService)}else if(Be(l,"px")){const m=Number(l.slice(0,-2));this.layoutStrategy=new De(m)}else if(typeof Number.parseFloat(l)=="number"){const m=Number.parseFloat(l);this.layoutStrategy=new De(m)}else this.layoutStrategy=new We}else this.layoutStrategy=new We;this.priority=(r=i.priority)!=null?r:ie.Normal,this.snap=typeof i.snap=="boolean"&&i.snap}layout(e){}}function Xt(u){return u.minSize!==void 0||u.maxSize!==void 0||u.preferredSize!==void 0||u.priority!==void 0||u.visible!==void 0}const mt=window.React.forwardRef(({className:u,children:e},i)=>window.React.createElement("div",{ref:i,className:at("split-view-view",Lt,u)},e));mt.displayName="Allotment.Pane";const Jt=window.React.forwardRef(({children:u,className:e,id:i,maxSize:r=1/0,minSize:l=30,proportionalLayout:m=!0,separator:g=!0,sizes:d,defaultSizes:n=d,snap:o=!1,vertical:c=!1,onChange:a,onReset:y,onVisibleChange:w,onDragStart:v,onDragEnd:z},S)=>{const p=window.React.useRef(null),_=window.React.useRef([]),I=window.React.useRef(new Map),E=window.React.useRef(null),C=window.React.useRef(new Map),X=window.React.useRef(new Ii),h=window.React.useRef([]),[L,K]=window.React.useState(!1),F=window.React.useMemo(()=>window.React.Children.toArray(u).filter(window.React.isValidElement),[u]),oe=window.React.useCallback(O=>{var D,k;const R=(D=h.current)==null?void 0:D[O];return typeof(R==null?void 0:R.preferredSize)=="number"&&((k=E.current)!=null&&k.resizeView(O,Math.round(R.preferredSize)),!0)},[]);return window.React.useImperativeHandle(S,()=>({reset:()=>{if(y)y();else{var O;(O=E.current)==null||O.distributeViewSizes();for(let D=0;D<h.current.length;D++)oe(D)}},resize:O=>{var D;(D=E.current)==null||D.resizeViews(O)}})),Mt(()=>{let O=!0;n&&C.current.size!==n.length&&(O=!1,console.warn(`Expected ${n.length} children based on defaultSizes but found ${C.current.size}`)),O&&n&&(_.current=F.map(R=>R.key));const D=ue({orientation:c?te.Vertical:te.Horizontal,proportionalLayout:m},O&&n&&{descriptor:{size:n.reduce((R,N)=>R+N,0),views:n.map((R,N)=>{var A,W,ze,pe;const J=I.current.get(_.current[N]),we=new Ut(X.current,ue({element:document.createElement("div"),minimumSize:(A=J==null?void 0:J.minSize)!=null?A:l,maximumSize:(W=J==null?void 0:J.maxSize)!=null?W:r,priority:(ze=J==null?void 0:J.priority)!=null?ze:ie.Normal},(J==null?void 0:J.preferredSize)&&{preferredSize:J==null?void 0:J.preferredSize},{snap:(pe=J==null?void 0:J.snap)!=null?pe:o}));return h.current.push(we),{container:[...C.current.values()][N],size:R,view:we}})}});E.current=new Mi(p.current,D,a,v,z),E.current.on("sashDragStart",()=>{var R;(R=p.current)==null||R.classList.add("split-view-sash-dragging")}),E.current.on("sashDragEnd",()=>{var R;(R=p.current)==null||R.classList.remove("split-view-sash-dragging")}),E.current.on("sashchange",R=>{if(w&&E.current){const N=F.map(A=>A.key);for(let A=0;A<N.length;A++){const W=I.current.get(N[A]);(W==null?void 0:W.visible)!==void 0&&W.visible!==E.current.isViewVisible(A)&&w(A,E.current.isViewVisible(A))}}}),E.current.on("sashreset",R=>{if(y)y();else{var N;if(oe(R)||oe(R+1))return;(N=E.current)==null||N.distributeViewSizes()}});const k=E.current;return()=>{k.dispose()}},[]),Mt(()=>{if(L){const Q=F.map(x=>x.key),le=[..._.current],ce=Q.filter(x=>!_.current.includes(x)),Le=Q.filter(x=>_.current.includes(x)),Oe=_.current.map(x=>!Q.includes(x));for(let x=Oe.length-1;x>=0;x--){var O;Oe[x]&&((O=E.current)!=null&&O.removeView(x),le.splice(x,1),h.current.splice(x,1))}for(const x of ce){var D,k,R,N,A;const V=I.current.get(x),$=new Ut(X.current,ue({element:document.createElement("div"),minimumSize:(D=V==null?void 0:V.minSize)!=null?D:l,maximumSize:(k=V==null?void 0:V.maxSize)!=null?k:r,priority:(R=V==null?void 0:V.priority)!=null?R:ie.Normal},(V==null?void 0:V.preferredSize)&&{preferredSize:V==null?void 0:V.preferredSize},{snap:(N=V==null?void 0:V.snap)!=null?N:o}));(A=E.current)!=null&&A.addView(C.current.get(x),$,Ye.Distribute,Q.findIndex(B=>B===x)),le.splice(Q.findIndex(B=>B===x),0,x),h.current.splice(Q.findIndex(B=>B===x),0,$)}for(;!vi(Q,le);)for(const[x,V]of Q.entries()){const $=le.findIndex(B=>B===V);if($!==x){var W;(W=E.current)==null||W.moveView(C.current.get(V),$,x);const B=le[$];le.splice($,1),le.splice(x,0,B);break}}for(const x of ce){var ze;const V=Q.findIndex(B=>B===x),$=h.current[V].preferredSize;$!==void 0&&((ze=E.current)==null||ze.resizeView(V,$))}for(const x of[...ce,...Le]){var pe,J;const V=I.current.get(x),$=Q.findIndex(B=>B===x);V&&Xt(V)&&V.visible!==void 0&&((pe=E.current)==null?void 0:pe.isViewVisible($))!==V.visible&&((J=E.current)==null||J.setViewVisible($,V.visible))}for(const x of Le){const V=I.current.get(x),$=Q.findIndex(B=>B===x);if(V&&Xt(V)){var we;V.preferredSize!==void 0&&h.current[$].preferredSize!==V.preferredSize&&(h.current[$].preferredSize=V.preferredSize);let B=!1;V.minSize!==void 0&&h.current[$].minimumSize!==V.minSize&&(h.current[$].minimumSize=V.minSize,B=!0),V.maxSize!==void 0&&h.current[$].maximumSize!==V.maxSize&&(h.current[$].maximumSize=V.maxSize,B=!0),B&&((we=E.current)==null||we.layout())}}(ce.length>0||Oe.length>0)&&(_.current=Q)}},[F,L,r,l,o]),window.React.useEffect(()=>{E.current&&(E.current.onDidChange=a)},[a]),window.React.useEffect(()=>{E.current&&(E.current.onDidDragStart=v)},[v]),window.React.useEffect(()=>{E.current&&(E.current.onDidDragEnd=z)},[z]),pi({ref:p,onResize:({width:O,height:D})=>{var k;O&&D&&((k=E.current)!=null&&k.layout(c?D:O),X.current.setSize(c?D:O),K(!0))}}),window.React.useEffect(()=>{Nt&&Pi(20)},[]),window.React.createElement("div",{ref:p,className:at("split-view",c?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":g},wi,c?bi:_i,{[zi]:g},e),id:i},window.React.createElement("div",{className:at("split-view-container",gi)},window.React.Children.toArray(u).map(O=>{if(!window.React.isValidElement(O))return null;const D=O.key;return O.type.displayName==="Allotment.Pane"?(I.current.set(D,O.props),window.React.cloneElement(O,{key:D,ref:k=>{const R=O.ref;R&&(R.current=k),k?C.current.set(D,k):C.current.delete(D)}})):window.React.createElement(mt,{key:D,ref:k=>{k?C.current.set(D,k):C.current.delete(D)}},O)})))});function Pi(u){const e=re(u,4,20),i=re(u,1,8);document.documentElement.style.setProperty("--sash-size",e+"px"),document.documentElement.style.setProperty("--sash-hover-size",i+"px"),(function(r){Ht=r,Bt.emit("onDidChangeGlobalSize",r)})(e)}Jt.displayName="Allotment";var Ai=Object.assign(Jt,{Pane:mt});je.Allotment=Ai,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})}));
14
6
  //# sourceMappingURL=libraries.umd.cjs.map