adminizer 4.3.0-build.113 → 4.3.0-build.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import{j as v,C as oc,E as ac,a as lc,L as _e,b as Ve,S as Nr,c as kr,d as Lr,e as Vr,f as jr,g as rr,B as we,P as Eo,h as W,I as ir,D as cc,i as uc,k as dc,l as Rn,t as Li,m as Nn,T as hc,r as fc,n as pc,o as gc,p as mc,q as vc,s as yc,v as bc,w as xc,x as Tc,y as Sc,z as wc,A as Bt}from"./app.js";import{A as Dc}from"./app-layout-BmMzULcJ.js";import{r as m,e as z}from"./monaco-ICtx6xoc.js";import{g as Cc}from"./vendor-wzZzN_Jv.js";import{r as Ec,d as Pc}from"./jsoneditor-D95dIAP2.js";import on from"./material-icon-DwkE6wKL.js";import{D as Oc}from"./del-modal-DyIWFflP.js";import Vi from"./add-form-tDZGN7FP.js";import"./handsontable-PVakPtJV.js";import"./app-shell-C8Cnr5Hy.js";import"./app-sidebar-HwvXNZzk.js";import"./nav-main-BqKm87JZ.js";import"./app-sidebar-header-RRnKZeeU.js";import"./breadcrumbs-DSMzNYiS.js";import"./nav-user-DuCZNsZX.js";import"./user-info-BGQvqBmO.js";import"./user-menu-content-BDm88xaM.js";import"./theme-switcher-cgyA7_cO.js";import"./icon-DpkedrXG.js";import"./field-renderer-DBKkDhBG.js";import"./dynamic-controls-BOYmRX_z.js";import"./input-error-CmXZF6xy.js";function Po(t){let e=null;return()=>(e==null&&(e=t()),e)}function Ic(t,e){return t.filter(n=>n!==e)}function Ac(t,e){const n=new Set,r=s=>n.add(s);t.forEach(r),e.forEach(r);const i=[];return n.forEach(s=>i.push(s)),i}class Mc{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=Ac(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=Ic(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class Rc{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const Oo="__NATIVE_FILE__",Io="__NATIVE_URL__",Ao="__NATIVE_TEXT__",Mo="__NATIVE_HTML__",ji=Object.freeze(Object.defineProperty({__proto__:null,FILE:Oo,HTML:Mo,TEXT:Ao,URL:Io},Symbol.toStringTag,{value:"Module"}));function kn(t,e,n){const r=e.reduce((i,s)=>i||t.getData(s),"");return r??n}const sr={[Oo]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[Mo]:{exposeProperties:{html:(t,e)=>kn(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[Io]:{exposeProperties:{urls:(t,e)=>kn(t,e,"").split(`
2
- `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[Ao]:{exposeProperties:{text:(t,e)=>kn(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function Nc(t,e){const n=sr[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new Rc(n);return r.loadDataTransfer(e),r}function Ln(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(sr).filter(n=>{const r=sr[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const kc=Po(()=>/firefox/i.test(navigator.userAgent)),Ro=Po(()=>!!window.safari);class _i{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:s,c3s:o}=this;let a=n.length-1;if(e===n[a])return r[a];let l=0,c=o.length-1,u;for(;l<=c;){u=Math.floor(.5*(l+c));const f=n[u];if(f<e)l=u+1;else if(f>e)c=u-1;else return r[u]}a=Math.max(0,c);const d=e-n[a],h=d*d;return r[a]+i[a]*d+s[a]*h+o[a]*d*h}constructor(e,n){const{length:r}=e,i=[];for(let f=0;f<r;f++)i.push(f);i.sort((f,p)=>e[f]<e[p]?-1:1);const s=[],o=[];let a,l;for(let f=0;f<r-1;f++)a=e[f+1]-e[f],l=n[f+1]-n[f],s.push(a),o.push(l/a);const c=[o[0]];for(let f=0;f<s.length-1;f++){const p=o[f],g=o[f+1];if(p*g<=0)c.push(0);else{a=s[f];const b=s[f+1],y=a+b;c.push(3*y/((y+b)/p+(y+a)/g))}}c.push(o[o.length-1]);const u=[],d=[];let h;for(let f=0;f<c.length-1;f++){h=o[f];const p=c[f],g=1/s[f],b=p+c[f+1]-h-h;u.push((h-p-b)*g),d.push(b*g*g)}this.xs=e,this.ys=n,this.c1s=c,this.c2s=u,this.c3s=d}}const Lc=1;function No(t){const e=t.nodeType===Lc?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Ft(t){return{x:t.clientX,y:t.clientY}}function Vc(t){var e;return t.nodeName==="IMG"&&(kc()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function jc(t,e,n,r){let i=t?e.width:n,s=t?e.height:r;return Ro()&&t&&(s/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:s}}function _c(t,e,n,r,i){const s=Vc(e),a=No(s?t:e),l={x:n.x-a.x,y:n.y-a.y},{offsetWidth:c,offsetHeight:u}=t,{anchorX:d,anchorY:h}=r,{dragPreviewWidth:f,dragPreviewHeight:p}=jc(s,e,c,u),g=()=>{let P=new _i([0,.5,1],[l.y,l.y/u*p,l.y+p-u]).interpolate(h);return Ro()&&s&&(P+=(window.devicePixelRatio-1)*p),P},b=()=>new _i([0,.5,1],[l.x,l.x/c*f,l.x+f-c]).interpolate(d),{offsetX:y,offsetY:T}=i,S=y===0||y,E=T===0||T;return{x:S?y:b(),y:E?T:g()}}let Bc=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}};function Fc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bi(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Fc(t,i,n[i])})}return t}class zc{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=o=>this.handleDragStart(o,e),s=o=>this.handleSelectStart(o);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=o=>this.handleDragEnter(o,e),i=o=>this.handleDragOver(o,e),s=o=>this.handleDrop(o,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",s),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",s)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return Bi({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return Bi({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(ji).some(n=>ji[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=Nc(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&No(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const o=Ft(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:a}=i,l=Ln(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const u=this.monitor.getSourceId(),d=this.sourceNodes.get(u),h=this.sourcePreviewNodes.get(u)||d;if(h){const{anchorX:f,anchorY:p,offsetX:g,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),S=_c(d,h,o,{anchorX:f,anchorY:p},{offsetX:g,offsetY:b});a.setDragImage(h,S.x,S.y)}}try{a==null||a.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(a&&!a.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:a}=i,l=Ln(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,s.length>0&&this.actions.hover(s,{clientOffset:Ft(i)}),s.some(a=>this.monitor.canDropOnTarget(a))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Ft(i),this.scheduleHover(s),(s||[]).some(a=>this.monitor.canDropOnTarget(a))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;i.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}else Ln(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:Ft(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const s=i.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(i.preventDefault(),s.dragDrop()))},this.options=new Bc(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Mc(this.isNodeInDocument)}}let zt;function Uc(){return zt||(zt=new Image,zt.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),zt}const Hc=function(e,n,r){return new zc(e,n,r)};var Be=[],$c=function(){return Be.some(function(t){return t.activeTargets.length>0})},Wc=function(){return Be.some(function(t){return t.skippedTargets.length>0})},Fi="ResizeObserver loop completed with undelivered notifications.",Gc=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Fi}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Fi),window.dispatchEvent(t)},wt;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(wt||(wt={}));var Fe=function(t){return Object.freeze(t)},qc=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,Fe(this)}return t})(),ko=(function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Fe(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,s=e.right,o=e.bottom,a=e.left,l=e.width,c=e.height;return{x:n,y:r,top:i,right:s,bottom:o,left:a,width:l,height:c}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),_r=function(t){return t instanceof SVGElement&&"getBBox"in t},Lo=function(t){if(_r(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,s=i.offsetWidth,o=i.offsetHeight;return!(s||o||t.getClientRects().length)},zi=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Kc=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},mt=typeof window<"u"?window:{},Ut=new WeakMap,Ui=/auto|scroll/,Xc=/^tb|vertical/,Yc=/msie|trident/i.test(mt.navigator&&mt.navigator.userAgent),he=function(t){return parseFloat(t||"0")},Ze=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new qc((n?e:t)||0,(n?t:e)||0)},Hi=Fe({devicePixelContentBoxSize:Ze(),borderBoxSize:Ze(),contentBoxSize:Ze(),contentRect:new ko(0,0,0,0)}),Vo=function(t,e){if(e===void 0&&(e=!1),Ut.has(t)&&!e)return Ut.get(t);if(Lo(t))return Ut.set(t,Hi),Hi;var n=getComputedStyle(t),r=_r(t)&&t.ownerSVGElement&&t.getBBox(),i=!Yc&&n.boxSizing==="border-box",s=Xc.test(n.writingMode||""),o=!r&&Ui.test(n.overflowY||""),a=!r&&Ui.test(n.overflowX||""),l=r?0:he(n.paddingTop),c=r?0:he(n.paddingRight),u=r?0:he(n.paddingBottom),d=r?0:he(n.paddingLeft),h=r?0:he(n.borderTopWidth),f=r?0:he(n.borderRightWidth),p=r?0:he(n.borderBottomWidth),g=r?0:he(n.borderLeftWidth),b=d+c,y=l+u,T=g+f,S=h+p,E=a?t.offsetHeight-S-t.clientHeight:0,w=o?t.offsetWidth-T-t.clientWidth:0,P=i?b+T:0,j=i?y+S:0,A=r?r.width:he(n.width)-P-w,U=r?r.height:he(n.height)-j-E,_=A+b+w+T,J=U+y+E+S,de=Fe({devicePixelContentBoxSize:Ze(Math.round(A*devicePixelRatio),Math.round(U*devicePixelRatio),s),borderBoxSize:Ze(_,J,s),contentBoxSize:Ze(A,U,s),contentRect:new ko(d,l,A,U)});return Ut.set(t,de),de},jo=function(t,e,n){var r=Vo(t,n),i=r.borderBoxSize,s=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(e){case wt.DEVICE_PIXEL_CONTENT_BOX:return o;case wt.BORDER_BOX:return i;default:return s}},Zc=(function(){function t(e){var n=Vo(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=Fe([n.borderBoxSize]),this.contentBoxSize=Fe([n.contentBoxSize]),this.devicePixelContentBoxSize=Fe([n.devicePixelContentBoxSize])}return t})(),_o=function(t){if(Lo(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Jc=function(){var t=1/0,e=[];Be.forEach(function(o){if(o.activeTargets.length!==0){var a=[];o.activeTargets.forEach(function(c){var u=new Zc(c.target),d=_o(c.target);a.push(u),c.lastReportedSize=jo(c.target,c.observedBox),d<t&&(t=d)}),e.push(function(){o.callback.call(o.observer,a,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t},$i=function(t){Be.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&(_o(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})},Qc=function(){var t=0;for($i(t);$c();)t=Jc(),$i(t);return Wc()&&Gc(),t>0},Vn,Bo=[],eu=function(){return Bo.splice(0).forEach(function(t){return t()})},tu=function(t){if(!Vn){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return eu()}).observe(n,r),Vn=function(){n.textContent="".concat(e?e--:e++)}}Bo.push(t),Vn()},nu=function(t){tu(function(){requestAnimationFrame(t)})},Yt=0,ru=function(){return!!Yt},iu=250,su={attributes:!0,characterData:!0,childList:!0,subtree:!0},Wi=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Gi=function(t){return t===void 0&&(t=0),Date.now()+t},jn=!1,ou=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=iu),!jn){jn=!0;var r=Gi(e);nu(function(){var i=!1;try{i=Qc()}finally{if(jn=!1,e=r-Gi(),!ru())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,su)};document.body?n():mt.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Wi.forEach(function(n){return mt.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Wi.forEach(function(n){return mt.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),or=new ou,qi=function(t){!Yt&&t>0&&or.start(),Yt+=t,!Yt&&or.stop()},au=function(t){return!_r(t)&&!Kc(t)&&getComputedStyle(t).display==="inline"},lu=(function(){function t(e,n){this.target=e,this.observedBox=n||wt.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=jo(this.target,this.observedBox,!0);return au(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),cu=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Ht=new WeakMap,Ki=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},$t=(function(){function t(){}return t.connect=function(e,n){var r=new cu(e,n);Ht.set(e,r)},t.observe=function(e,n,r){var i=Ht.get(e),s=i.observationTargets.length===0;Ki(i.observationTargets,n)<0&&(s&&Be.push(i),i.observationTargets.push(new lu(n,r&&r.box)),qi(1),or.schedule())},t.unobserve=function(e,n){var r=Ht.get(e),i=Ki(r.observationTargets,n),s=r.observationTargets.length===1;i>=0&&(s&&Be.splice(Be.indexOf(r),1),r.observationTargets.splice(i,1),qi(-1))},t.disconnect=function(e){var n=this,r=Ht.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),uu=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");$t.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!zi(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");$t.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!zi(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");$t.unobserve(this,e)},t.prototype.disconnect=function(){$t.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();const Fo=m.createContext({});function du(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const Br=m.createContext(null),zo=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function hu(t=!0){const e=m.useContext(Br);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=m.useId();m.useEffect(()=>{t&&i(s)},[t]);const o=m.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,o]:[!0]}const Fr=typeof window<"u",fu=Fr?m.useLayoutEffect:m.useEffect,te=t=>t;let Uo=te;function zr(t){let e;return()=>(e===void 0&&(e=t()),e)}const Je=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},ve=t=>t*1e3,ye=t=>t/1e3,pu={useManualTiming:!1};function gu(t){let e=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(l.schedule(c),t()),c(o)}const l={schedule:(c,u=!1,d=!1)=>{const f=d&&r?e:n;return u&&s.add(c),f.has(c)||f.add(c),c},cancel:c=>{n.delete(c),s.delete(c)},process:c=>{if(o=c,r){i=!0;return}r=!0,[e,n]=[n,e],e.forEach(a),e.clear(),r=!1,i&&(i=!1,l.process(c))}};return l}const Wt=["read","resolveKeyframes","update","preRender","render","postRender"],mu=40;function Ho(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Wt.reduce((y,T)=>(y[T]=gu(s),y),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:h}=o,f=()=>{const y=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(y-i.timestamp,mu),1),i.timestamp=y,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(f))},p=()=>{n=!0,r=!0,i.isProcessing||t(f)};return{schedule:Wt.reduce((y,T)=>{const S=o[T];return y[T]=(E,w=!1,P=!1)=>(n||p(),S.schedule(E,w,P)),y},{}),cancel:y=>{for(let T=0;T<Wt.length;T++)o[Wt[T]].cancel(y)},state:i,steps:o}}const{schedule:B,cancel:Ce,state:K,steps:_n}=Ho(typeof requestAnimationFrame<"u"?requestAnimationFrame:te,!0),$o=m.createContext({strict:!1}),Xi={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Qe={};for(const t in Xi)Qe[t]={isEnabled:e=>Xi[t].some(n=>!!e[n])};function vu(t){for(const e in t)Qe[e]={...Qe[e],...t[e]}}const yu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function an(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||yu.has(t)}let Wo=t=>!an(t);function bu(t){t&&(Wo=e=>e.startsWith("on")?!an(e):t(e))}try{bu(require("@emotion/is-prop-valid").default)}catch{}function xu(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(Wo(i)||n===!0&&an(i)||!e&&!an(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}function Tu(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...r)=>t(...r);return new Proxy(n,{get:(r,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const gn=m.createContext({});function Dt(t){return typeof t=="string"||Array.isArray(t)}function mn(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Ur=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Hr=["initial",...Ur];function vn(t){return mn(t.animate)||Hr.some(e=>Dt(t[e]))}function Go(t){return!!(vn(t)||t.variants)}function Su(t,e){if(vn(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Dt(n)?n:void 0,animate:Dt(r)?r:void 0}}return t.inherit!==!1?e:{}}function wu(t){const{initial:e,animate:n}=Su(t,m.useContext(gn));return m.useMemo(()=>({initial:e,animate:n}),[Yi(e),Yi(n)])}function Yi(t){return Array.isArray(t)?t.join(" "):t}const Du=Symbol.for("motionComponentSymbol");function Ge(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Cu(t,e,n){return m.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):Ge(n)&&(n.current=r))},[e])}const $r=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Eu="framerAppearId",qo="data-"+$r(Eu),{schedule:Wr}=Ho(queueMicrotask,!1),Ko=m.createContext({});function Pu(t,e,n,r,i){var s,o;const{visualElement:a}=m.useContext(gn),l=m.useContext($o),c=m.useContext(Br),u=m.useContext(zo).reducedMotion,d=m.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=d.current,f=m.useContext(Ko);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&Ou(d.current,n,i,f);const p=m.useRef(!1);m.useInsertionEffect(()=>{h&&p.current&&h.update(n,c)});const g=n[qo],b=m.useRef(!!g&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,g))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,g)));return fu(()=>{h&&(p.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Wr.render(h.render),b.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),b.current=!1))}),h}function Ou(t,e,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Xo(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ge(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function Xo(t){if(t)return t.options.allowProjection!==!1?t.projection:Xo(t.parent)}function Iu({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){var s,o;t&&vu(t);function a(c,u){let d;const h={...m.useContext(zo),...c,layoutId:Au(c)},{isStatic:f}=h,p=wu(c),g=r(c,f);if(!f&&Fr){Mu();const b=Ru(h);d=b.MeasureLayout,p.visualElement=Pu(i,g,h,e,b.ProjectionNode)}return v.jsxs(gn.Provider,{value:p,children:[d&&p.visualElement?v.jsx(d,{visualElement:p.visualElement,...h}):null,n(i,c,Cu(g,p.visualElement,u),g,f,p.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const l=m.forwardRef(a);return l[Du]=i,l}function Au({layoutId:t}){const e=m.useContext(Fo).id;return e&&t!==void 0?e+"-"+t:t}function Mu(t,e){m.useContext($o).strict}function Ru(t){const{drag:e,layout:n}=Qe;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Nu=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Gr(t){return typeof t!="string"||t.includes("-")?!1:!!(Nu.indexOf(t)>-1||/[A-Z]/u.test(t))}function Zi(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function qr(t,e,n,r){if(typeof e=="function"){const[i,s]=Zi(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=Zi(r);e=e(n!==void 0?n:t.custom,i,s)}return e}const ar=t=>Array.isArray(t),ku=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Lu=t=>ar(t)?t[t.length-1]||0:t,Y=t=>!!(t&&t.getVelocity);function Zt(t){const e=Y(t)?t.get():t;return ku(e)?e.toValue():e}function Vu({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},r,i,s){const o={latestValues:ju(r,i,s,t),renderState:e()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Yo=t=>(e,n)=>{const r=m.useContext(gn),i=m.useContext(Br),s=()=>Vu(t,e,r,i);return n?s():du(s)};function ju(t,e,n,r){const i={},s=r(t,{});for(const h in s)i[h]=Zt(s[h]);let{initial:o,animate:a}=t;const l=vn(t),c=Go(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!mn(d)){const h=Array.isArray(d)?d:[d];for(let f=0;f<h.length;f++){const p=qr(t,h[f]);if(p){const{transitionEnd:g,transition:b,...y}=p;for(const T in y){let S=y[T];if(Array.isArray(S)){const E=u?S.length-1:0;S=S[E]}S!==null&&(i[T]=S)}for(const T in g)i[T]=g[T]}}}return i}const tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],He=new Set(tt),Zo=t=>e=>typeof e=="string"&&e.startsWith(t),Jo=Zo("--"),_u=Zo("var(--"),Kr=t=>_u(t)?Bu.test(t.split("/*")[0].trim()):!1,Bu=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Qo=(t,e)=>e&&typeof t=="number"?e.transform(t):t,be=(t,e,n)=>n>e?e:n<t?t:n,nt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ct={...nt,transform:t=>be(0,1,t)},Gt={...nt,default:1},It=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Te=It("deg"),fe=It("%"),I=It("px"),Fu=It("vh"),zu=It("vw"),Ji={...fe,parse:t=>fe.parse(t)/100,transform:t=>fe.transform(t*100)},Uu={borderWidth:I,borderTopWidth:I,borderRightWidth:I,borderBottomWidth:I,borderLeftWidth:I,borderRadius:I,radius:I,borderTopLeftRadius:I,borderTopRightRadius:I,borderBottomRightRadius:I,borderBottomLeftRadius:I,width:I,maxWidth:I,height:I,maxHeight:I,top:I,right:I,bottom:I,left:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,backgroundPositionX:I,backgroundPositionY:I},Hu={rotate:Te,rotateX:Te,rotateY:Te,rotateZ:Te,scale:Gt,scaleX:Gt,scaleY:Gt,scaleZ:Gt,skew:Te,skewX:Te,skewY:Te,distance:I,translateX:I,translateY:I,translateZ:I,x:I,y:I,z:I,perspective:I,transformPerspective:I,opacity:Ct,originX:Ji,originY:Ji,originZ:I},Qi={...nt,transform:Math.round},Xr={...Uu,...Hu,zIndex:Qi,size:I,fillOpacity:Ct,strokeOpacity:Ct,numOctaves:Qi},$u={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Wu=tt.length;function Gu(t,e,n){let r="",i=!0;for(let s=0;s<Wu;s++){const o=tt[s],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Qo(a,Xr[o]);if(!l){i=!1;const u=$u[o]||o;r+=`${u}(${c}) `}n&&(e[o]=c)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function Yr(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if(He.has(l)){o=!0;continue}else if(Jo(l)){i[l]=c;continue}else{const u=Qo(c,Xr[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(e.transform||(o||n?r.transform=Gu(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const qu={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ku={offset:"strokeDashoffset",array:"strokeDasharray"};function Xu(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?qu:Ku;t[s.offset]=I.transform(-r);const o=I.transform(e),a=I.transform(n);t[s.array]=`${o} ${a}`}function es(t,e,n){return typeof t=="string"?t:I.transform(e+n*t)}function Yu(t,e,n){const r=es(e,t.x,t.width),i=es(n,t.y,t.height);return`${r} ${i}`}function Zr(t,{attrX:e,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(Yr(t,c,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f,dimensions:p}=t;h.transform&&(p&&(f.transform=h.transform),delete h.transform),p&&(i!==void 0||s!==void 0||f.transform)&&(f.transformOrigin=Yu(p,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Xu(h,o,a,l,!1)}const Jr=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),ea=()=>({...Jr(),attrs:{}}),Qr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ta(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const s in n)t.style.setProperty(s,n[s])}const na=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ra(t,e,n,r){ta(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(na.has(i)?i:$r(i),e.attrs[i])}const ln={};function Zu(t){Object.assign(ln,t)}function ia(t,{layout:e,layoutId:n}){return He.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!ln[t]||t==="opacity")}function ei(t,e,n){var r;const{style:i}=t,s={};for(const o in i)(Y(i[o])||e.style&&Y(e.style[o])||ia(o,t)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function sa(t,e,n){const r=ei(t,e,n);for(const i in t)if(Y(t[i])||Y(e[i])){const s=tt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}function Ju(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const ts=["x","y","width","height","cx","cy","r"],Qu={useVisualState:Yo({scrapeMotionValuesFromProps:sa,createRenderState:ea,onUpdate:({props:t,prevProps:e,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!t.drag;if(!s){for(const a in i)if(He.has(a)){s=!0;break}}if(!s)return;let o=!e;if(e)for(let a=0;a<ts.length;a++){const l=ts[a];t[l]!==e[l]&&(o=!0)}o&&B.read(()=>{Ju(n,r),B.render(()=>{Zr(r,i,Qr(n.tagName),t.transformTemplate),ra(n,r)})})}})},ed={useVisualState:Yo({scrapeMotionValuesFromProps:ei,createRenderState:Jr})};function oa(t,e,n){for(const r in e)!Y(e[r])&&!ia(r,n)&&(t[r]=e[r])}function td({transformTemplate:t},e){return m.useMemo(()=>{const n=Jr();return Yr(n,e,t),Object.assign({},n.vars,n.style)},[e])}function nd(t,e){const n=t.style||{},r={};return oa(r,n,t),Object.assign(r,td(t,e)),r}function rd(t,e){const n={},r=nd(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}function id(t,e,n,r){const i=m.useMemo(()=>{const s=ea();return Zr(s,e,Qr(r),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};oa(s,t.style,t),i.style={...s,...i.style}}return i}function sd(t=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Gr(n)?id:rd)(r,s,o,n),c=xu(r,typeof n=="string",t),u=n!==m.Fragment?{...c,...l,ref:i}:{},{children:d}=r,h=m.useMemo(()=>Y(d)?d.get():d,[d]);return m.createElement(n,{...u,children:h})}}function od(t,e){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Gr(r)?Qu:ed,preloadedFeatures:t,useRender:sd(i),createVisualElement:e,Component:r};return Iu(o)}}function aa(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function yn(t,e,n){const r=t.getProps();return qr(r,e,n!==void 0?n:r.custom,t)}const ad=zr(()=>window.ScrollTimeline!==void 0);class ld{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e,n){const r=this.animations.map(i=>{if(ad()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class cd extends ld{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function ti(t,e){return t?t[e]||t.default||t:void 0}const lr=2e4;function la(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<lr;)e+=n,r=t.next(e);return e>=lr?1/0:e}function ni(t){return typeof t=="function"}function ns(t,e){t.timeline=e,t.onfinish=null}const ri=t=>Array.isArray(t)&&typeof t[0]=="number",ud={linearEasing:void 0};function dd(t,e){const n=zr(t);return()=>{var r;return(r=ud[e])!==null&&r!==void 0?r:n()}}const cn=dd(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ca=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=t(Je(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function ua(t){return!!(typeof t=="function"&&cn()||!t||typeof t=="string"&&(t in cr||cn())||ri(t)||Array.isArray(t)&&t.every(ua))}const dt=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,cr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dt([0,.65,.55,1]),circOut:dt([.55,0,1,.45]),backIn:dt([.31,.01,.66,-.59]),backOut:dt([.33,1.53,.69,.99])};function da(t,e){if(t)return typeof t=="function"&&cn()?ca(t,e):ri(t)?dt(t):Array.isArray(t)?t.map(n=>da(n,e)||cr.easeOut):cr[t]}const ue={x:!1,y:!1};function ha(){return ue.x||ue.y}function hd(t,e,n){var r;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function fa(t,e){const n=hd(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function rs(t){return e=>{e.pointerType==="touch"||ha()||t(e)}}function fd(t,e,n={}){const[r,i,s]=fa(t,n),o=rs(a=>{const{target:l}=a,c=e(a);if(typeof c!="function"||!l)return;const u=rs(d=>{c(d),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const pa=(t,e)=>e?t===e?!0:pa(t,e.parentElement):!1,ii=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,pd=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function gd(t){return pd.has(t.tagName)||t.tabIndex!==-1}const ht=new WeakSet;function is(t){return e=>{e.key==="Enter"&&t(e)}}function Bn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const md=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=is(()=>{if(ht.has(n))return;Bn(n,"down");const i=is(()=>{Bn(n,"up")}),s=()=>Bn(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function ss(t){return ii(t)&&!ha()}function vd(t,e,n={}){const[r,i,s]=fa(t,n),o=a=>{const l=a.currentTarget;if(!ss(a)||ht.has(l))return;ht.add(l);const c=e(a),u=(f,p)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),!(!ss(f)||!ht.has(l))&&(ht.delete(l),typeof c=="function"&&c(f,{success:p}))},d=f=>{u(f,n.useGlobalTarget||pa(l,f.target))},h=f=>{u(f,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{!gd(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",c=>md(c,i),i)}),s}function yd(t){return t==="x"||t==="y"?ue[t]?null:(ue[t]=!0,()=>{ue[t]=!1}):ue.x||ue.y?null:(ue.x=ue.y=!0,()=>{ue.x=ue.y=!1})}const ga=new Set(["width","height","top","left","right","bottom",...tt]);let Jt;function bd(){Jt=void 0}const pe={now:()=>(Jt===void 0&&pe.set(K.isProcessing||pu.useManualTiming?K.timestamp:performance.now()),Jt),set:t=>{Jt=t,queueMicrotask(bd)}};function si(t,e){t.indexOf(e)===-1&&t.push(e)}function oi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ai{constructor(){this.subscriptions=[]}add(e){return si(this.subscriptions,e),()=>oi(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ma(t,e){return e?t*(1e3/e):0}const os=30,xd=t=>!isNaN(parseFloat(t));class Td{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=pe.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=pe.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=xd(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new ai);const r=this.events[e].add(n);return e==="change"?()=>{r(),B.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=pe.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>os)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,os);return ma(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Et(t,e){return new Td(t,e)}function Sd(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Et(n))}function wd(t,e){const n=yn(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=Lu(s[o]);Sd(t,o,a)}}function Dd(t){return!!(Y(t)&&t.add)}function ur(t,e){const n=t.getValue("willChange");if(Dd(n))return n.add(e)}function va(t){return t.props[qo]}const ya=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Cd=1e-7,Ed=12;function Pd(t,e,n,r,i){let s,o,a=0;do o=e+(n-e)/2,s=ya(o,r,i)-t,s>0?n=o:e=o;while(Math.abs(s)>Cd&&++a<Ed);return o}function At(t,e,n,r){if(t===e&&n===r)return te;const i=s=>Pd(s,0,1,t,n);return s=>s===0||s===1?s:ya(i(s),e,r)}const ba=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xa=t=>e=>1-t(1-e),Ta=At(.33,1.53,.69,.99),li=xa(Ta),Sa=ba(li),wa=t=>(t*=2)<1?.5*li(t):.5*(2-Math.pow(2,-10*(t-1))),ci=t=>1-Math.sin(Math.acos(t)),Da=xa(ci),Ca=ba(ci),Ea=t=>/^0[^.\s]+$/u.test(t);function Od(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ea(t):!0}const vt=t=>Math.round(t*1e5)/1e5,ui=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Id(t){return t==null}const Ad=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,di=(t,e)=>n=>!!(typeof n=="string"&&Ad.test(n)&&n.startsWith(t)||e&&!Id(n)&&Object.prototype.hasOwnProperty.call(n,e)),Pa=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(ui);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Md=t=>be(0,255,t),Fn={...nt,transform:t=>Math.round(Md(t))},je={test:di("rgb","red"),parse:Pa("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Fn.transform(t)+", "+Fn.transform(e)+", "+Fn.transform(n)+", "+vt(Ct.transform(r))+")"};function Rd(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const dr={test:di("#"),parse:Rd,transform:je.transform},qe={test:di("hsl","hue"),parse:Pa("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+fe.transform(vt(e))+", "+fe.transform(vt(n))+", "+vt(Ct.transform(r))+")"},X={test:t=>je.test(t)||dr.test(t)||qe.test(t),parse:t=>je.test(t)?je.parse(t):qe.test(t)?qe.parse(t):dr.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?je.transform(t):qe.transform(t)},Nd=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kd(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(ui))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Nd))===null||n===void 0?void 0:n.length)||0)>0}const Oa="number",Ia="color",Ld="var",Vd="var(",as="${}",jd=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pt(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(jd,l=>(X.test(l)?(r.color.push(s),i.push(Ia),n.push(X.parse(l))):l.startsWith(Vd)?(r.var.push(s),i.push(Ld),n.push(l)):(r.number.push(s),i.push(Oa),n.push(parseFloat(l))),++s,as)).split(as);return{values:n,split:a,indexes:r,types:i}}function Aa(t){return Pt(t).values}function Ma(t){const{split:e,types:n}=Pt(t),r=e.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=e[o],i[o]!==void 0){const a=n[o];a===Oa?s+=vt(i[o]):a===Ia?s+=X.transform(i[o]):s+=i[o]}return s}}const _d=t=>typeof t=="number"?0:t;function Bd(t){const e=Aa(t);return Ma(t)(e.map(_d))}const Ee={test:kd,parse:Aa,createTransformer:Ma,getAnimatableNone:Bd},Fd=new Set(["brightness","contrast","saturate","opacity"]);function zd(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(ui)||[];if(!r)return t;const i=n.replace(r,"");let s=Fd.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const Ud=/\b([a-z-]*)\(.*?\)/gu,hr={...Ee,getAnimatableNone:t=>{const e=t.match(Ud);return e?e.map(zd).join(" "):t}},Hd={...Xr,color:X,backgroundColor:X,outlineColor:X,fill:X,stroke:X,borderColor:X,borderTopColor:X,borderRightColor:X,borderBottomColor:X,borderLeftColor:X,filter:hr,WebkitFilter:hr},hi=t=>Hd[t];function Ra(t,e){let n=hi(t);return n!==hr&&(n=Ee),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const $d=new Set(["auto","none","0"]);function Wd(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!$d.has(s)&&Pt(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=Ra(n,i)}const ls=t=>t===nt||t===I,cs=(t,e)=>parseFloat(t.split(", ")[e]),us=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return cs(i[1],e);{const s=r.match(/^matrix\((.+)\)$/u);return s?cs(s[1],t):0}},Gd=new Set(["x","y","z"]),qd=tt.filter(t=>!Gd.has(t));function Kd(t){const e=[];return qd.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const et={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:us(4,13),y:us(5,14)};et.translateX=et.x;et.translateY=et.y;const ze=new Set;let fr=!1,pr=!1;function Na(){if(pr){const t=Array.from(ze).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=Kd(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}pr=!1,fr=!1,ze.forEach(t=>t.complete()),ze.clear()}function ka(){ze.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(pr=!0)})}function Xd(){ka(),Na()}class fi{constructor(e,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ze.add(this),fr||(fr=!0,B.read(ka),B.resolveKeyframes(Na))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;for(let s=0;s<e.length;s++)if(e[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[s]=e[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ze.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ze.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const La=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Yd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Zd(t){const e=Yd.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function Va(t,e,n=1){const[r,i]=Zd(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return La(o)?parseFloat(o):o}return Kr(i)?Va(i,e,n+1):i}const ja=t=>e=>e.test(t),Jd={test:t=>t==="auto",parse:t=>t},_a=[nt,I,fe,Te,zu,Fu,Jd],ds=t=>_a.find(ja(t));class Ba extends fi{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),Kr(c))){const u=Va(c,n.current);u!==void 0&&(e[l]=u),l===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!ga.has(r)||e.length!==2)return;const[i,s]=e,o=ds(i),a=ds(s);if(o!==a)if(ls(o)&&ls(a))for(let l=0;l<e.length;l++){const c=e[l];typeof c=="string"&&(e[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)Od(e[i])&&r.push(i);r.length&&Wd(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=et[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=et[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const hs=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ee.test(t)||t==="0")&&!t.startsWith("url("));function Qd(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function eh(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=hs(i,e),a=hs(s,e);return!o||!a?!1:Qd(t)||(n==="spring"||ni(n))&&r}const th=t=>t!==null;function bn(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(th),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const nh=40;class Fa{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=pe.now(),this.options={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>nh?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Xd(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=pe.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!eh(e,r,i,s))if(o)this.options.duration=0;else{l&&l(bn(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,n);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const H=(t,e,n)=>t+(e-t)*n;function zn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function rh({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,o=0;if(!e)i=s=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=zn(l,a,t+1/3),s=zn(l,a,t),o=zn(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function un(t,e){return n=>n>0?e:t}const Un=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},ih=[dr,je,qe],sh=t=>ih.find(e=>e.test(t));function fs(t){const e=sh(t);if(!e)return!1;let n=e.parse(t);return e===qe&&(n=rh(n)),n}const ps=(t,e)=>{const n=fs(t),r=fs(e);if(!n||!r)return un(t,e);const i={...n};return s=>(i.red=Un(n.red,r.red,s),i.green=Un(n.green,r.green,s),i.blue=Un(n.blue,r.blue,s),i.alpha=H(n.alpha,r.alpha,s),je.transform(i))},oh=(t,e)=>n=>e(t(n)),Mt=(...t)=>t.reduce(oh),gr=new Set(["none","hidden"]);function ah(t,e){return gr.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function lh(t,e){return n=>H(t,e,n)}function pi(t){return typeof t=="number"?lh:typeof t=="string"?Kr(t)?un:X.test(t)?ps:dh:Array.isArray(t)?za:typeof t=="object"?X.test(t)?ps:ch:un}function za(t,e){const n=[...t],r=n.length,i=t.map((s,o)=>pi(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function ch(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=pi(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function uh(t,e){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],a=t.indexes[o][i[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;r[s]=l,i[o]++}return r}const dh=(t,e)=>{const n=Ee.createTransformer(e),r=Pt(t),i=Pt(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?gr.has(t)&&!i.values.length||gr.has(e)&&!r.values.length?ah(t,e):Mt(za(uh(r,i),i.values),n):un(t,e)};function Ua(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?H(t,e,n):pi(t)(t,e)}const hh=5;function Ha(t,e,n){const r=Math.max(e-hh,0);return ma(n-t(r),e-r)}const $={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Hn=.001;function fh({duration:t=$.duration,bounce:e=$.bounce,velocity:n=$.velocity,mass:r=$.mass}){let i,s,o=1-e;o=be($.minDamping,$.maxDamping,o),t=be($.minDuration,$.maxDuration,ye(t)),o<1?(i=c=>{const u=c*o,d=u*t,h=u-n,f=mr(c,o),p=Math.exp(-d);return Hn-h/f*p},s=c=>{const d=c*o*t,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-d),g=mr(Math.pow(c,2),o);return(-i(c)+Hn>0?-1:1)*((h-f)*p)/g}):(i=c=>{const u=Math.exp(-c*t),d=(c-n)*t+1;return-Hn+u*d},s=c=>{const u=Math.exp(-c*t),d=(n-c)*(t*t);return u*d});const a=5/t,l=gh(i,s,a);if(t=ve(t),isNaN(l))return{stiffness:$.stiffness,damping:$.damping,duration:t};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:t}}}const ph=12;function gh(t,e,n){let r=n;for(let i=1;i<ph;i++)r=r-t(r)/e(r);return r}function mr(t,e){return t*Math.sqrt(1-e*e)}const mh=["duration","bounce"],vh=["stiffness","damping","mass"];function gs(t,e){return e.some(n=>t[n]!==void 0)}function yh(t){let e={velocity:$.velocity,stiffness:$.stiffness,damping:$.damping,mass:$.mass,isResolvedFromDuration:!1,...t};if(!gs(t,vh)&&gs(t,mh))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*be(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:$.mass,stiffness:i,damping:s}}else{const n=fh(t);e={...e,...n,mass:$.mass},e.isResolvedFromDuration=!0}return e}function $a(t=$.visualDuration,e=$.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:f}=yh({...n,velocity:-ye(n.velocity||0)}),p=h||0,g=c/(2*Math.sqrt(l*u)),b=o-s,y=ye(Math.sqrt(l/u)),T=Math.abs(b)<5;r||(r=T?$.restSpeed.granular:$.restSpeed.default),i||(i=T?$.restDelta.granular:$.restDelta.default);let S;if(g<1){const w=mr(y,g);S=P=>{const j=Math.exp(-g*y*P);return o-j*((p+g*y*b)/w*Math.sin(w*P)+b*Math.cos(w*P))}}else if(g===1)S=w=>o-Math.exp(-y*w)*(b+(p+y*b)*w);else{const w=y*Math.sqrt(g*g-1);S=P=>{const j=Math.exp(-g*y*P),A=Math.min(w*P,300);return o-j*((p+g*y*b)*Math.sinh(A)+w*b*Math.cosh(A))/w}}const E={calculatedDuration:f&&d||null,next:w=>{const P=S(w);if(f)a.done=w>=d;else{let j=0;g<1&&(j=w===0?ve(p):Ha(S,w,P));const A=Math.abs(j)<=r,U=Math.abs(o-P)<=i;a.done=A&&U}return a.value=a.done?o:P,a},toString:()=>{const w=Math.min(la(E),lr),P=ca(j=>E.next(w*j).value,w,30);return w+"ms "+P}};return E}function ms({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=t[0],h={done:!1,value:d},f=A=>a!==void 0&&A<a||l!==void 0&&A>l,p=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let g=n*e;const b=d+g,y=o===void 0?b:o(b);y!==b&&(g=y-d);const T=A=>-g*Math.exp(-A/r),S=A=>y+T(A),E=A=>{const U=T(A),_=S(A);h.done=Math.abs(U)<=c,h.value=h.done?y:_};let w,P;const j=A=>{f(h.value)&&(w=A,P=$a({keyframes:[h.value,p(h.value)],velocity:Ha(S,A,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return j(0),{calculatedDuration:null,next:A=>{let U=!1;return!P&&w===void 0&&(U=!0,E(A),j(A)),w!==void 0&&A>=w?P.next(A-w):(!U&&E(A),h)}}}const bh=At(.42,0,1,1),xh=At(0,0,.58,1),Wa=At(.42,0,.58,1),Th=t=>Array.isArray(t)&&typeof t[0]!="number",Sh={linear:te,easeIn:bh,easeInOut:Wa,easeOut:xh,circIn:ci,circInOut:Ca,circOut:Da,backIn:li,backInOut:Sa,backOut:Ta,anticipate:wa},vs=t=>{if(ri(t)){Uo(t.length===4);const[e,n,r,i]=t;return At(e,n,r,i)}else if(typeof t=="string")return Sh[t];return t};function wh(t,e,n){const r=[],i=n||Ua,s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||te:e;a=Mt(l,a)}r.push(a)}return r}function Dh(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(Uo(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=wh(e,r,i),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let d=0;if(l>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const h=Je(t[d],t[d+1],u);return a[d](h)};return n?u=>c(be(t[0],t[s-1],u)):c}function Ch(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Je(0,e,r);t.push(H(n,1,i))}}function Eh(t){const e=[0];return Ch(e,t.length-1),e}function Ph(t,e){return t.map(n=>n*e)}function Oh(t,e){return t.map(()=>e||Wa).splice(0,t.length-1)}function dn({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=Th(r)?r.map(vs):vs(r),s={done:!1,value:e[0]},o=Ph(n&&n.length===e.length?n:Eh(e),t),a=Dh(o,e,{ease:Array.isArray(i)?i:Oh(e,i)});return{calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}const Ih=t=>{const e=({timestamp:n})=>t(n);return{start:()=>B.update(e,!0),stop:()=>Ce(e),now:()=>K.isProcessing?K.timestamp:pe.now()}},Ah={decay:ms,inertia:ms,tween:dn,keyframes:dn,spring:$a},Mh=t=>t/100;class gi extends Fa{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||fi,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=ni(n)?n:Ah[n]||dn;let l,c;a!==dn&&typeof e[0]!="number"&&(l=Mt(Mh,Ua(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});s==="mirror"&&(c=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=la(u));const{calculatedDuration:d}=u,h=d+i,f=h*(r+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:h,totalDuration:f}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:h,repeat:f,repeatType:p,repeatDelay:g,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),T=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let S=this.currentTime,E=s;if(f){const A=Math.min(this.currentTime,u)/d;let U=Math.floor(A),_=A%1;!_&&A>=1&&(_=1),_===1&&U--,U=Math.min(U,f+1),!!(U%2)&&(p==="reverse"?(_=1-_,g&&(_-=g/d)):p==="mirror"&&(E=o)),S=be(0,1,_)*d}const w=T?{done:!1,value:l[0]}:E.next(S);a&&(w.value=a(w.value));let{done:P}=w;!T&&c!==null&&(P=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return j&&i!==void 0&&(w.value=bn(l,this.options,i)),b&&b(w.value),j&&this.finish(),w}get duration(){const{resolved:e}=this;return e?ye(e.calculatedDuration):0}get time(){return ye(this.currentTime)}set time(e){e=ve(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=ye(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Ih,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Rh=new Set(["opacity","clipPath","filter","transform"]);function Nh(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[e]:n};l&&(c.offset=l);const u=da(a,i);return Array.isArray(u)&&(c.easing=u),t.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const kh=zr(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),hn=10,Lh=2e4;function Vh(t){return ni(t.type)||t.type==="spring"||!ua(t.ease)}function jh(t,e){const n=new gi({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const i=[];let s=0;for(;!r.done&&s<Lh;)r=n.sample(s),i.push(r.value),s+=hn;return{times:void 0,keyframes:i,duration:s-hn,ease:"linear"}}const Ga={anticipate:wa,backInOut:Sa,circInOut:Ca};function _h(t){return t in Ga}class ys extends Fa{constructor(e){super(e);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new Ba(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&cn()&&_h(s)&&(s=Ga[s]),Vh(this.options)){const{onComplete:d,onUpdate:h,motionValue:f,element:p,...g}=this.options,b=jh(e,g);e=b.keyframes,e.length===1&&(e[1]=e[0]),r=b.duration,i=b.times,s=b.ease,o="keyframes"}const u=Nh(a.owner.current,l,e,{...this.options,duration:r,times:i,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(ns(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(bn(e,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:o,ease:s,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return ye(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return ye(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ve(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return te;const{animation:r}=n;ns(r,e)}return te}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:h,...f}=this.options,p=new gi({...f,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),g=ve(this.time);c.setWithVelocity(p.sample(g-hn).value,p.sample(g).value,hn)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return kh()&&r&&Rh.has(r)&&!l&&!c&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const Bh={type:"spring",stiffness:500,damping:25,restSpeed:10},Fh=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),zh={type:"keyframes",duration:.8},Uh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Hh=(t,{keyframes:e})=>e.length>2?zh:He.has(t)?t.startsWith("scale")?Fh(e[1]):Bh:Uh;function $h({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const mi=(t,e,n,r={},i,s)=>o=>{const a=ti(r,t)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ve(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:i};$h(a)||(u={...u,...Hh(t,u)}),u.duration&&(u.duration=ve(u.duration)),u.repeatDelay&&(u.repeatDelay=ve(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!s&&e.get()!==void 0){const h=bn(u.keyframes,a);if(h!==void 0)return B.update(()=>{u.onUpdate(h),u.onComplete()}),new cd([])}return!s&&ys.supports(u)?new ys(u):new gi(u)};function Wh({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function qa(t,e,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;r&&(o=r);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const d in l){const h=t.getValue(d,(s=t.latestValues[d])!==null&&s!==void 0?s:null),f=l[d];if(f===void 0||u&&Wh(u,d))continue;const p={delay:n,...ti(o||{},d)};let g=!1;if(window.MotionHandoffAnimation){const y=va(t);if(y){const T=window.MotionHandoffAnimation(y,d,B);T!==null&&(p.startTime=T,g=!0)}}ur(t,d),h.start(mi(d,h,f,t.shouldReduceMotion&&ga.has(d)?{type:!1}:p,t,g));const b=h.animation;b&&c.push(b)}return a&&Promise.all(c).then(()=>{B.update(()=>{a&&wd(t,a)})}),c}function vr(t,e,n={}){var r;const i=yn(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(qa(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=s;return Gh(t,e,u+c,d,h,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function Gh(t,e,n=0,r=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(t.variantChildren).sort(qh).forEach((c,u)=>{c.notify("AnimationStart",e),o.push(vr(c,e,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(o)}function qh(t,e){return t.sortNodePosition(e)}function Kh(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>vr(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=vr(t,e,n);else{const i=typeof e=="function"?yn(t,e,n.custom):e;r=Promise.all(qa(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const Xh=Hr.length;function Ka(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Ka(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Xh;n++){const r=Hr[n],i=t.props[r];(Dt(i)||i===!1)&&(e[r]=i)}return e}const Yh=[...Ur].reverse(),Zh=Ur.length;function Jh(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Kh(t,n,r)))}function Qh(t){let e=Jh(t),n=bs(),r=!0;const i=l=>(c,u)=>{var d;const h=yn(t,u,l==="exit"?(d=t.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(h){const{transition:f,transitionEnd:p,...g}=h;c={...c,...g,...p}}return c};function s(l){e=l(t)}function o(l){const{props:c}=t,u=Ka(t.parent)||{},d=[],h=new Set;let f={},p=1/0;for(let b=0;b<Zh;b++){const y=Yh[b],T=n[y],S=c[y]!==void 0?c[y]:u[y],E=Dt(S),w=y===l?T.isActive:null;w===!1&&(p=b);let P=S===u[y]&&S!==c[y]&&E;if(P&&r&&t.manuallyAnimateOnMount&&(P=!1),T.protectedKeys={...f},!T.isActive&&w===null||!S&&!T.prevProp||mn(S)||typeof S=="boolean")continue;const j=ef(T.prevProp,S);let A=j||y===l&&T.isActive&&!P&&E||b>p&&E,U=!1;const _=Array.isArray(S)?S:[S];let J=_.reduce(i(y),{});w===!1&&(J={});const{prevResolvedValues:de={}}=T,En={...de,...J},kt=q=>{A=!0,h.has(q)&&(U=!0,h.delete(q)),T.needsAnimating[q]=!0;const re=t.getValue(q);re&&(re.liveStyle=!1)};for(const q in En){const re=J[q],rt=de[q];if(f.hasOwnProperty(q))continue;let it=!1;ar(re)&&ar(rt)?it=!aa(re,rt):it=re!==rt,it?re!=null?kt(q):h.add(q):re!==void 0&&h.has(q)?kt(q):T.protectedKeys[q]=!0}T.prevProp=S,T.prevResolvedValues=J,T.isActive&&(f={...f,...J}),r&&t.blockInitialAnimation&&(A=!1),A&&(!(P&&j)||U)&&d.push(..._.map(q=>({animation:q,options:{type:y}})))}if(h.size){const b={};h.forEach(y=>{const T=t.getBaseTarget(y),S=t.getValue(y);S&&(S.liveStyle=!0),b[y]=T??null}),d.push({animation:b})}let g=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),r=!1,g?e(d):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=t.variantChildren)===null||u===void 0||u.forEach(h=>{var f;return(f=h.animationState)===null||f===void 0?void 0:f.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=bs(),r=!0}}}function ef(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!aa(e,t):!1}function Me(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bs(){return{animate:Me(!0),whileInView:Me(),whileHover:Me(),whileTap:Me(),whileDrag:Me(),whileFocus:Me(),exit:Me()}}class Oe{constructor(e){this.isMounted=!1,this.node=e}update(){}}class tf extends Oe{constructor(e){super(e),e.animationState||(e.animationState=Qh(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();mn(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let nf=0;class rf extends Oe{constructor(){super(...arguments),this.id=nf++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const sf={animation:{Feature:tf},exit:{Feature:rf}};function Ot(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function Rt(t){return{point:{x:t.pageX,y:t.pageY}}}const of=t=>e=>ii(e)&&t(e,Rt(e));function yt(t,e,n,r){return Ot(t,e,of(n),r)}const xs=(t,e)=>Math.abs(t-e);function af(t,e){const n=xs(t.x,e.x),r=xs(t.y,e.y);return Math.sqrt(n**2+r**2)}class Xa{constructor(e,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Wn(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=af(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:g}=K;this.history.push({...p,timestamp:g});const{onStart:b,onMove:y}=this.handlers;h||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=$n(h,this.transformPagePoint),B.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Wn(d.type==="pointercancel"?this.lastMoveEventInfo:$n(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,b),p&&p(d,b)},!ii(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Rt(e),a=$n(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=K;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(e,Wn(a,this.history)),this.removeListeners=Mt(yt(this.contextWindow,"pointermove",this.handlePointerMove),yt(this.contextWindow,"pointerup",this.handlePointerUp),yt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Ce(this.updatePoint)}}function $n(t,e){return e?{point:e(t.point)}:t}function Ts(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Wn({point:t},e){return{point:t,delta:Ts(t,Ya(e)),offset:Ts(t,lf(e)),velocity:cf(e,.1)}}function lf(t){return t[0]}function Ya(t){return t[t.length-1]}function cf(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Ya(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>ve(e)));)n--;if(!r)return{x:0,y:0};const s=ye(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const Za=1e-4,uf=1-Za,df=1+Za,Ja=.01,hf=0-Ja,ff=0+Ja;function ne(t){return t.max-t.min}function pf(t,e,n){return Math.abs(t-e)<=n}function Ss(t,e,n,r=.5){t.origin=r,t.originPoint=H(e.min,e.max,t.origin),t.scale=ne(n)/ne(e),t.translate=H(n.min,n.max,t.origin)-t.originPoint,(t.scale>=uf&&t.scale<=df||isNaN(t.scale))&&(t.scale=1),(t.translate>=hf&&t.translate<=ff||isNaN(t.translate))&&(t.translate=0)}function bt(t,e,n,r){Ss(t.x,e.x,n.x,r?r.originX:void 0),Ss(t.y,e.y,n.y,r?r.originY:void 0)}function ws(t,e,n){t.min=n.min+e.min,t.max=t.min+ne(e)}function gf(t,e,n){ws(t.x,e.x,n.x),ws(t.y,e.y,n.y)}function Ds(t,e,n){t.min=e.min-n.min,t.max=t.min+ne(e)}function xt(t,e,n){Ds(t.x,e.x,n.x),Ds(t.y,e.y,n.y)}function mf(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?H(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?H(n,t,r.max):Math.min(t,n)),t}function Cs(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function vf(t,{top:e,left:n,bottom:r,right:i}){return{x:Cs(t.x,n,i),y:Cs(t.y,e,r)}}function Es(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function yf(t,e){return{x:Es(t.x,e.x),y:Es(t.y,e.y)}}function bf(t,e){let n=.5;const r=ne(t),i=ne(e);return i>r?n=Je(e.min,e.max-r,t.min):r>i&&(n=Je(t.min,t.max-i,e.min)),be(0,1,n)}function xf(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const yr=.35;function Tf(t=yr){return t===!1?t=0:t===!0&&(t=yr),{x:Ps(t,"left","right"),y:Ps(t,"top","bottom")}}function Ps(t,e,n){return{min:Os(t,e),max:Os(t,n)}}function Os(t,e){return typeof t=="number"?t:t[e]||0}const Is=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ke=()=>({x:Is(),y:Is()}),As=()=>({min:0,max:0}),G=()=>({x:As(),y:As()});function ae(t){return[t("x"),t("y")]}function Qa({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Sf({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function wf(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Gn(t){return t===void 0||t===1}function br({scale:t,scaleX:e,scaleY:n}){return!Gn(t)||!Gn(e)||!Gn(n)}function Re(t){return br(t)||el(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function el(t){return Ms(t.x)||Ms(t.y)}function Ms(t){return t&&t!=="0%"}function fn(t,e,n){const r=t-n,i=e*r;return n+i}function Rs(t,e,n,r,i){return i!==void 0&&(t=fn(t,i,r)),fn(t,n,r)+e}function xr(t,e=0,n=1,r,i){t.min=Rs(t.min,e,n,r,i),t.max=Rs(t.max,e,n,r,i)}function tl(t,{x:e,y:n}){xr(t.x,e.translate,e.scale,e.originPoint),xr(t.y,n.translate,n.scale,n.originPoint)}const Ns=.999999999999,ks=1.0000000000001;function Df(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ye(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,tl(t,o)),r&&Re(s.latestValues)&&Ye(t,s.latestValues))}e.x<ks&&e.x>Ns&&(e.x=1),e.y<ks&&e.y>Ns&&(e.y=1)}function Xe(t,e){t.min=t.min+e,t.max=t.max+e}function Ls(t,e,n,r,i=.5){const s=H(t.min,t.max,i);xr(t,e,n,s,r)}function Ye(t,e){Ls(t.x,e.x,e.scaleX,e.scale,e.originX),Ls(t.y,e.y,e.scaleY,e.scale,e.originY)}function nl(t,e){return Qa(wf(t.getBoundingClientRect(),e))}function Cf(t,e,n){const r=nl(t,n),{scroll:i}=e;return i&&(Xe(r.x,i.offset.x),Xe(r.y,i.offset.y)),r}const rl=({current:t})=>t?t.ownerDocument.defaultView:null,Ef=new WeakMap;class Pf{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=G(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Rt(u).point)},s=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yd(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ae(b=>{let y=this.getAxisMotionValue(b).get()||0;if(fe.test(y)){const{projection:T}=this.visualElement;if(T&&T.layout){const S=T.layout.layoutBox[b];S&&(y=ne(S)*(parseFloat(y)/100))}}this.originPoint[b]=y}),p&&B.postRender(()=>p(u,d)),ur(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:g}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:b}=d;if(f&&this.currentDirection===null){this.currentDirection=Of(b),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,b),this.updateAxis("y",d.point,b),this.visualElement.render(),g&&g(u,d)},a=(u,d)=>this.stop(u,d),l=()=>ae(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Xa(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:rl(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&B.postRender(()=>s(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!qt(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=mf(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;n&&Ge(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=vf(i.layoutBox,n):this.constraints=!1,this.elastic=Tf(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&ae(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=xf(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ge(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Cf(r,i.root,this.visualElement.getTransformPagePoint());let o=yf(i.layout.layoutBox,s);if(n){const a=n(Sf(o));this.hasMutatedConstraints=!!a,a&&(o=Qa(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=ae(u=>{if(!qt(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=i?200:1e6,f=i?40:1e7,p={type:"inertia",velocity:r?e[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return ur(this.visualElement,e),r.start(mi(e,r,0,n,this.visualElement,!1))}stopAnimation(){ae(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){ae(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){ae(n=>{const{drag:r}=this.getProps();if(!qt(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(e[n]-H(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ge(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ae(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=bf({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),ae(o=>{if(!qt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(H(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;Ef.set(this.visualElement,this);const e=this.visualElement.current,n=yt(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ge(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),B.read(r);const o=Ot(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(ae(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=yr,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function qt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Of(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class If extends Oe{constructor(e){super(e),this.removeGroupControls=te,this.removeListeners=te,this.controls=new Pf(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||te}unmount(){this.removeGroupControls(),this.removeListeners()}}const Vs=t=>(e,n)=>{t&&B.postRender(()=>t(e,n))};class Af extends Oe{constructor(){super(...arguments),this.removePointerDownListener=te}onPointerDown(e){this.session=new Xa(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rl(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Vs(e),onStart:Vs(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&B.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=yt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function js(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const at={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(I.test(t))t=parseFloat(t);else return t;const n=js(t,e.target.x),r=js(t,e.target.y);return`${n}% ${r}%`}},Mf={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=Ee.parse(t);if(i.length>5)return r;const s=Ee.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const c=H(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class Rf extends m.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;Zu(Nf),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||B.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Wr.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function il(t){const[e,n]=hu(),r=m.useContext(Fo);return v.jsx(Rf,{...t,layoutGroup:r,switchLayoutGroup:m.useContext(Ko),isPresent:e,safeToRemove:n})}const Nf={borderRadius:{...at,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:at,borderTopRightRadius:at,borderBottomLeftRadius:at,borderBottomRightRadius:at,boxShadow:Mf};function kf(t,e,n){const r=Y(t)?t:Et(t);return r.start(mi("",r,e,n)),r.animation}function Lf(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Vf=(t,e)=>t.depth-e.depth;class jf{constructor(){this.children=[],this.isDirty=!1}add(e){si(this.children,e),this.isDirty=!0}remove(e){oi(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Vf),this.isDirty=!1,this.children.forEach(e)}}function _f(t,e){const n=pe.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(Ce(r),t(s-e))};return B.read(r,!0),()=>Ce(r)}const sl=["TopLeft","TopRight","BottomLeft","BottomRight"],Bf=sl.length,_s=t=>typeof t=="string"?parseFloat(t):t,Bs=t=>typeof t=="number"||I.test(t);function Ff(t,e,n,r,i,s){i?(t.opacity=H(0,n.opacity!==void 0?n.opacity:1,zf(r)),t.opacityExit=H(e.opacity!==void 0?e.opacity:1,0,Uf(r))):s&&(t.opacity=H(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Bf;o++){const a=`border${sl[o]}Radius`;let l=Fs(e,a),c=Fs(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Bs(l)===Bs(c)?(t[a]=Math.max(H(_s(l),_s(c),r),0),(fe.test(c)||fe.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=H(e.rotate||0,n.rotate||0,r))}function Fs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const zf=ol(0,.5,Da),Uf=ol(.5,.95,te);function ol(t,e,n){return r=>r<t?0:r>e?1:n(Je(t,e,r))}function zs(t,e){t.min=e.min,t.max=e.max}function ie(t,e){zs(t.x,e.x),zs(t.y,e.y)}function Us(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Hs(t,e,n,r,i){return t-=e,t=fn(t,1/n,r),i!==void 0&&(t=fn(t,1/i,r)),t}function Hf(t,e=0,n=1,r=.5,i,s=t,o=t){if(fe.test(e)&&(e=parseFloat(e),e=H(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=H(s.min,s.max,r);t===s&&(a-=e),t.min=Hs(t.min,e,n,a,i),t.max=Hs(t.max,e,n,a,i)}function $s(t,e,[n,r,i],s,o){Hf(t,e[n],e[r],e[i],e.scale,s,o)}const $f=["x","scaleX","originX"],Wf=["y","scaleY","originY"];function Ws(t,e,n,r){$s(t.x,e,$f,n?n.x:void 0,r?r.x:void 0),$s(t.y,e,Wf,n?n.y:void 0,r?r.y:void 0)}function Gs(t){return t.translate===0&&t.scale===1}function al(t){return Gs(t.x)&&Gs(t.y)}function qs(t,e){return t.min===e.min&&t.max===e.max}function Gf(t,e){return qs(t.x,e.x)&&qs(t.y,e.y)}function Ks(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function ll(t,e){return Ks(t.x,e.x)&&Ks(t.y,e.y)}function Xs(t){return ne(t.x)/ne(t.y)}function Ys(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class qf{constructor(){this.members=[]}add(e){si(this.members,e),e.scheduleRender()}remove(e){if(oi(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Kf(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:h,skewX:f,skewY:p}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),h&&(r+=`rotateY(${h}deg) `),f&&(r+=`skewX(${f}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ne={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ft=typeof window<"u"&&window.MotionDebug!==void 0,qn=["","X","Y","Z"],Xf={visibility:"hidden"},Zs=1e3;let Yf=0;function Kn(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function cl(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=va(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",B,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&cl(r)}function ul({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Yf++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ft&&(Ne.totalNodes=Ne.resolvedTargetDeltas=Ne.recalculatedProjection=0),this.nodes.forEach(Qf),this.nodes.forEach(ip),this.nodes.forEach(sp),this.nodes.forEach(ep),ft&&window.MotionDebug.record(Ne)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new jf)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new ai),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Lf(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),t){let d;const h=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=_f(h,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(Qs))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||up,{onLayoutAnimationStart:b,onLayoutAnimationComplete:y}=u.getProps(),T=!this.targetLayout||!ll(this.targetLayout,p)||f,S=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||S||h&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,S);const E={...ti(g,"layout"),onPlay:b,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else h||Qs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ce(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(op),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&cl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Js);return}this.isUpdating||this.nodes.forEach(np),this.isUpdating=!1,this.nodes.forEach(rp),this.nodes.forEach(Zf),this.nodes.forEach(Jf),this.clearAllSnapshots();const a=pe.now();K.delta=be(0,1e3/60,a-K.timestamp),K.timestamp=a,K.isProcessing=!0,_n.update.process(K),_n.preRender.process(K),_n.render.process(K),K.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Wr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(tp),this.sharedNodes.forEach(ap)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,B.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){B.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=G(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!al(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||Re(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),dp(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return G();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(hp))){const{scroll:u}=this.root;u&&(Xe(l.x,u.offset.x),Xe(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=G();if(ie(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&ie(l,o),Xe(l.x,d.offset.x),Xe(l.y,d.offset.y))}return l}applyTransform(o,a=!1){const l=G();ie(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ye(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Re(u.latestValues)&&Ye(l,u.latestValues)}return Re(this.latestValues)&&Ye(l,this.latestValues),l}removeTransform(o){const a=G();ie(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Re(c.latestValues))continue;br(c.latestValues)&&c.updateSnapshot();const u=G(),d=c.measurePageBox();ie(u,d),Ws(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Re(this.latestValues)&&Ws(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==K.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!(!this.layout||!(d||h))){if(this.resolvedRelativeTargetAt=K.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=G(),this.relativeTargetOrigin=G(),xt(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),ie(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=G(),this.targetWithTransforms=G()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),gf(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ie(this.target,this.layout.layoutBox),tl(this.target,this.targetDelta)):ie(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=G(),this.relativeTargetOrigin=G(),xt(this.relativeTargetOrigin,this.target,f.target),ie(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ft&&Ne.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||br(this.parent.latestValues)||el(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===K.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;ie(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Df(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=G());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Us(this.prevProjectionDelta.x,this.projectionDelta.x),Us(this.prevProjectionDelta.y,this.projectionDelta.y)),bt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Ys(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ys(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),ft&&Ne.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ke(),this.projectionDelta=Ke(),this.projectionDeltaWithTransform=Ke()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Ke();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=G(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=f!==p,b=this.getStack(),y=!b||b.members.length<=1,T=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(cp));this.animationProgress=0;let S;this.mixTargetDelta=E=>{const w=E/1e3;eo(d.x,o.x,w),eo(d.y,o.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),lp(this.relativeTarget,this.relativeTargetOrigin,h,w),S&&Gf(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=G()),ie(S,this.relativeTarget)),g&&(this.animationValues=u,Ff(u,c,this.latestValues,w,T,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ce(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=B.update(()=>{Qt.hasAnimatedSinceResize=!0,this.currentAnimation=kf(0,Zs,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Zs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&dl(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||G();const d=ne(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=ne(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}ie(a,l),Ye(a,u),bt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new qf),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Kn("z",o,c,this.animationValues);for(let u=0;u<qn.length;u++)Kn(`rotate${qn[u]}`,o,c,this.animationValues),Kn(`skew${qn[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Xf;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Zt(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Zt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Re(this.latestValues)&&(g.transform=u?u({},""):"none",this.hasProjected=!1),g}const h=d.animationValues||d.latestValues;this.applyTransformsToTarget(),c.transform=Kf(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:f,y:p}=this.projectionDelta;c.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,d.animationValues?c.opacity=d===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const g in ln){if(h[g]===void 0)continue;const{correct:b,applyTo:y}=ln[g],T=c.transform==="none"?h[g]:b(h[g],d);if(y){const S=y.length;for(let E=0;E<S;E++)c[y[E]]=T}else c[g]=T}return this.options.layoutId&&(c.pointerEvents=d===this?Zt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Js),this.root.sharedNodes.clear()}}}function Zf(t){t.updateLayout()}function Jf(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;s==="size"?ae(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=ne(h);h.min=r[d].min,h.max=h.min+f}):dl(s,n.layoutBox,r)&&ae(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=ne(r[d]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+f)});const a=Ke();bt(a,r,n.layoutBox);const l=Ke();o?bt(l,t.applyTransform(i,!0),n.measuredBox):bt(l,r,n.layoutBox);const c=!al(a);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=G();xt(p,n.layoutBox,h.layoutBox);const g=G();xt(g,r,f.layoutBox),ll(p,g)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Qf(t){ft&&Ne.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ep(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function tp(t){t.clearSnapshot()}function Js(t){t.clearMeasurements()}function np(t){t.isLayoutDirty=!1}function rp(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Qs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ip(t){t.resolveTargetDelta()}function sp(t){t.calcProjection()}function op(t){t.resetSkewAndRotation()}function ap(t){t.removeLeadSnapshot()}function eo(t,e,n){t.translate=H(e.translate,0,n),t.scale=H(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function to(t,e,n,r){t.min=H(e.min,n.min,r),t.max=H(e.max,n.max,r)}function lp(t,e,n,r){to(t.x,e.x,n.x,r),to(t.y,e.y,n.y,r)}function cp(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const up={duration:.45,ease:[.4,0,.1,1]},no=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ro=no("applewebkit/")&&!no("chrome/")?Math.round:te;function io(t){t.min=ro(t.min),t.max=ro(t.max)}function dp(t){io(t.x),io(t.y)}function dl(t,e,n){return t==="position"||t==="preserve-aspect"&&!pf(Xs(e),Xs(n),.2)}function hp(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const fp=ul({attachResizeListener:(t,e)=>Ot(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xn={current:void 0},hl=ul({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Xn.current){const t=new fp({});t.mount(window),t.setOptions({layoutScroll:!0}),Xn.current=t}return Xn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),pp={pan:{Feature:Af},drag:{Feature:If,ProjectionNode:hl,MeasureLayout:il}};function so(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&B.postRender(()=>s(e,Rt(e)))}class gp extends Oe{mount(){const{current:e}=this.node;e&&(this.unmount=fd(e,n=>(so(this.node,n,"Start"),r=>so(this.node,r,"End"))))}unmount(){}}class mp extends Oe{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Mt(Ot(this.node.current,"focus",()=>this.onFocus()),Ot(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function oo(t,e,n){const{props:r}=t;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&B.postRender(()=>s(e,Rt(e)))}class vp extends Oe{mount(){const{current:e}=this.node;e&&(this.unmount=vd(e,n=>(oo(this.node,n,"Start"),(r,{success:i})=>oo(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Tr=new WeakMap,Yn=new WeakMap,yp=t=>{const e=Tr.get(t.target);e&&e(t)},bp=t=>{t.forEach(yp)};function xp({root:t,...e}){const n=t||document;Yn.has(n)||Yn.set(n,{});const r=Yn.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(bp,{root:t,...e})),r[i]}function Tp(t,e,n){const r=xp(e);return Tr.set(t,n),r.observe(t),()=>{Tr.delete(t),r.unobserve(t)}}const Sp={some:0,all:1};class wp extends Oe{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Sp[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return Tp(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Dp(e,n))&&this.startObserver()}unmount(){}}function Dp({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Cp={inView:{Feature:wp},tap:{Feature:vp},focus:{Feature:mp},hover:{Feature:gp}},Ep={layout:{ProjectionNode:hl,MeasureLayout:il}},Sr={current:null},fl={current:!1};function Pp(){if(fl.current=!0,!!Fr)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Sr.current=t.matches;t.addListener(e),e()}else Sr.current=!1}const Op=[..._a,X,Ee],Ip=t=>Op.find(ja(t)),ao=new WeakMap;function Ap(t,e,n){for(const r in e){const i=e[r],s=n[r];if(Y(i))t.addValue(r,i);else if(Y(s))t.addValue(r,Et(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(r);t.addValue(r,Et(o!==void 0?o:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const lo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Mp{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=fi,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=pe.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,B.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=vn(n),this.isVariantNode=Go(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const p=h[f];l[f]!==void 0&&Y(p)&&p.set(l[f],!1)}}mount(e){this.current=e,ao.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),fl.current||Pp(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Sr.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){ao.delete(this.current),this.projection&&this.projection.unmount(),Ce(this.notifyUpdate),Ce(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=He.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&B.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Qe){const n=Qe[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):G()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<lo.length;r++){const i=lo[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Ap(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Et(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(La(i)||Ea(i))?i=parseFloat(i):!Ip(i)&&Ee.test(n)&&(i=Ra(e,n)),this.setBaseTarget(e,Y(i)?i.get():i)),Y(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=qr(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[e])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Y(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ai),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class pl extends Mp{constructor(){super(...arguments),this.KeyframeResolver=Ba}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Y(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rp(t){return window.getComputedStyle(t)}class Np extends pl{constructor(){super(...arguments),this.type="html",this.renderInstance=ta}readValueFromInstance(e,n){if(He.has(n)){const r=hi(n);return r&&r.default||0}else{const r=Rp(e),i=(Jo(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return nl(e,n)}build(e,n,r){Yr(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return ei(e,n,r)}}class kp extends pl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=G}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(He.has(n)){const r=hi(n);return r&&r.default||0}return n=na.has(n)?n:$r(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return sa(e,n,r)}build(e,n,r){Zr(e,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,n,r,i){ra(e,n,r,i)}mount(e){this.isSVGTag=Qr(e.tagName),super.mount(e)}}const Lp=(t,e)=>Gr(t)?new kp(e):new Np(e,{allowProjection:t!==m.Fragment}),Vp=od({...sf,...Cp,...pp,...Ep},Lp),jp=Tu(Vp);function co(t,e){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...r),e)}}function _p({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,o]=m.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=m.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=t?typeof t=="number"?t:t.scroll:null,c=t?typeof t=="number"?t:t.resize:null,u=m.useRef(!1);m.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[d,h,f]=m.useMemo(()=>{const y=()=>{if(!a.current.element)return;const{left:T,top:S,width:E,height:w,bottom:P,right:j,x:A,y:U}=a.current.element.getBoundingClientRect(),_={left:T,top:S,width:E,height:w,bottom:P,right:j,x:A,y:U};a.current.element instanceof HTMLElement&&r&&(_.height=a.current.element.offsetHeight,_.width=a.current.element.offsetWidth),Object.freeze(_),u.current&&!Up(a.current.lastBounds,_)&&o(a.current.lastBounds=_)};return[y,c?co(y,c):y,l?co(y,l):y]},[o,r,l,c]);function p(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(y=>y.removeEventListener("scroll",f,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function g(){a.current.element&&(a.current.resizeObserver=new i(f),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(y=>y.addEventListener("scroll",f,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{f()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const b=y=>{!y||y===a.current.element||(p(),a.current.element=y,a.current.scrollContainers=gl(y),g())};return Fp(f,!!e),Bp(h),m.useEffect(()=>{p(),g()},[e,f,h]),m.useEffect(()=>p,[]),[b,s,d]}function Bp(t){m.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function Fp(t,e){m.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function gl(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(t),[...e,...gl(t.parentElement)]}const zp=["x","y","top","bottom","left","right","width","height"],Up=(t,e)=>zp.every(n=>t[n]===e[n]),ml=m.createContext({dragDropManager:void 0});function se(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var uo=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),ho=function(){return Math.random().toString(36).substring(7).split("").join(".")},fo={INIT:"@@redux/INIT"+ho(),REPLACE:"@@redux/REPLACE"+ho()};function Hp(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function vl(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(se(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(se(1));return n(vl)(t,e)}if(typeof t!="function")throw new Error(se(2));var i=t,s=e,o=[],a=o,l=!1;function c(){a===o&&(a=o.slice())}function u(){if(l)throw new Error(se(3));return s}function d(g){if(typeof g!="function")throw new Error(se(4));if(l)throw new Error(se(5));var b=!0;return c(),a.push(g),function(){if(b){if(l)throw new Error(se(6));b=!1,c();var T=a.indexOf(g);a.splice(T,1),o=null}}}function h(g){if(!Hp(g))throw new Error(se(7));if(typeof g.type>"u")throw new Error(se(8));if(l)throw new Error(se(9));try{l=!0,s=i(s,g)}finally{l=!1}for(var b=o=a,y=0;y<b.length;y++){var T=b[y];T()}return g}function f(g){if(typeof g!="function")throw new Error(se(10));i=g,h({type:fo.REPLACE})}function p(){var g,b=d;return g={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(se(11));function S(){T.next&&T.next(u())}S();var E=b(S);return{unsubscribe:E}}},g[uo]=function(){return this},g}return h({type:fo.INIT}),r={dispatch:h,subscribe:d,getState:u,replaceReducer:f},r[uo]=p,r}function k(t,e,...n){if($p()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(e.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function $p(){return typeof process<"u"&&!0}function Wp(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function Gp(t,e){return t.filter(n=>n!==e)}function yl(t){return typeof t=="object"}function qp(t,e){const n=new Map,r=s=>{n.set(s,n.has(s)?n.get(s)+1:1)};t.forEach(r),e.forEach(r);const i=[];return n.forEach((s,o)=>{s===1&&i.push(o)}),i}function Kp(t,e){return t.filter(n=>e.indexOf(n)>-1)}const vi="dnd-core/INIT_COORDS",xn="dnd-core/BEGIN_DRAG",yi="dnd-core/PUBLISH_DRAG_SOURCE",Tn="dnd-core/HOVER",Sn="dnd-core/DROP",wn="dnd-core/END_DRAG";function po(t,e){return{type:vi,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const Xp={type:vi,payload:{clientOffset:null,sourceClientOffset:null}};function Yp(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:s,getSourceClientOffset:o}=r,a=t.getMonitor(),l=t.getRegistry();t.dispatch(po(s)),Zp(n,a,l);const c=eg(n,a);if(c==null){t.dispatch(Xp);return}let u=null;if(s){if(!o)throw new Error("getSourceClientOffset must be defined");Jp(o),u=o(c)}t.dispatch(po(s,u));const h=l.getSource(c).beginDrag(a,c);if(h==null)return;Qp(h),l.pinSource(c);const f=l.getSourceType(c);return{type:xn,payload:{itemType:f,item:h,sourceId:c,clientOffset:s||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}function Zp(t,e,n){k(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){k(n.getSource(r),"Expected sourceIds to be registered.")})}function Jp(t){k(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Qp(t){k(yl(t),"Item must be an object.")}function eg(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function tg(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ng(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){tg(t,i,n[i])})}return t}function rg(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();ig(r),ag(r).forEach((o,a)=>{const l=sg(o,a,i,r),c={type:Sn,payload:{dropResult:ng({},n,l)}};t.dispatch(c)})}}function ig(t){k(t.isDragging(),"Cannot call drop while not dragging."),k(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function sg(t,e,n,r){const i=n.getTarget(t);let s=i?i.drop(r,t):void 0;return og(s),typeof s>"u"&&(s=e===0?{}:r.getDropResult()),s}function og(t){k(typeof t>"u"||yl(t),"Drop result must either be an object or undefined.")}function ag(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function lg(t){return function(){const n=t.getMonitor(),r=t.getRegistry();cg(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:wn}}}function cg(t){k(t.isDragging(),"Cannot call endDrag while not dragging.")}function wr(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function ug(t){return function(n,{clientOffset:r}={}){dg(n);const i=n.slice(0),s=t.getMonitor(),o=t.getRegistry(),a=s.getItemType();return fg(i,o,a),hg(i,s,o),pg(i,s,o),{type:Tn,payload:{targetIds:i,clientOffset:r||null}}}}function dg(t){k(Array.isArray(t),"Expected targetIds to be an array.")}function hg(t,e,n){k(e.isDragging(),"Cannot call hover while not dragging."),k(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];k(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const s=n.getTarget(i);k(s,"Expected targetIds to be registered.")}}function fg(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],s=e.getTargetType(i);wr(s,n)||t.splice(r,1)}}function pg(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function gg(t){return function(){if(t.getMonitor().isDragging())return{type:yi}}}function mg(t){return{beginDrag:Yp(t),publishDragSource:gg(t),hover:ug(t),drop:rg(t),endDrag:lg(t)}}class vg{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(s){return(...o)=>{const a=s.apply(e,o);typeof a<"u"&&n(a)}}const i=mg(this);return Object.keys(i).reduce((s,o)=>{const a=i[o];return s[o]=r(a),s},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function yg(t,e){return{x:t.x+e.x,y:t.y+e.y}}function bl(t,e){return{x:t.x-e.x,y:t.y-e.y}}function bg(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:bl(yg(e,r),n)}function xg(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:bl(e,n)}const Tt=[],bi=[];Tt.__IS_NONE__=!0;bi.__IS_ALL__=!0;function Tg(t,e){return t===Tt?!1:t===bi||typeof e>"u"?!0:Kp(e,t).length>0}class Sg{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;k(typeof e=="function","listener must be a function."),k(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const s=()=>{const o=this.store.getState(),a=o.stateId;try{a===i||a===i+1&&!Tg(o.dirtyHandlerIds,r)||e()}finally{i=a}};return this.store.subscribe(s)}subscribeToOffsetChange(e){k(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return k(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(k(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),i=this.getItemType();return wr(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(k(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),i=this.getItemType();return r!==i?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(e),s=this.getItemType();if(s&&!wr(i,s))return!1;const o=this.getTargetIds();if(!o.length)return!1;const a=o.indexOf(e);return r?a===o.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return bg(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return xg(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const go=typeof global<"u"?global:self,xl=go.MutationObserver||go.WebKitMutationObserver;function Tl(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function wg(t){let e=1;const n=new xl(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const Dg=typeof xl=="function"?wg:Tl;class Cg{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,i=e.length-this.index;r<i;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Dg(this.flush),this.requestErrorThrow=Tl(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Eg{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class Pg{create(e){const n=this.freeTasks,r=n.length?n.pop():new Eg(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Sl=new Cg,Og=new Pg(Sl.registerPendingError);function Ig(t){Sl.enqueueTask(Og.create(t))}const xi="dnd-core/ADD_SOURCE",Ti="dnd-core/ADD_TARGET",Si="dnd-core/REMOVE_SOURCE",Dn="dnd-core/REMOVE_TARGET";function Ag(t){return{type:xi,payload:{sourceId:t}}}function Mg(t){return{type:Ti,payload:{targetId:t}}}function Rg(t){return{type:Si,payload:{sourceId:t}}}function Ng(t){return{type:Dn,payload:{targetId:t}}}function kg(t){k(typeof t.canDrag=="function","Expected canDrag to be a function."),k(typeof t.beginDrag=="function","Expected beginDrag to be a function."),k(typeof t.endDrag=="function","Expected endDrag to be a function.")}function Lg(t){k(typeof t.canDrop=="function","Expected canDrop to be a function."),k(typeof t.hover=="function","Expected hover to be a function."),k(typeof t.drop=="function","Expected beginDrag to be a function.")}function Dr(t,e){if(e&&Array.isArray(t)){t.forEach(n=>Dr(n,!1));return}k(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var le;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(le||(le={}));let Vg=0;function jg(){return Vg++}function _g(t){const e=jg().toString();switch(t){case le.SOURCE:return`S${e}`;case le.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function mo(t){switch(t[0]){case"S":return le.SOURCE;case"T":return le.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function vo(t,e){const n=t.entries();let r=!1;do{const{done:i,value:[,s]}=n.next();if(s===e)return!0;r=!!i}while(!r);return!1}class Bg{addSource(e,n){Dr(e),kg(n);const r=this.addHandler(le.SOURCE,e,n);return this.store.dispatch(Ag(r)),r}addTarget(e,n){Dr(e,!0),Lg(n);const r=this.addHandler(le.TARGET,e,n);return this.store.dispatch(Mg(r)),r}containsHandler(e){return vo(this.dragSources,e)||vo(this.dropTargets,e)}getSource(e,n=!1){return k(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return k(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return k(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return k(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return mo(e)===le.SOURCE}isTargetId(e){return mo(e)===le.TARGET}removeSource(e){k(this.getSource(e),"Expected an existing source."),this.store.dispatch(Rg(e)),Ig(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){k(this.getTarget(e),"Expected an existing target."),this.store.dispatch(Ng(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);k(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){k(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=_g(e);return this.types.set(i,n),e===le.SOURCE?this.dragSources.set(i,r):e===le.TARGET&&this.dropTargets.set(i,r),i}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const Fg=(t,e)=>t===e;function zg(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function Ug(t,e,n=Fg){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function Hg(t=Tt,e){switch(e.type){case Tn:break;case xi:case Ti:case Dn:case Si:return Tt;case xn:case yi:case wn:case Sn:default:return bi}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=qp(n,r);if(!(i.length>0||!Ug(n,r)))return Tt;const o=r[r.length-1],a=n[n.length-1];return o!==a&&(o&&i.push(o),a&&i.push(a)),i}function $g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wg(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){$g(t,i,n[i])})}return t}const yo={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Gg(t=yo,e){const{payload:n}=e;switch(e.type){case vi:case xn:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Tn:return zg(t.clientOffset,n.clientOffset)?t:Wg({},t,{clientOffset:n.clientOffset});case wn:case Sn:return yo;default:return t}}function qg(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function We(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){qg(t,i,n[i])})}return t}const Kg={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Xg(t=Kg,e){const{payload:n}=e;switch(e.type){case xn:return We({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case yi:return We({},t,{isSourcePublic:!0});case Tn:return We({},t,{targetIds:n.targetIds});case Dn:return t.targetIds.indexOf(n.targetId)===-1?t:We({},t,{targetIds:Gp(t.targetIds,n.targetId)});case Sn:return We({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case wn:return We({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Yg(t=0,e){switch(e.type){case xi:case Ti:return t+1;case Si:case Dn:return t-1;default:return t}}function Zg(t=0){return t+1}function Jg(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qg(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Jg(t,i,n[i])})}return t}function em(t={},e){return{dirtyHandlerIds:Hg(t.dirtyHandlerIds,{type:e.type,payload:Qg({},e.payload,{prevTargetIds:Wp(t,"dragOperation.targetIds",[])})}),dragOffset:Gg(t.dragOffset,e),refCount:Yg(t.refCount,e),dragOperation:Xg(t.dragOperation,e),stateId:Zg(t.stateId)}}function tm(t,e=void 0,n={},r=!1){const i=nm(r),s=new Sg(i,new Bg(i)),o=new vg(i,s),a=t(o,e,n);return o.receiveBackend(a),o}function nm(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return vl(em,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function rm(t,e){if(t==null)return{};var n=im(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function im(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}let bo=0;const en=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var sm=m.memo(function(e){var{children:n}=e,r=rm(e,["children"]);const[i,s]=om(r);return m.useEffect(()=>{if(s){const o=wl();return++bo,()=>{--bo===0&&(o[en]=null)}}},[]),v.jsx(ml.Provider,{value:i,children:n})});function om(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=am(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function am(t,e=wl(),n,r){const i=e;return i[en]||(i[en]={dragDropManager:tm(t,e,n,r)}),i[en]}function wl(){return typeof global<"u"?global:window}var lm=Ec();const cm=Cc(lm),Ue=typeof window<"u"?m.useLayoutEffect:m.useEffect;function Dl(t,e,n){const[r,i]=m.useState(()=>e(t)),s=m.useCallback(()=>{const o=e(t);cm(r,o)||(i(o),n&&n())},[r,t,n]);return Ue(s),[r,s]}function um(t,e,n){const[r,i]=Dl(t,e,n);return Ue(function(){const o=t.getHandlerId();if(o!=null)return t.subscribeToStateChange(i,{handlerIds:[o]})},[t,i]),r}function Cl(t,e,n){return um(e,t||(()=>({})),()=>n.reconnect())}function El(t,e){const n=[];return typeof t!="function"&&n.push(t),m.useMemo(()=>typeof t=="function"?t():t,n)}function dm(t){return m.useMemo(()=>t.hooks.dragSource(),[t])}function hm(t){return m.useMemo(()=>t.hooks.dragPreview(),[t])}let Zn=!1,Jn=!1;class fm{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){k(!Zn,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Zn=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Zn=!1}}isDragging(){if(!this.sourceId)return!1;k(!Jn,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Jn=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Jn=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let Qn=!1;class pm{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;k(!Qn,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Qn=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Qn=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function gm(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function mm(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function Cr(t,e,n,r){let i;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const s=Object.keys(t),o=Object.keys(e);if(s.length!==o.length)return!1;const a=Object.prototype.hasOwnProperty.bind(e);for(let l=0;l<s.length;l++){const c=s[l];if(!a(c))return!1;const u=t[c],d=e[c];if(i=void 0,i===!1||i===void 0&&u!==d)return!1}return!0}function Er(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function vm(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function ym(t){return(e=null,n=null)=>{if(!m.isValidElement(e)){const s=e;return t(s,n),s}const r=e;return vm(r),bm(r,n?s=>t(s,n):t)}}function Pl(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=ym(r);e[n]=()=>i}}),e}function xo(t,e){typeof t=="function"?t(e):t.current=e}function bm(t,e){const n=t.ref;return k(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?m.cloneElement(t,{ref:r=>{xo(n,r),xo(e,r)}}):m.cloneElement(t,{ref:e})}class xm{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Cr(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Cr(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Pl({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,Er(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,Er(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class Tm{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Cr(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Pl({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,Er(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function xe(){const{dragDropManager:t}=m.useContext(ml);return k(t!=null,"Expected drag drop context"),t}function Sm(t,e){const n=xe(),r=m.useMemo(()=>new xm(n.getBackend()),[n]);return Ue(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),Ue(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function wm(){const t=xe();return m.useMemo(()=>new fm(t),[t])}class Dm{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,i=this.monitor,{isDragging:s}=r;return s?s(i):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:i}=e;i&&i(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function Cm(t,e,n){const r=m.useMemo(()=>new Dm(t,e,n),[e,n]);return m.useEffect(()=>{r.spec=t},[t]),r}function Em(t){return m.useMemo(()=>{const e=t.type;return k(e!=null,"spec.type must be defined"),e},[t])}function Pm(t,e,n){const r=xe(),i=Cm(t,e,n),s=Em(t);Ue(function(){if(s!=null){const[a,l]=mm(s,i,r);return e.receiveHandlerId(a),n.receiveHandlerId(a),l}},[r,e,n,i,s])}function Om(t,e){const n=El(t);k(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=wm(),i=Sm(n.options,n.previewOptions);return Pm(n,r,i),[Cl(n.collect,r,i),dm(i),hm(i)]}function Im(t){const n=xe().getMonitor(),[r,i]=Dl(n,t);return m.useEffect(()=>n.subscribeToOffsetChange(i)),m.useEffect(()=>n.subscribeToStateChange(i)),r}function Am(t){return m.useMemo(()=>t.hooks.dropTarget(),[t])}function Mm(t){const e=xe(),n=m.useMemo(()=>new Tm(e.getBackend()),[e]);return Ue(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function Rm(){const t=xe();return m.useMemo(()=>new pm(t),[t])}function Nm(t){const{accept:e}=t;return m.useMemo(()=>(k(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class km{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function Lm(t,e){const n=m.useMemo(()=>new km(t,e),[e]);return m.useEffect(()=>{n.spec=t},[t]),n}function Vm(t,e,n){const r=xe(),i=Lm(t,e),s=Nm(t);Ue(function(){const[a,l]=gm(s,i,r);return e.receiveHandlerId(a),n.receiveHandlerId(a),l},[r,e,i,n,s.map(o=>o.toString()).join("|")])}function Ol(t,e){const n=El(t),r=Rm(),i=Mm(n.options);return Vm(n,r,i),[Cl(n.collect,r,i),Am(i)]}var Il=t=>{throw TypeError(t)},Al=(t,e,n)=>e.has(t)||Il("Cannot "+n),N=(t,e,n)=>(Al(t,e,"read from private field"),n?n.call(t):e.get(t)),oe=(t,e,n)=>e.has(t)?Il("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ke=(t,e,n,r)=>(Al(t,e,"write to private field"),e.set(t,n),n),Se,jm=class{constructor(){oe(this,Se),this.register=t=>{N(this,Se).push(t)},this.unregister=t=>{for(;N(this,Se).indexOf(t)!==-1;)N(this,Se).splice(N(this,Se).indexOf(t),1)},this.backendChanged=t=>{for(let e of N(this,Se))e.backendChanged(t)},ke(this,Se,[])}};Se=new WeakMap;var Q,pt,ee,me,Le,Pr,Or,Ir,tn,nn,gt,Ml=class rn{constructor(e,n,r){if(oe(this,Q),oe(this,pt),oe(this,ee),oe(this,me),oe(this,Le),oe(this,Pr,(i,s,o)=>{if(!o.backend)throw new Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(o)}`);let a=o.backend(i,s,o.options),l=o.id,c=!o.id&&a&&a.constructor;if(c&&(l=a.constructor.name),!l)throw new Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(o)}
1
+ import{j as m,C as cc,E as uc,a as dc,L as Be,b as De,S as Rr,c as Nr,d as kr,e as Lr,f as Vr,g as on,B as we,P as Eo,h as W,I as rr,D as hc,i as fc,k as pc,l as Rn,t as Li,m as Nn,T as gc,r as mc,n as vc,o as yc,p as bc,q as xc,s as Tc,v as Sc,w as wc,x as Dc,y as Cc,z as Ec,A as Bt}from"./app.js";import{A as Pc}from"./app-layout-BmMzULcJ.js";import{r as v,e as z}from"./monaco-ICtx6xoc.js";import{g as Oc}from"./vendor-wzZzN_Jv.js";import{r as Ic,d as Ac}from"./jsoneditor-D95dIAP2.js";import an from"./material-icon-DwkE6wKL.js";import{D as Mc}from"./del-modal-DyIWFflP.js";import Vi from"./add-form-BA-MI8Fw.js";import"./handsontable-PVakPtJV.js";import"./app-shell-C8Cnr5Hy.js";import"./app-sidebar-HwvXNZzk.js";import"./nav-main-BqKm87JZ.js";import"./app-sidebar-header-RRnKZeeU.js";import"./breadcrumbs-DSMzNYiS.js";import"./nav-user-DuCZNsZX.js";import"./user-info-BGQvqBmO.js";import"./user-menu-content-BDm88xaM.js";import"./theme-switcher-cgyA7_cO.js";import"./icon-DpkedrXG.js";import"./field-renderer-DBKkDhBG.js";import"./dynamic-controls-BOYmRX_z.js";import"./input-error-CmXZF6xy.js";function Po(t){let e=null;return()=>(e==null&&(e=t()),e)}function Rc(t,e){return t.filter(n=>n!==e)}function Nc(t,e){const n=new Set,r=s=>n.add(s);t.forEach(r),e.forEach(r);const i=[];return n.forEach(s=>i.push(s)),i}class kc{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=Nc(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=Rc(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class Lc{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const Oo="__NATIVE_FILE__",Io="__NATIVE_URL__",Ao="__NATIVE_TEXT__",Mo="__NATIVE_HTML__",ji=Object.freeze(Object.defineProperty({__proto__:null,FILE:Oo,HTML:Mo,TEXT:Ao,URL:Io},Symbol.toStringTag,{value:"Module"}));function kn(t,e,n){const r=e.reduce((i,s)=>i||t.getData(s),"");return r??n}const ir={[Oo]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[Mo]:{exposeProperties:{html:(t,e)=>kn(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[Io]:{exposeProperties:{urls:(t,e)=>kn(t,e,"").split(`
2
+ `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[Ao]:{exposeProperties:{text:(t,e)=>kn(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function Vc(t,e){const n=ir[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new Lc(n);return r.loadDataTransfer(e),r}function Ln(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(ir).filter(n=>{const r=ir[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const jc=Po(()=>/firefox/i.test(navigator.userAgent)),Ro=Po(()=>!!window.safari);class _i{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:s,c3s:o}=this;let a=n.length-1;if(e===n[a])return r[a];let l=0,c=o.length-1,u;for(;l<=c;){u=Math.floor(.5*(l+c));const f=n[u];if(f<e)l=u+1;else if(f>e)c=u-1;else return r[u]}a=Math.max(0,c);const d=e-n[a],h=d*d;return r[a]+i[a]*d+s[a]*h+o[a]*d*h}constructor(e,n){const{length:r}=e,i=[];for(let f=0;f<r;f++)i.push(f);i.sort((f,p)=>e[f]<e[p]?-1:1);const s=[],o=[];let a,l;for(let f=0;f<r-1;f++)a=e[f+1]-e[f],l=n[f+1]-n[f],s.push(a),o.push(l/a);const c=[o[0]];for(let f=0;f<s.length-1;f++){const p=o[f],g=o[f+1];if(p*g<=0)c.push(0);else{a=s[f];const b=s[f+1],y=a+b;c.push(3*y/((y+b)/p+(y+a)/g))}}c.push(o[o.length-1]);const u=[],d=[];let h;for(let f=0;f<c.length-1;f++){h=o[f];const p=c[f],g=1/s[f],b=p+c[f+1]-h-h;u.push((h-p-b)*g),d.push(b*g*g)}this.xs=e,this.ys=n,this.c1s=c,this.c2s=u,this.c3s=d}}const _c=1;function No(t){const e=t.nodeType===_c?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Ft(t){return{x:t.clientX,y:t.clientY}}function Bc(t){var e;return t.nodeName==="IMG"&&(jc()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function Fc(t,e,n,r){let i=t?e.width:n,s=t?e.height:r;return Ro()&&t&&(s/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:s}}function zc(t,e,n,r,i){const s=Bc(e),a=No(s?t:e),l={x:n.x-a.x,y:n.y-a.y},{offsetWidth:c,offsetHeight:u}=t,{anchorX:d,anchorY:h}=r,{dragPreviewWidth:f,dragPreviewHeight:p}=Fc(s,e,c,u),g=()=>{let O=new _i([0,.5,1],[l.y,l.y/u*p,l.y+p-u]).interpolate(h);return Ro()&&s&&(O+=(window.devicePixelRatio-1)*p),O},b=()=>new _i([0,.5,1],[l.x,l.x/c*f,l.x+f-c]).interpolate(d),{offsetX:y,offsetY:T}=i,S=y===0||y,E=T===0||T;return{x:S?y:b(),y:E?T:g()}}let Uc=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}};function Hc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bi(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Hc(t,i,n[i])})}return t}class $c{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=o=>this.handleDragStart(o,e),s=o=>this.handleSelectStart(o);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=o=>this.handleDragEnter(o,e),i=o=>this.handleDragOver(o,e),s=o=>this.handleDrop(o,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",s),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",s)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return Bi({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return Bi({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(ji).some(n=>ji[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=Vc(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&No(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const o=Ft(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:a}=i,l=Ln(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const u=this.monitor.getSourceId(),d=this.sourceNodes.get(u),h=this.sourcePreviewNodes.get(u)||d;if(h){const{anchorX:f,anchorY:p,offsetX:g,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),S=zc(d,h,o,{anchorX:f,anchorY:p},{offsetX:g,offsetY:b});a.setDragImage(h,S.x,S.y)}}try{a==null||a.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(a&&!a.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:a}=i,l=Ln(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,s.length>0&&this.actions.hover(s,{clientOffset:Ft(i)}),s.some(a=>this.monitor.canDropOnTarget(a))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Ft(i),this.scheduleHover(s),(s||[]).some(a=>this.monitor.canDropOnTarget(a))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;i.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}else Ln(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:Ft(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const s=i.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(i.preventDefault(),s.dragDrop()))},this.options=new Uc(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new kc(this.isNodeInDocument)}}let zt;function Wc(){return zt||(zt=new Image,zt.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),zt}const Gc=function(e,n,r){return new $c(e,n,r)};var Fe=[],qc=function(){return Fe.some(function(t){return t.activeTargets.length>0})},Kc=function(){return Fe.some(function(t){return t.skippedTargets.length>0})},Fi="ResizeObserver loop completed with undelivered notifications.",Xc=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Fi}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Fi),window.dispatchEvent(t)},Dt;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Dt||(Dt={}));var ze=function(t){return Object.freeze(t)},Yc=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,ze(this)}return t})(),ko=(function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ze(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,s=e.right,o=e.bottom,a=e.left,l=e.width,c=e.height;return{x:n,y:r,top:i,right:s,bottom:o,left:a,width:l,height:c}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),jr=function(t){return t instanceof SVGElement&&"getBBox"in t},Lo=function(t){if(jr(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,s=i.offsetWidth,o=i.offsetHeight;return!(s||o||t.getClientRects().length)},zi=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Zc=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},vt=typeof window<"u"?window:{},Ut=new WeakMap,Ui=/auto|scroll/,Jc=/^tb|vertical/,Qc=/msie|trident/i.test(vt.navigator&&vt.navigator.userAgent),he=function(t){return parseFloat(t||"0")},Je=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Yc((n?e:t)||0,(n?t:e)||0)},Hi=ze({devicePixelContentBoxSize:Je(),borderBoxSize:Je(),contentBoxSize:Je(),contentRect:new ko(0,0,0,0)}),Vo=function(t,e){if(e===void 0&&(e=!1),Ut.has(t)&&!e)return Ut.get(t);if(Lo(t))return Ut.set(t,Hi),Hi;var n=getComputedStyle(t),r=jr(t)&&t.ownerSVGElement&&t.getBBox(),i=!Qc&&n.boxSizing==="border-box",s=Jc.test(n.writingMode||""),o=!r&&Ui.test(n.overflowY||""),a=!r&&Ui.test(n.overflowX||""),l=r?0:he(n.paddingTop),c=r?0:he(n.paddingRight),u=r?0:he(n.paddingBottom),d=r?0:he(n.paddingLeft),h=r?0:he(n.borderTopWidth),f=r?0:he(n.borderRightWidth),p=r?0:he(n.borderBottomWidth),g=r?0:he(n.borderLeftWidth),b=d+c,y=l+u,T=g+f,S=h+p,E=a?t.offsetHeight-S-t.clientHeight:0,w=o?t.offsetWidth-T-t.clientWidth:0,O=i?b+T:0,k=i?y+S:0,R=r?r.width:he(n.width)-O-w,U=r?r.height:he(n.height)-k-E,_=R+b+w+T,J=U+y+E+S,de=ze({devicePixelContentBoxSize:Je(Math.round(R*devicePixelRatio),Math.round(U*devicePixelRatio),s),borderBoxSize:Je(_,J,s),contentBoxSize:Je(R,U,s),contentRect:new ko(d,l,R,U)});return Ut.set(t,de),de},jo=function(t,e,n){var r=Vo(t,n),i=r.borderBoxSize,s=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(e){case Dt.DEVICE_PIXEL_CONTENT_BOX:return o;case Dt.BORDER_BOX:return i;default:return s}},eu=(function(){function t(e){var n=Vo(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=ze([n.borderBoxSize]),this.contentBoxSize=ze([n.contentBoxSize]),this.devicePixelContentBoxSize=ze([n.devicePixelContentBoxSize])}return t})(),_o=function(t){if(Lo(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},tu=function(){var t=1/0,e=[];Fe.forEach(function(o){if(o.activeTargets.length!==0){var a=[];o.activeTargets.forEach(function(c){var u=new eu(c.target),d=_o(c.target);a.push(u),c.lastReportedSize=jo(c.target,c.observedBox),d<t&&(t=d)}),e.push(function(){o.callback.call(o.observer,a,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t},$i=function(t){Fe.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&(_o(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})},nu=function(){var t=0;for($i(t);qc();)t=tu(),$i(t);return Kc()&&Xc(),t>0},Vn,Bo=[],ru=function(){return Bo.splice(0).forEach(function(t){return t()})},iu=function(t){if(!Vn){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return ru()}).observe(n,r),Vn=function(){n.textContent="".concat(e?e--:e++)}}Bo.push(t),Vn()},su=function(t){iu(function(){requestAnimationFrame(t)})},Yt=0,ou=function(){return!!Yt},au=250,lu={attributes:!0,characterData:!0,childList:!0,subtree:!0},Wi=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Gi=function(t){return t===void 0&&(t=0),Date.now()+t},jn=!1,cu=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=au),!jn){jn=!0;var r=Gi(e);su(function(){var i=!1;try{i=nu()}finally{if(jn=!1,e=r-Gi(),!ou())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,lu)};document.body?n():vt.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Wi.forEach(function(n){return vt.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Wi.forEach(function(n){return vt.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),sr=new cu,qi=function(t){!Yt&&t>0&&sr.start(),Yt+=t,!Yt&&sr.stop()},uu=function(t){return!jr(t)&&!Zc(t)&&getComputedStyle(t).display==="inline"},du=(function(){function t(e,n){this.target=e,this.observedBox=n||Dt.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=jo(this.target,this.observedBox,!0);return uu(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),hu=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Ht=new WeakMap,Ki=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},$t=(function(){function t(){}return t.connect=function(e,n){var r=new hu(e,n);Ht.set(e,r)},t.observe=function(e,n,r){var i=Ht.get(e),s=i.observationTargets.length===0;Ki(i.observationTargets,n)<0&&(s&&Fe.push(i),i.observationTargets.push(new du(n,r&&r.box)),qi(1),sr.schedule())},t.unobserve=function(e,n){var r=Ht.get(e),i=Ki(r.observationTargets,n),s=r.observationTargets.length===1;i>=0&&(s&&Fe.splice(Fe.indexOf(r),1),r.observationTargets.splice(i,1),qi(-1))},t.disconnect=function(e){var n=this,r=Ht.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),fu=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");$t.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!zi(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");$t.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!zi(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");$t.unobserve(this,e)},t.prototype.disconnect=function(){$t.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();const Fo=v.createContext({});function pu(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const _r=v.createContext(null),zo=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function gu(t=!0){const e=v.useContext(_r);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=v.useId();v.useEffect(()=>{t&&i(s)},[t]);const o=v.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,o]:[!0]}const Br=typeof window<"u",mu=Br?v.useLayoutEffect:v.useEffect,te=t=>t;let Uo=te;function Fr(t){let e;return()=>(e===void 0&&(e=t()),e)}const Qe=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},ve=t=>t*1e3,ye=t=>t/1e3,vu={useManualTiming:!1};function yu(t){let e=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(l.schedule(c),t()),c(o)}const l={schedule:(c,u=!1,d=!1)=>{const f=d&&r?e:n;return u&&s.add(c),f.has(c)||f.add(c),c},cancel:c=>{n.delete(c),s.delete(c)},process:c=>{if(o=c,r){i=!0;return}r=!0,[e,n]=[n,e],e.forEach(a),e.clear(),r=!1,i&&(i=!1,l.process(c))}};return l}const Wt=["read","resolveKeyframes","update","preRender","render","postRender"],bu=40;function Ho(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Wt.reduce((y,T)=>(y[T]=yu(s),y),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:h}=o,f=()=>{const y=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(y-i.timestamp,bu),1),i.timestamp=y,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(f))},p=()=>{n=!0,r=!0,i.isProcessing||t(f)};return{schedule:Wt.reduce((y,T)=>{const S=o[T];return y[T]=(E,w=!1,O=!1)=>(n||p(),S.schedule(E,w,O)),y},{}),cancel:y=>{for(let T=0;T<Wt.length;T++)o[Wt[T]].cancel(y)},state:i,steps:o}}const{schedule:B,cancel:Ee,state:K,steps:_n}=Ho(typeof requestAnimationFrame<"u"?requestAnimationFrame:te,!0),$o=v.createContext({strict:!1}),Xi={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},et={};for(const t in Xi)et[t]={isEnabled:e=>Xi[t].some(n=>!!e[n])};function xu(t){for(const e in t)et[e]={...et[e],...t[e]}}const Tu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ln(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Tu.has(t)}let Wo=t=>!ln(t);function Su(t){t&&(Wo=e=>e.startsWith("on")?!ln(e):t(e))}try{Su(require("@emotion/is-prop-valid").default)}catch{}function wu(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(Wo(i)||n===!0&&ln(i)||!e&&!ln(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}function Du(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...r)=>t(...r);return new Proxy(n,{get:(r,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const mn=v.createContext({});function Ct(t){return typeof t=="string"||Array.isArray(t)}function vn(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const zr=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ur=["initial",...zr];function yn(t){return vn(t.animate)||Ur.some(e=>Ct(t[e]))}function Go(t){return!!(yn(t)||t.variants)}function Cu(t,e){if(yn(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Ct(n)?n:void 0,animate:Ct(r)?r:void 0}}return t.inherit!==!1?e:{}}function Eu(t){const{initial:e,animate:n}=Cu(t,v.useContext(mn));return v.useMemo(()=>({initial:e,animate:n}),[Yi(e),Yi(n)])}function Yi(t){return Array.isArray(t)?t.join(" "):t}const Pu=Symbol.for("motionComponentSymbol");function qe(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ou(t,e,n){return v.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):qe(n)&&(n.current=r))},[e])}const Hr=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Iu="framerAppearId",qo="data-"+Hr(Iu),{schedule:$r}=Ho(queueMicrotask,!1),Ko=v.createContext({});function Au(t,e,n,r,i){var s,o;const{visualElement:a}=v.useContext(mn),l=v.useContext($o),c=v.useContext(_r),u=v.useContext(zo).reducedMotion,d=v.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=d.current,f=v.useContext(Ko);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&Mu(d.current,n,i,f);const p=v.useRef(!1);v.useInsertionEffect(()=>{h&&p.current&&h.update(n,c)});const g=n[qo],b=v.useRef(!!g&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,g))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,g)));return mu(()=>{h&&(p.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),$r.render(h.render),b.current&&h.animationState&&h.animationState.animateChanges())}),v.useEffect(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),b.current=!1))}),h}function Mu(t,e,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Xo(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&qe(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function Xo(t){if(t)return t.options.allowProjection!==!1?t.projection:Xo(t.parent)}function Ru({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){var s,o;t&&xu(t);function a(c,u){let d;const h={...v.useContext(zo),...c,layoutId:Nu(c)},{isStatic:f}=h,p=Eu(c),g=r(c,f);if(!f&&Br){ku();const b=Lu(h);d=b.MeasureLayout,p.visualElement=Au(i,g,h,e,b.ProjectionNode)}return m.jsxs(mn.Provider,{value:p,children:[d&&p.visualElement?m.jsx(d,{visualElement:p.visualElement,...h}):null,n(i,c,Ou(g,p.visualElement,u),g,f,p.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const l=v.forwardRef(a);return l[Pu]=i,l}function Nu({layoutId:t}){const e=v.useContext(Fo).id;return e&&t!==void 0?e+"-"+t:t}function ku(t,e){v.useContext($o).strict}function Lu(t){const{drag:e,layout:n}=et;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Vu=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Wr(t){return typeof t!="string"||t.includes("-")?!1:!!(Vu.indexOf(t)>-1||/[A-Z]/u.test(t))}function Zi(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Gr(t,e,n,r){if(typeof e=="function"){const[i,s]=Zi(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=Zi(r);e=e(n!==void 0?n:t.custom,i,s)}return e}const or=t=>Array.isArray(t),ju=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),_u=t=>or(t)?t[t.length-1]||0:t,Y=t=>!!(t&&t.getVelocity);function Zt(t){const e=Y(t)?t.get():t;return ju(e)?e.toValue():e}function Bu({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},r,i,s){const o={latestValues:Fu(r,i,s,t),renderState:e()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Yo=t=>(e,n)=>{const r=v.useContext(mn),i=v.useContext(_r),s=()=>Bu(t,e,r,i);return n?s():pu(s)};function Fu(t,e,n,r){const i={},s=r(t,{});for(const h in s)i[h]=Zt(s[h]);let{initial:o,animate:a}=t;const l=yn(t),c=Go(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!vn(d)){const h=Array.isArray(d)?d:[d];for(let f=0;f<h.length;f++){const p=Gr(t,h[f]);if(p){const{transitionEnd:g,transition:b,...y}=p;for(const T in y){let S=y[T];if(Array.isArray(S)){const E=u?S.length-1:0;S=S[E]}S!==null&&(i[T]=S)}for(const T in g)i[T]=g[T]}}}return i}const nt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$e=new Set(nt),Zo=t=>e=>typeof e=="string"&&e.startsWith(t),Jo=Zo("--"),zu=Zo("var(--"),qr=t=>zu(t)?Uu.test(t.split("/*")[0].trim()):!1,Uu=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Qo=(t,e)=>e&&typeof t=="number"?e.transform(t):t,be=(t,e,n)=>n>e?e:n<t?t:n,rt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Et={...rt,transform:t=>be(0,1,t)},Gt={...rt,default:1},At=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Te=At("deg"),fe=At("%"),I=At("px"),Hu=At("vh"),$u=At("vw"),Ji={...fe,parse:t=>fe.parse(t)/100,transform:t=>fe.transform(t*100)},Wu={borderWidth:I,borderTopWidth:I,borderRightWidth:I,borderBottomWidth:I,borderLeftWidth:I,borderRadius:I,radius:I,borderTopLeftRadius:I,borderTopRightRadius:I,borderBottomRightRadius:I,borderBottomLeftRadius:I,width:I,maxWidth:I,height:I,maxHeight:I,top:I,right:I,bottom:I,left:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,backgroundPositionX:I,backgroundPositionY:I},Gu={rotate:Te,rotateX:Te,rotateY:Te,rotateZ:Te,scale:Gt,scaleX:Gt,scaleY:Gt,scaleZ:Gt,skew:Te,skewX:Te,skewY:Te,distance:I,translateX:I,translateY:I,translateZ:I,x:I,y:I,z:I,perspective:I,transformPerspective:I,opacity:Et,originX:Ji,originY:Ji,originZ:I},Qi={...rt,transform:Math.round},Kr={...Wu,...Gu,zIndex:Qi,size:I,fillOpacity:Et,strokeOpacity:Et,numOctaves:Qi},qu={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ku=nt.length;function Xu(t,e,n){let r="",i=!0;for(let s=0;s<Ku;s++){const o=nt[s],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Qo(a,Kr[o]);if(!l){i=!1;const u=qu[o]||o;r+=`${u}(${c}) `}n&&(e[o]=c)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function Xr(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if($e.has(l)){o=!0;continue}else if(Jo(l)){i[l]=c;continue}else{const u=Qo(c,Kr[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(e.transform||(o||n?r.transform=Xu(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const Yu={offset:"stroke-dashoffset",array:"stroke-dasharray"},Zu={offset:"strokeDashoffset",array:"strokeDasharray"};function Ju(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?Yu:Zu;t[s.offset]=I.transform(-r);const o=I.transform(e),a=I.transform(n);t[s.array]=`${o} ${a}`}function es(t,e,n){return typeof t=="string"?t:I.transform(e+n*t)}function Qu(t,e,n){const r=es(e,t.x,t.width),i=es(n,t.y,t.height);return`${r} ${i}`}function Yr(t,{attrX:e,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(Xr(t,c,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f,dimensions:p}=t;h.transform&&(p&&(f.transform=h.transform),delete h.transform),p&&(i!==void 0||s!==void 0||f.transform)&&(f.transformOrigin=Qu(p,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ju(h,o,a,l,!1)}const Zr=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),ea=()=>({...Zr(),attrs:{}}),Jr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ta(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const s in n)t.style.setProperty(s,n[s])}const na=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ra(t,e,n,r){ta(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(na.has(i)?i:Hr(i),e.attrs[i])}const cn={};function ed(t){Object.assign(cn,t)}function ia(t,{layout:e,layoutId:n}){return $e.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!cn[t]||t==="opacity")}function Qr(t,e,n){var r;const{style:i}=t,s={};for(const o in i)(Y(i[o])||e.style&&Y(e.style[o])||ia(o,t)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function sa(t,e,n){const r=Qr(t,e,n);for(const i in t)if(Y(t[i])||Y(e[i])){const s=nt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}function td(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const ts=["x","y","width","height","cx","cy","r"],nd={useVisualState:Yo({scrapeMotionValuesFromProps:sa,createRenderState:ea,onUpdate:({props:t,prevProps:e,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!t.drag;if(!s){for(const a in i)if($e.has(a)){s=!0;break}}if(!s)return;let o=!e;if(e)for(let a=0;a<ts.length;a++){const l=ts[a];t[l]!==e[l]&&(o=!0)}o&&B.read(()=>{td(n,r),B.render(()=>{Yr(r,i,Jr(n.tagName),t.transformTemplate),ra(n,r)})})}})},rd={useVisualState:Yo({scrapeMotionValuesFromProps:Qr,createRenderState:Zr})};function oa(t,e,n){for(const r in e)!Y(e[r])&&!ia(r,n)&&(t[r]=e[r])}function id({transformTemplate:t},e){return v.useMemo(()=>{const n=Zr();return Xr(n,e,t),Object.assign({},n.vars,n.style)},[e])}function sd(t,e){const n=t.style||{},r={};return oa(r,n,t),Object.assign(r,id(t,e)),r}function od(t,e){const n={},r=sd(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}function ad(t,e,n,r){const i=v.useMemo(()=>{const s=ea();return Yr(s,e,Jr(r),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};oa(s,t.style,t),i.style={...s,...i.style}}return i}function ld(t=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Wr(n)?ad:od)(r,s,o,n),c=wu(r,typeof n=="string",t),u=n!==v.Fragment?{...c,...l,ref:i}:{},{children:d}=r,h=v.useMemo(()=>Y(d)?d.get():d,[d]);return v.createElement(n,{...u,children:h})}}function cd(t,e){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Wr(r)?nd:rd,preloadedFeatures:t,useRender:ld(i),createVisualElement:e,Component:r};return Ru(o)}}function aa(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function bn(t,e,n){const r=t.getProps();return Gr(r,e,n!==void 0?n:r.custom,t)}const ud=Fr(()=>window.ScrollTimeline!==void 0);class dd{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e,n){const r=this.animations.map(i=>{if(ud()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class hd extends dd{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function ei(t,e){return t?t[e]||t.default||t:void 0}const ar=2e4;function la(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<ar;)e+=n,r=t.next(e);return e>=ar?1/0:e}function ti(t){return typeof t=="function"}function ns(t,e){t.timeline=e,t.onfinish=null}const ni=t=>Array.isArray(t)&&typeof t[0]=="number",fd={linearEasing:void 0};function pd(t,e){const n=Fr(t);return()=>{var r;return(r=fd[e])!==null&&r!==void 0?r:n()}}const un=pd(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ca=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=t(Qe(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function ua(t){return!!(typeof t=="function"&&un()||!t||typeof t=="string"&&(t in lr||un())||ni(t)||Array.isArray(t)&&t.every(ua))}const ht=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,lr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ht([0,.65,.55,1]),circOut:ht([.55,0,1,.45]),backIn:ht([.31,.01,.66,-.59]),backOut:ht([.33,1.53,.69,.99])};function da(t,e){if(t)return typeof t=="function"&&un()?ca(t,e):ni(t)?ht(t):Array.isArray(t)?t.map(n=>da(n,e)||lr.easeOut):lr[t]}const ue={x:!1,y:!1};function ha(){return ue.x||ue.y}function gd(t,e,n){var r;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function fa(t,e){const n=gd(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function rs(t){return e=>{e.pointerType==="touch"||ha()||t(e)}}function md(t,e,n={}){const[r,i,s]=fa(t,n),o=rs(a=>{const{target:l}=a,c=e(a);if(typeof c!="function"||!l)return;const u=rs(d=>{c(d),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const pa=(t,e)=>e?t===e?!0:pa(t,e.parentElement):!1,ri=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,vd=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function yd(t){return vd.has(t.tagName)||t.tabIndex!==-1}const ft=new WeakSet;function is(t){return e=>{e.key==="Enter"&&t(e)}}function Bn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const bd=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=is(()=>{if(ft.has(n))return;Bn(n,"down");const i=is(()=>{Bn(n,"up")}),s=()=>Bn(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function ss(t){return ri(t)&&!ha()}function xd(t,e,n={}){const[r,i,s]=fa(t,n),o=a=>{const l=a.currentTarget;if(!ss(a)||ft.has(l))return;ft.add(l);const c=e(a),u=(f,p)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),!(!ss(f)||!ft.has(l))&&(ft.delete(l),typeof c=="function"&&c(f,{success:p}))},d=f=>{u(f,n.useGlobalTarget||pa(l,f.target))},h=f=>{u(f,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{!yd(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",c=>bd(c,i),i)}),s}function Td(t){return t==="x"||t==="y"?ue[t]?null:(ue[t]=!0,()=>{ue[t]=!1}):ue.x||ue.y?null:(ue.x=ue.y=!0,()=>{ue.x=ue.y=!1})}const ga=new Set(["width","height","top","left","right","bottom",...nt]);let Jt;function Sd(){Jt=void 0}const pe={now:()=>(Jt===void 0&&pe.set(K.isProcessing||vu.useManualTiming?K.timestamp:performance.now()),Jt),set:t=>{Jt=t,queueMicrotask(Sd)}};function ii(t,e){t.indexOf(e)===-1&&t.push(e)}function si(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class oi{constructor(){this.subscriptions=[]}add(e){return ii(this.subscriptions,e),()=>si(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ma(t,e){return e?t*(1e3/e):0}const os=30,wd=t=>!isNaN(parseFloat(t));class Dd{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=pe.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=pe.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wd(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new oi);const r=this.events[e].add(n);return e==="change"?()=>{r(),B.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=pe.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>os)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,os);return ma(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pt(t,e){return new Dd(t,e)}function Cd(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Pt(n))}function Ed(t,e){const n=bn(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=_u(s[o]);Cd(t,o,a)}}function Pd(t){return!!(Y(t)&&t.add)}function cr(t,e){const n=t.getValue("willChange");if(Pd(n))return n.add(e)}function va(t){return t.props[qo]}const ya=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Od=1e-7,Id=12;function Ad(t,e,n,r,i){let s,o,a=0;do o=e+(n-e)/2,s=ya(o,r,i)-t,s>0?n=o:e=o;while(Math.abs(s)>Od&&++a<Id);return o}function Mt(t,e,n,r){if(t===e&&n===r)return te;const i=s=>Ad(s,0,1,t,n);return s=>s===0||s===1?s:ya(i(s),e,r)}const ba=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xa=t=>e=>1-t(1-e),Ta=Mt(.33,1.53,.69,.99),ai=xa(Ta),Sa=ba(ai),wa=t=>(t*=2)<1?.5*ai(t):.5*(2-Math.pow(2,-10*(t-1))),li=t=>1-Math.sin(Math.acos(t)),Da=xa(li),Ca=ba(li),Ea=t=>/^0[^.\s]+$/u.test(t);function Md(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ea(t):!0}const yt=t=>Math.round(t*1e5)/1e5,ci=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Rd(t){return t==null}const Nd=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ui=(t,e)=>n=>!!(typeof n=="string"&&Nd.test(n)&&n.startsWith(t)||e&&!Rd(n)&&Object.prototype.hasOwnProperty.call(n,e)),Pa=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(ci);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},kd=t=>be(0,255,t),Fn={...rt,transform:t=>Math.round(kd(t))},_e={test:ui("rgb","red"),parse:Pa("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Fn.transform(t)+", "+Fn.transform(e)+", "+Fn.transform(n)+", "+yt(Et.transform(r))+")"};function Ld(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const ur={test:ui("#"),parse:Ld,transform:_e.transform},Ke={test:ui("hsl","hue"),parse:Pa("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+fe.transform(yt(e))+", "+fe.transform(yt(n))+", "+yt(Et.transform(r))+")"},X={test:t=>_e.test(t)||ur.test(t)||Ke.test(t),parse:t=>_e.test(t)?_e.parse(t):Ke.test(t)?Ke.parse(t):ur.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?_e.transform(t):Ke.transform(t)},Vd=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jd(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(ci))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Vd))===null||n===void 0?void 0:n.length)||0)>0}const Oa="number",Ia="color",_d="var",Bd="var(",as="${}",Fd=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ot(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(Fd,l=>(X.test(l)?(r.color.push(s),i.push(Ia),n.push(X.parse(l))):l.startsWith(Bd)?(r.var.push(s),i.push(_d),n.push(l)):(r.number.push(s),i.push(Oa),n.push(parseFloat(l))),++s,as)).split(as);return{values:n,split:a,indexes:r,types:i}}function Aa(t){return Ot(t).values}function Ma(t){const{split:e,types:n}=Ot(t),r=e.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=e[o],i[o]!==void 0){const a=n[o];a===Oa?s+=yt(i[o]):a===Ia?s+=X.transform(i[o]):s+=i[o]}return s}}const zd=t=>typeof t=="number"?0:t;function Ud(t){const e=Aa(t);return Ma(t)(e.map(zd))}const Pe={test:jd,parse:Aa,createTransformer:Ma,getAnimatableNone:Ud},Hd=new Set(["brightness","contrast","saturate","opacity"]);function $d(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(ci)||[];if(!r)return t;const i=n.replace(r,"");let s=Hd.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const Wd=/\b([a-z-]*)\(.*?\)/gu,dr={...Pe,getAnimatableNone:t=>{const e=t.match(Wd);return e?e.map($d).join(" "):t}},Gd={...Kr,color:X,backgroundColor:X,outlineColor:X,fill:X,stroke:X,borderColor:X,borderTopColor:X,borderRightColor:X,borderBottomColor:X,borderLeftColor:X,filter:dr,WebkitFilter:dr},di=t=>Gd[t];function Ra(t,e){let n=di(t);return n!==dr&&(n=Pe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const qd=new Set(["auto","none","0"]);function Kd(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!qd.has(s)&&Ot(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=Ra(n,i)}const ls=t=>t===rt||t===I,cs=(t,e)=>parseFloat(t.split(", ")[e]),us=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return cs(i[1],e);{const s=r.match(/^matrix\((.+)\)$/u);return s?cs(s[1],t):0}},Xd=new Set(["x","y","z"]),Yd=nt.filter(t=>!Xd.has(t));function Zd(t){const e=[];return Yd.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const tt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:us(4,13),y:us(5,14)};tt.translateX=tt.x;tt.translateY=tt.y;const Ue=new Set;let hr=!1,fr=!1;function Na(){if(fr){const t=Array.from(Ue).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=Zd(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}fr=!1,hr=!1,Ue.forEach(t=>t.complete()),Ue.clear()}function ka(){Ue.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(fr=!0)})}function Jd(){ka(),Na()}class hi{constructor(e,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ue.add(this),hr||(hr=!0,B.read(ka),B.resolveKeyframes(Na))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;for(let s=0;s<e.length;s++)if(e[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[s]=e[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ue.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ue.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const La=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Qd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function eh(t){const e=Qd.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function Va(t,e,n=1){const[r,i]=eh(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return La(o)?parseFloat(o):o}return qr(i)?Va(i,e,n+1):i}const ja=t=>e=>e.test(t),th={test:t=>t==="auto",parse:t=>t},_a=[rt,I,fe,Te,$u,Hu,th],ds=t=>_a.find(ja(t));class Ba extends hi{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),qr(c))){const u=Va(c,n.current);u!==void 0&&(e[l]=u),l===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!ga.has(r)||e.length!==2)return;const[i,s]=e,o=ds(i),a=ds(s);if(o!==a)if(ls(o)&&ls(a))for(let l=0;l<e.length;l++){const c=e[l];typeof c=="string"&&(e[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)Md(e[i])&&r.push(i);r.length&&Kd(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=tt[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const hs=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Pe.test(t)||t==="0")&&!t.startsWith("url("));function nh(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function rh(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=hs(i,e),a=hs(s,e);return!o||!a?!1:nh(t)||(n==="spring"||ti(n))&&r}const ih=t=>t!==null;function xn(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(ih),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const sh=40;class Fa{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=pe.now(),this.options={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>sh?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Jd(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=pe.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!rh(e,r,i,s))if(o)this.options.duration=0;else{l&&l(xn(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,n);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const H=(t,e,n)=>t+(e-t)*n;function zn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function oh({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,o=0;if(!e)i=s=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=zn(l,a,t+1/3),s=zn(l,a,t),o=zn(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function dn(t,e){return n=>n>0?e:t}const Un=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},ah=[ur,_e,Ke],lh=t=>ah.find(e=>e.test(t));function fs(t){const e=lh(t);if(!e)return!1;let n=e.parse(t);return e===Ke&&(n=oh(n)),n}const ps=(t,e)=>{const n=fs(t),r=fs(e);if(!n||!r)return dn(t,e);const i={...n};return s=>(i.red=Un(n.red,r.red,s),i.green=Un(n.green,r.green,s),i.blue=Un(n.blue,r.blue,s),i.alpha=H(n.alpha,r.alpha,s),_e.transform(i))},ch=(t,e)=>n=>e(t(n)),Rt=(...t)=>t.reduce(ch),pr=new Set(["none","hidden"]);function uh(t,e){return pr.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function dh(t,e){return n=>H(t,e,n)}function fi(t){return typeof t=="number"?dh:typeof t=="string"?qr(t)?dn:X.test(t)?ps:ph:Array.isArray(t)?za:typeof t=="object"?X.test(t)?ps:hh:dn}function za(t,e){const n=[...t],r=n.length,i=t.map((s,o)=>fi(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function hh(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=fi(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function fh(t,e){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],a=t.indexes[o][i[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;r[s]=l,i[o]++}return r}const ph=(t,e)=>{const n=Pe.createTransformer(e),r=Ot(t),i=Ot(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?pr.has(t)&&!i.values.length||pr.has(e)&&!r.values.length?uh(t,e):Rt(za(fh(r,i),i.values),n):dn(t,e)};function Ua(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?H(t,e,n):fi(t)(t,e)}const gh=5;function Ha(t,e,n){const r=Math.max(e-gh,0);return ma(n-t(r),e-r)}const $={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Hn=.001;function mh({duration:t=$.duration,bounce:e=$.bounce,velocity:n=$.velocity,mass:r=$.mass}){let i,s,o=1-e;o=be($.minDamping,$.maxDamping,o),t=be($.minDuration,$.maxDuration,ye(t)),o<1?(i=c=>{const u=c*o,d=u*t,h=u-n,f=gr(c,o),p=Math.exp(-d);return Hn-h/f*p},s=c=>{const d=c*o*t,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-d),g=gr(Math.pow(c,2),o);return(-i(c)+Hn>0?-1:1)*((h-f)*p)/g}):(i=c=>{const u=Math.exp(-c*t),d=(c-n)*t+1;return-Hn+u*d},s=c=>{const u=Math.exp(-c*t),d=(n-c)*(t*t);return u*d});const a=5/t,l=yh(i,s,a);if(t=ve(t),isNaN(l))return{stiffness:$.stiffness,damping:$.damping,duration:t};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:t}}}const vh=12;function yh(t,e,n){let r=n;for(let i=1;i<vh;i++)r=r-t(r)/e(r);return r}function gr(t,e){return t*Math.sqrt(1-e*e)}const bh=["duration","bounce"],xh=["stiffness","damping","mass"];function gs(t,e){return e.some(n=>t[n]!==void 0)}function Th(t){let e={velocity:$.velocity,stiffness:$.stiffness,damping:$.damping,mass:$.mass,isResolvedFromDuration:!1,...t};if(!gs(t,xh)&&gs(t,bh))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*be(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:$.mass,stiffness:i,damping:s}}else{const n=mh(t);e={...e,...n,mass:$.mass},e.isResolvedFromDuration=!0}return e}function $a(t=$.visualDuration,e=$.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:f}=Th({...n,velocity:-ye(n.velocity||0)}),p=h||0,g=c/(2*Math.sqrt(l*u)),b=o-s,y=ye(Math.sqrt(l/u)),T=Math.abs(b)<5;r||(r=T?$.restSpeed.granular:$.restSpeed.default),i||(i=T?$.restDelta.granular:$.restDelta.default);let S;if(g<1){const w=gr(y,g);S=O=>{const k=Math.exp(-g*y*O);return o-k*((p+g*y*b)/w*Math.sin(w*O)+b*Math.cos(w*O))}}else if(g===1)S=w=>o-Math.exp(-y*w)*(b+(p+y*b)*w);else{const w=y*Math.sqrt(g*g-1);S=O=>{const k=Math.exp(-g*y*O),R=Math.min(w*O,300);return o-k*((p+g*y*b)*Math.sinh(R)+w*b*Math.cosh(R))/w}}const E={calculatedDuration:f&&d||null,next:w=>{const O=S(w);if(f)a.done=w>=d;else{let k=0;g<1&&(k=w===0?ve(p):Ha(S,w,O));const R=Math.abs(k)<=r,U=Math.abs(o-O)<=i;a.done=R&&U}return a.value=a.done?o:O,a},toString:()=>{const w=Math.min(la(E),ar),O=ca(k=>E.next(w*k).value,w,30);return w+"ms "+O}};return E}function ms({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=t[0],h={done:!1,value:d},f=R=>a!==void 0&&R<a||l!==void 0&&R>l,p=R=>a===void 0?l:l===void 0||Math.abs(a-R)<Math.abs(l-R)?a:l;let g=n*e;const b=d+g,y=o===void 0?b:o(b);y!==b&&(g=y-d);const T=R=>-g*Math.exp(-R/r),S=R=>y+T(R),E=R=>{const U=T(R),_=S(R);h.done=Math.abs(U)<=c,h.value=h.done?y:_};let w,O;const k=R=>{f(h.value)&&(w=R,O=$a({keyframes:[h.value,p(h.value)],velocity:Ha(S,R,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:R=>{let U=!1;return!O&&w===void 0&&(U=!0,E(R),k(R)),w!==void 0&&R>=w?O.next(R-w):(!U&&E(R),h)}}}const Sh=Mt(.42,0,1,1),wh=Mt(0,0,.58,1),Wa=Mt(.42,0,.58,1),Dh=t=>Array.isArray(t)&&typeof t[0]!="number",Ch={linear:te,easeIn:Sh,easeInOut:Wa,easeOut:wh,circIn:li,circInOut:Ca,circOut:Da,backIn:ai,backInOut:Sa,backOut:Ta,anticipate:wa},vs=t=>{if(ni(t)){Uo(t.length===4);const[e,n,r,i]=t;return Mt(e,n,r,i)}else if(typeof t=="string")return Ch[t];return t};function Eh(t,e,n){const r=[],i=n||Ua,s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||te:e;a=Rt(l,a)}r.push(a)}return r}function Ph(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(Uo(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Eh(e,r,i),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let d=0;if(l>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const h=Qe(t[d],t[d+1],u);return a[d](h)};return n?u=>c(be(t[0],t[s-1],u)):c}function Oh(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Qe(0,e,r);t.push(H(n,1,i))}}function Ih(t){const e=[0];return Oh(e,t.length-1),e}function Ah(t,e){return t.map(n=>n*e)}function Mh(t,e){return t.map(()=>e||Wa).splice(0,t.length-1)}function hn({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=Dh(r)?r.map(vs):vs(r),s={done:!1,value:e[0]},o=Ah(n&&n.length===e.length?n:Ih(e),t),a=Ph(o,e,{ease:Array.isArray(i)?i:Mh(e,i)});return{calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}const Rh=t=>{const e=({timestamp:n})=>t(n);return{start:()=>B.update(e,!0),stop:()=>Ee(e),now:()=>K.isProcessing?K.timestamp:pe.now()}},Nh={decay:ms,inertia:ms,tween:hn,keyframes:hn,spring:$a},kh=t=>t/100;class pi extends Fa{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||hi,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=ti(n)?n:Nh[n]||hn;let l,c;a!==hn&&typeof e[0]!="number"&&(l=Rt(kh,Ua(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});s==="mirror"&&(c=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=la(u));const{calculatedDuration:d}=u,h=d+i,f=h*(r+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:h,totalDuration:f}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:h,repeat:f,repeatType:p,repeatDelay:g,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),T=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let S=this.currentTime,E=s;if(f){const R=Math.min(this.currentTime,u)/d;let U=Math.floor(R),_=R%1;!_&&R>=1&&(_=1),_===1&&U--,U=Math.min(U,f+1),!!(U%2)&&(p==="reverse"?(_=1-_,g&&(_-=g/d)):p==="mirror"&&(E=o)),S=be(0,1,_)*d}const w=T?{done:!1,value:l[0]}:E.next(S);a&&(w.value=a(w.value));let{done:O}=w;!T&&c!==null&&(O=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return k&&i!==void 0&&(w.value=xn(l,this.options,i)),b&&b(w.value),k&&this.finish(),w}get duration(){const{resolved:e}=this;return e?ye(e.calculatedDuration):0}get time(){return ye(this.currentTime)}set time(e){e=ve(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=ye(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Rh,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Lh=new Set(["opacity","clipPath","filter","transform"]);function Vh(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[e]:n};l&&(c.offset=l);const u=da(a,i);return Array.isArray(u)&&(c.easing=u),t.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const jh=Fr(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),fn=10,_h=2e4;function Bh(t){return ti(t.type)||t.type==="spring"||!ua(t.ease)}function Fh(t,e){const n=new pi({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const i=[];let s=0;for(;!r.done&&s<_h;)r=n.sample(s),i.push(r.value),s+=fn;return{times:void 0,keyframes:i,duration:s-fn,ease:"linear"}}const Ga={anticipate:wa,backInOut:Sa,circInOut:Ca};function zh(t){return t in Ga}class ys extends Fa{constructor(e){super(e);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new Ba(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&un()&&zh(s)&&(s=Ga[s]),Bh(this.options)){const{onComplete:d,onUpdate:h,motionValue:f,element:p,...g}=this.options,b=Fh(e,g);e=b.keyframes,e.length===1&&(e[1]=e[0]),r=b.duration,i=b.times,s=b.ease,o="keyframes"}const u=Vh(a.owner.current,l,e,{...this.options,duration:r,times:i,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(ns(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(xn(e,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:o,ease:s,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return ye(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return ye(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ve(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return te;const{animation:r}=n;ns(r,e)}return te}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:h,...f}=this.options,p=new pi({...f,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),g=ve(this.time);c.setWithVelocity(p.sample(g-fn).value,p.sample(g).value,fn)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return jh()&&r&&Lh.has(r)&&!l&&!c&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const Uh={type:"spring",stiffness:500,damping:25,restSpeed:10},Hh=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),$h={type:"keyframes",duration:.8},Wh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Gh=(t,{keyframes:e})=>e.length>2?$h:$e.has(t)?t.startsWith("scale")?Hh(e[1]):Uh:Wh;function qh({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const gi=(t,e,n,r={},i,s)=>o=>{const a=ei(r,t)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ve(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:i};qh(a)||(u={...u,...Gh(t,u)}),u.duration&&(u.duration=ve(u.duration)),u.repeatDelay&&(u.repeatDelay=ve(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!s&&e.get()!==void 0){const h=xn(u.keyframes,a);if(h!==void 0)return B.update(()=>{u.onUpdate(h),u.onComplete()}),new hd([])}return!s&&ys.supports(u)?new ys(u):new pi(u)};function Kh({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function qa(t,e,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;r&&(o=r);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const d in l){const h=t.getValue(d,(s=t.latestValues[d])!==null&&s!==void 0?s:null),f=l[d];if(f===void 0||u&&Kh(u,d))continue;const p={delay:n,...ei(o||{},d)};let g=!1;if(window.MotionHandoffAnimation){const y=va(t);if(y){const T=window.MotionHandoffAnimation(y,d,B);T!==null&&(p.startTime=T,g=!0)}}cr(t,d),h.start(gi(d,h,f,t.shouldReduceMotion&&ga.has(d)?{type:!1}:p,t,g));const b=h.animation;b&&c.push(b)}return a&&Promise.all(c).then(()=>{B.update(()=>{a&&Ed(t,a)})}),c}function mr(t,e,n={}){var r;const i=bn(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(qa(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=s;return Xh(t,e,u+c,d,h,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function Xh(t,e,n=0,r=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(t.variantChildren).sort(Yh).forEach((c,u)=>{c.notify("AnimationStart",e),o.push(mr(c,e,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(o)}function Yh(t,e){return t.sortNodePosition(e)}function Zh(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>mr(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=mr(t,e,n);else{const i=typeof e=="function"?bn(t,e,n.custom):e;r=Promise.all(qa(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const Jh=Ur.length;function Ka(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Ka(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Jh;n++){const r=Ur[n],i=t.props[r];(Ct(i)||i===!1)&&(e[r]=i)}return e}const Qh=[...zr].reverse(),ef=zr.length;function tf(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Zh(t,n,r)))}function nf(t){let e=tf(t),n=bs(),r=!0;const i=l=>(c,u)=>{var d;const h=bn(t,u,l==="exit"?(d=t.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(h){const{transition:f,transitionEnd:p,...g}=h;c={...c,...g,...p}}return c};function s(l){e=l(t)}function o(l){const{props:c}=t,u=Ka(t.parent)||{},d=[],h=new Set;let f={},p=1/0;for(let b=0;b<ef;b++){const y=Qh[b],T=n[y],S=c[y]!==void 0?c[y]:u[y],E=Ct(S),w=y===l?T.isActive:null;w===!1&&(p=b);let O=S===u[y]&&S!==c[y]&&E;if(O&&r&&t.manuallyAnimateOnMount&&(O=!1),T.protectedKeys={...f},!T.isActive&&w===null||!S&&!T.prevProp||vn(S)||typeof S=="boolean")continue;const k=rf(T.prevProp,S);let R=k||y===l&&T.isActive&&!O&&E||b>p&&E,U=!1;const _=Array.isArray(S)?S:[S];let J=_.reduce(i(y),{});w===!1&&(J={});const{prevResolvedValues:de={}}=T,Pn={...de,...J},Lt=q=>{R=!0,h.has(q)&&(U=!0,h.delete(q)),T.needsAnimating[q]=!0;const ce=t.getValue(q);ce&&(ce.liveStyle=!1)};for(const q in Pn){const ce=J[q],it=de[q];if(f.hasOwnProperty(q))continue;let We=!1;or(ce)&&or(it)?We=!aa(ce,it):We=ce!==it,We?ce!=null?Lt(q):h.add(q):ce!==void 0&&h.has(q)?Lt(q):T.protectedKeys[q]=!0}T.prevProp=S,T.prevResolvedValues=J,T.isActive&&(f={...f,...J}),r&&t.blockInitialAnimation&&(R=!1),R&&(!(O&&k)||U)&&d.push(..._.map(q=>({animation:q,options:{type:y}})))}if(h.size){const b={};h.forEach(y=>{const T=t.getBaseTarget(y),S=t.getValue(y);S&&(S.liveStyle=!0),b[y]=T??null}),d.push({animation:b})}let g=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),r=!1,g?e(d):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=t.variantChildren)===null||u===void 0||u.forEach(h=>{var f;return(f=h.animationState)===null||f===void 0?void 0:f.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=bs(),r=!0}}}function rf(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!aa(e,t):!1}function Ne(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bs(){return{animate:Ne(!0),whileInView:Ne(),whileHover:Ne(),whileTap:Ne(),whileDrag:Ne(),whileFocus:Ne(),exit:Ne()}}class Ie{constructor(e){this.isMounted=!1,this.node=e}update(){}}class sf extends Ie{constructor(e){super(e),e.animationState||(e.animationState=nf(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();vn(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let of=0;class af extends Ie{constructor(){super(...arguments),this.id=of++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const lf={animation:{Feature:sf},exit:{Feature:af}};function It(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function Nt(t){return{point:{x:t.pageX,y:t.pageY}}}const cf=t=>e=>ri(e)&&t(e,Nt(e));function bt(t,e,n,r){return It(t,e,cf(n),r)}const xs=(t,e)=>Math.abs(t-e);function uf(t,e){const n=xs(t.x,e.x),r=xs(t.y,e.y);return Math.sqrt(n**2+r**2)}class Xa{constructor(e,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Wn(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=uf(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:g}=K;this.history.push({...p,timestamp:g});const{onStart:b,onMove:y}=this.handlers;h||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=$n(h,this.transformPagePoint),B.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Wn(d.type==="pointercancel"?this.lastMoveEventInfo:$n(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,b),p&&p(d,b)},!ri(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Nt(e),a=$n(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=K;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(e,Wn(a,this.history)),this.removeListeners=Rt(bt(this.contextWindow,"pointermove",this.handlePointerMove),bt(this.contextWindow,"pointerup",this.handlePointerUp),bt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Ee(this.updatePoint)}}function $n(t,e){return e?{point:e(t.point)}:t}function Ts(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Wn({point:t},e){return{point:t,delta:Ts(t,Ya(e)),offset:Ts(t,df(e)),velocity:hf(e,.1)}}function df(t){return t[0]}function Ya(t){return t[t.length-1]}function hf(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Ya(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>ve(e)));)n--;if(!r)return{x:0,y:0};const s=ye(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const Za=1e-4,ff=1-Za,pf=1+Za,Ja=.01,gf=0-Ja,mf=0+Ja;function ne(t){return t.max-t.min}function vf(t,e,n){return Math.abs(t-e)<=n}function Ss(t,e,n,r=.5){t.origin=r,t.originPoint=H(e.min,e.max,t.origin),t.scale=ne(n)/ne(e),t.translate=H(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ff&&t.scale<=pf||isNaN(t.scale))&&(t.scale=1),(t.translate>=gf&&t.translate<=mf||isNaN(t.translate))&&(t.translate=0)}function xt(t,e,n,r){Ss(t.x,e.x,n.x,r?r.originX:void 0),Ss(t.y,e.y,n.y,r?r.originY:void 0)}function ws(t,e,n){t.min=n.min+e.min,t.max=t.min+ne(e)}function yf(t,e,n){ws(t.x,e.x,n.x),ws(t.y,e.y,n.y)}function Ds(t,e,n){t.min=e.min-n.min,t.max=t.min+ne(e)}function Tt(t,e,n){Ds(t.x,e.x,n.x),Ds(t.y,e.y,n.y)}function bf(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?H(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?H(n,t,r.max):Math.min(t,n)),t}function Cs(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function xf(t,{top:e,left:n,bottom:r,right:i}){return{x:Cs(t.x,n,i),y:Cs(t.y,e,r)}}function Es(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function Tf(t,e){return{x:Es(t.x,e.x),y:Es(t.y,e.y)}}function Sf(t,e){let n=.5;const r=ne(t),i=ne(e);return i>r?n=Qe(e.min,e.max-r,t.min):r>i&&(n=Qe(t.min,t.max-i,e.min)),be(0,1,n)}function wf(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const vr=.35;function Df(t=vr){return t===!1?t=0:t===!0&&(t=vr),{x:Ps(t,"left","right"),y:Ps(t,"top","bottom")}}function Ps(t,e,n){return{min:Os(t,e),max:Os(t,n)}}function Os(t,e){return typeof t=="number"?t:t[e]||0}const Is=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xe=()=>({x:Is(),y:Is()}),As=()=>({min:0,max:0}),G=()=>({x:As(),y:As()});function oe(t){return[t("x"),t("y")]}function Qa({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Cf({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Ef(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Gn(t){return t===void 0||t===1}function yr({scale:t,scaleX:e,scaleY:n}){return!Gn(t)||!Gn(e)||!Gn(n)}function ke(t){return yr(t)||el(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function el(t){return Ms(t.x)||Ms(t.y)}function Ms(t){return t&&t!=="0%"}function pn(t,e,n){const r=t-n,i=e*r;return n+i}function Rs(t,e,n,r,i){return i!==void 0&&(t=pn(t,i,r)),pn(t,n,r)+e}function br(t,e=0,n=1,r,i){t.min=Rs(t.min,e,n,r,i),t.max=Rs(t.max,e,n,r,i)}function tl(t,{x:e,y:n}){br(t.x,e.translate,e.scale,e.originPoint),br(t.y,n.translate,n.scale,n.originPoint)}const Ns=.999999999999,ks=1.0000000000001;function Pf(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ze(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,tl(t,o)),r&&ke(s.latestValues)&&Ze(t,s.latestValues))}e.x<ks&&e.x>Ns&&(e.x=1),e.y<ks&&e.y>Ns&&(e.y=1)}function Ye(t,e){t.min=t.min+e,t.max=t.max+e}function Ls(t,e,n,r,i=.5){const s=H(t.min,t.max,i);br(t,e,n,s,r)}function Ze(t,e){Ls(t.x,e.x,e.scaleX,e.scale,e.originX),Ls(t.y,e.y,e.scaleY,e.scale,e.originY)}function nl(t,e){return Qa(Ef(t.getBoundingClientRect(),e))}function Of(t,e,n){const r=nl(t,n),{scroll:i}=e;return i&&(Ye(r.x,i.offset.x),Ye(r.y,i.offset.y)),r}const rl=({current:t})=>t?t.ownerDocument.defaultView:null,If=new WeakMap;class Af{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=G(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Nt(u).point)},s=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Td(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),oe(b=>{let y=this.getAxisMotionValue(b).get()||0;if(fe.test(y)){const{projection:T}=this.visualElement;if(T&&T.layout){const S=T.layout.layoutBox[b];S&&(y=ne(S)*(parseFloat(y)/100))}}this.originPoint[b]=y}),p&&B.postRender(()=>p(u,d)),cr(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:g}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:b}=d;if(f&&this.currentDirection===null){this.currentDirection=Mf(b),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,b),this.updateAxis("y",d.point,b),this.visualElement.render(),g&&g(u,d)},a=(u,d)=>this.stop(u,d),l=()=>oe(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Xa(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:rl(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&B.postRender(()=>s(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!qt(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=bf(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;n&&qe(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=xf(i.layoutBox,n):this.constraints=!1,this.elastic=Df(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&oe(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=wf(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!qe(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Of(r,i.root,this.visualElement.getTransformPagePoint());let o=Tf(i.layout.layoutBox,s);if(n){const a=n(Cf(o));this.hasMutatedConstraints=!!a,a&&(o=Qa(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=oe(u=>{if(!qt(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=i?200:1e6,f=i?40:1e7,p={type:"inertia",velocity:r?e[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return cr(this.visualElement,e),r.start(gi(e,r,0,n,this.visualElement,!1))}stopAnimation(){oe(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){oe(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){oe(n=>{const{drag:r}=this.getProps();if(!qt(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(e[n]-H(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!qe(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};oe(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=Sf({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),oe(o=>{if(!qt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(H(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;If.set(this.visualElement,this);const e=this.visualElement.current,n=bt(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();qe(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),B.read(r);const o=It(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(oe(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=vr,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function qt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Mf(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Rf extends Ie{constructor(e){super(e),this.removeGroupControls=te,this.removeListeners=te,this.controls=new Af(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||te}unmount(){this.removeGroupControls(),this.removeListeners()}}const Vs=t=>(e,n)=>{t&&B.postRender(()=>t(e,n))};class Nf extends Ie{constructor(){super(...arguments),this.removePointerDownListener=te}onPointerDown(e){this.session=new Xa(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rl(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Vs(e),onStart:Vs(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&B.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=bt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function js(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const lt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(I.test(t))t=parseFloat(t);else return t;const n=js(t,e.target.x),r=js(t,e.target.y);return`${n}% ${r}%`}},kf={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=Pe.parse(t);if(i.length>5)return r;const s=Pe.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const c=H(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class Lf extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;ed(Vf),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||B.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),$r.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function il(t){const[e,n]=gu(),r=v.useContext(Fo);return m.jsx(Lf,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(Ko),isPresent:e,safeToRemove:n})}const Vf={borderRadius:{...lt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomLeftRadius:lt,borderBottomRightRadius:lt,boxShadow:kf};function jf(t,e,n){const r=Y(t)?t:Pt(t);return r.start(gi("",r,e,n)),r.animation}function _f(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Bf=(t,e)=>t.depth-e.depth;class Ff{constructor(){this.children=[],this.isDirty=!1}add(e){ii(this.children,e),this.isDirty=!0}remove(e){si(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Bf),this.isDirty=!1,this.children.forEach(e)}}function zf(t,e){const n=pe.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(Ee(r),t(s-e))};return B.read(r,!0),()=>Ee(r)}const sl=["TopLeft","TopRight","BottomLeft","BottomRight"],Uf=sl.length,_s=t=>typeof t=="string"?parseFloat(t):t,Bs=t=>typeof t=="number"||I.test(t);function Hf(t,e,n,r,i,s){i?(t.opacity=H(0,n.opacity!==void 0?n.opacity:1,$f(r)),t.opacityExit=H(e.opacity!==void 0?e.opacity:1,0,Wf(r))):s&&(t.opacity=H(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Uf;o++){const a=`border${sl[o]}Radius`;let l=Fs(e,a),c=Fs(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Bs(l)===Bs(c)?(t[a]=Math.max(H(_s(l),_s(c),r),0),(fe.test(c)||fe.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=H(e.rotate||0,n.rotate||0,r))}function Fs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const $f=ol(0,.5,Da),Wf=ol(.5,.95,te);function ol(t,e,n){return r=>r<t?0:r>e?1:n(Qe(t,e,r))}function zs(t,e){t.min=e.min,t.max=e.max}function re(t,e){zs(t.x,e.x),zs(t.y,e.y)}function Us(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Hs(t,e,n,r,i){return t-=e,t=pn(t,1/n,r),i!==void 0&&(t=pn(t,1/i,r)),t}function Gf(t,e=0,n=1,r=.5,i,s=t,o=t){if(fe.test(e)&&(e=parseFloat(e),e=H(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=H(s.min,s.max,r);t===s&&(a-=e),t.min=Hs(t.min,e,n,a,i),t.max=Hs(t.max,e,n,a,i)}function $s(t,e,[n,r,i],s,o){Gf(t,e[n],e[r],e[i],e.scale,s,o)}const qf=["x","scaleX","originX"],Kf=["y","scaleY","originY"];function Ws(t,e,n,r){$s(t.x,e,qf,n?n.x:void 0,r?r.x:void 0),$s(t.y,e,Kf,n?n.y:void 0,r?r.y:void 0)}function Gs(t){return t.translate===0&&t.scale===1}function al(t){return Gs(t.x)&&Gs(t.y)}function qs(t,e){return t.min===e.min&&t.max===e.max}function Xf(t,e){return qs(t.x,e.x)&&qs(t.y,e.y)}function Ks(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function ll(t,e){return Ks(t.x,e.x)&&Ks(t.y,e.y)}function Xs(t){return ne(t.x)/ne(t.y)}function Ys(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Yf{constructor(){this.members=[]}add(e){ii(this.members,e),e.scheduleRender()}remove(e){if(si(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zf(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:h,skewX:f,skewY:p}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),h&&(r+=`rotateY(${h}deg) `),f&&(r+=`skewX(${f}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Le={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},pt=typeof window<"u"&&window.MotionDebug!==void 0,qn=["","X","Y","Z"],Jf={visibility:"hidden"},Zs=1e3;let Qf=0;function Kn(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function cl(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=va(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",B,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&cl(r)}function ul({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Qf++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,pt&&(Le.totalNodes=Le.resolvedTargetDeltas=Le.recalculatedProjection=0),this.nodes.forEach(np),this.nodes.forEach(ap),this.nodes.forEach(lp),this.nodes.forEach(rp),pt&&window.MotionDebug.record(Le)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ff)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new oi),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=_f(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),t){let d;const h=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=zf(h,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(Qs))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||fp,{onLayoutAnimationStart:b,onLayoutAnimationComplete:y}=u.getProps(),T=!this.targetLayout||!ll(this.targetLayout,p)||f,S=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||S||h&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,S);const E={...ei(g,"layout"),onPlay:b,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else h||Qs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ee(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(cp),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&cl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Js);return}this.isUpdating||this.nodes.forEach(sp),this.isUpdating=!1,this.nodes.forEach(op),this.nodes.forEach(ep),this.nodes.forEach(tp),this.clearAllSnapshots();const a=pe.now();K.delta=be(0,1e3/60,a-K.timestamp),K.timestamp=a,K.isProcessing=!0,_n.update.process(K),_n.preRender.process(K),_n.render.process(K),K.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,$r.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ip),this.sharedNodes.forEach(up)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,B.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){B.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=G(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!al(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||ke(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),pp(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return G();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(gp))){const{scroll:u}=this.root;u&&(Ye(l.x,u.offset.x),Ye(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=G();if(re(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&re(l,o),Ye(l.x,d.offset.x),Ye(l.y,d.offset.y))}return l}applyTransform(o,a=!1){const l=G();re(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ze(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),ke(u.latestValues)&&Ze(l,u.latestValues)}return ke(this.latestValues)&&Ze(l,this.latestValues),l}removeTransform(o){const a=G();re(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ke(c.latestValues))continue;yr(c.latestValues)&&c.updateSnapshot();const u=G(),d=c.measurePageBox();re(u,d),Ws(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return ke(this.latestValues)&&Ws(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==K.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!(!this.layout||!(d||h))){if(this.resolvedRelativeTargetAt=K.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=G(),this.relativeTargetOrigin=G(),Tt(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),re(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=G(),this.targetWithTransforms=G()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),yf(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):re(this.target,this.layout.layoutBox),tl(this.target,this.targetDelta)):re(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=G(),this.relativeTargetOrigin=G(),Tt(this.relativeTargetOrigin,this.target,f.target),re(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}pt&&Le.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||yr(this.parent.latestValues)||el(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===K.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;re(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Pf(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=G());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Us(this.prevProjectionDelta.x,this.projectionDelta.x),Us(this.prevProjectionDelta.y,this.projectionDelta.y)),xt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Ys(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ys(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),pt&&Le.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Xe(),this.projectionDelta=Xe(),this.projectionDeltaWithTransform=Xe()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Xe();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=G(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=f!==p,b=this.getStack(),y=!b||b.members.length<=1,T=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(hp));this.animationProgress=0;let S;this.mixTargetDelta=E=>{const w=E/1e3;eo(d.x,o.x,w),eo(d.y,o.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dp(this.relativeTarget,this.relativeTargetOrigin,h,w),S&&Xf(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=G()),re(S,this.relativeTarget)),g&&(this.animationValues=u,Hf(u,c,this.latestValues,w,T,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ee(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=B.update(()=>{Qt.hasAnimatedSinceResize=!0,this.currentAnimation=jf(0,Zs,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Zs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&dl(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||G();const d=ne(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=ne(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}re(a,l),Ze(a,u),xt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Yf),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Kn("z",o,c,this.animationValues);for(let u=0;u<qn.length;u++)Kn(`rotate${qn[u]}`,o,c,this.animationValues),Kn(`skew${qn[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Jf;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Zt(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Zt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!ke(this.latestValues)&&(g.transform=u?u({},""):"none",this.hasProjected=!1),g}const h=d.animationValues||d.latestValues;this.applyTransformsToTarget(),c.transform=Zf(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:f,y:p}=this.projectionDelta;c.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,d.animationValues?c.opacity=d===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const g in cn){if(h[g]===void 0)continue;const{correct:b,applyTo:y}=cn[g],T=c.transform==="none"?h[g]:b(h[g],d);if(y){const S=y.length;for(let E=0;E<S;E++)c[y[E]]=T}else c[g]=T}return this.options.layoutId&&(c.pointerEvents=d===this?Zt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Js),this.root.sharedNodes.clear()}}}function ep(t){t.updateLayout()}function tp(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;s==="size"?oe(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=ne(h);h.min=r[d].min,h.max=h.min+f}):dl(s,n.layoutBox,r)&&oe(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=ne(r[d]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+f)});const a=Xe();xt(a,r,n.layoutBox);const l=Xe();o?xt(l,t.applyTransform(i,!0),n.measuredBox):xt(l,r,n.layoutBox);const c=!al(a);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=G();Tt(p,n.layoutBox,h.layoutBox);const g=G();Tt(g,r,f.layoutBox),ll(p,g)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function np(t){pt&&Le.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function rp(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ip(t){t.clearSnapshot()}function Js(t){t.clearMeasurements()}function sp(t){t.isLayoutDirty=!1}function op(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Qs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ap(t){t.resolveTargetDelta()}function lp(t){t.calcProjection()}function cp(t){t.resetSkewAndRotation()}function up(t){t.removeLeadSnapshot()}function eo(t,e,n){t.translate=H(e.translate,0,n),t.scale=H(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function to(t,e,n,r){t.min=H(e.min,n.min,r),t.max=H(e.max,n.max,r)}function dp(t,e,n,r){to(t.x,e.x,n.x,r),to(t.y,e.y,n.y,r)}function hp(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const fp={duration:.45,ease:[.4,0,.1,1]},no=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ro=no("applewebkit/")&&!no("chrome/")?Math.round:te;function io(t){t.min=ro(t.min),t.max=ro(t.max)}function pp(t){io(t.x),io(t.y)}function dl(t,e,n){return t==="position"||t==="preserve-aspect"&&!vf(Xs(e),Xs(n),.2)}function gp(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const mp=ul({attachResizeListener:(t,e)=>It(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xn={current:void 0},hl=ul({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Xn.current){const t=new mp({});t.mount(window),t.setOptions({layoutScroll:!0}),Xn.current=t}return Xn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),vp={pan:{Feature:Nf},drag:{Feature:Rf,ProjectionNode:hl,MeasureLayout:il}};function so(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&B.postRender(()=>s(e,Nt(e)))}class yp extends Ie{mount(){const{current:e}=this.node;e&&(this.unmount=md(e,n=>(so(this.node,n,"Start"),r=>so(this.node,r,"End"))))}unmount(){}}class bp extends Ie{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Rt(It(this.node.current,"focus",()=>this.onFocus()),It(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function oo(t,e,n){const{props:r}=t;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&B.postRender(()=>s(e,Nt(e)))}class xp extends Ie{mount(){const{current:e}=this.node;e&&(this.unmount=xd(e,n=>(oo(this.node,n,"Start"),(r,{success:i})=>oo(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const xr=new WeakMap,Yn=new WeakMap,Tp=t=>{const e=xr.get(t.target);e&&e(t)},Sp=t=>{t.forEach(Tp)};function wp({root:t,...e}){const n=t||document;Yn.has(n)||Yn.set(n,{});const r=Yn.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(Sp,{root:t,...e})),r[i]}function Dp(t,e,n){const r=wp(e);return xr.set(t,n),r.observe(t),()=>{xr.delete(t),r.unobserve(t)}}const Cp={some:0,all:1};class Ep extends Ie{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Cp[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return Dp(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Pp(e,n))&&this.startObserver()}unmount(){}}function Pp({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Op={inView:{Feature:Ep},tap:{Feature:xp},focus:{Feature:bp},hover:{Feature:yp}},Ip={layout:{ProjectionNode:hl,MeasureLayout:il}},Tr={current:null},fl={current:!1};function Ap(){if(fl.current=!0,!!Br)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Tr.current=t.matches;t.addListener(e),e()}else Tr.current=!1}const Mp=[..._a,X,Pe],Rp=t=>Mp.find(ja(t)),ao=new WeakMap;function Np(t,e,n){for(const r in e){const i=e[r],s=n[r];if(Y(i))t.addValue(r,i);else if(Y(s))t.addValue(r,Pt(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(r);t.addValue(r,Pt(o!==void 0?o:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const lo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class kp{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=hi,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=pe.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,B.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=yn(n),this.isVariantNode=Go(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const p=h[f];l[f]!==void 0&&Y(p)&&p.set(l[f],!1)}}mount(e){this.current=e,ao.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),fl.current||Ap(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Tr.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){ao.delete(this.current),this.projection&&this.projection.unmount(),Ee(this.notifyUpdate),Ee(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=$e.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&B.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in et){const n=et[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):G()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<lo.length;r++){const i=lo[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Np(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Pt(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(La(i)||Ea(i))?i=parseFloat(i):!Rp(i)&&Pe.test(n)&&(i=Ra(e,n)),this.setBaseTarget(e,Y(i)?i.get():i)),Y(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=Gr(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[e])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Y(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new oi),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class pl extends kp{constructor(){super(...arguments),this.KeyframeResolver=Ba}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Y(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Lp(t){return window.getComputedStyle(t)}class Vp extends pl{constructor(){super(...arguments),this.type="html",this.renderInstance=ta}readValueFromInstance(e,n){if($e.has(n)){const r=di(n);return r&&r.default||0}else{const r=Lp(e),i=(Jo(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return nl(e,n)}build(e,n,r){Xr(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Qr(e,n,r)}}class jp extends pl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=G}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if($e.has(n)){const r=di(n);return r&&r.default||0}return n=na.has(n)?n:Hr(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return sa(e,n,r)}build(e,n,r){Yr(e,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,n,r,i){ra(e,n,r,i)}mount(e){this.isSVGTag=Jr(e.tagName),super.mount(e)}}const _p=(t,e)=>Wr(t)?new jp(e):new Vp(e,{allowProjection:t!==v.Fragment}),Bp=cd({...lf,...Op,...vp,...Ip},_p),Fp=Du(Bp);function co(t,e){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...r),e)}}function zp({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,o]=v.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=v.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=t?typeof t=="number"?t:t.scroll:null,c=t?typeof t=="number"?t:t.resize:null,u=v.useRef(!1);v.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[d,h,f]=v.useMemo(()=>{const y=()=>{if(!a.current.element)return;const{left:T,top:S,width:E,height:w,bottom:O,right:k,x:R,y:U}=a.current.element.getBoundingClientRect(),_={left:T,top:S,width:E,height:w,bottom:O,right:k,x:R,y:U};a.current.element instanceof HTMLElement&&r&&(_.height=a.current.element.offsetHeight,_.width=a.current.element.offsetWidth),Object.freeze(_),u.current&&!Wp(a.current.lastBounds,_)&&o(a.current.lastBounds=_)};return[y,c?co(y,c):y,l?co(y,l):y]},[o,r,l,c]);function p(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(y=>y.removeEventListener("scroll",f,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function g(){a.current.element&&(a.current.resizeObserver=new i(f),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(y=>y.addEventListener("scroll",f,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{f()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const b=y=>{!y||y===a.current.element||(p(),a.current.element=y,a.current.scrollContainers=gl(y),g())};return Hp(f,!!e),Up(h),v.useEffect(()=>{p(),g()},[e,f,h]),v.useEffect(()=>p,[]),[b,s,d]}function Up(t){v.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function Hp(t,e){v.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function gl(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(t),[...e,...gl(t.parentElement)]}const $p=["x","y","top","bottom","left","right","width","height"],Wp=(t,e)=>$p.every(n=>t[n]===e[n]),ml=v.createContext({dragDropManager:void 0});function ie(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var uo=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),ho=function(){return Math.random().toString(36).substring(7).split("").join(".")},fo={INIT:"@@redux/INIT"+ho(),REPLACE:"@@redux/REPLACE"+ho()};function Gp(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function vl(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ie(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ie(1));return n(vl)(t,e)}if(typeof t!="function")throw new Error(ie(2));var i=t,s=e,o=[],a=o,l=!1;function c(){a===o&&(a=o.slice())}function u(){if(l)throw new Error(ie(3));return s}function d(g){if(typeof g!="function")throw new Error(ie(4));if(l)throw new Error(ie(5));var b=!0;return c(),a.push(g),function(){if(b){if(l)throw new Error(ie(6));b=!1,c();var T=a.indexOf(g);a.splice(T,1),o=null}}}function h(g){if(!Gp(g))throw new Error(ie(7));if(typeof g.type>"u")throw new Error(ie(8));if(l)throw new Error(ie(9));try{l=!0,s=i(s,g)}finally{l=!1}for(var b=o=a,y=0;y<b.length;y++){var T=b[y];T()}return g}function f(g){if(typeof g!="function")throw new Error(ie(10));i=g,h({type:fo.REPLACE})}function p(){var g,b=d;return g={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(ie(11));function S(){T.next&&T.next(u())}S();var E=b(S);return{unsubscribe:E}}},g[uo]=function(){return this},g}return h({type:fo.INIT}),r={dispatch:h,subscribe:d,getState:u,replaceReducer:f},r[uo]=p,r}function L(t,e,...n){if(qp()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(e.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function qp(){return typeof process<"u"&&!0}function Kp(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function Xp(t,e){return t.filter(n=>n!==e)}function yl(t){return typeof t=="object"}function Yp(t,e){const n=new Map,r=s=>{n.set(s,n.has(s)?n.get(s)+1:1)};t.forEach(r),e.forEach(r);const i=[];return n.forEach((s,o)=>{s===1&&i.push(o)}),i}function Zp(t,e){return t.filter(n=>e.indexOf(n)>-1)}const mi="dnd-core/INIT_COORDS",Tn="dnd-core/BEGIN_DRAG",vi="dnd-core/PUBLISH_DRAG_SOURCE",Sn="dnd-core/HOVER",wn="dnd-core/DROP",Dn="dnd-core/END_DRAG";function po(t,e){return{type:mi,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const Jp={type:mi,payload:{clientOffset:null,sourceClientOffset:null}};function Qp(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:s,getSourceClientOffset:o}=r,a=t.getMonitor(),l=t.getRegistry();t.dispatch(po(s)),eg(n,a,l);const c=rg(n,a);if(c==null){t.dispatch(Jp);return}let u=null;if(s){if(!o)throw new Error("getSourceClientOffset must be defined");tg(o),u=o(c)}t.dispatch(po(s,u));const h=l.getSource(c).beginDrag(a,c);if(h==null)return;ng(h),l.pinSource(c);const f=l.getSourceType(c);return{type:Tn,payload:{itemType:f,item:h,sourceId:c,clientOffset:s||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}function eg(t,e,n){L(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){L(n.getSource(r),"Expected sourceIds to be registered.")})}function tg(t){L(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ng(t){L(yl(t),"Item must be an object.")}function rg(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function ig(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sg(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){ig(t,i,n[i])})}return t}function og(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();ag(r),ug(r).forEach((o,a)=>{const l=lg(o,a,i,r),c={type:wn,payload:{dropResult:sg({},n,l)}};t.dispatch(c)})}}function ag(t){L(t.isDragging(),"Cannot call drop while not dragging."),L(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function lg(t,e,n,r){const i=n.getTarget(t);let s=i?i.drop(r,t):void 0;return cg(s),typeof s>"u"&&(s=e===0?{}:r.getDropResult()),s}function cg(t){L(typeof t>"u"||yl(t),"Drop result must either be an object or undefined.")}function ug(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function dg(t){return function(){const n=t.getMonitor(),r=t.getRegistry();hg(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:Dn}}}function hg(t){L(t.isDragging(),"Cannot call endDrag while not dragging.")}function Sr(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function fg(t){return function(n,{clientOffset:r}={}){pg(n);const i=n.slice(0),s=t.getMonitor(),o=t.getRegistry(),a=s.getItemType();return mg(i,o,a),gg(i,s,o),vg(i,s,o),{type:Sn,payload:{targetIds:i,clientOffset:r||null}}}}function pg(t){L(Array.isArray(t),"Expected targetIds to be an array.")}function gg(t,e,n){L(e.isDragging(),"Cannot call hover while not dragging."),L(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];L(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const s=n.getTarget(i);L(s,"Expected targetIds to be registered.")}}function mg(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],s=e.getTargetType(i);Sr(s,n)||t.splice(r,1)}}function vg(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function yg(t){return function(){if(t.getMonitor().isDragging())return{type:vi}}}function bg(t){return{beginDrag:Qp(t),publishDragSource:yg(t),hover:fg(t),drop:og(t),endDrag:dg(t)}}class xg{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(s){return(...o)=>{const a=s.apply(e,o);typeof a<"u"&&n(a)}}const i=bg(this);return Object.keys(i).reduce((s,o)=>{const a=i[o];return s[o]=r(a),s},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function Tg(t,e){return{x:t.x+e.x,y:t.y+e.y}}function bl(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Sg(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:bl(Tg(e,r),n)}function wg(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:bl(e,n)}const St=[],yi=[];St.__IS_NONE__=!0;yi.__IS_ALL__=!0;function Dg(t,e){return t===St?!1:t===yi||typeof e>"u"?!0:Zp(e,t).length>0}class Cg{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;L(typeof e=="function","listener must be a function."),L(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const s=()=>{const o=this.store.getState(),a=o.stateId;try{a===i||a===i+1&&!Dg(o.dirtyHandlerIds,r)||e()}finally{i=a}};return this.store.subscribe(s)}subscribeToOffsetChange(e){L(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return L(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(L(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),i=this.getItemType();return Sr(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(L(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),i=this.getItemType();return r!==i?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(e),s=this.getItemType();if(s&&!Sr(i,s))return!1;const o=this.getTargetIds();if(!o.length)return!1;const a=o.indexOf(e);return r?a===o.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Sg(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return wg(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const go=typeof global<"u"?global:self,xl=go.MutationObserver||go.WebKitMutationObserver;function Tl(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function Eg(t){let e=1;const n=new xl(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const Pg=typeof xl=="function"?Eg:Tl;class Og{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,i=e.length-this.index;r<i;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Pg(this.flush),this.requestErrorThrow=Tl(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Ig{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class Ag{create(e){const n=this.freeTasks,r=n.length?n.pop():new Ig(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Sl=new Og,Mg=new Ag(Sl.registerPendingError);function Rg(t){Sl.enqueueTask(Mg.create(t))}const bi="dnd-core/ADD_SOURCE",xi="dnd-core/ADD_TARGET",Ti="dnd-core/REMOVE_SOURCE",Cn="dnd-core/REMOVE_TARGET";function Ng(t){return{type:bi,payload:{sourceId:t}}}function kg(t){return{type:xi,payload:{targetId:t}}}function Lg(t){return{type:Ti,payload:{sourceId:t}}}function Vg(t){return{type:Cn,payload:{targetId:t}}}function jg(t){L(typeof t.canDrag=="function","Expected canDrag to be a function."),L(typeof t.beginDrag=="function","Expected beginDrag to be a function."),L(typeof t.endDrag=="function","Expected endDrag to be a function.")}function _g(t){L(typeof t.canDrop=="function","Expected canDrop to be a function."),L(typeof t.hover=="function","Expected hover to be a function."),L(typeof t.drop=="function","Expected beginDrag to be a function.")}function wr(t,e){if(e&&Array.isArray(t)){t.forEach(n=>wr(n,!1));return}L(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var ae;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(ae||(ae={}));let Bg=0;function Fg(){return Bg++}function zg(t){const e=Fg().toString();switch(t){case ae.SOURCE:return`S${e}`;case ae.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function mo(t){switch(t[0]){case"S":return ae.SOURCE;case"T":return ae.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function vo(t,e){const n=t.entries();let r=!1;do{const{done:i,value:[,s]}=n.next();if(s===e)return!0;r=!!i}while(!r);return!1}class Ug{addSource(e,n){wr(e),jg(n);const r=this.addHandler(ae.SOURCE,e,n);return this.store.dispatch(Ng(r)),r}addTarget(e,n){wr(e,!0),_g(n);const r=this.addHandler(ae.TARGET,e,n);return this.store.dispatch(kg(r)),r}containsHandler(e){return vo(this.dragSources,e)||vo(this.dropTargets,e)}getSource(e,n=!1){return L(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return L(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return L(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return L(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return mo(e)===ae.SOURCE}isTargetId(e){return mo(e)===ae.TARGET}removeSource(e){L(this.getSource(e),"Expected an existing source."),this.store.dispatch(Lg(e)),Rg(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){L(this.getTarget(e),"Expected an existing target."),this.store.dispatch(Vg(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);L(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){L(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=zg(e);return this.types.set(i,n),e===ae.SOURCE?this.dragSources.set(i,r):e===ae.TARGET&&this.dropTargets.set(i,r),i}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const Hg=(t,e)=>t===e;function $g(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function Wg(t,e,n=Hg){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function Gg(t=St,e){switch(e.type){case Sn:break;case bi:case xi:case Cn:case Ti:return St;case Tn:case vi:case Dn:case wn:default:return yi}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=Yp(n,r);if(!(i.length>0||!Wg(n,r)))return St;const o=r[r.length-1],a=n[n.length-1];return o!==a&&(o&&i.push(o),a&&i.push(a)),i}function qg(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kg(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){qg(t,i,n[i])})}return t}const yo={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Xg(t=yo,e){const{payload:n}=e;switch(e.type){case mi:case Tn:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Sn:return $g(t.clientOffset,n.clientOffset)?t:Kg({},t,{clientOffset:n.clientOffset});case Dn:case wn:return yo;default:return t}}function Yg(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ge(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Yg(t,i,n[i])})}return t}const Zg={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Jg(t=Zg,e){const{payload:n}=e;switch(e.type){case Tn:return Ge({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case vi:return Ge({},t,{isSourcePublic:!0});case Sn:return Ge({},t,{targetIds:n.targetIds});case Cn:return t.targetIds.indexOf(n.targetId)===-1?t:Ge({},t,{targetIds:Xp(t.targetIds,n.targetId)});case wn:return Ge({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Dn:return Ge({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Qg(t=0,e){switch(e.type){case bi:case xi:return t+1;case Ti:case Cn:return t-1;default:return t}}function em(t=0){return t+1}function tm(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nm(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){tm(t,i,n[i])})}return t}function rm(t={},e){return{dirtyHandlerIds:Gg(t.dirtyHandlerIds,{type:e.type,payload:nm({},e.payload,{prevTargetIds:Kp(t,"dragOperation.targetIds",[])})}),dragOffset:Xg(t.dragOffset,e),refCount:Qg(t.refCount,e),dragOperation:Jg(t.dragOperation,e),stateId:em(t.stateId)}}function im(t,e=void 0,n={},r=!1){const i=sm(r),s=new Cg(i,new Ug(i)),o=new xg(i,s),a=t(o,e,n);return o.receiveBackend(a),o}function sm(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return vl(rm,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function om(t,e){if(t==null)return{};var n=am(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function am(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}let bo=0;const en=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var lm=v.memo(function(e){var{children:n}=e,r=om(e,["children"]);const[i,s]=cm(r);return v.useEffect(()=>{if(s){const o=wl();return++bo,()=>{--bo===0&&(o[en]=null)}}},[]),m.jsx(ml.Provider,{value:i,children:n})});function cm(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=um(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function um(t,e=wl(),n,r){const i=e;return i[en]||(i[en]={dragDropManager:im(t,e,n,r)}),i[en]}function wl(){return typeof global<"u"?global:window}var dm=Ic();const hm=Oc(dm),He=typeof window<"u"?v.useLayoutEffect:v.useEffect;function Dl(t,e,n){const[r,i]=v.useState(()=>e(t)),s=v.useCallback(()=>{const o=e(t);hm(r,o)||(i(o),n&&n())},[r,t,n]);return He(s),[r,s]}function fm(t,e,n){const[r,i]=Dl(t,e,n);return He(function(){const o=t.getHandlerId();if(o!=null)return t.subscribeToStateChange(i,{handlerIds:[o]})},[t,i]),r}function Cl(t,e,n){return fm(e,t||(()=>({})),()=>n.reconnect())}function El(t,e){const n=[];return typeof t!="function"&&n.push(t),v.useMemo(()=>typeof t=="function"?t():t,n)}function pm(t){return v.useMemo(()=>t.hooks.dragSource(),[t])}function gm(t){return v.useMemo(()=>t.hooks.dragPreview(),[t])}let Zn=!1,Jn=!1;class mm{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){L(!Zn,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Zn=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Zn=!1}}isDragging(){if(!this.sourceId)return!1;L(!Jn,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Jn=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Jn=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let Qn=!1;class vm{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;L(!Qn,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Qn=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Qn=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function ym(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function bm(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function Dr(t,e,n,r){let i;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const s=Object.keys(t),o=Object.keys(e);if(s.length!==o.length)return!1;const a=Object.prototype.hasOwnProperty.bind(e);for(let l=0;l<s.length;l++){const c=s[l];if(!a(c))return!1;const u=t[c],d=e[c];if(i=void 0,i===!1||i===void 0&&u!==d)return!1}return!0}function Cr(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function xm(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function Tm(t){return(e=null,n=null)=>{if(!v.isValidElement(e)){const s=e;return t(s,n),s}const r=e;return xm(r),Sm(r,n?s=>t(s,n):t)}}function Pl(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=Tm(r);e[n]=()=>i}}),e}function xo(t,e){typeof t=="function"?t(e):t.current=e}function Sm(t,e){const n=t.ref;return L(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?v.cloneElement(t,{ref:r=>{xo(n,r),xo(e,r)}}):v.cloneElement(t,{ref:e})}class wm{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Dr(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Dr(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Pl({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,Cr(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,Cr(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class Dm{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Dr(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Pl({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,Cr(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function xe(){const{dragDropManager:t}=v.useContext(ml);return L(t!=null,"Expected drag drop context"),t}function Cm(t,e){const n=xe(),r=v.useMemo(()=>new wm(n.getBackend()),[n]);return He(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),He(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function Em(){const t=xe();return v.useMemo(()=>new mm(t),[t])}class Pm{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,i=this.monitor,{isDragging:s}=r;return s?s(i):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:i}=e;i&&i(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function Om(t,e,n){const r=v.useMemo(()=>new Pm(t,e,n),[e,n]);return v.useEffect(()=>{r.spec=t},[t]),r}function Im(t){return v.useMemo(()=>{const e=t.type;return L(e!=null,"spec.type must be defined"),e},[t])}function Am(t,e,n){const r=xe(),i=Om(t,e,n),s=Im(t);He(function(){if(s!=null){const[a,l]=bm(s,i,r);return e.receiveHandlerId(a),n.receiveHandlerId(a),l}},[r,e,n,i,s])}function Mm(t,e){const n=El(t);L(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=Em(),i=Cm(n.options,n.previewOptions);return Am(n,r,i),[Cl(n.collect,r,i),pm(i),gm(i)]}function Rm(t){const n=xe().getMonitor(),[r,i]=Dl(n,t);return v.useEffect(()=>n.subscribeToOffsetChange(i)),v.useEffect(()=>n.subscribeToStateChange(i)),r}function Nm(t){return v.useMemo(()=>t.hooks.dropTarget(),[t])}function km(t){const e=xe(),n=v.useMemo(()=>new Dm(e.getBackend()),[e]);return He(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function Lm(){const t=xe();return v.useMemo(()=>new vm(t),[t])}function Vm(t){const{accept:e}=t;return v.useMemo(()=>(L(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class jm{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function _m(t,e){const n=v.useMemo(()=>new jm(t,e),[e]);return v.useEffect(()=>{n.spec=t},[t]),n}function Bm(t,e,n){const r=xe(),i=_m(t,e),s=Vm(t);He(function(){const[a,l]=ym(s,i,r);return e.receiveHandlerId(a),n.receiveHandlerId(a),l},[r,e,i,n,s.map(o=>o.toString()).join("|")])}function Ol(t,e){const n=El(t),r=Lm(),i=km(n.options);return Bm(n,r,i),[Cl(n.collect,r,i),Nm(i)]}var Il=t=>{throw TypeError(t)},Al=(t,e,n)=>e.has(t)||Il("Cannot "+n),N=(t,e,n)=>(Al(t,e,"read from private field"),n?n.call(t):e.get(t)),se=(t,e,n)=>e.has(t)?Il("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ve=(t,e,n,r)=>(Al(t,e,"write to private field"),e.set(t,n),n),Se,Fm=class{constructor(){se(this,Se),this.register=t=>{N(this,Se).push(t)},this.unregister=t=>{for(;N(this,Se).indexOf(t)!==-1;)N(this,Se).splice(N(this,Se).indexOf(t),1)},this.backendChanged=t=>{for(let e of N(this,Se))e.backendChanged(t)},Ve(this,Se,[])}};Se=new WeakMap;var Q,gt,ee,me,je,Er,Pr,Or,tn,nn,mt,Ml=class rn{constructor(e,n,r){if(se(this,Q),se(this,gt),se(this,ee),se(this,me),se(this,je),se(this,Er,(i,s,o)=>{if(!o.backend)throw new Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(o)}`);let a=o.backend(i,s,o.options),l=o.id,c=!o.id&&a&&a.constructor;if(c&&(l=a.constructor.name),!l)throw new Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(o)}
3
3
  see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(c&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.
4
4
  This might be unsupported in the future, please specify 'id' explicitely for every backend.`),N(this,ee)[l])throw new Error(`You must specify a unique 'id' property in your Backend entry:
5
- ${JSON.stringify(o)} (conflicts with: ${JSON.stringify(N(this,ee)[l])})`);return{id:l,instance:a,preview:o.preview??!1,transition:o.transition,skipDispatchOnTransition:o.skipDispatchOnTransition??!1}}),this.setup=()=>{if(!(typeof window>"u")){if(rn.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");rn.isSetUp=!0,N(this,Or).call(this,window),N(this,ee)[N(this,Q)].instance.setup()}},this.teardown=()=>{typeof window>"u"||(rn.isSetUp=!1,N(this,Ir).call(this,window),N(this,ee)[N(this,Q)].instance.teardown())},this.connectDragSource=(i,s,o)=>N(this,gt).call(this,"connectDragSource",i,s,o),this.connectDragPreview=(i,s,o)=>N(this,gt).call(this,"connectDragPreview",i,s,o),this.connectDropTarget=(i,s,o)=>N(this,gt).call(this,"connectDropTarget",i,s,o),this.profile=()=>N(this,ee)[N(this,Q)].instance.profile(),this.previewEnabled=()=>N(this,ee)[N(this,Q)].preview,this.previewsList=()=>N(this,pt),this.backendsList=()=>N(this,me),oe(this,Or,i=>{for(let s of N(this,me))s.transition&&i.addEventListener(s.transition.event,N(this,tn))}),oe(this,Ir,i=>{for(let s of N(this,me))s.transition&&i.removeEventListener(s.transition.event,N(this,tn))}),oe(this,tn,i=>{var o;let s=N(this,Q);if(N(this,me).some(a=>a.id!==N(this,Q)&&a.transition&&a.transition.check(i)?(ke(this,Q,a.id),!0):!1),N(this,Q)!==s){N(this,ee)[s].instance.teardown();for(let[u,d]of Object.entries(N(this,Le)))d.unsubscribe(),d.unsubscribe=N(this,nn).call(this,d.func,...d.args);N(this,pt).backendChanged(this);let a=N(this,ee)[N(this,Q)];if(a.instance.setup(),a.skipDispatchOnTransition)return;let l=i.constructor,c=new l(i.type,i);(o=i.target)==null||o.dispatchEvent(c)}}),oe(this,nn,(i,s,o,a)=>N(this,ee)[N(this,Q)].instance[i](s,o,a)),oe(this,gt,(i,s,o,a)=>{let l=`${i}_${s}`,c=N(this,nn).call(this,i,s,o,a);return N(this,Le)[l]={func:i,args:[s,o,a],unsubscribe:c},()=>{N(this,Le)[l].unsubscribe(),delete N(this,Le)[l]}}),!r||!r.backends||r.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
6
- see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);ke(this,pt,new jm),ke(this,ee,{}),ke(this,me,[]);for(let i of r.backends){let s=N(this,Pr).call(this,e,n,i);N(this,ee)[s.id]=s,N(this,me).push(s)}ke(this,Q,N(this,me)[0].id),ke(this,Le,{})}};Q=new WeakMap,pt=new WeakMap,ee=new WeakMap,me=new WeakMap,Le=new WeakMap,Pr=new WeakMap,Or=new WeakMap,Ir=new WeakMap,tn=new WeakMap,nn=new WeakMap,gt=new WeakMap,Ml.isSetUp=!1;var _m=Ml,Bm=(t,e,n)=>new _m(t,e,n),Rl=(t,e)=>({event:t,check:e}),Fm=Rl("touchstart",t=>{let e=t;return e.touches!==null&&e.touches!==void 0}),zm=Rl("pointerdown",t=>t.pointerType==="mouse"),De;(function(t){t.mouse="mouse",t.touch="touch",t.keyboard="keyboard"})(De||(De={}));class Um{get delay(){var e;return(e=this.args.delay)!==null&&e!==void 0?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return(e=this.args.ignoreContextMenu)!==null&&e!==void 0?e:!1}get enableHoverOutsideTarget(){var e;return(e=this.args.enableHoverOutsideTarget)!==null&&e!==void 0?e:!1}get enableKeyboardEvents(){var e;return(e=this.args.enableKeyboardEvents)!==null&&e!==void 0?e:!1}get enableMouseEvents(){var e;return(e=this.args.enableMouseEvents)!==null&&e!==void 0?e:!1}get enableTouchEvents(){var e;return(e=this.args.enableTouchEvents)!==null&&e!==void 0?e:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get delayMouseStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var e;if(!((e=this.context)===null||e===void 0)&&e.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.args)===null||e===void 0?void 0:e.rootElement)||this.document}constructor(e,n){this.args=e,this.context=n}}function Hm(t,e,n,r){return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function $m(t,e,n,r,i){if(!i)return!1;const s=Math.atan2(r-e,n-t)*180/Math.PI+180;for(let o=0;o<i.length;++o){const a=i[o];if(a&&(a.start==null||s>=a.start)&&(a.end==null||s<=a.end))return!0}return!1}const Wm={Left:1},Gm={Left:0};function er(t){return t.button===void 0||t.button===Gm.Left}function qm(t){return t.buttons===void 0||(t.buttons&Wm.Left)===0}function Nl(t){return!!t.targetTouches}const Km=1;function Xm(t){const e=t.nodeType===Km?t:t.parentElement;if(!e)return;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Ym(t,e){if(t.targetTouches.length===1)return pn(t.targetTouches[0]);if(e&&t.touches.length===1&&t.touches[0].target===e.target)return pn(t.touches[0])}function pn(t,e){return Nl(t)?Ym(t,e):{x:t.clientX,y:t.clientY}}const To=(()=>{let t=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return t=!0,!0}}))}catch{}return t})(),lt={[De.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[De.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[De.keyboard]:{keydown:"keydown"}};class St{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((e=this.dragOverTargetIds)===null||e===void 0?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&(k(!St.isSetUp,"Cannot have two Touch backends at the same time."),St.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(St.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,n,r,i=!1){const s=To?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=lt[o][n];a&&e.addEventListener(a,r,s)})}removeEventListener(e,n,r,i=!1){const s=To?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=lt[o][n];a&&e.removeEventListener(a,r,s)})}connectDragSource(e,n){const r=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(e),this.removeEventListener(n,"start",r)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const i=s=>{if(!this.document||!r||!this.monitor.isDragging())return;let o;switch(s.type){case lt.mouse.move:o={x:s.clientX,y:s.clientY};break;case lt.touch.move:var a,l;o={x:((a=s.touches[0])===null||a===void 0?void 0:a.clientX)||0,y:((l=s.touches[0])===null||l===void 0?void 0:l.clientY)||0};break}const c=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,u=c&&n.contains(c);if(c===n||u)return this.handleMove(s,e)};return this.addEventListener(this.document.body,"move",i),this.targetNodes.set(e,n),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",i))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,n,r){this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&Xm(s)},this.handleTopMoveStartCapture=i=>{er(i)&&(this.moveStartSourceIds=[])},this.handleMoveStart=i=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(i)},this.handleTopMoveStart=i=>{if(!er(i))return;const s=pn(i);s&&(Nl(i)&&(this.lastTargetTouchFallback=i.targetTouches[0]),this._mouseClientOffset=s),this.waitingForDelay=!1},this.handleTopMoveStartDelay=i=>{if(!er(i))return;const s=i.type===lt.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,i),s),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(i,s)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(s)},this.handleTopMove=i=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:s,dragOverTargetIds:o}=this,a=this.options.enableHoverOutsideTarget,l=pn(i,this.lastTargetTouchFallback);if(!l)return;if(this._isScrolling||!this.monitor.isDragging()&&$m(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&s&&Hm(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(s,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const c=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(c),this.actions.publishDragSource(),i.cancelable&&i.preventDefault();const u=(o||[]).map(p=>this.targetNodes.get(p)).filter(p=>!!p),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(l.x,l.y,u):this.document.elementsFromPoint(l.x,l.y),h=[];for(const p in d){if(!d.hasOwnProperty(p))continue;let g=d[p];for(g!=null&&h.push(g);g;)g=g.parentElement,g&&h.indexOf(g)===-1&&h.push(g)}const f=h.filter(p=>u.indexOf(p)>-1).map(p=>this._getDropTargetId(p)).filter(p=>!!p).filter((p,g,b)=>b.indexOf(p)===g);if(a)for(const p in this.targetNodes){const g=this.targetNodes.get(p);if(c&&g&&g.contains(c)&&f.indexOf(p)===-1){f.unshift(p);break}}f.reverse(),this.actions.hover(f,{clientOffset:l})},this._getDropTargetId=i=>{const s=this.targetNodes.keys();let o=s.next();for(;o.done===!1;){const a=o.value;if(i===this.targetNodes.get(a))return a;o=s.next()}},this.handleTopMoveEndCapture=i=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!qm(i)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}i.cancelable&&i.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=i=>{i.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new Um(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(De.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(De.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(De.keyboard)}}const Zm=function(e,n={},r={}){return new St(e,n,r)};var ce=function(){return ce=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},ce.apply(this,arguments)};function Z(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function Jm(t){var e=t.isVisible,n=t.ease,r=n===void 0?"easeIn":n,i=t.duration,s=t.variants,o=s===void 0?{open:{opacity:1,height:"auto"},close:{opacity:0,height:0}}:s,a=t.children,l=_p({polyfill:uu}),c=l[0],u=l[1].height,d=m.useState(e),h=d[0],f=d[1],p=m.useState(e),g=p[0],b=p[1],y=m.useState(!1),T=y[0],S=y[1],E=function(){S(!1),e||f(!1)};m.useEffect(function(){S(!0),e?f(!0):b(!1)},[e]);var w=u===0;return m.useEffect(function(){h&&b(!0)},[w]),z.createElement(jp.div,{style:T?{overflow:"hidden"}:void 0,onAnimationComplete:E,initial:g?"open":"close",animate:g?"open":"close",inherit:!1,variants:o,transition:{ease:r,duration:Qm(u,i)}},z.createElement("div",{ref:c},h&&a))}function Qm(t,e){if(e)return e;if(!t)return 0;var n=t/36;return Math.round((4+10*Math.pow(n,.25)+n/5)*10)/1500}var kl=m.createContext({}),ev={isLock:!1},tv=function(t){var e=m.useState(ev.isLock),n=e[0],r=e[1];return z.createElement(kl.Provider,{value:{isLock:n,lock:function(){return r(!0)},unlock:function(){return r(!1)}}},t.children)},Nt=m.createContext({}),Kt={dropTargetId:void 0,index:void 0},nv=function(t){var e=m.useState(Kt.dropTargetId),n=e[0],r=e[1],i=m.useState(Kt.index),s=i[0],o=i[1],a=function(c,u){r(c),o(u)},l=function(){r(Kt.dropTargetId),o(Kt.index)};return z.createElement(Nt.Provider,{value:{dropTargetId:n,index:s,showPlaceholder:a,hidePlaceholder:l}},t.children)},rv=function(t,e){return t.text>e.text?1:t.text<e.text?-1:0},ct=function(t,e){return t.find(function(n){return n.id===e})},Ll=function(t,e,n){if(n===0)return!1;var r=t.find(function(i){return i.id===n});return r===void 0?!1:r.parent===e?!0:Ll(t,e,r.parent)},wi=function(t){return typeof t=="object"&&t!==null&&"id"in t&&"parent"in t&&"text"in t},Pe=function(t,e,n){var r=n.tree,i=n.rootId,s=n.canDrop;if(t===null){if(e===i)return!0;var o=r.find(function(u){return u.id===e});return!!(o&&o.droppable)}else{var a=wi(t)?t.id:null;if(s){var l=s(a,e);if(l!==void 0)return l}if(a===e)return!1;var c=r.find(function(d){return d.id===a}),o=r.find(function(d){return d.id===e});return c===void 0||a===null?e===i||!!(o!=null&&o.droppable):o===void 0?c.parent!==0:c.parent===e||!o.droppable?!1:!Ll(r,a,e)}},iv=function(t,e,n){return t.map(function(r){return r.id===e?ce(ce({},r),{parent:n}):r})},Vl=function(t,e,n){if(n===0)return 0;var r=t.filter(function(i){return i.parent===e});return r[n]?t.findIndex(function(i){return i.id===r[n].id}):t.findIndex(function(i){return i.id===r[n-1].id})+1},sv=function(t,e){return t.findIndex(function(n){return n.id===e})},jl=function(t,e,n,r){var i=sv(t,e),s=Vl(t,n,r);return s=s>i?s-1:s,[i,s]},ov=function(t,e,n){var r=e<0?t.length+e:e;if(r>=0&&r<t.length){var i=n<0?t.length+n:n,s=t.splice(e,1)[0];t.splice(i,0,s)}},av=function(t,e,n,r){var i=jl(t,e,n,r),s=i[0],o=i[1],a=Z([],t,!0);return ov(a,s,o),a.map(function(l){return l.id===e?ce(ce({},l),{parent:n}):l})},lv=function(t,e){var n=t.getBoundingClientRect(),r=n.top+n.height/2;return e>r?"down":"up"},Ar=function(t,e){var n="",r=0;return t.forEach(function(i,s){var o,a=lv(i,((o=e.getClientOffset())===null||o===void 0?void 0:o.y)||0);n===""?n=a:n!==a&&(n=a,r=s),s===t.length-1&&a==="down"&&(r=s+1)}),r},So=function(t,e,n){var r=e.closest('[role="list"]'),i=r==null?void 0:r.querySelectorAll(':scope > [role="listitem"]');return i?Ar(i,n):null},cv=function(t,e,n){var r=t.getBoundingClientRect(),i=n.dropTargetOffset;if(i===0)return"middle";var s=r.top+i,o=r.bottom-i;return e>o?"lower":e<s?"upper":"middle"},Mr=function(t,e,n,r){var i;if(!e)return null;if(t===null){var s=e.querySelectorAll(':scope > [role="listitem"]');return{id:r.rootId,index:Ar(s,n)}}var o=n.getItem(),a=e.querySelector('[role="list"]'),l=cv(e,((i=n.getClientOffset())===null||i===void 0?void 0:i.y)||0,r);if(a){if(l==="upper")if(Pe(o,t.parent,r)){var c=So(t,e,n);return c===null?null:{id:t.parent,index:c}}else return{id:t.id,index:0};var s=a.querySelectorAll(':scope > [role="listitem"]');return{id:t.id,index:Ar(s,n)}}else{if(l==="middle")return{id:t.id,index:0};if(Pe(o,t.parent,r)){var c=So(t,e,n);return c===null?null:{id:t.parent,index:c}}return null}},uv=function(t){return t===void 0&&(t={}),{backends:[{id:"html5",backend:Hc,options:t.html5,transition:zm},{id:"touch",backend:Zm,options:t.touch||{enableMouseEvents:!0},preview:!0,transition:Fm}]}},sn=function(t,e){return t.some(function(n){return n.parent===e})},_l=m.createContext({}),dv=function(t){var e=vv(t.tree,t.initialOpen),n=e[0],r=e[1],i=r.handleToggle,s=r.handleCloseAll,o=r.handleOpenAll,a=r.handleOpen,l=r.handleClose;m.useImperativeHandle(t.treeRef,function(){return{open:function(f){return a(f,t.onChangeOpen)},close:function(f){return l(f,t.onChangeOpen)},openAll:function(){return o(t.onChangeOpen)},closeAll:function(){return s(t.onChangeOpen)}}});var c=xe().getMonitor(),u=t.canDrop,d=t.canDrag,h=ce(ce({extraAcceptTypes:[],listComponent:"ul",listItemComponent:"li",placeholderComponent:"li",sort:!0,insertDroppableFirst:!0,enableAnimateExpand:!1,dropTargetOffset:0,initialOpen:!1},t),{openIds:n,onDrop:function(f,p,g){if(f){var b={dragSourceId:f.id,dropTargetId:p,dragSource:f,dropTarget:ct(t.tree,p),monitor:c},y=t.tree;if(ct(y,f.id)||(y=Z(Z([],y,!0),[f],!1)),t.sort===!1){var T=jl(y,f.id,p,g),S=T[1];b.destinationIndex=S,b.relativeIndex=g,t.onDrop(av(y,f.id,p,g),b);return}t.onDrop(iv(y,f.id,p),b)}else{var b={dropTargetId:p,dropTarget:ct(t.tree,p),monitor:c};t.sort===!1&&(b.destinationIndex=Vl(t.tree,p,g),b.relativeIndex=g),t.onDrop(t.tree,b)}},canDrop:u?function(f,p){return u(t.tree,{dragSourceId:f??void 0,dropTargetId:p,dragSource:c.getItem(),dropTarget:ct(t.tree,p),monitor:c})}:void 0,canDrag:d?function(f){return d(ct(t.tree,f))}:void 0,onToggle:function(f){return i(f,t.onChangeOpen)}});return z.createElement(_l.Provider,{value:h},t.children)},hv=function(t){return z.createElement(dv,ce({},t),z.createElement(tv,null,z.createElement(nv,null,t.children)))},fv=function(t){var e=m.useContext(kl);m.useEffect(function(){if(t.current){var n=t.current,r=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.lock()},i=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.unlock()},s=function(u){return r(u)},o=function(u){return i(u)},a=function(u){return r(u)},l=function(u){return i(u)},c=new MutationObserver(function(){document.activeElement===document.body&&e.unlock()});return c.observe(n,{subtree:!0,childList:!0}),n.addEventListener("mouseover",s),n.addEventListener("mouseout",o),n.addEventListener("focusin",a),n.addEventListener("focusout",l),function(){c.disconnect(),n.removeEventListener("mouseover",s),n.removeEventListener("mouseout",o),n.removeEventListener("focusin",a),n.removeEventListener("focusout",l)}}},[t,e]),m.useEffect(function(){var n;(n=t.current)===null||n===void 0||n.setAttribute("draggable",e.isLock?"false":"true")},[t,e.isLock])},Cn={TREE_ITEM:Symbol()},Bl=null,Fl=function(t){var e=t.target;if(e instanceof HTMLElement){var n=e.closest('[role="listitem"]');t.currentTarget===n&&(Bl=n)}},wo=function(t){return Fl(t)},Do=function(t){return Fl(t)},pv=function(t,e){var n=Ie();m.useEffect(function(){var a=e.current;return a==null||a.addEventListener("dragstart",wo),a==null||a.addEventListener("touchstart",Do,{passive:!0}),function(){a==null||a.removeEventListener("dragstart",wo),a==null||a.removeEventListener("touchstart",Do)}},[e]);var r=Om({type:Cn.TREE_ITEM,item:function(a){var l=ce({ref:e},t);return n.onDragStart&&n.onDragStart(l,a),l},end:function(a,l){var c=a;n.onDragEnd&&n.onDragEnd(c,l)},canDrag:function(){var a=n.canDrag;return Bl!==e.current?!1:a?a(t.id):!0},collect:function(a){return{isDragging:a.isDragging()}}}),i=r[0].isDragging,s=r[1],o=r[2];return[i,s,o]},gv=function(t){var e=Ie(),n=m.useContext(Nt),r=Ol({accept:Z([Cn.TREE_ITEM],e.extraAcceptTypes,!0),drop:function(l,c){var u=e.rootId,d=e.onDrop,h=n.dropTargetId,f=n.index;c.isOver({shallow:!0})&&h!==void 0&&f!==void 0&&d(wi(l)?l:null,u,f),n.hidePlaceholder()},canDrop:function(l,c){var u=e.rootId;return c.isOver({shallow:!0})?l===void 0?!1:Pe(l,u,e):!1},hover:function(l,c){if(c.isOver({shallow:!0})){var u=e.rootId,d=n.dropTargetId,h=n.index,f=n.showPlaceholder,p=n.hidePlaceholder,g=Mr(null,t.current,c,e);if(g===null||!Pe(l,u,e)){p();return}(g.id!==d||g.index!==h)&&f(g.id,g.index)}},collect:function(l){var c=l.getItem();return{isOver:l.isOver({shallow:!0})&&l.canDrop(),dragSource:c}}}),i=r[0],s=i.isOver,o=i.dragSource,a=r[1];return[s,o,a]},mv=function(t,e){var n=Ie(),r=m.useContext(Nt),i=Ol({accept:Z([Cn.TREE_ITEM],n.extraAcceptTypes,!0),drop:function(c,u){var d=r.dropTargetId,h=r.index;u.isOver({shallow:!0})&&d!==void 0&&h!==void 0&&n.onDrop(wi(c)?c:null,d,h),r.hidePlaceholder()},canDrop:function(c,u){if(u.isOver({shallow:!0})){var d=Mr(t,e.current,u,n);return d===null?!1:Pe(c,d.id,n)}return!1},hover:function(c,u){if(u.isOver({shallow:!0})){var d=r.dropTargetId,h=r.index,f=r.showPlaceholder,p=r.hidePlaceholder,g=Mr(t,e.current,u,n);if(g===null||!Pe(c,g.id,n)){p();return}(g.id!==d||g.index!==h)&&f(g.id,g.index)}},collect:function(c){var u=c.getItem();return{isOver:c.isOver({shallow:!0})&&c.canDrop(),dragSource:u}}}),s=i[0],o=s.isOver,a=s.dragSource,l=i[1];return[o,a,l]},vv=function(t,e){var n=m.useMemo(function(){return e===!0?t.filter(function(d){return sn(t,d.id)}).map(function(d){return d.id}):Array.isArray(e)?e:[]},[e]),r=m.useState(n),i=r[0],s=r[1];m.useEffect(function(){return s(n)},[n]);var o=function(d,h){var f=i.includes(d)?i.filter(function(p){return p!==d}):Z(Z([],i,!0),[d],!1);s(f),h&&h(f)},a=function(d){s([]),d&&d([])},l=function(d){var h=t.filter(function(f){return sn(t,f.id)}).map(function(f){return f.id});s(h),d&&d(h)},c=function(d,h){var f=[];if(Array.isArray(d)){var p=t.filter(function(g){return d.includes(g.id)&&sn(t,g.id)});f=Z(Z([],i,!0),p.map(function(g){return g.id}),!0).filter(function(g,b,y){return y.indexOf(g)===b})}else f=i.includes(d)?i:Z(Z([],i,!0),[d],!1);s(f),h&&h(f)},u=function(d,h){var f=i.filter(function(p){return Array.isArray(d)?!d.includes(p):p!==d});s(f),h&&h(f)};return[i,{handleToggle:o,handleCloseAll:a,handleOpenAll:l,handleOpen:c,handleClose:u}]},yv=function(){return Im(function(t){var e=t.getItemType();return{item:t.getItem(),clientOffset:t.getClientOffset(),isDragging:t.isDragging()&&e===Cn.TREE_ITEM}})},Ie=function(){var t=m.useContext(_l);if(!t)throw new Error("useTreeContext must be used under TreeProvider");return t},bv=function(t,e){var n=Ie(),r=n.rootId,i=n.rootProps,s=n.classes,o=(s==null?void 0:s.container)||"";return e&&(s!=null&&s.dropTarget)&&(o="".concat(o," ").concat(s.dropTarget)),t===r&&(s!=null&&s.root)&&(o="".concat(o," ").concat(s.root)),t===r&&(i!=null&&i.className)&&(o="".concat(o," ").concat(i.className)),o=o.trim(),o},xv=function(t,e,n){e.current?n(e):n(t),m.useEffect(function(){e.current?n(e):n(t)},[e.current])},Tv=function(t){var e=Ie(),n=m.useContext(Nt),r=m.useRef(null),i=m.useRef(null),s=e.tree.find(function(A){return A.id===t.id}),o=e.openIds,a=e.classes,l=e.enableAnimateExpand,c=o.includes(t.id),u=pv(s,r),d=u[0],h=u[1],f=u[2],p=mv(s,r),g=p[0],b=p[1],y=p[2];xv(r,i,h),Pe(b,t.id,e)&&y(r),m.useEffect(function(){e.dragPreviewRender?f(Uc(),{captureDraggingState:!0}):i.current&&f(r)},[f,e.dragPreviewRender]),fv(r);var T=m.useCallback(function(){e.onToggle(s.id)},[s.id,e]),S=e.listItemComponent,E=e.canDrag?e.canDrag(t.id):!0,w=n.dropTargetId===t.id,P={depth:t.depth,isOpen:c,isDragging:d,isDropTarget:w,draggable:E,hasChild:sn(e.tree,t.id),containerRef:r,handleRef:i,onToggle:T},j="";return a!=null&&a.listItem&&(j=typeof a.listItem=="string"?a.listItem:a.listItem(s,P)),g&&(a!=null&&a.dropTarget)&&(j="".concat(j," ").concat(a.dropTarget)),d&&(a!=null&&a.draggingSource)&&(j="".concat(j," ").concat(a.draggingSource)),z.createElement(S,{ref:r,className:j,role:"listitem"},e.render(s,P),l&&P.hasChild&&z.createElement(Jm,{isVisible:c},z.createElement(Rr,{parentId:t.id,depth:t.depth+1})),!l&&P.hasChild&&c&&z.createElement(Rr,{parentId:t.id,depth:t.depth+1}))},Co=function(t){var e=Ie(),n=e.placeholderRender,r=e.placeholderComponent,i=e.classes,s=m.useContext(Nt),o=xe(),a=o.getMonitor(),l=a.getItem();if(!n||!l)return null;var c=t.dropTargetId===s.dropTargetId&&(t.index===s.index||t.index===void 0&&t.listCount===s.index),u=a.getTargetIds();return!c||!u.length?null:z.createElement(r,{className:(i==null?void 0:i.placeholder)||""},n(l,{depth:t.depth}))},Rr=function(t){var e=Ie(),n=m.useRef(null),r=e.tree.filter(function(g){return g.parent===t.parentId}),i=r,s=typeof e.sort=="function"?e.sort:rv;if(e.insertDroppableFirst){var o=r.filter(function(g){return g.droppable}),a=r.filter(function(g){return!g.droppable});e.sort===!1?i=Z(Z([],o,!0),a,!0):(o=o.sort(s),a=a.sort(s),i=Z(Z([],o,!0),a,!0))}else e.sort!==!1&&(i=r.sort(s));var l=gv(n),c=l[0],u=l[1],d=l[2];t.parentId===e.rootId&&Pe(u,e.rootId,e)&&d(n);var h=bv(t.parentId,c),f=e.rootProps||{},p=e.listComponent;return z.createElement(p,ce({ref:n,role:"list"},f,{className:h}),i.map(function(g,b){return z.createElement(z.Fragment,{key:g.id},z.createElement(Co,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId,index:b}),z.createElement(Tv,{id:g.id,depth:t.depth}))}),z.createElement(Co,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId}))},Sv={height:"100%",left:0,pointerEvents:"none",position:"fixed",top:0,width:"100%",zIndex:100},wv=function(t){var e=t.clientOffset;if(!e)return{};var n=e.x,r=e.y,i="translate(".concat(n,"px, ").concat(r,"px)");return{pointerEvents:"none",transform:i}},Dv=function(){var t=Ie(),e=yv(),n=e.isDragging,r=e.clientOffset;return!n||!r?null:z.createElement("div",{style:Sv},z.createElement("div",{style:wv(e)},t.dragPreviewRender&&t.dragPreviewRender(e)))};function Cv(t,e){return z.createElement(hv,ce({},t,{treeRef:e}),t.dragPreviewRender&&z.createElement(Dv,null),z.createElement(Rr,{parentId:t.rootId,depth:0}))}var Ev=m.forwardRef(Cv);const Pv="_root_71whx_1",Ov="_isSelected_71whx_10",Iv="_expandIconWrapper_71whx_13",Av="_isOpen_71whx_25",Mv="_labelGridItem_71whx_29",ut={root:Pv,isSelected:Ov,expandIconWrapper:Iv,isOpen:Av,labelGridItem:Mv},Rv=t=>{var i,s,o,a;const e=t.depth*24,n=l=>{l.stopPropagation(),t.onToggle(t.node.id)};m.useEffect(()=>{console.log(t.node)},[]);const r=()=>t.onSelect(t.node);return v.jsxs("div",{className:`tree-node ${ut.root} ${t.isSelected?ut.isSelected:""} ${(i=t.node.data)!=null&&i.marked?"bg-gray-200":""}`,style:{paddingInlineStart:e},onClick:r,children:[v.jsx("div",{className:`${ut.expandIconWrapper} ${t.isOpen?ut.isOpen:""}`,children:t.node.droppable&&v.jsx("div",{onClick:n,children:v.jsx(oc,{size:18})})}),v.jsxs("div",{className:"flex items-center gap-2",children:[((s=t.node.data)==null?void 0:s.isNavigation)&&((o=t.node.data)!=null&&o.visible?v.jsx(ac,{className:"size-5"}):v.jsx(lc,{className:"size-5"})),v.jsx(on,{name:((a=t.node.data)==null?void 0:a.icon)??"folder"})]}),v.jsx("div",{className:ut.labelGridItem,children:v.jsx("span",{children:t.node.text})}),t.loading&&v.jsx(_e,{className:"size-4 animate-spin"})]})},Nv="_root_ahb0f_1",kv="_icon_ahb0f_15",Lv="_label_ahb0f_16",tr={root:Nv,icon:kv,label:Lv},Vv=t=>{var n;const e=t.monitorProps.item;return v.jsxs("div",{className:`${tr.root} bg-chart-1/60`,children:[v.jsx("div",{className:tr.icon,children:v.jsx(on,{name:((n=e.data)==null?void 0:n.icon)??"folder"})}),v.jsx("div",{className:tr.label,children:e.text})]})},jv="_app_gsniw_1",_v="_draggingSource_gsniw_9",Bv="_placeholderContainer_gsniw_13",nr={app:jv,draggingSource:_v,placeholderContainer:Bv},Fv="_root_1hoix_1",zv={root:Fv},Uv=t=>{const e=t.depth*24;return v.jsx("div",{className:`${zv.root} bg-chart-3`,style:{left:e}})},zl=m.createContext({messages:{},setMessages:()=>{}}),Hv=({type:t,callback:e,parentId:n,isNavigation:r,...i})=>{const[s,o]=m.useState(!1),a=async l=>{try{(await W.post("",{data:{record:l,parentId:n,targetBlank:s,_method:"select",type:t},_method:"createItem"})).data&&e()}catch(c){console.log(c)}};return v.jsxs("div",{className:"p-8",children:[v.jsxs("div",{className:"flex gap-4 flex-col",children:[v.jsxs("div",{className:`grid gap-4 ${i.items.length?"":"opacity-50 pointer-events-none"}`,children:[v.jsx(Ve,{children:i.labels.selectTitle}),v.jsxs(Nr,{onValueChange:a,children:[v.jsx(kr,{className:"w-full max-w-[170px] cursor-pointer",children:v.jsx(Lr,{placeholder:i.labels.selectTitle})}),v.jsx(Vr,{children:i.items.map(l=>v.jsx(jr,{value:l.id.toString(),children:l.name},`${l.id}-${l.name}`))})]})]}),r&&v.jsxs("div",{className:"flex gap-4 items-center",children:[v.jsx(rr,{id:"targetBlank",checked:s,onCheckedChange:l=>o(!!l),className:"cursor-pointer size-5"}),v.jsx(Ve,{htmlFor:"targetBlank",children:i.labels.openInNewWindow})]})]}),v.jsx("div",{className:"mt-8",children:v.jsx("span",{children:v.jsx("b",{children:i.labels.OR})})}),v.jsxs(we,{className:"mt-8",onClick:()=>i.add(i.model),children:[v.jsx(Eo,{}),i.labels.createTitle]})]})},Xt=({update:t=!1,type:e,parentId:n,...r})=>{const[i,s]=m.useState({}),[o,a]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(!1);m.useEffect(()=>{console.log(r)},[]),m.useEffect(()=>{r.item?(s({name:r.item.name||"",...Object.fromEntries(r.items.map(p=>[p.name,r.item?r.item[p.name]:""]))}),a(r.item.targetBlank||!1),c(r.item.visible||!1)):(s({name:"",...Object.fromEntries(r.items.map(p=>[p.name,""]))}),a(!1),c(!1))},[r.item,r.items]);const h=p=>{const{name:g,value:b}=p.target;s(y=>({...y,[g]:b}))},f=async p=>{var g,b;p.preventDefault(),d(!0);try{let y=null;t?(y=await W.put("",{type:(g=r.item)==null?void 0:g.type,modelId:(b=r.item)==null?void 0:b.id,data:{...r.item,...i,targetBlank:o,visible:l},_method:"updateItem"}),r.callback(y.data.data)):(await W.post("",{data:{...i,targetBlank:o,visible:l,parentId:n,type:e},_method:"createItem"}),r.callback(null))}catch(y){console.error(y)}finally{d(!1)}};return v.jsxs("div",{className:"p-8",children:[v.jsxs("form",{className:"grid gap-6",id:"group-add",onSubmit:f,children:[v.jsxs("div",{className:"flex gap-4 items-center",children:[v.jsx(rr,{id:"targetBlank",checked:o,onCheckedChange:p=>a(!!p),className:"cursor-pointer size-5"}),v.jsx(Ve,{htmlFor:"targetBlank",children:r.labels.openInNewWindow})]}),v.jsxs("div",{className:"flex gap-4 items-center",children:[v.jsx(rr,{id:"visible",checked:l,onCheckedChange:p=>c(!!p),className:"cursor-pointer size-5"}),v.jsx(Ve,{htmlFor:"visible",children:r.labels.visible})]}),v.jsxs("div",{className:"grid gap-4",children:[v.jsx(Ve,{htmlFor:"name",children:r.labels.title}),v.jsx(ir,{required:!0,value:i.name||"",name:"name",placeholder:r.labels.title,onChange:h})]}),r.items.map(p=>v.jsxs("div",{className:"grid gap-4",children:[v.jsx(Ve,{children:p.name}),v.jsx(ir,{required:p.required,value:i[p.name]||"",name:p.name,placeholder:p.name,onChange:h})]},p.name))]}),v.jsxs(we,{className:"mt-8 w-fit",form:"group-add",type:"submit",disabled:u,children:[r.labels.save,u&&v.jsx(_e,{className:"h-4 w-4 animate-spin ml-2"})]})]})},$v=({items:t,onSelect:e})=>{const n=m.useContext(zl),[r,i]=m.useState(""),s=o=>{i(o),e(o),i("")};return v.jsxs("div",{className:"p-8",children:[v.jsx(Ve,{className:"mb-4",children:n.messages["Select Item type"]}),v.jsxs(Nr,{onValueChange:s,value:r,children:[v.jsx(kr,{className:"w-full max-w-[170px] cursor-pointer",children:v.jsx(Lr,{placeholder:n.messages["Select Ids"]})}),v.jsx(Vr,{className:"z-[1005]",children:t.map(o=>v.jsx(jr,{value:o.type,children:o.name},`${o.type}-${o.name}`))})]})]})},Wv=({dialogRef:t,PopupEvent:e,firstRender:n,secondRender:r,popupType:i,addProps:s,editModel:o,popUpTargetBlank:a,isNavigation:l,messages:c,DynamicComponent:u,DynamicActionComponent:d,addLinksGroupProps:h,reloadCatalog:f,itemType:p,parentid:g,addItemProps:b,getAddModelJSON:y,addModel:T,items:S,selectCatalogItem:E})=>v.jsxs(cc,{ref:t,children:[v.jsx(uc,{}),v.jsxs(dc,{children:[v.jsx(Rn,{children:v.jsxs("div",{className:"relative h-full",children:[e==="create"&&v.jsxs(v.Fragment,{children:[n&&v.jsx(_e,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}),v.jsx($v,{items:S,onSelect:E})]}),e==="update"&&v.jsx("div",{className:"h-full overflow-y-auto mt-5",children:n?v.jsx(_e,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}):v.jsxs(v.Fragment,{children:[i==="model"&&v.jsx(Vi,{page:s,catalog:!0,callback:o,openNewWindowLabel:c["Open in a new window"],openNewWindow:a,isNavigation:l}),i==="navigation.group"&&v.jsx(Xt,{callback:w=>{var P;(P=t.current)==null||P.close(),f(w)},update:!0,type:"group",...h}),i==="navigation.link"&&v.jsx(Xt,{callback:w=>{var P;(P=t.current)==null||P.close(),f(w)},update:!0,type:"link",...h}),i==="component"&&v.jsx(v.Fragment,{children:u})]})}),e==="action"&&v.jsx(v.Fragment,{children:d})]})}),v.jsx(Rn,{children:v.jsxs("div",{className:"relative h-full",children:[r&&v.jsx(_e,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}),e==="create"&&v.jsxs(v.Fragment,{children:[i==="model"&&v.jsx(Hv,{add:y,callback:()=>{var w;(w=t.current)==null||w.close(),f(null)},type:p??"",parentId:g,isNavigation:l,...b}),i==="navigation.group"&&v.jsx(Xt,{callback:w=>{var P;(P=t.current)==null||P.close(),f(w)},type:"group",parentId:g,...h}),i==="navigation.link"&&v.jsx(Xt,{callback:w=>{var P;(P=t.current)==null||P.close(),f(w)},type:"link",parentId:g,...h}),i==="component"&&v.jsx(v.Fragment,{children:u})]})]})}),v.jsx(Rn,{children:v.jsx("div",{className:"h-full overflow-y-auto mt-5",children:v.jsx(Vi,{page:s,catalog:!0,callback:T,openNewWindowLabel:c["Open in a new window"],isNavigation:l})})})]})]}),Gv=()=>{var Ri;const t=m.useRef(null),e=m.useRef(null),[n,r]=m.useState([]),[i,s]=m.useState([]),[o,a]=m.useState({catalogId:"",catalogName:"",catalogSlug:"",idList:[],nodes:[],movingGroupsRootOnly:!1}),[l,c]=m.useState([]),[u,d]=m.useState({}),[h,f]=m.useState(!1),p=m.useRef(null),[g,b]=m.useState({items:[],model:"",labels:{}}),[y,T]=m.useState({items:[],labels:{}}),[S,E]=m.useState(""),[w,P]=m.useState(null),[j,A]=m.useState(null),[U,_]=m.useState(null),[J,de]=m.useState(0),[En,kt]=m.useState(!1),[Pn,Di]=m.useState(!1),[q,re]=m.useState(null),[rt,it]=m.useState(null),[st,Ul]=m.useState([]),[On,Ci]=m.useState([]),[Hl,Ei]=m.useState(!1),[$l,In]=m.useState(!1),[Wl,Pi]=m.useState({props:{actions:[],btnBack:{link:"",title:""},btnSave:{title:""},edit:!1,fields:[],notFound:"",postLink:"",search:"",view:!1}}),[Gl,Ae]=m.useState(!1),[ql,Oi]=m.useState(!1);m.useEffect(()=>{const x=async()=>{const M=await W.post("",{_method:"getCatalog"}),{catalog:R,items:C,toolsActions:L}=M.data;a(R),c(C),r(R.nodes),Ul(L),Di(R.catalogSlug==="navigation")},O=async()=>{let M=await W.post("",{_method:"getLocales"});d(M.data.data)};(async()=>{try{f(!0),await O(),await x()}catch(M){console.error("Error initializing catalog:",M)}finally{f(!1)}})()},[]);const Ii=x=>{i.find(D=>D.id===x.id)?(de(0),s(i.filter(D=>D.id!==x.id))):(de(x.id),s([...i,x]))},Kl=x=>{x.target===x.currentTarget&&s([])},Xl=m.useCallback(async(x,{dragSourceId:O,dropTargetId:D})=>{var M;try{const R=x.find(V=>V.id===O),C=D||0,L={data:{reqNode:[{id:R==null?void 0:R.id,parent:C,text:R==null?void 0:R.text,data:R==null?void 0:R.data}],reqParent:{id:C,children:x.filter(V=>V.parent===C).map(V=>({id:V.id,text:V.text,data:V.data})),data:C===0?{id:0}:(M=x.find(V=>V.id===C))==null?void 0:M.data}},_method:"updateTree"};r(x),await W.put("",L)}catch(R){console.error("Error updating tree:",R)}},[n]),An=m.useCallback(async(x,O)=>{if(O)try{P(x);const D=n.find(C=>C.id===x),R=(await W.post("",{data:D,_method:"getChilds"})).data.data;r(C=>{const L=new Set(C.map(F=>F.id)),V=R.filter(F=>!L.has(F.id));return V.length===0?C:[...C,...V]})}catch(D){console.error("Error loading child nodes:",D)}finally{P(null)}},[n]),Yl=m.useCallback(async()=>{try{const x=await W.post("",{_method:"getCatalog"}),{catalog:O}=x.data;r(D=>{const M=new Map(D.map(V=>[V.id,V])),R=O.nodes,C=D.map(V=>{const F=R.find(ge=>ge.id===V.id);return F&&F.text!==V.text?F:V}),L=R.filter(V=>{var F;return!M.has(V.id)||((F=M.get(V.id))==null?void 0:F.text)!==V.text});return L.length===0&&C.length===D.length&&C.every((V,F)=>V===D[F])?D:[...C,...L]})}catch(x){console.error("Error reloading catalog:",x)}},[]),Lt=m.useCallback(async x=>{var O,D;x?r(M=>M.map(R=>R.id===x.id?{...R,text:x.name,data:{...R.data,...x}}:R)):(O=i[0])!=null&&O.droppable?((D=t.current)==null||D.open(i[0].id),await An(i[0].id,!0)):await Yl()},[i,An,r]),Zl=m.useCallback(async x=>{var D;A(x),Ae(!0);const O=await W.post("",{type:x,_method:"getAddTemplate"});Ql(O.data),(D=p.current)==null||D.next(),Ae(!1)},[J]),Ai=m.useCallback(async()=>{var x,O,D,M,R,C;try{Ae(!0);const L=await W.post("",{type:(O=(x=i[0])==null?void 0:x.data)==null?void 0:O.type,modelId:((M=(D=i[0])==null?void 0:D.data)==null?void 0:M.modelId)??null,id:(C=(R=i[0])==null?void 0:R.data)==null?void 0:C.id,_method:"getEditTemplate"});if(L.data)if(L.data.type.includes("navigation"))switch(L.data.type){case"navigation.group":T(L.data.data),E("navigation.group"),Ae(!1);break;case"navigation.link":T(L.data.data),E("navigation.link"),Ae(!1);break}else switch(L.data.type){case"model":const V=L.data.data.item,F=await W.get(`${window.routePrefix}/model/${V.type}/edit/${V.modelId}?without_layout=true`);Pi(F.data),kt(V.targetBlank),E("model"),Ae(!1);break;default:(async()=>{const Vt=(await import(L.data.data.path)).default;re(v.jsx(Vt,{callback:jt=>{var _t;(_t=p.current)==null||_t.close(),Lt(jt)},update:!0,item:L.data.data.item},`${L.data.data.id}-${L.data.data.item.name}`))})(),E("component"),Ae(!1);break}}catch(L){console.log(L)}},[i]),Jl=m.useCallback(async()=>{if(i.length)try{for(const x of i)if((await W.delete("",{data:x})).data.data.ok){let D=[...n];const M=(R,C)=>{let L=C.filter(F=>F.id!==R);return C.filter(F=>F.parent===R).forEach(F=>{L=M(F.id,L)}),L};i.forEach(R=>{D=M(R.id,D)}),r(D)}}catch(x){console.error("Error deleting node:",x)}finally{s([]),de(0)}},[i,n]),Ql=m.useCallback(x=>{if(x.type.includes("navigation"))switch(x.type){case"model":b(x.data),E("model");break;case"navigation.group":T(x.data),E("navigation.group");break;case"navigation.link":T(x.data),E("navigation.link");break}else switch(x.type){case"model":b(x.data),E("model");break;default:(async()=>{const M=(await import(x.data.path)).default;re(v.jsx(M,{parentId:J,callback:R=>{var C;(C=p.current)==null||C.close(),Lt(R)}},JSON.stringify(new Date)))})(),E("component");break}},[i,Pn]),ec=m.useCallback(async x=>{var D;Oi(!0);const O=await W.get(`${window.routePrefix}/model/${x}/add?without_layout=true'`);Pi(O.data),(D=p.current)==null||D.next(),Oi(!1)},[j]),tc=async(x,O)=>{var D;O&&(x.targetBlank=O);try{await W.post("",{data:{record:x,parentId:J,type:j},_method:"createItem"})}catch(M){console.log(M)}finally{(D=p.current)==null||D.close(),Lt()}},nc=m.useCallback(async(x,O)=>{var D,M,R,C,L,V,F;O&&(x[0].targetBlank=O),x[0].treeId=(M=(D=i[0])==null?void 0:D.data)==null?void 0:M.id;try{const ge=await W.put("",{type:(C=(R=i[0])==null?void 0:R.data)==null?void 0:C.type,data:{record:x[0]},modelId:(V=(L=i[0])==null?void 0:L.data)==null?void 0:V.modelId,_method:"updateItem"});r($e=>{const{modelId:Vt,type:jt,name:_t}=ge.data.data;return Vt===void 0||jt===void 0?(console.warn("No modelId or type in response!"),$e):$e.map(ot=>{var Ni,ki;return((Ni=ot.data)==null?void 0:Ni.modelId)===Vt&&((ki=ot.data)==null?void 0:ki.type)===jt?{...ot,text:_t,data:{...ot.data,...ge.data}}:ot})})}catch(ge){console.error("Error updating model:",ge)}finally{(F=p.current)==null||F.close()}},[i,r,n]),Mi=async x=>{if(s([]),In(!0),!x.trim()){const O=await W.post("",{_method:"getCatalog"}),{catalog:D}=O.data;r(D.nodes),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var M,R;t.current&&((R=(M=t.current).closeAll)==null||R.call(M),In(!1))})});return}try{const O=await W.post("",{s:x,_method:"search"});r(O.data.data),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var D,M;t.current&&((M=(D=t.current).openAll)==null||M.call(D),In(!1))})})}catch(O){console.error("Error searching:",O)}},rc=Pc(Mi,500),ic=m.useCallback((x,O)=>{if(x){const D=i.some(M=>M.id===O.id);s([]),D||(Ii(O),sc(O))}},[]),sc=m.useCallback(async x=>{var O,D;Ci([]),Ei(!0);try{const M=await W.post("",{items:[x],type:"context",_method:"getActions"});M.data&&((D=(O=M==null?void 0:M.data)==null?void 0:O.data)!=null&&D.length)&&Ci(M.data.data)}catch(M){console.error(M)}finally{Ei(!1)}},[]),Mn=m.useCallback(async x=>{var M,R;const O=st.find(C=>C.id===x)??On.find(C=>C.id===x);if(!O)return;let D=null;switch(O.type){case"link":try{D=await W.put("",{actionId:O.id,_method:"getLink"}),D.data&&((M=window.open(`${D.data.data}`,"_blank"))==null||M.focus())}catch(L){console.error(L)}break;case"basic":let C={actionID:O.id,items:i,data:""};try{Li.warning(u["Performing an action..."]),await W.put("",{data:C,_method:"handleAction"})}catch(L){console.error(L)}finally{Li.success(u["Action completed"])}break;case"external":try{const L=await W.put("",{actionId:O.id,_method:"getPopUpTemplate"});L.data&&((async()=>{const ge=(await import(L.data.data)).default;it(v.jsx(ge,{items:i,callback:()=>{var $e;($e=p.current)==null||$e.close()}},JSON.stringify(i)))})(),(R=p.current)==null||R.open(),_("action"))}catch(L){console.error(L)}break}},[st,i,On]);return v.jsx(v.Fragment,{children:h?v.jsxs(v.Fragment,{children:[v.jsx(Nn,{className:"h-12 w-1/4 rounded-md"}),v.jsx(Nn,{className:"h-12 w-full rounded-md"}),v.jsx(Nn,{className:"h-full w-full rounded-md"})]}):v.jsxs(zl.Provider,{value:{messages:u,setMessages:d},children:[v.jsx(hc,{position:"top-center",richColors:!0,closeButton:!0}),v.jsxs("div",{className:"flex gap-8 items-center mb-4",children:[v.jsx("h1",{className:"text-[28px] leading-[36px] text-foreground",children:u[o.catalogName]}),o.idList.length>0&&v.jsxs(Nr,{defaultValue:o.catalogId,onValueChange:x=>{fc.get(`${window.routePrefix}/catalog/${o.catalogSlug}/${x}`)},children:[v.jsx(kr,{className:"w-full max-w-[170px] cursor-pointer",children:v.jsx(Lr,{placeholder:u["Select Ids"]})}),v.jsx(Vr,{children:o.idList.map(x=>v.jsx(jr,{value:x,children:x},x))})]})]}),v.jsxs("div",{className:"xl:gap-10 justify-between flex flex-col xl:flex-row gap-3.5",children:[v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsxs("div",{className:"flex gap-2 items-center flex-wrap md:flex-nowrap",children:[v.jsxs(we,{variant:"default",size:"sm",className:`w-fit rounded-sm ${i.length===0||i.length===1&&((Ri=i[0])!=null&&Ri.droppable)?"":"opacity-50 pointer-events-none"}`,onClick:()=>{var x;_("create"),(x=p.current)==null||x.open()},children:[v.jsx(Eo,{}),u.create]}),v.jsxs(we,{variant:"outline",size:"sm",className:`w-fit cursor-pointer rounded-sm ${i.length>1||!i.length?"opacity-50 pointer-events-none":""}`,onClick:()=>{var x;Ai(),_("update"),(x=p.current)==null||x.open()},children:[v.jsx(pc,{}),u.Edit]}),v.jsx(Oc,{btnTitle:u.Delete,ref:e,variant:"destructive",btnCLass:`w-fit text-white hover ${i.length?"":"opacity-50 pointer-events-none"}`,delModal:{yes:u.Yes,no:u.No,text:u["Are you sure?"]},isLink:!1,handleDelete:Jl}),v.jsxs(we,{variant:"secondary",size:"sm",className:`w-fit cursor-pointer rounded-sm ${i.length?"":"opacity-50 pointer-events-none"}`,onClick:()=>{de(0),s([])},children:[v.jsx(gc,{}),u.Clean]})]}),v.jsxs("div",{className:"ml-4",children:[v.jsx("div",{className:"hidden lg:flex gap-2",children:st.map(x=>v.jsxs(we,{variant:"outline",size:"sm",onClick:()=>Mn(x.id),children:[v.jsx(on,{name:x.icon}),x.name]},x.id))}),st.length>0&&v.jsx("div",{className:"block lg:hidden",children:v.jsxs(mc,{children:[v.jsx(vc,{asChild:!0,children:v.jsx(we,{variant:"outline",size:"icon",children:v.jsx(yc,{})})}),v.jsx(bc,{className:"w-fit",side:"right",align:"start",children:v.jsx(xc,{className:"grid gap-2",children:st.map(x=>v.jsxs(we,{variant:"outline",size:"sm",onClick:()=>Mn(x.id),children:[v.jsx(on,{name:x.icon}),x.name]},x.id))})})]})})]})]}),v.jsxs("div",{className:"flex gap-2 items-center justify-start xl:justify-end",children:[$l&&v.jsx(_e,{className:"size-4 animate-spin order-2 xl:order-1"}),v.jsx(ir,{type:"search",autoFocus:!1,placeholder:u.Search,className:"w-[200px] p-2 border rounded order-1 xl:order-2",onChange:x=>{rc(x.target.value)},onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Mi(x.currentTarget.value))}})]})]}),v.jsx("div",{className:"h-full",children:v.jsx(sm,{backend:Bm,options:uv(),children:v.jsx("div",{className:nr.app,children:v.jsx(Ev,{ref:t,tree:n,rootId:0,render:(x,{depth:O,isOpen:D,onToggle:M})=>{var R;return v.jsxs(Tc,{onOpenChange:C=>ic(C,x),children:[v.jsx(Sc,{children:v.jsx(Rv,{node:x,depth:O,isOpen:D,loading:w===x.id,isSelected:!!i.find(C=>C.id===x.id),onToggle:C=>{M(),An(C,!D)},onSelect:Ii})}),v.jsxs(wc,{children:[v.jsx(Bt,{className:`${(R=i[0])!=null&&R.droppable?"":"opacity-50 pointer-events-none"}`,onClick:()=>{var C;_("create"),(C=p.current)==null||C.open()},children:u.create}),v.jsx(Bt,{onClick:()=>{var C;Ai(),_("update"),(C=p.current)==null||C.open()},children:u.Edit}),v.jsx(Bt,{variant:"destructive",onClick:()=>{var C;document.body.removeAttribute("style"),(C=e.current)==null||C.click()},className:i.length?"":"opacity-50 pointer-events-none",children:u.Delete}),Hl?v.jsx(_e,{className:"mx-auto size-3 animate-spin"}):On.map(C=>v.jsx(Bt,{onClick:()=>Mn(C.id),children:C.name},C.id))]})]})},dropTargetOffset:5,insertDroppableFirst:!1,classes:{draggingSource:nr.draggingSource,dropTarget:"bg-chart-1/30",placeholder:nr.placeholderContainer,root:"py-4"},canDrop:(x,{dragSource:O,dropTargetId:D})=>{if((O==null?void 0:O.parent)===D)return!0},sort:!1,dragPreviewRender:x=>v.jsx(Vv,{monitorProps:x}),onDrop:Xl,placeholderRender:(x,{depth:O})=>v.jsx(Uv,{node:x,depth:O}),rootProps:{onClick:Kl}})})})}),v.jsx(Wv,{dialogRef:p,PopupEvent:U,firstRender:Gl,secondRender:ql,popupType:S,addProps:Wl,editModel:nc,popUpTargetBlank:En,isNavigation:Pn,messages:u,DynamicComponent:q,DynamicActionComponent:rt,addLinksGroupProps:y,reloadCatalog:Lt,itemType:j,parentid:J,addItemProps:g,getAddModelJSON:ec,addModel:tc,items:l,selectCatalogItem:Zl})]})})},qv=[];function yy(){return v.jsx(Dc,{breadcrumbs:qv,children:v.jsx("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:v.jsx(Gv,{})})})}export{yy as default};
5
+ ${JSON.stringify(o)} (conflicts with: ${JSON.stringify(N(this,ee)[l])})`);return{id:l,instance:a,preview:o.preview??!1,transition:o.transition,skipDispatchOnTransition:o.skipDispatchOnTransition??!1}}),this.setup=()=>{if(!(typeof window>"u")){if(rn.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");rn.isSetUp=!0,N(this,Pr).call(this,window),N(this,ee)[N(this,Q)].instance.setup()}},this.teardown=()=>{typeof window>"u"||(rn.isSetUp=!1,N(this,Or).call(this,window),N(this,ee)[N(this,Q)].instance.teardown())},this.connectDragSource=(i,s,o)=>N(this,mt).call(this,"connectDragSource",i,s,o),this.connectDragPreview=(i,s,o)=>N(this,mt).call(this,"connectDragPreview",i,s,o),this.connectDropTarget=(i,s,o)=>N(this,mt).call(this,"connectDropTarget",i,s,o),this.profile=()=>N(this,ee)[N(this,Q)].instance.profile(),this.previewEnabled=()=>N(this,ee)[N(this,Q)].preview,this.previewsList=()=>N(this,gt),this.backendsList=()=>N(this,me),se(this,Pr,i=>{for(let s of N(this,me))s.transition&&i.addEventListener(s.transition.event,N(this,tn))}),se(this,Or,i=>{for(let s of N(this,me))s.transition&&i.removeEventListener(s.transition.event,N(this,tn))}),se(this,tn,i=>{var o;let s=N(this,Q);if(N(this,me).some(a=>a.id!==N(this,Q)&&a.transition&&a.transition.check(i)?(Ve(this,Q,a.id),!0):!1),N(this,Q)!==s){N(this,ee)[s].instance.teardown();for(let[u,d]of Object.entries(N(this,je)))d.unsubscribe(),d.unsubscribe=N(this,nn).call(this,d.func,...d.args);N(this,gt).backendChanged(this);let a=N(this,ee)[N(this,Q)];if(a.instance.setup(),a.skipDispatchOnTransition)return;let l=i.constructor,c=new l(i.type,i);(o=i.target)==null||o.dispatchEvent(c)}}),se(this,nn,(i,s,o,a)=>N(this,ee)[N(this,Q)].instance[i](s,o,a)),se(this,mt,(i,s,o,a)=>{let l=`${i}_${s}`,c=N(this,nn).call(this,i,s,o,a);return N(this,je)[l]={func:i,args:[s,o,a],unsubscribe:c},()=>{N(this,je)[l].unsubscribe(),delete N(this,je)[l]}}),!r||!r.backends||r.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
6
+ see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);Ve(this,gt,new Fm),Ve(this,ee,{}),Ve(this,me,[]);for(let i of r.backends){let s=N(this,Er).call(this,e,n,i);N(this,ee)[s.id]=s,N(this,me).push(s)}Ve(this,Q,N(this,me)[0].id),Ve(this,je,{})}};Q=new WeakMap,gt=new WeakMap,ee=new WeakMap,me=new WeakMap,je=new WeakMap,Er=new WeakMap,Pr=new WeakMap,Or=new WeakMap,tn=new WeakMap,nn=new WeakMap,mt=new WeakMap,Ml.isSetUp=!1;var zm=Ml,Um=(t,e,n)=>new zm(t,e,n),Rl=(t,e)=>({event:t,check:e}),Hm=Rl("touchstart",t=>{let e=t;return e.touches!==null&&e.touches!==void 0}),$m=Rl("pointerdown",t=>t.pointerType==="mouse"),Ce;(function(t){t.mouse="mouse",t.touch="touch",t.keyboard="keyboard"})(Ce||(Ce={}));class Wm{get delay(){var e;return(e=this.args.delay)!==null&&e!==void 0?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return(e=this.args.ignoreContextMenu)!==null&&e!==void 0?e:!1}get enableHoverOutsideTarget(){var e;return(e=this.args.enableHoverOutsideTarget)!==null&&e!==void 0?e:!1}get enableKeyboardEvents(){var e;return(e=this.args.enableKeyboardEvents)!==null&&e!==void 0?e:!1}get enableMouseEvents(){var e;return(e=this.args.enableMouseEvents)!==null&&e!==void 0?e:!1}get enableTouchEvents(){var e;return(e=this.args.enableTouchEvents)!==null&&e!==void 0?e:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get delayMouseStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var e;if(!((e=this.context)===null||e===void 0)&&e.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.args)===null||e===void 0?void 0:e.rootElement)||this.document}constructor(e,n){this.args=e,this.context=n}}function Gm(t,e,n,r){return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function qm(t,e,n,r,i){if(!i)return!1;const s=Math.atan2(r-e,n-t)*180/Math.PI+180;for(let o=0;o<i.length;++o){const a=i[o];if(a&&(a.start==null||s>=a.start)&&(a.end==null||s<=a.end))return!0}return!1}const Km={Left:1},Xm={Left:0};function er(t){return t.button===void 0||t.button===Xm.Left}function Ym(t){return t.buttons===void 0||(t.buttons&Km.Left)===0}function Nl(t){return!!t.targetTouches}const Zm=1;function Jm(t){const e=t.nodeType===Zm?t:t.parentElement;if(!e)return;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Qm(t,e){if(t.targetTouches.length===1)return gn(t.targetTouches[0]);if(e&&t.touches.length===1&&t.touches[0].target===e.target)return gn(t.touches[0])}function gn(t,e){return Nl(t)?Qm(t,e):{x:t.clientX,y:t.clientY}}const To=(()=>{let t=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return t=!0,!0}}))}catch{}return t})(),ct={[Ce.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Ce.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Ce.keyboard]:{keydown:"keydown"}};class wt{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((e=this.dragOverTargetIds)===null||e===void 0?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&(L(!wt.isSetUp,"Cannot have two Touch backends at the same time."),wt.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(wt.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,n,r,i=!1){const s=To?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=ct[o][n];a&&e.addEventListener(a,r,s)})}removeEventListener(e,n,r,i=!1){const s=To?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=ct[o][n];a&&e.removeEventListener(a,r,s)})}connectDragSource(e,n){const r=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(e),this.removeEventListener(n,"start",r)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const i=s=>{if(!this.document||!r||!this.monitor.isDragging())return;let o;switch(s.type){case ct.mouse.move:o={x:s.clientX,y:s.clientY};break;case ct.touch.move:var a,l;o={x:((a=s.touches[0])===null||a===void 0?void 0:a.clientX)||0,y:((l=s.touches[0])===null||l===void 0?void 0:l.clientY)||0};break}const c=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,u=c&&n.contains(c);if(c===n||u)return this.handleMove(s,e)};return this.addEventListener(this.document.body,"move",i),this.targetNodes.set(e,n),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",i))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,n,r){this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&Jm(s)},this.handleTopMoveStartCapture=i=>{er(i)&&(this.moveStartSourceIds=[])},this.handleMoveStart=i=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(i)},this.handleTopMoveStart=i=>{if(!er(i))return;const s=gn(i);s&&(Nl(i)&&(this.lastTargetTouchFallback=i.targetTouches[0]),this._mouseClientOffset=s),this.waitingForDelay=!1},this.handleTopMoveStartDelay=i=>{if(!er(i))return;const s=i.type===ct.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,i),s),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(i,s)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(s)},this.handleTopMove=i=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:s,dragOverTargetIds:o}=this,a=this.options.enableHoverOutsideTarget,l=gn(i,this.lastTargetTouchFallback);if(!l)return;if(this._isScrolling||!this.monitor.isDragging()&&qm(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&s&&Gm(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(s,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const c=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(c),this.actions.publishDragSource(),i.cancelable&&i.preventDefault();const u=(o||[]).map(p=>this.targetNodes.get(p)).filter(p=>!!p),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(l.x,l.y,u):this.document.elementsFromPoint(l.x,l.y),h=[];for(const p in d){if(!d.hasOwnProperty(p))continue;let g=d[p];for(g!=null&&h.push(g);g;)g=g.parentElement,g&&h.indexOf(g)===-1&&h.push(g)}const f=h.filter(p=>u.indexOf(p)>-1).map(p=>this._getDropTargetId(p)).filter(p=>!!p).filter((p,g,b)=>b.indexOf(p)===g);if(a)for(const p in this.targetNodes){const g=this.targetNodes.get(p);if(c&&g&&g.contains(c)&&f.indexOf(p)===-1){f.unshift(p);break}}f.reverse(),this.actions.hover(f,{clientOffset:l})},this._getDropTargetId=i=>{const s=this.targetNodes.keys();let o=s.next();for(;o.done===!1;){const a=o.value;if(i===this.targetNodes.get(a))return a;o=s.next()}},this.handleTopMoveEndCapture=i=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!Ym(i)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}i.cancelable&&i.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=i=>{i.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new Wm(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Ce.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Ce.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Ce.keyboard)}}const ev=function(e,n={},r={}){return new wt(e,n,r)};var le=function(){return le=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},le.apply(this,arguments)};function Z(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function tv(t){var e=t.isVisible,n=t.ease,r=n===void 0?"easeIn":n,i=t.duration,s=t.variants,o=s===void 0?{open:{opacity:1,height:"auto"},close:{opacity:0,height:0}}:s,a=t.children,l=zp({polyfill:fu}),c=l[0],u=l[1].height,d=v.useState(e),h=d[0],f=d[1],p=v.useState(e),g=p[0],b=p[1],y=v.useState(!1),T=y[0],S=y[1],E=function(){S(!1),e||f(!1)};v.useEffect(function(){S(!0),e?f(!0):b(!1)},[e]);var w=u===0;return v.useEffect(function(){h&&b(!0)},[w]),z.createElement(Fp.div,{style:T?{overflow:"hidden"}:void 0,onAnimationComplete:E,initial:g?"open":"close",animate:g?"open":"close",inherit:!1,variants:o,transition:{ease:r,duration:nv(u,i)}},z.createElement("div",{ref:c},h&&a))}function nv(t,e){if(e)return e;if(!t)return 0;var n=t/36;return Math.round((4+10*Math.pow(n,.25)+n/5)*10)/1500}var kl=v.createContext({}),rv={isLock:!1},iv=function(t){var e=v.useState(rv.isLock),n=e[0],r=e[1];return z.createElement(kl.Provider,{value:{isLock:n,lock:function(){return r(!0)},unlock:function(){return r(!1)}}},t.children)},kt=v.createContext({}),Kt={dropTargetId:void 0,index:void 0},sv=function(t){var e=v.useState(Kt.dropTargetId),n=e[0],r=e[1],i=v.useState(Kt.index),s=i[0],o=i[1],a=function(c,u){r(c),o(u)},l=function(){r(Kt.dropTargetId),o(Kt.index)};return z.createElement(kt.Provider,{value:{dropTargetId:n,index:s,showPlaceholder:a,hidePlaceholder:l}},t.children)},ov=function(t,e){return t.text>e.text?1:t.text<e.text?-1:0},ut=function(t,e){return t.find(function(n){return n.id===e})},Ll=function(t,e,n){if(n===0)return!1;var r=t.find(function(i){return i.id===n});return r===void 0?!1:r.parent===e?!0:Ll(t,e,r.parent)},Si=function(t){return typeof t=="object"&&t!==null&&"id"in t&&"parent"in t&&"text"in t},Oe=function(t,e,n){var r=n.tree,i=n.rootId,s=n.canDrop;if(t===null){if(e===i)return!0;var o=r.find(function(u){return u.id===e});return!!(o&&o.droppable)}else{var a=Si(t)?t.id:null;if(s){var l=s(a,e);if(l!==void 0)return l}if(a===e)return!1;var c=r.find(function(d){return d.id===a}),o=r.find(function(d){return d.id===e});return c===void 0||a===null?e===i||!!(o!=null&&o.droppable):o===void 0?c.parent!==0:c.parent===e||!o.droppable?!1:!Ll(r,a,e)}},av=function(t,e,n){return t.map(function(r){return r.id===e?le(le({},r),{parent:n}):r})},Vl=function(t,e,n){if(n===0)return 0;var r=t.filter(function(i){return i.parent===e});return r[n]?t.findIndex(function(i){return i.id===r[n].id}):t.findIndex(function(i){return i.id===r[n-1].id})+1},lv=function(t,e){return t.findIndex(function(n){return n.id===e})},jl=function(t,e,n,r){var i=lv(t,e),s=Vl(t,n,r);return s=s>i?s-1:s,[i,s]},cv=function(t,e,n){var r=e<0?t.length+e:e;if(r>=0&&r<t.length){var i=n<0?t.length+n:n,s=t.splice(e,1)[0];t.splice(i,0,s)}},uv=function(t,e,n,r){var i=jl(t,e,n,r),s=i[0],o=i[1],a=Z([],t,!0);return cv(a,s,o),a.map(function(l){return l.id===e?le(le({},l),{parent:n}):l})},dv=function(t,e){var n=t.getBoundingClientRect(),r=n.top+n.height/2;return e>r?"down":"up"},Ir=function(t,e){var n="",r=0;return t.forEach(function(i,s){var o,a=dv(i,((o=e.getClientOffset())===null||o===void 0?void 0:o.y)||0);n===""?n=a:n!==a&&(n=a,r=s),s===t.length-1&&a==="down"&&(r=s+1)}),r},So=function(t,e,n){var r=e.closest('[role="list"]'),i=r==null?void 0:r.querySelectorAll(':scope > [role="listitem"]');return i?Ir(i,n):null},hv=function(t,e,n){var r=t.getBoundingClientRect(),i=n.dropTargetOffset;if(i===0)return"middle";var s=r.top+i,o=r.bottom-i;return e>o?"lower":e<s?"upper":"middle"},Ar=function(t,e,n,r){var i;if(!e)return null;if(t===null){var s=e.querySelectorAll(':scope > [role="listitem"]');return{id:r.rootId,index:Ir(s,n)}}var o=n.getItem(),a=e.querySelector('[role="list"]'),l=hv(e,((i=n.getClientOffset())===null||i===void 0?void 0:i.y)||0,r);if(a){if(l==="upper")if(Oe(o,t.parent,r)){var c=So(t,e,n);return c===null?null:{id:t.parent,index:c}}else return{id:t.id,index:0};var s=a.querySelectorAll(':scope > [role="listitem"]');return{id:t.id,index:Ir(s,n)}}else{if(l==="middle")return{id:t.id,index:0};if(Oe(o,t.parent,r)){var c=So(t,e,n);return c===null?null:{id:t.parent,index:c}}return null}},fv=function(t){return t===void 0&&(t={}),{backends:[{id:"html5",backend:Gc,options:t.html5,transition:$m},{id:"touch",backend:ev,options:t.touch||{enableMouseEvents:!0},preview:!0,transition:Hm}]}},sn=function(t,e){return t.some(function(n){return n.parent===e})},_l=v.createContext({}),pv=function(t){var e=xv(t.tree,t.initialOpen),n=e[0],r=e[1],i=r.handleToggle,s=r.handleCloseAll,o=r.handleOpenAll,a=r.handleOpen,l=r.handleClose;v.useImperativeHandle(t.treeRef,function(){return{open:function(f){return a(f,t.onChangeOpen)},close:function(f){return l(f,t.onChangeOpen)},openAll:function(){return o(t.onChangeOpen)},closeAll:function(){return s(t.onChangeOpen)}}});var c=xe().getMonitor(),u=t.canDrop,d=t.canDrag,h=le(le({extraAcceptTypes:[],listComponent:"ul",listItemComponent:"li",placeholderComponent:"li",sort:!0,insertDroppableFirst:!0,enableAnimateExpand:!1,dropTargetOffset:0,initialOpen:!1},t),{openIds:n,onDrop:function(f,p,g){if(f){var b={dragSourceId:f.id,dropTargetId:p,dragSource:f,dropTarget:ut(t.tree,p),monitor:c},y=t.tree;if(ut(y,f.id)||(y=Z(Z([],y,!0),[f],!1)),t.sort===!1){var T=jl(y,f.id,p,g),S=T[1];b.destinationIndex=S,b.relativeIndex=g,t.onDrop(uv(y,f.id,p,g),b);return}t.onDrop(av(y,f.id,p),b)}else{var b={dropTargetId:p,dropTarget:ut(t.tree,p),monitor:c};t.sort===!1&&(b.destinationIndex=Vl(t.tree,p,g),b.relativeIndex=g),t.onDrop(t.tree,b)}},canDrop:u?function(f,p){return u(t.tree,{dragSourceId:f??void 0,dropTargetId:p,dragSource:c.getItem(),dropTarget:ut(t.tree,p),monitor:c})}:void 0,canDrag:d?function(f){return d(ut(t.tree,f))}:void 0,onToggle:function(f){return i(f,t.onChangeOpen)}});return z.createElement(_l.Provider,{value:h},t.children)},gv=function(t){return z.createElement(pv,le({},t),z.createElement(iv,null,z.createElement(sv,null,t.children)))},mv=function(t){var e=v.useContext(kl);v.useEffect(function(){if(t.current){var n=t.current,r=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.lock()},i=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.unlock()},s=function(u){return r(u)},o=function(u){return i(u)},a=function(u){return r(u)},l=function(u){return i(u)},c=new MutationObserver(function(){document.activeElement===document.body&&e.unlock()});return c.observe(n,{subtree:!0,childList:!0}),n.addEventListener("mouseover",s),n.addEventListener("mouseout",o),n.addEventListener("focusin",a),n.addEventListener("focusout",l),function(){c.disconnect(),n.removeEventListener("mouseover",s),n.removeEventListener("mouseout",o),n.removeEventListener("focusin",a),n.removeEventListener("focusout",l)}}},[t,e]),v.useEffect(function(){var n;(n=t.current)===null||n===void 0||n.setAttribute("draggable",e.isLock?"false":"true")},[t,e.isLock])},En={TREE_ITEM:Symbol()},Bl=null,Fl=function(t){var e=t.target;if(e instanceof HTMLElement){var n=e.closest('[role="listitem"]');t.currentTarget===n&&(Bl=n)}},wo=function(t){return Fl(t)},Do=function(t){return Fl(t)},vv=function(t,e){var n=Ae();v.useEffect(function(){var a=e.current;return a==null||a.addEventListener("dragstart",wo),a==null||a.addEventListener("touchstart",Do,{passive:!0}),function(){a==null||a.removeEventListener("dragstart",wo),a==null||a.removeEventListener("touchstart",Do)}},[e]);var r=Mm({type:En.TREE_ITEM,item:function(a){var l=le({ref:e},t);return n.onDragStart&&n.onDragStart(l,a),l},end:function(a,l){var c=a;n.onDragEnd&&n.onDragEnd(c,l)},canDrag:function(){var a=n.canDrag;return Bl!==e.current?!1:a?a(t.id):!0},collect:function(a){return{isDragging:a.isDragging()}}}),i=r[0].isDragging,s=r[1],o=r[2];return[i,s,o]},yv=function(t){var e=Ae(),n=v.useContext(kt),r=Ol({accept:Z([En.TREE_ITEM],e.extraAcceptTypes,!0),drop:function(l,c){var u=e.rootId,d=e.onDrop,h=n.dropTargetId,f=n.index;c.isOver({shallow:!0})&&h!==void 0&&f!==void 0&&d(Si(l)?l:null,u,f),n.hidePlaceholder()},canDrop:function(l,c){var u=e.rootId;return c.isOver({shallow:!0})?l===void 0?!1:Oe(l,u,e):!1},hover:function(l,c){if(c.isOver({shallow:!0})){var u=e.rootId,d=n.dropTargetId,h=n.index,f=n.showPlaceholder,p=n.hidePlaceholder,g=Ar(null,t.current,c,e);if(g===null||!Oe(l,u,e)){p();return}(g.id!==d||g.index!==h)&&f(g.id,g.index)}},collect:function(l){var c=l.getItem();return{isOver:l.isOver({shallow:!0})&&l.canDrop(),dragSource:c}}}),i=r[0],s=i.isOver,o=i.dragSource,a=r[1];return[s,o,a]},bv=function(t,e){var n=Ae(),r=v.useContext(kt),i=Ol({accept:Z([En.TREE_ITEM],n.extraAcceptTypes,!0),drop:function(c,u){var d=r.dropTargetId,h=r.index;u.isOver({shallow:!0})&&d!==void 0&&h!==void 0&&n.onDrop(Si(c)?c:null,d,h),r.hidePlaceholder()},canDrop:function(c,u){if(u.isOver({shallow:!0})){var d=Ar(t,e.current,u,n);return d===null?!1:Oe(c,d.id,n)}return!1},hover:function(c,u){if(u.isOver({shallow:!0})){var d=r.dropTargetId,h=r.index,f=r.showPlaceholder,p=r.hidePlaceholder,g=Ar(t,e.current,u,n);if(g===null||!Oe(c,g.id,n)){p();return}(g.id!==d||g.index!==h)&&f(g.id,g.index)}},collect:function(c){var u=c.getItem();return{isOver:c.isOver({shallow:!0})&&c.canDrop(),dragSource:u}}}),s=i[0],o=s.isOver,a=s.dragSource,l=i[1];return[o,a,l]},xv=function(t,e){var n=v.useMemo(function(){return e===!0?t.filter(function(d){return sn(t,d.id)}).map(function(d){return d.id}):Array.isArray(e)?e:[]},[e]),r=v.useState(n),i=r[0],s=r[1];v.useEffect(function(){return s(n)},[n]);var o=function(d,h){var f=i.includes(d)?i.filter(function(p){return p!==d}):Z(Z([],i,!0),[d],!1);s(f),h&&h(f)},a=function(d){s([]),d&&d([])},l=function(d){var h=t.filter(function(f){return sn(t,f.id)}).map(function(f){return f.id});s(h),d&&d(h)},c=function(d,h){var f=[];if(Array.isArray(d)){var p=t.filter(function(g){return d.includes(g.id)&&sn(t,g.id)});f=Z(Z([],i,!0),p.map(function(g){return g.id}),!0).filter(function(g,b,y){return y.indexOf(g)===b})}else f=i.includes(d)?i:Z(Z([],i,!0),[d],!1);s(f),h&&h(f)},u=function(d,h){var f=i.filter(function(p){return Array.isArray(d)?!d.includes(p):p!==d});s(f),h&&h(f)};return[i,{handleToggle:o,handleCloseAll:a,handleOpenAll:l,handleOpen:c,handleClose:u}]},Tv=function(){return Rm(function(t){var e=t.getItemType();return{item:t.getItem(),clientOffset:t.getClientOffset(),isDragging:t.isDragging()&&e===En.TREE_ITEM}})},Ae=function(){var t=v.useContext(_l);if(!t)throw new Error("useTreeContext must be used under TreeProvider");return t},Sv=function(t,e){var n=Ae(),r=n.rootId,i=n.rootProps,s=n.classes,o=(s==null?void 0:s.container)||"";return e&&(s!=null&&s.dropTarget)&&(o="".concat(o," ").concat(s.dropTarget)),t===r&&(s!=null&&s.root)&&(o="".concat(o," ").concat(s.root)),t===r&&(i!=null&&i.className)&&(o="".concat(o," ").concat(i.className)),o=o.trim(),o},wv=function(t,e,n){e.current?n(e):n(t),v.useEffect(function(){e.current?n(e):n(t)},[e.current])},Dv=function(t){var e=Ae(),n=v.useContext(kt),r=v.useRef(null),i=v.useRef(null),s=e.tree.find(function(R){return R.id===t.id}),o=e.openIds,a=e.classes,l=e.enableAnimateExpand,c=o.includes(t.id),u=vv(s,r),d=u[0],h=u[1],f=u[2],p=bv(s,r),g=p[0],b=p[1],y=p[2];wv(r,i,h),Oe(b,t.id,e)&&y(r),v.useEffect(function(){e.dragPreviewRender?f(Wc(),{captureDraggingState:!0}):i.current&&f(r)},[f,e.dragPreviewRender]),mv(r);var T=v.useCallback(function(){e.onToggle(s.id)},[s.id,e]),S=e.listItemComponent,E=e.canDrag?e.canDrag(t.id):!0,w=n.dropTargetId===t.id,O={depth:t.depth,isOpen:c,isDragging:d,isDropTarget:w,draggable:E,hasChild:sn(e.tree,t.id),containerRef:r,handleRef:i,onToggle:T},k="";return a!=null&&a.listItem&&(k=typeof a.listItem=="string"?a.listItem:a.listItem(s,O)),g&&(a!=null&&a.dropTarget)&&(k="".concat(k," ").concat(a.dropTarget)),d&&(a!=null&&a.draggingSource)&&(k="".concat(k," ").concat(a.draggingSource)),z.createElement(S,{ref:r,className:k,role:"listitem"},e.render(s,O),l&&O.hasChild&&z.createElement(tv,{isVisible:c},z.createElement(Mr,{parentId:t.id,depth:t.depth+1})),!l&&O.hasChild&&c&&z.createElement(Mr,{parentId:t.id,depth:t.depth+1}))},Co=function(t){var e=Ae(),n=e.placeholderRender,r=e.placeholderComponent,i=e.classes,s=v.useContext(kt),o=xe(),a=o.getMonitor(),l=a.getItem();if(!n||!l)return null;var c=t.dropTargetId===s.dropTargetId&&(t.index===s.index||t.index===void 0&&t.listCount===s.index),u=a.getTargetIds();return!c||!u.length?null:z.createElement(r,{className:(i==null?void 0:i.placeholder)||""},n(l,{depth:t.depth}))},Mr=function(t){var e=Ae(),n=v.useRef(null),r=e.tree.filter(function(g){return g.parent===t.parentId}),i=r,s=typeof e.sort=="function"?e.sort:ov;if(e.insertDroppableFirst){var o=r.filter(function(g){return g.droppable}),a=r.filter(function(g){return!g.droppable});e.sort===!1?i=Z(Z([],o,!0),a,!0):(o=o.sort(s),a=a.sort(s),i=Z(Z([],o,!0),a,!0))}else e.sort!==!1&&(i=r.sort(s));var l=yv(n),c=l[0],u=l[1],d=l[2];t.parentId===e.rootId&&Oe(u,e.rootId,e)&&d(n);var h=Sv(t.parentId,c),f=e.rootProps||{},p=e.listComponent;return z.createElement(p,le({ref:n,role:"list"},f,{className:h}),i.map(function(g,b){return z.createElement(z.Fragment,{key:g.id},z.createElement(Co,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId,index:b}),z.createElement(Dv,{id:g.id,depth:t.depth}))}),z.createElement(Co,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId}))},Cv={height:"100%",left:0,pointerEvents:"none",position:"fixed",top:0,width:"100%",zIndex:100},Ev=function(t){var e=t.clientOffset;if(!e)return{};var n=e.x,r=e.y,i="translate(".concat(n,"px, ").concat(r,"px)");return{pointerEvents:"none",transform:i}},Pv=function(){var t=Ae(),e=Tv(),n=e.isDragging,r=e.clientOffset;return!n||!r?null:z.createElement("div",{style:Cv},z.createElement("div",{style:Ev(e)},t.dragPreviewRender&&t.dragPreviewRender(e)))};function Ov(t,e){return z.createElement(gv,le({},t,{treeRef:e}),t.dragPreviewRender&&z.createElement(Pv,null),z.createElement(Mr,{parentId:t.rootId,depth:0}))}var Iv=v.forwardRef(Ov);const Av="_root_71whx_1",Mv="_isSelected_71whx_10",Rv="_expandIconWrapper_71whx_13",Nv="_isOpen_71whx_25",kv="_labelGridItem_71whx_29",dt={root:Av,isSelected:Mv,expandIconWrapper:Rv,isOpen:Nv,labelGridItem:kv},Lv=t=>{var i,s,o,a;const e=t.depth*24,n=l=>{l.stopPropagation(),t.onToggle(t.node.id)},r=()=>t.onSelect(t.node);return m.jsxs("div",{className:`tree-node ${dt.root} ${t.isSelected?dt.isSelected:""} ${(i=t.node.data)!=null&&i.marked?"bg-gray-200":""}`,style:{paddingInlineStart:e},onClick:r,children:[m.jsx("div",{className:`${dt.expandIconWrapper} ${t.isOpen?dt.isOpen:""}`,children:t.node.droppable&&m.jsx("div",{onClick:n,children:m.jsx(cc,{size:18})})}),m.jsxs("div",{className:"flex items-center gap-2",children:[((s=t.node.data)==null?void 0:s.isNavigation)&&((o=t.node.data)!=null&&o.visible?m.jsx(uc,{className:"size-5"}):m.jsx(dc,{className:"size-5"})),m.jsx(an,{name:((a=t.node.data)==null?void 0:a.icon)??"folder"})]}),m.jsx("div",{className:dt.labelGridItem,children:m.jsx("span",{children:t.node.text})}),t.loading&&m.jsx(Be,{className:"size-4 animate-spin"})]})},Vv="_root_ahb0f_1",jv="_icon_ahb0f_15",_v="_label_ahb0f_16",tr={root:Vv,icon:jv,label:_v},Bv=t=>{var n;const e=t.monitorProps.item;return m.jsxs("div",{className:`${tr.root} bg-chart-1/60`,children:[m.jsx("div",{className:tr.icon,children:m.jsx(an,{name:((n=e.data)==null?void 0:n.icon)??"folder"})}),m.jsx("div",{className:tr.label,children:e.text})]})},Fv="_app_gsniw_1",zv="_draggingSource_gsniw_9",Uv="_placeholderContainer_gsniw_13",nr={app:Fv,draggingSource:zv,placeholderContainer:Uv},Hv="_root_1hoix_1",$v={root:Hv},Wv=t=>{const e=t.depth*24;return m.jsx("div",{className:`${$v.root} bg-chart-3`,style:{left:e}})},zl=v.createContext({messages:{},setMessages:()=>{}}),Gv=({type:t,callback:e,parentId:n,isNavigation:r,...i})=>{const[s,o]=v.useState(!1),[a,l]=v.useState(!1),c=async u=>{try{(await W.post("",{data:{record:u,parentId:n,targetBlank:s,visible:a,_method:"select",type:t},_method:"createItem"})).data&&e()}catch(d){console.log(d)}};return m.jsxs("div",{className:"p-8",children:[m.jsxs("div",{className:"flex gap-4 flex-col",children:[m.jsxs("div",{className:`grid gap-4 ${i.items.length?"":"opacity-50 pointer-events-none"}`,children:[m.jsx(De,{children:i.labels.selectTitle}),m.jsxs(Rr,{onValueChange:c,children:[m.jsx(Nr,{className:"w-full max-w-[170px] cursor-pointer",children:m.jsx(kr,{placeholder:i.labels.selectTitle})}),m.jsx(Lr,{className:"z-[1003]",children:i.items.map(u=>m.jsx(Vr,{value:u.id.toString(),children:u.name},`${u.id}-${u.name}`))})]})]}),r&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex gap-4 items-center",children:[m.jsx(on,{id:"targetBlank",checked:s,onCheckedChange:u=>o(!!u),className:"cursor-pointer size-5"}),m.jsx(De,{htmlFor:"targetBlank",children:i.labels.openInNewWindow})]}),m.jsxs("div",{className:"flex gap-4 items-center",children:[m.jsx(on,{id:"visible",checked:a,onCheckedChange:u=>l(!!u),className:"cursor-pointer size-5"}),m.jsx(De,{htmlFor:"visible",children:i.labels.visible})]})]})]}),m.jsx("div",{className:"mt-8",children:m.jsx("span",{children:m.jsx("b",{children:i.labels.OR})})}),m.jsxs(we,{className:"mt-8",onClick:()=>i.add(i.model),children:[m.jsx(Eo,{}),i.labels.createTitle]})]})},Xt=({update:t=!1,type:e,parentId:n,...r})=>{const[i,s]=v.useState({}),[o,a]=v.useState(!1),[l,c]=v.useState(!1),[u,d]=v.useState(!1);v.useEffect(()=>{console.log(r)},[]),v.useEffect(()=>{r.item?(s({name:r.item.name||"",...Object.fromEntries(r.items.map(p=>[p.name,r.item?r.item[p.name]:""]))}),a(r.item.targetBlank||!1),c(r.item.visible||!1)):(s({name:"",...Object.fromEntries(r.items.map(p=>[p.name,""]))}),a(!1),c(!1))},[r.item,r.items]);const h=p=>{const{name:g,value:b}=p.target;s(y=>({...y,[g]:b}))},f=async p=>{var g,b;p.preventDefault(),d(!0);try{let y=null;t?(y=await W.put("",{type:(g=r.item)==null?void 0:g.type,modelId:(b=r.item)==null?void 0:b.id,data:{...r.item,...i,targetBlank:o,visible:l},_method:"updateItem"}),r.callback(y.data.data)):(await W.post("",{data:{...i,targetBlank:o,visible:l,parentId:n,type:e},_method:"createItem"}),r.callback(null))}catch(y){console.error(y)}finally{d(!1)}};return m.jsxs("div",{className:"p-8",children:[m.jsxs("form",{className:"grid gap-6",id:"group-add",onSubmit:f,children:[m.jsxs("div",{className:"flex gap-4 items-center",children:[m.jsx(on,{id:"targetBlank",checked:o,onCheckedChange:p=>a(!!p),className:"cursor-pointer size-5"}),m.jsx(De,{htmlFor:"targetBlank",children:r.labels.openInNewWindow})]}),m.jsxs("div",{className:"flex gap-4 items-center",children:[m.jsx(on,{id:"visible",checked:l,onCheckedChange:p=>c(!!p),className:"cursor-pointer size-5"}),m.jsx(De,{htmlFor:"visible",children:r.labels.visible})]}),m.jsxs("div",{className:"grid gap-4",children:[m.jsx(De,{htmlFor:"name",children:r.labels.title}),m.jsx(rr,{required:!0,value:i.name||"",name:"name",placeholder:r.labels.title,onChange:h})]}),r.items.map(p=>m.jsxs("div",{className:"grid gap-4",children:[m.jsx(De,{children:p.name}),m.jsx(rr,{required:p.required,value:i[p.name]||"",name:p.name,placeholder:p.name,onChange:h})]},p.name))]}),m.jsxs(we,{className:"mt-8 w-fit",form:"group-add",type:"submit",disabled:u,children:[r.labels.save,u&&m.jsx(Be,{className:"h-4 w-4 animate-spin ml-2"})]})]})},qv=({items:t,onSelect:e})=>{const n=v.useContext(zl),[r,i]=v.useState(""),s=o=>{i(o),e(o),i("")};return m.jsxs("div",{className:"p-8",children:[m.jsx(De,{className:"mb-4",children:n.messages["Select Item type"]}),m.jsxs(Rr,{onValueChange:s,value:r,children:[m.jsx(Nr,{className:"w-full max-w-[170px] cursor-pointer",children:m.jsx(kr,{placeholder:n.messages["Select Ids"]})}),m.jsx(Lr,{className:"z-[1005]",children:t.map(o=>m.jsx(Vr,{value:o.type,children:o.name},`${o.type}-${o.name}`))})]})]})},Kv=({dialogRef:t,PopupEvent:e,firstRender:n,secondRender:r,popupType:i,addProps:s,editModel:o,popUpTargetBlank:a,popUpVisible:l,isNavigation:c,messages:u,DynamicComponent:d,DynamicActionComponent:h,addLinksGroupProps:f,reloadCatalog:p,itemType:g,parentid:b,addItemProps:y,getAddModelJSON:T,addModel:S,items:E,selectCatalogItem:w})=>m.jsxs(hc,{ref:t,children:[m.jsx(fc,{}),m.jsxs(pc,{children:[m.jsx(Rn,{children:m.jsxs("div",{className:"relative h-full",children:[e==="create"&&m.jsxs(m.Fragment,{children:[n&&m.jsx(Be,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}),m.jsx(qv,{items:E,onSelect:w})]}),e==="update"&&m.jsx("div",{className:"h-full overflow-y-auto mt-5",children:n?m.jsx(Be,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}):m.jsxs(m.Fragment,{children:[i==="model"&&m.jsx(Vi,{page:s,catalog:!0,callback:o,openNewWindowLabel:u["Open in a new window"],visibleLable:u.Visible,openNewWindow:a,DnavVisible:l,isNavigation:c}),i==="navigation.group"&&m.jsx(Xt,{callback:O=>{var k;(k=t.current)==null||k.close(),p(O)},update:!0,type:"group",...f}),i==="navigation.link"&&m.jsx(Xt,{callback:O=>{var k;(k=t.current)==null||k.close(),p(O)},update:!0,type:"link",...f}),i==="component"&&m.jsx(m.Fragment,{children:d})]})}),e==="action"&&m.jsx(m.Fragment,{children:h})]})}),m.jsx(Rn,{children:m.jsxs("div",{className:"relative h-full",children:[r&&m.jsx(Be,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}),e==="create"&&m.jsxs(m.Fragment,{children:[i==="model"&&m.jsx(Gv,{add:T,callback:()=>{var O;(O=t.current)==null||O.close(),p(null)},type:g??"",parentId:b,isNavigation:c,...y}),i==="navigation.group"&&m.jsx(Xt,{callback:O=>{var k;(k=t.current)==null||k.close(),p(O)},type:"group",parentId:b,...f}),i==="navigation.link"&&m.jsx(Xt,{callback:O=>{var k;(k=t.current)==null||k.close(),p(O)},type:"link",parentId:b,...f}),i==="component"&&m.jsx(m.Fragment,{children:d})]})]})}),m.jsx(Rn,{children:m.jsx("div",{className:"h-full overflow-y-auto mt-5",children:m.jsx(Vi,{page:s,catalog:!0,callback:S,openNewWindowLabel:u["Open in a new window"],visibleLable:u.Visible,isNavigation:c})})})]})]}),Xv=()=>{var Ri;const t=v.useRef(null),e=v.useRef(null),[n,r]=v.useState([]),[i,s]=v.useState([]),[o,a]=v.useState({catalogId:"",catalogName:"",catalogSlug:"",idList:[],nodes:[],movingGroupsRootOnly:!1}),[l,c]=v.useState([]),[u,d]=v.useState({}),[h,f]=v.useState(!1),p=v.useRef(null),[g,b]=v.useState({items:[],model:"",labels:{}}),[y,T]=v.useState({items:[],labels:{}}),[S,E]=v.useState(""),[w,O]=v.useState(null),[k,R]=v.useState(null),[U,_]=v.useState(null),[J,de]=v.useState(0),[Pn,Lt]=v.useState(!1),[wi,Di]=v.useState(!1),[q,ce]=v.useState(!1),[it,We]=v.useState(null),[Ul,Hl]=v.useState(null),[st,$l]=v.useState([]),[On,Ci]=v.useState([]),[Wl,Ei]=v.useState(!1),[Gl,In]=v.useState(!1),[ql,Pi]=v.useState({props:{actions:[],btnBack:{link:"",title:""},btnSave:{title:""},edit:!1,fields:[],notFound:"",postLink:"",search:"",view:!1}}),[Kl,Me]=v.useState(!1),[Xl,Oi]=v.useState(!1);v.useEffect(()=>{const x=async()=>{const A=await W.post("",{_method:"getCatalog"}),{catalog:M,items:C,toolsActions:V}=A.data;a(M),c(C),r(M.nodes),$l(V),ce(M.catalogSlug==="navigation")},P=async()=>{let A=await W.post("",{_method:"getLocales"});d(A.data.data)};(async()=>{try{f(!0),await P(),await x()}catch(A){console.error("Error initializing catalog:",A)}finally{f(!1)}})()},[]);const Ii=x=>{i.find(D=>D.id===x.id)?(de(0),s(i.filter(D=>D.id!==x.id))):(de(x.id),s([...i,x]))},Yl=x=>{x.target===x.currentTarget&&s([])},Zl=v.useCallback(async(x,{dragSourceId:P,dropTargetId:D})=>{var A;try{const M=x.find(j=>j.id===P),C=D||0,V={data:{reqNode:[{id:M==null?void 0:M.id,parent:C,text:M==null?void 0:M.text,data:M==null?void 0:M.data}],reqParent:{id:C,children:x.filter(j=>j.parent===C).map(j=>({id:j.id,text:j.text,data:j.data})),data:C===0?{id:0}:(A=x.find(j=>j.id===C))==null?void 0:A.data}},_method:"updateTree"};r(x),await W.put("",V)}catch(M){console.error("Error updating tree:",M)}},[n]),An=v.useCallback(async(x,P)=>{if(P)try{O(x);const D=n.find(C=>C.id===x),M=(await W.post("",{data:D,_method:"getChilds"})).data.data;r(C=>{const V=new Set(C.map(F=>F.id)),j=M.filter(F=>!V.has(F.id));return j.length===0?C:[...C,...j]})}catch(D){console.error("Error loading child nodes:",D)}finally{O(null)}},[n]),Jl=v.useCallback(async()=>{try{const x=await W.post("",{_method:"getCatalog"}),{catalog:P}=x.data;r(D=>{const A=new Map(D.map(j=>[j.id,j])),M=P.nodes,C=D.map(j=>{const F=M.find(Re=>Re.id===j.id);return F&&F.text!==j.text?F:j}),V=M.filter(j=>{var F;return!A.has(j.id)||((F=A.get(j.id))==null?void 0:F.text)!==j.text});return V.length===0&&C.length===D.length&&C.every((j,F)=>j===D[F])?D:[...C,...V]})}catch(x){console.error("Error reloading catalog:",x)}},[]),Vt=v.useCallback(async x=>{var P,D;x?r(A=>A.map(M=>M.id===x.id?{...M,text:x.name,data:{...M.data,...x}}:M)):(P=i[0])!=null&&P.droppable?((D=t.current)==null||D.open(i[0].id),await An(i[0].id,!0)):await Jl()},[i,An,r]),Ql=v.useCallback(async x=>{var D;R(x),Me(!0);const P=await W.post("",{type:x,_method:"getAddTemplate"});tc(P.data),(D=p.current)==null||D.next(),Me(!1)},[J]),Ai=v.useCallback(async()=>{var x,P,D,A,M,C;try{Me(!0);const V=await W.post("",{type:(P=(x=i[0])==null?void 0:x.data)==null?void 0:P.type,modelId:((A=(D=i[0])==null?void 0:D.data)==null?void 0:A.modelId)??null,id:(C=(M=i[0])==null?void 0:M.data)==null?void 0:C.id,_method:"getEditTemplate"});if(V.data)if(V.data.type.includes("navigation"))switch(V.data.type){case"navigation.group":T(V.data.data),E("navigation.group"),Me(!1);break;case"navigation.link":T(V.data.data),E("navigation.link"),Me(!1);break}else switch(V.data.type){case"model":const j=V.data.data.item,F=await W.get(`${window.routePrefix}/model/${j.type}/edit/${j.modelId}?without_layout=true`);Pi(F.data),Lt(j.targetBlank),Di(j.visible),E("model"),Me(!1);break;default:(async()=>{const jt=(await import(V.data.data.path)).default;We(m.jsx(jt,{callback:_t=>{var ot;(ot=p.current)==null||ot.close(),Vt(_t)},update:!0,item:V.data.data.item},`${V.data.data.id}-${V.data.data.item.name}`))})(),E("component"),Me(!1);break}}catch(V){console.log(V)}},[i]),ec=v.useCallback(async()=>{if(i.length)try{for(const x of i)if((await W.delete("",{data:x})).data.data.ok){let D=[...n];const A=(M,C)=>{let V=C.filter(F=>F.id!==M);return C.filter(F=>F.parent===M).forEach(F=>{V=A(F.id,V)}),V};i.forEach(M=>{D=A(M.id,D)}),r(D)}}catch(x){console.error("Error deleting node:",x)}finally{s([]),de(0)}},[i,n]),tc=v.useCallback(x=>{if(x.type.includes("navigation"))switch(x.type){case"model":b(x.data),E("model");break;case"navigation.group":T(x.data),E("navigation.group");break;case"navigation.link":T(x.data),E("navigation.link");break}else switch(x.type){case"model":b(x.data),E("model");break;default:(async()=>{const A=(await import(x.data.path)).default;We(m.jsx(A,{parentId:J,callback:M=>{var C;(C=p.current)==null||C.close(),Vt(M)}},JSON.stringify(new Date)))})(),E("component");break}},[i,q]),nc=v.useCallback(async x=>{var D;Oi(!0);const P=await W.get(`${window.routePrefix}/model/${x}/add?without_layout=true'`);Pi(P.data),(D=p.current)==null||D.next(),Oi(!1)},[k]),rc=async(x,P,D)=>{var A;P&&(x.targetBlank=P),D&&(x.visible=D);try{await W.post("",{data:{record:x,parentId:J,type:k},_method:"createItem"})}catch(M){console.log(M)}finally{(A=p.current)==null||A.close(),Vt()}},ic=v.useCallback(async(x,P,D)=>{var A,M,C,V,j,F,Re;P&&(x[0].targetBlank=P),D&&(x[0].visible=D),x[0].treeId=(M=(A=i[0])==null?void 0:A.data)==null?void 0:M.id;try{const ge=await W.put("",{type:(V=(C=i[0])==null?void 0:C.data)==null?void 0:V.type,data:{record:x[0]},modelId:(F=(j=i[0])==null?void 0:j.data)==null?void 0:F.modelId,_method:"updateItem"});r(jt=>{const{modelId:_t,type:ot,name:lc}=ge.data.data;return _t===void 0||ot===void 0?(console.warn("No modelId or type in response!"),jt):jt.map(at=>{var Ni,ki;return((Ni=at.data)==null?void 0:Ni.modelId)===_t&&((ki=at.data)==null?void 0:ki.type)===ot?{...at,text:lc,data:{...at.data,...ge.data.data,visible:ge.data.data.visible??!1}}:at})})}catch(ge){console.error("Error updating model:",ge)}finally{(Re=p.current)==null||Re.close()}},[i,r,n]),Mi=async x=>{if(s([]),In(!0),!x.trim()){const P=await W.post("",{_method:"getCatalog"}),{catalog:D}=P.data;r(D.nodes),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var A,M;t.current&&((M=(A=t.current).closeAll)==null||M.call(A),In(!1))})});return}try{const P=await W.post("",{s:x,_method:"search"});r(P.data.data),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var D,A;t.current&&((A=(D=t.current).openAll)==null||A.call(D),In(!1))})})}catch(P){console.error("Error searching:",P)}},sc=Ac(Mi,500),oc=v.useCallback((x,P)=>{if(x){const D=i.some(A=>A.id===P.id);s([]),D||(Ii(P),ac(P))}},[]),ac=v.useCallback(async x=>{var P,D;Ci([]),Ei(!0);try{const A=await W.post("",{items:[x],type:"context",_method:"getActions"});A.data&&((D=(P=A==null?void 0:A.data)==null?void 0:P.data)!=null&&D.length)&&Ci(A.data.data)}catch(A){console.error(A)}finally{Ei(!1)}},[]),Mn=v.useCallback(async x=>{var A,M;const P=st.find(C=>C.id===x)??On.find(C=>C.id===x);if(!P)return;let D=null;switch(P.type){case"link":try{D=await W.put("",{actionId:P.id,_method:"getLink"}),D.data&&((A=window.open(`${D.data.data}`,"_blank"))==null||A.focus())}catch(V){console.error(V)}break;case"basic":let C={actionID:P.id,items:i,data:""};try{Li.warning(u["Performing an action..."]),await W.put("",{data:C,_method:"handleAction"})}catch(V){console.error(V)}finally{Li.success(u["Action completed"])}break;case"external":try{const V=await W.put("",{actionId:P.id,_method:"getPopUpTemplate"});V.data&&((async()=>{const Re=(await import(V.data.data)).default;Hl(m.jsx(Re,{items:i,callback:()=>{var ge;(ge=p.current)==null||ge.close()}},JSON.stringify(i)))})(),(M=p.current)==null||M.open(),_("action"))}catch(V){console.error(V)}break}},[st,i,On]);return m.jsx(m.Fragment,{children:h?m.jsxs(m.Fragment,{children:[m.jsx(Nn,{className:"h-12 w-1/4 rounded-md"}),m.jsx(Nn,{className:"h-12 w-full rounded-md"}),m.jsx(Nn,{className:"h-full w-full rounded-md"})]}):m.jsxs(zl.Provider,{value:{messages:u,setMessages:d},children:[m.jsx(gc,{position:"top-center",richColors:!0,closeButton:!0}),m.jsxs("div",{className:"flex gap-8 items-center mb-4",children:[m.jsx("h1",{className:"text-[28px] leading-[36px] text-foreground",children:u[o.catalogName]}),o.idList.length>0&&m.jsxs(Rr,{defaultValue:o.catalogId,onValueChange:x=>{mc.get(`${window.routePrefix}/catalog/${o.catalogSlug}/${x}`)},children:[m.jsx(Nr,{className:"w-full max-w-[170px] cursor-pointer",children:m.jsx(kr,{placeholder:u["Select Ids"]})}),m.jsx(Lr,{children:o.idList.map(x=>m.jsx(Vr,{value:x,children:x},x))})]})]}),m.jsxs("div",{className:"xl:gap-10 justify-between flex flex-col xl:flex-row gap-3.5",children:[m.jsxs("div",{className:"flex gap-2 items-center",children:[m.jsxs("div",{className:"flex gap-2 items-center flex-wrap md:flex-nowrap",children:[m.jsxs(we,{variant:"default",size:"sm",className:`w-fit rounded-sm ${i.length===0||i.length===1&&((Ri=i[0])!=null&&Ri.droppable)?"":"opacity-50 pointer-events-none"}`,onClick:()=>{var x;_("create"),(x=p.current)==null||x.open()},children:[m.jsx(Eo,{}),u.create]}),m.jsxs(we,{variant:"outline",size:"sm",className:`w-fit cursor-pointer rounded-sm ${i.length>1||!i.length?"opacity-50 pointer-events-none":""}`,onClick:()=>{var x;Ai(),_("update"),(x=p.current)==null||x.open()},children:[m.jsx(vc,{}),u.Edit]}),m.jsx(Mc,{btnTitle:u.Delete,ref:e,variant:"destructive",btnCLass:`w-fit text-white hover ${i.length?"":"opacity-50 pointer-events-none"}`,delModal:{yes:u.Yes,no:u.No,text:u["Are you sure?"]},isLink:!1,handleDelete:ec}),m.jsxs(we,{variant:"secondary",size:"sm",className:`w-fit cursor-pointer rounded-sm ${i.length?"":"opacity-50 pointer-events-none"}`,onClick:()=>{de(0),s([])},children:[m.jsx(yc,{}),u.Clean]})]}),m.jsxs("div",{className:"ml-4",children:[m.jsx("div",{className:"hidden lg:flex gap-2",children:st.map(x=>m.jsxs(we,{variant:"outline",size:"sm",onClick:()=>Mn(x.id),children:[m.jsx(an,{name:x.icon}),x.name]},x.id))}),st.length>0&&m.jsx("div",{className:"block lg:hidden",children:m.jsxs(bc,{children:[m.jsx(xc,{asChild:!0,children:m.jsx(we,{variant:"outline",size:"icon",children:m.jsx(Tc,{})})}),m.jsx(Sc,{className:"w-fit",side:"right",align:"start",children:m.jsx(wc,{className:"grid gap-2",children:st.map(x=>m.jsxs(we,{variant:"outline",size:"sm",onClick:()=>Mn(x.id),children:[m.jsx(an,{name:x.icon}),x.name]},x.id))})})]})})]})]}),m.jsxs("div",{className:"flex gap-2 items-center justify-start xl:justify-end",children:[Gl&&m.jsx(Be,{className:"size-4 animate-spin order-2 xl:order-1"}),m.jsx(rr,{type:"search",autoFocus:!1,placeholder:u.Search,className:"w-[200px] p-2 border rounded order-1 xl:order-2",onChange:x=>{sc(x.target.value)},onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Mi(x.currentTarget.value))}})]})]}),m.jsx("div",{className:"h-full",children:m.jsx(lm,{backend:Um,options:fv(),children:m.jsx("div",{className:nr.app,children:m.jsx(Iv,{ref:t,tree:n,rootId:0,render:(x,{depth:P,isOpen:D,onToggle:A})=>{var M;return m.jsxs(Dc,{onOpenChange:C=>oc(C,x),children:[m.jsx(Cc,{children:m.jsx(Lv,{node:x,depth:P,isOpen:D,loading:w===x.id,isSelected:!!i.find(C=>C.id===x.id),onToggle:C=>{A(),An(C,!D)},onSelect:Ii})}),m.jsxs(Ec,{children:[m.jsx(Bt,{className:`${(M=i[0])!=null&&M.droppable?"":"opacity-50 pointer-events-none"}`,onClick:()=>{var C;_("create"),(C=p.current)==null||C.open()},children:u.create}),m.jsx(Bt,{onClick:()=>{var C;Ai(),_("update"),(C=p.current)==null||C.open()},children:u.Edit}),m.jsx(Bt,{variant:"destructive",onClick:()=>{var C;document.body.removeAttribute("style"),(C=e.current)==null||C.click()},className:i.length?"":"opacity-50 pointer-events-none",children:u.Delete}),Wl?m.jsx(Be,{className:"mx-auto size-3 animate-spin"}):On.map(C=>m.jsx(Bt,{onClick:()=>Mn(C.id),children:C.name},C.id))]})]})},dropTargetOffset:5,insertDroppableFirst:!1,classes:{draggingSource:nr.draggingSource,dropTarget:"bg-chart-1/30",placeholder:nr.placeholderContainer,root:"py-4"},canDrop:(x,{dragSource:P,dropTargetId:D})=>{if((P==null?void 0:P.parent)===D)return!0},sort:!1,dragPreviewRender:x=>m.jsx(Bv,{monitorProps:x}),onDrop:Zl,placeholderRender:(x,{depth:P})=>m.jsx(Wv,{node:x,depth:P}),rootProps:{onClick:Yl}})})})}),m.jsx(Kv,{dialogRef:p,PopupEvent:U,firstRender:Kl,secondRender:Xl,popupType:S,addProps:ql,editModel:ic,popUpTargetBlank:Pn,popUpVisible:wi,isNavigation:q,messages:u,DynamicComponent:it,DynamicActionComponent:Ul,addLinksGroupProps:y,reloadCatalog:Vt,itemType:k,parentid:J,addItemProps:g,getAddModelJSON:nc,addModel:rc,items:l,selectCatalogItem:Ql})]})})},Yv=[];function Ty(){return m.jsx(Pc,{breadcrumbs:Yv,children:m.jsx("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:m.jsx(Xv,{})})})}export{Ty as default};