@purpurds/modal 6.7.2 → 6.8.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.map +1 -1
- package/dist/modal.cjs.js +18 -18
- package/dist/modal.cjs.js.map +1 -1
- package/dist/modal.es.js +546 -541
- package/dist/modal.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +9 -9
- package/src/modal-content.module.scss +0 -1
- package/src/modal-content.tsx +9 -0
- package/src/modal.stories.tsx +1 -1
package/dist/LICENSE.txt
CHANGED
|
@@ -387,35 +387,35 @@ Homepage: https://radix-ui.com/primitives
|
|
|
387
387
|
---
|
|
388
388
|
|
|
389
389
|
Name: @purpurds/button
|
|
390
|
-
Version: 6.7.
|
|
390
|
+
Version: 6.7.2
|
|
391
391
|
License: AGPL-3.0-only
|
|
392
392
|
Private: false
|
|
393
393
|
|
|
394
394
|
---
|
|
395
395
|
|
|
396
396
|
Name: @purpurds/heading
|
|
397
|
-
Version: 6.7.
|
|
397
|
+
Version: 6.7.2
|
|
398
398
|
License: AGPL-3.0-only
|
|
399
399
|
Private: false
|
|
400
400
|
|
|
401
401
|
---
|
|
402
402
|
|
|
403
403
|
Name: @purpurds/icon
|
|
404
|
-
Version: 6.7.
|
|
404
|
+
Version: 6.7.2
|
|
405
405
|
License: AGPL-3.0-only
|
|
406
406
|
Private: false
|
|
407
407
|
|
|
408
408
|
---
|
|
409
409
|
|
|
410
410
|
Name: @purpurds/paragraph
|
|
411
|
-
Version: 6.7.
|
|
411
|
+
Version: 6.7.2
|
|
412
412
|
License: AGPL-3.0-only
|
|
413
413
|
Private: false
|
|
414
414
|
|
|
415
415
|
---
|
|
416
416
|
|
|
417
417
|
Name: @purpurds/visually-hidden
|
|
418
|
-
Version: 6.7.
|
|
418
|
+
Version: 6.7.2
|
|
419
419
|
License: AGPL-3.0-only
|
|
420
420
|
Private: false
|
|
421
421
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["../src/modal-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,KAA+D,MAAM,OAAO,CAAC;AAgBpF,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,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;QAC9C,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;IAChB;;SAEK;IACL,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CACvC,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;2BAkB2B,SAAS,GAAG,YAAY,GAAG,aAAa;
|
|
1
|
+
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["../src/modal-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,KAA+D,MAAM,OAAO,CAAC;AAgBpF,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,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;QAC9C,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;IAChB;;SAEK;IACL,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CACvC,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;2BAkB2B,SAAS,GAAG,YAAY,GAAG,aAAa;yCAuJ3F,CAAC;AA6BF,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,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),R=require("react"),it=require("react-dom");function ut(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=ut(R),Xt=ut(it);function $(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Re(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function st(...e){return t=>{let r=!1;const o=e.map(a=>{const n=Re(a,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let a=0;a<o.length;a++){const n=o[a];typeof n=="function"?n():Re(e[a],null)}}}}function q(...e){return s.useCallback(st(...e),e)}function Yt(e,t){const r=s.createContext(t),o=n=>{const{children:i,...u}=n,f=s.useMemo(()=>u,Object.values(u));return c.jsx(r.Provider,{value:f,children:i})};o.displayName=e+"Provider";function a(n){const i=s.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}return[o,a]}function Zt(e,t=[]){let r=[];function o(n,i){const u=s.createContext(i),f=r.length;r=[...r,i];const l=v=>{var _;const{scope:h,children:g,...y}=v,d=((_=h==null?void 0:h[e])==null?void 0:_[f])||u,m=s.useMemo(()=>y,Object.values(y));return c.jsx(d.Provider,{value:m,children:g})};l.displayName=n+"Provider";function p(v,h){var d;const g=((d=h==null?void 0:h[e])==null?void 0:d[f])||u,y=s.useContext(g);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${v}\` must be used within \`${n}\``)}return[l,p]}const a=()=>{const n=r.map(i=>s.createContext(i));return function(u){const f=(u==null?void 0:u[e])||n;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return a.scopeName=e,[o,Qt(a,...t)]}function Qt(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){const i=o.reduce((u,{useScope:f,scopeName:l})=>{const v=f(n)[`__scope${l}`];return{...u,...v}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var ae=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},Jt=s.useId||(()=>{}),er=0;function le(e){const[t,r]=s.useState(Jt());return ae(()=>{r(o=>o??String(er++))},[e]),e||(t?`radix-${t}`:"")}function F(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}function tr({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,a]=rr({defaultProp:t,onChange:r}),n=e!==void 0,i=n?e:o,u=F(r),f=s.useCallback(l=>{if(n){const v=typeof l=="function"?l(e):l;v!==e&&u(v)}else a(l)},[n,e,a,u]);return[i,f]}function rr({defaultProp:e,onChange:t}){const r=s.useState(e),[o]=r,a=s.useRef(o),n=F(t);return s.useEffect(()=>{a.current!==o&&(n(o),a.current=o)},[o,a,n]),r}var xe=s.forwardRef((e,t)=>{const{children:r,...o}=e,a=s.Children.toArray(r),n=a.find(or);if(n){const i=n.props.children,u=a.map(f=>f===n?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:f);return c.jsx(ye,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return c.jsx(ye,{...o,ref:t,children:r})});xe.displayName="Slot";var ye=s.forwardRef((e,t)=>{const{children:r,...o}=e;if(s.isValidElement(r)){const a=ir(r),n=ar(o,r.props);return r.type!==s.Fragment&&(n.ref=t?st(t,a):a),s.cloneElement(r,n)}return s.Children.count(r)>1?s.Children.only(null):null});ye.displayName="SlotClone";var nr=({children:e})=>c.jsx(c.Fragment,{children:e});function or(e){return s.isValidElement(e)&&e.type===nr}function ar(e,t){const r={...t};for(const o in t){const a=e[o],n=t[o];/^on[A-Z]/.test(o)?a&&n?r[o]=(...u)=>{n(...u),a(...u)}:a&&(r[o]=a):o==="style"?r[o]={...a,...n}:o==="className"&&(r[o]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function ir(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ur=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],M=ur.reduce((e,t)=>{const r=s.forwardRef((o,a)=>{const{asChild:n,...i}=o,u=n?xe:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sr(e,t){e&&Xt.flushSync(()=>e.dispatchEvent(t))}function cr(e,t=globalThis==null?void 0:globalThis.document){const r=F(e);s.useEffect(()=>{const o=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var lr="DismissableLayer",be="dismissableLayer.update",dr="dismissableLayer.pointerDownOutside",fr="dismissableLayer.focusOutside",je,ct=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lt=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:n,onInteractOutside:i,onDismiss:u,...f}=e,l=s.useContext(ct),[p,v]=s.useState(null),h=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=s.useState({}),y=q(t,b=>v(b)),d=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=d.indexOf(m),S=p?d.indexOf(p):-1,w=l.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,x=hr(b=>{const N=b.target,I=[...l.branches].some(A=>A.contains(N));!E||I||(a==null||a(b),i==null||i(b),b.defaultPrevented||u==null||u())},h),P=mr(b=>{const N=b.target;[...l.branches].some(A=>A.contains(N))||(n==null||n(b),i==null||i(b),b.defaultPrevented||u==null||u())},h);return cr(b=>{S===l.layers.size-1&&(o==null||o(b),!b.defaultPrevented&&u&&(b.preventDefault(),u()))},h),s.useEffect(()=>{if(p)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(je=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(p)),l.layers.add(p),Ae(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=je)}},[p,h,r,l]),s.useEffect(()=>()=>{p&&(l.layers.delete(p),l.layersWithOutsidePointerEventsDisabled.delete(p),Ae())},[p,l]),s.useEffect(()=>{const b=()=>g({});return document.addEventListener(be,b),()=>document.removeEventListener(be,b)},[]),c.jsx(M.div,{...f,ref:y,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:$(e.onFocusCapture,P.onFocusCapture),onBlurCapture:$(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:$(e.onPointerDownCapture,x.onPointerDownCapture)})});lt.displayName=lr;var pr="DismissableLayerBranch",vr=s.forwardRef((e,t)=>{const r=s.useContext(ct),o=s.useRef(null),a=q(t,o);return s.useEffect(()=>{const n=o.current;if(n)return r.branches.add(n),()=>{r.branches.delete(n)}},[r.branches]),c.jsx(M.div,{...e,ref:a})});vr.displayName=pr;function hr(e,t=globalThis==null?void 0:globalThis.document){const r=F(e),o=s.useRef(!1),a=s.useRef(()=>{});return s.useEffect(()=>{const n=u=>{if(u.target&&!o.current){let f=function(){dt(dr,r,l,{discrete:!0})};const l={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=f,t.addEventListener("click",a.current,{once:!0})):f()}else t.removeEventListener("click",a.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",n)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",n),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function mr(e,t=globalThis==null?void 0:globalThis.document){const r=F(e),o=s.useRef(!1);return s.useEffect(()=>{const a=n=>{n.target&&!o.current&&dt(fr,r,{originalEvent:n},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Ae(){const e=new CustomEvent(be);document.dispatchEvent(e)}function dt(e,t,r,{discrete:o}){const a=r.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?sr(a,n):a.dispatchEvent(n)}var de="focusScope.autoFocusOnMount",fe="focusScope.autoFocusOnUnmount",De={bubbles:!1,cancelable:!0},gr="FocusScope",ft=s.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:n,...i}=e,[u,f]=s.useState(null),l=F(a),p=F(n),v=s.useRef(null),h=q(t,d=>f(d)),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let d=function(w){if(g.paused||!u)return;const E=w.target;u.contains(E)?v.current=E:T(v.current,{select:!0})},m=function(w){if(g.paused||!u)return;const E=w.relatedTarget;E!==null&&(u.contains(E)||T(v.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&T(u)};document.addEventListener("focusin",d),document.addEventListener("focusout",m);const S=new MutationObserver(_);return u&&S.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",d),document.removeEventListener("focusout",m),S.disconnect()}}},[o,u,g.paused]),s.useEffect(()=>{if(u){Te.add(g);const d=document.activeElement;if(!u.contains(d)){const _=new CustomEvent(de,De);u.addEventListener(de,l),u.dispatchEvent(_),_.defaultPrevented||(_r(xr(pt(u)),{select:!0}),document.activeElement===d&&T(u))}return()=>{u.removeEventListener(de,l),setTimeout(()=>{const _=new CustomEvent(fe,De);u.addEventListener(fe,p),u.dispatchEvent(_),_.defaultPrevented||T(d??document.body,{select:!0}),u.removeEventListener(fe,p),Te.remove(g)},0)}}},[u,l,p,g]);const y=s.useCallback(d=>{if(!r&&!o||g.paused)return;const m=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,_=document.activeElement;if(m&&_){const S=d.currentTarget,[w,E]=yr(S);w&&E?!d.shiftKey&&_===E?(d.preventDefault(),r&&T(w,{select:!0})):d.shiftKey&&_===w&&(d.preventDefault(),r&&T(E,{select:!0})):_===S&&d.preventDefault()}},[r,o,g.paused]);return c.jsx(M.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})});ft.displayName=gr;function _r(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(T(o,{select:t}),document.activeElement!==r)return}function yr(e){const t=pt(e),r=Me(t,e),o=Me(t.reverse(),e);return[r,o]}function pt(e){const t=[],r=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(;r.nextNode();)t.push(r.currentNode);return t}function Me(e,t){for(const r of e)if(!br(r,{upTo:t}))return r}function br(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function wr(e){return e instanceof HTMLInputElement&&"select"in e}function T(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&wr(e)&&t&&e.select()}}var Te=Er();function Er(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=$e(e,t),e.unshift(t)},remove(t){var r;e=$e(e,t),(r=e[0])==null||r.resume()}}}function $e(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function xr(e){return e.filter(t=>t.tagName!=="A")}var Sr="Portal",vt=s.forwardRef((e,t)=>{var u;const{container:r,...o}=e,[a,n]=s.useState(!1);ae(()=>n(!0),[]);const i=r||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return i?it.createPortal(c.jsx(M.div,{...o,ref:t}),i):null});vt.displayName=Sr;function Cr(e,t){return s.useReducer((r,o)=>t[r][o]??r,e)}var ue=e=>{const{present:t,children:r}=e,o=Nr(t),a=typeof r=="function"?r({present:o.isPresent}):s.Children.only(r),n=q(o.ref,Or(a));return typeof r=="function"||o.isPresent?s.cloneElement(a,{ref:n}):null};ue.displayName="Presence";function Nr(e){const[t,r]=s.useState(),o=s.useRef({}),a=s.useRef(e),n=s.useRef("none"),i=e?"mounted":"unmounted",[u,f]=Cr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const l=Y(o.current);n.current=u==="mounted"?l:"none"},[u]),ae(()=>{const l=o.current,p=a.current;if(p!==e){const h=n.current,g=Y(l);e?f("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?f("UNMOUNT"):f(p&&h!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),ae(()=>{if(t){let l;const p=t.ownerDocument.defaultView??window,v=g=>{const d=Y(o.current).includes(g.animationName);if(g.target===t&&d&&(f("ANIMATION_END"),!a.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=g=>{g.target===t&&(n.current=Y(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{p.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(l=>{l&&(o.current=getComputedStyle(l)),r(l)},[])}}function Y(e){return(e==null?void 0:e.animationName)||"none"}function Or(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pe=0;function Pr(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ie()),document.body.insertAdjacentElement("beforeend",e[1]??Ie()),pe++,()=>{pe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pe--}},[])}function Ie(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var D=function(){return D=Object.assign||function(t){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},D.apply(this,arguments)};function ht(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(r[o[a]]=e[o[a]]);return r}function Rr(e,t,r){if(r||arguments.length===2)for(var o=0,a=t.length,n;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var ne="right-scroll-bar-position",oe="width-before-scroll-bar",jr="with-scroll-bars-hidden",Ar="--removed-body-scroll-bar-size";function ve(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Dr(e,t){var r=R.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var a=r.value;a!==o&&(r.value=o,r.callback(o,a))}}}})[0];return r.callback=t,r.facade}var Mr=typeof window<"u"?s.useLayoutEffect:s.useEffect,Le=new WeakMap;function Tr(e,t){var r=Dr(null,function(o){return e.forEach(function(a){return ve(a,o)})});return Mr(function(){var o=Le.get(r);if(o){var a=new Set(o),n=new Set(e),i=r.current;a.forEach(function(u){n.has(u)||ve(u,null)}),n.forEach(function(u){a.has(u)||ve(u,i)})}Le.set(r,e)},[e]),r}function $r(e){return e}function Ir(e,t){t===void 0&&(t=$r);var r=[],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 r.length?r[r.length-1]:e},useMedium:function(n){var i=t(n,o);return r.push(i),function(){r=r.filter(function(u){return u!==i})}},assignSyncMedium:function(n){for(o=!0;r.length;){var i=r;r=[],i.forEach(n)}r={push:function(u){return n(u)},filter:function(){return r}}},assignMedium:function(n){o=!0;var i=[];if(r.length){var u=r;r=[],u.forEach(n),i=r}var f=function(){var p=i;i=[],p.forEach(n)},l=function(){return Promise.resolve().then(f)};l(),r={push:function(p){i.push(p),l()},filter:function(p){return i=i.filter(p),r}}}};return a}function Lr(e){e===void 0&&(e={});var t=Ir(null);return t.options=D({async:!0,ssr:!1},e),t}var mt=function(e){var t=e.sideCar,r=ht(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return s.createElement(o,D({},r))};mt.isSideCarExport=!0;function kr(e,t){return e.useMedium(t),mt}var gt=Lr(),he=function(){},se=s.forwardRef(function(e,t){var r=s.useRef(null),o=s.useState({onScrollCapture:he,onWheelCapture:he,onTouchMoveCapture:he}),a=o[0],n=o[1],i=e.forwardProps,u=e.children,f=e.className,l=e.removeScrollBar,p=e.enabled,v=e.shards,h=e.sideCar,g=e.noIsolation,y=e.inert,d=e.allowPinchZoom,m=e.as,_=m===void 0?"div":m,S=e.gapMode,w=ht(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,x=Tr([r,t]),P=D(D({},w),a);return s.createElement(s.Fragment,null,p&&s.createElement(E,{sideCar:gt,removeScrollBar:l,shards:v,noIsolation:g,inert:y,setCallbacks:n,allowPinchZoom:!!d,lockRef:r,gapMode:S}),i?s.cloneElement(s.Children.only(u),D(D({},P),{ref:x})):s.createElement(_,D({},P,{className:f,ref:x}),u))});se.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};se.classNames={fullWidth:oe,zeroRight:ne};var Fr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Fr();return t&&e.setAttribute("nonce",t),e}function qr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Br(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ur=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Wr())&&(qr(t,r),Br(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zr=function(){var e=Ur();return function(t,r){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},_t=function(){var e=zr(),t=function(r){var o=r.styles,a=r.dynamic;return e(o,a),null};return t},Vr={left:0,top:0,right:0,gap:0},me=function(e){return parseInt(e||"",10)||0},Hr=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[me(r),me(o),me(a)]},Gr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Vr;var t=Hr(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},Kr=_t(),V="data-scroll-locked",Xr=function(e,t,r,o){var a=e.left,n=e.top,i=e.right,u=e.gap;return r===void 0&&(r="margin"),`
|
|
2
|
-
.`.concat(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),O=require("react"),ut=require("react-dom");function st(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=st(O),Zt=st(ut);function $(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function je(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ct(...e){return t=>{let r=!1;const o=e.map(a=>{const n=je(a,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let a=0;a<o.length;a++){const n=o[a];typeof n=="function"?n():je(e[a],null)}}}}function q(...e){return s.useCallback(ct(...e),e)}function Qt(e,t){const r=s.createContext(t),o=n=>{const{children:i,...u}=n,p=s.useMemo(()=>u,Object.values(u));return c.jsx(r.Provider,{value:p,children:i})};o.displayName=e+"Provider";function a(n){const i=s.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}return[o,a]}function Jt(e,t=[]){let r=[];function o(n,i){const u=s.createContext(i),p=r.length;r=[...r,i];const l=v=>{var _;const{scope:h,children:g,...b}=v,d=((_=h==null?void 0:h[e])==null?void 0:_[p])||u,m=s.useMemo(()=>b,Object.values(b));return c.jsx(d.Provider,{value:m,children:g})};l.displayName=n+"Provider";function f(v,h){var d;const g=((d=h==null?void 0:h[e])==null?void 0:d[p])||u,b=s.useContext(g);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${v}\` must be used within \`${n}\``)}return[l,f]}const a=()=>{const n=r.map(i=>s.createContext(i));return function(u){const p=(u==null?void 0:u[e])||n;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:p}}),[u,p])}};return a.scopeName=e,[o,er(a,...t)]}function er(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){const i=o.reduce((u,{useScope:p,scopeName:l})=>{const v=p(n)[`__scope${l}`];return{...u,...v}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var ie=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},tr=s.useId||(()=>{}),rr=0;function de(e){const[t,r]=s.useState(tr());return ie(()=>{r(o=>o??String(rr++))},[e]),e||(t?`radix-${t}`:"")}function F(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}function nr({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,a]=or({defaultProp:t,onChange:r}),n=e!==void 0,i=n?e:o,u=F(r),p=s.useCallback(l=>{if(n){const v=typeof l=="function"?l(e):l;v!==e&&u(v)}else a(l)},[n,e,a,u]);return[i,p]}function or({defaultProp:e,onChange:t}){const r=s.useState(e),[o]=r,a=s.useRef(o),n=F(t);return s.useEffect(()=>{a.current!==o&&(n(o),a.current=o)},[o,a,n]),r}var Se=s.forwardRef((e,t)=>{const{children:r,...o}=e,a=s.Children.toArray(r),n=a.find(ir);if(n){const i=n.props.children,u=a.map(p=>p===n?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:p);return c.jsx(be,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return c.jsx(be,{...o,ref:t,children:r})});Se.displayName="Slot";var be=s.forwardRef((e,t)=>{const{children:r,...o}=e;if(s.isValidElement(r)){const a=sr(r),n=ur(o,r.props);return r.type!==s.Fragment&&(n.ref=t?ct(t,a):a),s.cloneElement(r,n)}return s.Children.count(r)>1?s.Children.only(null):null});be.displayName="SlotClone";var ar=({children:e})=>c.jsx(c.Fragment,{children:e});function ir(e){return s.isValidElement(e)&&e.type===ar}function ur(e,t){const r={...t};for(const o in t){const a=e[o],n=t[o];/^on[A-Z]/.test(o)?a&&n?r[o]=(...u)=>{n(...u),a(...u)}:a&&(r[o]=a):o==="style"?r[o]={...a,...n}:o==="className"&&(r[o]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function sr(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var cr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],M=cr.reduce((e,t)=>{const r=s.forwardRef((o,a)=>{const{asChild:n,...i}=o,u=n?Se:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function lr(e,t){e&&Zt.flushSync(()=>e.dispatchEvent(t))}function dr(e,t=globalThis==null?void 0:globalThis.document){const r=F(e);s.useEffect(()=>{const o=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var pr="DismissableLayer",we="dismissableLayer.update",fr="dismissableLayer.pointerDownOutside",vr="dismissableLayer.focusOutside",Ae,lt=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dt=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:n,onInteractOutside:i,onDismiss:u,...p}=e,l=s.useContext(lt),[f,v]=s.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=s.useState({}),b=q(t,y=>v(y)),d=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=d.indexOf(m),S=f?d.indexOf(f):-1,w=l.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,x=gr(y=>{const P=y.target,I=[...l.branches].some(A=>A.contains(P));!E||I||(a==null||a(y),i==null||i(y),y.defaultPrevented||u==null||u())},h),R=_r(y=>{const P=y.target;[...l.branches].some(A=>A.contains(P))||(n==null||n(y),i==null||i(y),y.defaultPrevented||u==null||u())},h);return dr(y=>{S===l.layers.size-1&&(o==null||o(y),!y.defaultPrevented&&u&&(y.preventDefault(),u()))},h),s.useEffect(()=>{if(f)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ae=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),De(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ae)}},[f,h,r,l]),s.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),De())},[f,l]),s.useEffect(()=>{const y=()=>g({});return document.addEventListener(we,y),()=>document.removeEventListener(we,y)},[]),c.jsx(M.div,{...p,ref:b,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:$(e.onFocusCapture,R.onFocusCapture),onBlurCapture:$(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:$(e.onPointerDownCapture,x.onPointerDownCapture)})});dt.displayName=pr;var hr="DismissableLayerBranch",mr=s.forwardRef((e,t)=>{const r=s.useContext(lt),o=s.useRef(null),a=q(t,o);return s.useEffect(()=>{const n=o.current;if(n)return r.branches.add(n),()=>{r.branches.delete(n)}},[r.branches]),c.jsx(M.div,{...e,ref:a})});mr.displayName=hr;function gr(e,t=globalThis==null?void 0:globalThis.document){const r=F(e),o=s.useRef(!1),a=s.useRef(()=>{});return s.useEffect(()=>{const n=u=>{if(u.target&&!o.current){let p=function(){pt(fr,r,l,{discrete:!0})};const l={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=p,t.addEventListener("click",a.current,{once:!0})):p()}else t.removeEventListener("click",a.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",n)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",n),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function _r(e,t=globalThis==null?void 0:globalThis.document){const r=F(e),o=s.useRef(!1);return s.useEffect(()=>{const a=n=>{n.target&&!o.current&&pt(vr,r,{originalEvent:n},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function De(){const e=new CustomEvent(we);document.dispatchEvent(e)}function pt(e,t,r,{discrete:o}){const a=r.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?lr(a,n):a.dispatchEvent(n)}var pe="focusScope.autoFocusOnMount",fe="focusScope.autoFocusOnUnmount",Me={bubbles:!1,cancelable:!0},yr="FocusScope",ft=s.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:n,...i}=e,[u,p]=s.useState(null),l=F(a),f=F(n),v=s.useRef(null),h=q(t,d=>p(d)),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let d=function(w){if(g.paused||!u)return;const E=w.target;u.contains(E)?v.current=E:T(v.current,{select:!0})},m=function(w){if(g.paused||!u)return;const E=w.relatedTarget;E!==null&&(u.contains(E)||T(v.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&T(u)};document.addEventListener("focusin",d),document.addEventListener("focusout",m);const S=new MutationObserver(_);return u&&S.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",d),document.removeEventListener("focusout",m),S.disconnect()}}},[o,u,g.paused]),s.useEffect(()=>{if(u){$e.add(g);const d=document.activeElement;if(!u.contains(d)){const _=new CustomEvent(pe,Me);u.addEventListener(pe,l),u.dispatchEvent(_),_.defaultPrevented||(br(Cr(vt(u)),{select:!0}),document.activeElement===d&&T(u))}return()=>{u.removeEventListener(pe,l),setTimeout(()=>{const _=new CustomEvent(fe,Me);u.addEventListener(fe,f),u.dispatchEvent(_),_.defaultPrevented||T(d??document.body,{select:!0}),u.removeEventListener(fe,f),$e.remove(g)},0)}}},[u,l,f,g]);const b=s.useCallback(d=>{if(!r&&!o||g.paused)return;const m=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,_=document.activeElement;if(m&&_){const S=d.currentTarget,[w,E]=wr(S);w&&E?!d.shiftKey&&_===E?(d.preventDefault(),r&&T(w,{select:!0})):d.shiftKey&&_===w&&(d.preventDefault(),r&&T(E,{select:!0})):_===S&&d.preventDefault()}},[r,o,g.paused]);return c.jsx(M.div,{tabIndex:-1,...i,ref:h,onKeyDown:b})});ft.displayName=yr;function br(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(T(o,{select:t}),document.activeElement!==r)return}function wr(e){const t=vt(e),r=Te(t,e),o=Te(t.reverse(),e);return[r,o]}function vt(e){const t=[],r=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(;r.nextNode();)t.push(r.currentNode);return t}function Te(e,t){for(const r of e)if(!Er(r,{upTo:t}))return r}function Er(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function xr(e){return e instanceof HTMLInputElement&&"select"in e}function T(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&xr(e)&&t&&e.select()}}var $e=Sr();function Sr(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Ie(e,t),e.unshift(t)},remove(t){var r;e=Ie(e,t),(r=e[0])==null||r.resume()}}}function Ie(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function Cr(e){return e.filter(t=>t.tagName!=="A")}var Nr="Portal",ht=s.forwardRef((e,t)=>{var u;const{container:r,...o}=e,[a,n]=s.useState(!1);ie(()=>n(!0),[]);const i=r||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return i?ut.createPortal(c.jsx(M.div,{...o,ref:t}),i):null});ht.displayName=Nr;function Or(e,t){return s.useReducer((r,o)=>t[r][o]??r,e)}var se=e=>{const{present:t,children:r}=e,o=Pr(t),a=typeof r=="function"?r({present:o.isPresent}):s.Children.only(r),n=q(o.ref,Rr(a));return typeof r=="function"||o.isPresent?s.cloneElement(a,{ref:n}):null};se.displayName="Presence";function Pr(e){const[t,r]=s.useState(),o=s.useRef({}),a=s.useRef(e),n=s.useRef("none"),i=e?"mounted":"unmounted",[u,p]=Or(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const l=Z(o.current);n.current=u==="mounted"?l:"none"},[u]),ie(()=>{const l=o.current,f=a.current;if(f!==e){const h=n.current,g=Z(l);e?p("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?p("UNMOUNT"):p(f&&h!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,p]),ie(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,v=g=>{const d=Z(o.current).includes(g.animationName);if(g.target===t&&d&&(p("ANIMATION_END"),!a.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=g=>{g.target===t&&(n.current=Z(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(l=>{l&&(o.current=getComputedStyle(l)),r(l)},[])}}function Z(e){return(e==null?void 0:e.animationName)||"none"}function Rr(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ve=0;function jr(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Le()),document.body.insertAdjacentElement("beforeend",e[1]??Le()),ve++,()=>{ve===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ve--}},[])}function Le(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var D=function(){return D=Object.assign||function(t){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},D.apply(this,arguments)};function mt(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(r[o[a]]=e[o[a]]);return r}function Ar(e,t,r){if(r||arguments.length===2)for(var o=0,a=t.length,n;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var oe="right-scroll-bar-position",ae="width-before-scroll-bar",Dr="with-scroll-bars-hidden",Mr="--removed-body-scroll-bar-size";function he(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Tr(e,t){var r=O.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var a=r.value;a!==o&&(r.value=o,r.callback(o,a))}}}})[0];return r.callback=t,r.facade}var $r=typeof window<"u"?s.useLayoutEffect:s.useEffect,ke=new WeakMap;function Ir(e,t){var r=Tr(null,function(o){return e.forEach(function(a){return he(a,o)})});return $r(function(){var o=ke.get(r);if(o){var a=new Set(o),n=new Set(e),i=r.current;a.forEach(function(u){n.has(u)||he(u,null)}),n.forEach(function(u){a.has(u)||he(u,i)})}ke.set(r,e)},[e]),r}function Lr(e){return e}function kr(e,t){t===void 0&&(t=Lr);var r=[],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 r.length?r[r.length-1]:e},useMedium:function(n){var i=t(n,o);return r.push(i),function(){r=r.filter(function(u){return u!==i})}},assignSyncMedium:function(n){for(o=!0;r.length;){var i=r;r=[],i.forEach(n)}r={push:function(u){return n(u)},filter:function(){return r}}},assignMedium:function(n){o=!0;var i=[];if(r.length){var u=r;r=[],u.forEach(n),i=r}var p=function(){var f=i;i=[],f.forEach(n)},l=function(){return Promise.resolve().then(p)};l(),r={push:function(f){i.push(f),l()},filter:function(f){return i=i.filter(f),r}}}};return a}function Fr(e){e===void 0&&(e={});var t=kr(null);return t.options=D({async:!0,ssr:!1},e),t}var gt=function(e){var t=e.sideCar,r=mt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return s.createElement(o,D({},r))};gt.isSideCarExport=!0;function Wr(e,t){return e.useMedium(t),gt}var _t=Fr(),me=function(){},ce=s.forwardRef(function(e,t){var r=s.useRef(null),o=s.useState({onScrollCapture:me,onWheelCapture:me,onTouchMoveCapture:me}),a=o[0],n=o[1],i=e.forwardProps,u=e.children,p=e.className,l=e.removeScrollBar,f=e.enabled,v=e.shards,h=e.sideCar,g=e.noIsolation,b=e.inert,d=e.allowPinchZoom,m=e.as,_=m===void 0?"div":m,S=e.gapMode,w=mt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,x=Ir([r,t]),R=D(D({},w),a);return s.createElement(s.Fragment,null,f&&s.createElement(E,{sideCar:_t,removeScrollBar:l,shards:v,noIsolation:g,inert:b,setCallbacks:n,allowPinchZoom:!!d,lockRef:r,gapMode:S}),i?s.cloneElement(s.Children.only(u),D(D({},R),{ref:x})):s.createElement(_,D({},R,{className:p,ref:x}),u))});ce.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ce.classNames={fullWidth:ae,zeroRight:oe};var qr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Br(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=qr();return t&&e.setAttribute("nonce",t),e}function Ur(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zr(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Vr=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Br())&&(Ur(t,r),zr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Hr=function(){var e=Vr();return function(t,r){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},yt=function(){var e=Hr(),t=function(r){var o=r.styles,a=r.dynamic;return e(o,a),null};return t},Gr={left:0,top:0,right:0,gap:0},ge=function(e){return parseInt(e||"",10)||0},Kr=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[ge(r),ge(o),ge(a)]},Xr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Gr;var t=Kr(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},Yr=yt(),H="data-scroll-locked",Zr=function(e,t,r,o){var a=e.left,n=e.top,i=e.right,u=e.gap;return r===void 0&&(r="margin"),`
|
|
2
|
+
.`.concat(Dr,` {
|
|
3
3
|
overflow: hidden `).concat(o,`;
|
|
4
4
|
padding-right: `).concat(u,"px ").concat(o,`;
|
|
5
5
|
}
|
|
6
|
-
body[`).concat(
|
|
6
|
+
body[`).concat(H,`] {
|
|
7
7
|
overflow: hidden `).concat(o,`;
|
|
8
8
|
overscroll-behavior: contain;
|
|
9
9
|
`).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&`
|
|
@@ -16,55 +16,55 @@
|
|
|
16
16
|
`),r==="padding"&&"padding-right: ".concat(u,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.`).concat(
|
|
19
|
+
.`).concat(oe,` {
|
|
20
20
|
right: `).concat(u,"px ").concat(o,`;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.`).concat(
|
|
23
|
+
.`).concat(ae,` {
|
|
24
24
|
margin-right: `).concat(u,"px ").concat(o,`;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.`).concat(
|
|
27
|
+
.`).concat(oe," .").concat(oe,` {
|
|
28
28
|
right: 0 `).concat(o,`;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.`).concat(
|
|
31
|
+
.`).concat(ae," .").concat(ae,` {
|
|
32
32
|
margin-right: 0 `).concat(o,`;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
body[`).concat(
|
|
36
|
-
`).concat(
|
|
35
|
+
body[`).concat(H,`] {
|
|
36
|
+
`).concat(Mr,": ").concat(u,`px;
|
|
37
37
|
}
|
|
38
|
-
`)},
|
|
38
|
+
`)},Fe=function(){var e=parseInt(document.body.getAttribute(H)||"0",10);return isFinite(e)?e:0},Qr=function(){s.useEffect(function(){return document.body.setAttribute(H,(Fe()+1).toString()),function(){var e=Fe()-1;e<=0?document.body.removeAttribute(H):document.body.setAttribute(H,e.toString())}},[])},Jr=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;Qr();var n=s.useMemo(function(){return Xr(a)},[a]);return s.createElement(Yr,{styles:Zr(n,!t,a,r?"":"!important")})},Ee=!1;if(typeof window<"u")try{var Q=Object.defineProperty({},"passive",{get:function(){return Ee=!0,!0}});window.addEventListener("test",Q,Q),window.removeEventListener("test",Q,Q)}catch{Ee=!1}var U=Ee?{passive:!1}:!1,en=function(e){return e.tagName==="TEXTAREA"},bt=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!en(e)&&r[t]==="visible")},tn=function(e){return bt(e,"overflowY")},rn=function(e){return bt(e,"overflowX")},We=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=wt(e,o);if(a){var n=Et(e,o),i=n[1],u=n[2];if(i>u)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},nn=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},on=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},wt=function(e,t){return e==="v"?tn(t):rn(t)},Et=function(e,t){return e==="v"?nn(t):on(t)},an=function(e,t){return e==="h"&&t==="rtl"?-1:1},un=function(e,t,r,o,a){var n=an(e,window.getComputedStyle(t).direction),i=n*o,u=r.target,p=t.contains(u),l=!1,f=i>0,v=0,h=0;do{var g=Et(e,u),b=g[0],d=g[1],m=g[2],_=d-m-n*b;(b||_)&&wt(e,u)&&(v+=_,h+=b),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!p&&u!==document.body||p&&(t.contains(u)||t===u));return(f&&Math.abs(v)<1||!f&&Math.abs(h)<1)&&(l=!0),l},J=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qe=function(e){return[e.deltaX,e.deltaY]},Be=function(e){return e&&"current"in e?e.current:e},sn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cn=function(e){return`
|
|
39
39
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
40
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},
|
|
41
|
+
`)},ln=0,z=[];function dn(e){var t=s.useRef([]),r=s.useRef([0,0]),o=s.useRef(),a=s.useState(ln++)[0],n=s.useState(yt)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var d=Ar([e.lockRef.current],(e.shards||[]).map(Be),!0).filter(Boolean);return d.forEach(function(m){return m.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),d.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=s.useCallback(function(d,m){if("touches"in d&&d.touches.length===2||d.type==="wheel"&&d.ctrlKey)return!i.current.allowPinchZoom;var _=J(d),S=r.current,w="deltaX"in d?d.deltaX:S[0]-_[0],E="deltaY"in d?d.deltaY:S[1]-_[1],x,R=d.target,y=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in d&&y==="h"&&R.type==="range")return!1;var P=We(y,R);if(!P)return!0;if(P?x=y:(x=y==="v"?"h":"v",P=We(y,R)),!P)return!1;if(!o.current&&"changedTouches"in d&&(w||E)&&(o.current=x),!x)return!0;var I=o.current||x;return un(I,m,d,I==="h"?w:E)},[]),p=s.useCallback(function(d){var m=d;if(!(!z.length||z[z.length-1]!==n)){var _="deltaY"in m?qe(m):J(m),S=t.current.filter(function(x){return x.name===m.type&&(x.target===m.target||m.target===x.shadowParent)&&sn(x.delta,_)})[0];if(S&&S.should){m.cancelable&&m.preventDefault();return}if(!S){var w=(i.current.shards||[]).map(Be).filter(Boolean).filter(function(x){return x.contains(m.target)}),E=w.length>0?u(m,w[0]):!i.current.noIsolation;E&&m.cancelable&&m.preventDefault()}}},[]),l=s.useCallback(function(d,m,_,S){var w={name:d,delta:m,target:_,should:S,shadowParent:pn(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),f=s.useCallback(function(d){r.current=J(d),o.current=void 0},[]),v=s.useCallback(function(d){l(d.type,qe(d),d.target,u(d,e.lockRef.current))},[]),h=s.useCallback(function(d){l(d.type,J(d),d.target,u(d,e.lockRef.current))},[]);s.useEffect(function(){return z.push(n),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:h}),document.addEventListener("wheel",p,U),document.addEventListener("touchmove",p,U),document.addEventListener("touchstart",f,U),function(){z=z.filter(function(d){return d!==n}),document.removeEventListener("wheel",p,U),document.removeEventListener("touchmove",p,U),document.removeEventListener("touchstart",f,U)}},[]);var g=e.removeScrollBar,b=e.inert;return s.createElement(s.Fragment,null,b?s.createElement(n,{styles:cn(a)}):null,g?s.createElement(Jr,{gapMode:e.gapMode}):null)}function pn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fn=Wr(_t,dn);var xt=s.forwardRef(function(e,t){return s.createElement(ce,D({},e,{ref:t,sideCar:fn}))});xt.classNames=ce.classNames;var vn=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},V=new WeakMap,ee=new WeakMap,te={},_e=0,St=function(e){return e&&(e.host||St(e.parentNode))},hn=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=St(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},mn=function(e,t,r,o){var a=hn(t,Array.isArray(e)?e:[e]);te[r]||(te[r]=new WeakMap);var n=te[r],i=[],u=new Set,p=new Set(a),l=function(v){!v||u.has(v)||(u.add(v),l(v.parentNode))};a.forEach(l);var f=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(h){if(u.has(h))f(h);else try{var g=h.getAttribute(o),b=g!==null&&g!=="false",d=(V.get(h)||0)+1,m=(n.get(h)||0)+1;V.set(h,d),n.set(h,m),i.push(h),d===1&&b&&ee.set(h,!0),m===1&&h.setAttribute(r,"true"),b||h.setAttribute(o,"true")}catch(_){console.error("aria-hidden: cannot operate on ",h,_)}})};return f(t),u.clear(),_e++,function(){i.forEach(function(v){var h=V.get(v)-1,g=n.get(v)-1;V.set(v,h),n.set(v,g),h||(ee.has(v)||v.removeAttribute(o),ee.delete(v)),g||v.removeAttribute(r)}),_e--,_e||(V=new WeakMap,V=new WeakMap,ee=new WeakMap,te={})}},gn=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=vn(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live]"))),mn(o,a,r,"aria-hidden")):function(){return null}},Ce="Dialog",[Ct,$o]=Jt(Ce),[_n,j]=Ct(Ce),Nt=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:a,onOpenChange:n,modal:i=!0}=e,u=s.useRef(null),p=s.useRef(null),[l=!1,f]=nr({prop:o,defaultProp:a,onChange:n});return c.jsx(_n,{scope:t,triggerRef:u,contentRef:p,contentId:de(),titleId:de(),descriptionId:de(),open:l,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(v=>!v),[f]),modal:i,children:r})};Nt.displayName=Ce;var Ot="DialogTrigger",Pt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=j(Ot,r),n=q(t,a.triggerRef);return c.jsx(M.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Pe(a.open),...o,ref:n,onClick:$(e.onClick,a.onOpenToggle)})});Pt.displayName=Ot;var Ne="DialogPortal",[yn,Rt]=Ct(Ne,{forceMount:void 0}),jt=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:a}=e,n=j(Ne,t);return c.jsx(yn,{scope:t,forceMount:r,children:s.Children.map(o,i=>c.jsx(se,{present:r||n.open,children:c.jsx(ht,{asChild:!0,container:a,children:i})}))})};jt.displayName=Ne;var ue="DialogOverlay",At=s.forwardRef((e,t)=>{const r=Rt(ue,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=j(ue,e.__scopeDialog);return n.modal?c.jsx(se,{present:o||n.open,children:c.jsx(bn,{...a,ref:t})}):null});At.displayName=ue;var bn=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=j(ue,r);return c.jsx(xt,{as:Se,allowPinchZoom:!0,shards:[a.contentRef],children:c.jsx(M.div,{"data-state":Pe(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),W="DialogContent",Dt=s.forwardRef((e,t)=>{const r=Rt(W,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=j(W,e.__scopeDialog);return c.jsx(se,{present:o||n.open,children:n.modal?c.jsx(wn,{...a,ref:t}):c.jsx(En,{...a,ref:t})})});Dt.displayName=W;var wn=s.forwardRef((e,t)=>{const r=j(W,e.__scopeDialog),o=s.useRef(null),a=q(t,r.contentRef,o);return s.useEffect(()=>{const n=o.current;if(n)return gn(n)},[]),c.jsx(Mt,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$(e.onCloseAutoFocus,n=>{var i;n.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:$(e.onPointerDownOutside,n=>{const i=n.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0;(i.button===2||u)&&n.preventDefault()}),onFocusOutside:$(e.onFocusOutside,n=>n.preventDefault())})}),En=s.forwardRef((e,t)=>{const r=j(W,e.__scopeDialog),o=s.useRef(!1),a=s.useRef(!1);return c.jsx(Mt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var i,u;(i=e.onCloseAutoFocus)==null||i.call(e,n),n.defaultPrevented||(o.current||(u=r.triggerRef.current)==null||u.focus(),n.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:n=>{var p,l;(p=e.onInteractOutside)==null||p.call(e,n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=n.target;((l=r.triggerRef.current)==null?void 0:l.contains(i))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&a.current&&n.preventDefault()}})}),Mt=s.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:n,...i}=e,u=j(W,r),p=s.useRef(null),l=q(t,p);return jr(),c.jsxs(c.Fragment,{children:[c.jsx(ft,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:n,children:c.jsx(dt,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Pe(u.open),...i,ref:l,onDismiss:()=>u.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(xn,{titleId:u.titleId}),c.jsx(Cn,{contentRef:p,descriptionId:u.descriptionId})]})]})}),Oe="DialogTitle",Tt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=j(Oe,r);return c.jsx(M.h2,{id:a.titleId,...o,ref:t})});Tt.displayName=Oe;var $t="DialogDescription",It=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=j($t,r);return c.jsx(M.p,{id:a.descriptionId,...o,ref:t})});It.displayName=$t;var Lt="DialogClose",kt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=j(Lt,r);return c.jsx(M.button,{type:"button",...o,ref:t,onClick:$(e.onClick,()=>a.onOpenChange(!1))})});kt.displayName=Lt;function Pe(e){return e?"open":"closed"}var Ft="DialogTitleWarning",[Io,Wt]=Qt(Ft,{contentName:W,titleName:Oe,docsSlug:"dialog"}),xn=({titleId:e})=>{const t=Wt(Ft),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
42
|
|
|
43
43
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
44
|
|
|
45
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Sn="DialogDescriptionWarning",Cn=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wt(Sn).contentName}}.`;return s.useEffect(()=>{var n;const a=(n=e.current)==null?void 0:n.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Nn=Nt,On=Pt,Pn=jt,Rn=At,jn=Dt,An=Tt,Ue=It,Dn=kt;const Mn={LG:"lg"};function Tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ze={exports:{}};/*!
|
|
46
46
|
Copyright (c) 2018 Jed Watson.
|
|
47
47
|
Licensed under the MIT License (MIT), see
|
|
48
48
|
http://jedwatson.github.io/classnames
|
|
49
|
-
*/var
|
|
49
|
+
*/var Ve;function $n(){return Ve||(Ve=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o(u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(ze)),ze.exports}var In=$n();const He=Tn(In),Ln="_rotate_1xozj_1",kn="_dash_1xozj_1",G={"purpur-spinner":"_purpur-spinner_1xozj_1",rotate:Ln,"purpur-spinner--xxs":"_purpur-spinner--xxs_1xozj_4","purpur-spinner--xs":"_purpur-spinner--xs_1xozj_8","purpur-spinner--sm":"_purpur-spinner--sm_1xozj_12","purpur-spinner--md":"_purpur-spinner--md_1xozj_16","purpur-spinner--lg":"_purpur-spinner--lg_1xozj_20","purpur-spinner__circle":"_purpur-spinner__circle_1xozj_24",dash:kn,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_1xozj_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_1xozj_36"},K="purpur-spinner",Fn={SM:"sm"},Wn=({["data-testid"]:e,disabled:t=!1,negative:r=!1,size:o=Fn.SM,...a})=>c.jsx("div",{className:He([G[K],G[`${K}--${o}`]]),"data-testid":e,...a,children:c.jsx("svg",{viewBox:"0 0 50 50",children:c.jsx("circle",{className:He(G[`${K}__circle`],{[G[`${K}__circle--disabled`]]:t,[G[`${K}__circle--negative`]]:r}),cx:"25",cy:"25",r:"20"})})});function qn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ge={exports:{}};/*!
|
|
50
50
|
Copyright (c) 2018 Jed Watson.
|
|
51
51
|
Licensed under the MIT License (MIT), see
|
|
52
52
|
http://jedwatson.github.io/classnames
|
|
53
|
-
*/var
|
|
53
|
+
*/var Ke;function Bn(){return Ke||(Ke=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Ge)),Ge.exports}var Un=Bn();const zn=qn(Un),Vn={"purpur-button":"_purpur-button_w455q_1","purpur-button--xs":"_purpur-button--xs_w455q_33","purpur-button--icon-only":"_purpur-button--icon-only_w455q_36","purpur-button--sm":"_purpur-button--sm_w455q_39","purpur-button--md":"_purpur-button--md_w455q_45","purpur-button--lg":"_purpur-button--lg_w455q_51","purpur-button--full-width":"_purpur-button--full-width_w455q_57","purpur-button--primary":"_purpur-button--primary_w455q_60","purpur-button--disabled":"_purpur-button--disabled_w455q_64","purpur-button--primary-negative":"_purpur-button--primary-negative_w455q_70","purpur-button--secondary":"_purpur-button--secondary_w455q_82","purpur-button--secondary-negative":"_purpur-button--secondary-negative_w455q_93","purpur-button--expressive":"_purpur-button--expressive_w455q_104","purpur-button--expressive-negative":"_purpur-button--expressive-negative_w455q_114","purpur-button--negative":"_purpur-button--negative_w455q_126","purpur-button--destructive":"_purpur-button--destructive_w455q_133","purpur-button--destructive-negative":"_purpur-button--destructive-negative_w455q_143","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_w455q_153","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_w455q_166","purpur-button--text-negative":"_purpur-button--text-negative_w455q_181","purpur-button--text":"_purpur-button--text_w455q_181"},Hn=zn.bind(Vn),k="purpur-button",Gn=({children:e,className:t,["data-testid"]:r,disabled:o=!1,fullWidth:a=!1,iconOnly:n,loading:i=!1,negative:u=!1,onClick:p,size:l="md",variant:f,type:v="button",...h},g)=>{if(n&&f==="destructive")return null;const b=Hn([k,`${k}--${u?`${f}-negative`:f}`,`${k}--${l}`],{[`${k}--icon-only`]:n,[`${k}--negative`]:u,[`${k}--full-width`]:a,[`${k}--disabled`]:o||i},t),d=_=>{o||i?_.preventDefault():p&&p(_)},m=!!h["aria-disabled"]||o||i;return c.jsxs("button",{className:b,"data-testid":r,type:v,ref:g,"aria-disabled":m,onClick:d,...h,children:[i&&c.jsx(Wn,{size:l===Mn.LG?"xs":"xxs",negative:u,disabled:m})," ",e]})},Re=O.forwardRef(Gn);Re.displayName="Button";function Kn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xe={exports:{}};/*!
|
|
54
54
|
Copyright (c) 2018 Jed Watson.
|
|
55
55
|
Licensed under the MIT License (MIT), see
|
|
56
56
|
http://jedwatson.github.io/classnames
|
|
57
|
-
*/var
|
|
57
|
+
*/var Ye;function Xn(){return Ye||(Ye=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o(u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Xe)),Xe.exports}var Yn=Xn();const Zn=Kn(Yn),re={"purpur-heading":"_purpur-heading_k9fhq_1","purpur-heading--hyphens":"_purpur-heading--hyphens_k9fhq_8","purpur-heading--negative":"_purpur-heading--negative_k9fhq_11","purpur-heading--subsection-100":"_purpur-heading--subsection-100_k9fhq_14","purpur-heading--title-100":"_purpur-heading--title-100_k9fhq_20","purpur-heading--title-200":"_purpur-heading--title-200_k9fhq_26","purpur-heading--title-300":"_purpur-heading--title-300_k9fhq_32","purpur-heading--title-400":"_purpur-heading--title-400_k9fhq_38","purpur-heading--title-500":"_purpur-heading--title-500_k9fhq_44","purpur-heading--title-600":"_purpur-heading--title-600_k9fhq_50","purpur-heading--title-700":"_purpur-heading--title-700_k9fhq_56","purpur-heading--display-25":"_purpur-heading--display-25_k9fhq_62","purpur-heading--display-50":"_purpur-heading--display-50_k9fhq_68","purpur-heading--display-100":"_purpur-heading--display-100_k9fhq_74","purpur-heading--display-200":"_purpur-heading--display-200_k9fhq_80"},Qn={TITLE100:"title-100"},ne="purpur-heading",qt=({["data-testid"]:e,children:t,className:r="",enableHyphenation:o=!1,negative:a=!1,tag:n,variant:i=Qn.TITLE100,...u})=>{const p=n,l=Zn([r,re[ne],re[`${ne}--${i}`],{[re[`${ne}--hyphens`]]:o,[re[`${ne}--negative`]]:a}]);return c.jsx(p,{...u,className:l,"data-testid":e,children:t})};qt.displayName="Heading";function Jn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ze={exports:{}};/*!
|
|
58
58
|
Copyright (c) 2018 Jed Watson.
|
|
59
59
|
Licensed under the MIT License (MIT), see
|
|
60
60
|
http://jedwatson.github.io/classnames
|
|
61
|
-
*/var
|
|
61
|
+
*/var Qe;function eo(){return Qe||(Qe=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Ze)),Ze.exports}var to=eo();const ro=Jn(to),no={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},oo=ro.bind(no),Je="purpur-icon",ao="md",io=e=>e.filter(t=>Object.keys(t).length>=1).map(t=>`${t.name}="${t.value}"`).join(" "),uo=({content:e="",title:t}={})=>{const r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},t?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],o=t?`<title>${t}</title>`:"";return`<svg ${io(r)}>${o}${e}</svg>`},so=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),Bt=({["data-testid"]:e,svg:t,allyTitle:r,className:o,size:a=ao,...n})=>{const i=uo({content:so(t.svg),title:r}),u=oo(o,Je,`${Je}--${a}`);return c.jsx("span",{"aria-label":r,className:u,"data-testid":e,dangerouslySetInnerHTML:{__html:i},...n})};Bt.displayName="Icon";const co={name:"close",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',keywords:["close"],category:"utility"},Ut=e=>c.jsx(Bt,{...e,svg:co});Ut.displayName="IconClose";function lo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var et={exports:{}};/*!
|
|
62
62
|
Copyright (c) 2018 Jed Watson.
|
|
63
63
|
Licensed under the MIT License (MIT), see
|
|
64
64
|
http://jedwatson.github.io/classnames
|
|
65
|
-
*/var
|
|
65
|
+
*/var tt;function po(){return tt||(tt=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o(u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(et)),et.exports}var fo=po();const vo=lo(fo),X={"purpur-paragraph":"_purpur-paragraph_1rh57_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_1rh57_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_1rh57_10","purpur-paragraph--negative":"_purpur-paragraph--negative_1rh57_13","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_1rh57_16","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_1rh57_22","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_1rh57_29","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_1rh57_36","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_1rh57_42","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_1rh57_48","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_1rh57_54","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_1rh57_60","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_1rh57_67","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_1rh57_75"},ho={PARAGRAPH100:"paragraph-100"},Y="purpur-paragraph",zt=({["data-testid"]:e,children:t,className:r,disabled:o,enableHyphenation:a=!1,negative:n=!1,variant:i=ho.PARAGRAPH100,...u})=>{const p=vo([r,X[Y],X[`${Y}--${i}`],{[X[`${Y}--hyphens`]]:a,[X[`${Y}--disabled`]]:o,[X[`${Y}--negative`]]:n}]);return c.jsx("p",{...u,className:p,"data-testid":e,children:t})};zt.displayName="Paragraph";function rt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mo(...e){return t=>{let r=!1;const o=e.map(a=>{const n=rt(a,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let a=0;a<o.length;a++){const n=o[a];typeof n=="function"?n():rt(e[a],null)}}}}var Vt=s.forwardRef((e,t)=>{const{children:r,...o}=e,a=s.Children.toArray(r),n=a.find(_o);if(n){const i=n.props.children,u=a.map(p=>p===n?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:p);return c.jsx(xe,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return c.jsx(xe,{...o,ref:t,children:r})});Vt.displayName="Slot";var xe=s.forwardRef((e,t)=>{const{children:r,...o}=e;if(s.isValidElement(r)){const a=bo(r),n=yo(o,r.props);return r.type!==s.Fragment&&(n.ref=t?mo(t,a):a),s.cloneElement(r,n)}return s.Children.count(r)>1?s.Children.only(null):null});xe.displayName="SlotClone";var go=({children:e})=>c.jsx(c.Fragment,{children:e});function _o(e){return s.isValidElement(e)&&e.type===go}function yo(e,t){const r={...t};for(const o in t){const a=e[o],n=t[o];/^on[A-Z]/.test(o)?a&&n?r[o]=(...i)=>{n(...i),a(...i)}:a&&(r[o]=a):o==="style"?r[o]={...a,...n}:o==="className"&&(r[o]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function bo(e){var t,r;let o=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?e.ref:(o=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var wo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Eo=wo.reduce((e,t)=>{const r=s.forwardRef((o,a)=>{const{asChild:n,...i}=o,u=n?Vt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),xo="VisuallyHidden",Ht=s.forwardRef((e,t)=>c.jsx(Eo.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Ht.displayName=xo;var So=Ht;const Co=({asChild:e,children:t,className:r="",["data-testid"]:o})=>c.jsx(So,{asChild:e,"data-testid":o,className:r,children:t});function No(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ye={exports:{}};/*!
|
|
66
66
|
Copyright (c) 2018 Jed Watson.
|
|
67
67
|
Licensed under the MIT License (MIT), see
|
|
68
68
|
http://jedwatson.github.io/classnames
|
|
69
|
-
*/var
|
|
69
|
+
*/var nt;function Oo(){return nt||(nt=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(ye)),ye.exports}var Po=Oo();const Ro=No(Po),jo="_fadeIn_1bcc3_1",Ao={"purpur-modal-content":"_purpur-modal-content_1bcc3_1",fadeIn:jo,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_1bcc3_30","purpur-modal-content__close-button":"_purpur-modal-content__close-button_1bcc3_37","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_1bcc3_47","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_1bcc3_57","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_1bcc3_61","purpur-modal-content__header":"_purpur-modal-content__header_1bcc3_84","purpur-modal-content__title":"_purpur-modal-content__title_1bcc3_97","purpur-modal-content__description":"_purpur-modal-content__description_1bcc3_100","purpur-modal-content__body":"_purpur-modal-content__body_1bcc3_103","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_1bcc3_111","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_1bcc3_123","purpur-modal-content__actions-button":"_purpur-modal-content__actions-button_1bcc3_123","purpur-modal-content__notification":"_purpur-modal-content__notification_1bcc3_146","purpur-modal-content--with-image":"_purpur-modal-content--with-image_1bcc3_149","purpur-modal-content--overflow":"_purpur-modal-content--overflow_1bcc3_149","purpur-modal-content__actions":"_purpur-modal-content__actions_1bcc3_123","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_1bcc3_180","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_1bcc3_190"},ot=e=>e.showCloseButton===!0,N=Ro.bind(Ao),C="purpur-modal-content",Do=O.forwardRef(({["data-testid"]:e,actions:t,children:r,className:o,description:a,disableCloseOnClickOutside:n,hideDescription:i,image:u,primaryActionVariant:p="primary",stickyButtons:l=!0,title:f,notification:v=void 0,zIndex:h,onCloseAutoFocus:g,...b},d)=>{const{closeButtonAllyLabel:m,showCloseButton:_,...S}=b,[w,E]=O.useState(!1),[x,R]=O.useState(0),y=O.useRef(null),P=O.useRef(null),I=N([C,{[`${C}--with-image`]:!!u},{[`${C}--overflow`]:w},{[`${C}--sticky-footer`]:l},o]),A=L=>e?`${e} ${L}`:void 0,Gt=L=>{n&&L.preventDefault()},B=O.useCallback(()=>{if(!y.current||!P.current)return;const L=window.getComputedStyle(y.current,null),Xt=parseFloat(L.getPropertyValue("height")),Yt=P.current.offsetHeight;E(Xt<Yt),R((y.current.offsetWidth??0)-(y.current.clientWidth??0))},[]),Kt=L=>{n&&!_&&L.preventDefault()};return O.useEffect(()=>(window.addEventListener("resize",B),()=>{window.removeEventListener("resize",B)}),[B]),O.useEffect(()=>{B()},[v,r,B]),c.jsxs(Pn,{children:[c.jsx(Rn,{className:N(`${C}__overlay`),style:{zIndex:h}}),c.jsxs(jn,{...S,className:I,"data-testid":e,ref:d,...!a&&{"aria-describedby":void 0},onPointerDownOutside:Gt,onOpenAutoFocus:B,onEscapeKeyDown:Kt,onCloseAutoFocus:g,style:{zIndex:`calc(${h} + 1)`},children:[c.jsxs("div",{ref:y,className:N(`${C}__wrapper`),children:[ot(b)&&m&&u&&c.jsx(at,{allyLabel:m,hasImage:!0,scrollbarWidth:x,"data-testid":A("close-button")}),c.jsxs("div",{ref:P,className:N(`${C}__wrapper-inner`),children:[c.jsxs("div",{className:N(`${C}__header`),children:[ot(b)&&m&&!u&&c.jsx(at,{allyLabel:m,"data-testid":A("close-button")}),c.jsx(An,{asChild:!0,className:N(`${C}__title`),"data-testid":A("title"),children:c.jsx(qt,{tag:"h2",variant:"title-200",children:f})})]}),u&&c.jsx("div",{className:N(`${C}__image-wrapper`),"data-testid":A("image"),children:u}),c.jsx("div",{className:N(`${C}__body`),children:c.jsxs("div",{className:N(`${C}__body-inner`),children:[a&&i&&c.jsx(Co,{asChild:!0,children:c.jsx(Ue,{"data-testid":A("description"),children:a})}),a&&!i&&c.jsx(Ue,{asChild:!0,className:N(`${C}__description`),"data-testid":A("description"),children:c.jsx(zt,{variant:"paragraph-100",children:a})}),c.jsx("div",{children:r}),!l&&c.jsx(it,{actions:t,primaryActionVariant:p,notification:v})]})})]})]}),l&&c.jsx(it,{actions:t,primaryActionVariant:p,notification:v})]})]})}),at=({allyLabel:e,hasImage:t,scrollbarWidth:r,["data-testid"]:o})=>c.jsx(Dn,{asChild:!0,children:c.jsx(Re,{variant:t?"primary":"tertiary-purple",negative:t,size:"sm",iconOnly:!0,"aria-label":e,className:N(`${C}__close-button`),style:{right:`calc(var(--purpur-spacing-100) + ${r||0}px)`},"data-testid":o,children:c.jsx(Ut,{})})}),Mo=3,it=({actions:e,primaryActionVariant:t,notification:r})=>{const o=O.useRef(null),a=[t,"secondary","text"];return O.useEffect(()=>{var n,i;r&&((i=(n=o==null?void 0:o.current)==null?void 0:n.scrollIntoView)==null||i.call(n,!1))},[r]),e&&e.length>0?c.jsxs("div",{className:N(`${C}__actions`),children:[c.jsx("div",{className:N(`${C}__actions-buttons`),"data-testid":"modal actions",children:e.slice(0,Mo).map(({label:n,onClick:i,disabled:u,loading:p,iconPosition:l="right",icon:f,...v},h)=>c.jsxs(Re,{"data-testid":"modal actions button",variant:a[h]||"",onClick:i,disabled:u,loading:p,className:N(`${C}__actions-button`),...v,children:[l==="left"&&f&&f,n,l==="right"&&f&&f]},n))}),r&&c.jsx("div",{className:N(`${C}__notification`),ref:o,children:r}),c.jsx("span",{className:N(`${C}__actions-separator`)})]}):null},To=O.forwardRef(({["data-testid"]:e,children:t,className:r,...o},a)=>c.jsx(On,{asChild:!0,ref:a,"data-testid":e,className:r,...o,children:t})),le=({["data-testid"]:e,children:t,open:r,onOpenChange:o})=>c.jsx(Nn,{open:r,onOpenChange:o,"data-testid":e,children:t});le.Trigger=To;le.Content=Do;le.displayName="Modal";exports.Modal=le;
|
|
70
70
|
//# sourceMappingURL=modal.cjs.js.map
|