@loadsmart/loadsmart-ui 6.0.0 → 6.0.1
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/DragDropFile.context-0f0ede42.js.map +1 -1
- package/dist/components/DatePicker/useDatePicker.d.ts +39 -37
- package/dist/components/DatePicker/useDateRangePicker.d.ts +60 -57
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/miranda-compatibility.theme-97e29e8e.js.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/package.json +58 -58
- package/src/components/Link/Link.test.tsx +2 -2
package/dist/index.js
CHANGED
|
@@ -1203,7 +1203,7 @@
|
|
|
1203
1203
|
${ya}:last-child {
|
|
1204
1204
|
margin-right: ${l.conditional({"space-m":l.whenProps({$direction:"horizontal"}),initial:l.whenProps({$direction:"vertical"})})}};
|
|
1205
1205
|
}
|
|
1206
|
-
`;function Pa(t){var{scale:n="default",open:r}=t,o=e.__rest(t,["scale","open"]);return d.default.createElement(wa,Object.assign({open:r,scale:n},o))}function Ea({open:e,onOpen:n,onClose:r}){const[o,a]=t.useState(e),l=t.useCallback((function(){a(!0),null==n||n()}),[n]),i=t.useCallback((function(){a(!1),null==r||r()}),[r]),c=t.useCallback((function(){o?i():l()}),[i,o,l]);return t.useEffect((function(){a(e)}),[e]),{open:o,show:l,hide:i,toggle:c}}function Ta(e){return e.split("-")[1]}function Ca(e){return"y"===e?"height":"width"}function ja(e){return e.split("-")[0]}function Oa(e){return["top","bottom"].includes(ja(e))?"x":"y"}function _a(e,t,n){let{reference:r,floating:o}=e;const a=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,i=Oa(t),c=Ca(i),s=r[c]/2-o[c]/2,d="x"===i;let u;switch(ja(t)){case"top":u={x:a,y:r.y-o.height};break;case"bottom":u={x:a,y:r.y+r.height};break;case"right":u={x:r.x+r.width,y:l};break;case"left":u={x:r.x-o.width,y:l};break;default:u={x:r.x,y:r.y}}switch(Ta(t)){case"start":u[i]-=s*(n&&d?-1:1);break;case"end":u[i]+=s*(n&&d?-1:1)}return u}Pa.Header=va,Pa.Body=$a,Pa.ActionConfirm=function(t){var{onConfirm:n=(()=>{}),children:r="CONFIRM"}=t,o=e.__rest(t,["onConfirm","children"]);return d.default.createElement(ya,null,d.default.createElement(Mn,Object.assign({},o,{onClick:n,variant:"primary"}),r))},Pa.ActionCancel=function(t){var{onCancel:n=(()=>{}),children:r="CANCEL"}=t,o=e.__rest(t,["onCancel","children"]);return d.default.createElement(ya,null,d.default.createElement(Mn,Object.assign({},o,{onClick:n,variant:"secondary"}),r))},Pa.Actions=function({scale:e="default",direction:t="vertical",children:n}){return d.default.createElement(xa,{$scale:e,$direction:t},n)},Pa.Close=ka;function za(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Sa(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Ra(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:l,elements:i,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:g=!1,padding:f=0}=t,p=za(f),h=i[g?"floating"===u?"reference":"floating":u],m=Sa(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(h)))||n?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(i.floating)),boundary:s,rootBoundary:d,strategy:c})),b="floating"===u?{...l.floating,x:r,y:o}:l.reference,w=await(null==a.getOffsetParent?void 0:a.getOffsetParent(i.floating)),v=await(null==a.isElement?void 0:a.isElement(w))&&await(null==a.getScale?void 0:a.getScale(w))||{x:1,y:1},$=Sa(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:w,strategy:c}):b);return process.env.NODE_ENV,{top:(m.top-$.top+p.top)/v.y,bottom:($.bottom-m.bottom+p.bottom)/v.y,left:(m.left-$.left+p.left)/v.x,right:($.right-m.right+p.right)/v.x}}const Da=Math.min,Ma=Math.max;function Aa(e,t,n){return Ma(e,Da(t,n))}const Fa=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:a,placement:l,rects:i,platform:c}=t;if(null==n)return"production"!==process.env.NODE_ENV&&console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const s=za(r),d={x:o,y:a},u=Oa(l),g=Ca(u),f=await c.getDimensions(n),p="y"===u?"top":"left",h="y"===u?"bottom":"right",m=i.reference[g]+i.reference[u]-d[u]-i.floating[g],b=d[u]-i.reference[u],w=await(null==c.getOffsetParent?void 0:c.getOffsetParent(n));let v=w?"y"===u?w.clientHeight||0:w.clientWidth||0:0;0===v&&(v=i.floating[g]);const $=m/2-b/2,y=s[p],k=v-f[g]-s[h],x=v/2-f[g]/2+$,P=Aa(y,x,k),E=null!=Ta(l)&&x!=P&&i.reference[g]/2-(x<y?s[p]:s[h])-f[g]/2<0;return{[u]:d[u]-(E?x<y?y-x:k-x:0),data:{[u]:P,centerOffset:x-P}}}}),La={left:"right",right:"left",bottom:"top",top:"bottom"};function Na(e){return e.replace(/left|right|bottom|top/g,(e=>La[e]))}const Ba={start:"end",end:"start"};function Ia(e){return e.replace(/start|end/g,(e=>Ba[e]))}const Ha=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:a,initialPlacement:l,platform:i,elements:c}=t,{mainAxis:s=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...h}=e,m=ja(r),b=ja(l)===l,w=await(null==i.isRTL?void 0:i.isRTL(c.floating)),v=u||(b||!p?[Na(l)]:function(e){const t=Na(e);return[Ia(e),t,Ia(t)]}(l));u||"none"===f||v.push(...function(e,t,n,r){const o=Ta(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:l;default:return[]}}(ja(e),"start"===n,r);return o&&(a=a.map((e=>e+"-"+o)),t&&(a=a.concat(a.map(Ia)))),a}(l,p,f,w));const $=[l,...v],y=await Ra(t,h),k=[];let x=(null==(n=o.flip)?void 0:n.overflows)||[];if(s&&k.push(y[m]),d){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=Ta(e),o=Oa(e),a=Ca(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Na(l)),{main:l,cross:Na(l)}}(r,a,w);k.push(y[e],y[t])}if(x=[...x,{placement:r,overflows:k}],!k.every((e=>e<=0))){var P,E;const e=((null==(P=o.flip)?void 0:P.index)||0)+1,t=$[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n=null==(E=x.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:E.placement;if(!n)switch(g){case"bestFit":{var T;const e=null==(T=x.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}};const Ua=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=ja(n),i=Ta(n),c="x"===Oa(n),s=["left","top"].includes(l)?-1:1,d=a&&c?-1:1,u="function"==typeof t?t(e):t;let{mainAxis:g,crossAxis:f,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return i&&"number"==typeof p&&(f="end"===i?-1*p:p),c?{x:f*d,y:g*s}:{x:g*s,y:f*d}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};const Wa=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:i={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=e,s={x:n,y:r},d=await Ra(t,c),u=Oa(ja(o)),g="x"===u?"y":"x";let f=s[u],p=s[g];if(a){const e="y"===u?"bottom":"right";f=Aa(f+d["y"===u?"top":"left"],f,f-d[e])}if(l){const e="y"===g?"bottom":"right";p=Aa(p+d["y"===g?"top":"left"],p,p-d[e])}const h=i.fn({...t,[u]:f,[g]:p});return{...h,data:{x:h.x-n,y:h.y-r}}}}};function Va(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ya(e){return Va(e).getComputedStyle(e)}const qa=Math.min,Ga=Math.max,Za=Math.round;function Ka(e){const t=Ya(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,a=e.offsetHeight,l=Za(n)!==o||Za(r)!==a;return l&&(n=o,r=a),{width:n,height:r,fallback:l}}function Qa(e){return nl(e)?(e.nodeName||"").toLowerCase():""}let Ja;function Xa(){if(Ja)return Ja;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Ja=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),Ja):navigator.userAgent}function el(e){return e instanceof Va(e).HTMLElement}function tl(e){return e instanceof Va(e).Element}function nl(e){return e instanceof Va(e).Node}function rl(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof Va(e).ShadowRoot||e instanceof ShadowRoot}function ol(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ya(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function al(e){return["table","td","th"].includes(Qa(e))}function ll(e){const t=/firefox/i.test(Xa()),n=Ya(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function il(){return/^((?!chrome|android).)*safari/i.test(Xa())}function cl(e){return["html","body","#document"].includes(Qa(e))}function sl(e){return tl(e)?e:e.contextElement}const dl={x:1,y:1};function ul(e){const t=sl(e);if(!el(t))return dl;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:a}=Ka(t);let l=(a?Za(n.width):n.width)/r,i=(a?Za(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),i&&Number.isFinite(i)||(i=1),{x:l,y:i}}function gl(e,t,n,r){var o,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),i=sl(e);let c=dl;t&&(r?tl(r)&&(c=ul(r)):c=ul(e));const s=i?Va(i):window,d=il()&&n;let u=(l.left+(d&&(null==(o=s.visualViewport)?void 0:o.offsetLeft)||0))/c.x,g=(l.top+(d&&(null==(a=s.visualViewport)?void 0:a.offsetTop)||0))/c.y,f=l.width/c.x,p=l.height/c.y;if(i){const e=Va(i),t=r&&tl(r)?Va(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=ul(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,u*=e.x,g*=e.y,f*=e.x,p*=e.y,u+=t.x,g+=t.y,n=Va(n).frameElement}}return{width:f,height:p,top:g,right:u+f,bottom:g+p,left:u,x:u,y:g}}function fl(e){return((nl(e)?e.ownerDocument:e.document)||window.document).documentElement}function pl(e){return tl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function hl(e){return gl(fl(e)).left+pl(e).scrollLeft}function ml(e){if("html"===Qa(e))return e;const t=e.assignedSlot||e.parentNode||rl(e)&&e.host||fl(e);return rl(t)?t.host:t}function bl(e){const t=ml(e);return cl(t)?t.ownerDocument.body:el(t)&&ol(t)?t:bl(t)}function wl(e,t){var n;void 0===t&&(t=[]);const r=bl(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=Va(r);return o?t.concat(a,a.visualViewport||[],ol(r)?r:[]):t.concat(r,wl(r))}function vl(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Va(e),r=fl(e),o=n.visualViewport;let a=r.clientWidth,l=r.clientHeight,i=0,c=0;if(o){a=o.width,l=o.height;const e=il();(!e||e&&"fixed"===t)&&(i=o.offsetLeft,c=o.offsetTop)}return{width:a,height:l,x:i,y:c}}(e,n);else if("document"===t)r=function(e){const t=fl(e),n=pl(e),r=e.ownerDocument.body,o=Ga(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ga(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+hl(e);const i=-n.scrollTop;return"rtl"===Ya(r).direction&&(l+=Ga(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:l,y:i}}(fl(e));else if(tl(t))r=function(e,t){const n=gl(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=el(e)?ul(e):{x:1,y:1};return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n={...t};if(il()){var o,a;const t=Va(e);n.x-=(null==(o=t.visualViewport)?void 0:o.offsetLeft)||0,n.y-=(null==(a=t.visualViewport)?void 0:a.offsetTop)||0}r=n}return Sa(r)}function $l(e,t){return el(e)&&"fixed"!==Ya(e).position?t?t(e):e.offsetParent:null}function yl(e,t){const n=Va(e);let r=$l(e,t);for(;r&&al(r)&&"static"===Ya(r).position;)r=$l(r,t);return r&&("html"===Qa(r)||"body"===Qa(r)&&"static"===Ya(r).position&&!ll(r))?n:r||function(e){let t=ml(e);for(;el(t)&&!cl(t);){if(ll(t))return t;t=ml(t)}return null}(e)||n}function kl(e,t,n){const r=el(t),o=fl(t),a=gl(e,!0,"fixed"===n,t);let l={scrollLeft:0,scrollTop:0};const i={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==Qa(t)||ol(o))&&(l=pl(t)),el(t)){const e=gl(t,!0);i.x=e.x+t.clientLeft,i.y=e.y+t.clientTop}else o&&(i.x=hl(o));return{x:a.left+l.scrollLeft-i.x,y:a.top+l.scrollTop-i.y,width:a.width,height:a.height}}const xl={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=wl(e).filter((e=>tl(e)&&"body"!==Qa(e))),o=null;const a="fixed"===Ya(e).position;let l=a?ml(e):e;for(;tl(l)&&!cl(l);){const e=Ya(l),t=ll(l);"fixed"===e.position?o=null:(a?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==l)),l=ml(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=a[0],i=a.reduce(((e,n)=>{const r=vl(t,n,o);return e.top=Ga(r.top,e.top),e.right=qa(r.right,e.right),e.bottom=qa(r.bottom,e.bottom),e.left=Ga(r.left,e.left),e}),vl(t,l,o));return{width:i.right-i.left,height:i.bottom-i.top,x:i.left,y:i.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=el(n),a=fl(n);if(n===a)return t;let l={scrollLeft:0,scrollTop:0},i={x:1,y:1};const c={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==Qa(n)||ol(a))&&(l=pl(n)),el(n))){const e=gl(n);i=ul(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*i.x,height:t.height*i.y,x:t.x*i.x-l.scrollLeft*i.x+c.x,y:t.y*i.y-l.scrollTop*i.y+c.y}},isElement:tl,getDimensions:function(e){return el(e)?Ka(e):e.getBoundingClientRect()},getOffsetParent:yl,getDocumentElement:fl,getScale:ul,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||yl,a=this.getDimensions;return{reference:kl(t,await o(n),r),floating:{x:0,y:0,...await a(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Ya(e).direction};function Pl(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l=!0,animationFrame:i=!1}=r,c=o&&!i,s=c||a?[...tl(e)?wl(e):e.contextElement?wl(e.contextElement):[],...wl(t)]:[];s.forEach((e=>{c&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)}));let d,u=null;if(l){let r=!0;u=new ResizeObserver((()=>{r||n(),r=!1})),tl(e)&&!i&&u.observe(e),tl(e)||!e.contextElement||i||u.observe(e.contextElement),u.observe(t)}let g=i?gl(e):null;return i&&function t(){const r=gl(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;s.forEach((e=>{c&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)})),null==(e=u)||e.disconnect(),u=null,i&&cancelAnimationFrame(d)}}const El=(e,t,n)=>{const r=new Map,o={platform:xl,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:l}=n,i=a.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));if("production"!==process.env.NODE_ENV){if(null==l&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),i.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=_a(s,r,c),g=r,f={},p=0;for(let n=0;n<i.length;n++){const{name:a,fn:h}=i[n],{x:m,y:b,data:w,reset:v}=await h({x:d,y:u,initialPlacement:r,placement:g,strategy:o,middlewareData:f,rects:s,platform:l,elements:{reference:e,floating:t}});d=null!=m?m:d,u=null!=b?b:u,f={...f,[a]:{...f[a],...w}},"production"!==process.env.NODE_ENV&&p>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),v&&p<=50&&(p++,"object"==typeof v&&(v.placement&&(g=v.placement),v.rects&&(s=!0===v.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):v.rects),({x:d,y:u}=_a(s,g,c))),n=-1)}return{x:d,y:u,placement:g,strategy:o,middlewareData:f}})(e,t,{...o,platform:a})};var Tl="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function Cl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!Cl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Cl(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function jl(e){const t=u.useRef(e);return Tl((()=>{t.current=e})),t}const Ol=d.default.createContext(void 0);function _l(){const e=d.default.useContext(Ol);if(!e)throw new Error("usePopover must be used within a <Popover> Provider");return e}function zl(e){var n,r;const o=d.default.useRef(null),{position:a="bottom",align:l="start",strategy:i="fixed"}=e,c=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:a,open:l}=e,[i,c]=u.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[s,d]=u.useState(r);Cl(s,r)||d(r);const g=u.useRef(null),f=u.useRef(null),h=u.useRef(i),m=jl(a),b=jl(o),[w,v]=u.useState(null),[$,y]=u.useState(null),k=u.useCallback((e=>{g.current!==e&&(g.current=e,v(e))}),[]),x=u.useCallback((e=>{f.current!==e&&(f.current=e,y(e))}),[]),P=u.useCallback((()=>{if(!g.current||!f.current)return;const e={placement:t,strategy:n,middleware:s};b.current&&(e.platform=b.current),El(g.current,f.current,e).then((e=>{const t={...e,isPositioned:!0};E.current&&!Cl(h.current,t)&&(h.current=t,p.flushSync((()=>{c(t)})))}))}),[s,t,n,b]);Tl((()=>{!1===l&&h.current.isPositioned&&(h.current.isPositioned=!1,c((e=>({...e,isPositioned:!1}))))}),[l]);const E=u.useRef(!1);Tl((()=>(E.current=!0,()=>{E.current=!1})),[]),Tl((()=>{if(w&&$){if(m.current)return m.current(w,$,P);P()}}),[w,$,P,m]);const T=u.useMemo((()=>({reference:g,floating:f,setReference:k,setFloating:x})),[k,x]),C=u.useMemo((()=>({reference:w,floating:$})),[w,$]);return u.useMemo((()=>({...i,update:P,refs:T,elements:C,reference:k,floating:x})),[i,P,T,C,k,x])}({placement:`${a}${"center"===l?"":`-${l}`}`,strategy:i,middleware:[Ua(10),Ha(),Wa(),{name:"arrow",fn:e=>o.current?Fa({element:o.current,padding:8}).fn(e):{}}],whileElementsMounted:Pl}),s=d.default.useCallback((e=>{o.current=e,c.update()}),[c]),[g=a,f=l]=c.placement.split("-"),h=t.useMemo((()=>{var e,t,n,r;return{strategy:i,register:{reference:c.refs.setReference,floating:c.refs.setFloating,arrow:s},result:{floating:{top:null!==(e=c.y)&&void 0!==e?e:0,left:null!==(t=c.x)&&void 0!==t?t:0},arrow:{top:null===(n=c.middlewareData.arrow)||void 0===n?void 0:n.y,left:null===(r=c.middlewareData.arrow)||void 0===r?void 0:r.x},position:g,align:f}}}),[s,c.refs.setFloating,null===(n=c.middlewareData.arrow)||void 0===n?void 0:n.x,null===(r=c.middlewareData.arrow)||void 0===r?void 0:r.y,c.refs.setReference,c.x,c.y,f,g,i]);return d.default.createElement(Ol.Provider,{value:h},e.children)}var Sl,Rl;zl.Floating=function(t){var{children:n,style:r}=t,o=e.__rest(t,["children","style"]);const{register:a,result:l,strategy:i}=_l(),c=d.default.useRef(null);return d.default.useLayoutEffect((()=>{c.current&&a.floating(c.current)}),[a]),d.default.createElement("div",Object.assign({ref:c},o,{style:Object.assign({position:i,top:l.floating.top,left:l.floating.left},r)}),n)},zl.Reference=function(t){var{children:n}=t,r=e.__rest(t,["children"]);const o=d.default.useRef(null),{register:a}=_l();return d.default.useLayoutEffect((()=>{o.current&&a.reference(o.current)}),[a]),d.default.createElement("div",Object.assign({ref:o},r),n)},exports.TooltipPosition=void 0,(Sl=exports.TooltipPosition||(exports.TooltipPosition={})).Top="top",Sl.Bottom="bottom",Sl.Left="left",Sl.Right="right",exports.TooltipAlign=void 0,(Rl=exports.TooltipAlign||(exports.TooltipAlign={})).Start="start",Rl.Center="center",Rl.End="end";const Dl=g.default.div`
|
|
1206
|
+
`;function Pa(t){var{scale:n="default",open:r}=t,o=e.__rest(t,["scale","open"]);return d.default.createElement(wa,Object.assign({open:r,scale:n},o))}function Ea({open:e,onOpen:n,onClose:r}){const[o,a]=t.useState(e),l=t.useCallback((function(){a(!0),null==n||n()}),[n]),i=t.useCallback((function(){a(!1),null==r||r()}),[r]),c=t.useCallback((function(){o?i():l()}),[i,o,l]);return t.useEffect((function(){a(e)}),[e]),{open:o,show:l,hide:i,toggle:c}}function Ta(e){return e.split("-")[1]}function Ca(e){return"y"===e?"height":"width"}function ja(e){return e.split("-")[0]}function Oa(e){return["top","bottom"].includes(ja(e))?"x":"y"}function _a(e,t,n){let{reference:r,floating:o}=e;const a=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,i=Oa(t),c=Ca(i),s=r[c]/2-o[c]/2,d="x"===i;let u;switch(ja(t)){case"top":u={x:a,y:r.y-o.height};break;case"bottom":u={x:a,y:r.y+r.height};break;case"right":u={x:r.x+r.width,y:l};break;case"left":u={x:r.x-o.width,y:l};break;default:u={x:r.x,y:r.y}}switch(Ta(t)){case"start":u[i]-=s*(n&&d?-1:1);break;case"end":u[i]+=s*(n&&d?-1:1)}return u}Pa.Header=va,Pa.Body=$a,Pa.ActionConfirm=function(t){var{onConfirm:n=(()=>{}),children:r="CONFIRM"}=t,o=e.__rest(t,["onConfirm","children"]);return d.default.createElement(ya,null,d.default.createElement(Mn,Object.assign({},o,{onClick:n,variant:"primary"}),r))},Pa.ActionCancel=function(t){var{onCancel:n=(()=>{}),children:r="CANCEL"}=t,o=e.__rest(t,["onCancel","children"]);return d.default.createElement(ya,null,d.default.createElement(Mn,Object.assign({},o,{onClick:n,variant:"secondary"}),r))},Pa.Actions=function({scale:e="default",direction:t="vertical",children:n}){return d.default.createElement(xa,{$scale:e,$direction:t},n)},Pa.Close=ka;function za(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Sa(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Ra(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:l,elements:i,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:g=!1,padding:f=0}=t,p=za(f),h=i[g?"floating"===u?"reference":"floating":u],m=Sa(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(h)))||n?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(i.floating)),boundary:s,rootBoundary:d,strategy:c})),b="floating"===u?{...l.floating,x:r,y:o}:l.reference,w=await(null==a.getOffsetParent?void 0:a.getOffsetParent(i.floating)),v=await(null==a.isElement?void 0:a.isElement(w))&&await(null==a.getScale?void 0:a.getScale(w))||{x:1,y:1},$=Sa(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:w,strategy:c}):b);return process.env.NODE_ENV,{top:(m.top-$.top+p.top)/v.y,bottom:($.bottom-m.bottom+p.bottom)/v.y,left:(m.left-$.left+p.left)/v.x,right:($.right-m.right+p.right)/v.x}}const Da=Math.min,Ma=Math.max;function Aa(e,t,n){return Ma(e,Da(t,n))}const Fa=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:a,placement:l,rects:i,platform:c,elements:s}=t;if(null==n)return"production"!==process.env.NODE_ENV&&console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const d=za(r),u={x:o,y:a},g=Oa(l),f=Ca(g),p=await c.getDimensions(n),h="y"===g,m=h?"top":"left",b=h?"bottom":"right",w=h?"clientHeight":"clientWidth",v=i.reference[f]+i.reference[g]-u[g]-i.floating[f],$=u[g]-i.reference[g],y=await(null==c.getOffsetParent?void 0:c.getOffsetParent(n));let k=y?y[w]:0;k&&await(null==c.isElement?void 0:c.isElement(y))||(k=s.floating[w]||i.floating[f]);const x=v/2-$/2,P=d[m],E=k-p[f]-d[b],T=k/2-p[f]/2+x,C=Aa(P,T,E),j=null!=Ta(l)&&T!=C&&i.reference[f]/2-(T<P?d[m]:d[b])-p[f]/2<0;return{[g]:u[g]-(j?T<P?P-T:E-T:0),data:{[g]:C,centerOffset:T-C}}}}),La={left:"right",right:"left",bottom:"top",top:"bottom"};function Na(e){return e.replace(/left|right|bottom|top/g,(e=>La[e]))}const Ba={start:"end",end:"start"};function Ia(e){return e.replace(/start|end/g,(e=>Ba[e]))}const Ha=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:a,initialPlacement:l,platform:i,elements:c}=t,{mainAxis:s=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...h}=e,m=ja(r),b=ja(l)===l,w=await(null==i.isRTL?void 0:i.isRTL(c.floating)),v=u||(b||!p?[Na(l)]:function(e){const t=Na(e);return[Ia(e),t,Ia(t)]}(l));u||"none"===f||v.push(...function(e,t,n,r){const o=Ta(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:l;default:return[]}}(ja(e),"start"===n,r);return o&&(a=a.map((e=>e+"-"+o)),t&&(a=a.concat(a.map(Ia)))),a}(l,p,f,w));const $=[l,...v],y=await Ra(t,h),k=[];let x=(null==(n=o.flip)?void 0:n.overflows)||[];if(s&&k.push(y[m]),d){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=Ta(e),o=Oa(e),a=Ca(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Na(l)),{main:l,cross:Na(l)}}(r,a,w);k.push(y[e],y[t])}if(x=[...x,{placement:r,overflows:k}],!k.every((e=>e<=0))){var P,E;const e=((null==(P=o.flip)?void 0:P.index)||0)+1,t=$[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n=null==(E=x.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:E.placement;if(!n)switch(g){case"bestFit":{var T;const e=null==(T=x.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}};const Ua=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=ja(n),i=Ta(n),c="x"===Oa(n),s=["left","top"].includes(l)?-1:1,d=a&&c?-1:1,u="function"==typeof t?t(e):t;let{mainAxis:g,crossAxis:f,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return i&&"number"==typeof p&&(f="end"===i?-1*p:p),c?{x:f*d,y:g*s}:{x:g*s,y:f*d}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};const Wa=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:i={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=e,s={x:n,y:r},d=await Ra(t,c),u=Oa(ja(o)),g="x"===u?"y":"x";let f=s[u],p=s[g];if(a){const e="y"===u?"bottom":"right";f=Aa(f+d["y"===u?"top":"left"],f,f-d[e])}if(l){const e="y"===g?"bottom":"right";p=Aa(p+d["y"===g?"top":"left"],p,p-d[e])}const h=i.fn({...t,[u]:f,[g]:p});return{...h,data:{x:h.x-n,y:h.y-r}}}}};function Va(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ya(e){return Va(e).getComputedStyle(e)}const qa=Math.min,Ga=Math.max,Za=Math.round;function Ka(e){const t=Ya(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,a=e.offsetHeight,l=Za(n)!==o||Za(r)!==a;return l&&(n=o,r=a),{width:n,height:r,fallback:l}}function Qa(e){return nl(e)?(e.nodeName||"").toLowerCase():""}let Ja;function Xa(){if(Ja)return Ja;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Ja=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),Ja):navigator.userAgent}function el(e){return e instanceof Va(e).HTMLElement}function tl(e){return e instanceof Va(e).Element}function nl(e){return e instanceof Va(e).Node}function rl(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof Va(e).ShadowRoot||e instanceof ShadowRoot}function ol(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ya(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function al(e){return["table","td","th"].includes(Qa(e))}function ll(e){const t=/firefox/i.test(Xa()),n=Ya(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function il(){return/^((?!chrome|android).)*safari/i.test(Xa())}function cl(e){return["html","body","#document"].includes(Qa(e))}function sl(e){return tl(e)?e:e.contextElement}const dl={x:1,y:1};function ul(e){const t=sl(e);if(!el(t))return dl;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:a}=Ka(t);let l=(a?Za(n.width):n.width)/r,i=(a?Za(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),i&&Number.isFinite(i)||(i=1),{x:l,y:i}}function gl(e,t,n,r){var o,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),i=sl(e);let c=dl;t&&(r?tl(r)&&(c=ul(r)):c=ul(e));const s=i?Va(i):window,d=il()&&n;let u=(l.left+(d&&(null==(o=s.visualViewport)?void 0:o.offsetLeft)||0))/c.x,g=(l.top+(d&&(null==(a=s.visualViewport)?void 0:a.offsetTop)||0))/c.y,f=l.width/c.x,p=l.height/c.y;if(i){const e=Va(i),t=r&&tl(r)?Va(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=ul(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,u*=e.x,g*=e.y,f*=e.x,p*=e.y,u+=t.x,g+=t.y,n=Va(n).frameElement}}return Sa({width:f,height:p,x:u,y:g})}function fl(e){return((nl(e)?e.ownerDocument:e.document)||window.document).documentElement}function pl(e){return tl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function hl(e){return gl(fl(e)).left+pl(e).scrollLeft}function ml(e){if("html"===Qa(e))return e;const t=e.assignedSlot||e.parentNode||rl(e)&&e.host||fl(e);return rl(t)?t.host:t}function bl(e){const t=ml(e);return cl(t)?t.ownerDocument.body:el(t)&&ol(t)?t:bl(t)}function wl(e,t){var n;void 0===t&&(t=[]);const r=bl(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=Va(r);return o?t.concat(a,a.visualViewport||[],ol(r)?r:[]):t.concat(r,wl(r))}function vl(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Va(e),r=fl(e),o=n.visualViewport;let a=r.clientWidth,l=r.clientHeight,i=0,c=0;if(o){a=o.width,l=o.height;const e=il();(!e||e&&"fixed"===t)&&(i=o.offsetLeft,c=o.offsetTop)}return{width:a,height:l,x:i,y:c}}(e,n);else if("document"===t)r=function(e){const t=fl(e),n=pl(e),r=e.ownerDocument.body,o=Ga(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ga(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+hl(e);const i=-n.scrollTop;return"rtl"===Ya(r).direction&&(l+=Ga(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:l,y:i}}(fl(e));else if(tl(t))r=function(e,t){const n=gl(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=el(e)?ul(e):{x:1,y:1};return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n={...t};if(il()){var o,a;const t=Va(e);n.x-=(null==(o=t.visualViewport)?void 0:o.offsetLeft)||0,n.y-=(null==(a=t.visualViewport)?void 0:a.offsetTop)||0}r=n}return Sa(r)}function $l(e,t){return el(e)&&"fixed"!==Ya(e).position?t?t(e):e.offsetParent:null}function yl(e,t){const n=Va(e);if(!el(e))return n;let r=$l(e,t);for(;r&&al(r)&&"static"===Ya(r).position;)r=$l(r,t);return r&&("html"===Qa(r)||"body"===Qa(r)&&"static"===Ya(r).position&&!ll(r))?n:r||function(e){let t=ml(e);for(;el(t)&&!cl(t);){if(ll(t))return t;t=ml(t)}return null}(e)||n}function kl(e,t,n){const r=el(t),o=fl(t),a=gl(e,!0,"fixed"===n,t);let l={scrollLeft:0,scrollTop:0};const i={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==Qa(t)||ol(o))&&(l=pl(t)),el(t)){const e=gl(t,!0);i.x=e.x+t.clientLeft,i.y=e.y+t.clientTop}else o&&(i.x=hl(o));return{x:a.left+l.scrollLeft-i.x,y:a.top+l.scrollTop-i.y,width:a.width,height:a.height}}const xl={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=wl(e).filter((e=>tl(e)&&"body"!==Qa(e))),o=null;const a="fixed"===Ya(e).position;let l=a?ml(e):e;for(;tl(l)&&!cl(l);){const e=Ya(l),t=ll(l);"fixed"===e.position?o=null:(a?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==l)),l=ml(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=a[0],i=a.reduce(((e,n)=>{const r=vl(t,n,o);return e.top=Ga(r.top,e.top),e.right=qa(r.right,e.right),e.bottom=qa(r.bottom,e.bottom),e.left=Ga(r.left,e.left),e}),vl(t,l,o));return{width:i.right-i.left,height:i.bottom-i.top,x:i.left,y:i.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=el(n),a=fl(n);if(n===a)return t;let l={scrollLeft:0,scrollTop:0},i={x:1,y:1};const c={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==Qa(n)||ol(a))&&(l=pl(n)),el(n))){const e=gl(n);i=ul(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*i.x,height:t.height*i.y,x:t.x*i.x-l.scrollLeft*i.x+c.x,y:t.y*i.y-l.scrollTop*i.y+c.y}},isElement:tl,getDimensions:function(e){return el(e)?Ka(e):e.getBoundingClientRect()},getOffsetParent:yl,getDocumentElement:fl,getScale:ul,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||yl,a=this.getDimensions;return{reference:kl(t,await o(n),r),floating:{x:0,y:0,...await a(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Ya(e).direction};function Pl(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l=!0,animationFrame:i=!1}=r,c=o&&!i,s=c||a?[...tl(e)?wl(e):e.contextElement?wl(e.contextElement):[],...wl(t)]:[];s.forEach((e=>{c&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)}));let d,u=null;if(l){let r=!0;u=new ResizeObserver((()=>{r||n(),r=!1})),tl(e)&&!i&&u.observe(e),tl(e)||!e.contextElement||i||u.observe(e.contextElement),u.observe(t)}let g=i?gl(e):null;return i&&function t(){const r=gl(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;s.forEach((e=>{c&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)})),null==(e=u)||e.disconnect(),u=null,i&&cancelAnimationFrame(d)}}const El=(e,t,n)=>{const r=new Map,o={platform:xl,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:l}=n,i=a.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));if("production"!==process.env.NODE_ENV){if(null==l&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),i.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=_a(s,r,c),g=r,f={},p=0;for(let n=0;n<i.length;n++){const{name:a,fn:h}=i[n],{x:m,y:b,data:w,reset:v}=await h({x:d,y:u,initialPlacement:r,placement:g,strategy:o,middlewareData:f,rects:s,platform:l,elements:{reference:e,floating:t}});d=null!=m?m:d,u=null!=b?b:u,f={...f,[a]:{...f[a],...w}},"production"!==process.env.NODE_ENV&&p>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),v&&p<=50&&(p++,"object"==typeof v&&(v.placement&&(g=v.placement),v.rects&&(s=!0===v.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):v.rects),({x:d,y:u}=_a(s,g,c))),n=-1)}return{x:d,y:u,placement:g,strategy:o,middlewareData:f}})(e,t,{...o,platform:a})};var Tl="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function Cl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!Cl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Cl(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function jl(e){const t=u.useRef(e);return Tl((()=>{t.current=e})),t}const Ol=d.default.createContext(void 0);function _l(){const e=d.default.useContext(Ol);if(!e)throw new Error("usePopover must be used within a <Popover> Provider");return e}function zl(e){var n,r;const o=d.default.useRef(null),{position:a="bottom",align:l="start",strategy:i="fixed"}=e,c=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:a,open:l}=e,[i,c]=u.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[s,d]=u.useState(r);Cl(s,r)||d(r);const g=u.useRef(null),f=u.useRef(null),h=u.useRef(i),m=jl(a),b=jl(o),[w,v]=u.useState(null),[$,y]=u.useState(null),k=u.useCallback((e=>{g.current!==e&&(g.current=e,v(e))}),[]),x=u.useCallback((e=>{f.current!==e&&(f.current=e,y(e))}),[]),P=u.useCallback((()=>{if(!g.current||!f.current)return;const e={placement:t,strategy:n,middleware:s};b.current&&(e.platform=b.current),El(g.current,f.current,e).then((e=>{const t={...e,isPositioned:!0};E.current&&!Cl(h.current,t)&&(h.current=t,p.flushSync((()=>{c(t)})))}))}),[s,t,n,b]);Tl((()=>{!1===l&&h.current.isPositioned&&(h.current.isPositioned=!1,c((e=>({...e,isPositioned:!1}))))}),[l]);const E=u.useRef(!1);Tl((()=>(E.current=!0,()=>{E.current=!1})),[]),Tl((()=>{if(w&&$){if(m.current)return m.current(w,$,P);P()}}),[w,$,P,m]);const T=u.useMemo((()=>({reference:g,floating:f,setReference:k,setFloating:x})),[k,x]),C=u.useMemo((()=>({reference:w,floating:$})),[w,$]);return u.useMemo((()=>({...i,update:P,refs:T,elements:C,reference:k,floating:x})),[i,P,T,C,k,x])}({placement:`${a}${"center"===l?"":`-${l}`}`,strategy:i,middleware:[Ua(10),Ha(),Wa(),{name:"arrow",fn:e=>o.current?Fa({element:o.current,padding:8}).fn(e):{}}],whileElementsMounted:Pl}),s=d.default.useCallback((e=>{o.current=e,c.update()}),[c]),[g=a,f=l]=c.placement.split("-"),h=t.useMemo((()=>{var e,t,n,r;return{strategy:i,register:{reference:c.refs.setReference,floating:c.refs.setFloating,arrow:s},result:{floating:{top:null!==(e=c.y)&&void 0!==e?e:0,left:null!==(t=c.x)&&void 0!==t?t:0},arrow:{top:null===(n=c.middlewareData.arrow)||void 0===n?void 0:n.y,left:null===(r=c.middlewareData.arrow)||void 0===r?void 0:r.x},position:g,align:f}}}),[s,c.refs.setFloating,null===(n=c.middlewareData.arrow)||void 0===n?void 0:n.x,null===(r=c.middlewareData.arrow)||void 0===r?void 0:r.y,c.refs.setReference,c.x,c.y,f,g,i]);return d.default.createElement(Ol.Provider,{value:h},e.children)}var Sl,Rl;zl.Floating=function(t){var{children:n,style:r}=t,o=e.__rest(t,["children","style"]);const{register:a,result:l,strategy:i}=_l(),c=d.default.useRef(null);return d.default.useLayoutEffect((()=>{c.current&&a.floating(c.current)}),[a]),d.default.createElement("div",Object.assign({ref:c},o,{style:Object.assign({position:i,top:l.floating.top,left:l.floating.left},r)}),n)},zl.Reference=function(t){var{children:n}=t,r=e.__rest(t,["children"]);const o=d.default.useRef(null),{register:a}=_l();return d.default.useLayoutEffect((()=>{o.current&&a.reference(o.current)}),[a]),d.default.createElement("div",Object.assign({ref:o},r),n)},exports.TooltipPosition=void 0,(Sl=exports.TooltipPosition||(exports.TooltipPosition={})).Top="top",Sl.Bottom="bottom",Sl.Left="left",Sl.Right="right",exports.TooltipAlign=void 0,(Rl=exports.TooltipAlign||(exports.TooltipAlign={})).Start="start",Rl.Center="center",Rl.End="end";const Dl=g.default.div`
|
|
1207
1207
|
display: inline-block;
|
|
1208
1208
|
|
|
1209
1209
|
position: relative;
|