talkweb 3.50.37 → 3.50.39

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.
Files changed (24) hide show
  1. package/dist/index.es.js +1 -1
  2. package/dist/index.umd.js +1 -1
  3. package/dist/js/{AddContact-CeX4oLhj.js → AddContact-geFB5uZu.js} +1 -1
  4. package/dist/js/{HamburgerMenu-dfTA643C.js → HamburgerMenu-Dnty8L_J.js} +1 -1
  5. package/dist/js/{ImageEditorModal-DbsdYQVv.js → ImageEditorModal-BE-kPsJd.js} +1 -1
  6. package/dist/js/{LoadingDots-Bhve_iKp.js → LoadingDots-CSbpS1Hq.js} +1 -1
  7. package/dist/js/{SearchContactBox-BGd95zZG.js → SearchContactBox-DCxa7Tq6.js} +1 -1
  8. package/dist/js/{StartCall-eJcDWulH.js → StartCall-BAc3hBgQ.js} +4 -4
  9. package/dist/js/{TypingView-CuPwigHA.js → TypingView-Cwu2sFsn.js} +1 -1
  10. package/dist/js/{boredGif-R2s_qhP7.js → boredGif-Bu2KwA3Z.js} +1 -1
  11. package/dist/js/{index-Du1-jpVq.js → index-BQxCMtTe.js} +1 -1
  12. package/dist/js/{index-Cz_W2Bpx.js → index-BartosUC.js} +41 -41
  13. package/dist/js/{index-BrFZ7lHw.js → index-Cb9BgC6O.js} +1 -1
  14. package/dist/js/{index-C55zkUMg.js → index-CdrvmdU9.js} +1 -1
  15. package/dist/js/{index-FH6APIiM.js → index-EIjPjN5k.js} +2 -2
  16. package/dist/js/{index-D57mr3fZ.js → index-tunuUxJO.js} +1 -1
  17. package/dist/js/{index-DxTp-3fp.js → index-vkicj3Qw.js} +1 -1
  18. package/dist/js/{main-CXfBH5gS.js → main-BiSoVrq9.js} +2 -2
  19. package/dist/js/{mic-BCmOzPl5.js → mic-Zn5tfKRn.js} +1 -1
  20. package/dist/js/{unescapeHtml-DGtjC5X0.js → unescapeHtml-Cw65I-c4.js} +1 -1
  21. package/dist/js/{useContactThread-DoR5yDuh.js → useContactThread-DFlOxXGB.js} +1 -1
  22. package/dist/js/{useCopyToClipboard-uKMC-KZD.js → useCopyToClipboard-CBpknd-Y.js} +1 -1
  23. package/dist/talkweb.css +1 -1
  24. package/package.json +4 -2
