@purpurds/modal 5.26.0 → 5.27.0
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/LICENSE.txt +5 -5
- package/dist/modal-content.d.ts +3 -2
- package/dist/modal-content.d.ts.map +1 -1
- package/dist/modal.cjs.js +5 -5
- package/dist/modal.cjs.js.map +1 -1
- package/dist/modal.es.js +77 -74
- package/dist/modal.es.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +9 -9
- package/src/modal-content.tsx +24 -17
- package/src/types.ts +5 -0
package/dist/LICENSE.txt
CHANGED
|
@@ -398,35 +398,35 @@ Homepage: https://radix-ui.com/primitives
|
|
|
398
398
|
---
|
|
399
399
|
|
|
400
400
|
Name: @purpurds/button
|
|
401
|
-
Version: 5.
|
|
401
|
+
Version: 5.26.0
|
|
402
402
|
License: AGPL-3.0-only
|
|
403
403
|
Private: false
|
|
404
404
|
|
|
405
405
|
---
|
|
406
406
|
|
|
407
407
|
Name: @purpurds/heading
|
|
408
|
-
Version: 5.
|
|
408
|
+
Version: 5.26.0
|
|
409
409
|
License: AGPL-3.0-only
|
|
410
410
|
Private: false
|
|
411
411
|
|
|
412
412
|
---
|
|
413
413
|
|
|
414
414
|
Name: @purpurds/icon
|
|
415
|
-
Version: 5.
|
|
415
|
+
Version: 5.26.0
|
|
416
416
|
License: AGPL-3.0-only
|
|
417
417
|
Private: false
|
|
418
418
|
|
|
419
419
|
---
|
|
420
420
|
|
|
421
421
|
Name: @purpurds/paragraph
|
|
422
|
-
Version: 5.
|
|
422
|
+
Version: 5.26.0
|
|
423
423
|
License: AGPL-3.0-only
|
|
424
424
|
Private: false
|
|
425
425
|
|
|
426
426
|
---
|
|
427
427
|
|
|
428
428
|
Name: @purpurds/visually-hidden
|
|
429
|
-
Version: 5.
|
|
429
|
+
Version: 5.26.0
|
|
430
430
|
License: AGPL-3.0-only
|
|
431
431
|
Private: false
|
|
432
432
|
|
package/dist/modal-content.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode, default as React } from 'react';
|
|
2
|
+
import { DataAttributes } from './types';
|
|
2
3
|
|
|
3
4
|
export declare const primaryActionVariants: readonly ["primary", "expressive", "destructive"];
|
|
4
5
|
export type PrimaryActionVariant = (typeof primaryActionVariants)[number];
|
|
@@ -7,14 +8,14 @@ export type DefaultProps = {
|
|
|
7
8
|
/**
|
|
8
9
|
* An array of actions to be displayed at the bottom of the modal in the form of buttons. A maximum of 3 buttons will be rendered,
|
|
9
10
|
* */
|
|
10
|
-
actions?: {
|
|
11
|
+
actions?: ({
|
|
11
12
|
label: string;
|
|
12
13
|
onClick: () => void;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
loading?: boolean;
|
|
15
16
|
icon?: ReactNode;
|
|
16
17
|
iconPosition?: "left" | "right";
|
|
17
|
-
}[];
|
|
18
|
+
} & DataAttributes)[];
|
|
18
19
|
children: ReactNode;
|
|
19
20
|
className?: string;
|
|
20
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["../src/modal-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAA+D,MAAM,OAAO,CAAC;AASpF,OAAO,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["../src/modal-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAA+D,MAAM,OAAO,CAAC;AASpF,OAAO,+BAA+B,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,qBAAqB,mDAAoD,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC;IACzB;;SAEK;IACL,OAAO,CAAC,EAAE,CAAC;QACT,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;KACjC,GAAG,cAAc,CAAC,EAAE,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;SAEK;IACL,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;SAEK;IACL,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;;SAEK;IACL,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;SAEK;IACL,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;SAEK;IACL,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;SAGK;IACL,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C;;SAEK;IACL,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;SAEK;IACL,KAAK,EAAE,MAAM,CAAC;IACd;;SAEK;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB;;SAEK;IACL,oBAAoB,CAAC,EAAE,KAAK,CAAC;IAC7B;;SAEK;IACL,eAAe,CAAC,EAAE,KAAK,CAAC;CACzB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB;;SAEK;IACL,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;SAEK;IACL,eAAe,EAAE,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,CAAC,gBAAgB,GAAG,kBAAkB,CAAC,CAAC;AASvF,eAAO,MAAM,YAAY;2BAiB2B,SAAS,GAAG,YAAY,GAAG,aAAa;yCAgJ3F,CAAC;AA0BF,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,eAAO,MAAM,YAAY,qDAItB,IAAI,CAAC,iBAAiB,EAAE,SAAS,GAAG,cAAc,CAAC,GAAG;IACvD,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C,6BA6CA,CAAC"}
|
package/dist/modal.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),u=require("react"),we=require("react-dom");function xt(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const _=xt(u);function O(){return O=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},O.apply(null,arguments)}function M(e,n,{checkForDefaultPrevented:t=!0}={}){return function(a){if(e==null||e(a),t===!1||!a.defaultPrevented)return n==null?void 0:n(a)}}function wt(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function He(...e){return n=>e.forEach(t=>wt(t,n))}function H(...e){return u.useCallback(He(...e),e)}function Ct(e,n){const t=u.createContext(n);function o(r){const{children:c,...i}=r,s=u.useMemo(()=>i,Object.values(i));return u.createElement(t.Provider,{value:s},c)}function a(r){const c=u.useContext(t);if(c)return c;if(n!==void 0)return n;throw new Error(`\`${r}\` must be used within \`${e}\``)}return o.displayName=e+"Provider",[o,a]}function St(e,n=[]){let t=[];function o(r,c){const i=u.createContext(c),s=t.length;t=[...t,c];function f(d){const{scope:h,children:v,...E}=d,l=(h==null?void 0:h[e][s])||i,m=u.useMemo(()=>E,Object.values(E));return u.createElement(l.Provider,{value:m},v)}function p(d,h){const v=(h==null?void 0:h[e][s])||i,E=u.useContext(v);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${d}\` must be used within \`${r}\``)}return f.displayName=r+"Provider",[f,p]}const a=()=>{const r=t.map(c=>u.createContext(c));return function(i){const s=(i==null?void 0:i[e])||r;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return a.scopeName=e,[o,Ot(a,...n)]}function Ot(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(r){const c=o.reduce((i,{useScope:s,scopeName:f})=>{const d=s(r)[`__scope${f}`];return{...i,...d}},{});return u.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return t.scopeName=n.scopeName,t}const _e=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},Nt=_.useId||(()=>{});let Pt=0;function le(e){const[n,t]=_.useState(Nt());return _e(()=>{e||t(o=>o??String(Pt++))},[e]),e||(n?`radix-${n}`:"")}function F(e){const n=u.useRef(e);return u.useEffect(()=>{n.current=e}),u.useMemo(()=>(...t)=>{var o;return(o=n.current)===null||o===void 0?void 0:o.call(n,...t)},[])}function Rt({prop:e,defaultProp:n,onChange:t=()=>{}}){const[o,a]=At({defaultProp:n,onChange:t}),r=e!==void 0,c=r?e:o,i=F(t),s=u.useCallback(f=>{if(r){const d=typeof f=="function"?f(e):f;d!==e&&i(d)}else a(f)},[r,e,a,i]);return[c,s]}function At({defaultProp:e,onChange:n}){const t=u.useState(e),[o]=t,a=u.useRef(o),r=F(n);return u.useEffect(()=>{a.current!==o&&(r(o),a.current=o)},[o,a,r]),t}const Ce=u.forwardRef((e,n)=>{const{children:t,...o}=e,a=u.Children.toArray(t),r=a.find(Dt);if(r){const c=r.props.children,i=a.map(s=>s===r?u.Children.count(c)>1?u.Children.only(null):u.isValidElement(c)?c.props.children:null:s);return u.createElement(be,O({},o,{ref:n}),u.isValidElement(c)?u.cloneElement(c,void 0,i):null)}return u.createElement(be,O({},o,{ref:n}),t)});Ce.displayName="Slot";const be=u.forwardRef((e,n)=>{const{children:t,...o}=e;return u.isValidElement(t)?u.cloneElement(t,{...jt(o,t.props),ref:n?He(n,t.ref):t.ref}):u.Children.count(t)>1?u.Children.only(null):null});be.displayName="SlotClone";const Tt=({children:e})=>u.createElement(u.Fragment,null,e);function Dt(e){return u.isValidElement(e)&&e.type===Tt}function jt(e,n){const t={...n};for(const o in n){const a=e[o],r=n[o];/^on[A-Z]/.test(o)?a&&r?t[o]=(...i)=>{r(...i),a(...i)}:a&&(t[o]=a):o==="style"?t[o]={...a,...r}:o==="className"&&(t[o]=[a,r].filter(Boolean).join(" "))}return{...e,...t}}const Mt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],k=Mt.reduce((e,n)=>{const t=u.forwardRef((o,a)=>{const{asChild:r,...c}=o,i=r?Ce:n;return u.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),u.createElement(i,O({},c,{ref:a}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{});function kt(e,n){e&&we.flushSync(()=>e.dispatchEvent(n))}function It(e,n=globalThis==null?void 0:globalThis.document){const t=F(e);u.useEffect(()=>{const o=a=>{a.key==="Escape"&&t(a)};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)},[t,n])}const $e="dismissableLayer.update",Lt="dismissableLayer.pointerDownOutside",Ft="dismissableLayer.focusOutside";let Ne;const Bt=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wt=u.forwardRef((e,n)=>{var t;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:i,onDismiss:s,...f}=e,p=u.useContext(Bt),[d,h]=u.useState(null),v=(t=d==null?void 0:d.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,E]=u.useState({}),l=H(n,x=>h(x)),m=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=m.indexOf(b),y=d?m.indexOf(d):-1,$=p.layersWithOutsidePointerEventsDisabled.size>0,w=y>=C,I=Ut(x=>{const R=x.target,Z=[...p.branches].some(A=>A.contains(R));!w||Z||(r==null||r(x),i==null||i(x),x.defaultPrevented||s==null||s())},v),P=qt(x=>{const R=x.target;[...p.branches].some(A=>A.contains(R))||(c==null||c(x),i==null||i(x),x.defaultPrevented||s==null||s())},v);return It(x=>{y===p.layers.size-1&&(a==null||a(x),!x.defaultPrevented&&s&&(x.preventDefault(),s()))},v),u.useEffect(()=>{if(d)return o&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Ne=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(d)),p.layers.add(d),Pe(),()=>{o&&p.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Ne)}},[d,v,o,p]),u.useEffect(()=>()=>{d&&(p.layers.delete(d),p.layersWithOutsidePointerEventsDisabled.delete(d),Pe())},[d,p]),u.useEffect(()=>{const x=()=>E({});return document.addEventListener($e,x),()=>document.removeEventListener($e,x)},[]),u.createElement(k.div,O({},f,{ref:l,style:{pointerEvents:$?w?"auto":"none":void 0,...e.style},onFocusCapture:M(e.onFocusCapture,P.onFocusCapture),onBlurCapture:M(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:M(e.onPointerDownCapture,I.onPointerDownCapture)}))});function Ut(e,n=globalThis==null?void 0:globalThis.document){const t=F(e),o=u.useRef(!1),a=u.useRef(()=>{});return u.useEffect(()=>{const r=i=>{if(i.target&&!o.current){let f=function(){Ke(Lt,t,s,{discrete:!0})};const s={originalEvent:i};i.pointerType==="touch"?(n.removeEventListener("click",a.current),a.current=f,n.addEventListener("click",a.current,{once:!0})):f()}else n.removeEventListener("click",a.current);o.current=!1},c=window.setTimeout(()=>{n.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(c),n.removeEventListener("pointerdown",r),n.removeEventListener("click",a.current)}},[n,t]),{onPointerDownCapture:()=>o.current=!0}}function qt(e,n=globalThis==null?void 0:globalThis.document){const t=F(e),o=u.useRef(!1);return u.useEffect(()=>{const a=r=>{r.target&&!o.current&&Ke(Ft,t,{originalEvent:r},{discrete:!1})};return n.addEventListener("focusin",a),()=>n.removeEventListener("focusin",a)},[n,t]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Pe(){const e=new CustomEvent($e);document.dispatchEvent(e)}function Ke(e,n,t,{discrete:o}){const a=t.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&a.addEventListener(e,n,{once:!0}),o?kt(a,r):a.dispatchEvent(r)}const de="focusScope.autoFocusOnMount",fe="focusScope.autoFocusOnUnmount",Re={bubbles:!1,cancelable:!0},zt=u.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:r,...c}=e,[i,s]=u.useState(null),f=F(a),p=F(r),d=u.useRef(null),h=H(n,l=>s(l)),v=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(o){let l=function(y){if(v.paused||!i)return;const $=y.target;i.contains($)?d.current=$:j(d.current,{select:!0})},m=function(y){if(v.paused||!i)return;const $=y.relatedTarget;$!==null&&(i.contains($)||j(d.current,{select:!0}))},b=function(y){if(document.activeElement===document.body)for(const w of y)w.removedNodes.length>0&&j(i)};document.addEventListener("focusin",l),document.addEventListener("focusout",m);const C=new MutationObserver(b);return i&&C.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",m),C.disconnect()}}},[o,i,v.paused]),u.useEffect(()=>{if(i){Te.add(v);const l=document.activeElement;if(!i.contains(l)){const b=new CustomEvent(de,Re);i.addEventListener(de,f),i.dispatchEvent(b),b.defaultPrevented||(Vt(Yt(Ge(i)),{select:!0}),document.activeElement===l&&j(i))}return()=>{i.removeEventListener(de,f),setTimeout(()=>{const b=new CustomEvent(fe,Re);i.addEventListener(fe,p),i.dispatchEvent(b),b.defaultPrevented||j(l??document.body,{select:!0}),i.removeEventListener(fe,p),Te.remove(v)},0)}}},[i,f,p,v]);const E=u.useCallback(l=>{if(!t&&!o||v.paused)return;const m=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,b=document.activeElement;if(m&&b){const C=l.currentTarget,[y,$]=Ht(C);y&&$?!l.shiftKey&&b===$?(l.preventDefault(),t&&j(y,{select:!0})):l.shiftKey&&b===y&&(l.preventDefault(),t&&j($,{select:!0})):b===C&&l.preventDefault()}},[t,o,v.paused]);return u.createElement(k.div,O({tabIndex:-1},c,{ref:h,onKeyDown:E}))});function Vt(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(j(o,{select:n}),document.activeElement!==t)return}function Ht(e){const n=Ge(e),t=Ae(n,e),o=Ae(n.reverse(),e);return[t,o]}function Ge(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function Ae(e,n){for(const t of e)if(!Kt(t,{upTo:n}))return t}function Kt(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Gt(e){return e instanceof HTMLInputElement&&"select"in e}function j(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&Gt(e)&&n&&e.select()}}const Te=Xt();function Xt(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=De(e,n),e.unshift(n)},remove(n){var t;e=De(e,n),(t=e[0])===null||t===void 0||t.resume()}}}function De(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function Yt(e){return e.filter(n=>n.tagName!=="A")}const Zt=u.forwardRef((e,n)=>{var t;const{container:o=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...a}=e;return o?we.createPortal(u.createElement(k.div,O({},a,{ref:n})),o):null});function Qt(e,n){return u.useReducer((t,o)=>{const a=n[t][o];return a??t},e)}const ie=e=>{const{present:n,children:t}=e,o=Jt(n),a=typeof t=="function"?t({present:o.isPresent}):u.Children.only(t),r=H(o.ref,a.ref);return typeof t=="function"||o.isPresent?u.cloneElement(a,{ref:r}):null};ie.displayName="Presence";function Jt(e){const[n,t]=u.useState(),o=u.useRef({}),a=u.useRef(e),r=u.useRef("none"),c=e?"mounted":"unmounted",[i,s]=Qt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const f=Q(o.current);r.current=i==="mounted"?f:"none"},[i]),_e(()=>{const f=o.current,p=a.current;if(p!==e){const h=r.current,v=Q(f);e?s("MOUNT"):v==="none"||(f==null?void 0:f.display)==="none"?s("UNMOUNT"):s(p&&h!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,s]),_e(()=>{if(n){const f=d=>{const v=Q(o.current).includes(d.animationName);d.target===n&&v&&we.flushSync(()=>s("ANIMATION_END"))},p=d=>{d.target===n&&(r.current=Q(o.current))};return n.addEventListener("animationstart",p),n.addEventListener("animationcancel",f),n.addEventListener("animationend",f),()=>{n.removeEventListener("animationstart",p),n.removeEventListener("animationcancel",f),n.removeEventListener("animationend",f)}}else s("ANIMATION_END")},[n,s]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:u.useCallback(f=>{f&&(o.current=getComputedStyle(f)),t(f)},[])}}function Q(e){return(e==null?void 0:e.animationName)||"none"}let pe=0;function en(){u.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!==null&&e!==void 0?e:je()),document.body.insertAdjacentElement("beforeend",(n=t[1])!==null&&n!==void 0?n:je()),pe++,()=>{pe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),pe--}},[])}function je(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var D=function(){return D=Object.assign||function(n){for(var t,o=1,a=arguments.length;o<a;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},D.apply(this,arguments)};function Xe(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)n.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]]);return t}function tn(e,n,t){if(t||arguments.length===2)for(var o=0,a=n.length,r;o<a;o++)(r||!(o in n))&&(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var ae="right-scroll-bar-position",ce="width-before-scroll-bar",nn="with-scroll-bars-hidden",rn="--removed-body-scroll-bar-size";function ve(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function on(e,n){var t=u.useState(function(){return{value:e,callback:n,facade:{get current(){return t.value},set current(o){var a=t.value;a!==o&&(t.value=o,t.callback(o,a))}}}})[0];return t.callback=n,t.facade}var an=typeof window<"u"?_.useLayoutEffect:_.useEffect,Me=new WeakMap;function cn(e,n){var t=on(null,function(o){return e.forEach(function(a){return ve(a,o)})});return an(function(){var o=Me.get(t);if(o){var a=new Set(o),r=new Set(e),c=t.current;a.forEach(function(i){r.has(i)||ve(i,null)}),r.forEach(function(i){a.has(i)||ve(i,c)})}Me.set(t,e)},[e]),t}function un(e){return e}function sn(e,n){n===void 0&&(n=un);var t=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:e},useMedium:function(r){var c=n(r,o);return t.push(c),function(){t=t.filter(function(i){return i!==c})}},assignSyncMedium:function(r){for(o=!0;t.length;){var c=t;t=[],c.forEach(r)}t={push:function(i){return r(i)},filter:function(){return t}}},assignMedium:function(r){o=!0;var c=[];if(t.length){var i=t;t=[],i.forEach(r),c=t}var s=function(){var p=c;c=[],p.forEach(r)},f=function(){return Promise.resolve().then(s)};f(),t={push:function(p){c.push(p),f()},filter:function(p){return c=c.filter(p),t}}}};return a}function ln(e){e===void 0&&(e={});var n=sn(null);return n.options=D({async:!0,ssr:!1},e),n}var Ye=function(e){var n=e.sideCar,t=Xe(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return _.createElement(o,D({},t))};Ye.isSideCarExport=!0;function dn(e,n){return e.useMedium(n),Ye}var Ze=ln(),he=function(){},ue=_.forwardRef(function(e,n){var t=_.useRef(null),o=_.useState({onScrollCapture:he,onWheelCapture:he,onTouchMoveCapture:he}),a=o[0],r=o[1],c=e.forwardProps,i=e.children,s=e.className,f=e.removeScrollBar,p=e.enabled,d=e.shards,h=e.sideCar,v=e.noIsolation,E=e.inert,l=e.allowPinchZoom,m=e.as,b=m===void 0?"div":m,C=Xe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),y=h,$=cn([t,n]),w=D(D({},C),a);return _.createElement(_.Fragment,null,p&&_.createElement(y,{sideCar:Ze,removeScrollBar:f,shards:d,noIsolation:v,inert:E,setCallbacks:r,allowPinchZoom:!!l,lockRef:t}),c?_.cloneElement(_.Children.only(i),D(D({},w),{ref:$})):_.createElement(b,D({},w,{className:s,ref:$}),i))});ue.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ue.classNames={fullWidth:ce,zeroRight:ae};var fn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=fn();return n&&e.setAttribute("nonce",n),e}function vn(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function hn(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var mn=function(){var e=0,n=null;return{add:function(t){e==0&&(n=pn())&&(vn(n,t),hn(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},gn=function(){var e=mn();return function(n,t){_.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&t])}},Qe=function(){var e=gn(),n=function(t){var o=t.styles,a=t.dynamic;return e(o,a),null};return n},_n={left:0,top:0,right:0,gap:0},me=function(e){return parseInt(e||"",10)||0},bn=function(e){var n=window.getComputedStyle(document.body),t=n[e==="padding"?"paddingLeft":"marginLeft"],o=n[e==="padding"?"paddingTop":"marginTop"],a=n[e==="padding"?"paddingRight":"marginRight"];return[me(t),me(o),me(a)]},$n=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _n;var n=bn(e),t=document.documentElement.clientWidth,o=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,o-t+n[2]-n[0])}},yn=Qe(),q="data-scroll-locked",En=function(e,n,t,o){var a=e.left,r=e.top,c=e.right,i=e.gap;return t===void 0&&(t="margin"),`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),u=require("react"),we=require("react-dom");function xt(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const _=xt(u);function O(){return O=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},O.apply(null,arguments)}function M(e,n,{checkForDefaultPrevented:t=!0}={}){return function(a){if(e==null||e(a),t===!1||!a.defaultPrevented)return n==null?void 0:n(a)}}function wt(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function He(...e){return n=>e.forEach(t=>wt(t,n))}function H(...e){return u.useCallback(He(...e),e)}function Ct(e,n){const t=u.createContext(n);function o(r){const{children:c,...i}=r,s=u.useMemo(()=>i,Object.values(i));return u.createElement(t.Provider,{value:s},c)}function a(r){const c=u.useContext(t);if(c)return c;if(n!==void 0)return n;throw new Error(`\`${r}\` must be used within \`${e}\``)}return o.displayName=e+"Provider",[o,a]}function St(e,n=[]){let t=[];function o(r,c){const i=u.createContext(c),s=t.length;t=[...t,c];function f(d){const{scope:v,children:h,...E}=d,l=(v==null?void 0:v[e][s])||i,m=u.useMemo(()=>E,Object.values(E));return u.createElement(l.Provider,{value:m},h)}function p(d,v){const h=(v==null?void 0:v[e][s])||i,E=u.useContext(h);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${d}\` must be used within \`${r}\``)}return f.displayName=r+"Provider",[f,p]}const a=()=>{const r=t.map(c=>u.createContext(c));return function(i){const s=(i==null?void 0:i[e])||r;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return a.scopeName=e,[o,Ot(a,...n)]}function Ot(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(r){const c=o.reduce((i,{useScope:s,scopeName:f})=>{const d=s(r)[`__scope${f}`];return{...i,...d}},{});return u.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return t.scopeName=n.scopeName,t}const _e=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},Nt=_.useId||(()=>{});let Pt=0;function le(e){const[n,t]=_.useState(Nt());return _e(()=>{e||t(o=>o??String(Pt++))},[e]),e||(n?`radix-${n}`:"")}function F(e){const n=u.useRef(e);return u.useEffect(()=>{n.current=e}),u.useMemo(()=>(...t)=>{var o;return(o=n.current)===null||o===void 0?void 0:o.call(n,...t)},[])}function Rt({prop:e,defaultProp:n,onChange:t=()=>{}}){const[o,a]=At({defaultProp:n,onChange:t}),r=e!==void 0,c=r?e:o,i=F(t),s=u.useCallback(f=>{if(r){const d=typeof f=="function"?f(e):f;d!==e&&i(d)}else a(f)},[r,e,a,i]);return[c,s]}function At({defaultProp:e,onChange:n}){const t=u.useState(e),[o]=t,a=u.useRef(o),r=F(n);return u.useEffect(()=>{a.current!==o&&(r(o),a.current=o)},[o,a,r]),t}const Ce=u.forwardRef((e,n)=>{const{children:t,...o}=e,a=u.Children.toArray(t),r=a.find(Dt);if(r){const c=r.props.children,i=a.map(s=>s===r?u.Children.count(c)>1?u.Children.only(null):u.isValidElement(c)?c.props.children:null:s);return u.createElement(be,O({},o,{ref:n}),u.isValidElement(c)?u.cloneElement(c,void 0,i):null)}return u.createElement(be,O({},o,{ref:n}),t)});Ce.displayName="Slot";const be=u.forwardRef((e,n)=>{const{children:t,...o}=e;return u.isValidElement(t)?u.cloneElement(t,{...jt(o,t.props),ref:n?He(n,t.ref):t.ref}):u.Children.count(t)>1?u.Children.only(null):null});be.displayName="SlotClone";const Tt=({children:e})=>u.createElement(u.Fragment,null,e);function Dt(e){return u.isValidElement(e)&&e.type===Tt}function jt(e,n){const t={...n};for(const o in n){const a=e[o],r=n[o];/^on[A-Z]/.test(o)?a&&r?t[o]=(...i)=>{r(...i),a(...i)}:a&&(t[o]=a):o==="style"?t[o]={...a,...r}:o==="className"&&(t[o]=[a,r].filter(Boolean).join(" "))}return{...e,...t}}const Mt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],k=Mt.reduce((e,n)=>{const t=u.forwardRef((o,a)=>{const{asChild:r,...c}=o,i=r?Ce:n;return u.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),u.createElement(i,O({},c,{ref:a}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{});function kt(e,n){e&&we.flushSync(()=>e.dispatchEvent(n))}function It(e,n=globalThis==null?void 0:globalThis.document){const t=F(e);u.useEffect(()=>{const o=a=>{a.key==="Escape"&&t(a)};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)},[t,n])}const $e="dismissableLayer.update",Lt="dismissableLayer.pointerDownOutside",Ft="dismissableLayer.focusOutside";let Ne;const Bt=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wt=u.forwardRef((e,n)=>{var t;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:i,onDismiss:s,...f}=e,p=u.useContext(Bt),[d,v]=u.useState(null),h=(t=d==null?void 0:d.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,E]=u.useState({}),l=H(n,x=>v(x)),m=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=m.indexOf(b),y=d?m.indexOf(d):-1,$=p.layersWithOutsidePointerEventsDisabled.size>0,w=y>=C,I=Ut(x=>{const R=x.target,Z=[...p.branches].some(A=>A.contains(R));!w||Z||(r==null||r(x),i==null||i(x),x.defaultPrevented||s==null||s())},h),P=qt(x=>{const R=x.target;[...p.branches].some(A=>A.contains(R))||(c==null||c(x),i==null||i(x),x.defaultPrevented||s==null||s())},h);return It(x=>{y===p.layers.size-1&&(a==null||a(x),!x.defaultPrevented&&s&&(x.preventDefault(),s()))},h),u.useEffect(()=>{if(d)return o&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Ne=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(d)),p.layers.add(d),Pe(),()=>{o&&p.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ne)}},[d,h,o,p]),u.useEffect(()=>()=>{d&&(p.layers.delete(d),p.layersWithOutsidePointerEventsDisabled.delete(d),Pe())},[d,p]),u.useEffect(()=>{const x=()=>E({});return document.addEventListener($e,x),()=>document.removeEventListener($e,x)},[]),u.createElement(k.div,O({},f,{ref:l,style:{pointerEvents:$?w?"auto":"none":void 0,...e.style},onFocusCapture:M(e.onFocusCapture,P.onFocusCapture),onBlurCapture:M(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:M(e.onPointerDownCapture,I.onPointerDownCapture)}))});function Ut(e,n=globalThis==null?void 0:globalThis.document){const t=F(e),o=u.useRef(!1),a=u.useRef(()=>{});return u.useEffect(()=>{const r=i=>{if(i.target&&!o.current){let f=function(){Ke(Lt,t,s,{discrete:!0})};const s={originalEvent:i};i.pointerType==="touch"?(n.removeEventListener("click",a.current),a.current=f,n.addEventListener("click",a.current,{once:!0})):f()}else n.removeEventListener("click",a.current);o.current=!1},c=window.setTimeout(()=>{n.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(c),n.removeEventListener("pointerdown",r),n.removeEventListener("click",a.current)}},[n,t]),{onPointerDownCapture:()=>o.current=!0}}function qt(e,n=globalThis==null?void 0:globalThis.document){const t=F(e),o=u.useRef(!1);return u.useEffect(()=>{const a=r=>{r.target&&!o.current&&Ke(Ft,t,{originalEvent:r},{discrete:!1})};return n.addEventListener("focusin",a),()=>n.removeEventListener("focusin",a)},[n,t]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Pe(){const e=new CustomEvent($e);document.dispatchEvent(e)}function Ke(e,n,t,{discrete:o}){const a=t.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&a.addEventListener(e,n,{once:!0}),o?kt(a,r):a.dispatchEvent(r)}const de="focusScope.autoFocusOnMount",fe="focusScope.autoFocusOnUnmount",Re={bubbles:!1,cancelable:!0},zt=u.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:r,...c}=e,[i,s]=u.useState(null),f=F(a),p=F(r),d=u.useRef(null),v=H(n,l=>s(l)),h=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(o){let l=function(y){if(h.paused||!i)return;const $=y.target;i.contains($)?d.current=$:j(d.current,{select:!0})},m=function(y){if(h.paused||!i)return;const $=y.relatedTarget;$!==null&&(i.contains($)||j(d.current,{select:!0}))},b=function(y){if(document.activeElement===document.body)for(const w of y)w.removedNodes.length>0&&j(i)};document.addEventListener("focusin",l),document.addEventListener("focusout",m);const C=new MutationObserver(b);return i&&C.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",m),C.disconnect()}}},[o,i,h.paused]),u.useEffect(()=>{if(i){Te.add(h);const l=document.activeElement;if(!i.contains(l)){const b=new CustomEvent(de,Re);i.addEventListener(de,f),i.dispatchEvent(b),b.defaultPrevented||(Vt(Yt(Ge(i)),{select:!0}),document.activeElement===l&&j(i))}return()=>{i.removeEventListener(de,f),setTimeout(()=>{const b=new CustomEvent(fe,Re);i.addEventListener(fe,p),i.dispatchEvent(b),b.defaultPrevented||j(l??document.body,{select:!0}),i.removeEventListener(fe,p),Te.remove(h)},0)}}},[i,f,p,h]);const E=u.useCallback(l=>{if(!t&&!o||h.paused)return;const m=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,b=document.activeElement;if(m&&b){const C=l.currentTarget,[y,$]=Ht(C);y&&$?!l.shiftKey&&b===$?(l.preventDefault(),t&&j(y,{select:!0})):l.shiftKey&&b===y&&(l.preventDefault(),t&&j($,{select:!0})):b===C&&l.preventDefault()}},[t,o,h.paused]);return u.createElement(k.div,O({tabIndex:-1},c,{ref:v,onKeyDown:E}))});function Vt(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(j(o,{select:n}),document.activeElement!==t)return}function Ht(e){const n=Ge(e),t=Ae(n,e),o=Ae(n.reverse(),e);return[t,o]}function Ge(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function Ae(e,n){for(const t of e)if(!Kt(t,{upTo:n}))return t}function Kt(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Gt(e){return e instanceof HTMLInputElement&&"select"in e}function j(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&Gt(e)&&n&&e.select()}}const Te=Xt();function Xt(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=De(e,n),e.unshift(n)},remove(n){var t;e=De(e,n),(t=e[0])===null||t===void 0||t.resume()}}}function De(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function Yt(e){return e.filter(n=>n.tagName!=="A")}const Zt=u.forwardRef((e,n)=>{var t;const{container:o=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...a}=e;return o?we.createPortal(u.createElement(k.div,O({},a,{ref:n})),o):null});function Qt(e,n){return u.useReducer((t,o)=>{const a=n[t][o];return a??t},e)}const ie=e=>{const{present:n,children:t}=e,o=Jt(n),a=typeof t=="function"?t({present:o.isPresent}):u.Children.only(t),r=H(o.ref,a.ref);return typeof t=="function"||o.isPresent?u.cloneElement(a,{ref:r}):null};ie.displayName="Presence";function Jt(e){const[n,t]=u.useState(),o=u.useRef({}),a=u.useRef(e),r=u.useRef("none"),c=e?"mounted":"unmounted",[i,s]=Qt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const f=Q(o.current);r.current=i==="mounted"?f:"none"},[i]),_e(()=>{const f=o.current,p=a.current;if(p!==e){const v=r.current,h=Q(f);e?s("MOUNT"):h==="none"||(f==null?void 0:f.display)==="none"?s("UNMOUNT"):s(p&&v!==h?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,s]),_e(()=>{if(n){const f=d=>{const h=Q(o.current).includes(d.animationName);d.target===n&&h&&we.flushSync(()=>s("ANIMATION_END"))},p=d=>{d.target===n&&(r.current=Q(o.current))};return n.addEventListener("animationstart",p),n.addEventListener("animationcancel",f),n.addEventListener("animationend",f),()=>{n.removeEventListener("animationstart",p),n.removeEventListener("animationcancel",f),n.removeEventListener("animationend",f)}}else s("ANIMATION_END")},[n,s]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:u.useCallback(f=>{f&&(o.current=getComputedStyle(f)),t(f)},[])}}function Q(e){return(e==null?void 0:e.animationName)||"none"}let pe=0;function en(){u.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!==null&&e!==void 0?e:je()),document.body.insertAdjacentElement("beforeend",(n=t[1])!==null&&n!==void 0?n:je()),pe++,()=>{pe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),pe--}},[])}function je(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var D=function(){return D=Object.assign||function(n){for(var t,o=1,a=arguments.length;o<a;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},D.apply(this,arguments)};function Xe(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)n.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]]);return t}function tn(e,n,t){if(t||arguments.length===2)for(var o=0,a=n.length,r;o<a;o++)(r||!(o in n))&&(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var ae="right-scroll-bar-position",ce="width-before-scroll-bar",nn="with-scroll-bars-hidden",rn="--removed-body-scroll-bar-size";function ve(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function on(e,n){var t=u.useState(function(){return{value:e,callback:n,facade:{get current(){return t.value},set current(o){var a=t.value;a!==o&&(t.value=o,t.callback(o,a))}}}})[0];return t.callback=n,t.facade}var an=typeof window<"u"?_.useLayoutEffect:_.useEffect,Me=new WeakMap;function cn(e,n){var t=on(null,function(o){return e.forEach(function(a){return ve(a,o)})});return an(function(){var o=Me.get(t);if(o){var a=new Set(o),r=new Set(e),c=t.current;a.forEach(function(i){r.has(i)||ve(i,null)}),r.forEach(function(i){a.has(i)||ve(i,c)})}Me.set(t,e)},[e]),t}function un(e){return e}function sn(e,n){n===void 0&&(n=un);var t=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:e},useMedium:function(r){var c=n(r,o);return t.push(c),function(){t=t.filter(function(i){return i!==c})}},assignSyncMedium:function(r){for(o=!0;t.length;){var c=t;t=[],c.forEach(r)}t={push:function(i){return r(i)},filter:function(){return t}}},assignMedium:function(r){o=!0;var c=[];if(t.length){var i=t;t=[],i.forEach(r),c=t}var s=function(){var p=c;c=[],p.forEach(r)},f=function(){return Promise.resolve().then(s)};f(),t={push:function(p){c.push(p),f()},filter:function(p){return c=c.filter(p),t}}}};return a}function ln(e){e===void 0&&(e={});var n=sn(null);return n.options=D({async:!0,ssr:!1},e),n}var Ye=function(e){var n=e.sideCar,t=Xe(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return _.createElement(o,D({},t))};Ye.isSideCarExport=!0;function dn(e,n){return e.useMedium(n),Ye}var Ze=ln(),he=function(){},ue=_.forwardRef(function(e,n){var t=_.useRef(null),o=_.useState({onScrollCapture:he,onWheelCapture:he,onTouchMoveCapture:he}),a=o[0],r=o[1],c=e.forwardProps,i=e.children,s=e.className,f=e.removeScrollBar,p=e.enabled,d=e.shards,v=e.sideCar,h=e.noIsolation,E=e.inert,l=e.allowPinchZoom,m=e.as,b=m===void 0?"div":m,C=Xe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),y=v,$=cn([t,n]),w=D(D({},C),a);return _.createElement(_.Fragment,null,p&&_.createElement(y,{sideCar:Ze,removeScrollBar:f,shards:d,noIsolation:h,inert:E,setCallbacks:r,allowPinchZoom:!!l,lockRef:t}),c?_.cloneElement(_.Children.only(i),D(D({},w),{ref:$})):_.createElement(b,D({},w,{className:s,ref:$}),i))});ue.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ue.classNames={fullWidth:ce,zeroRight:ae};var fn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=fn();return n&&e.setAttribute("nonce",n),e}function vn(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function hn(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var mn=function(){var e=0,n=null;return{add:function(t){e==0&&(n=pn())&&(vn(n,t),hn(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},gn=function(){var e=mn();return function(n,t){_.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&t])}},Qe=function(){var e=gn(),n=function(t){var o=t.styles,a=t.dynamic;return e(o,a),null};return n},_n={left:0,top:0,right:0,gap:0},me=function(e){return parseInt(e||"",10)||0},bn=function(e){var n=window.getComputedStyle(document.body),t=n[e==="padding"?"paddingLeft":"marginLeft"],o=n[e==="padding"?"paddingTop":"marginTop"],a=n[e==="padding"?"paddingRight":"marginRight"];return[me(t),me(o),me(a)]},$n=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _n;var n=bn(e),t=document.documentElement.clientWidth,o=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,o-t+n[2]-n[0])}},yn=Qe(),q="data-scroll-locked",En=function(e,n,t,o){var a=e.left,r=e.top,c=e.right,i=e.gap;return t===void 0&&(t="margin"),`
|
|
2
2
|
.`.concat(nn,` {
|
|
3
3
|
overflow: hidden `).concat(o,`;
|
|
4
4
|
padding-right: `).concat(i,"px ").concat(o,`;
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
body[`).concat(q,`] {
|
|
36
36
|
`).concat(rn,": ").concat(i,`px;
|
|
37
37
|
}
|
|
38
|
-
`)},ke=function(){var e=parseInt(document.body.getAttribute(q)||"0",10);return isFinite(e)?e:0},xn=function(){_.useEffect(function(){return document.body.setAttribute(q,(ke()+1).toString()),function(){var e=ke()-1;e<=0?document.body.removeAttribute(q):document.body.setAttribute(q,e.toString())}},[])},wn=function(e){var n=e.noRelative,t=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;xn();var r=_.useMemo(function(){return $n(a)},[a]);return _.createElement(yn,{styles:En(r,!n,a,t?"":"!important")})},ye=!1;if(typeof window<"u")try{var J=Object.defineProperty({},"passive",{get:function(){return ye=!0,!0}});window.addEventListener("test",J,J),window.removeEventListener("test",J,J)}catch{ye=!1}var B=ye?{}:!1,Cn=function(e){return e.tagName==="TEXTAREA"},Je=function(e,n){var t=window.getComputedStyle(e);return t[n]!=="hidden"&&!(t.overflowY===t.overflowX&&!Cn(e)&&t[n]==="visible")},Sn=function(e){return Je(e,"overflowY")},On=function(e){return Je(e,"overflowX")},Ie=function(e,n){var t=n;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var o=et(e,t);if(o){var a=tt(e,t),r=a[1],c=a[2];if(r>c)return!0}t=t.parentNode}while(t&&t!==document.body);return!1},Nn=function(e){var n=e.scrollTop,t=e.scrollHeight,o=e.clientHeight;return[n,t,o]},Pn=function(e){var n=e.scrollLeft,t=e.scrollWidth,o=e.clientWidth;return[n,t,o]},et=function(e,n){return e==="v"?Sn(n):On(n)},tt=function(e,n){return e==="v"?Nn(n):Pn(n)},Rn=function(e,n){return e==="h"&&n==="rtl"?-1:1},An=function(e,n,t,o,a){var r=Rn(e,window.getComputedStyle(n).direction),c=r*o,i=t.target,s=n.contains(i),f=!1,p=c>0,d=0,
|
|
38
|
+
`)},ke=function(){var e=parseInt(document.body.getAttribute(q)||"0",10);return isFinite(e)?e:0},xn=function(){_.useEffect(function(){return document.body.setAttribute(q,(ke()+1).toString()),function(){var e=ke()-1;e<=0?document.body.removeAttribute(q):document.body.setAttribute(q,e.toString())}},[])},wn=function(e){var n=e.noRelative,t=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;xn();var r=_.useMemo(function(){return $n(a)},[a]);return _.createElement(yn,{styles:En(r,!n,a,t?"":"!important")})},ye=!1;if(typeof window<"u")try{var J=Object.defineProperty({},"passive",{get:function(){return ye=!0,!0}});window.addEventListener("test",J,J),window.removeEventListener("test",J,J)}catch{ye=!1}var B=ye?{}:!1,Cn=function(e){return e.tagName==="TEXTAREA"},Je=function(e,n){var t=window.getComputedStyle(e);return t[n]!=="hidden"&&!(t.overflowY===t.overflowX&&!Cn(e)&&t[n]==="visible")},Sn=function(e){return Je(e,"overflowY")},On=function(e){return Je(e,"overflowX")},Ie=function(e,n){var t=n;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var o=et(e,t);if(o){var a=tt(e,t),r=a[1],c=a[2];if(r>c)return!0}t=t.parentNode}while(t&&t!==document.body);return!1},Nn=function(e){var n=e.scrollTop,t=e.scrollHeight,o=e.clientHeight;return[n,t,o]},Pn=function(e){var n=e.scrollLeft,t=e.scrollWidth,o=e.clientWidth;return[n,t,o]},et=function(e,n){return e==="v"?Sn(n):On(n)},tt=function(e,n){return e==="v"?Nn(n):Pn(n)},Rn=function(e,n){return e==="h"&&n==="rtl"?-1:1},An=function(e,n,t,o,a){var r=Rn(e,window.getComputedStyle(n).direction),c=r*o,i=t.target,s=n.contains(i),f=!1,p=c>0,d=0,v=0;do{var h=tt(e,i),E=h[0],l=h[1],m=h[2],b=l-m-r*E;(E||b)&&et(e,i)&&(d+=b,v+=E),i=i.parentNode}while(!s&&i!==document.body||s&&(n.contains(i)||n===i));return(p&&(d===0||!a)||!p&&(v===0||!a))&&(f=!0),f},ee=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Le=function(e){return[e.deltaX,e.deltaY]},Fe=function(e){return e&&"current"in e?e.current:e},Tn=function(e,n){return e[0]===n[0]&&e[1]===n[1]},Dn=function(e){return`
|
|
39
39
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
40
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},jn=0,W=[];function Mn(e){var n=_.useRef([]),t=_.useRef([0,0]),o=_.useRef(),a=_.useState(jn++)[0],r=_.useState(function(){return Qe()})[0],c=_.useRef(e);_.useEffect(function(){c.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var l=tn([e.lockRef.current],(e.shards||[]).map(Fe),!0).filter(Boolean);return l.forEach(function(m){return m.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),l.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=_.useCallback(function(l,m){if("touches"in l&&l.touches.length===2)return!c.current.allowPinchZoom;var b=ee(l),C=t.current,y="deltaX"in l?l.deltaX:C[0]-b[0],$="deltaY"in l?l.deltaY:C[1]-b[1],w,I=l.target,P=Math.abs(y)>Math.abs($)?"h":"v";if("touches"in l&&P==="h"&&I.type==="range")return!1;var x=Ie(P,I);if(!x)return!0;if(x?w=P:(w=P==="v"?"h":"v",x=Ie(P,I)),!x)return!1;if(!o.current&&"changedTouches"in l&&(y||$)&&(o.current=w),!w)return!0;var R=o.current||w;return An(R,m,l,R==="h"?y:$,!0)},[]),s=_.useCallback(function(l){var m=l;if(!(!W.length||W[W.length-1]!==r)){var b="deltaY"in m?Le(m):ee(m),C=n.current.filter(function(w){return w.name===m.type&&w.target===m.target&&Tn(w.delta,b)})[0];if(C&&C.should){m.cancelable&&m.preventDefault();return}if(!C){var y=(c.current.shards||[]).map(Fe).filter(Boolean).filter(function(w){return w.contains(m.target)}),$=y.length>0?i(m,y[0]):!c.current.noIsolation;$&&m.cancelable&&m.preventDefault()}}},[]),f=_.useCallback(function(l,m,b,C){var y={name:l,delta:m,target:b,should:C};n.current.push(y),setTimeout(function(){n.current=n.current.filter(function($){return $!==y})},1)},[]),p=_.useCallback(function(l){t.current=ee(l),o.current=void 0},[]),d=_.useCallback(function(l){f(l.type,Le(l),l.target,i(l,e.lockRef.current))},[]),
|
|
41
|
+
`)},jn=0,W=[];function Mn(e){var n=_.useRef([]),t=_.useRef([0,0]),o=_.useRef(),a=_.useState(jn++)[0],r=_.useState(function(){return Qe()})[0],c=_.useRef(e);_.useEffect(function(){c.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var l=tn([e.lockRef.current],(e.shards||[]).map(Fe),!0).filter(Boolean);return l.forEach(function(m){return m.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),l.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=_.useCallback(function(l,m){if("touches"in l&&l.touches.length===2)return!c.current.allowPinchZoom;var b=ee(l),C=t.current,y="deltaX"in l?l.deltaX:C[0]-b[0],$="deltaY"in l?l.deltaY:C[1]-b[1],w,I=l.target,P=Math.abs(y)>Math.abs($)?"h":"v";if("touches"in l&&P==="h"&&I.type==="range")return!1;var x=Ie(P,I);if(!x)return!0;if(x?w=P:(w=P==="v"?"h":"v",x=Ie(P,I)),!x)return!1;if(!o.current&&"changedTouches"in l&&(y||$)&&(o.current=w),!w)return!0;var R=o.current||w;return An(R,m,l,R==="h"?y:$,!0)},[]),s=_.useCallback(function(l){var m=l;if(!(!W.length||W[W.length-1]!==r)){var b="deltaY"in m?Le(m):ee(m),C=n.current.filter(function(w){return w.name===m.type&&w.target===m.target&&Tn(w.delta,b)})[0];if(C&&C.should){m.cancelable&&m.preventDefault();return}if(!C){var y=(c.current.shards||[]).map(Fe).filter(Boolean).filter(function(w){return w.contains(m.target)}),$=y.length>0?i(m,y[0]):!c.current.noIsolation;$&&m.cancelable&&m.preventDefault()}}},[]),f=_.useCallback(function(l,m,b,C){var y={name:l,delta:m,target:b,should:C};n.current.push(y),setTimeout(function(){n.current=n.current.filter(function($){return $!==y})},1)},[]),p=_.useCallback(function(l){t.current=ee(l),o.current=void 0},[]),d=_.useCallback(function(l){f(l.type,Le(l),l.target,i(l,e.lockRef.current))},[]),v=_.useCallback(function(l){f(l.type,ee(l),l.target,i(l,e.lockRef.current))},[]);_.useEffect(function(){return W.push(r),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:v}),document.addEventListener("wheel",s,B),document.addEventListener("touchmove",s,B),document.addEventListener("touchstart",p,B),function(){W=W.filter(function(l){return l!==r}),document.removeEventListener("wheel",s,B),document.removeEventListener("touchmove",s,B),document.removeEventListener("touchstart",p,B)}},[]);var h=e.removeScrollBar,E=e.inert;return _.createElement(_.Fragment,null,E?_.createElement(r,{styles:Dn(a)}):null,h?_.createElement(wn,{gapMode:"margin"}):null)}const kn=dn(Ze,Mn);var nt=_.forwardRef(function(e,n){return _.createElement(ue,D({},e,{ref:n,sideCar:kn}))});nt.classNames=ue.classNames;var In=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},U=new WeakMap,te=new WeakMap,ne={},ge=0,rt=function(e){return e&&(e.host||rt(e.parentNode))},Ln=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=rt(t);return o&&e.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},Fn=function(e,n,t,o){var a=Ln(n,Array.isArray(e)?e:[e]);ne[t]||(ne[t]=new WeakMap);var r=ne[t],c=[],i=new Set,s=new Set(a),f=function(d){!d||i.has(d)||(i.add(d),f(d.parentNode))};a.forEach(f);var p=function(d){!d||s.has(d)||Array.prototype.forEach.call(d.children,function(v){if(i.has(v))p(v);else try{var h=v.getAttribute(o),E=h!==null&&h!=="false",l=(U.get(v)||0)+1,m=(r.get(v)||0)+1;U.set(v,l),r.set(v,m),c.push(v),l===1&&E&&te.set(v,!0),m===1&&v.setAttribute(t,"true"),E||v.setAttribute(o,"true")}catch(b){console.error("aria-hidden: cannot operate on ",v,b)}})};return p(n),i.clear(),ge++,function(){c.forEach(function(d){var v=U.get(d)-1,h=r.get(d)-1;U.set(d,v),r.set(d,h),v||(te.has(d)||d.removeAttribute(o),te.delete(d)),h||d.removeAttribute(t)}),ge--,ge||(U=new WeakMap,U=new WeakMap,te=new WeakMap,ne={})}},Bn=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=In(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live]"))),Fn(o,a,t,"aria-hidden")):function(){return null}};const ot="Dialog",[at,co]=St(ot),[Wn,T]=at(ot),Un=e=>{const{__scopeDialog:n,children:t,open:o,defaultOpen:a,onOpenChange:r,modal:c=!0}=e,i=u.useRef(null),s=u.useRef(null),[f=!1,p]=Rt({prop:o,defaultProp:a,onChange:r});return u.createElement(Wn,{scope:n,triggerRef:i,contentRef:s,contentId:le(),titleId:le(),descriptionId:le(),open:f,onOpenChange:p,onOpenToggle:u.useCallback(()=>p(d=>!d),[p]),modal:c},t)},qn="DialogTrigger",zn=u.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,a=T(qn,t),r=H(n,a.triggerRef);return u.createElement(k.button,O({type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Se(a.open)},o,{ref:r,onClick:M(e.onClick,a.onOpenToggle)}))}),ct="DialogPortal",[Vn,it]=at(ct,{forceMount:void 0}),Hn=e=>{const{__scopeDialog:n,forceMount:t,children:o,container:a}=e,r=T(ct,n);return u.createElement(Vn,{scope:n,forceMount:t},u.Children.map(o,c=>u.createElement(ie,{present:t||r.open},u.createElement(Zt,{asChild:!0,container:a},c))))},Ee="DialogOverlay",Kn=u.forwardRef((e,n)=>{const t=it(Ee,e.__scopeDialog),{forceMount:o=t.forceMount,...a}=e,r=T(Ee,e.__scopeDialog);return r.modal?u.createElement(ie,{present:o||r.open},u.createElement(Gn,O({},a,{ref:n}))):null}),Gn=u.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,a=T(Ee,t);return u.createElement(nt,{as:Ce,allowPinchZoom:!0,shards:[a.contentRef]},u.createElement(k.div,O({"data-state":Se(a.open)},o,{ref:n,style:{pointerEvents:"auto",...o.style}})))}),z="DialogContent",Xn=u.forwardRef((e,n)=>{const t=it(z,e.__scopeDialog),{forceMount:o=t.forceMount,...a}=e,r=T(z,e.__scopeDialog);return u.createElement(ie,{present:o||r.open},r.modal?u.createElement(Yn,O({},a,{ref:n})):u.createElement(Zn,O({},a,{ref:n})))}),Yn=u.forwardRef((e,n)=>{const t=T(z,e.__scopeDialog),o=u.useRef(null),a=H(n,t.contentRef,o);return u.useEffect(()=>{const r=o.current;if(r)return Bn(r)},[]),u.createElement(ut,O({},e,{ref:a,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:M(e.onCloseAutoFocus,r=>{var c;r.preventDefault(),(c=t.triggerRef.current)===null||c===void 0||c.focus()}),onPointerDownOutside:M(e.onPointerDownOutside,r=>{const c=r.detail.originalEvent,i=c.button===0&&c.ctrlKey===!0;(c.button===2||i)&&r.preventDefault()}),onFocusOutside:M(e.onFocusOutside,r=>r.preventDefault())}))}),Zn=u.forwardRef((e,n)=>{const t=T(z,e.__scopeDialog),o=u.useRef(!1),a=u.useRef(!1);return u.createElement(ut,O({},e,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var c;if((c=e.onCloseAutoFocus)===null||c===void 0||c.call(e,r),!r.defaultPrevented){var i;o.current||(i=t.triggerRef.current)===null||i===void 0||i.focus(),r.preventDefault()}o.current=!1,a.current=!1},onInteractOutside:r=>{var c,i;(c=e.onInteractOutside)===null||c===void 0||c.call(e,r),r.defaultPrevented||(o.current=!0,r.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const s=r.target;((i=t.triggerRef.current)===null||i===void 0?void 0:i.contains(s))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&a.current&&r.preventDefault()}}))}),ut=u.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:r,...c}=e,i=T(z,t),s=u.useRef(null),f=H(n,s);return en(),u.createElement(u.Fragment,null,u.createElement(zt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:r},u.createElement(Wt,O({role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Se(i.open)},c,{ref:f,onDismiss:()=>i.onOpenChange(!1)}))),!1)}),st="DialogTitle",Qn=u.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,a=T(st,t);return u.createElement(k.h2,O({id:a.titleId},o,{ref:n}))}),Jn="DialogDescription",er=u.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,a=T(Jn,t);return u.createElement(k.p,O({id:a.descriptionId},o,{ref:n}))}),tr="DialogClose",nr=u.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,a=T(tr,t);return u.createElement(k.button,O({type:"button"},o,{ref:n,onClick:M(e.onClick,()=>a.onOpenChange(!1))}))});function Se(e){return e?"open":"closed"}const rr="DialogTitleWarning";Ct(rr,{contentName:z,titleName:st,docsSlug:"dialog"});const or=Un,ar=zn,cr=Hn,ir=Kn,ur=Xn,sr=Qn,Be=er,lr=nr,dr={LG:"lg"};function fr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lt={exports:{}};/*!
|
|
42
42
|
Copyright (c) 2018 Jed Watson.
|
|
43
43
|
Licensed under the MIT License (MIT), see
|
|
44
44
|
http://jedwatson.github.io/classnames
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
Copyright (c) 2018 Jed Watson.
|
|
47
47
|
Licensed under the MIT License (MIT), see
|
|
48
48
|
http://jedwatson.github.io/classnames
|
|
49
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=a(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)n.call(r,i)&&r[i]&&(c=a(c,this&&this[i]||i));return c}function a(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(dt);var br=dt.exports;const $r=_r(br),yr={"purpur-button":"_purpur-button_1acxn_1","purpur-button--sm":"_purpur-button--sm_1acxn_33","purpur-button--icon-only":"_purpur-button--icon-only_1acxn_36","purpur-button--md":"_purpur-button--md_1acxn_39","purpur-button--lg":"_purpur-button--lg_1acxn_45","purpur-button--full-width":"_purpur-button--full-width_1acxn_51","purpur-button--primary":"_purpur-button--primary_1acxn_54","purpur-button--disabled":"_purpur-button--disabled_1acxn_58","purpur-button--primary-negative":"_purpur-button--primary-negative_1acxn_64","purpur-button--secondary":"_purpur-button--secondary_1acxn_76","purpur-button--secondary-negative":"_purpur-button--secondary-negative_1acxn_87","purpur-button--expressive":"_purpur-button--expressive_1acxn_98","purpur-button--expressive-negative":"_purpur-button--expressive-negative_1acxn_108","purpur-button--negative":"_purpur-button--negative_1acxn_120","purpur-button--destructive":"_purpur-button--destructive_1acxn_127","purpur-button--destructive-negative":"_purpur-button--destructive-negative_1acxn_137","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_1acxn_147","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_1acxn_160","purpur-button--text-negative":"_purpur-button--text-negative_1acxn_175","purpur-button--text":"_purpur-button--text_1acxn_175"},Er=$r.bind(yr),L="purpur-button",xr=({children:e,className:n,["data-testid"]:t,disabled:o=!1,fullWidth:a=!1,iconOnly:r,loading:c=!1,negative:i=!1,onClick:s,size:f="md",variant:p,type:d="button",...
|
|
49
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=a(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)n.call(r,i)&&r[i]&&(c=a(c,this&&this[i]||i));return c}function a(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(dt);var br=dt.exports;const $r=_r(br),yr={"purpur-button":"_purpur-button_1acxn_1","purpur-button--sm":"_purpur-button--sm_1acxn_33","purpur-button--icon-only":"_purpur-button--icon-only_1acxn_36","purpur-button--md":"_purpur-button--md_1acxn_39","purpur-button--lg":"_purpur-button--lg_1acxn_45","purpur-button--full-width":"_purpur-button--full-width_1acxn_51","purpur-button--primary":"_purpur-button--primary_1acxn_54","purpur-button--disabled":"_purpur-button--disabled_1acxn_58","purpur-button--primary-negative":"_purpur-button--primary-negative_1acxn_64","purpur-button--secondary":"_purpur-button--secondary_1acxn_76","purpur-button--secondary-negative":"_purpur-button--secondary-negative_1acxn_87","purpur-button--expressive":"_purpur-button--expressive_1acxn_98","purpur-button--expressive-negative":"_purpur-button--expressive-negative_1acxn_108","purpur-button--negative":"_purpur-button--negative_1acxn_120","purpur-button--destructive":"_purpur-button--destructive_1acxn_127","purpur-button--destructive-negative":"_purpur-button--destructive-negative_1acxn_137","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_1acxn_147","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_1acxn_160","purpur-button--text-negative":"_purpur-button--text-negative_1acxn_175","purpur-button--text":"_purpur-button--text_1acxn_175"},Er=$r.bind(yr),L="purpur-button",xr=({children:e,className:n,["data-testid"]:t,disabled:o=!1,fullWidth:a=!1,iconOnly:r,loading:c=!1,negative:i=!1,onClick:s,size:f="md",variant:p,type:d="button",...v},h)=>{if(r&&p==="destructive")return null;const E=Er([L,`${L}--${i?`${p}-negative`:p}`,`${L}--${f}`],{[`${L}--icon-only`]:r,[`${L}--negative`]:i,[`${L}--full-width`]:a,[`${L}--disabled`]:o||c},n),l=b=>{o||c?b.preventDefault():s&&s(b)},m=!!v["aria-disabled"]||o||c;return g.jsxs("button",{className:E,"data-testid":t,type:d,ref:h,"aria-disabled":m,onClick:l,...v,children:[c&&g.jsx(gr,{size:f===dr.LG?"xs":"xxs",negative:i,disabled:m})," ",e]})},Oe=u.forwardRef(xr);Oe.displayName="Button";function wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ft={exports:{}};/*!
|
|
50
50
|
Copyright (c) 2018 Jed Watson.
|
|
51
51
|
Licensed under the MIT License (MIT), see
|
|
52
52
|
http://jedwatson.github.io/classnames
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
Copyright (c) 2018 Jed Watson.
|
|
63
63
|
Licensed under the MIT License (MIT), see
|
|
64
64
|
http://jedwatson.github.io/classnames
|
|
65
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=a(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)n.call(r,i)&&r[i]&&(c=a(c,this&&this[i]||i));return c}function a(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($t);var Jr=$t.exports;const eo=Qr(Jr),to="_fadeIn_1ifm3_1",no={"purpur-modal-content":"_purpur-modal-content_1ifm3_1",fadeIn:to,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_1ifm3_30","purpur-modal-content__close-button":"_purpur-modal-content__close-button_1ifm3_37","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_1ifm3_48","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_1ifm3_58","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_1ifm3_62","purpur-modal-content__header":"_purpur-modal-content__header_1ifm3_85","purpur-modal-content__title":"_purpur-modal-content__title_1ifm3_98","purpur-modal-content__description":"_purpur-modal-content__description_1ifm3_101","purpur-modal-content__body":"_purpur-modal-content__body_1ifm3_104","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_1ifm3_112","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_1ifm3_124","purpur-modal-content__actions-button":"_purpur-modal-content__actions-button_1ifm3_124","purpur-modal-content__notification":"_purpur-modal-content__notification_1ifm3_147","purpur-modal-content--with-image":"_purpur-modal-content--with-image_1ifm3_150","purpur-modal-content--overflow":"_purpur-modal-content--overflow_1ifm3_150","purpur-modal-content__actions":"_purpur-modal-content__actions_1ifm3_124","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_1ifm3_181","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_1ifm3_191"},qe=e=>e.showCloseButton===!0,N=eo.bind(no),S="purpur-modal-content",ro=u.forwardRef(({["data-testid"]:e,actions:n,children:t,className:o,description:a,disableCloseOnClickOutside:r,hideDescription:c,image:i,primaryActionVariant:s="primary",stickyButtons:f=!0,title:p,notification:d=void 0,zIndex:h
|
|
65
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=a(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)n.call(r,i)&&r[i]&&(c=a(c,this&&this[i]||i));return c}function a(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($t);var Jr=$t.exports;const eo=Qr(Jr),to="_fadeIn_1ifm3_1",no={"purpur-modal-content":"_purpur-modal-content_1ifm3_1",fadeIn:to,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_1ifm3_30","purpur-modal-content__close-button":"_purpur-modal-content__close-button_1ifm3_37","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_1ifm3_48","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_1ifm3_58","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_1ifm3_62","purpur-modal-content__header":"_purpur-modal-content__header_1ifm3_85","purpur-modal-content__title":"_purpur-modal-content__title_1ifm3_98","purpur-modal-content__description":"_purpur-modal-content__description_1ifm3_101","purpur-modal-content__body":"_purpur-modal-content__body_1ifm3_104","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_1ifm3_112","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_1ifm3_124","purpur-modal-content__actions-button":"_purpur-modal-content__actions-button_1ifm3_124","purpur-modal-content__notification":"_purpur-modal-content__notification_1ifm3_147","purpur-modal-content--with-image":"_purpur-modal-content--with-image_1ifm3_150","purpur-modal-content--overflow":"_purpur-modal-content--overflow_1ifm3_150","purpur-modal-content__actions":"_purpur-modal-content__actions_1ifm3_124","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_1ifm3_181","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_1ifm3_191"},qe=e=>e.showCloseButton===!0,N=eo.bind(no),S="purpur-modal-content",ro=u.forwardRef(({["data-testid"]:e,actions:n,children:t,className:o,description:a,disableCloseOnClickOutside:r,hideDescription:c,image:i,primaryActionVariant:s="primary",stickyButtons:f=!0,title:p,notification:d=void 0,zIndex:v,...h},E)=>{const{closeButtonAllyLabel:l,showCloseButton:m,...b}=h,[C,y]=u.useState(!1),$=u.useRef(null),w=u.useRef(null),I=N([S,{[`${S}--with-image`]:!!i},{[`${S}--overflow`]:C},{[`${S}--sticky-footer`]:f},o]),P=A=>e?`${e} ${A}`:void 0,x=A=>{r&&A.preventDefault()},R=u.useCallback(()=>{if(!$.current||!w.current)return;const A=window.getComputedStyle($.current,null),yt=parseFloat(A.getPropertyValue("height")),Et=w.current.offsetHeight;y(yt<Et)},[]),Z=A=>{r&&!m&&A.preventDefault()};return u.useEffect(()=>(window.addEventListener("resize",R),()=>{window.removeEventListener("resize",R)}),[R]),u.useEffect(()=>{R()},[d,t,R]),g.jsxs(cr,{children:[g.jsx(ir,{className:N(`${S}__overlay`),style:{zIndex:v}}),g.jsxs(ur,{...b,className:I,"data-testid":e,ref:E,...!a&&{"aria-describedby":void 0},onPointerDownOutside:x,onOpenAutoFocus:R,onEscapeKeyDown:Z,style:{zIndex:`calc(${v} + 1)`},children:[g.jsxs("div",{ref:$,className:N(`${S}__wrapper`),children:[qe(h)&&l&&i&&g.jsx(ze,{allyLabel:l,hasImage:!0,"data-testid":P("close-button")}),g.jsxs("div",{ref:w,className:N(`${S}__wrapper-inner`),children:[g.jsxs("div",{className:N(`${S}__header`),children:[qe(h)&&l&&!i&&g.jsx(ze,{allyLabel:l,"data-testid":P("close-button")}),g.jsx(sr,{asChild:!0,className:N(`${S}__title`),"data-testid":P("title"),children:g.jsx(pt,{tag:"h2",variant:"title-200",children:p})})]}),i&&g.jsx("div",{className:N(`${S}__image-wrapper`),"data-testid":P("image"),children:i}),g.jsx("div",{className:N(`${S}__body`),children:g.jsxs("div",{className:N(`${S}__body-inner`),children:[a&&c&&g.jsx(Zr,{asChild:!0,children:g.jsx(Be,{"data-testid":P("description"),children:a})}),a&&!c&&g.jsx(Be,{asChild:!0,className:N(`${S}__description`),"data-testid":P("description"),children:g.jsx(_t,{variant:"paragraph-100",children:a})}),g.jsx("div",{children:t}),!f&&g.jsx(Ve,{actions:n,primaryActionVariant:s,notification:d})]})})]})]}),f&&g.jsx(Ve,{actions:n,primaryActionVariant:s,notification:d})]})]})}),ze=({allyLabel:e,hasImage:n,["data-testid"]:t})=>g.jsx(lr,{asChild:!0,children:g.jsx(Oe,{variant:n?"primary":"tertiary-purple",negative:n,size:"sm",iconOnly:!0,"aria-label":e,className:N(`${S}__close-button`),"data-testid":t,children:g.jsx(ht,{})})}),oo=3,Ve=({actions:e,primaryActionVariant:n,notification:t})=>{const o=u.useRef(null),a=[n,"secondary","text"];return u.useEffect(()=>{var r,c;t&&((c=(r=o==null?void 0:o.current)==null?void 0:r.scrollIntoView)==null||c.call(r,!1))},[t]),e&&e.length>0?g.jsxs("div",{className:N(`${S}__actions`),children:[g.jsx("div",{className:N(`${S}__actions-buttons`),"data-testid":"modal actions",children:e.slice(0,oo).map(({label:r,onClick:c,disabled:i,loading:s,iconPosition:f="right",icon:p,...d},v)=>g.jsxs(Oe,{"data-testid":"modal actions button",variant:a[v]||"",onClick:c,disabled:i,loading:s,className:N(`${S}__actions-button`),...d,children:[f==="left"&&p&&p,r,f==="right"&&p&&p]},r))}),t&&g.jsx("div",{className:N(`${S}__notification`),ref:o,children:t}),g.jsx("span",{className:N(`${S}__actions-separator`)})]}):null},ao=u.forwardRef(({["data-testid"]:e,children:n,className:t,...o},a)=>g.jsx(ar,{asChild:!0,ref:a,"data-testid":e,className:t,...o,children:n})),se=({["data-testid"]:e,children:n,open:t,onOpenChange:o})=>g.jsx(or,{open:t,onOpenChange:o,"data-testid":e,children:n});se.Trigger=ao;se.Content=ro;se.displayName="Modal";exports.Modal=se;
|
|
66
66
|
//# sourceMappingURL=modal.cjs.js.map
|