grafana/plugins/grafana-lokiexplore-app/698.js
2025-01-10 20:54:04 -08:00

3 lines
No EOL
536 KiB
JavaScript

/*! For license information please see 698.js.LICENSE.txt */
(self.webpackChunkgrafana_lokiexplore_app=self.webpackChunkgrafana_lokiexplore_app||[]).push([[698],{1119:(e,t,n)=>{"use strict";n.d(t,{H9:()=>us,yP:()=>zd,mI:()=>qd,P1:()=>Dp,OS:()=>Vg,No:()=>Kg,n8:()=>Gt,d0:()=>Yg,UU:()=>ue,Oh:()=>_h,jD:()=>Gh,xK:()=>hh,gF:()=>fh,N0:()=>ah,Zv:()=>xe,Es:()=>_d,vA:()=>ih,G1:()=>oh,Bs:()=>J,So:()=>Oe,dt:()=>Ps,dM:()=>Lh,WM:()=>Vf,KE:()=>Pf,JZ:()=>ke,Pj:()=>Ad,Sh:()=>$s,K8:()=>Pd,Eb:()=>_c,Gg:()=>r,yC:()=>mn,jh:()=>wl,Go:()=>Xg,TG:()=>Ih});var r={};n.r(r),n.d(r,{K2:()=>Ml});var a=n(5959),o=n.t(a,2),i=n.n(a),s=n(3806),l=n(7781),c=n(8531),u=Object.defineProperty,d=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,h=(e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g=(e,t)=>{for(var n in t||(t={}))p.call(t,n)&&h(e,n,t[n]);if(d)for(var n of d(t))f.call(t,n)&&h(e,n,t[n]);return e};function m(e,t){const n=g({},c.locationService.getSearchObject());if(t)for(const e of Object.keys(n))t.includes(e)||delete n[e];return l.urlUtil.renderUrl(l.locationUtil.assureBaseUrl(e),n)}function b(e,t){return i().createElement(e.Component,{model:e,routeProps:t})}var y=Object.defineProperty,v=Object.defineProperties,w=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,D=(e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const C=new Map;var E=n(1269);const _={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let P;const R=new Uint8Array(16);function I(){if(!P&&(P="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!P))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return P(R)}const T=[];for(let e=0;e<256;++e)T.push((e+256).toString(16).slice(1));const k=function(e,t,n){if(_.randomUUID&&!t&&!e)return _.randomUUID();const r=(e=e||{}).random||(e.rng||I)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return T[e[t+0]]+T[e[t+1]]+T[e[t+2]]+T[e[t+3]]+"-"+T[e[t+4]]+T[e[t+5]]+"-"+T[e[t+6]]+T[e[t+7]]+"-"+T[e[t+8]]+T[e[t+9]]+"-"+T[e[t+10]]+T[e[t+11]]+T[e[t+12]]+T[e[t+13]]+T[e[t+14]]+T[e[t+15]]}(r)};var A=Object.defineProperty,j=Object.defineProperties,M=Object.getOwnPropertyDescriptors,L=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,V=(e,t,n)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const F=i().memo((function(e){var t,n=e,{model:r}=n,o=((e,t)=>{var n={};for(var r in e)N.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&L)for(var r of L(e))t.indexOf(r)<0&&B.call(e,r)&&(n[r]=e[r]);return n})(n,["model"]);const s=null!=(t=r.constructor.Component)?t:z,[l,c]=(0,a.useState)(0);return(0,a.useEffect)((()=>{const e=r.activate();return c((e=>e+1)),e}),[r]),r.isActive?i().createElement(s,(u=((e,t)=>{for(var n in t||(t={}))N.call(t,n)&&V(e,n,t[n]);if(L)for(var n of L(t))B.call(t,n)&&V(e,n,t[n]);return e})({},o),j(u,M({model:r})))):null;var u}));function z(e){return null}class W extends l.BusEventWithPayload{}W.type="scene-object-state-change";class U extends l.BusEventWithPayload{}U.type="scene-object-user-action";var H,$=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};class G{constructor(e){var t,n;((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,H),n=e,$(this,t=H,"write to private field"),t.set(this,n)}resolve(){return $(this,e=H,"read from private field"),e.get(this);var e}}H=new WeakMap;var q=Object.defineProperty,Q=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,X=(e,t,n)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z=(e,t)=>{for(var n in t||(t={}))Y.call(t,n)&&X(e,n,t[n]);if(Q)for(var n of Q(t))K.call(t,n)&&X(e,n,t[n]);return e};class J{constructor(e){this._isActive=!1,this._activationHandlers=[],this._deactivationHandlers=new Map,this._subs=new E.Subscription,this._refCount=0,e.key||(e.key=k()),this._events=new l.EventBusSrv,this._state=Object.freeze(e),this._setParent(this._state)}get state(){return this._state}get isActive(){return this._isActive}get parent(){return this._parent}get variableDependency(){return this._variableDependency}get urlSync(){return this._urlSync}get Component(){return F}_setParent(e){te(e,(e=>{e._parent&&e._parent!==this&&console.warn("SceneObject already has a parent set that is different from the new parent. You cannot share the same SceneObject instance in multiple scenes or in multiple different places of the same scene graph. Use SceneObject.clone() to duplicate a SceneObject or store a state key reference and use sceneGraph.findObject to locate it.",e,this),e._parent=this}))}clearParent(){this._parent=void 0}subscribeToState(e){return this._events.subscribe(W,(t=>{t.payload.changedObject===this&&e(t.payload.newState,t.payload.prevState)}))}subscribeToEvent(e,t){return this._events.subscribe(e,t)}setState(e){const t=this._state,n=Z(Z({},this._state),e);this._state=Object.freeze(n),this._setParent(e),this._handleActivationOfChangedStateProps(t,n),this.publishEvent(new W({prevState:t,newState:n,partialUpdate:e,changedObject:this}),!0)}_handleActivationOfChangedStateProps(e,t){this.isActive&&(e.$behaviors!==t.$behaviors&&this._handleChangedBehaviors(e.$behaviors,t.$behaviors),e.$data!==t.$data&&this._handleChangedStateActivation(e.$data,t.$data),e.$variables!==t.$variables&&this._handleChangedStateActivation(e.$variables,t.$variables),e.$timeRange!==t.$timeRange&&this._handleChangedStateActivation(e.$timeRange,t.$timeRange))}_handleChangedStateActivation(e,t){if(e){const t=this._deactivationHandlers.get(e);t&&(t(),this._deactivationHandlers.delete(e))}t&&this._deactivationHandlers.set(t,t.activate())}_handleChangedBehaviors(e,t){if(e)for(const n of e)if(!t||!t.includes(n)){const e=this._deactivationHandlers.get(n);e&&(e(),this._deactivationHandlers.delete(n))}if(t)for(const n of t)e&&e.includes(n)||this._activateBehavior(n)}publishEvent(e,t){this._events.publish(e),t&&this.parent&&this.parent.publishEvent(e,t)}getRoot(){return this._parent?this._parent.getRoot():this}_internalActivate(){this._isActive=!0;const{$data:e,$variables:t,$timeRange:n,$behaviors:r}=this.state;if(this._activationHandlers.forEach((e=>{const t=e();t&&this._deactivationHandlers.set(t,t)})),n&&!n.isActive&&this._deactivationHandlers.set(n,n.activate()),t&&!t.isActive&&this._deactivationHandlers.set(t,t.activate()),e&&!e.isActive&&this._deactivationHandlers.set(e,e.activate()),r)for(const e of r)this._activateBehavior(e)}_activateBehavior(e){if(e instanceof J)this._deactivationHandlers.set(e,e.activate());else if("function"==typeof e){const t=e(this);t&&this._deactivationHandlers.set(e,t)}}activate(){this.isActive||this._internalActivate(),this._refCount++;let e=!1;return()=>{if(this._refCount--,e)throw new Error("SceneObject cancelation handler returned by activate() called a second time");e=!0,0===this._refCount&&this._internalDeactivate()}}_internalDeactivate(){this._isActive=!1;for(let e of this._deactivationHandlers.values())e();this._deactivationHandlers.clear(),this._events.removeAllListeners(),this._subs.unsubscribe(),this._subs=new E.Subscription}useState(){return ee(this)}forceRender(){this.setState({})}clone(e){return function(e,t){const n=le(e.state,t);return new e.constructor(n)}(this,e)}addActivationHandler(e){this._activationHandlers.push(e)}forEachChild(e){te(this.state,e)}getRef(){return this._ref||(this._ref=new G(this)),this._ref}}function ee(e,t){var n;const[r,o]=(0,a.useState)(e.state),i=e.state,s=null!=(n=null==t?void 0:t.shouldActivateOrKeepAlive)&&n;return(0,a.useEffect)((()=>{let t;s&&(t=e.activate());const n=e.subscribeToState((e=>{o(e)}));return e.state!==i&&o(e.state),()=>{n.unsubscribe(),t&&t()}}),[e,s]),e.state}function te(e,t){for(const n of Object.values(e))if(n instanceof J&&t(n),Array.isArray(n))for(const e of n)e instanceof J&&t(e)}var ne=Object.defineProperty,re=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable,ie=(e,t,n)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,se=(e,t)=>{for(var n in t||(t={}))ae.call(t,n)&&ie(e,n,t[n]);if(re)for(var n of re(t))oe.call(t,n)&&ie(e,n,t[n]);return e};function le(e,t){const n=se({},e);for(const e in n){const t=n[e];if(t instanceof J&&(n[e]=t.clone()),t instanceof G)throw new Error("Cannot clone a SceneObject with a SceneObjectRef in state");if(Array.isArray(t)){const r=[];for(const e of t)e instanceof J?r.push(e.clone()):r.push(e);n[e]=r}}return Object.assign(n,t),n}function ce(e,t){let n,r=e;for(;r&&!n;)n=t(r),r=r.parent;return n}class ue extends l.DataSourceApi{constructor(e,t){super({name:"RuntimeDataSource-"+e,uid:t,type:e,id:1,readOnly:!0,jsonData:{},access:"direct",meta:{id:e,name:"RuntimeDataSource-"+e,type:l.PluginType.datasource,info:{author:{name:""},description:"",links:[],logos:{large:"",small:""},screenshots:[],updated:"",version:""},module:"",baseUrl:""}})}testDatasource(){return Promise.resolve({})}}const de=new Map;var pe=n(3241);function fe(e,t){const n=t.state.$variables;if(!n)return t.parent?fe(e,t.parent):null;return n.getByName(e)||(t.parent?fe(e,t.parent):null)}var he=n(3321);he.ob.Auto;var ge=(e=>(e.NotStarted="NotStarted",e.Loading="Loading",e.Streaming="Streaming",e.Done="Done",e.Error="Error",e))(ge||{}),me=Object.defineProperty,be=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,we=(e,t,n)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class xe extends J{constructor(e){super(((e,t)=>{for(var n in t||(t={}))ye.call(t,n)&&we(e,n,t[n]);if(be)for(var n of be(t))ve.call(t,n)&&we(e,n,t[n]);return e})({data:Se},e))}getResultsStream(){const e={origin:this,data:this.state.data};return(0,E.of)(e)}}const Se={state:ge.Done,series:[],timeRange:(0,l.getDefaultTimeRange)()};class Oe{constructor(e,t){this._sceneObject=e,this._nextChangeShouldAddHistoryStep=!1,this._keys=t.keys}getKeys(){return"function"==typeof this._keys?this._keys():this._keys}getUrlState(){return this._sceneObject.getUrlState()}updateFromUrl(e){this._sceneObject.updateFromUrl(e)}performBrowserHistoryAction(e){this._nextChangeShouldAddHistoryStep=!0,e(),this._nextChangeShouldAddHistoryStep=!1}shouldCreateHistoryStep(e){return this._nextChangeShouldAddHistoryStep}}const De=/^\d+[yYmMsSwWhHdD]$/;function Ce(e){if("string"!=typeof e)return null;if(-1!==e.indexOf("now"))return e;if(De.test(e))return e;if(8===e.length){const t=(0,l.toUtc)(e,"YYYYMMDD");if(t.isValid())return t.toISOString()}else if(15===e.length){const t=(0,l.toUtc)(e,"YYYYMMDDTHHmmss");if(t.isValid())return t.toISOString()}else if(24===e.length)return(0,l.toUtc)(e).toISOString();const t=parseInt(e,10);return isNaN(t)?null:(0,l.toUtc)(t).toISOString()}function Ee(e,t,n,r,a){const o=a&&"now"===t;return{from:l.dateMath.parse(e,!1,n,r),to:l.dateMath.parse(o?"now-"+a:t,!0,n,r),raw:{from:e,to:t}}}var _e=Object.defineProperty,Pe=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,Te=(e,t,n)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class ke extends J{constructor(e={}){var t,n,r;const a=null!=(t=e.from)?t:"now-6h",o=null!=(n=e.to)?n:"now",i=e.timeZone;super(((e,t)=>{for(var n in t||(t={}))Re.call(t,n)&&Te(e,n,t[n]);if(Pe)for(var n of Pe(t))Ie.call(t,n)&&Te(e,n,t[n]);return e})({from:a,to:o,timeZone:i,value:Ee(a,o,i||(0,l.getTimeZone)(),e.fiscalYearStartMonth,e.UNSAFE_nowDelay),refreshOnActivate:null!=(r=e.refreshOnActivate)?r:{percent:10}},e)),this._urlSync=new Oe(this,{keys:["from","to","timezone","time","time.window"]}),this.onTimeRangeChange=e=>{const t={},n={};"string"==typeof e.raw.from?(t.from=e.raw.from,n.from=e.raw.from):(t.from=e.raw.from.toISOString(),n.from=e.raw.from.toISOString(!0)),"string"==typeof e.raw.to?(t.to=e.raw.to,n.to=e.raw.to):(t.to=e.raw.to.toISOString(),n.to=e.raw.to.toISOString(!0)),t.value=Ee(n.from,n.to,this.getTimeZone(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay),t.from===this.state.from&&t.to===this.state.to||this._urlSync.performBrowserHistoryAction((()=>{this.setState(t)}))},this.onTimeZoneChange=e=>{this._urlSync.performBrowserHistoryAction((()=>{this.setState({timeZone:e})}))},this.onRefresh=()=>{this.setState({value:Ee(this.state.from,this.state.to,this.getTimeZone(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay)}),this.publishEvent(new c.RefreshEvent,!0)},this.addActivationHandler(this._onActivate.bind(this))}_onActivate(){if(!this.state.timeZone){const e=this.getTimeZoneSource();e!==this&&this._subs.add(e.subscribeToState(((t,n)=>{void 0!==t.timeZone&&t.timeZone!==n.timeZone&&this.setState({value:Ee(this.state.from,this.state.to,e.getTimeZone(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay)})})))}return this.state.weekStart&&(0,l.setWeekStart)(this.state.weekStart),l.rangeUtil.isRelativeTimeRange(this.state.value.raw)&&this.refreshIfStale(),()=>{this.state.weekStart&&(0,l.setWeekStart)(c.config.bootData.user.weekStart)}}refreshIfStale(){var e,t,n,r;let a;void 0!==(null==(t=null==(e=this.state)?void 0:e.refreshOnActivate)?void 0:t.percent)&&(a=this.calculatePercentOfInterval(this.state.refreshOnActivate.percent)),void 0!==(null==(r=null==(n=this.state)?void 0:n.refreshOnActivate)?void 0:r.afterMs)&&(a=Math.min(this.state.refreshOnActivate.afterMs,null!=a?a:1/0)),void 0!==a&&this.refreshRange(a)}getTimeZoneSource(){if(!this.parent||!this.parent.parent)return this;return ce(this.parent.parent,(e=>{if(e.state.$timeRange&&e.state.$timeRange.state.timeZone)return e.state.$timeRange}))||this}refreshRange(e){var t;const n=Ee(this.state.from,this.state.to,null!=(t=this.state.timeZone)?t:(0,l.getTimeZone)(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay);n.to.diff(this.state.value.to,"milliseconds")>=e&&this.setState({value:n})}calculatePercentOfInterval(e){const t=this.state.value.to.diff(this.state.value.from,"milliseconds");return Math.ceil(t/e)}getTimeZone(){if(this.state.timeZone)return this.state.timeZone;const e=this.getTimeZoneSource();return e!==this?e.state.timeZone:(0,l.getTimeZone)()}getUrlState(){const e=c.locationService.getSearchObject(),t={from:this.state.from,to:this.state.to};return this.state.timeZone&&(t.timezone=this.state.timeZone),e.time&&e["time.window"]&&(t.time=null,t["time.window"]=null),t}updateFromUrl(e){var t,n,r;const a={};let o=Ce(e.from),i=Ce(e.to);if(e.time&&e["time.window"]){const t=function(e,t){const n=isNaN(Date.parse(e))?parseInt(e,10):Date.parse(e);let r;return r=t.match(/^\d+$/)&&parseInt(t,10)?parseInt(t,10):l.rangeUtil.intervalToMs(t),{from:(0,l.toUtc)(n-r/2).toISOString(),to:(0,l.toUtc)(n+r/2).toISOString()}}(Array.isArray(e.time)?e.time[0]:e.time,Array.isArray(e["time.window"])?e["time.window"][0]:e["time.window"]);o=t.from,i=t.to}(o||i)&&(o&&(a.from=o),i&&(a.to=i),"string"==typeof e.timezone&&(a.timeZone=""!==e.timezone?e.timezone:void 0),a.value=Ee(null!=(t=a.from)?t:this.state.from,null!=(n=a.to)?n:this.state.to,null!=(r=a.timeZone)?r:this.getTimeZone(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay),this.setState(a))}}const Ae=new xe,je=new ke,Me=new class extends J{constructor(){super({variables:[]})}getByName(e){}isVariableLoadingOrWaitingToUpdate(e){return!1}};function Le(e){var t;return null!=(t=ce(e,(e=>e.state.$timeRange)))?t:je}class Ne extends l.BusEventWithPayload{}function Be(e){return"object"==typeof e&&"formatter"in e}Ne.type="scene-variable-changed-value";let Ve,Fe={};function ze(e){return Fe[e]||(Fe[e]=(0,pe.property)(e))}class We{constructor(e,t){this.state={name:e,value:t,type:"scopedvar"}}getValue(e){let{value:t}=this.state,n=t.value;return n=e?ze(e)(t.value):t.value,"string"===n||"number"===n||"boolean"===n?n:String(n)}getValueText(){const{value:e}=this.state;return null!=e.text?String(e.text):String(e)}}const Ue=new l.Registry((()=>{const e=[{id:he.$m.Lucene,name:"Lucene",description:"Values are lucene escaped and multi-valued variables generate an OR expression",formatter:e=>"string"==typeof e?He(e):Array.isArray(e)?0===e.length?"__empty__":"("+(0,pe.map)(e,(e=>'"'+He(e)+'"')).join(" OR ")+")":He(`${e}`)},{id:he.$m.Raw,name:"raw",description:"Keep value as is",formatter:e=>String(e)},{id:he.$m.Regex,name:"Regex",description:"Values are regex escaped and multi-valued variables generate a (<value>|<value>) expression",formatter:e=>{if("string"==typeof e)return(0,l.escapeRegex)(e);if(Array.isArray(e)){const t=e.map((e=>"string"==typeof e?(0,l.escapeRegex)(e):(0,l.escapeRegex)(String(e))));return 1===t.length?t[0]:"("+t.join("|")+")"}return(0,l.escapeRegex)(`${e}`)}},{id:he.$m.Pipe,name:"Pipe",description:"Values are separated by | character",formatter:e=>"string"==typeof e?e:Array.isArray(e)?e.join("|"):`${e}`},{id:he.$m.Distributed,name:"Distributed",description:"Multiple values are formatted like variable=value",formatter:(e,t,n)=>"string"==typeof e?e:Array.isArray(e)?(e=(0,pe.map)(e,((e,t)=>0!==t?n.state.name+"="+e:e)),e.join(",")):`${e}`},{id:he.$m.CSV,name:"Csv",description:"Comma-separated values",formatter:e=>"string"==typeof e?e:(0,pe.isArray)(e)?e.join(","):String(e)},{id:he.$m.HTML,name:"HTML",description:"HTML escaping of values",formatter:e=>"string"==typeof e?l.textUtil.escapeHtml(e):(0,pe.isArray)(e)?l.textUtil.escapeHtml(e.join(", ")):l.textUtil.escapeHtml(String(e))},{id:he.$m.JSON,name:"JSON",description:"JSON stringify value",formatter:e=>"string"==typeof e?e:JSON.stringify(e)},{id:he.$m.PercentEncode,name:"Percent encode",description:"Useful for URL escaping values",formatter:e=>(0,pe.isArray)(e)?$e("{"+e.join(",")+"}"):$e(e)},{id:he.$m.SingleQuote,name:"Single quote",description:"Single quoted values",formatter:e=>{const t=new RegExp("'","g");if((0,pe.isArray)(e))return(0,pe.map)(e,(e=>`'${(0,pe.replace)(e,t,"\\'")}'`)).join(",");let n="string"==typeof e?e:String(e);return`'${(0,pe.replace)(n,t,"\\'")}'`}},{id:he.$m.DoubleQuote,name:"Double quote",description:"Double quoted values",formatter:e=>{const t=new RegExp('"',"g");if((0,pe.isArray)(e))return(0,pe.map)(e,(e=>`"${(0,pe.replace)(e,t,'\\"')}"`)).join(",");let n="string"==typeof e?e:String(e);return`"${(0,pe.replace)(n,t,'\\"')}"`}},{id:he.$m.SQLString,name:"SQL string",description:"SQL string quoting and commas for use in IN statements and other scenarios",formatter:Ke},{id:he.$m.Date,name:"Date",description:"Format date in different ways",formatter:(e,t)=>{var n;let r=NaN;if("number"==typeof e?r=e:"string"==typeof e&&(r=parseInt(e,10)),isNaN(r))return"NaN";const a=null!=(n=t[0])?n:"iso";switch(a){case"ms":return String(e);case"seconds":return`${Math.round(r/1e3)}`;case"iso":return(0,l.dateTime)(r).toISOString();default:return(t||[]).length>1?(0,l.dateTime)(r).format(t.join(":")):(0,l.dateTime)(r).format(a)}}},{id:he.$m.Glob,name:"Glob",description:"Format multi-valued variables using glob syntax, example {value1,value2}",formatter:e=>(0,pe.isArray)(e)&&e.length>1?"{"+e.join(",")+"}":String(e)},{id:he.$m.Text,name:"Text",description:"Format variables in their text representation. Example in multi-variable scenario A + B + C.",formatter:(e,t,n)=>n.getValueText?n.getValueText():String(e)},{id:he.$m.QueryParam,name:"Query parameter",description:"Format variables as URL parameters. Example in multi-variable scenario A + B + C => var-foo=A&var-foo=B&var-foo=C.",formatter:(e,t,n)=>Array.isArray(e)?e.map((e=>Qe(n.state.name,e))).join("&"):Qe(n.state.name,e)},{id:he.$m.UriEncode,name:"Percent encode as URI",description:"Useful for URL escaping values, taking into URI syntax characters",formatter:e=>(0,pe.isArray)(e)?Ge("{"+e.join(",")+"}"):Ge(e)}];return e}));function He(e){return!1===isNaN(+e)?e:e.replace(/([\!\*\+\-\=<>\s\&\|\(\)\[\]\{\}\^\~\?\:\\/"])/g,"\\$1")}function $e(e){return"object"==typeof e&&(e=String(e)),qe(encodeURIComponent(e))}const Ge=e=>qe(encodeURI(String(e))),qe=e=>e.replace(/[!'()*]/g,(e=>"%"+e.charCodeAt(0).toString(16).toUpperCase()));function Qe(e,t){return`var-${e}=${$e(t)}`}const Ye={"'":"''",'"':'\\"'};function Ke(e){const t=new RegExp("'|\"","g");if((0,pe.isArray)(e))return(0,pe.map)(e,(e=>`'${(0,pe.replace)(e,t,(e=>{var t;return null!=(t=Ye[e])?t:""}))}'`)).join(",");let n="string"==typeof e?e:String(e);return`'${(0,pe.replace)(n,t,(e=>{var t;return null!=(t=Ye[e])?t:""}))}'`}const Xe="All",Ze="$__all",Je="$__auto",et=/\$(\w+)|\[\[(\w+?)(?::(\w+))?\]\]|\${(\w+)(?:\.([^:^\}]+))?(?::([^\}]+))?}/g;class tt{constructor(e){this._value=e}formatter(){return this._value}}class nt{constructor(e,t){this.state={name:e,type:"time_macro"},this._sceneObject=t}getValue(){const e=Le(this._sceneObject);return"__from"===this.state.name?e.state.value.from.valueOf():e.state.value.to.valueOf()}getValueText(){const e=Le(this._sceneObject);return"__from"===this.state.name?(0,l.dateTimeFormat)(e.state.value.from,{timeZone:e.getTimeZone()}):(0,l.dateTimeFormat)(e.state.value.to,{timeZone:e.getTimeZone()})}}class rt{constructor(e,t,n){this.state={name:e,type:"time_macro",match:n},this._sceneObject=t}getValue(){var e;const t=gl(this._sceneObject);if(t){const n=null==(e=t.state.data)?void 0:e.request;return n?"__interval_ms"===this.state.name?n.intervalMs:n.interval:this.state.match}return this.state.match}}function at(e,t={}){if(e.state.$variables)for(const n of e.state.$variables.state.variables)n.state.skipUrlSync||t[n.state.name]||(t[n.state.name]=n);return e.parent&&at(e.parent,t),t}var ot=Object.defineProperty,it=Object.defineProperties,st=Object.getOwnPropertyDescriptors,lt=Object.getOwnPropertySymbols,ct=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable,dt=(e,t,n)=>t in e?ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const pt=(0,l.getDisplayProcessor)();class ft{constructor(e){this._urlQueryParams=e}formatter(e){if(!e)return this._urlQueryParams;const t=e.split(":");if("exclude"===t[0]&&t.length>1){const e=new URLSearchParams(this._urlQueryParams);for(const n of t[1].split(","))e.delete(n);return`?${e}`}if("include"===t[0]&&t.length>1){const e=new URLSearchParams(this._urlQueryParams),n=t[1].split(",");for(const t of e.keys())n.includes(t)||e.delete(t);return`?${e}`}return this._urlQueryParams}}const ht=new Map([[l.DataLinkBuiltInVars.includeVars,class{constructor(e,t){this.state={name:e,type:"url_variable"},this._sceneObject=t}getValue(){const e=at(this._sceneObject),t=Ue.get(he.$m.QueryParam),n=[];for(const r of Object.keys(e)){const a=e[r],o=a.getValue();o&&(Be(o)?n.push(o.formatter(he.$m.QueryParam)):n.push(t.formatter(o,[],a)))}return new tt(n.join("&"))}getValueText(){return""}}],[l.DataLinkBuiltInVars.keepTime,class{constructor(e,t){this.state={name:e,type:"url_variable"},this._sceneObject=t}getValue(){var e;const t=null==(e=Le(this._sceneObject).urlSync)?void 0:e.getUrlState();return new tt(l.urlUtil.toUrlParams(t))}getValueText(){return""}}],["__value",class{constructor(e,t,n,r){this._match=n,this._scopedVars=r,this.state={name:e,type:"__value"}}getValue(e){var t,n;const r=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!r)return this._match;const{frame:a,rowIndex:o,field:i,calculatedValue:s}=r.value;if(s)switch(e){case"numeric":case"raw":return s.numeric;case"time":return"";default:return(0,l.formattedValueToString)(s)}if(null==o)return this._match;if("time"===e){const e=a.fields.find((e=>e.type===l.FieldType.time));return e?e.values.get(o):void 0}if(!i)return this._match;const c=i.values.get(o);if("raw"===e)return c;const u=(null!=(n=i.display)?n:pt)(c);return"numeric"===e?u.numeric:(0,l.formattedValueToString)(u)}getValueText(){return""}}],["__data",class{constructor(e,t,n,r){this._match=n,this._scopedVars=r,this.state={name:e,type:"__data"}}getValue(e){var t,n;const r=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!r||!e)return this._match;const{frame:a,rowIndex:o}=r.value;if(void 0===o||void 0===e)return this._match;const i={name:a.name,refId:a.refId,fields:(0,l.getFieldDisplayValuesProxy)({frame:a,rowIndex:o})};return null!=(n=ze(e)(i))?n:""}getValueText(){return""}}],["__series",class{constructor(e,t,n,r){this._match=n,this._scopedVars=r,this.state={name:e,type:"__series"}}getValue(e){var t;const n=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!n||!e)return this._match;if("name"!==e)return this._match;const{frame:r,frameIndex:a}=n.value;return(0,l.getFrameDisplayName)(r,a)}getValueText(){return""}}],["__field",class{constructor(e,t,n,r){this._match=n,this._scopedVars=r,this.state={name:e,type:"__field"}}getValue(e){var t,n;const r=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!r||!e)return this._match;if(void 0===e||""===e)return this._match;const{frame:a,field:o,data:i}=r.value,s=function(e,t,n){return new Proxy({},{get:(r,a)=>{return"name"===a?e.name:"displayName"===a?(0,l.getFieldDisplayName)(e,t,n):"labels"===a||"formattedLabels"===a?e.labels?(o=((e,t)=>{for(var n in t||(t={}))ct.call(t,n)&&dt(e,n,t[n]);if(lt)for(var n of lt(t))ut.call(t,n)&&dt(e,n,t[n]);return e})({},e.labels),i={__values:Object.values(e.labels).sort().join(", "),toString:()=>(0,l.formatLabels)(e.labels,"",!0)},it(o,st(i))):"":void 0;var o,i}})}(o,a,i);return null!=(n=ze(e)(s))?n:""}getValueText(){return""}}],["__url",class{constructor(e,t){this.state={name:e,type:"url_macro"}}getValue(e){var t;const n=c.locationService.getLocation(),r=null!=(t=c.config.appSubUrl)?t:"";switch(null!=e?e:""){case"params":return new ft(n.search);case"path":return r+n.pathname;default:return r+n.pathname+n.search}}getValueText(){return""}}],["__from",nt],["__to",nt],["__timezone",class{constructor(e,t){this.state={name:e,type:"time_macro"},this._sceneObject=t}getValue(){const e=Le(this._sceneObject).getTimeZone();return"browser"===e?Intl.DateTimeFormat().resolvedOptions().timeZone:e}getValueText(){return this.getValue()}}],["__user",class{constructor(e,t){this.state={name:e,type:"user_macro"}}getValue(e){const t=c.config.bootData.user;switch(e){case"login":return t.login;case"email":return t.email;default:return String(t.id)}}getValueText(){return""}}],["__org",class{constructor(e,t){this.state={name:e,type:"org_macro"}}getValue(e){const t=c.config.bootData.user;return"name"===e?t.orgName:String(t.orgId)}getValueText(){return""}}],["__interval",rt],["__interval_ms",rt]]);function gt(e,t,n,r,a){return t&&"string"==typeof t?(et.lastIndex=0,t.replace(et,((t,o,i,s,l,c,u)=>{const d=o||i||l,p=s||u||r,f=function(e,t,n,r){if(n&&n.hasOwnProperty(e)){const t=n[e];if(t)return function(e,t){return Ve?(Ve.state.name=e,Ve.state.value=t):Ve=new We(e,t),Ve}(e,t)}const a=fe(e,r);if(a)return a;const o=ht.get(e);return o?new o(e,r,t,n):null}(d,t,n,e);if(!f)return a&&a.push({match:t,variableName:d,fieldPath:c,format:p,value:t,found:!1}),t;const h=function(e,t,n,r){if(null==n)return"";if(Be(n))return gt(e,n.formatter(r));if(Array.isArray(n)||"object"!=typeof n||(n=`${n}`),"function"==typeof r)return r(n,{name:t.state.name,type:t.state.type,multi:t.state.isMulti,includeAll:t.state.includeAll});let a=[];r?(a=r.split(":"),a.length>1?(r=a[0],a=a.slice(1)):a=[]):r=he.$m.Glob;let o=Ue.getIfExists(r);return o||(console.error(`Variable format ${r} not found. Using glob format as fallback.`),o=Ue.get(he.$m.Glob)),o.formatter(n,a,t)}(e,f,f.getValue(c),p);return a&&a.push({match:t,variableName:d,fieldPath:c,format:p,value:h,found:h!==t}),h}))):null!=t?t:""}function mt(e){return void 0!==e.useState}function bt(e){return"enrichDataRequest"in e}function yt(e){return"isDataLayer"in e}function vt(e,t,...n){let r=!1;"undefined"!=typeof window&&(r="true"===localStorage.getItem("grafana.debug.scenes")),r&&console.log(`${e}: `,t,...n)}async function wt(e,t){if(null==e?void 0:e.uid){const t=de.get(e.uid);if(t)return t}return e&&e.query?e:await(0,c.getDataSourceSrv)().get(e,t)}new WeakMap;class xt{constructor(){this._values=new Map}recordCurrentDependencyValuesForSceneObject(e){if(this.clearValues(),e.variableDependency)for(const t of e.variableDependency.getNames()){const n=wl.lookupVariable(t,e);n&&this._values.set(n.state.name,n.getValue())}}cloneAndRecordCurrentValuesForSceneObject(e){const t=new xt;return t.recordCurrentDependencyValuesForSceneObject(e),t}clearValues(){this._values.clear()}hasValues(){return!!this._values}recordCurrentValue(e){this._values.set(e.state.name,e.getValue())}hasRecordedValue(e){return this._values.has(e.state.name)}hasValueChanged(e){return!(!this._values.has(e.state.name)||Ts(this._values.get(e.state.name),e.getValue()))}hasDependenciesChanged(e){if(!this._values)return!1;if(!e.variableDependency)return!1;for(const t of e.variableDependency.getNames()){const n=wl.lookupVariable(t,e);if(!n)continue;const r=n.state.name;if(n&&this._values.has(r)&&!Ts(this._values.get(r),n.getValue()))return!0}return!1}}function St(e){return"object"==typeof e&&"getExtraQueries"in e}var Ot=Object.defineProperty,Dt=Object.defineProperties,Ct=Object.getOwnPropertyDescriptors,Et=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable,Rt=(e,t,n)=>t in e?Ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const It=(e,t)=>(0,E.of)(t);var Tt=Object.defineProperty,kt=Object.defineProperties,At=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable,Nt=(e,t,n)=>t in e?Tt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bt=(e,t)=>{for(var n in t||(t={}))Mt.call(t,n)&&Nt(e,n,t[n]);if(jt)for(var n of jt(t))Lt.call(t,n)&&Nt(e,n,t[n]);return e},Vt=(e,t)=>kt(e,At(t));function Ft(e){const t=e.getRoot();return bt(t)?t.enrichDataRequest(e):null}let zt,Wt=new Set;function Ut(e){return t=>{const n=wl.getQueryController(e.origin);return n?new E.Observable((r=>{e.cancel||(e.cancel=()=>r.complete()),n.queryStarted(e);let a=!1;const o=t.subscribe({next:t=>{a||t.state===ge.Loading||(a=!0,n.queryCompleted(e)),r.next(t)},error:e=>r.error(e),complete:()=>{r.complete()}});return()=>{o.unsubscribe(),a||n.queryCompleted(e)}})):t}}const Ht=new Set;function $t(e,t){e.setState(t)}class Gt extends J{constructor(){super(...arguments),this._urlSync=new qt(this)}validateAndUpdate(){return this.getValueOptions({}).pipe((0,E.map)((e=>(this.updateValueGivenNewOptions(e),{}))))}onCancel(){this.setStateHelper({loading:!1});const e=this.parent;null==e||e.cancel(this)}updateValueGivenNewOptions(e){const{value:t,text:n,options:r}=this.state,a=this.getStateUpdateGivenNewOptions(e,t,n);this.interceptStateUpdateAfterValidation(a),this.setStateHelper(a),(a.value!==t||a.text!==n||this.hasAllValue()&&!(0,pe.isEqual)(e,r))&&this.publishEvent(new Ne(this),!0)}getStateUpdateGivenNewOptions(e,t,n){const r={options:e,loading:!1,value:t,text:n};if(0===e.length)return this.state.defaultToAll||this.state.includeAll?(r.value=Ze,r.text=Xe):this.state.isMulti?(r.value=[],r.text=[]):(r.value="",r.text=""),r;if(this.hasAllValue())return this.state.includeAll||(r.value=e[0].value,r.text=e[0].label,this.state.isMulti&&(r.value=[r.value],r.text=[r.text])),r;if(this.state.isMulti){const a=(Array.isArray(t)?t:[t]).filter((t=>e.find((e=>e.value===t)))),o=a.map((t=>e.find((e=>e.value===t)).label));if(0===a.length){const t=this.getDefaultMultiState(e);r.value=t.value,r.text=t.text}else(0,pe.isEqual)(a,t)||(r.value=a),(0,pe.isEqual)(o,n)||(r.text=o);return r}let a=function(e,t,n){let r;for(const a of n){if(a.value===e)return a;a.label===t&&(r=a)}return r}(t,n,e);return a?(r.text=a.label,r.value=a.value):this.state.defaultToAll?(r.value=Ze,r.text=Xe):(r.value=e[0].value,r.text=e[0].label),r}interceptStateUpdateAfterValidation(e){const t=e.value===Ze&&this.state.text===Xe;this.skipNextValidation&&e.value!==this.state.value&&e.text!==this.state.text&&!t&&(e.value=this.state.value,e.text=this.state.text),this.skipNextValidation=!1}getValue(){return this.hasAllValue()?this.state.allValue?new Qt(this.state.allValue,this):this.state.options.map((e=>e.value)):this.state.value}getValueText(){return this.hasAllValue()?Xe:Array.isArray(this.state.text)?this.state.text.join(" + "):String(this.state.text)}hasAllValue(){const e=this.state.value;return e===Ze||Array.isArray(e)&&e[0]===Ze}getDefaultMultiState(e){return this.state.defaultToAll?{value:[Ze],text:[Xe]}:e.length>0?{value:[e[0].value],text:[e[0].label]}:{value:[],text:[]}}changeValueTo(e,t){if(e!==this.state.value||t!==this.state.text){if(t||(t=Array.isArray(e)?e.map((e=>this.findLabelTextForValue(e))):this.findLabelTextForValue(e)),Array.isArray(e)){if(0===e.length){const n=this.getDefaultMultiState(this.state.options);e=n.value,t=n.text}e[e.length-1]===Ze?(e=[Ze],t=[Xe]):e[0]===Ze&&e.length>1&&(e.shift(),Array.isArray(t)&&t.shift())}(0,pe.isEqual)(e,this.state.value)&&(0,pe.isEqual)(t,this.state.text)||(this.setStateHelper({value:e,text:t,loading:!1}),this.publishEvent(new Ne(this),!0))}}findLabelTextForValue(e){if(e===Ze)return Xe;const t=this.state.options.find((t=>t.value===e));if(t)return t.label;const n=this.state.options.find((t=>t.label===e));return n?n.label:e}setStateHelper(e){$t(this,e)}getOptionsForSelect(){let e=this.state.options;return this.state.includeAll&&(e=[{value:Ze,label:Xe},...e]),Array.isArray(this.state.value)||e.find((e=>e.value===this.state.value))||(e=[{value:this.state.value,label:String(this.state.text)},...e]),e}refreshOptions(){this.getValueOptions({}).subscribe((e=>{this.updateValueGivenNewOptions(e)}))}}class qt{constructor(e){this._sceneObject=e}getKey(){return`var-${this._sceneObject.state.name}`}getKeys(){return this._sceneObject.state.skipUrlSync?[]:[this.getKey()]}getUrlState(){if(this._sceneObject.state.skipUrlSync)return{};let e=null,t=this._sceneObject.state.value;return e=Array.isArray(t)?t.map(String):this._sceneObject.state.isMulti?[String(t)]:String(t),{[this.getKey()]:e}}updateFromUrl(e){let t=e[this.getKey()];var n;null!=t&&(this._sceneObject.state.includeAll&&(n=t,t=(0,pe.isArray)(n)&&n[0]===Xe?[Ze]:n===Xe?Ze:n),this._sceneObject.state.allValue&&this._sceneObject.state.allValue===t&&(t=Ze),this._sceneObject.isActive||(this._sceneObject.skipNextValidation=!0),this._sceneObject.changeValueTo(t))}}class Qt{constructor(e,t){this._value=e,this._variable=t}formatter(e){return e===he.$m.Text?Xe:e===he.$m.PercentEncode?Ue.get(he.$m.PercentEncode).formatter(this._value,[],this._variable):e===he.$m.QueryParam?Ue.get(he.$m.QueryParam).formatter(Xe,[],this._variable):this._value}}var Yt=n(2007);const Kt={RadioButton:{container:"data-testid radio-button"},Breadcrumbs:{breadcrumb:e=>`data-testid ${e} breadcrumb`},TimePicker:{openButton:"data-testid TimePicker Open Button",overlayContent:"data-testid TimePicker Overlay Content",fromField:"data-testid Time Range from field",toField:"data-testid Time Range to field",applyTimeRange:"data-testid TimePicker submit button",copyTimeRange:"data-testid TimePicker copy button",pasteTimeRange:"data-testid TimePicker paste button",calendar:{label:"data-testid Time Range calendar",openButton:"data-testid Open time range calendar",closeButton:"data-testid Close time range Calendar"},absoluteTimeRangeTitle:"data-testid-absolute-time-range-narrow"},DataSourcePermissions:{form:()=>'form[name="addPermission"]',roleType:"Role to add new permission to",rolePicker:"Built-in role picker",permissionLevel:"Permission Level"},DateTimePicker:{input:"data-testid date-time-input"},DataSource:{TestData:{QueryTab:{scenarioSelectContainer:"Test Data Query scenario select container",scenarioSelect:"Test Data Query scenario select",max:"TestData max",min:"TestData min",noise:"TestData noise",seriesCount:"TestData series count",spread:"TestData spread",startValue:"TestData start value",drop:"TestData drop values"}},DataSourceHttpSettings:{urlInput:"data-testid Datasource HTTP settings url"},Jaeger:{traceIDInput:"Trace ID"},Prometheus:{configPage:{connectionSettings:"Data source connection URL",manageAlerts:"prometheus-alerts-manager",scrapeInterval:"data-testid scrape interval",queryTimeout:"data-testid query timeout",defaultEditor:"data-testid default editor",disableMetricLookup:"disable-metric-lookup",prometheusType:"data-testid prometheus type",prometheusVersion:"data-testid prometheus version",cacheLevel:"data-testid cache level",incrementalQuerying:"prometheus-incremental-querying",queryOverlapWindow:"data-testid query overlap window",disableRecordingRules:"disable-recording-rules",customQueryParameters:"data-testid custom query parameters",httpMethod:"data-testid http method",exemplarsAddButton:"data-testid Add exemplar config button",internalLinkSwitch:"data-testid Internal link switch"},queryEditor:{explain:"data-testid prometheus explain switch wrapper",editorToggle:"data-testid QueryEditorModeToggle",options:"data-testid prometheus options",legend:"data-testid prometheus legend wrapper",format:"data-testid prometheus format",step:"prometheus-step",type:"data-testid prometheus type",exemplars:"prometheus-exemplars",builder:{metricSelect:"data-testid metric select",hints:"data-testid prometheus hints",metricsExplorer:"data-testid metrics explorer",queryAdvisor:"data-testid query advisor"},code:{queryField:"data-testid prometheus query field",metricsBrowser:{openButton:"data-testid open metrics browser",selectMetric:"data-testid select a metric",metricList:"data-testid metric list",labelNamesFilter:"data-testid label names filter",labelValuesFilter:"data-testid label values filter",useQuery:"data-testid use query",useAsRateQuery:"data-testid use as rate query",validateSelector:"data-testid validate selector",clear:"data-testid clear"}}},exemplarMarker:"data-testid Exemplar marker",variableQueryEditor:{queryType:"data-testid query type",labelnames:{metricRegex:"data-testid label names metric regex"},labelValues:{labelSelect:"data-testid label values label select"},metricNames:{metricRegex:"data-testid metric names metric regex"},varQueryResult:"data-testid variable query result",seriesQuery:"data-testid prometheus series query",classicQuery:"data-testid prometheus classic query"},annotations:{minStep:"prometheus-annotation-min-step",title:"data-testid prometheus annotation title",tags:"data-testid prometheus annotation tags",text:"data-testid prometheus annotation text",seriesValueAsTimestamp:"data-testid prometheus annotation series value as timestamp"}}},Menu:{MenuComponent:e=>`${e} menu`,MenuGroup:e=>`${e} menu group`,MenuItem:e=>`${e} menu item`,SubMenu:{container:"data-testid SubMenu container",icon:"data-testid SubMenu icon"}},Panels:{Panel:{title:e=>`data-testid Panel header ${e}`,headerItems:e=>`data-testid Panel header item ${e}`,menuItems:e=>`data-testid Panel menu item ${e}`,menu:e=>`data-testid Panel menu ${e}`,containerByTitle:e=>`${e} panel`,headerCornerInfo:e=>`Panel header ${e}`,status:e=>`data-testid Panel status ${e}`,loadingBar:()=>"Panel loading bar",HoverWidget:{container:"data-testid hover-header-container",dragIcon:"data-testid drag-icon"},PanelDataErrorMessage:"data-testid Panel data error message"},Visualization:{Graph:{container:"Graph container",VisualizationTab:{legendSection:"Legend section"},Legend:{legendItemAlias:e=>`gpl alias ${e}`,showLegendSwitch:"gpl show legend"},xAxis:{labels:()=>"div.flot-x-axis > div.flot-tick-label"}},BarGauge:{value:"Bar gauge value",valueV2:"data-testid Bar gauge value"},PieChart:{svgSlice:"data testid Pie Chart Slice"},Text:{container:()=>".markdown-html"},Table:{header:"table header",footer:"table-footer",body:"data-testid table body"}}},VizLegend:{seriesName:e=>`data-testid VizLegend series ${e}`},Drawer:{General:{title:e=>`Drawer title ${e}`,expand:"Drawer expand",contract:"Drawer contract",close:"data-testid Drawer close",rcContentWrapper:()=>".rc-drawer-content-wrapper",subtitle:"data-testid drawer subtitle"},DashboardSaveDrawer:{saveButton:"data-testid Save dashboard drawer button",saveAsButton:"data-testid Save as dashboard drawer button",saveAsTitleInput:"Save dashboard title field"}},PanelEditor:{General:{content:"Panel editor content"},OptionsPane:{content:"Panel editor option pane content",select:"Panel editor option pane select",fieldLabel:e=>`${e} field property editor`,fieldInput:e=>`data-testid Panel editor option pane field input ${e}`},DataPane:{content:"Panel editor data pane content"},applyButton:"data-testid Apply changes and go back to dashboard",toggleVizPicker:"data-testid toggle-viz-picker",toggleVizOptions:"data-testid toggle-viz-options",toggleTableView:"toggle-table-view",showZoomField:"Map controls Show zoom control field property editor",showAttributionField:"Map controls Show attribution field property editor",showScaleField:"Map controls Show scale field property editor",showMeasureField:"Map controls Show measure tools field property editor",showDebugField:"Map controls Show debug field property editor",measureButton:"show measure tools"},PanelInspector:{Data:{content:"Panel inspector Data content"},Stats:{content:"Panel inspector Stats content"},Json:{content:"Panel inspector Json content"},Query:{content:"Panel inspector Query content",refreshButton:"Panel inspector Query refresh button",jsonObjectKeys:()=>".json-formatter-key"}},Tab:{title:e=>`Tab ${e}`,active:()=>'[class*="-activeTabStyle"]'},RefreshPicker:{runButton:"RefreshPicker run button",intervalButton:"RefreshPicker interval button",runButtonV2:"data-testid RefreshPicker run button",intervalButtonV2:"data-testid RefreshPicker interval button"},QueryTab:{content:"Query editor tab content",queryInspectorButton:"Query inspector button",queryHistoryButton:"data-testid query-history-button",addQuery:"data-testid query-tab-add-query",queryGroupTopSection:"data-testid query group top section",addExpression:"data-testid query-tab-add-expression"},QueryHistory:{queryText:"Query text"},QueryEditorRows:{rows:"Query editor row"},QueryEditorRow:{actionButton:e=>`data-testid ${e}`,title:e=>`Query editor row title ${e}`,container:e=>`Query editor row ${e}`},AlertTab:{content:"data-testid Alert editor tab content"},AlertRules:{groupToggle:"data-testid group-collapse-toggle",toggle:"data-testid collapse-toggle",expandedContent:"data-testid expanded-content"},Alert:{alert:e=>`Alert ${e}`,alertV2:e=>`data-testid Alert ${e}`},TransformTab:{content:"data-testid Transform editor tab content",newTransform:e=>`data-testid New transform ${e}`,transformationEditor:e=>`data-testid Transformation editor ${e}`,transformationEditorDebugger:e=>`data-testid Transformation editor debugger ${e}`},Transforms:{card:e=>`data-testid New transform ${e}`,disableTransformationButton:"data-testid Disable transformation button",Reduce:{modeLabel:"data-testid Transform mode label",calculationsLabel:"data-testid Transform calculations label"},SpatialOperations:{actionLabel:"root Action field property editor",locationLabel:"root Location Mode field property editor",location:{autoOption:"Auto location option",coords:{option:"Coords location option",latitudeFieldLabel:"root Latitude field field property editor",longitudeFieldLabel:"root Longitude field field property editor"},geohash:{option:"Geohash location option",geohashFieldLabel:"root Geohash field field property editor"},lookup:{option:"Lookup location option",lookupFieldLabel:"root Lookup field field property editor",gazetteerFieldLabel:"root Gazetteer field property editor"}}},searchInput:"data-testid search transformations",noTransformationsMessage:"data-testid no transformations message",addTransformationButton:"data-testid add transformation button",removeAllTransformationsButton:"data-testid remove all transformations button"},NavBar:{Configuration:{button:"Configuration"},Toggle:{button:"data-testid Toggle menu"},Reporting:{button:"Reporting"}},NavMenu:{Menu:"data-testid navigation mega-menu",item:"data-testid Nav menu item"},NavToolbar:{container:"data-testid Nav toolbar",shareDashboard:"data-testid Share dashboard",markAsFavorite:"data-testid Mark as favorite",editDashboard:{editButton:"data-testid Edit dashboard button",saveButton:"data-testid Save dashboard button",exitButton:"data-testid Exit edit mode button",settingsButton:"data-testid Dashboard settings",addRowButton:"data-testid Add row button",addLibraryPanelButton:"data-testid Add a panel from the panel library button",addVisualizationButton:"data-testid Add new visualization menu item",pastePanelButton:"data-testid Paste panel button",discardChangesButton:"data-testid Discard changes button",discardLibraryPanelButton:"data-testid Discard library panel button",unlinkLibraryPanelButton:"data-testid Unlink library panel button",saveLibraryPanelButton:"data-testid Save library panel button",backToDashboardButton:"data-testid Back to dashboard button"}},PageToolbar:{container:()=>".page-toolbar",item:e=>`${e}`,itemButton:e=>`data-testid ${e}`},QueryEditorToolbarItem:{button:e=>`QueryEditor toolbar item button ${e}`},BackButton:{backArrow:"data-testid Go Back"},OptionsGroup:{group:e=>e?`Options group ${e}`:"Options group",toggle:e=>e?`Options group ${e} toggle`:"Options group toggle"},PluginVisualization:{item:e=>`Plugin visualization item ${e}`,current:()=>'[class*="-currentVisualizationItem"]'},Select:{option:"Select option",input:()=>'input[id*="time-options-input"]',singleValue:()=>'div[class*="-singleValue"]'},FieldConfigEditor:{content:"Field config editor content"},OverridesConfigEditor:{content:"Field overrides editor content"},FolderPicker:{container:"Folder picker select container",containerV2:"data-testid Folder picker select container",input:"data-testid folder-picker-input"},ReadonlyFolderPicker:{container:"data-testid Readonly folder picker select container"},DataSourcePicker:{container:"data-testid Data source picker select container",input:()=>'input[id="data-source-picker"]',inputV2:"data-testid Select a data source",dataSourceList:"data-testid Data source list dropdown",advancedModal:{dataSourceList:"data-testid Data source list",builtInDataSourceList:"data-testid Built in data source list"}},TimeZonePicker:{container:"Time zone picker select container",containerV2:"data-testid Time zone picker select container",changeTimeSettingsButton:"data-testid Time zone picker Change time settings button"},WeekStartPicker:{container:"Choose starting day of the week",containerV2:"data-testid Choose starting day of the week",placeholder:"Choose starting day of the week"},TraceViewer:{spanBar:"data-testid SpanBar--wrapper"},QueryField:{container:"data-testid Query field"},QueryBuilder:{queryPatterns:"data-testid Query patterns",labelSelect:"data-testid Select label",valueSelect:"data-testid Select value",matchOperatorSelect:"data-testid Select match operator"},ValuePicker:{button:e=>`data-testid Value picker button ${e}`,select:e=>`data-testid Value picker select ${e}`},Search:{section:"Search section",sectionV2:"data-testid Search section",items:"Search items",itemsV2:"data-testid Search items",cards:"data-testid Search cards",collapseFolder:e=>`data-testid Collapse folder ${e}`,expandFolder:e=>`data-testid Expand folder ${e}`,dashboardItem:e=>`${Kt.Search.dashboardItems} ${e}`,dashboardCard:e=>`data-testid Search card ${e}`,folderHeader:e=>`data-testid Folder header ${e}`,folderContent:e=>`data-testid Folder content ${e}`,dashboardItems:"data-testid Dashboard search item"},DashboardLinks:{container:"data-testid Dashboard link container",dropDown:"data-testid Dashboard link dropdown",link:"data-testid Dashboard link"},LoadingIndicator:{icon:"data-testid Loading indicator"},CallToActionCard:{button:e=>`Call to action button ${e}`,buttonV2:e=>`data-testid Call to action button ${e}`},DataLinksContextMenu:{singleLink:"data-testid Data link"},CodeEditor:{container:"data-testid Code editor container"},DashboardImportPage:{textarea:"data-testid-import-dashboard-textarea",submit:"data-testid-load-dashboard"},ImportDashboardForm:{name:"data-testid-import-dashboard-title",submit:"data-testid-import-dashboard-submit"},PanelAlertTabContent:{content:"data-testid Unified alert editor tab content"},VisualizationPreview:{card:e=>`data-testid suggestion-${e}`},ColorSwatch:{name:"data-testid-colorswatch"},DashboardRow:{title:e=>`data-testid dashboard-row-title-${e}`},UserProfile:{profileSaveButton:"data-testid-user-profile-save",preferencesSaveButton:"data-testid-shared-prefs-save",orgsTable:"data-testid-user-orgs-table",sessionsTable:"data-testid-user-sessions-table",extensionPointTabs:"data-testid-extension-point-tabs",extensionPointTab:e=>`data-testid-extension-point-tab-${e}`},FileUpload:{inputField:"data-testid-file-upload-input-field",fileNameSpan:"data-testid-file-upload-file-name"},DebugOverlay:{wrapper:"debug-overlay"},OrgRolePicker:{input:"Role"},AnalyticsToolbarButton:{button:"Dashboard insights"},Variables:{variableOption:"data-testid variable-option"},Annotations:{annotationsTypeInput:"annotations-type-input",annotationsChoosePanelInput:"choose-panels-input",editor:{testButton:"data-testid annotations-test-button",resultContainer:"data-testid annotations-query-result-container"}},Tooltip:{container:"data-testid tooltip"},ReturnToPrevious:{buttonGroup:"data-testid dismissable button group",backButton:"data-testid back",dismissButton:"data-testid dismiss"},SQLQueryEditor:{selectColumn:"data-testid select-column",selectAggregation:"data-testid select-aggregation",selectAlias:"data-testid select-alias",filterConjunction:"data-testid filter-conjunction",filterField:"data-testid filter-field",filterOperator:"data-testid filter-operator",headerTableSelector:"data-testid header-table-selector",headerFilterSwitch:"data-testid header-filter-switch",headerGroupSwitch:"data-testid header-group-switch",headerOrderSwitch:"data-testid header-order-switch",headerPreviewSwitch:"data-testid header-preview-switch"}},Xt={pages:{Login:{url:"/login",username:"data-testid Username input field",password:"data-testid Password input field",submit:"data-testid Login button",skip:"data-testid Skip change password button"},Home:{url:"/"},DataSource:{name:"data-testid Data source settings page name input field",delete:"Data source settings page Delete button",readOnly:"data-testid Data source settings page read only message",saveAndTest:"data-testid Data source settings page Save and Test button",alert:"data-testid Data source settings page Alert"},DataSources:{url:"/datasources",dataSources:e=>`Data source list item ${e}`},EditDataSource:{url:e=>`/datasources/edit/${e}`,settings:"Datasource settings page basic settings"},AddDataSource:{url:"/datasources/new",dataSourcePlugins:e=>`Data source plugin item ${e}`,dataSourcePluginsV2:e=>`Add new data source ${e}`},ConfirmModal:{delete:"data-testid Confirm Modal Danger Button"},AddDashboard:{url:"/dashboard/new",itemButton:e=>`data-testid ${e}`,addNewPanel:"Add new panel",addNewRow:"Add new row",addNewPanelLibrary:"Add new panel from panel library"},Dashboard:{url:e=>`/d/${e}`,DashNav:{nav:"Dashboard navigation",navV2:"data-testid Dashboard navigation",publicDashboardTag:"data-testid public dashboard tag",shareButton:"data-testid share-button",scrollContainer:"data-testid Dashboard canvas scroll container",playlistControls:{prev:"data-testid playlist previous dashboard button",stop:"data-testid playlist stop dashboard button",next:"data-testid playlist next dashboard button"}},SubMenu:{submenu:"Dashboard submenu",submenuItem:"data-testid template variable",submenuItemLabels:e=>`data-testid Dashboard template variables submenu Label ${e}`,submenuItemValueDropDownValueLinkTexts:e=>`data-testid Dashboard template variables Variable Value DropDown value link text ${e}`,submenuItemValueDropDownDropDown:"Variable options",submenuItemValueDropDownOptionTexts:e=>`data-testid Dashboard template variables Variable Value DropDown option text ${e}`,Annotations:{annotationsWrapper:"data-testid annotation-wrapper",annotationLabel:e=>`data-testid Dashboard annotations submenu Label ${e}`,annotationToggle:e=>`data-testid Dashboard annotations submenu Toggle ${e}`}},Settings:{Actions:{close:"data-testid dashboard-settings-close"},General:{deleteDashBoard:"Dashboard settings page delete dashboard button",sectionItems:e=>`Dashboard settings section item ${e}`,saveDashBoard:"Dashboard settings aside actions Save button",saveAsDashBoard:"Dashboard settings aside actions Save As button",timezone:"Time zone picker select container",title:"Tab General"},Annotations:{List:{addAnnotationCTA:Kt.CallToActionCard.button("Add annotation query"),addAnnotationCTAV2:Kt.CallToActionCard.buttonV2("Add annotation query"),annotations:"data-testid list-annotations"},Settings:{name:"Annotations settings name input"},NewAnnotation:{panelFilterSelect:"data-testid annotations-panel-filter",showInLabel:"show-in-label",previewInDashboard:"data-testid annotations-preview",delete:"data-testid annotations-delete",apply:"data-testid annotations-apply",enable:"data-testid annotation-enable",hide:"data-testid annotation-hide"}},Variables:{List:{addVariableCTA:Kt.CallToActionCard.button("Add variable"),addVariableCTAV2:Kt.CallToActionCard.buttonV2("Add variable"),newButton:"Variable editor New variable button",table:"Variable editor Table",tableRowNameFields:e=>`Variable editor Table Name field ${e}`,tableRowDefinitionFields:e=>`Variable editor Table Definition field ${e}`,tableRowArrowUpButtons:e=>`Variable editor Table ArrowUp button ${e}`,tableRowArrowDownButtons:e=>`Variable editor Table ArrowDown button ${e}`,tableRowDuplicateButtons:e=>`Variable editor Table Duplicate button ${e}`,tableRowRemoveButtons:e=>`Variable editor Table Remove button ${e}`},Edit:{General:{headerLink:"Variable editor Header link",modeLabelNew:"Variable editor Header mode New",modeLabelEdit:"Variable editor Header mode Edit",generalNameInput:"Variable editor Form Name field",generalNameInputV2:"data-testid Variable editor Form Name field",generalTypeSelect:"Variable editor Form Type select",generalTypeSelectV2:"data-testid Variable editor Form Type select",generalLabelInput:"Variable editor Form Label field",generalLabelInputV2:"data-testid Variable editor Form Label field",generalHideSelect:"Variable editor Form Hide select",generalHideSelectV2:"data-testid Variable editor Form Hide select",selectionOptionsMultiSwitch:"data-testid Variable editor Form Multi switch",selectionOptionsIncludeAllSwitch:"data-testid Variable editor Form IncludeAll switch",selectionOptionsCustomAllInput:"data-testid Variable editor Form IncludeAll field",previewOfValuesOption:"data-testid Variable editor Preview of Values option",submitButton:"data-testid Variable editor Run Query button",applyButton:"data-testid Variable editor Apply button"},QueryVariable:{queryOptionsDataSourceSelect:Kt.DataSourcePicker.inputV2,queryOptionsRefreshSelect:"Variable editor Form Query Refresh select",queryOptionsRefreshSelectV2:"data-testid Variable editor Form Query Refresh select",queryOptionsRegExInput:"Variable editor Form Query RegEx field",queryOptionsRegExInputV2:"data-testid Variable editor Form Query RegEx field",queryOptionsSortSelect:"Variable editor Form Query Sort select",queryOptionsSortSelectV2:"data-testid Variable editor Form Query Sort select",queryOptionsQueryInput:"data-testid Variable editor Form Default Variable Query Editor textarea",valueGroupsTagsEnabledSwitch:"Variable editor Form Query UseTags switch",valueGroupsTagsTagsQueryInput:"Variable editor Form Query TagsQuery field",valueGroupsTagsTagsValuesQueryInput:"Variable editor Form Query TagsValuesQuery field"},ConstantVariable:{constantOptionsQueryInput:"Variable editor Form Constant Query field",constantOptionsQueryInputV2:"data-testid Variable editor Form Constant Query field"},DatasourceVariable:{datasourceSelect:"data-testid datasource variable datasource type"},TextBoxVariable:{textBoxOptionsQueryInput:"Variable editor Form TextBox Query field",textBoxOptionsQueryInputV2:"data-testid Variable editor Form TextBox Query field"},CustomVariable:{customValueInput:"data-testid custom-variable-input"},IntervalVariable:{intervalsValueInput:"data-testid interval variable intervals input",autoEnabledCheckbox:"data-testid interval variable auto value checkbox",stepCountIntervalSelect:"data-testid interval variable step count input",minIntervalInput:"data-testid interval variable mininum interval input"},GroupByVariable:{dataSourceSelect:Kt.DataSourcePicker.inputV2,infoText:"data-testid group by variable info text",modeToggle:"data-testid group by variable mode toggle"},AdHocFiltersVariable:{datasourceSelect:Kt.DataSourcePicker.inputV2,infoText:"data-testid ad-hoc filters variable info text",modeToggle:"data-testid ad-hoc filters variable mode toggle"}}}},Annotations:{marker:"data-testid annotation-marker"},Rows:{Repeated:{ConfigSection:{warningMessage:"data-testid Repeated rows warning message"}}}},Dashboards:{url:"/dashboards",dashboards:e=>`Dashboard search item ${e}`},SaveDashboardAsModal:{newName:"Save dashboard title field",save:"Save dashboard button"},SaveDashboardModal:{save:"Dashboard settings Save Dashboard Modal Save button",saveVariables:"Dashboard settings Save Dashboard Modal Save variables checkbox",saveTimerange:"Dashboard settings Save Dashboard Modal Save timerange checkbox",saveRefresh:"Dashboard settings Save Dashboard Modal Save refresh checkbox"},SharePanelModal:{linkToRenderedImage:"Link to rendered image"},ShareDashboardModal:{PublicDashboard:{Tab:"Tab Public dashboard",WillBePublicCheckbox:"data-testid public dashboard will be public checkbox",LimitedDSCheckbox:"data-testid public dashboard limited datasources checkbox",CostIncreaseCheckbox:"data-testid public dashboard cost may increase checkbox",PauseSwitch:"data-testid public dashboard pause switch",EnableAnnotationsSwitch:"data-testid public dashboard on off switch for annotations",CreateButton:"data-testid public dashboard create button",DeleteButton:"data-testid public dashboard delete button",CopyUrlInput:"data-testid public dashboard copy url input",CopyUrlButton:"data-testid public dashboard copy url button",SettingsDropdown:"data-testid public dashboard settings dropdown",TemplateVariablesWarningAlert:"data-testid public dashboard disabled template variables alert",UnsupportedDataSourcesWarningAlert:"data-testid public dashboard unsupported data sources alert",NoUpsertPermissionsWarningAlert:"data-testid public dashboard no upsert permissions alert",EnableTimeRangeSwitch:"data-testid public dashboard on off switch for time range",EmailSharingConfiguration:{Container:"data-testid email sharing config container",ShareType:"data-testid public dashboard share type",EmailSharingInput:"data-testid public dashboard email sharing input",EmailSharingInviteButton:"data-testid public dashboard email sharing invite button",EmailSharingList:"data-testid public dashboard email sharing list",DeleteEmail:"data-testid public dashboard delete email button",ReshareLink:"data-testid public dashboard reshare link button"}},PublicDashboardScene:{Tab:"Tab Public Dashboard"}},PublicDashboard:{page:"public-dashboard-page",NotAvailable:{container:"public-dashboard-not-available",title:"public-dashboard-title",pausedDescription:"public-dashboard-paused-description"},footer:"public-dashboard-footer"},PublicDashboardScene:{loadingPage:"public-dashboard-scene-loading-page",page:"public-dashboard-scene-page",controls:"public-dashboard-controls"},RequestViewAccess:{form:"request-view-access-form",recipientInput:"request-view-access-recipient-input",submitButton:"request-view-access-submit-button"},PublicDashboardConfirmAccess:{submitButton:"data-testid confirm-access-submit-button"},Explore:{url:"/explore",General:{container:"data-testid Explore",graph:"Explore Graph",table:"Explore Table",scrollView:"data-testid explorer scroll view"}},SoloPanel:{url:e=>`/d-solo/${e}`},PluginsList:{page:"Plugins list page",list:"Plugins list",listItem:"Plugins list item",signatureErrorNotice:"data-testid Unsigned plugins notice"},PluginPage:{page:"Plugin page",signatureInfo:"data-testid Plugin signature info",disabledInfo:"data-testid Plugin disabled info"},PlaylistForm:{name:"Playlist name",interval:"Playlist interval",itemDelete:"data-testid playlist-form-delete-item"},BrowseDashboards:{table:{body:"data-testid browse-dashboards-table",row:e=>`data-testid browse dashboards row ${e}`,checkbox:e=>`data-testid ${e} checkbox`},NewFolderForm:{form:"data-testid new folder form",nameInput:"data-testid new-folder-name-input",createButton:"data-testid new-folder-create-button"}},Search:{url:"/?search=openn",FolderView:{url:"/?search=open&layout=folders"}},PublicDashboards:{ListItem:{linkButton:"public-dashboard-link-button",configButton:"public-dashboard-configuration-button",trashcanButton:"public-dashboard-remove-button",pauseSwitch:"data-testid public dashboard pause switch"}},UserListPage:{tabs:{allUsers:"data-testid all-users-tab",orgUsers:"data-testid org-users-tab",anonUserDevices:"data-testid anon-user-devices-tab",publicDashboardsUsers:"data-testid public-dashboards-users-tab",users:"data-testid users-tab"},org:{url:"/org/users"},admin:{url:"/admin/users"},publicDashboards:{container:"data-testid public-dashboards-users-list"},UserListAdminPage:{container:"data-testid user-list-admin-page"},UsersListPage:{container:"data-testid users-list-page"},UserAnonListPage:{container:"data-testid user-anon-list-page"},UsersListPublicDashboardsPage:{container:"data-testid users-list-public-dashboards-page",DashboardsListModal:{listItem:e=>`data-testid dashboards-list-item-${e}`}}},ProfilePage:{url:"/profile"}},components:Kt};var Zt=n(6089),Jt=n(7928);function en(e,t){const n=new Jt.A;let r=e;const a=[],o=1e4;return t&&(r=[{value:Ze,label:Xe},...r]),e=>{if(""===e)return r.length>o?r.slice(0,o):r;if(0===a.length)for(let e=0;e<r.length;e++)a.push(r[e].label);const t=n.filter(a,e),i=[];if(t){for(let e=0;e<t.length;e++)if(i.push(r[t[e]]),i.length>o)return i;return i}return r.length>o?r.slice(0,o):r}}var tn=Object.defineProperty,nn=Object.defineProperties,rn=Object.getOwnPropertyDescriptors,an=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,ln=(e,t,n)=>t in e?tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const cn=()=>!0,un=e=>"$__all"!==e.value,dn=(e,t)=>e.length===t.filter(un).length?Yt.ToggleAllState.allSelected:0===e.length||1===e.length&&e[0]&&"$__all"===e[0].value?Yt.ToggleAllState.noneSelected:Yt.ToggleAllState.indeterminate;function pn({model:e}){const{value:t,text:n,key:r,options:o,includeAll:s,isReadOnly:l}=e.useState(),[c,u]=(0,a.useState)(""),[d,p]=(0,a.useState)(!1),f=function(e,t){return{value:e,label:null!=t?t:String(e)}}(t,String(n)),h=(0,a.useMemo)((()=>en(o,s)),[o,s])(c);return i().createElement(Yt.Select,{id:r,isValidNewOption:e=>e.trim().length>0,placeholder:"Select value",width:"auto",disabled:l,value:f,inputValue:c,allowCustomValue:!0,virtualized:!0,filterOption:cn,tabSelectsValue:!1,onInputChange:(t,{action:n})=>"input-change"===n?(u(t),e.onSearchChange&&e.onSearchChange(t),t):t,onOpenMenu:()=>{d&&u(String(n))},onCloseMenu:()=>{u("")},options:h,"data-testid":Xt.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${t}`),onChange:t=>{e.changeValueTo(t.value,t.label),d!==t.__isNew__&&p(t.__isNew__)}})}function fn({model:e}){const{value:t,options:n,key:r,maxVisibleValues:o,noValueOnClear:s,includeAll:l,isReadOnly:c}=e.useState(),u=(0,a.useMemo)((()=>(0,pe.isArray)(t)?t:[t]),[t]),[d,p]=(0,a.useState)(u),[f,h]=(0,a.useState)(""),g=(0,a.useMemo)((()=>en(n,l)),[n,l]);(0,a.useEffect)((()=>{p(u)}),[u]);const m=n.length>0?"Select value":"",b=g(f);return i().createElement(Yt.MultiSelect,{id:r,placeholder:m,width:"auto",inputValue:f,disabled:c,value:d,noMultiValueWrap:!0,maxVisibleValues:null!=o?o:5,tabSelectsValue:!1,virtualized:!0,allowCustomValue:!0,toggleAllOptions:{enabled:!0,optionsFilter:un,determineToggleAllState:dn},options:b,closeMenuOnSelect:!1,components:{Option:hn},isClearable:!0,hideSelectedOptions:!1,onInputChange:(t,{action:n})=>"input-change"===n?(h(t),e.onSearchChange&&e.onSearchChange(t),t):"input-blur"===n?(h(""),""):f,onBlur:()=>{e.changeValueTo(d)},filterOption:cn,"data-testid":Xt.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${d}`),onChange:(t,n)=>{"clear"===n.action&&s&&e.changeValueTo([]),p(t.map((e=>e.value)))}})}const hn=({children:e,data:t,innerProps:n,innerRef:r,isFocused:a,isSelected:o,indeterminate:s,renderOptionLabel:l})=>{var c;const u=((e,t)=>{var n={};for(var r in e)on.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&an)for(var r of an(e))t.indexOf(r)<0&&sn.call(e,r)&&(n[r]=e[r]);return n})(n,["onMouseMove","onMouseOver"]),d=(0,Yt.useTheme2)(),p=(0,Yt.getSelectStyles)(d),f=(0,Yt.useStyles2)(gn);return i().createElement("div",(h=((e,t)=>{for(var n in t||(t={}))on.call(t,n)&&ln(e,n,t[n]);if(an)for(var n of an(t))sn.call(t,n)&&ln(e,n,t[n]);return e})({ref:r,className:(0,Zt.cx)(p.option,a&&p.optionFocused)},u),g={"data-testid":"data-testid Select option",title:t.title},nn(h,rn(g))),i().createElement("div",{className:f.checkbox},i().createElement(Yt.Checkbox,{indeterminate:s,value:o})),i().createElement("div",{className:p.optionBody,"data-testid":Xt.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(null!=(c=t.label)?c:String(t.value))},i().createElement("span",null,e)));var h,g};hn.displayName="SelectMenuOptions";const gn=e=>({checkbox:(0,Zt.css)({marginRight:e.spacing(2)})});function mn(e){return e.state.isMulti?i().createElement(fn,{model:e}):i().createElement(pn,{model:e})}class bn{constructor(e){this._sceneObject=e}getKey(){return`var-${this._sceneObject.state.name}`}getKeys(){return this._sceneObject.state.skipUrlSync?[]:[this.getKey()]}getUrlState(){return this._sceneObject.state.skipUrlSync?{}:{[this.getKey()]:(e=this._sceneObject.state.value,t=this._sceneObject.state.text,e=Array.isArray(e)?e:[e],t=Array.isArray(t)?t:[t],e.map(((e,n)=>{if(null==e)return"";e=String(e);let r=t[n];return r=null==r?e:String(r),zs(e,r)})))};var e,t}updateFromUrl(e){let t=e[this.getKey()];if(null!=t){this._sceneObject.isActive||(this._sceneObject.skipNextValidation=!0);const{values:e,texts:r}=(n=t,(n=Array.isArray(n)?n:[n]).reduce(((e,t)=>{const[n,r]=(null!=t?t:"").split(",");return e.values.push(Fs(n)),e.texts.push(Fs(null!=r?r:n)),e}),{values:[],texts:[]}));this._sceneObject.changeValueTo(e,r)}var n}}function yn(e){const t=e.getRoot();return"enrichFiltersRequest"in t?t.enrichFiltersRequest(e):null}var vn,wn=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};class xn{constructor(e){((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,vn),this.text="__sceneObject",this.valueOf=()=>{return wn(this,e=vn,"read from private field"),e.get(this);var e},((e,t,n,r)=>{wn(e,t,"write to private field"),t.set(e,n)})(this,vn,e)}toString(){}get value(){return this}}function Sn(e){return function(e){const t=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(!t)return!1;const n=parseInt(t[1],10),r=parseInt(t[2],10),a=parseInt(t[3],10);return 11===n?0===r&&a>=4||1===r&&a>=2||r>1:10===n?4===r&&a>=8||r>=5:n>11}(c.config.buildInfo.version)?new xn(e):{value:e,text:"__sceneObject"}}vn=new WeakMap;var On=Object.defineProperty,Dn=Object.defineProperties,Cn=Object.getOwnPropertyDescriptors,En=Object.getOwnPropertySymbols,_n=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable,Rn=(e,t,n)=>t in e?On(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,In=(e,t)=>{for(var n in t||(t={}))_n.call(t,n)&&Rn(e,n,t[n]);if(En)for(var n of En(t))Pn.call(t,n)&&Rn(e,n,t[n]);return e};class Tn extends Gt{constructor(e){var t;super((t=In({isMulti:!0,name:"",value:[],text:[],options:[],datasource:null,baseFilters:[],applyMode:"auto",layout:"horizontal",type:"groupby"},e),Dn(t,Cn({noValueOnClear:!0})))),this.isLazy=!0,this._urlSync=new bn(this),this._getKeys=async e=>{var t,n,r;const a=await(null==(n=(t=this.state).getTagKeysProvider)?void 0:n.call(t,this,null));if(a&&a.replace)return a.values;if(this.state.defaultOptions)return this.state.defaultOptions.concat(Ws(null!=(r=null==a?void 0:a.values)?r:[]));if(!e.getTagKeys)return[];const o=Ns(this),i=this.state.baseFilters||[],s=wl.getTimeRange(this).state.value,l=await e.getTagKeys(In({filters:i,queries:o,timeRange:s},yn(this)));Us(l)&&this.setState({error:l.error.message});let c=Ws(l);a&&(c=c.concat(Ws(a.values)));const u=this.state.tagKeyRegexFilter;return u&&(c=c.filter((e=>e.text.match(u)))),c},this.addActivationHandler((()=>(Ht.add(this),()=>Ht.delete(this))))}validateAndUpdate(){return this.getValueOptions({}).pipe((0,E.map)((e=>(this._updateValueGivenNewOptions(e),{}))))}_updateValueGivenNewOptions(e){const{value:t,text:n}=this.state,r={options:e,loading:!1,value:null!=t?t:[],text:null!=n?n:[]};this.setState(r)}getValueOptions(e){return this.state.defaultOptions?(0,E.of)(this.state.defaultOptions.map((e=>({label:e.text,value:String(e.value),group:e.group})))):(this.setState({loading:!0,error:null}),(0,E.from)(wt(this.state.datasource,{__sceneObject:Sn(this)})).pipe((0,E.mergeMap)((e=>(0,E.from)(this._getKeys(e)).pipe((0,E.tap)((e=>{Us(e)&&this.setState({error:e.error.message})})),(0,E.map)((e=>Ws(e))),(0,E.take)(1),(0,E.mergeMap)((e=>{const t=e.map((e=>({label:e.text,value:e.value?String(e.value):e.text,group:e.group})));return(0,E.of)(t)})))))))}getDefaultMultiState(e){return{value:[],text:[]}}}Tn.Component=function({model:e}){const{value:t,text:n,key:r,maxVisibleValues:o,noValueOnClear:s,options:l,includeAll:c}=e.useState(),u=(0,a.useMemo)((()=>{const e=(0,pe.isArray)(t)?t:[t],r=(0,pe.isArray)(n)?n:[n];return e.map(((e,t)=>{var n;return{value:e,label:String(null!=(n=r[t])?n:e)}}))}),[t,n]),[d,p]=(0,a.useState)(!1),[f,h]=(0,a.useState)(!1),[g,m]=(0,a.useState)(""),[b,y]=(0,a.useState)(u),v=(0,a.useMemo)((()=>en(l,c)),[l,c]);(0,a.useEffect)((()=>{y(u)}),[u]);const w=(0,a.useMemo)((()=>Hs(v(g).map(An))),[v,g]);return i().createElement(Yt.MultiSelect,{"data-testid":`GroupBySelect-${r}`,id:r,placeholder:"Select value",width:"auto",inputValue:g,value:b,noMultiValueWrap:!0,maxVisibleValues:null!=o?o:5,tabSelectsValue:!1,virtualized:!0,options:w,filterOption:kn,closeMenuOnSelect:!1,isOpen:f,isClearable:!0,hideSelectedOptions:!1,isLoading:d,components:{Option:hn},onInputChange:(t,{action:n})=>"input-change"===n?(m(t),e.onSearchChange&&e.onSearchChange(t),t):"input-blur"===n?(m(""),""):g,onBlur:()=>{e.changeValueTo(b.map((e=>e.value)),b.map((e=>e.label)))},onChange:(t,n)=>{"clear"===n.action&&s&&e.changeValueTo([]),y(t)},onOpenMenu:async()=>{p(!0),await(0,E.lastValueFrom)(e.validateAndUpdate()),p(!1),h(!0)},onCloseMenu:()=>{h(!1)}})};const kn=()=>!0;function An(e){const{label:t,value:n,group:r}=e,a={label:t,value:n};return r&&(a.group=r),a}function jn(e){return i().createElement(Yt.Tooltip,{content:"Cancel query"},i().createElement(Yt.Icon,{className:"spin-clockwise",name:"sync",size:"xs",role:"button",onMouseDown:t=>{e.onCancel(t)}}))}function Mn(e){const t=(0,Yt.useStyles2)(Ln),n=(0,Yt.useTheme2)(),r="vertical"===e.layout,a=Boolean(e.isLoading)?i().createElement("div",{style:{marginLeft:n.spacing(1),marginTop:"-1px"},"aria-label":Xt.components.LoadingIndicator.icon},i().createElement(jn,{onCancel:t=>{var n;t.preventDefault(),t.stopPropagation(),null==(n=e.onCancel)||n.call(e)}})):null;let o=null;e.error&&(o=i().createElement(Yt.Tooltip,{content:e.error,placement:"bottom"},i().createElement(Yt.Icon,{className:t.errorIcon,name:"exclamation-triangle"})));let s=null;e.description&&(s=i().createElement(Yt.Tooltip,{content:e.description,placement:r?"top":"bottom"},i().createElement(Yt.Icon,{className:t.normalIcon,name:"info-circle"})));const l="string"==typeof e.label?Xt.pages.Dashboard.SubMenu.submenuItemLabels(e.label):"";let c;return c=r?i().createElement("label",{className:t.verticalLabel,"data-testid":l,htmlFor:e.htmlFor},e.label,s,o,e.icon&&i().createElement(Yt.Icon,{name:e.icon,className:t.normalIcon}),a,e.onRemove&&i().createElement(Yt.IconButton,{variant:"secondary",size:"xs",name:"times",onClick:e.onRemove,tooltip:"Remove"})):i().createElement("label",{className:t.horizontalLabel,"data-testid":l,htmlFor:e.htmlFor},o,e.icon&&i().createElement(Yt.Icon,{name:e.icon,className:t.normalIcon}),e.label,s,a),c}const Ln=e=>({horizontalLabel:(0,Zt.css)({background:e.isDark?e.colors.background.primary:e.colors.background.secondary,display:"flex",alignItems:"center",padding:e.spacing(0,1),fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.bodySmall.fontSize,height:e.spacing(e.components.height.md),lineHeight:e.spacing(e.components.height.md),borderRadius:e.shape.borderRadius(1),border:`1px solid ${e.components.input.borderColor}`,position:"relative",right:-1,whiteSpace:"nowrap",gap:e.spacing(.5)}),verticalLabel:(0,Zt.css)({display:"flex",alignItems:"center",fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.bodySmall.fontSize,lineHeight:e.typography.bodySmall.lineHeight,whiteSpace:"nowrap",marginBottom:e.spacing(.5),gap:e.spacing(1)}),errorIcon:(0,Zt.css)({color:e.colors.error.text}),normalIcon:(0,Zt.css)({color:e.colors.text.secondary})});var Nn=Object.defineProperty,Bn=Object.getOwnPropertySymbols,Vn=Object.prototype.hasOwnProperty,Fn=Object.prototype.propertyIsEnumerable,zn=(e,t,n)=>t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wn=(e,t)=>{for(var n in t||(t={}))Vn.call(t,n)&&zn(e,n,t[n]);if(Bn)for(var n of Bn(t))Fn.call(t,n)&&zn(e,n,t[n]);return e};function Un(e,t){return""!==e?{value:e,label:t||e}:null}const Hn=()=>!0;function $n({filter:e,model:t}){var n,r,o;const s=(0,Yt.useStyles2)(Gn),[l,c]=(0,a.useState)([]),[u,d]=(0,a.useState)([]),[p,f]=(0,a.useState)(!1),[h,g]=(0,a.useState)(!1),[m,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),[w,x]=(0,a.useState)(!1),[S,O]=(0,a.useState)(""),[D,C]=(0,a.useState)(!1),[E,_]=(0,a.useState)(e.values?e.values.map(((t,n)=>{var r;return Un(t,null==(r=e.valueLabels)?void 0:r[n])})):[]),P=gs(e.operator),R=Un(e.key,e.keyLabel),I=Un(e.value,null==(n=e.valueLabels)?void 0:n[0]),T=(0,a.useMemo)((()=>function(e){const t=new Jt.A,n=[],r=1e4;return a=>{var o;if(""===a)return e.length>r?e.slice(0,r):e;if(0===n.length)for(let t=0;t<e.length;t++)n.push(null!=(o=e[t].label)?o:String(e[t].value));const i=t.filter(n,a),s=[];if(i){for(let t=0;t<i.length;t++)if(s.push(e[i[t]]),s.length>r)return s;return s}return e.length>r?e.slice(0,r):e}}(u)),[u]),k=(0,a.useMemo)((()=>Hs(T(S))),[T,S]),A={isMulti:!0,value:E,components:{Option:hn},hideSelectedOptions:!1,closeMenuOnSelect:!1,openMenuOnFocus:!1,onChange:e=>{_(e),e.some((e=>e.__isNew__))&&O("")},onBlur:()=>{var n,r;t._updateFilter(e,{value:null!=(r=null==(n=E[0])?void 0:n.value)?r:"",values:E.map((e=>e.value)),valueLabels:E.map((e=>e.label))})}},j=i().createElement(Yt.Select,Wn({virtualized:!0,allowCustomValue:!0,isValidNewOption:e=>e.trim().length>0,allowCreateWhileLoading:!0,formatCreateLabel:e=>`Use custom value: ${e}`,disabled:t.state.readOnly,className:(0,Zt.cx)(s.value,y?s.widthWhenOpen:void 0),width:"auto",value:I,filterOption:Hn,placeholder:"Select value",options:k,inputValue:S,onInputChange:(e,{action:t})=>("input-change"===t&&O(e),e),onChange:n=>{t._updateFilter(e,{value:n.value,valueLabels:n.label?[n.label]:[n.value]}),D!==n.__isNew__&&C(n.__isNew__)},isOpen:y&&!h,isLoading:h,openMenuOnFocus:!0,onOpenMenu:async()=>{var n;g(!0),v(!0);const r=await t._getValuesFor(e);g(!1),d(r),D&&O(null!=(n=null==I?void 0:I.label)?n:"")},onCloseMenu:()=>{v(!1),O("")}},P&&A)),M=i().createElement(Yt.Select,{key:h?"loading":"loaded",disabled:t.state.readOnly,className:(0,Zt.cx)(s.key,m?s.widthWhenOpen:void 0),width:"auto",allowCustomValue:!0,value:R,placeholder:"Select label",options:Hs(l),onChange:n=>{t._updateFilter(e,{key:n.value,keyLabel:n.label,value:"",valueLabels:[""],values:void 0}),_([])},autoFocus:""===e.key,isOpen:m&&!p,isLoading:p,onOpenMenu:async()=>{b(!0),f(!0);const n=await t._getKeys(e.key);f(!1),c(n)},onCloseMenu:()=>{b(!1)},onBlur:()=>{""===e.key&&t._removeFilter(e)},openMenuOnFocus:!0}),L=i().createElement(Yt.Select,{className:(0,Zt.cx)(s.operator,{[s.widthWhenOpen]:w}),value:e.operator,disabled:t.state.readOnly,options:t._getOperators(),onChange:n=>{var r,a;const o=e.operator,i=n.value,s={operator:i};gs(o)&&!gs(i)?(s.value="",s.valueLabels=[""],s.values=void 0,_([])):!gs(o)&&gs(i)&&e.value&&(s.values=[e.value],_([{value:e.value,label:null!=(a=null==(r=e.valueLabels)?void 0:r[0])?a:e.value}])),t._updateFilter(e,s)},onOpenMenu:()=>{x(!0)},onCloseMenu:()=>{x(!1)}});if("vertical"===t.state.layout){if(e.key){const n=i().createElement(Mn,{layout:"vertical",label:null!=(r=e.key)?r:"",onRemove:()=>t._removeFilter(e)});return i().createElement(Yt.Field,{label:n,"data-testid":`AdHocFilter-${e.key}`,className:s.field},i().createElement("div",{className:s.wrapper},L,j))}return i().createElement(Yt.Field,{label:"Select label","data-testid":`AdHocFilter-${e.key}`,className:s.field},M)}return i().createElement("div",{className:s.wrapper,"data-testid":`AdHocFilter-${e.key}`},M,L,j,i().createElement(Yt.Button,{variant:"secondary","aria-label":"Remove filter",title:"Remove filter",className:s.removeButton,icon:"times","data-testid":`AdHocFilter-remove-${null!=(o=e.key)?o:""}`,onClick:()=>t._removeFilter(e)}))}const Gn=e=>({field:(0,Zt.css)({marginBottom:0}),wrapper:(0,Zt.css)({display:"flex","> *":{"&:not(:first-child)":{marginLeft:-1},"&:first-child":{borderTopRightRadius:0,borderBottomRightRadius:0},"&:last-child":{borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:first-child):not(:last-child)":{borderRadius:0},position:"relative",zIndex:0,"&:hover":{zIndex:1},"&:focus-within":{zIndex:2}}}),widthWhenOpen:(0,Zt.css)({minWidth:e.spacing(16)}),value:(0,Zt.css)({flexBasis:"content",flexShrink:1,minWidth:"90px"}),key:(0,Zt.css)({flexBasis:"content",minWidth:"90px",flexShrink:1}),operator:(0,Zt.css)({flexShrink:0,flexBasis:"content"}),removeButton:(0,Zt.css)({paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),borderLeft:"none",width:e.spacing(3),marginRight:e.spacing(1),boxSizing:"border-box",position:"relative",left:"1px"})});function qn({model:e,addFilterButtonText:t}){const{_wip:n}=e.useState();return n?i().createElement($n,{filter:n,model:e}):i().createElement(Yt.Button,{variant:"secondary",icon:"plus",title:"Add filter","aria-label":"Add filter","data-testid":"AdHocFilter-add",onClick:()=>e._addWip()},t)}class Qn{constructor(e){this._variable=e}getKey(){return`var-${this._variable.state.name}`}getKeys(){return[this.getKey()]}getUrlState(){const e=this._variable.state.filters;if(0===e.length)return{[this.getKey()]:[""]};const t=e.filter(hs).map((e=>function(e){var t;const n=[zs(e.key,e.keyLabel),e.operator];return gs(e.operator)?e.values.forEach(((t,r)=>{var a;n.push(zs(t,null==(a=e.valueLabels)?void 0:a[r]))})):n.push(zs(e.value,null==(t=e.valueLabels)?void 0:t[0])),n}(e).map(Bs).join("|")));return{[this.getKey()]:t}}updateFromUrl(e){const t=e[this.getKey()];if(null==t)return;const n=function(e){if(Array.isArray(e))return e.map(Yn).filter(Kn);const t=Yn(e);return null===t?[]:[t]}(t);this._variable.setState({filters:n})}}function Yn(e){if("string"!=typeof e||0===e.length)return null;const[t,n,r,a,...o]=e.split("|").reduce(((e,t)=>{const[n,r]=t.split(",");return e.push(n,null!=r?r:n),e}),[]).map(Fs);return{key:t,keyLabel:n,operator:r,value:o[0],values:gs(r)?o.filter(((e,t)=>t%2==0)):void 0,valueLabels:o.filter(((e,t)=>t%2==1)),condition:""}}function Kn(e){return null!==e&&"string"==typeof e.key&&"string"==typeof e.value}function Xn(e){return er(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Jn(e){var t;return null==(t=(er(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function er(e){return e instanceof Node||e instanceof Zn(e).Node}function tr(e){return e instanceof Element||e instanceof Zn(e).Element}function nr(e){return e instanceof HTMLElement||e instanceof Zn(e).HTMLElement}function rr(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot)}function ar(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=cr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function or(e){return["table","td","th"].includes(Xn(e))}function ir(e){const t=sr(),n=cr(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function sr(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function lr(e){return["html","body","#document"].includes(Xn(e))}function cr(e){return Zn(e).getComputedStyle(e)}function ur(e){return tr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dr(e){if("html"===Xn(e))return e;const t=e.assignedSlot||e.parentNode||rr(e)&&e.host||Jn(e);return rr(t)?t.host:t}function pr(e){const t=dr(e);return lr(t)?e.ownerDocument?e.ownerDocument.body:e.body:nr(t)&&ar(t)?t:pr(t)}function fr(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const a=pr(e),o=a===(null==(r=e.ownerDocument)?void 0:r.body),i=Zn(a);return o?t.concat(i,i.visualViewport||[],ar(a)?a:[],i.frameElement&&n?fr(i.frameElement):[]):t.concat(a,fr(a,[],n))}function hr(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function gr(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&rr(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function mr(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function br(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function yr(e){return!(0!==e.mozInputSource||!e.isTrusted)||(xr()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function vr(e){return!br().includes("jsdom/")&&(!xr()&&0===e.width&&0===e.height||xr()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function wr(){return/apple/i.test(navigator.vendor)}function xr(){const e=/android/i;return e.test(mr())||e.test(br())}function Sr(e){return(null==e?void 0:e.ownerDocument)||document}function Or(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Dr(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Cr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Er(e){e.preventDefault(),e.stopPropagation()}function _r(e){return!!e&&"combobox"===e.getAttribute("role")&&function(e){return nr(e)&&e.matches(Cr)}(e)}const Pr=Math.min,Rr=Math.max,Ir=Math.round,Tr=Math.floor,kr=e=>({x:e,y:e}),Ar={left:"right",right:"left",bottom:"top",top:"bottom"},jr={start:"end",end:"start"};function Mr(e,t){return"function"==typeof e?e(t):e}function Lr(e){return e.split("-")[0]}function Nr(e){return e.split("-")[1]}function Br(e){return"y"===e?"height":"width"}function Vr(e){return["top","bottom"].includes(Lr(e))?"y":"x"}function Fr(e){return"x"===Vr(e)?"y":"x"}function zr(e){return e.replace(/start|end/g,(e=>jr[e]))}function Wr(e){return e.replace(/left|right|bottom|top/g,(e=>Ar[e]))}function Ur(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Hr(e,t,n){let{reference:r,floating:a}=e;const o=Vr(t),i=Fr(t),s=Br(i),l=Lr(t),c="y"===o,u=r.x+r.width/2-a.width/2,d=r.y+r.height/2-a.height/2,p=r[s]/2-a[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-a.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-a.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Nr(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1)}return f}async function $r(e,t){var n;void 0===t&&(t={});const{x:r,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Mr(t,e),h=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(f),g=s[p?"floating"===d?"reference":"floating":d],m=Ur(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(g)))||n?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),b="floating"===d?{...i.floating,x:r,y:a}:i.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),v=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},w=Ur(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:y,strategy:l}):b);return{top:(m.top-w.top+h.top)/v.y,bottom:(w.bottom-m.bottom+h.bottom)/v.y,left:(m.left-w.left+h.left)/v.x,right:(w.right-m.right+h.right)/v.x}}function Gr(e){const t=cr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=nr(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,s=Ir(n)!==o||Ir(r)!==i;return s&&(n=o,r=i),{width:n,height:r,$:s}}function qr(e){return tr(e)?e:e.contextElement}function Qr(e){const t=qr(e);if(!nr(t))return kr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=Gr(t);let i=(o?Ir(n.width):n.width)/r,s=(o?Ir(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const Yr=kr(0);function Kr(e){const t=Zn(e);return sr()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Yr}function Xr(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),o=qr(e);let i=kr(1);t&&(r?tr(r)&&(i=Qr(r)):i=Qr(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Zn(e))&&t}(o,n,r)?Kr(o):kr(0);let l=(a.left+s.x)/i.x,c=(a.top+s.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(o){const e=Zn(o),t=r&&tr(r)?Zn(r):r;let n=e,a=n.frameElement;for(;a&&r&&t!==n;){const e=Qr(a),t=a.getBoundingClientRect(),r=cr(a),o=t.left+(a.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,n=Zn(a),a=n.frameElement}}return Ur({width:u,height:d,x:l,y:c})}const Zr=[":popover-open",":modal"];function Jr(e){return Zr.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function ea(e){return Xr(Jn(e)).left+ur(e).scrollLeft}function ta(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Zn(e),r=Jn(e),a=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=sr();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:o,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Jn(e),n=ur(e),r=e.ownerDocument.body,a=Rr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Rr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ea(e);const s=-n.scrollTop;return"rtl"===cr(r).direction&&(i+=Rr(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:s}}(Jn(e));else if(tr(t))r=function(e,t){const n=Xr(e,!0,"fixed"===t),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=nr(e)?Qr(e):kr(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:r*o.y}}(t,n);else{const n=Kr(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Ur(r)}function na(e,t){const n=dr(e);return!(n===t||!tr(n)||lr(n))&&("fixed"===cr(n).position||na(n,t))}function ra(e,t,n){const r=nr(t),a=Jn(t),o="fixed"===n,i=Xr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=kr(0);if(r||!r&&!o)if(("body"!==Xn(t)||ar(a))&&(s=ur(t)),r){const e=Xr(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&(l.x=ea(a));return{x:i.left+s.scrollLeft-l.x,y:i.top+s.scrollTop-l.y,width:i.width,height:i.height}}function aa(e){return"static"===cr(e).position}function oa(e,t){return nr(e)&&"fixed"!==cr(e).position?t?t(e):e.offsetParent:null}function ia(e,t){const n=Zn(e);if(Jr(e))return n;if(!nr(e)){let t=dr(e);for(;t&&!lr(t);){if(tr(t)&&!aa(t))return t;t=dr(t)}return n}let r=oa(e,t);for(;r&&or(r)&&aa(r);)r=oa(r,t);return r&&lr(r)&&aa(r)&&!ir(r)?n:r||function(e){let t=dr(e);for(;nr(t)&&!lr(t);){if(ir(t))return t;t=dr(t)}return null}(e)||n}const sa={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o="fixed"===a,i=Jn(r),s=!!t&&Jr(t.floating);if(r===i||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=kr(1);const u=kr(0),d=nr(r);if((d||!d&&!o)&&(("body"!==Xn(r)||ar(i))&&(l=ur(r)),nr(r))){const e=Xr(r);c=Qr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:Jn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[..."clippingAncestors"===n?Jr(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=fr(e,[],!1).filter((e=>tr(e)&&"body"!==Xn(e))),a=null;const o="fixed"===cr(e).position;let i=o?dr(e):e;for(;tr(i)&&!lr(i);){const t=cr(i),n=ir(i);n||"fixed"!==t.position||(a=null),(o?!n&&!a:!n&&"static"===t.position&&a&&["absolute","fixed"].includes(a.position)||ar(i)&&!n&&na(e,i))?r=r.filter((e=>e!==i)):a=t,i=dr(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=o[0],s=o.reduce(((e,n)=>{const r=ta(t,n,a);return e.top=Rr(r.top,e.top),e.right=Pr(r.right,e.right),e.bottom=Pr(r.bottom,e.bottom),e.left=Rr(r.left,e.left),e}),ta(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:ia,getElementRects:async function(e){const t=this.getOffsetParent||ia,n=this.getDimensions,r=await n(e.floating);return{reference:ra(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Gr(e);return{width:t,height:n}},getScale:Qr,isElement:tr,isRTL:function(e){return"rtl"===cr(e).direction}};function la(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=qr(e),u=a||o?[...c?fr(c):[],...fr(t)]:[];u.forEach((e=>{a&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const a=Jn(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const f={rootMargin:-Tr(u)+"px "+-Tr(a.clientWidth-(c+d))+"px "+-Tr(a.clientHeight-(u+p))+"px "+-Tr(c)+"px",threshold:Rr(0,Pr(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return i();t?i(!1,t):n=setTimeout((()=>{i(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(g,{...f,root:a.ownerDocument})}catch(e){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),o}(c,n):null;let p,f=-1,h=null;i&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let g=l?Xr(e):null;return l&&function t(){const r=Xr(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n(),g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const ca=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:a}=e,o=await(null==r.isRTL?void 0:r.isRTL(a.floating)),i=Lr(n),s=Nr(n),l="y"===Vr(n),c=["left","top"].includes(i)?-1:1,u=o&&l?-1:1,d=Mr(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}},ua=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=Mr(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const b=Lr(a),y=Lr(s)===s,v=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(y||!g?[Wr(s)]:function(e){const t=Wr(e);return[zr(e),t,zr(t)]}(s));p||"none"===h||w.push(...function(e,t,n,r){const a=Nr(e);let o=function(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:i;default:return[]}}(Lr(e),"start"===n,r);return a&&(o=o.map((e=>e+"-"+a)),t&&(o=o.concat(o.map(zr)))),o}(s,g,h,v));const x=[s,...w],S=await $r(t,m),O=[];let D=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&O.push(S[b]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Nr(e),a=Fr(e),o=Br(a);let i="x"===a?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Wr(i)),[i,Wr(i)]}(a,i,v);O.push(S[e[0]],S[e[1]])}if(D=[...D,{placement:a,overflows:O}],!O.every((e=>e<=0))){var C,E;const e=((null==(C=o.flip)?void 0:C.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:D},reset:{placement:t}};let n=null==(E=D.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:E.placement;if(!n)switch(f){case"bestFit":{var _;const e=null==(_=D.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:_[0];e&&(n=e);break}case"initialPlacement":n=s}if(a!==n)return{reset:{placement:n}}}return{}}}},da=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:o}=t,{apply:i=(()=>{}),...s}=Mr(e,t),l=await $r(t,s),c=Lr(n),u=Nr(n),d="y"===Vr(n),{width:p,height:f}=r.floating;let h,g;"top"===c||"bottom"===c?(h=c,g=u===(await(null==a.isRTL?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,h="end"===u?"top":"bottom");const m=f-l[h],b=p-l[g],y=!t.middlewareData.shift;let v=m,w=b;if(d){const e=p-l.left-l.right;w=u||y?Pr(b,e):e}else{const e=f-l.top-l.bottom;v=u||y?Pr(m,e):e}if(y&&!u){const e=Rr(l.left,0),t=Rr(l.right,0),n=Rr(l.top,0),r=Rr(l.bottom,0);d?w=p-2*(0!==e||0!==t?e+t:Rr(l.left,l.right)):v=f-2*(0!==n||0!==r?n+r:Rr(l.top,l.bottom))}await i({...t,availableWidth:w,availableHeight:v});const x=await a.getDimensions(o.floating);return p!==x.width||f!==x.height?{reset:{rects:!0}}:{}}}};var pa=n(8398),fa="undefined"!=typeof document?a.useLayoutEffect:a.useEffect;function ha(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!ha(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){const n=a[r];if(!("_owner"===n&&e.$$typeof||ha(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function ga(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ma(e,t){const n=ga(e);return Math.round(t*n)/n}function ba(e){const t=a.useRef(e);return fa((()=>{t.current=e})),t}const ya=(e,t)=>({...ua(e),options:[e,t]}),va=(e,t)=>({...da(e),options:[e,t]});var wa=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),xa="undefined"==typeof Element,Sa=xa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Oa=!xa&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Da=function e(t,n){var r;void 0===n&&(n=!0);var a=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===a||"true"===a||n&&t&&e(t.parentNode)},Ca=function e(t,n,r){for(var a=[],o=Array.from(t);o.length;){var i=o.shift();if(!Da(i,!1))if("SLOT"===i.tagName){var s=i.assignedElements(),l=e(s.length?s:i.children,!0,r);r.flatten?a.push.apply(a,l):a.push({scopeParent:i,candidates:l})}else{Sa.call(i,wa)&&r.filter(i)&&(n||!t.includes(i))&&a.push(i);var c=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),u=!Da(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(c&&u){var d=e(!0===c?i.children:c.children,!0,r);r.flatten?a.push.apply(a,d):a.push({scopeParent:i,candidates:d})}else o.unshift.apply(o,i.children)}}return a},Ea=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},_a=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ea(e)?0:e.tabIndex},Pa=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ra=function(e){return"INPUT"===e.tagName},Ia=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Ta=function(e,t){return!(t.disabled||Da(t)||function(e){return Ra(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var a=Sa.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Sa.call(a,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ia(e)}else{if("function"==typeof r){for(var o=e;e;){var i=e.parentElement,s=Oa(e);if(i&&!i.shadowRoot&&!0===r(i))return Ia(e);e=e.assignedSlot?e.assignedSlot:i||s===e.ownerDocument?i:s.host}e=o}if(function(e){var t,n,r,a,o=e&&Oa(e),i=null===(t=o)||void 0===t?void 0:t.host,s=!1;if(o&&o!==e)for(s=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(a=e.ownerDocument)&&void 0!==a&&a.contains(e));!s&&i;){var l,c,u;s=!(null===(c=i=null===(l=o=Oa(i))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(i))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Sa.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ka=function(e,t){return!(function(e){return function(e){return Ra(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Oa(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var a=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!a||a===e}(e)}(t)||_a(t)<0||!Ta(e,t))},Aa=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ja=function e(t){var n=[],r=[];return t.forEach((function(t,a){var o=!!t.scopeParent,i=o?t.scopeParent:t,s=function(e,t){var n=_a(e);return n<0&&t&&!Ea(e)?0:n}(i,o),l=o?e(t.candidates):i;0===s?o?n.push.apply(n,l):n.push(i):r.push({documentOrder:a,tabIndex:s,item:t,isScope:o,content:l})})),r.sort(Pa).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ma=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Ca([e],t.includeContainer,{filter:ka.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Aa}):function(e,t,n){if(Da(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(wa));return t&&Sa.call(e,wa)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,ka.bind(null,t)),ja(n)},La=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Sa.call(e,wa)&&ka(t,e)};const Na={...o},Ba=Na.useInsertionEffect||(e=>e());function Va(e){const t=a.useRef((()=>{}));return Ba((()=>{t.current=e})),a.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}const Fa="ArrowUp",za="ArrowDown",Wa="ArrowLeft",Ua="ArrowRight";function Ha(e,t,n){return Math.floor(e/t)!==n}function $a(e,t){return t<0||t>=e.current.length}function Ga(e,t){return Qa(e,{disabledIndices:t})}function qa(e,t){return Qa(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Qa(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:a,amount:o=1}=void 0===t?{}:t;const i=e.current;let s=n;do{s+=r?-o:o}while(s>=0&&s<=i.length-1&&Xa(i,s,a));return s}function Ya(e,t,n,r,a){if(-1===e)return-1;const o=n.indexOf(e),i=t[e];switch(a){case"tl":return o;case"tr":return i?o+i.width-1:o;case"bl":return i?o+(i.height-1)*r:o;case"br":return n.lastIndexOf(e)}}function Ka(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function Xa(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Za=0;function Ja(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(Za);const o=()=>null==e?void 0:e.focus({preventScroll:n});a?o():Za=requestAnimationFrame(o)}var eo="undefined"!=typeof document?a.useLayoutEffect:a.useEffect;function to(){return to=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},to.apply(this,arguments)}let no=!1,ro=0;const ao=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ro++,oo=Na.useId||function(){const[e,t]=a.useState((()=>no?ao():void 0));return eo((()=>{null==e&&t(ao())}),[]),a.useEffect((()=>{no=!0}),[]),e};const io=a.createContext(null),so=a.createContext(null),lo=()=>{var e;return(null==(e=a.useContext(io))?void 0:e.id)||null},co=()=>a.useContext(so);function uo(e){return"data-floating-ui-"+e}function po(e){const t=(0,a.useRef)(e);return eo((()=>{t.current=e})),t}function fo(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let ho=new WeakMap,go=new WeakSet,mo={},bo=0;const yo=e=>e&&(e.host||yo(e.parentNode)),vo=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=yo(t);return e.contains(n)?n:null})).filter((e=>null!=e));function wo(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=Sr(e[0]).body;return function(e,t,n,r){const a="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,i=vo(t,e),s=new Set,l=new Set(i),c=[];mo[a]||(mo[a]=new WeakMap);const u=mo[a];return i.forEach((function e(t){t&&!s.has(t)&&(s.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==Xn(t))if(s.has(t))e(t);else{const e=o?t.getAttribute(o):null,n=null!==e&&"false"!==e,r=(ho.get(t)||0)+1,i=(u.get(t)||0)+1;ho.set(t,r),u.set(t,i),c.push(t),1===r&&n&&go.add(t),1===i&&t.setAttribute(a,""),!n&&o&&t.setAttribute(o,"true")}}))}(t),s.clear(),bo++,()=>{c.forEach((e=>{const t=(ho.get(e)||0)-1,n=(u.get(e)||0)-1;ho.set(e,t),u.set(e,n),t||(!go.has(e)&&o&&e.removeAttribute(o),go.delete(e)),n||e.removeAttribute(a)})),bo--,bo||(ho=new WeakMap,ho=new WeakMap,go=new WeakSet,mo={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const xo=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function So(e,t){const n=Ma(e,xo());"prev"===t&&n.reverse();const r=n.indexOf(hr(Sr(e)));return n.slice(r+1)[0]}function Oo(){return So(document.body,"next")}function Do(){return So(document.body,"prev")}function Co(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!gr(n,r)}function Eo(e){Ma(e,xo()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function _o(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Po={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Ro(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const Io=a.forwardRef((function(e,t){const[n,r]=a.useState();eo((()=>(wr()&&r("button"),document.addEventListener("keydown",Ro),()=>{document.removeEventListener("keydown",Ro)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[uo("focus-guard")]:"",style:Po};return a.createElement("span",to({},e,o))})),To=a.createContext(null),ko=uo("portal");function Ao(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,i=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=oo(),o=jo(),[i,s]=a.useState(null),l=a.useRef(null);return eo((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{l.current=null}))}),[i]),eo((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(ko,""),e.appendChild(n),l.current=n,s(n)}),[t,r]),eo((()=>{if(!r)return;if(l.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!tr(e)&&(e=e.current),e=e||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,e.appendChild(a));const i=document.createElement("div");i.id=r,i.setAttribute(ko,""),e=a||e,e.appendChild(i),l.current=i,s(i)}),[t,n,r,o]),i}({id:n,root:r}),[s,l]=a.useState(null),c=a.useRef(null),u=a.useRef(null),d=a.useRef(null),p=a.useRef(null),f=!!s&&!s.modal&&s.open&&o&&!(!r&&!i);return a.useEffect((()=>{if(i&&o&&(null==s||!s.modal))return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){i&&Co(e)&&("focusin"===e.type?_o:Eo)(i)}}),[i,o,null==s?void 0:s.modal]),a.createElement(To.Provider,{value:a.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:p,portalNode:i,setFocusManagerState:l})),[o,i])},f&&i&&a.createElement(Io,{"data-type":"outside",ref:c,onFocus:e=>{if(Co(e,i)){var t;null==(t=d.current)||t.focus()}else{const e=Do()||(null==s?void 0:s.refs.domReference.current);null==e||e.focus()}}}),f&&i&&a.createElement("span",{"aria-owns":i.id,style:Po}),i&&(0,pa.createPortal)(t,i),f&&i&&a.createElement(Io,{"data-type":"outside",ref:u,onFocus:e=>{if(Co(e,i)){var t;null==(t=p.current)||t.focus()}else{const t=Oo()||(null==s?void 0:s.refs.domReference.current);null==t||t.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,e.nativeEvent))}}}))}const jo=()=>a.useContext(To),Mo=20;let Lo=[];function No(e){Lo=Lo.filter((e=>e.isConnected));let t=e;if(t&&"body"!==Xn(t)){if(!La(t,xo())){const e=Ma(t,xo())[0];e&&(t=e)}Lo.push(t),Lo.length>Mo&&(Lo=Lo.slice(-Mo))}}function Bo(){return Lo.slice().reverse().find((e=>e.isConnected))}const Vo=a.forwardRef((function(e,t){return a.createElement("button",to({},e,{type:"button",ref:t,tabIndex:-1,style:Po}))}));function Fo(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:s=0,returnFocus:l=!0,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:p,refs:f,nodeId:h,onOpenChange:g,events:m,dataRef:b,elements:{domReference:y,floating:v}}=t,w="number"==typeof s&&s<0,x=_r(y)&&w,S="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,O=po(o),D=po(s),C=po(l),E=co(),_=jo(),P=a.useRef(null),R=a.useRef(null),I=a.useRef(!1),T=a.useRef(!1),k=null!=_,A=a.useCallback((function(e){return void 0===e&&(e=v),e?Ma(e,xo()):[]}),[v]),j=a.useCallback((e=>{const t=A(e);return O.current.map((e=>y&&"reference"===e?y:v&&"floating"===e?v:t)).filter(Boolean).flat()}),[y,v,O,A]);function M(e){return!r&&u&&c?a.createElement(Vo,{ref:"start"===e?P:R,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof u?u:"Dismiss"):null}a.useEffect((()=>{if(r||!c)return;function e(e){if("Tab"===e.key){gr(v,hr(Sr(v)))&&0===A().length&&!x&&Er(e);const t=j(),n=Dr(e);"reference"===O.current[0]&&n===y&&(Er(e),e.shiftKey?Ja(t[t.length-1]):Ja(t[1])),"floating"===O.current[1]&&n===v&&e.shiftKey&&(Er(e),Ja(t[0]))}}const t=Sr(v);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,y,v,c,O,x,A,j]),a.useEffect((()=>{if(!r&&d)return v&&nr(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),!c&&v.addEventListener("focusout",t),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),!c&&v.removeEventListener("focusout",t)}):void 0;function e(){T.current=!0,setTimeout((()=>{T.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(gr(y,t)||gr(v,t)||gr(t,v)||gr(null==_?void 0:_.portalNode,t)||null!=t&&t.hasAttribute(uo("focus-guard"))||E&&(fo(E.nodesRef.current,h).find((e=>{var n,r;return gr(null==(n=e.context)?void 0:n.elements.floating,t)||gr(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],a=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;a;){const t=e.find((e=>e.id===a));a=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(E.nodesRef.current,h).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!T.current&&t!==Bo()&&(I.current=!0,g(!1,e))}))}}),[r,y,v,c,h,E,_,g,d]),a.useEffect((()=>{var e;if(r)return;const t=Array.from((null==_||null==(e=_.portalNode)?void 0:e.querySelectorAll("["+uo("portal")+"]"))||[]);if(v){const e=[v,...t,P.current,R.current,O.current.includes("reference")||x?y:null].filter((e=>null!=e)),n=c||x?wo(e,S,!S):wo(e);return()=>{n()}}}),[r,y,v,c,O,_,x,S]),eo((()=>{if(r||!v)return;const e=hr(Sr(v));queueMicrotask((()=>{const t=j(v),n=D.current,r=("number"==typeof n?t[n]:n.current)||v,a=gr(v,e);w||a||!p||Ja(r,{preventScroll:r===v})}))}),[r,p,v,w,j,D]),eo((()=>{if(r||!v)return;let e=!1;const t=Sr(v),n=hr(t);let a=b.current.openEvent;function o(t){let{open:n,reason:r,event:o,nested:i}=t;n&&(a=o),"escape-key"===r&&f.domReference.current&&No(f.domReference.current),"hover"===r&&"mouseleave"===o.type&&(I.current=!0),"outside-press"===r&&(i?(I.current=!1,e=!0):I.current=!(yr(o)||vr(o)))}return No(n),m.on("openchange",o),()=>{m.off("openchange",o);const n=hr(t),r=gr(v,n)||E&&fo(E.nodesRef.current,h).some((e=>{var t;return gr(null==(t=e.context)?void 0:t.elements.floating,n)}));(r||a&&["click","mousedown"].includes(a.type))&&f.domReference.current&&No(f.domReference.current);const i=Bo();C.current&&!I.current&&nr(i)&&(i===n||n===t.body||r)&&Ja(i,{cancelPrevious:!1,preventScroll:e})}}),[r,v,C,b,f,m,E,h]),eo((()=>{if(!r&&_)return _.setFocusManagerState({modal:c,closeOnFocusOut:d,open:p,onOpenChange:g,refs:f}),()=>{_.setFocusManagerState(null)}}),[r,_,c,p,g,f,d]),eo((()=>{if(r||!v||"function"!=typeof MutationObserver||w)return;const e=()=>{const e=v.getAttribute("tabindex");O.current.includes("floating")||hr(Sr(v))!==f.domReference.current&&0===A().length?"0"!==e&&v.setAttribute("tabindex","0"):"-1"!==e&&v.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,v,f,O,A,w]);const L=!r&&S&&(k||c);return a.createElement(a.Fragment,null,L&&a.createElement(Io,{"data-type":"inside",ref:null==_?void 0:_.beforeInsideRef,onFocus:e=>{if(c){const e=j();Ja("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=_&&_.preserveTabOrder&&_.portalNode)if(I.current=!1,Co(e,_.portalNode)){const e=Oo()||y;null==e||e.focus()}else{var t;null==(t=_.beforeOutsideRef.current)||t.focus()}}}),!x&&M("start"),n,M("end"),L&&a.createElement(Io,{"data-type":"inside",ref:null==_?void 0:_.afterInsideRef,onFocus:e=>{if(c)Ja(j()[0]);else if(null!=_&&_.preserveTabOrder&&_.portalNode)if(d&&(I.current=!0),Co(e,_.portalNode)){const e=Do()||y;null==e||e.focus()}else{var t;null==(t=_.afterOutsideRef.current)||t.focus()}}}))}const zo={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Wo={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Uo=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Ho(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=oo(),i=a.useRef({}),[s]=a.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),l=null!=lo(),[c,u]=a.useState(r.reference),d=Va(((e,t,r)=>{i.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),p=a.useMemo((()=>({setPositionReference:u})),[]),f=a.useMemo((()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference})),[c,r.reference,r.floating]);return a.useMemo((()=>({dataRef:i,open:t,onOpenChange:d,elements:f,events:s,floatingId:o,refs:p})),[t,d,f,s,o,p])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=a.useState(null),[l,c]=a.useState(null),u=(null==o?void 0:o.reference)||i,d=a.useRef(null),p=co();eo((()=>{u&&(d.current=u)}),[u]);const f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,p]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=a.useState(r);ha(f,r)||h(r);const[g,m]=a.useState(null),[b,y]=a.useState(null),v=a.useCallback((e=>{e!==O.current&&(O.current=e,m(e))}),[]),w=a.useCallback((e=>{e!==D.current&&(D.current=e,y(e))}),[]),x=i||g,S=s||b,O=a.useRef(null),D=a.useRef(null),C=a.useRef(d),E=null!=c,_=ba(c),P=ba(o),R=a.useCallback((()=>{if(!O.current||!D.current)return;const e={placement:t,strategy:n,middleware:f};P.current&&(e.platform=P.current),((e,t,n)=>{const r=new Map,a={platform:sa,...n},o={...a.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,s=o.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=Hr(c,r,l),p=r,f={},h=0;for(let n=0;n<s.length;n++){const{name:o,fn:g}=s[n],{x:m,y:b,data:y,reset:v}=await g({x:u,y:d,initialPlacement:r,placement:p,strategy:a,middlewareData:f,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=m?m:u,d=null!=b?b:d,f={...f,[o]:{...f[o],...y}},v&&h<=50&&(h++,"object"==typeof v&&(v.placement&&(p=v.placement),v.rects&&(c=!0===v.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):v.rects),({x:u,y:d}=Hr(c,p,l))),n=-1)}return{x:u,y:d,placement:p,strategy:a,middlewareData:f}})(e,t,{...a,platform:o})})(O.current,D.current,e).then((e=>{const t={...e,isPositioned:!0};I.current&&!ha(C.current,t)&&(C.current=t,pa.flushSync((()=>{p(t)})))}))}),[f,t,n,P]);fa((()=>{!1===u&&C.current.isPositioned&&(C.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[u]);const I=a.useRef(!1);fa((()=>(I.current=!0,()=>{I.current=!1})),[]),fa((()=>{if(x&&(O.current=x),S&&(D.current=S),x&&S){if(_.current)return _.current(x,S,R);R()}}),[x,S,R,_,E]);const T=a.useMemo((()=>({reference:O,floating:D,setReference:v,setFloating:w})),[v,w]),k=a.useMemo((()=>({reference:x,floating:S})),[x,S]),A=a.useMemo((()=>{const e={position:n,left:0,top:0};if(!k.floating)return e;const t=ma(k.floating,d.x),r=ma(k.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...ga(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,l,k.floating,d.x,d.y]);return a.useMemo((()=>({...d,update:R,refs:T,elements:k,floatingStyles:A})),[d,R,T,k,A])}({...e,elements:{...o,...l&&{reference:l}}}),h=a.useCallback((e=>{const t=tr(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),f.refs.setReference(t)}),[f.refs]),g=a.useCallback((e=>{(tr(e)||null===e)&&(d.current=e,s(e)),(tr(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!tr(e))&&f.refs.setReference(e)}),[f.refs]),m=a.useMemo((()=>({...f.refs,setReference:g,setPositionReference:h,domReference:d})),[f.refs,g,h]),b=a.useMemo((()=>({...f.elements,domReference:u})),[f.elements,u]),y=a.useMemo((()=>({...f,...r,refs:m,elements:b,nodeId:t})),[f,m,b,t,r]);return eo((()=>{r.dataRef.current.floatingContext=y;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===t));e&&(e.context=y)})),a.useMemo((()=>({...f,context:y,refs:m,elements:b})),[f,m,b,y])}const $o="active",Go="selected";function qo(e,t,n){const r=new Map,a="item"===n;let o=e;if(a&&e){const{[$o]:t,[Go]:n,...r}=e;o=r}return{..."floating"===n&&{tabIndex:-1},...o,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var i;a&&[$o,Go].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(i=r.get(n))||i.push(o),e[n]=function(){for(var e,t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return null==(e=r.get(n))?void 0:e.map((e=>e(...a))).find((e=>void 0!==e))})):e[n]=o)})),e):e),{})}}let Qo=!1;function Yo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ko(e,t){return Yo(t,e===Fa||e===za,e===Wa||e===Ua)}function Xo(e,t,n){return Yo(t,e===za,n?e===Wa:e===Ua)||"Enter"===e||" "===e||""===e}function Zo(e,t,n){return Yo(t,n?e===Ua:e===Wa,e===Fa)}function Jo(e,t){const{open:n,onOpenChange:r,elements:{domReference:o,floating:i}}=e,{listRef:s,activeIndex:l,onNavigate:c=(()=>{}),enabled:u=!0,selectedIndex:d=null,allowEscape:p=!1,loop:f=!1,nested:h=!1,rtl:g=!1,virtual:m=!1,focusItemOnOpen:b="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:v=!0,disabledIndices:w,orientation:x="vertical",cols:S=1,scrollItemIntoView:O=!0,virtualItemRef:D,itemSizes:C,dense:E=!1}=t,_=lo(),P=co(),R=Va(c),I=a.useRef(b),T=a.useRef(null!=d?d:-1),k=a.useRef(null),A=a.useRef(!0),j=a.useRef(R),M=a.useRef(!!i),L=a.useRef(!1),N=a.useRef(!1),B=po(w),V=po(n),F=po(O),z=po(i),W=po(d),[U,H]=a.useState(),[$,G]=a.useState(),q=Va((function(e,t,n){function r(e){m?(H(e.id),null==P||P.events.emit("virtualfocus",e),D&&(D.current=e)):Ja(e,{preventScroll:!0,sync:!(!mr().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!wr())&&(Qo||L.current)})}void 0===n&&(n=!1);const a=e.current[t.current];a&&r(a),requestAnimationFrame((()=>{const o=e.current[t.current]||a;if(!o)return;a||r(o);const i=F.current;i&&Y&&(n||!A.current)&&(null==o.scrollIntoView||o.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))}))}));eo((()=>{document.createElement("div").focus({get preventScroll(){return Qo=!0,!1}})}),[]),eo((()=>{u&&(n&&i?I.current&&null!=d&&(N.current=!0,T.current=d,R(d)):M.current&&(T.current=-1,j.current(null)))}),[u,n,i,d,R]),eo((()=>{if(u&&n&&i)if(null==l){if(L.current=!1,null!=W.current)return;if(M.current&&(T.current=-1,q(s,T)),!M.current&&I.current&&(null!=k.current||!0===I.current&&null==k.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(T.current=null==k.current||Xo(k.current,x,g)||h?Ga(s,B.current):qa(s,B.current),k.current=null,R(T.current))};t()}}else $a(s,l)||(T.current=l,q(s,T,N.current),N.current=!1)}),[u,n,i,l,W,h,s,x,g,R,q,B]),eo((()=>{var e;if(!u||i||!P||m||!M.current)return;const t=P.nodesRef.current,n=null==(e=t.find((e=>e.id===_)))||null==(e=e.context)?void 0:e.elements.floating,r=hr(Sr(i)),a=t.some((e=>e.context&&gr(e.context.elements.floating,r)));n&&!a&&A.current&&n.focus({preventScroll:!0})}),[u,i,P,_,m]),eo((()=>{if(u&&P&&m&&!_)return P.events.on("virtualfocus",e),()=>{P.events.off("virtualfocus",e)};function e(e){G(e.id),D&&(D.current=e)}}),[u,P,m,_,D]),eo((()=>{j.current=R,M.current=!!i})),eo((()=>{n||(k.current=null)}),[n]);const Q=null!=l,Y=a.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&R(t)}const t={onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...y&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;A.current&&"touch"!==t&&(T.current=-1,q(s,T),R(null),m||Ja(z.current,{preventScroll:!0}))}}};return t}),[n,z,q,y,s,R,m]);return a.useMemo((()=>{if(!u)return{};const e=B.current;function t(t){if(A.current=!1,L.current=!0,!V.current&&t.currentTarget===z.current)return;if(h&&Zo(t.key,x,g))return Er(t),r(!1,t.nativeEvent,"list-navigation"),void(nr(o)&&!m&&o.focus());const a=T.current,i=Ga(s,e),l=qa(s,e);if("Home"===t.key&&(Er(t),T.current=i,R(T.current)),"End"===t.key&&(Er(t),T.current=l,R(T.current)),S>1){const n=C||Array.from({length:s.current.length},(()=>({width:1,height:1}))),r=function(e,t,n){const r=[];let a=0;return e.forEach(((e,o)=>{let{width:i,height:s}=e,l=!1;for(n&&(a=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<s;r++)e.push(a+n+r*t);a%t+i<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=o})),l=!0):a++}})),[...r]}(n,S,E),a=r.findIndex((t=>null!=t&&!Xa(s.current,t,e))),o=r.reduce(((t,n,r)=>null==n||Xa(s.current,n,e)?t:r),-1);if(T.current=r[function(e,t){let{event:n,orientation:r,loop:a,cols:o,disabledIndices:i,minIndex:s,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===Fa){if(u&&Er(n),-1===c)d=l;else if(d=Qa(e,{startingIndex:d,amount:o,decrement:!0,disabledIndices:i}),a&&(c-o<s||d<0)){const e=c%o,t=l%o,n=l-(t-e);d=t===e?l:t>e?n:n-o}$a(e,d)&&(d=c)}if(n.key===za&&(u&&Er(n),-1===c?d=s:(d=Qa(e,{startingIndex:c,amount:o,disabledIndices:i}),a&&c+o>l&&(d=Qa(e,{startingIndex:c%o-o,amount:o,disabledIndices:i}))),$a(e,d)&&(d=c)),"both"===r){const t=Tr(c/o);n.key===Ua&&(u&&Er(n),c%o!=o-1?(d=Qa(e,{startingIndex:c,disabledIndices:i}),a&&Ha(d,o,t)&&(d=Qa(e,{startingIndex:c-c%o-1,disabledIndices:i}))):a&&(d=Qa(e,{startingIndex:c-c%o-1,disabledIndices:i})),Ha(d,o,t)&&(d=c)),n.key===Wa&&(u&&Er(n),c%o!=0?(d=Qa(e,{startingIndex:c,decrement:!0,disabledIndices:i}),a&&Ha(d,o,t)&&(d=Qa(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:i}))):a&&(d=Qa(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:i})),Ha(d,o,t)&&(d=c));const r=Tr(l/o)===t;$a(e,d)&&(d=a&&r?n.key===Wa?l:Qa(e,{startingIndex:c-c%o-1,disabledIndices:i}):c)}return d}({current:r.map((e=>null!=e?s.current[e]:null))},{event:t,orientation:x,loop:f,cols:S,disabledIndices:Ka([...e||s.current.map(((e,t)=>Xa(s.current,t)?t:void 0)),void 0],r),minIndex:a,maxIndex:o,prevIndex:Ya(T.current>l?i:T.current,n,r,S,t.key===za?"bl":t.key===Ua?"tr":"tl"),stopEvent:!0})],R(T.current),"both"===x)return}if(Ko(t.key,x)){if(Er(t),n&&!m&&hr(t.currentTarget.ownerDocument)===t.currentTarget)return T.current=Xo(t.key,x,g)?i:l,void R(T.current);Xo(t.key,x,g)?T.current=f?a>=l?p&&a!==s.current.length?-1:i:Qa(s,{startingIndex:a,disabledIndices:e}):Math.min(l,Qa(s,{startingIndex:a,disabledIndices:e})):T.current=f?a<=i?p&&-1!==a?s.current.length:l:Qa(s,{startingIndex:a,decrement:!0,disabledIndices:e}):Math.max(i,Qa(s,{startingIndex:a,decrement:!0,disabledIndices:e})),$a(s,T.current)?R(null):R(T.current)}}function a(e){"auto"===b&&yr(e.nativeEvent)&&(I.current=!0)}const i=m&&n&&Q&&{"aria-activedescendant":$||U},l=s.current.find((e=>(null==e?void 0:e.id)===U));return{reference:{...i,onKeyDown(a){A.current=!1;const o=0===a.key.indexOf("Arrow"),i=function(e,t,n){return Yo(t,n?e===Wa:e===Ua,e===za)}(a.key,x,g),c=Zo(a.key,x,g),u=Ko(a.key,x),p=(h?i:u)||"Enter"===a.key||""===a.key.trim();if(m&&n){const e=null==P?void 0:P.nodesRef.current.find((e=>null==e.parentId)),n=P&&e?function(e,t){let n,r=-1;return function t(a,o){o>r&&(n=a,r=o),fo(e,a).forEach((e=>{t(e.id,o+1)}))}(t,0),e.find((e=>e.id===n))}(P.nodesRef.current,e.id):null;if(o&&n&&D){const e=new KeyboardEvent("keydown",{key:a.key,bubbles:!0});if(i||c){var f,b;const t=(null==(f=n.context)?void 0:f.elements.domReference)===a.currentTarget,r=c&&!t?null==(b=n.context)?void 0:b.elements.domReference:i?l:null;r&&(Er(a),r.dispatchEvent(e),G(void 0))}var y;if(u&&n.context&&n.context.open&&n.parentId&&a.currentTarget!==n.context.elements.domReference)return Er(a),void(null==(y=n.context.elements.domReference)||y.dispatchEvent(e))}return t(a)}(n||v||!o)&&(p&&(k.current=h&&u?null:a.key),h?i&&(Er(a),n?(T.current=Ga(s,e),R(T.current)):r(!0,a.nativeEvent,"list-navigation")):u&&(null!=d&&(T.current=d),Er(a),!n&&v?r(!0,a.nativeEvent,"list-navigation"):t(a),n&&R(T.current)))},onFocus(){n&&!m&&R(null)},onPointerDown:function(e){I.current=b,"auto"===b&&vr(e.nativeEvent)&&(I.current=!0)},onMouseDown:a,onClick:a},floating:{"aria-orientation":"both"===x?void 0:x,...!_r(o)&&i,onKeyDown:t,onPointerMove(){A.current=!0}},item:Y}}),[o,z,U,$,B,V,s,u,x,g,m,n,Q,h,d,v,p,S,f,b,R,r,Y,P,D,C,E])}const ei=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ti(e,t,n){let r,a=n.initialDeps??[];return()=>{var o,i,s,l;let c;n.key&&(null==(o=n.debug)?void 0:o.call(n))&&(c=Date.now());const u=e(),d=u.length!==a.length||u.some(((e,t)=>a[t]!==e));if(!d)return r;let p;if(a=u,n.key&&(null==(i=n.debug)?void 0:i.call(n))&&(p=Date.now()),r=t(...u),n.key&&(null==(s=n.debug)?void 0:s.call(n))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-p))/100,r=t/16,a=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${a(t,5)} /${a(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null==(l=null==n?void 0:n.onChange)||l.call(n,r),r}}function ni(e,t){if(void 0===e)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return e}const ri=(e,t,n)=>{let r;return function(...a){e.clearTimeout(r),r=e.setTimeout((()=>t.apply(this,a)),n)}},ai=e=>e,oi=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},ii=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const a=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(a(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver((e=>{const t=e[0];if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void a({width:e.inlineSize,height:e.blockSize})}a(n.getBoundingClientRect())}));return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},si={passive:!0},li="undefined"==typeof window||"onscrollend"in window,ci=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let a=0;const o=li?()=>{}:ri(r,(()=>{t(a,!1)}),e.options.isScrollingResetDelay),i=r=>()=>{const{horizontal:i,isRtl:s}=e.options;a=i?n.scrollLeft*(s?-1:1):n.scrollTop,o(),t(a,r)},s=i(!0),l=i(!1);return l(),n.addEventListener("scroll",s,si),n.addEventListener("scrollend",l,si),()=>{n.removeEventListener("scroll",s),n.removeEventListener("scrollend",l)}},ui=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},di=(e,{adjustments:t=0,behavior:n},r)=>{var a,o;const i=e+t;null==(o=null==(a=r.scrollElement)?void 0:a.scrollTo)||o.call(a,{[r.options.horizontal?"left":"top"]:i,behavior:n})};class pi{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{this._measureElement(e.target,e)}))})):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,n])=>{void 0===n&&delete e[t]})),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ai,rangeExtractor:oi,onChange:()=>{},measureElement:ui,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=ti((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let a=t-1;a>=0;a--){const t=e[a];if(n.has(t.lane))continue;const o=r.get(t.lane);if(null==o||t.end>o.end?r.set(t.lane,t):t.end<o.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=ti((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,n,r,a)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:a})),{key:!1}),this.getMeasurements=ti((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:a},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const i=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const s=this.measurementsCache.slice(0,i);for(let a=i;a<e;a++){const e=r(a),i=1===this.options.lanes?s[a-1]:this.getFurthestMeasurement(s,a),l=i?i.end+this.options.gap:t+n,c=o.get(e),u="number"==typeof c?c:this.options.estimateSize(a),d=l+u,p=i?i.lane:a%this.options.lanes;s[a]={index:a,start:l,size:u,end:d,key:e,lane:p}}return this.measurementsCache=s,s}),{key:!1,debug:()=>this.options.debug}),this.calculateRange=ti((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()]),((e,t,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,a=fi(0,r,(t=>e[t].start),n);let o=a;for(;o<r&&e[o].end<n+t;)o++;return{startIndex:a,endIndex:o}}({measurements:e,outerSize:t,scrollOffset:n}):null),{key:!1,debug:()=>this.options.debug}),this.getIndexes=ti((()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count]),((e,t,n,r)=>null===t?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:n,count:r})),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const a=r.key,o=this.elementsCache.get(a);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(a,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const n=this.measurementsCache[e];if(!n)return;const r=t-(this.itemSizeCache.get(n.key)??n.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=ti((()=>[this.getIndexes(),this.getMeasurements()]),((e,t)=>{const n=[];for(let r=0,a=e.length;r<a;r++){const a=t[e[r]];n.push(a)}return n}),{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return ni(t[fi(0,t.length-1,(e=>ni(t[e]).start),e)])},this.getOffsetForAlignment=(e,t)=>{const n=this.getSize(),r=this.getScrollOffset();"auto"===t&&(t=e<=r?"start":e>=r+n?"end":"start"),"start"===t||("end"===t?e-=n:"center"===t&&(e-=n/2));const a=this.options.horizontal?"scrollWidth":"scrollHeight",o=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-n;return Math.max(Math.min(o,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),a=this.getScrollOffset();if("auto"===t)if(n.end>=a+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=a+this.options.scrollPaddingStart))return[a,t];t="start"}const o="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,t),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const r=this.getOffsetForIndex(e,t);if(!r)return;const[a,o]=r;this._scrollToOffset(a,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(e))){const[a]=ni(this.getOffsetForIndex(e,o));t=a,r=this.getScrollOffset(),Math.abs(t-r)<1||this.scrollToIndex(e,{align:o,behavior:n})}else this.scrollToIndex(e,{align:o,behavior:n});var t,r})))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;return n=0===t.length?this.options.paddingStart:1===this.options.lanes?(null==(e=t[t.length-1])?void 0:e.end)??0:Math.max(...t.slice(-this.options.lanes).map((e=>e.end))),Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const fi=(e,t,n,r)=>{for(;e<=t;){const a=(e+t)/2|0,o=n(a);if(o<r)e=a+1;else{if(!(o>r))return a;t=a-1}}return e>0?e-1:0},hi="undefined"!=typeof document?a.useLayoutEffect:a.useEffect;var gi=Object.defineProperty,mi=Object.getOwnPropertySymbols,bi=Object.prototype.hasOwnProperty,yi=Object.prototype.propertyIsEnumerable,vi=(e,t,n)=>t in e?gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const wi=(0,a.forwardRef)((function(e,t){var n=e,{children:r,active:o,addGroupBottomBorder:s,isMultiValueEdit:l,checked:c}=n,u=((e,t)=>{var n={};for(var r in e)bi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&mi)for(var r of mi(e))t.indexOf(r)<0&&yi.call(e,r)&&(n[r]=e[r]);return n})(n,["children","active","addGroupBottomBorder","isMultiValueEdit","checked"]);const d=(0,Yt.useStyles2)(xi),p=(0,a.useId)();return i().createElement("div",((e,t)=>{for(var n in t||(t={}))bi.call(t,n)&&vi(e,n,t[n]);if(mi)for(var n of mi(t))yi.call(t,n)&&vi(e,n,t[n]);return e})({ref:t,role:"option",id:p,"aria-selected":o,className:(0,Zt.cx)(d.option,o&&d.optionFocused,s&&d.groupBottomBorder)},u),i().createElement("div",{className:d.optionBody,"data-testid":`data-testid ad hoc filter option value ${r}`},i().createElement("span",null,l?i().createElement(Yt.Checkbox,{tabIndex:-1,checked:c,className:d.checkbox}):null,r)))})),xi=e=>({option:(0,Zt.css)({label:"grafana-select-option",top:0,left:0,width:"100%",position:"absolute",padding:e.spacing(1),display:"flex",alignItems:"center",flexDirection:"row",flexShrink:0,whiteSpace:"nowrap",cursor:"pointer","&:hover":{background:e.colors.action.hover,"@media (forced-colors: active), (prefers-contrast: more)":{border:`1px solid ${e.colors.primary.border}`}}}),optionFocused:(0,Zt.css)({label:"grafana-select-option-focused",background:e.colors.action.focus,"@media (forced-colors: active), (prefers-contrast: more)":{border:`1px solid ${e.colors.primary.border}`}}),optionBody:(0,Zt.css)({label:"grafana-select-option-body",display:"flex",fontWeight:e.typography.fontWeightMedium,flexDirection:"column",flexGrow:1}),groupBottomBorder:(0,Zt.css)({borderBottom:`1px solid ${e.colors.border.weak}`}),checkbox:(0,Zt.css)({paddingRight:e.spacing(.5)}),multiValueApplyWrapper:(0,Zt.css)({position:"absolute",top:0,left:0,display:"flex",backgroundColor:e.colors.background.primary,color:e.colors.text.primary,boxShadow:e.shadows.z2,overflowY:"auto",zIndex:e.zIndex.dropdown,gap:e.spacing(1.5),padding:`${e.spacing(1.5)} ${e.spacing(1)}`})}),Si=()=>i().createElement(wi,{onClick:e=>e.stopPropagation()},"Loading options..."),Oi=()=>i().createElement(wi,{onClick:e=>e.stopPropagation()},"No options found"),Di=({handleFetchOptions:e})=>i().createElement(wi,{onClick:e},"An error has occurred fetching labels. Click to retry"),Ci=({onApply:e,floatingElement:t,maxOptionWidth:n})=>{const r=(0,Yt.useStyles2)(xi),a=null==t?void 0:t.getBoundingClientRect();return i().createElement("div",{className:r.multiValueApplyWrapper,style:{width:`${n}px`,transform:`translate(${null==a?void 0:a.left}px,${null==a?void 0:a.bottom}px)`}},i().createElement(Yt.Button,{onClick:e,size:"sm",tabIndex:-1},"Apply"))},Ei={key:"operator",operator:"value",value:"key"},_i=(e,t,n,r)=>Pi(Ei[e],t,"value"===e?n:void 0,r),Pi=(e,t,n,r)=>{t(e),null==n||n(),setTimeout((()=>null==r?void 0:r.focus()))},Ri=(e,t)=>"key"===e?{key:t.value,keyLabel:t.label?t.label:t.value}:"value"===e?{value:t.value,valueLabels:[t.label?t.label:t.value]}:{[e]:t.value},Ii="Filter by label values",Ti=(e,t,n,r)=>{var a;return"key"===t?Ii:"value"===t?n?"Edit values":(null==(a=e.valueLabels)?void 0:a[0])||"":e[t]&&!r?`${e[t]}`:Ii};var ki=Object.defineProperty,Ai=Object.defineProperties,ji=Object.getOwnPropertyDescriptors,Mi=Object.getOwnPropertySymbols,Li=Object.prototype.hasOwnProperty,Ni=Object.prototype.propertyIsEnumerable,Bi=(e,t,n)=>t in e?ki(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vi=(e,t)=>{for(var n in t||(t={}))Li.call(t,n)&&Bi(e,n,t[n]);if(Mi)for(var n of Mi(t))Ni.call(t,n)&&Bi(e,n,t[n]);return e},Fi=(e,t)=>Ai(e,ji(t));const zi=(0,a.forwardRef)((function({filter:e,model:t,isAlwaysWip:n,handleChangeViewMode:r},o){var s,l,c;const[u,d]=(0,a.useState)(!1),[p,f]=(0,a.useState)([]),[h,g]=(0,a.useState)(!1),[m,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(""),[w,x]=(0,a.useState)(null),[S,O]=(0,a.useState)(n?"key":"value"),D=(0,Yt.useStyles2)(Ui),[C,E]=(0,a.useState)([]),[_,P]=(0,a.useState)({}),R=(0,a.useRef)(null),I=(0,a.useMemo)((()=>cs.reduce(((e,t)=>t.isMulti?[...e,t.value]:e),[])),[]).includes((null==e?void 0:e.operator)||""),T=I&&"value"===S,k=(0,a.useId)(),A=(0,a.useRef)([]),j=(0,a.useRef)([]),M=(0,a.useMemo)((()=>function(e){const t=new Jt.A,n=[],r=1e4;return(a,o)=>{var i;if(""===a)return e.length>r?e.slice(0,r):e;if("operator"===o){const t=[];for(let n=0;n<e.length;n++)if((null==(i=e[n].label||e[n].value)?void 0:i.includes(a))&&(t.push(e[n]),t.length>r))return t;return t}if(0===n.length)for(let t=0;t<e.length;t++)n.push(e[t].label||e[t].value);const s=t.filter(n,a),l=[];if(s){for(let t=0;t<s.length;t++)if(l.push(e[s[t]]),l.length>r)return l;return l}return e.length>r?e.slice(0,r):e}}(p)),[p]),L=(0,a.useCallback)((()=>{n&&(t._addWip(),O("key"),v(""))}),[t,n]),N=(0,a.useCallback)(((e,t,n,r)=>{if(n.length){const r=[],a=[];n.forEach((e=>{var t;r.push(null!=(t=e.label)?t:e.value),a.push(e.value)})),e._updateFilter(t,{valueLabels:r,values:a,value:a[0]}),E([])}r||setTimeout((()=>{var e;return null==(e=z.domReference.current)?void 0:e.focus()}))}),[]),B=(0,a.useCallback)((e=>{E((t=>t.some((t=>t.value===e.value))?t.filter((t=>t.value!==e.value)):[...t,e]))}),[]),V=(0,a.useCallback)(((n,a,o)=>{d(n),o&&["outside-press","escape-key"].includes(o)&&(T&&N(t,e,C),L(),null==r||r())}),[e,C,r,N,L,T,t]),F=(0,a.useMemo)((()=>[k,...C.map(((e,t)=>`${e.value}-${t}`))]),[k,C]),{refs:z,floatingStyles:W,context:U,getReferenceProps:H,getFloatingProps:$,getItemProps:G}=(({open:e,onOpenChange:t,activeIndex:n,setActiveIndex:r,outsidePressIdsToIgnore:o,listRef:i,disabledIndicesRef:s})=>{const{refs:l,floatingStyles:c,context:u}=Ho({whileElementsMounted:la,open:e,onOpenChange:t,placement:"bottom-start",middleware:[{...ca(10),options:[10,void 0]},ya({padding:10}),va({apply({availableHeight:e,availableWidth:t,elements:n}){n.floating.style.maxHeight=`${Math.min(300,e)}px`,n.floating.style.maxWidth=`${t}px`},padding:10})]}),d=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:s="dialog"}=t,l=null!=(n=ei.get(s))?n:s,c=oo(),u=null!=lo();return a.useMemo((()=>{if(!i)return{};const e={id:o,...l&&{role:l}};return"tooltip"===l||"label"===s?{reference:{["aria-"+("label"===s?"labelledby":"describedby")]:r?o:void 0},floating:e}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?o:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},floating:{...e,..."menu"===l&&{"aria-labelledby":c}},item(e){let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(s){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}}}),[i,s,l,r,o,c,u])}(u,{role:"listbox"}),p=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:{reference:o,domReference:i,floating:s},dataRef:l}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:p="pointerdown",referencePress:f=!1,referencePressEvent:h="pointerdown",ancestorScroll:g=!1,bubbles:m,capture:b}=t,y=co(),v=Va("function"==typeof d?d:()=>!1),w="function"==typeof d?v:d,x=a.useRef(!1),S=a.useRef(!1),{escapeKey:O,outsidePress:D}=Uo(m),{escapeKey:C,outsidePress:E}=Uo(b),_=Va((e=>{var t;if(!n||!c||!u||"Escape"!==e.key)return;const a=null==(t=l.current.floatingContext)?void 0:t.nodeId,o=y?fo(y.nodesRef.current,a):[];if(!O&&(e.stopPropagation(),o.length>0)){let e=!0;if(o.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),P=Va((e=>{var t;const n=()=>{var t;_(e),null==(t=Dr(e))||t.removeEventListener("keydown",n)};null==(t=Dr(e))||t.addEventListener("keydown",n)})),R=Va((e=>{var t;const n=x.current;x.current=!1;const a=S.current;if(S.current=!1,"click"===p&&a)return;if(n)return;if("function"==typeof w&&!w(e))return;const o=Dr(e),c="["+uo("inert")+"]",u=Sr(s).querySelectorAll(c);let d=tr(o)?o:null;for(;d&&!lr(d);){const e=dr(d);if(lr(e)||!tr(e))break;d=e}if(u.length&&tr(o)&&!o.matches("html,body")&&!gr(o,s)&&Array.from(u).every((e=>!gr(d,e))))return;if(nr(o)&&s){const t=o.clientWidth>0&&o.scrollWidth>o.clientWidth,n=o.clientHeight>0&&o.scrollHeight>o.clientHeight;let r=n&&e.offsetX>o.clientWidth;if(n&&"rtl"===cr(o).direction&&(r=e.offsetX<=o.offsetWidth-o.clientWidth),r||t&&e.offsetY>o.clientHeight)return}const f=null==(t=l.current.floatingContext)?void 0:t.nodeId,h=y&&fo(y.nodesRef.current,f).some((t=>{var n;return Or(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Or(e,s)||Or(e,i)||h)return;const g=y?fo(y.nodesRef.current,f):[];if(g.length>0){let e=!0;if(g.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),I=Va((e=>{var t;const n=()=>{var t;R(e),null==(t=Dr(e))||t.removeEventListener(p,n)};null==(t=Dr(e))||t.addEventListener(p,n)}));return a.useEffect((()=>{if(!n||!c)return;function e(e){r(!1,e,"ancestor-scroll")}l.current.__escapeKeyBubbles=O,l.current.__outsidePressBubbles=D;const t=Sr(s);u&&t.addEventListener("keydown",C?P:_,C),w&&t.addEventListener(p,E?I:R,E);let a=[];return g&&(tr(i)&&(a=fr(i)),tr(s)&&(a=a.concat(fr(s))),!tr(o)&&o&&o.contextElement&&(a=a.concat(fr(o.contextElement)))),a=a.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),a.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{u&&t.removeEventListener("keydown",C?P:_,C),w&&t.removeEventListener(p,E?I:R,E),a.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[l,s,i,o,u,w,p,n,r,g,c,O,D,_,C,P,R,E,I]),a.useEffect((()=>{x.current=!1}),[w,p]),a.useMemo((()=>c?{reference:{onKeyDown:_,[zo[h]]:e=>{f&&r(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:_,onMouseDown(){S.current=!0},onMouseUp(){S.current=!0},[Wo[p]]:()=>{x.current=!0}}}:{}),[c,f,p,h,r,_])}(u,{outsidePress:e=>{var t;if(e.currentTarget instanceof Element){const n=e.currentTarget;let r=n.id;if("path"===n.nodeName&&(r=(null==(t=n.parentElement)?void 0:t.id)||""),o.includes(r))return!1}return!0}}),f=Jo(u,{listRef:i,activeIndex:n,onNavigate:r,virtual:!0,loop:!0,disabledIndices:s.current}),{getReferenceProps:h,getFloatingProps:g,getItemProps:m}=function(e){void 0===e&&(e=[]);const t=e,n=a.useCallback((t=>qo(t,e,"reference")),t),r=a.useCallback((t=>qo(t,e,"floating")),t),o=a.useCallback((t=>qo(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return a.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])}([d,p,f]);return{refs:l,floatingStyles:c,context:u,getReferenceProps:h,getFloatingProps:g,getItemProps:m}})({open:u,onOpenChange:V,activeIndex:w,setActiveIndex:x,outsidePressIdsToIgnore:F,listRef:A,disabledIndicesRef:j});(0,a.useImperativeHandle)(o,(()=>()=>{var e;return null==(e=z.domReference.current)?void 0:e.focus()}),[z.domReference]);const q=(0,a.useCallback)((e=>{E((t=>t.filter((t=>t.value!==e.value)))),setTimeout((()=>{var e;return null==(e=z.domReference.current)?void 0:e.focus()}))}),[z.domReference]),Q=(e=>e.flatMap((e=>e.options?[e,...e.options]:[e])))(Hs(M(y,S)));"operator"!==S&&y&&Q.push({value:y.trim(),label:y.trim(),isCustom:!0});const Y=((e,t,n)=>{var r,a,o,i;let s=182;const l=[],c=[];for(let t=0;t<e.length;t++){l.push(null),(null==(r=e[t])?void 0:r.options)&&c.push(t);let n=null!=(o=null!=(a=e[t].label)?a:e[t].value)?o:"",u=8;8*n.length<6*((null==(i=e[t].description)?void 0:i.length)||0)&&(n=e[t].description,u=6);const d=(e[t].isCustom?n.length+18:n.length)*u+16;d>s&&(s=d)}return t.current=[...l],n.current=[...c],s})(Q,A,j),K=(0,a.useCallback)((async n=>{var r;b(!1),g(!0),f([]);let a=[];try{"key"===n?a=await t._getKeys(null):"operator"===n?a=t._getOperators():"value"===n&&(a=await t._getValuesFor(e)),f(a),(null==(r=a[0])?void 0:r.group)&&x(1)}catch(e){b(!0)}g(!1)}),[e,t]),X=function(e){return function(e){const t=a.useReducer((()=>({})),{})[1],n={...e,onChange:(n,r)=>{var a;r?(0,pa.flushSync)(t):t(),null==(a=e.onChange)||a.call(e,n,r)}},[r]=a.useState((()=>new pi(n)));return r.setOptions(n),a.useEffect((()=>r._didMount()),[]),hi((()=>r._willUpdate())),r}({observeElementRect:ii,observeElementOffset:ci,scrollToFn:di,...e})}({count:Q.length,getScrollElement:()=>z.floating.current,estimateSize:e=>Q[e].description?60:38,overscan:5}),Z=(0,a.useCallback)(((e,n)=>{"Backspace"!==e.key||y||(n?E((e=>{const t=[...e];return t.splice(-1,1),t})):"key"===S&&(t._removeLastFilter(),K(S)))}),[y,S,t,K]),J=(0,a.useCallback)(((n,a)=>{var o;"Tab"!==n.key||n.shiftKey||(a&&(n.preventDefault(),N(t,e,C),null==(o=z.domReference.current)||o.focus()),null==r||r(),L())}),[e,C,r,N,L,t,z.domReference]),ee=(0,a.useCallback)(((n,a)=>{"Tab"===n.key&&n.shiftKey&&(a&&(n.preventDefault(),N(t,e,C,!0)),null==r||r(),L())}),[e,C,r,N,L,t]),te=(0,a.useCallback)(((n,a)=>{if("Enter"===n.key&&null!=w){if(!Q[w])return;const n=Q[w];a?B(n):(t._updateFilter(e,Ri(S,n)),_i(S,O,r,z.domReference.current),x(0)),v("")}}),[w,e,S,Q,B,r,t,z.domReference]);(0,a.useEffect)((()=>{u&&K(S)}),[u,S]),(0,a.useEffect)((()=>{var t,r;if(!n){if(O("value"),v(""),I&&(null==(t=null==e?void 0:e.values)?void 0:t.length)){const t=e.values.reduce(((t,n,r)=>{var a;return[...t,{label:(null==(a=e.valueLabels)?void 0:a[r])||n,value:n}]}),[]);E(t)}null==(r=z.domReference.current)||r.focus()}}),[]),(0,a.useEffect)((()=>{T&&C&&setTimeout((()=>P({})))}),[C,T]),(0,a.useLayoutEffect)((()=>{var e,t;null!==w&&X.range&&(w>(null==(e=X.range)?void 0:e.endIndex)||w<(null==(t=X.range)?void 0:t.startIndex))&&X.scrollToIndex(w)}),[w,X]);const ne=null!=(s=null==e?void 0:e.keyLabel)?s:null==e?void 0:e.key;return i().createElement("div",{className:D.comboboxWrapper},e?i().createElement("div",{className:D.pillWrapper},(null==e?void 0:e.key)?i().createElement("div",{className:(0,Zt.cx)(D.basePill,D.keyPill)},ne):null,(null==e?void 0:e.key)&&(null==e?void 0:e.operator)&&"operator"!==S?i().createElement("div",{id:k,className:(0,Zt.cx)(D.basePill,D.operatorPill,k),role:"button","aria-label":"Edit filter operator",tabIndex:0,onClick:e=>{e.stopPropagation(),Pi("operator",O,void 0,z.domReference.current)},onKeyDown:e=>{ee(e,I),"Enter"===e.key&&Pi("operator",O,void 0,z.domReference.current)}},e.operator):null,i().createElement("div",{ref:R}),T?C.map(((e,t)=>i().createElement(Wi,{key:`${e.value}-${t}`,item:e,index:t,handleRemoveMultiValue:q}))):null):null,i().createElement("input",Fi(Vi({},H({ref:z.setReference,onChange:function(e){const t=e.target.value;v(t),x(0)},value:y,placeholder:Ti(e,S,T,n),"aria-autocomplete":"list",onKeyDown(e){u?("operator"===S&&ee(e),Z(e,T),J(e,T),te(e,T)):d(!0)}})),{className:(0,Zt.cx)(D.inputStyle,{[D.loadingInputPadding]:!h}),onClick:e=>{e.stopPropagation(),d(!0)},onFocus:()=>{x(0),d(!0)}})),h?i().createElement(Yt.Spinner,{className:D.loadingIndicator,inline:!0}):null,i().createElement(Ao,null,u&&i().createElement(Fo,{context:U,initialFocus:-1,visuallyHiddenDismiss:!0,modal:!1},i().createElement(i().Fragment,null,i().createElement("div",{style:Fi(Vi({},W),{width:`${m?366:Y}px`,transform:T?`translate(${(null==(l=R.current)?void 0:l.getBoundingClientRect().left)||0}px, ${((null==(c=z.domReference.current)?void 0:c.getBoundingClientRect().bottom)||0)+10}px )`:W.transform}),ref:z.setFloating,className:D.dropdownWrapper,tabIndex:-1},i().createElement("div",Fi(Vi({style:{height:`${X.getTotalSize()||38}px`}},$()),{tabIndex:-1}),h?i().createElement(Si,null):m?i().createElement(Di,{handleFetchOptions:()=>K(S)}):Q.length||"operator"!==S&&y?X.getVirtualItems().map((n=>{var a;const o=Q[n.index],s=n.index;if(o.options)return i().createElement("div",{key:`${o.label}+${s}`,className:(0,Zt.cx)(D.optionGroupLabel,D.groupTopBorder),style:{height:`${n.size}px`,transform:`translateY(${n.start}px)`}},i().createElement(Yt.Text,{weight:"bold",variant:"bodySmall",color:"secondary"},o.label));const l=Q[n.index+1],c=l&&!l.group&&!l.options&&o.group;return i().createElement(wi,Fi(Vi({},G({key:`${o.value}-${s}`,ref(e){A.current[s]=e},onClick(n){var a;"value"!==S&&n.stopPropagation(),T?(n.preventDefault(),n.stopPropagation(),B(o),null==(a=z.domReference.current)||a.focus()):(t._updateFilter(e,Ri(S,o)),v(""),_i(S,O,r,z.domReference.current))}})),{active:w===s,addGroupBottomBorder:c,style:{height:`${n.size}px`,transform:`translateY(${n.start}px)`},"aria-setsize":Q.length,"aria-posinset":n.index+1,isMultiValueEdit:T,checked:C.some((e=>e.value===o.value))}),i().createElement("span",null,o.isCustom?"Use custom value: ":""," ",null!=(a=o.label)?a:o.value),o.description?i().createElement("div",{className:D.descriptionText},o.description):null)})):i().createElement(Oi,null))),T&&!h&&!m&&Q.length?i().createElement(Ci,{onApply:()=>{N(t,e,C)},floatingElement:z.floating.current,maxOptionWidth:Y}):null))))})),Wi=({item:e,handleRemoveMultiValue:t,index:n})=>{var r,a;const o=(0,Yt.useStyles2)(Ui);return i().createElement("div",{className:(0,Zt.cx)(o.basePill,o.valuePill)},i().createElement("span",null," ",null!=(r=e.label)?r:e.value),i().createElement(Yt.Button,{onClick:n=>{n.stopPropagation(),n.preventDefault(),t(e)},onKeyDownCapture:n=>{"Enter"===n.key&&(n.preventDefault(),n.stopPropagation(),t(e))},fill:"text",size:"sm",variant:"secondary",className:o.removeButton,tooltip:`Remove filter value - ${null!=(a=e.label)?a:e.value}`},i().createElement(Yt.Icon,{name:"times",size:"md",id:`${e.value}-${n}`})))},Ui=e=>({comboboxWrapper:(0,Zt.css)({display:"flex",flexWrap:"wrap"}),pillWrapper:(0,Zt.css)({display:"flex",alignItems:"center",flexWrap:"wrap"}),basePill:(0,Zt.css)(Fi(Vi({display:"flex",alignItems:"center",background:e.colors.action.disabledBackground,border:`1px solid ${e.colors.border.weak}`,padding:e.spacing(.125,1,.125,1),color:e.colors.text.primary,overflow:"hidden",whiteSpace:"nowrap",minHeight:e.spacing(2.75)},e.typography.bodySmall),{cursor:"pointer"})),keyPill:(0,Zt.css)({fontWeight:e.typography.fontWeightBold,cursor:"default"}),operatorPill:(0,Zt.css)({"&:hover":{background:e.colors.action.hover}}),valuePill:(0,Zt.css)({background:e.colors.action.selected,padding:e.spacing(.125,0,.125,1)}),dropdownWrapper:(0,Zt.css)({backgroundColor:e.colors.background.primary,color:e.colors.text.primary,boxShadow:e.shadows.z2,overflowY:"auto",zIndex:e.zIndex.dropdown}),inputStyle:(0,Zt.css)({paddingBlock:0,"&:focus":{outline:"none"}}),loadingIndicator:(0,Zt.css)({color:e.colors.text.secondary,marginLeft:e.spacing(.5)}),loadingInputPadding:(0,Zt.css)({paddingRight:e.spacing(2.5)}),optionGroupLabel:(0,Zt.css)({padding:e.spacing(1),position:"absolute",top:0,left:0,width:"100%"}),groupTopBorder:(0,Zt.css)({"&:not(:first-child)":{borderTop:`1px solid ${e.colors.border.weak}`}}),removeButton:(0,Zt.css)({marginInline:e.spacing(.5),height:"100%",padding:0,cursor:"pointer","&:hover":{color:e.colors.text.primary}}),descriptionText:(0,Zt.css)(Fi(Vi({},e.typography.bodySmall),{color:e.colors.text.secondary,paddingTop:e.spacing(.5)})),multiValueApply:(0,Zt.css)({position:"absolute",top:0,left:0,display:"flex"})});var Hi=Object.defineProperty,$i=Object.defineProperties,Gi=Object.getOwnPropertyDescriptors,qi=Object.getOwnPropertySymbols,Qi=Object.prototype.hasOwnProperty,Yi=Object.prototype.propertyIsEnumerable,Ki=(e,t,n)=>t in e?Hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xi=(e,t)=>{for(var n in t||(t={}))Qi.call(t,n)&&Ki(e,n,t[n]);if(qi)for(var n of qi(t))Yi.call(t,n)&&Ki(e,n,t[n]);return e};function Zi({filter:e,model:t,readOnly:n,focusOnInputRef:r}){var o,s,l;const c=(0,Yt.useStyles2)(Ji),[u,d]=(0,a.useState)(!0),[p,f]=(0,a.useState)(!1),h=(0,a.useRef)(null),g=null!=(o=e.keyLabel)?o:e.key,m=(null==(s=e.valueLabels)?void 0:s.join(", "))||(null==(l=e.values)?void 0:l.join(", "))||e.value,b=(0,a.useCallback)((e=>{null==e||e.stopPropagation(),n||(f(!u),d(!u))}),[n,u]);if((0,a.useEffect)((()=>{var e;p&&(null==(e=h.current)||e.focus(),f(!1))}),[p]),u){const a=i().createElement("span",{className:c.pillText},g," ",e.operator," ",m);return i().createElement("div",{className:(0,Zt.cx)(c.combinedFilterPill,{[c.readOnlyCombinedFilter]:n}),onClick:b,onKeyDown:e=>{"Enter"===e.key&&b()},role:"button","aria-label":`Edit filter with key ${g}`,tabIndex:0,ref:h},m.length<20?a:i().createElement(Yt.Tooltip,{content:i().createElement("div",{className:c.tooltipText},m),placement:"top"},a),n?null:i().createElement(Yt.IconButton,{onClick:n=>{n.stopPropagation(),t._removeFilter(e),setTimeout((()=>null==r?void 0:r()))},onKeyDownCapture:n=>{"Enter"===n.key&&(n.preventDefault(),n.stopPropagation(),t._removeFilter(e),setTimeout((()=>null==r?void 0:r())))},name:"times",size:"md",className:c.removeButton,tooltip:`Remove filter with key ${g}`}))}return i().createElement(zi,{filter:e,model:t,handleChangeViewMode:b})}const Ji=e=>{return{combinedFilterPill:(0,Zt.css)((t=Xi({display:"flex",alignItems:"center",background:e.colors.action.selected,borderRadius:e.shape.radius.default,border:`1px solid ${e.colors.border.weak}`,padding:e.spacing(.125,0,.125,1),color:e.colors.text.primary,overflow:"hidden",whiteSpace:"nowrap",minHeight:e.spacing(2.75)},e.typography.bodySmall),n={fontWeight:e.typography.fontWeightBold,cursor:"pointer","&:hover":{background:e.colors.action.hover}},$i(t,Gi(n)))),readOnlyCombinedFilter:(0,Zt.css)({paddingRight:e.spacing(1),cursor:"text","&:hover":{background:e.colors.action.selected}}),removeButton:(0,Zt.css)({marginInline:e.spacing(.5),cursor:"pointer","&:hover":{color:e.colors.text.primary}}),pillText:(0,Zt.css)({maxWidth:"200px",width:"100%",textOverflow:"ellipsis",overflow:"hidden"}),tooltipText:(0,Zt.css)({textAlign:"center"})};var t,n},es=(0,a.forwardRef)((function({model:e},t){const{_wip:n}=e.useState();return(0,a.useLayoutEffect)((()=>{n||e._addWip()}),[n]),i().createElement(zi,{model:e,filter:n,isAlwaysWip:!0,ref:t})})),ts=(0,a.memo)((function({model:e}){const{filters:t,readOnly:n}=e.useState(),r=(0,Yt.useStyles2)(ns),o=(0,a.useRef)();return i().createElement("div",{className:(0,Zt.cx)(r.comboboxWrapper,{[r.comboboxFocusOutline]:!n}),onClick:()=>{var e;null==(e=o.current)||e.call(o)}},i().createElement(Yt.Icon,{name:"filter",className:r.filterIcon,size:"lg"}),t.map(((t,r)=>i().createElement(Zi,{key:r,filter:t,model:e,readOnly:n,focusOnInputRef:o.current}))),n?null:i().createElement(es,{model:e,ref:o}))})),ns=e=>({comboboxWrapper:(0,Zt.css)({display:"flex",flexWrap:"wrap",alignItems:"center",columnGap:e.spacing(1),rowGap:e.spacing(.5),minHeight:e.spacing(4),backgroundColor:e.components.input.background,border:`1px solid ${e.colors.border.strong}`,borderRadius:e.shape.radius.default,paddingInline:e.spacing(1),paddingBlock:e.spacing(.5),flexGrow:1}),comboboxFocusOutline:(0,Zt.css)({"&:focus-within":{outline:"2px dotted transparent",outlineOffset:"2px",boxShadow:`0 0 0 2px ${e.colors.background.canvas}, 0 0 0px 4px ${e.colors.primary.main}`,transitionTimingFunction:"cubic-bezier(0.19, 1, 0.22, 1)",transitionDuration:"0.2s",transitionProperty:"outline, outline-offset, box-shadow",zIndex:2}}),filterIcon:(0,Zt.css)({color:e.colors.text.secondary,alignSelf:"center"})});var rs=Object.defineProperty,as=Object.getOwnPropertySymbols,os=Object.prototype.hasOwnProperty,is=Object.prototype.propertyIsEnumerable,ss=(e,t,n)=>t in e?rs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ls=(e,t)=>{for(var n in t||(t={}))os.call(t,n)&&ss(e,n,t[n]);if(as)for(var n of as(t))is.call(t,n)&&ss(e,n,t[n]);return e};const cs=[{value:"=",description:"Equals"},{value:"!=",description:"Not equal"},{value:"=|",description:"One of. Use to filter on multiple values.",isMulti:!0},{value:"!=|",description:"Not one of. Use to exclude multiple values.",isMulti:!0},{value:"=~",description:"Matches regex"},{value:"!~",description:"Does not match regex"},{value:"<",description:"Less than"},{value:">",description:"Greater than"}];class us extends J{constructor(e){var t,n;super(ls({type:"adhoc",name:null!=(t=e.name)?t:"Filters",filters:[],datasource:null,applyMode:"auto",filterExpression:null!=(n=e.filterExpression)?n:ds(e.expressionBuilder,e.filters)},e)),this._scopedVars={__sceneObject:Sn(this)},this._dataSourceSrv=(0,c.getDataSourceSrv)(),this._urlSync=new Qn(this),"auto"===this.state.applyMode&&function(e){if(e.addActivationHandler((()=>(Wt.add(e),()=>Wt.delete(e)))),zt)return;const t=(0,c.getTemplateSrv)();(null==t?void 0:t.getAdhocFilters)?(zt=t.getAdhocFilters,t.getAdhocFilters=function(e){var n;if(0===Wt.size)return zt.call(t);const r=(0,c.getDataSourceSrv)().getInstanceSettings(e);if(!r)return[];for(const e of Wt.values())if((null==(n=e.state.datasource)?void 0:n.uid)===r.uid)return e.state.filters;return[]}.bind(t)):console.log("Failed to patch getAdhocFilters")}(this)}setState(e){let t=!1;e.filters&&e.filters!==this.state.filters&&!e.filterExpression&&(e.filterExpression=ds(this.state.expressionBuilder,e.filters),t=e.filterExpression!==this.state.filterExpression),super.setState(e),t&&this.publishEvent(new Ne(this),!0)}getValue(){return this.state.filterExpression}_updateFilter(e,t){const{filters:n,_wip:r}=this.state;if(e===r)return void("value"in t&&""!==t.value?this.setState({filters:[...n,ls(ls({},r),t)],_wip:void 0}):this.setState({_wip:ls(ls({},e),t)}));const a=this.state.filters.map((n=>n===e?ls(ls({},n),t):n));this.setState({filters:a})}_removeFilter(e){e!==this.state._wip?this.setState({filters:this.state.filters.filter((t=>t!==e))}):this.setState({_wip:void 0})}_removeLastFilter(){const e=this.state.filters.at(-1);e&&this._removeFilter(e)}async _getKeys(e){var t,n,r;const a=await(null==(n=(t=this.state).getTagKeysProvider)?void 0:n.call(t,this,e));if(a&&a.replace)return Ws(a.values).map(fs);if(this.state.defaultKeys)return this.state.defaultKeys.map(fs);const o=await this._dataSourceSrv.get(this.state.datasource,this._scopedVars);if(!o||!o.getTagKeys)return[];const i=this.state.filters.filter((t=>t.key!==e)).concat(null!=(r=this.state.baseFilters)?r:[]),s=wl.getTimeRange(this).state.value,l=this.state.useQueriesAsFilterForOptions?Ns(this):void 0,c=await o.getTagKeys(ls({filters:i,queries:l,timeRange:s},yn(this)));Us(c)&&this.setState({error:c.error.message});let u=Ws(c);a&&(u=u.concat(Ws(a.values)));const d=this.state.tagKeyRegexFilter;return d&&(u=u.filter((e=>e.text.match(d)))),u.map(fs)}async _getValuesFor(e){var t,n,r;const a=await(null==(n=(t=this.state).getTagValuesProvider)?void 0:n.call(t,this,e));if(a&&a.replace)return Ws(a.values).map(fs);const o=await this._dataSourceSrv.get(this.state.datasource,this._scopedVars);if(!o||!o.getTagValues)return[];const i=this.state.filters.filter((t=>t.key!==e.key)).concat(null!=(r=this.state.baseFilters)?r:[]),s=wl.getTimeRange(this).state.value,l=this.state.useQueriesAsFilterForOptions?Ns(this):void 0,c=await o.getTagValues(ls({key:e.key,filters:i,timeRange:s,queries:l},yn(this)));Us(c)&&this.setState({error:c.error.message});let u=Ws(c);return a&&(u=u.concat(Ws(a.values))),u.map(fs)}_addWip(){this.setState({_wip:{key:"",value:"",operator:"=",condition:""}})}_getOperators(){return(this.state.supportsMultiValueOperators?cs:cs.filter((e=>!e.isMulti))).map((({value:e,description:t})=>({label:e,value:e,description:t})))}}function ds(e,t){return(null!=e?e:As)(null!=t?t:[])}us.Component=function({model:e}){const{filters:t,readOnly:n,addFilterButtonText:r}=e.useState(),a=(0,Yt.useStyles2)(ps);return"combobox"===e.state.layout?i().createElement(ts,{model:e}):i().createElement("div",{className:a.wrapper},t.map(((t,n)=>i().createElement(i().Fragment,{key:n},i().createElement($n,{filter:t,model:e})))),!n&&i().createElement(qn,{model:e,key:"'builder",addFilterButtonText:r}))};const ps=e=>({wrapper:(0,Zt.css)({display:"flex",flexWrap:"wrap",alignItems:"flex-end",columnGap:e.spacing(2),rowGap:e.spacing(1)})});function fs(e){const{text:t,value:n}=e,r={label:t,value:String(null!=n?n:t)};return"group"in e&&(r.group=e.group),r}function hs(e){return""!==e.key&&""!==e.operator&&""!==e.value}function gs(e){const t=cs.find((t=>t.value===e));return!!t&&Boolean(t.isMulti)}class ms{constructor(){this._resultsMap=new Map,this._prevLayers=[]}getMergedStream(e){(function(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1})(e,this._prevLayers)&&(this._resultsMap=new Map,this._prevLayers=e);const t=e.map((e=>e.getResultsStream())),n=[];for(const t of e)n.push(t.activate());return(0,E.merge)(t).pipe((0,E.mergeAll)(),(0,E.filter)((e=>this._resultsMap.get(e.origin.state.key)!==e)),(0,E.map)((e=>(this._resultsMap.set(e.origin.state.key,e),this._resultsMap.values()))),(0,E.finalize)((()=>{n.forEach((e=>e()))})))}}var bs=Object.defineProperty,ys=Object.defineProperties,vs=Object.getOwnPropertyDescriptors,ws=Object.getOwnPropertySymbols,xs=Object.prototype.hasOwnProperty,Ss=Object.prototype.propertyIsEnumerable,Os=(e,t,n)=>t in e?bs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ds=(e,t)=>{for(var n in t||(t={}))xs.call(t,n)&&Os(e,n,t[n]);if(ws)for(var n of ws(t))Ss.call(t,n)&&Os(e,n,t[n]);return e},Cs=(e,t)=>ys(e,vs(t));let Es=100;function _s(){return"SQR"+Es++}class Ps extends J{constructor(e){super(e),this._dataLayersMerger=new ms,this._variableValueRecorder=new xt,this._results=new E.ReplaySubject(1),this._scopedVars={__sceneObject:Sn(this)},this._variableDependency=new $s(this,{statePaths:["queries","datasource"],onVariableUpdateCompleted:this.onVariableUpdatesCompleted.bind(this),onAnyVariableChanged:this.onAnyVariableChanged.bind(this)}),this.onDataReceived=e=>{const t=(0,l.preProcessPanelData)(e,this.state.data);this._resultAnnotations=e.annotations;const n=this._combineDataLayers(t);let r=this.state._hasFetchedData;r||t.state===ge.Loading||(r=!0),this.setState({data:n,_hasFetchedData:r}),this._results.next({origin:this,data:n})},this.addActivationHandler((()=>this._onActivate()))}getResultsStream(){return this._results}_onActivate(){if(this.isQueryModeAuto()){const e=wl.getTimeRange(this),t=this.getClosestExtraQueryProviders();for(const e of t)this._subs.add(e.subscribeToState(((t,n)=>{e.shouldRerun(n,t,this.state.queries)&&this.runQueries()})));this.subscribeToTimeRangeChanges(e),this.shouldRunQueriesOnActivate()&&this.runQueries()}return this._dataLayersSub||this._handleDataLayers(),()=>this._onDeactivate()}_handleDataLayers(){const e=wl.getDataLayers(this);0!==e.length&&(this._dataLayersSub=this._dataLayersMerger.getMergedStream(e).subscribe(this._onLayersReceived.bind(this)))}_onLayersReceived(e){var t,n,r,a,o;const i=wl.getTimeRange(this),{dataLayerFilter:s}=this.state;let c,u=[],d=[];for(const r of e)for(let e of r.data.series)(null==(t=e.meta)?void 0:t.dataTopic)===l.DataTopic.Annotations&&(u=u.concat(e)),(null==(n=e.meta)?void 0:n.dataTopic)===l.DataTopic.AlertStates&&(d=d.concat(e));if((null==s?void 0:s.panelId)&&(u.length>0&&(u=function(e,t){var n;if(!Array.isArray(e)||0===e.length)return e;const r=Array.from({length:e.length},(()=>new Set));let a=0;for(const o of e){for(let e=0;e<o.length;e++){if(r[a].has(e))continue;let i=!0;const s=o.fields.find((e=>"panelId"===e.name)),l=o.fields.find((e=>"source"===e.name));if(l){s&&"dashboard"===l.values[e].type&&(i=s.values[e]===t.panelId);const r=l.values[e].filter;if(r){const e=(null!=(n=r.ids)?n:[]).includes(t.panelId);r.exclude?e&&(i=!1):e||(i=!1)}}i&&r[a].add(e)}a++}const o=[];a=0;for(const t of e){const e=r[a].size,n=[];for(const e of t.fields){const o=[];for(let n=0;n<t.length;n++)r[a].has(n)&&o.push(e.values[n]);n.push(Vt(Bt({},e),{values:o}))}o.push(Vt(Bt({},t),{fields:n,length:e})),a++}return o}(u,s)),d.length>0))for(const e of d){const t=new l.DataFrameView(e);for(const e of t)if(e.panelId===s.panelId){c=e;break}}if(Is(u)&&Is(this._layerAnnotations)&&(0,pe.isEqual)(c,null==(r=this.state.data)?void 0:r.alertState))return;this._layerAnnotations=u;const p=this.state.data?this.state.data:Cs(Ds({},Se),{timeRange:i.state.value});this.setState({data:Cs(Ds({},p),{annotations:[...null!=(a=this._resultAnnotations)?a:[],...u],alertState:null!=c?c:null==(o=this.state.data)?void 0:o.alertState})})}onVariableUpdatesCompleted(){this.isQueryModeAuto()&&this.runQueries()}onAnyVariableChanged(e){this._adhocFiltersVar!==e&&this._groupByVar!==e&&this.isQueryModeAuto()&&(e instanceof us&&this._isRelevantAutoVariable(e)&&this.runQueries(),e instanceof Tn&&this._isRelevantAutoVariable(e)&&this.runQueries())}_isRelevantAutoVariable(e){var t,n;const r=null!=(t=this.state.datasource)?t:Rs(this.state.queries);return"auto"===e.state.applyMode&&(null==r?void 0:r.uid)===(null==(n=e.state.datasource)?void 0:n.uid)}shouldRunQueriesOnActivate(){return this._variableValueRecorder.hasDependenciesChanged(this)?(vt("SceneQueryRunner","Variable dependency changed while inactive, shouldRunQueriesOnActivate returns true"),!0):!this.state.data||!!this._isDataTimeRangeStale(this.state.data)}_isDataTimeRangeStale(e){const t=wl.getTimeRange(this).state.value,n=e.timeRange;return(t.from.unix()!==n.from.unix()||t.to.unix()!==n.to.unix())&&(vt("SceneQueryRunner","Data time range is stale"),!0)}_onDeactivate(){var e;this._querySub&&(this._querySub.unsubscribe(),this._querySub=void 0),this._dataLayersSub&&(this._dataLayersSub.unsubscribe(),this._dataLayersSub=void 0),null==(e=this._timeSub)||e.unsubscribe(),this._timeSub=void 0,this._timeSubRange=void 0,this._adhocFiltersVar=void 0,this._groupByVar=void 0,this._variableValueRecorder.recordCurrentDependencyValuesForSceneObject(this)}setContainerWidth(e){!this._containerWidth&&e>0?(this._containerWidth=e,this.state.maxDataPointsFromWidth&&!this.state.maxDataPoints&&setTimeout((()=>{this.isActive&&!this.state._hasFetchedData&&this.runQueries()}),0)):e>0&&(this._containerWidth=e)}isDataReadyToDisplay(){return Boolean(this.state._hasFetchedData)}subscribeToTimeRangeChanges(e){this._timeSubRange!==e&&(this._timeSub&&this._timeSub.unsubscribe(),this._timeSubRange=e,this._timeSub=e.subscribeToState((()=>{this.runWithTimeRange(e)})))}runQueries(){const e=wl.getTimeRange(this);this.isQueryModeAuto()&&this.subscribeToTimeRangeChanges(e),this.runWithTimeRange(e)}getMaxDataPoints(){var e;return this.state.maxDataPoints?this.state.maxDataPoints:this.state.maxDataPointsFromWidth&&null!=(e=this._containerWidth)?e:500}cancelQuery(){var e;null==(e=this._querySub)||e.unsubscribe(),this._dataLayersSub&&(this._dataLayersSub.unsubscribe(),this._dataLayersSub=void 0),this.setState({data:Cs(Ds({},this.state.data),{state:ge.Done})})}async runWithTimeRange(e){var t,n,r;if(!this.state.maxDataPoints&&this.state.maxDataPointsFromWidth&&!this._containerWidth)return;if(this._dataLayersSub||this._handleDataLayers(),null==(t=this._querySub)||t.unsubscribe(),this._variableDependency.hasDependencyInLoadingState())return vt("SceneQueryRunner","Variable dependency is in loading state, skipping query execution"),void this.setState({data:Cs(Ds({},null!=(n=this.state.data)?n:Se),{state:ge.Loading})});const{queries:a}=this.state;if(null==a?void 0:a.length)try{const t=null!=(r=this.state.datasource)?r:Rs(a),n=await wt(t,this._scopedVars);this.findAndSubscribeToAdHocFilters(null==t?void 0:t.uid);const o=(0,c.getRunRequest)(),{primary:i,secondaries:s,processors:l}=this.prepareRequests(e,n);vt("SceneQueryRunner","Starting runRequest",this.state.key);let u=o(n,i);if(s.length>0){const e=s.map((e=>o(n,e))),t=(e=>t=>t.pipe((0,E.mergeMap)((([t,...n])=>{const r=n.flatMap((n=>{var r,a;return null!=(a=null==(r=e.get(n.request.requestId))?void 0:r(t,n))?a:(0,E.of)(n)}));return(0,E.forkJoin)([(0,E.of)(t),...r])})),(0,E.map)((([e,...t])=>{var n,r,a;return r=((e,t)=>{for(var n in t||(t={}))_t.call(t,n)&&Rt(e,n,t[n]);if(Et)for(var n of Et(t))Pt.call(t,n)&&Rt(e,n,t[n]);return e})({},e),a={series:[...e.series,...t.flatMap((e=>e.series))],annotations:[...null!=(n=e.annotations)?n:[],...t.flatMap((e=>{var t;return null!=(t=e.annotations)?t:[]}))]},Dt(r,Ct(a))}))))(l);u=(0,E.forkJoin)([u,...e]).pipe(t)}u=u.pipe(Ut({type:"data",request:i,origin:this,cancel:()=>this.cancelQuery()})),this._querySub=u.subscribe(this.onDataReceived)}catch(e){console.error("PanelQueryRunner Error",e),this.onDataReceived(Cs(Ds(Ds({},Se),this.state.data),{state:ge.Error,errors:[(0,c.toDataQueryError)(e)]}))}else this._setNoDataState()}clone(e){var t;const n=super.clone(e);return this._resultAnnotations&&(n._resultAnnotations=this._resultAnnotations.map((e=>Ds({},e)))),this._layerAnnotations&&(n._layerAnnotations=this._layerAnnotations.map((e=>Ds({},e)))),n._variableValueRecorder=this._variableValueRecorder.cloneAndRecordCurrentValuesForSceneObject(this),n._containerWidth=this._containerWidth,n._results.next({origin:this,data:null!=(t=this.state.data)?t:Se}),n}prepareRequests(e,t){var n;const{minInterval:r,queries:a}=this.state;let o=Ds({app:"scenes",requestId:_s(),timezone:e.getTimeZone(),range:e.state.value,interval:"1s",intervalMs:1e3,targets:(0,pe.cloneDeep)(a),maxDataPoints:this.getMaxDataPoints(),scopedVars:this._scopedVars,startTime:Date.now(),liveStreaming:this.state.liveStreaming,rangeRaw:{from:e.state.from,to:e.state.to},cacheTimeout:this.state.cacheTimeout,queryCachingTTL:this.state.queryCachingTTL},Ft(this));this._adhocFiltersVar&&(o.filters=this._adhocFiltersVar.state.filters.filter(hs)),this._groupByVar&&(o.groupByKeys=this._groupByVar.state.value),o.targets=o.targets.map((e=>{var n;return e.datasource&&(e.datasource.uid===t.uid||(null==(n=t.meta)?void 0:n.mixed)||!c.isExpressionReference||(0,c.isExpressionReference)(e.datasource))||(e.datasource=t.getRef()),e}));const i=r?ml(this,r):t.interval,s=l.rangeUtil.calculateInterval(e.state.value,o.maxDataPoints,i);o.scopedVars=Object.assign({},o.scopedVars,{__interval:{text:s.interval,value:s.interval},__interval_ms:{text:s.intervalMs.toString(),value:s.intervalMs}}),o.interval=s.interval,o.intervalMs=s.intervalMs;const u=e.state.value;let d=[],p=new Map;for(const e of null!=(n=this.getClosestExtraQueryProviders())?n:[])for(const{req:t,processor:n}of e.getExtraQueries(o)){const e=_s();d.push(Cs(Ds({},t),{requestId:e})),p.set(e,null!=n?n:It)}return o.range=u,{primary:o,secondaries:d,processors:p}}_combineDataLayers(e){return this._layerAnnotations&&this._layerAnnotations.length>0&&(e.annotations=(e.annotations||[]).concat(this._layerAnnotations)),this.state.data&&this.state.data.alertState&&(e.alertState=this.state.data.alertState),e}_setNoDataState(){this.state.data!==Se&&this.setState({data:Se})}getClosestExtraQueryProviders(){const e=new Map;return this.parent?(ce(this.parent,(t=>(St(t)&&!e.has(t.constructor)&&e.set(t.constructor,t),t.forEachChild((t=>{St(t)&&!e.has(t.constructor)&&e.set(t.constructor,t)})),null))),Array.from(e.values())):[]}findAndSubscribeToAdHocFilters(e){const t=function(e){var t;for(const n of Wt.values())if((null==(t=n.state.datasource)?void 0:t.uid)===e)return n}(e);this._adhocFiltersVar!==t&&(this._adhocFiltersVar=t,this._updateExplicitVariableDependencies());const n=function(e){var t;for(const n of Ht.values())if((null==(t=n.state.datasource)?void 0:t.uid)===e)return n}(e);this._groupByVar!==n&&(this._groupByVar=n,this._updateExplicitVariableDependencies())}_updateExplicitVariableDependencies(){const e=[];this._adhocFiltersVar&&e.push(this._adhocFiltersVar.state.name),this._groupByVar&&e.push(this._groupByVar.state.name),this._variableDependency.setVariableNames(e)}isQueryModeAuto(){var e;return"auto"===(null!=(e=this.state.runQueriesMode)?e:"auto")}}function Rs(e){var t,n;return null!=(n=null==(t=e.find((e=>null!==e.datasource)))?void 0:t.datasource)?n:void 0}function Is(e){if(!e)return!0;for(let t=0;t<e.length;t++)if(e[t].length>0)return!1;return!0}function Ts(e,t){return e===t||(0,pe.isEqual)(e,t)}function ks(e){try{return JSON.stringify(e,(()=>{const e=new WeakSet;return(t,n)=>{if("object"==typeof n&&null!==n){if(e.has(n))return;e.add(n)}return n}})())}catch(e){console.error(e)}return""}function As(e){return e.map((e=>function(e){var t,n;let r="",a=e.operator;return"=|"===a?(a="=~",r=null==(t=e.values)?void 0:t.map(Ms).join("|")):"!=|"===a?(a="!~",r=null==(n=e.values)?void 0:n.map(Ms).join("|")):r="=~"===a||"!~"===a?Ms(e.value):js(e.value),`${e.key}${a}"${r}"`}(e))).join(",")}function js(e){return e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/"/g,'\\"')}function Ms(e){return js(e.replace(Ls,"\\$&"))}const Ls=/[*+?()|\\.\[\]{}^$]/g;function Ns(e){const t=function(e){const t={};for(const n of e)n.state.key&&(n.state.key in t||(t[n.state.key]=[]),t[n.state.key].push(n));return Object.values(t).flatMap((e=>{const t=e.filter((e=>e.isActive));return 0===t.length&&1===e.length?e:t}))}(wl.findAllObjects(e.getRoot(),(e=>e instanceof Ps))).filter((t=>{var n,r;return(null==(n=t.state.datasource)?void 0:n.uid)===(null==(r=e.state.datasource)?void 0:r.uid)}));if(0===t.length)return[];const n=[];return t.forEach((e=>{n.push(...e.state.queries)})),n}function Bs(e){return null==e?"":/\|/g[Symbol.replace](e,"__gfp__")}function Vs(e){return null==e?"":/,/g[Symbol.replace](e,"__gfc__")}function Fs(e){return null==e?"":(e=/__gfp__/g[Symbol.replace](e,"|"),e=/__gfc__/g[Symbol.replace](e,","))}function zs(e,t){return t&&e!==t?[e,t].map(Vs).join(","):Vs(e)}function Ws(e){return Array.isArray(e)?e:e.data}function Us(e){return!Array.isArray(e)&&Boolean(e.error)}function Hs(e){const t=[],n=new Map;for(const r of e){const e=r.group;if(e){let a=n.get(e);a||(a=[],n.set(e,a),t.push({label:e,options:a})),a.push(r)}else t.push(r)}return t}class $s{constructor(e,t){this._sceneObject=e,this._options=t,this._dependencies=new Set,this._isWaitingForVariables=!1,this.scanCount=0,this._statePaths=t.statePaths}hasDependencyOn(e){return this.getNames().has(e)}variableUpdateCompleted(e,t){const n=this.getNames();let r=!1;(n.has(e.state.name)||n.has(l.DataLinkBuiltInVars.includeVars))&&t&&(r=!0),vt("VariableDependencyConfig","variableUpdateCompleted",e.state.name,r,this._isWaitingForVariables),this._options.onAnyVariableChanged&&this._options.onAnyVariableChanged(e),this._options.onVariableUpdateCompleted&&(this._isWaitingForVariables||r)&&this._options.onVariableUpdateCompleted(),r&&(this._options.onReferencedVariableValueChanged&&this._options.onReferencedVariableValueChanged(e),this._options.onReferencedVariableValueChanged||this._options.onVariableUpdateCompleted||this._sceneObject.forceRender())}hasDependencyInLoadingState(){return wl.hasVariableDependencyInLoadingState(this._sceneObject)?(this._isWaitingForVariables=!0,!0):(this._isWaitingForVariables=!1,!1)}getNames(){const e=this._state,t=this._state=this._sceneObject.state;if(!e)return this.scanStateForDependencies(this._state),this._dependencies;if(t!==e)if(this._statePaths){for(const n of this._statePaths)if("*"===n||t[n]!==e[n]){this.scanStateForDependencies(t);break}}else this.scanStateForDependencies(t);return this._dependencies}setVariableNames(e){this._options.variableNames=e,this.scanStateForDependencies(this._state)}setPaths(e){this._statePaths=e}scanStateForDependencies(e){if(this._dependencies.clear(),this.scanCount+=1,this._options.variableNames)for(const e of this._options.variableNames)this._dependencies.add(e);if(this._statePaths)for(const t of this._statePaths){if("*"===t){this.extractVariablesFrom(e);break}{const n=e[t];n&&this.extractVariablesFrom(n)}}}extractVariablesFrom(e){et.lastIndex=0;const t=("string"!=typeof e?ks(e):e).matchAll(et);if(t)for(const e of t){const[,t,n,,r]=e,a=t||n||r;this._dependencies.add(a)}}}const Gs=e=>Boolean(e.metricFindQuery)&&!Boolean(e.variables),qs=e=>{if(!e.variables)return!1;if(e.variables.getType()!==l.VariableSupportType.Standard)return!1;const t=e.variables;return"toDataQuery"in t&&Boolean(t.toDataQuery)},Qs=e=>{if(!e.variables)return!1;if(e.variables.getType()!==l.VariableSupportType.Custom)return!1;const t=e.variables;return"query"in t&&"editor"in t&&Boolean(t.query)&&Boolean(t.editor)};var Ys=Object.defineProperty,Ks=Object.defineProperties,Xs=Object.getOwnPropertyDescriptors,Zs=Object.getOwnPropertySymbols,Js=Object.prototype.hasOwnProperty,el=Object.prototype.propertyIsEnumerable,tl=(e,t,n)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nl=(e,t)=>{for(var n in t||(t={}))Js.call(t,n)&&tl(e,n,t[n]);if(Zs)for(var n of Zs(t))el.call(t,n)&&tl(e,n,t[n]);return e},rl=(e,t)=>Ks(e,Xs(t));class al{constructor(e,t=(0,c.getRunRequest)()){this.datasource=e,this._runRequest=t}getTarget(e){if(qs(this.datasource))return this.datasource.variables.toDataQuery(function(e){var t;const n=null!=(t=e.state.query)?t:"";return"string"==typeof n?{query:n,refId:`variable-${e.state.name}`}:null==n.refId?rl(nl({},n),{refId:`variable-${e.state.name}`}):e.state.query}(e));throw new Error("Couldn't create a target with supplied arguments.")}runRequest(e,t){return qs(this.datasource)?this.datasource.variables.query?this._runRequest(this.datasource,t,this.datasource.variables.query.bind(this.datasource.variables)):this._runRequest(this.datasource,t):sl()}}class ol{constructor(e){this.datasource=e}getTarget(e){if(Gs(this.datasource))return e.state.query;throw new Error("Couldn't create a target with supplied arguments.")}runRequest({variable:e,searchFilter:t},n){return Gs(this.datasource)?(0,E.from)(this.datasource.metricFindQuery(e.state.query,rl(nl({},n),{variable:{name:e.state.name,type:e.state.type},searchFilter:t}))).pipe((0,E.mergeMap)((e=>{if(!e||!e.length)return sl();const t=e;return(0,E.of)({series:t,state:l.LoadingState.Done,timeRange:n.range})}))):sl()}}class il{constructor(e,t=(0,c.getRunRequest)()){this.datasource=e,this._runRequest=t}getTarget(e){if(Qs(this.datasource))return e.state.query;throw new Error("Couldn't create a target with supplied arguments.")}runRequest(e,t){return Qs(this.datasource)?this.datasource.variables.query?this._runRequest(this.datasource,t,this.datasource.variables.query.bind(this.datasource.variables)):this._runRequest(this.datasource,t):sl()}}function sl(){return(0,E.of)({state:l.LoadingState.Done,series:[],timeRange:(0,l.getDefaultTimeRange)()})}const ll=(e,t)=>{const n=[];let r=null;t.lastIndex=0;do{r=t.exec(e),r&&n.push(r)}while(t.global&&r&&""!==r[0]&&void 0!==r[0]);return n};var cl=Object.defineProperty,ul=Object.getOwnPropertySymbols,dl=Object.prototype.hasOwnProperty,pl=Object.prototype.propertyIsEnumerable,fl=(e,t,n)=>t in e?cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class hl extends Gt{constructor(e){super(((e,t)=>{for(var n in t||(t={}))dl.call(t,n)&&fl(e,n,t[n]);if(ul)for(var n of ul(t))pl.call(t,n)&&fl(e,n,t[n]);return e})({type:"query",name:"",value:"",text:"",options:[],datasource:null,regex:"",query:"",refresh:l.VariableRefresh.onDashboardLoad,sort:l.VariableSort.disabled},e)),this._variableDependency=new $s(this,{statePaths:["regex","query","datasource"]}),this.onSearchChange=e=>{ks(this.state.query).indexOf("__searchFilter")>-1&&this._updateOptionsBasedOnSearchFilter(e)},this._updateOptionsBasedOnSearchFilter=(0,pe.debounce)((async e=>{const t=await(0,E.lastValueFrom)(this.getValueOptions({searchFilter:e}));this.setState({options:t,loading:!1})}),400)}getValueOptions(e){return this.state.query?(this.setState({loading:!0,error:null}),(0,E.from)(wt(this.state.datasource,{__sceneObject:Sn(this)})).pipe((0,E.mergeMap)((t=>{const n=function(e){if(qs(e))return new al(e,(0,c.getRunRequest)());if(Gs(e))return new ol(e);if(Qs(e))return new il(e);throw new Error(`Couldn't create a query runner for datasource ${e.type}`)}(t),r=n.getTarget(this),a=this.getRequest(r,e.searchFilter);return n.runRequest({variable:this,searchFilter:e.searchFilter},a).pipe(Ut({type:"variable",request:a,origin:this}),(0,E.filter)((e=>e.state===l.LoadingState.Done||e.state===l.LoadingState.Error)),(0,E.take)(1),(0,E.mergeMap)((e=>e.state===l.LoadingState.Error?(0,E.throwError)((()=>e.error)):(0,E.of)(e))),(e=>e.pipe((0,E.map)((e=>{const t=e.series;if(!t||!t.length)return[];if(function(e){if(!e)return!1;if(!e.length)return!0;const t=e[0];if((0,l.isDataFrame)(t))return!1;for(const e in t){if(!t.hasOwnProperty(e))continue;if(null!==t[e]&&"string"!=typeof t[e]&&"number"!=typeof t[e])continue;const n=e.toLowerCase();if("text"===n||"value"===n)return!0}return!1}(t))return t;if(0===t[0].fields.length)return[];const n=(0,l.getProcessedDataFrames)(t),r=[];let a=-1,o=-1,i=-1,s=-1;for(const e of n)for(let n=0;n<e.fields.length;n++){const r=e.fields[n],c=(0,l.getFieldDisplayName)(r,e,t).toLowerCase();r.type===l.FieldType.string&&-1===i&&(i=n),"text"===c&&r.type===l.FieldType.string&&-1===o&&(o=n),"value"===c&&r.type===l.FieldType.string&&-1===a&&(a=n),"expandable"!==c||r.type!==l.FieldType.boolean&&r.type!==l.FieldType.number||-1!==s||(s=n)}if(-1===i)throw new Error("Couldn't find any field of type string in the results.");for(const e of t)for(let t=0;t<e.length;t++){const n=-1!==s?e.fields[s].values.get(t):void 0,l=e.fields[i].values.get(t),c=-1!==o?e.fields[o].values.get(t):null,u=-1!==a?e.fields[a].values.get(t):null;-1!==a||-1!==o?-1!==a||-1===o?-1===a||-1!==o?r.push({text:c,value:u,expandable:n}):r.push({text:u,value:u,expandable:n}):r.push({text:c,value:c,expandable:n}):r.push({text:l,value:l,expandable:n})}return r})))),(0,E.mergeMap)((e=>{let t="";return this.state.regex&&(t=wl.interpolate(this,this.state.regex,void 0,"regex")),(0,E.of)(((e,t,n)=>{var r,a,o,i,s,c;let u,d=[];e&&(u=(0,l.stringToJsRegex)(e));for(let e=0;e<n.length;e++){const t=n[e];let l=void 0===t.text||null===t.text?t.value:t.text,p=void 0===t.value||null===t.value?t.text:t.value;if((0,pe.isNumber)(p)&&(p=p.toString()),(0,pe.isNumber)(l)&&(l=l.toString()),u){const e=ll(p,u);if(!e.length)continue;const t=e.find((e=>e.groups&&e.groups.value)),n=e.find((e=>e.groups&&e.groups.text)),f=e.find((e=>e.length>1)),h=e.length>1&&f;if(t||n)p=null!=(o=null==(r=null==t?void 0:t.groups)?void 0:r.value)?o:null==(a=null==n?void 0:n.groups)?void 0:a.text,l=null!=(c=null==(i=null==n?void 0:n.groups)?void 0:i.text)?c:null==(s=null==t?void 0:t.groups)?void 0:s.value;else{if(h){for(let t=0;t<e.length;t++){const n=e[t];d.push({label:n[1],value:n[1]})}continue}f&&(l=f[1],p=f[1])}}d.push({label:l,value:p})}return d=(0,pe.uniqBy)(d,"value"),((e,t)=>{if(t===l.VariableSort.disabled)return e;const n=e=>{if(!e.text)return-1;const t=e.text.match(/.*?(\d+).*/);return!t||t.length<2?-1:parseInt(t[1],10)},r=e=>e.sort(((e,t)=>e.text?t.text?e.text.localeCompare(t.text,void 0,{numeric:!0}):1:-1));switch(t){case l.VariableSort.alphabeticalAsc:e=(0,pe.sortBy)(e,"label");break;case l.VariableSort.alphabeticalDesc:e=(0,pe.sortBy)(e,"label").reverse();break;case l.VariableSort.numericalAsc:e=(0,pe.sortBy)(e,n);break;case l.VariableSort.numericalDesc:e=(e=(0,pe.sortBy)(e,n)).reverse();break;case l.VariableSort.alphabeticalCaseInsensitiveAsc:e=(0,pe.sortBy)(e,(e=>(0,pe.toLower)(e.label)));break;case l.VariableSort.alphabeticalCaseInsensitiveDesc:e=(e=(0,pe.sortBy)(e,(e=>(0,pe.toLower)(e.label)))).reverse();break;case l.VariableSort.naturalAsc||7:e=r(e);break;case l.VariableSort.naturalDesc||8:e=(e=r(e)).reverse()}return e})(d,t)})(t,this.state.sort,e))})),(0,E.catchError)((e=>e.cancelled?(0,E.of)([]):(0,E.throwError)((()=>e)))))})))):(0,E.of)([])}getRequest(e,t){const n={__sceneObject:Sn(this)};t&&(n.__searchFilter={value:t,text:t});const r=wl.getTimeRange(this).state.value;return{app:l.CoreApp.Dashboard,requestId:k(),timezone:"",range:r,interval:"",intervalMs:0,targets:[e],scopedVars:n,startTime:Date.now()}}}function gl(e){var t;return null!=(t=ce(e,(e=>e.state.$data)))?t:Ae}function ml(e,t,n,r,a){return""===t||null==t?"":gt(e,t,n,r,a)}function bl(e,t,n,r){if(t(e))return e;let a=null;return e.forEachChild((e=>{if(e===n)return;let r=bl(e,t);r&&(a=r)})),a||(r&&e.parent?bl(e.parent,t,e,!0):null)}function yl(e,t){return bl(e,t,void 0,!0)}function vl(e,t){const n=[];return e.forEachChild((e=>{t(e)&&n.push(e),n.push(...vl(e,t))})),n}hl.Component=({model:e})=>mn(e);const wl={getVariables:function(e){var t;return null!=(t=ce(e,(e=>e.state.$variables)))?t:Me},getData:gl,getTimeRange:Le,getLayout:function(e){return ce(e,(e=>function(e){return"isDraggable"in e}(e)?e:void 0))||null},getDataLayers:function(e,t=!1){let n=e,r=[];for(;n;){const e=n.state.$data;if(e){if(yt(e)?r=r.concat(e):e.state.$data&&yt(e.state.$data)&&(r=r.concat(e.state.$data)),t&&r.length>0)break;n=n.parent}else n=n.parent}return r},interpolate:ml,lookupVariable:fe,hasVariableDependencyInLoadingState:function(e){if(!e.variableDependency)return!1;for(const t of e.variableDependency.getNames()){if(e instanceof hl&&e.state.name===t){console.warn("Query variable is referencing itself");continue}const n=fe(t,e);if(n&&n.parent.isVariableLoadingOrWaitingToUpdate(n))return!0}return!1},findByKey:function(e,t){const n=yl(e,(e=>e.state.key===t));if(!n)throw new Error("Unable to find scene with key "+t);return n},findByKeyAndType:function(e,t,n){const r=yl(e,(e=>e.state.key===t));if(!r)throw new Error("Unable to find scene with key "+t);if(!(r instanceof n))throw new Error(`Found scene object with key ${t} does not match type ${n.name}`);return r},findObject:yl,findAllObjects:vl,getAncestor:function(e,t){let n=e;for(;n;){if(n instanceof t)return n;n=n.parent}if(!n)throw new Error("Unable to find parent of type "+t.name);return n},findDescendents:function(e,t){function n(e){return e instanceof t}return vl(e,n).filter(n)},getQueryController:function(e){let t=e;for(;t;){if(t.state.$behaviors)for(const e of t.state.$behaviors)if("isQueryController"in e)return e;t=t.parent}},getUrlSyncManager:function(e){let t=e;for(;t;){if("urlSyncManager"in t.state)return t.state.urlSyncManager;t=t.parent}}};class xl{constructor(){this.index=new Map}getUniqueKey(e,t){const n=this.index.get(e);if(!n)return this.index.set(e,[t]),e;let r=n.findIndex((e=>e===t));return-1===r&&(function(e){for(const t of e)if(Sl(t)){const n=e.indexOf(t);e.splice(n,1)}}(n),n.push(t),r=n.length-1),r>0?`${e}-${r+1}`:e}clear(){this.index.clear()}}function Sl(e){const t=e.getRoot();return!wl.findObject(t,(t=>t===e))}function Ol(e){const t=new xl,n={},r=e=>{if(e.urlSync){const r=e.urlSync.getUrlState();for(const[a,o]of Object.entries(r))if(null!=o){const r=t.getUniqueKey(a,e);n[r]=o}}e.forEachChild(r)};return r(e),n}function Dl(e,t,n,r){r||Cl(e,t,n),e.forEachChild((e=>{Cl(e,t,n)})),e.forEachChild((e=>Dl(e,t,n,!0)))}function Cl(e,t,n){if(e.urlSync){const r={},a=e.urlSync.getUrlState();for(const o of e.urlSync.getKeys()){const i=n.getUniqueKey(o,e),s=t.getAll(i),l=a[o];El(s,l)||(s.length>0?Array.isArray(l)?r[o]=s:r[o]=s[0]:r[o]=null)}Object.keys(r).length>0&&e.urlSync.updateFromUrl(r)}}function El(e,t){return 0===e.length&&null==t||(Array.isArray(t)||1!==(null==e?void 0:e.length)?0===(null==t?void 0:t.length)&&null===e||(0,pe.isEqual)(e,t):t===e[0])}var _l=n(3633),Pl=Object.defineProperty,Rl=Object.defineProperties,Il=Object.getOwnPropertyDescriptors,Tl=Object.getOwnPropertySymbols,kl=Object.prototype.hasOwnProperty,Al=Object.prototype.propertyIsEnumerable,jl=(e,t,n)=>t in e?Pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class Ml extends J{constructor(e){var t,n;super((t=((e,t)=>{for(var n in t||(t={}))kl.call(t,n)&&jl(e,n,t[n]);if(Tl)for(var n of Tl(t))Al.call(t,n)&&jl(e,n,t[n]);return e})({},e),n={sync:e.sync||_l.yV.Off},Rl(t,Il(n)))),this.getEventsBus=e=>{if(!this.parent)throw new Error("EnableCursorSync cannot be used as a standalone scene object");return new Ll(this.parent,e)}}getEventsScope(){if(!this.parent)throw new Error("EnableCursorSync cannot be used as a standalone scene object");return this.state.key}}class Ll{constructor(e,t){this._source=e,this._eventsOrigin=t}publish(e){e.origin=this,this._eventsOrigin.publishEvent(e,!0)}getStream(e){return new E.Observable((t=>{const n=this._source.subscribeToEvent(e,(e=>{t.next(e)}));return()=>n.unsubscribe()}))}subscribe(e,t){return this.getStream(e).pipe().subscribe(t)}removeAllListeners(){}newScopedBus(e,t){throw new Error("For internal use only")}}var Nl=function(){},Bl="undefined"!=typeof window;const Vl=Bl?a.useLayoutEffect:a.useEffect;var Fl={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const zl=Bl&&void 0!==window.ResizeObserver?function(){var e=(0,a.useState)(null),t=e[0],n=e[1],r=(0,a.useState)(Fl),o=r[0],i=r[1],s=(0,a.useMemo)((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,n=t.x,r=t.y,a=t.width,o=t.height,s=t.top,l=t.left,c=t.bottom,u=t.right;i({x:n,y:r,width:a,height:o,top:s,left:l,bottom:c,right:u})}}))}),[]);return Vl((function(){if(t)return s.observe(t),function(){s.disconnect()}}),[t]),[n,o]}:function(){return[Nl,Fl]};function Wl(e,t){if(t)return t;let n=e.error?e.error.message:void 0;return e.errors&&(n=e.errors.map((e=>e.message)).join(", ")),n}const Ul=(0,Zt.css)({position:"relative",width:"100%",height:"100%"}),Hl=(0,Zt.css)({position:"absolute",width:"100%",height:"100%"}),$l=e=>({ok:(0,Zt.css)({color:e.colors.success.text}),pending:(0,Zt.css)({color:e.colors.warning.text}),alerting:(0,Zt.css)({color:e.colors.error.text})});var Gl=Object.defineProperty,ql=Object.defineProperties,Ql=Object.getOwnPropertyDescriptors,Yl=Object.getOwnPropertySymbols,Kl=Object.prototype.hasOwnProperty,Xl=Object.prototype.propertyIsEnumerable,Zl=(e,t,n)=>t in e?Gl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jl=(e,t)=>{for(var n in t||(t={}))Kl.call(t,n)&&Zl(e,n,t[n]);if(Yl)for(var n of Yl(t))Xl.call(t,n)&&Zl(e,n,t[n]);return e},ec=(e,t)=>ql(e,Ql(t));const tc="hideSeriesFrom",nc=(0,l.isSystemOverrideWithRef)(tc);function rc(e,t=l.ByNamesMatcherMode.exclude,n){return n=null!=n?n:{id:"custom.hideFrom",value:{viz:!0,legend:!1,tooltip:!1}},{__systemRef:tc,matcher:{id:l.FieldMatcherID.byNames,options:{mode:t,names:e,prefix:t===l.ByNamesMatcherMode.exclude?"All except:":void 0,readOnly:!0}},properties:[ec(Jl({},n),{value:{viz:!0,legend:!1,tooltip:!1}})]}}const ac=e=>{var t;const n=null==(t=e.matcher.options)?void 0:t.names;return Array.isArray(n)?[...n]:[]},oc=(e,t)=>{const n=new Set;for(const r of e)for(const a of r.fields){if(a.type!==l.FieldType.number)continue;const o=(0,l.getFieldDisplayName)(a,r,e);o!==t&&n.add(o)}return Array.from(n)},ic=(e,t)=>{var n;let r=[];for(const a of e){const e=a.properties.find((e=>"custom.hideFrom"===e.id));if(void 0!==e&&!0===(null==(n=e.value)?void 0:n.legend)){const e=l.fieldMatchers.get(a.matcher.id).get(a.matcher.options);for(const n of t)for(const a of n.fields){if(a.type!==l.FieldType.number)continue;const o=(0,l.getFieldDisplayName)(a,n,t);e(a,n,t)&&r.push(o)}}}return r};var sc=Object.defineProperty,lc=Object.defineProperties,cc=Object.getOwnPropertyDescriptors,uc=Object.getOwnPropertySymbols,dc=Object.prototype.hasOwnProperty,pc=Object.prototype.propertyIsEnumerable,fc=(e,t,n)=>t in e?sc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hc=(e,t)=>{for(var n in t||(t={}))dc.call(t,n)&&fc(e,n,t[n]);if(uc)for(var n of uc(t))pc.call(t,n)&&fc(e,n,t[n]);return e},gc=(e,t)=>lc(e,cc(t));const mc=(e,t)=>({matcher:{id:l.FieldMatcherID.byName,options:e},properties:[bc(t)]}),bc=e=>({id:"color",value:{mode:l.FieldColorModeId.Fixed,fixedColor:e}});var yc=Object.defineProperty,vc=Object.defineProperties,wc=Object.getOwnPropertyDescriptors,xc=Object.getOwnPropertySymbols,Sc=Object.prototype.hasOwnProperty,Oc=Object.prototype.propertyIsEnumerable,Dc=(e,t,n)=>t in e?yc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cc=(e,t)=>{for(var n in t||(t={}))Sc.call(t,n)&&Dc(e,n,t[n]);if(xc)for(var n of xc(t))Oc.call(t,n)&&Dc(e,n,t[n]);return e},Ec=(e,t)=>vc(e,wc(t));class _c extends J{constructor(e){var t;super(Cc({options:{},fieldConfig:{defaults:{},overrides:[]},title:"Title",pluginId:"timeseries"},e)),this._variableDependency=new $s(this,{statePaths:["title","options","fieldConfig"]}),this._structureRev=0,this.onTimeRangeChange=e=>{wl.getTimeRange(this).onTimeRangeChange({raw:{from:(0,l.toUtc)(e.from),to:(0,l.toUtc)(e.to)},from:(0,l.toUtc)(e.from),to:(0,l.toUtc)(e.to)})},this.getTimeRange=e=>{const t=wl.findObject(this,(e=>e instanceof Rc)),n=wl.getTimeRange(this);if(t instanceof Rc&&t.isEnabled)return Ee(n.state.from,n.state.to,n.getTimeZone(),n.state.fiscalYearStartMonth,n.state.UNSAFE_nowDelay);const r=this.getPlugin();return r&&!r.meta.skipDataQuery&&e&&e.timeRange?e.timeRange:n.state.value},this.onTitleChange=e=>{this.setState({title:e})},this.onDescriptionChange=e=>{this.setState({description:e})},this.onDisplayModeChange=e=>{this.setState({displayMode:e})},this.onOptionsChange=(e,t=!1,n=!1)=>{const{fieldConfig:r,options:a}=this.state,o=t?e:(0,pe.mergeWith)((0,pe.cloneDeep)(a),e,((e,t,n,r)=>{if((0,pe.isArray)(t))return t;e===t||void 0!==t||(r[n]=t)})),i=(0,l.getPanelOptionsWithDefaults)({plugin:this._plugin,currentOptions:o,currentFieldConfig:r,isAfterPluginChange:n});this.setState({options:i.options})},this.onFieldConfigChange=(e,t)=>{const{fieldConfig:n,options:r}=this.state,a=t?e:(0,pe.merge)((0,pe.cloneDeep)(n),e),o=(0,l.getPanelOptionsWithDefaults)({plugin:this._plugin,currentOptions:r,currentFieldConfig:a,isAfterPluginChange:!1});this._dataWithFieldConfig=void 0,this.setState({fieldConfig:o.fieldConfig})},this.interpolate=(e,t,n)=>wl.interpolate(this,e,t,n),this.getDescription=()=>{this.publishEvent(new U({origin:this,interaction:"panel-description-shown"}),!0);const{description:e}=this.state;if(e){const t=this.interpolate(e);return(0,l.renderMarkdown)(t)}return""},this.onCancelQuery=()=>{var e;this.publishEvent(new U({origin:this,interaction:"panel-cancel-query-clicked"}),!0);const t=wl.getData(this);null==(e=t.cancelQuery)||e.call(t)},this.onStatusMessageClick=()=>{this.publishEvent(new U({origin:this,interaction:"panel-status-message-clicked"}),!0)},this._onSeriesColorChange=(e,t)=>{this.onFieldConfigChange(((e,t,n)=>{const{overrides:r}=n,a=n.overrides.findIndex((t=>t.matcher.id===l.FieldMatcherID.byName&&t.matcher.options===e));if(a<0)return gc(hc({},n),{overrides:[...n.overrides,mc(e,t)]});const o=Array.from(r),i=o[a],s=i.properties.findIndex((e=>"color"===e.id));if(s<0)return o[a]=gc(hc({},i),{properties:[...i.properties,bc(t)]}),gc(hc({},n),{overrides:o});const c=Array.from(i.properties);return c[s]=bc(t),o[a]=gc(hc({},i),{properties:c}),gc(hc({},n),{overrides:o})})(e,t,this.state.fieldConfig))},this._onSeriesVisibilityChange=(e,t)=>{this._dataWithFieldConfig&&this.onFieldConfigChange(function(e,t,n,r){const{overrides:a}=n,o=e,i=a.findIndex(nc);if(i<0){if(t===Yt.SeriesVisibilityChangeMode.ToggleSelection){const e=rc([o,...ic(a,r)]);return ec(Jl({},n),{overrides:[...n.overrides,e]})}const e=rc(oc(r,o));return ec(Jl({},n),{overrides:[...n.overrides,e]})}const s=Array.from(a),[c]=s.splice(i,1);if(t===Yt.SeriesVisibilityChangeMode.ToggleSelection){let e=ac(c);const t=ic(s,r);if(t.length>0&&(e=e.filter((e=>t.indexOf(e)<0))),e[0]===o&&1===e.length)return ec(Jl({},n),{overrides:s});const a=rc([o,...t]);return ec(Jl({},n),{overrides:[...s,a]})}const u=((e,t,n=l.ByNamesMatcherMode.exclude)=>{const r=e.properties.find((e=>"custom.hideFrom"===e.id)),a=ac(e),o=a.findIndex((e=>e===t));return o<0?a.push(t):a.splice(o,1),rc(a,n,r)})(c,o);return((e,t)=>ac(e).length===oc(t).length)(u,r)?ec(Jl({},n),{overrides:s}):ec(Jl({},n),{overrides:[...s,u]})}(e,t,this.state.fieldConfig,this._dataWithFieldConfig.series),!0)},this._onInstanceStateChange=e=>{this._panelContext&&(this._panelContext=Ec(Cc({},this._panelContext),{instanceState:e})),this.setState({_pluginInstanceState:e})},this._onToggleLegendSort=e=>{const t=this.state.options.legend;if(!t)return;let n=t.sortDesc,r=t.sortBy;e!==r&&(n=void 0),!1===n?(r=void 0,n=void 0):(n=!n,r=e),this.onOptionsChange(Ec(Cc({},this.state.options),{legend:Ec(Cc({},t),{sortBy:r,sortDesc:n})}),!0)},this.addActivationHandler((()=>{this._onActivate()})),null==(t=e.menu)||t.addActivationHandler((()=>{this.publishEvent(new U({origin:this,interaction:"panel-menu-shown"}),!0)}))}_onActivate(){this._plugin||this._loadPlugin(this.state.pluginId)}async _loadPlugin(e,t,n,r){const a=function(e){var t;const{getPanelPluginFromCache:n}=(0,c.getPluginImportUtils)();return null!=(t=n(e))?t:C.get(e)}(e);if(a)this._pluginLoaded(a,t,n,r);else{const{importPanelPlugin:a}=(0,c.getPluginImportUtils)();try{const o=await a(e);this._pluginLoaded(o,t,n,r)}catch(t){this._pluginLoaded(function(e){const t=new l.PanelPlugin((()=>null));return t.meta={id:e,name:e,sort:100,type:l.PluginType.panel,module:"",baseUrl:"",info:{author:{name:""},description:"",links:[],logos:{large:"",small:"public/img/grafana_icon.svg"},screenshots:[],updated:"",version:""}},t}(e)),t instanceof Error&&this.setState({_pluginLoadError:t.message})}}}getLegacyPanelId(){const e=parseInt(this.state.key.replace("panel-",""),10);return isNaN(e)?0:e}async _pluginLoaded(e,t,n,r){const{options:a,fieldConfig:o,title:i,pluginVersion:s,_UNSAFE_customMigrationHandler:c}=this.state,u={title:i,options:a,fieldConfig:o,id:this.getLegacyPanelId(),type:e.meta.id,pluginVersion:s};t&&(u.options=t),n&&(u.fieldConfig=n);const d=this._getPluginVersion(e);null==c||c(u,e),e.onPanelMigration&&d!==this.state.pluginVersion&&(u.options=await e.onPanelMigration(u));const p=(0,l.getPanelOptionsWithDefaults)({plugin:e,currentOptions:u.options,currentFieldConfig:u.fieldConfig,isAfterPluginChange:null!=r&&r});if(this._plugin=e,this.setState({options:p.options,fieldConfig:p.fieldConfig,pluginVersion:d,pluginId:e.meta.id}),e.meta.skipDataQuery){const e=wl.getTimeRange(this);this._subs.add(e.subscribeToState((()=>this.forceRender())))}}_getPluginVersion(e){return e&&e.meta.info.version?e.meta.info.version:c.config.buildInfo.version}getPlugin(){return this._plugin}getPanelContext(){return null!=this._panelContext||(this._panelContext=this.buildPanelContext()),this._panelContext}async changePluginType(e,t,n){var r,a;const{options:o,fieldConfig:i,pluginId:s}=this.state;this._dataWithFieldConfig=void 0,await this._loadPlugin(e,null!=t?t:{},n,!0);const l={title:this.state.title,options:this.state.options,fieldConfig:this.state.fieldConfig,id:1,type:e},c=null==(a=null==(r=this._plugin)?void 0:r.onPanelTypeChanged)?void 0:a.call(r,l,s,o,i);c&&!(0,pe.isEmpty)(c)&&this.onOptionsChange(c,!0,!0)}clearFieldConfigCache(){this._dataWithFieldConfig=void 0}applyFieldConfig(e){var t,n,r,a;const o=this._plugin;if(!o||o.meta.skipDataQuery||!e)return Se;if(this._prevData===e&&this._dataWithFieldConfig)return this._dataWithFieldConfig;const i=o.dataSupport||{alertStates:!1,annotations:!1},s=o.fieldConfigRegistry,u=null!=(n=null==(t=this._dataWithFieldConfig)?void 0:t.series)?n:[],d=(0,l.applyFieldOverrides)({data:e.series,fieldConfig:this.state.fieldConfig,fieldConfigRegistry:s,replaceVariables:this.interpolate,theme:c.config.theme2,timeZone:null==(r=e.request)?void 0:r.timezone});return(0,l.compareArrayValues)(d,u,l.compareDataFrameStructures)||this._structureRev++,this._dataWithFieldConfig=Ec(Cc({},e),{structureRev:this._structureRev,series:d}),this._dataWithFieldConfig.annotations&&(this._dataWithFieldConfig.annotations=(0,l.applyFieldOverrides)({data:this._dataWithFieldConfig.annotations,fieldConfig:{defaults:{},overrides:[]},fieldConfigRegistry:s,replaceVariables:this.interpolate,theme:c.config.theme2,timeZone:null==(a=e.request)?void 0:a.timezone})),i.alertStates||(this._dataWithFieldConfig.alertState=void 0),i.annotations||(this._dataWithFieldConfig.annotations=void 0),this._prevData=e,this._dataWithFieldConfig}buildPanelContext(){const e=(this,wl.findObject(this,(e=>e instanceof Ml)));const t={eventsScope:e?e.getEventsScope():"__global_",eventBus:e?e.getEventsBus(this):(0,c.getAppEvents)(),app:l.CoreApp.Unknown,sync:()=>e?e.state.sync:l.DashboardCursorSync.Off,onSeriesColorChange:this._onSeriesColorChange,onToggleSeriesVisibility:this._onSeriesVisibilityChange,onToggleLegendSort:this._onToggleLegendSort,onInstanceStateChange:this._onInstanceStateChange};return this.state.extendPanelContext&&this.state.extendPanelContext(this,t),t}}_c.Component=function({model:e}){var t;const{title:n,options:r,fieldConfig:o,_pluginLoadError:s,displayMode:u,hoverHeader:d,hoverHeaderOffset:p,menu:f,headerActions:h,titleItems:g,description:m}=e.useState(),[b,{width:y,height:v}]=zl(),w=(0,a.useMemo)((()=>(0,c.getAppEvents)()),[]),x=(0,a.useCallback)((()=>{w.publish(new l.SetPanelAttentionEvent({panelId:e.state.key}))}),[e.state.key,w]),S=(0,a.useMemo)((()=>(0,pe.debounce)(x,100,{leading:!0,trailing:!1})),[x]),O=e.getPlugin(),{dragClass:D,dragClassCancel:C}=function(e){var t,n;const r=wl.getLayout(e),a=null==r?void 0:r.isDraggable();return r&&a&&!function(e,t){let n=e.parent;for(;n&&n!==t;){if("isDraggable"in n.state&&!1===n.state.isDraggable)return!0;n=n.parent}return!1}(e,r)?{dragClass:null==(t=r.getDragClass)?void 0:t.call(r),dragClassCancel:null==(n=null==r?void 0:r.getDragClassCancel)?void 0:n.call(r)}:{dragClass:"",dragClassCancel:""}}(e),E=wl.getData(e),_=E.useState(),P=e.applyFieldConfig(_.data),R=wl.getTimeRange(e).getTimeZone(),I=e.getTimeRange(P),T=e.interpolate(n,void 0,"text"),k=(0,Yt.useStyles2)($l);if(!O)return i().createElement("div",null,"Loading plugin panel...");if(!O.panel)return i().createElement("div",null,"Panel plugin has no panel component");const A=O.panel;E&&E.setContainerWidth&&E.setContainerWidth(Math.round(y));let j,M,L=[];g&&(Array.isArray(g)?L=L.concat(g.map((e=>i().createElement(e.Component,{model:e,key:`${e.state.key}`})))):mt(g)?L.push(i().createElement(g.Component,{model:g})):L.push(g)),e.state.$timeRange&&L.push(i().createElement(e.state.$timeRange.Component,{model:e.state.$timeRange,key:e.state.key})),P.alertState&&L.push(i().createElement(Yt.Tooltip,{content:null!=(t=P.alertState.state)?t:"unknown",key:`alert-states-icon-${e.state.key}`},i().createElement(Yt.PanelChrome.TitleItem,{className:(0,Zt.cx)({[k.ok]:P.alertState.state===l.AlertState.OK,[k.pending]:P.alertState.state===l.AlertState.Pending,[k.alerting]:P.alertState.state===l.AlertState.Alerting})},i().createElement(Yt.Icon,{name:"alerting"===P.alertState.state?"heart-break":"heart",className:"panel-alert-icon",size:"md"})))),f&&(j=i().createElement(f.Component,{model:f})),h&&(M=Array.isArray(h)?i().createElement(i().Fragment,null,h.map((e=>i().createElement(e.Component,{model:e,key:`${e.state.key}`})))):mt(h)?i().createElement(h.Component,{model:h}):h);const N=P,B=!E.isDataReadyToDisplay||E.isDataReadyToDisplay(),V=e.getPanelContext(),F=e.getLegacyPanelId();return i().createElement("div",{className:Ul},i().createElement("div",{ref:b,className:Hl,"data-viz-panel-key":e.state.key},y>0&&v>0&&i().createElement(Yt.PanelChrome,{title:T,description:(null==m?void 0:m.trim())?e.getDescription:void 0,loadingState:N.state,statusMessage:Wl(N,s),statusMessageOnClick:e.onStatusMessageClick,width:y,height:v,displayMode:u,hoverHeader:d,hoverHeaderOffset:p,titleItems:L,dragClass:D,actions:M,dragClassCancel:C,padding:O.noPadding?"none":"md",menu:j,onCancelQuery:e.onCancelQuery,onFocus:x,onMouseEnter:x,onMouseMove:S},((t,a)=>i().createElement(i().Fragment,null,i().createElement(Yt.ErrorBoundaryAlert,{dependencies:[O,N]},i().createElement(l.PluginContextProvider,{meta:O.meta},i().createElement(Yt.PanelContextProvider,{value:V},B&&i().createElement(A,{id:F,data:N,title:n,timeRange:I,timeZone:R,options:r,fieldConfig:o,transparent:!1,width:t,height:a,renderCounter:0,replaceVariables:e.interpolate,onOptionsChange:e.onOptionsChange,onFieldConfigChange:e.onFieldConfigChange,onChangeTimeRange:e.onTimeRangeChange,eventBus:V.eventBus})))))))))};const Pc=class extends J{constructor({enabled:e=!1}){super({enabled:e}),this.timerId=void 0,this._activationHandler=()=>(this.state.enabled&&this.enable(),()=>{window.clearInterval(this.timerId),this.timerId=void 0}),this.addActivationHandler(this._activationHandler)}enable(){window.clearInterval(this.timerId),this.timerId=void 0,this.timerId=window.setInterval((()=>{const e=wl.findAllObjects(this.getRoot(),(e=>e instanceof _c));for(const t of e)t.forceRender()}),Pc.REFRESH_RATE),this.setState({enabled:!0})}disable(){window.clearInterval(this.timerId),this.timerId=void 0,this.setState({enabled:!1})}get isEnabled(){return this.state.enabled}};let Rc=Pc;function Ic(e){if("string"==typeof e)return e;if(e){if(e instanceof Error)return e.message;if((0,c.isFetchError)(e)){if(e.data&&e.data.message)return e.data.message;if(e.statusText)return e.statusText}else if(e.hasOwnProperty("message"))return e.message}return JSON.stringify(e)}Rc.REFRESH_RATE=100;var Tc=Object.defineProperty,kc=Object.getOwnPropertySymbols,Ac=Object.prototype.hasOwnProperty,jc=Object.prototype.propertyIsEnumerable,Mc=(e,t,n)=>t in e?Tc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class Lc extends J{constructor(e,t=[]){super(((e,t)=>{for(var n in t||(t={}))Ac.call(t,n)&&Mc(e,n,t[n]);if(kc)for(var n of kc(t))jc.call(t,n)&&Mc(e,n,t[n]);return e})({isEnabled:!0},e)),this._results=new E.ReplaySubject(1),this.isDataLayer=!0,this._variableValueRecorder=new xt,this._variableDependency=new $s(this,{onVariableUpdateCompleted:this.onVariableUpdateCompleted.bind(this)}),this._variableDependency.setPaths(t),this.addActivationHandler((()=>this.onActivate()))}onActivate(){return this.state.isEnabled&&this.onEnable(),this.shouldRunLayerOnActivate()&&this.runLayer(),this.subscribeToState(((e,t)=>{!e.isEnabled&&this.querySub&&(this.querySub.unsubscribe(),this.querySub=void 0,this.onDisable(),this._results.next({origin:this,data:Se}),this.setStateHelper({data:Se})),e.isEnabled&&!t.isEnabled&&(this.onEnable(),this.runLayer())})),()=>{this.onDeactivate()}}onDeactivate(){this.querySub&&(this.querySub.unsubscribe(),this.querySub=void 0),this.onDisable(),this._variableValueRecorder.recordCurrentDependencyValuesForSceneObject(this)}onVariableUpdateCompleted(){this.runLayer()}cancelQuery(){this.querySub&&(this.querySub.unsubscribe(),this.querySub=void 0,this.publishResults(Se))}publishResults(e){this.state.isEnabled&&(this._results.next({origin:this,data:e}),this.setStateHelper({data:e}))}getResultsStream(){return this._results}shouldRunLayerOnActivate(){return!!this.state.isEnabled&&(this._variableValueRecorder.hasDependenciesChanged(this)?(vt("SceneDataLayerBase","Variable dependency changed while inactive, shouldRunLayerOnActivate returns true"),!0):!this.state.data)}setStateHelper(e){$t(this,e)}}function Nc({layer:e}){var t,n;const r=`data-layer-${e.state.key}`,{data:a,isEnabled:o}=e.useState(),s=Boolean(a&&a.state===ge.Loading);return i().createElement("div",{className:Bc},i().createElement(Mn,{htmlFor:r,isLoading:s,onCancel:()=>{var t;return null==(t=e.cancelQuery)?void 0:t.call(e)},label:e.state.name,description:e.state.description,error:null==(n=null==(t=e.state.data)?void 0:t.errors)?void 0:n[0].message}),i().createElement(Yt.InlineSwitch,{id:r,value:o,onChange:()=>e.setState({isEnabled:!o})}))}(class extends J{constructor(){super({})}}).Component=function({model:e}){const t=wl.getDataLayers(e,!0);return 0===t.length?null:i().createElement(i().Fragment,null,t.map((e=>i().createElement(e.Component,{model:e,key:e.state.key}))))};const Bc=(0,Zt.css)({display:"flex"});function Vc(e){return"function"==typeof e}function Fc(e){return function(t){if(function(e){return Vc(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var zc=function(e,t){return zc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},zc(e,t)};function Wc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}zc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Uc(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Hc(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function $c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function Gc(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}function qc(e){return this instanceof qc?(this.v=e,this):new qc(e)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var Qc,Yc=((Qc=function(e){var t;t=this,Error.call(t),t.stack=(new Error).stack,this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}).prototype=Object.create(Error.prototype),Qc.prototype.constructor=Qc,Qc);function Kc(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Xc=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,r,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var i=Hc(o),s=i.next();!s.done;s=i.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(Vc(l))try{l()}catch(e){a=e instanceof Yc?e.errors:[e]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var u=Hc(c),d=u.next();!d.done;d=u.next()){var p=d.value;try{Jc(p)}catch(e){a=null!=a?a:[],e instanceof Yc?a=Gc(Gc([],$c(a)),$c(e.errors)):a.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(a)throw new Yc(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Jc(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Kc(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Kc(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function Zc(e){return e instanceof Xc||e&&"closed"in e&&Vc(e.remove)&&Vc(e.add)&&Vc(e.unsubscribe)}function Jc(e){Vc(e)?e():e.unsubscribe()}Xc.EMPTY;var eu={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},tu={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=tu.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,Gc([e,t],$c(n))):setTimeout.apply(void 0,Gc([e,t],$c(n)))},clearTimeout:function(e){var t=tu.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function nu(e){tu.setTimeout((function(){var t=eu.onUnhandledError;if(!t)throw e;t(e)}))}function ru(){}var au=ou("C",void 0,void 0);function ou(e,t,n){return{kind:e,value:t,error:n}}var iu=null,su=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Zc(t)&&t.add(n)):n.destination=hu,n}return Wc(t,e),t.create=function(e,t,n){return new du(e,t,n)},t.prototype.next=function(e){this.isStopped?fu(function(e){return ou("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?fu(ou("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?fu(au,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Xc),lu=Function.prototype.bind;function cu(e,t){return lu.call(e,t)}var uu=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){pu(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){pu(e)}else pu(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){pu(e)}},e}(),du=function(e){function t(t,n,r){var a,o,i=e.call(this)||this;return Vc(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:i&&eu.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&cu(t.next,o),error:t.error&&cu(t.error,o),complete:t.complete&&cu(t.complete,o)}):a=t,i.destination=new uu(a),i}return Wc(t,e),t}(su);function pu(e){var t;eu.useDeprecatedSynchronousErrorHandling?(t=e,eu.useDeprecatedSynchronousErrorHandling&&iu&&(iu.errorThrown=!0,iu.error=t)):nu(e)}function fu(e,t){var n=eu.onStoppedNotification;n&&tu.setTimeout((function(){return n(e,t)}))}var hu={closed:!0,next:ru,error:function(e){throw e},complete:ru};function gu(e,t,n,r,a){return new mu(e,t,n,r,a)}var mu=function(e){function t(t,n,r,a,o,i){var s=e.call(this,t)||this;return s.onFinalize=o,s.shouldUnsubscribe=i,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=a?function(e){try{a(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return Wc(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(su);function bu(e,t){return Fc((function(n,r){var a=0;n.subscribe(gu(r,(function(n){r.next(e.call(t,n,a++))})))}))}var yu=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e},vu="function"==typeof Symbol&&Symbol.observable||"@@observable";function wu(e){return e}var xu=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,a=this,o=(r=e)&&r instanceof su||function(e){return e&&Vc(e.next)&&Vc(e.error)&&Vc(e.complete)}(r)&&Zc(r)?e:new du(e,t,n);return function(e){if(eu.useDeprecatedSynchronousErrorHandling){var t=!iu;if(t&&(iu={errorThrown:!1,error:null}),e(),t){var n=iu,r=n.errorThrown,a=n.error;if(iu=null,r)throw a}}else e()}((function(){var e=a,t=e.operator,n=e.source;o.add(t?t.call(o,n):n?a._subscribe(o):a._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Su(t))((function(t,r){var a=new du({next:function(t){try{e(t)}catch(e){r(e),a.unsubscribe()}},error:r,complete:t});n.subscribe(a)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[vu]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===(n=e).length?wu:1===n.length?n[0]:function(e){return n.reduce((function(e,t){return t(e)}),e)})(this);var n},e.prototype.toPromise=function(e){var t=this;return new(e=Su(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function Su(e){var t;return null!==(t=null!=e?e:eu.Promise)&&void 0!==t?t:Promise}var Ou="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Du(e){if(e instanceof xu)return e;if(null!=e){if(function(e){return Vc(e[vu])}(e))return o=e,new xu((function(e){var t=o[vu]();if(Vc(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(yu(e))return a=e,new xu((function(e){for(var t=0;t<a.length&&!e.closed;t++)e.next(a[t]);e.complete()}));if(Vc(null==(r=e)?void 0:r.then))return n=e,new xu((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,nu)}));if(function(e){return Symbol.asyncIterator&&Vc(null==e?void 0:e[Symbol.asyncIterator])}(e))return Cu(e);if(function(e){return Vc(null==e?void 0:e[Ou])}(e))return t=e,new xu((function(e){var n,r;try{for(var a=Hc(t),o=a.next();!o.done;o=a.next()){var i=o.value;if(e.next(i),e.closed)return}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}e.complete()}));if(function(e){return Vc(null==e?void 0:e.getReader)}(e))return Cu(function(e){return function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,a=n.apply(e,t||[]),o=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(e){a[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=a[e](t)).value instanceof qc?Promise.resolve(n.value.v).then(l,c):u(o[0][2],n)}catch(e){u(o[0][3],e)}var n}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}(this,arguments,(function(){var t,n,r;return Uc(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,qc(t.read())];case 3:return n=a.sent(),r=n.value,n.done?[4,qc(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,qc(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e))}var t,n,r,a,o;throw function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(e)}function Cu(e){return new xu((function(t){(function(e,t){var n,r,a,o,i,s,l,c;return i=this,s=void 0,c=function(){var i,s;return Uc(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Hc(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,a){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,a,(t=e[n](t)).done,t.value)}))}}}(e),l.label=1;case 1:return[4,n.next()];case 2:if((r=l.sent()).done)return[3,4];if(i=r.value,t.next(i),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),a={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))},new((l=void 0)||(l=Promise))((function(e,t){function n(e){try{a(c.next(e))}catch(e){t(e)}}function r(e){try{a(c.throw(e))}catch(e){t(e)}}function a(t){var a;t.done?e(t.value):(a=t.value,a instanceof l?a:new l((function(e){e(a)}))).then(n,r)}a((c=c.apply(i,s||[])).next())}))})(e,t).catch((function(e){return t.error(e)}))}))}function Eu(e,t,n){return void 0===n&&(n=1/0),Vc(t)?Eu((function(n,r){return bu((function(e,a){return t(n,e,r,a)}))(Du(e(n,r)))}),n):("number"==typeof t&&(n=t),Fc((function(t,r){return function(e,t,n,r,a,o,i,s){var l=[],c=0,u=0,d=!1,p=function(){!d||l.length||c||t.complete()},f=function(e){return c<r?h(e):l.push(e)},h=function(e){c++;var a=!1;Du(n(e,u++)).subscribe(gu(t,(function(e){t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{c--;for(var e=function(){var e=l.shift();h(e)};l.length&&c<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(gu(t,f,(function(){d=!0,p()}))),function(){}}(t,r,e,n)})))}var _u=Object.defineProperty,Pu=Object.defineProperties,Ru=Object.getOwnPropertyDescriptors,Iu=Object.getOwnPropertySymbols,Tu=Object.prototype.hasOwnProperty,ku=Object.prototype.propertyIsEnumerable,Au=(e,t,n)=>t in e?_u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const ju={prepareAnnotation:e=>{if((0,pe.isString)(null==e?void 0:e.query)){const n=e,{query:r}=n;return t=((e,t)=>{for(var n in t||(t={}))Tu.call(t,n)&&Au(e,n,t[n]);if(Iu)for(var n of Iu(t))ku.call(t,n)&&Au(e,n,t[n]);return e})({},((e,t)=>{var n={};for(var r in e)Tu.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Iu)for(var r of Iu(e))t.indexOf(r)<0&&ku.call(e,r)&&(n[r]=e[r]);return n})(n,["query"])),Pu(t,Ru({target:{refId:"annotation_query",query:r},mappings:{}}))}var t;return e},prepareQuery:e=>e.target,processEvents:(e,t)=>function(e,t){return(0,E.of)(e).pipe((e=>e.pipe(Eu((e=>{if(!(null==e?void 0:e.length))return(0,E.of)(void 0);if(1===e.length)return(0,E.of)(e[0]);return(0,E.of)(e).pipe(l.standardTransformers.mergeTransformer.operator({},{interpolate:e=>e}),bu((e=>e[0])))})))),bu((e=>{if(!(null==e?void 0:e.length))return[];let n=!1,r=!1;const a={};for(const t of e.fields)a[(0,l.getFieldDisplayName)(t,e).toLowerCase()]=t;t||(t={});const o=[];for(const i of Lu){const s=t[i.key]||{};if(s.source===l.AnnotationEventFieldSource.Skip)continue;const c={key:i.key,split:i.split};if(s.source===l.AnnotationEventFieldSource.Text)c.text=s.value;else{const t=(s.value||i.key).toLowerCase();c.field=a[t],!c.field&&i.field&&(c.field=i.field(e))}(c.field||c.text)&&(o.push(c),"time"===c.key?n=!0:"text"===c.key&&(r=!0))}if(!n||!r)return console.error("Cannot process annotation fields. No time or text present."),[];const i=[];for(let t=0;t<e.length;t++){const e={type:"default",color:"red"};for(const n of o){let r;if(n.text)r=n.text;else if(n.field&&(r=n.field.values.get(t),void 0!==r&&n.regex)){const e=n.regex.exec(r);e&&(r=e[1]?e[1]:e[0])}null!=r&&(n.split&&"string"==typeof r&&(r=r.split(",")),e[n.key]=r)}i.push(e)}return i})))}(t,e.mappings)},Mu=[{key:"time",field:e=>e.fields.find((e=>e.type===l.FieldType.time)),placeholder:"time, or the first time field"},{key:"timeEnd",help:"When this field is defined, the annotation will be treated as a range"},{key:"title"},{key:"text",field:e=>e.fields.find((e=>e.type===l.FieldType.string)),placeholder:"text, or the first text field"},{key:"tags",split:",",help:"The results will be split on comma (,)"},{key:"id"}],Lu=[...c.config.publicDashboardAccessToken?[{key:"color"},{key:"isRegion"},{key:"source"}]:[],...Mu,{key:"userId"},{key:"login"},{key:"email"},{key:"prevState"},{key:"newState"},{key:"data"},{key:"panelId"},{key:"alertId"},{key:"dashboardId"},{key:"dashboardUID"}],Nu=["prometheus","loki","elasticsearch","grafana-opensearch-datasource"];var Bu=Object.defineProperty,Vu=Object.defineProperties,Fu=Object.getOwnPropertyDescriptors,zu=Object.getOwnPropertySymbols,Wu=Object.prototype.hasOwnProperty,Uu=Object.prototype.propertyIsEnumerable,Hu=(e,t,n)=>t in e?Bu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$u=(e,t)=>{for(var n in t||(t={}))Wu.call(t,n)&&Hu(e,n,t[n]);if(zu)for(var n of zu(t))Uu.call(t,n)&&Hu(e,n,t[n]);return e},Gu=(e,t)=>Vu(e,Fu(t));let qu=100;var Qu=Object.defineProperty,Yu=Object.getOwnPropertySymbols,Ku=Object.prototype.hasOwnProperty,Xu=Object.prototype.propertyIsEnumerable,Zu=(e,t,n)=>t in e?Qu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function Ju(e){return"panel-alert"===e.eventType}var ed=Object.defineProperty,td=Object.defineProperties,nd=Object.getOwnPropertyDescriptors,rd=Object.getOwnPropertySymbols,ad=Object.prototype.hasOwnProperty,od=Object.prototype.propertyIsEnumerable,id=(e,t,n)=>t in e?ed(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sd=(e,t)=>{for(var n in t||(t={}))ad.call(t,n)&&id(e,n,t[n]);if(rd)for(var n of rd(t))od.call(t,n)&&id(e,n,t[n]);return e},ld=(e,t)=>td(e,nd(t));(class extends Lc{constructor(e){super(sd({isEnabled:!0},e),["query"]),this._scopedVars={__sceneObject:Sn(this)}}onEnable(){const e=wl.getTimeRange(this);this._timeRangeSub=e.subscribeToState((()=>{this.runWithTimeRange(e)}))}onDisable(){var e;null==(e=this._timeRangeSub)||e.unsubscribe()}runLayer(){vt("AnnotationsDataLayer","run layer");const e=wl.getTimeRange(this);this.runWithTimeRange(e)}async runWithTimeRange(e){const{query:t}=this.state;if(this.querySub&&this.querySub.unsubscribe(),this._variableDependency.hasDependencyInLoadingState())vt("AnnotationsDataLayer","Variable dependency is in loading state, skipping query execution");else try{let n=function(e,t,n,r){var a;if(e.annotationQuery&&function(e){const{type:t}=e;return!e.annotations||Nu.includes(t)}(e))return console.warn("Using deprecated annotationQuery method, please upgrade your datasource"),(0,E.from)(e.annotationQuery({range:t.state.value,rangeRaw:t.state.value.raw,annotation:n,dashboard:{}})).pipe(bu((e=>({state:ge.Done,events:e}))));const o=$u($u({},ju),e.annotations),i=$u($u({},null==(a=o.getDefaultQuery)?void 0:a.call(o)),n),s=o.prepareAnnotation(i);if(!s)return(0,E.of)({state:ge.Done,events:[]});const u=o.prepareQuery(s);if(!u)return(0,E.of)({state:ge.Done,events:[]});const d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,p=l.rangeUtil.calculateInterval(t.state.value,d,e.interval),f={__interval:{text:p.interval,value:p.interval},__interval_ms:{text:p.intervalMs.toString(),value:p.intervalMs},__annotation:{text:s.name,value:s},__sceneObject:Sn(r)},h=$u(Gu($u({startTime:Date.now(),requestId:"AQ"+qu++,range:t.state.value,maxDataPoints:d,scopedVars:f},p),{app:l.CoreApp.Dashboard,timezone:t.getTimeZone(),targets:[Gu($u({},u),{refId:"Anno"})]}),Ft(r));return(0,c.getRunRequest)()(e,h).pipe(Eu((e=>{const t=(null==e?void 0:e.series.length)?e.series:e.annotations;return(null==t?void 0:t.length)?(t.forEach((e=>{var t;(null==(t=e.meta)?void 0:t.dataTopic)||(e.meta=Gu($u({},e.meta||{}),{dataTopic:l.DataTopic.Annotations}))})),o.processEvents(s,t).pipe(bu((t=>({state:e.state,events:t||[]}))))):(0,E.of)({state:e.state,events:[]})})))}(await this.resolveDataSource(t),e,t,this).pipe(Ut({type:"annotations",origin:this,cancel:()=>this.cancelQuery()}),(0,E.map)((e=>this.processEvents(t,e))));this.querySub=n.subscribe((e=>{this.publishResults(e)}))}catch(e){this.publishResults(ld(sd({},Se),{state:ge.Error,errors:[{message:Ic(e)}]})),console.error("AnnotationsDataLayer error",e)}}async resolveDataSource(e){return await wt(e.datasource||void 0,this._scopedVars)}processEvents(e,t){let n=(r=e,a=t.events||[],r.snapshotData&&delete(r=(0,pe.cloneDeep)(r)).snapshotData,a.map((e=>{var t;const n=((e,t)=>{for(var n in t||(t={}))Ku.call(t,n)&&Zu(e,n,t[n]);if(Yu)for(var n of Yu(t))Xu.call(t,n)&&Zu(e,n,t[n]);return e})({},e);switch(n.source=r,n.color=c.config.theme2.visualization.getColorByName(r.iconColor),n.type=r.name,n.isRegion=Boolean(n.timeEnd&&n.time!==n.timeEnd),null==(t=n.newState)?void 0:t.toLowerCase()){case"pending":n.color="yellow";break;case"alerting":n.color="red";break;case"ok":case"normal":n.color="green";break;case"no_data":case"nodata":n.color="gray"}return n})));var r,a;n=function(e){let t=[];const n=(0,pe.partition)(e,"id"),r=(0,pe.groupBy)(n[0],"id");return t=(0,pe.map)(r,(e=>e.length>1&&!(0,pe.every)(e,Ju)?(0,pe.find)(e,(e=>"panel-alert"!==e.eventType)):(0,pe.head)(e))),t=(0,pe.concat)(t,n[1]),t}(n);const o=ld(sd({},Se),{state:t.state}),i=(0,l.arrayToDataFrame)(n);return i.meta=ld(sd({},i.meta),{dataTopic:l.DataTopic.Annotations}),o.series=[i],o}}).Component=function({model:e}){const{isHidden:t}=e.useState();return t?null:i().createElement(Nc,{layer:e})},Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var cd=Object.defineProperty,ud=Object.defineProperties,dd=Object.getOwnPropertyDescriptors,pd=Object.getOwnPropertySymbols,fd=Object.prototype.hasOwnProperty,hd=Object.prototype.propertyIsEnumerable,gd=(e,t,n)=>t in e?cd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class md extends J{constructor(){super(...arguments),this.isDataLayer=!0,this._results=new E.ReplaySubject(1),this._dataLayersMerger=new ms}subscribeToAllLayers(e){e.length>0?this.querySub=this._dataLayersMerger.getMergedStream(e).subscribe(this._onLayerUpdateReceived.bind(this)):(this._results.next({origin:this,data:Se}),this.setStateHelper({data:Se}))}_onLayerUpdateReceived(e){var t;let n=[];for(const r of e)(null==(t=r.data)?void 0:t.series)&&(n=n.concat(r.data.series));const r=(a=((e,t)=>{for(var n in t||(t={}))fd.call(t,n)&&gd(e,n,t[n]);if(pd)for(var n of pd(t))hd.call(t,n)&&gd(e,n,t[n]);return e})({},Se),ud(a,dd({series:n})));var a;this._results.next({origin:this,data:r}),this.setStateHelper({data:r})}getResultsStream(){return this._results}cancelQuery(){var e;null==(e=this.querySub)||e.unsubscribe()}setStateHelper(e){$t(this,e)}}class bd extends md{constructor(e){var t,n;super({name:null!=(t=e.name)?t:"Data layers",layers:null!=(n=e.layers)?n:[]}),this.addActivationHandler((()=>this._onActivate()))}_onActivate(){return this._subs.add(this.subscribeToState(((e,t)=>{var n;e.layers!==t.layers&&(null==(n=this.querySub)||n.unsubscribe(),this.subscribeToAllLayers(e.layers))}))),this.subscribeToAllLayers(this.state.layers),()=>{var e;null==(e=this.querySub)||e.unsubscribe()}}}bd.Component=({model:e})=>{const{layers:t}=e.useState();return i().createElement(i().Fragment,null,t.map((e=>i().createElement(e.Component,{model:e,key:e.state.key}))))};var yd=Object.defineProperty,vd=Object.defineProperties,wd=Object.getOwnPropertyDescriptors,xd=Object.getOwnPropertySymbols,Sd=Object.prototype.hasOwnProperty,Od=Object.prototype.propertyIsEnumerable,Dd=(e,t,n)=>t in e?yd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cd=(e,t)=>{for(var n in t||(t={}))Sd.call(t,n)&&Dd(e,n,t[n]);if(xd)for(var n of xd(t))Od.call(t,n)&&Dd(e,n,t[n]);return e},Ed=(e,t)=>vd(e,wd(t));class _d extends J{constructor(e){super(e),this._results=new E.ReplaySubject(1),this._variableDependency=new $s(this,{statePaths:["transformations"],onReferencedVariableValueChanged:()=>this.reprocessTransformations()}),this.addActivationHandler((()=>this.activationHandler()))}activationHandler(){const e=this.getSourceData();return this._subs.add(e.subscribeToState((e=>this.transform(e.data)))),e.state.data&&this.transform(e.state.data),()=>{this._transformSub&&this._transformSub.unsubscribe()}}getSourceData(){if(this.state.$data){if(this.state.$data instanceof bd)throw new Error("SceneDataLayerSet can not be used as data provider for SceneDataTransformer.");return this.state.$data}if(!this.parent||!this.parent.parent)throw new Error("SceneDataTransformer must either have $data set on it or have a parent.parent with $data");return wl.getData(this.parent.parent)}setContainerWidth(e){this.state.$data&&this.state.$data.setContainerWidth&&this.state.$data.setContainerWidth(e)}isDataReadyToDisplay(){const e=this.getSourceData();return!e.isDataReadyToDisplay||e.isDataReadyToDisplay()}reprocessTransformations(){this.transform(this.getSourceData().state.data,!0)}cancelQuery(){var e,t;null==(t=(e=this.getSourceData()).cancelQuery)||t.call(e)}getResultsStream(){return this._results}clone(e){const t=super.clone(e);return this._prevDataFromSource&&(t._prevDataFromSource=this._prevDataFromSource),t}haveAlreadyTransformedData(e){if(!this._prevDataFromSource)return!1;if(e===this._prevDataFromSource)return!0;const{series:t,annotations:n}=this._prevDataFromSource;return e.series===t&&e.annotations===n&&(this.state.data&&e.state!==this.state.data.state&&this.setState({data:Ed(Cd({},this.state.data),{state:e.state})}),!0)}transform(e,t=!1){var n;if(0===this.state.transformations.length||!e)return this._prevDataFromSource=e,this.setState({data:e}),void(e&&this._results.next({origin:this,data:e}));if(!t&&this.haveAlreadyTransformedData(e))return;const r=this.state.transformations.filter((e=>!("options"in e)&&!("topic"in e)||null==e.topic||e.topic===l.DataTopic.Series)).map((e=>"operator"in e?e.operator:e)),a=this.state.transformations.filter((e=>("options"in e||"topic"in e)&&e.topic===l.DataTopic.Annotations)).map((e=>"operator"in e?e.operator:e));this._transformSub&&this._transformSub.unsubscribe();const o={interpolate:t=>{var n;return wl.interpolate(this,t,null==(n=e.request)?void 0:n.scopedVars)}};let i=[(0,l.transformDataFrame)(r,e.series,o)];e.annotations&&e.annotations.length>0&&a.length>0&&i.push((0,l.transformDataFrame)(a,null!=(n=e.annotations)?n:[])),this._transformSub=(0,E.forkJoin)(i).pipe((0,E.map)((t=>{const n=t[0],r=t[1];return Ed(Cd({},e),{series:n,annotations:null!=r?r:e.annotations})})),(0,E.catchError)((t=>{var n;console.error("Error transforming data: ",t);const r=(null==(n=this.getSourceData().state.data)?void 0:n.errors)||[],a=(0,c.toDataQueryError)(t);a.message=`Error transforming data: ${a.message}`;const o=Ed(Cd({},e),{state:l.LoadingState.Error,errors:[...r,a]});return(0,E.of)(o)}))).subscribe((t=>{this.setState({data:t}),this._results.next({origin:this,data:t}),this._prevDataFromSource=e}))}}class Pd extends J{}function Rd({variable:e,layout:t,showAlways:n,hideLabel:r}){return ee(e,{shouldActivateOrKeepAlive:!0}).hide!==l.VariableHide.hideVariable||n?"vertical"===t?i().createElement("div",{className:kd,"data-testid":Xt.pages.Dashboard.SubMenu.submenuItem},i().createElement(Id,{variable:e,layout:t,hideLabel:r}),i().createElement(e.Component,{model:e})):i().createElement("div",{className:Td,"data-testid":Xt.pages.Dashboard.SubMenu.submenuItem},i().createElement(Id,{variable:e,hideLabel:r}),i().createElement(e.Component,{model:e})):null}function Id({variable:e,layout:t,hideLabel:n}){var r,a;const{state:o}=e;if(e.state.hide===l.VariableHide.hideLabel||n)return null;const s=`var-${o.key}`,c=null!=(r=o.label)?r:o.name;return i().createElement(Mn,{htmlFor:s,isLoading:o.loading,onCancel:()=>{var t;return null==(t=e.onCancel)?void 0:t.call(e)},label:c,error:o.error,layout:t,description:null!=(a=o.description)?a:void 0})}Pd.Component=function({model:e}){const t=wl.getVariables(e).useState();return i().createElement(i().Fragment,null,t.variables.map((t=>i().createElement(Rd,{key:t.state.key,variable:t,layout:e.state.layout}))))};const Td=(0,Zt.css)({display:"flex"}),kd=(0,Zt.css)({display:"flex",flexDirection:"column"});(class extends J{}).Component=function({model:e}){const t=wl.lookupVariable(e.state.variableName,e);return t?i().createElement(Rd,{key:t.state.key,variable:t,layout:e.state.layout,showAlways:!0}):null};class Ad extends J{constructor(e){super(e),this._variablesThatHaveChanged=new Set,this._variablesToUpdate=new Set,this._updating=new Map,this._variableValueRecorder=new xt,this._variableDependency=new Md(this._handleParentVariableUpdatesCompleted.bind(this)),this._onActivate=()=>{const e=wl.getTimeRange(this);this._subs.add(this.subscribeToEvent(Ne,(e=>this._handleVariableValueChanged(e.payload)))),this._subs.add(e.subscribeToState((()=>{this._refreshTimeRangeBasedVariables()}))),this._subs.add(this.subscribeToState(this._onStateChanged)),this._checkForVariablesThatChangedWhileInactive();for(const e of this.state.variables)this._variableNeedsUpdate(e)&&this._variablesToUpdate.add(e);return this._updateNextBatch(),this._onDeactivate},this._onDeactivate=()=>{var e;for(const t of this._updating.values())null==(e=t.subscription)||e.unsubscribe();for(const e of this.state.variables)this._variablesToUpdate.has(e)||this._updating.has(e)||this._variableValueRecorder.recordCurrentValue(e);this._variablesToUpdate.clear(),this._updating.clear()},this._onStateChanged=(e,t)=>{const n=this._variablesToUpdate.size;for(const n of t.variables)if(!e.variables.includes(n)){const e=this._updating.get(n);(null==e?void 0:e.subscription)&&e.subscription.unsubscribe(),this._updating.delete(n),this._variablesToUpdate.delete(n)}for(const n of e.variables)t.variables.includes(n)||this._variableNeedsUpdate(n)&&this._variablesToUpdate.add(n);0===n&&this._variablesToUpdate.size>0&&this._updateNextBatch()},this.addActivationHandler(this._onActivate)}getByName(e){return this.state.variables.find((t=>t.state.name===e))}_refreshTimeRangeBasedVariables(){for(const e of this.state.variables)"refresh"in e.state&&e.state.refresh===l.VariableRefresh.onTimeRangeChanged&&this._variablesToUpdate.add(e);this._updateNextBatch()}_checkForVariablesThatChangedWhileInactive(){if(this._variableValueRecorder.hasValues())for(const e of this.state.variables)this._variableValueRecorder.hasValueChanged(e)&&(jd(e,"Changed while in-active"),this._addDependentVariablesToUpdateQueue(e))}_variableNeedsUpdate(e){return!(e.isLazy||!e.validateAndUpdate||this._variableValueRecorder.hasRecordedValue(e)&&(jd(e,"Skipping updateAndValidate current value valid"),1))}_updateNextBatch(){for(const e of this._variablesToUpdate){if(!e.validateAndUpdate)throw new Error("Variable added to variablesToUpdate but does not have validateAndUpdate");if(this._updating.has(e))continue;if(wl.hasVariableDependencyInLoadingState(e))continue;const t={variable:e};this._updating.set(e,t),jd(e,"updateAndValidate started"),t.subscription=e.validateAndUpdate().subscribe({next:()=>this._validateAndUpdateCompleted(e),complete:()=>this._validateAndUpdateCompleted(e),error:t=>this._handleVariableError(e,t)})}}_validateAndUpdateCompleted(e){var t;if(!this._updating.has(e))return;const n=this._updating.get(e);null==(t=null==n?void 0:n.subscription)||t.unsubscribe(),this._updating.delete(e),this._variablesToUpdate.delete(e),jd(e,"updateAndValidate completed"),this._notifyDependentSceneObjects(e),this._updateNextBatch()}cancel(e){var t;const n=this._updating.get(e);null==(t=null==n?void 0:n.subscription)||t.unsubscribe(),this._updating.delete(e),this._variablesToUpdate.delete(e)}_handleVariableError(e,t){var n;const r=this._updating.get(e);null==(n=null==r?void 0:r.subscription)||n.unsubscribe(),this._updating.delete(e),this._variablesToUpdate.delete(e),e.setState({loading:!1,error:t.message}),console.error("SceneVariableSet updateAndValidate error",t),jd(e,"updateAndValidate error",t),this._notifyDependentSceneObjects(e),this._updateNextBatch()}_handleVariableValueChanged(e){this._variablesThatHaveChanged.add(e),this._addDependentVariablesToUpdateQueue(e),this._updating.has(e)||(this._updateNextBatch(),this._notifyDependentSceneObjects(e))}_handleParentVariableUpdatesCompleted(e,t){t&&this._addDependentVariablesToUpdateQueue(e),this._variablesToUpdate.size>0&&0===this._updating.size&&this._updateNextBatch()}_addDependentVariablesToUpdateQueue(e){for(const t of this.state.variables)t.variableDependency&&t.variableDependency.hasDependencyOn(e.state.name)&&(jd(t,"Added to update queue, dependant variable value changed"),this._updating.has(t)&&t.onCancel&&t.onCancel(),this._variablesToUpdate.add(t))}_notifyDependentSceneObjects(e){this.parent&&(this._traverseSceneAndNotify(this.parent,e,this._variablesThatHaveChanged.has(e)),this._variablesThatHaveChanged.delete(e))}_traverseSceneAndNotify(e,t,n){if(this!==e&&e.isActive){if(e.state.$variables&&e.state.$variables!==this&&e.state.$variables.getByName(t.state.name))return;e.variableDependency&&e.variableDependency.variableUpdateCompleted(t,n),e.forEachChild((e=>this._traverseSceneAndNotify(e,t,n)))}}isVariableLoadingOrWaitingToUpdate(e){return!(!e.isAncestorLoading||!e.isAncestorLoading())||!(!this._variablesToUpdate.has(e)&&!this._updating.has(e))||wl.hasVariableDependencyInLoadingState(e)}}function jd(e,t,n){n?vt("SceneVariableSet",`Variable[${e.state.name}]: ${t}`,n):vt("SceneVariableSet",`Variable[${e.state.name}]: ${t}`)}class Md{constructor(e){this._variableUpdatesCompleted=e,this._emptySet=new Set}getNames(){return this._emptySet}hasDependencyOn(e){return!1}variableUpdateCompleted(e,t){this._variableUpdatesCompleted(e,t)}}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var Ld=Object.defineProperty,Nd=Object.getOwnPropertySymbols,Bd=Object.prototype.hasOwnProperty,Vd=Object.prototype.propertyIsEnumerable,Fd=(e,t,n)=>t in e?Ld(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class zd extends Gt{constructor(e){super(((e,t)=>{for(var n in t||(t={}))Bd.call(t,n)&&Fd(e,n,t[n]);if(Nd)for(var n of Nd(t))Vd.call(t,n)&&Fd(e,n,t[n]);return e})({type:"custom",query:"",value:"",text:"",options:[],name:""},e)),this._variableDependency=new $s(this,{statePaths:["query"]})}getValueOptions(e){var t;const n=(null!=(t=wl.interpolate(this,this.state.query).match(/(?:\\,|[^,])+/g))?t:[]).map((e=>{var t;e=e.replace(/\\,/g,",");const n=null!=(t=/^(.+)\s:\s(.+)$/g.exec(e))?t:[];if(3===n.length){const[,e,t]=n;return{label:e.trim(),value:t.trim()}}return{label:e.trim(),value:e.trim()}}));return(0,E.of)(n)}}zd.Component=({model:e})=>mn(e);var Wd=Object.defineProperty,Ud=Object.getOwnPropertySymbols,Hd=Object.prototype.hasOwnProperty,$d=Object.prototype.propertyIsEnumerable,Gd=(e,t,n)=>t in e?Wd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class qd extends Gt{constructor(e){super(((e,t)=>{for(var n in t||(t={}))Hd.call(t,n)&&Gd(e,n,t[n]);if(Ud)for(var n of Ud(t))$d.call(t,n)&&Gd(e,n,t[n]);return e})({type:"datasource",value:"",text:"",options:[],name:"",regex:"",pluginId:""},e)),this._variableDependency=new $s(this,{statePaths:["regex"]})}getValueOptions(e){if(!this.state.pluginId)return(0,E.of)([]);const t=(0,c.getDataSourceSrv)().getList({metrics:!0,variables:!1,pluginId:this.state.pluginId});let n;if(this.state.regex){const e=wl.interpolate(this,this.state.regex,void 0,"regex");n=(0,l.stringToJsRegex)(e)}const r=[];for(let e=0;e<t.length;e++){const a=t[e];Qd(a,n)&&r.push({label:a.name,value:a.uid}),this.state.defaultOptionEnabled&&Yd(a,n)&&r.push({label:"default",value:"default"})}return 0===r.length?this.setState({error:"No data sources found"}):this.state.error&&this.setState({error:null}),(0,E.of)(r)}}function Qd(e,t){return!t||t.exec(e.name)}function Yd(e,t){return!!e.isDefault&&(!t||t.exec("default"))}function Kd(e,t){const n=["A","B","C","D","E","F","G","H"],r=[];if(t>5)return[];for(const a of n){const n=`${e}${a}`;r.push({name:n,children:Kd(n,t+1)})}return r}function Xd(e,t,n){if(n>=t.length)return e;if("*"===t[n])return e;const r=t[n];let a=[],o=[r];r.startsWith("{")&&(o=r.replace(/\{|\}/g,"").split(","));for(const r of e)for(const e of o)if(-1!==e.indexOf("*")){const o=e.replace("*","");new RegExp(`^${o}.*`,"gi").test(r.name)&&(a=a.concat(Xd([r],t,n+1)))}else r.name===e&&(a=a.concat(Xd(r.children,t,n+1)));return a}function Zd(e){return 0===e.indexOf("value")?[{name:e,children:[]}]:Xd(Kd("",0),e.split("."),0)}qd.Component=({model:e})=>mn(e);var Jd=Object.defineProperty,ep=Object.getOwnPropertySymbols,tp=Object.prototype.hasOwnProperty,np=Object.prototype.propertyIsEnumerable,rp=(e,t,n)=>t in e?Jd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function ap({model:e}){const{value:t,key:n,loading:r}=e.useState(),o=(0,a.useCallback)((t=>{e.setValue(t.currentTarget.value)}),[e]),s=(0,a.useCallback)((t=>{"Enter"===t.key&&e.setValue(t.currentTarget.value)}),[e]);return i().createElement(Yt.AutoSizeInput,{id:n,placeholder:"Enter value",minWidth:15,value:t,loading:r,onBlur:o,onKeyDown:s})}(class extends Gt{constructor(e,t=!1){super(((e,t)=>{for(var n in t||(t={}))tp.call(t,n)&&rp(e,n,t[n]);if(ep)for(var n of ep(t))np.call(t,n)&&rp(e,n,t[n]);return e})({type:"custom",name:"Test",value:"Value",text:"Text",query:"Query",options:[],refresh:l.VariableRefresh.onDashboardLoad,updateOptions:!0},e)),this.completeUpdate=new E.Subject,this.isGettingValues=!0,this.getValueOptionsCount=0,this.isLazy=!1,this._variableDependency=new $s(this,{statePaths:["query"]}),this.isLazy=t}getValueOptions(e){const{delayMs:t}=this.state;this.getValueOptionsCount+=1;const n=wl.getQueryController(this);return new E.Observable((e=>{const r={type:"variable",origin:this,cancel:()=>e.complete()};if(n&&n.queryStarted(r),this.setState({loading:!0}),this.state.throwError)throw new Error(this.state.throwError);const a=wl.interpolate(this,this.state.query),o=this.getOptions(a),i=this.completeUpdate.subscribe({next:()=>{const t={issuedQuery:a,loading:!1};this.state.updateOptions&&(t.options=o),this.setState(t),e.next(o),e.complete()}});let s;return t?s=window.setTimeout((()=>this.signalUpdateCompleted()),t):0===t&&this.signalUpdateCompleted(),this.isGettingValues=!0,()=>{i.unsubscribe(),window.clearTimeout(s),this.isGettingValues=!1,this.state.loading&&this.setState({loading:!1}),n&&n.queryCompleted(r)}}))}cancel(){const e=ce(this,(e=>e instanceof Ad?e:void 0));null==e||e.cancel(this)}getOptions(e){return this.state.optionsToReturn?this.state.optionsToReturn:Zd(e).map((e=>({label:e.name,value:e.name})))}signalUpdateCompleted(){this.completeUpdate.next(1)}}).Component=({model:e})=>mn(e);var op=Object.defineProperty,ip=Object.getOwnPropertySymbols,sp=Object.prototype.hasOwnProperty,lp=Object.prototype.propertyIsEnumerable,cp=(e,t,n)=>t in e?op(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;(class extends J{constructor(e){super(((e,t)=>{for(var n in t||(t={}))sp.call(t,n)&&cp(e,n,t[n]);if(ip)for(var n of ip(t))lp.call(t,n)&&cp(e,n,t[n]);return e})({type:"textbox",value:"",name:""},e)),this._urlSync=new Oe(this,{keys:()=>[this.getKey()]})}getValue(){return this.state.value}setValue(e){e!==this.state.value&&(this.setState({value:e}),this.publishEvent(new Ne(this),!0))}getKey(){return`var-${this.state.name}`}getUrlState(){return{[this.getKey()]:this.state.value}}updateFromUrl(e){const t=e[this.getKey()];"string"==typeof t&&this.setValue(t)}}).Component=({model:e})=>i().createElement(ap,{model:e}),Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var up=Object.defineProperty,dp=Object.getOwnPropertySymbols,pp=Object.prototype.hasOwnProperty,fp=Object.prototype.propertyIsEnumerable,hp=(e,t,n)=>t in e?up(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;(class extends J{constructor(e){super(((e,t)=>{for(var n in t||(t={}))pp.call(t,n)&&hp(e,n,t[n]);if(dp)for(var n of dp(t))fp.call(t,n)&&hp(e,n,t[n]);return e})({type:"interval",value:"",intervals:["1m","10m","30m","1h","6h","12h","1d","7d","14d","30d"],name:"",autoStepCount:30,autoMinInterval:"10s",autoEnabled:!1,refresh:_l.CO.onTimeRangeChanged},e)),this._onChange=e=>{this.setState({value:e.value}),this.publishEvent(new Ne(this),!0)},this._urlSync=new Oe(this,{keys:()=>[this.getKey()]})}getKey(){return`var-${this.state.name}`}getUrlState(){return{[this.getKey()]:this.state.value}}updateFromUrl(e){const t={},n=e[this.getKey()];"string"==typeof n&&(n.startsWith("$__auto_interval_")?t.value=Je:t.value=n),this.setState(t)}getOptionsForSelect(){const{value:e,intervals:t,autoEnabled:n}=this.state;let r=t.map((e=>({value:e,label:e})));return n&&(r=[{value:Je,label:"Auto"},...r]),e&&!r.some((t=>t.value===e))&&r.push({value:e,label:e}),r}getValue(){const{value:e,autoStepCount:t,autoMinInterval:n}=this.state;return e===Je?this.getAutoRefreshInteval(t,n):e}getAutoRefreshInteval(e,t){const n=wl.getTimeRange(this).state.value;return l.rangeUtil.calculateInterval(n,e,t).interval}validateAndUpdate(){const{value:e,intervals:t}=this.state;let n=!1;if(e===Je)n=!0;else if(!e&&t.length>0){const e=t[0];this.setState({value:e}),n=!0}return n&&this.publishEvent(new Ne(this),!0),(0,E.of)({})}}).Component=({model:e})=>{const{key:t,value:n}=e.useState();return i().createElement(Yt.Select,{id:t,placeholder:"Select value",width:"auto",value:n,tabSelectsValue:!1,options:e.getOptionsForSelect(),onChange:e._onChange})};var gp,mp,bp=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},yp=(e,t,n)=>(bp(e,t,"read from private field"),n?n.call(e):t.get(e)),vp=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},wp=(e,t,n,r)=>(bp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class xp extends l.BusEventWithPayload{}xp.type="new-scene-object-added";class Sp{constructor(e={}){this._urlKeyMapper=new xl,this._paramsCache=new Op,this._options=e}initSync(e){var t;if(this._subs&&(vt("UrlSyncManager","Unregister previous scene state subscription",null==(t=this._sceneRoot)?void 0:t.state.key),this._subs.unsubscribe()),vt("UrlSyncManager","init",e.state.key),this._sceneRoot=e,this._subs=new E.Subscription,this._subs.add(e.subscribeToEvent(W,(e=>{this.handleSceneObjectStateChanged(e.payload.changedObject)}))),this._subs.add(e.subscribeToEvent(xp,(e=>{this.handleNewObject(e.payload)}))),this._urlKeyMapper.clear(),this._lastLocation=c.locationService.getLocation(),this.handleNewObject(this._sceneRoot),this._options.updateUrlOnInit){const t=Ol(e);(function(e,t){for(let n in e)if(!El(t.getAll(n),e[n]))return!0;return!1})(t,this._paramsCache.getParams())&&c.locationService.partial(t,!0)}}cleanUp(e){this._sceneRoot===e&&(vt("UrlSyncManager","Clean up"),this._subs&&(this._subs.unsubscribe(),this._subs=void 0,vt("UrlSyncManager","Root deactived, unsub to state","same key",this._sceneRoot.state.key===e.state.key)),this._sceneRoot=void 0,this._lastLocation=void 0)}handleNewLocation(e){this._sceneRoot&&this._lastLocation!==e&&(vt("UrlSyncManager","handleNewLocation"),this._lastLocation=e,Dl(this._sceneRoot,this._paramsCache.getParams(),this._urlKeyMapper))}handleNewObject(e){this._sceneRoot&&Dl(e,this._paramsCache.getParams(),this._urlKeyMapper)}handleSceneObjectStateChanged(e){var t,n;if(!e.urlSync)return;const r=e.urlSync.getUrlState(),a=c.locationService.getSearch(),o={};for(const[t,n]of Object.entries(r)){const r=this._urlKeyMapper.getUniqueKey(t,e);El(a.getAll(r),n)||(o[r]=n)}if(Object.keys(o).length>0){const a=!0!==(null==(n=(t=e.urlSync).shouldCreateHistoryStep)?void 0:n.call(t,r));vt("UrlSyncManager","onStateChange updating URL"),c.locationService.partial(o,a),this._lastLocation=c.locationService.getLocation()}}getUrlState(e){return Ol(e)}}class Op{constructor(){vp(this,gp,void 0),vp(this,mp,void 0)}getParams(){const e=c.locationService.getLocation();return yp(this,mp)===e||(wp(this,mp,e),wp(this,gp,new URLSearchParams(e.search))),yp(this,gp)}}gp=new WeakMap,mp=new WeakMap;class Dp extends J{constructor(e){super(e),this.addActivationHandler((()=>{const e=function(e){const t=window.__grafanaSceneContext;return vt("setWindowGrafanaScene","set window.__grafanaSceneContext",e),window.__grafanaSceneContext=e,()=>{window.__grafanaSceneContext===e&&(vt("setWindowGrafanaScene","restore window.__grafanaSceneContext",t),window.__grafanaSceneContext=t)}}(this);return()=>{e()}}))}}Dp.Component=function({model:e}){const{body:t,controls:n}=e.useState(),r=(0,Yt.useStyles2)(Cp);return i().createElement("div",{className:r.container},n&&i().createElement("div",{className:r.controls},n.map((e=>i().createElement(e.Component,{key:e.state.key,model:e})))),i().createElement("div",{className:r.body},i().createElement(t.Component,{model:t})))};const Cp=e=>({container:(0,Zt.css)({flexGrow:1,display:"flex",gap:e.spacing(2),minHeight:"100%",flexDirection:"column"}),body:(0,Zt.css)({flexGrow:1,display:"flex",gap:e.spacing(1)}),controls:(0,Zt.css)({display:"flex",gap:e.spacing(2),alignItems:"flex-end",flexWrap:"wrap"})});function Ep(e){return e instanceof Cf}(class extends J{addItem(e){this.setState({items:this.state.items?[...this.state.items,e]:[e]})}setItems(e){this.setState({items:e})}}).Component=function({model:e}){const{items:t=[]}=e.useState(),n=i().useRef(null);(0,a.useEffect)((()=>{n.current&&n.current.focus()}),[]);const r=e=>e.map((e=>{switch(e.type){case"divider":return i().createElement(Yt.Menu.Divider,{key:e.text});case"group":return i().createElement(Yt.Menu.Group,{key:e.text,label:e.text},e.subMenu?r(e.subMenu):void 0);default:return i().createElement(Yt.Menu.Item,{key:e.text,label:e.text,icon:e.iconClassName,childItems:e.subMenu?r(e.subMenu):void 0,url:e.href,onClick:e.onClick,shortcut:e.shortcut,testId:Xt.components.Panels.Panel.menuItems(e.text)})}}));return i().createElement(Yt.Menu,{ref:n},r(t))},class extends J{}.Component=function({model:e}){const{body:t}=e.useState(),n=e.parent;if(n&&!(n instanceof gf)&&!Ep(n))throw new Error("SceneGridItem must be a child of SceneGridLayout or SceneGridRow");return t?i().createElement(t.Component,{model:t}):null};var _p=n(2548),Pp=n.n(_p);var Rp=Object.defineProperty,Ip=Object.getOwnPropertySymbols,Tp=Object.prototype.hasOwnProperty,kp=Object.prototype.propertyIsEnumerable,Ap=(e,t,n)=>t in e?Rp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function jp(){const e=(0,a.useRef)(void 0);return null!=e.current||(e.current=(0,pe.uniqueId)()),e.current}const Mp=i().forwardRef(((e,t)=>{var n=e,{children:r,onLoad:o,onChange:s,className:l}=n,c=((e,t)=>{var n={};for(var r in e)Tp.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ip)for(var r of Ip(e))t.indexOf(r)<0&&kp.call(e,r)&&(n[r]=e[r]);return n})(n,["children","onLoad","onChange","className"]);const u=jp(),{hideEmpty:d}=(0,Yt.useStyles2)(Lp),[p,f]=(0,a.useState)(!1),[h,g]=(0,a.useState)(!1),m=(0,a.useRef)(null);var b;(0,a.useImperativeHandle)(t,(()=>m.current)),b=()=>{Mp.addCallback(u,(e=>{!p&&e.isIntersecting&&(f(!0),null==o||o()),g(e.isIntersecting),null==s||s(e.isIntersecting)}));const e=m.current;return e&&Mp.observer.observe(e),()=>{e&&Mp.observer.unobserve(e),delete Mp.callbacks[u],0===Object.keys(Mp.callbacks).length&&Mp.observer.disconnect()}},(0,a.useEffect)(b,[]);const y=`${p?d:""} ${l}`;return i().createElement("div",((e,t)=>{for(var n in t||(t={}))Tp.call(t,n)&&Ap(e,n,t[n]);if(Ip)for(var n of Ip(t))kp.call(t,n)&&Ap(e,n,t[n]);return e})({id:u,ref:m,className:y},c),p&&("function"==typeof r?r({isInView:h}):r))}));function Lp(){return{hideEmpty:(0,Zt.css)({"&:empty":{display:"none"}})}}Mp.displayName="LazyLoader",Mp.callbacks={},Mp.addCallback=(e,t)=>Mp.callbacks[e]=t,Mp.observer=new IntersectionObserver((e=>{for(const t of e)"function"==typeof Mp.callbacks[t.target.id]&&Mp.callbacks[t.target.id](t)}),{rootMargin:"100px"});var Np=Object.defineProperty,Bp=Object.defineProperties,Vp=Object.getOwnPropertyDescriptors,Fp=Object.getOwnPropertySymbols,zp=Object.prototype.hasOwnProperty,Wp=Object.prototype.propertyIsEnumerable,Up=(e,t,n)=>t in e?Np(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hp=(e,t)=>{for(var n in t||(t={}))zp.call(t,n)&&Up(e,n,t[n]);if(Fp)for(var n of Fp(t))Wp.call(t,n)&&Up(e,n,t[n]);return e},$p=(e,t)=>Bp(e,Vp(t)),Gp=(e,t)=>{var n={};for(var r in e)zp.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Fp)for(var r of Fp(e))t.indexOf(r)<0&&Wp.call(e,r)&&(n[r]=e[r]);return n};const qp=i().forwardRef(((e,t)=>{var n;const r=e,{grid:a,layoutItem:o,index:s,totalCount:l,isLazy:c,style:u,onLoad:d,onChange:p,children:f}=r,h=Gp(r,["grid","layoutItem","index","totalCount","isLazy","style","onLoad","onChange","children"]),g=a.getSceneLayoutChild(o.i),m=null==(n=g.getClassName)?void 0:n.call(g),b=i().createElement(g.Component,{model:g,key:g.state.key});return c?i().createElement(Mp,$p(Hp({},h),{key:g.state.key,"data-griditem-key":g.state.key,className:(0,Zt.cx)(m,e.className),style:u,ref:t}),b,f):i().createElement("div",$p(Hp({},h),{ref:t,key:g.state.key,"data-griditem-key":g.state.key,className:(0,Zt.cx)(m,e.className),style:u}),b,f)}));function Qp(e,t,n){e.current?t?e.current.classList.add("react-grid-layout--enable-move-animations"):e.current.classList.remove("react-grid-layout--enable-move-animations"):n||setTimeout((()=>Qp(e,t,!0)),50)}qp.displayName="GridItemWrapper";const Yp=i().forwardRef(((e,t)=>{var n=Gp(e,["handleAxis"]);const r=(0,Yt.useStyles2)(Kp);return i().createElement("div",$p(Hp({ref:t},n),{className:`${r} scene-resize-handle`}),i().createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i().createElement("path",{d:"M21 15L15 21M21 8L8 21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}));function Kp(e){return(0,Zt.css)({position:"absolute",bottom:0,right:0,zIndex:999,padding:e.spacing(1.5,0,0,1.5),color:e.colors.border.strong,cursor:"se-resize","&:hover":{color:e.colors.text.link},svg:{display:"block"},".react-resizable-hide &":{display:"none"}})}Yp.displayName="ResizeHandle";var Xp=Object.defineProperty,Zp=Object.defineProperties,Jp=Object.getOwnPropertyDescriptors,ef=Object.getOwnPropertySymbols,tf=Object.prototype.hasOwnProperty,nf=Object.prototype.propertyIsEnumerable,rf=(e,t,n)=>t in e?Xp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var af=Object.defineProperty,of=Object.defineProperties,sf=Object.getOwnPropertyDescriptors,lf=Object.getOwnPropertySymbols,cf=Object.prototype.hasOwnProperty,uf=Object.prototype.propertyIsEnumerable,df=(e,t,n)=>t in e?af(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pf=(e,t)=>{for(var n in t||(t={}))cf.call(t,n)&&df(e,n,t[n]);if(lf)for(var n of lf(t))uf.call(t,n)&&df(e,n,t[n]);return e},ff=(e,t)=>of(e,sf(t));const hf=class extends J{constructor(e){super(ff(pf({},e),{children:mf(e.children)})),this._skipOnLayoutChange=!1,this._oldLayout=[],this._loadOldLayout=!1,this.onLayoutChange=e=>{if(this._skipOnLayoutChange)this._skipOnLayoutChange=!1;else{this._loadOldLayout&&(e=[...this._oldLayout],this._loadOldLayout=!1);for(const r of e){const e=this.getSceneLayoutChild(r.i),a={x:r.x,y:r.y,width:r.w,height:r.h};n=a,((t=e.state).x!==n.x||t.y!==n.y||t.width!==n.width||t.height!==n.height)&&e.setState(pf({},a))}var t,n;this.setState({children:mf(this.state.children)})}},this.onResizeStop=(e,t,n)=>{this.getSceneLayoutChild(n.i).setState({width:n.w,height:n.h})},this.onDragStart=e=>{this._oldLayout=[...e]},this.onDragStop=(e,t,n)=>{const r=this.getSceneLayoutChild(n.i);e=bf(e);for(let t=0;t<e.length;t++){const n=e[t],r=this.getSceneLayoutChild(n.i),a=r.state;(null==a?void 0:a.x)===n.x&&(null==a?void 0:a.y)===n.y||r.setState({x:n.x,y:n.y})}const a=e.findIndex((e=>e.i===n.i));let o=this.findGridItemSceneParent(e,a-1),i=this.state.children;r instanceof Cf&&o instanceof Cf&&(this.isRowDropValid(e,n,a)||(this._loadOldLayout=!0),o=this),o!==r.parent&&(i=this.moveChildTo(r,o)),this.setState({children:mf(i)}),this._skipOnLayoutChange=!0}}isDraggable(){var e;return null!=(e=this.state.isDraggable)&&e}getDragClass(){return`grid-drag-handle-${this.state.key}`}getDragClassCancel(){return"grid-drag-cancel"}toggleRow(e){var t,n;if(!e.state.isCollapsed)return e.setState({isCollapsed:!0}),void this.setState({});const r=e.state.children;if(0===r.length)return e.setState({isCollapsed:!1}),void this.setState({});const a=e.state.y,o=(null!=(t=r[0].state.y)?t:a)-(a+1);let i=a;for(const e of r){const t=pf({},e.state);t.y=null!=(n=t.y)?n:a,t.y-=o,t.y!==e.state.y&&e.setState(t),i=Math.max(i,Number(t.y)+Number(t.height))}const s=i-a-1;for(const t of this.state.children)if(t.state.y>a&&this.pushChildDown(t,s),Ep(t)&&t!==e)for(const e of t.state.children)e.state.y>a&&this.pushChildDown(e,s);e.setState({isCollapsed:!1}),this.setState({})}ignoreLayoutChange(e){this._skipOnLayoutChange=e}getSceneLayoutChild(e){for(const t of this.state.children){if(t.state.key===e)return t;if(t instanceof Cf)for(const n of t.state.children)if(n.state.key===e)return n}throw new Error("Scene layout child not found for GridItem")}pushChildDown(e,t){e.setState({y:e.state.y+t})}findGridItemSceneParent(e,t){for(let n=t;n>=0;n--){const t=e[n],r=this.getSceneLayoutChild(t.i);if(r instanceof Cf)return r.state.isCollapsed?this:r}return this}isRowDropValid(e,t,n){if(e[e.length-1].i===t.i)return!0;const r=this.getSceneLayoutChild(e[n+1].i);return r instanceof Cf||r.parent instanceof hf}moveChildTo(e,t){const n=e.parent;let r=this.state.children;const a=e.clone({key:e.state.key});if(n instanceof Cf){const o=n.clone();if(o.setState({children:o.state.children.filter((t=>t.state.key!==e.state.key))}),r=r.map((e=>e===n?o:e)),t instanceof Cf){const e=t.clone();e.setState({children:[...e.state.children,a]}),r=r.map((n=>n===t?e:n))}else r=[...r,a]}else if(!(t instanceof hf)){r=r.filter((t=>t.state.key!==e.state.key));const n=t.clone();n.setState({children:[...n.state.children,a]}),r=r.map((e=>e===t?n:e))}return r}toGridCell(e){var t,n;const r=e.state;let a=null!=(t=r.x)?t:0,o=null!=(n=r.y)?n:0;const i=Number.isInteger(Number(r.width))?Number(r.width):4,s=Number.isInteger(Number(r.height))?Number(r.height):4;let l=e.state.isDraggable,c=e.state.isResizable;return e instanceof Cf&&(l=!!e.state.isCollapsed,c=!1),{i:e.state.key,x:a,y:o,h:s,w:i,isResizable:c,isDraggable:l}}buildGridLayout(e,t){let n=[];for(const e of this.state.children)if(n.push(this.toGridCell(e)),e instanceof Cf&&!e.state.isCollapsed)for(const t of e.state.children)n.push(this.toGridCell(t));return n=bf(n),this.state.UNSAFE_fitPanels&&(n=function(e,t){const n=t-32,r=Math.max(...e.map((e=>e.h+e.y)))/Math.floor(n/38);return e.map((e=>{return t=((e,t)=>{for(var n in t||(t={}))tf.call(t,n)&&rf(e,n,t[n]);if(ef)for(var n of ef(t))nf.call(t,n)&&rf(e,n,t[n]);return e})({},e),n={y:Math.round(e.y/r)||0,h:Math.round(e.h/r)||1},Zp(t,Jp(n));var t,n}))}(n,t)),e<768?(this._skipOnLayoutChange=!0,n.map((e=>ff(pf({},e),{w:24})))):(this._skipOnLayoutChange=!1,n)}};let gf=hf;function mf(e){return e.forEach((e=>{e instanceof Cf&&e.setState({children:mf(e.state.children)})})),[...e].sort(((e,t)=>e.state.y-t.state.y||e.state.x-t.state.x))}function bf(e){return[...e].sort(((e,t)=>e.y-t.y||e.x-t.x))}gf.Component=function({model:e}){const{children:t,isLazy:n,isDraggable:r,isResizable:o}=e.useState(),[s,{width:l,height:c}]=zl(),u=(0,a.useRef)(null);return(0,a.useEffect)((()=>{Qp(u,!!r)}),[r]),function(e){if(e.some((e=>void 0===e.state.height||void 0===e.state.width||void 0===e.state.x||void 0===e.state.y)))throw new Error("All children must have a size specified")}(t),i().createElement("div",{ref:s,style:{flex:"1 1 auto",position:"relative",zIndex:1,width:"100%"}},((t,a)=>{if(!t||!a)return null;const s=e.buildGridLayout(t,a);return i().createElement("div",{ref:u,style:{width:`${t}px`,height:"100%"},className:"react-grid-layout"},i().createElement(Pp(),{width:t,isDraggable:r&&t>768,isResizable:null!=o&&o,containerPadding:[0,0],useCSSTransforms:!0,margin:[8,8],cols:24,rowHeight:30,draggableHandle:`.grid-drag-handle-${e.state.key}`,draggableCancel:".grid-drag-cancel",layout:s,onDragStart:e.onDragStart,onDragStop:e.onDragStop,onResizeStop:e.onResizeStop,onLayoutChange:e.onLayoutChange,isBounded:!1,resizeHandle:i().createElement(Yp,null)},s.map(((t,r)=>i().createElement(qp,{key:t.i,grid:e,layoutItem:t,index:r,isLazy:n,totalCount:s.length})))))})(l,c))};var yf=Object.defineProperty,vf=Object.defineProperties,wf=Object.getOwnPropertyDescriptors,xf=Object.getOwnPropertySymbols,Sf=Object.prototype.hasOwnProperty,Of=Object.prototype.propertyIsEnumerable,Df=(e,t,n)=>t in e?yf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class Cf extends J{constructor(e){var t;super((t=((e,t)=>{for(var n in t||(t={}))Sf.call(t,n)&&Df(e,n,t[n]);if(xf)for(var n of xf(t))Of.call(t,n)&&Df(e,n,t[n]);return e})({children:e.children||[],isCollapsible:e.isCollapsible||!0,title:e.title||""},e),vf(t,wf({x:0,height:1,width:24})))),this._variableDependency=new $s(this,{statePaths:["title"]}),this.onCollapseToggle=()=>{this.state.isCollapsible&&this.getGridLayout().toggleRow(this)}}getGridLayout(){const e=this.parent;if(!(e&&e instanceof gf))throw new Error("SceneGridRow must be a child of SceneGridLayout");return e}getUrlState(){return{rowc:this.state.isCollapsed?"1":"0"}}updateFromUrl(e){null!=e.rowc&&e.rowc!==this.getUrlState().rowc&&this.onCollapseToggle()}}Cf.Component=function({model:e}){const t=(0,Yt.useStyles2)(Ef),{isCollapsible:n,isCollapsed:r,title:a,actions:o,children:s}=e.useState(),l=e.getGridLayout(),c=l.getDragClass(),u=l.isDraggable(),d=s?s.length:0,p=1===d?"panel":"panels";return i().createElement("div",{className:(0,Zt.cx)(t.row,r&&t.rowCollapsed)},i().createElement("div",{className:t.rowTitleAndActionsGroup},i().createElement("button",{onClick:e.onCollapseToggle,className:t.rowTitleButton,"aria-label":r?"Expand row":"Collapse row","data-testid":Xt.components.DashboardRow.title(wl.interpolate(e,a,void 0,"text"))},n&&i().createElement(Yt.Icon,{name:r?"angle-right":"angle-down"}),i().createElement("span",{className:t.rowTitle,role:"heading"},wl.interpolate(e,a,void 0,"text"))),i().createElement("span",{className:(0,Zt.cx)(t.panelCount,r&&t.panelCountCollapsed)},"(",d," ",p,")"),o&&i().createElement("div",{className:t.rowActions},i().createElement(o.Component,{model:o}))),u&&r&&i().createElement("div",{className:(0,Zt.cx)(t.dragHandle,c)},i().createElement(Yt.Icon,{name:"draggabledots"})))};const Ef=e=>({row:(0,Zt.css)({width:"100%",height:"30px",display:"flex",justifyContent:"space-between",gap:e.spacing(1)}),rowTitleButton:(0,Zt.css)({display:"flex",alignItems:"center",cursor:"pointer",background:"transparent",border:"none",gap:e.spacing(1)}),rowCollapsed:(0,Zt.css)({borderBottom:`1px solid ${e.colors.border.weak}`}),rowTitle:(0,Zt.css)({fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium}),collapsedInfo:(0,Zt.css)({fontSize:e.typography.bodySmall.fontSize,color:e.colors.text.secondary,display:"flex",alignItems:"center",flexGrow:1}),rowTitleAndActionsGroup:(0,Zt.css)({display:"flex","&:hover, &:focus-within":{"& > div":{opacity:1}}}),rowActions:(0,Zt.css)({display:"flex",opacity:0,transition:"200ms opacity ease-in 200ms","&:hover, &:focus-within":{opacity:1}}),dragHandle:(0,Zt.css)({display:"flex",padding:e.spacing(0,1),alignItems:"center",justifyContent:"flex-end",cursor:"move",color:e.colors.text.secondary,"&:hover":{color:e.colors.text.primary}}),panelCount:(0,Zt.css)({paddingLeft:e.spacing(2),color:e.colors.text.secondary,fontStyle:"italic",fontSize:e.typography.size.sm,fontWeight:"normal",display:"none",lineHeight:"30px"}),panelCountCollapsed:(0,Zt.css)({display:"inline-block"})});(class extends J{constructor(){super(...arguments),this.onToggle=()=>{this.setState({isCollapsed:!this.state.isCollapsed})},this.onRemove=()=>{const e=this.parent;"body"in e.state&&e.setState({body:void 0})}}}).Component=function({model:e}){const{title:t,isCollapsed:n,canCollapse:r,canRemove:a,body:o,controls:s}=e.useState(),l=(0,Yt.useStyles2)(Ef),c=(0,Yt.useStyles2)(_f),u=(null!=s?s:[]).map((e=>i().createElement(e.Component,{key:e.state.key,model:e})));return a&&u.push(i().createElement(Yt.ToolbarButton,{icon:"times",variant:"default",onClick:e.onRemove,key:"remove-button","aria-label":"Remove scene"})),i().createElement("div",{className:c.wrapper},i().createElement("div",{className:(0,Zt.cx)(c.row,n&&c.rowCollapsed)},i().createElement("button",{onClick:e.onToggle,className:l.rowTitleButton,"aria-label":n?"Expand scene":"Collapse scene"},r&&i().createElement(Yt.Icon,{name:n?"angle-right":"angle-down"}),i().createElement("span",{className:l.rowTitle,role:"heading"},wl.interpolate(e,t,void 0,"text"))),i().createElement("div",{className:c.actions},u)),!n&&i().createElement(o.Component,{model:o}))};const _f=e=>({wrapper:(0,Zt.css)({display:"flex",flexDirection:"column",flexGrow:1,gap:e.spacing(1)}),row:(0,Zt.css)({width:"100%",display:"flex",justifyContent:"space-between",gap:e.spacing(1)}),rowCollapsed:(0,Zt.css)({borderBottom:`1px solid ${e.colors.border.weak}`,paddingBottom:e.spacing(1)}),actions:(0,Zt.css)({display:"flex",alignItems:"center",gap:e.spacing(1),justifyContent:"flex-end",flexGrow:1})});(class extends J{constructor(){super(...arguments),this._variableDependency=new $s(this,{statePaths:["text"]})}}).Component=({model:e})=>{const{text:t,fontSize:n=20,align:r="left",key:a,spacing:o}=e.useState(),s=(0,Yt.useTheme2)(),l=(0,Zt.css)({fontSize:n,display:"flex",flexGrow:1,alignItems:"center",padding:o?s.spacing(o,0):void 0,justifyContent:r});return i().createElement("div",{className:l,"data-testid":a},wl.interpolate(e,t))},class extends J{}.Component=({model:e})=>{const t=e.useState();return i().createElement(Yt.ToolbarButton,{onClick:t.onClick,icon:t.icon})},class extends J{}.Component=({model:e})=>{const t=e.useState();return i().createElement("div",{style:{display:"flex"}},t.label&&i().createElement(Mn,{label:t.label}),i().createElement(Yt.Input,{defaultValue:t.value,width:8,onBlur:t=>{e.state.onChange(parseInt(t.currentTarget.value,10))}}))};class Pf extends J{constructor(){super(...arguments),this.onZoom=()=>{const e=wl.getTimeRange(this),t=function(e,t){const n=e.to.valueOf()-e.from.valueOf(),r=e.to.valueOf()-n/2,a=0===n?3e4:2*n,o=r+a/2,i=r-a/2;return{from:(0,l.toUtc)(i),to:(0,l.toUtc)(o),raw:{from:(0,l.toUtc)(i),to:(0,l.toUtc)(o)}}}(e.state.value);e.onTimeRangeChange(t)},this.onChangeFiscalYearStartMonth=e=>{wl.getTimeRange(this).setState({fiscalYearStartMonth:e})},this.toAbsolute=()=>{const e=wl.getTimeRange(this),t=e.state.value,n=(0,l.toUtc)(t.from),r=(0,l.toUtc)(t.to);e.onTimeRangeChange({from:n,to:r,raw:{from:n,to:r}})},this.onMoveBackward=()=>{const e=wl.getTimeRange(this),{state:{value:t}}=e;e.onTimeRangeChange(If(Rf.Backward,t,Date.now()))},this.onMoveForward=()=>{const e=wl.getTimeRange(this),{state:{value:t}}=e;e.onTimeRangeChange(If(Rf.Forward,t,Date.now()))}}}Pf.Component=function({model:e}){const{hidePicker:t,isOnCanvas:n}=e.useState(),r=wl.getTimeRange(e),a=r.getTimeZone(),o=r.useState();return t?null:i().createElement(Yt.TimeRangePicker,{isOnCanvas:null==n||n,value:o.value,onChange:r.onTimeRangeChange,timeZone:a,fiscalYearStartMonth:o.fiscalYearStartMonth,onMoveBackward:e.onMoveBackward,onMoveForward:e.onMoveForward,onZoom:e.onZoom,onChangeTimeZone:r.onTimeZoneChange,onChangeFiscalYearStartMonth:e.onChangeFiscalYearStartMonth})};var Rf=(e=>(e[e.Backward=0]="Backward",e[e.Forward=1]="Forward",e))(Rf||{});function If(e,t,n){const r=t.to.valueOf(),a=t.from.valueOf(),o=(r-a)/2;let i,s;0===e?(i=a-o,s=r-o):(i=a+o,s=r+o,s>n&&r<n&&(s=n,i=a));const c=(0,l.toUtc)(i),u=(0,l.toUtc)(s);return{from:c,to:u,raw:{from:c,to:u}}}var Tf=Object.defineProperty,kf=Object.defineProperties,Af=Object.getOwnPropertyDescriptors,jf=Object.getOwnPropertySymbols,Mf=Object.prototype.hasOwnProperty,Lf=Object.prototype.propertyIsEnumerable,Nf=(e,t,n)=>t in e?Tf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const Bf=["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"];class Vf extends J{constructor(e){var t,n,r,a,o;super((a=((e,t)=>{for(var n in t||(t={}))Mf.call(t,n)&&Nf(e,n,t[n]);if(jf)for(var n of jf(t))Lf.call(t,n)&&Nf(e,n,t[n]);return e})({refresh:""},e),o={autoValue:void 0,autoEnabled:null==(t=e.autoEnabled)||t,autoMinInterval:null!=(n=e.autoMinInterval)?n:c.config.minRefreshInterval,intervals:(null!=(r=e.intervals)?r:Bf).filter((t=>{var n;const r=null!=(n=e.minRefreshInterval)?n:c.config.minRefreshInterval;return!r||l.rangeUtil.intervalToMs(t)>=l.rangeUtil.intervalToMs(r)}))},kf(a,Af(o)))),this._urlSync=new Oe(this,{keys:["refresh"]}),this._autoRefreshBlocked=!1,this.onRefresh=()=>{const e=wl.getQueryController(this);if(null==e?void 0:e.state.isRunning)return void e.cancelAll();const t=wl.getTimeRange(this);this._intervalTimer&&clearInterval(this._intervalTimer),t.onRefresh(),this.setupIntervalTimer()},this.onIntervalChanged=e=>{this.setState({refresh:e}),this.setupIntervalTimer()},this.setupAutoTimeRangeListener=()=>wl.getTimeRange(this).subscribeToState(((e,t)=>{e.from===t.from&&e.to===t.to||this.setupIntervalTimer()})),this.calculateAutoRefreshInterval=()=>{var e;const t=wl.getTimeRange(this),n=null!=(e=null==window?void 0:window.innerWidth)?e:2e3;return l.rangeUtil.calculateInterval(t.state.value,n,this.state.autoMinInterval)},this.setupIntervalTimer=()=>{var e;const t=wl.getTimeRange(this),{refresh:n,intervals:r}=this.state;if((this._intervalTimer||""===n)&&clearInterval(this._intervalTimer),""===n)return;if(n!==Yt.RefreshPicker.autoOption.value&&r&&!r.includes(n))return;let a;if(null==(e=this._autoTimeRangeListener)||e.unsubscribe(),n===Yt.RefreshPicker.autoOption.value){const e=this.calculateAutoRefreshInterval();a=e.intervalMs,this._autoTimeRangeListener=this.setupAutoTimeRangeListener(),e.interval!==this.state.autoValue&&this.setState({autoValue:e.interval})}else a=l.rangeUtil.intervalToMs(n);this._intervalTimer=setInterval((()=>{this.isTabVisible()?t.onRefresh():this._autoRefreshBlocked=!0}),a)},this.addActivationHandler((()=>{this.setupIntervalTimer();const e=()=>{this._autoRefreshBlocked&&"visible"===document.visibilityState&&(this._autoRefreshBlocked=!1,this.onRefresh())};return document.addEventListener("visibilitychange",e),()=>{var t;this._intervalTimer&&clearInterval(this._intervalTimer),document.removeEventListener("visibilitychange",e),null==(t=this._autoTimeRangeListener)||t.unsubscribe()}}))}getUrlState(){return{refresh:this.state.refresh}}updateFromUrl(e){const{intervals:t}=this.state,n=e.refresh;n&&"string"==typeof n&&((null==t?void 0:t.includes(n))?this.setState({refresh:n}):this.setState({refresh:t?t[0]:void 0}))}isTabVisible(){return void 0===document.visibilityState||"visible"===document.visibilityState}}Vf.Component=function({model:e}){var t;const{refresh:n,intervals:r,autoEnabled:a,autoValue:o,isOnCanvas:s,primary:l,withText:c}=e.useState(),u=function(e){const t=wl.getQueryController(e);return!!t&&t.useState().isRunning}(e);let d,p,f=n===(null==(t=Yt.RefreshPicker.autoOption)?void 0:t.value)?o:c?"Refresh":void 0;return u&&(d="Cancel all queries",c&&(f="Cancel")),c&&(p="96px"),i().createElement(Yt.RefreshPicker,{showAutoInterval:a,value:n,intervals:r,tooltip:d,width:p,text:f,onRefresh:e.onRefresh,primary:l,onIntervalChanged:e.onIntervalChanged,isLoading:u,isOnCanvas:null==s||s})};const Ff=e=>`${e}-compare`;var zf=Object.defineProperty,Wf=Object.defineProperties,Uf=Object.getOwnPropertyDescriptors,Hf=Object.getOwnPropertySymbols,$f=Object.prototype.hasOwnProperty,Gf=Object.prototype.propertyIsEnumerable,qf=(e,t,n)=>t in e?zf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qf=(e,t)=>{for(var n in t||(t={}))$f.call(t,n)&&qf(e,n,t[n]);if(Hf)for(var n of Hf(t))Gf.call(t,n)&&qf(e,n,t[n]);return e},Yf=(e,t)=>Wf(e,Uf(t));const Kf="__previousPeriod",Xf="__noPeriod",Zf={label:"Previous period",value:Kf},Jf={label:"No comparison",value:Xf},eh=[{label:"Day before",value:"24h"},{label:"Week before",value:"1w"},{label:"Month before",value:"1M"}];(class extends J{constructor(e){super(Qf({compareOptions:eh},e)),this._urlSync=new Oe(this,{keys:["compareWith"]}),this._onActivate=()=>{const e=wl.getTimeRange(this);this.setState({compareOptions:this.getCompareOptions(e.state.value)}),this._subs.add(e.subscribeToState((e=>{const t=this.getCompareOptions(e.value),n={compareOptions:t};Boolean(this.state.compareWith)&&!t.find((({value:e})=>e===this.state.compareWith))&&(n.compareWith=Kf),this.setState(n)})))},this.getCompareOptions=e=>{const t=Math.ceil(e.to.diff(e.from)),n=eh.findIndex((({value:e})=>l.rangeUtil.intervalToMs(e)>=t));return[Jf,Zf,...eh.slice(n).map((({label:e,value:t})=>({label:e,value:t})))]},this.onCompareWithChanged=e=>{e===Xf?this.onClearCompare():this.setState({compareWith:e})},this.onClearCompare=()=>{this.setState({compareWith:void 0})},this.addActivationHandler(this._onActivate)}getExtraQueries(e){const t=[],n=this.getCompareTimeRange(e.range);if(!n)return t;const r=e.targets.filter((e=>!1!==e.timeRangeCompare));return r.length&&t.push({req:Yf(Qf({},e),{targets:r,range:n}),processor:th}),t}shouldRerun(e,t,n){return e.compareWith!==t.compareWith&&void 0!==n.find((e=>!1!==e.timeRangeCompare))}getCompareTimeRange(e){let t,n;if(this.state.compareWith){if(this.state.compareWith===Kf){const r=e.to.diff(e.from);t=(0,l.dateTime)(e.from).subtract(r),n=(0,l.dateTime)(e.to).subtract(r)}else t=(0,l.dateTime)(e.from).subtract(l.rangeUtil.intervalToMs(this.state.compareWith)),n=(0,l.dateTime)(e.to).subtract(l.rangeUtil.intervalToMs(this.state.compareWith));return{from:t,to:n,raw:{from:t,to:n}}}}getUrlState(){return{compareWith:this.state.compareWith}}updateFromUrl(e){if(!e.compareWith)return;const t=Ce(e.compareWith);t&&(this.getCompareOptions(wl.getTimeRange(this).state.value).find((({value:e})=>e===t))?this.setState({compareWith:t}):this.setState({compareWith:"__previousPeriod"}))}}).Component=function({model:e}){var t;const n=(0,Yt.useStyles2)(nh),{compareWith:r,compareOptions:a}=e.useState(),[o,s]=i().useState(r),l=null!=(t=a.find((({value:e})=>e===o)))?t:Zf,c=a.find((({value:e})=>e===r)),u=Boolean(c),d=()=>{u?(s(r),e.onClearCompare()):u||e.onCompareWithChanged(l.value)};return i().createElement(Yt.ButtonGroup,null,i().createElement(Yt.ToolbarButton,{variant:"canvas",tooltip:"Enable time frame comparison",onClick:e=>{e.stopPropagation(),e.preventDefault(),d()}},i().createElement(Yt.Checkbox,{label:" ",value:u,onClick:d}),"Comparison"),u?i().createElement(Yt.ButtonSelect,{variant:"canvas",value:c,options:a,onChange:t=>{e.onCompareWithChanged(t.value)}}):i().createElement(Yt.ToolbarButton,{className:n.previewButton,disabled:!0,variant:"canvas",isOpen:!1},l.label))};const th=(e,t)=>{const n=t.timeRange.from.diff(e.timeRange.from);return t.series.forEach((e=>{e.refId=Ff(e.refId||""),e.meta=Yf(Qf({},e.meta),{timeCompare:{diffMs:n,isTimeShiftQuery:!0}}),e.fields.forEach((e=>(e.type===l.FieldType.time&&(e.values=e.values.map((e=>n<0?e-n:e+n))),e.config=Yf(Qf({},e.config),{color:{mode:"fixed",fixedColor:c.config.theme.palette.gray60}}),e)))})),(0,E.of)(t)};function nh(e){return{previewButton:(0,Zt.css)({"&:disabled":{border:`1px solid ${e.colors.secondary.border}`,color:e.colors.text.disabled,opacity:1}})}}(class extends J{constructor(e){super(e),this.addActivationHandler((()=>{const e=wl.getData(this);this._subs.add(e.subscribeToState((e=>{var t;(null==(t=e.data)?void 0:t.state)===l.LoadingState.Done&&this.performRepeat(e.data)}))),e.state.data&&this.performRepeat(e.state.data)}))}performRepeat(e){const t=[];for(let n=0;n<e.series.length;n++){const r=this.state.getLayoutChild(e,e.series[n],n);t.push(r)}this.state.body.setState({children:t})}}).Component=({model:e})=>{const{body:t}=e.useState();return i().createElement(t.Component,{model:t})},class extends J{constructor(e){super(e),this._variableDependency=new $s(this,{variableNames:[this.state.variableName],onVariableUpdateCompleted:()=>this.performRepeat()}),this.addActivationHandler((()=>this.performRepeat()))}performRepeat(){if(this._variableDependency.hasDependencyInLoadingState())return;const e=wl.lookupVariable(this.state.variableName,this);if(!(e instanceof Gt))return void console.error("SceneByVariableRepeater: variable is not a MultiValueVariable");const t=function(e){const{value:t,text:n,options:r}=e.state;return e.hasAllValue()?r:Array.isArray(t)&&Array.isArray(n)?t.map(((e,t)=>({value:e,label:n[t]}))):[{value:t,label:n}]}(e),n=[];for(const e of t){const t=this.state.getLayoutChild(e);n.push(t)}this.state.body.setState({children:n})}}.Component=({model:e})=>{const{body:t}=e.useState();return i().createElement(t.Component,{model:t})};const rh=class extends J{constructor(){super({})}get Component(){return rh.Component}};let ah=rh;ah.Component=e=>i().createElement("div",{style:{flexGrow:1}});class oh extends J{toggleDirection(){this.setState({direction:"row"===this.state.direction?"column":"row"})}isDraggable(){return!1}}oh.Component=function({model:e,parentState:t}){const{children:n,isHidden:r}=e.useState(),o=function(e,t){return(0,a.useMemo)((()=>{var n,r,a,o,i,s,l,u,d,p;const{direction:f="row",wrap:h}=e,g=c.config.theme2,m={};return t?sh(m,e,t):(m.display="flex",m.flexGrow=1,m.minWidth=e.minWidth,m.minHeight=e.minHeight),m.flexDirection=f,m.gap="8px",m.flexWrap=h||"nowrap",m.alignContent="baseline",m.minWidth=m.minWidth||0,m.minHeight=m.minHeight||0,m[g.breakpoints.down("md")]={flexDirection:null!=(r=null==(n=e.md)?void 0:n.direction)?r:"column",maxWidth:null!=(o=null==(a=e.md)?void 0:a.maxWidth)?o:"unset",maxHeight:null!=(s=null==(i=e.md)?void 0:i.maxHeight)?s:"unset",height:null!=(u=null==(l=e.md)?void 0:l.height)?u:"unset",width:null!=(p=null==(d=e.md)?void 0:d.width)?p:"unset"},(0,Zt.css)(m)}),[t,e])}(e.state,t);return r?null:i().createElement("div",{className:o},n.map((t=>{const n=t.Component;return i().createElement(n,{key:t.state.key,model:t,parentState:e.state})})))};class ih extends J{}function sh(e,t,n){var r,a,o;const i=null!=(r=n.direction)?r:"row",{xSizing:s="fill",ySizing:l="fill"}=t;return e.display="flex",e.position="relative",e.flexDirection=i,"column"===i?(t.height?e.height=t.height:e.flexGrow="fill"===l?1:0,t.width?e.width=t.width:e.alignSelf="fill"===s?"stretch":"flex-start"):(t.height?e.height=t.height:e.alignSelf="fill"===l?"stretch":"flex-start",t.width?e.width=t.width:e.flexGrow="fill"===s?1:0),e.minWidth=t.minWidth,e.maxWidth=t.maxWidth,e.maxHeight=t.maxHeight,e.minHeight=null!=(a=t.minHeight)?a:n.minHeight,e.height=null!=(o=t.height)?o:n.height,e}ih.Component=function({model:e,parentState:t}){if(!t)throw new Error("SceneFlexItem must be a child of SceneFlexLayout");const{body:n,isHidden:r}=e.useState(),o=function(e,t){return(0,a.useMemo)((()=>{var n,r,a,o,i,s,l,u,d,p;const f=c.config.theme2,h=sh({},e,t);return h[f.breakpoints.down("md")]={maxWidth:null!=(r=null==(n=e.md)?void 0:n.maxWidth)?r:"unset",maxHeight:null!=(o=null==(a=e.md)?void 0:a.maxHeight)?o:"unset",height:null!=(l=null==(i=e.md)?void 0:i.height)?l:null==(s=t.md)?void 0:s.height,width:null!=(p=null==(u=e.md)?void 0:u.width)?p:null==(d=t.md)?void 0:d.width},(0,Zt.css)(h)}),[e,t])}(e.state,t);return!n||r?null:i().createElement("div",{className:o},i().createElement(n.Component,{model:n}))};var lh=Object.defineProperty,ch=Object.getOwnPropertySymbols,uh=Object.prototype.hasOwnProperty,dh=Object.prototype.propertyIsEnumerable,ph=(e,t,n)=>t in e?lh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class fh extends J{constructor(e){var t,n;super(((e,t)=>{for(var n in t||(t={}))uh.call(t,n)&&ph(e,n,t[n]);if(ch)for(var n of ch(t))dh.call(t,n)&&ph(e,n,t[n]);return e})({rowGap:1,columnGap:1,templateColumns:"repeat(auto-fit, minmax(400px, 1fr))",autoRows:null!=(t=e.autoRows)?t:"320px",children:null!=(n=e.children)?n:[]},e))}isDraggable(){return!1}}fh.Component=function({model:e}){const{children:t,isHidden:n,isLazy:r}=e.useState(),o=(s=e.state,(0,a.useMemo)((()=>{var e,t,n,r,a,o,i,l,u,d,p;const f={},h=c.config.theme2;return f.display="grid",f.gridTemplateColumns=s.templateColumns,f.gridTemplateRows=s.templateRows||"unset",f.gridAutoRows=s.autoRows||"unset",f.rowGap=h.spacing(null!=(e=s.rowGap)?e:1),f.columnGap=h.spacing(null!=(t=s.columnGap)?t:1),f.justifyItems=s.justifyItems||"unset",f.alignItems=s.alignItems||"unset",f.justifyContent=s.justifyContent||"unset",f.flexGrow=1,s.md&&(f[h.breakpoints.down("md")]={gridTemplateRows:null==(n=s.md)?void 0:n.templateRows,gridTemplateColumns:null==(r=s.md)?void 0:r.templateColumns,rowGap:s.md.rowGap?h.spacing(null!=(o=null==(a=s.md)?void 0:a.rowGap)?o:1):void 0,columnGap:s.md.columnGap?h.spacing(null!=(l=null==(i=s.md)?void 0:i.rowGap)?l:1):void 0,justifyItems:null==(u=s.md)?void 0:u.justifyItems,alignItems:null==(d=s.md)?void 0:d.alignItems,justifyContent:null==(p=s.md)?void 0:p.justifyContent}),(0,Zt.css)(f)}),[s]));var s;return n?null:i().createElement("div",{className:o},t.map((t=>{const n=t.Component;return r?i().createElement(Mp,{key:t.state.key,className:o},i().createElement(n,{key:t.state.key,model:t,parentState:e.state})):i().createElement(n,{key:t.state.key,model:t,parentState:e.state})})))};class hh extends J{}hh.Component=function({model:e,parentState:t}){if(!t)throw new Error("SceneCSSGridItem must be a child of SceneCSSGridLayout");const{body:n,isHidden:r}=e.useState(),o=(s=e.state,(0,a.useMemo)((()=>{const e={};return e.gridColumn=s.gridColumn||"unset",e.gridRow=s.gridRow||"unset",e.position="relative",(0,Zt.css)(e)}),[s]));var s;return!n||r?null:i().createElement("div",{className:o},i().createElement(n.Component,{model:n}))};var gh=Object.defineProperty,mh=Object.getOwnPropertySymbols,bh=Object.prototype.hasOwnProperty,yh=Object.prototype.propertyIsEnumerable,vh=(e,t,n)=>t in e?gh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wh=(e,t)=>{for(var n in t||(t={}))bh.call(t,n)&&vh(e,n,t[n]);if(mh)for(var n of mh(t))yh.call(t,n)&&vh(e,n,t[n]);return e};const xh=new Set(["ArrowUp","ArrowDown"]),Sh=new Set(["ArrowLeft","ArrowRight"]),Oh={row:{dim:"width",axis:"clientX",min:"minWidth",max:"maxWidth"},column:{dim:"height",axis:"clientY",min:"minHeight",max:"maxHeight"}};function Dh({direction:e="row",handleSize:t=32,initialSize:n="auto",primaryPaneStyles:r,secondaryPaneStyles:o,onDragFinished:s,children:l}){const c=i().Children.toArray(l),u=(0,a.useRef)(null),d=(0,a.useRef)(null),p=(0,a.useRef)(null),f=(0,a.useRef)(null),h=(0,a.useRef)(null),g=(0,a.useRef)("1fr"),m=(0,a.useRef)(void 0),b=(0,a.useRef)(void 0),y=Oh[e].dim,v=Oh[e].axis,w=Oh[e].min,x=Oh[e].max;!function(e,t,n=0,r){const o=(0,pe.throttle)(t,n);(0,a.useLayoutEffect)((()=>{if(!e)return;const t=new ResizeObserver(o);return t.observe(e,{box:"device-pixel-content-box"}),()=>t.disconnect()}),r)}(f.current,(e=>{for(const t of e){if(!t.target.isSameNode(f.current))return;const e=d.current.getBoundingClientRect()[y],n=Eh(d.current);u.current.ariaValueNow=`${(0,pe.clamp)((e-n[w])/(n[x]-n[w])*100,0,100)}`}}),500,[x,w,e,y]);const S=(0,a.useRef)(null),O=(0,a.useCallback)((e=>{g.current=d.current.getBoundingClientRect()[y],h.current=f.current.getBoundingClientRect()[y],S.current=e[v],u.current.setPointerCapture(e.pointerId),m.current=Eh(d.current),b.current=void 0}),[y,v]),D=(0,a.useCallback)((e=>{if(null!==S.current&&"1fr"!==g.current){const n=e[v]-S.current,r=m.current,a=(0,pe.clamp)(g.current+n,r[w],r[x]),o=a/(h.current-t);d.current.style.flexGrow=`${o}`,p.current.style.flexGrow=""+(1-o);const i=(0,pe.clamp)((a-r[w])/(r[x]-r[w])*100,0,100);u.current.ariaValueNow=`${i}`}}),[t,v,w,x]),C=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),u.current.releasePointerCapture(e.pointerId),S.current=null,null==s||s(parseFloat(d.current.style.flexGrow))}),[s]),E=(0,a.useRef)(new Set),_=(0,a.useRef)(null),P=(0,a.useCallback)((n=>{var r;if(0===E.current.size)return void(_.current=null);if("1fr"===g.current)return;const a=.3*(n-(null!=(r=_.current)?r:n));let o=0;"row"===e?(E.current.has("ArrowLeft")&&(o-=a),E.current.has("ArrowRight")&&(o+=a)):(E.current.has("ArrowUp")&&(o-=a),E.current.has("ArrowDown")&&(o+=a));const i=m.current,s=d.current.getBoundingClientRect()[y],l=(0,pe.clamp)(s+o,i[w],i[x]),c=l/(h.current-t);d.current.style.flexGrow=`${c}`,p.current.style.flexGrow=""+(1-c);const f=(l-i[w])/(i[x]-i[w])*100;u.current.ariaValueNow=`${(0,pe.clamp)(f,0,100)}`,_.current=n,window.requestAnimationFrame(P)}),[e,t,w,x,y]),R=(0,a.useCallback)((n=>{if("Enter"!==n.key){if("Home"===n.key){m.current=Eh(d.current),h.current=f.current.getBoundingClientRect()[y];const e=m.current[w]/(h.current-t);return d.current.style.flexGrow=`${e}`,p.current.style.flexGrow=""+(1-e),void(u.current.ariaValueNow="0")}if("End"===n.key){m.current=Eh(d.current),h.current=f.current.getBoundingClientRect()[y];const e=m.current[x]/(h.current-t);return d.current.style.flexGrow=`${e}`,p.current.style.flexGrow=""+(1-e),void(u.current.ariaValueNow="100")}if(("column"===e&&xh.has(n.key)||"row"===e&&Sh.has(n.key))&&!E.current.has(n.key)&&(b.current=void 0,n.preventDefault(),n.stopPropagation(),g.current=d.current.getBoundingClientRect()[y],h.current=f.current.getBoundingClientRect()[y],m.current=Eh(d.current),!E.current.has(n.key))){const e=0===E.current.size;E.current.add(n.key),e&&window.requestAnimationFrame(P)}}else void 0===b.current?(b.current=d.current.style.flexGrow,d.current.style.flexGrow="0",p.current.style.flexGrow="1"):(d.current.style.flexGrow=b.current,p.current.style.flexGrow=""+(1-parseFloat(b.current)),b.current=void 0)}),[e,P,t,x,y,w]),I=(0,a.useCallback)((t=>{"row"===e&&!Sh.has(t.key)||"column"===e&&!xh.has(t.key)||(E.current.delete(t.key),null==s||s(parseFloat(d.current.style.flexGrow)))}),[e,s]),T=(0,a.useCallback)((()=>{d.current.style.flexGrow="0.5",p.current.style.flexGrow="0.5";const e=Eh(d.current);m.current=e,g.current=d.current.getBoundingClientRect()[y],u.current.ariaValueNow=""+(g.current-e[w])/(e[x]-e[w])*100}),[x,y,w]),k=(0,a.useCallback)((()=>{E.current.size>0&&(E.current.clear(),S.current=null,null==s||s(parseFloat(d.current.style.flexGrow)))}),[s]),A=(0,Yt.useStyles2)(Ch),j=jp(),M=2===c.length?"visible":"hidden";return i().createElement("div",{ref:f,className:A.container,style:{flexDirection:e}},i().createElement("div",{ref:d,className:A.panel,style:wh({flexGrow:"auto"===n?.5:(0,pe.clamp)(n,0,1),[w]:"min-content"},r),id:`start-panel-${j}`},c[0]),c[1]&&i().createElement(i().Fragment,null,i().createElement("div",{ref:u,style:{[y]:`${t}px`},className:(0,Zt.cx)(A.handle,{[A.handleHorizontal]:"column"===e}),onPointerUp:C,onPointerDown:O,onPointerMove:D,onKeyDown:R,onKeyUp:I,onDoubleClick:T,onBlur:k,role:"separator","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":50,"aria-controls":`start-panel-${j}`,"aria-label":"Pane resize widget",tabIndex:0}),i().createElement("div",{ref:p,className:A.panel,style:wh({flexGrow:"auto"===n?.5:(0,pe.clamp)(1-n,0,1),[w]:"min-content",visibility:`${M}`},o),id:`end-panel-${j}`},c[1])))}function Ch(e){return{handle:(0,Zt.css)({cursor:"col-resize",position:"relative",flexShrink:0,userSelect:"none","&::before":{content:'""',position:"absolute",backgroundColor:e.colors.primary.main,left:"50%",transform:"translate(-50%)",top:0,height:"100%",width:"1px",opacity:0,transition:"opacity ease-in-out 0.2s"},"&::after":{content:'""',width:"4px",borderRadius:"4px",backgroundColor:e.colors.border.weak,transition:"background-color ease-in-out 0.2s",height:"50%",top:"calc(50% - (50%) / 2)",transform:"translateX(-50%)",position:"absolute",left:"50%"},"&:hover, &:focus-visible":{outline:"none","&::before":{opacity:1},"&::after":{backgroundColor:e.colors.primary.main}}}),handleHorizontal:(0,Zt.css)({cursor:"row-resize","&::before":{left:"inherit",transform:"translateY(-50%)",top:"50%",height:"1px",width:"100%"},"&::after":{width:"50%",height:"4px",top:"50%",transform:"translateY(-50%)",left:"calc(50% - (50%) / 2)"}}),container:(0,Zt.css)({display:"flex",width:"100%",flexGrow:1,overflow:"hidden"}),panel:(0,Zt.css)({display:"flex",position:"relative",flexBasis:0})}}function Eh(e){if(null===e)return;const t=document.body.style.overflow,n=e.style.width,r=e.style.height,a=e.style.flexGrow;document.body.style.overflow="hidden",e.style.flexGrow="0";const{width:o,height:i}=e.getBoundingClientRect();e.style.flexGrow="100";const{width:s,height:l}=e.getBoundingClientRect();return document.body.style.overflow=t,e.style.width=n,e.style.height=r,e.style.flexGrow=a,{minWidth:o,maxWidth:s,minHeight:i,maxHeight:l}}(class extends J{toggleDirection(){this.setState({direction:"row"===this.state.direction?"column":"row"})}isDraggable(){return!1}}).Component=function({model:e}){const{primary:t,secondary:n,direction:r,isHidden:a,initialSize:o,primaryPaneStyles:s,secondaryPaneStyles:l}=e.useState();if(a)return null;const c=t.Component,u=null==n?void 0:n.Component;let d=n?o:1;return i().createElement(Dh,{direction:r,initialSize:null!=d?d:.5,primaryPaneStyles:s,secondaryPaneStyles:l},i().createElement(c,{key:t.state.key,model:t,parentState:e.state}),u&&n&&i().createElement(u,{key:n.state.key,model:n,parentState:e.state}))};class _h extends J{enrichDataRequest(){return{app:this.state.name||"app"}}}_h.Component=({model:e})=>{const{pages:t}=e.useState();return i().createElement(Ph.Provider,{value:e},i().createElement(s.Switch,null,t.map((e=>i().createElement(s.Route,{key:e.state.url,exact:!1,path:e.state.url,render:t=>b(e,t)})))))};const Ph=(0,a.createContext)(null),Rh=new Map;function Ih(e){const t=Rh.get(e);if(t)return t;const n=e();return Rh.set(e,n),n}var Th=Object.defineProperty,kh=Object.getOwnPropertySymbols,Ah=Object.prototype.hasOwnProperty,jh=Object.prototype.propertyIsEnumerable,Mh=(e,t,n)=>t in e?Th(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class Lh extends J{}function Nh({node:e}){const t=e.useState(),n=(0,Yt.useStyles2)(Bh);return i().createElement("div",{className:n.container},Object.keys(t).map((r=>i().createElement("div",{className:n.row,key:r},i().createElement("div",{className:n.keyName},r),i().createElement("div",{className:n.value},function(e,t,n){if(null===t)return"null";switch(typeof t){case"number":return i().createElement(Yt.Input,{type:"number",defaultValue:t,onBlur:t=>n.setState({[e]:t.currentTarget.valueAsNumber})});case"string":return i().createElement(Yt.Input,{type:"text",defaultValue:t,onBlur:t=>n.setState({[e]:t.currentTarget.value})});case"object":return mt(t)?t.constructor.name:(0,pe.isPlainObject)(t)||(0,pe.isArray)(t)?i().createElement(Yt.JSONFormatter,{json:t,open:0}):String(t);default:return typeof t}}(r,t[r],e))))))}function Bh(e){return{container:(0,Zt.css)({flexGrow:1,display:"flex",gap:e.spacing(.5),flexDirection:"column"}),row:(0,Zt.css)({display:"flex",gap:e.spacing(2)}),keyName:(0,Zt.css)({display:"flex",flexGrow:"0",width:120,alignItems:"center",height:e.spacing(e.components.height.md)}),value:(0,Zt.css)({flexGrow:1,minHeight:e.spacing(e.components.height.md),display:"flex",alignItems:"center"})}}function Vh({node:e,selectedObject:t,onSelect:n}){const r=(0,Yt.useStyles2)(Fh),a=[],o=e===t;return e.forEachChild((e=>{a.push(i().createElement(Vh,{node:e,key:e.state.key,selectedObject:t,onSelect:n}))})),i().createElement("div",{className:r.container},i().createElement("div",{className:(0,Zt.cx)(r.name,o&&r.selected),onClick:()=>n(e)},e.constructor.name),i().createElement("div",{className:r.children},a))}function Fh(e){return{container:(0,Zt.css)({flexGrow:1,display:"flex",gap:e.spacing(.5),flexDirection:"column"}),name:(0,Zt.css)({flexGrow:1,display:"flex",gap:e.spacing(1),fontSize:e.typography.bodySmall.fontSize,cursor:"pointer",padding:e.spacing(0,1),borderRadius:e.shape.borderRadius(2),position:"relative","&:hover":{background:e.colors.background.secondary}}),selected:(0,Zt.css)({"&::before":{display:"block",content:"' '",position:"absolute",left:0,width:4,bottom:2,top:2,borderRadius:e.shape.radius.default,backgroundImage:e.colors.gradients.brandVertical}}),children:(0,Zt.css)({flexGrow:1,display:"flex",flexDirection:"column",paddingLeft:e.spacing(1)})}}function zh({scene:e}){const t=(0,Yt.useStyles2)(Wh),[n,r]=(0,a.useState)(!1),[o,s]=(0,a.useState)();return i().createElement(i().Fragment,null,i().createElement(Yt.ToolbarButton,{variant:"canvas",icon:"bug",onClick:()=>r(!0)}),n&&i().createElement(Yt.Drawer,{title:"Scene debugger",onClose:()=>r(!1),size:"lg"},i().createElement("div",{className:t.panes},i().createElement("div",{className:t.pane1},i().createElement("div",{className:t.paneHeading},"Scene graph"),i().createElement(Yt.CustomScrollbar,{autoHeightMin:"100%"},i().createElement("div",{className:t.treeWrapper},i().createElement(Vh,{node:e,selectedObject:o,onSelect:s})))),i().createElement("div",{className:t.pane2},i().createElement("div",{className:t.paneHeading},"Object details"),o&&i().createElement(Nh,{node:o})))))}function Wh(e){return{panes:(0,Zt.css)({flexGrow:1,display:"flex",height:"100%",flexDirection:"row",marginTop:e.spacing(-2)}),pane1:(0,Zt.css)({flexGrow:0,display:"flex",height:"100%",flexDirection:"column",borderRight:`1px solid ${e.colors.border.weak}`}),pane2:(0,Zt.css)({flexGrow:1,display:"flex",minHeight:"100%",flexDirection:"column",paddingLeft:e.spacing(2)}),treeWrapper:(0,Zt.css)({paddingRight:e.spacing(2),height:"100%",marginLeft:e.spacing(-1)}),paneHeading:(0,Zt.css)({padding:e.spacing(1,0),fontWeight:e.typography.fontWeightMedium})}}function Uh({page:e,routeProps:t}){const n=function(e){return e.parent instanceof Gh?e.parent:e}(e),r=n.useState(),o=function(){const e=(0,s.useLocation)();return(0,c.locationSearchToObject)(e.search||"")}(),l=e.getScene(t.match),u=(0,a.useContext)(Ph),d=r.initializedScene===l,{layout:p}=e.state;(0,a.useLayoutEffect)((()=>{d||n.initializeScene(l)}),[l,n,d]),(0,a.useEffect)((()=>()=>n.setState({initializedScene:void 0})),[n]);const f=function(e,t={}){const n=(0,s.useLocation)(),[r,o]=(0,a.useState)(!1),i=function(e){return(0,a.useMemo)((()=>new Sp({updateUrlOnInit:e.updateUrlOnInit,createBrowserHistorySteps:e.createBrowserHistorySteps})),[e.updateUrlOnInit,e.createBrowserHistorySteps])}(t);return(0,a.useEffect)((()=>(i.initSync(e),o(!0),()=>i.cleanUp(e))),[e,i]),(0,a.useEffect)((()=>{const e=c.locationService.getLocation(),t=e!==n?e:n;e!==n&&vt("useUrlSync","latestLocation different from location"),i.handleNewLocation(t)}),[e,i,n]),r}(n,null==u?void 0:u.state.urlSyncOptions);if(!d&&!f)return null;const h={text:r.title,img:r.titleImg,icon:r.titleIcon,url:m(r.url,r.preserveUrlKeys),hideFromBreadcrumbs:r.hideFromBreadcrumbs,parentItem:Hh(r.getParentPage?r.getParentPage():n.parent)};r.tabs&&(h.children=r.tabs.map((t=>({text:t.state.title,icon:t.state.titleIcon,tabSuffix:t.state.tabSuffix,active:e===t,url:m(t.state.url,t.state.preserveUrlKeys),parentItem:h}))));let g=[];return r.controls&&(g=r.controls.map((e=>i().createElement(e.Component,{model:e,key:e.state.key})))),o["scene-debugger"]&&g.push(i().createElement(zh,{scene:n,key:"scene-debugger"})),i().createElement(c.PluginPage,{layout:p,pageNav:h,actions:g,renderTitle:r.renderTitle,subTitle:r.subTitle},i().createElement(l.Component,{model:l}))}function Hh(e,t){if(e instanceof Gh)return{text:e.state.title,url:m(e.state.url,e.state.preserveUrlKeys),hideFromBreadcrumbs:e.state.hideFromBreadcrumbs,parentItem:Hh(e.state.getParentPage?e.state.getParentPage():e.parent)}}function $h({drilldown:e,parent:t,routeProps:n}){return b(t.getDrilldownPage(e,n.match),n)}Lh.Component=({model:e})=>{const{component:t,props:n,reactNode:r}=e.useState();return t?i().createElement(t,((e,t)=>{for(var n in t||(t={}))Ah.call(t,n)&&Mh(e,n,t[n]);if(kh)for(var n of kh(t))jh.call(t,n)&&Mh(e,n,t[n]);return e})({},n)):r||null};class Gh extends J{constructor(e){super(e),this._sceneCache=new Map,this._drilldownCache=new Map}initializeScene(e){this.setState({initializedScene:e})}getScene(e){let t=this._sceneCache.get(e.url);if(t)return t;if(!this.state.getScene)throw new Error("Missing getScene on SceneAppPage "+this.state.title);return t=this.state.getScene(e),this._sceneCache.set(e.url,t),t}getDrilldownPage(e,t){let n=this._drilldownCache.get(t.url);return n||(n=e.getPage(t,this),this._drilldownCache.set(t.url,n),n)}enrichDataRequest(e){if(this.state.getParentPage)return this.state.getParentPage().enrichDataRequest(e);if(!this.parent)return null;const t=this.getRoot();return bt(t)?t.enrichDataRequest(e):null}}Gh.Component=function({model:e,routeProps:t}){var n,r;const{tabs:a,drilldowns:o}=e.useState(),l=[];if(a&&a.length>0)for(let t=0;t<a.length;t++){const o=a[t];if(0===t&&l.push(i().createElement(s.Route,{exact:!0,key:e.state.url,path:null!=(n=e.state.routePath)?n:e.state.url,render:e=>b(o,e)})),l.push(i().createElement(s.Route,{exact:!0,key:o.state.url,path:null!=(r=o.state.routePath)?r:o.state.url,render:e=>b(o,e)})),o.state.drilldowns)for(const e of o.state.drilldowns)l.push(i().createElement(s.Route,{exact:!1,key:e.routePath,path:e.routePath,render:t=>i().createElement($h,{drilldown:e,parent:o,routeProps:t})}))}if(o)for(const t of o)l.push(i().createElement(s.Route,{key:t.routePath,exact:!1,path:t.routePath,render:n=>i().createElement($h,{drilldown:t,parent:e,routeProps:n})}));return!a&&(c=e,(u=t.match).isExact&&(u.url===c.state.url||c.parent instanceof Gh&&c.parent.state.tabs[0]===c&&c.parent.state.url===u.url))?i().createElement(Uh,{page:e,routeProps:t}):(l.push(function(e,t){return i().createElement(s.Route,{key:"fallback route",render:n=>{var r,a,o;const s=null!=(o=null==(a=(r=e.state).getFallbackPage)?void 0:a.call(r))?o:new Gh({url:"",title:"Not found",subTitle:"The url did not match any page",getScene:()=>new Dp({body:new oh({direction:"column",children:[new ih({body:new Lh({component:()=>i().createElement("div",{"data-testid":"default-fallback-content"},"If you found your way here using a link then there might be a bug in this application.")})})]})})});return i().createElement(Uh,{page:s,routeProps:t})}})}(e,t)),i().createElement(s.Switch,null,l));var c,u};var qh=(e=>(e.Always="always",e.Auto="auto",e.Never="never",e))(qh||{}),Qh=(e=>(e.Hue="hue",e.None="none",e.Opacity="opacity",e.Scheme="scheme",e))(Qh||{}),Yh=(e=>(e.None="none",e.Normal="normal",e.Percent="percent",e))(Yh||{}),Kh=(e=>(e.Auto="auto",e.Horizontal="horizontal",e.Vertical="vertical",e))(Kh||{}),Xh=(e=>(e.Background="background",e.BackgroundSolid="background_solid",e.None="none",e.Value="value",e))(Xh||{}),Zh=(e=>(e.Area="area",e.Line="line",e.None="none",e))(Zh||{}),Jh=(e=>(e.Auto="auto",e.Center="center",e))(Jh||{}),eg=(e=>(e.Auto="auto",e.Name="name",e.None="none",e.Value="value",e.ValueAndName="value_and_name",e))(eg||{}),tg=(e=>(e.Inverted="inverted",e.SameAsValue="same_as_value",e.Standard="standard",e))(tg||{}),ng=(e=>(e.Multi="multi",e.None="none",e.Single="single",e))(ng||{}),rg=(e=>(e.Basic="basic",e.Gradient="gradient",e.Lcd="lcd",e))(rg||{}),ag=(e=>(e.Color="color",e.Hidden="hidden",e.Text="text",e))(ag||{}),og=(e=>(e.Auto="auto",e.Hidden="hidden",e.Left="left",e.Top="top",e))(og||{}),ig=(e=>(e.Auto="auto",e.Manual="manual",e))(ig||{}),sg=(e=>(e.Auto="auto",e.Lg="lg",e.Md="md",e.Sm="sm",e))(sg||{});const lg={barRadius:0,barWidth:.97,fullHighlight:!1,groupWidth:.7,orientation:Kh.Auto,showValue:qh.Auto,stacking:Yh.None,xTickLabelRotation:0,xTickLabelSpacing:0},cg={fillOpacity:80,gradientMode:Qh.None,lineWidth:1},ug={displayMode:rg.Gradient,maxVizHeight:300,minVizHeight:16,minVizWidth:8,namePlacement:og.Auto,showUnfilled:!0,sizing:ig.Auto,valueMode:ag.Color},dg={selectedSeries:0},pg={minVizHeight:75,minVizWidth:75,showThresholdLabels:!1,showThresholdMarkers:!0,sizing:ig.Auto},fg={layers:[]},hg={calculate:!1,cellGap:1,cellValues:{},color:{scheme:"Oranges",fill:"dark-orange",reverse:!1,exponent:.5,steps:64},exemplars:{color:"rgba(255,0,255,0.7)"},filterValues:{le:1e-9},legend:{show:!0},selectionMode:"x",showValue:qh.Auto,tooltip:{mode:ng.Single,yHistogram:!1,showColorScale:!1}},gg={bucketCount:30,bucketOffset:0},mg={fillOpacity:80,gradientMode:Qh.None,lineWidth:1},bg={showImage:!0},yg={displayLabels:[]},vg={colorMode:Xh.Value,graphMode:Zh.Area,justifyMode:Jh.Auto,percentChangeColorMode:tg.Standard,showPercentChange:!1,textMode:eg.Auto,wideLayout:!0},wg={alignValue:"left",mergeValues:!0,perPage:20,rowHeight:.9,showValue:qh.Auto},xg={fillOpacity:70,lineWidth:0},Sg={colWidth:.9,rowHeight:.9,showValue:qh.Auto},Og={fillOpacity:70,lineWidth:1},Dg={cellHeight:sg.Sm,footer:{show:!1,countRows:!1,reducer:[]},frameIndex:0,showHeader:!0,showTypeIcons:!1,sortBy:[]},Cg={content:"# Title\n\nFor markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)",mode:"markdown"},Eg={label:qh.Auto,show:"points"},_g={series:[]};class Pg{constructor(){this._overrides=[]}overrideColor(e){return this._overrides[this._overrides.length-1].properties.push({id:"color",value:e}),this}overrideDecimals(e){return this._overrides[this._overrides.length-1].properties.push({id:"decimals",value:e}),this}overrideDisplayName(e){return this._overrides[this._overrides.length-1].properties.push({id:"displayName",value:e}),this}overrideFilterable(e){return this._overrides[this._overrides.length-1].properties.push({id:"filterable",value:e}),this}overrideLinks(e){return this._overrides[this._overrides.length-1].properties.push({id:"links",value:e}),this}overrideMappings(e){return this._overrides[this._overrides.length-1].properties.push({id:"mappings",value:e}),this}overrideMax(e){return this._overrides[this._overrides.length-1].properties.push({id:"max",value:e}),this}overrideMin(e){return this._overrides[this._overrides.length-1].properties.push({id:"min",value:e}),this}overrideNoValue(e){return this._overrides[this._overrides.length-1].properties.push({id:"noValue",value:e}),this}overrideThresholds(e){return this._overrides[this._overrides.length-1].properties.push({id:"thresholds",value:e}),this}overrideUnit(e){return this._overrides[this._overrides.length-1].properties.push({id:"unit",value:e}),this}}class Rg extends Pg{match(e){return this._overrides.push({matcher:e,properties:[]}),this}matchFieldsWithName(e){return this._overrides.push({matcher:{id:l.FieldMatcherID.byName,options:e},properties:[]}),this}matchFieldsWithNameByRegex(e){return this._overrides.push({matcher:{id:l.FieldMatcherID.byRegexp,options:e},properties:[]}),this}matchFieldsByType(e){return this._overrides.push({matcher:{id:l.FieldMatcherID.byType,options:e},properties:[]}),this}matchFieldsByQuery(e){return this._overrides.push({matcher:{id:l.FieldMatcherID.byFrameRefID,options:e},properties:[]}),this}matchFieldsByValue(e){return this._overrides.push({matcher:{id:l.FieldMatcherID.byValue,options:e},properties:[]}),this}matchComparisonQuery(e){return this.matchFieldsByQuery(Ff(e))}overrideCustomFieldConfig(e,t){const n=`custom.${String(e)}`;return this._overrides[this._overrides.length-1].properties.push({id:n,value:t}),this}build(){return this._overrides}}var Ig=Object.defineProperty,Tg=Object.defineProperties,kg=Object.getOwnPropertyDescriptors,Ag=Object.getOwnPropertySymbols,jg=Object.prototype.hasOwnProperty,Mg=Object.prototype.propertyIsEnumerable,Lg=(e,t,n)=>t in e?Ig(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ng=(e,t)=>{for(var n in t||(t={}))jg.call(t,n)&&Lg(e,n,t[n]);if(Ag)for(var n of Ag(t))Mg.call(t,n)&&Lg(e,n,t[n]);return e},Bg=(e,t)=>Tg(e,kg(t));class Vg{constructor(e){this.defaultFieldConfig=e,this._fieldConfig={defaults:{},overrides:[]},this._overridesBuilder=new Rg,this.setDefaults()}setDefaults(){const e={defaults:{custom:this.defaultFieldConfig?(0,pe.cloneDeep)(this.defaultFieldConfig()):{}},overrides:[]};this._fieldConfig=e}setColor(e){return this.setFieldConfigDefaults("color",e)}setDecimals(e){return this.setFieldConfigDefaults("decimals",e)}setDisplayName(e){return this.setFieldConfigDefaults("displayName",e)}setFilterable(e){return this.setFieldConfigDefaults("filterable",e)}setLinks(e){return this.setFieldConfigDefaults("links",e)}setMappings(e){return this.setFieldConfigDefaults("mappings",e)}setMax(e){return this.setFieldConfigDefaults("max",e)}setMin(e){return this.setFieldConfigDefaults("min",e)}setNoValue(e){return this.setFieldConfigDefaults("noValue",e)}setThresholds(e){return this.setFieldConfigDefaults("thresholds",e)}setUnit(e){return this.setFieldConfigDefaults("unit",e)}setCustomFieldConfig(e,t){return this._fieldConfig.defaults=Bg(Ng({},this._fieldConfig.defaults),{custom:(0,pe.merge)(this._fieldConfig.defaults.custom,{[e]:t})}),this}setOverrides(e){return e(this._overridesBuilder),this}setFieldConfigDefaults(e,t){return this._fieldConfig.defaults=Bg(Ng({},this._fieldConfig.defaults),{[e]:t}),this}build(){return{defaults:this._fieldConfig.defaults,overrides:this._overridesBuilder.build()}}}class Fg{constructor(e){this.defaultOptions=e,this._options={},this.setDefaults()}setDefaults(){this._options=this.defaultOptions?(0,pe.cloneDeep)(this.defaultOptions()):{}}setOption(e,t){return this._options=(0,pe.merge)(this._options,{[e]:t}),this}build(){return this._options}}var zg=Object.defineProperty,Wg=Object.defineProperties,Ug=Object.getOwnPropertyDescriptors,Hg=Object.getOwnPropertySymbols,$g=Object.prototype.hasOwnProperty,Gg=Object.prototype.propertyIsEnumerable,qg=(e,t,n)=>t in e?zg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class Qg{constructor(e,t,n,r){this._state={},this._state.title="",this._state.description="",this._state.displayMode="default",this._state.hoverHeader=!1,this._state.pluginId=e,this._state.pluginVersion=t,this._fieldConfigBuilder=new Vg(r),this._panelOptionsBuilder=new Fg(n)}setTitle(e){return this._state.title=e,this}setDescription(e){return this._state.description=e,this}setDisplayMode(e){return this._state.displayMode=e,this}setHoverHeader(e){return this._state.hoverHeader=e,this}setMenu(e){return this._state.menu=e,this}setHeaderActions(e){return this._state.headerActions=e,this}setColor(e){return this._fieldConfigBuilder.setColor(e),this}setDecimals(e){return this._fieldConfigBuilder.setDecimals(e),this}setDisplayName(e){return this._fieldConfigBuilder.setDisplayName(e),this}setFilterable(e){return this._fieldConfigBuilder.setFilterable(e),this}setLinks(e){return this._fieldConfigBuilder.setLinks(e),this}setMappings(e){return this._fieldConfigBuilder.setMappings(e),this}setMax(e){return this._fieldConfigBuilder.setMax(e),this}setMin(e){return this._fieldConfigBuilder.setMin(e),this}setNoValue(e){return this._fieldConfigBuilder.setNoValue(e),this}setThresholds(e){return this._fieldConfigBuilder.setThresholds(e),this}setUnit(e){return this._fieldConfigBuilder.setUnit(e),this}setCustomFieldConfig(e,t){return this._fieldConfigBuilder.setCustomFieldConfig(e,t),this}setOverrides(e){return this._fieldConfigBuilder.setOverrides(e),this}setOption(e,t){return this._panelOptionsBuilder.setOption(e,t),this}setData(e){return this._state.$data=e,this}setTimeRange(e){return this._state.$timeRange=e,this}setVariables(e){return this._state.$variables=e,this}setBehaviors(e){return this._state.$behaviors=e,this}build(){const e=new _c((t=((e,t)=>{for(var n in t||(t={}))$g.call(t,n)&&qg(e,n,t[n]);if(Hg)for(var n of Hg(t))Gg.call(t,n)&&qg(e,n,t[n]);return e})({},this._state),n={options:this._panelOptionsBuilder.build(),fieldConfig:this._fieldConfigBuilder.build()},Wg(t,Ug(n))));var t,n;return e}}const Yg={barchart:()=>new Qg("barchart","10.0.0",(()=>lg),(()=>cg)),bargauge:()=>new Qg("bargauge","10.0.0",(()=>ug)),datagrid:()=>new Qg("datagrid","10.0.0",(()=>dg)),flamegraph:()=>new Qg("flamegraph","10.0.0"),gauge:()=>new Qg("gauge","10.0.0",(()=>pg)),geomap:()=>new Qg("geomap","10.0.0",(()=>fg)),heatmap:()=>new Qg("heatmap","10.0.0",(()=>hg)),histogram:()=>new Qg("histogram","10.0.0",(()=>gg),(()=>mg)),logs:()=>new Qg("logs","10.0.0"),news:()=>new Qg("news","10.0.0",(()=>bg)),nodegraph:()=>new Qg("nodeGraph","10.0.0"),piechart:()=>new Qg("piechart","10.0.0",(()=>yg)),stat:()=>new Qg("stat","10.0.0",(()=>vg)),statetimeline:()=>new Qg("state-timeline","10.0.0",(()=>wg),(()=>xg)),statushistory:()=>new Qg("status-history","10.0.0",(()=>Sg),(()=>Og)),table:()=>new Qg("table","10.0.0",(()=>Dg)),text:()=>new Qg("text","10.0.0",(()=>Cg)),timeseries:()=>new Qg("timeseries","10.0.0"),trend:()=>new Qg("trend","10.0.0"),traces:()=>new Qg("traces","10.0.0"),xychart:()=>new Qg("xychart","10.0.0",(()=>_g),(()=>Eg))},Kg={barchart:()=>new Vg((()=>cg)),bargauge:()=>new Vg,datagrid:()=>new Vg,flamegraph:()=>new Vg,gauge:()=>new Vg,geomap:()=>new Vg,heatmap:()=>new Vg,histogram:()=>new Vg((()=>mg)),logs:()=>new Vg,news:()=>new Vg,nodegraph:()=>new Vg,piechart:()=>new Vg,stat:()=>new Vg,statetimeline:()=>new Vg((()=>xg)),statushistory:()=>new Vg((()=>Og)),table:()=>new Vg,text:()=>new Vg,timeseries:()=>new Vg,trend:()=>new Vg,traces:()=>new Vg,xychart:()=>new Vg((()=>Eg))},Xg={getUrlWithAppState:m,registerRuntimePanelPlugin:function({pluginId:e,plugin:t}){if(C.has(e))throw new Error(`A runtime panel plugin with id ${e} has already been registered`);var n;t.meta=(n=((e,t)=>{for(var n in t||(t={}))S.call(t,n)&&D(e,n,t[n]);if(x)for(var n of x(t))O.call(t,n)&&D(e,n,t[n]);return e})({},t.meta),v(n,w({id:e,name:e,module:"runtime plugin",baseUrl:"runtime plugin",info:{author:{name:"Runtime plugin "+e},description:"",links:[],logos:{large:"",small:""},screenshots:[],updated:"",version:""}}))),C.set(e,t)},registerRuntimeDataSource:function({dataSource:e}){if(de.has(e.uid))throw new Error(`A runtime data source with uid ${e.uid} has already been registered`);de.set(e.uid,e)},registerVariableMacro:function(e,t){if(ht.get(e))throw new Error(`Macro already registered ${e}`);return ht.set(e,t),()=>{ht.delete(e)}},cloneSceneObjectState:le,syncStateFromSearchParams:function(e,t){Dl(e,t,new xl)},getUrlState:Ol,renderPrometheusLabelFilters:As,isAdHocVariable:function(e){return"adhoc"===e.state.type},isConstantVariable:function(e){return"constant"===e.state.type},isCustomVariable:function(e){return"custom"===e.state.type},isDataSourceVariable:function(e){return"datasource"===e.state.type},isIntervalVariable:function(e){return"interval"===e.state.type},isQueryVariable:function(e){return"query"===e.state.type},isTextBoxVariable:function(e){return"textbox"===e.state.type},isGroupByVariable:function(e){return"groupby"===e.state.type}}},3321:(e,t,n)=>{"use strict";n.d(t,{$m:()=>o,ob:()=>r,qM:()=>a});var r=(e=>(e.Auto="auto",e.BasicGauge="basic",e.ColorBackground="color-background",e.ColorBackgroundSolid="color-background-solid",e.ColorText="color-text",e.Custom="custom",e.DataLinks="data-links",e.Gauge="gauge",e.GradientGauge="gradient-gauge",e.Image="image",e.JSONView="json-view",e.LcdGauge="lcd-gauge",e.Sparkline="sparkline",e))(r||{}),a=(e=>(e.Auto="auto",e.Lg="lg",e.Md="md",e.Sm="sm",e))(a||{}),o=(e=>(e.CSV="csv",e.Date="date",e.Distributed="distributed",e.DoubleQuote="doublequote",e.Glob="glob",e.HTML="html",e.JSON="json",e.Lucene="lucene",e.PercentEncode="percentencode",e.Pipe="pipe",e.QueryParam="queryparam",e.Raw="raw",e.Regex="regex",e.SQLString="sqlstring",e.SingleQuote="singlequote",e.Text="text",e.UriEncode="uriencode",e))(o||{})},3633:(e,t,n)=>{"use strict";n.d(t,{CO:()=>a,rw:()=>r,yV:()=>o});const r={includeAll:!1,multi:!1,options:[],skipUrlSync:!1};var a=(e=>(e[e.never=0]="never",e[e.onDashboardLoad=1]="onDashboardLoad",e[e.onTimeRangeChanged=2]="onTimeRangeChanged",e))(a||{}),o=(e=>(e[e.Crosshair=1]="Crosshair",e[e.Off=0]="Off",e[e.Tooltip=2]="Tooltip",e))(o||{})},5435:(e,t,n)=>{"use strict";n.d(t,{zL:()=>a});var r=n(3633),a=(e=>(e[e.dontHide=0]="dontHide",e[e.hideLabel=1]="hideLabel",e[e.hideVariable=2]="hideVariable",e))(a||{});r.rw},5786:(e,t,n)=>{"use strict";n.d(t,{$j:()=>i}),n(2540),n(8486);var r=n(5959),a=n(7781);let o=null;function i(){return(0,r.useContext)(o||a.ThemeContext)}},5206:(e,t,n)=>{"use strict";n.d(t,{JY:()=>mr,sx:()=>kr,gL:()=>Jr});var r=n(5959),a=n.n(r),o=n(8398),i=n.n(o),s=n(7694),l=n(200);function c(e,t){var n=(0,r.useState)((function(){return{inputs:t,result:e()}}))[0],a=(0,r.useRef)(!0),o=(0,r.useRef)(n),i=a.current||Boolean(t&&o.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,o.current.inputs))?o.current:{inputs:t,result:e()};return(0,r.useEffect)((function(){a.current=!1,o.current=i}),[i]),i.result}var u=c,d=function(e,t){return c((function(){return e}),t)},p=function(e){var t=e.top,n=e.right,r=e.bottom,a=e.left;return{top:t,right:n,bottom:r,left:a,width:n-a,height:r-t,x:a,y:t,center:{x:(n+a)/2,y:(r+t)/2}}},f=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},h=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},g={top:0,right:0,bottom:0,left:0},m=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?g:n,a=e.border,o=void 0===a?g:a,i=e.padding,s=void 0===i?g:i,l=p(f(t,r)),c=p(h(t,o)),u=p(h(c,s));return{marginBox:l,borderBox:p(t),paddingBox:c,contentBox:u,margin:r,border:o,padding:s}},b=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&function(e,t){throw new Error("Invariant failed")}(),n},y=function(e,t){var n,r,a=e.borderBox,o=e.border,i=e.margin,s=e.padding,l=(r=t,{top:(n=a).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return m({borderBox:l,border:o,margin:i,padding:s})},v=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),y(e,t)},w=function(e,t){var n={top:b(t.marginTop),right:b(t.marginRight),bottom:b(t.marginBottom),left:b(t.marginLeft)},r={top:b(t.paddingTop),right:b(t.paddingRight),bottom:b(t.paddingBottom),left:b(t.paddingLeft)},a={top:b(t.borderTopWidth),right:b(t.borderRightWidth),bottom:b(t.borderBottomWidth),left:b(t.borderLeftWidth)};return m({borderBox:e,margin:n,padding:r,border:a})},x=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return w(t,n)},S=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function O(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!((r=e[n])===(a=t[n])||S(r)&&S(a)))return!1;var r,a;return!0}function D(e,t){void 0===t&&(t=O);var n=null;function r(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var o=e.apply(this,r);return n={lastResult:o,lastArgs:r,lastThis:this},o}return r.clear=function(){n=null},r}const C=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];t=a,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E.apply(null,arguments)}function _(e,t){}function P(){}function R(e,t,n){const r=t.map((t=>{const r=(a=n,o=t.options,{...a,...o});var a,o;return e.addEventListener(t.eventName,t.fn,r),function(){e.removeEventListener(t.eventName,t.fn,r)}}));return function(){r.forEach((e=>{e()}))}}_.bind(null,"warn"),_.bind(null,"error");const I=!0,T="Invariant failed";class k extends Error{}function A(e,t){if(!e)throw new k(I?T:`${T}: ${t||""}`)}k.prototype.toString=function(){return this.message};class j extends a().Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=P,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&t.tryAbort(),e.error instanceof k&&e.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=e=>{this.callbacks=e}}componentDidMount(){this.unbind=R(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(!(e instanceof k))throw e;this.setState({})}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const M=e=>e+1,L=(e,t)=>{const n=e.droppableId===t.droppableId,r=M(e.index),a=M(t.index);return n?`\n You have moved the item from position ${r}\n to position ${a}\n `:`\n You have moved the item from position ${r}\n in list ${e.droppableId}\n to list ${t.droppableId}\n in position ${a}\n `},N=(e,t,n)=>t.droppableId===n.droppableId?`\n The item ${e}\n has been combined with ${n.draggableId}`:`\n The item ${e}\n in list ${t.droppableId}\n has been combined with ${n.draggableId}\n in list ${n.droppableId}\n `,B=e=>`\n The item has returned to its starting position\n of ${M(e.index)}\n`,V={dragHandleUsageInstructions:"\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n",onDragStart:e=>`\n You have lifted an item in position ${M(e.source.index)}\n`,onDragUpdate:e=>{const t=e.destination;if(t)return L(e.source,t);const n=e.combine;return n?N(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},onDragEnd:e=>{if("CANCEL"===e.reason)return`\n Movement cancelled.\n ${B(e.source)}\n `;const t=e.destination,n=e.combine;return t?`\n You have dropped the item.\n ${L(e.source,t)}\n `:n?`\n You have dropped the item.\n ${N(e.draggableId,e.source,n)}\n `:`\n The item has been dropped while not over a drop area.\n ${B(e.source)}\n `}};var F=V;const z={x:0,y:0},W=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),U=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),H=(e,t)=>e.x===t.x&&e.y===t.y,$=e=>({x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}),G=(e,t,n=0)=>"x"===e?{x:t,y:n}:{x:n,y:t},q=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),Q=(e,t)=>Math.min(...t.map((t=>q(e,t)))),Y=e=>t=>({x:e(t.x),y:e(t.y)}),K=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),X=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],Z=(e,t)=>t&&t.shouldClipSubject?((e,t)=>{const n=p({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n})(t.pageMarginBox,e):p(e);var J=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const a=((e,t)=>t?K(e,t.scroll.diff.displacement):e)(e.marginBox,r),o=((e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e)(a,n,t);return{page:e,withPlaceholder:t,active:Z(o,r)}},ee=(e,t)=>{e.frame||A(!1);const n=e.frame,r=U(t,n.scroll.initial),a=$(r),o={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:a},max:n.scroll.max}},i=J({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return{...e,frame:o,subject:i}};const te=D((e=>e.reduce(((e,t)=>(e[t.descriptor.id]=t,e)),{}))),ne=D((e=>e.reduce(((e,t)=>(e[t.descriptor.id]=t,e)),{}))),re=D((e=>Object.values(e))),ae=D((e=>Object.values(e)));var oe=D(((e,t)=>{const n=ae(t).filter((t=>e===t.descriptor.droppableId)).sort(((e,t)=>e.descriptor.index-t.descriptor.index));return n}));function ie(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function se(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var le=D(((e,t)=>t.filter((t=>t.descriptor.id!==e.descriptor.id)))),ce=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const ue={point:z,value:0},de={invisible:{},visible:{},all:[]};var pe={displaced:de,displacedBy:ue,at:null},fe=(e,t)=>n=>e<=n&&n<=t,he=e=>{const t=fe(e.top,e.bottom),n=fe(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const a=t(r.top)||t(r.bottom),o=n(r.left)||n(r.right);if(a&&o)return!0;const i=r.top<e.top&&r.bottom>e.bottom,s=r.left<e.left&&r.right>e.right;return!(!i||!s)||(i&&o||s&&a)}},ge=e=>{const t=fe(e.top,e.bottom),n=fe(e.left,e.right);return e=>t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)};const me={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},be={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},ye=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:a})=>{const o=r?((e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:z;return K(e,n)})(e,t):e;return((e,t,n)=>!!t.subject.active&&n(t.subject.active)(e))(o,t,a)&&((e,t,n)=>n(t)(e))(o,n,a)},ve=e=>ye({...e,isVisibleThroughFrameFn:he}),we=e=>ye({...e,isVisibleThroughFrameFn:ge}),xe=(e,t,n)=>{if("boolean"==typeof n)return n;if(!t)return!0;const{invisible:r,visible:a}=t;if(r[e])return!1;const o=a[e];return!o||o.shouldAnimate};function Se({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:a,last:o}){return e.reduce((function(e,i){const s=function(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return p(f(n,r))}(i,n),l=i.descriptor.id;if(e.all.push(l),!ve({target:s,destination:t,viewport:r,withDroppableDisplacement:!0}))return e.invisible[i.descriptor.id]=!0,e;const c={draggableId:l,shouldAnimate:xe(l,o,a)};return e.visible[l]=c,e}),{all:[],visible:{},invisible:{}})}function Oe({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const a=function(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(e,{inHomeList:t});return{displaced:de,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:a}}}}function De({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:a,last:o,index:i,forceShouldAnimate:s}){const l=ce(e,n);if(null==i)return Oe({insideDestination:t,inHomeList:l,displacedBy:a,destination:n});const c=t.find((e=>e.descriptor.index===i));if(!c)return Oe({insideDestination:t,inHomeList:l,displacedBy:a,destination:n});const u=le(e,t),d=t.indexOf(c);return{displaced:Se({afterDragging:u.slice(d),destination:n,displacedBy:a,last:o,viewport:r.frame,forceShouldAnimate:s}),displacedBy:a,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:i}}}}function Ce(e,t){return Boolean(t.effected[e])}const Ee=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,_e=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,Pe=({axis:e,moveRelativeTo:t,isMoving:n})=>G(e.line,t.marginBox[e.end]+Ee(e,n),_e(e,t.marginBox,n)),Re=({axis:e,moveRelativeTo:t,isMoving:n})=>G(e.line,t.marginBox[e.start]-((e,t)=>t.margin[e.end]+t.borderBox[e.size]/2)(e,n),_e(e,t.marginBox,n));var Ie=(e,t)=>{const n=e.frame;return n?W(t,n.scroll.diff.displacement):t},Te=e=>{const t=(({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:a})=>{const o=t.page.borderBox.center,i=e.at;return n&&i?"REORDER"===i.type?(({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:a})=>{const o=oe(r.descriptor.id,n),i=t.page,s=r.axis;if(!o.length)return(({axis:e,moveInto:t,isMoving:n})=>G(e.line,t.contentBox[e.start]+Ee(e,n),_e(e,t.contentBox,n)))({axis:s,moveInto:r.page,isMoving:i});const{displaced:l,displacedBy:c}=e,u=l.all[0];if(u){const e=n[u];if(Ce(u,a))return Re({axis:s,moveRelativeTo:e.page,isMoving:i});const t=y(e.page,c.point);return Re({axis:s,moveRelativeTo:t,isMoving:i})}const d=o[o.length-1];if(d.descriptor.id===t.descriptor.id)return i.borderBox.center;if(Ce(d.descriptor.id,a)){const e=y(d.page,$(a.displacedBy.point));return Pe({axis:s,moveRelativeTo:e,isMoving:i})}return Pe({axis:s,moveRelativeTo:d.page,isMoving:i})})({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:a}):(({afterCritical:e,impact:t,draggables:n})=>{const r=se(t);r||A(!1);const a=r.draggableId,o=n[a].page.borderBox.center,i=(({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const a=Boolean(e.visible[n]||e.invisible[n]);return Ce(n,t)?a?z:$(r.point):a?r.point:z})({displaced:t.displaced,afterCritical:e,combineWith:a,displacedBy:t.displacedBy});return W(o,i)})({impact:e,draggables:r,afterCritical:a}):o})(e),n=e.droppable;return n?Ie(n,t):t},ke=(e,t)=>{const n=U(t,e.scroll.initial),r=$(n);return{frame:p({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function Ae(e,t){return e.map((e=>t[e]))}var je=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=((e,t)=>W(e.scroll.diff.displacement,t))(n,e),a=U(r,t.page.borderBox.center);return W(t.client.borderBox.center,a)},Me=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:a,onlyOnMainAxis:o=!1})=>{const i=U(n,e.page.borderBox.center),s={target:K(e.page.borderBox,i),destination:t,withDroppableDisplacement:a,viewport:r};return o?(e=>{return ye({...e,isVisibleThroughFrameFn:(t=e.destination.axis,e=>{const n=fe(e.top,e.bottom),r=fe(e.left,e.right);return e=>t===me?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)})});var t})(s):we(s)},Le=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:a,viewport:o,previousPageBorderBoxCenter:i,previousClientSelection:s,afterCritical:l})=>{if(!n.isEnabled)return null;const c=oe(n.descriptor.id,r),u=ce(t,n),d=(({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:a})=>{if(!n.isCombineEnabled)return null;if(!ie(a))return null;function o(e){const t={type:"COMBINE",combine:{draggableId:e,droppableId:n.descriptor.id}};return{...a,at:t}}const i=a.displaced.all,s=i.length?i[0]:null;if(e)return s?o(s):null;const l=le(t,r);if(!s)return l.length?o(l[l.length-1].descriptor.id):null;const c=l.findIndex((e=>e.descriptor.id===s));-1===c&&A(!1);const u=c-1;return u<0?null:o(l[u].descriptor.id)})({isMovingForward:e,draggable:t,destination:n,insideDestination:c,previousImpact:a})||(({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:a,insideDestination:o,previousImpact:i,viewport:s,afterCritical:l})=>{const c=i.at;if(c||A(!1),"REORDER"===c.type){const r=(({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const a=r.index,o=e?a+1:a-1,i=n[0].descriptor.index,s=n[n.length-1].descriptor.index;return o<i||o>(t?s:s+1)?null:o})({isMovingForward:e,isInHomeList:t,location:c.destination,insideDestination:o});return null==r?null:De({draggable:n,insideDestination:o,destination:a,viewport:s,last:i.displaced,displacedBy:i.displacedBy,index:r})}const u=(({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:a})=>{if(!t.isCombineEnabled)return null;const o=r.draggableId,i=n[o].descriptor.index;return Ce(o,a)?e?i:i-1:e?i+1:i})({isMovingForward:e,destination:a,displaced:i.displaced,draggables:r,combine:c.combine,afterCritical:l});return null==u?null:De({draggable:n,insideDestination:o,destination:a,viewport:s,last:i.displaced,displacedBy:i.displacedBy,index:u})})({isMovingForward:e,isInHomeList:u,draggable:t,draggables:r,destination:n,insideDestination:c,previousImpact:a,viewport:o,afterCritical:l});if(!d)return null;const p=Te({impact:d,draggable:t,droppable:n,draggables:r,afterCritical:l});if(Me({draggable:t,destination:n,newPageBorderBoxCenter:p,viewport:o.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:je({pageBorderBoxCenter:p,draggable:t,viewport:o}),impact:d,scrollJumpRequest:null};const f=U(p,i),h=(({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:a})=>{const o=ke(t,W(t.scroll.current,a)),i=n.frame?ee(n,W(n.frame.scroll.current,a)):n,s=e.displaced,l=Se({afterDragging:Ae(s.all,r),destination:n,displacedBy:e.displacedBy,viewport:o.frame,last:s,forceShouldAnimate:!1}),c=Se({afterDragging:Ae(s.all,r),destination:i,displacedBy:e.displacedBy,viewport:t.frame,last:s,forceShouldAnimate:!1}),u={},d={},p=[s,l,c];return s.all.forEach((e=>{const t=function(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}(e,p);t?d[e]=t:u[e]=!0})),{...e,displaced:{all:s.all,invisible:u,visible:d}}})({impact:d,viewport:o,destination:n,draggables:r,maxScrollChange:f});return{clientSelection:s,impact:h,scrollJumpRequest:f}};const Ne=e=>{const t=e.subject.active;return t||A(!1),t},Be=(e,t)=>{const n=e.page.borderBox.center;return Ce(e.descriptor.id,t)?U(n,t.displacedBy.point):n},Ve=(e,t)=>{const n=e.page.borderBox;return Ce(e.descriptor.id,t)?K(n,$(t.displacedBy.point)):n};var Fe=D((function(e,t){const n=t[e.line];return{value:n,point:G(e.line,n)}}));const ze=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),We=(e,t,n)=>{const r=e.frame;ce(t,e)&&A(!1),e.subject.withPlaceholder&&A(!1);const a=Fe(e.axis,t.displaceBy).point,o=((e,t,n)=>{const r=e.axis;if("virtual"===e.descriptor.mode)return G(r.line,t[r.line]);const a=e.subject.page.contentBox[r.size],o=oe(e.descriptor.id,n).reduce(((e,t)=>e+t.client.marginBox[r.size]),0)+t[r.line]-a;return o<=0?null:G(r.line,o)})(e,a,n),i={placeholderSize:a,increasedBy:o,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const t=J({page:e.subject.page,withPlaceholder:i,axis:e.axis,frame:e.frame});return{...e,subject:t}}const s=o?W(r.scroll.max,o):r.scroll.max,l=ze(r,s),c=J({page:e.subject.page,withPlaceholder:i,axis:e.axis,frame:l});return{...e,subject:c,frame:l}};var Ue=e=>{const t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},He=({state:e,type:t})=>{const n=((e,t)=>{const n=Ue(e);return n?t[n]:null})(e.impact,e.dimensions.droppables),r=Boolean(n),a=e.dimensions.droppables[e.critical.droppable.id],o=n||a,i=o.axis.direction,s="vertical"===i&&("MOVE_UP"===t||"MOVE_DOWN"===t)||"horizontal"===i&&("MOVE_LEFT"===t||"MOVE_RIGHT"===t);if(s&&!r)return null;const l="MOVE_DOWN"===t||"MOVE_RIGHT"===t,c=e.dimensions.draggables[e.critical.draggable.id],u=e.current.page.borderBoxCenter,{draggables:d,droppables:p}=e.dimensions;return s?Le({isMovingForward:l,previousPageBorderBoxCenter:u,draggable:c,destination:o,draggables:d,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):(({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:a,droppables:o,viewport:i,afterCritical:s})=>{const l=(({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:a})=>{const o=n.subject.active;if(!o)return null;const i=n.axis,s=fe(o[i.start],o[i.end]),l=re(r).filter((e=>e!==n)).filter((e=>e.isEnabled)).filter((e=>Boolean(e.subject.active))).filter((e=>he(a.frame)(Ne(e)))).filter((t=>{const n=Ne(t);return e?o[i.crossAxisEnd]<n[i.crossAxisEnd]:n[i.crossAxisStart]<o[i.crossAxisStart]})).filter((e=>{const t=Ne(e),n=fe(t[i.start],t[i.end]);return s(t[i.start])||s(t[i.end])||n(o[i.start])||n(o[i.end])})).sort(((t,n)=>{const r=Ne(t)[i.crossAxisStart],a=Ne(n)[i.crossAxisStart];return e?r-a:a-r})).filter(((e,t,n)=>Ne(e)[i.crossAxisStart]===Ne(n[0])[i.crossAxisStart]));if(!l.length)return null;if(1===l.length)return l[0];const c=l.filter((e=>fe(Ne(e)[i.start],Ne(e)[i.end])(t[i.line])));return 1===c.length?c[0]:c.length>1?c.sort(((e,t)=>Ne(e)[i.start]-Ne(t)[i.start]))[0]:l.sort(((e,n)=>{const r=Q(t,X(Ne(e))),a=Q(t,X(Ne(n)));return r!==a?r-a:Ne(e)[i.start]-Ne(n)[i.start]}))[0]})({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:o,viewport:i});if(!l)return null;const c=oe(l.descriptor.id,a),u=(({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:a})=>{const o=r.filter((e=>we({target:Ve(e,a),destination:n,viewport:t.frame,withDroppableDisplacement:!0}))).sort(((t,r)=>{const o=q(e,Ie(n,Be(t,a))),i=q(e,Ie(n,Be(r,a)));return o<i?-1:i<o?1:t.descriptor.index-r.descriptor.index}));return o[0]||null})({pageBorderBoxCenter:t,viewport:i,destination:l,insideDestination:c,afterCritical:s}),d=(({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:a,destination:o,viewport:i,afterCritical:s})=>{if(!t){if(n.length)return null;const e={displaced:de,displacedBy:ue,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:0}}},t=Te({impact:e,draggable:r,droppable:o,draggables:a,afterCritical:s}),l=ce(r,o)?o:We(o,r,a);return Me({draggable:r,destination:l,newPageBorderBoxCenter:t,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?e:null}const l=Boolean(e[o.axis.line]<=t.page.borderBox.center[o.axis.line]),c=(()=>{const e=t.descriptor.index;return t.descriptor.id===r.descriptor.id||l?e:e+1})(),u=Fe(o.axis,r.displaceBy);return De({draggable:r,insideDestination:n,destination:o,viewport:i,displacedBy:u,last:de,index:c})})({previousPageBorderBoxCenter:t,destination:l,draggable:n,draggables:a,moveRelativeTo:u,insideDestination:c,viewport:i,afterCritical:s});if(!d)return null;const p=Te({impact:d,draggable:n,droppable:l,draggables:a,afterCritical:s});return{clientSelection:je({pageBorderBoxCenter:p,draggable:n,viewport:i}),impact:d,scrollJumpRequest:null}})({isMovingForward:l,previousPageBorderBoxCenter:u,draggable:c,isOver:o,draggables:d,droppables:p,viewport:e.viewport,afterCritical:e.afterCritical})};function $e(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function Ge(e){const t=fe(e.top,e.bottom),n=fe(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}const qe=(e,t)=>p(K(e,t));function Qe({displaced:e,id:t}){return Boolean(e.visible[t]||e.invisible[t])}var Ye=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:a,viewport:o,afterCritical:i})=>{const s=qe(t.page.borderBox,e),l=function({pageBorderBox:e,draggable:t,droppables:n}){const r=re(n).filter((t=>{if(!t.isEnabled)return!1;const n=t.subject.active;if(!n)return!1;if(a=n,!((r=e).left<a.right&&r.right>a.left&&r.top<a.bottom&&r.bottom>a.top))return!1;var r,a;if(Ge(n)(e.center))return!0;const o=t.axis,i=n.center[o.crossAxisLine],s=e[o.crossAxisStart],l=e[o.crossAxisEnd],c=fe(n[o.crossAxisStart],n[o.crossAxisEnd]),u=c(s),d=c(l);return!u&&!d||(u?s<i:l>i)}));return r.length?1===r.length?r[0].descriptor.id:function({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,a=n.map((t=>{const n=t.axis,a=G(t.axis.line,e.center[n.line],t.page.borderBox.center[n.crossAxisLine]);return{id:t.descriptor.id,distance:q(r,a)}})).sort(((e,t)=>t.distance-e.distance));return a[0]?a[0].id:null}({pageBorderBox:e,draggable:t,candidates:r}):null}({pageBorderBox:s,draggable:t,droppables:r});if(!l)return pe;const c=r[l],u=oe(c.descriptor.id,n),d=((e,t)=>{const n=e.frame;return n?qe(t,n.scroll.diff.value):t})(c,s);return(({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:a,afterCritical:o})=>{if(!r.isCombineEnabled)return null;const i=r.axis,s=Fe(r.axis,e.displaceBy),l=s.value,c=t[i.start],u=t[i.end],d=le(e,a).find((e=>{const t=e.descriptor.id,r=e.page.borderBox,a=r[i.size]/4,s=Ce(t,o),d=Qe({displaced:n.displaced,id:t});return s?d?u>r[i.start]+a&&u<r[i.end]-a:c>r[i.start]-l+a&&c<r[i.end]-l-a:d?u>r[i.start]+l+a&&u<r[i.end]+l-a:c>r[i.start]+a&&c<r[i.end]-a}));return d?{displacedBy:s,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:d.descriptor.id,droppableId:r.descriptor.id}}}:null})({pageBorderBoxWithDroppableScroll:d,draggable:t,previousImpact:a,destination:c,insideDestination:u,afterCritical:i})||(({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:a,viewport:o,afterCritical:i})=>{const s=n.axis,l=Fe(n.axis,t.displaceBy),c=l.value,u=e[s.start],d=e[s.end],p=function({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}({draggable:t,closest:le(t,r).find((e=>{const t=e.descriptor.id,n=e.page.borderBox.center[s.line],r=Ce(t,i),o=Qe({displaced:a,id:t});return r?o?d<=n:u<n-c:o?d<=n+c:u<n}))||null,inHomeList:ce(t,n)});return De({draggable:t,insideDestination:r,destination:n,viewport:o,last:a,displacedBy:l,index:p})})({pageBorderBoxWithDroppableScroll:d,draggable:t,destination:c,insideDestination:u,last:a.displaced,viewport:o,afterCritical:i})},Ke=(e,t)=>({...e,[t.descriptor.id]:t});var Xe=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:a,scrollJumpRequest:o})=>{const i=r||e.viewport,s=n||e.dimensions,l=t||e.current.client.selection,c=U(l,e.initial.client.selection),u={offset:c,selection:l,borderBoxCenter:W(e.initial.client.borderBoxCenter,c)},d={selection:W(u.selection,i.scroll.current),borderBoxCenter:W(u.borderBoxCenter,i.scroll.current),offset:W(u.offset,i.scroll.diff.value)},p={client:u,page:d};if("COLLECTING"===e.phase)return{...e,dimensions:s,viewport:i,current:p};const f=s.draggables[e.critical.draggable.id],h=a||Ye({pageOffset:d.offset,draggable:f,draggables:s.draggables,droppables:s.droppables,previousImpact:e.impact,viewport:i,afterCritical:e.afterCritical}),g=(({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:a})=>{const o=(({previousImpact:e,impact:t,droppables:n})=>{const r=Ue(e),a=Ue(t);if(!r)return n;if(r===a)return n;const o=n[r];if(!o.subject.withPlaceholder)return n;const i=(e=>{const t=e.subject.withPlaceholder;t||A(!1);const n=e.frame;if(!n){const t=J({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:t}}const r=t.oldFrameMaxScroll;r||A(!1);const a=ze(n,r),o=J({page:e.subject.page,axis:e.axis,frame:a,withPlaceholder:null});return{...e,subject:o,frame:a}})(o);return Ke(n,i)})({previousImpact:r,impact:a,droppables:n}),i=Ue(a);if(!i)return o;const s=n[i];if(ce(e,s))return o;if(s.subject.withPlaceholder)return o;const l=We(s,e,t);return Ke(o,l)})({draggable:f,impact:h,previousImpact:e.impact,draggables:s.draggables,droppables:s.droppables});return{...e,current:p,dimensions:{draggables:s.draggables,droppables:g},impact:h,viewport:i,scrollJumpRequest:o||null,forceShouldAnimate:!o&&null}},Ze=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:a})=>{const o=e.displaced,i=function(e,t){return e.map((e=>t[e]))}(o.all,n),s=Se({afterDragging:i,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:a,last:o});return{...e,displaced:s}},Je=({impact:e,draggable:t,droppable:n,draggables:r,viewport:a,afterCritical:o})=>{const i=Te({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o});return je({pageBorderBoxCenter:i,draggable:t,viewport:a})},et=({state:e,dimensions:t,viewport:n})=>{"SNAP"!==e.movementMode&&A(!1);const r=e.impact,a=n||e.viewport,o=t||e.dimensions,{draggables:i,droppables:s}=o,l=i[e.critical.draggable.id],c=Ue(r);c||A(!1);const u=s[c],d=Ze({impact:r,viewport:a,destination:u,draggables:i}),p=Je({impact:d,draggable:l,droppable:u,draggables:i,viewport:a,afterCritical:e.afterCritical});return Xe({impact:d,clientSelection:p,state:e,dimensions:o,viewport:a})},tt=({draggable:e,home:t,draggables:n,viewport:r})=>{const a=Fe(t.axis,e.displaceBy),o=oe(t.descriptor.id,n),i=o.indexOf(e);-1===i&&A(!1);const s=o.slice(i+1),l=s.reduce(((e,t)=>(e[t.descriptor.id]=!0,e)),{}),c={inVirtualList:"virtual"===t.descriptor.mode,displacedBy:a,effected:l};var u;return{impact:{displaced:Se({afterDragging:s,destination:t,displacedBy:a,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:a,at:{type:"REORDER",destination:(u=e.descriptor,{index:u.index,droppableId:u.droppableId})}},afterCritical:c}};const nt=e=>"SNAP"===e.movementMode,rt=(e,t,n)=>{const r=((e,t)=>({draggables:e.draggables,droppables:Ke(e.droppables,t)}))(e.dimensions,t);return!nt(e)||n?Xe({state:e,dimensions:r}):et({state:e,dimensions:r})};function at(e){return e.isDragging&&"SNAP"===e.movementMode?{...e,scrollJumpRequest:null}:e}const ot={phase:"IDLE",completed:null,shouldFlush:!1};var it=(e=ot,t)=>{if("FLUSH"===t.type)return{...ot,shouldFlush:!0};if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&A(!1);const{critical:n,clientSelection:r,viewport:a,dimensions:o,movementMode:i}=t.payload,s=o.draggables[n.draggable.id],l=o.droppables[n.droppable.id],c={selection:r,borderBoxCenter:s.client.borderBox.center,offset:z},u={client:c,page:{selection:W(c.selection,a.scroll.initial),borderBoxCenter:W(c.selection,a.scroll.initial),offset:W(c.selection,a.scroll.diff.value)}},d=re(o.droppables).every((e=>!e.isFixedOnPage)),{impact:p,afterCritical:f}=tt({draggable:s,home:l,draggables:o.draggables,viewport:a});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:i,dimensions:o,initial:u,current:u,isWindowScrollAllowed:d,impact:p,afterCritical:f,onLiftImpact:p,viewport:a,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&A(!1),{...e,phase:"COLLECTING"});if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&A(!1),(({state:e,published:t})=>{const n=t.modified.map((t=>{const n=e.dimensions.droppables[t.droppableId];return ee(n,t.scroll)})),r={...e.dimensions.droppables,...te(n)},a=ne((({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map((e=>{const a=e.descriptor.droppableId,o=(e=>{const t=e.frame;return t||A(!1),t})(t[a]),i=o.scroll.diff.value,s=(({draggable:e,offset:t,initialWindowScroll:n})=>{const r=y(e.client,t),a=v(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:a}})({draggable:e,offset:W(r,i),initialWindowScroll:n.scroll.initial});return s}))})({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),o={...e.dimensions.draggables,...a};t.removals.forEach((e=>{delete o[e]}));const i={droppables:r,draggables:o},s=Ue(e.impact),l=s?i.droppables[s]:null,c=i.draggables[e.critical.draggable.id],u=i.droppables[e.critical.droppable.id],{impact:d,afterCritical:p}=tt({draggable:c,home:u,draggables:o,viewport:e.viewport}),f=l&&l.isCombineEnabled?e.impact:d,h=Ye({pageOffset:e.current.page.offset,draggable:i.draggables[e.critical.draggable.id],draggables:i.draggables,droppables:i.droppables,previousImpact:f,viewport:e.viewport,afterCritical:p}),g={...e,phase:"DRAGGING",impact:h,onLiftImpact:d,dimensions:i,afterCritical:p,forceShouldAnimate:!1};return"COLLECTING"===e.phase?g:{...g,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}})({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;$e(e)||A(!1);const{client:n}=t.payload;return H(n,e.current.client.selection)?e:Xe({state:e,clientSelection:n,impact:nt(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return at(e);if("COLLECTING"===e.phase)return at(e);$e(e)||A(!1);const{id:n,newScroll:r}=t.payload,a=e.dimensions.droppables[n];if(!a)return e;const o=ee(a,r);return rt(e,o,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;$e(e)||A(!1);const{id:n,isEnabled:r}=t.payload,a=e.dimensions.droppables[n];a||A(!1),a.isEnabled===r&&A(!1);const o={...a,isEnabled:r};return rt(e,o,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;$e(e)||A(!1);const{id:n,isCombineEnabled:r}=t.payload,a=e.dimensions.droppables[n];a||A(!1),a.isCombineEnabled===r&&A(!1);const o={...a,isCombineEnabled:r};return rt(e,o,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;$e(e)||A(!1),e.isWindowScrollAllowed||A(!1);const n=t.payload.newScroll;if(H(e.viewport.scroll.current,n))return at(e);const r=ke(e.viewport,n);return nt(e)?et({state:e,viewport:r}):Xe({state:e,viewport:r})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!$e(e))return e;const n=t.payload.maxScroll;if(H(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&A(!1);const n=He({state:e,type:t.type});return n?Xe({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){const n=t.payload.reason;return"COLLECTING"!==e.phase&&A(!1),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if("DROP_ANIMATE"===t.type){const{completed:n,dropDuration:r,newHomeClientOffset:a}=t.payload;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&A(!1),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:a,dimensions:e.dimensions}}if("DROP_COMPLETE"===t.type){const{completed:e}=t.payload;return{phase:"IDLE",completed:e,shouldFlush:!1}}return e};const st=e=>({type:"LIFT",payload:e}),lt=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),ct=()=>({type:"COLLECTION_STARTING",payload:null}),ut=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),dt=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),pt=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),ft=e=>({type:"MOVE",payload:e}),ht=()=>({type:"MOVE_UP",payload:null}),gt=()=>({type:"MOVE_DOWN",payload:null}),mt=()=>({type:"MOVE_RIGHT",payload:null}),bt=()=>({type:"MOVE_LEFT",payload:null}),yt=()=>({type:"FLUSH",payload:null}),vt=e=>({type:"DROP_COMPLETE",payload:e}),wt=e=>({type:"DROP",payload:e}),xt="cubic-bezier(.2,1,.1,1)",St=0,Ot=.7,Dt=.75,Ct={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},Et=`${Ct.outOfTheWay}s cubic-bezier(0.2, 0, 0, 1)`,_t={fluid:`opacity ${Et}`,snap:`transform ${Et}, opacity ${Et}`,drop:e=>{const t=`${e}s ${xt}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${Et}`,placeholder:`height ${Et}, width ${Et}, margin ${Et}`},Pt=e=>H(e,z)?void 0:`translate(${e.x}px, ${e.y}px)`,Rt=Pt,It=(e,t)=>{const n=Pt(e);if(n)return t?`${n} scale(${Dt})`:n},{minDropTime:Tt,maxDropTime:kt}=Ct,At=kt-Tt;var jt=({getState:e,dispatch:t})=>n=>r=>{if("DROP"!==r.type)return void n(r);const a=e(),o=r.payload.reason;if("COLLECTING"===a.phase)return void t((i={reason:o},{type:"DROP_PENDING",payload:i}));var i;if("IDLE"===a.phase)return;"DROP_PENDING"===a.phase&&a.isWaiting&&A(!1),"DRAGGING"!==a.phase&&"DROP_PENDING"!==a.phase&&A(!1);const s=a.critical,l=a.dimensions,c=l.draggables[a.critical.draggable.id],{impact:u,didDropInsideDroppable:d}=(({draggables:e,reason:t,lastImpact:n,home:r,viewport:a,onLiftImpact:o})=>n.at&&"DROP"===t?"REORDER"===n.at.type?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:de},didDropInsideDroppable:!0}:{impact:Ze({draggables:e,impact:o,destination:r,viewport:a,forceShouldAnimate:!0}),didDropInsideDroppable:!1})({reason:o,lastImpact:a.impact,afterCritical:a.afterCritical,onLiftImpact:a.onLiftImpact,home:a.dimensions.droppables[a.critical.droppable.id],viewport:a.viewport,draggables:a.dimensions.draggables}),p=d?ie(u):null,f=d?se(u):null,h={index:s.draggable.index,droppableId:s.droppable.id},g={draggableId:c.descriptor.id,type:c.descriptor.type,source:h,reason:o,mode:a.movementMode,destination:p,combine:f},m=(({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:a})=>{const{draggables:o,droppables:i}=n,s=Ue(e),l=s?i[s]:null,c=i[t.descriptor.droppableId],u=Je({impact:e,draggable:t,draggables:o,afterCritical:a,droppable:l||c,viewport:r});return U(u,t.client.borderBox.center)})({impact:u,draggable:c,dimensions:l,viewport:a.viewport,afterCritical:a.afterCritical}),b={critical:a.critical,afterCritical:a.afterCritical,result:g,impact:u};if(H(a.current.client.offset,m)&&!Boolean(g.combine))return void t(vt({completed:b}));const y=(({current:e,destination:t,reason:n})=>{const r=q(e,t);if(r<=0)return Tt;if(r>=1500)return kt;const a=Tt+At*(r/1500);return Number(("CANCEL"===n?.6*a:a).toFixed(2))})({current:a.current.client.offset,destination:m,reason:o});t((e=>({type:"DROP_ANIMATE",payload:e}))({newHomeClientOffset:m,dropDuration:y,completed:b}))},Mt=()=>({x:window.pageXOffset,y:window.pageYOffset});var Lt=e=>{const t=function({onWindowScroll:e}){const t=C((function(){e(Mt())})),n=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}(t);let r=P;function a(){return r!==P}return{start:function(){a()&&A(!1),r=R(window,[n])},stop:function(){a()||A(!1),t.cancel(),r(),r=P},isActive:a}}({onWindowScroll:t=>{e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return e=>n=>{t.isActive()||"INITIAL_PUBLISH"!==n.type||t.start(),t.isActive()&&(e=>"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type)(n)&&t.stop(),e(n)}};const Nt=(e,t)=>{t()},Bt=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Vt(e,t,n,r){if(!e)return void n(r(t));const a=(e=>{let t=!1,n=!1;const r=setTimeout((()=>{n=!0})),a=a=>{t||n||(t=!0,e(a),clearTimeout(r))};return a.wasCalled=()=>t,a})(n);e(t,{announce:a}),a.wasCalled()||n(r(t))}var Ft=(e,t)=>{const n=((e,t)=>{const n=(()=>{const e=[];return{add:t=>{const n=setTimeout((()=>(t=>{const n=e.findIndex((e=>e.timerId===t));-1===n&&A(!1);const[r]=e.splice(n,1);r.callback()})(n))),r={timerId:n,callback:t};e.push(r)},flush:()=>{if(!e.length)return;const t=[...e];e.length=0,t.forEach((e=>{clearTimeout(e.timerId),e.callback()}))}}})();let r=null;const a=n=>{r||A(!1),r=null,Nt(0,(()=>Vt(e().onDragEnd,n,t,F.onDragEnd)))};return{beforeCapture:(t,n)=>{r&&A(!1),Nt(0,(()=>{const r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:(t,n)=>{r&&A(!1),Nt(0,(()=>{const r=e().onBeforeDragStart;r&&r(Bt(t,n))}))},start:(a,o)=>{r&&A(!1);const i=Bt(a,o);r={mode:o,lastCritical:a,lastLocation:i.source,lastCombine:null},n.add((()=>{Nt(0,(()=>Vt(e().onDragStart,i,t,F.onDragStart)))}))},update:(a,o)=>{const i=ie(o),s=se(o);r||A(!1);const l=!((e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r})(a,r.lastCritical);l&&(r.lastCritical=a);const c=(d=i,!(null==(u=r.lastLocation)&&null==d||null!=u&&null!=d&&u.droppableId===d.droppableId&&u.index===d.index));var u,d;c&&(r.lastLocation=i);const p=!((e,t)=>null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId)(r.lastCombine,s);if(p&&(r.lastCombine=s),!l&&!c&&!p)return;const f={...Bt(a,r.mode),combine:s,destination:i};n.add((()=>{Nt(0,(()=>Vt(e().onDragUpdate,f,t,F.onDragUpdate)))}))},flush:()=>{r||A(!1),n.flush()},drop:a,abort:()=>{if(!r)return;const e={...Bt(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};a(e)}}})(e,t);return e=>t=>r=>{if("BEFORE_INITIAL_CAPTURE"===r.type)return void n.beforeCapture(r.payload.draggableId,r.payload.movementMode);if("INITIAL_PUBLISH"===r.type){const e=r.payload.critical;return n.beforeStart(e,r.payload.movementMode),t(r),void n.start(e,r.payload.movementMode)}if("DROP_COMPLETE"===r.type){const e=r.payload.completed.result;return n.flush(),t(r),void n.drop(e)}if(t(r),"FLUSH"===r.type)return void n.abort();const a=e.getState();"DRAGGING"===a.phase&&n.update(a.critical,a.impact)}},zt=e=>t=>n=>{if("DROP_ANIMATION_FINISHED"!==n.type)return void t(n);const r=e.getState();"DROP_ANIMATING"!==r.phase&&A(!1),e.dispatch(vt({completed:r.completed}))},Wt=e=>{let t=null,n=null;return r=>a=>{if("FLUSH"!==a.type&&"DROP_COMPLETE"!==a.type&&"DROP_ANIMATION_FINISHED"!==a.type||(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(a),"DROP_ANIMATE"!==a.type)return;const o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame((()=>{n=null,t=R(window,[o])}))}},Ut=e=>t=>n=>{if(t(n),"PUBLISH_WHILE_DRAGGING"!==n.type)return;const r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(wt({reason:r.reason})))};const Ht=s.compose;var $t=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:a,autoScroller:o})=>{return(0,s.createStore)(it,Ht((0,s.applyMiddleware)((i=n,()=>e=>t=>{"INITIAL_PUBLISH"===t.type&&i.dragging(),"DROP_ANIMATE"===t.type&&i.dropping(t.payload.completed.result.reason),"FLUSH"!==t.type&&"DROP_COMPLETE"!==t.type||i.resting(),e(t)}),(e=>()=>t=>n=>{"DROP_COMPLETE"!==n.type&&"FLUSH"!==n.type&&"DROP_ANIMATE"!==n.type||e.stopPublishing(),t(n)})(e),(e=>({getState:t,dispatch:n})=>r=>a=>{if("LIFT"!==a.type)return void r(a);const{id:o,clientSelection:i,movementMode:s}=a.payload,l=t();"DROP_ANIMATING"===l.phase&&n(vt({completed:l.completed})),"IDLE"!==t().phase&&A(!1),n(yt()),n({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:o,movementMode:s}});const c={draggableId:o,scrollOptions:{shouldPublishImmediately:"SNAP"===s}},{critical:u,dimensions:d,viewport:p}=e.startPublishing(c);n({type:"INITIAL_PUBLISH",payload:{critical:u,dimensions:d,clientSelection:i,movementMode:s,viewport:p}})})(e),jt,zt,Wt,Ut,(e=>t=>n=>r=>{if((e=>"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type)(r))return e.stop(),void n(r);if("INITIAL_PUBLISH"===r.type){n(r);const a=t.getState();return"DRAGGING"!==a.phase&&A(!1),void e.start(a)}n(r),e.scroll(t.getState())})(o),Lt,(e=>{let t=!1;return()=>n=>r=>{if("INITIAL_PUBLISH"===r.type)return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if("FLUSH"===r.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===r.type){t=!1;const n=r.payload.completed.result;n.combine&&e.tryShiftRecord(n.draggableId,n.combine.draggableId),e.tryRestoreFocusRecorded()}}}})(t),Ft(r,a))));var i},Gt=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const a=U({x:t,y:e},{x:r,y:n});return{x:Math.max(0,a.x),y:Math.max(0,a.y)}},qt=()=>{const e=document.documentElement;return e||A(!1),e},Qt=()=>{const e=qt();return Gt({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function Yt(e,t,n){return n.descriptor.id!==t.id&&(n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode)}var Kt=(e,t)=>{let n=null;const r=function({registry:e,callbacks:t}){let n={additions:{},removals:{},modified:{}},r=null;const a=()=>{r||(t.collectionStarting(),r=requestAnimationFrame((()=>{r=null;const{additions:a,removals:o,modified:i}=n,s=Object.keys(a).map((t=>e.draggable.getById(t).getDimension(z))).sort(((e,t)=>e.descriptor.index-t.descriptor.index)),l=Object.keys(i).map((t=>({droppableId:t,scroll:e.droppable.getById(t).callbacks.getScrollWhileDragging()}))),c={additions:s,removals:Object.keys(o),modified:l};n={additions:{},removals:{},modified:{}},t.publish(c)})))};return{add:e=>{const t=e.descriptor.id;n.additions[t]=e,n.modified[e.descriptor.droppableId]=!0,n.removals[t]&&delete n.removals[t],a()},remove:e=>{const t=e.descriptor;n.removals[t.id]=!0,n.modified[t.droppableId]=!0,n.additions[t.id]&&delete n.additions[t.id],a()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),a=t=>{n||A(!1);const a=n.critical.draggable;"ADDITION"===t.type&&Yt(e,a,t.value)&&r.add(t.value),"REMOVAL"===t.type&&Yt(e,a,t.value)&&r.remove(t.value)},o={updateDroppableIsEnabled:(r,a)=>{e.droppable.exists(r)||A(!1),n&&t.updateDroppableIsEnabled({id:r,isEnabled:a})},updateDroppableIsCombineEnabled:(r,a)=>{n&&(e.droppable.exists(r)||A(!1),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:a}))},scrollDroppable:(t,r)=>{n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:(r,a)=>{n&&(e.droppable.exists(r)||A(!1),t.updateDroppableScroll({id:r,newScroll:a}))},startPublishing:t=>{n&&A(!1);const r=e.draggable.getById(t.draggableId),o=e.droppable.getById(r.descriptor.droppableId),i={draggable:r.descriptor,droppable:o.descriptor},s=e.subscribe(a);return n={critical:i,unsubscribe:s},(({critical:e,scrollOptions:t,registry:n})=>{const r=(()=>{const e=Mt(),t=Qt(),n=e.y,r=e.x,a=qt(),o=a.clientWidth,i=a.clientHeight;return{frame:p({top:n,left:r,right:r+o,bottom:n+i}),scroll:{initial:e,current:e,max:t,diff:{value:z,displacement:z}}}})(),a=r.scroll.current,o=e.droppable,i=n.droppable.getAllByType(o.type).map((e=>e.callbacks.getDimensionAndWatchScroll(a,t))),s=n.draggable.getAllByType(e.draggable.type).map((e=>e.getDimension(a)));return{dimensions:{draggables:ne(s),droppables:te(i)},critical:e,viewport:r}})({critical:i,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:()=>{if(!n)return;r.stop();const t=n.critical.droppable;e.droppable.getAllByType(t.type).forEach((e=>e.callbacks.dragStopped())),n.unsubscribe(),n=null}};return o},Xt=(e,t)=>"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason,Zt=e=>{window.scrollBy(e.x,e.y)};const Jt=D((e=>re(e).filter((e=>!!e.isEnabled&&!!e.frame))));const en={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var tn=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return 0===r?0:(n-e)/r},nn=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:a})=>{const o=((e,t,n=(()=>en))=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return 1;const a=1-tn({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),o=r.maxPixelScroll*r.ease(a);return Math.ceil(o)})(e,t,a);return 0===o?0:r?Math.max(((e,t,n)=>{const r=n(),a=r.durationDampening.accelerateAt,o=r.durationDampening.stopDampeningAt,i=t,s=o,l=Date.now()-i;if(l>=o)return e;if(l<a)return 1;const c=tn({startOfRange:a,endOfRange:s,current:l}),u=e*r.ease(c);return Math.ceil(u)})(o,n,a),1):o},rn=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:a,getAutoScrollerOptions:o})=>{const i=((e,t,n=(()=>en))=>{const r=n();return{startScrollingFrom:e[t.size]*r.startFromPercentage,maxScrollValueAt:e[t.size]*r.maxScrollAtPercentage}})(e,r,o);return t[r.end]<t[r.start]?nn({distanceToEdge:t[r.end],thresholds:i,dragStartTime:n,shouldUseTimeDampening:a,getAutoScrollerOptions:o}):-1*nn({distanceToEdge:t[r.start],thresholds:i,dragStartTime:n,shouldUseTimeDampening:a,getAutoScrollerOptions:o})};const an=Y((e=>0===e?0:e));var on=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:a,getAutoScrollerOptions:o})=>{const i={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},s=rn({container:t,distanceToEdges:i,dragStartTime:e,axis:me,shouldUseTimeDampening:a,getAutoScrollerOptions:o}),l=rn({container:t,distanceToEdges:i,dragStartTime:e,axis:be,shouldUseTimeDampening:a,getAutoScrollerOptions:o}),c=an({x:l,y:s});if(H(c,z))return null;const u=(({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,a=t.width>e.width;return a||r?a&&r?null:{x:a?0:n.x,y:r?0:n.y}:n})({container:t,subject:n,proposedScroll:c});return u?H(u,z)?null:u:null};const sn=Y((e=>0===e?0:e>0?1:-1)),ln=(()=>{const e=(e,t)=>e<0?e:e>t?e-t:0;return({current:t,max:n,change:r})=>{const a=W(t,r),o={x:e(a.x,n.x),y:e(a.y,n.y)};return H(o,z)?null:o}})(),cn=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},a=sn(n),o=ln({max:r,current:t,change:a});return!o||0!==a.x&&0===o.x||0!==a.y&&0===o.y},un=(e,t)=>cn({current:e.scroll.current,max:e.scroll.max,change:t}),dn=(e,t)=>{const n=e.frame;return!!n&&cn({current:n.scroll.current,max:n.scroll.max,change:t})};var pn=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:a,getAutoScrollerOptions:o})=>{const i=e.current.page.borderBoxCenter,s=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const a=(({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:a,getAutoScrollerOptions:o})=>{const i=on({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:a,getAutoScrollerOptions:o});return i&&un(e,i)?i:null})({dragStartTime:t,viewport:e.viewport,subject:s,center:i,shouldUseTimeDampening:n,getAutoScrollerOptions:o});if(a)return void r(a)}const l=(({center:e,destination:t,droppables:n})=>{if(t){const e=n[t];return e.frame?e:null}const r=((e,t)=>{const n=Jt(t).find((t=>(t.frame||A(!1),Ge(t.frame.pageMarginBox)(e))))||null;return n})(e,n);return r})({center:i,destination:Ue(e.impact),droppables:e.dimensions.droppables});if(!l)return;const c=(({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:a,getAutoScrollerOptions:o})=>{const i=e.frame;if(!i)return null;const s=on({dragStartTime:r,container:i.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:a,getAutoScrollerOptions:o});return s&&dn(e,s)?s:null})({dragStartTime:t,droppable:l,subject:s,center:i,shouldUseTimeDampening:n,getAutoScrollerOptions:o});c&&a(l.descriptor.id,c)},fn=({move:e,scrollDroppable:t,scrollWindow:n})=>r=>{const a=r.scrollJumpRequest;if(!a)return;const o=Ue(r.impact);o||A(!1);const i=((e,n)=>{if(!dn(e,n))return n;const r=((e,t)=>{const n=e.frame;return n&&dn(e,t)?ln({current:n.scroll.current,max:n.scroll.max,change:t}):null})(e,n);if(!r)return t(e.descriptor.id,n),null;const a=U(n,r);return t(e.descriptor.id,a),U(n,a)})(r.dimensions.droppables[o],a);if(!i)return;const s=r.viewport,l=((e,t,r)=>{if(!e)return r;if(!un(t,r))return r;const a=((e,t)=>{if(!un(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return ln({current:r,max:n,change:t})})(t,r);if(!a)return n(r),null;const o=U(r,a);return n(o),U(r,o)})(r.isWindowScrollAllowed,s,i);l&&((t,n)=>{const r=W(t.current.client.selection,n);e({client:r})})(r,l)},hn=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const a=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=(()=>en)})=>{const r=C(e),a=C(t);let o=null;const i=e=>{o||A(!1);const{shouldUseTimeDampening:t,dragStartTime:i}=o;pn({state:e,scrollWindow:r,scrollDroppable:a,dragStartTime:i,shouldUseTimeDampening:t,getAutoScrollerOptions:n})};return{start:e=>{o&&A(!1);const t=Date.now();let r=!1;const a=()=>{r=!0};pn({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:a,scrollDroppable:a,getAutoScrollerOptions:n}),o={dragStartTime:t,shouldUseTimeDampening:r},r&&i(e)},stop:()=>{o&&(r.cancel(),a.cancel(),o=null)},scroll:i}})({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),o=fn({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:e=>{r().disabled||"DRAGGING"!==e.phase||("FLUID"!==e.movementMode?e.scrollJumpRequest&&o(e):a.scroll(e))},start:a.start,stop:a.stop}};const gn="data-rfd",mn=(()=>{const e=`${gn}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),bn=(()=>{const e=`${gn}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),yn=(()=>{const e=`${gn}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),vn={contextId:`${gn}-scroll-container-context-id`},wn=(e,t)=>e.map((e=>{const n=e.styles[t];return n?`${e.selector} { ${n} }`:""})).join(" ");var xn=e=>{const t=(n=e,e=>`[${e}="${n}"]`);var n;const r=(()=>{const e="\n cursor: -webkit-grab;\n cursor: grab;\n ";return{selector:t(mn.contextId),styles:{always:"\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",resting:e,dragging:"pointer-events: none;",dropAnimating:e}}})(),a=[(()=>{const e=`\n transition: ${_t.outOfTheWay};\n `;return{selector:t(bn.contextId),styles:{dragging:e,dropAnimating:e,userCancel:e}}})(),r,{selector:t(yn.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "}}];return{always:wn(a,"always"),resting:wn(a,"resting"),dragging:wn(a,"dragging"),dropAnimating:wn(a,"dropAnimating"),userCancel:wn(a,"userCancel")}},Sn="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect;const On=()=>{const e=document.querySelector("head");return e||A(!1),e},Dn=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function Cn(e,t){return Array.from(e.querySelectorAll(t))}var En=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function _n(e){return e instanceof En(e).HTMLElement}function Pn(){const e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach((t=>t(e)))}function r(t){return e.draggables[t]||null}function a(t){return e.droppables[t]||null}return{draggable:{register:t=>{e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:(t,n)=>{const r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:t=>{const a=t.descriptor.id,o=r(a);o&&t.uniqueId===o.uniqueId&&(delete e.draggables[a],e.droppables[t.descriptor.droppableId]&&n({type:"REMOVAL",value:t}))},getById:function(e){const t=r(e);return t||A(!1),t},findById:r,exists:e=>Boolean(r(e)),getAllByType:t=>Object.values(e.draggables).filter((e=>e.descriptor.type===t))},droppable:{register:t=>{e.droppables[t.descriptor.id]=t},unregister:t=>{const n=a(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){const t=a(e);return t||A(!1),t},findById:a,exists:e=>Boolean(a(e)),getAllByType:t=>Object.values(e.droppables).filter((e=>e.descriptor.type===t))},subscribe:function(e){return t.push(e),function(){const n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var Rn=a().createContext(null),In=()=>{const e=document.body;return e||A(!1),e},Tn={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"};const kn=e=>`rfd-announcement-${e}`;let An=0;const jn={separator:"::"};var Mn="useId"in a()?function(e,t=jn){const n=a().useId();return u((()=>`${e}${t.separator}${n}`),[t.separator,e,n])}:function(e,t=jn){return u((()=>`${e}${t.separator}${An++}`),[t.separator,e])},Ln=a().createContext(null);function Nn(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e})),t}function Bn(e){return"IDLE"!==e.phase&&"DROP_ANIMATING"!==e.phase&&e.isDragging}const Vn=9,Fn=13,zn=33,Wn=34,Un=35,Hn=36,$n={[Fn]:!0,[Vn]:!0};var Gn=e=>{$n[e.keyCode]&&e.preventDefault()},qn=(()=>{const e="visibilitychange";return"undefined"==typeof document?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find((e=>`on${e}`in document))||e})();const Qn={type:"IDLE"};function Yn(){}const Kn={[Wn]:!0,[zn]:!0,[Hn]:!0,[Un]:!0};const Xn={type:"IDLE"},Zn=["input","button","textarea","select","option","optgroup","video","audio"];function Jn(e,t){if(null==t)return!1;if(Zn.includes(t.tagName.toLowerCase()))return!0;const n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&Jn(e,t.parentElement)}function er(e,t){const n=t.target;return!!_n(n)&&Jn(e,n)}var tr=e=>p(e.getBoundingClientRect()).center;const nr=(()=>{const e="matches";return"undefined"==typeof document?e:[e,"msMatchesSelector","webkitMatchesSelector"].find((e=>e in Element.prototype))||e})();function rr(e,t){return null==e?null:e[nr](t)?e:rr(e.parentElement,t)}function ar(e,t){return e.closest?e.closest(t):rr(e,t)}function or(e){e.preventDefault()}function ir({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!!n()&&e===t}function sr({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const a=n.draggable.findById(r);return!!a&&!!a.options.isEnabled&&!!Xt(t.getState(),r)}const lr=[function(e){const t=(0,r.useRef)(Qn),n=(0,r.useRef)(P),a=u((()=>({eventName:"mousedown",fn:function(t){if(t.defaultPrevented)return;if(0!==t.button)return;if(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)return;const r=e.findClosestDraggableId(t);if(!r)return;const a=e.tryGetLock(r,s,{sourceEvent:t});if(!a)return;t.preventDefault();const o={x:t.clientX,y:t.clientY};n.current(),p(a,o)}})),[e]),o=u((()=>({eventName:"webkitmouseforcewillbegin",fn:t=>{if(t.defaultPrevented)return;const n=e.findClosestDraggableId(t);if(!n)return;const r=e.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||e.canGetLock(n)&&t.preventDefault())}})),[e]),i=d((function(){n.current=R(window,[o,a],{passive:!1,capture:!0})}),[o,a]),s=d((()=>{"IDLE"!==t.current.type&&(t.current=Qn,n.current(),i())}),[i]),l=d((()=>{const e=t.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[s]),c=d((function(){const e=function({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:e=>{const{button:t,clientX:a,clientY:o}=e;if(0!==t)return;const i={x:a,y:o},s=n();if("DRAGGING"===s.type)return e.preventDefault(),void s.actions.move(i);if("PENDING"!==s.type&&A(!1),l=s.point,c=i,!(Math.abs(c.x-l.x)>=5||Math.abs(c.y-l.y)>=5))return;var l,c;e.preventDefault();const u=s.actions.fluidLift(i);r({type:"DRAGGING",actions:u})}},{eventName:"mouseup",fn:r=>{const a=n();"DRAGGING"===a.type?(r.preventDefault(),a.actions.drop({shouldBlockNextClick:!0}),t()):e()}},{eventName:"mousedown",fn:t=>{"DRAGGING"===n().type&&t.preventDefault(),e()}},{eventName:"keydown",fn:t=>{if("PENDING"!==n().type)return 27===t.keyCode?(t.preventDefault(),void e()):void Gn(t);e()}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{"PENDING"===n().type&&e()}},{eventName:"webkitmouseforcedown",fn:t=>{const r=n();"IDLE"===r.type&&A(!1),r.actions.shouldRespectForcePress()?e():t.preventDefault()}},{eventName:qn,fn:e}]}({cancel:l,completed:s,getPhase:()=>t.current,setPhase:e=>{t.current=e}});n.current=R(window,e,{capture:!0,passive:!1})}),[l,s]),p=d((function(e,n){"IDLE"!==t.current.type&&A(!1),t.current={type:"PENDING",point:n,actions:e},c()}),[c]);Sn((function(){return i(),function(){n.current()}}),[i])},function(e){const t=(0,r.useRef)(Yn),n=u((()=>({eventName:"keydown",fn:function(n){if(n.defaultPrevented)return;if(32!==n.keyCode)return;const r=e.findClosestDraggableId(n);if(!r)return;const o=e.tryGetLock(r,l,{sourceEvent:n});if(!o)return;n.preventDefault();let i=!0;const s=o.snapLift();function l(){i||A(!1),i=!1,t.current(),a()}t.current(),t.current=R(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:r=>27===r.keyCode?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(Kn[r.keyCode]?r.preventDefault():Gn(r))},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:qn,fn:n}]}(s,l),{capture:!0,passive:!1})}})),[e]),a=d((function(){t.current=R(window,[n],{passive:!1,capture:!0})}),[n]);Sn((function(){return a(),function(){t.current()}}),[a])},function(e){const t=(0,r.useRef)(Xn),n=(0,r.useRef)(P),a=d((function(){return t.current}),[]),o=d((function(e){t.current=e}),[]),i=u((()=>({eventName:"touchstart",fn:function(t){if(t.defaultPrevented)return;const r=e.findClosestDraggableId(t);if(!r)return;const a=e.tryGetLock(r,l,{sourceEvent:t});if(!a)return;const o=t.touches[0],{clientX:i,clientY:s}=o,c={x:i,y:s};n.current(),h(a,c)}})),[e]),s=d((function(){n.current=R(window,[i],{capture:!0,passive:!1})}),[i]),l=d((()=>{const e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),o(Xn),n.current(),s())}),[s,o]),c=d((()=>{const e=t.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[l]),p=d((function(){const e={capture:!0,passive:!1},t={cancel:c,completed:l,getPhase:a},r=R(window,function({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:t=>{const r=n();if("DRAGGING"!==r.type)return void e();r.hasMoved=!0;const{clientX:a,clientY:o}=t.touches[0],i={x:a,y:o};t.preventDefault(),r.actions.move(i)}},{eventName:"touchend",fn:r=>{const a=n();"DRAGGING"===a.type?(r.preventDefault(),a.actions.drop({shouldBlockNextClick:!0}),t()):e()}},{eventName:"touchcancel",fn:t=>{"DRAGGING"===n().type?(t.preventDefault(),e()):e()}},{eventName:"touchforcechange",fn:t=>{const r=n();"IDLE"===r.type&&A(!1);const a=t.touches[0];if(!a)return;if(!(a.force>=.15))return;const o=r.actions.shouldRespectForcePress();if("PENDING"!==r.type)return o?r.hasMoved?void t.preventDefault():void e():void t.preventDefault();o&&e()}},{eventName:qn,fn:e}]}(t),e),o=R(window,function({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:e=>{e.preventDefault()}},{eventName:"keydown",fn:n=>{"DRAGGING"===t().type?(27===n.keyCode&&n.preventDefault(),e()):e()}},{eventName:qn,fn:e}]}(t),e);n.current=function(){r(),o()}}),[c,a,l]),f=d((function(){const e=a();"PENDING"!==e.type&&A(!1);const t=e.actions.fluidLift(e.point);o({type:"DRAGGING",actions:t,hasMoved:!1})}),[a,o]),h=d((function(e,t){"IDLE"!==a().type&&A(!1);const n=setTimeout(f,120);o({type:"PENDING",point:t,actions:e,longPressTimerId:n}),p()}),[p,a,o,f]);Sn((function(){return s(),function(){n.current();const e=a();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),o(Xn))}}),[a,s,o]),Sn((function(){return R(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])}),[])}];function cr({contextId:e,store:t,registry:n,customSensors:a,enableDefaultSensors:o}){const i=[...o?lr:[],...a||[]],s=(0,r.useState)((()=>function(){let e=null;function t(){e||A(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&A(!1);const n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()))[0],l=d((function(e,t){Bn(e)&&!Bn(t)&&s.tryAbandon()}),[s]);Sn((function(){let e=t.getState();return t.subscribe((()=>{const n=t.getState();l(e,n),e=n}))}),[s,t,l]),Sn((()=>s.tryAbandon),[s.tryAbandon]);const c=d((e=>sr({lockAPI:s,registry:n,store:t,draggableId:e})),[s,n,t]),p=d(((r,a,o)=>function({lockAPI:e,contextId:t,store:n,registry:r,draggableId:a,forceSensorStop:o,sourceEvent:i}){if(!sr({lockAPI:e,store:n,registry:r,draggableId:a}))return null;const s=r.draggable.getById(a),l=function(e,t){const n=`[${bn.contextId}="${e}"]`,r=Cn(document,n).find((e=>e.getAttribute(bn.id)===t));return r&&_n(r)?r:null}(t,s.descriptor.id);if(!l)return null;if(i&&!s.options.canDragInteractiveElements&&er(l,i))return null;const c=e.claim(o||P);let u="PRE_DRAG";function d(){return s.options.shouldRespectForcePress}function p(){return e.isActive(c)}const f=function(e,t){ir({expected:e,phase:u,isLockActive:p,shouldWarn:!0})&&n.dispatch(t())}.bind(null,"DRAGGING");function h(t){function r(){e.release(),u="COMPLETED"}function a(e,a={shouldBlockNextClick:!1}){if(t.cleanup(),a.shouldBlockNextClick){const e=R(window,[{eventName:"click",fn:or,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(e)}r(),n.dispatch(wt({reason:e}))}return"PRE_DRAG"!==u&&(r(),A(!1)),n.dispatch(st(t.liftActionArgs)),u="DRAGGING",{isActive:()=>ir({expected:"DRAGGING",phase:u,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:d,drop:e=>a("DROP",e),cancel:e=>a("CANCEL",e),...t.actions}}return{isActive:()=>ir({expected:"PRE_DRAG",phase:u,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:d,fluidLift:function(e){const t=C((e=>{f((()=>ft({client:e})))}));return{...h({liftActionArgs:{id:a,clientSelection:e,movementMode:"FLUID"},cleanup:()=>t.cancel(),actions:{move:t}}),move:t}},snapLift:function(){const e={moveUp:()=>f(ht),moveRight:()=>f(mt),moveDown:()=>f(gt),moveLeft:()=>f(bt)};return h({liftActionArgs:{id:a,clientSelection:tr(l),movementMode:"SNAP"},cleanup:P,actions:e})},abort:function(){ir({expected:"PRE_DRAG",phase:u,isLockActive:p,shouldWarn:!0})&&e.release()}}}({lockAPI:s,registry:n,contextId:e,store:t,draggableId:r,forceSensorStop:a||null,sourceEvent:o&&o.sourceEvent?o.sourceEvent:null})),[e,s,n,t]),f=d((t=>function(e,t){const n=function(e,t){const n=t.target;if(!((r=n)instanceof En(r).Element))return null;var r;const a=function(e){return`[${mn.contextId}="${e}"]`}(e),o=ar(n,a);return o&&_n(o)?o:null}(e,t);return n?n.getAttribute(mn.draggableId):null}(e,t)),[e]),h=d((e=>{const t=n.draggable.findById(e);return t?t.options:null}),[n.draggable]),g=d((function(){s.isClaimed()&&(s.tryAbandon(),"IDLE"!==t.getState().phase&&t.dispatch(yt()))}),[s,t]),m=d((()=>s.isClaimed()),[s]),b=u((()=>({canGetLock:c,tryGetLock:p,findClosestDraggableId:f,findOptionsForDraggable:h,tryReleaseLock:g,isLockClaimed:m})),[c,p,f,h,g,m]);for(let e=0;e<i.length;e++)i[e](b)}const ur=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};a().version.startsWith("16")||a().version.startsWith("17")?n():(0,o.flushSync)(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),dr=e=>({...en,...e.autoScrollerOptions,durationDampening:{...en.durationDampening,...e.autoScrollerOptions}});function pr(e){return e.current||A(!1),e.current}function fr(e){const{contextId:t,setCallbacks:n,sensors:o,nonce:i,dragHandleUsageInstructions:c}=e,p=(0,r.useRef)(null),f=Nn(e),h=d((()=>ur(f.current)),[f]),g=d((()=>dr(f.current)),[f]),m=function(e){const t=u((()=>kn(e)),[e]),n=(0,r.useRef)(null);return(0,r.useEffect)((function(){const e=document.createElement("div");return n.current=e,e.id=t,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),E(e.style,Tn),In().appendChild(e),function(){setTimeout((function(){const t=In();t.contains(e)&&t.removeChild(e),e===n.current&&(n.current=null)}))}}),[t]),d((e=>{const t=n.current;t&&(t.textContent=e)}),[])}(t),b=function({contextId:e,text:t}){const n=Mn("hidden-text",{separator:"-"}),a=u((()=>function({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}({contextId:e,uniqueId:n})),[n,e]);return(0,r.useEffect)((function(){const e=document.createElement("div");return e.id=a,e.textContent=t,e.style.display="none",In().appendChild(e),function(){const t=In();t.contains(e)&&t.removeChild(e)}}),[a,t]),a}({contextId:t,text:c}),y=function(e,t){const n=u((()=>xn(e)),[e]),a=(0,r.useRef)(null),o=(0,r.useRef)(null),i=d(D((e=>{const t=o.current;t||A(!1),t.textContent=e})),[]),s=d((e=>{const t=a.current;t||A(!1),t.textContent=e}),[]);Sn((()=>{(a.current||o.current)&&A(!1);const r=Dn(t),l=Dn(t);return a.current=r,o.current=l,r.setAttribute(`${gn}-always`,e),l.setAttribute(`${gn}-dynamic`,e),On().appendChild(r),On().appendChild(l),s(n.always),i(n.resting),()=>{const e=e=>{const t=e.current;t||A(!1),On().removeChild(t),e.current=null};e(a),e(o)}}),[t,s,i,n.always,n.resting,e]);const l=d((()=>i(n.dragging)),[i,n.dragging]),c=d((e=>{i("DROP"!==e?n.userCancel:n.dropAnimating)}),[i,n.dropAnimating,n.userCancel]),p=d((()=>{o.current&&i(n.resting)}),[i,n.resting]);return u((()=>({dragging:l,dropping:c,resting:p})),[l,c,p])}(t,i),v=d((e=>{pr(p).dispatch(e)}),[]),w=u((()=>(0,s.bindActionCreators)({publishWhileDragging:lt,updateDroppableScroll:ut,updateDroppableIsEnabled:dt,updateDroppableIsCombineEnabled:pt,collectionStarting:ct},v)),[v]),x=function(){const e=u(Pn,[]);return(0,r.useEffect)((()=>function(){a().version.startsWith("16")||a().version.startsWith("17")?requestAnimationFrame(e.clean):e.clean()}),[e]),e}(),S=u((()=>Kt(x,w)),[x,w]),O=u((()=>hn({scrollWindow:Zt,scrollDroppable:S.scrollDroppable,getAutoScrollerOptions:g,...(0,s.bindActionCreators)({move:ft},v)})),[S.scrollDroppable,v,g]),C=function(e){const t=(0,r.useRef)({}),n=(0,r.useRef)(null),a=(0,r.useRef)(null),o=(0,r.useRef)(!1),i=d((function(e,n){const r={id:e,focus:n};return t.current[e]=r,function(){const n=t.current;n[e]!==r&&delete n[e]}}),[]),s=d((function(t){const n=function(e,t){const n=`[${mn.contextId}="${e}"]`,r=Cn(document,n);if(!r.length)return null;const a=r.find((e=>e.getAttribute(mn.draggableId)===t));return a&&_n(a)?a:null}(e,t);n&&n!==document.activeElement&&n.focus()}),[e]),l=d((function(e,t){n.current===e&&(n.current=t)}),[]),c=d((function(){a.current||o.current&&(a.current=requestAnimationFrame((()=>{a.current=null;const e=n.current;e&&s(e)})))}),[s]),p=d((function(e){n.current=null;const t=document.activeElement;t&&t.getAttribute(mn.draggableId)===e&&(n.current=e)}),[]);return Sn((()=>(o.current=!0,function(){o.current=!1;const e=a.current;e&&cancelAnimationFrame(e)})),[]),u((()=>({register:i,tryRecordFocus:p,tryRestoreFocusRecorded:c,tryShiftRecord:l})),[i,p,c,l])}(t),_=u((()=>$t({announce:m,autoScroller:O,dimensionMarshal:S,focusMarshal:C,getResponders:h,styleMarshal:y})),[m,O,S,C,h,y]);p.current=_;const P=d((()=>{const e=pr(p);"IDLE"!==e.getState().phase&&e.dispatch(yt())}),[]),R=d((()=>{const e=pr(p).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging}),[]);n(u((()=>({isDragging:R,tryAbort:P})),[R,P]));const I=d((e=>Xt(pr(p).getState(),e)),[]),T=d((()=>$e(pr(p).getState())),[]),k=u((()=>({marshal:S,focus:C,contextId:t,canLift:I,isMovementAllowed:T,dragHandleUsageInstructionsId:b,registry:x})),[t,S,b,C,I,T,x]);return cr({contextId:t,store:_,registry:x,customSensors:o||null,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,r.useEffect)((()=>P),[P]),a().createElement(Ln.Provider,{value:k},a().createElement(l.Provider,{context:Rn,store:_},e.children))}let hr=0;var gr="useId"in a()?function(){return a().useId()}:function(){return u((()=>""+hr++),[])};function mr(e){const t=gr(),n=e.dragHandleUsageInstructions||F.dragHandleUsageInstructions;return a().createElement(j,null,(r=>a().createElement(fr,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children)))}const br=5e3,yr=4500,vr=(e,t)=>t?_t.drop(t.duration):e?_t.snap:_t.fluid,wr=(e,t)=>{if(e)return t?St:Ot};var xr=a().createContext(null);function Sr(e){const t=(0,r.useContext)(e);return t||A(!1),t}function Or(e){e.preventDefault()}var Dr=(e,t)=>e===t,Cr=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};function Er(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const _r={mapped:{type:"SECONDARY",offset:z,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Er(null)}},Pr={dropAnimationFinished:()=>({type:"DROP_ANIMATION_FINISHED",payload:null})},Rr=(0,l.connect)((()=>{const e=function(){const e=D(((e,t)=>({x:e,y:t}))),t=D(((e,t,n=null,r=null,a=null)=>({isDragging:!0,isClone:t,isDropAnimating:Boolean(a),dropAnimation:a,mode:e,draggingOver:n,combineWith:r,combineTargetFor:null}))),n=D(((e,n,r,a,o=null,i=null,s=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:o,combineWith:i,mode:n,offset:e,dimension:r,forceShouldAnimate:s,snapshot:t(n,a,o,i,null)}})));return(r,a)=>{if(Bn(r)){if(r.critical.draggable.id!==a.draggableId)return null;const t=r.current.client.offset,i=r.dimensions.draggables[a.draggableId],s=Ue(r.impact),l=(o=r.impact).at&&"COMBINE"===o.at.type?o.at.combine.draggableId:null,c=r.forceShouldAnimate;return n(e(t.x,t.y),r.movementMode,i,a.isClone,s,l,c)}var o;if("DROP_ANIMATING"===r.phase){const e=r.completed;if(e.result.draggableId!==a.draggableId)return null;const n=a.isClone,o=r.dimensions.draggables[a.draggableId],i=e.result,s=i.mode,l=Cr(i),c=(e=>e.combine?e.combine.draggableId:null)(i),u={duration:r.dropDuration,curve:xt,moveTo:r.newHomeClientOffset,opacity:c?St:null,scale:c?Dt:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:o,dropping:u,draggingOver:l,combineWith:c,mode:s,forceShouldAnimate:null,snapshot:t(s,n,l,c,u)}}}return null}}(),t=function(){const e=D(((e,t)=>({x:e,y:t}))),t=D(Er),n=D(((e,n=null,r)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}}))),r=e=>e?n(z,e,!0):null,a=(t,a,o,i)=>{const s=o.displaced.visible[t],l=Boolean(i.inVirtualList&&i.effected[t]),c=se(o),u=c&&c.draggableId===t?a:null;if(!s){if(!l)return r(u);if(o.displaced.invisible[t])return null;const a=$(i.displacedBy.point),s=e(a.x,a.y);return n(s,u,!0)}if(l)return r(u);const d=o.displacedBy.point,p=e(d.x,d.y);return n(p,u,s.shouldAnimate)};return(e,t)=>{if(Bn(e))return e.critical.draggable.id===t.draggableId?null:a(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){const n=e.completed;return n.result.draggableId===t.draggableId?null:a(t.draggableId,n.result.draggableId,n.impact,n.afterCritical)}return null}}();return(n,r)=>e(n,r)||t(n,r)||_r}),Pr,null,{context:Rn,areStatePropsEqual:Dr})((e=>{const t=(0,r.useRef)(null),n=d(((e=null)=>{t.current=e}),[]),i=d((()=>t.current),[]),{contextId:s,dragHandleUsageInstructionsId:l,registry:c}=Sr(Ln),{type:p,droppableId:f}=Sr(xr),h=u((()=>({id:e.draggableId,index:e.index,type:p,droppableId:f})),[e.draggableId,e.index,p,f]),{children:g,draggableId:m,isEnabled:b,shouldRespectForcePress:y,canDragInteractiveElements:x,isClone:S,mapped:O,dropAnimationFinished:D}=e;S||function(e){const t=Mn("draggable"),{descriptor:n,registry:a,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:l}=e,c=u((()=>({canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:l})),[i,l,s]),p=d((e=>{const t=o();return t||A(!1),function(e,t,n=z){const r=window.getComputedStyle(t),a=t.getBoundingClientRect(),o=w(a,r),i=v(o,n);return{descriptor:e,placeholder:{client:o,tagName:t.tagName.toLowerCase(),display:r.display},displaceBy:{x:o.marginBox.width,y:o.marginBox.height},client:o,page:i}}(n,t,e)}),[n,o]),f=u((()=>({uniqueId:t,descriptor:n,options:c,getDimension:p})),[n,p,c,t]),h=(0,r.useRef)(f),g=(0,r.useRef)(!0);Sn((()=>(a.draggable.register(h.current),()=>a.draggable.unregister(h.current))),[a.draggable]),Sn((()=>{if(g.current)return void(g.current=!1);const e=h.current;h.current=f,a.draggable.update(f,e)}),[f,a.draggable])}(u((()=>({descriptor:h,registry:c,getDraggableRef:i,canDragInteractiveElements:x,shouldRespectForcePress:y,isEnabled:b})),[h,c,i,x,y,b]));const C=u((()=>b?{tabIndex:0,role:"button","aria-describedby":l,"data-rfd-drag-handle-draggable-id":m,"data-rfd-drag-handle-context-id":s,draggable:!1,onDragStart:Or}:null),[s,l,m,b]),E=d((e=>{"DRAGGING"===O.type&&O.dropping&&"transform"===e.propertyName&&(a().version.startsWith("16")||a().version.startsWith("17")?D():(0,o.flushSync)(D))}),[D,O]),_=u((()=>{const e=function(e){return"DRAGGING"===e.type?function(e){const t=e.dimension.client,{offset:n,combineWith:r,dropping:a}=e,o=Boolean(r),i=(e=>null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode)(e),s=Boolean(a),l=s?It(n,o):Rt(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:vr(i,a),transform:l,opacity:wr(o,s),zIndex:s?yr:br,pointerEvents:"none"}}(e):{transform:Rt((t=e).offset),transition:t.shouldAnimateDisplacement?void 0:"none"};var t}(O),t="DRAGGING"===O.type&&O.dropping?E:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":s,"data-rfd-draggable-id":m,style:e,onTransitionEnd:t},dragHandleProps:C}}),[s,C,m,O,E,n]),P=u((()=>({draggableId:h.id,type:h.type,source:{index:h.index,droppableId:h.droppableId}})),[h.droppableId,h.id,h.index,h.type]);return a().createElement(a().Fragment,null,g(_,O.snapshot,P))}));var Ir=Rr;function Tr(e){return Sr(xr).isUsingCloneFor!==e.draggableId||e.isClone?a().createElement(Ir,e):null}function kr(e){const t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return a().createElement(Tr,E({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const Ar=e=>t=>e===t,jr=Ar("scroll"),Mr=Ar("auto"),Lr=(Ar("visible"),(e,t)=>t(e.overflowX)||t(e.overflowY)),Nr=e=>null==e||e===document.body||e===document.documentElement?null:(e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return Lr(n,jr)||Lr(n,Mr)})(e)?e:Nr(e.parentElement);var Br=e=>({x:e.scrollLeft,y:e.scrollTop});const Vr=e=>!!e&&("fixed"===window.getComputedStyle(e).position||Vr(e.parentElement));const Fr={passive:!1},zr={passive:!0};var Wr=e=>e.shouldPublishImmediately?Fr:zr;const Ur=e=>e&&e.env.closestScrollable||null;function Hr(e){const t=(0,r.useRef)(null),n=Sr(Ln),a=Mn("droppable"),{registry:o,marshal:i}=n,s=Nn(e),l=u((()=>({id:e.droppableId,type:e.type,mode:e.mode})),[e.droppableId,e.mode,e.type]),c=(0,r.useRef)(l),p=u((()=>D(((e,n)=>{t.current||A(!1);const r={x:e,y:n};i.updateDroppableScroll(l.id,r)}))),[l.id,i]),h=d((()=>{const e=t.current;return e&&e.env.closestScrollable?Br(e.env.closestScrollable):z}),[]),g=d((()=>{const e=h();p(e.x,e.y)}),[h,p]),b=u((()=>C(g)),[g]),y=d((()=>{const e=t.current,n=Ur(e);e&&n||A(!1),e.scrollOptions.shouldPublishImmediately?g():b()}),[b,g]),w=d(((e,r)=>{t.current&&A(!1);const a=s.current,o=a.getDroppableRef();o||A(!1);const i=(e=>({closestScrollable:Nr(e),isFixedOnPage:Vr(e)}))(o),c={ref:o,descriptor:l,env:i,scrollOptions:r};t.current=c;const u=(({ref:e,descriptor:t,env:n,windowScroll:r,direction:a,isDropDisabled:o,isCombineEnabled:i,shouldClipSubject:s})=>{const l=n.closestScrollable,c=((e,t)=>{const n=x(e);if(!t)return n;if(e!==t)return n;const r=n.paddingBox.top-t.scrollTop,a=n.paddingBox.left-t.scrollLeft,o=r+t.scrollHeight,i=a+t.scrollWidth,s=f({top:r,right:i,bottom:o,left:a},n.border);return m({borderBox:s,margin:n.margin,border:n.border,padding:n.padding})})(e,l),u=v(c,r),d=(()=>{if(!l)return null;const e=x(l),t={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:e,page:v(e,r),scroll:Br(l),scrollSize:t,shouldClipSubject:s}})(),p=(({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:a,client:o,page:i,closest:s})=>{const l=(()=>{if(!s)return null;const{scrollSize:e,client:t}=s,n=Gt({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:n,diff:{value:z,displacement:z}}}})(),c="vertical"===a?me:be;return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:o,page:i,frame:l,subject:J({page:i,withPlaceholder:null,axis:c,frame:l})}})({descriptor:t,isEnabled:!o,isCombineEnabled:i,isFixedOnPage:n.isFixedOnPage,direction:a,client:c,page:u,closest:d});return p})({ref:o,descriptor:l,env:i,windowScroll:e,direction:a.direction,isDropDisabled:a.isDropDisabled,isCombineEnabled:a.isCombineEnabled,shouldClipSubject:!a.ignoreContainerClipping}),d=i.closestScrollable;return d&&(d.setAttribute(vn.contextId,n.contextId),d.addEventListener("scroll",y,Wr(c.scrollOptions))),u}),[n.contextId,l,y,s]),S=d((()=>{const e=t.current,n=Ur(e);return e&&n||A(!1),Br(n)}),[]),O=d((()=>{const e=t.current;e||A(!1);const n=Ur(e);t.current=null,n&&(b.cancel(),n.removeAttribute(vn.contextId),n.removeEventListener("scroll",y,Wr(e.scrollOptions)))}),[y,b]),E=d((e=>{const n=t.current;n||A(!1);const r=Ur(n);r||A(!1),r.scrollTop+=e.y,r.scrollLeft+=e.x}),[]),_=u((()=>({getDimensionAndWatchScroll:w,getScrollWhileDragging:S,dragStopped:O,scroll:E})),[O,w,S,E]),P=u((()=>({uniqueId:a,descriptor:l,callbacks:_})),[_,l,a]);Sn((()=>(c.current=P.descriptor,o.droppable.register(P),()=>{t.current&&O(),o.droppable.unregister(P)})),[_,l,O,P,i,o.droppable]),Sn((()=>{t.current&&i.updateDroppableIsEnabled(c.current.id,!e.isDropDisabled)}),[e.isDropDisabled,i]),Sn((()=>{t.current&&i.updateDroppableIsCombineEnabled(c.current.id,e.isCombineEnabled)}),[e.isCombineEnabled,i])}function $r(){}const Gr={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var qr=a().memo((e=>{const t=(0,r.useRef)(null),n=d((()=>{t.current&&(clearTimeout(t.current),t.current=null)}),[]),{animate:o,onTransitionEnd:i,onClose:s,contextId:l}=e,[c,u]=(0,r.useState)("open"===e.animate);(0,r.useEffect)((()=>c?"open"!==o?(n(),u(!1),$r):t.current?$r:(t.current=setTimeout((()=>{t.current=null,u(!1)})),n):$r),[o,c,n]);const p=d((e=>{"height"===e.propertyName&&(i(),"close"===o&&s())}),[o,s,i]),f=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||"close"===n?Gr:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin})({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==n?_t.placeholder:null}})({isAnimatingOpenOnMount:c,animate:e.animate,placeholder:e.placeholder});return a().createElement(e.placeholder.tagName,{style:f,"data-rfd-placeholder-context-id":l,onTransitionEnd:p,ref:e.innerRef})}));class Qr extends a().PureComponent{constructor(...e){super(...e),this.state={isVisible:Boolean(this.props.on),data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{"close"===this.state.animate&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)}}const Yr={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||A(!1),document.body}},Kr=e=>{let t,n={...e};for(t in Yr)void 0===e[t]&&(n={...n,[t]:Yr[t]});return n},Xr=(e,t)=>e===t.droppable.type,Zr=(e,t)=>t.draggables[e.draggable.id];var Jr=(0,l.connect)((()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=D((e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}))),r=D(((r,a,o,i,s,l)=>{const c=s.descriptor.id;if(s.descriptor.droppableId===r){const e=l?{render:l,dragging:n(s.descriptor)}:null,t={isDraggingOver:o,draggingOverWith:o?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0};return{placeholder:s.placeholder,shouldAnimatePlaceholder:!1,snapshot:t,useClone:e}}if(!a)return t;if(!i)return e;const u={isDraggingOver:o,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:s.placeholder,shouldAnimatePlaceholder:!0,snapshot:u,useClone:null}}));return(n,a)=>{const o=Kr(a),i=o.droppableId,s=o.type,l=!o.isDropDisabled,c=o.renderClone;if(Bn(n)){const e=n.critical;if(!Xr(s,e))return t;const a=Zr(e,n.dimensions),o=Ue(n.impact)===i;return r(i,l,o,o,a,c)}if("DROP_ANIMATING"===n.phase){const e=n.completed;if(!Xr(s,e.critical))return t;const a=Zr(e.critical,n.dimensions);return r(i,l,Cr(e.result)===i,Ue(e.impact)===i,a,c)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){const r=n.completed;if(!Xr(s,r.critical))return t;const a=Ue(r.impact)===i,o=Boolean(r.impact.at&&"COMBINE"===r.impact.at.type),l=r.critical.droppable.id===i;return a?o?e:t:l?e:t}return t}}),{updateViewportMaxScroll:e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e})},((e,t,n)=>({...Kr(n),...e,...t})),{context:Rn,areStatePropsEqual:Dr})((e=>{const t=(0,r.useContext)(Ln);t||A(!1);const{contextId:n,isMovementAllowed:o}=t,s=(0,r.useRef)(null),l=(0,r.useRef)(null),{children:c,droppableId:p,type:f,mode:h,direction:g,ignoreContainerClipping:m,isDropDisabled:b,isCombineEnabled:y,snapshot:v,useClone:w,updateViewportMaxScroll:x,getContainerForClone:S}=e,O=d((()=>s.current),[]),D=d(((e=null)=>{s.current=e}),[]),C=(d((()=>l.current),[]),d(((e=null)=>{l.current=e}),[])),E=d((()=>{o()&&x({maxScroll:Qt()})}),[o,x]);Hr({droppableId:p,type:f,mode:h,direction:g,isDropDisabled:b,isCombineEnabled:y,ignoreContainerClipping:m,getDroppableRef:O});const _=u((()=>a().createElement(Qr,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},(({onClose:e,data:t,animate:r})=>a().createElement(qr,{placeholder:t,onClose:e,innerRef:C,animate:r,contextId:n,onTransitionEnd:E})))),[n,E,e.placeholder,e.shouldAnimatePlaceholder,C]),P=u((()=>({innerRef:D,placeholder:_,droppableProps:{"data-rfd-droppable-id":p,"data-rfd-droppable-context-id":n}})),[n,p,_,D]),R=w?w.dragging.draggableId:null,I=u((()=>({droppableId:p,type:f,isUsingCloneFor:R})),[p,R,f]);return a().createElement(xr.Provider,{value:I},c(P,v),function(){if(!w)return null;const{dragging:e,render:t}=w,n=a().createElement(Tr,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},((n,r)=>t(n,r,e)));return i().createPortal(n,S())}())}))},7928:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});const r=new Intl.Collator("en",{numeric:!0,sensitivity:"base"}).compare,a=1/0,o=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i="eexxaacctt",s=(e,t,n)=>e.replace("A-Z",t).replace("a-z",n),l={unicode:!1,alpha:null,interSplit:"[^A-Za-z\\d']+",intraSplit:"[a-z][A-Z]",intraBound:"[A-Za-z]\\d|\\d[A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:a,intraChars:"[a-z\\d']",intraIns:null,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,a],intraSub:null,intraTrn:null,intraDel:null,intraFilt:(e,t,n)=>!0,sort:(e,t,n)=>{let{idx:a,chars:o,terms:i,interLft2:s,interLft1:l,start:c,intraIns:u,interIns:d}=e;return a.map(((e,t)=>t)).sort(((e,n)=>o[n]-o[e]||u[e]-u[n]||i[n]+s[n]+.5*l[n]-(i[e]+s[e]+.5*l[e])||d[e]-d[n]||c[e]-c[n]||r(t[a[e]],t[a[n]])))}},c=(e,t)=>0==t?"":1==t?e+"??":t==a?e+"*?":e+`{0,${t}}?`,u="(?:\\b|_)";function d(e){e=Object.assign({},l,e);let{unicode:t,interLft:n,interRgt:r,intraMode:a,intraSlice:d,intraIns:p,intraSub:h,intraTrn:g,intraDel:m,intraContr:b,intraSplit:y,interSplit:v,intraBound:w,intraChars:x}=e;p??=a,h??=a,g??=a,m??=a;let S=e.letters??e.alpha;if(null!=S){let e=S.toLocaleUpperCase(),t=S.toLocaleLowerCase();v=s(v,e,t),y=s(y,e,t),w=s(w,e,t),x=s(x,e,t),b=s(b,e,t)}let O=t?"u":"";const D='".+?"',C=new RegExp(D,"gi"+O),E=new RegExp(`(?:\\s+|^)-(?:${x}+|${D})`,"gi"+O);let{intraRules:_}=e;null==_&&(_=e=>{let t=l.intraSlice,n=0,r=0,a=0,o=0;if(/[^\d]/.test(e)){let i=e.length;i<=4?i>=3&&(a=Math.min(g,1),4==i&&(n=Math.min(p,1))):(t=d,n=p,r=h,a=g,o=m)}return{intraSlice:t,intraIns:n,intraSub:r,intraTrn:a,intraDel:o}});let P=!!y,R=new RegExp(y,"g"+O),I=new RegExp(v,"g"+O),T=new RegExp("^"+v+"|"+v+"$","g"+O),k=new RegExp(b,"gi"+O);const A=e=>{let t=[];e=(e=e.replace(C,(e=>(t.push(e),i)))).replace(T,"").toLocaleLowerCase(),P&&(e=e.replace(R,(e=>e[0]+" "+e[1])));let n=0;return e.split(I).filter((e=>""!=e)).map((e=>e===i?t[n++]:e))},j=/[^\d]+|\d+/g,M=(t,i=0,s=!1)=>{let l=A(t);if(0==l.length)return[];let d,f=Array(l.length).fill("");if(l=l.map(((e,t)=>e.replace(k,(e=>(f[t]=e,""))))),1==a)d=l.map(((e,t)=>{if('"'===e[0])return o(e.slice(1,-1));let n="";for(let r of e.matchAll(j)){let e=r[0],{intraSlice:a,intraIns:o,intraSub:i,intraTrn:s,intraDel:l}=_(e);if(o+i+s+l==0)n+=e+f[t];else{let[r,u]=a,d=e.slice(0,r),p=e.slice(u),h=e.slice(r,u);1==o&&1==d.length&&d!=h[0]&&(d+="(?!"+d+")");let g=h.length,m=[e];if(i)for(let e=0;e<g;e++)m.push(d+h.slice(0,e)+x+h.slice(e+1)+p);if(s)for(let e=0;e<g-1;e++)h[e]!=h[e+1]&&m.push(d+h.slice(0,e)+h[e+1]+h[e]+h.slice(e+2)+p);if(l)for(let e=0;e<g;e++)m.push(d+h.slice(0,e+1)+"?"+h.slice(e+1)+p);if(o){let e=c(x,1);for(let t=0;t<g;t++)m.push(d+h.slice(0,t)+e+h.slice(t)+p)}n+="(?:"+m.join("|")+")"+f[t]}}return n}));else{let e=c(x,p);2==i&&p>0&&(e=")("+e+")("),d=l.map(((t,n)=>'"'===t[0]?o(t.slice(1,-1)):t.split("").map(((e,t,n)=>(1==p&&0==t&&n.length>1&&e!=n[t+1]&&(e+="(?!"+e+")"),e))).join(e)+f[n]))}let h=2==n?u:"",g=2==r?u:"",m=g+c(e.interChars,e.interIns)+h;return i>0?s?d=h+"("+d.join(")"+g+"|"+h+"(")+")"+g:(d="("+d.join(")("+m+")(")+")",d="(.??"+h+")"+d+"("+g+".*)"):(d=d.join(m),d=h+d+g),[new RegExp(d,"i"+O),l,f]},L=(e,t,n)=>{let[r]=M(t);if(null==r)return null;let a=[];if(null!=n)for(let t=0;t<n.length;t++){let o=n[t];r.test(e[o])&&a.push(o)}else for(let t=0;t<e.length;t++)r.test(e[t])&&a.push(t);return a};let N=!!w,B=new RegExp(v,O),V=new RegExp(w,O);const F=(t,a,o)=>{let[i,s,l]=M(o,1),[c]=M(o,2),u=s.length,d=t.length,p=Array(d).fill(0),f={idx:Array(d),start:p.slice(),chars:p.slice(),terms:p.slice(),interIns:p.slice(),intraIns:p.slice(),interLft2:p.slice(),interRgt2:p.slice(),interLft1:p.slice(),interRgt1:p.slice(),ranges:Array(d)},h=1==n||1==r,g=0;for(let o=0;o<t.length;o++){let d=a[t[o]],p=d.match(i),m=p.index+p[1].length,b=m,y=!1,v=0,w=0,x=0,S=0,D=0,C=0,E=0,_=0,P=[];for(let t=0,a=2;t<u;t++,a+=2){let o=p[a].toLocaleLowerCase(),i=s[t],c='"'==i[0]?i.slice(1,-1):i+l[t],f=c.length,g=o.length,R=o==c;if(!R&&p[a+1].length>=f){let e=p[a+1].toLocaleLowerCase().indexOf(c);e>-1&&(P.push(b,g,e,f),b+=z(p,a,e,f),o=c,g=f,R=!0,0==t&&(m=b))}if(h||R){let e=b-1,i=b+g,s=!1,l=!1;if(-1==e||B.test(d[e]))R&&v++,s=!0;else{if(2==n){y=!0;break}if(N&&V.test(d[e]+d[e+1]))R&&w++,s=!0;else if(1==n){let e=p[a+1],n=b+g;if(e.length>=f){let r,i=0,l=!1,u=new RegExp(c,"ig"+O);for(;r=u.exec(e);){i=r.index;let e=n+i,t=e-1;if(-1==t||B.test(d[t])){v++,l=!0;break}if(V.test(d[t]+d[e])){w++,l=!0;break}}l&&(s=!0,P.push(b,g,i,f),b+=z(p,a,i,f),o=c,g=f,R=!0,0==t&&(m=b))}if(!s){y=!0;break}}}if(i==d.length||B.test(d[i]))R&&x++,l=!0;else{if(2==r){y=!0;break}if(N&&V.test(d[i-1]+d[i]))R&&S++,l=!0;else if(1==r){y=!0;break}}R&&(D+=f,s&&l&&C++)}if(g>f&&(_+=g-f),t>0&&(E+=p[a-1].length),!e.intraFilt(c,o,b)){y=!0;break}t<u-1&&(b+=g+p[a+1].length)}if(!y){f.idx[g]=t[o],f.interLft2[g]=v,f.interLft1[g]=w,f.interRgt2[g]=x,f.interRgt1[g]=S,f.chars[g]=D,f.terms[g]=C,f.interIns[g]=E,f.intraIns[g]=_,f.start[g]=m;let e=d.match(c),n=e.index+e[1].length,r=P.length,a=r>0?0:1/0,i=r-4;for(let t=2;t<e.length;){let r=e[t].length;if(a<=i&&P[a]==n){let r=P[a+1],o=P[a+2],i=P[a+3],s=t,l="";for(let t=0;t<r;s++)l+=e[s],t+=e[s].length;e.splice(t,s-t,l),n+=z(e,t,o,i),a+=4}else n+=r,t++}n=e.index+e[1].length;let s=f.ranges[g]=[],l=n,u=n;for(let t=2;t<e.length;t++){let r=e[t].length;n+=r,t%2==0?u=n:r>0&&(s.push(l,u),l=u=n)}u>l&&s.push(l,u),g++}}if(g<t.length)for(let e in f)f[e]=f[e].slice(0,g);return f},z=(e,t,n,r)=>{let a=e[t]+e[t+1].slice(0,n);return e[t-1]+=a,e[t]=e[t+1].slice(n,n+r),e[t+1]=e[t+1].slice(n+r),a.length};return{search:(...t)=>((t,n,r,a=1e3,i)=>{r=r?!0===r?5:r:0;let s=null,l=null,c=[];n=n.replace(E,(e=>{let t=e.trim().slice(1);return'"'===t[0]&&(t=o(t.slice(1,-1))),c.push(t),""}));let u,d=A(n);if(c.length>0){if(u=new RegExp(c.join("|"),"i"+O),0==d.length){let e=[];for(let n=0;n<t.length;n++)u.test(t[n])||e.push(n);return[e,null,null]}}else if(0==d.length)return[null,null,null];if(r>0){let e=A(n);if(e.length>1){let n=e.slice().sort(((e,t)=>t.length-e.length));for(let e=0;e<n.length;e++){if(0==i?.length)return[[],null,null];i=L(t,n[e],i)}if(e.length>r)return[i,null,null];s=f(e).map((e=>e.join(" "))),l=[];let a=new Set;for(let e=0;e<s.length;e++)if(a.size<i.length){let n=i.filter((e=>!a.has(e))),r=L(t,s[e],n);for(let e=0;e<r.length;e++)a.add(r[e]);l.push(r)}else l.push([])}}null==s&&(s=[n],l=[i?.length>0?i:L(t,n)]);let p=null,h=null;if(c.length>0&&(l=l.map((e=>e.filter((e=>!u.test(t[e])))))),l.reduce(((e,t)=>e+t.length),0)<=a){p={},h=[];for(let n=0;n<l.length;n++){let r=l[n];if(null==r||0==r.length)continue;let a=s[n],o=F(r,t,a),i=e.sort(o,t,a);if(n>0)for(let e=0;e<i.length;e++)i[e]+=h.length;for(let e in o)p[e]=(p[e]??[]).concat(o[e]);h=h.concat(i)}}return[[].concat(...l),p,h]})(...t),split:A,filter:L,info:F,sort:e.sort}}const p=(()=>{let e={A:"ÁÀÃÂÄĄ",a:"áàãâäą",E:"ÉÈÊËĖ",e:"éèêëę",I:"ÍÌÎÏĮ",i:"íìîïį",O:"ÓÒÔÕÖ",o:"óòôõö",U:"ÚÙÛÜŪŲ",u:"úùûüūų",C:"ÇČĆ",c:"çčć",L:"Ł",l:"ł",N:"ÑŃ",n:"ñń",S:"ŠŚ",s:"šś",Z:"ŻŹ",z:"żź"},t=new Map,n="";for(let r in e)e[r].split("").forEach((e=>{n+=e,t.set(e,r)}));let r=new RegExp(`[${n}]`,"g"),a=e=>t.get(e);return e=>{if("string"==typeof e)return e.replace(r,a);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n].replace(r,a);return t}})();function f(e){let t,n,r=(e=e.slice()).length,a=[e.slice()],o=new Array(r).fill(0),i=1;for(;i<r;)o[i]<i?(t=i%2&&o[i],n=e[i],e[i]=e[t],e[t]=n,++o[i],i=1,a.push(e.slice())):(o[i]=0,++i);return a}const h=(e,t)=>t?`<mark>${e}</mark>`:e,g=(e,t)=>e+t;d.latinize=p,d.permute=e=>f([...Array(e.length).keys()]).sort(((e,t)=>{for(let n=0;n<e.length;n++)if(e[n]!=t[n])return e[n]-t[n];return 0})).map((t=>t.map((t=>e[t])))),d.highlight=function(e,t,n=h,r="",a=g){r=a(r,n(e.substring(0,t[0]),!1))??r;for(let o=0;o<t.length;o+=2){let i=t[o],s=t[o+1];r=a(r,n(e.substring(i,s),!0))??r,o<t.length-3&&(r=a(r,n(e.substring(t[o+1],t[o+2]),!1))??r)}return a(r,n(e.substring(t[t.length-1]),!1))??r}},1567:(e,t,n)=>{var r;!function(){"use strict";var a=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:a,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:a&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:a&&!!window.screen};void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},8486:(e,t,n)=>{"use strict";var r=n(9360),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?i:s[e.$$typeof]||a}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var a=f(n);a&&a!==h&&e(t,a,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=l(t),g=l(n),m=0;m<i.length;++m){var b=i[m];if(!(o[b]||r&&r[b]||g&&g[b]||s&&s[b])){var y=p(n,b);try{c(t,b,y)}catch(e){}}}}return t}},2332:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case o:case s:case i:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case m:case g:case l:return e;default:return t}}case a:return t}}}function S(e){return x(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=p,t.Fragment=o,t.Lazy=m,t.Memo=g,t.Portal=a,t.Profiler=s,t.StrictMode=i,t.Suspense=f,t.isAsyncMode=function(e){return S(e)||x(e)===u},t.isConcurrentMode=S,t.isContextConsumer=function(e){return x(e)===c},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===p},t.isFragment=function(e){return x(e)===o},t.isLazy=function(e){return x(e)===m},t.isMemo=function(e){return x(e)===g},t.isPortal=function(e){return x(e)===a},t.isProfiler=function(e){return x(e)===s},t.isStrictMode=function(e){return x(e)===i},t.isSuspense=function(e){return x(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===i||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===y||e.$$typeof===v||e.$$typeof===w||e.$$typeof===b)},t.typeOf=x},9360:(e,t,n)=>{"use strict";e.exports=n(2332)},7842:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",a=1,o=2,i=9007199254740991,s="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",p="[object Error]",f="[object Function]",h="[object GeneratorFunction]",g="[object Map]",m="[object Number]",b="[object Null]",y="[object Object]",v="[object Promise]",w="[object Proxy]",x="[object RegExp]",S="[object Set]",O="[object String]",D="[object Undefined]",C="[object WeakMap]",E="[object ArrayBuffer]",_="[object DataView]",P=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[s]=I[l]=I[E]=I[u]=I[_]=I[d]=I[p]=I[f]=I[g]=I[m]=I[y]=I[x]=I[S]=I[O]=I[C]=!1;var T="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,k="object"==typeof self&&self&&self.Object===Object&&self,A=T||k||Function("return this")(),j=t&&!t.nodeType&&t,M=j&&e&&!e.nodeType&&e,L=M&&M.exports===j,N=L&&T.process,B=function(){try{return N&&N.binding&&N.binding("util")}catch(e){}}(),V=B&&B.isTypedArray;function F(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function z(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var U,H,$,G=Array.prototype,q=Function.prototype,Q=Object.prototype,Y=A["__core-js_shared__"],K=q.toString,X=Q.hasOwnProperty,Z=(U=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"",J=Q.toString,ee=RegExp("^"+K.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),te=L?A.Buffer:void 0,ne=A.Symbol,re=A.Uint8Array,ae=Q.propertyIsEnumerable,oe=G.splice,ie=ne?ne.toStringTag:void 0,se=Object.getOwnPropertySymbols,le=te?te.isBuffer:void 0,ce=(H=Object.keys,$=Object,function(e){return H($(e))}),ue=Me(A,"DataView"),de=Me(A,"Map"),pe=Me(A,"Promise"),fe=Me(A,"Set"),he=Me(A,"WeakMap"),ge=Me(Object,"create"),me=Ve(ue),be=Ve(de),ye=Ve(pe),ve=Ve(fe),we=Ve(he),xe=ne?ne.prototype:void 0,Se=xe?xe.valueOf:void 0;function Oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function De(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ce(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ee(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ce;++t<n;)this.add(e[t])}function _e(e){var t=this.__data__=new De(e);this.size=t.size}function Pe(e,t){for(var n=e.length;n--;)if(Fe(e[n][0],t))return n;return-1}function Re(e){return null==e?void 0===e?D:b:ie&&ie in Object(e)?function(e){var t=X.call(e,ie),n=e[ie];try{e[ie]=void 0;var r=!0}catch(e){}var a=J.call(e);return r&&(t?e[ie]=n:delete e[ie]),a}(e):function(e){return J.call(e)}(e)}function Ie(e){return qe(e)&&Re(e)==s}function Te(e,t,n,r,i){return e===t||(null==e||null==t||!qe(e)&&!qe(t)?e!=e&&t!=t:function(e,t,n,r,i,c){var f=We(e),h=We(t),b=f?l:Ne(e),v=h?l:Ne(t),w=(b=b==s?y:b)==y,D=(v=v==s?y:v)==y,C=b==v;if(C&&Ue(e)){if(!Ue(t))return!1;f=!0,w=!1}if(C&&!w)return c||(c=new _e),f||Qe(e)?ke(e,t,n,r,i,c):function(e,t,n,r,i,s,l){switch(n){case _:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!s(new re(e),new re(t)));case u:case d:case m:return Fe(+e,+t);case p:return e.name==t.name&&e.message==t.message;case x:case O:return e==t+"";case g:var c=z;case S:var f=r&a;if(c||(c=W),e.size!=t.size&&!f)return!1;var h=l.get(e);if(h)return h==t;r|=o,l.set(e,t);var b=ke(c(e),c(t),r,i,s,l);return l.delete(e),b;case"[object Symbol]":if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,b,n,r,i,c);if(!(n&a)){var P=w&&X.call(e,"__wrapped__"),R=D&&X.call(t,"__wrapped__");if(P||R){var I=P?e.value():e,T=R?t.value():t;return c||(c=new _e),i(I,T,n,r,c)}}return!!C&&(c||(c=new _e),function(e,t,n,r,o,i){var s=n&a,l=Ae(e),c=l.length;if(c!=Ae(t).length&&!s)return!1;for(var u=c;u--;){var d=l[u];if(!(s?d in t:X.call(t,d)))return!1}var p=i.get(e);if(p&&i.get(t))return p==t;var f=!0;i.set(e,t),i.set(t,e);for(var h=s;++u<c;){var g=e[d=l[u]],m=t[d];if(r)var b=s?r(m,g,d,t,e,i):r(g,m,d,e,t,i);if(!(void 0===b?g===m||o(g,m,n,r,i):b)){f=!1;break}h||(h="constructor"==d)}if(f&&!h){var y=e.constructor,v=t.constructor;y==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof v&&v instanceof v||(f=!1)}return i.delete(e),i.delete(t),f}(e,t,n,r,i,c))}(e,t,n,r,Te,i))}function ke(e,t,n,r,i,s){var l=n&a,c=e.length,u=t.length;if(c!=u&&!(l&&u>c))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var p=-1,f=!0,h=n&o?new Ee:void 0;for(s.set(e,t),s.set(t,e);++p<c;){var g=e[p],m=t[p];if(r)var b=l?r(m,g,p,t,e,s):r(g,m,p,e,t,s);if(void 0!==b){if(b)continue;f=!1;break}if(h){if(!F(t,(function(e,t){if(a=t,!h.has(a)&&(g===e||i(g,e,n,r,s)))return h.push(t);var a}))){f=!1;break}}else if(g!==m&&!i(g,m,n,r,s)){f=!1;break}}return s.delete(e),s.delete(t),f}function Ae(e){return function(e,t,n){var r=t(e);return We(e)?r:function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}(r,n(e))}(e,Ye,Le)}function je(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function Me(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ge(e)||function(e){return!!Z&&Z in e}(e))&&(He(e)?ee:P).test(Ve(e))}(n)?n:void 0}Oe.prototype.clear=function(){this.__data__=ge?ge(null):{},this.size=0},Oe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Oe.prototype.get=function(e){var t=this.__data__;if(ge){var n=t[e];return n===r?void 0:n}return X.call(t,e)?t[e]:void 0},Oe.prototype.has=function(e){var t=this.__data__;return ge?void 0!==t[e]:X.call(t,e)},Oe.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ge&&void 0===t?r:t,this},De.prototype.clear=function(){this.__data__=[],this.size=0},De.prototype.delete=function(e){var t=this.__data__,n=Pe(t,e);return!(n<0||(n==t.length-1?t.pop():oe.call(t,n,1),--this.size,0))},De.prototype.get=function(e){var t=this.__data__,n=Pe(t,e);return n<0?void 0:t[n][1]},De.prototype.has=function(e){return Pe(this.__data__,e)>-1},De.prototype.set=function(e,t){var n=this.__data__,r=Pe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Ce.prototype.clear=function(){this.size=0,this.__data__={hash:new Oe,map:new(de||De),string:new Oe}},Ce.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},Ce.prototype.get=function(e){return je(this,e).get(e)},Ce.prototype.has=function(e){return je(this,e).has(e)},Ce.prototype.set=function(e,t){var n=je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Ee.prototype.add=Ee.prototype.push=function(e){return this.__data__.set(e,r),this},Ee.prototype.has=function(e){return this.__data__.has(e)},_e.prototype.clear=function(){this.__data__=new De,this.size=0},_e.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},_e.prototype.get=function(e){return this.__data__.get(e)},_e.prototype.has=function(e){return this.__data__.has(e)},_e.prototype.set=function(e,t){var n=this.__data__;if(n instanceof De){var r=n.__data__;if(!de||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ce(r)}return n.set(e,t),this.size=n.size,this};var Le=se?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var r=-1,a=null==t?0:t.length,o=0,i=[];++r<a;){var s=t[r];l=s,ae.call(e,l)&&(i[o++]=s)}var l;return i}(se(e)))}:function(){return[]},Ne=Re;function Be(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||R.test(e))&&e>-1&&e%1==0&&e<t}function Ve(e){if(null!=e){try{return K.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fe(e,t){return e===t||e!=e&&t!=t}(ue&&Ne(new ue(new ArrayBuffer(1)))!=_||de&&Ne(new de)!=g||pe&&Ne(pe.resolve())!=v||fe&&Ne(new fe)!=S||he&&Ne(new he)!=C)&&(Ne=function(e){var t=Re(e),n=t==y?e.constructor:void 0,r=n?Ve(n):"";if(r)switch(r){case me:return _;case be:return g;case ye:return v;case ve:return S;case we:return C}return t});var ze=Ie(function(){return arguments}())?Ie:function(e){return qe(e)&&X.call(e,"callee")&&!ae.call(e,"callee")},We=Array.isArray,Ue=le||function(){return!1};function He(e){if(!Ge(e))return!1;var t=Re(e);return t==f||t==h||t==c||t==w}function $e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Ge(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qe(e){return null!=e&&"object"==typeof e}var Qe=V?function(e){return function(t){return e(t)}}(V):function(e){return qe(e)&&$e(e.length)&&!!I[Re(e)]};function Ye(e){return null!=(t=e)&&$e(t.length)&&!He(t)?function(e,t){var n=We(e),r=!n&&ze(e),a=!n&&!r&&Ue(e),o=!n&&!r&&!a&&Qe(e),i=n||r||a||o,s=i?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!X.call(e,c)||i&&("length"==c||a&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Be(c,l))||s.push(c);return s}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Q))return ce(e);var t,n,r=[];for(var a in Object(e))X.call(e,a)&&"constructor"!=a&&r.push(a);return r}(e);var t}e.exports=function(e,t){return Te(e,t)}},362:(e,t,n)=>{"use strict";var r=n(6441);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},2688:(e,t,n)=>{e.exports=n(362)()},6441:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),t.default=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(5959)),a=p(n(2688)),o=p(n(8398)),i=p(n(8262)),s=n(2837),l=n(402),c=n(6732),u=p(n(1060)),d=p(n(7988));function p(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function g(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class m extends r.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,d.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),g(this,"onDragStart",((e,t)=>{if((0,d.default)("Draggable: onDragStart: %j",t),!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})})),g(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",t);const n=(0,l.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[a,o]=(0,l.getBoundPosition)(this,r.x,r.y);r.x=a,r.y=o,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)})),g(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,d.default)("Draggable: onDragStop: %j",t);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:o.default.findDOMNode(this)}render(){const{axis:e,bounds:t,children:n,defaultPosition:a,defaultClassName:o,defaultClassNameDragging:c,defaultClassNameDragged:d,position:p,positionOffset:f,scale:g,...m}=this.props;let b={},y=null;const v=!Boolean(p)||this.state.dragging,w=p||a,x={x:(0,l.canDragX)(this)&&v?this.state.x:w.x,y:(0,l.canDragY)(this)&&v?this.state.y:w.y};this.state.isElementSVG?y=(0,s.createSVGTransform)(x,f):b=(0,s.createCSSTransform)(x,f);const S=(0,i.default)(n.props.className||"",o,{[c]:this.state.dragging,[d]:this.state.dragged});return r.createElement(u.default,h({},m,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),r.cloneElement(r.Children.only(n),{className:S,style:{...n.props.style,...b},transform:y}))}}t.default=m,g(m,"displayName","Draggable"),g(m,"propTypes",{...u.default.propTypes,axis:a.default.oneOf(["both","x","y","none"]),bounds:a.default.oneOfType([a.default.shape({left:a.default.number,right:a.default.number,top:a.default.number,bottom:a.default.number}),a.default.string,a.default.oneOf([!1])]),defaultClassName:a.default.string,defaultClassNameDragging:a.default.string,defaultClassNameDragged:a.default.string,defaultPosition:a.default.shape({x:a.default.number,y:a.default.number}),positionOffset:a.default.shape({x:a.default.oneOfType([a.default.number,a.default.string]),y:a.default.oneOfType([a.default.number,a.default.string])}),position:a.default.shape({x:a.default.number,y:a.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),g(m,"defaultProps",{...u.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})},1060:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(5959)),a=u(n(2688)),o=u(n(8398)),i=n(2837),s=n(402),l=n(6732),c=u(n(7988));function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function p(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const f={start:"touchstart",move:"touchmove",stop:"touchend"},h={start:"mousedown",move:"mousemove",stop:"mouseup"};let g=h;class m extends r.Component{constructor(){super(...arguments),p(this,"dragging",!1),p(this,"lastX",NaN),p(this,"lastY",NaN),p(this,"touchIdentifier",null),p(this,"mounted",!1),p(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,i.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,i.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();const r=(0,i.getTouchIdentifier)(e);this.touchIdentifier=r;const a=(0,s.getControlPosition)(e,r,this);if(null==a)return;const{x:o,y:l}=a,u=(0,s.createCoreData)(this,o,l);(0,c.default)("DraggableCore: handleDragStart: %j",u),(0,c.default)("calling",this.props.onStart),!1!==this.props.onStart(e,u)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,i.addUserSelectStyles)(n),this.dragging=!0,this.lastX=o,this.lastY=l,(0,i.addEvent)(n,g.move,this.handleDrag),(0,i.addEvent)(n,g.stop,this.handleDragStop))})),p(this,"handleDrag",(e=>{const t=(0,s.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,s.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}const a=(0,s.createCoreData)(this,n,r);if((0,c.default)("DraggableCore: handleDrag: %j",a),!1!==this.props.onDrag(e,a)&&!1!==this.mounted)this.lastX=n,this.lastY=r;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}})),p(this,"handleDragStop",(e=>{if(!this.dragging)return;const t=(0,s.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,s.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}const a=(0,s.createCoreData)(this,n,r);if(!1===this.props.onStop(e,a)||!1===this.mounted)return!1;const o=this.findDOMNode();o&&this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(o.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,o&&((0,c.default)("DraggableCore: Removing handlers"),(0,i.removeEvent)(o.ownerDocument,g.move,this.handleDrag),(0,i.removeEvent)(o.ownerDocument,g.stop,this.handleDragStop))})),p(this,"onMouseDown",(e=>(g=h,this.handleDragStart(e)))),p(this,"onMouseUp",(e=>(g=h,this.handleDragStop(e)))),p(this,"onTouchStart",(e=>(g=f,this.handleDragStart(e)))),p(this,"onTouchEnd",(e=>(g=f,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,i.addEvent)(e,f.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,i.removeEvent)(t,h.move,this.handleDrag),(0,i.removeEvent)(t,f.move,this.handleDrag),(0,i.removeEvent)(t,h.stop,this.handleDragStop),(0,i.removeEvent)(t,f.stop,this.handleDragStop),(0,i.removeEvent)(e,f.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:o.default.findDOMNode(this)}render(){return r.cloneElement(r.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}t.default=m,p(m,"displayName","DraggableCore"),p(m,"propTypes",{allowAnyClick:a.default.bool,children:a.default.node.isRequired,disabled:a.default.bool,enableUserSelectHack:a.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:a.default.arrayOf(a.default.number),handle:a.default.string,cancel:a.default.string,nodeRef:a.default.object,onStart:a.default.func,onDrag:a.default.func,onStop:a.default.func,onMouseDown:a.default.func,scale:a.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),p(m,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},8230:(e,t,n)=>{"use strict";const{default:r,DraggableCore:a}=n(9111);e.exports=r,e.exports.default=r,e.exports.DraggableCore=a},2837:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=c,t.addEvent=function(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,a):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t)),e.body&&c(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){const n=l(e,t,"px");return{[(0,a.browserPrefixToKey)("transform",a.default)]:n}},t.createSVGTransform=function(e,t){return l(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,r.findInArray)(e.targetTouches,(e=>t===e.identifier))||e.changedTouches&&(0,r.findInArray)(e.changedTouches,(e=>t===e.identifier))},t.getTouchIdentifier=function(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:void 0},t.getTranslation=l,t.innerHeight=function(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingTop),t-=(0,r.int)(n.paddingBottom),t},t.innerWidth=function(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingLeft),t-=(0,r.int)(n.paddingRight),t},t.matchesSelector=s,t.matchesSelectorAndParentsTo=function(e,t,n){let r=e;do{if(s(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},t.offsetXYFromParent=function(e,t,n){const r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}},t.outerHeight=function(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,r.int)(n.borderTopWidth),t+=(0,r.int)(n.borderBottomWidth),t},t.outerWidth=function(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,r.int)(n.borderLeftWidth),t+=(0,r.int)(n.borderRightWidth),t},t.removeClassName=u,t.removeEvent=function(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,a):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(e)try{if(e.body&&u(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var r=n(6732),a=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(7350));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}let i="";function s(e,t){return i||(i=(0,r.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(t){return(0,r.isFunction)(e[t])}))),!!(0,r.isFunction)(e[i])&&e[i](t)}function l(e,t,n){let{x:r,y:a}=e,o="translate(".concat(r).concat(n,",").concat(a).concat(n,")");if(t){const e="".concat("string"==typeof t.x?t.x:t.x+n),r="".concat("string"==typeof t.y?t.y:t.y+n);o="translate(".concat(e,", ").concat(r,")")+o}return o}function c(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function u(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}},7350:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToKey=a,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0,t.getPrefix=r;const n=["Moz","Webkit","O","ms"];function r(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const r=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!r)return"";if(t in r)return"";for(let e=0;e<n.length;e++)if(a(t,n[e])in r)return n[e];return""}function a(e,t){return t?"".concat(t).concat(function(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)):e}t.default=r()},7988:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){}},402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},t.createCoreData=function(e,t,n){const a=!(0,r.isNum)(e.lastX),i=o(e);return a?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}},t.createDraggableData=function(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},t.getBoundPosition=function(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:i}=e.props;i="string"==typeof i?i:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(i);const s=o(e);if("string"==typeof i){const{ownerDocument:e}=s,t=e.defaultView;let n;if(n="parent"===i?s.parentNode:e.querySelector(i),!(n instanceof t.HTMLElement))throw new Error('Bounds selector "'+i+'" could not find an element.');const o=n,l=t.getComputedStyle(s),c=t.getComputedStyle(o);i={left:-s.offsetLeft+(0,r.int)(c.paddingLeft)+(0,r.int)(l.marginLeft),top:-s.offsetTop+(0,r.int)(c.paddingTop)+(0,r.int)(l.marginTop),right:(0,a.innerWidth)(o)-(0,a.outerWidth)(s)-s.offsetLeft+(0,r.int)(c.paddingRight)-(0,r.int)(l.marginRight),bottom:(0,a.innerHeight)(o)-(0,a.outerHeight)(s)-s.offsetTop+(0,r.int)(c.paddingBottom)-(0,r.int)(l.marginBottom)}}return(0,r.isNum)(i.right)&&(t=Math.min(t,i.right)),(0,r.isNum)(i.bottom)&&(n=Math.min(n,i.bottom)),(0,r.isNum)(i.left)&&(t=Math.max(t,i.left)),(0,r.isNum)(i.top)&&(n=Math.max(n,i.top)),[t,n]},t.getControlPosition=function(e,t,n){const r="number"==typeof t?(0,a.getTouch)(e,t):null;if("number"==typeof t&&!r)return null;const i=o(n),s=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,a.offsetXYFromParent)(r||e,s,n.props.scale)},t.snapToGrid=function(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]};var r=n(6732),a=n(2837);function o(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}},6732:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},t.int=function(e){return parseInt(e,10)},t.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},t.isNum=function(e){return"number"==typeof e&&!isNaN(e)}},8262:(e,t,n)=>{"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}function a(){for(var e,t,n=0,a="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}n.r(t),n.d(t,{clsx:()=>a,default:()=>o});const o=a},8100:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=p(n(5959)),o=p(n(2688)),i=n(8230),s=n(936),l=n(414),c=n(906),u=n(7222),d=p(n(7256));function p(e){return e&&e.__esModule?e:{default:e}}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(f,e);var t,n,o,u,p=(o=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y(o);if(u){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return b(e)}(this,e)});function f(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v(b(e=p.call.apply(p,[this].concat(n))),"state",{resizing:null,dragging:null,className:""}),v(b(e),"elementRef",a.default.createRef()),v(b(e),"onDragStart",(function(t,n){var r=n.node,a=e.props,o=a.onDragStart,i=a.transformScale;if(o){var s={top:0,left:0},l=r.offsetParent;if(l){var u=l.getBoundingClientRect(),d=r.getBoundingClientRect(),p=d.left/i,f=u.left/i,h=d.top/i,g=u.top/i;s.left=p-f+l.scrollLeft,s.top=h-g+l.scrollTop,e.setState({dragging:s});var m=(0,c.calcXY)(e.getPositionParams(),s.top,s.left,e.props.w,e.props.h),y=m.x,v=m.y;return o.call(b(e),e.props.i,y,v,{e:t,node:r,newPosition:s})}}})),v(b(e),"onDrag",(function(t,n){var r=n.node,a=n.deltaX,o=n.deltaY,i=e.props.onDrag;if(i){if(!e.state.dragging)throw new Error("onDrag called before onDragStart.");var s=e.state.dragging.top+o,l=e.state.dragging.left+a,u=e.props,d=u.isBounded,p=u.i,f=u.w,h=u.h,g=u.containerWidth,m=e.getPositionParams();if(d){var y=r.offsetParent;if(y){var v=e.props,w=v.margin,x=v.rowHeight,S=y.clientHeight-(0,c.calcGridItemWHPx)(h,x,w[1]);s=(0,c.clamp)(s,0,S);var O=(0,c.calcGridColWidth)(m),D=g-(0,c.calcGridItemWHPx)(f,O,w[0]);l=(0,c.clamp)(l,0,D)}}var C={top:s,left:l};e.setState({dragging:C});var E=(0,c.calcXY)(m,s,l,f,h),_=E.x,P=E.y;return i.call(b(e),p,_,P,{e:t,node:r,newPosition:C})}})),v(b(e),"onDragStop",(function(t,n){var r=n.node,a=e.props.onDragStop;if(a){if(!e.state.dragging)throw new Error("onDragEnd called before onDragStart.");var o=e.props,i=o.w,s=o.h,l=o.i,u=e.state.dragging,d=u.left,p=u.top,f={top:p,left:d};e.setState({dragging:null});var h=(0,c.calcXY)(e.getPositionParams(),p,d,i,s),g=h.x,m=h.y;return a.call(b(e),l,g,m,{e:t,node:r,newPosition:f})}})),v(b(e),"onResizeStop",(function(t,n){e.onResizeHandler(t,n,"onResizeStop")})),v(b(e),"onResizeStart",(function(t,n){e.onResizeHandler(t,n,"onResizeStart")})),v(b(e),"onResize",(function(t,n){e.onResizeHandler(t,n,"onResize")})),e}return t=f,n=[{key:"shouldComponentUpdate",value:function(e,t){if(this.props.children!==e.children)return!0;if(this.props.droppingPosition!==e.droppingPosition)return!0;var n=(0,c.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),r=(0,c.calcGridItemPosition)(this.getPositionParams(e),e.x,e.y,e.w,e.h,t);return!(0,l.fastPositionEqual)(n,r)||this.props.useCSSTransforms!==e.useCSSTransforms}},{key:"componentDidMount",value:function(){this.moveDroppingItem({})}},{key:"componentDidUpdate",value:function(e){this.moveDroppingItem(e)}},{key:"moveDroppingItem",value:function(e){var t=this.props.droppingPosition;if(t){var n=this.elementRef.current;if(n){var r=e.droppingPosition||{left:0,top:0},a=this.state.dragging,o=a&&t.left!==r.left||t.top!==r.top;if(a){if(o){var i=t.left-a.left,s=t.top-a.top;this.onDrag(t.e,{node:n,deltaX:i,deltaY:s})}}else this.onDragStart(t.e,{node:n,deltaX:t.left,deltaY:t.top})}}}},{key:"getPositionParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;return{cols:e.cols,containerPadding:e.containerPadding,containerWidth:e.containerWidth,margin:e.margin,maxRows:e.maxRows,rowHeight:e.rowHeight}}},{key:"createStyle",value:function(e){var t,n=this.props,r=n.usePercentages,a=n.containerWidth;return n.useCSSTransforms?t=(0,l.setTransform)(e):(t=(0,l.setTopLeft)(e),r&&(t.left=(0,l.perc)(e.left/a),t.width=(0,l.perc)(e.width/a))),t}},{key:"mixinDraggable",value:function(e,t){return a.default.createElement(i.DraggableCore,{disabled:!t,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},e)}},{key:"mixinResizable",value:function(e,t,n){var r=this.props,o=r.cols,i=r.x,l=r.minW,u=r.minH,d=r.maxW,p=r.maxH,f=r.transformScale,h=r.resizeHandles,g=r.resizeHandle,m=this.getPositionParams(),b=(0,c.calcGridItemPosition)(m,0,0,o-i,0).width,y=(0,c.calcGridItemPosition)(m,0,0,l,u),v=(0,c.calcGridItemPosition)(m,0,0,d,p),w=[y.width,y.height],x=[Math.min(v.width,b),Math.min(v.height,1/0)];return a.default.createElement(s.Resizable,{draggableOpts:{disabled:!n},className:n?void 0:"react-resizable-hide",width:t.width,height:t.height,minConstraints:w,maxConstraints:x,onResizeStop:this.onResizeStop,onResizeStart:this.onResizeStart,onResize:this.onResize,transformScale:f,resizeHandles:h,handle:g},e)}},{key:"onResizeHandler",value:function(e,t,n){var r=t.node,a=t.size,o=this.props[n];if(o){var i=this.props,s=i.cols,l=i.x,u=i.y,d=i.i,p=i.maxH,f=i.minH,h=this.props,g=h.minW,m=h.maxW,b=(0,c.calcWH)(this.getPositionParams(),a.width,a.height,l,u),y=b.w,v=b.h;g=Math.max(g,1),m=Math.min(m,s-l),y=(0,c.clamp)(y,g,m),v=(0,c.clamp)(v,f,p),this.setState({resizing:"onResizeStop"===n?null:a}),o.call(this,d,y,v,{e,node:r,size:a})}}},{key:"render",value:function(){var e=this.props,t=e.x,n=e.y,r=e.w,o=e.h,i=e.isDraggable,s=e.isResizable,l=e.droppingPosition,u=e.useCSSTransforms,p=(0,c.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),f=a.default.Children.only(this.props.children),g=a.default.cloneElement(f,{ref:this.elementRef,className:(0,d.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:Boolean(this.state.resizing),"react-draggable":i,"react-draggable-dragging":Boolean(this.state.dragging),dropping:Boolean(l),cssTransforms:u}),style:h(h(h({},this.props.style),f.props.style),this.createStyle(p))});return g=this.mixinResizable(g,p,s),this.mixinDraggable(g,i)}}],n&&g(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),f}(a.default.Component);t.default=w,v(w,"propTypes",{children:o.default.element,cols:o.default.number.isRequired,containerWidth:o.default.number.isRequired,rowHeight:o.default.number.isRequired,margin:o.default.array.isRequired,maxRows:o.default.number.isRequired,containerPadding:o.default.array.isRequired,x:o.default.number.isRequired,y:o.default.number.isRequired,w:o.default.number.isRequired,h:o.default.number.isRequired,minW:function(e,t){var n=e[t];return"number"!=typeof n?new Error("minWidth not Number"):n>e.w||n>e.maxW?new Error("minWidth larger than item width/maxWidth"):void 0},maxW:function(e,t){var n=e[t];return"number"!=typeof n?new Error("maxWidth not Number"):n<e.w||n<e.minW?new Error("maxWidth smaller than item width/minWidth"):void 0},minH:function(e,t){var n=e[t];return"number"!=typeof n?new Error("minHeight not Number"):n>e.h||n>e.maxH?new Error("minHeight larger than item height/maxHeight"):void 0},maxH:function(e,t){var n=e[t];return"number"!=typeof n?new Error("maxHeight not Number"):n<e.h||n<e.minH?new Error("maxHeight smaller than item height/minHeight"):void 0},i:o.default.string.isRequired,resizeHandles:u.resizeHandleAxesType,resizeHandle:u.resizeHandleType,onDragStop:o.default.func,onDragStart:o.default.func,onDrag:o.default.func,onResizeStop:o.default.func,onResizeStart:o.default.func,onResize:o.default.func,isDraggable:o.default.bool.isRequired,isResizable:o.default.bool.isRequired,isBounded:o.default.bool.isRequired,static:o.default.bool,useCSSTransforms:o.default.bool.isRequired,transformScale:o.default.number,className:o.default.string,handle:o.default.string,cancel:o.default.string,droppingPosition:o.default.shape({e:o.default.object.isRequired,left:o.default.number.isRequired,top:o.default.number.isRequired})}),v(w,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1})},9482:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(5959)),o=d(n(7842)),i=d(n(7256)),s=n(414),l=n(906),c=d(n(8100)),u=d(n(7222));function d(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S="react-grid-layout",O=!1;try{O=/firefox/i.test(navigator.userAgent)}catch(e){}var D=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(D,e);var t,n,u,d,p,f=(d=D,p=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=w(d);if(p){var n=w(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}(this,e)});function D(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,D);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return x(v(e=f.call.apply(f,[this].concat(n))),"state",{activeDrag:null,layout:(0,s.synchronizeLayoutWithChildren)(e.props.layout,e.props.children,e.props.cols,(0,s.compactType)(e.props),e.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,droppingDOMNode:null,children:[]}),x(v(e),"dragEnterCounter",0),x(v(e),"onDragStart",(function(t,n,r,a){var o=a.e,i=a.node,l=e.state.layout,c=(0,s.getLayoutItem)(l,t);if(c)return e.setState({oldDragItem:(0,s.cloneLayoutItem)(c),oldLayout:l}),e.props.onDragStart(l,c,c,null,o,i)})),x(v(e),"onDrag",(function(t,n,r,a){var o=a.e,i=a.node,l=e.state.oldDragItem,c=e.state.layout,u=e.props,d=u.cols,p=u.allowOverlap,f=u.preventCollision,h=(0,s.getLayoutItem)(c,t);if(h){var g={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t};c=(0,s.moveElement)(c,h,n,r,!0,f,(0,s.compactType)(e.props),d,p),e.props.onDrag(c,l,h,g,o,i),e.setState({layout:p?c:(0,s.compact)(c,(0,s.compactType)(e.props),d),activeDrag:g})}})),x(v(e),"onDragStop",(function(t,n,r,a){var o=a.e,i=a.node;if(e.state.activeDrag){var l=e.state.oldDragItem,c=e.state.layout,u=e.props,d=u.cols,p=u.preventCollision,f=u.allowOverlap,h=(0,s.getLayoutItem)(c,t);if(h){c=(0,s.moveElement)(c,h,n,r,!0,p,(0,s.compactType)(e.props),d,f),e.props.onDragStop(c,l,h,null,o,i);var g=f?c:(0,s.compact)(c,(0,s.compactType)(e.props),d),m=e.state.oldLayout;e.setState({activeDrag:null,layout:g,oldDragItem:null,oldLayout:null}),e.onLayoutMaybeChanged(g,m)}}})),x(v(e),"onResizeStart",(function(t,n,r,a){var o=a.e,i=a.node,l=e.state.layout,c=(0,s.getLayoutItem)(l,t);c&&(e.setState({oldResizeItem:(0,s.cloneLayoutItem)(c),oldLayout:e.state.layout}),e.props.onResizeStart(l,c,c,null,o,i))})),x(v(e),"onResize",(function(t,n,r,a){var o=a.e,i=a.node,l=e.state,c=l.layout,u=l.oldResizeItem,d=e.props,p=d.cols,f=d.preventCollision,m=d.allowOverlap,b=(0,s.withLayoutItem)(c,t,(function(e){var t;if(f&&!m){var a=(0,s.getAllCollisions)(c,h(h({},e),{},{w:n,h:r})).filter((function(t){return t.i!==e.i}));if(t=a.length>0){var o=1/0,i=1/0;a.forEach((function(t){t.x>e.x&&(o=Math.min(o,t.x)),t.y>e.y&&(i=Math.min(i,t.y))})),Number.isFinite(o)&&(e.w=o-e.x),Number.isFinite(i)&&(e.h=i-e.y)}}return t||(e.w=n,e.h=r),e})),y=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(b,2),v=y[0],w=y[1];if(w){var x={w:w.w,h:w.h,x:w.x,y:w.y,static:!0,i:t};e.props.onResize(v,u,w,x,o,i),e.setState({layout:m?v:(0,s.compact)(v,(0,s.compactType)(e.props),p),activeDrag:x})}})),x(v(e),"onResizeStop",(function(t,n,r,a){var o=a.e,i=a.node,l=e.state,c=l.layout,u=l.oldResizeItem,d=e.props,p=d.cols,f=d.allowOverlap,h=(0,s.getLayoutItem)(c,t);e.props.onResizeStop(c,u,h,null,o,i);var g=f?c:(0,s.compact)(c,(0,s.compactType)(e.props),p),m=e.state.oldLayout;e.setState({activeDrag:null,layout:g,oldResizeItem:null,oldLayout:null}),e.onLayoutMaybeChanged(g,m)})),x(v(e),"onDragOver",(function(t){var n;if(t.preventDefault(),t.stopPropagation(),O&&(null===(n=t.nativeEvent.target)||void 0===n||!n.classList.contains(S)))return!1;var r=e.props,o=r.droppingItem,i=r.onDropDragOver,s=r.margin,c=r.cols,u=r.rowHeight,d=r.maxRows,p=r.width,f=r.containerPadding,b=r.transformScale,y=null==i?void 0:i(t);if(!1===y)return e.state.droppingDOMNode&&e.removeDroppingPlaceholder(),!1;var v,w=h(h({},o),y),x=e.state.layout,D=t.nativeEvent,C=D.layerX,E=D.layerY,_={left:C/b,top:E/b,e:t};if(e.state.droppingDOMNode){if(e.state.droppingPosition){var P=e.state.droppingPosition,R=P.left,I=P.top;(R!=C||I!=E)&&e.setState({droppingPosition:_})}}else{var T={cols:c,margin:s,maxRows:d,rowHeight:u,containerWidth:p,containerPadding:f||s},k=(0,l.calcXY)(T,E,C,w.w,w.h);e.setState({droppingDOMNode:a.createElement("div",{key:w.i}),droppingPosition:_,layout:[].concat((v=x,function(e){if(Array.isArray(e))return m(e)}(v)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(v)||g(v)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),[h(h({},w),{},{x:k.x,y:k.y,static:!1,isDraggable:!0})])})}})),x(v(e),"removeDroppingPlaceholder",(function(){var t=e.props,n=t.droppingItem,r=t.cols,a=e.state.layout,o=(0,s.compact)(a.filter((function(e){return e.i!==n.i})),(0,s.compactType)(e.props),r);e.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})})),x(v(e),"onDragLeave",(function(t){t.preventDefault(),t.stopPropagation(),e.dragEnterCounter--,0===e.dragEnterCounter&&e.removeDroppingPlaceholder()})),x(v(e),"onDragEnter",(function(t){t.preventDefault(),t.stopPropagation(),e.dragEnterCounter++})),x(v(e),"onDrop",(function(t){t.preventDefault(),t.stopPropagation();var n=e.props.droppingItem,r=e.state.layout,a=r.find((function(e){return e.i===n.i}));e.dragEnterCounter=0,e.removeDroppingPlaceholder(),e.props.onDrop(r,a,t)})),e}return t=D,u=[{key:"getDerivedStateFromProps",value:function(e,t){var n;return t.activeDrag?null:((0,o.default)(e.layout,t.propsLayout)&&e.compactType===t.compactType?(0,s.childrenEqual)(e.children,t.children)||(n=t.layout):n=e.layout,n?{layout:(0,s.synchronizeLayoutWithChildren)(n,e.children,e.cols,(0,s.compactType)(e),e.allowOverlap),compactType:e.compactType,children:e.children,propsLayout:e.layout}:null)}}],(n=[{key:"componentDidMount",value:function(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.children!==e.children||!(0,s.fastRGLPropsEqual)(this.props,e,o.default)||this.state.activeDrag!==t.activeDrag||this.state.mounted!==t.mounted||this.state.droppingPosition!==t.droppingPosition}},{key:"componentDidUpdate",value:function(e,t){if(!this.state.activeDrag){var n=this.state.layout,r=t.layout;this.onLayoutMaybeChanged(n,r)}}},{key:"containerHeight",value:function(){if(this.props.autoSize){var e=(0,s.bottom)(this.state.layout),t=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return e*this.props.rowHeight+(e-1)*this.props.margin[1]+2*t+"px"}}},{key:"onLayoutMaybeChanged",value:function(e,t){t||(t=this.state.layout),(0,o.default)(t,e)||this.props.onLayoutChange(e)}},{key:"placeholder",value:function(){var e=this.state.activeDrag;if(!e)return null;var t=this.props,n=t.width,r=t.cols,o=t.margin,i=t.containerPadding,s=t.rowHeight,l=t.maxRows,u=t.useCSSTransforms,d=t.transformScale;return a.createElement(c.default,{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,className:"react-grid-placeholder",containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:l,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:u,transformScale:d},a.createElement("div",null))}},{key:"processGridItem",value:function(e,t){if(e&&e.key){var n=(0,s.getLayoutItem)(this.state.layout,String(e.key));if(!n)return null;var r=this.props,o=r.width,i=r.cols,l=r.margin,u=r.containerPadding,d=r.rowHeight,p=r.maxRows,f=r.isDraggable,h=r.isResizable,g=r.isBounded,m=r.useCSSTransforms,b=r.transformScale,y=r.draggableCancel,v=r.draggableHandle,w=r.resizeHandles,x=r.resizeHandle,S=this.state,O=S.mounted,D=S.droppingPosition,C="boolean"==typeof n.isDraggable?n.isDraggable:!n.static&&f,E="boolean"==typeof n.isResizable?n.isResizable:!n.static&&h,_=n.resizeHandles||w,P=C&&g&&!1!==n.isBounded;return a.createElement(c.default,{containerWidth:o,cols:i,margin:l,containerPadding:u||l,maxRows:p,rowHeight:d,cancel:y,handle:v,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:E,isBounded:P,useCSSTransforms:m&&O,usePercentages:!O,transformScale:b,w:n.w,h:n.h,x:n.x,y:n.y,i:n.i,minH:n.minH,minW:n.minW,maxH:n.maxH,maxW:n.maxW,static:n.static,droppingPosition:t?D:void 0,resizeHandles:_,resizeHandle:x},e)}}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.style,o=t.isDroppable,l=t.innerRef,c=(0,i.default)(S,n),u=h({height:this.containerHeight()},r);return a.createElement("div",{ref:l,className:c,style:u,onDrop:o?this.onDrop:s.noop,onDragLeave:o?this.onDragLeave:s.noop,onDragEnter:o?this.onDragEnter:s.noop,onDragOver:o?this.onDragOver:s.noop},a.Children.map(this.props.children,(function(t){return e.processGridItem(t)})),o&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}])&&b(t.prototype,n),u&&b(t,u),Object.defineProperty(t,"prototype",{writable:!1}),D}(a.Component);t.default=D,x(D,"displayName","ReactGridLayout"),x(D,"propTypes",u.default),x(D,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:s.noop,onDragStart:s.noop,onDrag:s.noop,onDragStop:s.noop,onResizeStart:s.noop,onResize:s.noop,onResizeStop:s.noop,onDrop:s.noop,onDropDragOver:s.noop})},7222:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeHandleType=t.resizeHandleAxesType=t.default=void 0;var r=o(n(2688)),a=o(n(5959));function o(e){return e&&e.__esModule?e:{default:e}}var i=r.default.arrayOf(r.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));t.resizeHandleAxesType=i;var s=r.default.oneOfType([r.default.node,r.default.func]);t.resizeHandleType=s;var l={className:r.default.string,style:r.default.object,width:r.default.number,autoSize:r.default.bool,cols:r.default.number,draggableCancel:r.default.string,draggableHandle:r.default.string,verticalCompact:function(e){e.verticalCompact},compactType:r.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;void 0!==t&&n(414).validateLayout(t,"layout")},margin:r.default.arrayOf(r.default.number),containerPadding:r.default.arrayOf(r.default.number),rowHeight:r.default.number,maxRows:r.default.number,isBounded:r.default.bool,isDraggable:r.default.bool,isResizable:r.default.bool,allowOverlap:r.default.bool,preventCollision:r.default.bool,useCSSTransforms:r.default.bool,transformScale:r.default.number,isDroppable:r.default.bool,resizeHandles:i,resizeHandle:s,onLayoutChange:r.default.func,onDragStart:r.default.func,onDrag:r.default.func,onDragStop:r.default.func,onResizeStart:r.default.func,onResize:r.default.func,onResizeStop:r.default.func,onDrop:r.default.func,droppingItem:r.default.shape({i:r.default.string.isRequired,w:r.default.number.isRequired,h:r.default.number.isRequired}),children:function(e,t){var n=e[t],r={};a.default.Children.forEach(n,(function(e){if(null!=(null==e?void 0:e.key)){if(r[e.key])throw new Error('Duplicate child key "'+e.key+'" found! This will cause problems in ReactGridLayout.');r[e.key]=!0}}))},innerRef:r.default.any};t.default=l},4636:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}t.default=void 0;var a=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(5959)),o=d(n(2688)),i=d(n(7842)),s=n(414),l=n(544),c=d(n(9482)),u=["breakpoint","breakpoints","cols","layouts","margin","containerPadding","onBreakpointChange","onLayoutChange","onWidthChange"];function d(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=function(e){return Object.prototype.toString.call(e)};function S(e,t){return null==e?null:Array.isArray(e)?e:e[t]}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(x,e);var t,n,o,d,p,h=(d=x,p=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=v(d);if(p){var n=v(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}(this,e)});function x(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,x);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return w(y(e=h.call.apply(h,[this].concat(n))),"state",e.generateInitialState()),w(y(e),"onLayoutChange",(function(t){e.props.onLayoutChange(t,g(g({},e.props.layouts),{},w({},e.state.breakpoint,t)))})),e}return t=x,o=[{key:"getDerivedStateFromProps",value:function(e,t){if(!(0,i.default)(e.layouts,t.layouts)){var n=t.breakpoint,r=t.cols;return{layout:(0,l.findOrGenerateResponsiveLayout)(e.layouts,e.breakpoints,n,n,r,e.compactType),layouts:e.layouts}}return null}}],(n=[{key:"generateInitialState",value:function(){var e=this.props,t=e.width,n=e.breakpoints,r=e.layouts,a=e.cols,o=(0,l.getBreakpointFromWidth)(n,t),i=(0,l.getColsFromBreakpoint)(o,a),s=!1===this.props.verticalCompact?null:this.props.compactType;return{layout:(0,l.findOrGenerateResponsiveLayout)(r,n,o,o,i,s),breakpoint:o,cols:i}}},{key:"componentDidUpdate",value:function(e){this.props.width==e.width&&this.props.breakpoint===e.breakpoint&&(0,i.default)(this.props.breakpoints,e.breakpoints)&&(0,i.default)(this.props.cols,e.cols)||this.onWidthChange(e)}},{key:"onWidthChange",value:function(e){var t=this.props,n=t.breakpoints,r=t.cols,a=t.layouts,o=t.compactType,i=this.props.breakpoint||(0,l.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),c=this.state.breakpoint,u=(0,l.getColsFromBreakpoint)(i,r),d=g({},a);if(c!==i||e.breakpoints!==n||e.cols!==r){c in d||(d[c]=(0,s.cloneLayout)(this.state.layout));var p=(0,l.findOrGenerateResponsiveLayout)(d,n,i,c,u,o);p=(0,s.synchronizeLayoutWithChildren)(p,this.props.children,u,o,this.props.allowOverlap),d[i]=p,this.props.onLayoutChange(p,d),this.props.onBreakpointChange(i,u),this.setState({breakpoint:i,layout:p,cols:u})}var f=S(this.props.margin,i),h=S(this.props.containerPadding,i);this.props.onWidthChange(this.props.width,f,u,h)}},{key:"render",value:function(){var e=this.props,t=(e.breakpoint,e.breakpoints,e.cols,e.layouts,e.margin),n=e.containerPadding,r=(e.onBreakpointChange,e.onLayoutChange,e.onWidthChange,function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,u));return a.createElement(c.default,f({},r,{margin:S(t,this.state.breakpoint),containerPadding:S(n,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}])&&m(t.prototype,n),o&&m(t,o),Object.defineProperty(t,"prototype",{writable:!1}),x}(a.Component);t.default=O,w(O,"propTypes",{breakpoint:o.default.string,breakpoints:o.default.object,allowOverlap:o.default.bool,cols:o.default.object,margin:o.default.oneOfType([o.default.array,o.default.object]),containerPadding:o.default.oneOfType([o.default.array,o.default.object]),layouts:function(e,t){if("[object Object]"!==x(e[t]))throw new Error("Layout property must be an object. Received: "+x(e[t]));Object.keys(e[t]).forEach((function(t){if(!(t in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,s.validateLayout)(e.layouts[t],"layouts."+t)}))},width:o.default.number.isRequired,onBreakpointChange:o.default.func,onLayoutChange:o.default.func,onWidthChange:o.default.func}),w(O,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:s.noop,onLayoutChange:s.noop,onWidthChange:s.noop})},906:(e,t)=>{"use strict";function n(e){var t=e.margin,n=e.containerPadding,r=e.containerWidth,a=e.cols;return(r-t[0]*(a-1)-2*n[0])/a}function r(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function a(e,t,n){return Math.max(Math.min(e,n),t)}Object.defineProperty(t,"__esModule",{value:!0}),t.calcGridColWidth=n,t.calcGridItemPosition=function(e,t,a,o,i,s){var l=e.margin,c=e.containerPadding,u=e.rowHeight,d=n(e),p={};return s&&s.resizing?(p.width=Math.round(s.resizing.width),p.height=Math.round(s.resizing.height)):(p.width=r(o,d,l[0]),p.height=r(i,u,l[1])),s&&s.dragging?(p.top=Math.round(s.dragging.top),p.left=Math.round(s.dragging.left)):(p.top=Math.round((u+l[1])*a+c[1]),p.left=Math.round((d+l[0])*t+c[0])),p},t.calcGridItemWHPx=r,t.calcWH=function(e,t,r,o,i){var s=e.margin,l=e.maxRows,c=e.cols,u=e.rowHeight,d=n(e),p=Math.round((t+s[0])/(d+s[0])),f=Math.round((r+s[1])/(u+s[1]));return{w:p=a(p,0,c-o),h:f=a(f,0,l-i)}},t.calcXY=function(e,t,r,o,i){var s=e.margin,l=e.cols,c=e.rowHeight,u=e.maxRows,d=n(e),p=Math.round((r-s[0])/(d+s[0])),f=Math.round((t-s[1])/(c+s[1]));return{x:p=a(p,0,l-o),y:f=a(f,0,u-i)}},t.clamp=a},6805:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}t.default=function(e){var t;return t=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(y,t);var n,o,l,c,b=(n=y,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(n);if(o){var a=h(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}(this,e)});function y(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return g(f(e=b.call.apply(b,[this].concat(n))),"state",{width:1280}),g(f(e),"elementRef",a.createRef()),g(f(e),"mounted",!1),g(f(e),"onWindowResize",(function(){if(e.mounted){var t=e.elementRef.current;t instanceof HTMLElement&&t.offsetWidth&&e.setState({width:t.offsetWidth})}})),e}return l=y,(c=[{key:"componentDidMount",value:function(){this.mounted=!0,window.addEventListener("resize",this.onWindowResize),this.onWindowResize()}},{key:"componentWillUnmount",value:function(){this.mounted=!1,window.removeEventListener("resize",this.onWindowResize)}},{key:"render",value:function(){var t=this.props,n=t.measureBeforeMount,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,s);return n&&!this.mounted?a.createElement("div",{className:(0,i.default)(this.props.className,m),style:this.props.style,ref:this.elementRef}):a.createElement(e,u({innerRef:this.elementRef},r,this.state))}}])&&d(l.prototype,c),Object.defineProperty(l,"prototype",{writable:!1}),y}(a.Component),g(t,"defaultProps",{measureBeforeMount:!1}),g(t,"propTypes",{measureBeforeMount:o.default.bool}),t};var a=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(5959)),o=l(n(2688)),i=l(n(7256)),s=["measureBeforeMount"];function l(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m="react-grid-layout"},7434:e=>{e.exports=function(e,t,n){return e===t||e.className===t.className&&n(e.style,t.style)&&e.width===t.width&&e.autoSize===t.autoSize&&e.cols===t.cols&&e.draggableCancel===t.draggableCancel&&e.draggableHandle===t.draggableHandle&&n(e.verticalCompact,t.verticalCompact)&&n(e.compactType,t.compactType)&&n(e.layout,t.layout)&&n(e.margin,t.margin)&&n(e.containerPadding,t.containerPadding)&&e.rowHeight===t.rowHeight&&e.maxRows===t.maxRows&&e.isBounded===t.isBounded&&e.isDraggable===t.isDraggable&&e.isResizable===t.isResizable&&e.allowOverlap===t.allowOverlap&&e.preventCollision===t.preventCollision&&e.useCSSTransforms===t.useCSSTransforms&&e.transformScale===t.transformScale&&e.isDroppable===t.isDroppable&&n(e.resizeHandles,t.resizeHandles)&&n(e.resizeHandle,t.resizeHandle)&&e.onLayoutChange===t.onLayoutChange&&e.onDragStart===t.onDragStart&&e.onDrag===t.onDrag&&e.onDragStop===t.onDragStop&&e.onResizeStart===t.onResizeStart&&e.onResize===t.onResize&&e.onResizeStop===t.onResizeStop&&e.onDrop===t.onDrop&&n(e.droppingItem,t.droppingItem)&&n(e.innerRef,t.innerRef)}},544:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findOrGenerateResponsiveLayout=function(e,t,n,o,i,s){if(e[n])return(0,r.cloneLayout)(e[n]);for(var l=e[o],c=a(t),u=c.slice(c.indexOf(n)),d=0,p=u.length;d<p;d++){var f=u[d];if(e[f]){l=e[f];break}}return l=(0,r.cloneLayout)(l||[]),(0,r.compact)((0,r.correctBounds)(l,{cols:i}),s,i)},t.getBreakpointFromWidth=function(e,t){for(var n=a(e),r=n[0],o=1,i=n.length;o<i;o++){var s=n[o];t>e[s]&&(r=s)}return r},t.getColsFromBreakpoint=function(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]},t.sortBreakpoints=a;var r=n(414);function a(e){return Object.keys(e).sort((function(t,n){return e[t]-e[n]}))}},414:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bottom=d,t.childrenEqual=function(e,t){return(0,r.default)(a.default.Children.map(e,(function(e){return null==e?void 0:e.key})),a.default.Children.map(t,(function(e){return null==e?void 0:e.key})))},t.cloneLayout=p,t.cloneLayoutItem=h,t.collides=m,t.compact=b,t.compactItem=w,t.compactType=function(e){var t=e||{},n=t.verticalCompact,r=t.compactType;return!1===n?null:r},t.correctBounds=x,t.fastPositionEqual=function(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height},t.fastRGLPropsEqual=void 0,t.getAllCollisions=D,t.getFirstCollision=O,t.getLayoutItem=S,t.getStatics=C,t.modifyLayout=f,t.moveElement=E,t.moveElementAwayFromCollision=_,t.noop=void 0,t.perc=function(e){return 100*e+"%"},t.setTopLeft=function(e){var t=e.top,n=e.left,r=e.width,a=e.height;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(a,"px"),position:"absolute"}},t.setTransform=function(e){var t=e.top,n=e.left,r=e.width,a=e.height,o="translate(".concat(n,"px,").concat(t,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(a,"px"),position:"absolute"}},t.sortLayoutItems=P,t.sortLayoutItemsByColRow=I,t.sortLayoutItemsByRowCol=R,t.synchronizeLayoutWithChildren=function(e,t,n,r,o){e=e||[];var i=[];a.default.Children.forEach(t,(function(t){if(null!=(null==t?void 0:t.key)){var n=S(e,String(t.key));if(n)i.push(h(n));else{!c&&t.props._grid&&console.warn("`_grid` properties on children have been deprecated as of React 15.2. Please use `data-grid` or add your properties directly to the `layout`.");var r=t.props["data-grid"]||t.props._grid;r?(c||T([r],"ReactGridLayout.children"),i.push(h(s(s({},r),{},{i:t.key})))):i.push(h({w:1,h:1,x:0,y:d(i),i:String(t.key)}))}}}));var l=x(i,{cols:n});return o?l:b(l,r,n)},t.validateLayout=T,t.withLayoutItem=function(e,t,n){var r=S(e,t);return r?[e=f(e,r=n(h(r))),r]:[e,null]};var r=o(n(7842)),a=o(n(5959));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=!0,u=!1;function d(e){for(var t,n=0,r=0,a=e.length;r<a;r++)(t=e[r].y+e[r].h)>n&&(n=t);return n}function p(e){for(var t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]=h(e[n]);return t}function f(e,t){for(var n=Array(e.length),r=0,a=e.length;r<a;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function h(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:Boolean(e.moved),static:Boolean(e.static),isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}var g=n(7434);function m(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function b(e,t,n){for(var r=C(e),a=P(e,t),o=Array(e.length),i=0,s=a.length;i<s;i++){var l=h(a[i]);l.static||(l=w(r,l,t,n,a),r.push(l)),o[e.indexOf(a[i])]=l,l.moved=!1}return o}t.fastRGLPropsEqual=g;var y={x:"w",y:"h"};function v(e,t,n,r){var a=y[r];t[r]+=1;for(var o=e.map((function(e){return e.i})).indexOf(t.i)+1;o<e.length;o++){var i=e[o];if(!i.static){if(i.y>t.y+t.h)break;m(t,i)&&v(e,i,n+t[a],r)}}t[r]=n}function w(e,t,n,r,a){var o,i="horizontal"===n;if("vertical"===n)for(t.y=Math.min(d(e),t.y);t.y>0&&!O(e,t);)t.y--;else if(i)for(;t.x>0&&!O(e,t);)t.x--;for(;o=O(e,t);)i?v(a,t,o.x+o.w,"x"):v(a,t,o.y+o.h,"y"),i&&t.x+t.w>r&&(t.x=r-t.w,t.y++);return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function x(e,t){for(var n=C(e),r=0,a=e.length;r<a;r++){var o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),o.static)for(;O(n,o);)o.y++;else n.push(o)}return e}function S(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function O(e,t){for(var n=0,r=e.length;n<r;n++)if(m(e[n],t))return e[n]}function D(e,t){return e.filter((function(e){return m(e,t)}))}function C(e){return e.filter((function(e){return e.static}))}function E(e,t,n,r,a,o,i,s,l){if(t.static&&!0!==t.isDraggable)return e;if(t.y===r&&t.x===n)return e;k("Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]"));var c=t.x,u=t.y;"number"==typeof n&&(t.x=n),"number"==typeof r&&(t.y=r),t.moved=!0;var d=P(e,i);("vertical"===i&&"number"==typeof r?u>=r:"horizontal"===i&&"number"==typeof n&&c>=n)&&(d=d.reverse());var f=D(d,t),h=f.length>0;if(h&&l)return p(e);if(h&&o)return k("Collision prevented on ".concat(t.i,", reverting.")),t.x=c,t.y=u,t.moved=!1,e;for(var g=0,m=f.length;g<m;g++){var b=f[g];k("Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(b.i," at [").concat(b.x,",").concat(b.y,"]")),b.moved||(e=b.static?_(e,b,t,a,i,s):_(e,t,b,a,i,s))}return e}function _(e,t,n,r,a,o){var i="horizontal"===a,s="horizontal"!==a,l=t.static;if(r){r=!1;var c={x:i?Math.max(t.x-n.w,0):n.x,y:s?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"};if(!O(e,c))return k("Doing reverse collision on ".concat(n.i," up to [").concat(c.x,",").concat(c.y,"].")),E(e,n,i?c.x:void 0,s?c.y:void 0,r,l,a,o)}return E(e,n,i?n.x+1:void 0,s?n.y+1:void 0,r,l,a,o)}function P(e,t){return"horizontal"===t?I(e):"vertical"===t?R(e):e}function R(e){return e.slice(0).sort((function(e,t){return e.y>t.y||e.y===t.y&&e.x>t.x?1:e.y===t.y&&e.x===t.x?0:-1}))}function I(e){return e.slice(0).sort((function(e,t){return e.x>t.x||e.x===t.x&&e.y>t.y?1:-1}))}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Layout",n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(var r=0,a=e.length;r<a;r++)for(var o=e[r],i=0;i<n.length;i++)if("number"!=typeof o[n[i]])throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[i]+" must be a number!")}function k(){var e;u&&(e=console).log.apply(e,arguments)}t.noop=function(){}},2548:(e,t,n)=>{e.exports=n(9482).default,e.exports.utils=n(414),e.exports.Responsive=n(4636).default,e.exports.Responsive.utils=n(544),e.exports.WidthProvider=n(6805).default},7256:(e,t,n)=>{"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}function a(){for(var e,t,n=0,a="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}n.r(t),n.d(t,{clsx:()=>a,default:()=>o});const o=a},1575:(e,t,n)=>{"use strict";n.d(t,{A:()=>w});var r=n(5959),a=function(e){return e.split(/ ?; ?/).reduce((function(e,t){var n=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}(t.split(/ ?: ?/),2),r=n[0],a=n[1];return r&&a&&(e[r.replace(/-(\w)/g,(function(e,t){return t.toUpperCase()}))]=Number.isNaN(Number(a))?a:Number(a)),e}),{})},o=["br","col","colgroup","dl","hr","iframe","img","input","link","menuitem","meta","ol","param","select","table","tbody","tfoot","thead","tr","ul","wbr"],i={"accept-charset":"acceptCharset",acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",classid:"classID",classname:"className",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",controlslist:"controlsList",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",datetime:"dateTime",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",enctype:"encType",for:"htmlFor",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",innerhtml:"innerHTML",inputmode:"inputMode",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",marginwidth:"marginWidth",marginheight:"marginHeight",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",nomodule:"noModule",novalidate:"noValidate",playsinline:"playsInline",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",typemustmatch:"typeMustMatch",usemap:"useMap",accentheight:"accentHeight","accent-height":"accentHeight",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",arabicform:"arabicForm","arabic-form":"arabicForm",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",diffuseconstant:"diffuseConstant",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",edgemode:"edgeMode",enablebackground:"enableBackground","enable-background":"enableBackground",externalresourcesrequired:"externalResourcesRequired",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",imagerendering:"imageRendering","image-rendering":"imageRendering",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",vmathematical:"vMathematical","v-mathematical":"vMathematical",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan",onblur:"onBlur",onchange:"onChange",onclick:"onClick",oncontextmenu:"onContextMenu",ondoubleclick:"onDoubleClick",ondrag:"onDrag",ondragend:"onDragEnd",ondragenter:"onDragEnter",ondragexit:"onDragExit",ondragleave:"onDragLeave",ondragover:"onDragOver",ondragstart:"onDragStart",ondrop:"onDrop",onerror:"onError",onfocus:"onFocus",oninput:"onInput",oninvalid:"onInvalid",onkeydown:"onKeyDown",onkeypress:"onKeyPress",onkeyup:"onKeyUp",onload:"onLoad",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onscroll:"onScroll",onsubmit:"onSubmit",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"},s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},s.apply(this,arguments)},l=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},c=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))};function u(e,t){var n;if(void 0===t&&(t={}),!(e&&e instanceof Node))return null;var d,p=t.actions,f=void 0===p?[]:p,h=t.index,g=void 0===h?0:h,m=t.level,b=void 0===m?0:m,y=t.randomKey,v=e,w="".concat(b,"-").concat(g),x=[];if(y&&0===b&&(w="".concat(function(e){void 0===e&&(e=6);for(var t="",n=e;n>0;--n)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.round(61*Math.random())];return t}(),"-").concat(w)),Array.isArray(f)&&f.forEach((function(t){t.condition(v,w,b)&&("function"==typeof t.pre&&((v=t.pre(v,w,b))instanceof Node||(v=e)),"function"==typeof t.post&&x.push(t.post(v,w,b)))})),x.length)return x;switch(v.nodeType){case 1:return r.createElement((d=v.nodeName,/[a-z]+[A-Z]+[a-z]+/.test(d)?d:d.toLowerCase()),function(e,t){var n={key:t};if(e instanceof Element){var r=e.getAttribute("class");r&&(n.className=r),c([],l(e.attributes),!1).forEach((function(e){switch(e.name){case"class":break;case"style":n[e.name]=a(e.value);break;case"allowfullscreen":case"allowpaymentrequest":case"async":case"autofocus":case"autoplay":case"checked":case"controls":case"default":case"defer":case"disabled":case"formnovalidate":case"hidden":case"ismap":case"itemscope":case"loop":case"multiple":case"muted":case"nomodule":case"novalidate":case"open":case"readonly":case"required":case"reversed":case"selected":case"typemustmatch":n[i[e.name]||e.name]=!0;break;default:n[i[e.name]||e.name]=e.value}}))}return n}(v,w),function(e,t,n){var r=c([],l(e),!1).map((function(e,r){return u(e,s(s({},n),{index:r,level:t+1}))})).filter(Boolean);return r.length?r:null}(v.childNodes,b,t));case 3:var S=(null===(n=v.nodeValue)||void 0===n?void 0:n.toString())||"";if(/^\s+$/.test(S)&&!/[\u00A0\u202F]/.test(S))return null;if(!v.parentNode)return S;var O=v.parentNode.nodeName.toLowerCase();return o.includes(O)?(/\S/.test(S)&&console.warn("A textNode is not allowed inside '".concat(O,"'. Your text \"").concat(S,'" will be ignored')),null):S;default:return null}}function d(e,t){return void 0===t&&(t={}),"string"==typeof e?function(e,t){if(void 0===t&&(t={}),!e||"string"!=typeof e)return null;var n=t.nodeOnly,r=void 0!==n&&n,a=t.selector,o=void 0===a?"body > *":a,i=t.type,s=void 0===i?"text/html":i;try{var l=(new DOMParser).parseFromString(e,s).querySelector(o);if(!(l instanceof Node))throw new TypeError("Error parsing input");return r?l:u(l,t)}catch(e){}return null}(e,t):e instanceof Node?u(e,t):null}var p=n(1567),f={FAILED:"failed",LOADED:"loaded",LOADING:"loading",PENDING:"pending",READY:"ready",UNSUPPORTED:"unsupported"};function h(){return p.canUseDOM}var g,m=(g=function(e,t){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},g(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),b=function(){return b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},b.apply(this,arguments)},y=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},v=Object.create(null);const w=function(e){function t(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"isInitialized",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(n,"isActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(n,"hash",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"handleLoad",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!1),n.isActive&&n.setState({content:e,hasCache:t,status:f.LOADED},n.getElement)}}),Object.defineProperty(n,"handleError",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=n.props.onError,r="Browser does not support SVG"===e.message?f.UNSUPPORTED:f.FAILED;n.isActive&&n.setState({status:r},(function(){"function"==typeof t&&t(e)}))}}),Object.defineProperty(n,"request",{enumerable:!0,configurable:!0,writable:!0,value:function(){var e=n.props,t=e.cacheRequests,r=e.fetchOptions,a=e.src;try{return t&&(v[a]={content:"",status:f.LOADING}),fetch(a,r).then((function(e){var t=e.headers.get("content-type"),n=y((t||"").split(/ ?; ?/),1)[0];if(e.status>299)throw new Error("Not found");if(!["image/svg+xml","text/plain"].some((function(e){return n.includes(e)})))throw new Error("Content type isn't valid: ".concat(n));return e.text()})).then((function(e){var r=n.props.src;if(a===r){if(n.handleLoad(e),t){var o=v[a];o&&(o.content=e,o.status=f.LOADED)}}else v[a].status===f.LOADING&&delete v[a]})).catch((function(e){n.handleError(e),t&&v[a]&&delete v[a]}))}catch(e){return n.handleError(new Error(e.message))}}}),n.state={content:"",element:null,hasCache:!!t.cacheRequests&&!!v[t.src],status:f.PENDING},n.hash=t.uniqueHash||function(e){for(var t,n="abcdefghijklmnopqrstuvwxyz",r="".concat(n).concat(n.toUpperCase()).concat("1234567890"),a="",o=0;o<8;o++)a+=(t=r)[Math.floor(Math.random()*t.length)];return a}(),n}return m(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isActive=!0,h()&&!this.isInitialized){var e=this.state.status,t=this.props.src;try{if(e===f.PENDING){if(!function(){if(!document)return!1;var e=document.createElement("div");e.innerHTML="<svg />";var t=e.firstChild;return!!t&&"http://www.w3.org/2000/svg"===t.namespaceURI}()||"undefined"==typeof window||null===window)throw new Error("Browser does not support SVG");if(!t)throw new Error("Missing src");this.load()}}catch(e){this.handleError(e)}this.isInitialized=!0}}}),Object.defineProperty(t.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(h()){var n=this.state,r=n.hasCache,a=n.status,o=this.props,i=o.onLoad,s=o.src;if(t.status!==f.READY&&a===f.READY&&i&&i(s,r),e.src!==s){if(!s)return void this.handleError(new Error("Missing src"));this.load()}}}}),Object.defineProperty(t.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isActive=!1}}),Object.defineProperty(t.prototype,"getNode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.description,n=e.title;try{var r=d(this.processSVG(),{nodeOnly:!0});if(!(r&&r instanceof SVGSVGElement))throw new Error("Could not convert the src to a DOM Node");var a=this.updateSVGAttributes(r);if(t){var o=a.querySelector("desc");o&&o.parentNode&&o.parentNode.removeChild(o);var i=document.createElementNS("http://www.w3.org/2000/svg","desc");i.innerHTML=t,a.prepend(i)}if(void 0!==n){var s=a.querySelector("title");if(s&&s.parentNode&&s.parentNode.removeChild(s),n){var l=document.createElementNS("http://www.w3.org/2000/svg","title");l.innerHTML=n,a.prepend(l)}}return a}catch(e){return this.handleError(e)}}}),Object.defineProperty(t.prototype,"getElement",{enumerable:!1,configurable:!0,writable:!0,value:function(){try{var e=d(this.getNode());if(!e||!r.isValidElement(e))throw new Error("Could not convert the src to a React element");this.setState({element:e,status:f.READY})}catch(e){this.handleError(new Error(e.message))}}}),Object.defineProperty(t.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.isActive&&this.setState({content:"",element:null,hasCache:!1,status:f.LOADING},(function(){var t=e.props,n=t.cacheRequests,r=t.src,a=n&&v[r];if(a&&a.status===f.LOADED)e.handleLoad(a.content,!0);else{var o,i=r.match(/data:image\/svg[^,]*?(;base64)?,(.*)/);i?o=i[1]?window.atob(i[2]):decodeURIComponent(i[2]):r.includes("<svg")&&(o=r),o?e.handleLoad(o):e.request()}}))}}),Object.defineProperty(t.prototype,"updateSVGAttributes",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=this.props,r=n.baseURL,a=void 0===r?"":r,o=n.uniquifyIDs,i=["id","href","xlink:href","xlink:role","xlink:arcrole"],s=["href","xlink:href"];return o?(function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}([],y(e.children),!1).map((function(e){if(e.attributes&&e.attributes.length){var n=Object.values(e.attributes).map((function(e){var n=e,r=e.value.match(/url\((.*?)\)/);return r&&r[1]&&(n.value=e.value.replace(r[0],"url(".concat(a).concat(r[1],"__").concat(t.hash,")"))),n}));i.forEach((function(e){var r,a,o=n.find((function(t){return t.name===e}));o&&(r=e,a=o.value,!s.includes(r)||!a||a.includes("#"))&&(o.value="".concat(o.value,"__").concat(t.hash))}))}return e.children.length?t.updateSVGAttributes(e):e})),e):e}}),Object.defineProperty(t.prototype,"processSVG",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.state.content,t=this.props.preProcessor;return t?t(e):e}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.state,t=e.element,n=e.status,a=this.props,o=a.children,i=void 0===o?null:o,s=a.innerRef,l=a.loader,c=void 0===l?null:l,u=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r={};for(var a in e)({}).hasOwnProperty.call(e,a)&&(t.includes(a)||(r[a]=e[a]));return r}(this.props,"baseURL","cacheRequests","children","description","fetchOptions","innerRef","loader","onError","onLoad","preProcessor","src","title","uniqueHash","uniquifyIDs");return h()?t?r.cloneElement(t,b({ref:s},u)):[f.UNSUPPORTED,f.FAILED].includes(n)?i:c:c}}),Object.defineProperty(t,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{cacheRequests:!0,uniquifyIDs:!1}}),t}(r.PureComponent)},1794:(e,t,n)=>{"use strict";t.__esModule=!0,t.default=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(5959)),a=n(8230),o=n(9954),i=n(6333),s=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var h=function(e){var t,n;function i(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).handleRefs={},t.lastHandleRect=null,t.slack=null,t}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,f(t,n);var l=i.prototype;return l.componentWillUnmount=function(){this.resetData()},l.resetData=function(){this.lastHandleRect=this.slack=null},l.runConstraints=function(e,t){var n=this.props,r=n.minConstraints,a=n.maxConstraints,o=n.lockAspectRatio;if(!r&&!a&&!o)return[e,t];if(o){var i=this.props.width/this.props.height,s=e-this.props.width,l=t-this.props.height;Math.abs(s)>Math.abs(l*i)?t=e/i:e=t*i}var c=e,u=t,d=this.slack||[0,0],p=d[0],f=d[1];return e+=p,t+=f,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),a&&(e=Math.min(a[0],e),t=Math.min(a[1],t)),this.slack=[p+(c-e),f+(u-t)],[e,t]},l.resizeHandler=function(e,t){var n=this;return function(r,a){var o=a.node,i=a.deltaX,s=a.deltaY;"onResizeStart"===e&&n.resetData();var l=("both"===n.props.axis||"x"===n.props.axis)&&"n"!==t&&"s"!==t,c=("both"===n.props.axis||"y"===n.props.axis)&&"e"!==t&&"w"!==t;if(l||c){var u=t[0],d=t[t.length-1],p=o.getBoundingClientRect();null!=n.lastHandleRect&&("w"===d&&(i+=p.left-n.lastHandleRect.left),"n"===u&&(s+=p.top-n.lastHandleRect.top)),n.lastHandleRect=p,"w"===d&&(i=-i),"n"===u&&(s=-s);var f=n.props.width+(l?i/n.props.transformScale:0),h=n.props.height+(c?s/n.props.transformScale:0),g=n.runConstraints(f,h);f=g[0],h=g[1];var m=f!==n.props.width||h!==n.props.height,b="function"==typeof n.props[e]?n.props[e]:null;b&&!("onResize"===e&&!m)&&(null==r.persist||r.persist(),b(r,{node:o,size:{width:f,height:h},handle:t})),"onResizeStop"===e&&n.resetData()}}},l.renderResizeHandle=function(e,t){var n=this.props.handle;if(!n)return r.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+e,ref:t});if("function"==typeof n)return n(e,t);var a=d({ref:t},"string"==typeof n.type?{}:{handleAxis:e});return r.cloneElement(n,a)},l.render=function(){var e=this,t=this.props,n=t.children,i=t.className,l=t.draggableOpts,u=(t.width,t.height,t.handle,t.handleSize,t.lockAspectRatio,t.axis,t.minConstraints,t.maxConstraints,t.onResize,t.onResizeStop,t.onResizeStart,t.resizeHandles),p=(t.transformScale,function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(t,s));return(0,o.cloneElement)(n,d(d({},p),{},{className:(i?i+" ":"")+"react-resizable",children:[].concat(n.props.children,u.map((function(t){var n,o=null!=(n=e.handleRefs[t])?n:e.handleRefs[t]=r.createRef();return r.createElement(a.DraggableCore,c({},l,{nodeRef:o,key:"resizableHandle-"+t,onStop:e.resizeHandler("onResizeStop",t),onStart:e.resizeHandler("onResizeStart",t),onDrag:e.resizeHandler("onResize",t)}),e.renderResizeHandle(t,o))})))}))},i}(r.Component);t.default=h,h.propTypes=i.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}},6609:(e,t,n)=>{"use strict";t.default=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(5959)),a=l(n(2688)),o=l(n(1794)),i=n(6333),s=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function l(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var g=function(e){var t,n;function a(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).state={width:t.props.width,height:t.props.height,propsWidth:t.props.width,propsHeight:t.props.height},t.onResize=function(e,n){var r=n.size;t.props.onResize?(null==e.persist||e.persist(),t.setState(r,(function(){return t.props.onResize&&t.props.onResize(e,n)}))):t.setState(r)},t}return n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,h(t,n),a.getDerivedStateFromProps=function(e,t){return t.propsWidth!==e.width||t.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null},a.prototype.render=function(){var e=this.props,t=e.handle,n=e.handleSize,a=(e.onResize,e.onResizeStart),i=e.onResizeStop,l=e.draggableOpts,c=e.minConstraints,d=e.maxConstraints,f=e.lockAspectRatio,h=e.axis,g=(e.width,e.height,e.resizeHandles),m=e.style,b=e.transformScale,y=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,s);return r.createElement(o.default,{axis:h,draggableOpts:l,handle:t,handleSize:n,height:this.state.height,lockAspectRatio:f,maxConstraints:d,minConstraints:c,onResizeStart:a,onResize:this.onResize,onResizeStop:i,resizeHandles:g,transformScale:b,width:this.state.width},r.createElement("div",u({},y,{style:p(p({},m),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},a}(r.Component);t.default=g,g.propTypes=p(p({},i.resizableProps),{},{children:a.default.element})},6333:(e,t,n)=>{"use strict";t.__esModule=!0,t.resizableProps=void 0;var r,a=(r=n(2688))&&r.__esModule?r:{default:r};n(8230);var o={axis:a.default.oneOf(["both","x","y","none"]),className:a.default.string,children:a.default.element.isRequired,draggableOpts:a.default.shape({allowAnyClick:a.default.bool,cancel:a.default.string,children:a.default.node,disabled:a.default.bool,enableUserSelectHack:a.default.bool,offsetParent:a.default.node,grid:a.default.arrayOf(a.default.number),handle:a.default.string,nodeRef:a.default.object,onStart:a.default.func,onDrag:a.default.func,onStop:a.default.func,onMouseDown:a.default.func,scale:a.default.number}),height:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=t[0];return"both"===o.axis||"y"===o.axis?(r=a.default.number).isRequired.apply(r,t):a.default.number.apply(a.default,t)},handle:a.default.oneOfType([a.default.node,a.default.func]),handleSize:a.default.arrayOf(a.default.number),lockAspectRatio:a.default.bool,maxConstraints:a.default.arrayOf(a.default.number),minConstraints:a.default.arrayOf(a.default.number),onResizeStop:a.default.func,onResizeStart:a.default.func,onResize:a.default.func,resizeHandles:a.default.arrayOf(a.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:a.default.number,width:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=t[0];return"both"===o.axis||"x"===o.axis?(r=a.default.number).isRequired.apply(r,t):a.default.number.apply(a.default,t)}};t.resizableProps=o},9954:(e,t,n)=>{"use strict";t.__esModule=!0,t.cloneElement=function(e,t){return t.style&&e.props.style&&(t.style=i(i({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),a.default.cloneElement(e,t)};var r,a=(r=n(5959))&&r.__esModule?r:{default:r};function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},936:(e,t,n)=>{"use strict";e.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},e.exports.Resizable=n(1794).default,e.exports.ResizableBox=n(6609).default},3367:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}([function(e,t){var n,r,a=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var l,c=[],u=!1,d=-1;function p(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&f())}function f(){if(!u){var e=s(p);u=!0;for(var t=c.length;t;){for(l=c,c=[];++d<t;)l&&l[d].run();d=-1,t=c.length}l=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function g(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||u||s(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=g,a.addListener=g,a.once=g,a.off=g,a.removeListener=g,a.removeAllListeners=g,a.emit=g,a.prependListener=g,a.prependOnceListener=g,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){return function(){return e}}var a=function(){};a.thatReturns=r,a.thatReturnsFalse=r(!1),a.thatReturnsTrue=r(!0),a.thatReturnsNull=r(null),a.thatReturnsThis=function(){return this},a.thatReturnsArgument=function(e){return e},e.exports=a},function(e,t,n){"use strict";(function(t){var n=function(e){};"production"!==t.env.NODE_ENV&&(n=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=function(e,t,r,a,o,i,s,l){if(n(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,a,o,i,s,l],d=0;(c=new Error(t.replace(/%s/g,(function(){return u[d++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}}).call(t,n(0))},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=((r=n(4))&&r.__esModule?r:{default:r}).default.createContext({registerPane:function(){},unregisterPane:function(){}});t.default=a,e.exports=t.default},function(e,t,n){"use strict";(function(t){var r,a=n(1);"production"!==t.env.NODE_ENV&&(r=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=0,o="Warning: "+e.replace(/%s/g,(function(){return n[a++]}));"undefined"!=typeof console&&console.error(o);try{throw new Error(o)}catch(e){}},a=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,a=Array(n>2?n-2:0),o=2;o<n;o++)a[o-2]=arguments[o];r.apply(void 0,[t].concat(a))}}),e.exports=a}).call(t,n(0))},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=n(13)((function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}),!0)}else e.exports=n(12)()}).call(t,n(0))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(4),o=l(a),i=l(n(7)),s=l(n(5));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return n=r=c(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.panes={},r.registerPane=function(e,t){t.forEach((function(t){r.panes[t]||(r.panes[t]=[]),r.findPane(e,t)||(r.panes[t].length>0&&r.syncScrollPosition(r.panes[t][0],e),r.panes[t].push(e))})),r.addEvents(e,t)},r.unregisterPane=function(e,t){t.forEach((function(t){r.findPane(e,t)&&(r.removeEvents(e),r.panes[t].splice(r.panes[t].indexOf(e),1))}))},r.addEvents=function(e,t){e.onscroll=r.handlePaneScroll.bind(r,e,t)},r.removeEvents=function(e){e.onscroll=null},r.findPane=function(e,t){return!!r.panes[t]&&r.panes[t].find((function(t){return t===e}))},r.handlePaneScroll=function(e,t){r.props.enabled&&window.requestAnimationFrame((function(){r.syncScrollPositions(e,t)}))},r.syncScrollPositions=function(e,t){t.forEach((function(n){r.panes[n].forEach((function(a){e!==a&&(r.removeEvents(a,n),r.syncScrollPosition(e,a),window.requestAnimationFrame((function(){r.addEvents(a,t)})))}))})),r.props.onSync&&r.props.onSync(e)},c(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"getContextValue",value:function(){return{registerPane:this.registerPane,unregisterPane:this.unregisterPane}}},{key:"syncScrollPosition",value:function(e,t){var n=e.scrollTop,r=e.scrollHeight,a=e.clientHeight,o=e.scrollLeft,i=e.scrollWidth,s=e.clientWidth,l=r-a,c=i-s,u=this.props,d=u.proportional,p=u.vertical,f=u.horizontal,h=t.scrollHeight-a,g=t.scrollWidth-s;p&&l>0&&(t.scrollTop=d?h*n/l:n),f&&c>0&&(t.scrollLeft=d?g*o/c:o)}},{key:"render",value:function(){return o.default.createElement(s.default.Provider,{value:this.getContextValue()},o.default.Children.only(this.props.children))}}]),t}(a.Component);u.propTypes={onSync:i.default.func,children:i.default.element.isRequired,proportional:i.default.bool,vertical:i.default.bool,horizontal:i.default.bool,enabled:i.default.bool},u.defaultProps={proportional:!0,vertical:!0,horizontal:!0,enabled:!0},t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(4),o=s(n(7)),i=s(n(5));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.toArray=function(e){return[].concat(e)},n.updateNode=function(){n.props.attachTo?n.node=n.props.attachTo.current:n.node=n.childRef.current},n.childRef=e.innerRef?e.innerRef:(0,a.createRef)(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){this.props.enabled&&(this.updateNode(),this.node&&this.context.registerPane(this.node,this.toArray(this.props.group)))}},{key:"componentDidUpdate",value:function(e){this.props.attachTo!==e.attachTo&&(this.node&&this.context.unregisterPane(this.node,this.toArray(e.group)),this.updateNode(),this.node&&this.context.registerPane(this.node,this.toArray(e.group))),this.node&&this.props.enabled!==e.enabled&&(this.props.enabled?this.context.registerPane(this.node,this.toArray(e.group)):this.context.unregisterPane(this.node,this.toArray(e.group))),this.node&&this.props.enabled&&this.props.group!==e.group&&(this.context.unregisterPane(this.node,this.toArray(e.group)),this.context.registerPane(this.node,this.toArray(this.props.group)))}},{key:"componentWillUnmount",value:function(){this.node&&this.props.enabled&&this.context.unregisterPane(this.node,this.toArray(this.props.group))}},{key:"render",value:function(){return this.props.attachTo?this.props.children:(0,a.cloneElement)(a.Children.only(this.props.children),{ref:this.childRef})}}]),t}(a.Component);l.contextType=i.default,l.propTypes={children:o.default.node.isRequired,attachTo:o.default.oneOfType([o.default.func,o.default.shape({current:o.default.any})]),group:o.default.oneOfType([o.default.string,o.default.arrayOf(o.default.string)]),enabled:o.default.bool,innerRef:o.default.oneOfType([o.default.func,o.default.shape({current:o.default.any})])},l.defaultProps={group:"default",enabled:!0},t.default=l,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);Object.defineProperty(t,"ScrollSync",{enumerable:!0,get:function(){return o(r).default}});var a=n(9);function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"ScrollSyncPane",{enumerable:!0,get:function(){return o(a).default}})},function(e,t,n){"use strict";(function(t){if("production"!==t.env.NODE_ENV)var r=n(2),a=n(6),o=n(3),i={};e.exports=function(e,n,s,l,c){if("production"!==t.env.NODE_ENV)for(var u in e)if(e.hasOwnProperty(u)){var d;try{r("function"==typeof e[u],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",l||"React class",s,u),d=e[u](n,u,l,s,null,o)}catch(e){d=e}if(a(!d||d instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",s,u,typeof d),d instanceof Error&&!(d.message in i)){i[d.message]=!0;var p=c?c():"";a(!1,"Failed %s type: %s%s",s,d.message,null!=p?p:"")}}}}).call(t,n(0))},function(e,t,n){"use strict";var r=n(1),a=n(2),o=n(3);e.exports=function(){function e(e,t,n,r,i,s){s!==o&&a(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";(function(t){var r=n(1),a=n(2),o=n(6),i=n(3),s=n(11);e.exports=function(e,n){var l="function"==typeof Symbol&&Symbol.iterator,c="<<anonymous>>",u={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:p(r.thatReturnsNull),arrayOf:function(e){return p((function(t,n,r,a,o){if("function"!=typeof e)return new d("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new d("Invalid "+a+" `"+o+"` of type `"+g(s)+"` supplied to `"+r+"`, expected an array.");for(var l=0;l<s.length;l++){var c=e(s,l,r,a,o+"["+l+"]",i);if(c instanceof Error)return c}return null}))},element:p((function(t,n,r,a,o){var i=t[n];return e(i)?null:new d("Invalid "+a+" `"+o+"` of type `"+g(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),instanceOf:function(e){return p((function(t,n,r,a,o){if(!(t[n]instanceof e)){var i=e.name||c;return new d("Invalid "+a+" `"+o+"` of type `"+((s=t[n]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `"+r+"`, expected instance of `"+i+"`.")}var s;return null}))},node:p((function(e,t,n,r,a){return h(e[t])?null:new d("Invalid "+r+" `"+a+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return p((function(t,n,r,a,o){if("function"!=typeof e)return new d("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],l=g(s);if("object"!==l)return new d("Invalid "+a+" `"+o+"` of type `"+l+"` supplied to `"+r+"`, expected an object.");for(var c in s)if(s.hasOwnProperty(c)){var u=e(s,c,r,a,o+"."+c,i);if(u instanceof Error)return u}return null}))},oneOf:function(e){return Array.isArray(e)?p((function(t,n,r,a,o){for(var i=t[n],s=0;s<e.length;s++)if(l=i,c=e[s],l===c?0!==l||1/l==1/c:l!=l&&c!=c)return null;var l,c;return new d("Invalid "+a+" `"+o+"` of value `"+i+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")})):("production"!==t.env.NODE_ENV&&o(!1,"Invalid argument supplied to oneOf, expected an instance of array."),r.thatReturnsNull)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==t.env.NODE_ENV&&o(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),r.thatReturnsNull;for(var n=0;n<e.length;n++){var a=e[n];if("function"!=typeof a)return o(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",b(a),n),r.thatReturnsNull}return p((function(t,n,r,a,o){for(var s=0;s<e.length;s++)if(null==(0,e[s])(t,n,r,a,o,i))return null;return new d("Invalid "+a+" `"+o+"` supplied to `"+r+"`.")}))},shape:function(e){return p((function(t,n,r,a,o){var s=t[n],l=g(s);if("object"!==l)return new d("Invalid "+a+" `"+o+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");for(var c in e){var u=e[c];if(u){var p=u(s,c,r,a,o+"."+c,i);if(p)return p}}return null}))}};function d(e){this.message=e,this.stack=""}function p(e){if("production"!==t.env.NODE_ENV)var r={},s=0;function l(l,u,p,f,h,g,m){if(f=f||c,g=g||p,m!==i)if(n)a(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var b=f+":"+p;!r[b]&&s<3&&(o(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",g,f),r[b]=!0,s++)}return null==u[p]?l?null===u[p]?new d("The "+h+" `"+g+"` is marked as required in `"+f+"`, but its value is `null`."):new d("The "+h+" `"+g+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(u,p,f,h,g)}var u=l.bind(null,!1);return u.isRequired=l.bind(null,!0),u}function f(e){return p((function(t,n,r,a,o,i){var s=t[n];return g(s)!==e?new d("Invalid "+a+" `"+o+"` of type `"+m(s)+"` supplied to `"+r+"`, expected `"+e+"`."):null}))}function h(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(h);if(null===t||e(t))return!0;var n=function(e){var t=e&&(l&&e[l]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!n)return!1;var r,a=n.call(t);if(n!==t.entries){for(;!(r=a.next()).done;)if(!h(r.value))return!1}else for(;!(r=a.next()).done;){var o=r.value;if(o&&!h(o[1]))return!1}return!0;default:return!1}}function g(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function m(e){if(null==e)return""+e;var t=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function b(e){var t=m(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return d.prototype=Error.prototype,u.checkPropTypes=s,u.PropTypes=u,u}}).call(t,n(0))}])},e.exports=r(n(5959))},2192:(e,t,n)=>{"use strict";var r=n(5959);Symbol.for("react.element"),Symbol.for("react.fragment"),Object.prototype.hasOwnProperty,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner},2540:(e,t,n)=>{"use strict";n(2192)},5745:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var a,o=new Uint8Array(16);function i(){if(!a&&!(a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(o)}for(var s=[],l=0;l<256;++l)s.push((l+256).toString(16).slice(1));const c=function(e,t,n){if(r.randomUUID&&!t&&!e)return r.randomUUID();var a=(e=e||{}).random||(e.rng||i)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=a[o];return t}return function(e,t=0){return(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase()}(a)}},5540:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var r=n(5959);function a(e){const{ref:t,box:n,onResize:a}=e;(0,r.useEffect)((()=>{let e=null==t?void 0:t.current;if(e){if(void 0===window.ResizeObserver)return window.addEventListener("resize",a,!1),()=>{window.removeEventListener("resize",a,!1)};{const t=new window.ResizeObserver((e=>{e.length&&a()}));return t.observe(e,{box:n}),()=>{e&&t.unobserve(e)}}}}),[a,t,n])}}}]);
//# sourceMappingURL=698.js.map