@@ -1,4 +1,4 @@
1
- import{e,j as a,l as s,eA as t,e6 as r}from"./main-CXfBH5gS.js";import{useState as n,useEffect as l}from"react";import{b as i}from"./useContactThread-DoR5yDuh.js";const m=({open:m,setOpen:c,init:o,onComplete:d})=>{const x=o||{firstName:"",lastName:"",username:""},[u,h]=n(x),p=e(),[N,f]=n(!1),{openOrCreateThread:b}=i(),[j,g]=n(""),v=e=>{const{name:a,value:s}=e.target;h(e=>({...e,[a]:s}))};function k(){c(!1),g(""),h(x)}return l(()=>{m||h(x)},[m,p]),/* @__PURE__ */a.jsx("div",{children:/* @__PURE__ */a.jsx(s,{disableAutoFocus:!0,open:m,onOpenChange:()=>{c(!m),g("")},title:"اضافه کردن مخاطب جدید",closable:!1,size:"xs",errorText:j||void 0,onConfirm:async()=>{if(!u.firstName.trim()||!u.username.trim()){const a=(e=u).username.trim()?e.firstName.trim()?"":"نام اجباری است":"نام کاربری یا موبایل اجباری است";return void g(a)}var e;f(!0),g("");try{const e=await p(t({firstName:u.firstName,addBy:u.username,lastName:u.lastName})).unwrap();if(f(!1),e.hasError||!e.linkedUser)return void g(e.errorMessage??"کاربر یافت نشد");if(k(),d)return void d(e);const a=e.id;if(!a)return;p(r({new_data:{coreUserId:e.linkedUser.coreUserId,contactFirstName:e.firstName,contactId:a,contactLastName:e.lastName,image:e.linkedUser.image}})),await b({coreUserId:e.linkedUser.coreUserId,username:e.linkedUser.username,contactId:a,participantInfo:{firstName:e.firstName,lastName:e.lastName,image:e.linkedUser.image}})}catch(a){f(!1)}},onCancel:()=>k(),confirmText:N?"در حال اضافه کردن...":"اضافه کردن",cancelText:"انصراف",children:/* @__PURE__ */a.jsx("div",{className:"mt-5",children:/* @__PURE__ */a.jsx("form",{className:"h-full",noValidate:!0,children:/* @__PURE__ */a.jsx("div",{className:"flex flex-1 h-full flex-col items-between justify-between",children:/* @__PURE__ */a.jsxs("div",{className:"gap-4",children:[
1
+ import{e,j as a,l as s,eA as t,e6 as r}from"./main-BiSoVrq9.js";import{useState as n,useEffect as l}from"react";import{b as i}from"./useContactThread-DFlOxXGB.js";const m=({open:m,setOpen:c,init:o,onComplete:d})=>{const x=o||{firstName:"",lastName:"",username:""},[u,h]=n(x),p=e(),[N,f]=n(!1),{openOrCreateThread:b}=i(),[j,g]=n(""),v=e=>{const{name:a,value:s}=e.target;h(e=>({...e,[a]:s}))};function k(){c(!1),g(""),h(x)}return l(()=>{m||h(x)},[m,p]),/* @__PURE__ */a.jsx("div",{children:/* @__PURE__ */a.jsx(s,{disableAutoFocus:!0,open:m,onOpenChange:()=>{c(!m),g("")},title:"اضافه کردن مخاطب جدید",closable:!1,size:"xs",errorText:j||void 0,onConfirm:async()=>{if(!u.firstName.trim()||!u.username.trim()){const a=(e=u).username.trim()?e.firstName.trim()?"":"نام اجباری است":"نام کاربری یا موبایل اجباری است";return void g(a)}var e;f(!0),g("");try{const e=await p(t({firstName:u.firstName,addBy:u.username,lastName:u.lastName})).unwrap();if(f(!1),e.hasError||!e.linkedUser)return void g(e.errorMessage??"کاربر یافت نشد");if(k(),d)return void d(e);const a=e.id;if(!a)return;p(r({new_data:{coreUserId:e.linkedUser.coreUserId,contactFirstName:e.firstName,contactId:a,contactLastName:e.lastName,image:e.linkedUser.image}})),await b({coreUserId:e.linkedUser.coreUserId,username:e.linkedUser.username,contactId:a,participantInfo:{firstName:e.firstName,lastName:e.lastName,image:e.linkedUser.image}})}catch(a){f(!1)}},onCancel:()=>k(),confirmText:N?"در حال اضافه کردن...":"اضافه کردن",cancelText:"انصراف",children:/* @__PURE__ */a.jsx("div",{className:"mt-5",children:/* @__PURE__ */a.jsx("form",{className:"h-full",noValidate:!0,children:/* @__PURE__ */a.jsx("div",{className:"flex flex-1 h-full flex-col items-between justify-between",children:/* @__PURE__ */a.jsxs("div",{className:"gap-4",children:[
2
2
  /* @__PURE__ */a.jsxs("div",{className:"mb-10",children:[
3
3
  /* @__PURE__ */a.jsxs("label",{className:"mb-2 mr-1 flex items-center gap-1 text-xs font-medium",htmlFor:"firstName",children:[
4
4
  /* @__PURE__ */a.jsx("span",{className:"text-invertBlackWhite text-xs",children:"نام"}),
@@ -1,4 +1,4 @@
1
- import{k as e,j as t,Z as n,dQ as i,e as o,g as a,f1 as r,f2 as s,f3 as c,f4 as l,da as d,d9 as m,f5 as u,ea as h,f6 as x,dx as f,f7 as p,f8 as w,f9 as v,fa as g,fb as b,_ as j,o as y,p as k,aB as C,cs as N,fc as E}from"./main-CXfBH5gS.js";import{A as M}from"./LoadingDots-Bhve_iKp.js";import{useEffect as B,useState as S,useRef as T}from"react";import{u as I}from"./useCopyToClipboard-uKMC-KZD.js";import{A as R}from"./AddContact-CeX4oLhj.js";import{u as L}from"./index-FH6APIiM.js";import{flushSync as W}from"react-dom";const _=({icon:i,title:o,to:a,onClick:r,subtitle:s,className:c,withBorder:l=!1,target:d="_self",children:m})=>{const u=e();/* @__PURE__ */
1
+ import{k as e,j as t,Z as n,dQ as i,e as o,g as a,f1 as r,f2 as s,f3 as c,f4 as l,da as d,d9 as m,f5 as u,ea as h,f6 as x,dx as f,f7 as p,f8 as w,f9 as v,fa as g,fb as b,_ as j,o as y,p as k,aB as C,cs as N,fc as E}from"./main-BiSoVrq9.js";import{A as M}from"./LoadingDots-CSbpS1Hq.js";import{useEffect as B,useState as S,useRef as T}from"react";import{u as I}from"./useCopyToClipboard-CBpknd-Y.js";import{A as R}from"./AddContact-geFB5uZu.js";import{u as L}from"./index-EIjPjN5k.js";import{flushSync as W}from"react-dom";const _=({icon:i,title:o,to:a,onClick:r,subtitle:s,className:c,withBorder:l=!1,target:d="_self",children:m})=>{const u=e();/* @__PURE__ */
2
2
  return t.jsx(n,{children:/* @__PURE__ */t.jsxs("div",{className:`flex items-center ${l?"border-b-2 border-divider":""} `,children:[
3
3
  /* @__PURE__ */t.jsx("div",{onClick:e=>{a&&("_blank"===d?window.open(a,"_blank","noopener,noreferrer"):u(a)),r&&r()},className:`flex items-center justify-between cursor-pointer px-4 py-[9px] hover:bg-bgHover flex-1 ${c} `,children:/* @__PURE__ */t.jsxs("div",{className:"flex items-center gap-3",children:[i&&/* @__PURE__ */t.jsx("div",{className:"flex-shrink-0 text-menuIconColor",children:i}),
4
4
  /* @__PURE__ */t.jsxs("div",{className:"text-right flex flex-col",children:[
@@ -1,4 +1,4 @@
1
- import{aG as e,fB as t,fC as o,j as n,l as r,S as i,cp as a,bi as s}from"./main-CXfBH5gS.js";import*as c from"react";import{useState as h,useCallback as p}from"react";var u,d,l,m,v,f,g,w,C,S;const x=/* @__PURE__ */e(S?C:(S=1,C=function(){if(w)return g;w=1;var e=function(){if(d)return u;d=1;var e,t,o,n,r,i,a,s,c,h,p,l,m,v,f,g=!1;function w(){if(!g){g=!0;var u=navigator.userAgent,d=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(u),w=/(Mac OS X)|(Windows)|(Linux)/.exec(u);if(l=/\b(iPhone|iP[ao]d)/.exec(u),m=/\b(iP[ao]d)/.exec(u),h=/Android/i.exec(u),v=/FBAN\/\w+;/i.exec(u),f=/Mobile/i.exec(u),p=!!/Win64/.exec(u),d){(e=d[1]?parseFloat(d[1]):d[5]?parseFloat(d[5]):NaN)&&document&&document.documentMode&&(e=document.documentMode);var C=/(?:Trident\/(\d+.\d+))/.exec(u);i=C?parseFloat(C[1])+4:e,t=d[2]?parseFloat(d[2]):NaN,o=d[3]?parseFloat(d[3]):NaN,(n=d[4]?parseFloat(d[4]):NaN)?(d=/(?:Chrome\/(\d+\.\d+))/.exec(u),r=d&&d[1]?parseFloat(d[1]):NaN):r=NaN}else e=t=o=r=n=NaN;if(w){if(w[1]){var S=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(u);a=!S||parseFloat(S[1].replace("_","."))}else a=!1;s=!!w[2],c=!!w[3]}else a=s=c=!1}}var C={ie:function(){return w()||e},ieCompatibilityMode:function(){return w()||i>e},ie64:function(){return C.ie()&&p},firefox:function(){return w()||t},opera:function(){return w()||o},webkit:function(){return w()||n},safari:function(){return C.webkit()},chrome:function(){return w()||r},windows:function(){return w()||s},osx:function(){return w()||a},linux:function(){return w()||c},iphone:function(){return w()||l},mobile:function(){return w()||l||m||h||f},nativeApp:function(){return w()||v},android:function(){return w()||h},ipad:function(){return w()||m}};return u=C}(),t=function(){if(f)return v;f=1;var e,t=function(){if(m)return l;m=1;var e=!("undefined"==typeof window||!window.document||!window.document.createElement),t={canUseDOM:e,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:e&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};return l=t}();return t.canUseDOM&&(e=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),v=function(o,n){if(!t.canUseDOM||n&&!("addEventListener"in document))return!1;var r="on"+o,i=r in document;if(!i){var a=document.createElement("div");a.setAttribute(r,"return;"),i="function"==typeof a[r]}return!i&&e&&"wheel"===o&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}}();function o(e){var t=0,o=0,n=0,r=0;return"detail"in e&&(o=e.detail),"wheelDelta"in e&&(o=-e.wheelDelta/120),"wheelDeltaY"in e&&(o=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=o,o=0),n=10*t,r=10*o,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||r)&&e.deltaMode&&(1==e.deltaMode?(n*=40,r*=40):(n*=800,r*=800)),n&&!t&&(t=n<1?-1:1),r&&!o&&(o=r<1?-1:1),{spinX:t,spinY:o,pixelX:n,pixelY:r}}return o.getEventType=function(){return e.firefox()?"DOMMouseScroll":t("wheel")?"wheel":"mousewheel"},g=o}()));function y(e,t,o,n,r){void 0===r&&(r=0);var i=E(t.width,t.height,r),a=i.width,s=i.height;return{x:z(e.x,a,o.width,n),y:z(e.y,s,o.height,n)}}function z(e,t,o,n){var r=t*n/2-o/2;return A(e,-r,r)}function R(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function b(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function D(e,t){return Math.min(e,Math.max(0,t))}function P(e,t){return t}function M(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function E(e,t,o){var n=o*Math.PI/180;return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}function A(e,t,o){return Math.min(Math.max(e,t),o)}function W(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return"string"==typeof e&&e.length>0}).join(" ").trim()}var N=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.cropperRef=c.createRef(),t.imageRef=c.createRef(),t.videoRef=c.createRef(),t.containerPosition={x:0,y:0},t.containerRef=null,t.styleRef=null,t.containerRect=null,t.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},t.dragStartPosition={x:0,y:0},t.dragStartCrop={x:0,y:0},t.gestureZoomStart=0,t.gestureRotationStart=0,t.isTouching=!1,t.lastPinchDistance=0,t.lastPinchRotation=0,t.rafDragTimeout=null,t.rafPinchTimeout=null,t.wheelTimer=null,t.currentDoc="undefined"!=typeof document?document:null,t.currentWindow="undefined"!=typeof window?window:null,t.resizeObserver=null,t.previousCropSize=null,t.isInitialized=!1,t.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},t.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&t.containerRef){var e=!0;t.resizeObserver=new window.ResizeObserver(function(o){e?e=!1:t.computeSizes()}),t.resizeObserver.observe(t.containerRef)}},t.preventZoomSafari=function(e){return e.preventDefault()},t.cleanEvents=function(){t.currentDoc&&(t.currentDoc.removeEventListener("mousemove",t.onMouseMove),t.currentDoc.removeEventListener("mouseup",t.onDragStopped),t.currentDoc.removeEventListener("touchmove",t.onTouchMove),t.currentDoc.removeEventListener("touchend",t.onDragStopped),t.currentDoc.removeEventListener("gesturechange",t.onGestureChange),t.currentDoc.removeEventListener("gestureend",t.onGestureEnd),t.currentDoc.removeEventListener("scroll",t.onScroll))},t.clearScrollEvent=function(){t.containerRef&&t.containerRef.removeEventListener("wheel",t.onWheel),t.wheelTimer&&clearTimeout(t.wheelTimer)},t.onMediaLoad=function(){var e=t.computeSizes();e&&(t.previousCropSize=e,t.emitCropData(),t.setInitialCrop(e),t.isInitialized=!0),t.props.onMediaLoaded&&t.props.onMediaLoaded(t.mediaSize)},t.setInitialCrop=function(e){if(t.props.initialCroppedAreaPercentages){var o=function(e,t,o,n,r,i){var a=E(t.width,t.height,o),s=A(n.width/a.width*(100/e.width),r,i);return{crop:{x:s*a.width/2-n.width/2-a.width*s*(e.x/100),y:s*a.height/2-n.height/2-a.height*s*(e.y/100)},zoom:s}}(t.props.initialCroppedAreaPercentages,t.mediaSize,t.props.rotation,e,t.props.minZoom,t.props.maxZoom),n=o.crop,r=o.zoom;t.props.onCropChange(n),t.props.onZoomChange&&t.props.onZoomChange(r)}else if(t.props.initialCroppedAreaPixels){var i=function(e,t,o,n,r,i){void 0===o&&(o=0);var a=E(t.naturalWidth,t.naturalHeight,o),s=A(function(e,t,o){var n=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return o.height>o.width?o.height/(e.height*n):o.width/(e.width*n)}(e,t,n),r,i),c=n.height>n.width?n.height/e.height:n.width/e.width;return{crop:{x:((a.width-e.width)/2-e.x)*c,y:((a.height-e.height)/2-e.y)*c},zoom:s}}(t.props.initialCroppedAreaPixels,t.mediaSize,t.props.rotation,e,t.props.minZoom,t.props.maxZoom);n=i.crop,r=i.zoom,t.props.onCropChange(n),t.props.onZoomChange&&t.props.onZoomChange(r)}},t.computeSizes=function(){var e,n,r,i,a,s,c=t.imageRef.current||t.videoRef.current;if(c&&t.containerRef){t.containerRect=t.containerRef.getBoundingClientRect(),t.saveContainerPosition();var h=t.containerRect.width/t.containerRect.height,p=(null===(e=t.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(n=t.videoRef.current)||void 0===n?void 0:n.videoWidth)||0,u=(null===(r=t.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(i=t.videoRef.current)||void 0===i?void 0:i.videoHeight)||0,d=p/u,l=void 0;if(c.offsetWidth<p||c.offsetHeight<u)switch(t.state.mediaObjectFit){default:case"contain":l=h>d?{width:t.containerRect.height*d,height:t.containerRect.height}:{width:t.containerRect.width,height:t.containerRect.width/d};break;case"horizontal-cover":l={width:t.containerRect.width,height:t.containerRect.width/d};break;case"vertical-cover":l={width:t.containerRect.height*d,height:t.containerRect.height}}else l={width:c.offsetWidth,height:c.offsetHeight};t.mediaSize=o(o({},l),{naturalWidth:p,naturalHeight:u}),t.props.setMediaSize&&t.props.setMediaSize(t.mediaSize);var m=t.props.cropSize?t.props.cropSize:function(e,t,o,n,r,i){void 0===i&&(i=0);var a=E(e,t,i),s=a.width,c=a.height,h=Math.min(s,o),p=Math.min(c,n);return h>p*r?{width:p*r,height:p}:{width:h,height:h/r}}(t.mediaSize.width,t.mediaSize.height,t.containerRect.width,t.containerRect.height,t.props.aspect,t.props.rotation);return(null===(a=t.state.cropSize)||void 0===a?void 0:a.height)===m.height&&(null===(s=t.state.cropSize)||void 0===s?void 0:s.width)===m.width||t.props.onCropSizeChange&&t.props.onCropSizeChange(m),t.setState({cropSize:m},t.recomputeCropPosition),t.props.setCropSize&&t.props.setCropSize(m),m}},t.saveContainerPosition=function(){if(t.containerRef){var e=t.containerRef.getBoundingClientRect();t.containerPosition={x:e.left,y:e.top}}},t.onMouseDown=function(e){t.currentDoc&&(e.preventDefault(),t.currentDoc.addEventListener("mousemove",t.onMouseMove),t.currentDoc.addEventListener("mouseup",t.onDragStopped),t.saveContainerPosition(),t.onDragStart(n.getMousePoint(e)))},t.onMouseMove=function(e){return t.onDrag(n.getMousePoint(e))},t.onScroll=function(e){t.currentDoc&&(e.preventDefault(),t.saveContainerPosition())},t.onTouchStart=function(e){t.currentDoc&&(t.isTouching=!0,t.props.onTouchRequest&&!t.props.onTouchRequest(e)||(t.currentDoc.addEventListener("touchmove",t.onTouchMove,{passive:!1}),t.currentDoc.addEventListener("touchend",t.onDragStopped),t.saveContainerPosition(),2===e.touches.length?t.onPinchStart(e):1===e.touches.length&&t.onDragStart(n.getTouchPoint(e.touches[0]))))},t.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?t.onPinchMove(e):1===e.touches.length&&t.onDrag(n.getTouchPoint(e.touches[0]))},t.onGestureStart=function(e){t.currentDoc&&(e.preventDefault(),t.currentDoc.addEventListener("gesturechange",t.onGestureChange),t.currentDoc.addEventListener("gestureend",t.onGestureEnd),t.gestureZoomStart=t.props.zoom,t.gestureRotationStart=t.props.rotation)},t.onGestureChange=function(e){if(e.preventDefault(),!t.isTouching){var o=n.getMousePoint(e),r=t.gestureZoomStart-1+e.scale;if(t.setNewZoom(r,o,{shouldUpdatePosition:!0}),t.props.onRotationChange){var i=t.gestureRotationStart+e.rotation;t.props.onRotationChange(i)}}},t.onGestureEnd=function(e){t.cleanEvents()},t.onDragStart=function(e){var n,r,i=e.x,a=e.y;t.dragStartPosition={x:i,y:a},t.dragStartCrop=o({},t.props.crop),null===(r=(n=t.props).onInteractionStart)||void 0===r||r.call(n)},t.onDrag=function(e){var o=e.x,n=e.y;t.currentWindow&&(t.rafDragTimeout&&t.currentWindow.cancelAnimationFrame(t.rafDragTimeout),t.rafDragTimeout=t.currentWindow.requestAnimationFrame(function(){if(t.state.cropSize&&void 0!==o&&void 0!==n){var e=o-t.dragStartPosition.x,r=n-t.dragStartPosition.y,i={x:t.dragStartCrop.x+e,y:t.dragStartCrop.y+r},a=t.props.restrictPosition?y(i,t.mediaSize,t.state.cropSize,t.props.zoom,t.props.rotation):i;t.props.onCropChange(a)}}))},t.onDragStopped=function(){var e,o;t.isTouching=!1,t.cleanEvents(),t.emitCropData(),null===(o=(e=t.props).onInteractionEnd)||void 0===o||o.call(e)},t.onWheel=function(e){if(t.currentWindow&&(!t.props.onWheelRequest||t.props.onWheelRequest(e))){e.preventDefault();var o=n.getMousePoint(e),r=x(e).pixelY,i=t.props.zoom-r*t.props.zoomSpeed/200;t.setNewZoom(i,o,{shouldUpdatePosition:!0}),t.state.hasWheelJustStarted||t.setState({hasWheelJustStarted:!0},function(){var e,o;return null===(o=(e=t.props).onInteractionStart)||void 0===o?void 0:o.call(e)}),t.wheelTimer&&clearTimeout(t.wheelTimer),t.wheelTimer=t.currentWindow.setTimeout(function(){return t.setState({hasWheelJustStarted:!1},function(){var e,o;return null===(o=(e=t.props).onInteractionEnd)||void 0===o?void 0:o.call(e)})},250)}},t.getPointOnContainer=function(e,o){var n=e.x,r=e.y;if(!t.containerRect)throw Error("The Cropper is not mounted");return{x:t.containerRect.width/2-(n-o.x),y:t.containerRect.height/2-(r-o.y)}},t.getPointOnMedia=function(e){var o=e.x,n=e.y,r=t.props,i=r.crop,a=r.zoom;return{x:(o+i.x)/a,y:(n+i.y)/a}},t.setNewZoom=function(e,o,n){var r=(void 0===n?{}:n).shouldUpdatePosition,i=void 0===r||r;if(t.state.cropSize&&t.props.onZoomChange){var a=A(e,t.props.minZoom,t.props.maxZoom);if(i){var s=t.getPointOnContainer(o,t.containerPosition),c=t.getPointOnMedia(s),h={x:c.x*a-s.x,y:c.y*a-s.y},p=t.props.restrictPosition?y(h,t.mediaSize,t.state.cropSize,a,t.props.rotation):h;t.props.onCropChange(p)}t.props.onZoomChange(a)}},t.getCropData=function(){return t.state.cropSize?function(e,t,n,r,i,a,s){void 0===a&&(a=0),void 0===s&&(s=!0);var c=s?D:P,h=E(t.width,t.height,a),p=E(t.naturalWidth,t.naturalHeight,a),u={x:c(100,((h.width-n.width/i)/2-e.x/i)/h.width*100),y:c(100,((h.height-n.height/i)/2-e.y/i)/h.height*100),width:c(100,n.width/h.width*100/i),height:c(100,n.height/h.height*100/i)},d=Math.round(c(p.width,u.width*p.width/100)),l=Math.round(c(p.height,u.height*p.height/100)),m=p.width>=p.height*r?{width:Math.round(l*r),height:l}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:o(o({},m),{x:Math.round(c(p.width-m.width,u.x*p.width/100)),y:Math.round(c(p.height-m.height,u.y*p.height/100))})}}(t.props.restrictPosition?y(t.props.crop,t.mediaSize,t.state.cropSize,t.props.zoom,t.props.rotation):t.props.crop,t.mediaSize,t.state.cropSize,t.getAspect(),t.props.zoom,t.props.rotation,t.props.restrictPosition):null},t.emitCropData=function(){var e=t.getCropData();if(e){var o=e.croppedAreaPercentages,n=e.croppedAreaPixels;t.props.onCropComplete&&t.props.onCropComplete(o,n),t.props.onCropAreaChange&&t.props.onCropAreaChange(o,n)}},t.emitCropAreaChange=function(){var e=t.getCropData();if(e){var o=e.croppedAreaPercentages,n=e.croppedAreaPixels;t.props.onCropAreaChange&&t.props.onCropAreaChange(o,n)}},t.recomputeCropPosition=function(){var e,o;if(t.state.cropSize){var n=t.props.crop;if(t.isInitialized&&(null===(e=t.previousCropSize)||void 0===e?void 0:e.width)&&(null===(o=t.previousCropSize)||void 0===o?void 0:o.height)&&(Math.abs(t.previousCropSize.width-t.state.cropSize.width)>1e-6||Math.abs(t.previousCropSize.height-t.state.cropSize.height)>1e-6)){var r=t.state.cropSize.width/t.previousCropSize.width,i=t.state.cropSize.height/t.previousCropSize.height;n={x:t.props.crop.x*r,y:t.props.crop.y*i}}var a=t.props.restrictPosition?y(n,t.mediaSize,t.state.cropSize,t.props.zoom,t.props.rotation):n;t.previousCropSize=t.state.cropSize,t.props.onCropChange(a),t.emitCropData()}},t.onKeyDown=function(e){var n,r,i=t.props,a=i.crop,s=i.onCropChange,c=i.keyboardStep,h=i.zoom,p=i.rotation,u=c;if(t.state.cropSize){e.shiftKey&&(u*=.2);var d=o({},a);switch(e.key){case"ArrowUp":d.y-=u,e.preventDefault();break;case"ArrowDown":d.y+=u,e.preventDefault();break;case"ArrowLeft":d.x-=u,e.preventDefault();break;case"ArrowRight":d.x+=u,e.preventDefault();break;default:return}t.props.restrictPosition&&(d=y(d,t.mediaSize,t.state.cropSize,h,p)),e.repeat||null===(r=(n=t.props).onInteractionStart)||void 0===r||r.call(n),s(d)}},t.onKeyUp=function(e){var o,n;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}t.emitCropData(),null===(n=(o=t.props).onInteractionEnd)||void 0===n||n.call(o)},t}return t(n,e),n.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},n.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},n.prototype.componentDidUpdate=function(e){var t,o,n,r,i,a,s,c,h;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.height)||(null===(n=e.cropSize)||void 0===n?void 0:n.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(a=this.props.crop)||void 0===a?void 0:a.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(c=this.props.crop)||void 0===c?void 0:c.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(h=this.videoRef.current)||void 0===h||h.load());var p=this.getObjectFit();p!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:p},this.computeSizes)},n.prototype.getAspect=function(){var e=this.props,t=e.cropSize,o=e.aspect;return t?t.width/t.height:o},n.prototype.getObjectFit=function(){var e,t,o,n;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var r=this.containerRect.width/this.containerRect.height;return((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(o=this.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(n=this.videoRef.current)||void 0===n?void 0:n.videoHeight)||0)<r?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},n.prototype.onPinchStart=function(e){var t=n.getTouchPoint(e.touches[0]),o=n.getTouchPoint(e.touches[1]);this.lastPinchDistance=R(t,o),this.lastPinchRotation=b(t,o),this.onDragStart(M(t,o))},n.prototype.onPinchMove=function(e){var t=this;if(this.currentDoc&&this.currentWindow){var o=n.getTouchPoint(e.touches[0]),r=n.getTouchPoint(e.touches[1]),i=M(o,r);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var e=R(o,r),n=t.props.zoom*(e/t.lastPinchDistance);t.setNewZoom(n,i,{shouldUpdatePosition:!1}),t.lastPinchDistance=e;var a=b(o,r),s=t.props.rotation+(a-t.lastPinchRotation);t.props.onRotationChange&&t.props.onRotationChange(s),t.lastPinchRotation=a})}},n.prototype.render=function(){var e,t=this,n=this.props,r=n.image,i=n.video,a=n.mediaProps,s=n.cropperProps,h=n.transform,p=n.crop,u=p.x,d=p.y,l=n.rotation,m=n.zoom,v=n.cropShape,f=n.showGrid,g=n.roundCropAreaPixels,w=n.style,C=w.containerStyle,S=w.cropAreaStyle,x=w.mediaStyle,y=n.classes,z=y.containerClassName,R=y.cropAreaClassName,b=y.mediaClassName,D=null!==(e=this.state.mediaObjectFit)&&void 0!==e?e:this.getObjectFit();return c.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef=e},"data-testid":"container",style:C,className:W("reactEasyCrop_Container",z)},r?c.createElement("img",o({alt:"",className:W("reactEasyCrop_Image","contain"===D&&"reactEasyCrop_Contain","horizontal-cover"===D&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===D&&"reactEasyCrop_Cover_Vertical",b)},a,{src:r,ref:this.imageRef,style:o(o({},x),{transform:h||"translate(".concat(u,"px, ").concat(d,"px) rotate(").concat(l,"deg) scale(").concat(m,")")}),onLoad:this.onMediaLoad})):i&&c.createElement("video",o({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:W("reactEasyCrop_Video","contain"===D&&"reactEasyCrop_Contain","horizontal-cover"===D&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===D&&"reactEasyCrop_Cover_Vertical",b)},a,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:o(o({},x),{transform:h||"translate(".concat(u,"px, ").concat(d,"px) rotate(").concat(l,"deg) scale(").concat(m,")")}),controls:!1}),(Array.isArray(i)?i:[{src:i}]).map(function(e){return c.createElement("source",o({key:e.src},e))})),this.state.cropSize&&c.createElement("div",o({ref:this.cropperRef,style:o(o({},S),{width:g?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:g?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:W("reactEasyCrop_CropArea","round"===v&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",R)},s)))},n.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:1},n.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},n.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},n}(c.Component);const j=({min:e,max:t,step:o,value:r,onChange:i,icon:a,className:s})=>/* @__PURE__ */n.jsxs("div",{className:"gap-1 flex justify-between items-center "+s,children:[
1
+ import{aG as e,fB as t,fC as o,j as n,l as r,S as i,cp as a,bi as s}from"./main-BiSoVrq9.js";import*as c from"react";import{useState as h,useCallback as p}from"react";var u,d,l,m,v,f,g,w,C,S;const x=/* @__PURE__ */e(S?C:(S=1,C=function(){if(w)return g;w=1;var e=function(){if(d)return u;d=1;var e,t,o,n,r,i,a,s,c,h,p,l,m,v,f,g=!1;function w(){if(!g){g=!0;var u=navigator.userAgent,d=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(u),w=/(Mac OS X)|(Windows)|(Linux)/.exec(u);if(l=/\b(iPhone|iP[ao]d)/.exec(u),m=/\b(iP[ao]d)/.exec(u),h=/Android/i.exec(u),v=/FBAN\/\w+;/i.exec(u),f=/Mobile/i.exec(u),p=!!/Win64/.exec(u),d){(e=d[1]?parseFloat(d[1]):d[5]?parseFloat(d[5]):NaN)&&document&&document.documentMode&&(e=document.documentMode);var C=/(?:Trident\/(\d+.\d+))/.exec(u);i=C?parseFloat(C[1])+4:e,t=d[2]?parseFloat(d[2]):NaN,o=d[3]?parseFloat(d[3]):NaN,(n=d[4]?parseFloat(d[4]):NaN)?(d=/(?:Chrome\/(\d+\.\d+))/.exec(u),r=d&&d[1]?parseFloat(d[1]):NaN):r=NaN}else e=t=o=r=n=NaN;if(w){if(w[1]){var S=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(u);a=!S||parseFloat(S[1].replace("_","."))}else a=!1;s=!!w[2],c=!!w[3]}else a=s=c=!1}}var C={ie:function(){return w()||e},ieCompatibilityMode:function(){return w()||i>e},ie64:function(){return C.ie()&&p},firefox:function(){return w()||t},opera:function(){return w()||o},webkit:function(){return w()||n},safari:function(){return C.webkit()},chrome:function(){return w()||r},windows:function(){return w()||s},osx:function(){return w()||a},linux:function(){return w()||c},iphone:function(){return w()||l},mobile:function(){return w()||l||m||h||f},nativeApp:function(){return w()||v},android:function(){return w()||h},ipad:function(){return w()||m}};return u=C}(),t=function(){if(f)return v;f=1;var e,t=function(){if(m)return l;m=1;var e=!("undefined"==typeof window||!window.document||!window.document.createElement),t={canUseDOM:e,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:e&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};return l=t}();return t.canUseDOM&&(e=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),v=function(o,n){if(!t.canUseDOM||n&&!("addEventListener"in document))return!1;var r="on"+o,i=r in document;if(!i){var a=document.createElement("div");a.setAttribute(r,"return;"),i="function"==typeof a[r]}return!i&&e&&"wheel"===o&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}}();function o(e){var t=0,o=0,n=0,r=0;return"detail"in e&&(o=e.detail),"wheelDelta"in e&&(o=-e.wheelDelta/120),"wheelDeltaY"in e&&(o=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=o,o=0),n=10*t,r=10*o,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||r)&&e.deltaMode&&(1==e.deltaMode?(n*=40,r*=40):(n*=800,r*=800)),n&&!t&&(t=n<1?-1:1),r&&!o&&(o=r<1?-1:1),{spinX:t,spinY:o,pixelX:n,pixelY:r}}return o.getEventType=function(){return e.firefox()?"DOMMouseScroll":t("wheel")?"wheel":"mousewheel"},g=o}()));function y(e,t,o,n,r){void 0===r&&(r=0);var i=E(t.width,t.height,r),a=i.width,s=i.height;return{x:z(e.x,a,o.width,n),y:z(e.y,s,o.height,n)}}function z(e,t,o,n){var r=t*n/2-o/2;return A(e,-r,r)}function R(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function b(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function D(e,t){return Math.min(e,Math.max(0,t))}function P(e,t){return t}function M(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function E(e,t,o){var n=o*Math.PI/180;return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}function A(e,t,o){return Math.min(Math.max(e,t),o)}function W(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return"string"==typeof e&&e.length>0}).join(" ").trim()}var N=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.cropperRef=c.createRef(),t.imageRef=c.createRef(),t.videoRef=c.createRef(),t.containerPosition={x:0,y:0},t.containerRef=null,t.styleRef=null,t.containerRect=null,t.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},t.dragStartPosition={x:0,y:0},t.dragStartCrop={x:0,y:0},t.gestureZoomStart=0,t.gestureRotationStart=0,t.isTouching=!1,t.lastPinchDistance=0,t.lastPinchRotation=0,t.rafDragTimeout=null,t.rafPinchTimeout=null,t.wheelTimer=null,t.currentDoc="undefined"!=typeof document?document:null,t.currentWindow="undefined"!=typeof window?window:null,t.resizeObserver=null,t.previousCropSize=null,t.isInitialized=!1,t.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},t.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&t.containerRef){var e=!0;t.resizeObserver=new window.ResizeObserver(function(o){e?e=!1:t.computeSizes()}),t.resizeObserver.observe(t.containerRef)}},t.preventZoomSafari=function(e){return e.preventDefault()},t.cleanEvents=function(){t.currentDoc&&(t.currentDoc.removeEventListener("mousemove",t.onMouseMove),t.currentDoc.removeEventListener("mouseup",t.onDragStopped),t.currentDoc.removeEventListener("touchmove",t.onTouchMove),t.currentDoc.removeEventListener("touchend",t.onDragStopped),t.currentDoc.removeEventListener("gesturechange",t.onGestureChange),t.currentDoc.removeEventListener("gestureend",t.onGestureEnd),t.currentDoc.removeEventListener("scroll",t.onScroll))},t.clearScrollEvent=function(){t.containerRef&&t.containerRef.removeEventListener("wheel",t.onWheel),t.wheelTimer&&clearTimeout(t.wheelTimer)},t.onMediaLoad=function(){var e=t.computeSizes();e&&(t.previousCropSize=e,t.emitCropData(),t.setInitialCrop(e),t.isInitialized=!0),t.props.onMediaLoaded&&t.props.onMediaLoaded(t.mediaSize)},t.setInitialCrop=function(e){if(t.props.initialCroppedAreaPercentages){var o=function(e,t,o,n,r,i){var a=E(t.width,t.height,o),s=A(n.width/a.width*(100/e.width),r,i);return{crop:{x:s*a.width/2-n.width/2-a.width*s*(e.x/100),y:s*a.height/2-n.height/2-a.height*s*(e.y/100)},zoom:s}}(t.props.initialCroppedAreaPercentages,t.mediaSize,t.props.rotation,e,t.props.minZoom,t.props.maxZoom),n=o.crop,r=o.zoom;t.props.onCropChange(n),t.props.onZoomChange&&t.props.onZoomChange(r)}else if(t.props.initialCroppedAreaPixels){var i=function(e,t,o,n,r,i){void 0===o&&(o=0);var a=E(t.naturalWidth,t.naturalHeight,o),s=A(function(e,t,o){var n=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return o.height>o.width?o.height/(e.height*n):o.width/(e.width*n)}(e,t,n),r,i),c=n.height>n.width?n.height/e.height:n.width/e.width;return{crop:{x:((a.width-e.width)/2-e.x)*c,y:((a.height-e.height)/2-e.y)*c},zoom:s}}(t.props.initialCroppedAreaPixels,t.mediaSize,t.props.rotation,e,t.props.minZoom,t.props.maxZoom);n=i.crop,r=i.zoom,t.props.onCropChange(n),t.props.onZoomChange&&t.props.onZoomChange(r)}},t.computeSizes=function(){var e,n,r,i,a,s,c=t.imageRef.current||t.videoRef.current;if(c&&t.containerRef){t.containerRect=t.containerRef.getBoundingClientRect(),t.saveContainerPosition();var h=t.containerRect.width/t.containerRect.height,p=(null===(e=t.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(n=t.videoRef.current)||void 0===n?void 0:n.videoWidth)||0,u=(null===(r=t.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(i=t.videoRef.current)||void 0===i?void 0:i.videoHeight)||0,d=p/u,l=void 0;if(c.offsetWidth<p||c.offsetHeight<u)switch(t.state.mediaObjectFit){default:case"contain":l=h>d?{width:t.containerRect.height*d,height:t.containerRect.height}:{width:t.containerRect.width,height:t.containerRect.width/d};break;case"horizontal-cover":l={width:t.containerRect.width,height:t.containerRect.width/d};break;case"vertical-cover":l={width:t.containerRect.height*d,height:t.containerRect.height}}else l={width:c.offsetWidth,height:c.offsetHeight};t.mediaSize=o(o({},l),{naturalWidth:p,naturalHeight:u}),t.props.setMediaSize&&t.props.setMediaSize(t.mediaSize);var m=t.props.cropSize?t.props.cropSize:function(e,t,o,n,r,i){void 0===i&&(i=0);var a=E(e,t,i),s=a.width,c=a.height,h=Math.min(s,o),p=Math.min(c,n);return h>p*r?{width:p*r,height:p}:{width:h,height:h/r}}(t.mediaSize.width,t.mediaSize.height,t.containerRect.width,t.containerRect.height,t.props.aspect,t.props.rotation);return(null===(a=t.state.cropSize)||void 0===a?void 0:a.height)===m.height&&(null===(s=t.state.cropSize)||void 0===s?void 0:s.width)===m.width||t.props.onCropSizeChange&&t.props.onCropSizeChange(m),t.setState({cropSize:m},t.recomputeCropPosition),t.props.setCropSize&&t.props.setCropSize(m),m}},t.saveContainerPosition=function(){if(t.containerRef){var e=t.containerRef.getBoundingClientRect();t.containerPosition={x:e.left,y:e.top}}},t.onMouseDown=function(e){t.currentDoc&&(e.preventDefault(),t.currentDoc.addEventListener("mousemove",t.onMouseMove),t.currentDoc.addEventListener("mouseup",t.onDragStopped),t.saveContainerPosition(),t.onDragStart(n.getMousePoint(e)))},t.onMouseMove=function(e){return t.onDrag(n.getMousePoint(e))},t.onScroll=function(e){t.currentDoc&&(e.preventDefault(),t.saveContainerPosition())},t.onTouchStart=function(e){t.currentDoc&&(t.isTouching=!0,t.props.onTouchRequest&&!t.props.onTouchRequest(e)||(t.currentDoc.addEventListener("touchmove",t.onTouchMove,{passive:!1}),t.currentDoc.addEventListener("touchend",t.onDragStopped),t.saveContainerPosition(),2===e.touches.length?t.onPinchStart(e):1===e.touches.length&&t.onDragStart(n.getTouchPoint(e.touches[0]))))},t.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?t.onPinchMove(e):1===e.touches.length&&t.onDrag(n.getTouchPoint(e.touches[0]))},t.onGestureStart=function(e){t.currentDoc&&(e.preventDefault(),t.currentDoc.addEventListener("gesturechange",t.onGestureChange),t.currentDoc.addEventListener("gestureend",t.onGestureEnd),t.gestureZoomStart=t.props.zoom,t.gestureRotationStart=t.props.rotation)},t.onGestureChange=function(e){if(e.preventDefault(),!t.isTouching){var o=n.getMousePoint(e),r=t.gestureZoomStart-1+e.scale;if(t.setNewZoom(r,o,{shouldUpdatePosition:!0}),t.props.onRotationChange){var i=t.gestureRotationStart+e.rotation;t.props.onRotationChange(i)}}},t.onGestureEnd=function(e){t.cleanEvents()},t.onDragStart=function(e){var n,r,i=e.x,a=e.y;t.dragStartPosition={x:i,y:a},t.dragStartCrop=o({},t.props.crop),null===(r=(n=t.props).onInteractionStart)||void 0===r||r.call(n)},t.onDrag=function(e){var o=e.x,n=e.y;t.currentWindow&&(t.rafDragTimeout&&t.currentWindow.cancelAnimationFrame(t.rafDragTimeout),t.rafDragTimeout=t.currentWindow.requestAnimationFrame(function(){if(t.state.cropSize&&void 0!==o&&void 0!==n){var e=o-t.dragStartPosition.x,r=n-t.dragStartPosition.y,i={x:t.dragStartCrop.x+e,y:t.dragStartCrop.y+r},a=t.props.restrictPosition?y(i,t.mediaSize,t.state.cropSize,t.props.zoom,t.props.rotation):i;t.props.onCropChange(a)}}))},t.onDragStopped=function(){var e,o;t.isTouching=!1,t.cleanEvents(),t.emitCropData(),null===(o=(e=t.props).onInteractionEnd)||void 0===o||o.call(e)},t.onWheel=function(e){if(t.currentWindow&&(!t.props.onWheelRequest||t.props.onWheelRequest(e))){e.preventDefault();var o=n.getMousePoint(e),r=x(e).pixelY,i=t.props.zoom-r*t.props.zoomSpeed/200;t.setNewZoom(i,o,{shouldUpdatePosition:!0}),t.state.hasWheelJustStarted||t.setState({hasWheelJustStarted:!0},function(){var e,o;return null===(o=(e=t.props).onInteractionStart)||void 0===o?void 0:o.call(e)}),t.wheelTimer&&clearTimeout(t.wheelTimer),t.wheelTimer=t.currentWindow.setTimeout(function(){return t.setState({hasWheelJustStarted:!1},function(){var e,o;return null===(o=(e=t.props).onInteractionEnd)||void 0===o?void 0:o.call(e)})},250)}},t.getPointOnContainer=function(e,o){var n=e.x,r=e.y;if(!t.containerRect)throw Error("The Cropper is not mounted");return{x:t.containerRect.width/2-(n-o.x),y:t.containerRect.height/2-(r-o.y)}},t.getPointOnMedia=function(e){var o=e.x,n=e.y,r=t.props,i=r.crop,a=r.zoom;return{x:(o+i.x)/a,y:(n+i.y)/a}},t.setNewZoom=function(e,o,n){var r=(void 0===n?{}:n).shouldUpdatePosition,i=void 0===r||r;if(t.state.cropSize&&t.props.onZoomChange){var a=A(e,t.props.minZoom,t.props.maxZoom);if(i){var s=t.getPointOnContainer(o,t.containerPosition),c=t.getPointOnMedia(s),h={x:c.x*a-s.x,y:c.y*a-s.y},p=t.props.restrictPosition?y(h,t.mediaSize,t.state.cropSize,a,t.props.rotation):h;t.props.onCropChange(p)}t.props.onZoomChange(a)}},t.getCropData=function(){return t.state.cropSize?function(e,t,n,r,i,a,s){void 0===a&&(a=0),void 0===s&&(s=!0);var c=s?D:P,h=E(t.width,t.height,a),p=E(t.naturalWidth,t.naturalHeight,a),u={x:c(100,((h.width-n.width/i)/2-e.x/i)/h.width*100),y:c(100,((h.height-n.height/i)/2-e.y/i)/h.height*100),width:c(100,n.width/h.width*100/i),height:c(100,n.height/h.height*100/i)},d=Math.round(c(p.width,u.width*p.width/100)),l=Math.round(c(p.height,u.height*p.height/100)),m=p.width>=p.height*r?{width:Math.round(l*r),height:l}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:o(o({},m),{x:Math.round(c(p.width-m.width,u.x*p.width/100)),y:Math.round(c(p.height-m.height,u.y*p.height/100))})}}(t.props.restrictPosition?y(t.props.crop,t.mediaSize,t.state.cropSize,t.props.zoom,t.props.rotation):t.props.crop,t.mediaSize,t.state.cropSize,t.getAspect(),t.props.zoom,t.props.rotation,t.props.restrictPosition):null},t.emitCropData=function(){var e=t.getCropData();if(e){var o=e.croppedAreaPercentages,n=e.croppedAreaPixels;t.props.onCropComplete&&t.props.onCropComplete(o,n),t.props.onCropAreaChange&&t.props.onCropAreaChange(o,n)}},t.emitCropAreaChange=function(){var e=t.getCropData();if(e){var o=e.croppedAreaPercentages,n=e.croppedAreaPixels;t.props.onCropAreaChange&&t.props.onCropAreaChange(o,n)}},t.recomputeCropPosition=function(){var e,o;if(t.state.cropSize){var n=t.props.crop;if(t.isInitialized&&(null===(e=t.previousCropSize)||void 0===e?void 0:e.width)&&(null===(o=t.previousCropSize)||void 0===o?void 0:o.height)&&(Math.abs(t.previousCropSize.width-t.state.cropSize.width)>1e-6||Math.abs(t.previousCropSize.height-t.state.cropSize.height)>1e-6)){var r=t.state.cropSize.width/t.previousCropSize.width,i=t.state.cropSize.height/t.previousCropSize.height;n={x:t.props.crop.x*r,y:t.props.crop.y*i}}var a=t.props.restrictPosition?y(n,t.mediaSize,t.state.cropSize,t.props.zoom,t.props.rotation):n;t.previousCropSize=t.state.cropSize,t.props.onCropChange(a),t.emitCropData()}},t.onKeyDown=function(e){var n,r,i=t.props,a=i.crop,s=i.onCropChange,c=i.keyboardStep,h=i.zoom,p=i.rotation,u=c;if(t.state.cropSize){e.shiftKey&&(u*=.2);var d=o({},a);switch(e.key){case"ArrowUp":d.y-=u,e.preventDefault();break;case"ArrowDown":d.y+=u,e.preventDefault();break;case"ArrowLeft":d.x-=u,e.preventDefault();break;case"ArrowRight":d.x+=u,e.preventDefault();break;default:return}t.props.restrictPosition&&(d=y(d,t.mediaSize,t.state.cropSize,h,p)),e.repeat||null===(r=(n=t.props).onInteractionStart)||void 0===r||r.call(n),s(d)}},t.onKeyUp=function(e){var o,n;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}t.emitCropData(),null===(n=(o=t.props).onInteractionEnd)||void 0===n||n.call(o)},t}return t(n,e),n.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},n.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},n.prototype.componentDidUpdate=function(e){var t,o,n,r,i,a,s,c,h;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.height)||(null===(n=e.cropSize)||void 0===n?void 0:n.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(a=this.props.crop)||void 0===a?void 0:a.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(c=this.props.crop)||void 0===c?void 0:c.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(h=this.videoRef.current)||void 0===h||h.load());var p=this.getObjectFit();p!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:p},this.computeSizes)},n.prototype.getAspect=function(){var e=this.props,t=e.cropSize,o=e.aspect;return t?t.width/t.height:o},n.prototype.getObjectFit=function(){var e,t,o,n;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var r=this.containerRect.width/this.containerRect.height;return((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(o=this.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(n=this.videoRef.current)||void 0===n?void 0:n.videoHeight)||0)<r?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},n.prototype.onPinchStart=function(e){var t=n.getTouchPoint(e.touches[0]),o=n.getTouchPoint(e.touches[1]);this.lastPinchDistance=R(t,o),this.lastPinchRotation=b(t,o),this.onDragStart(M(t,o))},n.prototype.onPinchMove=function(e){var t=this;if(this.currentDoc&&this.currentWindow){var o=n.getTouchPoint(e.touches[0]),r=n.getTouchPoint(e.touches[1]),i=M(o,r);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var e=R(o,r),n=t.props.zoom*(e/t.lastPinchDistance);t.setNewZoom(n,i,{shouldUpdatePosition:!1}),t.lastPinchDistance=e;var a=b(o,r),s=t.props.rotation+(a-t.lastPinchRotation);t.props.onRotationChange&&t.props.onRotationChange(s),t.lastPinchRotation=a})}},n.prototype.render=function(){var e,t=this,n=this.props,r=n.image,i=n.video,a=n.mediaProps,s=n.cropperProps,h=n.transform,p=n.crop,u=p.x,d=p.y,l=n.rotation,m=n.zoom,v=n.cropShape,f=n.showGrid,g=n.roundCropAreaPixels,w=n.style,C=w.containerStyle,S=w.cropAreaStyle,x=w.mediaStyle,y=n.classes,z=y.containerClassName,R=y.cropAreaClassName,b=y.mediaClassName,D=null!==(e=this.state.mediaObjectFit)&&void 0!==e?e:this.getObjectFit();return c.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef=e},"data-testid":"container",style:C,className:W("reactEasyCrop_Container",z)},r?c.createElement("img",o({alt:"",className:W("reactEasyCrop_Image","contain"===D&&"reactEasyCrop_Contain","horizontal-cover"===D&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===D&&"reactEasyCrop_Cover_Vertical",b)},a,{src:r,ref:this.imageRef,style:o(o({},x),{transform:h||"translate(".concat(u,"px, ").concat(d,"px) rotate(").concat(l,"deg) scale(").concat(m,")")}),onLoad:this.onMediaLoad})):i&&c.createElement("video",o({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:W("reactEasyCrop_Video","contain"===D&&"reactEasyCrop_Contain","horizontal-cover"===D&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===D&&"reactEasyCrop_Cover_Vertical",b)},a,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:o(o({},x),{transform:h||"translate(".concat(u,"px, ").concat(d,"px) rotate(").concat(l,"deg) scale(").concat(m,")")}),controls:!1}),(Array.isArray(i)?i:[{src:i}]).map(function(e){return c.createElement("source",o({key:e.src},e))})),this.state.cropSize&&c.createElement("div",o({ref:this.cropperRef,style:o(o({},S),{width:g?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:g?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:W("reactEasyCrop_CropArea","round"===v&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",R)},s)))},n.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:1},n.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},n.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},n}(c.Component);const j=({min:e,max:t,step:o,value:r,onChange:i,icon:a,className:s})=>/* @__PURE__ */n.jsxs("div",{className:"gap-1 flex justify-between items-center "+s,children:[
2
2
  /* @__PURE__ */n.jsx("span",{className:"mb-1",children:a}),
3
3
  /* @__PURE__ */n.jsx("input",{type:"range",min:e,max:t,step:o,value:r,onChange:e=>i(parseFloat(e.target.value)),className:"w-full accent-accent"})]}),T=({open:e,onClose:t,imageUrl:o,onSave:c})=>{const[u,d]=h({x:0,y:0}),[l,m]=h(1),[v,f]=h(0),[g,w]=h(null),C=p((e,t)=>{w(t)},[]),S=p(async()=>{if(g)try{const e=await async function(e,t,o=0){const n=await new Promise((t,o)=>{const n=new Image;n.src=e,n.crossOrigin="anonymous",n.onload=()=>t(n),n.onerror=o}),r=document.createElement("canvas"),i=r.getContext("2d");return r.width=t.width,r.height=t.height,i.translate(r.width/2,r.height/2),i.rotate(o*Math.PI/180),i.translate(-r.width/2,-r.height/2),i.drawImage(n,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise(e=>{r.toBlob(t=>{if(!t)throw Error("Canvas to blob failed");e(t)},"image/jpeg")})}(o,g,v),n=new File([e],"edited-image.jpg",{type:"image/jpeg",lastModified:Date.now()});c(n),t()}catch(e){}},[g,v,o,c,t]);/* @__PURE__ */
4
4
  return n.jsx(r,{open:e,onOpenChange:t,size:"full",hasNotPadding:!0,children:/* @__PURE__ */n.jsxs("div",{className:"dark h-full bg-divider flex flex-col",children:[
@@ -1,4 +1,4 @@
1
- import*as React from"react";import React__default,{useRef,useEffect,useMemo,useCallback,useState,useLayoutEffect,createElement}from"react";import{c as createLucideIcon,eJ as getAugmentedNamespace,eO as requirePropTypes,aG as getDefaultExportFromCjs,j as jsxRuntimeExports,g as useSelector,dU as convertPodspaceUrl,eP as FavoriteIcon,ar as Primitive,cV as useLayoutEffect2,aq as createContextScope,as as useComposedRefs,cT as useCallbackRef,dO as useId,ap as useControllableState,at as composeEventHandlers,au as Presence,eQ as DismissableLayer,eR as createSlottable,e as useDispatch,dv as MdCallEnd,dB as endCall,b2 as GenIcon,eS as startScreenShare,eT as recordingCall,eU as HiOutlineVideoCameraSlash,eV as turnOnVideoCall,eW as createSlot,eX as hideOthers,eY as useFocusGuards,eZ as ReactRemoveScroll,e_ as FocusScope,eF as SelectOnDownIcon,dL as selectDevicesBucket,dE as getActiveDevice,dF as VideoCam,G as getChatAgentInstance,dJ as setActiveDevice,dx as SettingIcon,dr as showSettingModalAction,dI as Mic,dH as MicOff,dh as selectCallParticipantByUserId,dM as SpeakerIcon,c$ as muteCallParticipants,e$ as dispatchDiscreteCustomEvent,cU as composeRefs,Z as RippleEffect,d0 as MdCheckCircle,d1 as MdOutlineCircle,d6 as CloseCircleIcon,f0 as decodeHexEntitiesToEmoji,aH as purify,aF as commonjsGlobal}from"./main-CXfBH5gS.js";import*as ReactDOM from"react-dom";import ReactDOM__default from"react-dom";const __iconNode=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Check=createLucideIcon("check",__iconNode);var OutsideClickHandler$1={},mocks,hasRequiredMocks,airbnbPropTypes,hasRequiredAirbnbPropTypes;function requireMocks(){if(hasRequiredMocks)return mocks;function e(){return null}function t(){return e}return hasRequiredMocks=1,e.isRequired=e,mocks={and:t,between:t,booleanSome:t,childrenHavePropXorChildren:t,childrenOf:t,childrenOfType:t,childrenSequenceOf:t,componentWithName:t,disallowedIf:t,elementType:t,empty:t,explicitNull:t,forbidExtraProps:Object,integer:t,keysOf:t,mutuallyExclusiveProps:t,mutuallyExclusiveTrueProps:t,nChildren:t,nonNegativeInteger:e,nonNegativeNumber:t,numericString:t,object:t,or:t,predicate:t,range:t,ref:t,requiredBy:t,restrictedProp:t,sequenceOf:t,shape:t,stringEndsWith:t,stringStartsWith:t,uniqueArray:t,uniqueArrayOf:t,valuesOf:t,withShape:t}}function requireAirbnbPropTypes(){return hasRequiredAirbnbPropTypes?airbnbPropTypes:(hasRequiredAirbnbPropTypes=1,airbnbPropTypes=requireMocks())}var CAN_USE_DOM=!("undefined"==typeof window||!window.document||!window.document.createElement);function testPassiveEventListeners(){if(!CAN_USE_DOM)return!1;if(!window.addEventListener||!window.removeEventListener||!Object.defineProperty)return!1;var e=!1;try{var t=Object.defineProperty({},"passive",{get:/* @__PURE__ */function(){return function(){e=!0}}()}),r=function(){};window.addEventListener("testPassiveEventSupport",r,t),window.removeEventListener("testPassiveEventSupport",r,t)}catch(n){}return e}var memoized=void 0;function canUsePassiveEventListeners(){return void 0===memoized&&(memoized=testPassiveEventListeners()),memoized}function normalizeEventOptions(e){if(e)return canUsePassiveEventListeners()?e:!!e.capture}function eventOptionsKey(e){return e?!0===e?100:(0|e.capture)+(e.passive<<1)+(e.once<<2):0}function ensureCanMutateNextEventHandlers(e){e.handlers===e.nextHandlers&&(e.nextHandlers=e.handlers.slice())}function TargetEventHandlers(e){this.target=e,this.events={}}TargetEventHandlers.prototype.getEventHandlers=/* @__PURE__ */function(){return function(e,t){var r=e+" "+eventOptionsKey(t);return this.events[r]||(this.events[r]={handlers:[],handleEvent:void 0},this.events[r].nextHandlers=this.events[r].handlers),this.events[r]}}(),TargetEventHandlers.prototype.handleEvent=/* @__PURE__ */function(){return function(e,t,r){var n=this.getEventHandlers(e,t);n.handlers=n.nextHandlers,n.handlers.forEach(function(e){e&&e(r)})}}(),TargetEventHandlers.prototype.add=/* @__PURE__ */function(){return function(e,t,r){var n=this,i=this.getEventHandlers(e,r);ensureCanMutateNextEventHandlers(i),0===i.nextHandlers.length&&(i.handleEvent=this.handleEvent.bind(this,e,r),this.target.addEventListener(e,i.handleEvent,r)),i.nextHandlers.push(t);var o=!0;/* @__PURE__ */
1
+ import*as React from"react";import React__default,{useRef,useEffect,useMemo,useCallback,useState,useLayoutEffect,createElement}from"react";import{c as createLucideIcon,eJ as getAugmentedNamespace,eO as requirePropTypes,aG as getDefaultExportFromCjs,j as jsxRuntimeExports,g as useSelector,dU as convertPodspaceUrl,eP as FavoriteIcon,ar as Primitive,cV as useLayoutEffect2,aq as createContextScope,as as useComposedRefs,cT as useCallbackRef,dO as useId,ap as useControllableState,at as composeEventHandlers,au as Presence,eQ as DismissableLayer,eR as createSlottable,e as useDispatch,dv as MdCallEnd,dB as endCall,b2 as GenIcon,eS as startScreenShare,eT as recordingCall,eU as HiOutlineVideoCameraSlash,eV as turnOnVideoCall,eW as createSlot,eX as hideOthers,eY as useFocusGuards,eZ as ReactRemoveScroll,e_ as FocusScope,eF as SelectOnDownIcon,dL as selectDevicesBucket,dE as getActiveDevice,dF as VideoCam,G as getChatAgentInstance,dJ as setActiveDevice,dx as SettingIcon,dr as showSettingModalAction,dI as Mic,dH as MicOff,dh as selectCallParticipantByUserId,dM as SpeakerIcon,c$ as muteCallParticipants,e$ as dispatchDiscreteCustomEvent,cU as composeRefs,Z as RippleEffect,d0 as MdCheckCircle,d1 as MdOutlineCircle,d6 as CloseCircleIcon,f0 as decodeHexEntitiesToEmoji,aH as purify,aF as commonjsGlobal}from"./main-BiSoVrq9.js";import*as ReactDOM from"react-dom";import ReactDOM__default from"react-dom";const __iconNode=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Check=createLucideIcon("check",__iconNode);var OutsideClickHandler$1={},mocks,hasRequiredMocks,airbnbPropTypes,hasRequiredAirbnbPropTypes;function requireMocks(){if(hasRequiredMocks)return mocks;function e(){return null}function t(){return e}return hasRequiredMocks=1,e.isRequired=e,mocks={and:t,between:t,booleanSome:t,childrenHavePropXorChildren:t,childrenOf:t,childrenOfType:t,childrenSequenceOf:t,componentWithName:t,disallowedIf:t,elementType:t,empty:t,explicitNull:t,forbidExtraProps:Object,integer:t,keysOf:t,mutuallyExclusiveProps:t,mutuallyExclusiveTrueProps:t,nChildren:t,nonNegativeInteger:e,nonNegativeNumber:t,numericString:t,object:t,or:t,predicate:t,range:t,ref:t,requiredBy:t,restrictedProp:t,sequenceOf:t,shape:t,stringEndsWith:t,stringStartsWith:t,uniqueArray:t,uniqueArrayOf:t,valuesOf:t,withShape:t}}function requireAirbnbPropTypes(){return hasRequiredAirbnbPropTypes?airbnbPropTypes:(hasRequiredAirbnbPropTypes=1,airbnbPropTypes=requireMocks())}var CAN_USE_DOM=!("undefined"==typeof window||!window.document||!window.document.createElement);function testPassiveEventListeners(){if(!CAN_USE_DOM)return!1;if(!window.addEventListener||!window.removeEventListener||!Object.defineProperty)return!1;var e=!1;try{var t=Object.defineProperty({},"passive",{get:/* @__PURE__ */function(){return function(){e=!0}}()}),r=function(){};window.addEventListener("testPassiveEventSupport",r,t),window.removeEventListener("testPassiveEventSupport",r,t)}catch(n){}return e}var memoized=void 0;function canUsePassiveEventListeners(){return void 0===memoized&&(memoized=testPassiveEventListeners()),memoized}function normalizeEventOptions(e){if(e)return canUsePassiveEventListeners()?e:!!e.capture}function eventOptionsKey(e){return e?!0===e?100:(0|e.capture)+(e.passive<<1)+(e.once<<2):0}function ensureCanMutateNextEventHandlers(e){e.handlers===e.nextHandlers&&(e.nextHandlers=e.handlers.slice())}function TargetEventHandlers(e){this.target=e,this.events={}}TargetEventHandlers.prototype.getEventHandlers=/* @__PURE__ */function(){return function(e,t){var r=e+" "+eventOptionsKey(t);return this.events[r]||(this.events[r]={handlers:[],handleEvent:void 0},this.events[r].nextHandlers=this.events[r].handlers),this.events[r]}}(),TargetEventHandlers.prototype.handleEvent=/* @__PURE__ */function(){return function(e,t,r){var n=this.getEventHandlers(e,t);n.handlers=n.nextHandlers,n.handlers.forEach(function(e){e&&e(r)})}}(),TargetEventHandlers.prototype.add=/* @__PURE__ */function(){return function(e,t,r){var n=this,i=this.getEventHandlers(e,r);ensureCanMutateNextEventHandlers(i),0===i.nextHandlers.length&&(i.handleEvent=this.handleEvent.bind(this,e,r),this.target.addEventListener(e,i.handleEvent,r)),i.nextHandlers.push(t);var o=!0;/* @__PURE__ */
2
2
  return function(){return function(){if(o){o=!1,ensureCanMutateNextEventHandlers(i);var s=i.nextHandlers.indexOf(t);i.nextHandlers.splice(s,1),0===i.nextHandlers.length&&(n.target&&n.target.removeEventListener(e,i.handleEvent,r),i.handleEvent=void 0)}}}()}}();var EVENT_HANDLERS_KEY="__consolidated_events_handlers__";function addEventListener(e,t,r,n){e[EVENT_HANDLERS_KEY]||(e[EVENT_HANDLERS_KEY]=new TargetEventHandlers(e));var i=normalizeEventOptions(n);return e[EVENT_HANDLERS_KEY].add(t,r,i)}const index_esm=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,addEventListener:addEventListener},Symbol.toStringTag,{value:"Module"})),require$$3=/* @__PURE__ */getAugmentedNamespace(index_esm);var isArguments,hasRequiredIsArguments,implementation$3,hasRequiredImplementation$3,objectKeys,hasRequiredObjectKeys,esDefineProperty,hasRequiredEsDefineProperty,syntax,hasRequiredSyntax,type,hasRequiredType,gOPD,hasRequiredGOPD,gopd,hasRequiredGopd,defineDataProperty,hasRequiredDefineDataProperty,hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors,defineProperties_1,hasRequiredDefineProperties;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var e=Object.prototype.toString;return isArguments=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}}function requireImplementation$3(){if(hasRequiredImplementation$3)return implementation$3;var e;if(hasRequiredImplementation$3=1,!Object.keys){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=requireIsArguments(),i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(e){var t=e.constructor;return t&&t.prototype===e},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},c=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!u["$"+e]&&t.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{l(window[e])}catch(r){return!0}}catch(r){return!0}return!1}();e=function(e){var i=null!==e&&"object"==typeof e,u="[object Function]"===r.call(e),d=n(e),h=i&&"[object String]"===r.call(e),p=[];if(!i&&!u&&!d)throw new TypeError("Object.keys called on a non-object");var f=s&&u;if(h&&e.length>0&&!t.call(e,0))for(var m=0;m<e.length;++m)p.push(m+"");if(d&&e.length>0)for(var g=0;g<e.length;++g)p.push(g+"");else for(var y in e)f&&"prototype"===y||!t.call(e,y)||p.push(y+"");if(o)for(var v=function(e){if("undefined"==typeof window||!c)return l(e);try{return l(e)}catch(t){return!1}}(e),x=0;x<a.length;++x)v&&"constructor"===a[x]||!t.call(e,a[x])||p.push(a[x]);return p}}return implementation$3=e}function requireObjectKeys(){if(hasRequiredObjectKeys)return objectKeys;hasRequiredObjectKeys=1;var e=Array.prototype.slice,t=requireIsArguments(),r=Object.keys,n=r?function(e){return r(e)}:requireImplementation$3(),i=Object.keys;return n.shim=function(){if(Object.keys){var r=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);r||(Object.keys=function(r){return t(r)?i(e.call(r)):i(r)})}else Object.keys=n;return Object.keys||n},objectKeys=n}function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}return esDefineProperty=e}function requireSyntax(){return hasRequiredSyntax?syntax:(hasRequiredSyntax=1,syntax=SyntaxError)}function requireType(){return hasRequiredType?type:(hasRequiredType=1,type=TypeError)}function requireGOPD(){return hasRequiredGOPD?gOPD:(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor)}function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var e=/* @__PURE__ */requireGOPD();if(e)try{e([],"length")}catch(t){e=null}return gopd=e}function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var e=/* @__PURE__ */requireEsDefineProperty(),t=/* @__PURE__ */requireSyntax(),r=/* @__PURE__ */requireType(),n=/* @__PURE__ */requireGopd();return defineDataProperty=function(i,o,s){if(!i||"object"!=typeof i&&"function"!=typeof i)throw new r("`obj` must be an object or a function`");if("string"!=typeof o&&"symbol"!=typeof o)throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new r("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],d=!!n&&n(i,o);if(e)e(i,o,{configurable:null===u&&d?d.configurable:!u,enumerable:null===a&&d?d.enumerable:!a,value:s,writable:null===l&&d?d.writable:!l});else{if(!c&&(a||l||u))throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");i[o]=s}},defineDataProperty}function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var e=/* @__PURE__ */requireEsDefineProperty(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return 1!==e([],"length",{value:1}).length}catch(t){return!0}},hasPropertyDescriptors_1=t}function requireDefineProperties(){if(hasRequiredDefineProperties)return defineProperties_1;hasRequiredDefineProperties=1;var e=requireObjectKeys(),t="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),r=Object.prototype.toString,n=Array.prototype.concat,i=/* @__PURE__ */requireDefineDataProperty(),o=/* @__PURE__ */requireHasPropertyDescriptors()(),s=function(e,t,n,s){if(t in e)if(!0===s){if(e[t]===n)return}else if("function"!=typeof(a=s)||"[object Function]"!==r.call(a)||!s())return;var a;o?i(e,t,n,!0):i(e,t,n)},a=function(r,i){var o=arguments.length>2?arguments[2]:{},a=e(i);t&&(a=n.call(a,Object.getOwnPropertySymbols(i)));for(var l=0;l<a.length;l+=1)s(r,a[l],i[a[l]],o[a[l]])};return a.supportsDescriptors=!!o,defineProperties_1=a}var callBind={exports:{}},esObjectAtoms,hasRequiredEsObjectAtoms,esErrors,hasRequiredEsErrors,_eval,hasRequired_eval,range,hasRequiredRange,ref,hasRequiredRef,uri,hasRequiredUri,abs,hasRequiredAbs,floor$1,hasRequiredFloor,max$1,hasRequiredMax,min$1,hasRequiredMin,pow,hasRequiredPow,round$1,hasRequiredRound,_isNaN,hasRequired_isNaN,sign,hasRequiredSign,shams,hasRequiredShams,hasSymbols,hasRequiredHasSymbols,Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf,Object_getPrototypeOf,hasRequiredObject_getPrototypeOf,implementation$2,hasRequiredImplementation$2,functionBind,hasRequiredFunctionBind,functionCall,hasRequiredFunctionCall,functionApply,hasRequiredFunctionApply,reflectApply,hasRequiredReflectApply,actualApply,hasRequiredActualApply,callBindApplyHelpers,hasRequiredCallBindApplyHelpers,get,hasRequiredGet,getProto,hasRequiredGetProto,hasown,hasRequiredHasown,getIntrinsic,hasRequiredGetIntrinsic,setFunctionLength,hasRequiredSetFunctionLength,applyBind,hasRequiredApplyBind,hasRequiredCallBind,RequireObjectCoercible,hasRequiredRequireObjectCoercible,callBound,hasRequiredCallBound,implementation$1,hasRequiredImplementation$1,polyfill$1,hasRequiredPolyfill$1,shim$1,hasRequiredShim$1,object_values,hasRequiredObject_values,implementation,hasRequiredImplementation,polyfill,hasRequiredPolyfill,shim,hasRequiredShim,document_contains,hasRequiredDocument_contains,hasRequiredOutsideClickHandler,reactOutsideClickHandler,hasRequiredReactOutsideClickHandler;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms?esObjectAtoms:(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object)}function requireEsErrors(){return hasRequiredEsErrors?esErrors:(hasRequiredEsErrors=1,esErrors=Error)}function require_eval(){return hasRequired_eval?_eval:(hasRequired_eval=1,_eval=EvalError)}function requireRange(){return hasRequiredRange?range:(hasRequiredRange=1,range=RangeError)}function requireRef(){return hasRequiredRef?ref:(hasRequiredRef=1,ref=ReferenceError)}function requireUri(){return hasRequiredUri?uri:(hasRequiredUri=1,uri=URIError)}function requireAbs(){return hasRequiredAbs?abs:(hasRequiredAbs=1,abs=Math.abs)}function requireFloor(){return hasRequiredFloor?floor$1:(hasRequiredFloor=1,floor$1=Math.floor)}function requireMax(){return hasRequiredMax?max$1:(hasRequiredMax=1,max$1=Math.max)}function requireMin(){return hasRequiredMin?min$1:(hasRequiredMin=1,min$1=Math.min)}function requirePow(){return hasRequiredPow?pow:(hasRequiredPow=1,pow=Math.pow)}function requireRound(){return hasRequiredRound?round$1:(hasRequiredRound=1,round$1=Math.round)}function require_isNaN(){return hasRequired_isNaN?_isNaN:(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(e){return e!=e})}function requireSign(){if(hasRequiredSign)return sign;hasRequiredSign=1;var e=/* @__PURE__ */require_isNaN();return sign=function(t){return e(t)||0===t?t:t<0?-1:1}}function requireShams(){return hasRequiredShams?shams:(hasRequiredShams=1,shams=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0})}function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var e="undefined"!=typeof Symbol&&Symbol,t=requireShams();return hasSymbols=function(){return"function"==typeof e&&"function"==typeof Symbol&&"symbol"==typeof e("foo")&&"symbol"==typeof Symbol("bar")&&t()}}function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf?Reflect_getPrototypeOf:(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null)}function requireObject_getPrototypeOf(){return hasRequiredObject_getPrototypeOf?Object_getPrototypeOf:(hasRequiredObject_getPrototypeOf=1,Object_getPrototypeOf=/* @__PURE__ */requireEsObjectAtoms().getPrototypeOf||null)}function requireImplementation$2(){if(hasRequiredImplementation$2)return implementation$2;hasRequiredImplementation$2=1;var e=Object.prototype.toString,t=Math.max,r=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};return implementation$2=function(n){var i=this;if("function"!=typeof i||"[object Function]"!==e.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var o,s=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),a=t(0,i.length-s.length),l=[],u=0;u<a;u++)l[u]="$"+u;if(o=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof o){var e=i.apply(this,r(s,arguments));return Object(e)===e?e:this}return i.apply(n,r(s,arguments))}),i.prototype){var c=function(){};c.prototype=i.prototype,o.prototype=new c,c.prototype=null}return o},implementation$2}function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var e=requireImplementation$2();return functionBind=Function.prototype.bind||e}function requireFunctionCall(){return hasRequiredFunctionCall?functionCall:(hasRequiredFunctionCall=1,functionCall=Function.prototype.call)}function requireFunctionApply(){return hasRequiredFunctionApply?functionApply:(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply)}function requireReflectApply(){return hasRequiredReflectApply?reflectApply:(hasRequiredReflectApply=1,reflectApply="undefined"!=typeof Reflect&&Reflect&&Reflect.apply)}function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireFunctionCall(),n=requireReflectApply();return actualApply=n||e.call(r,t)}function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var e=requireFunctionBind(),t=/* @__PURE__ */requireType(),r=requireFunctionCall(),n=requireActualApply();return callBindApplyHelpers=function(i){if(i.length<1||"function"!=typeof i[0])throw new t("a function is required");return n(e,r,i)}}function requireGet(){if(hasRequiredGet)return get;hasRequiredGet=1;var e,t=requireCallBindApplyHelpers(),r=/* @__PURE__ */requireGopd();try{e=[].__proto__===Array.prototype}catch(s){if(!s||"object"!=typeof s||!("code"in s)||"ERR_PROTO_ACCESS"!==s.code)throw s}var n=!!e&&r&&r(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return get=n&&"function"==typeof n.get?t([n.get]):"function"==typeof o&&function(e){return o(null==e?e:i(e))}}function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var e=requireReflect_getPrototypeOf(),t=requireObject_getPrototypeOf(),r=/* @__PURE__ */requireGet();return getProto=e?function(t){return e(t)}:t?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return t(e)}:r?function(e){return r(e)}:null}function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=requireFunctionBind();return hasown=r.call(e,t)}function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;var e;hasRequiredGetIntrinsic=1;var t=/* @__PURE__ */requireEsObjectAtoms(),r=/* @__PURE__ */requireEsErrors(),n=/* @__PURE__ */require_eval(),i=/* @__PURE__ */requireRange(),o=/* @__PURE__ */requireRef(),s=/* @__PURE__ */requireSyntax(),a=/* @__PURE__ */requireType(),l=/* @__PURE__ */requireUri(),u=/* @__PURE__ */requireAbs(),c=/* @__PURE__ */requireFloor(),d=/* @__PURE__ */requireMax(),h=/* @__PURE__ */requireMin(),p=/* @__PURE__ */requirePow(),f=/* @__PURE__ */requireRound(),m=/* @__PURE__ */requireSign(),g=Function,y=function(e){try{return g('"use strict"; return ('+e+").constructor;")()}catch(t){}},v=/* @__PURE__ */requireGopd(),x=/* @__PURE__ */requireEsDefineProperty(),b=function(){throw new a},_=v?function(){try{return b}catch(e){try{return v(arguments,"callee").get}catch(t){return b}}}():b,E=requireHasSymbols()(),C=requireGetProto(),S=requireObject_getPrototypeOf(),P=requireReflect_getPrototypeOf(),R=requireFunctionApply(),w=requireFunctionCall(),A={},T="undefined"!=typeof Uint8Array&&C?C(Uint8Array):e,M={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?e:ArrayBuffer,"%ArrayIteratorPrototype%":E&&C?C([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":"undefined"==typeof Atomics?e:Atomics,"%BigInt%":"undefined"==typeof BigInt?e:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?e:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float16Array%":"undefined"==typeof Float16Array?e:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?e:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?e:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?e:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":A,"%Int8Array%":"undefined"==typeof Int8Array?e:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?e:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&C?C(C([][Symbol.iterator]())):e,"%JSON%":"object"==typeof JSON?JSON:e,"%Map%":"undefined"==typeof Map?e:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&C?C(/* @__PURE__ */(new Map)[Symbol.iterator]()):e,"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?e:Promise,"%Proxy%":"undefined"==typeof Proxy?e:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":"undefined"==typeof Reflect?e:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?e:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&C?C(/* @__PURE__ */(new Set)[Symbol.iterator]()):e,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&C?C(""[Symbol.iterator]()):e,"%Symbol%":E?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":_,"%TypedArray%":T,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?e:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?e:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?e:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?e:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?e:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?e:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?e:WeakSet,"%Function.prototype.call%":w,"%Function.prototype.apply%":R,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":S,"%Math.abs%":u,"%Math.floor%":c,"%Math.max%":d,"%Math.min%":h,"%Math.pow%":p,"%Math.round%":f,"%Math.sign%":m,"%Reflect.getPrototypeOf%":P};if(C)try{null.error}catch(z){var I=C(C(z));M["%Error.prototype%"]=I}var k=function e(t){var r;if("%AsyncFunction%"===t)r=y("async function () {}");else if("%GeneratorFunction%"===t)r=y("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=y("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&C&&(r=C(i.prototype))}return M[t]=r,r},D={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=requireFunctionBind(),j=/* @__PURE__ */requireHasown(),O=F.call(w,Array.prototype.concat),q=F.call(R,Array.prototype.splice),N=F.call(w,String.prototype.replace),L=F.call(w,String.prototype.slice),B=F.call(w,RegExp.prototype.exec),V=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,H=function(e,t){var r,n=e;if(j(D,n)&&(n="%"+(r=D[n])[0]+"%"),j(M,n)){var i=M[n];if(i===A&&(i=k(n)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new s("intrinsic "+e+" does not exist!")};return getIntrinsic=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===B(/^%?[^%]*%?$/,e))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=L(e,0,1),r=L(e,-1);if("%"===t&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new s("invalid intrinsic syntax, expected opening `%`");var n=[];return N(e,V,function(e,t,r,i){n[n.length]=r?N(i,G,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=H("%"+n+"%",t),o=i.name,l=i.value,u=!1,c=i.alias;c&&(n=c[0],q(r,O([0,1],c)));for(var d=1,h=!0;d<r.length;d+=1){var p=r[d],f=L(p,0,1),m=L(p,-1);if(('"'===f||"'"===f||"`"===f||'"'===m||"'"===m||"`"===m)&&f!==m)throw new s("property names with quotes must have matching quotes");if("constructor"!==p&&h||(u=!0),j(M,o="%"+(n+="."+p)+"%"))l=M[o];else if(null!=l){if(!(p in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(v&&d+1>=r.length){var g=v(l,p);l=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:l[p]}else h=j(l,p),l=l[p];h&&!u&&(M[o]=l)}}return l},getIntrinsic}function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var e=/* @__PURE__ */requireGetIntrinsic(),t=/* @__PURE__ */requireDefineDataProperty(),r=/* @__PURE__ */requireHasPropertyDescriptors()(),n=/* @__PURE__ */requireGopd(),i=/* @__PURE__ */requireType(),o=e("%Math.floor%");return setFunctionLength=function(e,s){if("function"!=typeof e)throw new i("`fn` is not a function");if("number"!=typeof s||s<0||s>4294967295||o(s)!==s)throw new i("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],l=!0,u=!0;if("length"in e&&n){var c=n(e,"length");c&&!c.configurable&&(l=!1),c&&!c.writable&&(u=!1)}return(l||u||!a)&&(r?t(e,"length",s,!0,!0):t(e,"length",s)),e},setFunctionLength}function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireActualApply();return applyBind=function(){return r(e,t,arguments)},applyBind}function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,e=callBind,t=/* @__PURE__ */requireSetFunctionLength(),r=/* @__PURE__ */requireEsDefineProperty(),n=requireCallBindApplyHelpers(),i=requireApplyBind(),e.exports=function(e){var r=n(arguments),i=e.length-(arguments.length-1);return t(r,1+(i>0?i:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i),callBind.exports;var e,t,r,n,i}function requireRequireObjectCoercible(){if(hasRequiredRequireObjectCoercible)return RequireObjectCoercible;hasRequiredRequireObjectCoercible=1;var e=/* @__PURE__ */requireType();return RequireObjectCoercible=function(t){if(null==t)throw new e(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t},RequireObjectCoercible}function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var e=/* @__PURE__ */requireGetIntrinsic(),t=requireCallBindApplyHelpers(),r=t([e("%String.prototype.indexOf%")]);return callBound=function(n,i){var o=e(n,!!i);return"function"==typeof o&&r(n,".prototype.")>-1?t([o]):o}}function requireImplementation$1(){if(hasRequiredImplementation$1)return implementation$1;hasRequiredImplementation$1=1;var e=/* @__PURE__ */requireRequireObjectCoercible(),t=/* @__PURE__ */requireCallBound()("Object.prototype.propertyIsEnumerable");return implementation$1=function(r){var n=e(r),i=[];for(var o in n)t(n,o)&&(i[i.length]=n[o]);return i}}function requirePolyfill$1(){if(hasRequiredPolyfill$1)return polyfill$1;hasRequiredPolyfill$1=1;var e=requireImplementation$1();return polyfill$1=function(){return"function"==typeof Object.values?Object.values:e}}function requireShim$1(){if(hasRequiredShim$1)return shim$1;hasRequiredShim$1=1;var e=requirePolyfill$1(),t=requireDefineProperties();return shim$1=function(){var r=e();return t(Object,{values:r},{values:function(){return Object.values!==r}}),r}}function requireObject_values(){if(hasRequiredObject_values)return object_values;hasRequiredObject_values=1;var e=requireDefineProperties(),t=requireCallBind(),r=requireImplementation$1(),n=requirePolyfill$1(),i=requireShim$1(),o=t(n(),Object);return e(o,{getPolyfill:n,implementation:r,shim:i}),object_values=o}function requireImplementation(){return hasRequiredImplementation||(hasRequiredImplementation=1,implementation=function(e){if(arguments.length<1)throw new TypeError("1 argument is required");if("object"!=typeof e)throw new TypeError("Argument 1 (”other“) to Node.contains must be an instance of Node");var t=e;do{if(this===t)return!0;t&&(t=t.parentNode)}while(t);return!1}),implementation}function requirePolyfill(){if(hasRequiredPolyfill)return polyfill;hasRequiredPolyfill=1;var e=requireImplementation();return polyfill=function(){if("undefined"!=typeof document){if(document.contains)return document.contains;if(document.body&&document.body.contains)try{if("boolean"==typeof document.body.contains.call(document,""))return document.body.contains}catch(t){}}return e}}function requireShim(){if(hasRequiredShim)return shim;hasRequiredShim=1;var e=requireDefineProperties(),t=requirePolyfill();return shim=function(){var r=t();return"undefined"!=typeof document&&(e(document,{contains:r},{contains:function(){return document.contains!==r}}),"undefined"!=typeof Element&&e(Element.prototype,{contains:r},{contains:function(){return Element.prototype.contains!==r}})),r}}function requireDocument_contains(){if(hasRequiredDocument_contains)return document_contains;hasRequiredDocument_contains=1;var e=requireDefineProperties(),t=requireImplementation(),r=requirePolyfill(),n=r(),i=function(e,t){return n.call(e,t)};return e(i,{getPolyfill:r,implementation:t,shim:requireShim()}),document_contains=i}function requireOutsideClickHandler(){return hasRequiredOutsideClickHandler||(hasRequiredOutsideClickHandler=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=/* @__PURE__ */function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),r=l(React__default),n=l(/* @__PURE__ */requirePropTypes()),i=requireAirbnbPropTypes(),o=require$$3,s=l(requireObject_values()),a=l(requireDocument_contains());function l(e){return e&&e.__esModule?e:{default:e}}var u={BLOCK:"block",FLEX:"flex",INLINE:"inline",INLINE_BLOCK:"inline-block",CONTENTS:"contents"},c=(0,i.forbidExtraProps)({children:n.default.node.isRequired,onOutsideClick:n.default.func.isRequired,disabled:n.default.bool,useCapture:n.default.bool,display:n.default.oneOf((0,s.default)(u))}),d={disabled:!1,useCapture:!0,display:u.BLOCK},h=function(e){function n(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(r)));return o.onMouseDown=o.onMouseDown.bind(o),o.onMouseUp=o.onMouseUp.bind(o),o.setChildNodeRef=o.setChildNodeRef.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,e),t(n,[{key:"componentDidMount",value:/* @__PURE__ */function(){return function(){var e=this.props,t=e.disabled,r=e.useCapture;t||this.addMouseDownEventListener(r)}}()},{key:"componentDidUpdate",value:/* @__PURE__ */function(){return function(e){var t=e.disabled,r=this.props,n=r.disabled,i=r.useCapture;t!==n&&(n?this.removeEventListeners():this.addMouseDownEventListener(i))}}()},{key:"componentWillUnmount",value:/* @__PURE__ */function(){return function(){this.removeEventListeners()}}()},{key:"onMouseDown",value:/* @__PURE__ */function(){return function(e){var t=this.props.useCapture;this.childNode&&(0,a.default)(this.childNode,e.target)||(this.removeMouseUp&&(this.removeMouseUp(),this.removeMouseUp=null),this.removeMouseUp=(0,o.addEventListener)(document,"mouseup",this.onMouseUp,{capture:t}))}}()},{key:"onMouseUp",value:/* @__PURE__ */function(){return function(e){var t=this.props.onOutsideClick,r=this.childNode&&(0,a.default)(this.childNode,e.target);this.removeMouseUp&&(this.removeMouseUp(),this.removeMouseUp=null),r||t(e)}}()},{key:"setChildNodeRef",value:/* @__PURE__ */function(){return function(e){this.childNode=e}}()},{key:"addMouseDownEventListener",value:/* @__PURE__ */function(){return function(e){this.removeMouseDown=(0,o.addEventListener)(document,"mousedown",this.onMouseDown,{capture:e})}}()},{key:"removeEventListeners",value:/* @__PURE__ */function(){return function(){this.removeMouseDown&&this.removeMouseDown(),this.removeMouseUp&&this.removeMouseUp()}}()},{key:"render",value:/* @__PURE__ */function(){return function(){var e=this.props,t=e.children,n=e.display;return r.default.createElement("div",{ref:this.setChildNodeRef,style:n!==u.BLOCK&&(0,s.default)(u).includes(n)?{display:n}:void 0},t)}}()}]),n}(r.default.Component);e.default=h,h.propTypes=c,h.defaultProps=d}(OutsideClickHandler$1)),OutsideClickHandler$1}function requireReactOutsideClickHandler(){return hasRequiredReactOutsideClickHandler?reactOutsideClickHandler:(hasRequiredReactOutsideClickHandler=1,reactOutsideClickHandler=requireOutsideClickHandler())}var reactOutsideClickHandlerExports=requireReactOutsideClickHandler();const OutsideClickHandler=/* @__PURE__ */getDefaultExportFromCjs(reactOutsideClickHandlerExports);function useDebouncedCallback(e,t=300,{leading:r=!1,trailing:n=!0,maxWait:i}={}){const o=useRef(e),s=useRef(null),a=useRef(null),l=useRef(0),u=useRef(!1);useEffect(()=>{o.current=e},[e]);const c=()=>{s.current&&(window.clearTimeout(s.current),s.current=null)},d=()=>{l.current=Date.now(),u.current=!1,a.current&&(o.current(...a.current),a.current=null)},h=e=>{c(),s.current=window.setTimeout(()=>{!n||r&&!u.current?u.current=!1:d(),s.current=null},e)},p=useMemo(()=>{const e=(...e)=>{const n=Date.now();a.current=e,r&&!s.current&&!u.current&&(u.current=!0,o.current(...e),l.current=n);let c=t;if("number"==typeof i&&i>=0){const e=n-l.current,r=Math.max(0,i-e);if(c=Math.min(t,r),0===r)return d(),void h(t)}h(c)};return e.cancel=()=>{c(),a.current=null,u.current=!1},e.flush=()=>{s.current&&(c(),d())},e.pending=()=>!!s.current,e},[t,r,n,i]);return useEffect(()=>()=>c(),[]),p}function useAvatarNameGenerator(e,t){const r=useMemo(()=>[{min:0,max:20,color:"#3280C0"},{min:20,max:40,color:"#3C9C21"},{min:40,max:60,color:"#C37024"},{min:60,max:80,color:"#B94C47"},{min:80,max:100,color:"#8957CA"},{min:100,max:120,color:"#36A4B1"},{min:120,max:200,color:"#B74C82"},{min:1500,max:1550,color:"#3280C0"},{min:1550,max:1600,color:"#3C9C21"},{min:1600,max:1620,color:"#C37024"},{min:1620,max:1680,color:"#B94C47"},{min:1680,max:1700,color:"#8957CA"},{min:1700,max:1750,color:"#36A4B1"},{min:1750,max:1800,color:"#B74C82"}],[]),n="#3280C0",i=useCallback(e=>(e??"").replace(/\s+/g," ").replace(/\u200F/g,"").trim(),[]),o=useMemo(()=>i(e),[e,i]),s=useMemo(()=>i(t),[t,i]),a=useMemo(()=>{if(!o)return"";if(!s){const e=o.split(" ");return e.length<=1?e[0]??"":`${e[0][0]??""}${e[1][0]??""}`}return`${o[0]}${s[0]??""}`},[o,s]),l=useMemo(()=>a?a.length>1?a.charCodeAt(1):a.charCodeAt(0):NaN,[a]),u=useMemo(()=>{if(!a||Number.isNaN(l))return n;for(const e of r)if(l>=e.min&&l<e.max)return e.color;return n},[a,l,r]),c=useMemo(()=>a.length>1?`${a[0]} ${a[1]}`:a[0]??"",[a]),d=useMemo(()=>`linear-gradient(to top, ${u}, ${u}99)`,[u]);return useMemo(()=>({letter:c,color:u,gradient:d}),[c,u,d])}var cssUnit={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function parseLengthAndUnit(e){if("number"==typeof e)return{value:e,unit:"px"};var t,r=(e.match(/^[0-9.]*/)||"").toString();t=r.includes(".")?parseFloat(r):parseInt(r,10);var n=(e.match(/[^0-9]*$/)||"").toString();return cssUnit[n]?{value:t,unit:n}:{value:t,unit:"px"}}function cssValue(e){var t=parseLengthAndUnit(e);return"".concat(t.value).concat(t.unit)}var createAnimation=function(e,t,r){var n="react-spinners-".concat(e,"-").concat(r);if("undefined"==typeof window||!window.document)return n;var i=document.createElement("style");document.head.appendChild(i);var o=i.sheet,s="\n @keyframes ".concat(n," {\n ").concat(t,"\n }\n ");return o&&o.insertRule(s,0),n},__assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)},__rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},fade=createAnimation("FadeLoader","50% {opacity: 0.3} 100% {opacity: 1}","fade");function FadeLoader(e){var t=e.loading,r=void 0===t||t,n=e.color,i=void 0===n?"#000000":n,o=e.speedMultiplier,s=void 0===o?1:o,a=e.cssOverride,l=void 0===a?{}:a,u=e.height,c=void 0===u?15:u,d=e.width,h=void 0===d?5:d,p=e.radius,f=void 0===p?2:p,m=e.margin,g=void 0===m?2:m,y=__rest(e,["loading","color","speedMultiplier","cssOverride","height","width","radius","margin"]),v=parseLengthAndUnit(g).value+18,x=v/2+v/5.5,b=__assign({display:"inherit",position:"relative",fontSize:"0",top:v,left:v,width:"".concat(3*v,"px"),height:"".concat(3*v,"px")},l),_=function(e){return{position:"absolute",width:cssValue(h),height:cssValue(c),margin:cssValue(g),backgroundColor:i,borderRadius:cssValue(f),transition:"2s",animationFillMode:"both",animation:"".concat(fade," ").concat(1.2/s,"s ").concat(.12*e,"s infinite ease-in-out")}},E=__assign(__assign({},_(1)),{top:"".concat(v,"px"),left:"0"}),C=__assign(__assign({},_(2)),{top:"".concat(x,"px"),left:"".concat(x,"px"),transform:"rotate(-45deg)"}),S=__assign(__assign({},_(3)),{top:"0",left:"".concat(v,"px"),transform:"rotate(90deg)"}),P=__assign(__assign({},_(4)),{top:"".concat(-1*x,"px"),left:"".concat(x,"px"),transform:"rotate(45deg)"}),R=__assign(__assign({},_(5)),{top:"".concat(-1*v,"px"),left:"0"}),w=__assign(__assign({},_(6)),{top:"".concat(-1*x,"px"),left:"".concat(-1*x,"px"),transform:"rotate(-45deg)"}),A=__assign(__assign({},_(7)),{top:"0",left:"".concat(-1*v,"px"),transform:"rotate(90deg)"}),T=__assign(__assign({},_(8)),{top:"".concat(x,"px"),left:"".concat(-1*x,"px"),transform:"rotate(45deg)"});return r?React.createElement("span",__assign({style:b},y),React.createElement("span",{style:E}),React.createElement("span",{style:C}),React.createElement("span",{style:S}),React.createElement("span",{style:P}),React.createElement("span",{style:R}),React.createElement("span",{style:w}),React.createElement("span",{style:A}),React.createElement("span",{style:T})):null}const PulseCircle=({onClick:e,value:t=60,children:r,className:n="",color:i="rgba(255,255,255,0.6)"})=>/* @__PURE__ */jsxRuntimeExports.jsxs("div",{onClick:()=>e&&e(),className:`relative inline-flex items-center justify-center ${n} ${e?"cursor-pointer":""}`,children:[r&&r,
3
3
  /* @__PURE__ */jsxRuntimeExports.jsx("span",{className:`absolute bg-[${i}] inset-0 rounded-full pointer-events-none w-full h-full opacity-60 `,style:{transform:`scale(1 + ${t}/100)`}})]}),imageCache=/* @__PURE__ */new Map,pendingFetches=/* @__PURE__ */new Map;function getCacheKey(e,t){return`${e}|${t}`}function useCachedImage(e,t="SMALL"){const[r,n]=useState(null),i=useSelector(e=>e.appConfig.token),o=useRef(!0),s=e?getCacheKey(e,t):null;return useEffect(()=>(o.current=!0,()=>{o.current=!1}),[]),useEffect(()=>{if(!e||!i||!s)return void n(null);const r=imageCache.get(s);if(r)return void n(r);const a=pendingFetches.get(s);if(a)return void a.then(e=>o.current&&n(e??null)).catch(()=>o.current&&n(null));const l=(async()=>{try{const r=t?`${e}?size=${t}`:e,n=await fetch(r,{headers:{},cache:"force-cache"});if(!n.ok)throw Error("HTTP "+n.status);const i=await n.blob();if(!i.type.startsWith("image/"))throw Error("Not an image");const o=URL.createObjectURL(i);return imageCache.set(s,o),o}catch(r){throw r}finally{pendingFetches.delete(s)}})();pendingFetches.set(s,l),l.then(e=>{o.current&&n(e??null)}).catch(()=>{o.current&&n(null)})},[e,t,i,s]),r}const SIZE_CLASSES={xxs:"w-7 h-7",xs:"w-9 h-9",sm:"w-[42px] h-[42px]",md:"w-14 h-14",lg:"w-20 h-20",xl:"w-32 h-32",xxl:"w-48 h-48","":""},Avatar=React__default.memo(({onClick:e,image:t,firstName:r,lastName:n,inbox:i=!1,show:o=!0,reconnecting:s=!1,grayscale:a=!1,size:l="sm",className:u="",cache:c=!0})=>{const{letter:d,color:h}=useAvatarNameGenerator(r,n),p=SIZE_CLASSES[l],f=convertPodspaceUrl(t)?.replace("http://","https://"),m=useCachedImage(f),g=c?m:f,y=`flex items-center justify-center font-bold text-white overflow-hidden rounded-[42%] ${u||p} ${o?"visible":"invisible"} ${a?"filter grayscale":""} ${s?"relative":""}`,v=()=>s?/* @__PURE__ */jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[
4
4
  /* @__PURE__ */jsxRuntimeExports.jsx("div",{className:"absolute inset-0 bg-black/25 backdrop-blur-[1px] pointer-events-none","aria-hidden":"true"}),
@@ -1,4 +1,4 @@
1
- import{g as e,e as t,fD as s,j as a,eE as n,x as l,eF as o,fE as r}from"./main-CXfBH5gS.js";import{T as c,Y as i,C as x,L as d,u as h}from"./LoadingDots-Bhve_iKp.js";import m,{useEffect as u,useState as f}from"react";import{R as p,T as g,P as j,C as v,I as w}from"./index-C55zkUMg.js";const b=({selectedItems:n=[],height:l="",selectable:o=!1,searchValue:r="",onSelect:h})=>{const{contacts:m,loading:f,loadingFromDown:p,hasNext:g,nextOffset:j}=e(e=>e.contacts),v=t();return u(()=>{v(s({count:20,offset:0}))},[]),f?/* @__PURE__ */a.jsx("div",{className:"mt-5",children:/* @__PURE__ */a.jsx(c,{})}):r?.length&&0===m.length?/* @__PURE__ */a.jsx("div",{className:"w-full text-center mt-5 text-secondary text-sm",children:`مخاطبی با مشخصات "${r}" وجود ندارد`}):0===m.length?/* @__PURE__ */a.jsx("div",{className:"w-full text-center mt-5 text-secondary text-sm",children:"مخاطبی وجود ندارد"}):/* @__PURE__ */a.jsx(i,{components:{Footer:()=>p&&/* @__PURE__ */a.jsx(d,{})},endReached:()=>{g&&v(s({count:21,offset:j}))},data:m,className:"scroll-container",overscan:100,style:{height:l||"100dvh",direction:"rtl"},itemContent:(e,t)=>/* @__PURE__ */a.jsx(x,{contact:t,showIsNotMember:!0,showBlock:!0,showSelect:o,handleSelect:h,selectedContacts:n})})},N=m.memo(({handleChange:e})=>{const[t,s]=m.useState("");/* @__PURE__ */
1
+ import{g as e,e as t,fD as s,j as a,eE as n,x as l,eF as o,fE as r}from"./main-BiSoVrq9.js";import{T as c,Y as i,C as x,L as d,u as h}from"./LoadingDots-CSbpS1Hq.js";import m,{useEffect as u,useState as f}from"react";import{R as p,T as g,P as j,C as v,I as w}from"./index-CdrvmdU9.js";const b=({selectedItems:n=[],height:l="",selectable:o=!1,searchValue:r="",onSelect:h})=>{const{contacts:m,loading:f,loadingFromDown:p,hasNext:g,nextOffset:j}=e(e=>e.contacts),v=t();return u(()=>{v(s({count:20,offset:0}))},[]),f?/* @__PURE__ */a.jsx("div",{className:"mt-5",children:/* @__PURE__ */a.jsx(c,{})}):r?.length&&0===m.length?/* @__PURE__ */a.jsx("div",{className:"w-full text-center mt-5 text-secondary text-sm",children:`مخاطبی با مشخصات "${r}" وجود ندارد`}):0===m.length?/* @__PURE__ */a.jsx("div",{className:"w-full text-center mt-5 text-secondary text-sm",children:"مخاطبی وجود ندارد"}):/* @__PURE__ */a.jsx(i,{components:{Footer:()=>p&&/* @__PURE__ */a.jsx(d,{})},endReached:()=>{g&&v(s({count:21,offset:j}))},data:m,className:"scroll-container",overscan:100,style:{height:l||"100dvh",direction:"rtl"},itemContent:(e,t)=>/* @__PURE__ */a.jsx(x,{contact:t,showIsNotMember:!0,showBlock:!0,showSelect:o,handleSelect:h,selectedContacts:n})})},N=m.memo(({handleChange:e})=>{const[t,s]=m.useState("");/* @__PURE__ */
2
2
  return a.jsxs("div",{className:"flex-1 max-w-[161px] flex items-center gap-1 text-invertBlackWhite min-w-px",children:[
3
3
  /* @__PURE__ */a.jsx(n,{size:26,color:"var(--light-text)"}),
4
4
  /* @__PURE__ */a.jsx("input",{className:"min-w-0 bg-transparent focus:outline-none focus-visible:outline-none focus-visible:border-0",type:"text",placeholder:l.search,value:t,onChange:t=>{s(t.target.value),e(t?.target?.value)}})]})}),S=[{value:"",label:"نام و نام خانوادگی "},{value:"uname:",label:"نام کاربری"},{value:"tel:",label:"موبایل"}],C=({onSelect:e})=>{const[t,s]=f(S[0]);/* @__PURE__ */