@tap-payments/os-micro-frontend-shared 0.1.482 → 0.1.483
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/chunk-MFD4RWWA.js +1 -0
- package/build/chunk-TT2IK3IE.js +2 -0
- package/build/components/Amount/index.js +1 -1
- package/build/components/AmountConversionFilter/index.js +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/CopyImage/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CurrencyFilter/index.js +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/FlagDetails/index.js +1 -1
- package/build/components/JSONViewer/components/HighlightText/HighlightText.d.ts +2 -0
- package/build/components/JSONViewer/components/HighlightText/HighlightedParts.d.ts +2 -0
- package/build/components/JSONViewer/components/HighlightText/index.d.ts +2 -0
- package/build/components/JSONViewer/components/HighlightText/type.d.ts +11 -0
- package/build/components/JSONViewer/components/HighlightText/util.d.ts +2 -0
- package/build/components/JSONViewer/components/JSONSearchBar/JSONSearchBar.d.ts +13 -0
- package/build/components/JSONViewer/components/JSONSearchBar/index.d.ts +2 -0
- package/build/components/JSONViewer/components/JSONSearchBar/styles.d.ts +1113 -0
- package/build/components/JSONViewer/components/JSONSearchHighlighters/HighlightMatchingKey.d.ts +2 -0
- package/build/components/JSONViewer/components/JSONSearchHighlighters/HighlightMatchingValue.d.ts +2 -0
- package/build/components/JSONViewer/components/JSONSearchHighlighters/index.d.ts +2 -0
- package/build/components/JSONViewer/components/JSONSearchHighlighters/type.d.ts +6 -0
- package/build/components/JSONViewer/components/JSONSearchHighlighters/util.d.ts +2 -0
- package/build/components/JSONViewer/components/index.d.ts +2 -0
- package/build/components/JSONViewer/hooks/index.d.ts +1 -0
- package/build/components/JSONViewer/hooks/useJsonSearch.d.ts +7 -0
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/JSONViewer/style.d.ts +2 -0
- package/build/components/JSONViewer/utils.d.ts +7 -0
- package/build/components/LanguageDropdown/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/MerchantCurrencyDropdown/index.js +1 -1
- package/build/components/MerchantLogo/index.js +1 -1
- package/build/components/MerchantsDropdown/index.js +1 -1
- package/build/components/PartnersFilter/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/ReceiptsViewer/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/SalesChannelFilter/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableHeader/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VAT/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/build/chunk-4DXOV6G5.js +0 -2
- package/build/chunk-TZDBATZU.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c as c$2}from'./chunk-YO6CMXAI.js';import {c,e}from'./chunk-UIUJ55RJ.js';import {a,c as c$1,d}from'./chunk-WRDDVTG7.js';import {b,a as a$1}from'./chunk-LFP7PJUC.js';import {Ra}from'./chunk-RACDVPDX.js';import {na,Dj,Ej,Xg,hj,w,_c,Cd,Bd,ma,ka,la}from'./chunk-RC7QOYMU.js';import io,{memo,createContext,useState,useRef,useId,useMemo,useEffect,useCallback,useContext}from'react';import {styled,Popover,Input,Typography,Box,Dialog}from'@mui/material';import C from'@uiw/react-json-view';import {motion,AnimatePresence}from'framer-motion';import {Resizable}from're-resizable';import Po from'react-draggable';import so from'@mui/material/Box';import {useTranslation}from'react-i18next';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {styled as styled$1}from'@mui/material/styles';var R=37,ye="32px",I=545;styled(Popover)(({theme:e})=>({backgroundColor:e.palette.background.default,boxShadow:e.shadows[21],"& .MuiPaper-root":{borderRadius:"12px"}}));var ro=44,we={"--w-rjv-color":"#9cdcfe","--w-rjv-key-string":"#357fb9","--w-rjv-background-color":"#ffffff","--w-rjv-line-color":"#ffffff","--w-rjv-arrow-color":"#116e6bed","--w-rjv-edit-color":"#9cdcfe","--w-rjv-info-color":"#9c9c9c7a","--w-rjv-update-color":"#FFE20B","--w-rjv-copied-color":"#9cdcfe","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#000000","--w-rjv-colon-color":"#000000","--w-rjv-brackets-color":"#000000","--w-rjv-quotes-color":"#9cdcfe","--w-rjv-quotes-string-color":"#c27c46","--w-rjv-type-string-color":"#c27c46","--w-rjv-type-int-color":"#956ea5","--w-rjv-type-float-color":"#956ea5","--w-rjv-type-bigint-color":"#956ea5","--w-rjv-type-boolean-color":"#956ea5","--w-rjv-type-date-color":"#956ea5","--w-rjv-type-url-color":"#3b89cf","--w-rjv-type-null-color":"#956ea5","--w-rjv-type-nan-color":"#956ea5","--w-rjv-type-undefined-color":"#956ea5",padding:"1rem",height:`calc(100% - ${ro+R}px`,overflow:"auto"},at={...we,background:"transparent","--w-rjv-line-color":"transparent"},st=styled("button")(({theme:e})=>({padding:"0rem",borderRadius:"0.25rem",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem",color:e.palette.text.primary,fontSize:"0.625rem",fontWeight:e.typography.fontWeightBold,outline:"none",cursor:"pointer",border:`1px solid ${e.palette.grey[100]}`,"&:hover":{boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark};`},position:"relative",overflow:"hidden",transition:"all 0.2s ease-in-out",width:"24px",height:"24px",flexShrink:0})),be=styled("button")(({theme:e})=>({outline:"none",cursor:"pointer",border:"1px solid transparent","&:hover":{boxShadow:e.shadows[8]},borderRadius:"0.25rem",position:"relative",backgroundColor:e.palette.background.transparent,display:"inline-flex",alignItems:"center",justifyContent:"center"}));styled(Input)(({theme:e})=>({border:`1px solid ${e.palette.grey[100]}`,borderRadius:"0.25rem",padding:"0.375rem",fontSize:"0.625rem",outline:"none",width:"100%",maxWidth:"150px",height:"1.5rem",backgroundColor:e.palette.background.paper,"&:focus":{border:`1px solid ${e.palette.info.dark}`}}));var Se=styled(Typography)(()=>({border:"1px solid rgba(242, 242, 242, 0.70);",display:"inline-flex",height:"24px",padding:"0px 8px",justifyContent:"center",alignItems:"center",borderRadius:"37.5px",backgroundColor:"#fff"})),Ce=styled(Box,{shouldForwardProp:e=>!["isMaximized","isScrollingRequest","isRequestShown"].includes(e)})(({isScrollingRequest:e,isMaximized:t,isRequestShown:a,theme:n})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"4px",paddingBlock:"0px",paddingInlineStart:"12px",paddingInlineEnd:"12px",position:"sticky",left:0,right:0,top:0,background:"#fff",zIndex:5,...e&&{boxShadow:n.shadows[23]},...t&&{paddingTop:ye,transition:"padding 0.3s ease-in-out",...a&&{width:"50%"}}})),ve=styled(Box,{shouldForwardProp:e=>!["isMaximized","isRequestShown"].includes(e)})(({isMaximized:e,isRequestShown:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",height:R,position:"fixed",bottom:0,right:0,left:e?"50vw":0,...!t&&{left:0}})),Re=styled(Box)(()=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",paddingBlock:"10px",paddingInlineStart:"8px",paddingInlineEnd:"0px"})),Ie=styled(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"4px",paddingBlock:"10px",paddingInlineStart:"0px",paddingInlineEnd:"12px"})),lt=styled(motion.div,{shouldForwardProp:e=>!["isRequestShown","isMaximized"].includes(e)})(({isRequestShown:e,isMaximized:t})=>({width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:"#fff",zIndex:20,position:"relative",display:"flex",flexDirection:"column",borderBottomRightRadius:"12px",borderBottomLeftRadius:e?0:"12px",...t&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,height:"100vh"}}));styled(motion.div,{shouldForwardProp:e=>!["isMaximized","currentRequestWidth"].includes(e)})(({isMaximized:e,currentRequestWidth:t})=>({backgroundColor:"#E7E7E7B2",backdropFilter:"blur(12px)",height:e?"100vh":"100%",overflowY:"auto",overflowX:"hidden",position:"absolute",width:e?"100vw":t,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px"}));styled(Box,{shouldForwardProp:e=>!["isMaximized","currentHeight"].includes(e)})(({isMaximized:e,currentHeight:t})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",height:e?`calc(100vh - ${R}px)`:(t||I)-R+5,background:"transparent",position:"fixed",width:"100%"}));var pt=styled(Box)(()=>({position:"fixed",width:"100%",background:"transparent",height:"100%"})),dt=styled("span")(()=>({color:"#032F62"})),ct=styled("span")(()=>({color:"#357fb9"}));function po({onClick:e,icon:t,label:a,disableAnimation:n,...r}){let[s,o]=io.useState(false),{t:f}=useTranslation();return jsxs(st,{...r,onClick:m=>{e?.(m),!n&&(o(true),setTimeout(()=>{o(false);},2e3));},children:[jsxs(so,{sx:{width:"16px",display:"flex",overflow:"hidden",justifyContent:"center",alignItems:"center"},children:[jsx(AnimatePresence,{mode:"wait",children:s&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:na,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{mode:"wait",children:!s&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:t,alt:"icon"},"id-icon")})]}),a&&jsxs(Fragment,{children:[jsx(AnimatePresence,{children:s&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{duration:.4},children:f("copied")})}),jsx(AnimatePresence,{children:!s&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute",width:"53px"},transition:{duration:.4},children:a})})]})]})}var ut=memo(po);var O=ut;var ft=styled$1("div")(()=>({display:"flex",alignItems:"center",position:"relative",flexShrink:0,width:"24px",height:"24px"})),mt=styled$1("button")(({theme:e,isActive:t})=>({width:"24px",height:"24px",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",border:`1px solid ${t?e.palette.info.dark:e.palette.grey[100]}`,backgroundColor:e.palette.background.paper,cursor:"pointer",outline:"none",padding:0,position:"relative",zIndex:11,transition:"all 0.2s ease-in-out","&:hover":{boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark}`}})),gt=styled$1(motion.div)(()=>({position:"absolute",right:0,top:0,height:"24px",display:"flex",alignItems:"center",zIndex:20,background:"transparent"})),ht=styled$1(motion.input)(({theme:e})=>({width:"177px",height:"24px",borderRadius:"4px",color:e.palette.text.primary,fontSize:"10px",outline:0,background:e.palette.background.paper,boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark}`,paddingLeft:"8px",boxSizing:"border-box","::placeholder":{color:"#D5D5D5"}})),Be={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,userSelect:"none"},xt={...Be,background:"none",border:"none",padding:0,margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none","&:disabled":{opacity:.3,cursor:"default"}},yt=styled$1("button")(()=>({...xt,right:53})),wt=styled$1("button")(()=>({...xt,right:39})),bt=styled$1(motion.img)(()=>({...Be,right:24,width:10,height:10,cursor:"pointer"})),St=styled$1(motion.img)(()=>({...Be,right:8,width:11,height:11,cursor:"default"})),Te=styled$1("img")(()=>({width:10,height:10})),Ct=styled$1("img")(()=>({width:12,height:12})),vt=styled$1("span")(({theme:e})=>({position:"absolute",right:67,top:"50%",transform:"translateY(-50%)",fontSize:"9px",lineHeight:1,color:e.palette.text.secondary,whiteSpace:"nowrap",userSelect:"none",zIndex:2,pointerEvents:"none"}));function ho({value:e,onChange:t,currentIndex:a,totalCount:n,onPrev:r,onNext:s,placeholder:o="Search..."}){let[f,p]=useState(false),m=useRef(null),w$1=e.trim().length>0,S=n>0,c=w$1,v=()=>{p(true),requestAnimationFrame(()=>m.current?.focus());},k=()=>{t(""),p(false);};return jsxs(ft,{children:[jsx(AnimatePresence,{children:f&&jsxs(gt,{initial:{clipPath:"inset(0 0 0 100%)",opacity:0},animate:{clipPath:"inset(0 0 0 0%)",opacity:1},exit:{clipPath:"inset(0 0 0 100%)",opacity:0},transition:{duration:.22,ease:[.4,0,.2,1]},children:[jsx(ht,{ref:m,initial:false,animate:{paddingRight:c?"98px":"24px"},transition:{duration:.15},placeholder:o,value:e,onChange:d=>t(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.shiftKey?r():s()),d.key==="Escape"&&k();},onBlur:()=>{w$1||p(false);}}),c&&jsx(yt,{onClick:r,disabled:!S,title:"Previous match (Shift+Enter)",children:jsx(Te,{src:Dj,alt:"prev"})}),c&&jsx(wt,{onClick:s,disabled:!S,title:"Next match (Enter)",children:jsx(Te,{src:Ej,alt:"next"})}),c&&jsx(bt,{src:Xg,alt:"clear",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:k}),jsx(St,{src:hj,alt:"search",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),c&&jsx(vt,{children:S?`${a+1}/${n}`:"0/0"})]},"input-area")}),jsx(AnimatePresence,{children:!f&&jsx(motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:jsx(mt,{isActive:false,onClick:v,title:"Search",children:jsx(Ct,{src:w,alt:"search"})})})})]})}var L=memo(ho);function kt(e,t){let a=[],n=t.length,r=0,s=e.indexOf(t,r);for(;s!==-1;){let o=s+n;a.push([s,o]),r=o,s=e.indexOf(t,r);}return a}var xo={padding:0,outline:"none"};function Tt({text:e,queryLength:t,ranges:a,idPrefix:n}){let r=[],s=0;return a.forEach(([o,f],p)=>{o>s&&r.push(e.slice(s,o)),r.push(jsx("mark",{style:xo,children:e.slice(o,o+t)},`${n}-${p}`)),s=f;}),s<e.length&&r.push(e.slice(s)),jsx(Fragment,{children:r})}function M({text:e,query:t}){let a=useId(),n=useMemo(()=>t.trim().toLowerCase(),[t]),r=useMemo(()=>{if(!n)return e;let s=e.toLowerCase(),o=kt(s,n);return o.length===0?e:jsx(Tt,{text:e,queryLength:t.length,ranges:o,idPrefix:a})},[e,t.length,n,a]);return jsx(Fragment,{children:r})}function ee(e,t){return e.toLowerCase().includes(t)}function te(e){return e.trim().toLowerCase()}function oe(e){let t=te(e);return (a,{keyName:n})=>{if(!t||!n)return;let r=String(n);if(ee(r,t))return jsx(ct,{children:jsx(M,{text:String(n),query:e})})}}function ne(e){let t=te(e);return (a,{value:n})=>{if(!t)return;let r=String(n??"");if(ee(r,t))return jsxs(dt,{children:['"',jsx(M,{text:String(n??""),query:e}),'"']})}}function Ro({title:e$1,onClose:t,onMaximize:a$1,maximized:n=false,id:r,onMouseHover:s,onMouseLeave:o,onRequestClick:f,isRequestExpanded:p=false,showRequestIcon:m=false,isHovered:w=false}){return jsx(c,{id:r,maximized:n||false,children:jsx(e,{isHovered:true,onMouseEnter:s,onMouseLeave:o,isMaximized:n,title:e$1,icon:_c,leftActions:jsxs(Fragment,{children:[jsx(a,{onClick:t}),jsx(c$1,{isMaximized:n,onClick:a$1}),m&&jsx(d,{onClick:f,isExpanded:p,isHovered:w,children:"Request"})]})})})}var Ht=memo(Ro);var Je=Ht;var zt="#FFE20B";function re(e,t){let[a,n]=useState(0),[r,s]=useState(0);useEffect(()=>{if(!t.trim()){s(0),n(0);return}let p=setTimeout(()=>{let m=e.current?.querySelectorAll("mark")??[];s(m.length),n(0);},50);return ()=>clearTimeout(p)},[t,e]),useEffect(()=>{if(!e.current||!t.trim())return;let p=Array.from(e.current.querySelectorAll("mark"));p.forEach((m,w)=>{let S=w===a;m.style.backgroundColor=S?zt:"transparent",m.style.outline=S?`1px solid ${zt}`:"none",m.style.borderRadius="2px";}),p[a]?.scrollIntoView({behavior:"smooth",block:"nearest"});},[a,r,t,e]);let o=useCallback(()=>{r!==0&&n(p=>(p+1)%r);},[r]),f=useCallback(()=>{r!==0&&n(p=>(p-1+r)%r);},[r]);return {currentIndex:a,totalCount:r,goNext:o,goPrev:f}}function Vt(e,t){return e==null?String(e).includes(t):typeof e=="string"?e.toLowerCase().includes(t):typeof e=="number"||typeof e=="boolean"?String(e).includes(t):false}function Nt(e,t){if(Array.isArray(e)){let a=e.map(n=>Nt(n,t)).filter(n=>n!=null);return a.length>0?a:null}return typeof e=="object"&&e!==null?At(e,t):Vt(e,t)?e:null}function At(e,t){let a={};for(let[n,r]of Object.entries(e))if(n.toLowerCase().includes(t))a[n]=r;else if(typeof r=="object"&&r!==null){let s=Nt(r,t);s!==null&&(a[n]=s);}else Vt(r,t)&&(a[n]=r);return Object.keys(a).length>0?a:null}function Pe(e,t){return t.trim()?At(e,t.toLowerCase()):e}var F=400,j=.5;function K({index:e,json:t,requestJson:a={},isWindowMinimized:n,windowOrder:r,onClose:s}){let[o,f]=useState(false),[p,m]=useState(false),[w,S]=useState(false),[c,v]=useState(false),[k,W]=useState({width:0,height:0}),[B,T]=useState(true),[d,Ft]=useState(false),[Oe,Kt]=useState(true),[$t,We]=useState(false),[$,Me]=useState(F),[J,Gt]=useState(""),[P,Yt]=useState(""),ze=useRef(null),Ve=useRef(null),G=re(ze,J),Y=re(Ve,P),le=useRef(),{onMouseEnter:Xt,onMouseLeave:Qt,isHovered:Ut}=b(),{height:pe,width:q}=a$1(),[Ne,Zt]=useState({x:q/2+F/4-e*20,y:pe/2-I/2+e*30}),X=useRef(),eo=useMemo(()=>Object.keys(t)?.length,[t]),Ae=Ra(),E=Number(X.current?.state?.width)||F,je=l=>{setTimeout(()=>{navigator.clipboard.writeText(l||"").then(()=>{});},10);},qe=useMemo(()=>Object.keys(a)?.length,[a]),De=useMemo(()=>Pe(t,J),[t,J]),Le=useMemo(()=>Pe(a,P),[a,P]);return useEffect(()=>{if(le.current&&clearTimeout(le.current),!d){le.current=setTimeout(()=>{Me(E);},j*1e3);return}Me(E);},[d,E]),jsx(Po,{disabled:o,handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]',defaultPosition:{x:q/2-F/4,y:pe/2-I/2},position:{x:q-Ne.x,y:Ne.y},onStop:(l,u)=>{Zt({x:q-u.x,y:u.y});},bounds:{top:10},children:jsx(Dialog,{disableEnforceFocus:true,sx:{backgroundColor:"transparent",zIndex:(r||0)+3+(o?1:0),...n&&{display:"none"},transform:"translate(180px, 14px)",...!o&&{width:Ae?k?.width||$:"fit-content",height:Ae?k?.height||I:"fit-content"},...o&&{transform:"none !important"}},PaperProps:{style:{margin:0,maxHeight:"100%",maxWidth:"none",background:"transparent",width:p?"fit-content":$,height:p?"fit-content":I,...o&&{width:"100%",height:"100%"},position:"relative"}},onClose:()=>{f(false),T(true),setTimeout(()=>{T(false);},j*1e3);},open:true,hideBackdrop:true,fullScreen:o,"aria-labelledby":"draggable-dialog-title",children:jsx(Resizable,{enable:{left:false,right:true,bottomRight:true,bottom:true},maxHeight:pe-40,maxWidth:q,minWidth:o?"100vw":$,minHeight:o?"100vh":"300px",ref:l=>{X.current=l;},onResizeStart:()=>{T(true);},onResizeStop:()=>{T(false);},onResize:(l,u,z)=>{m(true),W({width:z.offsetWidth,height:z.offsetHeight});},defaultSize:{width:$,height:I},style:{background:"transparent",...o&&{height:"100% !important",width:"100% !important",flex:1},...o&&{position:"relative"}},children:jsxs(pt,{children:[jsx(motion.div,{style:{...o&&{height:ye,position:"fixed",zIndex:1e3}},animate:{width:d?E*2:E,...o&&{width:"100vw"},...!o&&{transform:`translateX(${d?-E:0}px)`}},transition:{duration:j,...B&&{duration:0}},children:jsx(Je,{title:d?"JSON Request & Response":"JSON Response",onClose:()=>s(),onMaximize:()=>{f(l=>!l),T(true),setTimeout(()=>{T(false);},j*1e3);},isHovered:Ut,onMouseHover:Xt,onMouseLeave:Qt,maximized:o,id:"draggable-dialog-title",onRequestClick:()=>{Ft(l=>!l),T(false),d||X.current?.updateSize({width:F,height:I});},isRequestExpanded:d,showRequestIcon:!!qe})}),jsxs(Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",height:o?`calc(100vh - ${R}px)`:(Number(X.current?.state?.height)||I)-R+5,background:"transparent",position:"fixed",width:"100%"},children:[jsx(AnimatePresence,{children:d&&jsxs(motion.div,{initial:{left:o?"50vw":0,...o&&{position:"relative",left:"-50vw"}},animate:{left:o?"50vw":-E,...o&&{position:"relative",left:"0"},...!d&&{left:0}},exit:{left:o?"50vw":0,...o&&{position:"relative",left:"0"}},transition:{duration:j,...B&&{duration:0}},ref:Ve,style:{flex:1,backgroundColor:"#E7E7E7B2",backdropFilter:"blur(12px)",height:o?"100vh":"100%",overflowY:"auto",position:"absolute",width:o?"100vw":E,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px"},onScroll:()=>{We(true),setTimeout(()=>{We(false);},2e3);},children:[jsxs(Ce,{isMaximized:o,isScrollingRequest:$t,sx:{background:"#E7E7E7B2"},isRequestShown:d,children:[jsx(Ie,{children:jsx(Se,{variant:"subtitle1",children:"API Request"})}),jsxs(Re,{children:[jsx(L,{value:P,onChange:Yt,currentIndex:Y.currentIndex,totalCount:Y.totalCount,onPrev:Y.goPrev,onNext:Y.goNext}),jsx(O,{disableAnimation:true,onClick:()=>{Kt(l=>!l);},icon:Oe?Cd:Bd}),jsx(O,{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(t)).then(()=>{});},icon:ma}),jsx(O,{onClick:()=>{navigator.clipboard.writeText(t?.id||"").then(()=>{});},icon:ka})]})]}),P.trim()&&Le===null?jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(Typography,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsxs(C,{value:Le??a,style:at,displayDataTypes:false,collapsed:P.trim()?void 0:Oe?1:void 0,onCopied:(l,u)=>{typeof u=="string"&&je(u);},enableClipboard:false,children:[jsx(C.String,{render:ne(P)}),jsx(C.KeyName,{render:oe(P)}),jsx(C.CountInfo,{render:(l,{keyName:u})=>{if(!u)return jsx("span",{})}}),jsx(C.Copied,{render:({"data-copied":l,style:u,onClick:z},{keyName:de})=>de?jsxs(be,{style:u,onClick:ce=>{z?.(ce);},children:[jsx(AnimatePresence,{children:l&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:na,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{children:!l&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:la,alt:"icon"},"id-icon")})]}):jsx("span",{})})]}),jsx(AnimatePresence,{children:d&&jsx(ve,{sx:{flex:1,height:R,left:0},children:jsx(c$2,{sx:{paddingLeft:"12px",borderBottomRightRadius:"0",background:"#f8f9fb",flex:1},totalCount:qe})})})]})}),jsxs(lt,{ref:ze,isMaximized:o,isRequestShown:d,style:{left:0,maxHeight:"100vw"},initial:{...o&&{width:"100vw",left:0}},animate:{...o&&{position:"absolute",left:d?"50vw":"0"}},transition:{duration:j,...B&&{duration:0}},onScroll:()=>{v(true),setTimeout(()=>{v(false);},2e3);},children:[jsxs(Ce,{isMaximized:o,isScrollingRequest:c,isRequestShown:d,children:[jsx(Ie,{children:jsx(Se,{variant:"subtitle1",children:"API Response"})}),jsxs(Re,{children:[jsx(L,{value:J,onChange:Gt,currentIndex:G.currentIndex,totalCount:G.totalCount,onPrev:G.goPrev,onNext:G.goNext}),jsx(O,{disableAnimation:true,onClick:()=>{S(l=>!l);},icon:w?Cd:Bd}),jsx(O,{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(t,null,2)).then(()=>{});},icon:ma}),jsx(O,{onClick:()=>{navigator.clipboard.writeText(t?.id||"").then(()=>{});},icon:ka})]})]}),J.trim()&&De===null?jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(Typography,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsxs(C,{value:De??t,style:we,displayDataTypes:false,collapsed:J.trim()?void 0:w?1:void 0,onCopied:(l,u)=>{typeof u=="string"&&je(u);},children:[jsx(C.String,{render:ne(J)}),jsx(C.KeyName,{render:oe(J)}),jsx(C.CountInfo,{render:(l,{keyName:u})=>{if(!u)return jsx("span",{})}}),jsx(C.Copied,{render:({"data-copied":l,style:u,onClick:z},{keyName:de})=>de?jsxs(be,{style:u,onClick:ce=>{z?.(ce);},children:[jsx(AnimatePresence,{children:l&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:na,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{children:!l&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:la,alt:"icon"},"id-icon")})]}):jsx("span",{})})]}),jsx(ve,{sx:{flex:1,height:R},children:jsx(c$2,{sx:{borderBottomLeftRadius:d?0:"12px",background:"#f8f9fb",flex:1},totalCount:eo})})]})]})]})})})})}var se=createContext({jsonViewerList:[],handleJsonViewerDialogOpen:()=>{},handleWindowMinimize:()=>{},handleWindowOrder:()=>{}});var Dt=({list:e,onClose:t,isWindowMinimized:a,windowOrder:n})=>e?.length?jsx(Fragment,{children:e.map((r,s)=>jsx(K,{index:s,json:r.json,requestJson:r?.requestJson,onClose:()=>{t(s);},isWindowMinimized:a,windowOrder:n},r.json.id))}):null;var Mo=({children:e})=>{let[t,a]=useState([]),[n,r]=useState(false),[s,o]=useState(1),f=useCallback(c=>{if(t.length===7){alert("Maximum allowed active Json Viewer is 7 per table.");return}if(t.some(B=>B.json.id===c.json.id))return;let v=structuredClone(c.json),k=v.request_body,W={json:v,requestJson:c.requestJson||k||void 0};delete W.json.request_body,a(B=>[...B,W]);},[t]),p=c=>{a(v=>v.filter((k,W)=>c!==W));},m=c=>{r(c);},w=c=>{o(c);},S=useMemo(()=>({jsonViewerList:t,handleJsonViewerDialogOpen:f,handleWindowMinimize:m,handleWindowOrder:w}),[t,f]);return jsxs(se.Provider,{value:S,children:[e,jsx(Dt,{list:t,onClose:p,isWindowMinimized:n,windowOrder:s})]})};var Ao=({isWindowMinimized:e,windowOrder:t})=>{let{handleJsonViewerDialogOpen:a,handleWindowMinimize:n,handleWindowOrder:r}=useContext(se),s=useCallback(()=>{n(e);},[n,e]),o=useCallback(()=>{r(t);},[r,t]);return useEffect(()=>{o();},[o]),useEffect(()=>{s();},[s]),{handleJsonViewerDialogOpen:a}};var Fr=K;export{O as a,L as b,M as c,Je as d,re as e,se as f,Dt as g,Mo as h,Ao as i,Fr as j};
|