@yoopta/ui 6.0.0-beta.21 → 6.0.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-menu-list.js +1 -1
- package/dist/block-options.js +1 -1
- package/dist/chunks/floating-ui.react-0f8b5c36.js +5 -0
- package/dist/chunks/{floating-ui.react-dom-59d096f1.js → floating-ui.react-dom-dc823237.js} +1 -1
- package/dist/element-options.js +3 -3
- package/dist/floating-toolbar.js +1 -1
- package/dist/highlight-color-picker.js +1 -1
- package/dist/index.js +1 -1
- package/dist/overlay.js +1 -1
- package/dist/portal.js +1 -1
- package/dist/slash-command-menu.js +1 -1
- package/package.json +3 -4
- package/LICENSE +0 -21
- package/dist/chunks/floating-ui.react-993d5ee4.js +0 -5
package/dist/action-menu-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./chunks/_tslib-29461875.js";import{jsx as o,jsxs as i,Fragment as e}from"react/jsx-runtime";import{createContext as n,useContext as a,forwardRef as r,useRef as s,useEffect as l,useState as u,useMemo as p,useCallback as c,isValidElement as d,cloneElement as m}from"react";import{b as y,F as g,u as h,c as v,d as f}from"./chunks/floating-ui.react-993d5ee4.js";import{Blocks as b,getAllowedPluginsFromElement as x,getRootBlockElement as w,useYooptaEditor as k}from"@yoopta/editor";import{s as j}from"./chunks/style-inject.es-e87a8d02.js";import{Overlay as N}from"./overlay.js";import{l as O,s as z,o as A,j as F}from"./chunks/floating-ui.react-dom-59d096f1.js";import"react-dom";const M=n(null),S=()=>{const t=a(M);if(!t)throw new Error("ActionMenuList components must be used within <ActionMenuList>");return t};function C(t){const o=Object.keys(t.plugins);let i=null;if("number"==typeof t.path.current){const o=b.getBlockSlate(t,{at:t.path.current});o&&(i=x(t,o))}let e=o;return i&&i.length>0&&(e="string"==typeof o[0]?o.filter(t=>i.includes(t)):o.filter(t=>i.includes(t.type))),e.map(o=>{var i,e,n,a,r,s;if("string"==typeof o){return{type:o,title:(null===(e=null===(i=t.plugins[o].options)||void 0===i?void 0:i.display)||void 0===e?void 0:e.title)||o,description:null===(a=null===(n=t.plugins[o].options)||void 0===n?void 0:n.display)||void 0===a?void 0:a.description,icon:null===(s=null===(r=t.plugins[o].options)||void 0===r?void 0:r.display)||void 0===s?void 0:s.icon}}return o})}function E(t,o){var i;const e=t.plugins[o];if(!e)return!1;const n=w(e.elements);return"void"!==(null===(i=null==n?void 0:n.props)||void 0===i?void 0:i.nodeType)}j(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}.yoopta-ui-action-menu-list-overlay{background:transparent;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list{bottom:auto;left:0;margin:0;position:absolute;right:auto;top:0;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list-content{background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-radius,.5rem);box-shadow:var(--yoopta-ui-action-menu-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1));max-height:var(--yoopta-ui-action-menu-max-height,330px);overflow-x:hidden;overflow-y:auto;padding:var(--yoopta-ui-action-menu-padding,.5rem);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-ui-action-menu-list-group{color:hsl(var(--yoopta-ui-foreground));overflow:hidden;padding:0}.yoopta-ui-action-menu-list-item{align-items:center;background:transparent;border:none;border-radius:var(--yoopta-ui-action-menu-item-radius,.375rem);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-action-menu-item-font-size,.875rem);gap:var(--yoopta-ui-action-menu-item-gap,.5rem);margin-bottom:.125rem;outline:none;padding:var(--yoopta-ui-action-menu-item-padding,.5rem);text-align:left;transition:background-color .15s ease-out;width:100%}.yoopta-ui-action-menu-list-item:last-child{margin-bottom:0}.yoopta-ui-action-menu-list-item:hover,.yoopta-ui-action-menu-list-item[data-selected=true]{background:hsl(var(--yoopta-ui-accent))}.yoopta-ui-action-menu-list-item:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-action-menu-list-item-icon{align-items:center;background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-icon-radius,.375rem);display:flex;flex-shrink:0;justify-content:center}.yoopta-ui-action-menu-list-item-icon img,.yoopta-ui-action-menu-list-item-icon svg{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.yoopta-ui-action-menu-list-item-content{flex:1;min-width:0}.yoopta-ui-action-menu-list-item-title{font-weight:500;line-height:1.25}.yoopta-ui-action-menu-list-item-description{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-item-description-font-size,.75rem);line-height:1.25;margin-top:.125rem;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoopta-ui-action-menu-list-empty{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-empty-font-size,.75rem);padding:var(--yoopta-ui-action-menu-empty-padding,.5rem);text-align:left}.yoopta-ui-action-menu-list-small{max-height:280px;min-width:180px;padding:.375rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item{font-size:.8125rem;gap:.375rem;padding:.375rem .5rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-icon{height:20px;padding:2px;width:20px}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-title{font-size:.8125rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-description{display:none}.yoopta-ui-action-menu-list-default{min-width:244px}.yoopta-ui-action-menu-list-default .yoopta-ui-action-menu-list-item-icon{height:40px;padding:6px;width:40px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar{width:8px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-track{background:transparent}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb{background:hsl(var(--yoopta-ui-border));border-radius:4px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb:hover{background:hsl(var(--yoopta-ui-muted-foreground))}");const L=({children:t,open:i,onOpenChange:e,defaultOpen:n=!1,anchor:a=null,view:r="default",placement:s="bottom-start",className:d=""})=>{const m=k(),[y,g]=u(n),b=void 0!==i,x=b?i:y,j=p(()=>{if(!x)return[];return C(m).filter(t=>E(m,t.type)).filter(t=>{var o,i,e;const n=m.plugins[t.type],a=w(n.elements);return"inline"!==(null===(o=null==a?void 0:a.props)||void 0===o?void 0:o.nodeType)&&"inlineVoid"!==(null===(i=null==a?void 0:a.props)||void 0===i?void 0:i.nodeType)&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType)})},[m,x]),[N,S]=u(null);l(()=>{j.length>0&&S(j[0])},[j]);const L=c(t=>{b||g(t),null==e||e(t)},[b,e]),{refs:P,floatingStyles:$,context:T}=h({elements:{reference:a},placement:s,open:x,onOpenChange:L,middleware:[O(),z(),A(10)],whileElementsMounted:F}),B=v(T,{escapeKey:!0,outsidePress:!1}),{getFloatingProps:I}=f([B]),R=p(()=>Object.assign(Object.assign({},$),{minWidth:"small"===r?200:244}),[$,r]),D=c(()=>{var t;L(!1),S(null!==(t=j[0])&&void 0!==t?t:null)},[L,j]),G=c(t=>{Array.isArray(m.path.selected)&&m.path.selected.length>0?m.batchOperations(()=>{m.path.selected.forEach(o=>{m.toggleBlock(t,{preserveContent:!0,focus:!0,at:o})})}):m.toggleBlock(t,{preserveContent:!0,focus:!0,at:m.path.current}),D()},[m,D]),q=p(()=>({isOpen:x,view:r,actions:j,selectedAction:N,setSelectedAction:S,onSelect:G,close:D,floatingStyles:R,setFloatingRef:P.setFloating,getFloatingProps:I}),[x,r,j,N,G,D,R,P.setFloating,I]),K={actions:j,selectedAction:N,onSelect:G,empty:0===j.length},V="function"==typeof t?t(K):t;return o(M.Provider,Object.assign({value:q},{children:o("div",Object.assign({className:d},{children:V}))}))};L.displayName="ActionMenuList";const P=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);const{isOpen:u,floatingStyles:p,setFloatingRef:c,actions:d,selectedAction:m,setSelectedAction:h,onSelect:v,view:f,close:b,getFloatingProps:x}=S(),w=s(null),j=y([e,c,w]),O=k();if(l(()=>{let t;return u&&w.current&&(t=requestAnimationFrame(()=>{var t;null===(t=w.current)||void 0===t||t.focus()})),()=>cancelAnimationFrame(t)},[u]),!u)return null;const z=null!=n?n:0===d.length?o(B,{}):o($,{children:d.map(t=>o(T,{action:t,selected:t.type===(null==m?void 0:m.type),onMouseEnter:()=>h(t),onClick:()=>v(t.type)},t.type))});return o(g,Object.assign({root:O.refElement,id:`yoopta-ui-action-menu-list-portal-${O.id}`},{children:o(N,Object.assign({lockScroll:!1,onClick:b,className:"yoopta-ui-action-menu-list-overlay"},{children:o("div",Object.assign({ref:j,role:"listbox",tabIndex:0,className:`yoopta-ui-action-menu-list-content yoopta-ui-action-menu-list-${f} ${a}`,style:p},x({onMouseDown:t=>{t.preventDefault(),t.stopPropagation()},onClick:t=>t.stopPropagation()}),r,{children:z}))}))}))});P.displayName="ActionMenuList.Content";const $=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);return o("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-group ${a}`},r,{children:n}))});$.displayName="ActionMenuList.Group";const T=r((n,a)=>{var{action:r,selected:s,icon:l,className:u="",children:p}=n,c=t(n,["action","selected","icon","className","children"]);const y=null!=l?l:null==r?void 0:r.icon;return i("button",Object.assign({ref:a,type:"button",className:`yoopta-ui-action-menu-list-item ${s?"selected":""} ${u}`,"data-action-menu-item-type":null==r?void 0:r.type,"data-selected":s,"aria-pressed":s},c,{children:[r&&i(e,{children:[y&&o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-icon"},{children:(t=>{if(!t)return null;if("string"==typeof t)return o("img",{src:t,alt:"icon"});if(d(t))return m(t);return o(t,{})})(y)})),i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-content"},{children:[o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-title"},{children:null==r?void 0:r.title})),(null==r?void 0:r.description)&&o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-description"},{children:null==r?void 0:r.description}))]}))]}),p]}))});T.displayName="ActionMenuList.Item";const B=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);return o("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-empty ${a}`},r,{children:null!=n?n:"No actions available"}))});B.displayName="ActionMenuList.Empty";const I=Object.assign(L,{Root:L,Content:P,Group:$,Item:T,Empty:B});export{I as ActionMenuList,E as filterToggleActions,C as mapActionMenuItems,S as useActionMenuListContext};
|
|
1
|
+
import{a as t}from"./chunks/_tslib-29461875.js";import{jsx as o,jsxs as i,Fragment as e}from"react/jsx-runtime";import{createContext as n,useContext as a,forwardRef as r,useRef as s,useEffect as l,useState as u,useMemo as p,useCallback as c,isValidElement as d,cloneElement as m}from"react";import{b as y,F as g,u as h,c as v,d as f}from"./chunks/floating-ui.react-0f8b5c36.js";import{Blocks as b,getAllowedPluginsFromElement as x,getRootBlockElement as w,useYooptaEditor as k}from"@yoopta/editor";import{s as j}from"./chunks/style-inject.es-e87a8d02.js";import{Overlay as N}from"./overlay.js";import{l as O,s as z,o as A,j as F}from"./chunks/floating-ui.react-dom-dc823237.js";import"react-dom";const M=n(null),S=()=>{const t=a(M);if(!t)throw new Error("ActionMenuList components must be used within <ActionMenuList>");return t};function C(t){const o=Object.keys(t.plugins);let i=null;if("number"==typeof t.path.current){const o=b.getBlockSlate(t,{at:t.path.current});o&&(i=x(t,o))}let e=o;return i&&i.length>0&&(e="string"==typeof o[0]?o.filter(t=>i.includes(t)):o.filter(t=>i.includes(t.type))),e.map(o=>{var i,e,n,a,r,s;if("string"==typeof o){return{type:o,title:(null===(e=null===(i=t.plugins[o].options)||void 0===i?void 0:i.display)||void 0===e?void 0:e.title)||o,description:null===(a=null===(n=t.plugins[o].options)||void 0===n?void 0:n.display)||void 0===a?void 0:a.description,icon:null===(s=null===(r=t.plugins[o].options)||void 0===r?void 0:r.display)||void 0===s?void 0:s.icon}}return o})}function E(t,o){var i;const e=t.plugins[o];if(!e)return!1;const n=w(e.elements);return"void"!==(null===(i=null==n?void 0:n.props)||void 0===i?void 0:i.nodeType)}j(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}.yoopta-ui-action-menu-list-overlay{background:transparent;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list{bottom:auto;left:0;margin:0;position:absolute;right:auto;top:0;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list-content{background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-radius,.5rem);box-shadow:var(--yoopta-ui-action-menu-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1));max-height:var(--yoopta-ui-action-menu-max-height,330px);overflow-x:hidden;overflow-y:auto;padding:var(--yoopta-ui-action-menu-padding,.5rem);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-ui-action-menu-list-group{color:hsl(var(--yoopta-ui-foreground));overflow:hidden;padding:0}.yoopta-ui-action-menu-list-item{align-items:center;background:transparent;border:none;border-radius:var(--yoopta-ui-action-menu-item-radius,.375rem);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-action-menu-item-font-size,.875rem);gap:var(--yoopta-ui-action-menu-item-gap,.5rem);margin-bottom:.125rem;outline:none;padding:var(--yoopta-ui-action-menu-item-padding,.5rem);text-align:left;transition:background-color .15s ease-out;width:100%}.yoopta-ui-action-menu-list-item:last-child{margin-bottom:0}.yoopta-ui-action-menu-list-item:hover,.yoopta-ui-action-menu-list-item[data-selected=true]{background:hsl(var(--yoopta-ui-accent))}.yoopta-ui-action-menu-list-item:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-action-menu-list-item-icon{align-items:center;background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-icon-radius,.375rem);display:flex;flex-shrink:0;justify-content:center}.yoopta-ui-action-menu-list-item-icon img,.yoopta-ui-action-menu-list-item-icon svg{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.yoopta-ui-action-menu-list-item-content{flex:1;min-width:0}.yoopta-ui-action-menu-list-item-title{font-weight:500;line-height:1.25}.yoopta-ui-action-menu-list-item-description{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-item-description-font-size,.75rem);line-height:1.25;margin-top:.125rem;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoopta-ui-action-menu-list-empty{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-empty-font-size,.75rem);padding:var(--yoopta-ui-action-menu-empty-padding,.5rem);text-align:left}.yoopta-ui-action-menu-list-small{max-height:280px;min-width:180px;padding:.375rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item{font-size:.8125rem;gap:.375rem;padding:.375rem .5rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-icon{height:20px;padding:2px;width:20px}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-title{font-size:.8125rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-description{display:none}.yoopta-ui-action-menu-list-default{min-width:244px}.yoopta-ui-action-menu-list-default .yoopta-ui-action-menu-list-item-icon{height:40px;padding:6px;width:40px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar{width:8px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-track{background:transparent}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb{background:hsl(var(--yoopta-ui-border));border-radius:4px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb:hover{background:hsl(var(--yoopta-ui-muted-foreground))}");const L=({children:t,open:i,onOpenChange:e,defaultOpen:n=!1,anchor:a=null,view:r="default",placement:s="bottom-start",className:d=""})=>{const m=k(),[y,g]=u(n),b=void 0!==i,x=b?i:y,j=p(()=>{if(!x)return[];return C(m).filter(t=>E(m,t.type)).filter(t=>{var o,i,e;const n=m.plugins[t.type],a=w(n.elements);return"inline"!==(null===(o=null==a?void 0:a.props)||void 0===o?void 0:o.nodeType)&&"inlineVoid"!==(null===(i=null==a?void 0:a.props)||void 0===i?void 0:i.nodeType)&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType)})},[m,x]),[N,S]=u(null);l(()=>{j.length>0&&S(j[0])},[j]);const L=c(t=>{b||g(t),null==e||e(t)},[b,e]),{refs:P,floatingStyles:$,context:T}=h({elements:{reference:a},placement:s,open:x,onOpenChange:L,middleware:[O(),z(),A(10)],whileElementsMounted:F}),B=v(T,{escapeKey:!0,outsidePress:!1}),{getFloatingProps:I}=f([B]),R=p(()=>Object.assign(Object.assign({},$),{minWidth:"small"===r?200:244}),[$,r]),D=c(()=>{var t;L(!1),S(null!==(t=j[0])&&void 0!==t?t:null)},[L,j]),G=c(t=>{Array.isArray(m.path.selected)&&m.path.selected.length>0?m.batchOperations(()=>{m.path.selected.forEach(o=>{m.toggleBlock(t,{preserveContent:!0,focus:!0,at:o})})}):m.toggleBlock(t,{preserveContent:!0,focus:!0,at:m.path.current}),D()},[m,D]),q=p(()=>({isOpen:x,view:r,actions:j,selectedAction:N,setSelectedAction:S,onSelect:G,close:D,floatingStyles:R,setFloatingRef:P.setFloating,getFloatingProps:I}),[x,r,j,N,G,D,R,P.setFloating,I]),K={actions:j,selectedAction:N,onSelect:G,empty:0===j.length},V="function"==typeof t?t(K):t;return o(M.Provider,Object.assign({value:q},{children:o("div",Object.assign({className:d},{children:V}))}))};L.displayName="ActionMenuList";const P=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);const{isOpen:u,floatingStyles:p,setFloatingRef:c,actions:d,selectedAction:m,setSelectedAction:h,onSelect:v,view:f,close:b,getFloatingProps:x}=S(),w=s(null),j=y([e,c,w]),O=k();if(l(()=>{let t;return u&&w.current&&(t=requestAnimationFrame(()=>{var t;null===(t=w.current)||void 0===t||t.focus()})),()=>cancelAnimationFrame(t)},[u]),!u)return null;const z=null!=n?n:0===d.length?o(B,{}):o($,{children:d.map(t=>o(T,{action:t,selected:t.type===(null==m?void 0:m.type),onMouseEnter:()=>h(t),onClick:()=>v(t.type)},t.type))});return o(g,Object.assign({root:O.refElement,id:`yoopta-ui-action-menu-list-portal-${O.id}`},{children:o(N,Object.assign({lockScroll:!1,onClick:b,className:"yoopta-ui-action-menu-list-overlay"},{children:o("div",Object.assign({ref:j,role:"listbox",tabIndex:0,className:`yoopta-ui-action-menu-list-content yoopta-ui-action-menu-list-${f} ${a}`,style:p},x({onMouseDown:t=>{t.preventDefault(),t.stopPropagation()},onClick:t=>t.stopPropagation()}),r,{children:z}))}))}))});P.displayName="ActionMenuList.Content";const $=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);return o("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-group ${a}`},r,{children:n}))});$.displayName="ActionMenuList.Group";const T=r((n,a)=>{var{action:r,selected:s,icon:l,className:u="",children:p}=n,c=t(n,["action","selected","icon","className","children"]);const y=null!=l?l:null==r?void 0:r.icon;return i("button",Object.assign({ref:a,type:"button",className:`yoopta-ui-action-menu-list-item ${s?"selected":""} ${u}`,"data-action-menu-item-type":null==r?void 0:r.type,"data-selected":s,"aria-pressed":s},c,{children:[r&&i(e,{children:[y&&o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-icon"},{children:(t=>{if(!t)return null;if("string"==typeof t)return o("img",{src:t,alt:"icon"});if(d(t))return m(t);return o(t,{})})(y)})),i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-content"},{children:[o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-title"},{children:null==r?void 0:r.title})),(null==r?void 0:r.description)&&o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-description"},{children:null==r?void 0:r.description}))]}))]}),p]}))});T.displayName="ActionMenuList.Item";const B=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);return o("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-empty ${a}`},r,{children:null!=n?n:"No actions available"}))});B.displayName="ActionMenuList.Empty";const I=Object.assign(L,{Root:L,Content:P,Group:$,Item:T,Empty:B});export{I as ActionMenuList,E as filterToggleActions,C as mapActionMenuItems,S as useActionMenuListContext};
|
package/dist/block-options.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunks/_tslib-29461875.js";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{createContext as a,useContext as e,forwardRef as n,useCallback as p,isValidElement as r,cloneElement as s,useState as l,useMemo as c}from"react";import{b as u,u as d,a as b,c as y,d as g,F as k,e as m,f as x}from"./chunks/floating-ui.react-
|
|
1
|
+
import{a as o}from"./chunks/_tslib-29461875.js";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{createContext as a,useContext as e,forwardRef as n,useCallback as p,isValidElement as r,cloneElement as s,useState as l,useMemo as c}from"react";import{b as u,u as d,a as b,c as y,d as g,F as k,e as m,f as x}from"./chunks/floating-ui.react-0f8b5c36.js";import{useYooptaEditor as h}from"@yoopta/editor";import{s as f}from"./chunks/style-inject.es-e87a8d02.js";import{Overlay as v}from"./overlay.js";import{o as w,l as O,s as j,j as N}from"./chunks/floating-ui.react-dom-dc823237.js";import"react-dom";const B=a(null),C=()=>{const o=e(B);if(!o)throw new Error("BlockOptions components must be used within <BlockOptions>");return o};f(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}:root{--yoopta-ui-block-options-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-block-options-radius:0.5rem;--yoopta-ui-block-options-padding:4px;--yoopta-ui-block-options-min-width:220px;--yoopta-ui-block-options-z-index:200;--yoopta-ui-block-options-group-gap:1px;--yoopta-ui-block-options-button-padding-y:8px;--yoopta-ui-block-options-button-padding-x:12px;--yoopta-ui-block-options-button-font-size:0.875rem;--yoopta-ui-block-options-button-line-height:1.25rem;--yoopta-ui-block-options-button-bg:transparent;--yoopta-ui-block-options-button-radius:0.375rem;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-block-options-icon-size:1rem;--yoopta-ui-block-options-icon-gap:8px;--yoopta-ui-block-options-separator-height:1px;--yoopta-ui-block-options-separator-margin:4px 0;--yoopta-ui-block-options-transition:color 0.15s ease-in-out,background-color 0.15s ease-in-out,border-color 0.15s ease-in-out,box-shadow 0.15s ease-in-out}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-block-options-shadow:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3)}.yoopta-ui-block-options{background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-block-options-radius);box-shadow:var(--yoopta-ui-block-options-shadow);min-width:var(--yoopta-ui-block-options-min-width);padding:var(--yoopta-ui-block-options-padding);position:fixed;z-index:var(--yoopta-ui-block-options-z-index)}.yoopta-ui-block-options-content{display:flex;flex-direction:column;gap:var(--yoopta-ui-block-options-group-gap)}.yoopta-ui-block-options-group{display:flex;flex-direction:column;gap:1px}.yoopta-ui-block-options-button{align-items:center;background-color:hsl(var(--yoopta-ui-background));border:none;border-radius:var(--yoopta-ui-block-options-button-radius);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-block-options-button-font-size);font-weight:400;line-height:var(--yoopta-ui-block-options-button-line-height);outline:none;padding:var(--yoopta-ui-block-options-button-padding-y) var(--yoopta-ui-block-options-button-padding-x);text-align:left;transition:var(--yoopta-ui-block-options-transition);-moz-user-select:none;user-select:none;-webkit-user-select:none;width:100%}.yoopta-ui-block-options-button:active,.yoopta-ui-block-options-button:hover{background-color:hsl(var(--yoopta-ui-accent))}.yoopta-ui-block-options-button:focus-visible{box-shadow:0 0 0 2px hsl(var(--yoopta-ui-background)),0 0 0 4px hsl(var(--yoopta-ui-ring));outline:none}.yoopta-ui-block-options-button:disabled{opacity:.5;pointer-events:none}.yoopta-ui-block-options-button-destructive{color:hsl(var(--yoopta-ui-destructive))}.yoopta-ui-block-options-button-icon{align-items:center;display:inline-flex;flex-shrink:0;justify-content:center;margin-right:var(--yoopta-ui-block-options-icon-gap)}.yoopta-ui-block-options-button-icon svg{height:var(--yoopta-ui-block-options-icon-size);width:var(--yoopta-ui-block-options-icon-size)}.yoopta-ui-block-options-button-text{flex:1}.yoopta-ui-block-options-separator{background-color:hsl(var(--yoopta-ui-border));height:var(--yoopta-ui-block-options-separator-height);margin:var(--yoopta-ui-block-options-separator-margin)}");const z=({children:o,open:i,onOpenChange:a,defaultOpen:e=!1,anchor:n=null})=>{const[r,s]=l(e),[u,d]=l(null),b=x(),y=void 0!==i,g=y?i:r,k=null!=n?n:u,m=p(o=>{y||s(o),null==a||a(o)},[y,a]),h=c(()=>({open:g,onOpenChange:m,triggerRef:k,setTriggerRef:d,contentId:b}),[g,m,k,b]);return t(B.Provider,Object.assign({value:h},{children:o}))};z.displayName="BlockOptions";const $=n(({children:o,asChild:i=!1,className:a=""},e)=>{const{open:n,onOpenChange:l,setTriggerRef:c,contentId:d}=C(),b=p(o=>{o.stopPropagation(),l(!n)},[n,l]),y={ref:u([e,c]),onClick:b,"aria-expanded":n,"aria-haspopup":"menu","aria-controls":n?d:void 0};return i&&r(o)?s(o,y):t("button",Object.assign({type:"button",className:`yoopta-ui-block-options-trigger ${a}`},y,{children:o}))});$.displayName="BlockOptions.Trigger";const I=n(({children:o,className:i="",style:a,side:e="right",align:n="start",sideOffset:p=5},r)=>{const{open:s,onOpenChange:l,triggerRef:c,contentId:x}=C(),f=h(),B="center"===n?e:`${e}-${n}`,{refs:z,floatingStyles:$,context:I}=d({elements:{reference:c},placement:B,open:s,onOpenChange:l,middleware:[w(p),O(),j({padding:8})],whileElementsMounted:N,strategy:"fixed"}),{isMounted:E,styles:P}=b(I,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),S=y(I,{outsidePress:!0,escapeKey:!0}),{getFloatingProps:T}=g([S]),R=u([z.setFloating,r]);return E?t(k,Object.assign({root:f.refElement,id:`yoopta-ui-block-options-portal-${f.id}`},{children:t(v,Object.assign({lockScroll:!0,onClick:()=>l(!1)},{children:t(m,Object.assign({context:I,modal:!1},{children:t("div",Object.assign({ref:R,id:x,role:"menu","aria-orientation":"vertical",className:`yoopta-ui-block-options ${i}`,style:Object.assign(Object.assign(Object.assign({},$),P),a),contentEditable:!1},T({onClick:o=>o.stopPropagation(),onMouseDown:o=>o.stopPropagation()}),{children:o}))}))}))})):null});I.displayName="BlockOptions.Content";const E=n(({children:o,className:i=""},a)=>t("div",Object.assign({ref:a,role:"group",className:`yoopta-ui-block-options-group ${i}`},{children:o})));E.displayName="BlockOptions.Group";const P=n((a,e)=>{var{children:n,onSelect:r,className:s="",disabled:l,icon:c,variant:u="default",keepOpen:d=!1}=a,b=o(a,["children","onSelect","className","disabled","icon","variant","keepOpen"]);const{onOpenChange:y}=C(),g=p(o=>{l||(null==r||r(o),d||y(!1))},[l,r,y,d]);return i("button",Object.assign({ref:e,type:"button",role:"menuitem",disabled:l,className:`yoopta-ui-block-options-button yoopta-ui-block-options-button-${u} ${s}`,onClick:g},b,{children:[c&&t("span",Object.assign({className:"yoopta-ui-block-options-button-icon"},{children:c})),t("span",Object.assign({className:"yoopta-ui-block-options-button-text"},{children:n}))]}))});P.displayName="BlockOptions.Item";const S=n(({className:o=""},i)=>t("div",{ref:i,role:"separator",className:`yoopta-ui-block-options-separator ${o}`}));S.displayName="BlockOptions.Separator";const T=n(({children:o,className:i=""},a)=>t("div",Object.assign({ref:a,className:`yoopta-ui-block-options-label ${i}`},{children:o})));T.displayName="BlockOptions.Label";const R=Object.assign(z,{Root:z,Trigger:$,Content:I,Group:E,Item:P,Separator:S,Label:T}),D=()=>{const o=h();return{duplicateBlock:p(t=>{if(!t)throw new Error("Block ID is required to duplicate block");o.duplicateBlock({blockId:t,focus:!0})},[o]),copyBlockLink:p(t=>{var i;if(!t)throw new Error("Block ID is required to copy block link");const a=o.children[t];if(a){const t=`${window.location.origin}${window.location.pathname}#${a.id}`;if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(t);else{const o=document.createElement("textarea");o.value=t,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)}null===(i=o.emit)||void 0===i||i.call(o,"block:copy",a)}},[o]),deleteBlock:p(t=>{if(!t)throw new Error("Block ID is required to delete block");o.deleteBlock({blockId:t}),o.setPath({current:null})},[o])}};export{R as BlockOptions,D as useBlockActions,C as useBlockOptionsContext};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import*as e from"react";import{useLayoutEffect as t,useEffect as n,useRef as r}from"react";import{i as o,a as i,b as u,g as c,u as l,c as s,d as a,e as f,f as d,h as p}from"./floating-ui.react-dom-dc823237.js";import*as v from"react-dom";function m(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function h(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function g(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function y(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function b(e){return!y().includes("jsdom/")&&(!E()&&0===e.width&&0===e.height||E()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function E(){const e=/android/i;return e.test(g())||e.test(y())}function w(e){return(null==e?void 0:e.ownerDocument)||document}function R(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function x(e){return"composedPath"in e?e.composedPath()[0]:e.target}function S(e){e.preventDefault(),e.stopPropagation()}function A(e){return!!e&&("combobox"===e.getAttribute("role")&&function(e){return i(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}(e))}
|
|
2
|
+
/*!
|
|
3
|
+
* tabbable 6.4.0
|
|
4
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
|
+
*/var k=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),C="undefined"==typeof Element,O=C?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,M=!C&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},L=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):L(e.parentNode))},P=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!L(i,!1))if("SLOT"===i.tagName){var u=i.assignedElements(),c=u.length?u:i.children,l=P(c,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{O.call(i,k)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var s=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!L(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(s&&a){var f=P(!0===s?i.children:s.children,!0,n);n.flatten?r.push.apply(r,f):r.push({scopeParent:i,candidates:f})}else o.unshift.apply(o,i.children)}}return r},I=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},T=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!I(e)?0:e.tabIndex},N=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},D=function(e){return"INPUT"===e.tagName},F=function(e){return function(e){return D(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||M(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},j=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},q=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=O.call(e,"details>summary:first-of-type")?e.parentElement:e;if(O.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return j(e)}else{if("function"==typeof r){for(var i=e;e;){var u=e.parentElement,c=M(e);if(u&&!u.shadowRoot&&!0===r(u))return j(e);e=e.assignedSlot?e.assignedSlot:u||c===e.ownerDocument?u:c.host}e=i}if(function(e){var t,n,r,o,i=e&&M(e),u=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=u)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(u)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&u;){var l,s,a;c=!(null===(s=u=null===(l=i=M(u))||void 0===l?void 0:l.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(u))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},W=function(e,t){return!(t.disabled||function(e){return D(e)&&"hidden"===e.type}(t)||q(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!O.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},B=function(e,t){return!(F(t)||T(t)<0||!W(e,t))},K=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},V=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,u=function(e,t){var n=T(e);return n<0&&t&&!I(e)?0:n}(i,o),c=o?V(e.candidates):i;0===u?o?t.push.apply(t,c):t.push(i):n.push({documentOrder:r,tabIndex:u,item:e,isScope:o,content:c})}),n.sort(N).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},_=function(e,t){var n;return n=(t=t||{}).getShadowRoot?P([e],t.includeContainer,{filter:B.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:K}):function(e,t,n){if(L(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(k));return t&&O.call(e,k)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,B.bind(null,t)),V(n)};function H(t){return e.useMemo(()=>t.every(e=>null==e)?null:e=>{t.forEach(t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)})},t)}const U={...e},z=U.useInsertionEffect||(e=>e());function X(t){const n=e.useRef(()=>{});return z(()=>{n.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)},[])}var Y="undefined"!=typeof document?t:n;function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z.apply(this,arguments)}let $=!1,G=0;const J=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+G++;const Q=U.useId||function(){const[t,n]=e.useState(()=>$?J():void 0);return Y(()=>{null==t&&n(J())},[]),e.useEffect(()=>{$=!0},[]),t};const ee=e.createContext(null),te=e.createContext(null),ne=()=>e.useContext(te);function re(e){return"data-floating-ui-"+e}function oe(e){const t=r(e);return Y(()=>{t.current=e}),t}let ie=0;function ue(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(ie);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():ie=requestAnimationFrame(i)}function ce(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),r=n;for(;r.length;)r=e.filter(e=>{var t;return null==(t=r)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(r);return n}let le=new WeakMap,se=new WeakSet,ae={},fe=0;const de=e=>e&&(e.host||de(e.parentNode));function pe(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=(c=t,e.map(e=>{if(c.contains(e))return e;const t=de(e);return c.contains(t)?t:null}).filter(e=>null!=e));var c;const l=new Set,a=new Set(u),f=[];ae[o]||(ae[o]=new WeakMap);const d=ae[o];return u.forEach(function e(t){if(!t||l.has(t))return;l.add(t),t.parentNode&&e(t.parentNode)}),function e(t){if(!t||a.has(t))return;[].forEach.call(t.children,t=>{if("script"!==s(t))if(l.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(le.get(t)||0)+1,u=(d.get(t)||0)+1;le.set(t,r),d.set(t,u),f.push(t),1===r&&n&&se.add(t),1===u&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}})}(t),l.clear(),fe++,()=>{f.forEach(e=>{const t=(le.get(e)||0)-1,n=(d.get(e)||0)-1;le.set(e,t),d.set(e,n),t||(!se.has(e)&&i&&e.removeAttribute(i),se.delete(e)),n||e.removeAttribute(o)}),fe--,fe||(le=new WeakMap,le=new WeakMap,se=new WeakSet,ae={})}}function ve(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=w(e[0]).body;return pe(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const me=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function he(e,t){const n=_(e,me());"prev"===t&&n.reverse();const r=n.indexOf(m(w(e)));return n.slice(r+1)[0]}function ge(){return he(document.body,"next")}function ye(){return he(document.body,"prev")}function be(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!h(n,r)}function Ee(e){_(e,me()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function we(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const Re={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function xe(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const Se=e.forwardRef(function(t,n){const[r,o]=e.useState();Y(()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",xe),()=>{document.removeEventListener("keydown",xe)}),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[re("focus-guard")]:"",style:Re};return e.createElement("span",Z({},t,i))}),Ae=e.createContext(null),ke=re("portal");function Ce(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,c=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=Q(),i=Oe(),[c,l]=e.useState(null),s=e.useRef(null);return Y(()=>()=>{null==c||c.remove(),queueMicrotask(()=>{s.current=null})},[c]),Y(()=>{if(!o)return;if(s.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(ke,""),e.appendChild(t),s.current=t,l(t)},[n,o]),Y(()=>{if(null===r)return;if(!o)return;if(s.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!u(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const c=document.createElement("div");c.id=o,c.setAttribute(ke,""),e=t||e,e.appendChild(c),s.current=c,l(c)},[n,r,o,i]),c}({id:r,root:o}),[l,s]=e.useState(null),a=e.useRef(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=null==l?void 0:l.modal,h=null==l?void 0:l.open,g=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return e.useEffect(()=>{if(c&&i&&!m)return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&be(e)){("focusin"===e.type?we:Ee)(c)}}},[c,i,m]),e.useEffect(()=>{c&&(h||we(c))},[h,c]),e.createElement(Ae.Provider,{value:e.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:p,portalNode:c,setFocusManagerState:s}),[i,c])},g&&c&&e.createElement(Se,{"data-type":"outside",ref:a,onFocus:e=>{if(be(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=ye()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),g&&c&&e.createElement("span",{"aria-owns":c.id,style:Re}),c&&v.createPortal(n,c),g&&c&&e.createElement(Se,{"data-type":"outside",ref:f,onFocus:e=>{if(be(e,c)){var t;null==(t=p.current)||t.focus()}else{const t=ge()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Oe=()=>e.useContext(Ae),Me="data-floating-ui-focusable";let Le=[];function Pe(e){Le=Le.filter(e=>e.isConnected);let t=e;if(t&&"body"!==s(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==O.call(e,k)&&B(t,e)}(t,me())){const e=_(t,me())[0];e&&(t=e)}Le.push(t),Le.length>20&&(Le=Le.slice(-20))}}function Ie(){return Le.slice().reverse().find(e=>e.isConnected)}const Te=e.forwardRef(function(t,n){return e.createElement("button",Z({},t,{type:"button",ref:n,tabIndex:-1,style:Re}))});function Ne(t){const{context:n,children:r,disabled:o=!1,order:u=["content"],guards:c=!0,initialFocus:l=0,returnFocus:s=!0,restoreFocus:a=!1,modal:f=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:p=!0}=t,{open:v,refs:g,nodeId:y,onOpenChange:R,events:k,dataRef:C,floatingId:O,elements:{domReference:M,floating:L}}=n,P="number"==typeof l&&l<0,I=A(M)&&P,T="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||c,N=oe(u),D=oe(l),F=oe(s),j=ne(),q=Oe(),W=e.useRef(null),B=e.useRef(null),K=e.useRef(!1),V=e.useRef(!1),H=e.useRef(-1),U=null!=q,z=(Z=L)?Z.hasAttribute(Me)?Z:Z.querySelector("["+Me+"]")||Z:null;var Z;const $=X(function(e){return void 0===e&&(e=z),e?_(e,me()):[]}),G=X(e=>{const t=$(e);return N.current.map(e=>M&&"reference"===e?M:z&&"floating"===e?z:t).filter(Boolean).flat()});function J(t){return!o&&d&&f?e.createElement(Te,{ref:"start"===t?W:B,onClick:e=>R(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}e.useEffect(()=>{if(o)return;if(!f)return;function e(e){if("Tab"===e.key){h(z,m(w(z)))&&0===$().length&&!I&&S(e);const t=G(),n=x(e);"reference"===N.current[0]&&n===M&&(S(e),e.shiftKey?ue(t[t.length-1]):ue(t[1])),"floating"===N.current[1]&&n===z&&e.shiftKey&&(S(e),ue(t[0]))}}const t=w(z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[o,M,z,f,N,I,$,G]),e.useEffect(()=>{if(!o&&L)return L.addEventListener("focusin",e),()=>{L.removeEventListener("focusin",e)};function e(e){const t=x(e),n=$().indexOf(t);-1!==n&&(H.current=n)}},[o,L,$]),e.useEffect(()=>{if(!o&&p)return L&&i(M)?(M.addEventListener("focusout",t),M.addEventListener("pointerdown",e),L.addEventListener("focusout",t),()=>{M.removeEventListener("focusout",t),M.removeEventListener("pointerdown",e),L.removeEventListener("focusout",t)}):void 0;function e(){V.current=!0,setTimeout(()=>{V.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(h(M,t)||h(L,t)||h(t,L)||h(null==q?void 0:q.portalNode,t)||null!=t&&t.hasAttribute(re("focus-guard"))||j&&(ce(j.nodesRef.current,y).find(e=>{var n,r;return h(null==(n=e.context)?void 0:n.elements.floating,t)||h(null==(r=e.context)?void 0:r.elements.domReference,t)})||function(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(j.nodesRef.current,y).find(e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t})));if(a&&n&&m(w(z))===w(z).body){i(z)&&z.focus();const e=H.current,t=$(),n=t[e]||t[t.length-1]||z;i(n)&&n.focus()}!I&&f||!t||!n||V.current||t===Ie()||(K.current=!0,R(!1,e,"focus-out"))})}},[o,M,L,z,f,y,j,q,R,p,a,$,I]),e.useEffect(()=>{var e;if(o)return;const t=Array.from((null==q||null==(e=q.portalNode)?void 0:e.querySelectorAll("["+re("portal")+"]"))||[]);if(L){const e=[L,...t,W.current,B.current,N.current.includes("reference")||I?M:null].filter(e=>null!=e),n=f||I?ve(e,T,!T):ve(e);return()=>{n()}}},[o,M,L,f,N,q,I,T]),Y(()=>{if(o||!i(z))return;const e=m(w(z));queueMicrotask(()=>{const t=G(z),n=D.current,r=("number"==typeof n?t[n]:n.current)||z,o=h(z,e);P||o||!v||ue(r,{preventScroll:r===z})})},[o,v,z,P,G,D]),Y(()=>{if(o||!z)return;let e=!1;const t=w(z),n=m(t);let r=C.current.openEvent;function u(t){let{open:n,reason:o,event:i,nested:u}=t;n&&(r=i),"escape-key"===o&&g.domReference.current&&Pe(g.domReference.current),"hover"===o&&"mouseleave"===i.type&&(K.current=!0),"outside-press"===o&&(u?(K.current=!1,e=!0):K.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(E()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||b(i)))}Pe(n),k.on("openchange",u);const c=t.createElement("span");return c.setAttribute("tabindex","-1"),c.setAttribute("aria-hidden","true"),Object.assign(c.style,Re),U&&M&&M.insertAdjacentElement("afterend",c),()=>{k.off("openchange",u);const n=m(t),o=h(L,n)||j&&ce(j.nodesRef.current,y).some(e=>{var t;return h(null==(t=e.context)?void 0:t.elements.floating,n)});(o||r&&["click","mousedown"].includes(r.type))&&g.domReference.current&&Pe(g.domReference.current);const l="boolean"==typeof F.current?Ie()||c:F.current.current||c;queueMicrotask(()=>{F.current&&!K.current&&i(l)&&(l===n||n===t.body||o)&&l.focus({preventScroll:e}),c.remove()})}},[o,L,z,F,C,g,k,j,y,U,M]),e.useEffect(()=>{queueMicrotask(()=>{K.current=!1})},[o]),Y(()=>{if(!o&&q)return q.setFocusManagerState({modal:f,closeOnFocusOut:p,open:v,onOpenChange:R,refs:g}),()=>{q.setFocusManagerState(null)}},[o,q,f,v,R,g,p]),Y(()=>{if(o)return;if(!z)return;if("function"!=typeof MutationObserver)return;if(P)return;const e=()=>{const e=z.getAttribute("tabindex"),t=$(),n=m(w(L)),r=t.indexOf(n);-1!==r&&(H.current=r),N.current.includes("floating")||n!==g.domReference.current&&0===t.length?"0"!==e&&z.setAttribute("tabindex","0"):"-1"!==e&&z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[o,L,z,g,N,$,P]);const Q=!o&&T&&(!f||!I)&&(U||f);return e.createElement(e.Fragment,null,Q&&e.createElement(Se,{"data-type":"inside",ref:null==q?void 0:q.beforeInsideRef,onFocus:e=>{if(f){const e=G();ue("reference"===u[0]?e[0]:e[e.length-1])}else if(null!=q&&q.preserveTabOrder&&q.portalNode)if(K.current=!1,be(e,q.portalNode)){const e=ge()||M;null==e||e.focus()}else{var t;null==(t=q.beforeOutsideRef.current)||t.focus()}}}),!I&&J("start"),r,J("end"),Q&&e.createElement(Se,{"data-type":"inside",ref:null==q?void 0:q.afterInsideRef,onFocus:e=>{if(f)ue(G()[0]);else if(null!=q&&q.preserveTabOrder&&q.portalNode)if(p&&(K.current=!0),be(e,q.portalNode)){const e=ye()||M;null==e||e.focus()}else{var t;null==(t=q.afterOutsideRef.current)||t.focus()}}}))}let De=0;let Fe=()=>{};const je=e.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t;return Y(()=>{if(r)return De++,1===De&&(Fe=function(){const e=/iP(hone|ad|od)|iOS/.test(g()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var u,c;const e=(null==(u=window.visualViewport)?void 0:u.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{De--,0===De&&Fe()}},[r]),e.createElement("div",Z({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}),qe={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},We={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Be=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Ke(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:l,dataRef:s}=t,{enabled:v=!0,escapeKey:m=!0,outsidePress:g=!0,outsidePressEvent:y="pointerdown",referencePress:b=!1,referencePressEvent:E="pointerdown",ancestorScroll:S=!1,bubbles:A,capture:k}=n,C=ne(),O=X("function"==typeof g?g:()=>!1),M="function"==typeof g?O:g,L=e.useRef(!1),P=e.useRef(!1),{escapeKey:I,outsidePress:T}=Be(A),{escapeKey:N,outsidePress:D}=Be(k),F=e.useRef(!1),j=X(e=>{var t;if(!r||!v||!m||"Escape"!==e.key)return;if(F.current)return;const n=null==(t=s.current.floatingContext)?void 0:t.nodeId,i=C?ce(C.nodesRef.current,n):[];if(!I&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),q=X(e=>{var t;const n=()=>{var t;j(e),null==(t=x(e))||t.removeEventListener("keydown",n)};null==(t=x(e))||t.addEventListener("keydown",n)}),W=X(e=>{var t;const n=L.current;L.current=!1;const r=P.current;if(P.current=!1,"click"===y&&r)return;if(n)return;if("function"==typeof M&&!M(e))return;const c=x(e),p="["+re("inert")+"]",v=w(l.floating).querySelectorAll(p);let m=u(c)?c:null;for(;m&&!a(m);){const e=f(m);if(a(e)||!u(e))break;m=e}if(v.length&&u(c)&&!c.matches("html,body")&&!h(c,l.floating)&&Array.from(v).every(e=>!h(m,e)))return;if(i(c)&&V){const t=c.clientWidth>0&&c.scrollWidth>c.clientWidth,n=c.clientHeight>0&&c.scrollHeight>c.clientHeight;let r=n&&e.offsetX>c.clientWidth;if(n){"rtl"===d(c).direction&&(r=e.offsetX<=c.offsetWidth-c.clientWidth)}if(r||t&&e.offsetY>c.clientHeight)return}const g=null==(t=s.current.floatingContext)?void 0:t.nodeId,b=C&&ce(C.nodesRef.current,g).some(t=>{var n;return R(e,null==(n=t.context)?void 0:n.elements.floating)});if(R(e,l.floating)||R(e,l.domReference)||b)return;const E=C?ce(C.nodesRef.current,g):[];if(E.length>0){let e=!0;if(E.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}o(!1,e,"outside-press")}),B=X(e=>{var t;const n=()=>{var t;W(e),null==(t=x(e))||t.removeEventListener(y,n)};null==(t=x(e))||t.addEventListener(y,n)});e.useEffect(()=>{if(!r||!v)return;s.current.__escapeKeyBubbles=I,s.current.__outsidePressBubbles=T;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),F.current=!0}function i(){e=window.setTimeout(()=>{F.current=!1},p()?5:0)}const a=w(l.floating);m&&(a.addEventListener("keydown",N?q:j,N),a.addEventListener("compositionstart",n),a.addEventListener("compositionend",i)),M&&a.addEventListener(y,D?B:W,D);let f=[];return S&&(u(l.domReference)&&(f=c(l.domReference)),u(l.floating)&&(f=f.concat(c(l.floating))),!u(l.reference)&&l.reference&&l.reference.contextElement&&(f=f.concat(c(l.reference.contextElement)))),f=f.filter(e=>{var t;return e!==(null==(t=a.defaultView)?void 0:t.visualViewport)}),f.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{m&&(a.removeEventListener("keydown",N?q:j,N),a.removeEventListener("compositionstart",n),a.removeEventListener("compositionend",i)),M&&a.removeEventListener(y,D?B:W,D),f.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[s,l,m,M,y,r,o,S,v,I,T,j,N,q,W,D,B]),e.useEffect(()=>{L.current=!1},[M,y]);const K=e.useMemo(()=>({onKeyDown:j,[qe[E]]:e=>{b&&o(!1,e.nativeEvent,"reference-press")}}),[j,o,b,E]),V=e.useMemo(()=>({onKeyDown:j,onMouseDown(){P.current=!0},onMouseUp(){P.current=!0},[We[y]]:()=>{L.current=!0}}),[j,y]);return e.useMemo(()=>v?{reference:K,floating:V}:{},[v,K,V])}function Ve(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=Q(),u=e.useRef({}),[c]=e.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),l=null!=((null==(s=e.useContext(ee))?void 0:s.id)||null);var s;const[a,f]=e.useState(o.reference),d=X((e,t,n)=>{u.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:l}),null==r||r(e,t,n)}),p=e.useMemo(()=>({setPositionReference:f}),[]),v=e.useMemo(()=>({reference:a||o.reference||null,floating:o.floating||null,domReference:o.reference}),[a,o.reference,o.floating]);return e.useMemo(()=>({dataRef:u,open:n,onOpenChange:d,elements:v,events:c,floatingId:i,refs:p}),[n,d,v,c,i,p])}function _e(t){void 0===t&&(t={});const{nodeId:n}=t,r=Ve({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[c,s]=e.useState(null),[a,f]=e.useState(null),d=(null==i?void 0:i.domReference)||c,p=e.useRef(null),v=ne();Y(()=>{d&&(p.current=d)},[d]);const m=l({...t,elements:{...i,...a&&{reference:a}}}),h=e.useCallback(e=>{const t=u(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f(t),m.refs.setReference(t)},[m.refs]),g=e.useCallback(e=>{(u(e)||null===e)&&(p.current=e,s(e)),(u(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!u(e))&&m.refs.setReference(e)},[m.refs]),y=e.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:p}),[m.refs,g,h]),b=e.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),E=e.useMemo(()=>({...m,...o,refs:y,elements:b,nodeId:n}),[m,y,b,n,o]);return Y(()=>{o.dataRef.current.floatingContext=E;const e=null==v?void 0:v.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),e.useMemo(()=>({...m,context:E,refs:y,elements:b}),[m,y,b,E])}const He="active",Ue="selected";function ze(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[He]:t,[Ue]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Me]:""},...i,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,i]=t;var u;o&&[He,Ue].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(u=r.get(n))||u.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=i)}),e):e,{})}}function Xe(t){void 0===t&&(t=[]);const n=t.map(e=>null==e?void 0:e.reference),r=t.map(e=>null==e?void 0:e.floating),o=t.map(e=>null==e?void 0:e.item),i=e.useCallback(e=>ze(e,t,"reference"),n),u=e.useCallback(e=>ze(e,t,"floating"),r),c=e.useCallback(e=>ze(e,t,"item"),o);return e.useMemo(()=>({getReferenceProps:i,getFloatingProps:u,getItemProps:c}),[i,u,c])}const Ye=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function Ze(e,t){return"function"==typeof e?e(t):e}function $e(t,n){void 0===n&&(n={});const{open:r,elements:{floating:o}}=t,{duration:i=250}=n,u=("number"==typeof i?i:i.close)||0,[c,l]=e.useState("unmounted"),s=function(t,n){const[r,o]=e.useState(t);return t&&!r&&o(!0),e.useEffect(()=>{if(!t&&r){const e=setTimeout(()=>o(!1),n);return()=>clearTimeout(e)}},[t,r,n]),r}(r,u);return s||"close"!==c||l("unmounted"),Y(()=>{if(o){if(r){l("initial");const e=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(e)}}l("close")}},[r,o]),{isMounted:s,status:c}}function Ge(t,n){void 0===n&&(n={});const{initial:r={opacity:0},open:o,close:i,common:u,duration:c=250}=n,l=t.placement,s=l.split("-")[0],a=e.useMemo(()=>({side:s,placement:l}),[s,l]),f="number"==typeof c,d=(f?c:c.open)||0,p=(f?c:c.close)||0,[v,m]=e.useState(()=>({...Ze(u,a),...Ze(r,a)})),{isMounted:h,status:g}=$e(t,{duration:c}),y=oe(r),b=oe(o),E=oe(i),w=oe(u);return Y(()=>{const e=Ze(y.current,a),t=Ze(E.current,a),n=Ze(w.current,a),r=Ze(b.current,a)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===g&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===g&&m({transitionProperty:Object.keys(r).map(Ye).join(","),transitionDuration:d+"ms",...n,...r}),"close"===g){const r=t||e;m({transitionProperty:Object.keys(r).map(Ye).join(","),transitionDuration:p+"ms",...n,...r})}},[p,E,y,b,w,d,g,a]),{isMounted:h,styles:v}}export{Ce as F,Ge as a,H as b,Ke as c,Xe as d,Ne as e,Q as f,je as g,_e as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"react";import{useLayoutEffect as e}from"react";import*as n from"react-dom";function o(){return"undefined"!=typeof window}function r(t){return s(t)?(t.nodeName||"").toLowerCase():"#document"}function i(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function l(t){var e;return null==(e=(s(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function s(t){return!!o()&&(t instanceof Node||t instanceof i(t).Node)}function c(t){return!!o()&&(t instanceof Element||t instanceof i(t).Element)}function a(t){return!!o()&&(t instanceof HTMLElement||t instanceof i(t).HTMLElement)}function f(t){return!(!o()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof i(t).ShadowRoot)}const u=new Set(["inline","contents"]);function d(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=S(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!u.has(r)}const h=new Set(["table","td","th"]);function m(t){return h.has(r(t))}const p=[":popover-open",":modal"];function g(t){return p.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const y=["transform","translate","scale","rotate","perspective"],w=["transform","translate","scale","rotate","perspective","filter"],x=["paint","layout","strict","content"];function v(t){const e=b(),n=c(t)?S(t):t;return y.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||w.some(t=>(n.willChange||"").includes(t))||x.some(t=>(n.contain||"").includes(t))}function b(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const R=new Set(["html","body","#document"]);function A(t){return R.has(r(t))}function S(t){return i(t).getComputedStyle(t)}function L(t){return c(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function T(t){if("html"===r(t))return t;const e=t.assignedSlot||t.parentNode||f(t)&&t.host||l(t);return f(e)?e.host:e}function E(t){const e=T(t);return A(e)?t.ownerDocument?t.ownerDocument.body:t.body:a(e)&&d(e)?e:E(e)}function C(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=E(t),l=r===(null==(o=t.ownerDocument)?void 0:o.body),s=i(r);if(l){const t=D(s);return e.concat(s,s.visualViewport||[],d(r)?r:[],t&&n?C(t):[])}return e.concat(r,C(r,[],n))}function D(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const O=["top","right","bottom","left"],P=Math.min,k=Math.max,F=Math.round,H=Math.floor,M=t=>({x:t,y:t}),W={left:"right",right:"left",bottom:"top",top:"bottom"},B={start:"end",end:"start"};function V(t,e,n){return k(t,P(e,n))}function z(t,e){return"function"==typeof t?t(e):t}function j(t){return t.split("-")[0]}function N(t){return t.split("-")[1]}function $(t){return"x"===t?"y":"x"}function q(t){return"y"===t?"height":"width"}const I=new Set(["top","bottom"]);function _(t){return I.has(j(t))?"y":"x"}function X(t){return $(_(t))}function Y(t){return t.replace(/start|end/g,t=>B[t])}const G=["left","right"],J=["right","left"],K=["top","bottom"],Q=["bottom","top"];function U(t,e,n,o){const r=N(t);let i=function(t,e,n){switch(t){case"top":case"bottom":return n?e?J:G:e?G:J;case"left":case"right":return e?K:Q;default:return[]}}(j(t),"start"===n,o);return r&&(i=i.map(t=>t+"-"+r),e&&(i=i.concat(i.map(Y)))),i}function Z(t){return t.replace(/left|right|bottom|top/g,t=>W[t])}function tt(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function et(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function nt(t,e,n){let{reference:o,floating:r}=t;const i=_(e),l=X(e),s=q(l),c=j(e),a="y"===i,f=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,d=o[s]/2-r[s]/2;let h;switch(c){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:u};break;case"left":h={x:o.x-r.width,y:u};break;default:h={x:o.x,y:o.y}}switch(N(e)){case"start":h[l]-=d*(n&&a?-1:1);break;case"end":h[l]+=d*(n&&a?-1:1)}return h}async function ot(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:l,elements:s,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:h=0}=z(e,t),m=tt(h),p=s[d?"floating"===u?"reference":"floating":u],g=et(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(p)))||n?p:p.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:a,rootBoundary:f,strategy:c})),y="floating"===u?{x:o,y:r,width:l.floating.width,height:l.floating.height}:l.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),x=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},v=et(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:w,strategy:c}):y);return{top:(g.top-v.top+m.top)/x.y,bottom:(v.bottom-g.bottom+m.bottom)/x.y,left:(g.left-v.left+m.left)/x.x,right:(v.right-g.right+m.right)/x.x}}function rt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function it(t){return O.some(e=>t[e]>=0)}function lt(t){const e=P(...t.map(t=>t.left)),n=P(...t.map(t=>t.top));return{x:e,y:n,width:k(...t.map(t=>t.right))-e,height:k(...t.map(t=>t.bottom))-n}}const st=new Set(["left","top"]);function ct(t){const e=S(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=a(t),i=r?t.offsetWidth:n,l=r?t.offsetHeight:o,s=F(n)!==i||F(o)!==l;return s&&(n=i,o=l),{width:n,height:o,$:s}}function at(t){return c(t)?t:t.contextElement}function ft(t){const e=at(t);if(!a(e))return M(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=ct(e);let l=(i?F(n.width):n.width)/o,s=(i?F(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const ut=M(0);function dt(t){const e=i(t);return b()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ut}function ht(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),l=at(t);let s=M(1);e&&(o?c(o)&&(s=ft(o)):s=ft(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==i(t))&&e}(l,n,o)?dt(l):M(0);let f=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,d=r.width/s.x,h=r.height/s.y;if(l){const t=i(l),e=o&&c(o)?i(o):o;let n=t,r=D(n);for(;r&&o&&e!==n;){const t=ft(r),e=r.getBoundingClientRect(),o=S(r),l=e.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;f*=t.x,u*=t.y,d*=t.x,h*=t.y,f+=l,u+=s,n=i(r),r=D(n)}}return et({width:d,height:h,x:f,y:u})}function mt(t,e){const n=L(t).scrollLeft;return e?e.left+n:ht(l(t)).left+n}function pt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-mt(t,n),y:n.top+e.scrollTop}}const gt=new Set(["absolute","fixed"]);function yt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=i(t),o=l(t),r=n.visualViewport;let s=o.clientWidth,c=o.clientHeight,a=0,f=0;if(r){s=r.width,c=r.height;const t=b();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,f=r.offsetTop)}const u=mt(o);if(u<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),r="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-e.clientWidth-r);i<=25&&(s-=i)}else u<=25&&(s+=u);return{width:s,height:c,x:a,y:f}}(t,n);else if("document"===e)o=function(t){const e=l(t),n=L(t),o=t.ownerDocument.body,r=k(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=k(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+mt(t);const c=-n.scrollTop;return"rtl"===S(o).direction&&(s+=k(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}(l(t));else if(c(e))o=function(t,e){const n=ht(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=a(t)?ft(t):M(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=dt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return et(o)}function wt(t,e){const n=T(t);return!(n===e||!c(n)||A(n))&&("fixed"===S(n).position||wt(n,e))}function xt(t,e,n){const o=a(e),i=l(e),s="fixed"===n,c=ht(t,!0,s,e);let f={scrollLeft:0,scrollTop:0};const u=M(0);function h(){u.x=mt(i)}if(o||!o&&!s)if(("body"!==r(e)||d(i))&&(f=L(e)),o){const t=ht(e,!0,s,e);u.x=t.x+e.clientLeft,u.y=t.y+e.clientTop}else i&&h();s&&!o&&i&&h();const m=!i||o||s?M(0):pt(i,f);return{x:c.left+f.scrollLeft-u.x-m.x,y:c.top+f.scrollTop-u.y-m.y,width:c.width,height:c.height}}function vt(t){return"static"===S(t).position}function bt(t,e){if(!a(t)||"fixed"===S(t).position)return null;if(e)return e(t);let n=t.offsetParent;return l(t)===n&&(n=n.ownerDocument.body),n}function Rt(t,e){const n=i(t);if(g(t))return n;if(!a(t)){let e=T(t);for(;e&&!A(e);){if(c(e)&&!vt(e))return e;e=T(e)}return n}let o=bt(t,e);for(;o&&m(o)&&vt(o);)o=bt(o,e);return o&&A(o)&&vt(o)&&!v(o)?n:o||function(t){let e=T(t);for(;a(e)&&!A(e);){if(v(e))return e;if(g(e))return null;e=T(e)}return null}(t)||n}const At={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s="fixed"===i,c=l(o),f=!!e&&g(e.floating);if(o===c||f&&s)return n;let u={scrollLeft:0,scrollTop:0},h=M(1);const m=M(0),p=a(o);if((p||!p&&!s)&&(("body"!==r(o)||d(c))&&(u=L(o)),a(o))){const t=ht(o);h=ft(o),m.x=t.x+o.clientLeft,m.y=t.y+o.clientTop}const y=!c||p||s?M(0):pt(c,u);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-u.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-u.scrollTop*h.y+m.y+y.y}},getDocumentElement:l,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[..."clippingAncestors"===n?g(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=C(t,[],!1).filter(t=>c(t)&&"body"!==r(t)),i=null;const l="fixed"===S(t).position;let s=l?T(t):t;for(;c(s)&&!A(s);){const e=S(s),n=v(s);n||"fixed"!==e.position||(i=null),(l?!n&&!i:!n&&"static"===e.position&&i&>.has(i.position)||d(s)&&!n&&wt(t,s))?o=o.filter(t=>t!==s):i=e,s=T(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=l[0],a=l.reduce((t,n)=>{const o=yt(e,n,i);return t.top=k(o.top,t.top),t.right=P(o.right,t.right),t.bottom=P(o.bottom,t.bottom),t.left=k(o.left,t.left),t},yt(e,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Rt,getElementRects:async function(t){const e=this.getOffsetParent||Rt,n=this.getDimensions,o=await n(t.floating);return{reference:xt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=ct(t);return{width:e,height:n}},getScale:ft,isElement:c,isRTL:function(t){return"rtl"===S(t).direction}};function St(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Lt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,f=at(t),u=r||i?[...f?C(f):[],...C(e)]:[];u.forEach(t=>{r&&t.addEventListener("scroll",n,{passive:!0}),i&&t.addEventListener("resize",n)});const d=f&&c?function(t,e){let n,o=null;const r=l(t);function i(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function l(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),i();const a=t.getBoundingClientRect(),{left:f,top:u,width:d,height:h}=a;if(s||e(),!d||!h)return;const m={rootMargin:-H(u)+"px "+-H(r.clientWidth-(f+d))+"px "+-H(r.clientHeight-(u+h))+"px "+-H(f)+"px",threshold:k(0,P(1,c))||1};let p=!0;function g(e){const o=e[0].intersectionRatio;if(o!==c){if(!p)return l();o?l(!1,o):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==o||St(a,t.getBoundingClientRect())||l(),p=!1}try{o=new IntersectionObserver(g,{...m,root:r.ownerDocument})}catch(t){o=new IntersectionObserver(g,m)}o.observe(t)}(!0),i}(f,n):null;let h,m=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===f&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e)})),n()}),f&&!a&&p.observe(f),p.observe(e));let g=a?ht(t):null;return a&&function e(){const o=ht(t);g&&!St(g,o)&&n();g=o,h=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach(t=>{r&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)}),null==d||d(),null==(t=p)||t.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const Tt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:l,middlewareData:s}=e,c=await async function(t,e){const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=j(n),s=N(n),c="y"===_(n),a=st.has(l)?-1:1,f=i&&c?-1:1,u=z(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*f,y:d*a}:{x:d*a,y:h*f}}(e,t);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:l}}}}},Et=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=z(t,e),a={x:n,y:o},f=await ot(e,c),u=_(j(r)),d=$(u);let h=a[d],m=a[u];if(i){const t="y"===d?"bottom":"right";h=V(h+f["y"===d?"top":"left"],h,h-f[t])}if(l){const t="y"===u?"bottom":"right";m=V(m+f["y"===u?"top":"left"],m,m-f[t])}const p=s.fn({...e,[d]:h,[u]:m});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[d]:i,[u]:l}}}}}},Ct=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:s,platform:c,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=z(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=j(r),w=_(s),x=j(s)===s,v=await(null==c.isRTL?void 0:c.isRTL(a.floating)),b=d||(x||!p?[Z(s)]:function(t){const e=Z(t);return[Y(t),e,Y(e)]}(s)),R="none"!==m;!d&&R&&b.push(...U(s,p,m,v));const A=[s,...b],S=await ot(e,g),L=[];let T=(null==(o=i.flip)?void 0:o.overflows)||[];if(f&&L.push(S[y]),u){const t=function(t,e,n){void 0===n&&(n=!1);const o=N(t),r=X(t),i=q(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(l=Z(l)),[l,Z(l)]}(r,l,v);L.push(S[t[0]],S[t[1]])}if(T=[...T,{placement:r,overflows:L}],!L.every(t=>t<=0)){var E,C;const t=((null==(E=i.flip)?void 0:E.index)||0)+1,e=A[t];if(e){if(!("alignment"===u&&w!==_(e))||T.every(t=>_(t.placement)!==w||t.overflows[0]>0))return{data:{index:t,overflows:T},reset:{placement:e}}}let n=null==(C=T.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:C.placement;if(!n)switch(h){case"bestFit":{var D;const t=null==(D=T.filter(t=>{if(R){const e=_(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:D[0];t&&(n=t);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},Dt=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:i,platform:l,elements:s}=e,{apply:c=()=>{},...a}=z(t,e),f=await ot(e,a),u=j(r),d=N(r),h="y"===_(r),{width:m,height:p}=i.floating;let g,y;"top"===u||"bottom"===u?(g=u,y=d===(await(null==l.isRTL?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,g="end"===d?"top":"bottom");const w=p-f.top-f.bottom,x=m-f.left-f.right,v=P(p-f[g],w),b=P(m-f[y],x),R=!e.middlewareData.shift;let A=v,S=b;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(S=x),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(A=w),R&&!d){const t=k(f.left,0),e=k(f.right,0),n=k(f.top,0),o=k(f.bottom,0);h?S=m-2*(0!==t||0!==e?t+e:k(f.left,f.right)):A=p-2*(0!==n||0!==o?n+o:k(f.top,f.bottom))}await c({...e,availableWidth:S,availableHeight:A});const L=await l.getDimensions(s.floating);return m!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}},Ot=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...r}=z(t,e);switch(o){case"referenceHidden":{const t=rt(await ot(e,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:it(t)}}}case"escaped":{const t=rt(await ot(e,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:it(t)}}}default:return{}}}}},Pt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:i,platform:l,elements:s,middlewareData:c}=e,{element:a,padding:f=0}=z(t,e)||{};if(null==a)return{};const u=tt(f),d={x:n,y:o},h=X(r),m=q(h),p=await l.getDimensions(a),g="y"===h,y=g?"top":"left",w=g?"bottom":"right",x=g?"clientHeight":"clientWidth",v=i.reference[m]+i.reference[h]-d[h]-i.floating[m],b=d[h]-i.reference[h],R=await(null==l.getOffsetParent?void 0:l.getOffsetParent(a));let A=R?R[x]:0;A&&await(null==l.isElement?void 0:l.isElement(R))||(A=s.floating[x]||i.floating[m]);const S=v/2-b/2,L=A/2-p[m]/2-1,T=P(u[y],L),E=P(u[w],L),C=T,D=A-p[m]-E,O=A/2-p[m]/2+S,k=V(C,O,D),F=!c.arrow&&null!=N(r)&&O!==k&&i.reference[m]/2-(O<C?T:E)-p[m]/2<0,H=F?O<C?O-C:O-D:0;return{[h]:d[h]+H,data:{[h]:k,centerOffset:O-k-H,...F&&{alignmentOffset:H}},reset:F}}}),kt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:r,platform:i,strategy:l}=e,{padding:s=2,x:c,y:a}=z(t,e),f=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]),u=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const r=e[t];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map(t=>et(lt(t)))}(f),d=et(lt(f)),h=tt(s);const m=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=c&&null!=a)return u.find(t=>c>t.left-h.left&&c<t.right+h.right&&a>t.top-h.top&&a<t.bottom+h.bottom)||d;if(u.length>=2){if("y"===_(n)){const t=u[0],e=u[u.length-1],o="top"===j(n),r=t.top,i=e.bottom,l=o?t.left:e.left,s=o?t.right:e.right;return{top:r,bottom:i,left:l,right:s,width:s-l,height:i-r,x:l,y:r}}const t="left"===j(n),e=k(...u.map(t=>t.right)),o=P(...u.map(t=>t.left)),r=u.filter(n=>t?n.left===o:n.right===e),i=r[0].top,l=r[r.length-1].bottom;return{top:i,bottom:l,left:o,right:e,width:e-o,height:l-i,x:o,y:i}}return d}},floating:o.floating,strategy:l});return r.reference.x!==m.reference.x||r.reference.y!==m.reference.y||r.reference.width!==m.reference.width||r.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},Ft=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:r,rects:i,middlewareData:l}=e,{offset:s=0,mainAxis:c=!0,crossAxis:a=!0}=z(t,e),f={x:n,y:o},u=_(r),d=$(u);let h=f[d],m=f[u];const p=z(s,e),g="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const t="y"===d?"height":"width",e=i.reference[d]-i.floating[t]+g.mainAxis,n=i.reference[d]+i.reference[t]-g.mainAxis;h<e?h=e:h>n&&(h=n)}if(a){var y,w;const t="y"===d?"width":"height",e=st.has(j(r)),n=i.reference[u]-i.floating[t]+(e&&(null==(y=l.offset)?void 0:y[u])||0)+(e?0:g.crossAxis),o=i.reference[u]+i.reference[t]+(e?0:(null==(w=l.offset)?void 0:w[u])||0)-(e?g.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[d]:h,[u]:m}}}},Ht=(t,e,n)=>{const o=new Map,r={platform:At,...n},i={...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:u}=nt(a,o,c),d=o,h={},m=0;for(let n=0;n<s.length;n++){const{name:i,fn:p}=s[n],{x:g,y:y,data:w,reset:x}=await p({x:f,y:u,initialPlacement:o,placement:d,strategy:r,middlewareData:h,rects:a,platform:l,elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=y?y:u,h={...h,[i]:{...h[i],...w}},x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(a=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:r}):x.rects),({x:f,y:u}=nt(a,d,c))),n=-1)}return{x:f,y:u,placement:d,strategy:r,middlewareData:h}})(t,e,{...r,platform:i})};var Mt="undefined"!=typeof document?e:function(){};function Wt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;0!==o--;)if(!Wt(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!t.$$typeof)&&!Wt(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}function Bt(t){if("undefined"==typeof window)return 1;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Vt(t,e){const n=Bt(t);return Math.round(e*n)/n}function zt(e){const n=t.useRef(e);return Mt(()=>{n.current=e}),n}function jt(e){void 0===e&&(e={});const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l,elements:{reference:s,floating:c}={},transform:a=!0,whileElementsMounted:f,open:u}=e,[d,h]=t.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[m,p]=t.useState(i);Wt(m,i)||p(i);const[g,y]=t.useState(null),[w,x]=t.useState(null),v=t.useCallback(t=>{t!==S.current&&(S.current=t,y(t))},[]),b=t.useCallback(t=>{t!==L.current&&(L.current=t,x(t))},[]),R=s||g,A=c||w,S=t.useRef(null),L=t.useRef(null),T=t.useRef(d),E=null!=f,C=zt(f),D=zt(l),O=zt(u),P=t.useCallback(()=>{if(!S.current||!L.current)return;const t={placement:o,strategy:r,middleware:m};D.current&&(t.platform=D.current),Ht(S.current,L.current,t).then(t=>{const e={...t,isPositioned:!1!==O.current};k.current&&!Wt(T.current,e)&&(T.current=e,n.flushSync(()=>{h(e)}))})},[m,o,r,D,O]);Mt(()=>{!1===u&&T.current.isPositioned&&(T.current.isPositioned=!1,h(t=>({...t,isPositioned:!1})))},[u]);const k=t.useRef(!1);Mt(()=>(k.current=!0,()=>{k.current=!1}),[]),Mt(()=>{if(R&&(S.current=R),A&&(L.current=A),R&&A){if(C.current)return C.current(R,A,P);P()}},[R,A,P,C,E]);const F=t.useMemo(()=>({reference:S,floating:L,setReference:v,setFloating:b}),[v,b]),H=t.useMemo(()=>({reference:R,floating:A}),[R,A]),M=t.useMemo(()=>{const t={position:r,left:0,top:0};if(!H.floating)return t;const e=Vt(H.floating,d.x),n=Vt(H.floating,d.y);return a?{...t,transform:"translate("+e+"px, "+n+"px)",...Bt(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:e,top:n}},[r,a,H.floating,d.x,d.y]);return t.useMemo(()=>({...d,update:P,refs:F,elements:H,floatingStyles:M}),[d,P,F,H,M])}const Nt=t=>({name:"arrow",options:t,fn(e){const{element:n,padding:o}="function"==typeof t?t(e):t;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?Pt({element:n.current,padding:o}).fn(e):{}:n?Pt({element:n,padding:o}).fn(e):{};var r}}),$t=(t,e)=>({...Tt(t),options:[t,e]}),qt=(t,e)=>({...Et(t),options:[t,e]}),It=(t,e)=>({...Ft(t),options:[t,e]}),_t=(t,e)=>({...Ct(t),options:[t,e]}),Xt=(t,e)=>({...Dt(t),options:[t,e]}),Yt=(t,e)=>({...Ot(t),options:[t,e]}),Gt=(t,e)=>({...kt(t),options:[t,e]}),Jt=(t,e)=>({...Nt(t),options:[t,e]});export{a,c as b,r as c,A as d,T as e,S as f,C as g,b as h,f as i,Lt as j,Gt as k,_t as l,Xt as m,It as n,$t as o,Jt as p,Yt as q,qt as s,jt as u};
|
|
1
|
+
import*as t from"react";import{useLayoutEffect as e}from"react";import*as n from"react-dom";function o(){return"undefined"!=typeof window}function r(t){return s(t)?(t.nodeName||"").toLowerCase():"#document"}function i(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function l(t){var e;return null==(e=(s(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function s(t){return!!o()&&(t instanceof Node||t instanceof i(t).Node)}function c(t){return!!o()&&(t instanceof Element||t instanceof i(t).Element)}function a(t){return!!o()&&(t instanceof HTMLElement||t instanceof i(t).HTMLElement)}function f(t){return!(!o()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof i(t).ShadowRoot)}const u=new Set(["inline","contents"]);function d(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=S(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!u.has(r)}const h=new Set(["table","td","th"]);function m(t){return h.has(r(t))}const p=[":popover-open",":modal"];function g(t){return p.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const y=["transform","translate","scale","rotate","perspective"],w=["transform","translate","scale","rotate","perspective","filter"],x=["paint","layout","strict","content"];function v(t){const e=b(),n=c(t)?S(t):t;return y.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||w.some(t=>(n.willChange||"").includes(t))||x.some(t=>(n.contain||"").includes(t))}function b(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const R=new Set(["html","body","#document"]);function A(t){return R.has(r(t))}function S(t){return i(t).getComputedStyle(t)}function L(t){return c(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function T(t){if("html"===r(t))return t;const e=t.assignedSlot||t.parentNode||f(t)&&t.host||l(t);return f(e)?e.host:e}function O(t){const e=T(t);return A(e)?t.ownerDocument?t.ownerDocument.body:t.body:a(e)&&d(e)?e:O(e)}function E(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=O(t),l=r===(null==(o=t.ownerDocument)?void 0:o.body),s=i(r);if(l){const t=C(s);return e.concat(s,s.visualViewport||[],d(r)?r:[],t&&n?E(t):[])}return e.concat(r,E(r,[],n))}function C(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const D=["top","right","bottom","left"],P=Math.min,k=Math.max,F=Math.round,H=Math.floor,M=t=>({x:t,y:t}),W={left:"right",right:"left",bottom:"top",top:"bottom"},B={start:"end",end:"start"};function V(t,e,n){return k(t,P(e,n))}function z(t,e){return"function"==typeof t?t(e):t}function j(t){return t.split("-")[0]}function N(t){return t.split("-")[1]}function $(t){return"x"===t?"y":"x"}function q(t){return"y"===t?"height":"width"}const I=new Set(["top","bottom"]);function _(t){return I.has(j(t))?"y":"x"}function X(t){return $(_(t))}function Y(t){return t.replace(/start|end/g,t=>B[t])}const G=["left","right"],J=["right","left"],K=["top","bottom"],Q=["bottom","top"];function U(t,e,n,o){const r=N(t);let i=function(t,e,n){switch(t){case"top":case"bottom":return n?e?J:G:e?G:J;case"left":case"right":return e?K:Q;default:return[]}}(j(t),"start"===n,o);return r&&(i=i.map(t=>t+"-"+r),e&&(i=i.concat(i.map(Y)))),i}function Z(t){return t.replace(/left|right|bottom|top/g,t=>W[t])}function tt(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function et(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function nt(t,e,n){let{reference:o,floating:r}=t;const i=_(e),l=X(e),s=q(l),c=j(e),a="y"===i,f=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,d=o[s]/2-r[s]/2;let h;switch(c){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:u};break;case"left":h={x:o.x-r.width,y:u};break;default:h={x:o.x,y:o.y}}switch(N(e)){case"start":h[l]-=d*(n&&a?-1:1);break;case"end":h[l]+=d*(n&&a?-1:1)}return h}async function ot(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:l,elements:s,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:h=0}=z(e,t),m=tt(h),p=s[d?"floating"===u?"reference":"floating":u],g=et(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(p)))||n?p:p.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:a,rootBoundary:f,strategy:c})),y="floating"===u?{x:o,y:r,width:l.floating.width,height:l.floating.height}:l.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),x=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},v=et(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:w,strategy:c}):y);return{top:(g.top-v.top+m.top)/x.y,bottom:(v.bottom-g.bottom+m.bottom)/x.y,left:(g.left-v.left+m.left)/x.x,right:(v.right-g.right+m.right)/x.x}}function rt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function it(t){return D.some(e=>t[e]>=0)}function lt(t){const e=P(...t.map(t=>t.left)),n=P(...t.map(t=>t.top));return{x:e,y:n,width:k(...t.map(t=>t.right))-e,height:k(...t.map(t=>t.bottom))-n}}const st=new Set(["left","top"]);function ct(t){const e=S(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=a(t),i=r?t.offsetWidth:n,l=r?t.offsetHeight:o,s=F(n)!==i||F(o)!==l;return s&&(n=i,o=l),{width:n,height:o,$:s}}function at(t){return c(t)?t:t.contextElement}function ft(t){const e=at(t);if(!a(e))return M(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=ct(e);let l=(i?F(n.width):n.width)/o,s=(i?F(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const ut=M(0);function dt(t){const e=i(t);return b()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ut}function ht(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),l=at(t);let s=M(1);e&&(o?c(o)&&(s=ft(o)):s=ft(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==i(t))&&e}(l,n,o)?dt(l):M(0);let f=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,d=r.width/s.x,h=r.height/s.y;if(l){const t=i(l),e=o&&c(o)?i(o):o;let n=t,r=C(n);for(;r&&o&&e!==n;){const t=ft(r),e=r.getBoundingClientRect(),o=S(r),l=e.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;f*=t.x,u*=t.y,d*=t.x,h*=t.y,f+=l,u+=s,n=i(r),r=C(n)}}return et({width:d,height:h,x:f,y:u})}function mt(t,e){const n=L(t).scrollLeft;return e?e.left+n:ht(l(t)).left+n}function pt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-mt(t,n),y:n.top+e.scrollTop}}const gt=new Set(["absolute","fixed"]);function yt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=i(t),o=l(t),r=n.visualViewport;let s=o.clientWidth,c=o.clientHeight,a=0,f=0;if(r){s=r.width,c=r.height;const t=b();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,f=r.offsetTop)}const u=mt(o);if(u<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),r="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-e.clientWidth-r);i<=25&&(s-=i)}else u<=25&&(s+=u);return{width:s,height:c,x:a,y:f}}(t,n);else if("document"===e)o=function(t){const e=l(t),n=L(t),o=t.ownerDocument.body,r=k(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=k(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+mt(t);const c=-n.scrollTop;return"rtl"===S(o).direction&&(s+=k(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}(l(t));else if(c(e))o=function(t,e){const n=ht(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=a(t)?ft(t):M(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=dt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return et(o)}function wt(t,e){const n=T(t);return!(n===e||!c(n)||A(n))&&("fixed"===S(n).position||wt(n,e))}function xt(t,e,n){const o=a(e),i=l(e),s="fixed"===n,c=ht(t,!0,s,e);let f={scrollLeft:0,scrollTop:0};const u=M(0);function h(){u.x=mt(i)}if(o||!o&&!s)if(("body"!==r(e)||d(i))&&(f=L(e)),o){const t=ht(e,!0,s,e);u.x=t.x+e.clientLeft,u.y=t.y+e.clientTop}else i&&h();s&&!o&&i&&h();const m=!i||o||s?M(0):pt(i,f);return{x:c.left+f.scrollLeft-u.x-m.x,y:c.top+f.scrollTop-u.y-m.y,width:c.width,height:c.height}}function vt(t){return"static"===S(t).position}function bt(t,e){if(!a(t)||"fixed"===S(t).position)return null;if(e)return e(t);let n=t.offsetParent;return l(t)===n&&(n=n.ownerDocument.body),n}function Rt(t,e){const n=i(t);if(g(t))return n;if(!a(t)){let e=T(t);for(;e&&!A(e);){if(c(e)&&!vt(e))return e;e=T(e)}return n}let o=bt(t,e);for(;o&&m(o)&&vt(o);)o=bt(o,e);return o&&A(o)&&vt(o)&&!v(o)?n:o||function(t){let e=T(t);for(;a(e)&&!A(e);){if(v(e))return e;if(g(e))return null;e=T(e)}return null}(t)||n}const At={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s="fixed"===i,c=l(o),f=!!e&&g(e.floating);if(o===c||f&&s)return n;let u={scrollLeft:0,scrollTop:0},h=M(1);const m=M(0),p=a(o);if((p||!p&&!s)&&(("body"!==r(o)||d(c))&&(u=L(o)),a(o))){const t=ht(o);h=ft(o),m.x=t.x+o.clientLeft,m.y=t.y+o.clientTop}const y=!c||p||s?M(0):pt(c,u);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-u.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-u.scrollTop*h.y+m.y+y.y}},getDocumentElement:l,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[..."clippingAncestors"===n?g(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=E(t,[],!1).filter(t=>c(t)&&"body"!==r(t)),i=null;const l="fixed"===S(t).position;let s=l?T(t):t;for(;c(s)&&!A(s);){const e=S(s),n=v(s);n||"fixed"!==e.position||(i=null),(l?!n&&!i:!n&&"static"===e.position&&i&>.has(i.position)||d(s)&&!n&&wt(t,s))?o=o.filter(t=>t!==s):i=e,s=T(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=l[0],a=l.reduce((t,n)=>{const o=yt(e,n,i);return t.top=k(o.top,t.top),t.right=P(o.right,t.right),t.bottom=P(o.bottom,t.bottom),t.left=k(o.left,t.left),t},yt(e,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Rt,getElementRects:async function(t){const e=this.getOffsetParent||Rt,n=this.getDimensions,o=await n(t.floating);return{reference:xt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=ct(t);return{width:e,height:n}},getScale:ft,isElement:c,isRTL:function(t){return"rtl"===S(t).direction}};function St(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Lt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,f=at(t),u=r||i?[...f?E(f):[],...E(e)]:[];u.forEach(t=>{r&&t.addEventListener("scroll",n,{passive:!0}),i&&t.addEventListener("resize",n)});const d=f&&c?function(t,e){let n,o=null;const r=l(t);function i(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function l(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),i();const a=t.getBoundingClientRect(),{left:f,top:u,width:d,height:h}=a;if(s||e(),!d||!h)return;const m={rootMargin:-H(u)+"px "+-H(r.clientWidth-(f+d))+"px "+-H(r.clientHeight-(u+h))+"px "+-H(f)+"px",threshold:k(0,P(1,c))||1};let p=!0;function g(e){const o=e[0].intersectionRatio;if(o!==c){if(!p)return l();o?l(!1,o):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==o||St(a,t.getBoundingClientRect())||l(),p=!1}try{o=new IntersectionObserver(g,{...m,root:r.ownerDocument})}catch(t){o=new IntersectionObserver(g,m)}o.observe(t)}(!0),i}(f,n):null;let h,m=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===f&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e)})),n()}),f&&!a&&p.observe(f),p.observe(e));let g=a?ht(t):null;return a&&function e(){const o=ht(t);g&&!St(g,o)&&n();g=o,h=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach(t=>{r&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)}),null==d||d(),null==(t=p)||t.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const Tt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:l,middlewareData:s}=e,c=await async function(t,e){const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=j(n),s=N(n),c="y"===_(n),a=st.has(l)?-1:1,f=i&&c?-1:1,u=z(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*f,y:d*a}:{x:d*a,y:h*f}}(e,t);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:l}}}}},Ot=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:i}=e,{mainAxis:l=!0,crossAxis:s=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...a}=z(t,e),f={x:n,y:o},u=await i.detectOverflow(e,a),d=_(j(r)),h=$(d);let m=f[h],p=f[d];if(l){const t="y"===h?"bottom":"right";m=V(m+u["y"===h?"top":"left"],m,m-u[t])}if(s){const t="y"===d?"bottom":"right";p=V(p+u["y"===d?"top":"left"],p,p-u[t])}const g=c.fn({...e,[h]:m,[d]:p});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[h]:l,[d]:s}}}}}},Et=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:s,platform:c,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=z(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=j(r),w=_(s),x=j(s)===s,v=await(null==c.isRTL?void 0:c.isRTL(a.floating)),b=d||(x||!p?[Z(s)]:function(t){const e=Z(t);return[Y(t),e,Y(e)]}(s)),R="none"!==m;!d&&R&&b.push(...U(s,p,m,v));const A=[s,...b],S=await c.detectOverflow(e,g),L=[];let T=(null==(o=i.flip)?void 0:o.overflows)||[];if(f&&L.push(S[y]),u){const t=function(t,e,n){void 0===n&&(n=!1);const o=N(t),r=X(t),i=q(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(l=Z(l)),[l,Z(l)]}(r,l,v);L.push(S[t[0]],S[t[1]])}if(T=[...T,{placement:r,overflows:L}],!L.every(t=>t<=0)){var O,E;const t=((null==(O=i.flip)?void 0:O.index)||0)+1,e=A[t];if(e){if(!("alignment"===u&&w!==_(e))||T.every(t=>_(t.placement)!==w||t.overflows[0]>0))return{data:{index:t,overflows:T},reset:{placement:e}}}let n=null==(E=T.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:E.placement;if(!n)switch(h){case"bestFit":{var C;const t=null==(C=T.filter(t=>{if(R){const e=_(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:C[0];t&&(n=t);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},Ct=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:i,platform:l,elements:s}=e,{apply:c=()=>{},...a}=z(t,e),f=await l.detectOverflow(e,a),u=j(r),d=N(r),h="y"===_(r),{width:m,height:p}=i.floating;let g,y;"top"===u||"bottom"===u?(g=u,y=d===(await(null==l.isRTL?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,g="end"===d?"top":"bottom");const w=p-f.top-f.bottom,x=m-f.left-f.right,v=P(p-f[g],w),b=P(m-f[y],x),R=!e.middlewareData.shift;let A=v,S=b;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(S=x),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(A=w),R&&!d){const t=k(f.left,0),e=k(f.right,0),n=k(f.top,0),o=k(f.bottom,0);h?S=m-2*(0!==t||0!==e?t+e:k(f.left,f.right)):A=p-2*(0!==n||0!==o?n+o:k(f.top,f.bottom))}await c({...e,availableWidth:S,availableHeight:A});const L=await l.getDimensions(s.floating);return m!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}},Dt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:r="referenceHidden",...i}=z(t,e);switch(r){case"referenceHidden":{const t=rt(await o.detectOverflow(e,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:it(t)}}}case"escaped":{const t=rt(await o.detectOverflow(e,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:it(t)}}}default:return{}}}}},Pt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:i,platform:l,elements:s,middlewareData:c}=e,{element:a,padding:f=0}=z(t,e)||{};if(null==a)return{};const u=tt(f),d={x:n,y:o},h=X(r),m=q(h),p=await l.getDimensions(a),g="y"===h,y=g?"top":"left",w=g?"bottom":"right",x=g?"clientHeight":"clientWidth",v=i.reference[m]+i.reference[h]-d[h]-i.floating[m],b=d[h]-i.reference[h],R=await(null==l.getOffsetParent?void 0:l.getOffsetParent(a));let A=R?R[x]:0;A&&await(null==l.isElement?void 0:l.isElement(R))||(A=s.floating[x]||i.floating[m]);const S=v/2-b/2,L=A/2-p[m]/2-1,T=P(u[y],L),O=P(u[w],L),E=T,C=A-p[m]-O,D=A/2-p[m]/2+S,k=V(E,D,C),F=!c.arrow&&null!=N(r)&&D!==k&&i.reference[m]/2-(D<E?T:O)-p[m]/2<0,H=F?D<E?D-E:D-C:0;return{[h]:d[h]+H,data:{[h]:k,centerOffset:D-k-H,...F&&{alignmentOffset:H}},reset:F}}}),kt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:r,platform:i,strategy:l}=e,{padding:s=2,x:c,y:a}=z(t,e),f=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]),u=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const r=e[t];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map(t=>et(lt(t)))}(f),d=et(lt(f)),h=tt(s);const m=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=c&&null!=a)return u.find(t=>c>t.left-h.left&&c<t.right+h.right&&a>t.top-h.top&&a<t.bottom+h.bottom)||d;if(u.length>=2){if("y"===_(n)){const t=u[0],e=u[u.length-1],o="top"===j(n),r=t.top,i=e.bottom,l=o?t.left:e.left,s=o?t.right:e.right;return{top:r,bottom:i,left:l,right:s,width:s-l,height:i-r,x:l,y:r}}const t="left"===j(n),e=k(...u.map(t=>t.right)),o=P(...u.map(t=>t.left)),r=u.filter(n=>t?n.left===o:n.right===e),i=r[0].top,l=r[r.length-1].bottom;return{top:i,bottom:l,left:o,right:e,width:e-o,height:l-i,x:o,y:i}}return d}},floating:o.floating,strategy:l});return r.reference.x!==m.reference.x||r.reference.y!==m.reference.y||r.reference.width!==m.reference.width||r.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},Ft=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:r,rects:i,middlewareData:l}=e,{offset:s=0,mainAxis:c=!0,crossAxis:a=!0}=z(t,e),f={x:n,y:o},u=_(r),d=$(u);let h=f[d],m=f[u];const p=z(s,e),g="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const t="y"===d?"height":"width",e=i.reference[d]-i.floating[t]+g.mainAxis,n=i.reference[d]+i.reference[t]-g.mainAxis;h<e?h=e:h>n&&(h=n)}if(a){var y,w;const t="y"===d?"width":"height",e=st.has(j(r)),n=i.reference[u]-i.floating[t]+(e&&(null==(y=l.offset)?void 0:y[u])||0)+(e?0:g.crossAxis),o=i.reference[u]+i.reference[t]+(e?0:(null==(w=l.offset)?void 0:w[u])||0)-(e?g.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[d]:h,[u]:m}}}},Ht=(t,e,n)=>{const o=new Map,r={platform:At,...n},i={...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:u}=nt(a,o,c),d=o,h={},m=0;for(let n=0;n<s.length;n++){var p;const{name:i,fn:g}=s[n],{x:y,y:w,data:x,reset:v}=await g({x:f,y:u,initialPlacement:o,placement:d,strategy:r,middlewareData:h,rects:a,platform:{...l,detectOverflow:null!=(p=l.detectOverflow)?p:ot},elements:{reference:t,floating:e}});f=null!=y?y:f,u=null!=w?w:u,h={...h,[i]:{...h[i],...x}},v&&m<=50&&(m++,"object"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(a=!0===v.rects?await l.getElementRects({reference:t,floating:e,strategy:r}):v.rects),({x:f,y:u}=nt(a,d,c))),n=-1)}return{x:f,y:u,placement:d,strategy:r,middlewareData:h}})(t,e,{...r,platform:i})};var Mt="undefined"!=typeof document?e:function(){};function Wt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;0!==o--;)if(!Wt(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!t.$$typeof)&&!Wt(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}function Bt(t){if("undefined"==typeof window)return 1;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Vt(t,e){const n=Bt(t);return Math.round(e*n)/n}function zt(e){const n=t.useRef(e);return Mt(()=>{n.current=e}),n}function jt(e){void 0===e&&(e={});const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l,elements:{reference:s,floating:c}={},transform:a=!0,whileElementsMounted:f,open:u}=e,[d,h]=t.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[m,p]=t.useState(i);Wt(m,i)||p(i);const[g,y]=t.useState(null),[w,x]=t.useState(null),v=t.useCallback(t=>{t!==S.current&&(S.current=t,y(t))},[]),b=t.useCallback(t=>{t!==L.current&&(L.current=t,x(t))},[]),R=s||g,A=c||w,S=t.useRef(null),L=t.useRef(null),T=t.useRef(d),O=null!=f,E=zt(f),C=zt(l),D=zt(u),P=t.useCallback(()=>{if(!S.current||!L.current)return;const t={placement:o,strategy:r,middleware:m};C.current&&(t.platform=C.current),Ht(S.current,L.current,t).then(t=>{const e={...t,isPositioned:!1!==D.current};k.current&&!Wt(T.current,e)&&(T.current=e,n.flushSync(()=>{h(e)}))})},[m,o,r,C,D]);Mt(()=>{!1===u&&T.current.isPositioned&&(T.current.isPositioned=!1,h(t=>({...t,isPositioned:!1})))},[u]);const k=t.useRef(!1);Mt(()=>(k.current=!0,()=>{k.current=!1}),[]),Mt(()=>{if(R&&(S.current=R),A&&(L.current=A),R&&A){if(E.current)return E.current(R,A,P);P()}},[R,A,P,E,O]);const F=t.useMemo(()=>({reference:S,floating:L,setReference:v,setFloating:b}),[v,b]),H=t.useMemo(()=>({reference:R,floating:A}),[R,A]),M=t.useMemo(()=>{const t={position:r,left:0,top:0};if(!H.floating)return t;const e=Vt(H.floating,d.x),n=Vt(H.floating,d.y);return a?{...t,transform:"translate("+e+"px, "+n+"px)",...Bt(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:e,top:n}},[r,a,H.floating,d.x,d.y]);return t.useMemo(()=>({...d,update:P,refs:F,elements:H,floatingStyles:M}),[d,P,F,H,M])}const Nt=t=>({name:"arrow",options:t,fn(e){const{element:n,padding:o}="function"==typeof t?t(e):t;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?Pt({element:n.current,padding:o}).fn(e):{}:n?Pt({element:n,padding:o}).fn(e):{};var r}}),$t=(t,e)=>({...Tt(t),options:[t,e]}),qt=(t,e)=>({...Ot(t),options:[t,e]}),It=(t,e)=>({...Ft(t),options:[t,e]}),_t=(t,e)=>({...Et(t),options:[t,e]}),Xt=(t,e)=>({...Ct(t),options:[t,e]}),Yt=(t,e)=>({...Dt(t),options:[t,e]}),Gt=(t,e)=>({...kt(t),options:[t,e]}),Jt=(t,e)=>({...Nt(t),options:[t,e]});export{a,c as b,r as c,A as d,T as e,S as f,E as g,b as h,f as i,Lt as j,Gt as k,_t as l,Xt as m,It as n,$t as o,Jt as p,Yt as q,qt as s,jt as u};
|