@orangelogic/orange-dam-content-browser-sdk 2.2.0-beta-66 → 2.2.0-beta-68

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.
@@ -109,7 +109,7 @@
109
109
  margin-bottom: var(--cx-spacing-3x-small);
110
110
  }
111
111
  }
112
- `;var Ut=n(4413),Vt=n(579);const qt=e=>{let{loadMore:t,isLoading:n,disabled:r=!1,slot:o,disabledIndentation:i}=e;return(0,Vt.jsxs)("cx-space",{direction:"horizontal",slot:o,children:[!i&&(0,Vt.jsx)("div",{className:"browser__load-more__indentation"}),(0,Vt.jsxs)("cx-button",{variant:"text",size:"small",onClick:t,disabled:r,loading:n,className:"browser__load-more",children:[(0,Vt.jsx)("cx-icon",{name:"add",slot:"prefix"}),"More"]})]})},Ht=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Wt=(e,t)=>{if(!t)return e;const n=t.toLowerCase().split(" ").filter(Boolean),r=n.map(Ht),o=new RegExp(`(${r.join("|")})`,"gi");return e.split(o).map(((e,t)=>n.includes(e.toLowerCase())?(0,Vt.jsx)("strong",{children:e},t):e))},Kt=e=>{var t;let{allowedFolders:n,folder:r,currentFolderID:o,icon:i,searchText:a,useSession:s,damViewSeeThru:l}=e;const[c,u]=(0,wt.useState)(!1),[d,h]=(0,wt.useState)(!1),[p,f]=(0,wt.useState)({start:0,pageSize:Ut.VH}),m=(0,wt.useRef)(null),g=o===r.id,{data:v,isFetching:b,isLoading:y}=(0,Rt.Jz)({allowedFolders:n,folder:r,searchText:"",useSession:s,start:p.start,pageSize:p.pageSize,damViewSeeThru:l},{skip:!d}),x=(0,wt.useMemo)((()=>{var e;return null!==(e=null===v||void 0===v?void 0:v.items)&&void 0!==e?e:void 0}),[v]),w=null!==(t=null===v||void 0===v?void 0:v.totalCount)&&void 0!==t?t:0,S=(0,wt.useCallback)((()=>{const e=(null===x||void 0===x?void 0:x.length)||0;e>=w||f((t=>({...t,start:e})))}),[null===x||void 0===x?void 0:x.length,w]);(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-tree-item")]).then((()=>{u(!0)}))}),[c]),(0,wt.useEffect)((()=>{const e=m.current;if(!e)return;const t=()=>{h(!0)},n=e=>{e.detail.target===m.current&&h(!1)};return e.addEventListener("cx-lazy-load",t),e.addEventListener("cx-expand",t),e.addEventListener("cx-collapse",n),()=>{e.removeEventListener("cx-lazy-load",t),e.removeEventListener("cx-expand",t),e.removeEventListener("cx-collapse",n)}}),[c]);const k=(0,wt.useMemo)((()=>{let e;return e=i||("Album"===r.docType?"share":"folder"),e}),[r.docType,i]),_=r.hasChildren&&(void 0===x||b);return(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsxs)("cx-tree-item",{ref:m,"data-value":JSON.stringify(r),expanded:d,selected:g,lazy:_,children:[(0,Vt.jsx)("cx-icon",{name:k}),(0,Vt.jsx)("cx-line-clamp",{lines:1,children:Wt(r.title,a)}),null===x||void 0===x?void 0:x.map((e=>(0,Vt.jsx)(Kt,{folder:e,searchText:a,currentFolderID:o,damViewSeeThru:l},e.id)))]}),x&&x.length<w&&!y&&(0,Vt.jsx)(qt,{loadMore:S,isLoading:b,disabled:b})]})},$t=Kt;var Qt=n(1158);const Xt=e=>{switch(e){case Qt.zu.Audio:return"audio_file";case Qt.zu.Album:return"album";case Qt.zu.Widget:return"widgets";case Qt.zu.Multimedia:return"perm_media";case Qt.zu.Story:return"article";case Qt.zu.Video:return"video_file";case Qt.zu.Image:return"photo";default:return"file"}},Gt=e=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22")}`,Zt={id:"",title:"My Favorites",docType:"Story",path:[],parents:[],fullPath:"My Favorites",hasChildren:!1},Yt=e=>{var t,n;let{allowedFolders:r,allowPin:o,collectionPath:i,currentFolder:a,favoriteFolderId:s,focusInput:l,lastLocationMode:c,open:u,showCollections:d,showFavoriteFolder:h,useSession:p,onFolderSelect:f,onClose:m,isPersistent:g,onChangePersistent:v,forceOverlay:b,damViewSeeThru:y}=e;const[x,w]=(0,wt.useState)(""),[S,k]=(0,wt.useState)(!1),[_,C]=(0,wt.useState)(!1),[E,A]=(0,wt.useState)(!1),[T,O]=(0,wt.useState)({start:0,pageSize:Ut.VH}),[P,z]=(0,wt.useState)({start:0,pageSize:Ut.VH}),D=(0,wt.useRef)(null),R=(0,wt.useRef)(null),j=(0,wt.useRef)(null),N=(0,wt.useRef)(null),I=(0,wt.useRef)(!0);(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-drawer"),customElements.whenDefined("cx-input"),customElements.whenDefined("cx-tree")]).then((()=>{k(!0)}))}),[]),(0,wt.useEffect)((()=>{const e=j.current;if(!e)return;const t=ke((e=>{const t=e.target.value;x!==t&&(t.length>2||0===t.length)&&w(t)}),500);return e.addEventListener("cx-input",t),()=>{e.removeEventListener("cx-input",t)}}),[S,x]),(0,wt.useEffect)((()=>{const e=R.current;if(!e)return;const t=()=>{m(),v(!1)};return e.addEventListener("cx-request-close",t),()=>{e.removeEventListener("cx-request-close",t)}}),[S,m,v]);const{data:M,isLoading:F,isFetching:L,isError:B}=(0,Rt.Jz)({allowedFolders:r,folder:Nt,searchText:x,useSession:p,start:T.start,pageSize:T.pageSize,damViewSeeThru:y}),{data:U}=(0,Rt.Jz)({allowedFolders:r,folder:{...Zt,id:null!==s&&void 0!==s?s:""},searchText:"",useSession:p,self:!0,includeDirectChild:!1,damViewSeeThru:y},{skip:!s}),V=(0,wt.useMemo)((()=>{var e;return null!==(e=null===M||void 0===M?void 0:M.items)&&void 0!==e?e:void 0}),[M]),q=null!==(t=null===M||void 0===M?void 0:M.totalCount)&&void 0!==t?t:0,H=(0,wt.useCallback)((()=>{if(!V)return;const e=V.length;e>=q||(C(!0),O((t=>({...t,start:e}))))}),[V,q]);(0,wt.useEffect)((()=>{const e=()=>{if(!V)return;if(r&&r.length>0){const e=V.find((e=>r.includes(e.id)));if(e)return void f(e)}const e=V.find((e=>e.title===Dt.mT));f(e||Nt)};I.current&&V&&(I.current=!1,c?(0,Mt.bQ)("lastLocation").then((t=>{if("string"===typeof t)try{const n=JSON.parse(t);if(n.id===s&&!h||r&&r.length>0)return void e();f(n)}catch(n){e()}else e()})).catch((()=>{e()})):e())}),[r,s,V,c,f,h]);const{data:W,isLoading:K,isFetching:$,isError:Q}=(0,Rt.$Y)(i?{folder:i,searchText:x,useSession:p,start:P.start,pageSize:P.pageSize}:Ft.hT),X=(0,wt.useMemo)((()=>{var e;return null!==(e=null===W||void 0===W?void 0:W.items)&&void 0!==e?e:void 0}),[W]),G=null!==(n=null===W||void 0===W?void 0:W.totalCount)&&void 0!==n?n:0,Z=(0,wt.useCallback)((()=>{if(!X)return;A(!0);const e=X.length;e>=G||z((t=>({...t,start:e})))}),[X,G]);(0,wt.useEffect)((()=>{const e=N.current;if(!e)return;const t=e=>{var t;const n=JSON.parse(null!==(t=e.detail.selection[0].dataset.value)&&void 0!==t?t:"{}");null===f||void 0===f||f(n)};return e.addEventListener("cx-selection-change",t),()=>{e.removeEventListener("cx-selection-change",t)}}),[S,f]),(0,wt.useEffect)((()=>{const e=D.current;if(!e)return;const t=e=>{var t;const n=JSON.parse(null!==(t=e.detail.item.value)&&void 0!==t?t:"{}");null===f||void 0===f||f(n)};return e.addEventListener("cx-select",t),()=>{e.removeEventListener("cx-select",t)}}),[S,X,f]),(0,wt.useEffect)((()=>{L||C(!1)}),[L]),(0,wt.useEffect)((()=>{$||A(!1)}),[$]);const Y=(0,wt.useCallback)((()=>{if(F||L&&!_)return Array.from({length:5}).map(((e,t)=>(0,Vt.jsx)("cx-skeleton",{},t)));if(V&&V.length>0){const o=[];var e,t,n;if(s)o.push((0,Vt.jsx)($t,{folder:{...Zt,id:s,hasChildren:null!==(e=null===U||void 0===U||null===(t=U.items)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.hasChildren)&&void 0!==e&&e},currentFolderID:a.id,icon:"star",useSession:p,damViewSeeThru:y},s));return[...o,...(null!==V&&void 0!==V?V:[]).map((e=>(0,Vt.jsx)($t,{allowedFolders:r,folder:e,currentFolderID:a.id,searchText:x,useSession:p,damViewSeeThru:y},e.id)))]}return B?(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Failed to load folders"}):(0,Vt.jsx)("cx-typography",{variant:"body3",children:"No folders found"})}),[r,a.id,s,V,B,L,F,x,p,_,U,y]),J=(0,wt.useCallback)((()=>K||$&&!E?Array.from({length:5}).map(((e,t)=>(0,Vt.jsx)("cx-skeleton",{},t))):X&&X.length>0?null===X||void 0===X?void 0:X.map((e=>{const t=a.id===e.id;return(0,Vt.jsxs)("cx-menu-item",{value:JSON.stringify(e),className:""+(t?"selected":""),children:[(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"collections"}),Wt(e.title,x)]},e.id)})):Q?(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Failed to load collections"}):(0,Vt.jsx)("cx-typography",{variant:"body3",children:"No collections found"})),[K,$,X,Q,a.id,x,E]),ee={persistent:{src:Gt('<svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="#52525B"\n >\n <path d="M660-320v-320L500-480l160 160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z" />\n </svg>'),onclick:()=>{m(),v(!1)}},overlay:{src:Gt('<svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="#52525B"\n >\n <path d="M500-640v320l160-160-160-160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z" />\n </svg>'),onclick:()=>v(!0)}},te=g?ee.persistent:ee.overlay,ne=b||!g?"overlay":"persistent",re=!b&&g;return(0,Vt.jsxs)(Bt,{ref:R,label:"Browser",placement:"start",contained:!0,open:u,variant:ne,noCloseButton:re,children:[!b&&o?(0,Vt.jsx)("cx-icon-button",{slot:"header-actions",...te}):null,(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"small",wrap:"nowrap",children:[(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"small",style:{padding:"var(--body-spacing) var(--body-spacing) 0"},children:[(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Folders"}),(0,Vt.jsx)("cx-input",{ref:j,value:x,placeholder:"Search...",clearable:!0,autoFocus:l,className:"search-input",children:(0,Vt.jsx)("cx-icon",{name:"search",slot:"prefix",className:"icon--large"})}),(0,Vt.jsx)("div",{className:"browser__folders",children:(0,Vt.jsxs)("cx-tree",{ref:N,"force-on-change":!0,children:[Y(),V&&V.length<q&&!F&&(0,Vt.jsx)(qt,{loadMore:H,isLoading:L,disabled:L})]})})]}),d&&(0,Vt.jsx)("div",{className:"browser__collections",children:(0,Vt.jsxs)("cx-details",{children:[(0,Vt.jsx)("cx-typography",{slot:"summary",variant:"body3",children:"Collections"}),(0,Vt.jsxs)("cx-menu",{ref:D,className:"browser__collections__menu",children:[J(),X&&X.length<G&&!K&&(0,Vt.jsx)(qt,{loadMore:Z,isLoading:$,disabled:$,disabledIndentation:!0})]})]})})]})]})},Jt=[{label:"Ascending",value:"ascending",icon:()=>(0,Vt.jsxs)("svg",{slot:"prefix",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{d:"M3.33333 4.7619L4.25984 5.68841L6.60714 3.33929V11.3095H7.61905V3.33929L9.96627 5.68841L10.8929 4.7619L6.96429 0.833333L3.33333 4.7619Z",fill:"currentColor"}),(0,Vt.jsx)("path",{opacity:"0.3",d:"M17.0833 15.2381L16.1568 14.3116L13.8095 16.6607V8.69048H12.7976V16.6607L10.4504 14.3116L9.52381 15.2381L13.4524 19.1667L17.0833 15.2381Z",fill:"currentColor"})]})},{label:"Descending",value:"descending",icon:()=>(0,Vt.jsxs)("svg",{slot:"prefix",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{opacity:"0.3",d:"M3.33333 4.7619L4.25984 5.68841L6.60714 3.33929V11.3095H7.61905V3.33929L9.96627 5.68841L10.8929 4.7619L6.96429 0.833333L3.33333 4.7619Z",fill:"currentColor"}),(0,Vt.jsx)("path",{d:"M17.0833 15.2381L16.1568 14.3116L13.8095 16.6607V8.69048H12.7976V16.6607L10.4504 14.3116L9.52381 15.2381L13.4524 19.1667L17.0833 15.2381Z",fill:"currentColor"})]})}],en=[{value:Qt.gf.Small,label:"Small labeled"},{value:Qt.gf.Medium,label:"Medium labeled"},{value:Qt.gf.Large,label:"Large labeled"}],tn=Lt.Ay.div`
112
+ `;var Ut=n(4413),Vt=n(579);const qt=e=>{let{loadMore:t,isLoading:n,disabled:r=!1,slot:o,disabledIndentation:i}=e;return(0,Vt.jsxs)("cx-space",{direction:"horizontal",slot:o,children:[!i&&(0,Vt.jsx)("div",{className:"browser__load-more__indentation"}),(0,Vt.jsxs)("cx-button",{variant:"text",size:"small",onClick:t,disabled:r,loading:n,className:"browser__load-more",children:[(0,Vt.jsx)("cx-icon",{name:"add",slot:"prefix"}),"More"]})]})},Ht=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Wt=(e,t)=>{if(!t)return e;const n=t.toLowerCase().split(" ").filter(Boolean),r=n.map(Ht),o=new RegExp(`(${r.join("|")})`,"gi");return e.split(o).map(((e,t)=>n.includes(e.toLowerCase())?(0,Vt.jsx)("strong",{children:e},t):e))},Kt=e=>{var t;let{allowedFolders:n,folder:r,currentFolderID:o,icon:i,searchText:a,useSession:s,damViewSeeThru:l}=e;const[c,u]=(0,wt.useState)(!1),[d,h]=(0,wt.useState)(!1),[p,f]=(0,wt.useState)({start:0,pageSize:Ut.VH}),m=(0,wt.useRef)(null),g=o===r.id,{data:v,isFetching:b,isLoading:y}=(0,Rt.Jz)({allowedFolders:n,folder:r,searchText:"",useSession:s,start:p.start,pageSize:p.pageSize,damViewSeeThru:l},{skip:!d}),x=(0,wt.useMemo)((()=>{var e;return null!==(e=null===v||void 0===v?void 0:v.items)&&void 0!==e?e:void 0}),[v]),w=null!==(t=null===v||void 0===v?void 0:v.totalCount)&&void 0!==t?t:0,S=(0,wt.useCallback)((()=>{const e=(null===x||void 0===x?void 0:x.length)||0;e>=w||f((t=>({...t,start:e})))}),[null===x||void 0===x?void 0:x.length,w]);(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-tree-item")]).then((()=>{u(!0)}))}),[c]),(0,wt.useEffect)((()=>{const e=m.current;if(!e)return;const t=()=>{h(!0)},n=e=>{e.detail.target===m.current&&h(!1)};return e.addEventListener("cx-lazy-load",t),e.addEventListener("cx-expand",t),e.addEventListener("cx-collapse",n),()=>{e.removeEventListener("cx-lazy-load",t),e.removeEventListener("cx-expand",t),e.removeEventListener("cx-collapse",n)}}),[c]);const k=(0,wt.useMemo)((()=>{let e;return e=i||("Album"===r.docType?"share":"folder"),e}),[r.docType,i]),_=r.hasChildren&&(void 0===x||b);return(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsxs)("cx-tree-item",{ref:m,"data-value":JSON.stringify(r),expanded:d,selected:g,lazy:_,children:[(0,Vt.jsx)("cx-icon",{name:k}),(0,Vt.jsx)("cx-line-clamp",{lines:1,children:Wt(r.title,a)}),null===x||void 0===x?void 0:x.map((e=>(0,Vt.jsx)(Kt,{folder:e,searchText:a,currentFolderID:o,damViewSeeThru:l},e.id)))]}),x&&x.length<w&&!y&&(0,Vt.jsx)(qt,{loadMore:S,isLoading:b,disabled:b})]})},$t=Kt;var Qt=n(1158);const Xt=e=>{switch(e){case Qt.zu.Audio:return"audio_file";case Qt.zu.Album:return"album";case Qt.zu.Widget:return"widgets";case Qt.zu.Multimedia:return"perm_media";case Qt.zu.Story:return"article";case Qt.zu.Video:return"video_file";case Qt.zu.Image:return"photo";default:return"file"}},Gt=e=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22")}`;var Zt=n(7840);const Yt={id:"",title:"My Favorites",docType:"Story",path:[],parents:[],fullPath:"My Favorites",hasChildren:!1},Jt=e=>{var t,n;let{allowedFolders:r,allowPin:o,collectionPath:i,currentFolder:a,favoriteFolderId:s,focusInput:l,lastLocationMode:c,open:u,showCollections:d,showFavoriteFolder:h,useSession:p,onFolderSelect:f,onClose:m,isPersistent:g,onChangePersistent:v,forceOverlay:b,damViewSeeThru:y}=e;const[x,w]=(0,wt.useState)(""),[S,k]=(0,wt.useState)(!1),[_,C]=(0,wt.useState)(!1),[E,A]=(0,wt.useState)(!1),[T,O]=(0,wt.useState)({start:0,pageSize:Ut.VH}),[P,z]=(0,wt.useState)({start:0,pageSize:Ut.VH}),D=(0,wt.useRef)(null),R=(0,wt.useRef)(null),j=(0,wt.useRef)(null),N=(0,wt.useRef)(null),I=(0,wt.useRef)(!0);(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-drawer"),customElements.whenDefined("cx-input"),customElements.whenDefined("cx-tree")]).then((()=>{k(!0)}))}),[]),(0,wt.useEffect)((()=>{const e=j.current;if(!e)return;const t=ke((e=>{const t=e.target.value;x!==t&&(t.length>2||0===t.length)&&(w(t),O((e=>({...e,start:0}))))}),500);return e.addEventListener("cx-input",t),()=>{e.removeEventListener("cx-input",t)}}),[S,x]),(0,wt.useEffect)((()=>{const e=R.current;if(!e)return;const t=()=>{m(),v(!1)};return e.addEventListener("cx-request-close",t),()=>{e.removeEventListener("cx-request-close",t)}}),[S,m,v]);const{data:M,isLoading:F,isFetching:L,isError:B}=(0,Rt.Jz)({allowedFolders:r,folder:Nt,searchText:x,useSession:p,start:T.start,pageSize:T.pageSize,damViewSeeThru:y}),{data:U}=(0,Rt.Jz)({allowedFolders:r,folder:{...Yt,id:null!==s&&void 0!==s?s:""},searchText:"",useSession:p,self:!0,includeDirectChild:!1,damViewSeeThru:y},{skip:!s}),V=(0,wt.useMemo)((()=>{var e;return null!==(e=null===M||void 0===M?void 0:M.items)&&void 0!==e?e:void 0}),[M]),q=null!==(t=null===M||void 0===M?void 0:M.totalCount)&&void 0!==t?t:0,H=(0,wt.useCallback)((()=>{if(!V)return;const e=V.length;e>=q||(C(!0),O((t=>({...t,start:e}))))}),[V,q]);(0,wt.useEffect)((()=>{const e=()=>{if(!V)return;if(r&&r.length>0){const e=V.find((e=>r.includes(e.id)));if(e)return void f(e)}const e=V.find((e=>e.title===Dt.mT));f(e||Nt)};I.current&&V&&(I.current=!1,c?(0,Mt.bQ)("lastLocation").then((t=>{if("string"===typeof t)try{const n=JSON.parse(t);if(n.id===s&&!h||r&&r.length>0)return void e();f(n)}catch(n){e()}else e()})).catch((()=>{e()})):e())}),[r,s,V,c,f,h]);const{data:W,isLoading:K,isFetching:$,isError:Q}=(0,Rt.$Y)(i?{folder:i,searchText:x,useSession:p,start:P.start,pageSize:P.pageSize}:Ft.hT),X=(0,wt.useMemo)((()=>{var e;return null!==(e=null===W||void 0===W?void 0:W.items)&&void 0!==e?e:void 0}),[W]),G=null!==(n=null===W||void 0===W?void 0:W.totalCount)&&void 0!==n?n:0,Z=(0,wt.useCallback)((()=>{if(!X)return;A(!0);const e=X.length;e>=G||z((t=>({...t,start:e})))}),[X,G]);(0,wt.useEffect)((()=>{const e=N.current;if(!e)return;const t=e=>{var t;const n=JSON.parse(null!==(t=e.detail.selection[0].dataset.value)&&void 0!==t?t:"{}");null===f||void 0===f||f(n)};return e.addEventListener("cx-selection-change",t),()=>{e.removeEventListener("cx-selection-change",t)}}),[S,f]),(0,wt.useEffect)((()=>{const e=D.current;if(!e)return;const t=e=>{var t;const n=JSON.parse(null!==(t=e.detail.item.value)&&void 0!==t?t:"{}");null===f||void 0===f||f(n)};return e.addEventListener("cx-select",t),()=>{e.removeEventListener("cx-select",t)}}),[S,X,f]),(0,wt.useEffect)((()=>{L||C(!1)}),[L]),(0,wt.useEffect)((()=>{$||A(!1)}),[$]);const Y=(0,wt.useCallback)((()=>{if(F||L&&!_)return Array.from({length:5}).map(((e,t)=>(0,Vt.jsx)("cx-skeleton",{},t)));if(V&&V.length>0){var e;const i=[];var t,n,o;if(s)i.push((0,Vt.jsx)($t,{folder:{...Yt,id:s,hasChildren:null!==(t=null===U||void 0===U||null===(n=U.items)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.hasChildren)&&void 0!==t&&t},currentFolderID:a.id,icon:"star",useSession:p,damViewSeeThru:y},s));return[...i,...(null!==(e=(0,Zt.A)(V,(e=>e.id)))&&void 0!==e?e:[]).map((e=>(0,Vt.jsx)($t,{allowedFolders:r,folder:e,currentFolderID:a.id,searchText:x,useSession:p,damViewSeeThru:y},e.id)))]}return B?(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Failed to load folders"}):(0,Vt.jsx)("cx-typography",{variant:"body3",children:"No folders found"})}),[r,a.id,s,V,B,L,F,x,p,_,U,y]),J=(0,wt.useCallback)((()=>K||$&&!E?Array.from({length:5}).map(((e,t)=>(0,Vt.jsx)("cx-skeleton",{},t))):X&&X.length>0?null===X||void 0===X?void 0:X.map((e=>{const t=a.id===e.id;return(0,Vt.jsxs)("cx-menu-item",{value:JSON.stringify(e),className:""+(t?"selected":""),children:[(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"collections"}),Wt(e.title,x)]},e.id)})):Q?(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Failed to load collections"}):(0,Vt.jsx)("cx-typography",{variant:"body3",children:"No collections found"})),[K,$,X,Q,a.id,x,E]),ee={persistent:{src:Gt('<svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="#52525B"\n >\n <path d="M660-320v-320L500-480l160 160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z" />\n </svg>'),onclick:()=>{m(),v(!1)}},overlay:{src:Gt('<svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="#52525B"\n >\n <path d="M500-640v320l160-160-160-160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z" />\n </svg>'),onclick:()=>v(!0)}},te=g?ee.persistent:ee.overlay,ne=b||!g?"overlay":"persistent",re=!b&&g;return(0,Vt.jsxs)(Bt,{ref:R,label:"Browser",placement:"start",contained:!0,open:u,variant:ne,noCloseButton:re,children:[!b&&o?(0,Vt.jsx)("cx-icon-button",{slot:"header-actions",...te}):null,(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"small",wrap:"nowrap",children:[(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"small",style:{padding:"var(--body-spacing) var(--body-spacing) 0"},children:[(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Folders"}),(0,Vt.jsx)("cx-input",{ref:j,value:x,placeholder:"Search...",clearable:!0,autoFocus:l,className:"search-input",children:(0,Vt.jsx)("cx-icon",{name:"search",slot:"prefix",className:"icon--large"})}),(0,Vt.jsx)("div",{className:"browser__folders",children:(0,Vt.jsxs)("cx-tree",{ref:N,"force-on-change":!0,children:[Y(),V&&V.length<q&&!F&&(0,Vt.jsx)(qt,{loadMore:H,isLoading:L,disabled:L})]})})]}),d&&(0,Vt.jsx)("div",{className:"browser__collections",children:(0,Vt.jsxs)("cx-details",{children:[(0,Vt.jsx)("cx-typography",{slot:"summary",variant:"body3",children:"Collections"}),(0,Vt.jsxs)("cx-menu",{ref:D,className:"browser__collections__menu",children:[J(),X&&X.length<G&&!K&&(0,Vt.jsx)(qt,{loadMore:Z,isLoading:$,disabled:$,disabledIndentation:!0})]})]})})]})]})},en=[{label:"Ascending",value:"ascending",icon:()=>(0,Vt.jsxs)("svg",{slot:"prefix",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{d:"M3.33333 4.7619L4.25984 5.68841L6.60714 3.33929V11.3095H7.61905V3.33929L9.96627 5.68841L10.8929 4.7619L6.96429 0.833333L3.33333 4.7619Z",fill:"currentColor"}),(0,Vt.jsx)("path",{opacity:"0.3",d:"M17.0833 15.2381L16.1568 14.3116L13.8095 16.6607V8.69048H12.7976V16.6607L10.4504 14.3116L9.52381 15.2381L13.4524 19.1667L17.0833 15.2381Z",fill:"currentColor"})]})},{label:"Descending",value:"descending",icon:()=>(0,Vt.jsxs)("svg",{slot:"prefix",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{opacity:"0.3",d:"M3.33333 4.7619L4.25984 5.68841L6.60714 3.33929V11.3095H7.61905V3.33929L9.96627 5.68841L10.8929 4.7619L6.96429 0.833333L3.33333 4.7619Z",fill:"currentColor"}),(0,Vt.jsx)("path",{d:"M17.0833 15.2381L16.1568 14.3116L13.8095 16.6607V8.69048H12.7976V16.6607L10.4504 14.3116L9.52381 15.2381L13.4524 19.1667L17.0833 15.2381Z",fill:"currentColor"})]})}],tn=[{value:Qt.gf.Small,label:"Small labeled"},{value:Qt.gf.Medium,label:"Medium labeled"},{value:Qt.gf.Large,label:"Large labeled"}],nn=Lt.Ay.div`
113
113
  display: flex;
114
114
  justify-content: space-between;
115
115
  flex-wrap: wrap;
@@ -196,7 +196,7 @@
196
196
  display: none;
197
197
  }
198
198
  }
199
- `,nn=e=>{let{itemKey:t,type:n,loading:r,selected:o,all:i,rest:a,mappedDisplayNames:s,collections:l,partialSyncCheckbox:c}=e;const u=(0,wt.useRef)(null),d=(0,wt.useMemo)((()=>{const e=u.current;if(!e)return;const n=Object.keys(a).some((e=>l.includes(`${t}>>${e}`)));return o||n?!n||(e.indeterminate=!0,!1):(e.previouslySelected=!1,e.indeterminate=!1,!1)}),[o,l,a,t]);return(0,Vt.jsxs)("cx-tree-item",{ref:u,"data-value":t,"data-type":n,readonly:r,selected:d,"partial-sync-checkboxes":c,children:[s[t]," ",!!i&&`(${i})`,Object.entries(a).map((e=>{let[o,i]=e;return(0,Vt.jsxs)("cx-tree-item",{"data-value":`${t}>>${o}`,"data-type":n,readonly:r,selected:l.includes(`${t}>>${o}`),children:[s[`${t}>>${o}`]," (",i,")"]},o)}))]})},rn=e=>{let{values:t,type:n,displayName:r,collections:o,loading:i=!1}=e;const[a,s]=(0,wt.useState)(1),l=(0,wt.useMemo)((()=>t.reduce(((e,t)=>{let{value:n,count:r}=t;const[o,i]=n.split(">>");return e[o]&&"object"===typeof e[o]||(e[o]?e[o]={all:e[o]}:e[o]={}),i&&(e[o][i]=r),e[o].all=(e[o].all||0)+r,e}),{})),[t]),c=(0,wt.useMemo)((()=>{const e={};return t.forEach((t=>{e[t.value]=t.displayValue})),t.forEach((t=>{const n=t.value.split(">>");if(n.length>1){const t=n.slice(0,-1).join(">>");e[t]||(e[t]=t.split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "))}})),e}),[t]),u=(0,wt.useMemo)((()=>Object.keys(l).length>20*a),[l,a]);return 0===t.length?null:(0,Vt.jsxs)("cx-details",{open:!0,className:"filter-details",children:[(0,Vt.jsxs)("cx-space",{slot:"summary","align-items":"center",spacing:"x-small",wrap:"nowrap",children:[(0,Vt.jsx)("span",{children:r}),i&&(0,Vt.jsx)("cx-spinner",{})]}),(0,Vt.jsx)("cx-space",{direction:"vertical",children:(0,Vt.jsxs)("cx-tree",{selection:"multiple","label-select-single":!0,"data-facet":n,children:[Object.entries(l).slice(0,20*a).map((e=>{let[t,r]=e;if("object"===typeof r){const e=o.includes(t),{all:a,...s}=r,l=Object.values(s).reduce(((e,t)=>e+t),0);return(0,Vt.jsx)(nn,{itemKey:t,type:n,loading:i,selected:e,all:a,rest:s,mappedDisplayNames:c,collections:o,partialSyncCheckbox:l<a||void 0},t)}return(0,Vt.jsxs)("cx-tree-item",{"data-value":t,"data-type":n,readonly:i,selected:o.includes(t),children:[c[t]," (",r,")"]},t)})),u&&(0,Vt.jsx)(qt,{loadMore:()=>s((e=>e+1)),isLoading:i,disabled:i})]})})]})},on=e=>{let{allowSorting:t,availableFacets:n,currentCount:r,loading:o,facets:i,isMobile:a,isSeeThrough:s,searchValue:l,selectedFacets:c,sortDirection:u,sortOrder:d,sortOrders:h,totalCount:p,view:f,onSearchChange:m,onSettingChange:g}=e;const[v,b]=(0,wt.useState)(!1),[y,x]=(0,wt.useState)({type:void 0,value:void 0}),w=(0,wt.useRef)(null),S=(0,wt.useRef)(null),k=(0,wt.useRef)(null),_=(0,wt.useRef)(null);(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-input"),customElements.whenDefined("cx-checkbox"),customElements.whenDefined("cx-dropdown")]).then((()=>b(!0)))}),[]),(0,wt.useEffect)((()=>{const e=e=>{const t=e.target.value;l!==t&&m(t)},t=w.current;return null===t||void 0===t||t.addEventListener("cx-change",e),()=>{null===t||void 0===t||t.removeEventListener("cx-change",e)}}),[v,l,m]),(0,wt.useEffect)((()=>{const e=e=>{const t=e.detail.item.value;"see-thru"===t?g("isSeeThrough",!s):g("view",null!==t&&void 0!==t?t:Qt.gf.Medium)},t=k.current;return null===t||void 0===t||t.addEventListener("cx-select",e),()=>{null===t||void 0===t||t.removeEventListener("cx-select",e)}}),[v,s,g]),(0,wt.useEffect)((()=>{const e=e=>{const t=e.target,n=t.dataset.type,r=t.dataset.value;if(!r||!n)return;const o={...c};o[n]&&(o[n]=o[n].filter((e=>e!==r))),g("filter",o)},t=e=>{const t=e.target.dataset.facet;if(!t)return;x({type:"filter",value:t});const n=e.detail.selection.reduce(((e,t)=>{const n=t.dataset.type,r=t.dataset.value;return r&&n?(e[n]||(e[n]=[]),e[n].push(r),e):e}),{...c,[t]:[]});g("filter",n)},n=e=>{const t=e.detail.item.dataset.type,n=e.detail.item.value;n&&("sort-direction"===t?(x({type:"sortDirection",value:n}),g("sortDirection",n)):"sort-order"===t&&(x({type:"sortOrder",value:n}),g("sortOrder",n)))},r=S.current,o=_.current;return null===r||void 0===r||r.addEventListener("cx-selection-change",t),null===r||void 0===r||r.addEventListener("cx-remove",e),null===o||void 0===o||o.addEventListener("cx-select",n),()=>{null===r||void 0===r||r.removeEventListener("cx-selection-change",t),null===r||void 0===r||r.removeEventListener("cx-remove",e),null===o||void 0===o||o.removeEventListener("cx-select",n)}}),[v,c,g]);const C=(0,wt.useMemo)((()=>en.find((e=>e.value===f))),[f]),E=(0,wt.useMemo)((()=>{var e;return null!==(e=null===i||void 0===i?void 0:i.reduce(((e,t)=>{const n=t.values.reduce(((e,t)=>{let{value:n,displayValue:r}=t;return e[n]=r,e}),{});return{...e,[t.facetDetails.facetFieldName]:n}}),{}))&&void 0!==e?e:{}}),[i]),A=(0,wt.useMemo)((()=>Object.entries(c).reduce(((e,t)=>{let[n,r]=t;return E[n]?e+r.filter((e=>E[n][e])).length:e}),0)),[c,E]),T=(0,wt.useCallback)((()=>(0,Vt.jsxs)("cx-details",{"data-cy":"applied-filters",open:!0,className:("filter-details "+(0===A?"filter-details--empty":"")).trim(),children:[(0,Vt.jsxs)("cx-space",{slot:"summary","align-items":"center",spacing:"x-small",wrap:"nowrap",children:[(0,Vt.jsxs)("span",{children:["Applied filters"," ",A>0?` (${A})`:""]}),o&&"filter"===y.type&&(0,Vt.jsx)("cx-spinner",{})]}),(0,Vt.jsx)("cx-space",{direction:"horizontal",spacing:"small",children:Object.entries(c).map((e=>{let[t,n]=e;return n&&0!==n.length?n.filter((e=>E[t][e])).map((e=>(0,Vt.jsxs)("cx-tag",{removable:!0,"data-value":e,"data-type":t,size:"small",children:[E[t][e],(0,Vt.jsx)("cx-icon",{slot:"suffix",name:"close"})]},e))):null}))}),A>0&&(0,Vt.jsxs)("cx-button",{variant:"text",className:"clear-all-button",onClick:()=>{g("filter",{mediaTypes:[],visibilityClasses:[],statuses:[],extensions:[]})},children:["Clear all",(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"clear",label:"Clear"})]})]})),[A,o,E,y.type,g,c]);return(0,Vt.jsxs)(tn,{children:[(0,Vt.jsxs)("cx-space",{"align-items":"center",spacing:"x-small",wrap:"nowrap",style:{flex:1},children:[(0,Vt.jsx)("cx-input",{ref:w,value:l,placeholder:"Search...",clearable:!0,className:"search-input",children:(0,Vt.jsx)("cx-icon",{name:"search",slot:"prefix",className:"icon--large"})}),(0,Vt.jsxs)("cx-dropdown",{ref:S,children:[(0,Vt.jsx)("div",{slot:"trigger",children:(0,Vt.jsx)("cx-tooltip",{content:"Filter",children:(0,Vt.jsx)("cx-icon-button",{name:"filter_alt",label:"Filter",outline:!0,"data-cy":"filter-button",children:A>0&&(0,Vt.jsx)("cx-badge",{slot:"badge",pill:!0,size:"small",children:A})})})}),T(),n.length>0&&(0,Vt.jsx)("cx-space",{direction:"vertical",className:"filter-details",children:n.map((e=>{const t=null===i||void 0===i?void 0:i.find((t=>t.facetDetails.facetFieldName===e.facetFieldName));return t?(0,Vt.jsx)(rn,{values:t.values,displayName:t.facetDetails.displayName,type:t.facetDetails.facetFieldName,collections:c[t.facetDetails.facetFieldName]||[]},t.facetDetails.facetFieldName):null}))})]})]}),(0,Vt.jsxs)("cx-space",{"align-items":"center",spacing:"x-small",wrap:"nowrap",style:{marginLeft:"auto"},children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:(0,Vt.jsxs)("cx-typography",{variant:"body3",children:[r," of ",p]})}),(0,Vt.jsxs)("cx-dropdown",{ref:k,"auto-width-factor":a?1:.6,"stay-open-on-select":!0,placement:"bottom-end",skidding:a?40:0,children:[(0,Vt.jsx)("div",{slot:"trigger",children:(0,Vt.jsx)("cx-tooltip",{content:"View",children:(0,Vt.jsx)("cx-icon-button",{name:"dashboard",label:"View",outline:!0,"data-cy":"view-button"})})}),a?(0,Vt.jsxs)("cx-menu",{variant:"multiple",children:[(0,Vt.jsxs)("cx-menu",{active:!0,name:"main",children:[(0,Vt.jsx)("cx-menu-label",{children:"View"}),(0,Vt.jsxs)("cx-menu-item",{menu:"submenu",class:C?"selected":"",children:["Grid (",null===C||void 0===C?void 0:C.label,")",(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"grid_view"})]}),(0,Vt.jsx)("cx-divider",{}),(0,Vt.jsxs)("cx-menu-item",{value:"see-thru",className:"menu-item--switch",children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:"See-thru"}),(0,Vt.jsx)("cx-switch",{checked:s,onClick:e=>e.preventDefault()})]})]}),(0,Vt.jsx)("cx-menu",{name:"submenu",back:"main",children:en.map((e=>(0,Vt.jsxs)("cx-menu-item",{value:e.value.toString(),class:e.value===f?"selected":"",children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:e.label}),(0,Vt.jsx)("cx-icon",{slot:"prefix",name:f===e.value?"check":""})]},e.value)))})]},"multiple-menu"):(0,Vt.jsxs)("cx-menu",{children:[(0,Vt.jsx)("cx-menu-label",{children:"View"}),(0,Vt.jsxs)("cx-menu-item",{class:C?"selected":"",children:["Grid (",null===C||void 0===C?void 0:C.label,")",(0,Vt.jsx)("cx-menu",{slot:"submenu",children:en.map((e=>(0,Vt.jsxs)("cx-menu-item",{value:e.value.toString(),class:e.value===f?"selected":"",children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:e.label}),(0,Vt.jsx)("cx-icon",{slot:"prefix",name:f===e.value?"check":""})]},e.value)))}),(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"grid_view"})]}),(0,Vt.jsx)("cx-divider",{}),(0,Vt.jsxs)("cx-menu-item",{value:"see-thru",className:"menu-item--switch",children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:"See-thru"}),(0,Vt.jsx)("cx-switch",{checked:s,onClick:e=>e.preventDefault()})]})]},"default-menu")]}),(0,Vt.jsxs)("cx-dropdown",{ref:_,"auto-width-factor":a?1:.5,"stay-open-on-select":!0,children:[(0,Vt.jsx)("div",{slot:"trigger",children:(0,Vt.jsx)("cx-tooltip",{content:"Sort",children:(0,Vt.jsx)("cx-icon-button",{name:"sort",label:"Sort",outline:!0,"data-cy":"sort-button"})})}),(0,Vt.jsxs)("cx-menu",{children:[(h?Jt.map((e=>{var t,n;const r=null===(t=h[d])||void 0===t||null===(n=t.find((t=>t.sortDirection.toLowerCase()===e.value.toLowerCase())))||void 0===n?void 0:n.sortDirectionDisplayName;return{...e,label:null!==r&&void 0!==r?r:e.value}})):Jt).map((e=>(0,Vt.jsxs)("cx-menu-item",{"data-type":"sort-direction",disabled:!t,value:e.value,class:t&&u===e.value?"selected":"",children:[e.label.replace(/\b\w/g,(e=>e.toUpperCase())),o&&"sortDirection"===y.type&&y.value===e.value?(0,Vt.jsx)("cx-spinner",{slot:"prefix"}):(0,Vt.jsx)(e.icon,{})]},e.value))),(0,Vt.jsx)("cx-divider",{}),Object.keys(null!==h&&void 0!==h?h:{}).map((e=>(0,Vt.jsxs)("cx-menu-item",{"data-type":"sort-order",value:e,class:d===e?"selected":"",children:[e.replace(/\b\w/g,(e=>e.toUpperCase())),o&&"sortOrder"===y.type&&y.value===e?(0,Vt.jsx)("cx-spinner",{slot:"prefix"}):(0,Vt.jsx)("cx-icon",{slot:"prefix",name:d===e?"check":""})]},e)))]})]})]})]})};var an=n(7840),sn=n(8743);const ln=(e,t)=>{const n=(e,t)=>0===t?e:n(t,e%t),r=Math.round(e),o=Math.round(t),i=n(r,o);return{width:r/i,height:o/i}},cn=(e,t,n)=>{const r=n*Math.PI/180;if(n%90===0)return{width:n%180===0?e:t,height:n%180===0?t:e};const o=Math.abs(Math.cos(r)),i=Math.abs(Math.sin(r)),a=e*o+t*i,s=e*i+t*o;return{width:Math.round(a),height:Math.round(s)}};var un=function(e,t){return un=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},un(e,t)};function dn(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}un(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var hn=function(){return hn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},hn.apply(this,arguments)};Object.create;Object.create;"function"===typeof SuppressedError&&SuppressedError;var pn=n(1185),fn=n.n(pn);function mn(e,t,n,r,o){void 0===o&&(o=0);var i=Sn(t.width,t.height,o),a=i.width,s=i.height;return{x:gn(e.x,a,n.width,r),y:gn(e.y,s,n.height,r)}}function gn(e,t,n,r){var o=t*r/2-n/2;return kn(e,-o,o)}function vn(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function bn(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function yn(e,t){return Math.min(e,Math.max(0,t))}function xn(e,t){return t}function wn(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Sn(e,t,n){var r=n*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function kn(e,t,n){return Math.min(Math.max(e,t),n)}function _n(){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 Cn=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.cropperRef=wt.createRef(),n.imageRef=wt.createRef(),n.videoRef=wt.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!==typeof document?document:null,n.currentWindow="undefined"!==typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if("undefined"!==typeof window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,r,o,i){var a=Sn(t.width,t.height,n),s=kn(r.width/a.width*(100/e.width),o,i);return{crop:{x:s*a.width/2-r.width/2-a.width*s*(e.x/100),y:s*a.height/2-r.height/2-a.height*s*(e.y/100)},zoom:s}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),r=t.crop,o=t.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var i=function(e,t,n,r,o,i){void 0===n&&(n=0);var a=Sn(t.naturalWidth,t.naturalHeight,n),s=kn(function(e,t,n){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}(e,t,r),o,i),l=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((a.width-e.width)/2-e.x)*l,y:((a.height-e.height)/2-e.y)*l},zoom:s}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);r=i.crop,o=i.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var e,t,r,o,i,a,s=n.imageRef.current||n.videoRef.current;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var l=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=n.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef.current)||void 0===o?void 0:o.videoHeight)||0,d=c/u,h=void 0;if(s.offsetWidth<c||s.offsetHeight<u)switch(n.state.mediaObjectFit){default:case"contain":h=l>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":h={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":h={width:n.containerRect.height*d,height:n.containerRect.height}}else h={width:s.offsetWidth,height:s.offsetHeight};n.mediaSize=hn(hn({},h),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var p=n.props.cropSize?n.props.cropSize:function(e,t,n,r,o,i){void 0===i&&(i=0);var a=Sn(e,t,i),s=a.width,l=a.height,c=Math.min(s,n),u=Math.min(l,r);return c>u*o?{width:u*o,height:u}:{width:c,height:c/o}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===p.height&&(null===(a=n.state.cropSize)||void 0===a?void 0:a.width)===p.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(p),n.setState({cropSize:p},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(p),p}},n.saveContainerPosition=function(){if(n.containerRef){var e=n.containerRef.getBoundingClientRect();n.containerPosition={x:e.left,y:e.top}}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onScroll=function(e){n.currentDoc&&(e.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var r=t.getMousePoint(e),o=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(o,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=hn({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},a=n.props.restrictPosition?mn(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(a)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var r=t.getMousePoint(e),o=fn()(e).pixelY,i=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(i,r,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e,t){var r=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(r-t.x),y:n.containerRect.height/2-(o-t.y)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,i=o.crop,a=o.zoom;return{x:(t+i.x)/a,y:(r+i.y)/a}},n.setNewZoom=function(e,t,r){var o=(void 0===r?{}:r).shouldUpdatePosition,i=void 0===o||o;if(n.state.cropSize&&n.props.onZoomChange){var a=kn(e,n.props.minZoom,n.props.maxZoom);if(i){var s=n.getPointOnContainer(t,n.containerPosition),l=n.getPointOnMedia(s),c={x:l.x*a-s.x,y:l.y*a-s.y},u=n.props.restrictPosition?mn(c,n.mediaSize,n.state.cropSize,a,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(a)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,r,o,i,a){void 0===i&&(i=0),void 0===a&&(a=!0);var s=a?yn:xn,l=Sn(t.width,t.height,i),c=Sn(t.naturalWidth,t.naturalHeight,i),u={x:s(100,((l.width-n.width/o)/2-e.x/o)/l.width*100),y:s(100,((l.height-n.height/o)/2-e.y/o)/l.height*100),width:s(100,n.width/l.width*100/o),height:s(100,n.height/l.height*100/o)},d=Math.round(s(c.width,u.width*c.width/100)),h=Math.round(s(c.height,u.height*c.height/100)),p=c.width>=c.height*r?{width:Math.round(h*r),height:h}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:hn(hn({},p),{x:Math.round(s(c.width-p.width,u.x*c.width/100)),y:Math.round(s(c.height-p.height,u.y*c.height/100))})}}(n.props.restrictPosition?mn(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?mn(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n.onKeyDown=function(e){var t,r,o=n.props,i=o.crop,a=o.onCropChange,s=o.keyboardStep,l=o.zoom,c=o.rotation,u=s;if(n.state.cropSize){e.shiftKey&&(u*=.2);var d=hn({},i);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}n.props.restrictPosition&&(d=mn(d,n.mediaSize,n.state.cropSize,l,c)),e.repeat||null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t),a(d)}},n.onKeyUp=function(e){var t,r;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}n.emitCropData(),null===(r=(t=n.props).onInteractionEnd)||void 0===r||r.call(t)},n}return dn(t,e),t.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(),"undefined"===typeof 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))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&("undefined"===typeof 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())},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,a,s,l,c;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===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.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===(l=this.props.crop)||void 0===l?void 0:l.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===(c=this.videoRef.current)||void 0===c||c.load());var u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.getObjectFit=function(){var e,t,n,r;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var o=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===(n=this.imageRef.current)||void 0===n?void 0:n.naturalHeight)||(null===(r=this.videoRef.current)||void 0===r?void 0:r.videoHeight)||0)<o?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=vn(n,r),this.lastPinchRotation=bn(n,r),this.onDragStart(wn(n,r))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var r=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),i=wn(r,o);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=vn(r,o),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var a=bn(r,o),s=n.props.rotation+(a-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=a}))}},t.prototype.render=function(){var e,t=this,n=this.props,r=n.image,o=n.video,i=n.mediaProps,a=n.cropperProps,s=n.transform,l=n.crop,c=l.x,u=l.y,d=n.rotation,h=n.zoom,p=n.cropShape,f=n.showGrid,m=n.style,g=m.containerStyle,v=m.cropAreaStyle,b=m.mediaStyle,y=n.classes,x=y.containerClassName,w=y.cropAreaClassName,S=y.mediaClassName,k=null!==(e=this.state.mediaObjectFit)&&void 0!==e?e:this.getObjectFit();return wt.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef=e},"data-testid":"container",style:g,className:_n("reactEasyCrop_Container",x)},r?wt.createElement("img",hn({alt:"",className:_n("reactEasyCrop_Image","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical",S)},i,{src:r,ref:this.imageRef,style:hn(hn({},b),{transform:s||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(h,")")}),onLoad:this.onMediaLoad})):o&&wt.createElement("video",hn({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:_n("reactEasyCrop_Video","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical",S)},i,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:hn(hn({},b),{transform:s||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(h,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return wt.createElement("source",hn({key:e.src},e))}))),this.state.cropSize&&wt.createElement("div",hn({ref:this.cropperRef,style:hn(hn({},v),{width:this.state.cropSize.width,height:this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:_n("reactEasyCrop_CropArea","round"===p&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",w)},a)))},t.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},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(wt.Component);const En=(e,t,n,r)=>{const o=n/r;let i=e,a=t;return e/t>o?i=Math.round(a*o):a=Math.round(i/o),{width:i,height:a}},An=Lt.Ay.div`
199
+ `,rn=e=>{let{itemKey:t,type:n,loading:r,selected:o,all:i,rest:a,mappedDisplayNames:s,collections:l,partialSyncCheckbox:c}=e;const u=(0,wt.useRef)(null),d=(0,wt.useMemo)((()=>{const e=u.current;if(!e)return;const n=Object.keys(a).some((e=>l.includes(`${t}>>${e}`)));return o||n?!o&&n?(e.indeterminate=!0,!1):o:(e.previouslySelected=!1,e.indeterminate=!1,!1)}),[o,l,a,t]);return(0,Vt.jsxs)("cx-tree-item",{ref:u,"data-value":t,"data-type":n,readonly:r,selected:d||void 0,"partial-sync-checkboxes":c,children:[s[t]," ",!!i&&`(${i})`,Object.entries(a).map((e=>{let[o,i]=e;return(0,Vt.jsxs)("cx-tree-item",{"data-value":`${t}>>${o}`,"data-type":n,readonly:r,selected:l.includes(`${t}>>${o}`),children:[s[`${t}>>${o}`]," (",i,")"]},o)}))]})},on=e=>{let{values:t,type:n,displayName:r,collections:o,loading:i=!1}=e;const[a,s]=(0,wt.useState)(1),l=(0,wt.useMemo)((()=>t.reduce(((e,t)=>{let{value:n,count:r}=t;const[o,i]=n.split(">>");return e[o]&&"object"===typeof e[o]||(e[o]?e[o]={all:e[o]}:e[o]={}),i&&(e[o][i]=r),e[o].all=(e[o].all||0)+r,e}),{})),[t]),c=(0,wt.useMemo)((()=>{const e={};return t.forEach((t=>{e[t.value]=t.displayValue})),t.forEach((t=>{const n=t.value.split(">>");if(n.length>1){const t=n.slice(0,-1).join(">>");e[t]||(e[t]=t.split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "))}})),e}),[t]),u=(0,wt.useMemo)((()=>Object.keys(l).length>20*a),[l,a]);return 0===t.length?null:(0,Vt.jsxs)("cx-details",{open:!0,className:"filter-details",children:[(0,Vt.jsxs)("cx-space",{slot:"summary","align-items":"center",spacing:"x-small",wrap:"nowrap",children:[(0,Vt.jsx)("span",{children:r}),i&&(0,Vt.jsx)("cx-spinner",{})]}),(0,Vt.jsx)("cx-space",{direction:"vertical",children:(0,Vt.jsxs)("cx-tree",{selection:"multiple","label-select-single":!0,"data-facet":n,children:[Object.entries(l).slice(0,20*a).map((e=>{let[t,r]=e;if("object"===typeof r){const e=o.includes(t),{all:a,...s}=r,l=Object.values(s).reduce(((e,t)=>e+t),0);return(0,Vt.jsx)(rn,{itemKey:t,type:n,loading:i,selected:e,all:a,rest:s,mappedDisplayNames:c,collections:o,partialSyncCheckbox:l<a||void 0},t)}return(0,Vt.jsxs)("cx-tree-item",{"data-value":t,"data-type":n,readonly:i,selected:o.includes(t),children:[c[t]," (",r,")"]},t)})),u&&(0,Vt.jsx)(qt,{loadMore:()=>s((e=>e+1)),isLoading:i,disabled:i})]})})]})},an=e=>{let{allowSorting:t,availableFacets:n,currentCount:r,loading:o,facets:i,isMobile:a,isSeeThrough:s,searchValue:l,selectedFacets:c,sortDirection:u,sortOrder:d,sortOrders:h,totalCount:p,view:f,onSearchChange:m,onSettingChange:g}=e;const[v,b]=(0,wt.useState)(!1),[y,x]=(0,wt.useState)({type:void 0,value:void 0}),w=(0,wt.useRef)(null),S=(0,wt.useRef)(null),k=(0,wt.useRef)(null),_=(0,wt.useRef)(null);(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-input"),customElements.whenDefined("cx-checkbox"),customElements.whenDefined("cx-dropdown")]).then((()=>b(!0)))}),[]),(0,wt.useEffect)((()=>{const e=e=>{const t=e.target.value;l!==t&&m(t)},t=w.current;return null===t||void 0===t||t.addEventListener("cx-change",e),()=>{null===t||void 0===t||t.removeEventListener("cx-change",e)}}),[v,l,m]),(0,wt.useEffect)((()=>{const e=e=>{const t=e.detail.item.value;"see-thru"===t?g("isSeeThrough",!s):g("view",null!==t&&void 0!==t?t:Qt.gf.Medium)},t=k.current;return null===t||void 0===t||t.addEventListener("cx-select",e),()=>{null===t||void 0===t||t.removeEventListener("cx-select",e)}}),[v,s,g]),(0,wt.useEffect)((()=>{const e=e=>{const t=e.target,n=t.dataset.type,r=t.dataset.value;if(!r||!n)return;const o={...c};o[n]&&(o[n]=o[n].filter((e=>e!==r))),g("filter",o)},t=e=>{const t=e.target.dataset.facet;if(!t)return;x({type:"filter",value:t});const n=e.detail.selection.reduce(((e,t)=>{const n=t.dataset.type,r=t.dataset.value;return r&&n?(e[n]||(e[n]=[]),e[n].push(r),e):e}),{...c,[t]:[]});g("filter",n)},n=e=>{const t=e.detail.item.dataset.type,n=e.detail.item.value;n&&("sort-direction"===t?(x({type:"sortDirection",value:n}),g("sortDirection",n)):"sort-order"===t&&(x({type:"sortOrder",value:n}),g("sortOrder",n)))},r=S.current,o=_.current;return null===r||void 0===r||r.addEventListener("cx-selection-change",t),null===r||void 0===r||r.addEventListener("cx-remove",e),null===o||void 0===o||o.addEventListener("cx-select",n),()=>{null===r||void 0===r||r.removeEventListener("cx-selection-change",t),null===r||void 0===r||r.removeEventListener("cx-remove",e),null===o||void 0===o||o.removeEventListener("cx-select",n)}}),[v,c,g]);const C=(0,wt.useMemo)((()=>tn.find((e=>e.value===f))),[f]),E=(0,wt.useMemo)((()=>{var e;return null!==(e=null===i||void 0===i?void 0:i.reduce(((e,t)=>{const n=t.values.reduce(((e,t)=>{let{value:n,displayValue:r}=t;return e[n]=r,e}),{});return{...e,[t.facetDetails.facetFieldName]:n}}),{}))&&void 0!==e?e:{}}),[i]),A=(0,wt.useMemo)((()=>Object.entries(c).reduce(((e,t)=>{let[n,r]=t;return E[n]?e+r.filter((e=>E[n][e])).length:e}),0)),[c,E]),T=(0,wt.useCallback)((()=>(0,Vt.jsxs)("cx-details",{"data-cy":"applied-filters",open:!0,className:("filter-details "+(0===A?"filter-details--empty":"")).trim(),children:[(0,Vt.jsxs)("cx-space",{slot:"summary","align-items":"center",spacing:"x-small",wrap:"nowrap",children:[(0,Vt.jsxs)("span",{children:["Applied filters"," ",A>0?` (${A})`:""]}),o&&"filter"===y.type&&(0,Vt.jsx)("cx-spinner",{})]}),(0,Vt.jsx)("cx-space",{direction:"horizontal",spacing:"small",style:{maxWidth:"320px"},children:Object.entries(c).map((e=>{let[t,n]=e;return n&&0!==n.length?n.filter((e=>E[t][e])).map((e=>(0,Vt.jsxs)("cx-tag",{removable:!0,"data-value":e,"data-type":t,size:"small",children:[E[t][e],(0,Vt.jsx)("cx-icon",{slot:"suffix",name:"close"})]},e))):null}))}),A>0&&(0,Vt.jsxs)("cx-button",{variant:"text",className:"clear-all-button",onClick:()=>{g("filter",{mediaTypes:[],visibilityClasses:[],statuses:[],extensions:[]})},children:["Clear all",(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"clear",label:"Clear"})]})]})),[A,o,E,y.type,g,c]);return(0,Vt.jsxs)(nn,{children:[(0,Vt.jsxs)("cx-space",{"align-items":"center",spacing:"x-small",wrap:"nowrap",style:{flex:1},children:[(0,Vt.jsx)("cx-input",{ref:w,value:l,placeholder:"Search...",clearable:!0,className:"search-input",children:(0,Vt.jsx)("cx-icon",{name:"search",slot:"prefix",className:"icon--large"})}),(0,Vt.jsxs)("cx-dropdown",{ref:S,children:[(0,Vt.jsx)("div",{slot:"trigger",children:(0,Vt.jsx)("cx-tooltip",{content:"Filter",children:(0,Vt.jsx)("cx-icon-button",{name:"filter_alt",label:"Filter",outline:!0,"data-cy":"filter-button",children:A>0&&(0,Vt.jsx)("cx-badge",{slot:"badge",pill:!0,size:"small",children:A})})})}),T(),n.length>0&&(0,Vt.jsx)("cx-space",{direction:"vertical",className:"filter-details",children:n.map((e=>{const t=null===i||void 0===i?void 0:i.find((t=>t.facetDetails.facetFieldName===e.facetFieldName));return t?(0,Vt.jsx)(on,{values:t.values,displayName:t.facetDetails.displayName,type:t.facetDetails.facetFieldName,collections:c[t.facetDetails.facetFieldName]||[]},t.facetDetails.facetFieldName):null}))})]})]}),(0,Vt.jsxs)("cx-space",{"align-items":"center",spacing:"x-small",wrap:"nowrap",style:{marginLeft:"auto"},children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:(0,Vt.jsxs)("cx-typography",{variant:"body3",children:[r," of ",p]})}),(0,Vt.jsxs)("cx-dropdown",{ref:k,"auto-width-factor":a?1:.6,"stay-open-on-select":!0,placement:"bottom-end",skidding:a?40:0,children:[(0,Vt.jsx)("div",{slot:"trigger",children:(0,Vt.jsx)("cx-tooltip",{content:"View",children:(0,Vt.jsx)("cx-icon-button",{name:"dashboard",label:"View",outline:!0,"data-cy":"view-button"})})}),a?(0,Vt.jsxs)("cx-menu",{variant:"multiple",children:[(0,Vt.jsxs)("cx-menu",{active:!0,name:"main",children:[(0,Vt.jsx)("cx-menu-label",{children:"View"}),(0,Vt.jsxs)("cx-menu-item",{menu:"submenu",class:C?"selected":"",children:["Grid (",null===C||void 0===C?void 0:C.label,")",(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"grid_view"})]}),(0,Vt.jsx)("cx-divider",{}),(0,Vt.jsxs)("cx-menu-item",{value:"see-thru",className:"menu-item--switch",children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:"See-thru"}),(0,Vt.jsx)("cx-switch",{checked:s,onClick:e=>e.preventDefault()})]})]}),(0,Vt.jsx)("cx-menu",{name:"submenu",back:"main",children:tn.map((e=>(0,Vt.jsxs)("cx-menu-item",{value:e.value.toString(),class:e.value===f?"selected":"",children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:e.label}),(0,Vt.jsx)("cx-icon",{slot:"prefix",name:f===e.value?"check":""})]},e.value)))})]},"multiple-menu"):(0,Vt.jsxs)("cx-menu",{children:[(0,Vt.jsx)("cx-menu-label",{children:"View"}),(0,Vt.jsxs)("cx-menu-item",{class:C?"selected":"",children:["Grid (",null===C||void 0===C?void 0:C.label,")",(0,Vt.jsx)("cx-menu",{slot:"submenu",children:tn.map((e=>(0,Vt.jsxs)("cx-menu-item",{value:e.value.toString(),class:e.value===f?"selected":"",children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:e.label}),(0,Vt.jsx)("cx-icon",{slot:"prefix",name:f===e.value?"check":""})]},e.value)))}),(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"grid_view"})]}),(0,Vt.jsx)("cx-divider",{}),(0,Vt.jsxs)("cx-menu-item",{value:"see-thru",className:"menu-item--switch",children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:"See-thru"}),(0,Vt.jsx)("cx-switch",{checked:s,onClick:e=>e.preventDefault()})]})]},"default-menu")]}),(0,Vt.jsxs)("cx-dropdown",{ref:_,"auto-width-factor":a?1:.5,"stay-open-on-select":!0,children:[(0,Vt.jsx)("div",{slot:"trigger",children:(0,Vt.jsx)("cx-tooltip",{content:"Sort",children:(0,Vt.jsx)("cx-icon-button",{name:"sort",label:"Sort",outline:!0,"data-cy":"sort-button"})})}),(0,Vt.jsxs)("cx-menu",{children:[(h?en.map((e=>{var t,n;const r=null===(t=h[d])||void 0===t||null===(n=t.find((t=>t.sortDirection.toLowerCase()===e.value.toLowerCase())))||void 0===n?void 0:n.sortDirectionDisplayName;return{...e,label:null!==r&&void 0!==r?r:e.value}})):en).map((e=>(0,Vt.jsxs)("cx-menu-item",{"data-type":"sort-direction",disabled:!t,value:e.value,class:t&&u===e.value?"selected":"",children:[e.label.replace(/\b\w/g,(e=>e.toUpperCase())),o&&"sortDirection"===y.type&&y.value===e.value?(0,Vt.jsx)("cx-spinner",{slot:"prefix"}):(0,Vt.jsx)(e.icon,{})]},e.value))),(0,Vt.jsx)("cx-divider",{}),Object.keys(null!==h&&void 0!==h?h:{}).map((e=>(0,Vt.jsxs)("cx-menu-item",{"data-type":"sort-order",value:e,class:d===e?"selected":"",children:[e.replace(/\b\w/g,(e=>e.toUpperCase())),o&&"sortOrder"===y.type&&y.value===e?(0,Vt.jsx)("cx-spinner",{slot:"prefix"}):(0,Vt.jsx)("cx-icon",{slot:"prefix",name:d===e?"check":""})]},e)))]})]})]})]})};var sn=n(8743);const ln=(e,t)=>{const n=(e,t)=>0===t?e:n(t,e%t),r=Math.round(e),o=Math.round(t),i=n(r,o);return{width:r/i,height:o/i}},cn=(e,t,n)=>{const r=n*Math.PI/180;if(n%90===0)return{width:n%180===0?e:t,height:n%180===0?t:e};const o=Math.abs(Math.cos(r)),i=Math.abs(Math.sin(r)),a=e*o+t*i,s=e*i+t*o;return{width:Math.round(a),height:Math.round(s)}};var un=function(e,t){return un=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},un(e,t)};function dn(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}un(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var hn=function(){return hn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},hn.apply(this,arguments)};Object.create;Object.create;"function"===typeof SuppressedError&&SuppressedError;var pn=n(1185),fn=n.n(pn);function mn(e,t,n,r,o){void 0===o&&(o=0);var i=Sn(t.width,t.height,o),a=i.width,s=i.height;return{x:gn(e.x,a,n.width,r),y:gn(e.y,s,n.height,r)}}function gn(e,t,n,r){var o=t*r/2-n/2;return kn(e,-o,o)}function vn(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function bn(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function yn(e,t){return Math.min(e,Math.max(0,t))}function xn(e,t){return t}function wn(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Sn(e,t,n){var r=n*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function kn(e,t,n){return Math.min(Math.max(e,t),n)}function _n(){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 Cn=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.cropperRef=wt.createRef(),n.imageRef=wt.createRef(),n.videoRef=wt.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!==typeof document?document:null,n.currentWindow="undefined"!==typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if("undefined"!==typeof window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,r,o,i){var a=Sn(t.width,t.height,n),s=kn(r.width/a.width*(100/e.width),o,i);return{crop:{x:s*a.width/2-r.width/2-a.width*s*(e.x/100),y:s*a.height/2-r.height/2-a.height*s*(e.y/100)},zoom:s}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),r=t.crop,o=t.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var i=function(e,t,n,r,o,i){void 0===n&&(n=0);var a=Sn(t.naturalWidth,t.naturalHeight,n),s=kn(function(e,t,n){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}(e,t,r),o,i),l=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((a.width-e.width)/2-e.x)*l,y:((a.height-e.height)/2-e.y)*l},zoom:s}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);r=i.crop,o=i.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var e,t,r,o,i,a,s=n.imageRef.current||n.videoRef.current;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var l=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=n.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef.current)||void 0===o?void 0:o.videoHeight)||0,d=c/u,h=void 0;if(s.offsetWidth<c||s.offsetHeight<u)switch(n.state.mediaObjectFit){default:case"contain":h=l>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":h={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":h={width:n.containerRect.height*d,height:n.containerRect.height}}else h={width:s.offsetWidth,height:s.offsetHeight};n.mediaSize=hn(hn({},h),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var p=n.props.cropSize?n.props.cropSize:function(e,t,n,r,o,i){void 0===i&&(i=0);var a=Sn(e,t,i),s=a.width,l=a.height,c=Math.min(s,n),u=Math.min(l,r);return c>u*o?{width:u*o,height:u}:{width:c,height:c/o}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===p.height&&(null===(a=n.state.cropSize)||void 0===a?void 0:a.width)===p.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(p),n.setState({cropSize:p},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(p),p}},n.saveContainerPosition=function(){if(n.containerRef){var e=n.containerRef.getBoundingClientRect();n.containerPosition={x:e.left,y:e.top}}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onScroll=function(e){n.currentDoc&&(e.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var r=t.getMousePoint(e),o=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(o,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=hn({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},a=n.props.restrictPosition?mn(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(a)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var r=t.getMousePoint(e),o=fn()(e).pixelY,i=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(i,r,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e,t){var r=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(r-t.x),y:n.containerRect.height/2-(o-t.y)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,i=o.crop,a=o.zoom;return{x:(t+i.x)/a,y:(r+i.y)/a}},n.setNewZoom=function(e,t,r){var o=(void 0===r?{}:r).shouldUpdatePosition,i=void 0===o||o;if(n.state.cropSize&&n.props.onZoomChange){var a=kn(e,n.props.minZoom,n.props.maxZoom);if(i){var s=n.getPointOnContainer(t,n.containerPosition),l=n.getPointOnMedia(s),c={x:l.x*a-s.x,y:l.y*a-s.y},u=n.props.restrictPosition?mn(c,n.mediaSize,n.state.cropSize,a,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(a)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,r,o,i,a){void 0===i&&(i=0),void 0===a&&(a=!0);var s=a?yn:xn,l=Sn(t.width,t.height,i),c=Sn(t.naturalWidth,t.naturalHeight,i),u={x:s(100,((l.width-n.width/o)/2-e.x/o)/l.width*100),y:s(100,((l.height-n.height/o)/2-e.y/o)/l.height*100),width:s(100,n.width/l.width*100/o),height:s(100,n.height/l.height*100/o)},d=Math.round(s(c.width,u.width*c.width/100)),h=Math.round(s(c.height,u.height*c.height/100)),p=c.width>=c.height*r?{width:Math.round(h*r),height:h}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:hn(hn({},p),{x:Math.round(s(c.width-p.width,u.x*c.width/100)),y:Math.round(s(c.height-p.height,u.y*c.height/100))})}}(n.props.restrictPosition?mn(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?mn(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n.onKeyDown=function(e){var t,r,o=n.props,i=o.crop,a=o.onCropChange,s=o.keyboardStep,l=o.zoom,c=o.rotation,u=s;if(n.state.cropSize){e.shiftKey&&(u*=.2);var d=hn({},i);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}n.props.restrictPosition&&(d=mn(d,n.mediaSize,n.state.cropSize,l,c)),e.repeat||null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t),a(d)}},n.onKeyUp=function(e){var t,r;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}n.emitCropData(),null===(r=(t=n.props).onInteractionEnd)||void 0===r||r.call(t)},n}return dn(t,e),t.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(),"undefined"===typeof 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))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&("undefined"===typeof 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())},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,a,s,l,c;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===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.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===(l=this.props.crop)||void 0===l?void 0:l.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===(c=this.videoRef.current)||void 0===c||c.load());var u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.getObjectFit=function(){var e,t,n,r;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var o=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===(n=this.imageRef.current)||void 0===n?void 0:n.naturalHeight)||(null===(r=this.videoRef.current)||void 0===r?void 0:r.videoHeight)||0)<o?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=vn(n,r),this.lastPinchRotation=bn(n,r),this.onDragStart(wn(n,r))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var r=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),i=wn(r,o);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=vn(r,o),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var a=bn(r,o),s=n.props.rotation+(a-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=a}))}},t.prototype.render=function(){var e,t=this,n=this.props,r=n.image,o=n.video,i=n.mediaProps,a=n.cropperProps,s=n.transform,l=n.crop,c=l.x,u=l.y,d=n.rotation,h=n.zoom,p=n.cropShape,f=n.showGrid,m=n.style,g=m.containerStyle,v=m.cropAreaStyle,b=m.mediaStyle,y=n.classes,x=y.containerClassName,w=y.cropAreaClassName,S=y.mediaClassName,k=null!==(e=this.state.mediaObjectFit)&&void 0!==e?e:this.getObjectFit();return wt.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef=e},"data-testid":"container",style:g,className:_n("reactEasyCrop_Container",x)},r?wt.createElement("img",hn({alt:"",className:_n("reactEasyCrop_Image","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical",S)},i,{src:r,ref:this.imageRef,style:hn(hn({},b),{transform:s||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(h,")")}),onLoad:this.onMediaLoad})):o&&wt.createElement("video",hn({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:_n("reactEasyCrop_Video","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical",S)},i,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:hn(hn({},b),{transform:s||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(h,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return wt.createElement("source",hn({key:e.src},e))}))),this.state.cropSize&&wt.createElement("div",hn({ref:this.cropperRef,style:hn(hn({},v),{width:this.state.cropSize.width,height:this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:_n("reactEasyCrop_CropArea","round"===p&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",w)},a)))},t.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},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(wt.Component);const En=(e,t,n,r)=>{const o=n/r;let i=e,a=t;return e/t>o?i=Math.round(a*o):a=Math.round(i/o),{width:i,height:a}},An=Lt.Ay.div`
200
200
  position: relative;
201
201
  width: 100%;
202
202
  height: 350px;
@@ -651,7 +651,7 @@
651
651
  .version__item__editor {
652
652
  color: var(--cx-color-primary);
653
653
  }
654
- `;var Yn=n(3943);const Jn=e=>{let{src:t,alt:n}=e;const[r,o]=(0,wt.useState)("horizontal"),i=(0,wt.useRef)(null),a=(0,wt.useCallback)((()=>{if(i.current){const{naturalWidth:e,naturalHeight:t}=i.current;o(e>t?"horizontal":"vertical")}}),[]);return(0,Vt.jsx)("div",{className:`version__item__preview version__item__preview--${r}`,children:(0,Vt.jsx)("img",{ref:i,src:t,alt:n,onLoad:a})})},er=e=>{let{src:t}=e;const[n,r]=(0,wt.useState)("horizontal"),o=(0,wt.useRef)(null),i=(0,wt.useCallback)((()=>{if(o.current){const{videoWidth:e,videoHeight:t}=o.current;r(e>t?"horizontal":"vertical")}}),[]);return(0,Vt.jsx)("div",{className:`version__item__preview version__item__preview--${n}`,children:(0,Vt.jsx)("video",{ref:o,src:t,onLoadedMetadata:i,controls:!0})})},tr=e=>{var t;let{assetId:n}=e;const{data:r,isFetching:o,isLoading:i}=(0,Yn.cP)(n?{assetId:n}:Ft.hT);return o||i?(0,Vt.jsx)(Zn,{children:(0,Vt.jsx)("cx-spinner",{})}):(0,Vt.jsx)(Zn,{children:(0,Vt.jsx)("cx-menu",{children:null===r||void 0===r||null===(t=r.versions)||void 0===t?void 0:t.map(((e,t)=>(0,Vt.jsx)("cx-menu-item",{className:"version__item",readonly:!0,children:(0,Vt.jsxs)("cx-grid",{columns:5,spacing:"12px",children:[(0,Vt.jsx)("cx-grid-item",{xs:"2",sm:"2",children:(0,Vt.jsxs)("cx-space",{direction:"horizontal","align-items":"center",wrap:"nowrap",children:[(0,Vt.jsx)("div",{className:"version__item__number",children:(0,Vt.jsx)("cx-line-clamp",{lines:1,children:e.versionNumberDisplay})}),e.scrubUrl?(0,Vt.jsx)(er,{src:e.scrubUrl}):(0,Vt.jsx)(Jn,{src:e.versionFileUrl,alt:e.versionFileName})]})}),(0,Vt.jsx)("cx-grid-item",{xs:"2",sm:"3",children:(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"2x-small",children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:(0,Vt.jsx)("cx-typography",{variant:"body3",className:"version__item__name",children:e.versionFileName})}),(0,Vt.jsx)("cx-line-clamp",{lines:1,children:(0,Vt.jsx)("cx-typography",{variant:"body3",children:e.createByEmail})}),(0,Vt.jsxs)("cx-typography",{variant:"body3",children:[e.versionCreateDate.split(" ")[0],0===t&&(0,Vt.jsx)("span",{className:"version__item__latest",children:"Current version"})]})]})})]})},e.versionNumber)))})})},nr=CSS.supports("(overlay: auto)")&&"showPopover"in document.createElement("div"),rr={previewLoadable:!1,defaultSize:{width:0,height:0},selectedProxy:"",selectedFormat:{url:"",originalUrl:"",width:0,height:0,x:0,y:0,extension:"",rotation:0},defaultSelectedFormat:{url:"",originalUrl:"",width:0,height:0,x:0,y:0,extension:"",rotation:0},resizeSize:{width:0,height:0,unit:sn.Nf.Pixel},lastResizeSize:{[sn.Nf.AspectRatio]:{width:0,height:0,unit:sn.Nf.AspectRatio},[sn.Nf.Pixel]:{width:0,height:0,unit:sn.Nf.Pixel}},cropSize:{width:0,height:0,percentageWidth:0,percentageHeight:0,x:0,y:0,unit:sn.Nf.Pixel},lastCropSize:{[sn.Nf.AspectRatio]:{width:0,height:0,percentageWidth:0,percentageHeight:0,x:0,y:0,unit:sn.Nf.AspectRatio},[sn.Nf.Pixel]:{width:0,height:0,percentageWidth:0,percentageHeight:0,x:0,y:0,unit:sn.Nf.Pixel}},isLoadingConfirm:!1,isLoadingFavorites:!1,rotation:0,quality:100,keepMetadata:!1,transformations:[],confirmedTransformations:[],enabledTracking:!1,trackingParameters:[{key:"UTM_source",value:""},{key:"UTM_campaign",value:""},{key:"UTM_description",value:""}],showCustomRendition:!1,showVersionHistory:!1,useCustomRendition:!1,useRepresentative:!1,activeSetting:"format",isLoading:!1},or=(e,t)=>{switch(t.type){case"CANCEL_USE_CUSTOM_RENDITION":return{...e,cropSize:{...e.cropSize,width:t.payload.width,height:t.payload.height},resizeSize:{...e.resizeSize,width:t.payload.width,height:t.payload.height},selectedFormat:{...e.selectedFormat,...t.payload,rotation:0,x:0,y:0},rotation:0,transformations:e.useCustomRendition?e.confirmedTransformations:[],showCustomRendition:!1,activeSetting:"format"};case"CONFIRM_USE_CUSTOM_RENDITION":return{...e,confirmedTransformations:e.transformations,cropSize:{...e.cropSize,width:e.selectedFormat.width,height:e.selectedFormat.height},resizeSize:{...e.resizeSize,width:e.selectedFormat.width,height:e.selectedFormat.height},rotation:0,activeSetting:"format",showCustomRendition:!1,useCustomRendition:!0,defaultSelectedFormat:{...e.selectedFormat}};case"SET_DEFAULT_SIZE":return{...e,defaultSize:{...e.defaultSize,...t.payload}};case"RESET_DATA":return rr;case"SET_ACTIVE_SETTING":return{...e,activeSetting:t.payload};case"SET_CROP_SIZE":return{...e,cropSize:{...e.cropSize,...t.payload}};case"SET_ENABLED_TRACKING":return{...e,enabledTracking:t.payload};case"SET_KEEP_METADATA":return{...e,keepMetadata:t.payload};case"SET_LAST_CROP_SIZE":return{...e,lastCropSize:{...e.lastCropSize,...t.payload}};case"SET_LAST_RESIZE_SIZE":return{...e,lastResizeSize:{...e.lastResizeSize,...t.payload}};case"SET_LOADING":return{...e,isLoading:t.payload};case"SET_LOADING_CONFIRM":return{...e,isLoadingConfirm:t.payload};case"SET_LOADING_FAVORITES":return{...e,isLoadingFavorites:t.payload};case"SET_PREVIEW_LOADABLE":return{...e,previewLoadable:t.payload};case"SET_QUALITY":return{...e,quality:t.payload};case"SET_RESIZE_SIZE":return{...e,resizeSize:{...e.resizeSize,...t.payload}};case"SET_ROTATION":return{...e,rotation:t.payload};case"SET_SELECTED_FORMAT":return{...e,selectedFormat:{...e.selectedFormat,...t.payload}};case"SET_SELECTED_PROXY":return t.payload?"string"===typeof t.payload?{...e,selectedProxy:t.payload,useCustomRendition:!1,useRepresentative:!1}:{...e,selectedProxy:t.payload.proxy,useCustomRendition:Boolean(t.payload.useCustomRendition),useRepresentative:!1}:{...e,selectedProxy:"",useCustomRendition:!1,useRepresentative:!1};case"SET_SHOW_CUSTOM_RENDITION":return{...e,selectedProxy:"",showCustomRendition:t.payload};case"SET_SHOW_VERSION_HISTORY":return{...e,showVersionHistory:t.payload};case"SET_TRACKING_PARAMETERS":return{...e,trackingParameters:t.payload};case"SET_TRANSFORMATIONS":return{...e,transformations:[...e.transformations,t.payload]};case"SET_USE_REPRESENTATIVE":return{...e,selectedProxy:t.payload?"":e.selectedProxy,useRepresentative:t.payload};default:return e}},ir=e=>{let{allowCustomFormat:t,allowFavorites:n,allowProxy:r,allowTracking:o,allowedExtensions:i,appendAutoExtension:a,autoExtension:s,availableExtensions:l,availableProxies:c,ctaText:u="Insert",extensions:d,isFavorite:h,maxHeight:p,open:f,previewUrl:m,selectedAsset:g,showVersions:v,supportedRepresentativeSubtypes:b,variant:y="dialog",boundary:x,onClose:w,onFavorite:S,onProxyConfirm:k,onFormatConfirm:_,onUnFavorite:C}=e;const[E,A]=(0,wt.useReducer)(or,rr),[T,O]=(0,wt.useState)(!1),P=(0,wt.useRef)(null),z=(0,wt.useRef)(null),D=(0,wt.useRef)(null),R=(0,wt.useMemo)((()=>i?c?c.filter((e=>{if(!e.extension&&g){return!!(null===i||void 0===i?void 0:i.some((e=>e===g.extension.replace(/^\./,""))))}return!0})):[]:c),[c,i,g]),j=(0,wt.useCallback)((()=>{if(!g)return;const e=ln(E.defaultSize.width,E.defaultSize.height);A({type:"SET_RESIZE_SIZE",payload:{...rr.resizeSize,width:E.defaultSize.width,height:E.defaultSize.height}}),A({type:"SET_CROP_SIZE",payload:{...rr.cropSize,width:E.defaultSize.width,height:E.defaultSize.height,percentageHeight:100,percentageWidth:100}}),A({type:"SET_ROTATION",payload:0}),A({type:"SET_LAST_CROP_SIZE",payload:{...rr.lastCropSize,[sn.Nf.Pixel]:{width:E.defaultSize.width,height:E.defaultSize.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:e.width,height:e.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.AspectRatio}}}),A({type:"SET_LAST_RESIZE_SIZE",payload:{[sn.Nf.Pixel]:{width:E.defaultSize.width,height:E.defaultSize.height,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:e.width,height:e.height,unit:sn.Nf.AspectRatio}}});let t=g.extension;if(a)t=s;else if(g.docType){var n,r,o,i;if(null!==l&&void 0!==l&&null!==(n=l[g.docType])&&void 0!==n&&n.map((e=>e.value)).includes(g.extension))t=g.extension;else t=null!==(r=null===l||void 0===l||null===(o=l[g.docType])||void 0===o||null===(i=o[0])||void 0===i?void 0:i.value)&&void 0!==r?r:""}var c;R&&R.length>0?(A({type:"SET_SELECTED_PROXY",payload:null===(c=R[0])||void 0===c?void 0:c.id}),A({type:"SET_SELECTED_FORMAT",payload:{...rr.selectedFormat,url:g.imageUrl,originalUrl:g.originalUrl,extension:t,width:R[0].formatWidth||E.defaultSize.width,height:R[0].formatHeight||E.defaultSize.height}})):A({type:"SET_SELECTED_FORMAT",payload:{...rr.selectedFormat,url:g.imageUrl,originalUrl:g.originalUrl,extension:t,width:E.defaultSize.width,height:E.defaultSize.height}})}),[s,R,g,E.defaultSize.height,E.defaultSize.width,a,l]);(0,wt.useEffect)((()=>{null!==g&&void 0!==g&&g.width&&null!==g&&void 0!==g&&g.height&&A({type:"SET_DEFAULT_SIZE",payload:{width:parseInt(g.width,10),height:parseInt(g.height,10)}})}),[null===g||void 0===g?void 0:g.width,null===g||void 0===g?void 0:g.height]),(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-dialog"),customElements.whenDefined("cx-drawer"),customElements.whenDefined("cx-dropdown")]).then((()=>{O(!0)}))}),[]),(0,wt.useEffect)((()=>{const e=e=>{E.isLoadingFavorites?e.preventDefault():E.showVersionHistory?(e.preventDefault(),A({type:"SET_SHOW_VERSION_HISTORY",payload:!1})):(A({type:"SET_PREVIEW_LOADABLE",payload:!1}),A({type:"RESET_DATA"}),w())},t=P.current,n=z.current;return null===t||void 0===t||t.addEventListener("cx-request-close",e),null===n||void 0===n||n.addEventListener("cx-request-close",e),()=>{null===t||void 0===t||t.removeEventListener("cx-request-close",e),null===n||void 0===n||n.removeEventListener("cx-request-close",e)}}),[x,T,w,E.isLoadingFavorites,E.showVersionHistory]),(0,wt.useEffect)((()=>{const e=P.current;e&&x&&(e.boundary=x)})),(0,wt.useEffect)((()=>{const e=()=>{A({type:"SET_PREVIEW_LOADABLE",payload:!0})},t=P.current,n=z.current;return null===t||void 0===t||t.addEventListener("cx-after-show",e),null===n||void 0===n||n.addEventListener("cx-after-show",e),()=>{null===t||void 0===t||t.removeEventListener("cx-after-show",e),null===n||void 0===n||n.removeEventListener("cx-after-show",e)}}),[T,E.showCustomRendition,y]),(0,wt.useEffect)((()=>{const e=e=>{const t=e.detail.item.value;if("custom"===t)return A({type:"SET_SHOW_CUSTOM_RENDITION",payload:!0}),void(E.useCustomRendition||j());if("tracking"!==t)if("use-representative"!==t){if(t&&R){if(!R.map((e=>e.id)).includes(t))return;A({type:"SET_SELECTED_PROXY",payload:t})}}else A({type:"SET_USE_REPRESENTATIVE",payload:!E.useRepresentative});else A({type:"SET_ENABLED_TRACKING",payload:!E.enabledTracking})},t=P.current,n=z.current;return null===t||void 0===t||t.addEventListener("cx-select",e),null===n||void 0===n||n.addEventListener("cx-select",e),()=>{null===t||void 0===t||t.removeEventListener("cx-select",e),null===n||void 0===n||n.removeEventListener("cx-select",e)}}),[T,E.enabledTracking,E.useCustomRendition,E.useRepresentative,j,R,null===g||void 0===g?void 0:g.extension]),(0,wt.useEffect)((()=>{j()}),[j]);const N=(0,wt.useMemo)((()=>{var e;return(null===b||void 0===b?void 0:b.includes(null!==(e=null===g||void 0===g?void 0:g.docSubType)&&void 0!==e?e:""))&&(null===g||void 0===g?void 0:g.imageUrl)}),[g,b]),I=(0,wt.useCallback)((e=>{A({type:"SET_LOADING",payload:e})}),[]),M=(0,wt.useCallback)((async(e,t,n,r)=>{if(!g)return;const o=E.selectedFormat.width||E.defaultSize.width,i=E.selectedFormat.height||E.defaultSize.height;if(A({type:"SET_RESIZE_SIZE",payload:{width:e,height:t,unit:n}}),r){var a;let r=e,s=t;E.resizeSize.unit!==n?(r=o,s=i):n===sn.Nf.AspectRatio&&(r=Math.round(e/t*i),s=i);const l=await(null===(a=D.current)||void 0===a?void 0:a.applyResize());A({type:"SET_SELECTED_FORMAT",payload:{url:l,width:r,height:s}}),A({type:"SET_TRANSFORMATIONS",payload:{key:sn.YQ.Resize,value:{width:r,height:s}}}),A({type:"SET_CROP_SIZE",payload:{width:r,height:s}});const c=ln(r,s);A({type:"SET_LAST_RESIZE_SIZE",payload:{[sn.Nf.Pixel]:{width:r,height:s,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:n===sn.Nf.AspectRatio?e:c.width,height:n===sn.Nf.AspectRatio?t:c.height,unit:sn.Nf.AspectRatio}}}),A({type:"SET_LAST_CROP_SIZE",payload:{[sn.Nf.Pixel]:{width:r,height:s,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:n===sn.Nf.AspectRatio?e:c.width,height:n===sn.Nf.AspectRatio?t:c.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.AspectRatio}}})}}),[g,E.defaultSize.height,E.defaultSize.width,E.resizeSize.unit,E.selectedFormat.height,E.selectedFormat.width]),F=(0,wt.useCallback)((async(e,t,n,r)=>{var o,i;if(!g)return;const a=E.cropSize.unit,s=D.current;if(s&&null!==(o=E.selectedFormat)&&void 0!==o&&o.width&&null!==(i=E.selectedFormat)&&void 0!==i&&i.height){if(n===a&&n===sn.Nf.Pixel){const n=Math.max(e/E.selectedFormat.width,t/E.selectedFormat.height);s.setZoom(1/n)}n!==a&&s.setZoom(1)}if(A({type:"SET_CROP_SIZE",payload:{width:e,height:t,unit:n}}),r){var l;const r=await(null===(l=D.current)||void 0===l?void 0:l.applyCrop());let o=e,i=t;n===sn.Nf.AspectRatio&&(o=Math.round(E.cropSize.percentageWidth*E.selectedFormat.width/100),i=Math.round(E.cropSize.percentageHeight*E.selectedFormat.height/100)),null===s||void 0===s||s.setZoom(1);const a=Number((E.cropSize.x/100*E.selectedFormat.width).toFixed(0)),c=Number((E.cropSize.y/100*E.selectedFormat.height).toFixed(0));A({type:"SET_SELECTED_FORMAT",payload:{url:r,width:o,height:i}}),A({type:"SET_RESIZE_SIZE",payload:{width:o,height:i,unit:sn.Nf.Pixel}}),A({type:"SET_TRANSFORMATIONS",payload:{key:sn.YQ.Crop,value:{width:Number(o.toFixed(0)),height:Number(i.toFixed(0)),x:a,y:c}}});const u=ln(o,i);A({type:"SET_LAST_CROP_SIZE",payload:{[sn.Nf.Pixel]:{width:Math.round(o),height:Math.round(i),percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:n===sn.Nf.AspectRatio?e:u.width,height:n===sn.Nf.AspectRatio?t:u.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.AspectRatio}}}),A({type:"SET_LAST_RESIZE_SIZE",payload:{[sn.Nf.Pixel]:{width:o,height:i,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:n===sn.Nf.AspectRatio?e:u.width,height:n===sn.Nf.AspectRatio?t:u.height,unit:sn.Nf.AspectRatio}}})}}),[g,E.cropSize,E.selectedFormat.height,E.selectedFormat.width]),L=(0,wt.useCallback)((async(e,t)=>{if(A({type:"SET_ROTATION",payload:t?0:e}),t){var n;const{width:t,height:r}=cn(E.selectedFormat.width,E.selectedFormat.height,e),o=await(null===(n=D.current)||void 0===n?void 0:n.applyRotation());A({type:"SET_SELECTED_FORMAT",payload:{rotation:e,url:o,width:t,height:r}}),A({type:"SET_TRANSFORMATIONS",payload:{key:sn.YQ.Rotate,value:{rotation:e}}}),A({type:"SET_CROP_SIZE",payload:{width:t,height:r}}),A({type:"SET_RESIZE_SIZE",payload:{width:t,height:r,unit:sn.Nf.Pixel}});const i=ln(t,r);A({type:"SET_LAST_CROP_SIZE",payload:{[sn.Nf.Pixel]:{width:t,height:r,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:i.width,height:i.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.AspectRatio}}}),A({type:"SET_LAST_RESIZE_SIZE",payload:{[sn.Nf.Pixel]:{width:t,height:r,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:i.width,height:i.height,unit:sn.Nf.AspectRatio}}})}}),[E.selectedFormat]),B=(0,wt.useCallback)((e=>{A({type:"SET_SELECTED_FORMAT",payload:{extension:e}})}),[]),U=(0,wt.useCallback)((e=>{A({type:"SET_CROP_SIZE",payload:{width:E.selectedFormat.width,height:E.selectedFormat.height,unit:sn.Nf.Pixel}}),A({type:"SET_RESIZE_SIZE",payload:{width:E.selectedFormat.width,height:E.selectedFormat.height,unit:sn.Nf.Pixel}}),A({type:"SET_ROTATION",payload:0}),A({type:"SET_ACTIVE_SETTING",payload:e})}),[E.selectedFormat]),V=(0,wt.useCallback)((()=>{A({type:"SET_SHOW_VERSION_HISTORY",payload:!0})}),[]),q=(0,wt.useCallback)((e=>{let t=e.formatWidth,n=e.formatHeight;"TRX"===e.proxyName&&g&&(t=Number(g.width),n=Number(g.height)),A({type:"SET_SELECTED_PROXY",payload:{proxy:e.id,useCustomRendition:!0}}),A({type:"SET_SELECTED_FORMAT",payload:{width:t,height:n}}),A({type:"SET_RESIZE_SIZE",payload:{width:t,height:n,unit:sn.Nf.Pixel}}),A({type:"SET_CROP_SIZE",payload:{width:t,height:n,percentageWidth:100,percentageHeight:100,x:0,y:0,unit:sn.Nf.Pixel}});const r=ln(t,n);A({type:"SET_LAST_CROP_SIZE",payload:{[sn.Nf.Pixel]:{width:Math.round(t),height:Math.round(n),percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:r.width,height:r.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.AspectRatio}}}),A({type:"SET_LAST_RESIZE_SIZE",payload:{[sn.Nf.Pixel]:{width:t,height:n,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:r.width,height:r.height,unit:sn.Nf.AspectRatio}}})}),[g]),H=(0,wt.useCallback)((e=>{A({type:"SET_QUALITY",payload:e}),A({type:"SET_TRANSFORMATIONS",payload:{key:sn.YQ.Quality,value:{quality:e}}})}),[]),W=(0,wt.useCallback)((e=>{A({type:"SET_KEEP_METADATA",payload:e}),A({type:"SET_TRANSFORMATIONS",payload:{key:sn.YQ.KeepMetadata,value:{keepMetadata:e}}})}),[]);(0,wt.useEffect)((()=>{R&&0!==R.length?A({type:"SET_SELECTED_PROXY",payload:R[0].id}):A({type:"SET_SELECTED_PROXY",payload:""})}),[R,g]);const K=(0,wt.useCallback)((()=>{const e=E.isLoading||!E.selectedProxy&&!E.useCustomRendition&&!E.useRepresentative,i=(l&&null!==g&&void 0!==g&&g.docType?(0,an.A)([...l[g.docType],{displayName:"Automatic",value:s}],"value"):[{displayName:"Automatic",value:s}]).filter((e=>a||e.value!==s)),c=t&&i.length>0&&d.includes(g?g.extension:""),p=R&&Object.values(R).flat().length>0,f=Boolean(E.selectedFormat.width&&E.selectedFormat.height&&E.useCustomRendition);return(0,Vt.jsxs)(Vt.Fragment,{children:[E.showVersionHistory?(0,Vt.jsx)("cx-space",{slot:"label","justify-content":"space-between","align-items":"center",children:(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"2x-small",style:{flex:"1"},children:[(0,Vt.jsx)("cx-typography",{variant:"h4",children:"Version history"}),(0,Vt.jsx)("cx-typography",{variant:"body3",className:"asset-name",children:(0,Vt.jsx)("cx-line-clamp",{lines:1,children:null===g||void 0===g?void 0:g.name})})]})}):(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)("cx-space",{slot:"label","justify-content":"space-between","align-items":"center",children:(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"2x-small",style:{flex:"1"},children:[(0,Vt.jsx)("cx-typography",{variant:"h4",children:r?"Custom format":"Preview"}),(0,Vt.jsx)("cx-typography",{variant:"body3",className:"asset-name",children:(0,Vt.jsx)("cx-line-clamp",{lines:1,children:null===g||void 0===g?void 0:g.name})})]})}),n&&(0,Vt.jsx)("cx-tooltip",{slot:"header-actions",content:h?"Unfavorite":"Favorite",placement:"bottom",children:E.isLoadingFavorites?(0,Vt.jsx)("cx-space",{"align-items":"center","justify-content":"center",style:{width:"32px",height:"32px"},children:(0,Vt.jsx)("cx-spinner",{})}):(0,Vt.jsx)("cx-icon-button",{name:h?"star":"star_outline",style:{color:h?"var(--cx-color-warning)":"var(--cx-color-text)"},onClick:async()=>{E.isLoadingFavorites||(A({type:"SET_LOADING_FAVORITES",payload:!0}),h?await C():await S(),A({type:"SET_LOADING_FAVORITES",payload:!1}))}})}),v&&(0,Vt.jsx)("cx-tooltip",{slot:"header-actions",content:"Version history",placement:"bottom",children:(0,Vt.jsx)("cx-icon-button",{name:"history",onClick:V})})]}),(()=>{let e=null,t=null;if(e=E.selectedFormat.width&&E.selectedFormat.height&&(null===g||void 0===g?void 0:g.docType)===Qt.zu.Image?(0,Vt.jsx)(Tn,{ref:D,loadable:E.previewLoadable,image:E.selectedFormat,selectedProxy:E.selectedProxy,resizer:E.resizeSize,cropper:E.cropSize,rotation:E.rotation,disabled:"crop"!==E.activeSetting||!E.showCustomRendition,onCropComplete:e=>{A({type:"SET_CROP_SIZE",payload:{percentageWidth:e.width,percentageHeight:e.height,x:e.x,y:e.y}})},onLoadingChange:I}):(0,Vt.jsx)($n,{loadable:E.previewLoadable,asset:{docType:null===g||void 0===g?void 0:g.docType,imageUrl:null===g||void 0===g?void 0:g.imageUrl,videoUrl:m,extension:null===g||void 0===g?void 0:g.extension},onLoad:e=>{if(null!==g&&void 0!==g&&g.width&&null!==g&&void 0!==g&&g.height||null===g||void 0===g||!g.imageUrl)return;const t=null!==g&&void 0!==g&&g.width?parseInt(g.width,10):e.width,n=null!==g&&void 0!==g&&g.height?parseInt(g.height,10):e.height;A({type:"SET_DEFAULT_SIZE",payload:{width:t,height:n}})}}),E.showVersionHistory)return(0,Vt.jsx)(tr,{assetId:null===g||void 0===g?void 0:g.id});if(!r)return e;var n;E.showCustomRendition&&R?t=(0,Vt.jsx)(Vn,{activeSetting:E.activeSetting,extensions:i,availableProxies:R,imageSize:{width:E.selectedFormat.width?E.selectedFormat.width:1/0,height:E.selectedFormat.height?E.selectedFormat.height:1/0},resize:{width:E.resizeSize.width,height:E.resizeSize.height,unit:E.resizeSize.unit},crop:E.cropSize,keepMetadata:E.keepMetadata,lastAppliedCrop:E.lastCropSize,lastAppliedResize:E.lastResizeSize,proxy:E.selectedProxy,quality:E.quality,rotation:E.rotation,extension:E.selectedFormat.extension,onCropChange:F,onExtensionChange:B,onFormatChange:q,onKeepMetadataChange:W,onQualityChange:H,onResizeChange:M,onRotateChange:L,onViewChange:U}):t=(0,Vt.jsx)("cx-space",{direction:"vertical",spacing:"small",children:p||c?(0,Vt.jsxs)("div",{style:{width:"100%"},children:[p&&(0,Vt.jsx)(Xn,{items:null===R||void 0===R?void 0:R.map((e=>{var t;return"TRX"===e.proxyName&&g?{value:e.id,name:e.proxyLabel,cdnName:e.cdnName,width:g.width,height:g.height,extension:g.extension,docType:g.docType}:{value:e.id,name:e.proxyLabel,cdnName:e.cdnName,width:String(e.formatWidth),height:String(e.formatHeight),extension:null!==(t=e.extension)&&void 0!==t?t:void 0,docType:null===g||void 0===g?void 0:g.docType}})),selectedDisabled:E.useCustomRendition,selectedItem:E.selectedProxy,children:N&&(0,Vt.jsxs)("cx-menu-item",{value:"use-representative",children:[(0,Vt.jsx)("cx-typography",{variant:"body3",className:"proxy__name "+(E.useRepresentative?"selected":""),children:"Representative image"}),(0,Vt.jsx)("cx-icon",{slot:"suffix",name:E.useRepresentative?"check":""})]})}),c&&(0,Vt.jsx)(Xn,{items:[],selectedItem:E.selectedProxy,style:{borderTopWidth:"0"},children:(0,Vt.jsxs)("cx-menu-item",{value:"custom","data-cy":"custom-rendition-menu-item",children:[(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"crop_rotate",className:"icon--large"}),(0,Vt.jsxs)("div",{children:[(0,Vt.jsx)("cx-typography",{variant:"body3",className:"proxy__name "+(E.useCustomRendition?"selected":""),children:"Custom format"}),f?(0,Vt.jsxs)("cx-typography",{variant:"body3",className:"proxy__details",children:[E.selectedFormat.width," x"," ",E.selectedFormat.height,E.selectedFormat.extension&&(0,Vt.jsx)("div",{className:"proxy__extension-dot"}),null===(n=E.selectedFormat.extension)||void 0===n?void 0:n.replace(/^\./,"").toUpperCase()]}):null]}),(0,Vt.jsx)("cx-icon",{slot:"suffix",name:E.useCustomRendition?"edit":"",className:"icon--large"}),(0,Vt.jsx)("cx-icon",{slot:"suffix",name:E.useCustomRendition?"check":"",className:"icon--large icon--primary"})]})}),o&&(0,Vt.jsxs)("div",{style:{backgroundColor:"var(--cx-color-neutral-0)",width:"100%"},children:[(0,Vt.jsx)(Xn,{children:(0,Vt.jsxs)("cx-menu-item",{value:"tracking",className:"proxy--switch",children:[(0,Vt.jsx)("cx-typography",{variant:"body3",className:"proxy__name",children:"Tracking parameters"}),(0,Vt.jsx)("cx-switch",{checked:E.enabledTracking,onClick:e=>e.preventDefault()})]})}),E.enabledTracking&&(0,Vt.jsx)(Gn,{values:E.trackingParameters,onChange:e=>A({type:"SET_TRACKING_PARAMETERS",payload:e})})]})]}):(0,Vt.jsxs)("cx-space",{"align-items":"center",spacing:"large",wrap:"nowrap",style:{backgroundColor:"var(--cx-color-neutral-0)",width:"100%",padding:"var(--cx-spacing-medium)",gap:"20px"},children:[(0,Vt.jsx)("cx-icon",{style:{color:"var(--cx-color-warning)"},name:"warning",className:"ic_warning_amber"}),(0,Vt.jsx)("cx-typography",{variant:"body3",className:"proxy__name",children:"There are no available options for this asset. This might be due to your permissions or the application's settings."})]})});return(0,Vt.jsxs)(Vt.Fragment,{children:[e,t]})})(),(()=>{if(E.showVersionHistory)return null;let t=null;return t=r?E.showCustomRendition?(0,Vt.jsxs)("cx-space",{spacing:"small",style:{width:"fit-content"},children:[(0,Vt.jsx)("cx-button",{variant:"default",onClick:()=>{var e,t,n,r,o;E.useCustomRendition?A({type:"CANCEL_USE_CUSTOM_RENDITION",payload:{url:E.defaultSelectedFormat.url,originalUrl:E.defaultSelectedFormat.originalUrl,width:E.defaultSelectedFormat.width,height:E.defaultSelectedFormat.height,extension:E.defaultSelectedFormat.extension,useCustomRendition:!0}}):A({type:"CANCEL_USE_CUSTOM_RENDITION",payload:{url:null!==(e=null===g||void 0===g?void 0:g.imageUrl)&&void 0!==e?e:"",originalUrl:null!==(t=null===g||void 0===g?void 0:g.originalUrl)&&void 0!==t?t:"",width:parseInt(null!==(n=null===g||void 0===g?void 0:g.width)&&void 0!==n?n:"0",10),height:parseInt(null!==(r=null===g||void 0===g?void 0:g.height)&&void 0!==r?r:"0",10),extension:null!==(o=null===g||void 0===g?void 0:g.extension)&&void 0!==o?o:"",useCustomRendition:!1}})},children:"Cancel"}),(0,Vt.jsx)("cx-button",{variant:"primary",onClick:()=>{A({type:"CONFIRM_USE_CUSTOM_RENDITION"})},children:"Done"})]}):(0,Vt.jsx)("cx-button",{className:"dialog__footer__button",disabled:e,loading:E.isLoadingConfirm,variant:"primary",style:{flex:1},onClick:async()=>{const e=null===R||void 0===R?void 0:R.find((e=>e.id===E.selectedProxy));if(E.useCustomRendition){var t,n,r,o,i,a,s,l,c,u,d,h,p,f,m;if(null===g||void 0===g||!g.docType)return;A({type:"SET_LOADING_CONFIRM",payload:!0}),await _({value:E.transformations,parameters:E.enabledTracking?E.trackingParameters:void 0,proxiesPreference:null===e||void 0===e?void 0:e.proxyName,extension:E.selectedFormat.extension,sourceProxyMetadata:{cdnName:null!==(t=null===e||void 0===e?void 0:e.cdnName)&&void 0!==t?t:null,extension:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?g.extension:null!==(n=null===e||void 0===e?void 0:e.extension)&&void 0!==n?n:null,isCustomFormat:null,width:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?parseInt(null!==(r=g.width)&&void 0!==r?r:"0",10):null!==(o=null===e||void 0===e?void 0:e.formatWidth)&&void 0!==o?o:null,height:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?parseInt(null!==(i=g.height)&&void 0!==i?i:"0",10):null!==(a=null===e||void 0===e?void 0:e.formatHeight)&&void 0!==a?a:null,permanentLink:null!==(s=null===e||void 0===e?void 0:e.permanentLink)&&void 0!==s?s:null,proxyLabel:null!==(l=null===e||void 0===e?void 0:e.proxyLabel)&&void 0!==l?l:null,proxyName:null!==(c=null===e||void 0===e?void 0:e.proxyName)&&void 0!==c?c:null},transformedAssetMetadata:{extension:null!==(u=null===(d=E.selectedFormat)||void 0===d?void 0:d.extension)&&void 0!==u?u:null,isCustomFormat:!0,height:null!==(h=null===(p=E.selectedFormat)||void 0===p?void 0:p.height)&&void 0!==h?h:null,width:null!==(f=null===(m=E.selectedFormat)||void 0===m?void 0:m.width)&&void 0!==f?f:null,permanentLink:null}}),A({type:"SET_LOADING_CONFIRM",payload:!1})}else{var v,b,y,x,S,C,T,O,P,z,D,j;if(null===g||void 0===g||!g.docType)return;if(!e&&!E.useRepresentative)return;A({type:"SET_LOADING_CONFIRM",payload:!0}),await k({extension:null!==(v=null===e||void 0===e?void 0:e.extension)&&void 0!==v?v:g.extension,value:null!==(b=null===e||void 0===e?void 0:e.proxyName)&&void 0!==b?b:"",permanentLink:null!==(y=null===e||void 0===e?void 0:e.permanentLink)&&void 0!==y?y:void 0,parameters:E.enabledTracking?E.trackingParameters:void 0,useRepresentative:E.useRepresentative,selectedProxyMetadata:{cdnName:null!==(x=null===e||void 0===e?void 0:e.cdnName)&&void 0!==x?x:null,extension:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?g.extension:null!==(S=null===e||void 0===e?void 0:e.extension)&&void 0!==S?S:null,isCustomFormat:!1,width:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?parseInt(null!==(C=g.width)&&void 0!==C?C:"0",10):null!==(T=null===e||void 0===e?void 0:e.formatWidth)&&void 0!==T?T:null,height:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?parseInt(null!==(O=g.height)&&void 0!==O?O:"0",10):null!==(P=null===e||void 0===e?void 0:e.formatHeight)&&void 0!==P?P:null,permanentLink:null!==(z=null===e||void 0===e?void 0:e.permanentLink)&&void 0!==z?z:null,proxyLabel:null!==(D=null===e||void 0===e?void 0:e.proxyLabel)&&void 0!==D?D:null,proxyName:null!==(j=null===e||void 0===e?void 0:e.proxyName)&&void 0!==j?j:null}}),A({type:"SET_LOADING_CONFIRM",payload:!1})}A({type:"RESET_DATA"}),w()},children:null!==u&&void 0!==u?u:"Insert"}):(0,Vt.jsxs)("cx-button",{className:"dialog__footer__button",loading:E.isLoadingConfirm,onClick:async()=>{null!==g&&void 0!==g&&g.docType&&(A({type:"SET_LOADING_CONFIRM",payload:!0}),await k({extension:g.extension,useRepresentative:!0,value:""}),A({type:"SET_LOADING_CONFIRM",payload:!1}))},variant:"primary",children:[(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"folder"}),u]}),(0,Vt.jsx)("div",{slot:"footer",className:"dialog__footer",children:t})})()]})}),[t,n,r,o,a,s,l,u,d,R,V,h,m,g,v,E,N,w,F,B,S,q,_,W,I,k,H,M,L,C,U]);return"drawer"===y?(0,Vt.jsx)(Hn,{ref:z,className:"dialog",label:"Drawer",placement:"bottom",contained:!0,open:f,children:K()}):(0,Vt.jsx)(qn,{ref:P,className:"dialog",open:f,"use-overlay-scrollbar":nr||void 0,style:{"--max-height":`${p}px`,"--max-width":E.showVersionHistory?"600px":"520px"},children:K()})};var ar=n(5650);const sr=(0,Lt.Ay)("cx-space")`
654
+ `;var Yn=n(3943);const Jn=e=>{let{src:t,alt:n}=e;const[r,o]=(0,wt.useState)("horizontal"),i=(0,wt.useRef)(null),a=(0,wt.useCallback)((()=>{if(i.current){const{naturalWidth:e,naturalHeight:t}=i.current;o(e>t?"horizontal":"vertical")}}),[]);return(0,Vt.jsx)("div",{className:`version__item__preview version__item__preview--${r}`,children:(0,Vt.jsx)("img",{ref:i,src:t,alt:n,onLoad:a})})},er=e=>{let{src:t}=e;const[n,r]=(0,wt.useState)("horizontal"),o=(0,wt.useRef)(null),i=(0,wt.useCallback)((()=>{if(o.current){const{videoWidth:e,videoHeight:t}=o.current;r(e>t?"horizontal":"vertical")}}),[]);return(0,Vt.jsx)("div",{className:`version__item__preview version__item__preview--${n}`,children:(0,Vt.jsx)("video",{ref:o,src:t,onLoadedMetadata:i,controls:!0})})},tr=e=>{var t;let{assetId:n}=e;const{data:r,isFetching:o,isLoading:i}=(0,Yn.cP)(n?{assetId:n}:Ft.hT);return o||i?(0,Vt.jsx)(Zn,{children:(0,Vt.jsx)("cx-spinner",{})}):(0,Vt.jsx)(Zn,{children:(0,Vt.jsx)("cx-menu",{children:null===r||void 0===r||null===(t=r.versions)||void 0===t?void 0:t.map(((e,t)=>(0,Vt.jsx)("cx-menu-item",{className:"version__item",readonly:!0,children:(0,Vt.jsxs)("cx-grid",{columns:5,spacing:"12px",children:[(0,Vt.jsx)("cx-grid-item",{xs:"2",sm:"2",children:(0,Vt.jsxs)("cx-space",{direction:"horizontal","align-items":"center",wrap:"nowrap",children:[(0,Vt.jsx)("div",{className:"version__item__number",children:(0,Vt.jsx)("cx-line-clamp",{lines:1,children:e.versionNumberDisplay})}),e.scrubUrl?(0,Vt.jsx)(er,{src:e.scrubUrl}):(0,Vt.jsx)(Jn,{src:e.versionFileUrl,alt:e.versionFileName})]})}),(0,Vt.jsx)("cx-grid-item",{xs:"2",sm:"3",children:(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"2x-small",children:[(0,Vt.jsx)("cx-line-clamp",{lines:1,children:(0,Vt.jsx)("cx-typography",{variant:"body3",className:"version__item__name",children:e.versionFileName})}),(0,Vt.jsx)("cx-line-clamp",{lines:1,children:(0,Vt.jsx)("cx-typography",{variant:"body3",children:e.createByEmail})}),(0,Vt.jsxs)("cx-typography",{variant:"body3",children:[e.versionCreateDate.split(" ")[0],0===t&&(0,Vt.jsx)("span",{className:"version__item__latest",children:"Current version"})]})]})})]})},e.versionNumber)))})})},nr=CSS.supports("(overlay: auto)")&&"showPopover"in document.createElement("div"),rr={previewLoadable:!1,defaultSize:{width:0,height:0},selectedProxy:"",defaultSelectedProxy:"",selectedFormat:{url:"",originalUrl:"",width:0,height:0,x:0,y:0,extension:"",rotation:0},defaultSelectedFormat:{url:"",originalUrl:"",width:0,height:0,x:0,y:0,extension:"",rotation:0},resizeSize:{width:0,height:0,unit:sn.Nf.Pixel},lastResizeSize:{[sn.Nf.AspectRatio]:{width:0,height:0,unit:sn.Nf.AspectRatio},[sn.Nf.Pixel]:{width:0,height:0,unit:sn.Nf.Pixel}},cropSize:{width:0,height:0,percentageWidth:0,percentageHeight:0,x:0,y:0,unit:sn.Nf.Pixel},lastCropSize:{[sn.Nf.AspectRatio]:{width:0,height:0,percentageWidth:0,percentageHeight:0,x:0,y:0,unit:sn.Nf.AspectRatio},[sn.Nf.Pixel]:{width:0,height:0,percentageWidth:0,percentageHeight:0,x:0,y:0,unit:sn.Nf.Pixel}},isLoadingConfirm:!1,isLoadingFavorites:!1,rotation:0,quality:100,keepMetadata:!1,transformations:[],confirmedTransformations:[],enabledTracking:!1,trackingParameters:[{key:"UTM_source",value:""},{key:"UTM_campaign",value:""},{key:"UTM_description",value:""}],showCustomRendition:!1,showVersionHistory:!1,useCustomRendition:!1,useRepresentative:!1,activeSetting:"format",isLoading:!1},or=(e,t)=>{switch(t.type){case"CANCEL_USE_CUSTOM_RENDITION":return{...e,cropSize:{...e.cropSize,width:t.payload.width,height:t.payload.height},resizeSize:{...e.resizeSize,width:t.payload.width,height:t.payload.height},selectedFormat:{...e.selectedFormat,...t.payload,rotation:0,x:0,y:0},rotation:0,transformations:e.useCustomRendition?e.confirmedTransformations:[],showCustomRendition:!1,activeSetting:"format",selectedProxy:t.payload.selectedProxy};case"CONFIRM_USE_CUSTOM_RENDITION":return{...e,confirmedTransformations:e.transformations,cropSize:{...e.cropSize,width:e.selectedFormat.width,height:e.selectedFormat.height},resizeSize:{...e.resizeSize,width:e.selectedFormat.width,height:e.selectedFormat.height},rotation:0,activeSetting:"format",showCustomRendition:!1,useCustomRendition:!0,defaultSelectedFormat:{...e.selectedFormat},defaultSelectedProxy:e.selectedProxy};case"SET_DEFAULT_SIZE":return{...e,defaultSize:{...e.defaultSize,...t.payload}};case"RESET_DATA":return rr;case"SET_ACTIVE_SETTING":return{...e,activeSetting:t.payload};case"SET_CROP_SIZE":return{...e,cropSize:{...e.cropSize,...t.payload}};case"SET_ENABLED_TRACKING":return{...e,enabledTracking:t.payload};case"SET_KEEP_METADATA":return{...e,keepMetadata:t.payload};case"SET_LAST_CROP_SIZE":return{...e,lastCropSize:{...e.lastCropSize,...t.payload}};case"SET_LAST_RESIZE_SIZE":return{...e,lastResizeSize:{...e.lastResizeSize,...t.payload}};case"SET_LOADING":return{...e,isLoading:t.payload};case"SET_LOADING_CONFIRM":return{...e,isLoadingConfirm:t.payload};case"SET_LOADING_FAVORITES":return{...e,isLoadingFavorites:t.payload};case"SET_PREVIEW_LOADABLE":return{...e,previewLoadable:t.payload};case"SET_QUALITY":return{...e,quality:t.payload};case"SET_RESIZE_SIZE":return{...e,resizeSize:{...e.resizeSize,...t.payload}};case"SET_ROTATION":return{...e,rotation:t.payload};case"SET_SELECTED_FORMAT":return{...e,selectedFormat:{...e.selectedFormat,...t.payload}};case"SET_SELECTED_PROXY":return t.payload?"string"===typeof t.payload?{...e,selectedProxy:t.payload,useCustomRendition:!1,useRepresentative:!1}:{...e,selectedProxy:t.payload.proxy,useCustomRendition:Boolean(t.payload.useCustomRendition),useRepresentative:!1}:{...e,selectedProxy:"",useCustomRendition:!1,useRepresentative:!1};case"SET_SHOW_CUSTOM_RENDITION":return{...e,showCustomRendition:t.payload};case"SET_SHOW_VERSION_HISTORY":return{...e,showVersionHistory:t.payload};case"SET_TRACKING_PARAMETERS":return{...e,trackingParameters:t.payload};case"SET_TRANSFORMATIONS":return{...e,transformations:[...e.transformations,t.payload]};case"SET_USE_REPRESENTATIVE":return{...e,selectedProxy:t.payload?"":e.selectedProxy,useRepresentative:t.payload};default:return e}},ir=e=>{let{allowCustomFormat:t,allowFavorites:n,allowProxy:r,allowTracking:o,allowedExtensions:i,appendAutoExtension:a,autoExtension:s,availableExtensions:l,availableProxies:c,ctaText:u="Insert",extensions:d,isFavorite:h,maxHeight:p,open:f,previewUrl:m,selectedAsset:g,showVersions:v,supportedRepresentativeSubtypes:b,variant:y="dialog",boundary:x,onClose:w,onFavorite:S,onProxyConfirm:k,onFormatConfirm:_,onUnFavorite:C}=e;const[E,A]=(0,wt.useReducer)(or,rr),[T,O]=(0,wt.useState)(!1),P=(0,wt.useRef)(null),z=(0,wt.useRef)(null),D=(0,wt.useRef)(null),R=(0,wt.useMemo)((()=>i?c?c.filter((e=>{if(!e.extension&&g){return!!(null===i||void 0===i?void 0:i.some((e=>e===g.extension.replace(/^\./,""))))}return!0})):[]:c),[c,i,g]),j=(0,wt.useCallback)((()=>{if(!g)return;const e=ln(E.defaultSize.width,E.defaultSize.height);A({type:"SET_RESIZE_SIZE",payload:{...rr.resizeSize,width:E.defaultSize.width,height:E.defaultSize.height}}),A({type:"SET_CROP_SIZE",payload:{...rr.cropSize,width:E.defaultSize.width,height:E.defaultSize.height,percentageHeight:100,percentageWidth:100}}),A({type:"SET_ROTATION",payload:0}),A({type:"SET_LAST_CROP_SIZE",payload:{...rr.lastCropSize,[sn.Nf.Pixel]:{width:E.defaultSize.width,height:E.defaultSize.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:e.width,height:e.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.AspectRatio}}}),A({type:"SET_LAST_RESIZE_SIZE",payload:{[sn.Nf.Pixel]:{width:E.defaultSize.width,height:E.defaultSize.height,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:e.width,height:e.height,unit:sn.Nf.AspectRatio}}});let t=g.extension;if(a)t=s;else if(g.docType){var n,r,o,i;if(null!==l&&void 0!==l&&null!==(n=l[g.docType])&&void 0!==n&&n.map((e=>e.value)).includes(g.extension))t=g.extension;else t=null!==(r=null===l||void 0===l||null===(o=l[g.docType])||void 0===o||null===(i=o[0])||void 0===i?void 0:i.value)&&void 0!==r?r:""}var c;R&&R.length>0?(A({type:"SET_SELECTED_PROXY",payload:null===(c=R[0])||void 0===c?void 0:c.id}),A({type:"SET_SELECTED_FORMAT",payload:{...rr.selectedFormat,url:g.imageUrl,originalUrl:g.originalUrl,extension:t,width:R[0].formatWidth||E.defaultSize.width,height:R[0].formatHeight||E.defaultSize.height}})):A({type:"SET_SELECTED_FORMAT",payload:{...rr.selectedFormat,url:g.imageUrl,originalUrl:g.originalUrl,extension:t,width:E.defaultSize.width,height:E.defaultSize.height}})}),[s,R,g,E.defaultSize.height,E.defaultSize.width,a,l]);(0,wt.useEffect)((()=>{null!==g&&void 0!==g&&g.width&&null!==g&&void 0!==g&&g.height&&A({type:"SET_DEFAULT_SIZE",payload:{width:parseInt(g.width,10),height:parseInt(g.height,10)}})}),[null===g||void 0===g?void 0:g.width,null===g||void 0===g?void 0:g.height]),(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-dialog"),customElements.whenDefined("cx-drawer"),customElements.whenDefined("cx-dropdown")]).then((()=>{O(!0)}))}),[]),(0,wt.useEffect)((()=>{const e=e=>{E.isLoadingFavorites?e.preventDefault():E.showVersionHistory?(e.preventDefault(),A({type:"SET_SHOW_VERSION_HISTORY",payload:!1})):(A({type:"SET_PREVIEW_LOADABLE",payload:!1}),A({type:"RESET_DATA"}),w())},t=P.current,n=z.current;return null===t||void 0===t||t.addEventListener("cx-request-close",e),null===n||void 0===n||n.addEventListener("cx-request-close",e),()=>{null===t||void 0===t||t.removeEventListener("cx-request-close",e),null===n||void 0===n||n.removeEventListener("cx-request-close",e)}}),[x,T,w,E.isLoadingFavorites,E.showVersionHistory]),(0,wt.useEffect)((()=>{const e=P.current;e&&x&&(e.boundary=x)})),(0,wt.useEffect)((()=>{const e=()=>{A({type:"SET_PREVIEW_LOADABLE",payload:!0})},t=P.current,n=z.current;return null===t||void 0===t||t.addEventListener("cx-after-show",e),null===n||void 0===n||n.addEventListener("cx-after-show",e),()=>{null===t||void 0===t||t.removeEventListener("cx-after-show",e),null===n||void 0===n||n.removeEventListener("cx-after-show",e)}}),[T,E.showCustomRendition,y]),(0,wt.useEffect)((()=>{const e=e=>{const t=e.detail.item.value;if("custom"===t)return A({type:"SET_SHOW_CUSTOM_RENDITION",payload:!0}),void(E.useCustomRendition||j());if("tracking"!==t)if("use-representative"!==t){if(t&&R){if(!R.map((e=>e.id)).includes(t))return;A({type:"SET_SELECTED_PROXY",payload:t})}}else A({type:"SET_USE_REPRESENTATIVE",payload:!E.useRepresentative});else A({type:"SET_ENABLED_TRACKING",payload:!E.enabledTracking})},t=P.current,n=z.current;return null===t||void 0===t||t.addEventListener("cx-select",e),null===n||void 0===n||n.addEventListener("cx-select",e),()=>{null===t||void 0===t||t.removeEventListener("cx-select",e),null===n||void 0===n||n.removeEventListener("cx-select",e)}}),[T,E.enabledTracking,E.useCustomRendition,E.useRepresentative,j,R,null===g||void 0===g?void 0:g.extension]),(0,wt.useEffect)((()=>{j()}),[j]);const N=(0,wt.useMemo)((()=>{var e;return(null===b||void 0===b?void 0:b.includes(null!==(e=null===g||void 0===g?void 0:g.docSubType)&&void 0!==e?e:""))&&(null===g||void 0===g?void 0:g.imageUrl)}),[g,b]),I=(0,wt.useCallback)((e=>{A({type:"SET_LOADING",payload:e})}),[]),M=(0,wt.useCallback)((async(e,t,n,r)=>{if(!g)return;const o=E.selectedFormat.width||E.defaultSize.width,i=E.selectedFormat.height||E.defaultSize.height;if(A({type:"SET_RESIZE_SIZE",payload:{width:e,height:t,unit:n}}),r){var a;let r=e,s=t;E.resizeSize.unit!==n?(r=o,s=i):n===sn.Nf.AspectRatio&&(r=Math.round(e/t*i),s=i);const l=await(null===(a=D.current)||void 0===a?void 0:a.applyResize());A({type:"SET_SELECTED_FORMAT",payload:{url:l,width:r,height:s}}),A({type:"SET_TRANSFORMATIONS",payload:{key:sn.YQ.Resize,value:{width:r,height:s}}}),A({type:"SET_CROP_SIZE",payload:{width:r,height:s}});const c=ln(r,s);A({type:"SET_LAST_RESIZE_SIZE",payload:{[sn.Nf.Pixel]:{width:r,height:s,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:n===sn.Nf.AspectRatio?e:c.width,height:n===sn.Nf.AspectRatio?t:c.height,unit:sn.Nf.AspectRatio}}}),A({type:"SET_LAST_CROP_SIZE",payload:{[sn.Nf.Pixel]:{width:r,height:s,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:n===sn.Nf.AspectRatio?e:c.width,height:n===sn.Nf.AspectRatio?t:c.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.AspectRatio}}})}}),[g,E.defaultSize.height,E.defaultSize.width,E.resizeSize.unit,E.selectedFormat.height,E.selectedFormat.width]),F=(0,wt.useCallback)((async(e,t,n,r)=>{var o,i;if(!g)return;const a=E.cropSize.unit,s=D.current;if(s&&null!==(o=E.selectedFormat)&&void 0!==o&&o.width&&null!==(i=E.selectedFormat)&&void 0!==i&&i.height){if(n===a&&n===sn.Nf.Pixel){const n=Math.max(e/E.selectedFormat.width,t/E.selectedFormat.height);s.setZoom(1/n)}n!==a&&s.setZoom(1)}if(A({type:"SET_CROP_SIZE",payload:{width:e,height:t,unit:n}}),r){var l;const r=await(null===(l=D.current)||void 0===l?void 0:l.applyCrop());let o=e,i=t;n===sn.Nf.AspectRatio&&(o=Math.round(E.cropSize.percentageWidth*E.selectedFormat.width/100),i=Math.round(E.cropSize.percentageHeight*E.selectedFormat.height/100)),null===s||void 0===s||s.setZoom(1);const a=Number((E.cropSize.x/100*E.selectedFormat.width).toFixed(0)),c=Number((E.cropSize.y/100*E.selectedFormat.height).toFixed(0));A({type:"SET_SELECTED_FORMAT",payload:{url:r,width:o,height:i}}),A({type:"SET_RESIZE_SIZE",payload:{width:o,height:i,unit:sn.Nf.Pixel}}),A({type:"SET_TRANSFORMATIONS",payload:{key:sn.YQ.Crop,value:{width:Number(o.toFixed(0)),height:Number(i.toFixed(0)),x:a,y:c}}});const u=ln(o,i);A({type:"SET_LAST_CROP_SIZE",payload:{[sn.Nf.Pixel]:{width:Math.round(o),height:Math.round(i),percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:n===sn.Nf.AspectRatio?e:u.width,height:n===sn.Nf.AspectRatio?t:u.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.AspectRatio}}}),A({type:"SET_LAST_RESIZE_SIZE",payload:{[sn.Nf.Pixel]:{width:o,height:i,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:n===sn.Nf.AspectRatio?e:u.width,height:n===sn.Nf.AspectRatio?t:u.height,unit:sn.Nf.AspectRatio}}})}}),[g,E.cropSize,E.selectedFormat.height,E.selectedFormat.width]),L=(0,wt.useCallback)((async(e,t)=>{if(A({type:"SET_ROTATION",payload:t?0:e}),t){var n;const{width:t,height:r}=cn(E.selectedFormat.width,E.selectedFormat.height,e),o=await(null===(n=D.current)||void 0===n?void 0:n.applyRotation());A({type:"SET_SELECTED_FORMAT",payload:{rotation:e,url:o,width:t,height:r}}),A({type:"SET_TRANSFORMATIONS",payload:{key:sn.YQ.Rotate,value:{rotation:e}}}),A({type:"SET_CROP_SIZE",payload:{width:t,height:r}}),A({type:"SET_RESIZE_SIZE",payload:{width:t,height:r,unit:sn.Nf.Pixel}});const i=ln(t,r);A({type:"SET_LAST_CROP_SIZE",payload:{[sn.Nf.Pixel]:{width:t,height:r,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:i.width,height:i.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.AspectRatio}}}),A({type:"SET_LAST_RESIZE_SIZE",payload:{[sn.Nf.Pixel]:{width:t,height:r,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:i.width,height:i.height,unit:sn.Nf.AspectRatio}}})}}),[E.selectedFormat]),B=(0,wt.useCallback)((e=>{A({type:"SET_SELECTED_FORMAT",payload:{extension:e}})}),[]),U=(0,wt.useCallback)((e=>{A({type:"SET_CROP_SIZE",payload:{width:E.selectedFormat.width,height:E.selectedFormat.height,unit:sn.Nf.Pixel}}),A({type:"SET_RESIZE_SIZE",payload:{width:E.selectedFormat.width,height:E.selectedFormat.height,unit:sn.Nf.Pixel}}),A({type:"SET_ROTATION",payload:0}),A({type:"SET_ACTIVE_SETTING",payload:e})}),[E.selectedFormat]),V=(0,wt.useCallback)((()=>{A({type:"SET_SHOW_VERSION_HISTORY",payload:!0})}),[]),q=(0,wt.useCallback)((e=>{let t=e.formatWidth,n=e.formatHeight;"TRX"===e.proxyName&&g&&(t=Number(g.width),n=Number(g.height)),A({type:"SET_SELECTED_PROXY",payload:{proxy:e.id,useCustomRendition:!0}}),A({type:"SET_SELECTED_FORMAT",payload:{url:null===g||void 0===g?void 0:g.imageUrl,width:t,height:n}}),A({type:"SET_RESIZE_SIZE",payload:{width:t,height:n,unit:sn.Nf.Pixel}}),A({type:"SET_CROP_SIZE",payload:{width:t,height:n,percentageWidth:100,percentageHeight:100,x:0,y:0,unit:sn.Nf.Pixel}});const r=ln(t,n);A({type:"SET_LAST_CROP_SIZE",payload:{[sn.Nf.Pixel]:{width:Math.round(t),height:Math.round(n),percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:r.width,height:r.height,percentageHeight:100,percentageWidth:100,x:0,y:0,unit:sn.Nf.AspectRatio}}}),A({type:"SET_LAST_RESIZE_SIZE",payload:{[sn.Nf.Pixel]:{width:t,height:n,unit:sn.Nf.Pixel},[sn.Nf.AspectRatio]:{width:r.width,height:r.height,unit:sn.Nf.AspectRatio}}})}),[g]),H=(0,wt.useCallback)((e=>{A({type:"SET_QUALITY",payload:e}),A({type:"SET_TRANSFORMATIONS",payload:{key:sn.YQ.Quality,value:{quality:e}}})}),[]),W=(0,wt.useCallback)((e=>{A({type:"SET_KEEP_METADATA",payload:e}),A({type:"SET_TRANSFORMATIONS",payload:{key:sn.YQ.KeepMetadata,value:{keepMetadata:e}}})}),[]);(0,wt.useEffect)((()=>{R&&0!==R.length?A({type:"SET_SELECTED_PROXY",payload:R[0].id}):A({type:"SET_SELECTED_PROXY",payload:""})}),[R,g]);const K=(0,wt.useCallback)((()=>{const e=E.isLoading||!E.selectedProxy&&!E.useCustomRendition&&!E.useRepresentative,i=(l&&null!==g&&void 0!==g&&g.docType?(0,Zt.A)([...l[g.docType],{displayName:"Automatic",value:s}],"value"):[{displayName:"Automatic",value:s}]).filter((e=>a||e.value!==s)),c=t&&i.length>0&&d.includes(g?g.extension:""),p=R&&Object.values(R).flat().length>0,f=Boolean(E.selectedFormat.width&&E.selectedFormat.height&&E.useCustomRendition);return(0,Vt.jsxs)(Vt.Fragment,{children:[E.showVersionHistory?(0,Vt.jsx)("cx-space",{slot:"label","justify-content":"space-between","align-items":"center",children:(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"2x-small",style:{flex:"1"},children:[(0,Vt.jsx)("cx-typography",{variant:"h4",children:"Version history"}),(0,Vt.jsx)("cx-typography",{variant:"body3",className:"asset-name",children:(0,Vt.jsx)("cx-line-clamp",{lines:1,children:null===g||void 0===g?void 0:g.name})})]})}):(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)("cx-space",{slot:"label","justify-content":"space-between","align-items":"center",children:(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"2x-small",style:{flex:"1"},children:[(0,Vt.jsx)("cx-typography",{variant:"h4",children:r?"Custom format":"Preview"}),(0,Vt.jsx)("cx-typography",{variant:"body3",className:"asset-name",children:(0,Vt.jsx)("cx-line-clamp",{lines:1,children:null===g||void 0===g?void 0:g.name})})]})}),n&&(0,Vt.jsx)("cx-tooltip",{slot:"header-actions",content:h?"Unfavorite":"Favorite",placement:"bottom",children:E.isLoadingFavorites?(0,Vt.jsx)("cx-space",{"align-items":"center","justify-content":"center",style:{width:"32px",height:"32px"},children:(0,Vt.jsx)("cx-spinner",{})}):(0,Vt.jsx)("cx-icon-button",{name:h?"star":"star_outline",style:{color:h?"var(--cx-color-warning)":"var(--cx-color-text)"},onClick:async()=>{E.isLoadingFavorites||(A({type:"SET_LOADING_FAVORITES",payload:!0}),h?await C():await S(),A({type:"SET_LOADING_FAVORITES",payload:!1}))}})}),v&&(0,Vt.jsx)("cx-tooltip",{slot:"header-actions",content:"Version history",placement:"bottom",children:(0,Vt.jsx)("cx-icon-button",{name:"history",onClick:V})})]}),(()=>{let e=null,t=null;if(e=E.selectedFormat.width&&E.selectedFormat.height&&(null===g||void 0===g?void 0:g.docType)===Qt.zu.Image?(0,Vt.jsx)(Tn,{ref:D,loadable:E.previewLoadable,image:E.selectedFormat,selectedProxy:E.selectedProxy,resizer:E.resizeSize,cropper:E.cropSize,rotation:E.rotation,disabled:"crop"!==E.activeSetting||!E.showCustomRendition,onCropComplete:e=>{A({type:"SET_CROP_SIZE",payload:{percentageWidth:e.width,percentageHeight:e.height,x:e.x,y:e.y}})},onLoadingChange:I}):(0,Vt.jsx)($n,{loadable:E.previewLoadable,asset:{docType:null===g||void 0===g?void 0:g.docType,imageUrl:null===g||void 0===g?void 0:g.imageUrl,videoUrl:m,extension:null===g||void 0===g?void 0:g.extension},onLoad:e=>{if(null!==g&&void 0!==g&&g.width&&null!==g&&void 0!==g&&g.height||null===g||void 0===g||!g.imageUrl)return;const t=null!==g&&void 0!==g&&g.width?parseInt(g.width,10):e.width,n=null!==g&&void 0!==g&&g.height?parseInt(g.height,10):e.height;A({type:"SET_DEFAULT_SIZE",payload:{width:t,height:n}})}}),E.showVersionHistory)return(0,Vt.jsx)(tr,{assetId:null===g||void 0===g?void 0:g.id});if(!r)return e;var n;E.showCustomRendition&&R?t=(0,Vt.jsx)(Vn,{activeSetting:E.activeSetting,extensions:i,availableProxies:R,imageSize:{width:E.selectedFormat.width?E.selectedFormat.width:1/0,height:E.selectedFormat.height?E.selectedFormat.height:1/0},resize:{width:E.resizeSize.width,height:E.resizeSize.height,unit:E.resizeSize.unit},crop:E.cropSize,keepMetadata:E.keepMetadata,lastAppliedCrop:E.lastCropSize,lastAppliedResize:E.lastResizeSize,proxy:E.selectedProxy,quality:E.quality,rotation:E.rotation,extension:E.selectedFormat.extension,onCropChange:F,onExtensionChange:B,onFormatChange:q,onKeepMetadataChange:W,onQualityChange:H,onResizeChange:M,onRotateChange:L,onViewChange:U}):t=(0,Vt.jsx)("cx-space",{direction:"vertical",spacing:"small",children:p||c?(0,Vt.jsxs)("div",{style:{width:"100%"},children:[p&&(0,Vt.jsx)(Xn,{items:null===R||void 0===R?void 0:R.map((e=>{var t;return"TRX"===e.proxyName&&g?{value:e.id,name:e.proxyLabel,cdnName:e.cdnName,width:g.width,height:g.height,extension:g.extension,docType:g.docType}:{value:e.id,name:e.proxyLabel,cdnName:e.cdnName,width:String(e.formatWidth),height:String(e.formatHeight),extension:null!==(t=e.extension)&&void 0!==t?t:void 0,docType:null===g||void 0===g?void 0:g.docType}})),selectedDisabled:E.useCustomRendition,selectedItem:E.selectedProxy,children:N&&(0,Vt.jsxs)("cx-menu-item",{value:"use-representative",children:[(0,Vt.jsx)("cx-typography",{variant:"body3",className:"proxy__name "+(E.useRepresentative?"selected":""),children:"Representative image"}),(0,Vt.jsx)("cx-icon",{slot:"suffix",name:E.useRepresentative?"check":""})]})}),c&&(0,Vt.jsx)(Xn,{items:[],selectedItem:E.selectedProxy,style:{borderTopWidth:"0"},children:(0,Vt.jsxs)("cx-menu-item",{value:"custom","data-cy":"custom-rendition-menu-item",children:[(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"crop_rotate",className:"icon--large"}),(0,Vt.jsxs)("div",{children:[(0,Vt.jsx)("cx-typography",{variant:"body3",className:"proxy__name "+(E.useCustomRendition?"selected":""),children:"Custom format"}),f?(0,Vt.jsxs)("cx-typography",{variant:"body3",className:"proxy__details",children:[E.selectedFormat.width," x"," ",E.selectedFormat.height,E.selectedFormat.extension&&(0,Vt.jsx)("div",{className:"proxy__extension-dot"}),null===(n=E.selectedFormat.extension)||void 0===n?void 0:n.replace(/^\./,"").toUpperCase()]}):null]}),(0,Vt.jsx)("cx-icon",{slot:"suffix",name:E.useCustomRendition?"edit":"",className:"icon--large"}),(0,Vt.jsx)("cx-icon",{slot:"suffix",name:E.useCustomRendition?"check":"",className:"icon--large icon--primary"})]})}),o&&(0,Vt.jsxs)("div",{style:{backgroundColor:"var(--cx-color-neutral-0)",width:"100%"},children:[(0,Vt.jsx)(Xn,{children:(0,Vt.jsxs)("cx-menu-item",{value:"tracking",className:"proxy--switch",children:[(0,Vt.jsx)("cx-typography",{variant:"body3",className:"proxy__name",children:"Tracking parameters"}),(0,Vt.jsx)("cx-switch",{checked:E.enabledTracking,onClick:e=>e.preventDefault()})]})}),E.enabledTracking&&(0,Vt.jsx)(Gn,{values:E.trackingParameters,onChange:e=>A({type:"SET_TRACKING_PARAMETERS",payload:e})})]})]}):(0,Vt.jsxs)("cx-space",{"align-items":"center",spacing:"large",wrap:"nowrap",style:{backgroundColor:"var(--cx-color-neutral-0)",width:"100%",padding:"var(--cx-spacing-medium)",gap:"20px"},children:[(0,Vt.jsx)("cx-icon",{style:{color:"var(--cx-color-warning)"},name:"warning",className:"ic_warning_amber"}),(0,Vt.jsx)("cx-typography",{variant:"body3",className:"proxy__name",children:"There are no available options for this asset. This might be due to your permissions or the application's settings."})]})});return(0,Vt.jsxs)(Vt.Fragment,{children:[e,t]})})(),(()=>{if(E.showVersionHistory)return null;let t=null;return t=r?E.showCustomRendition?(0,Vt.jsxs)("cx-space",{spacing:"small",style:{width:"fit-content"},children:[(0,Vt.jsx)("cx-button",{variant:"default",onClick:()=>{var e,t,n,r,o;E.useCustomRendition?A({type:"CANCEL_USE_CUSTOM_RENDITION",payload:{url:E.defaultSelectedFormat.url,originalUrl:E.defaultSelectedFormat.originalUrl,width:E.defaultSelectedFormat.width,height:E.defaultSelectedFormat.height,extension:E.defaultSelectedFormat.extension,selectedProxy:E.defaultSelectedProxy,useCustomRendition:!0}}):A({type:"CANCEL_USE_CUSTOM_RENDITION",payload:{url:null!==(e=null===g||void 0===g?void 0:g.imageUrl)&&void 0!==e?e:"",originalUrl:null!==(t=null===g||void 0===g?void 0:g.originalUrl)&&void 0!==t?t:"",width:parseInt(null!==(n=null===g||void 0===g?void 0:g.width)&&void 0!==n?n:"0",10),height:parseInt(null!==(r=null===g||void 0===g?void 0:g.height)&&void 0!==r?r:"0",10),extension:null!==(o=null===g||void 0===g?void 0:g.extension)&&void 0!==o?o:"",useCustomRendition:!1,selectedProxy:""}})},children:"Cancel"}),(0,Vt.jsx)("cx-button",{variant:"primary",onClick:()=>{A({type:"CONFIRM_USE_CUSTOM_RENDITION"})},children:"Done"})]}):(0,Vt.jsx)("cx-button",{className:"dialog__footer__button",disabled:e,loading:E.isLoadingConfirm,variant:"primary",style:{flex:1},onClick:async()=>{const e=null===R||void 0===R?void 0:R.find((e=>e.id===E.selectedProxy));if(E.useCustomRendition){var t,n,r,o,i,a,s,l,c,u,d,h,p,f,m;if(null===g||void 0===g||!g.docType)return;A({type:"SET_LOADING_CONFIRM",payload:!0}),await _({value:E.transformations,parameters:E.enabledTracking?E.trackingParameters:void 0,proxiesPreference:null===e||void 0===e?void 0:e.proxyName,extension:E.selectedFormat.extension,sourceProxyMetadata:{cdnName:null!==(t=null===e||void 0===e?void 0:e.cdnName)&&void 0!==t?t:null,extension:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?g.extension:null!==(n=null===e||void 0===e?void 0:e.extension)&&void 0!==n?n:null,isCustomFormat:null,width:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?parseInt(null!==(r=g.width)&&void 0!==r?r:"0",10):null!==(o=null===e||void 0===e?void 0:e.formatWidth)&&void 0!==o?o:null,height:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?parseInt(null!==(i=g.height)&&void 0!==i?i:"0",10):null!==(a=null===e||void 0===e?void 0:e.formatHeight)&&void 0!==a?a:null,permanentLink:null!==(s=null===e||void 0===e?void 0:e.permanentLink)&&void 0!==s?s:null,proxyLabel:null!==(l=null===e||void 0===e?void 0:e.proxyLabel)&&void 0!==l?l:null,proxyName:null!==(c=null===e||void 0===e?void 0:e.proxyName)&&void 0!==c?c:null},transformedAssetMetadata:{extension:null!==(u=null===(d=E.selectedFormat)||void 0===d?void 0:d.extension)&&void 0!==u?u:null,isCustomFormat:!0,height:null!==(h=null===(p=E.selectedFormat)||void 0===p?void 0:p.height)&&void 0!==h?h:null,width:null!==(f=null===(m=E.selectedFormat)||void 0===m?void 0:m.width)&&void 0!==f?f:null,permanentLink:null}}),A({type:"SET_LOADING_CONFIRM",payload:!1})}else{var v,b,y,x,S,C,T,O,P,z,D,j;if(null===g||void 0===g||!g.docType)return;if(!e&&!E.useRepresentative)return;A({type:"SET_LOADING_CONFIRM",payload:!0}),await k({extension:null!==(v=null===e||void 0===e?void 0:e.extension)&&void 0!==v?v:g.extension,value:null!==(b=null===e||void 0===e?void 0:e.proxyName)&&void 0!==b?b:"",permanentLink:null!==(y=null===e||void 0===e?void 0:e.permanentLink)&&void 0!==y?y:void 0,parameters:E.enabledTracking?E.trackingParameters:void 0,useRepresentative:E.useRepresentative,selectedProxyMetadata:{cdnName:null!==(x=null===e||void 0===e?void 0:e.cdnName)&&void 0!==x?x:null,extension:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?g.extension:null!==(S=null===e||void 0===e?void 0:e.extension)&&void 0!==S?S:null,isCustomFormat:!1,width:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?parseInt(null!==(C=g.width)&&void 0!==C?C:"0",10):null!==(T=null===e||void 0===e?void 0:e.formatWidth)&&void 0!==T?T:null,height:"TRX"===(null===e||void 0===e?void 0:e.proxyName)?parseInt(null!==(O=g.height)&&void 0!==O?O:"0",10):null!==(P=null===e||void 0===e?void 0:e.formatHeight)&&void 0!==P?P:null,permanentLink:null!==(z=null===e||void 0===e?void 0:e.permanentLink)&&void 0!==z?z:null,proxyLabel:null!==(D=null===e||void 0===e?void 0:e.proxyLabel)&&void 0!==D?D:null,proxyName:null!==(j=null===e||void 0===e?void 0:e.proxyName)&&void 0!==j?j:null}}),A({type:"SET_LOADING_CONFIRM",payload:!1})}A({type:"RESET_DATA"}),w()},children:null!==u&&void 0!==u?u:"Insert"}):(0,Vt.jsxs)("cx-button",{className:"dialog__footer__button",loading:E.isLoadingConfirm,onClick:async()=>{null!==g&&void 0!==g&&g.docType&&(A({type:"SET_LOADING_CONFIRM",payload:!0}),await k({extension:g.extension,useRepresentative:!0,value:""}),A({type:"SET_LOADING_CONFIRM",payload:!1}))},variant:"primary",children:[(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"folder"}),u]}),(0,Vt.jsx)("div",{slot:"footer",className:"dialog__footer",children:t})})()]})}),[t,n,r,o,a,s,l,u,d,R,V,h,m,g,v,E,N,w,F,B,S,q,_,W,I,k,H,M,L,C,U]);return"drawer"===y?(0,Vt.jsx)(Hn,{ref:z,className:"dialog",label:"Drawer",placement:"bottom",contained:!0,open:f,children:K()}):(0,Vt.jsx)(qn,{ref:P,className:"dialog",open:f,"use-overlay-scrollbar":nr||void 0,style:{"--max-height":`${p}px`,"--max-width":E.showVersionHistory?"600px":"520px"},children:K()})};var ar=n(5650);const sr=(0,Lt.Ay)("cx-space")`
655
655
  border-bottom: ${e=>{let{bordered:t}=e;return t?"1px solid var(--cx-color-neutral-300)":"none"}};
656
656
  padding: var(--cx-spacing-medium);
657
657
 
@@ -1037,7 +1037,7 @@
1037
1037
  height: 100%;
1038
1038
  display: flex;
1039
1039
  flex-direction: column;
1040
- `;var Hr=n(2246);const Wr={containerSize:{width:0,height:0},currentCount:0,currentFolder:Nt,defaultPageSize:Ut.md,facets:[],hasScrolled:!1,isLoading:!1,isSeeThrough:!0,openBrowser:!1,start:0,pageSize:0,maxPageSize:0,searchText:"",selectedFacets:{},shouldResetFilters:!0,sortDirection:void 0,sortOrder:"",totalCount:0,view:Qt.gf.Medium},Kr=(e,t)=>{const n={start:0,pageSize:e.maxPageSize};switch(t.type){case"SET_CONTAINER_SIZE":return{...e,containerSize:t.payload};case"SET_CURRENT_COUNT":return{...e,currentCount:t.payload};case"SET_CURRENT_FOLDER":return{...e,currentFolder:t.payload.folder,shouldResetFilters:!!t.payload.shouldResetFilters,...n};case"SET_FACETS":return{...e,facets:t.payload};case"SET_FILTERS":return{...e,selectedFacets:t.payload,shouldResetFilters:!1,...n};case"SET_HAS_SCROLLED":return{...e,hasScrolled:t.payload};case"SET_IS_LOADING":return{...e,isLoading:t.payload};case"SET_IS_SEE_THROUGH":return{...e,isSeeThrough:t.payload,...n};case"SET_OPEN_BROWSER":return{...e,openBrowser:t.payload};case"SET_START":return{...e,start:t.payload,pageSize:e.defaultPageSize};case"SET_PAGE_SIZE":{const n={...e,pageSize:t.payload.pageSize,maxPageSize:t.payload.pageSize};return t.payload.returnToFirstPage&&(n.start=0),n}case"SET_SEARCH_TEXT":return{...e,...n,searchText:t.payload};case"SET_SORT_DIRECTION":return{...e,...n,sortDirection:t.payload};case"SET_SORT_ORDER":return{...e,...n,sortOrder:t.payload};case"SET_TOTAL_COUNT":return{...e,totalCount:t.payload};case"SET_VIEW":{let n=Ut.md;switch(t.payload){case Qt.gf.Large:n=15;break;case Qt.gf.Medium:n=20;break;case Qt.gf.Small:n=30}return{...e,view:t.payload,defaultPageSize:n}}case"RESET_SEARCH":return{...e,currentCount:0,currentFolder:Nt,searchText:"",totalCount:0};default:return e}},$r=()=>{var e;const[t,n]=(0,wt.useReducer)(Kr,Wr),r=(0,Fr.GV)(Br.jT),o=(0,Fr.GV)(Br.wL),i=(0,Fr.GV)(Lr.OC),{allowedExtensions:a,allowedFolders:s,allowFavorites:l,allowPin:c,allowProxy:u,allowTracking:d,availableDocTypes:h,availableRepresentativeSubtypes:p,ctaText:f,lastLocationMode:m,persistMode:g,showCollections:v,showFavoriteFolder:b,showVersions:y,defaultGridView:x}=(0,wt.useContext)(ar.t),{extraFields:w,onAssetAction:S,onAssetSelected:k,onClose:_}=(0,wt.useContext)(zt.B),{data:C,isFetching:E,isError:A}=(0,Rt.aM)(i?{id:i,useSession:o}:Ft.hT),T=(0,wt.useMemo)((()=>C&&i&&C.recordId===i?C:null),[C,i]),{data:O,isFetching:P,isLoading:z,refetch:D}=(0,Ur.X)({});(0,wt.useEffect)((()=>{r&&D()}),[r,D]);const{data:R,isFetching:j,isError:N}=(0,Yn.t$)(T?{assetImages:T?[T]:[],useSession:o}:Ft.hT),{data:I}=(0,Yn.jS)({useSession:o}),{data:M}=(0,Yn.M$)({useSession:o}),{ATSEnabled:F,autoExtension:L=".auto",collectionPath:B,supportedExtensions:U,supportedRepresentativeSubtypes:V}=M||{},{data:q}=(0,Yn.ZP)({useSession:o}),{data:H}=(0,Yn.nb)({useSession:o}),{data:W,refetch:K}=(0,Rt.E7)(T&&l?{recordId:T.id}:Ft.hT),[$,Q]=(0,wt.useState)(!1),[X,G]=(0,wt.useState)(!1),[Z,Y]=(0,wt.useState)(sn.EI.Hide),[J,ee]=(0,wt.useState)(0),[te,ne]=(0,wt.useState)(!1),[re,oe]=(0,wt.useState)(!1),ie=(0,wt.useRef)($),ae=(0,wt.useRef)(null),le=(0,wt.useRef)(null),ce=(0,wt.useRef)(null),ue=(0,wt.useRef)(!1),de=(0,wt.useRef)([]),he=(0,wt.useRef)({}),pe=(0,Fr.jL)(),fe=(0,wt.useRef)(t.pageSize),me=(0,wt.useRef)(t.view),ge=(0,wt.useRef)(!1),ve=(0,wt.useRef)(null);ie.current=$,de.current=t.facets,he.current=t.selectedFacets,me.current=t.view,fe.current=t.pageSize;const be=(0,wt.useRef)(null),ye=(0,wt.useMemo)((()=>t.selectedFacets.Types&&t.selectedFacets.Types.length>0?t.selectedFacets.Types:["*"]),[t.selectedFacets]),xe=(0,wt.useMemo)((()=>!(null!==ye&&void 0!==ye&&ye.length)||0===ye.length),[ye]),we=(0,wt.useMemo)((()=>{var e;if(!q)return;const r=null===(e=Object.values(q).find((e=>e.some((e=>e.isDefault)))))||void 0===e?void 0:e[0];return t.sortOrder&&q[t.sortOrder]&&0!==q[t.sortOrder].length?1===q[t.sortOrder].length?q[t.sortOrder][0]:q[t.sortOrder].find((e=>{let{sortDirection:n}=e;return n.toLowerCase()===t.sortDirection})):(r&&(n({type:"SET_SORT_DIRECTION",payload:r.sortDirection.toLowerCase()}),n({type:"SET_SORT_ORDER",payload:r.sortDirectionGroupKey.toLowerCase()})),r)}),[q,t.sortDirection,t.sortOrder]),Se=(0,wt.useMemo)((()=>null===R||void 0===R?void 0:R.proxies.filter((e=>{if(!a||0===a.length)return!0;let t="";if(e.extension)t=e.extension.replace(".","");else{var n;const r=null===(n=e.permanentLink)||void 0===n?void 0:n.split(".").at(-1);t=null!==r&&void 0!==r?r:""}return a.some((e=>!!t&&t.toLowerCase()===e.toLowerCase()))}))),[R,a]),_e=(0,wt.useMemo)((()=>X&&q&&(null===ye||void 0===ye?void 0:ye.length)&&$),[X,q,ye,$]),{data:Ce,isFetching:Ee,isError:Ae,refetch:Te}=(0,Rt.pf)(_e?{folderID:t.currentFolder.id,isSeeThrough:t.isSeeThrough,limitedToDocTypes:h,pageSize:t.pageSize,searchText:t.searchText,selectedFacets:t.selectedFacets,sortOrder:null===we||void 0===we?void 0:we.id,start:t.start,useSession:o}:Ft.hT);(0,wt.useEffect)((()=>{var e;ee(null!==(e=null===Ce||void 0===Ce?void 0:Ce.items.length)&&void 0!==e?e:0)}),[null===Ce||void 0===Ce?void 0:Ce.items.length]),(0,wt.useEffect)((()=>{A&&pe((0,Lr.DM)(null))}),[pe,A]),(0,wt.useEffect)((()=>{S&&null!==T&&void 0!==T&&T.recordId&&S("select",T.recordId)}),[S,T]),(0,wt.useEffect)((()=>{let e=null;return Ee?n({type:"SET_IS_LOADING",payload:!0}):e=setTimeout((()=>{n({type:"SET_IS_LOADING",payload:Ee})}),200),()=>{e&&clearTimeout(e)}}),[Ee]),(0,wt.useEffect)((()=>{r&&(pe((0,Lr.DM)(null)),n({type:"RESET_SEARCH"}),Promise.all([(0,Mt.bQ)("selectedSortOrder"),(0,Mt.bQ)("selectedSortDirection"),(0,Mt.bQ)("selectedView"),(0,Mt.bQ)("newFacets"),(0,Mt.bQ)("selectedFilter"),(0,Mt.bQ)("selectedIsSeeThrough"),(0,Mt.bQ)("searchText")]).then((e=>{let[t,r,o,i,a,s,l]=e;if(t&&n({type:"SET_SORT_ORDER",payload:t}),"ascending"!==r&&"descending"!==r||n({type:"SET_SORT_DIRECTION",payload:r}),null===o&&(o=x),"string"===typeof o&&(Object.values(Qt.gf).includes(o)?n({type:"SET_VIEW",payload:o}):n({type:"SET_VIEW",payload:Qt.gf.Medium})),m){if(i){const e=JSON.parse(i);(0,Xe.A)(e)?n({type:"SET_FACETS",payload:e}):n({type:"SET_FACETS",payload:[]})}if(a){const e=JSON.parse(a);n(e?{type:"SET_FILTERS",payload:xt(e,Xe.A)}:{type:"SET_FILTERS",payload:{}})}s&&n({type:"SET_IS_SEE_THROUGH",payload:"true"===s}),l&&n({type:"SET_SEARCH_TEXT",payload:l}),ue.current=!0,oe(!0)}})))}),[pe,r,m,x]),(0,wt.useEffect)((()=>{let e=null;const t=ae.current;if(!t)return;const n=t.offsetWidth;return t.style.width=n-1+"px",e=setTimeout((()=>{t.style.width="100%"}),50),()=>{e&&clearTimeout(e)}}),[r]),(0,wt.useEffect)((()=>{const e=ce.current;if(!e)return;const t=e=>{const t=e.detail.entries;window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&t[0].target===ae.current&&n({type:"SET_CONTAINER_SIZE",payload:{width:t[0].contentRect.width,height:t[0].contentRect.height}})}))};return e.addEventListener("cx-resize",t),()=>{e.removeEventListener("cx-resize",t)}}),[]),(0,wt.useEffect)((()=>{!we&&ue.current&&n({type:"SET_SORT_ORDER",payload:Wr.sortOrder})}),[we,q]),(0,wt.useEffect)((()=>{ue.current&&((0,Mt.yt)("selectedSortOrder",t.sortOrder),t.sortDirection&&(0,Mt.yt)("selectedSortDirection",t.sortDirection),(0,Mt.yt)("selectedView",t.view),(0,Mt.yt)("newFacets",JSON.stringify(t.facets)),(0,Mt.yt)("selectedFilter",JSON.stringify(t.selectedFacets)),(0,Mt.yt)("selectedIsSeeThrough",t.isSeeThrough.toString()),(0,Mt.yt)("searchText",t.searchText))}),[t.currentFolder,t.facets,t.isSeeThrough,t.sortDirection,t.sortOrder,t.searchText,t.view,t.selectedFacets]);const Oe=t.containerSize.width>0&&t.containerSize.width<=Ut.Pm,Pe=e=>{pe((0,Lr.DM)(e.recordId))},ze=(0,wt.useCallback)((e=>{pe((0,Lr.DM)(null)),n({type:"SET_SEARCH_TEXT",payload:e})}),[pe]),De=(0,wt.useRef)(0),Re=(0,wt.useRef)(0),je=(0,wt.useRef)(t.defaultPageSize);je.current=t.defaultPageSize;const Ne=(0,wt.useCallback)(((e,t)=>{var r;const{width:o,height:i}=e,a=o||0,s=i||0;if(a*s===0||!ue.current)return;const l=De.current,c=Re.current;if(Math.abs(l-s)<10&&Math.abs(c-a)<10&&(null===t||void 0===t||!t.force))return;De.current=s,Re.current=a;const u=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cx-spacing-medium")||"16",10),d=(null===(r=Rr[me.current])||void 0===r?void 0:r.minWidth)||Rr[Qt.gf.Large].minWidth,h=Math.max(1,Math.floor((a+u)/(d+u))),p=Math.ceil(s/(d+u)),f=Math.ceil(p*h/je.current+1)*je.current;G(!0),f!==fe.current&&0!==f&&n({type:"SET_PAGE_SIZE",payload:{pageSize:f,returnToFirstPage:!(null===t||void 0===t||!t.returnToFirstPage)}})}),[]),Ie=(0,wt.useMemo)((()=>ke(Ne,Ut.h,{leading:!1})),[Ne]);(0,wt.useEffect)((()=>{if(ue.current){const e=le.current;me.current=t.view,e&&Ie({width:e.clientWidth,height:e.clientHeight},{returnToFirstPage:!0,force:!0})}}),[Ie,t.view]);const Me=(0,wt.useCallback)(((e,t)=>{switch(e){case"view":n({type:"SET_VIEW",payload:t});break;case"sortDirection":n({type:"SET_SORT_DIRECTION",payload:t});break;case"sortOrder":n({type:"SET_SORT_ORDER",payload:t.toString()});break;case"isSeeThrough":n({type:"SET_IS_SEE_THROUGH",payload:Boolean(t)});break;case"filter":n({type:"SET_FILTERS",payload:t})}}),[]),Fe=(0,wt.useCallback)((e=>{n({type:"SET_CURRENT_COUNT",payload:e.currentCount}),n({type:"SET_TOTAL_COUNT",payload:e.totalCount}),n({type:"SET_FACETS",payload:e.facets})}),[]),Le=(0,wt.useCallback)((async e=>{ie.current||Q(!0);const t=await pe(It(e));It.fulfilled.match(t)&&(n({type:"SET_CURRENT_FOLDER",payload:{folder:e,shouldResetFilters:ie.current}}),te||n({type:"SET_OPEN_BROWSER",payload:!1}),pe((0,Lr.DM)(null)),(0,Mt.yt)("lastLocation",JSON.stringify(e)))}),[pe,te]),Be=(0,wt.useCallback)((()=>{ge.current?ge.current=!1:n({type:"SET_START",payload:null!==J&&void 0!==J?J:0})}),[J]),Ue=(0,wt.useCallback)((e=>{if(!e.target)return;const t=e.target.scrollTop;n(0===t?{type:"SET_HAS_SCROLLED",payload:!1}:{type:"SET_HAS_SCROLLED",payload:!0})}),[]),Ve=(0,wt.useCallback)((async(e,t,n)=>{const r=[...e];Dt.Yq.forEach((e=>{const o=se(e);var i,a,s,l,c,u,d,h,p,f;T&&null!==w&&void 0!==w&&w.includes(e)&&(r[0]={...r[0],extraFields:{...(null===(i=r[0])||void 0===i?void 0:i.extraFields)||{},[e]:T[o]}});n?r[0]={...r[0],assetTransformationSource:t,assetLinkInfo:{extension:n.extension,isCustomFormat:null===(a=n.isCustomFormat)||void 0===a||a,permanentLink:r[0].imageUrl,width:n.width,height:n.height}}:r[0]={...r[0],assetLinkInfo:{cdnName:null!==(s=null===t||void 0===t?void 0:t.cdnName)&&void 0!==s?s:null,extension:null!==(l=null===t||void 0===t?void 0:t.extension)&&void 0!==l?l:null,isCustomFormat:null!==(c=null===t||void 0===t?void 0:t.isCustomFormat)&&void 0!==c&&c,permanentLink:null!==(u=r[0].imageUrl)&&void 0!==u?u:null,proxyLabel:null!==(d=null===t||void 0===t?void 0:t.proxyLabel)&&void 0!==d?d:null,proxyName:null!==(h=null===t||void 0===t?void 0:t.proxyName)&&void 0!==h?h:null,width:null!==(p=null===t||void 0===t?void 0:t.width)&&void 0!==p?p:null,height:null!==(f=null===t||void 0===t?void 0:t.height)&&void 0!==f?f:null}}}));const o=k(r);if("object"===typeof(i=o)&&null!==i&&"function"===typeof i.then)try{await o}catch(a){return void console.error("Error in onAssetSelected:",a)}var i;g||null===_||void 0===_||_()}),[w,k,_,g,T]),qe=(0,wt.useMemo)((()=>!!Ce&&t.start+t.pageSize<t.totalCount),[Ce,t.pageSize,t.start,t.totalCount]);(0,wt.useEffect)((()=>{if(Fe){var e,t,n,r,o;const i=new Map(de.current.map((e=>[`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`,{...e,values:e.values.reduce(((t,n)=>{var r;return(null===(r=he.current[e.facetDetails.facetFieldName])||void 0===r?void 0:r.find((e=>e===n.value)))&&t.push({...n,count:0}),t}),[])}])));(null!==(e=null===Ce||void 0===Ce||null===(t=Ce.facets)||void 0===t?void 0:t.filter((e=>e.values.length>0)))&&void 0!==e?e:[]).forEach((e=>{var t;const n=i.get(`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`),r=[...e.values,...null!==(t=null===n||void 0===n?void 0:n.values.filter((t=>!(null!==e&&void 0!==e&&e.values.find((e=>t.value===e.value&&t.displayValue===e.displayValue))))))&&void 0!==t?t:[]];i.set(`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`,{...e,values:r})})),Fe({currentCount:null!==(n=null===Ce||void 0===Ce?void 0:Ce.items.length)&&void 0!==n?n:0,items:null!==(r=null===Ce||void 0===Ce?void 0:Ce.items)&&void 0!==r?r:[],facets:Array.from(i.values()),totalCount:null!==(o=null===Ce||void 0===Ce?void 0:Ce.totalCount)&&void 0!==o?o:0})}}),[Ce,Fe]),(0,wt.useEffect)((()=>{const e=()=>{ge.current=!0,ve.current&&clearTimeout(ve.current),ve.current=setTimeout((()=>{ge.current=!1}),Ut.h)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,wt.useEffect)((()=>{const e=be.current,t=()=>{e&&window.clearTimeout(e)};return t(),E||j?(Y(sn.EI.Hide),be.current=window.setTimeout((()=>{Y(sn.EI.ShowLoader)}),800)):E||j||!(null!==R&&void 0!==R&&R.proxies||N)||be.current&&(t(),Y(sn.EI.ShowDialog)),()=>{t()}}),[R,N,j,E]),(0,wt.useEffect)((()=>{T||Y(sn.EI.ShowDialog)}),[T]);const He=(0,wt.useMemo)((()=>I&&a&&0!==a.length?Object.entries(I).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:r.filter((e=>!a||0===a.length||a.some((t=>e.value.toLowerCase()===`.${t.toLowerCase()}`))))}}),I):I),[I,a]),We=t.containerSize.width<650;return re?(0,Vt.jsx)("cx-resize-observer",{ref:ce,children:(0,Vt.jsxs)(Vr,{ref:ae,children:[(0,Vt.jsx)(Yt,{allowedFolders:s,allowPin:c,collectionPath:B,currentFolder:t.currentFolder,favoriteFolderId:null===O||void 0===O?void 0:O.favoriteFolderRecordID,lastLocationMode:m,open:t.openBrowser,showCollections:v,showFavoriteFolder:b,useSession:o,onFolderSelect:Le,onClose:()=>n({type:"SET_OPEN_BROWSER",payload:!1}),isPersistent:te,onChangePersistent:ne,forceOverlay:We,damViewSeeThru:t.isSeeThrough}),(0,Vt.jsxs)(qr,{children:[(0,Vt.jsx)(lr,{bordered:t.hasScrolled,currentFolder:t.currentFolder,isFetching:P,isLoading:z,userInfo:O,onMenuClick:()=>n({type:"SET_OPEN_BROWSER",payload:!0}),onLogout:()=>{pe((0,Br.ri)()),pe((0,Lr.DM)(null)),n({type:"RESET_SEARCH"})},children:(0,Vt.jsx)(on,{allowSorting:"Mono"!==(null===we||void 0===we?void 0:we.sortDirection)&&!!we,availableFacets:null!==H&&void 0!==H?H:[],currentCount:t.currentCount,facets:t.facets,isMobile:Oe,isSeeThrough:t.isSeeThrough,loading:t.isLoading,searchValue:t.searchText,selectedFacets:t.selectedFacets,sortDirection:t.sortDirection,sortOrder:t.sortOrder,sortOrders:q,totalCount:t.totalCount,view:t.view,onSearchChange:ze,onSettingChange:Me})}),(0,Vt.jsx)("div",{style:{flex:1,minHeight:"320px",padding:"0 var(--cx-spacing-medium)",position:"relative"},children:(0,Vt.jsx)(Pt,{onResize:Ie,children:e=>{let{height:n,width:r}=e;return(0,Vt.jsx)("div",{style:{height:n+"px",width:r+"px"},children:(0,Vt.jsx)(Mr,{ref:le,isError:Ae,isConfigError:xe,hasNextPage:qe,height:n,isLoadingData:t.isLoading||!Ce,isFetched:!!Ce||xe,items:(null===Ce||void 0===Ce?void 0:Ce.items)||[],selectedAsset:null!==T&&void 0!==T?T:null,view:t.view,width:r,onItemSelect:Pe,onLoadMore:Be,onScroll:Ue},t.currentFolder.id+t.searchText+Object.values(t.selectedFacets).join("+")+t.isSeeThrough+t.view)})}})}),Z===sn.EI.ShowLoader&&(0,Vt.jsx)("cx-space",{className:"format-loader",children:(0,Vt.jsx)("cx-spinner",{})}),(0,Vt.jsx)(ir,{allowCustomFormat:!!F&&!(null===T||void 0===T||!T.allowATSLink),allowFavorites:l,allowProxy:u,allowTracking:d,allowedExtensions:a,appendAutoExtension:null!==(e=null===a||void 0===a?void 0:a.includes(L))&&void 0!==e&&e,autoExtension:L,availableExtensions:He,availableProxies:N?[]:j?void 0:Se,ctaText:f,extensions:null!==U&&void 0!==U?U:[],isFavorite:!!W,maxHeight:t.containerSize.height,open:!!T&&Z===sn.EI.ShowDialog,previewUrl:N||j||null===R||void 0===R?void 0:R.previewUrl,selectedAsset:null!==T&&void 0!==T?T:null,showVersions:y,supportedRepresentativeSubtypes:null!==p&&void 0!==p&&p.length?Qe(p,V):V,variant:Oe?"drawer":"dialog",boundary:ae.current,onClose:()=>{pe((0,Lr.DM)(null)),S("unselect","")},onFavorite:async()=>{if(!T)return!1;const e=await pe((0,Lr.P1)({recordId:T.recordId}));return Lr.P1.fulfilled.match(e)&&(S&&S("favorite",T.recordId),await K(),S&&S("afterFavorite",T.recordId),t.currentFolder.id===(null===O||void 0===O?void 0:O.favoriteFolderRecordID)&&(0===t.start?Te():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e},onProxyConfirm:async e=>{let{extension:t,value:n,permanentLink:r,parameters:i,useRepresentative:a,selectedProxyMetadata:s}=e;if(!T)return;const l=await pe((0,Lr.Tp)({extension:t,extraFields:w,parameters:i,permanentLink:r,proxiesPreference:n,selectedAsset:T,useRepresentative:a,useSession:o}));Lr.Tp.fulfilled.match(l)&&await Ve(l.payload,s)},onFormatConfirm:async e=>{let{value:t,parameters:n,proxiesPreference:r,extension:i,sourceProxyMetadata:a,transformedAssetMetadata:s}=e;if(!T)return;const l=null!==T&&void 0!==T&&T.width?parseInt(T.width,10):0,c=null!==T&&void 0!==T&&T.height?parseInt(T.height,10):0,u=await pe((0,Lr.Tp)({extraFields:w,extension:i,maxHeight:c,maxWidth:l,parameters:n,proxiesPreference:r,selectedAsset:T,useSession:o,transformations:t}));Lr.Tp.fulfilled.match(u)&&await Ve(u.payload,a,s)},onUnFavorite:async()=>{if(!T)return!1;const e=await pe((0,Lr.BZ)({recordId:T.recordId}));return Lr.BZ.fulfilled.match(e)&&(S&&S("unfavorite",T.recordId),await K(),S&&S("afterUnfavorite",T.recordId),t.currentFolder.id===(null===O||void 0===O?void 0:O.favoriteFolderRecordID)&&(0===t.start?Te():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e}})]})]})}):(0,Vt.jsx)(Hr.A,{})}},8853:(e,t,n)=>{"use strict";e.exports=n(5896)},8879:(e,t,n)=>{"use strict";n.d(t,{xP:()=>z});var r=n(4657),o=n(2222),i=n(5043),a=n(5137),s=n(9815),l=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},c=Object.defineProperty,u=Object.defineProperties,d=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,m=function(e,t,n){return t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},g=function(e,t){for(var n in t||(t={}))p.call(t,n)&&m(e,n,t[n]);if(h)for(var r=0,o=h(t);r<o.length;r++){n=o[r];f.call(t,n)&&m(e,n,t[n])}return e},v=function(e,t){return u(e,d(t))};function b(e,t,n,r){var o=(0,i.useMemo)((function(){return{queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}}),[e,t,n,r]),a=(0,i.useRef)(o);return(0,i.useEffect)((function(){a.current.serialized!==o.serialized&&(a.current=o)}),[o]),a.current.serialized===o.serialized?a.current.queryArgs:e}var y=Symbol();function x(e){var t=(0,i.useRef)(e);return(0,i.useEffect)((function(){(0,a.bN)(t.current,e)||(t.current=e)}),[e]),(0,a.bN)(t.current,e)?t.current:e}var w,S,k=WeakMap?new WeakMap:void 0,_=function(e){var t=e.endpointName,n=e.queryArgs,r="",o=null==k?void 0:k.get(n);if("string"===typeof o)r=o;else{var i=JSON.stringify(n,(function(e,t){return(0,s.isPlainObject)(t)?Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{}):t}));(0,s.isPlainObject)(n)&&(null==k||k.set(n,i)),r=i}return t+"("+r+")"},C="undefined"!==typeof window&&window.document&&window.document.createElement?i.useLayoutEffect:i.useEffect,E=function(e){return e},A=function(e){return e.isUninitialized?v(g({},e),{isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:r.RE.pending}):e};function T(e){return e.replace(e[0],e[0].toUpperCase())}function O(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,l([e],t))}(S=w||(w={})).query="query",S.mutation="mutation";var P=Symbol();var z=(0,r.l0)((0,r.m7)(),function(e){var t=void 0===e?{}:e,n=t.batch,s=void 0===n?a.vA:n,l=t.useDispatch,c=void 0===l?a.wA:l,u=t.useSelector,d=void 0===u?a.d4:u,h=t.useStore,p=void 0===h?a.Pj:h,f=t.unstable__sideEffectsInRender,m=void 0!==f&&f;return{name:P,init:function(e,t,n){var l=t.serializeQueryArgs,u=e,h=function(e){var t=e.api,n=e.moduleOptions,s=n.batch,l=n.useDispatch,c=n.useSelector,u=n.useStore,d=n.unstable__sideEffectsInRender,h=e.serializeQueryArgs,p=e.context,f=d?function(e){return e()}:i.useEffect;return{buildQueryHooks:function(e){var n=function(n,o){var a=void 0===o?{}:o,s=a.refetchOnReconnect,c=a.refetchOnFocus,u=a.refetchOnMountOrArgChange,d=a.skip,h=void 0!==d&&d,m=a.pollingInterval,g=void 0===m?0:m,v=t.endpoints[e].initiate,y=l(),w=b(h?r.hT:n,_,p.endpointDefinitions[e],e),S=x({refetchOnReconnect:s,refetchOnFocus:c,pollingInterval:g}),k=(0,i.useRef)(!1),C=(0,i.useRef)(),E=C.current||{},A=E.queryCacheKey,T=E.requestId,O=!1;if(A&&T){var P=y(t.internalActions.internal_probeSubscription({queryCacheKey:A,requestId:T}));O=!!P}var z=!O&&k.current;return f((function(){k.current=O})),f((function(){z&&(C.current=void 0)}),[z]),f((function(){var e,t=C.current;if(w===r.hT)return null==t||t.unsubscribe(),void(C.current=void 0);var n=null==(e=C.current)?void 0:e.subscriptionOptions;if(t&&t.arg===w)S!==n&&t.updateSubscriptionOptions(S);else{null==t||t.unsubscribe();var o=y(v(w,{subscriptionOptions:S,forceRefetch:u}));C.current=o}}),[y,v,u,w,S,z]),(0,i.useEffect)((function(){return function(){var e;null==(e=C.current)||e.unsubscribe(),C.current=void 0}}),[]),(0,i.useMemo)((function(){return{refetch:function(){var e;if(!C.current)throw new Error("Cannot refetch a query that has not been started yet.");return null==(e=C.current)?void 0:e.refetch()}}}),[])},d=function(n){var r=void 0===n?{}:n,o=r.refetchOnReconnect,a=r.refetchOnFocus,c=r.pollingInterval,u=void 0===c?0:c,d=t.endpoints[e].initiate,h=l(),p=(0,i.useState)(y),m=p[0],g=p[1],v=(0,i.useRef)(),b=x({refetchOnReconnect:o,refetchOnFocus:a,pollingInterval:u});f((function(){var e,t,n=null==(e=v.current)?void 0:e.subscriptionOptions;b!==n&&(null==(t=v.current)||t.updateSubscriptionOptions(b))}),[b]);var w=(0,i.useRef)(b);f((function(){w.current=b}),[b]);var S=(0,i.useCallback)((function(e,t){var n;return void 0===t&&(t=!1),s((function(){var r;null==(r=v.current)||r.unsubscribe(),v.current=n=h(d(e,{subscriptionOptions:w.current,forceRefetch:!t})),g(e)})),n}),[h,d]);return(0,i.useEffect)((function(){return function(){var e;null==(e=null==v?void 0:v.current)||e.unsubscribe()}}),[]),(0,i.useEffect)((function(){m===y||v.current||S(m,!0)}),[m,S]),(0,i.useMemo)((function(){return[S,m]}),[S,m])},w=function(n,s){var l=void 0===s?{}:s,d=l.skip,f=void 0!==d&&d,g=l.selectFromResult,v=t.endpoints[e].select,y=b(f?r.hT:n,h,p.endpointDefinitions[e],e),x=(0,i.useRef)(),w=(0,i.useMemo)((function(){return(0,o.createSelector)([v(y),function(e,t){return t},function(e){return y}],m)}),[v,y]),S=(0,i.useMemo)((function(){return g?(0,o.createSelector)([w],g):w}),[w,g]),k=c((function(e){return S(e,x.current)}),a.bN),_=u(),E=w(_.getState(),x.current);return C((function(){x.current=E}),[E]),k};return{useQueryState:w,useQuerySubscription:n,useLazyQuerySubscription:d,useLazyQuery:function(e){var t=d(e),n=t[0],r=t[1],o=w(r,v(g({},e),{skip:r===y})),a=(0,i.useMemo)((function(){return{lastArg:r}}),[r]);return(0,i.useMemo)((function(){return[n,o,a]}),[n,o,a])},useQuery:function(e,t){var o=n(e,t),a=w(e,g({selectFromResult:e===r.hT||(null==t?void 0:t.skip)?void 0:A},t)),s=a.data,l=a.status,c=a.isLoading,u=a.isSuccess,d=a.isError,h=a.error;return(0,i.useDebugValue)({data:s,status:l,isLoading:c,isSuccess:u,isError:d,error:h}),(0,i.useMemo)((function(){return g(g({},a),o)}),[a,o])}}},buildMutationHook:function(e){return function(n){var r=void 0===n?{}:n,u=r.selectFromResult,d=void 0===u?E:u,h=r.fixedCacheKey,p=t.endpoints[e],f=p.select,m=p.initiate,b=l(),y=(0,i.useState)(),x=y[0],w=y[1];(0,i.useEffect)((function(){return function(){(null==x?void 0:x.arg.fixedCacheKey)||null==x||x.reset()}}),[x]);var S=(0,i.useCallback)((function(e){var t=b(m(e,{fixedCacheKey:h}));return w(t),t}),[b,m,h]),k=(x||{}).requestId,_=(0,i.useMemo)((function(){return(0,o.createSelector)([f({fixedCacheKey:h,requestId:null==x?void 0:x.requestId})],d)}),[f,x,d,h]),C=c(_,a.bN),A=null==h?null==x?void 0:x.arg.originalArgs:void 0,T=(0,i.useCallback)((function(){s((function(){x&&w(void 0),h&&b(t.internalActions.removeMutationResult({requestId:k,fixedCacheKey:h}))}))}),[b,h,x,k]),O=C.endpointName,P=C.data,z=C.status,D=C.isLoading,R=C.isSuccess,j=C.isError,N=C.error;(0,i.useDebugValue)({endpointName:O,data:P,status:z,isLoading:D,isSuccess:R,isError:j,error:N});var I=(0,i.useMemo)((function(){return v(g({},C),{originalArgs:A,reset:T})}),[C,A,T]);return(0,i.useMemo)((function(){return[S,I]}),[S,I])}},usePrefetch:function(e,n){var r=l(),o=x(n);return(0,i.useCallback)((function(n,i){return r(t.util.prefetch(e,n,g(g({},o),i)))}),[e,r,o])}};function m(e,t,n){if((null==t?void 0:t.endpointName)&&e.isUninitialized){var r=t.endpointName,o=p.endpointDefinitions[r];h({queryArgs:t.originalArgs,endpointDefinition:o,endpointName:r})===h({queryArgs:n,endpointDefinition:o,endpointName:r})&&(t=void 0)}var i=e.isSuccess?e.data:null==t?void 0:t.data;void 0===i&&(i=e.data);var a=void 0!==i,s=e.isLoading,l=!a&&s,c=e.isSuccess||s&&a;return v(g({},e),{data:i,currentData:e.data,isFetching:s,isLoading:l,isSuccess:c})}}({api:e,moduleOptions:{batch:s,useDispatch:c,useSelector:d,useStore:p,unstable__sideEffectsInRender:m},serializeQueryArgs:l,context:n}),f=h.buildQueryHooks,S=h.buildMutationHook,k=h.usePrefetch;return O(u,{usePrefetch:k}),O(n,{batch:s}),{injectEndpoint:function(t,n){if(function(e){return e.type===w.query}(n)){var r=f(t),o=r.useQuery,i=r.useLazyQuery,a=r.useLazyQuerySubscription,s=r.useQueryState,l=r.useQuerySubscription;O(u.endpoints[t],{useQuery:o,useLazyQuery:i,useLazyQuerySubscription:a,useQueryState:s,useQuerySubscription:l}),e["use"+T(t)+"Query"]=o,e["useLazy"+T(t)+"Query"]=i}else if(function(e){return e.type===w.mutation}(n)){var c=S(t);O(u.endpoints[t],{useMutation:c}),e["use"+T(t)+"Mutation"]=c}}}}}}())},8948:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e,t){return e.has(t)}},9063:(e,t,n)=>{"use strict";n.d(t,{$Y:()=>m,E7:()=>b,Jz:()=>f,PG:()=>p,aM:()=>v,pf:()=>g});var r=n(7840),o=n(4951),i=n(8024),a=n(9487),s=n(4657),l=n(8879),c=n(4413);const u=e=>{let{searchText:t,folder:n,allowedFolders:r}=e,o="MediaType:Story OR MediaType:Album";if((0,a.o)(t)||(o=`(${o}) AND Story_Title:${t}`),null!==r&&void 0!==r&&r.length){o=`(${o}) AND (${r.map((e=>`Path:${e}${null!==n&&void 0!==n&&n.id?"/*":""}`)).join(" OR ")})`}return o},d=e=>e&&0!==Object.keys(e).length?Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return r&&0!==r.length?"Types"===n?{...e,subtypeCriteria:e.subtypeCriteria.concat(r)}:{...e,facetFilters:{...e.facetFilters,[n]:r}}:e}),{subtypeCriteria:[],facetFilters:{}}):{subtypeCriteria:[],facetFilters:{}},h=(0,s.L5)(i.rQ,{maxRetries:2}),p=(0,l.xP)({reducerPath:"searchApi",baseQuery:h,tagTypes:["Folders","Images","ImagesInFolders"],endpoints:e=>({getFolders:e.query({keepUnusedDataFor:0,query:e=>{let{allowedFolders:t,folder:n,searchText:r,useSession:o,start:i=0,pageSize:a=c.VH,self:s=!1,includeDirectChild:l,damViewSeeThru:u}=e;const d=[["DamViewSeeThru",u?"true":"false"]];var h;if((i||i>=0)&&d.push(["Start",i.toString()]),r&&(d.push(["Text",r]),d.push(["SeeThru","true"])),a&&d.push(["Limit",a.toString()]),null===t||void 0===t||!t.length||null!==n&&void 0!==n&&n.id){if(null!==n&&void 0!==n&&n.id){var p;d.push(["ObjectRecordIDs",n.id]),d.push(["IncludeDirectChild",null!==(p=null===l||void 0===l?void 0:l.toString())&&void 0!==p?p:"true"])}}else t.forEach((e=>{d.push(["ObjectRecordIDs",e])})),d.push(["Self","true"]),d.push(["IncludeDirectChild",null!==(h=null===l||void 0===l?void 0:l.toString())&&void 0!==h?h:"false"]);return o&&d.push(["UseSession",o]),s&&d.push(["Self","true"]),{url:"/webapi/extensibility/integrations/gab/assetbrowser/gethierarchy_41e8",params:d}},transformResponse:(e,t,n)=>{var r,a;return{items:null!==(r=null===(a=e.contentItems)||void 0===a?void 0:a.map((e=>{var t,r,a,s;return{id:e.recordID,title:null!==(t=(0,i.Pp)(e.fields,o._3))&&void 0!==t?t:"",docType:null!==(r=(0,i.Pp)(e.fields,o.VV))&&void 0!==r?r:"",path:n.folder?[...n.folder.path,n.folder.title]:[],fullPath:(null!==(a=(0,i.Pp)(e.fields,o.bV))&&void 0!==a?a:"").replace(/^Root\//i,""),parents:n.folder?[...n.folder.parents,n.folder]:[],hasChildren:"1"===(null!==(s=(0,i.Pp)(e.fields,o.VH))&&void 0!==s?s:"0")}})))&&void 0!==r?r:[],totalCount:e.totalCount}},providesTags:(e,t,n)=>{var r,o;return[{type:"Folders",id:null!==(r=null===(o=n.folder)||void 0===o?void 0:o.id)&&void 0!==r?r:"Root"}]},merge:(e,t,n)=>n.arg.start&&n.arg.start>0?(e.items.push(...t.items),e):t,forceRefetch(e){let{currentArg:t,previousArg:n}=e;return t!==n},serializeQueryArgs:e=>{var t;let{endpointName:n,queryArgs:r}=e;return{endpointName:n,id:null===(t=r.folder)||void 0===t?void 0:t.id,type:"Folders"}}}),getCollections:e.query({keepUnusedDataFor:0,query:e=>{let{folder:t,searchText:n,useSession:r,start:i=0,pageSize:a=c.VH}=e;const s=[["extraFilters",u({searchText:n})],["fields",o.bV],["fields",o.VV],["fields",o._3],["seeThru",!0],["subtypeCriteria",t]];return(i||i>=0)&&s.push(["start",i.toString()]),a&&s.push(["limit",a.toString()]),r&&s.push(["UseSession",r]),{url:"/webapi/extensibility/integrations/contentBrowserSDK/getcontent_4bw_v1",params:s}},transformResponse:(e,t)=>{var n,r;return{items:null!==(n=null===(r=e.contentItems)||void 0===r?void 0:r.map((e=>{var t,n,r;return{id:e.recordID,title:null!==(t=(0,i.Pp)(e.fields,o._3))&&void 0!==t?t:"",docType:null!==(n=(0,i.Pp)(e.fields,o.VV))&&void 0!==n?n:"",path:[],fullPath:(null!==(r=(0,i.Pp)(e.fields,o.bV))&&void 0!==r?r:"").replace(/^Root\//i,""),parents:[],hasChildren:!1}})))&&void 0!==n?n:[],totalCount:e.totalCount}},providesTags:(e,t,n)=>[{type:"Folders",id:n.folder.id}],merge:(e,t,n)=>n.arg.start&&n.arg.start>0?(e.items.push(...t.items),e):t,forceRefetch(e){let{currentArg:t,previousArg:n}=e;return t!==n},serializeQueryArgs:e=>{var t;let{endpointName:n,queryArgs:r}=e;return{endpointName:n,id:null===(t=r.folder)||void 0===t?void 0:t.id,type:"Folders"}}}),getAssets:e.query({keepUnusedDataFor:0,query:e=>{let{folderID:t,isSeeThrough:n,limitedToDocTypes:r=[],pageSize:i,searchText:a,selectedFacets:s,sortOrder:l,start:c,useSession:u}=e;return{url:"/webapi/extensibility/integrations/contentBrowserSDK/getcontent_4bw_v3",body:{fields:[o.s6,o.VV,o.jb,o._R,o.vA,o.sP,o.S,o.Ni,o.Gu,o.HO,o.EG,o._3,o.Uh,o.g_],seeThru:!!n,objectRecordID:null!==t&&void 0!==t?t:void 0,start:null!==c&&void 0!==c?c:void 0,limit:null!==i&&void 0!==i?i:void 0,orderBy:l,limitedToDocTypes:r,text:a,useSession:u,...d(s)},method:"POST"}},transformResponse:e=>{var t,n;return{facets:e.facets,items:null!==(t=null===(n=e.contentItems)||void 0===n?void 0:n.map((e=>{var t,n,r,a,s,l,c,u,d,h,p,f;let m=null!==(t=(0,i.Pp)(e.fields,o.jb))&&void 0!==t?t:"";const g=(0,i.Pp)(e.fields,o.Gu);return m&&!m.startsWith(".")&&(m="."+m),{docType:null!==(n=(0,i.Pp)(e.fields,o.VV))&&void 0!==n?n:"",docSubType:null!==(r=(0,i.Pp)(e.fields,o.EG))&&void 0!==r?r:"",extension:m,height:null!==(a=(0,i.Pp)(e.fields,o.S))&&void 0!==a?a:"0",id:e.recordID,identifier:null!==(s=(0,i.Pp)(e.fields,o.vA))&&void 0!==s?s:"",imageUrl:null!==(l=(0,i.Pp)(e.fields,o.s6))&&void 0!==l?l:"",originalUrl:null!==(c=(0,i.Pp)(e.fields,o.g_))&&void 0!==c?c:"",name:null!==g&&void 0!==g?g:"",scrubUrl:null!==(u=(0,i.Pp)(e.fields,o.he))&&void 0!==u?u:"",size:null!==(d=(0,i.Pp)(e.fields,o._R))&&void 0!==d?d:"0 MB",tags:null!==(h=(0,i.Pp)(e.fields,o.sP))&&void 0!==h?h:"",width:null!==(p=(0,i.Pp)(e.fields,o.Ni))&&void 0!==p?p:"0",allowATSLink:"True"===(0,i.Pp)(e.fields,o.F4),recordId:null!==(f=(0,i.Pp)(e.fields,o.HO))&&void 0!==f?f:""}})))&&void 0!==t?t:[],totalCount:e.totalCount}},providesTags:(e,t,n)=>{var r;return[{selectedFacets:Object.values(null!==(r=n.selectedFacets)&&void 0!==r?r:{}),id:n.folderID,isSeeThrough:n.isSeeThrough,searchText:n.searchText,sortOrder:n.sortOrder,type:"ImagesInFolders"},"Images"]},merge:(e,t,n)=>n.arg.start&&n.arg.start>0?{...e,items:(0,r.A)([...e.items,...t.items],"recordId")}:t,forceRefetch(e){let{currentArg:t,previousArg:n}=e;return(null===t||void 0===t?void 0:t.start)===(null===n||void 0===n?void 0:n.start)?!(null===t||void 0===t||!t.pageSize)&&!(null===n||void 0===n||!n.pageSize)&&t.pageSize>n.pageSize:t!==n},serializeQueryArgs:e=>{var t;let{endpointName:n,queryArgs:r}=e;return{endpointName:n,selectedFacets:Object.values(null!==(t=r.selectedFacets)&&void 0!==t?t:{}),id:r.folderID,isSeeThrough:r.isSeeThrough,searchText:r.searchText,sortOrder:r.sortOrder,type:"ImagesInFolders"}}}),getIsFavorite:e.query({keepUnusedDataFor:0,query:e=>{let{recordId:t}=e;return{url:"/webapi/extensibility/integrations/contentBrowserSDK/getfavorites_419t",params:[["recordId",t]]}},transformResponse:(e,t,n)=>{let{recordId:r}=n;return!!e.favoriteRecordIds&&e.favoriteRecordIds[0]===r}}),getAssetById:e.query({keepUnusedDataFor:0,query:e=>{let{id:t,useSession:n}=e;const r=[["extraFilters",`RecordID:${t}`],["fields",o.s6],["fields",o.VV],["fields",o.jb],["fields",o._R],["fields",o.vA],["fields",o.sP],["fields",o.S],["fields",o.Ni],["fields",o.Gu],["fields",o.HO],["fields",o.EG],["fields",o._3],["fields",o.Uh],["fields",o.g_],["seeThru","true"]];return n&&r.push(["UseSession",n]),{url:"/webapi/extensibility/integrations/contentBrowserSDK/getcontent_4bw_v1",params:r}},transformResponse:e=>{var t,n,r,a,s,l,c,u,d,h,p,f,m;const g=null===(t=e.contentItems)||void 0===t?void 0:t[0];if(!g)return;let v=null!==(n=(0,i.Pp)(g.fields,o.jb))&&void 0!==n?n:"";v&&!v.startsWith(".")&&(v="."+v);const b=(0,i.Pp)(g.fields,o.Gu);return v&&!v.startsWith(".")&&(v="."+v),{docType:null!==(r=(0,i.Pp)(g.fields,o.VV))&&void 0!==r?r:"",docSubType:null!==(a=(0,i.Pp)(g.fields,o.EG))&&void 0!==a?a:"",extension:v,height:null!==(s=(0,i.Pp)(g.fields,o.S))&&void 0!==s?s:"0",id:g.recordID,identifier:null!==(l=(0,i.Pp)(g.fields,o.vA))&&void 0!==l?l:"",imageUrl:null!==(c=(0,i.Pp)(g.fields,o.s6))&&void 0!==c?c:"",originalUrl:null!==(u=(0,i.Pp)(g.fields,o.g_))&&void 0!==u?u:"",name:b,scrubUrl:null!==(d=(0,i.Pp)(g.fields,o.he))&&void 0!==d?d:"",size:null!==(h=(0,i.Pp)(g.fields,o._R))&&void 0!==h?h:"0 MB",tags:null!==(p=(0,i.Pp)(g.fields,o.sP))&&void 0!==p?p:"",width:null!==(f=(0,i.Pp)(g.fields,o.Ni))&&void 0!==f?f:"0",allowATSLink:"True"===(0,i.Pp)(g.fields,o.F4),recordId:null!==(m=(0,i.Pp)(g.fields,o.HO))&&void 0!==m?m:""}},providesTags:(e,t,n)=>[{type:"Images",id:n.id}],serializeQueryArgs:e=>{let{endpointName:t,queryArgs:n}=e;return{endpointName:t,id:n.id,useSession:n.useSession}}})})}),{useGetFoldersQuery:f,useGetCollectionsQuery:m,useGetAssetsQuery:g,useGetAssetByIdQuery:v,useGetIsFavoriteQuery:b}=p},9171:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});const r=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1};const o=function(e){return e!==e};const i=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1};const a=function(e,t,n){return t===t?i(e,t,n):r(e,o,n)};const s=function(e,t){return!!(null==e?0:e.length)&&a(e,t,0)>-1}},9392:(e,t,n)=>{"use strict";var r=n(1218),o=n(6496);function i(e){var t=0,n=0,r=0,o=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=10*t,o=10*n,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!t&&(t=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},e.exports=i},9406:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(){return[]}},9461:(e,t,n)=>{"use strict";e.exports=n(2330)},9487:(e,t,n)=>{"use strict";n.d(t,{k:()=>r,o:()=>o});const r=e=>{let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";for(let r=0;r<e;r++)t+=n.charAt(Math.floor(62*Math.random()));return t},o=e=>!e||""===e.trim()},9500:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(4802),o=n(3239);const i=function(e){return(0,o.A)(e)&&"[object Arguments]"==(0,r.A)(e)};var a=Object.prototype,s=a.hasOwnProperty,l=a.propertyIsEnumerable;const c=i(function(){return arguments}())?i:function(e){return(0,o.A)(e)&&s.call(e,"callee")&&!l.call(e,"callee")}},9618:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});const r=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i};var o=n(9406),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;const s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o.A},9717:(e,t,n)=>{"use strict";var r=n(5043),o=n(9461);var i="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},a=o.useSyncExternalStore,s=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=s(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=c((function(){function e(e){if(!l){if(l=!0,a=e,e=r(e),void 0!==o&&h.hasValue){var t=h.value;if(o(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(a=e,t):(a=e,s=n)}var a,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var p=a(e,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=p}),[p]),u(p),p}},9815:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EnhancerArray:()=>j,MiddlewareArray:()=>R,SHOULD_AUTOBATCH:()=>Ze,TaskAbortError:()=>Pe,__DO_NOT_USE__ActionTypes:()=>o.$d,addListener:()=>We,applyMiddleware:()=>o.Tw,autoBatchEnhancer:()=>nt,bindActionCreators:()=>o.zH,clearAllListeners:()=>Ke,combineReducers:()=>o.HY,compose:()=>o.Zz,configureStore:()=>H,createAction:()=>E,createActionCreatorInvariantMiddleware:()=>D,createAsyncThunk:()=>ae,createDraftSafeSelector:()=>S,createEntityAdapter:()=>ee,createImmutableStateInvariantMiddleware:()=>M,createListenerMiddleware:()=>Xe,createNextState:()=>r.Ay,createReducer:()=>K,createSelector:()=>i.createSelector,createSerializableStateInvariantMiddleware:()=>U,createSlice:()=>$,createStore:()=>o.y$,current:()=>r.ss,findNonSerializableValue:()=>L,freeze:()=>r.CN,getDefaultMiddleware:()=>V,getType:()=>z,isAction:()=>A,isActionCreator:()=>T,isAllOf:()=>ue,isAnyOf:()=>ce,isAsyncThunkAction:()=>ve,isDraft:()=>r.Qx,isFluxStandardAction:()=>O,isFulfilled:()=>ge,isImmutableDefault:()=>I,isPending:()=>pe,isPlain:()=>F,isPlainObject:()=>_,isRejected:()=>fe,isRejectedWithValue:()=>me,legacy_createStore:()=>o.Yl,miniSerializeError:()=>ie,nanoid:()=>te,original:()=>r.c2,prepareAutoBatched:()=>Ye,removeListener:()=>$e,unwrapResult:()=>se});var r=n(2272),o=n(6096),i=n(2222);function a(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"===typeof o?o(n,r,e):t(o)}}}}var s=a();s.withExtraArgument=a;const l=s;var c=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},d=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},h=Object.defineProperty,p=Object.defineProperties,f=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,b=function(e,t,n){return t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},y=function(e,t){for(var n in t||(t={}))g.call(t,n)&&b(e,n,t[n]);if(m)for(var r=0,o=m(t);r<o.length;r++){n=o[r];v.call(t,n)&&b(e,n,t[n])}return e},x=function(e,t){return p(e,f(t))},w=function(e,t,n){return new Promise((function(r,o){var i=function(e){try{s(n.next(e))}catch(t){o(t)}},a=function(e){try{s(n.throw(e))}catch(t){o(t)}},s=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(i,a)};s((n=n.apply(e,t)).next())}))},S=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.createSelector.apply(void 0,e);return function(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return n.apply(void 0,d([(0,r.Qx)(e)?(0,r.ss)(e):e],t))}},k="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"===typeof arguments[0]?o.Zz:o.Zz.apply(null,arguments)};"undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function _(e){if("object"!==typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}var C=function(e){return e&&"function"===typeof e.match};function E(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return y(y({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}function A(e){return _(e)&&"type"in e}function T(e){return"function"===typeof e&&"type"in e&&C(e)}function O(e){return A(e)&&"string"===typeof e.type&&Object.keys(e).every(P)}function P(e){return["type","payload","error","meta"].indexOf(e)>-1}function z(e){return""+e}function D(e){return void 0===e&&(e={}),function(){return function(e){return function(t){return e(t)}}}}var R=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return c(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,d([void 0],e[0].concat(this)))):new(t.bind.apply(t,d([void 0],e.concat(this))))},t}(Array),j=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return c(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,d([void 0],e[0].concat(this)))):new(t.bind.apply(t,d([void 0],e.concat(this))))},t}(Array);function N(e){return(0,r.a6)(e)?(0,r.Ay)(e,(function(){})):e}function I(e){return"object"!==typeof e||null==e||Object.isFrozen(e)}function M(e){return void 0===e&&(e={}),function(){return function(e){return function(t){return e(t)}}}}function F(e){var t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||_(e)}function L(e,t,n,r,o,i){var a;if(void 0===t&&(t=""),void 0===n&&(n=F),void 0===o&&(o=[]),!n(e))return{keyPath:t||"<root>",value:e};if("object"!==typeof e||null===e)return!1;if(null==i?void 0:i.has(e))return!1;for(var s=null!=r?r(e):Object.entries(e),l=o.length>0,c=function(e,s){var c=t?t+"."+e:e;if(l&&o.some((function(e){return e instanceof RegExp?e.test(c):c===e})))return"continue";return n(s)?"object"===typeof s&&(a=L(s,c,n,r,o,i))?{value:a}:void 0:{value:{keyPath:c,value:s}}},u=0,d=s;u<d.length;u++){var h=d[u],p=c(h[0],h[1]);if("object"===typeof p)return p.value}return i&&B(e)&&i.add(e),!1}function B(e){if(!Object.isFrozen(e))return!1;for(var t=0,n=Object.values(e);t<n.length;t++){var r=n[t];if("object"===typeof r&&null!==r&&!B(r))return!1}return!0}function U(e){return void 0===e&&(e={}),function(){return function(e){return function(t){return e(t)}}}}function V(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t,r=(e.immutableCheck,e.serializableCheck,e.actionCreatorCheck,new R);return n&&("boolean"===typeof n?r.push(l):r.push(l.withExtraArgument(n.extraArgument))),r}var q=!0;function H(e){var t,n=function(e){return V(e)},r=e||{},i=r.reducer,a=void 0===i?void 0:i,s=r.middleware,l=void 0===s?n():s,c=r.devTools,u=void 0===c||c,h=r.preloadedState,p=void 0===h?void 0:h,f=r.enhancers,m=void 0===f?void 0:f;if("function"===typeof a)t=a;else{if(!_(a))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=(0,o.HY)(a)}var g=l;if("function"===typeof g&&(g=g(n),!q&&!Array.isArray(g)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!q&&g.some((function(e){return"function"!==typeof e})))throw new Error("each middleware provided to configureStore must be a function");var v=o.Tw.apply(void 0,g),b=o.Zz;u&&(b=k(y({trace:!q},"object"===typeof u&&u)));var x=new j(v),w=x;Array.isArray(m)?w=d([v],m):"function"===typeof m&&(w=m(x));var S=b.apply(void 0,w);return(0,o.y$)(t,p,S)}function W(e){var t,n={},r=[],o={addCase:function(e,t){var r="string"===typeof e?e:e.type;if(!r)throw new Error("`builder.addCase` cannot be called with an empty action type");if(r in n)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return n[r]=t,o},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),o},addDefaultCase:function(e){return t=e,o}};return e(o),[n,r,t]}function K(e,t,n,o){void 0===n&&(n=[]);var i,a="function"===typeof t?W(t):[t,n,o],s=a[0],l=a[1],c=a[2];if("function"===typeof e)i=function(){return N(e())};else{var u=N(e);i=function(){return u}}function h(e,t){void 0===e&&(e=i());var n=d([s[t.type]],l.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[c]),n.reduce((function(e,n){if(n){var o;if((0,r.Qx)(e))return void 0===(o=n(e,t))?e:o;if((0,r.a6)(e))return(0,r.Ay)(e,(function(e){return n(e,t)}));if(void 0===(o=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return o}return e}),e)}return h.getInitialState=i,h}function $(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:N(e.initialState),o=e.reducers||{},i=Object.keys(o),a={},s={},l={};function c(){var t="function"===typeof e.extraReducers?W(e.extraReducers):[e.extraReducers],n=t[0],o=void 0===n?{}:n,i=t[1],a=void 0===i?[]:i,l=t[2],c=void 0===l?void 0:l,u=y(y({},o),s);return K(r,(function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=a;n<r.length;n++){var o=r[n];e.addMatcher(o.matcher,o.reducer)}c&&e.addDefaultCase(c)}))}return i.forEach((function(e){var n,r,i=o[e],c=t+"/"+e;"reducer"in i?(n=i.reducer,r=i.prepare):n=i,a[e]=n,s[c]=n,l[e]=r?E(c,r):E(c)})),{name:t,reducer:function(e,t){return n||(n=c()),n(e,t)},actions:l,caseReducers:a,getInitialState:function(){return n||(n=c()),n.getInitialState()}}}function Q(e){var t=X((function(t,n){return e(n)}));return function(e){return t(e,void 0)}}function X(e){return function(t,n){var o=function(t){O(n)?e(n.payload,t):e(n,t)};return(0,r.Qx)(t)?(o(t),t):(0,r.Ay)(t,o)}}function G(e,t){return t(e)}function Z(e){return Array.isArray(e)||(e=Object.values(e)),e}function Y(e,t,n){for(var r=[],o=[],i=0,a=e=Z(e);i<a.length;i++){var s=a[i],l=G(s,t);l in n.entities?o.push({id:l,changes:s}):r.push(s)}return[r,o]}function J(e){function t(t,n){var r=G(t,e);r in n.entities||(n.ids.push(r),n.entities[r]=t)}function n(e,n){for(var r=0,o=e=Z(e);r<o.length;r++){t(o[r],n)}}function r(t,n){var r=G(t,e);r in n.entities||n.ids.push(r),n.entities[r]=t}function o(e,t){var n=!1;e.forEach((function(e){e in t.entities&&(delete t.entities[e],n=!0)})),n&&(t.ids=t.ids.filter((function(e){return e in t.entities})))}function i(t,n){var r={},o={};if(t.forEach((function(e){e.id in n.entities&&(o[e.id]={id:e.id,changes:y(y({},o[e.id]?o[e.id].changes:null),e.changes)})})),(t=Object.values(o)).length>0){var i=t.filter((function(t){return function(t,n,r){var o=r.entities[n.id],i=Object.assign({},o,n.changes),a=G(i,e),s=a!==n.id;return s&&(t[n.id]=a,delete r.entities[n.id]),r.entities[a]=i,s}(r,t,n)})).length>0;i&&(n.ids=Object.keys(n.entities))}}function a(t,r){var o=Y(t,e,r),a=o[0];i(o[1],r),n(a,r)}return{removeAll:Q((function(e){Object.assign(e,{ids:[],entities:{}})})),addOne:X(t),addMany:X(n),setOne:X(r),setMany:X((function(e,t){for(var n=0,o=e=Z(e);n<o.length;n++){r(o[n],t)}})),setAll:X((function(e,t){e=Z(e),t.ids=[],t.entities={},n(e,t)})),updateOne:X((function(e,t){return i([e],t)})),updateMany:X(i),upsertOne:X((function(e,t){return a([e],t)})),upsertMany:X(a),removeOne:X((function(e,t){return o([e],t)})),removeMany:X(o)}}function ee(e){void 0===e&&(e={});var t=y({sortComparer:!1,selectId:function(e){return e.id}},e),n=t.selectId,r=t.sortComparer,o={getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},i={getSelectors:function(e){var t=function(e){return e.ids},n=function(e){return e.entities},r=S(t,n,(function(e,t){return e.map((function(e){return t[e]}))})),o=function(e,t){return t},i=function(e,t){return e[t]},a=S(t,(function(e){return e.length}));if(!e)return{selectIds:t,selectEntities:n,selectAll:r,selectTotal:a,selectById:S(n,o,i)};var s=S(e,n);return{selectIds:S(e,t),selectEntities:s,selectAll:S(e,r),selectTotal:S(e,a),selectById:S(s,o,i)}}},a=r?function(e,t){var n=J(e);function r(t,n){var r=(t=Z(t)).filter((function(t){return!(G(t,e)in n.entities)}));0!==r.length&&s(r,n)}function o(e,t){0!==(e=Z(e)).length&&s(e,t)}function i(t,n){for(var r=!1,o=0,i=t;o<i.length;o++){var a=i[o],s=n.entities[a.id];if(s){r=!0,Object.assign(s,a.changes);var c=e(s);a.id!==c&&(delete n.entities[a.id],n.entities[c]=s)}}r&&l(n)}function a(t,n){var o=Y(t,e,n),a=o[0];i(o[1],n),r(a,n)}function s(t,n){t.forEach((function(t){n.entities[e(t)]=t})),l(n)}function l(n){var r=Object.values(n.entities);r.sort(t);var o=r.map(e);(function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(e[n]!==t[n])return!1;return!0})(n.ids,o)||(n.ids=o)}return{removeOne:n.removeOne,removeMany:n.removeMany,removeAll:n.removeAll,addOne:X((function(e,t){return r([e],t)})),updateOne:X((function(e,t){return i([e],t)})),upsertOne:X((function(e,t){return a([e],t)})),setOne:X((function(e,t){return o([e],t)})),setMany:X(o),setAll:X((function(e,t){e=Z(e),t.entities={},t.ids=[],r(e,t)})),addMany:X(r),updateMany:X(i),upsertMany:X(a)}}(n,r):J(n);return y(y(y({selectId:n,sortComparer:r},o),i),a)}var te=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},ne=["name","message","stack","code"],re=function(e,t){this.payload=e,this.meta=t},oe=function(e,t){this.payload=e,this.meta=t},ie=function(e){if("object"===typeof e&&null!==e){for(var t={},n=0,r=ne;n<r.length;n++){var o=r[n];"string"===typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},ae=function(){function e(e,t,n){var r=E(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:x(y({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=E(e+"/pending",(function(e,t,n){return{payload:void 0,meta:x(y({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),i=E(e+"/rejected",(function(e,t,r,o,i){return{payload:o,error:(n&&n.serializeError||ie)(e||"Rejected"),meta:x(y({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),a="undefined"!==typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){0},e}();return Object.assign((function(e){return function(s,l,c){var d,h=(null==n?void 0:n.idGenerator)?n.idGenerator(e):te(),p=new a;function f(e){d=e,p.abort()}var m=function(){return w(this,null,(function(){var a,m,g,v,b,y;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,4,,5]),v=null==(a=null==n?void 0:n.condition)?void 0:a.call(n,e,{getState:l,extra:c}),null===(x=v)||"object"!==typeof x||"function"!==typeof x.then?[3,2]:[4,v];case 1:v=u.sent(),u.label=2;case 2:if(!1===v||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(e,t){return p.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:d||"Aborted"})}))})),s(o(h,e,null==(m=null==n?void 0:n.getPendingMeta)?void 0:m.call(n,{requestId:h,arg:e},{getState:l,extra:c}))),[4,Promise.race([b,Promise.resolve(t(e,{dispatch:s,getState:l,extra:c,requestId:h,signal:p.signal,abort:f,rejectWithValue:function(e,t){return new re(e,t)},fulfillWithValue:function(e,t){return new oe(e,t)}})).then((function(t){if(t instanceof re)throw t;return t instanceof oe?r(t.payload,h,e,t.meta):r(t,h,e)}))])];case 3:return g=u.sent(),[3,5];case 4:return y=u.sent(),g=y instanceof re?i(null,h,e,y.payload,y.meta):i(y,h,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&i.match(g)&&g.meta.condition||s(g),[2,g]}var x}))}))}();return Object.assign(m,{abort:f,requestId:h,arg:e,unwrap:function(){return m.then(se)}})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}return e.withTypes=function(){return e},e}();function se(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var le=function(e,t){return C(e)?e.match(t):e(t)};function ce(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return le(e,t)}))}}function ue(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.every((function(e){return le(e,t)}))}}function de(e,t){if(!e||!e.meta)return!1;var n="string"===typeof e.meta.requestId,r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function he(e){return"function"===typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function pe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return de(e,["pending"])}:he(e)?function(t){var n=e.map((function(e){return e.pending}));return ce.apply(void 0,n)(t)}:pe()(e[0])}function fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return de(e,["rejected"])}:he(e)?function(t){var n=e.map((function(e){return e.rejected}));return ce.apply(void 0,n)(t)}:fe()(e[0])}function me(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return 0===e.length||he(e)?function(t){return ue(fe.apply(void 0,e),n)(t)}:me()(e[0])}function ge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return de(e,["fulfilled"])}:he(e)?function(t){var n=e.map((function(e){return e.fulfilled}));return ce.apply(void 0,n)(t)}:ge()(e[0])}function ve(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return de(e,["pending","fulfilled","rejected"])}:he(e)?function(t){for(var n=[],r=0,o=e;r<o.length;r++){var i=o[r];n.push(i.pending,i.rejected,i.fulfilled)}return ce.apply(void 0,n)(t)}:ve()(e[0])}var be=function(e,t){if("function"!==typeof e)throw new TypeError(t+" is not a function")},ye=function(){},xe=function(e,t){return void 0===t&&(t=ye),e.catch(t),e},we=function(e,t){return e.addEventListener("abort",t,{once:!0}),function(){return e.removeEventListener("abort",t)}},Se=function(e,t){var n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},ke="listener",_e="completed",Ce="cancelled",Ee="task-"+Ce,Ae="task-"+_e,Te=ke+"-"+Ce,Oe=ke+"-"+_e,Pe=function(e){this.code=e,this.name="TaskAbortError",this.message="task "+Ce+" (reason: "+e+")"},ze=function(e){if(e.aborted)throw new Pe(e.reason)};function De(e,t){var n=ye;return new Promise((function(r,o){var i=function(){return o(new Pe(e.reason))};e.aborted?i():(n=we(e,i),t.finally((function(){return n()})).then(r,o))})).finally((function(){n=ye}))}var Re=function(e){return function(t){return xe(De(e,t).then((function(t){return ze(e),t})))}},je=function(e){var t=Re(e);return function(e){return t(new Promise((function(t){return setTimeout(t,e)})))}},Ne=Object.assign,Ie={},Me="listenerMiddleware",Fe=function(e,t){return function(n,r){be(n,"taskExecutor");var o,i=new AbortController;o=i,we(e,(function(){return Se(o,e.reason)}));var a,s,l=(a=function(){return w(void 0,null,(function(){var t;return u(this,(function(r){switch(r.label){case 0:return ze(e),ze(i.signal),[4,n({pause:Re(i.signal),delay:je(i.signal),signal:i.signal})];case 1:return t=r.sent(),ze(i.signal),[2,t]}}))}))},s=function(){return Se(i,Ae)},w(void 0,null,(function(){var e;return u(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return t.sent(),[4,a()];case 2:return[2,{status:"ok",value:t.sent()}];case 3:return[2,{status:(e=t.sent())instanceof Pe?"cancelled":"rejected",error:e}];case 4:return null==s||s(),[7];case 5:return[2]}}))})));return(null==r?void 0:r.autoJoin)&&t.push(l),{result:Re(e)(l),cancel:function(){Se(i,Ee)}}}},Le=function(e,t){return function(n,r){return xe(function(n,r){return w(void 0,null,(function(){var o,i,a,s;return u(this,(function(l){switch(l.label){case 0:ze(t),o=function(){},i=new Promise((function(t,r){var i=e({predicate:n,effect:function(e,n){n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});o=function(){i(),r()}})),a=[i],null!=r&&a.push(new Promise((function(e){return setTimeout(e,r,null)}))),l.label=1;case 1:return l.trys.push([1,,3,4]),[4,De(t,Promise.race(a))];case 2:return s=l.sent(),ze(t),[2,s];case 3:return o(),[7];case 4:return[2]}}))}))}(n,r))}},Be=function(e){var t=e.type,n=e.actionCreator,r=e.matcher,o=e.predicate,i=e.effect;if(t)o=E(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return be(i,"options.listener"),{predicate:o,type:t,effect:i}},Ue=function(e){var t=Be(e),n=t.type,r=t.predicate,o=t.effect;return{id:te(),effect:o,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}}},Ve=function(e){e.pending.forEach((function(e){Se(e,Te)}))},qe=function(e){return function(){e.forEach(Ve),e.clear()}},He=function(e,t,n){try{e(t,n)}catch(r){setTimeout((function(){throw r}),0)}},We=E(Me+"/add"),Ke=E(Me+"/removeAll"),$e=E(Me+"/remove"),Qe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,d([Me+"/error"],e))};function Xe(e){var t=this;void 0===e&&(e={});var n=new Map,r=e.extra,o=e.onError,i=void 0===o?Qe:o;be(i,"onError");var a=function(e){for(var t=0,r=Array.from(n.values());t<r.length;t++){var o=r[t];if(e(o))return o}},s=function(e){var t=a((function(t){return t.effect===e.effect}));return t||(t=Ue(e)),function(e){return e.unsubscribe=function(){return n.delete(e.id)},n.set(e.id,e),function(t){e.unsubscribe(),(null==t?void 0:t.cancelActive)&&Ve(e)}}(t)},l=function(e){var t=Be(e),n=t.type,r=t.effect,o=t.predicate,i=a((function(e){return("string"===typeof n?e.type===n:e.predicate===o)&&e.effect===r}));return i&&(i.unsubscribe(),e.cancelActive&&Ve(i)),!!i},c=function(e,o,a,l){return w(t,null,(function(){var t,c,d,h;return u(this,(function(u){switch(u.label){case 0:t=new AbortController,c=Le(s,t.signal),d=[],u.label=1;case 1:return u.trys.push([1,3,4,6]),e.pending.add(t),[4,Promise.resolve(e.effect(o,Ne({},a,{getOriginalState:l,condition:function(e,t){return c(e,t).then(Boolean)},take:c,delay:je(t.signal),pause:Re(t.signal),extra:r,signal:t.signal,fork:Fe(t.signal,d),unsubscribe:e.unsubscribe,subscribe:function(){n.set(e.id,e)},cancelActiveListeners:function(){e.pending.forEach((function(e,n,r){e!==t&&(Se(e,Te),r.delete(e))}))}})))];case 2:return u.sent(),[3,6];case 3:return(h=u.sent())instanceof Pe||He(i,h,{raisedBy:"effect"}),[3,6];case 4:return[4,Promise.allSettled(d)];case 5:return u.sent(),Se(t,Oe),e.pending.delete(t),[7];case 6:return[2]}}))}))},d=qe(n);return{middleware:function(e){return function(t){return function(r){if(!A(r))return t(r);if(We.match(r))return s(r.payload);if(!Ke.match(r)){if($e.match(r))return l(r.payload);var o,a=e.getState(),u=function(){if(a===Ie)throw new Error(Me+": getOriginalState can only be called synchronously");return a};try{if(o=t(r),n.size>0)for(var h=e.getState(),p=Array.from(n.values()),f=0,m=p;f<m.length;f++){var g=m[f],v=!1;try{v=g.predicate(r,h,a)}catch(b){v=!1,He(i,b,{raisedBy:"predicate"})}v&&c(g,r,e,u)}}finally{a=Ie}return o}d()}}},startListening:s,stopListening:l,clearListeners:d}}var Ge,Ze="RTK_autoBatch",Ye=function(){return function(e){var t;return{payload:e,meta:(t={},t[Ze]=!0,t)}}},Je="function"===typeof queueMicrotask?queueMicrotask.bind("undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:globalThis):function(e){return(Ge||(Ge=Promise.resolve())).then(e).catch((function(e){return setTimeout((function(){throw e}),0)}))},et=function(e){return function(t){setTimeout(t,e)}},tt="undefined"!==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:et(10),nt=function(e){return void 0===e&&(e={type:"raf"}),function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.apply(void 0,n),i=!0,a=!1,s=!1,l=new Set,c="tick"===e.type?Je:"raf"===e.type?tt:"callback"===e.type?e.queueNotification:et(e.timeout),u=function(){s=!1,a&&(a=!1,l.forEach((function(e){return e()})))};return Object.assign({},o,{subscribe:function(e){var t=o.subscribe((function(){return i&&e()}));return l.add(e),function(){t(),l.delete(e)}},dispatch:function(e){var t;try{return i=!(null==(t=null==e?void 0:e.meta)?void 0:t[Ze]),(a=!i)&&(s||(s=!0,c(u))),o.dispatch(e)}finally{i=!0}}})}}};(0,r.rF)()},9885:(e,t,n)=>{"use strict";n.d(t,{A:()=>v});var r=n(4067);const o=n(4306).A["__core-js_shared__"];var i=function(){var e=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();const a=function(e){return!!i&&i in e};var s=n(7664),l=n(6166),c=/^\[object .+?Constructor\]$/,u=Function.prototype,d=Object.prototype,h=u.toString,p=d.hasOwnProperty,f=RegExp("^"+h.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const m=function(e){return!(!(0,s.A)(e)||a(e))&&((0,r.A)(e)?f:c).test((0,l.A)(e))};const g=function(e,t){return null==e?void 0:e[t]};const v=function(e,t){var n=g(e,t);return m(n)?n:void 0}},9989:e=>{"use strict";var t=!("undefined"===typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},9993:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(4802),o=n(3903),i=n(3239),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;const s=function(e){return(0,i.A)(e)&&(0,o.A)(e.length)&&!!a[(0,r.A)(e)]};var l=n(7328),c=n(8187),u="object"==typeof exports&&exports&&!exports.nodeType&&exports,d=u&&"object"==typeof module&&module&&!module.nodeType&&module,h=d&&d.exports===u&&c.A.process,p=function(){try{var e=d&&d.require&&d.require("util").types;return e||h&&h.binding&&h.binding("util")}catch(t){}}();var f=p&&p.isTypedArray;const m=f?(0,l.A)(f):s}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};return(()=>{"use strict";n.d(r,{default:()=>Iv});var e=n(4391),t=n(5137);const o=globalThis,i=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),s=new WeakMap;let l=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&s.set(t,e))}return e}toString(){return this.cssText}};const c=e=>new l("string"==typeof e?e:e+"",void 0,a),u=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const o=1===e.length?e[0]:n.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new l(o,e,a)},d=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return c(t)})(e):e,{is:h,defineProperty:p,getOwnPropertyDescriptor:f,getOwnPropertyNames:m,getOwnPropertySymbols:g,getPrototypeOf:v}=Object,b=globalThis,y=b.trustedTypes,x=y?y.emptyScript:"",w=b.reactiveElementPolyfillSupport,S=(e,t)=>e,k={toAttribute(e,t){switch(t){case Boolean:e=e?x:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},_=(e,t)=>!h(e,t),C={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C;if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:o}=f(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);o?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??C}static _$Ei(){if(this.hasOwnProperty(S("elementProperties")))return;const e=v(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(S("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(S("properties"))){const e=this.properties,t=[...m(e),...g(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const e=this._$Eu(t,n);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(d(e))}else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(i)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=o.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:k).toAttribute(t,n.type);this._$Em=e,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:k;this._$Em=r;const i=o.fromAttribute(t,e.type);this[r]=i??this._$Ej?.get(r)??i,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const r=this.constructor,o=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??_)(o,t)||n.useDefault&&n.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,n,r){let{useDefault:o,reflect:i,wrapped:a}=n;o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,n,r)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(Oe){throw e=!1,this._$EM(),Oe}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[S("elementProperties")]=new Map,E[S("finalized")]=new Map,w?.({ReactiveElement:E}),(b.reactiveElementVersions??=[]).push("2.1.1");const A=globalThis,T=A.trustedTypes,O=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,P="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+z,R=`<${D}>`,j=document,N=()=>j.createComment(""),I=e=>null===e||"object"!=typeof e&&"function"!=typeof e,M=Array.isArray,F="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,U=/>/g,V=RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,H=/"/g,W=/^(?:script|style|textarea|title)$/i,K=e=>function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return{_$litType$:e,strings:t,values:r}},$=K(1),Q=(K(2),Symbol.for("lit-noChange")),X=Symbol.for("lit-nothing"),G=new WeakMap,Z=j.createTreeWalker(j,129);function Y(e,t){if(!M(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(t):t}class J{constructor(e,t){let n,{strings:r,_$litType$:o}=e;this.parts=[];let i=0,a=0;const s=r.length-1,l=this.parts,[c,u]=((e,t)=>{const n=e.length-1,r=[];let o,i=2===t?"<svg>":3===t?"<math>":"",a=L;for(let s=0;s<n;s++){const t=e[s];let n,l,c=-1,u=0;for(;u<t.length&&(a.lastIndex=u,l=a.exec(t),null!==l);)u=a.lastIndex,a===L?"!--"===l[1]?a=B:void 0!==l[1]?a=U:void 0!==l[2]?(W.test(l[2])&&(o=RegExp("</"+l[2],"g")),a=V):void 0!==l[3]&&(a=V):a===V?">"===l[0]?(a=o??L,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,n=l[1],a=void 0===l[3]?V:'"'===l[3]?H:q):a===H||a===q?a=V:a===B||a===U?a=L:(a=V,o=void 0);const d=a===V&&e[s+1].startsWith("/>")?" ":"";i+=a===L?t+R:c>=0?(r.push(n),t.slice(0,c)+P+t.slice(c)+z+d):t+z+(-2===c?s:d)}return[Y(e,i+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]})(r,o);if(this.el=J.createElement(c,t),Z.currentNode=this.el.content,2===o||3===o){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=Z.nextNode())&&l.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(P)){const t=u[a++],r=n.getAttribute(e).split(z),o=/([.?@])?(.*)/.exec(t);l.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?oe:"?"===o[1]?ie:"@"===o[1]?ae:re}),n.removeAttribute(e)}else e.startsWith(z)&&(l.push({type:6,index:i}),n.removeAttribute(e));if(W.test(n.tagName)){const e=n.textContent.split(z),t=e.length-1;if(t>0){n.textContent=T?T.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],N()),Z.nextNode(),l.push({type:2,index:++i});n.append(e[t],N())}}}else if(8===n.nodeType)if(n.data===D)l.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(z,e+1));)l.push({type:7,index:i}),e+=z.length-1}i++}}static createElement(e,t){const n=j.createElement("template");return n.innerHTML=e,n}}function ee(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3?arguments[3]:void 0;if(t===Q)return t;let o=void 0!==r?n._$Co?.[r]:n._$Cl;const i=I(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(e),o._$AT(e,n,r)),void 0!==r?(n._$Co??=[])[r]=o:n._$Cl=o),void 0!==o&&(t=ee(e,o._$AS(e,t.values),o,r)),t}class te{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??j).importNode(t,!0);Z.currentNode=r;let o=Z.nextNode(),i=0,a=0,s=n[0];for(;void 0!==s;){if(i===s.index){let t;2===s.type?t=new ne(o,o.nextSibling,this,e):1===s.type?t=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(t=new se(o,this,e)),this._$AV.push(t),s=n[++a]}i!==s?.index&&(o=Z.nextNode(),i++)}return Z.currentNode=j,r}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class ne{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e){e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),I(e)?e===X||null==e||""===e?(this._$AH!==X&&this._$AR(),this._$AH=X):e!==this._$AH&&e!==Q&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>M(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==X&&I(this._$AH)?this._$AA.nextSibling.data=e:this.T(j.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=J.createElement(Y(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new te(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=G.get(e.strings);return void 0===t&&G.set(e.strings,t=new J(e)),t}k(e){M(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,r=0;for(const o of e)r===t.length?t.push(n=new ne(this.O(N()),this.O(N()),this,this.options)):n=t[r],n._$AI(o),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,t=arguments.length>1?arguments[1]:void 0;for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class re{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,o){this.type=1,this._$AH=X,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=X}_$AI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=this.strings;let i=!1;if(void 0===o)e=ee(this,e,t,0),i=!I(e)||e!==this._$AH&&e!==Q,i&&(this._$AH=e);else{const r=e;let a,s;for(e=o[0],a=0;a<o.length-1;a++)s=ee(this,r[n+a],t,a),s===Q&&(s=this._$AH[a]),i||=!I(s)||s!==this._$AH[a],s===X?e=X:e!==X&&(e+=(s??"")+o[a+1]),this._$AH[a]=s}i&&!r&&this.j(e)}j(e){e===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class oe extends re{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===X?void 0:e}}class ie extends re{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==X)}}class ae extends re{constructor(e,t,n,r,o){super(e,t,n,r,o),this.type=5}_$AI(e){if((e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0)??X)===Q)return;const t=this._$AH,n=e===X&&t!==X||e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive,r=e!==X&&(t===X||n);n&&this.element.removeEventListener(this.name,this,t),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class se{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ee(this,e)}}const le={I:ne},ce=A.litHtmlPolyfillSupport;ce?.(J,ne),(A.litHtmlVersions??=[]).push("3.3.1");const ue=globalThis;class de extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const r=n?.renderBefore??t;let o=r._$litPart$;if(void 0===o){const e=n?.renderBefore??null;r._$litPart$=o=new ne(t.insertBefore(N(),e),e,void 0,n??{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}}de._$litElement$=!0,de.finalized=!0,ue.litElementHydrateSupport?.({LitElement:de});const he=ue.litElementPolyfillSupport;he?.({LitElement:de}),(ue.litElementVersions??=[]).push("4.2.1");const pe={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:_};function fe(e){return(t,n)=>"object"==typeof n?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pe,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;const{kind:r,metadata:o}=n;let i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),"setter"===r&&((e=Object.create(e)).wrapped=!0),i.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const o=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,o,e)},init(t){return void 0!==t&&this.C(r,void 0,e,t),t}}}if("setter"===r){const{name:r}=n;return function(n){const o=this[r];t.call(this,n),this.requestUpdate(r,o,e)}}throw Error("Unsupported decorator location: "+r)}(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var me=Object.defineProperty,ge=(e,t,n,r)=>{for(var o,i=void 0,a=e.length-1;a>=0;a--)(o=e[a])&&(i=o(t,n,i)||i);return i&&me(t,n,i),i};const ve=class extends de{constructor(){super(),this.preRender=!1,Object.entries(this.constructor.dependencies).forEach((e=>{let[t,n]=e;this.constructor.define(t,n)}))}emit(e,t){const n=new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:{},...t});return this.dispatchEvent(n),n}static define(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=customElements.get(e);if(!r){try{customElements.define(e,t,n)}catch{customElements.define(e,class extends t{},n)}return}let o=" (unknown version)",i=o;"version"in t&&t.version&&(o=" v"+t.version),"version"in r&&r.version&&(i=" v"+r.version),(!o||!i||o!==i)&&console.warn(`Attempted to register <${e}>${o}, but <${e}>${i} has already been registered.`)}static createProperty(e,t){super.createProperty(e,t),t?.attribute&&"string"==typeof t.attribute&&!Object.prototype.hasOwnProperty.call(this.prototype,t.attribute)&&Object.prototype.hasOwnProperty.call(this.prototype,e)&&Object.defineProperty(this.prototype,t.attribute,{get(){return this[e]},set(t){this[e]=t}})}firstUpdated(e){super.firstUpdated(e),!this.preRender&&this.runFirstUpdated(e)}runFirstUpdated(e){}adoptedCallback(){ye(this)}disconnectedCallback(){super.disconnectedCallback(),ye(this)}};ve.version="1",ve.dependencies={};let be=ve;function ye(e){if(e instanceof be)return;const t=e.localName||e.tagName,n=customElements.get(t.toLowerCase());n&&Object.setPrototypeOf(e,n.prototype)}ge([fe()],be.prototype,"dir"),ge([fe()],be.prototype,"lang"),ge([fe({attribute:"pre-render",type:Boolean})],be.prototype,"preRender");const xe=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.get(e)||window.customElements.define(e,t),t))(e,t):((e,t)=>{const{elements:n,kind:r}=t;return{elements:n,finisher(t){window.customElements.get(e)||window.customElements.define(e,t)},kind:r}})(e,t),we=u`
1040
+ `;var Hr=n(2246);const Wr={containerSize:{width:0,height:0},currentCount:0,currentFolder:Nt,defaultPageSize:Ut.md,facets:[],hasScrolled:!1,isLoading:!1,isSeeThrough:!0,openBrowser:!1,start:0,pageSize:0,maxPageSize:0,searchText:"",selectedFacets:{},shouldResetFilters:!0,sortDirection:void 0,sortOrder:"",totalCount:0,view:Qt.gf.Medium},Kr=(e,t)=>{const n={start:0,pageSize:e.maxPageSize};switch(t.type){case"SET_CONTAINER_SIZE":return{...e,containerSize:t.payload};case"SET_CURRENT_COUNT":return{...e,currentCount:t.payload};case"SET_CURRENT_FOLDER":return{...e,currentFolder:t.payload.folder,shouldResetFilters:!!t.payload.shouldResetFilters,...n};case"SET_FACETS":return{...e,facets:t.payload};case"SET_FILTERS":return{...e,selectedFacets:t.payload,shouldResetFilters:!1,...n};case"SET_HAS_SCROLLED":return{...e,hasScrolled:t.payload};case"SET_IS_LOADING":return{...e,isLoading:t.payload};case"SET_IS_SEE_THROUGH":return{...e,isSeeThrough:t.payload,...n};case"SET_OPEN_BROWSER":return{...e,openBrowser:t.payload};case"SET_START":return{...e,start:t.payload,pageSize:e.defaultPageSize};case"SET_PAGE_SIZE":{const n={...e,pageSize:t.payload.pageSize,maxPageSize:t.payload.pageSize};return t.payload.returnToFirstPage&&(n.start=0),n}case"SET_SEARCH_TEXT":return{...e,...n,searchText:t.payload};case"SET_SORT_DIRECTION":return{...e,...n,sortDirection:t.payload};case"SET_SORT_ORDER":return{...e,...n,sortOrder:t.payload};case"SET_TOTAL_COUNT":return{...e,totalCount:t.payload};case"SET_VIEW":{let n=Ut.md;switch(t.payload){case Qt.gf.Large:n=15;break;case Qt.gf.Medium:n=20;break;case Qt.gf.Small:n=30}return{...e,view:t.payload,defaultPageSize:n}}case"RESET_SEARCH":return{...e,currentCount:0,currentFolder:Nt,searchText:"",totalCount:0};default:return e}},$r=()=>{var e;const[t,n]=(0,wt.useReducer)(Kr,Wr),r=(0,Fr.GV)(Br.jT),o=(0,Fr.GV)(Br.wL),i=(0,Fr.GV)(Lr.OC),{allowedExtensions:a,allowedFolders:s,allowFavorites:l,allowPin:c,allowProxy:u,allowTracking:d,availableDocTypes:h,availableRepresentativeSubtypes:p,ctaText:f,lastLocationMode:m,persistMode:g,showCollections:v,showFavoriteFolder:b,showVersions:y,defaultGridView:x}=(0,wt.useContext)(ar.t),{extraFields:w,onAssetAction:S,onAssetSelected:k,onClose:_}=(0,wt.useContext)(zt.B),{data:C,isFetching:E,isError:A}=(0,Rt.aM)(i?{id:i,useSession:o}:Ft.hT),T=(0,wt.useMemo)((()=>C&&i&&C.recordId===i?C:null),[C,i]),{data:O,isFetching:P,isLoading:z,refetch:D}=(0,Ur.X)({});(0,wt.useEffect)((()=>{r&&D()}),[r,D]);const{data:R,isFetching:j,isError:N}=(0,Yn.t$)(T?{assetImages:T?[T]:[],useSession:o}:Ft.hT),{data:I}=(0,Yn.jS)({useSession:o}),{data:M}=(0,Yn.M$)({useSession:o}),{ATSEnabled:F,autoExtension:L=".auto",collectionPath:B,supportedExtensions:U,supportedRepresentativeSubtypes:V}=M||{},{data:q}=(0,Yn.ZP)({useSession:o}),{data:H}=(0,Yn.nb)({useSession:o}),{data:W,refetch:K}=(0,Rt.E7)(T&&l?{recordId:T.id}:Ft.hT),[$,Q]=(0,wt.useState)(!1),[X,G]=(0,wt.useState)(!1),[Z,Y]=(0,wt.useState)(sn.EI.Hide),[J,ee]=(0,wt.useState)(0),[te,ne]=(0,wt.useState)(!1),[re,oe]=(0,wt.useState)(!1),ie=(0,wt.useRef)($),ae=(0,wt.useRef)(null),le=(0,wt.useRef)(null),ce=(0,wt.useRef)(null),ue=(0,wt.useRef)(!1),de=(0,wt.useRef)([]),he=(0,wt.useRef)({}),pe=(0,Fr.jL)(),fe=(0,wt.useRef)(t.pageSize),me=(0,wt.useRef)(t.view),ge=(0,wt.useRef)(!1),ve=(0,wt.useRef)(null);ie.current=$,de.current=t.facets,he.current=t.selectedFacets,me.current=t.view,fe.current=t.pageSize;const be=(0,wt.useRef)(null),ye=(0,wt.useMemo)((()=>t.selectedFacets.Types&&t.selectedFacets.Types.length>0?t.selectedFacets.Types:["*"]),[t.selectedFacets]),xe=(0,wt.useMemo)((()=>!(null!==ye&&void 0!==ye&&ye.length)||0===ye.length),[ye]),we=(0,wt.useMemo)((()=>{var e;if(!q)return;const r=null===(e=Object.values(q).find((e=>e.some((e=>e.isDefault)))))||void 0===e?void 0:e[0];return t.sortOrder&&q[t.sortOrder]&&0!==q[t.sortOrder].length?1===q[t.sortOrder].length?q[t.sortOrder][0]:q[t.sortOrder].find((e=>{let{sortDirection:n}=e;return n.toLowerCase()===t.sortDirection})):(r&&(n({type:"SET_SORT_DIRECTION",payload:r.sortDirection.toLowerCase()}),n({type:"SET_SORT_ORDER",payload:r.sortDirectionGroupKey.toLowerCase()})),r)}),[q,t.sortDirection,t.sortOrder]),Se=(0,wt.useMemo)((()=>null===R||void 0===R?void 0:R.proxies.filter((e=>{if(!a||0===a.length)return!0;let t="";if(e.extension)t=e.extension.replace(".","");else{var n;const r=null===(n=e.permanentLink)||void 0===n?void 0:n.split(".").at(-1);t=null!==r&&void 0!==r?r:""}return a.some((e=>!!t&&t.toLowerCase()===e.toLowerCase()))}))),[R,a]),_e=(0,wt.useMemo)((()=>X&&q&&(null===ye||void 0===ye?void 0:ye.length)&&$),[X,q,ye,$]),{data:Ce,isFetching:Ee,isError:Ae,refetch:Te}=(0,Rt.pf)(_e?{folderID:t.currentFolder.id,isSeeThrough:t.isSeeThrough,limitedToDocTypes:h,pageSize:t.pageSize,searchText:t.searchText,selectedFacets:t.selectedFacets,sortOrder:null===we||void 0===we?void 0:we.id,start:t.start,useSession:o}:Ft.hT);(0,wt.useEffect)((()=>{var e;ee(null!==(e=null===Ce||void 0===Ce?void 0:Ce.items.length)&&void 0!==e?e:0)}),[null===Ce||void 0===Ce?void 0:Ce.items.length]),(0,wt.useEffect)((()=>{A&&pe((0,Lr.DM)(null))}),[pe,A]),(0,wt.useEffect)((()=>{S&&null!==T&&void 0!==T&&T.recordId&&S("select",T.recordId)}),[S,T]),(0,wt.useEffect)((()=>{let e=null;return Ee?n({type:"SET_IS_LOADING",payload:!0}):e=setTimeout((()=>{n({type:"SET_IS_LOADING",payload:Ee})}),200),()=>{e&&clearTimeout(e)}}),[Ee]),(0,wt.useEffect)((()=>{r&&(pe((0,Lr.DM)(null)),n({type:"RESET_SEARCH"}),Promise.all([(0,Mt.bQ)("selectedSortOrder"),(0,Mt.bQ)("selectedSortDirection"),(0,Mt.bQ)("selectedView"),(0,Mt.bQ)("newFacets"),(0,Mt.bQ)("selectedFilter"),(0,Mt.bQ)("selectedIsSeeThrough"),(0,Mt.bQ)("searchText")]).then((e=>{let[t,r,o,i,a,s,l]=e;if(t&&n({type:"SET_SORT_ORDER",payload:t}),"ascending"!==r&&"descending"!==r||n({type:"SET_SORT_DIRECTION",payload:r}),null===o&&(o=x),"string"===typeof o&&(Object.values(Qt.gf).includes(o)?n({type:"SET_VIEW",payload:o}):n({type:"SET_VIEW",payload:Qt.gf.Medium})),m){if(i){const e=JSON.parse(i);(0,Xe.A)(e)?n({type:"SET_FACETS",payload:e}):n({type:"SET_FACETS",payload:[]})}if(a){const e=JSON.parse(a);n(e?{type:"SET_FILTERS",payload:xt(e,Xe.A)}:{type:"SET_FILTERS",payload:{}})}s&&n({type:"SET_IS_SEE_THROUGH",payload:"true"===s}),l&&n({type:"SET_SEARCH_TEXT",payload:l}),ue.current=!0,oe(!0)}})))}),[pe,r,m,x]),(0,wt.useEffect)((()=>{let e=null;const t=ae.current;if(!t)return;const n=t.offsetWidth;return t.style.width=n-1+"px",e=setTimeout((()=>{t.style.width="100%"}),50),()=>{e&&clearTimeout(e)}}),[r]),(0,wt.useEffect)((()=>{const e=ce.current;if(!e)return;ae.current&&n({type:"SET_CONTAINER_SIZE",payload:{width:ae.current.offsetWidth,height:ae.current.offsetHeight}});const t=e=>{const t=e.detail.entries;window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&t[0].target===ae.current&&n({type:"SET_CONTAINER_SIZE",payload:{width:t[0].contentRect.width,height:t[0].contentRect.height}})}))};return e.addEventListener("cx-resize",t),()=>{e.removeEventListener("cx-resize",t)}}),[re]),(0,wt.useEffect)((()=>{!we&&ue.current&&n({type:"SET_SORT_ORDER",payload:Wr.sortOrder})}),[we,q]),(0,wt.useEffect)((()=>{ue.current&&((0,Mt.yt)("selectedSortOrder",t.sortOrder),t.sortDirection&&(0,Mt.yt)("selectedSortDirection",t.sortDirection),(0,Mt.yt)("selectedView",t.view),(0,Mt.yt)("newFacets",JSON.stringify(t.facets)),(0,Mt.yt)("selectedFilter",JSON.stringify(t.selectedFacets)),(0,Mt.yt)("selectedIsSeeThrough",t.isSeeThrough.toString()),(0,Mt.yt)("searchText",t.searchText))}),[t.currentFolder,t.facets,t.isSeeThrough,t.sortDirection,t.sortOrder,t.searchText,t.view,t.selectedFacets]);const Oe=t.containerSize.width>0&&t.containerSize.width<=Ut.Pm,Pe=e=>{pe((0,Lr.DM)(e.recordId))},ze=(0,wt.useCallback)((e=>{pe((0,Lr.DM)(null)),n({type:"SET_SEARCH_TEXT",payload:e})}),[pe]),De=(0,wt.useRef)(0),Re=(0,wt.useRef)(0),je=(0,wt.useRef)(t.defaultPageSize);je.current=t.defaultPageSize;const Ne=(0,wt.useCallback)(((e,t)=>{var r;const{width:o,height:i}=e,a=o||0,s=i||0;if(a*s===0||!ue.current)return;const l=De.current,c=Re.current;if(Math.abs(l-s)<10&&Math.abs(c-a)<10&&(null===t||void 0===t||!t.force))return;De.current=s,Re.current=a;const u=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cx-spacing-medium")||"16",10),d=(null===(r=Rr[me.current])||void 0===r?void 0:r.minWidth)||Rr[Qt.gf.Large].minWidth,h=Math.max(1,Math.floor((a+u)/(d+u))),p=Math.ceil(s/(d+u)),f=Math.ceil(p*h/je.current+1)*je.current;G(!0),f!==fe.current&&0!==f&&n({type:"SET_PAGE_SIZE",payload:{pageSize:f,returnToFirstPage:!(null===t||void 0===t||!t.returnToFirstPage)}})}),[]),Ie=(0,wt.useMemo)((()=>ke(Ne,Ut.h,{leading:!1})),[Ne]);(0,wt.useEffect)((()=>{if(ue.current){const e=le.current;me.current=t.view,e&&Ie({width:e.clientWidth,height:e.clientHeight},{returnToFirstPage:!0,force:!0})}}),[Ie,t.view]);const Me=(0,wt.useCallback)(((e,t)=>{switch(e){case"view":n({type:"SET_VIEW",payload:t});break;case"sortDirection":n({type:"SET_SORT_DIRECTION",payload:t});break;case"sortOrder":n({type:"SET_SORT_ORDER",payload:t.toString()});break;case"isSeeThrough":n({type:"SET_IS_SEE_THROUGH",payload:Boolean(t)});break;case"filter":n({type:"SET_FILTERS",payload:t})}}),[]),Fe=(0,wt.useCallback)((e=>{n({type:"SET_CURRENT_COUNT",payload:e.currentCount}),n({type:"SET_TOTAL_COUNT",payload:e.totalCount}),n({type:"SET_FACETS",payload:e.facets})}),[]),Le=(0,wt.useCallback)((async e=>{ie.current||Q(!0);const t=await pe(It(e));It.fulfilled.match(t)&&(n({type:"SET_CURRENT_FOLDER",payload:{folder:e,shouldResetFilters:ie.current}}),te||n({type:"SET_OPEN_BROWSER",payload:!1}),pe((0,Lr.DM)(null)),(0,Mt.yt)("lastLocation",JSON.stringify(e)))}),[pe,te]),Be=(0,wt.useCallback)((()=>{ge.current?ge.current=!1:n({type:"SET_START",payload:null!==J&&void 0!==J?J:0})}),[J]),Ue=(0,wt.useCallback)((e=>{if(!e.target)return;const t=e.target.scrollTop;n(0===t?{type:"SET_HAS_SCROLLED",payload:!1}:{type:"SET_HAS_SCROLLED",payload:!0})}),[]),Ve=(0,wt.useCallback)((async(e,t,n)=>{const r=[...e];Dt.Yq.forEach((e=>{const o=se(e);var i,a,s,l,c,u,d,h,p,f;T&&null!==w&&void 0!==w&&w.includes(e)&&(r[0]={...r[0],extraFields:{...(null===(i=r[0])||void 0===i?void 0:i.extraFields)||{},[e]:T[o]}});n?r[0]={...r[0],assetTransformationSource:t,assetLinkInfo:{extension:n.extension,isCustomFormat:null===(a=n.isCustomFormat)||void 0===a||a,permanentLink:r[0].imageUrl,width:n.width,height:n.height}}:r[0]={...r[0],assetLinkInfo:{cdnName:null!==(s=null===t||void 0===t?void 0:t.cdnName)&&void 0!==s?s:null,extension:null!==(l=null===t||void 0===t?void 0:t.extension)&&void 0!==l?l:null,isCustomFormat:null!==(c=null===t||void 0===t?void 0:t.isCustomFormat)&&void 0!==c&&c,permanentLink:null!==(u=r[0].imageUrl)&&void 0!==u?u:null,proxyLabel:null!==(d=null===t||void 0===t?void 0:t.proxyLabel)&&void 0!==d?d:null,proxyName:null!==(h=null===t||void 0===t?void 0:t.proxyName)&&void 0!==h?h:null,width:null!==(p=null===t||void 0===t?void 0:t.width)&&void 0!==p?p:null,height:null!==(f=null===t||void 0===t?void 0:t.height)&&void 0!==f?f:null}}}));const o=k(r);if("object"===typeof(i=o)&&null!==i&&"function"===typeof i.then)try{await o}catch(a){return void console.error("Error in onAssetSelected:",a)}var i;g||null===_||void 0===_||_()}),[w,k,_,g,T]),qe=(0,wt.useMemo)((()=>!!Ce&&t.start+t.pageSize<t.totalCount),[Ce,t.pageSize,t.start,t.totalCount]);(0,wt.useEffect)((()=>{if(Fe){var e,t,n,r,o;const i=new Map(de.current.map((e=>[`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`,{...e,values:e.values.reduce(((t,n)=>{var r;return(null===(r=he.current[e.facetDetails.facetFieldName])||void 0===r?void 0:r.find((e=>e===n.value)))&&t.push({...n,count:0}),t}),[])}])));(null!==(e=null===Ce||void 0===Ce||null===(t=Ce.facets)||void 0===t?void 0:t.filter((e=>e.values.length>0)))&&void 0!==e?e:[]).forEach((e=>{var t;const n=i.get(`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`),r=[...e.values,...null!==(t=null===n||void 0===n?void 0:n.values.filter((t=>!(null!==e&&void 0!==e&&e.values.find((e=>t.value===e.value&&t.displayValue===e.displayValue))))))&&void 0!==t?t:[]];i.set(`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`,{...e,values:r})})),Fe({currentCount:null!==(n=null===Ce||void 0===Ce?void 0:Ce.items.length)&&void 0!==n?n:0,items:null!==(r=null===Ce||void 0===Ce?void 0:Ce.items)&&void 0!==r?r:[],facets:Array.from(i.values()),totalCount:null!==(o=null===Ce||void 0===Ce?void 0:Ce.totalCount)&&void 0!==o?o:0})}}),[Ce,Fe]),(0,wt.useEffect)((()=>{const e=()=>{ge.current=!0,ve.current&&clearTimeout(ve.current),ve.current=setTimeout((()=>{ge.current=!1}),Ut.h)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,wt.useEffect)((()=>{const e=be.current,t=()=>{e&&window.clearTimeout(e)};return t(),E||j?(Y(sn.EI.Hide),be.current=window.setTimeout((()=>{Y(sn.EI.ShowLoader)}),800)):E||j||!(null!==R&&void 0!==R&&R.proxies||N)||be.current&&(t(),Y(sn.EI.ShowDialog)),()=>{t()}}),[R,N,j,E]),(0,wt.useEffect)((()=>{T||Y(sn.EI.ShowDialog)}),[T]);const He=(0,wt.useMemo)((()=>I&&a&&0!==a.length?Object.entries(I).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:r.filter((e=>!a||0===a.length||a.some((t=>e.value.toLowerCase()===`.${t.toLowerCase()}`))))}}),I):I),[I,a]),We=t.containerSize.width<650;return re?(0,Vt.jsx)("cx-resize-observer",{ref:ce,children:(0,Vt.jsxs)(Vr,{ref:ae,children:[(0,Vt.jsx)(Jt,{allowedFolders:s,allowPin:c,collectionPath:B,currentFolder:t.currentFolder,favoriteFolderId:null===O||void 0===O?void 0:O.favoriteFolderRecordID,lastLocationMode:m,open:t.openBrowser,showCollections:v,showFavoriteFolder:b,useSession:o,onFolderSelect:Le,onClose:()=>n({type:"SET_OPEN_BROWSER",payload:!1}),isPersistent:te,onChangePersistent:ne,forceOverlay:We,damViewSeeThru:t.isSeeThrough}),(0,Vt.jsxs)(qr,{children:[(0,Vt.jsx)(lr,{bordered:t.hasScrolled,currentFolder:t.currentFolder,isFetching:P,isLoading:z,userInfo:O,onMenuClick:()=>n({type:"SET_OPEN_BROWSER",payload:!0}),onLogout:()=>{pe((0,Br.ri)()),pe((0,Lr.DM)(null)),n({type:"RESET_SEARCH"})},children:(0,Vt.jsx)(an,{allowSorting:"Mono"!==(null===we||void 0===we?void 0:we.sortDirection)&&!!we,availableFacets:null!==H&&void 0!==H?H:[],currentCount:t.currentCount,facets:t.facets,isMobile:Oe,isSeeThrough:t.isSeeThrough,loading:t.isLoading,searchValue:t.searchText,selectedFacets:t.selectedFacets,sortDirection:t.sortDirection,sortOrder:t.sortOrder,sortOrders:q,totalCount:t.totalCount,view:t.view,onSearchChange:ze,onSettingChange:Me})}),(0,Vt.jsx)("div",{style:{flex:1,minHeight:"320px",padding:"0 var(--cx-spacing-medium)",position:"relative"},children:(0,Vt.jsx)(Pt,{onResize:Ie,children:e=>{let{height:n,width:r}=e;return(0,Vt.jsx)("div",{style:{height:n+"px",width:r+"px"},children:(0,Vt.jsx)(Mr,{ref:le,isError:Ae,isConfigError:xe,hasNextPage:qe,height:n,isLoadingData:t.isLoading||!Ce,isFetched:!!Ce||xe,items:(null===Ce||void 0===Ce?void 0:Ce.items)||[],selectedAsset:null!==T&&void 0!==T?T:null,view:t.view,width:r,onItemSelect:Pe,onLoadMore:Be,onScroll:Ue},t.currentFolder.id+t.searchText+Object.values(t.selectedFacets).join("+")+t.isSeeThrough+t.view)})}})}),Z===sn.EI.ShowLoader&&(0,Vt.jsx)("cx-space",{className:"format-loader",children:(0,Vt.jsx)("cx-spinner",{})}),(0,Vt.jsx)(ir,{allowCustomFormat:!!F&&!(null===T||void 0===T||!T.allowATSLink),allowFavorites:l,allowProxy:u,allowTracking:d,allowedExtensions:a,appendAutoExtension:null!==(e=null===a||void 0===a?void 0:a.includes(L))&&void 0!==e&&e,autoExtension:L,availableExtensions:He,availableProxies:N?[]:j?void 0:Se,ctaText:f,extensions:null!==U&&void 0!==U?U:[],isFavorite:!!W,maxHeight:t.containerSize.height,open:!!T&&Z===sn.EI.ShowDialog,previewUrl:N||j||null===R||void 0===R?void 0:R.previewUrl,selectedAsset:null!==T&&void 0!==T?T:null,showVersions:y,supportedRepresentativeSubtypes:null!==p&&void 0!==p&&p.length?Qe(p,V):V,variant:Oe?"drawer":"dialog",boundary:ae.current,onClose:()=>{pe((0,Lr.DM)(null)),S("unselect","")},onFavorite:async()=>{if(!T)return!1;const e=await pe((0,Lr.P1)({recordId:T.recordId}));return Lr.P1.fulfilled.match(e)&&(S&&S("favorite",T.recordId),await K(),S&&S("afterFavorite",T.recordId),t.currentFolder.id===(null===O||void 0===O?void 0:O.favoriteFolderRecordID)&&(0===t.start?Te():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e},onProxyConfirm:async e=>{let{extension:t,value:n,permanentLink:r,parameters:i,useRepresentative:a,selectedProxyMetadata:s}=e;if(!T)return;const l=await pe((0,Lr.Tp)({extension:t,extraFields:w,parameters:i,permanentLink:r,proxiesPreference:n,selectedAsset:T,useRepresentative:a,useSession:o}));Lr.Tp.fulfilled.match(l)&&await Ve(l.payload,s)},onFormatConfirm:async e=>{let{value:t,parameters:n,proxiesPreference:r,extension:i,sourceProxyMetadata:a,transformedAssetMetadata:s}=e;if(!T)return;const l=null!==T&&void 0!==T&&T.width?parseInt(T.width,10):0,c=null!==T&&void 0!==T&&T.height?parseInt(T.height,10):0,u=await pe((0,Lr.Tp)({extraFields:w,extension:i,maxHeight:c,maxWidth:l,parameters:n,proxiesPreference:r,selectedAsset:T,useSession:o,transformations:t}));Lr.Tp.fulfilled.match(u)&&await Ve(u.payload,a,s)},onUnFavorite:async()=>{if(!T)return!1;const e=await pe((0,Lr.BZ)({recordId:T.recordId}));return Lr.BZ.fulfilled.match(e)&&(S&&S("unfavorite",T.recordId),await K(),S&&S("afterUnfavorite",T.recordId),t.currentFolder.id===(null===O||void 0===O?void 0:O.favoriteFolderRecordID)&&(0===t.start?Te():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e}})]})]})}):(0,Vt.jsx)(Hr.A,{})}},8853:(e,t,n)=>{"use strict";e.exports=n(5896)},8879:(e,t,n)=>{"use strict";n.d(t,{xP:()=>z});var r=n(4657),o=n(2222),i=n(5043),a=n(5137),s=n(9815),l=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},c=Object.defineProperty,u=Object.defineProperties,d=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,m=function(e,t,n){return t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},g=function(e,t){for(var n in t||(t={}))p.call(t,n)&&m(e,n,t[n]);if(h)for(var r=0,o=h(t);r<o.length;r++){n=o[r];f.call(t,n)&&m(e,n,t[n])}return e},v=function(e,t){return u(e,d(t))};function b(e,t,n,r){var o=(0,i.useMemo)((function(){return{queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}}),[e,t,n,r]),a=(0,i.useRef)(o);return(0,i.useEffect)((function(){a.current.serialized!==o.serialized&&(a.current=o)}),[o]),a.current.serialized===o.serialized?a.current.queryArgs:e}var y=Symbol();function x(e){var t=(0,i.useRef)(e);return(0,i.useEffect)((function(){(0,a.bN)(t.current,e)||(t.current=e)}),[e]),(0,a.bN)(t.current,e)?t.current:e}var w,S,k=WeakMap?new WeakMap:void 0,_=function(e){var t=e.endpointName,n=e.queryArgs,r="",o=null==k?void 0:k.get(n);if("string"===typeof o)r=o;else{var i=JSON.stringify(n,(function(e,t){return(0,s.isPlainObject)(t)?Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{}):t}));(0,s.isPlainObject)(n)&&(null==k||k.set(n,i)),r=i}return t+"("+r+")"},C="undefined"!==typeof window&&window.document&&window.document.createElement?i.useLayoutEffect:i.useEffect,E=function(e){return e},A=function(e){return e.isUninitialized?v(g({},e),{isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:r.RE.pending}):e};function T(e){return e.replace(e[0],e[0].toUpperCase())}function O(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,l([e],t))}(S=w||(w={})).query="query",S.mutation="mutation";var P=Symbol();var z=(0,r.l0)((0,r.m7)(),function(e){var t=void 0===e?{}:e,n=t.batch,s=void 0===n?a.vA:n,l=t.useDispatch,c=void 0===l?a.wA:l,u=t.useSelector,d=void 0===u?a.d4:u,h=t.useStore,p=void 0===h?a.Pj:h,f=t.unstable__sideEffectsInRender,m=void 0!==f&&f;return{name:P,init:function(e,t,n){var l=t.serializeQueryArgs,u=e,h=function(e){var t=e.api,n=e.moduleOptions,s=n.batch,l=n.useDispatch,c=n.useSelector,u=n.useStore,d=n.unstable__sideEffectsInRender,h=e.serializeQueryArgs,p=e.context,f=d?function(e){return e()}:i.useEffect;return{buildQueryHooks:function(e){var n=function(n,o){var a=void 0===o?{}:o,s=a.refetchOnReconnect,c=a.refetchOnFocus,u=a.refetchOnMountOrArgChange,d=a.skip,h=void 0!==d&&d,m=a.pollingInterval,g=void 0===m?0:m,v=t.endpoints[e].initiate,y=l(),w=b(h?r.hT:n,_,p.endpointDefinitions[e],e),S=x({refetchOnReconnect:s,refetchOnFocus:c,pollingInterval:g}),k=(0,i.useRef)(!1),C=(0,i.useRef)(),E=C.current||{},A=E.queryCacheKey,T=E.requestId,O=!1;if(A&&T){var P=y(t.internalActions.internal_probeSubscription({queryCacheKey:A,requestId:T}));O=!!P}var z=!O&&k.current;return f((function(){k.current=O})),f((function(){z&&(C.current=void 0)}),[z]),f((function(){var e,t=C.current;if(w===r.hT)return null==t||t.unsubscribe(),void(C.current=void 0);var n=null==(e=C.current)?void 0:e.subscriptionOptions;if(t&&t.arg===w)S!==n&&t.updateSubscriptionOptions(S);else{null==t||t.unsubscribe();var o=y(v(w,{subscriptionOptions:S,forceRefetch:u}));C.current=o}}),[y,v,u,w,S,z]),(0,i.useEffect)((function(){return function(){var e;null==(e=C.current)||e.unsubscribe(),C.current=void 0}}),[]),(0,i.useMemo)((function(){return{refetch:function(){var e;if(!C.current)throw new Error("Cannot refetch a query that has not been started yet.");return null==(e=C.current)?void 0:e.refetch()}}}),[])},d=function(n){var r=void 0===n?{}:n,o=r.refetchOnReconnect,a=r.refetchOnFocus,c=r.pollingInterval,u=void 0===c?0:c,d=t.endpoints[e].initiate,h=l(),p=(0,i.useState)(y),m=p[0],g=p[1],v=(0,i.useRef)(),b=x({refetchOnReconnect:o,refetchOnFocus:a,pollingInterval:u});f((function(){var e,t,n=null==(e=v.current)?void 0:e.subscriptionOptions;b!==n&&(null==(t=v.current)||t.updateSubscriptionOptions(b))}),[b]);var w=(0,i.useRef)(b);f((function(){w.current=b}),[b]);var S=(0,i.useCallback)((function(e,t){var n;return void 0===t&&(t=!1),s((function(){var r;null==(r=v.current)||r.unsubscribe(),v.current=n=h(d(e,{subscriptionOptions:w.current,forceRefetch:!t})),g(e)})),n}),[h,d]);return(0,i.useEffect)((function(){return function(){var e;null==(e=null==v?void 0:v.current)||e.unsubscribe()}}),[]),(0,i.useEffect)((function(){m===y||v.current||S(m,!0)}),[m,S]),(0,i.useMemo)((function(){return[S,m]}),[S,m])},w=function(n,s){var l=void 0===s?{}:s,d=l.skip,f=void 0!==d&&d,g=l.selectFromResult,v=t.endpoints[e].select,y=b(f?r.hT:n,h,p.endpointDefinitions[e],e),x=(0,i.useRef)(),w=(0,i.useMemo)((function(){return(0,o.createSelector)([v(y),function(e,t){return t},function(e){return y}],m)}),[v,y]),S=(0,i.useMemo)((function(){return g?(0,o.createSelector)([w],g):w}),[w,g]),k=c((function(e){return S(e,x.current)}),a.bN),_=u(),E=w(_.getState(),x.current);return C((function(){x.current=E}),[E]),k};return{useQueryState:w,useQuerySubscription:n,useLazyQuerySubscription:d,useLazyQuery:function(e){var t=d(e),n=t[0],r=t[1],o=w(r,v(g({},e),{skip:r===y})),a=(0,i.useMemo)((function(){return{lastArg:r}}),[r]);return(0,i.useMemo)((function(){return[n,o,a]}),[n,o,a])},useQuery:function(e,t){var o=n(e,t),a=w(e,g({selectFromResult:e===r.hT||(null==t?void 0:t.skip)?void 0:A},t)),s=a.data,l=a.status,c=a.isLoading,u=a.isSuccess,d=a.isError,h=a.error;return(0,i.useDebugValue)({data:s,status:l,isLoading:c,isSuccess:u,isError:d,error:h}),(0,i.useMemo)((function(){return g(g({},a),o)}),[a,o])}}},buildMutationHook:function(e){return function(n){var r=void 0===n?{}:n,u=r.selectFromResult,d=void 0===u?E:u,h=r.fixedCacheKey,p=t.endpoints[e],f=p.select,m=p.initiate,b=l(),y=(0,i.useState)(),x=y[0],w=y[1];(0,i.useEffect)((function(){return function(){(null==x?void 0:x.arg.fixedCacheKey)||null==x||x.reset()}}),[x]);var S=(0,i.useCallback)((function(e){var t=b(m(e,{fixedCacheKey:h}));return w(t),t}),[b,m,h]),k=(x||{}).requestId,_=(0,i.useMemo)((function(){return(0,o.createSelector)([f({fixedCacheKey:h,requestId:null==x?void 0:x.requestId})],d)}),[f,x,d,h]),C=c(_,a.bN),A=null==h?null==x?void 0:x.arg.originalArgs:void 0,T=(0,i.useCallback)((function(){s((function(){x&&w(void 0),h&&b(t.internalActions.removeMutationResult({requestId:k,fixedCacheKey:h}))}))}),[b,h,x,k]),O=C.endpointName,P=C.data,z=C.status,D=C.isLoading,R=C.isSuccess,j=C.isError,N=C.error;(0,i.useDebugValue)({endpointName:O,data:P,status:z,isLoading:D,isSuccess:R,isError:j,error:N});var I=(0,i.useMemo)((function(){return v(g({},C),{originalArgs:A,reset:T})}),[C,A,T]);return(0,i.useMemo)((function(){return[S,I]}),[S,I])}},usePrefetch:function(e,n){var r=l(),o=x(n);return(0,i.useCallback)((function(n,i){return r(t.util.prefetch(e,n,g(g({},o),i)))}),[e,r,o])}};function m(e,t,n){if((null==t?void 0:t.endpointName)&&e.isUninitialized){var r=t.endpointName,o=p.endpointDefinitions[r];h({queryArgs:t.originalArgs,endpointDefinition:o,endpointName:r})===h({queryArgs:n,endpointDefinition:o,endpointName:r})&&(t=void 0)}var i=e.isSuccess?e.data:null==t?void 0:t.data;void 0===i&&(i=e.data);var a=void 0!==i,s=e.isLoading,l=!a&&s,c=e.isSuccess||s&&a;return v(g({},e),{data:i,currentData:e.data,isFetching:s,isLoading:l,isSuccess:c})}}({api:e,moduleOptions:{batch:s,useDispatch:c,useSelector:d,useStore:p,unstable__sideEffectsInRender:m},serializeQueryArgs:l,context:n}),f=h.buildQueryHooks,S=h.buildMutationHook,k=h.usePrefetch;return O(u,{usePrefetch:k}),O(n,{batch:s}),{injectEndpoint:function(t,n){if(function(e){return e.type===w.query}(n)){var r=f(t),o=r.useQuery,i=r.useLazyQuery,a=r.useLazyQuerySubscription,s=r.useQueryState,l=r.useQuerySubscription;O(u.endpoints[t],{useQuery:o,useLazyQuery:i,useLazyQuerySubscription:a,useQueryState:s,useQuerySubscription:l}),e["use"+T(t)+"Query"]=o,e["useLazy"+T(t)+"Query"]=i}else if(function(e){return e.type===w.mutation}(n)){var c=S(t);O(u.endpoints[t],{useMutation:c}),e["use"+T(t)+"Mutation"]=c}}}}}}())},8948:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e,t){return e.has(t)}},9063:(e,t,n)=>{"use strict";n.d(t,{$Y:()=>m,E7:()=>b,Jz:()=>f,PG:()=>p,aM:()=>v,pf:()=>g});var r=n(7840),o=n(4951),i=n(8024),a=n(9487),s=n(4657),l=n(8879),c=n(4413);const u=e=>{let{searchText:t,folder:n,allowedFolders:r}=e,o="MediaType:Story OR MediaType:Album";if((0,a.o)(t)||(o=`(${o}) AND Story_Title:${t}`),null!==r&&void 0!==r&&r.length){o=`(${o}) AND (${r.map((e=>`Path:${e}${null!==n&&void 0!==n&&n.id?"/*":""}`)).join(" OR ")})`}return o},d=e=>e&&0!==Object.keys(e).length?Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return r&&0!==r.length?"Types"===n?{...e,subtypeCriteria:e.subtypeCriteria.concat(r)}:{...e,facetFilters:{...e.facetFilters,[n]:r}}:e}),{subtypeCriteria:[],facetFilters:{}}):{subtypeCriteria:[],facetFilters:{}},h=(0,s.L5)(i.rQ,{maxRetries:2}),p=(0,l.xP)({reducerPath:"searchApi",baseQuery:h,tagTypes:["Folders","Images","ImagesInFolders"],endpoints:e=>({getFolders:e.query({keepUnusedDataFor:0,query:e=>{let{allowedFolders:t,folder:n,searchText:r,useSession:o,start:i=0,pageSize:a=c.VH,self:s=!1,includeDirectChild:l,damViewSeeThru:u}=e;const d=[["DamViewSeeThru",u?"true":"false"]];var h;if((i||i>=0)&&d.push(["Start",i.toString()]),r&&(d.push(["Text",r]),d.push(["SeeThru","true"])),a&&d.push(["Limit",a.toString()]),null===t||void 0===t||!t.length||null!==n&&void 0!==n&&n.id){if(null!==n&&void 0!==n&&n.id){var p;d.push(["ObjectRecordIDs",n.id]),d.push(["IncludeDirectChild",null!==(p=null===l||void 0===l?void 0:l.toString())&&void 0!==p?p:"true"])}}else t.forEach((e=>{d.push(["ObjectRecordIDs",e])})),d.push(["Self","true"]),d.push(["IncludeDirectChild",null!==(h=null===l||void 0===l?void 0:l.toString())&&void 0!==h?h:"false"]);return o&&d.push(["UseSession",o]),s&&d.push(["Self","true"]),{url:"/webapi/extensibility/integrations/gab/assetbrowser/gethierarchy_41e8",params:d}},transformResponse:(e,t,n)=>{var r,a;return{items:null!==(r=null===(a=e.contentItems)||void 0===a?void 0:a.map((e=>{var t,r,a,s;return{id:e.recordID,title:null!==(t=(0,i.Pp)(e.fields,o._3))&&void 0!==t?t:"",docType:null!==(r=(0,i.Pp)(e.fields,o.VV))&&void 0!==r?r:"",path:n.folder?[...n.folder.path,n.folder.title]:[],fullPath:(null!==(a=(0,i.Pp)(e.fields,o.bV))&&void 0!==a?a:"").replace(/^Root\//i,""),parents:n.folder?[...n.folder.parents,n.folder]:[],hasChildren:"1"===(null!==(s=(0,i.Pp)(e.fields,o.VH))&&void 0!==s?s:"0")}})))&&void 0!==r?r:[],totalCount:e.totalCount}},providesTags:(e,t,n)=>{var r,o;return[{type:"Folders",id:null!==(r=null===(o=n.folder)||void 0===o?void 0:o.id)&&void 0!==r?r:"Root"}]},merge:(e,t,n)=>n.arg.start&&n.arg.start>0?(e.items.push(...t.items),e):t,forceRefetch(e){let{currentArg:t,previousArg:n}=e;return t!==n},serializeQueryArgs:e=>{var t;let{endpointName:n,queryArgs:r}=e;return{endpointName:n,id:null===(t=r.folder)||void 0===t?void 0:t.id,type:"Folders"}}}),getCollections:e.query({keepUnusedDataFor:0,query:e=>{let{folder:t,searchText:n,useSession:r,start:i=0,pageSize:a=c.VH}=e;const s=[["extraFilters",u({searchText:n})],["fields",o.bV],["fields",o.VV],["fields",o._3],["seeThru",!0],["subtypeCriteria",t]];return(i||i>=0)&&s.push(["start",i.toString()]),a&&s.push(["limit",a.toString()]),r&&s.push(["UseSession",r]),{url:"/webapi/extensibility/integrations/contentBrowserSDK/getcontent_4bw_v1",params:s}},transformResponse:(e,t)=>{var n,r;return{items:null!==(n=null===(r=e.contentItems)||void 0===r?void 0:r.map((e=>{var t,n,r;return{id:e.recordID,title:null!==(t=(0,i.Pp)(e.fields,o._3))&&void 0!==t?t:"",docType:null!==(n=(0,i.Pp)(e.fields,o.VV))&&void 0!==n?n:"",path:[],fullPath:(null!==(r=(0,i.Pp)(e.fields,o.bV))&&void 0!==r?r:"").replace(/^Root\//i,""),parents:[],hasChildren:!1}})))&&void 0!==n?n:[],totalCount:e.totalCount}},providesTags:(e,t,n)=>[{type:"Folders",id:n.folder.id}],merge:(e,t,n)=>n.arg.start&&n.arg.start>0?(e.items.push(...t.items),e):t,forceRefetch(e){let{currentArg:t,previousArg:n}=e;return t!==n},serializeQueryArgs:e=>{var t;let{endpointName:n,queryArgs:r}=e;return{endpointName:n,id:null===(t=r.folder)||void 0===t?void 0:t.id,type:"Folders"}}}),getAssets:e.query({keepUnusedDataFor:0,query:e=>{let{folderID:t,isSeeThrough:n,limitedToDocTypes:r=[],pageSize:i,searchText:a,selectedFacets:s,sortOrder:l,start:c,useSession:u}=e;return{url:"/webapi/extensibility/integrations/contentBrowserSDK/getcontent_4bw_v3",body:{fields:[o.s6,o.VV,o.jb,o._R,o.vA,o.sP,o.S,o.Ni,o.Gu,o.HO,o.EG,o._3,o.Uh,o.g_],seeThru:!!n,objectRecordID:null!==t&&void 0!==t?t:void 0,start:null!==c&&void 0!==c?c:void 0,limit:null!==i&&void 0!==i?i:void 0,orderBy:l,limitedToDocTypes:r,text:a,useSession:u,...d(s)},method:"POST"}},transformResponse:e=>{var t,n;return{facets:e.facets,items:null!==(t=null===(n=e.contentItems)||void 0===n?void 0:n.map((e=>{var t,n,r,a,s,l,c,u,d,h,p,f;let m=null!==(t=(0,i.Pp)(e.fields,o.jb))&&void 0!==t?t:"";const g=(0,i.Pp)(e.fields,o.Gu);return m&&!m.startsWith(".")&&(m="."+m),{docType:null!==(n=(0,i.Pp)(e.fields,o.VV))&&void 0!==n?n:"",docSubType:null!==(r=(0,i.Pp)(e.fields,o.EG))&&void 0!==r?r:"",extension:m,height:null!==(a=(0,i.Pp)(e.fields,o.S))&&void 0!==a?a:"0",id:e.recordID,identifier:null!==(s=(0,i.Pp)(e.fields,o.vA))&&void 0!==s?s:"",imageUrl:null!==(l=(0,i.Pp)(e.fields,o.s6))&&void 0!==l?l:"",originalUrl:null!==(c=(0,i.Pp)(e.fields,o.g_))&&void 0!==c?c:"",name:null!==g&&void 0!==g?g:"",scrubUrl:null!==(u=(0,i.Pp)(e.fields,o.he))&&void 0!==u?u:"",size:null!==(d=(0,i.Pp)(e.fields,o._R))&&void 0!==d?d:"0 MB",tags:null!==(h=(0,i.Pp)(e.fields,o.sP))&&void 0!==h?h:"",width:null!==(p=(0,i.Pp)(e.fields,o.Ni))&&void 0!==p?p:"0",allowATSLink:"True"===(0,i.Pp)(e.fields,o.F4),recordId:null!==(f=(0,i.Pp)(e.fields,o.HO))&&void 0!==f?f:""}})))&&void 0!==t?t:[],totalCount:e.totalCount}},providesTags:(e,t,n)=>{var r;return[{selectedFacets:Object.values(null!==(r=n.selectedFacets)&&void 0!==r?r:{}),id:n.folderID,isSeeThrough:n.isSeeThrough,searchText:n.searchText,sortOrder:n.sortOrder,type:"ImagesInFolders"},"Images"]},merge:(e,t,n)=>n.arg.start&&n.arg.start>0?{...e,items:(0,r.A)([...e.items,...t.items],"recordId")}:t,forceRefetch(e){let{currentArg:t,previousArg:n}=e;return(null===t||void 0===t?void 0:t.start)===(null===n||void 0===n?void 0:n.start)?!(null===t||void 0===t||!t.pageSize)&&!(null===n||void 0===n||!n.pageSize)&&t.pageSize>n.pageSize:t!==n},serializeQueryArgs:e=>{var t;let{endpointName:n,queryArgs:r}=e;return{endpointName:n,selectedFacets:Object.values(null!==(t=r.selectedFacets)&&void 0!==t?t:{}),id:r.folderID,isSeeThrough:r.isSeeThrough,searchText:r.searchText,sortOrder:r.sortOrder,type:"ImagesInFolders"}}}),getIsFavorite:e.query({keepUnusedDataFor:0,query:e=>{let{recordId:t}=e;return{url:"/webapi/extensibility/integrations/contentBrowserSDK/getfavorites_419t",params:[["recordId",t]]}},transformResponse:(e,t,n)=>{let{recordId:r}=n;return!!e.favoriteRecordIds&&e.favoriteRecordIds[0]===r}}),getAssetById:e.query({keepUnusedDataFor:0,query:e=>{let{id:t,useSession:n}=e;const r=[["extraFilters",`RecordID:${t}`],["fields",o.s6],["fields",o.VV],["fields",o.jb],["fields",o._R],["fields",o.vA],["fields",o.sP],["fields",o.S],["fields",o.Ni],["fields",o.Gu],["fields",o.HO],["fields",o.EG],["fields",o._3],["fields",o.Uh],["fields",o.g_],["seeThru","true"]];return n&&r.push(["UseSession",n]),{url:"/webapi/extensibility/integrations/contentBrowserSDK/getcontent_4bw_v1",params:r}},transformResponse:e=>{var t,n,r,a,s,l,c,u,d,h,p,f,m;const g=null===(t=e.contentItems)||void 0===t?void 0:t[0];if(!g)return;let v=null!==(n=(0,i.Pp)(g.fields,o.jb))&&void 0!==n?n:"";v&&!v.startsWith(".")&&(v="."+v);const b=(0,i.Pp)(g.fields,o.Gu);return v&&!v.startsWith(".")&&(v="."+v),{docType:null!==(r=(0,i.Pp)(g.fields,o.VV))&&void 0!==r?r:"",docSubType:null!==(a=(0,i.Pp)(g.fields,o.EG))&&void 0!==a?a:"",extension:v,height:null!==(s=(0,i.Pp)(g.fields,o.S))&&void 0!==s?s:"0",id:g.recordID,identifier:null!==(l=(0,i.Pp)(g.fields,o.vA))&&void 0!==l?l:"",imageUrl:null!==(c=(0,i.Pp)(g.fields,o.s6))&&void 0!==c?c:"",originalUrl:null!==(u=(0,i.Pp)(g.fields,o.g_))&&void 0!==u?u:"",name:b,scrubUrl:null!==(d=(0,i.Pp)(g.fields,o.he))&&void 0!==d?d:"",size:null!==(h=(0,i.Pp)(g.fields,o._R))&&void 0!==h?h:"0 MB",tags:null!==(p=(0,i.Pp)(g.fields,o.sP))&&void 0!==p?p:"",width:null!==(f=(0,i.Pp)(g.fields,o.Ni))&&void 0!==f?f:"0",allowATSLink:"True"===(0,i.Pp)(g.fields,o.F4),recordId:null!==(m=(0,i.Pp)(g.fields,o.HO))&&void 0!==m?m:""}},providesTags:(e,t,n)=>[{type:"Images",id:n.id}],serializeQueryArgs:e=>{let{endpointName:t,queryArgs:n}=e;return{endpointName:t,id:n.id,useSession:n.useSession}}})})}),{useGetFoldersQuery:f,useGetCollectionsQuery:m,useGetAssetsQuery:g,useGetAssetByIdQuery:v,useGetIsFavoriteQuery:b}=p},9171:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});const r=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1};const o=function(e){return e!==e};const i=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1};const a=function(e,t,n){return t===t?i(e,t,n):r(e,o,n)};const s=function(e,t){return!!(null==e?0:e.length)&&a(e,t,0)>-1}},9392:(e,t,n)=>{"use strict";var r=n(1218),o=n(6496);function i(e){var t=0,n=0,r=0,o=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=10*t,o=10*n,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!t&&(t=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},e.exports=i},9406:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(){return[]}},9461:(e,t,n)=>{"use strict";e.exports=n(2330)},9487:(e,t,n)=>{"use strict";n.d(t,{k:()=>r,o:()=>o});const r=e=>{let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";for(let r=0;r<e;r++)t+=n.charAt(Math.floor(62*Math.random()));return t},o=e=>!e||""===e.trim()},9500:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(4802),o=n(3239);const i=function(e){return(0,o.A)(e)&&"[object Arguments]"==(0,r.A)(e)};var a=Object.prototype,s=a.hasOwnProperty,l=a.propertyIsEnumerable;const c=i(function(){return arguments}())?i:function(e){return(0,o.A)(e)&&s.call(e,"callee")&&!l.call(e,"callee")}},9618:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});const r=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i};var o=n(9406),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;const s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o.A},9717:(e,t,n)=>{"use strict";var r=n(5043),o=n(9461);var i="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},a=o.useSyncExternalStore,s=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=s(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=c((function(){function e(e){if(!l){if(l=!0,a=e,e=r(e),void 0!==o&&h.hasValue){var t=h.value;if(o(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(a=e,t):(a=e,s=n)}var a,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var p=a(e,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=p}),[p]),u(p),p}},9815:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EnhancerArray:()=>j,MiddlewareArray:()=>R,SHOULD_AUTOBATCH:()=>Ze,TaskAbortError:()=>Pe,__DO_NOT_USE__ActionTypes:()=>o.$d,addListener:()=>We,applyMiddleware:()=>o.Tw,autoBatchEnhancer:()=>nt,bindActionCreators:()=>o.zH,clearAllListeners:()=>Ke,combineReducers:()=>o.HY,compose:()=>o.Zz,configureStore:()=>H,createAction:()=>E,createActionCreatorInvariantMiddleware:()=>D,createAsyncThunk:()=>ae,createDraftSafeSelector:()=>S,createEntityAdapter:()=>ee,createImmutableStateInvariantMiddleware:()=>M,createListenerMiddleware:()=>Xe,createNextState:()=>r.Ay,createReducer:()=>K,createSelector:()=>i.createSelector,createSerializableStateInvariantMiddleware:()=>U,createSlice:()=>$,createStore:()=>o.y$,current:()=>r.ss,findNonSerializableValue:()=>L,freeze:()=>r.CN,getDefaultMiddleware:()=>V,getType:()=>z,isAction:()=>A,isActionCreator:()=>T,isAllOf:()=>ue,isAnyOf:()=>ce,isAsyncThunkAction:()=>ve,isDraft:()=>r.Qx,isFluxStandardAction:()=>O,isFulfilled:()=>ge,isImmutableDefault:()=>I,isPending:()=>pe,isPlain:()=>F,isPlainObject:()=>_,isRejected:()=>fe,isRejectedWithValue:()=>me,legacy_createStore:()=>o.Yl,miniSerializeError:()=>ie,nanoid:()=>te,original:()=>r.c2,prepareAutoBatched:()=>Ye,removeListener:()=>$e,unwrapResult:()=>se});var r=n(2272),o=n(6096),i=n(2222);function a(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"===typeof o?o(n,r,e):t(o)}}}}var s=a();s.withExtraArgument=a;const l=s;var c=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},d=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},h=Object.defineProperty,p=Object.defineProperties,f=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,b=function(e,t,n){return t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},y=function(e,t){for(var n in t||(t={}))g.call(t,n)&&b(e,n,t[n]);if(m)for(var r=0,o=m(t);r<o.length;r++){n=o[r];v.call(t,n)&&b(e,n,t[n])}return e},x=function(e,t){return p(e,f(t))},w=function(e,t,n){return new Promise((function(r,o){var i=function(e){try{s(n.next(e))}catch(t){o(t)}},a=function(e){try{s(n.throw(e))}catch(t){o(t)}},s=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(i,a)};s((n=n.apply(e,t)).next())}))},S=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.createSelector.apply(void 0,e);return function(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return n.apply(void 0,d([(0,r.Qx)(e)?(0,r.ss)(e):e],t))}},k="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"===typeof arguments[0]?o.Zz:o.Zz.apply(null,arguments)};"undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function _(e){if("object"!==typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}var C=function(e){return e&&"function"===typeof e.match};function E(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return y(y({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}function A(e){return _(e)&&"type"in e}function T(e){return"function"===typeof e&&"type"in e&&C(e)}function O(e){return A(e)&&"string"===typeof e.type&&Object.keys(e).every(P)}function P(e){return["type","payload","error","meta"].indexOf(e)>-1}function z(e){return""+e}function D(e){return void 0===e&&(e={}),function(){return function(e){return function(t){return e(t)}}}}var R=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return c(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,d([void 0],e[0].concat(this)))):new(t.bind.apply(t,d([void 0],e.concat(this))))},t}(Array),j=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return c(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,d([void 0],e[0].concat(this)))):new(t.bind.apply(t,d([void 0],e.concat(this))))},t}(Array);function N(e){return(0,r.a6)(e)?(0,r.Ay)(e,(function(){})):e}function I(e){return"object"!==typeof e||null==e||Object.isFrozen(e)}function M(e){return void 0===e&&(e={}),function(){return function(e){return function(t){return e(t)}}}}function F(e){var t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||_(e)}function L(e,t,n,r,o,i){var a;if(void 0===t&&(t=""),void 0===n&&(n=F),void 0===o&&(o=[]),!n(e))return{keyPath:t||"<root>",value:e};if("object"!==typeof e||null===e)return!1;if(null==i?void 0:i.has(e))return!1;for(var s=null!=r?r(e):Object.entries(e),l=o.length>0,c=function(e,s){var c=t?t+"."+e:e;if(l&&o.some((function(e){return e instanceof RegExp?e.test(c):c===e})))return"continue";return n(s)?"object"===typeof s&&(a=L(s,c,n,r,o,i))?{value:a}:void 0:{value:{keyPath:c,value:s}}},u=0,d=s;u<d.length;u++){var h=d[u],p=c(h[0],h[1]);if("object"===typeof p)return p.value}return i&&B(e)&&i.add(e),!1}function B(e){if(!Object.isFrozen(e))return!1;for(var t=0,n=Object.values(e);t<n.length;t++){var r=n[t];if("object"===typeof r&&null!==r&&!B(r))return!1}return!0}function U(e){return void 0===e&&(e={}),function(){return function(e){return function(t){return e(t)}}}}function V(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t,r=(e.immutableCheck,e.serializableCheck,e.actionCreatorCheck,new R);return n&&("boolean"===typeof n?r.push(l):r.push(l.withExtraArgument(n.extraArgument))),r}var q=!0;function H(e){var t,n=function(e){return V(e)},r=e||{},i=r.reducer,a=void 0===i?void 0:i,s=r.middleware,l=void 0===s?n():s,c=r.devTools,u=void 0===c||c,h=r.preloadedState,p=void 0===h?void 0:h,f=r.enhancers,m=void 0===f?void 0:f;if("function"===typeof a)t=a;else{if(!_(a))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=(0,o.HY)(a)}var g=l;if("function"===typeof g&&(g=g(n),!q&&!Array.isArray(g)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!q&&g.some((function(e){return"function"!==typeof e})))throw new Error("each middleware provided to configureStore must be a function");var v=o.Tw.apply(void 0,g),b=o.Zz;u&&(b=k(y({trace:!q},"object"===typeof u&&u)));var x=new j(v),w=x;Array.isArray(m)?w=d([v],m):"function"===typeof m&&(w=m(x));var S=b.apply(void 0,w);return(0,o.y$)(t,p,S)}function W(e){var t,n={},r=[],o={addCase:function(e,t){var r="string"===typeof e?e:e.type;if(!r)throw new Error("`builder.addCase` cannot be called with an empty action type");if(r in n)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return n[r]=t,o},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),o},addDefaultCase:function(e){return t=e,o}};return e(o),[n,r,t]}function K(e,t,n,o){void 0===n&&(n=[]);var i,a="function"===typeof t?W(t):[t,n,o],s=a[0],l=a[1],c=a[2];if("function"===typeof e)i=function(){return N(e())};else{var u=N(e);i=function(){return u}}function h(e,t){void 0===e&&(e=i());var n=d([s[t.type]],l.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[c]),n.reduce((function(e,n){if(n){var o;if((0,r.Qx)(e))return void 0===(o=n(e,t))?e:o;if((0,r.a6)(e))return(0,r.Ay)(e,(function(e){return n(e,t)}));if(void 0===(o=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return o}return e}),e)}return h.getInitialState=i,h}function $(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:N(e.initialState),o=e.reducers||{},i=Object.keys(o),a={},s={},l={};function c(){var t="function"===typeof e.extraReducers?W(e.extraReducers):[e.extraReducers],n=t[0],o=void 0===n?{}:n,i=t[1],a=void 0===i?[]:i,l=t[2],c=void 0===l?void 0:l,u=y(y({},o),s);return K(r,(function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=a;n<r.length;n++){var o=r[n];e.addMatcher(o.matcher,o.reducer)}c&&e.addDefaultCase(c)}))}return i.forEach((function(e){var n,r,i=o[e],c=t+"/"+e;"reducer"in i?(n=i.reducer,r=i.prepare):n=i,a[e]=n,s[c]=n,l[e]=r?E(c,r):E(c)})),{name:t,reducer:function(e,t){return n||(n=c()),n(e,t)},actions:l,caseReducers:a,getInitialState:function(){return n||(n=c()),n.getInitialState()}}}function Q(e){var t=X((function(t,n){return e(n)}));return function(e){return t(e,void 0)}}function X(e){return function(t,n){var o=function(t){O(n)?e(n.payload,t):e(n,t)};return(0,r.Qx)(t)?(o(t),t):(0,r.Ay)(t,o)}}function G(e,t){return t(e)}function Z(e){return Array.isArray(e)||(e=Object.values(e)),e}function Y(e,t,n){for(var r=[],o=[],i=0,a=e=Z(e);i<a.length;i++){var s=a[i],l=G(s,t);l in n.entities?o.push({id:l,changes:s}):r.push(s)}return[r,o]}function J(e){function t(t,n){var r=G(t,e);r in n.entities||(n.ids.push(r),n.entities[r]=t)}function n(e,n){for(var r=0,o=e=Z(e);r<o.length;r++){t(o[r],n)}}function r(t,n){var r=G(t,e);r in n.entities||n.ids.push(r),n.entities[r]=t}function o(e,t){var n=!1;e.forEach((function(e){e in t.entities&&(delete t.entities[e],n=!0)})),n&&(t.ids=t.ids.filter((function(e){return e in t.entities})))}function i(t,n){var r={},o={};if(t.forEach((function(e){e.id in n.entities&&(o[e.id]={id:e.id,changes:y(y({},o[e.id]?o[e.id].changes:null),e.changes)})})),(t=Object.values(o)).length>0){var i=t.filter((function(t){return function(t,n,r){var o=r.entities[n.id],i=Object.assign({},o,n.changes),a=G(i,e),s=a!==n.id;return s&&(t[n.id]=a,delete r.entities[n.id]),r.entities[a]=i,s}(r,t,n)})).length>0;i&&(n.ids=Object.keys(n.entities))}}function a(t,r){var o=Y(t,e,r),a=o[0];i(o[1],r),n(a,r)}return{removeAll:Q((function(e){Object.assign(e,{ids:[],entities:{}})})),addOne:X(t),addMany:X(n),setOne:X(r),setMany:X((function(e,t){for(var n=0,o=e=Z(e);n<o.length;n++){r(o[n],t)}})),setAll:X((function(e,t){e=Z(e),t.ids=[],t.entities={},n(e,t)})),updateOne:X((function(e,t){return i([e],t)})),updateMany:X(i),upsertOne:X((function(e,t){return a([e],t)})),upsertMany:X(a),removeOne:X((function(e,t){return o([e],t)})),removeMany:X(o)}}function ee(e){void 0===e&&(e={});var t=y({sortComparer:!1,selectId:function(e){return e.id}},e),n=t.selectId,r=t.sortComparer,o={getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},i={getSelectors:function(e){var t=function(e){return e.ids},n=function(e){return e.entities},r=S(t,n,(function(e,t){return e.map((function(e){return t[e]}))})),o=function(e,t){return t},i=function(e,t){return e[t]},a=S(t,(function(e){return e.length}));if(!e)return{selectIds:t,selectEntities:n,selectAll:r,selectTotal:a,selectById:S(n,o,i)};var s=S(e,n);return{selectIds:S(e,t),selectEntities:s,selectAll:S(e,r),selectTotal:S(e,a),selectById:S(s,o,i)}}},a=r?function(e,t){var n=J(e);function r(t,n){var r=(t=Z(t)).filter((function(t){return!(G(t,e)in n.entities)}));0!==r.length&&s(r,n)}function o(e,t){0!==(e=Z(e)).length&&s(e,t)}function i(t,n){for(var r=!1,o=0,i=t;o<i.length;o++){var a=i[o],s=n.entities[a.id];if(s){r=!0,Object.assign(s,a.changes);var c=e(s);a.id!==c&&(delete n.entities[a.id],n.entities[c]=s)}}r&&l(n)}function a(t,n){var o=Y(t,e,n),a=o[0];i(o[1],n),r(a,n)}function s(t,n){t.forEach((function(t){n.entities[e(t)]=t})),l(n)}function l(n){var r=Object.values(n.entities);r.sort(t);var o=r.map(e);(function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(e[n]!==t[n])return!1;return!0})(n.ids,o)||(n.ids=o)}return{removeOne:n.removeOne,removeMany:n.removeMany,removeAll:n.removeAll,addOne:X((function(e,t){return r([e],t)})),updateOne:X((function(e,t){return i([e],t)})),upsertOne:X((function(e,t){return a([e],t)})),setOne:X((function(e,t){return o([e],t)})),setMany:X(o),setAll:X((function(e,t){e=Z(e),t.entities={},t.ids=[],r(e,t)})),addMany:X(r),updateMany:X(i),upsertMany:X(a)}}(n,r):J(n);return y(y(y({selectId:n,sortComparer:r},o),i),a)}var te=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},ne=["name","message","stack","code"],re=function(e,t){this.payload=e,this.meta=t},oe=function(e,t){this.payload=e,this.meta=t},ie=function(e){if("object"===typeof e&&null!==e){for(var t={},n=0,r=ne;n<r.length;n++){var o=r[n];"string"===typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},ae=function(){function e(e,t,n){var r=E(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:x(y({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=E(e+"/pending",(function(e,t,n){return{payload:void 0,meta:x(y({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),i=E(e+"/rejected",(function(e,t,r,o,i){return{payload:o,error:(n&&n.serializeError||ie)(e||"Rejected"),meta:x(y({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),a="undefined"!==typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){0},e}();return Object.assign((function(e){return function(s,l,c){var d,h=(null==n?void 0:n.idGenerator)?n.idGenerator(e):te(),p=new a;function f(e){d=e,p.abort()}var m=function(){return w(this,null,(function(){var a,m,g,v,b,y;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,4,,5]),v=null==(a=null==n?void 0:n.condition)?void 0:a.call(n,e,{getState:l,extra:c}),null===(x=v)||"object"!==typeof x||"function"!==typeof x.then?[3,2]:[4,v];case 1:v=u.sent(),u.label=2;case 2:if(!1===v||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(e,t){return p.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:d||"Aborted"})}))})),s(o(h,e,null==(m=null==n?void 0:n.getPendingMeta)?void 0:m.call(n,{requestId:h,arg:e},{getState:l,extra:c}))),[4,Promise.race([b,Promise.resolve(t(e,{dispatch:s,getState:l,extra:c,requestId:h,signal:p.signal,abort:f,rejectWithValue:function(e,t){return new re(e,t)},fulfillWithValue:function(e,t){return new oe(e,t)}})).then((function(t){if(t instanceof re)throw t;return t instanceof oe?r(t.payload,h,e,t.meta):r(t,h,e)}))])];case 3:return g=u.sent(),[3,5];case 4:return y=u.sent(),g=y instanceof re?i(null,h,e,y.payload,y.meta):i(y,h,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&i.match(g)&&g.meta.condition||s(g),[2,g]}var x}))}))}();return Object.assign(m,{abort:f,requestId:h,arg:e,unwrap:function(){return m.then(se)}})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}return e.withTypes=function(){return e},e}();function se(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var le=function(e,t){return C(e)?e.match(t):e(t)};function ce(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return le(e,t)}))}}function ue(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.every((function(e){return le(e,t)}))}}function de(e,t){if(!e||!e.meta)return!1;var n="string"===typeof e.meta.requestId,r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function he(e){return"function"===typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function pe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return de(e,["pending"])}:he(e)?function(t){var n=e.map((function(e){return e.pending}));return ce.apply(void 0,n)(t)}:pe()(e[0])}function fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return de(e,["rejected"])}:he(e)?function(t){var n=e.map((function(e){return e.rejected}));return ce.apply(void 0,n)(t)}:fe()(e[0])}function me(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return 0===e.length||he(e)?function(t){return ue(fe.apply(void 0,e),n)(t)}:me()(e[0])}function ge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return de(e,["fulfilled"])}:he(e)?function(t){var n=e.map((function(e){return e.fulfilled}));return ce.apply(void 0,n)(t)}:ge()(e[0])}function ve(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return de(e,["pending","fulfilled","rejected"])}:he(e)?function(t){for(var n=[],r=0,o=e;r<o.length;r++){var i=o[r];n.push(i.pending,i.rejected,i.fulfilled)}return ce.apply(void 0,n)(t)}:ve()(e[0])}var be=function(e,t){if("function"!==typeof e)throw new TypeError(t+" is not a function")},ye=function(){},xe=function(e,t){return void 0===t&&(t=ye),e.catch(t),e},we=function(e,t){return e.addEventListener("abort",t,{once:!0}),function(){return e.removeEventListener("abort",t)}},Se=function(e,t){var n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},ke="listener",_e="completed",Ce="cancelled",Ee="task-"+Ce,Ae="task-"+_e,Te=ke+"-"+Ce,Oe=ke+"-"+_e,Pe=function(e){this.code=e,this.name="TaskAbortError",this.message="task "+Ce+" (reason: "+e+")"},ze=function(e){if(e.aborted)throw new Pe(e.reason)};function De(e,t){var n=ye;return new Promise((function(r,o){var i=function(){return o(new Pe(e.reason))};e.aborted?i():(n=we(e,i),t.finally((function(){return n()})).then(r,o))})).finally((function(){n=ye}))}var Re=function(e){return function(t){return xe(De(e,t).then((function(t){return ze(e),t})))}},je=function(e){var t=Re(e);return function(e){return t(new Promise((function(t){return setTimeout(t,e)})))}},Ne=Object.assign,Ie={},Me="listenerMiddleware",Fe=function(e,t){return function(n,r){be(n,"taskExecutor");var o,i=new AbortController;o=i,we(e,(function(){return Se(o,e.reason)}));var a,s,l=(a=function(){return w(void 0,null,(function(){var t;return u(this,(function(r){switch(r.label){case 0:return ze(e),ze(i.signal),[4,n({pause:Re(i.signal),delay:je(i.signal),signal:i.signal})];case 1:return t=r.sent(),ze(i.signal),[2,t]}}))}))},s=function(){return Se(i,Ae)},w(void 0,null,(function(){var e;return u(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return t.sent(),[4,a()];case 2:return[2,{status:"ok",value:t.sent()}];case 3:return[2,{status:(e=t.sent())instanceof Pe?"cancelled":"rejected",error:e}];case 4:return null==s||s(),[7];case 5:return[2]}}))})));return(null==r?void 0:r.autoJoin)&&t.push(l),{result:Re(e)(l),cancel:function(){Se(i,Ee)}}}},Le=function(e,t){return function(n,r){return xe(function(n,r){return w(void 0,null,(function(){var o,i,a,s;return u(this,(function(l){switch(l.label){case 0:ze(t),o=function(){},i=new Promise((function(t,r){var i=e({predicate:n,effect:function(e,n){n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});o=function(){i(),r()}})),a=[i],null!=r&&a.push(new Promise((function(e){return setTimeout(e,r,null)}))),l.label=1;case 1:return l.trys.push([1,,3,4]),[4,De(t,Promise.race(a))];case 2:return s=l.sent(),ze(t),[2,s];case 3:return o(),[7];case 4:return[2]}}))}))}(n,r))}},Be=function(e){var t=e.type,n=e.actionCreator,r=e.matcher,o=e.predicate,i=e.effect;if(t)o=E(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return be(i,"options.listener"),{predicate:o,type:t,effect:i}},Ue=function(e){var t=Be(e),n=t.type,r=t.predicate,o=t.effect;return{id:te(),effect:o,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}}},Ve=function(e){e.pending.forEach((function(e){Se(e,Te)}))},qe=function(e){return function(){e.forEach(Ve),e.clear()}},He=function(e,t,n){try{e(t,n)}catch(r){setTimeout((function(){throw r}),0)}},We=E(Me+"/add"),Ke=E(Me+"/removeAll"),$e=E(Me+"/remove"),Qe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,d([Me+"/error"],e))};function Xe(e){var t=this;void 0===e&&(e={});var n=new Map,r=e.extra,o=e.onError,i=void 0===o?Qe:o;be(i,"onError");var a=function(e){for(var t=0,r=Array.from(n.values());t<r.length;t++){var o=r[t];if(e(o))return o}},s=function(e){var t=a((function(t){return t.effect===e.effect}));return t||(t=Ue(e)),function(e){return e.unsubscribe=function(){return n.delete(e.id)},n.set(e.id,e),function(t){e.unsubscribe(),(null==t?void 0:t.cancelActive)&&Ve(e)}}(t)},l=function(e){var t=Be(e),n=t.type,r=t.effect,o=t.predicate,i=a((function(e){return("string"===typeof n?e.type===n:e.predicate===o)&&e.effect===r}));return i&&(i.unsubscribe(),e.cancelActive&&Ve(i)),!!i},c=function(e,o,a,l){return w(t,null,(function(){var t,c,d,h;return u(this,(function(u){switch(u.label){case 0:t=new AbortController,c=Le(s,t.signal),d=[],u.label=1;case 1:return u.trys.push([1,3,4,6]),e.pending.add(t),[4,Promise.resolve(e.effect(o,Ne({},a,{getOriginalState:l,condition:function(e,t){return c(e,t).then(Boolean)},take:c,delay:je(t.signal),pause:Re(t.signal),extra:r,signal:t.signal,fork:Fe(t.signal,d),unsubscribe:e.unsubscribe,subscribe:function(){n.set(e.id,e)},cancelActiveListeners:function(){e.pending.forEach((function(e,n,r){e!==t&&(Se(e,Te),r.delete(e))}))}})))];case 2:return u.sent(),[3,6];case 3:return(h=u.sent())instanceof Pe||He(i,h,{raisedBy:"effect"}),[3,6];case 4:return[4,Promise.allSettled(d)];case 5:return u.sent(),Se(t,Oe),e.pending.delete(t),[7];case 6:return[2]}}))}))},d=qe(n);return{middleware:function(e){return function(t){return function(r){if(!A(r))return t(r);if(We.match(r))return s(r.payload);if(!Ke.match(r)){if($e.match(r))return l(r.payload);var o,a=e.getState(),u=function(){if(a===Ie)throw new Error(Me+": getOriginalState can only be called synchronously");return a};try{if(o=t(r),n.size>0)for(var h=e.getState(),p=Array.from(n.values()),f=0,m=p;f<m.length;f++){var g=m[f],v=!1;try{v=g.predicate(r,h,a)}catch(b){v=!1,He(i,b,{raisedBy:"predicate"})}v&&c(g,r,e,u)}}finally{a=Ie}return o}d()}}},startListening:s,stopListening:l,clearListeners:d}}var Ge,Ze="RTK_autoBatch",Ye=function(){return function(e){var t;return{payload:e,meta:(t={},t[Ze]=!0,t)}}},Je="function"===typeof queueMicrotask?queueMicrotask.bind("undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:globalThis):function(e){return(Ge||(Ge=Promise.resolve())).then(e).catch((function(e){return setTimeout((function(){throw e}),0)}))},et=function(e){return function(t){setTimeout(t,e)}},tt="undefined"!==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:et(10),nt=function(e){return void 0===e&&(e={type:"raf"}),function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.apply(void 0,n),i=!0,a=!1,s=!1,l=new Set,c="tick"===e.type?Je:"raf"===e.type?tt:"callback"===e.type?e.queueNotification:et(e.timeout),u=function(){s=!1,a&&(a=!1,l.forEach((function(e){return e()})))};return Object.assign({},o,{subscribe:function(e){var t=o.subscribe((function(){return i&&e()}));return l.add(e),function(){t(),l.delete(e)}},dispatch:function(e){var t;try{return i=!(null==(t=null==e?void 0:e.meta)?void 0:t[Ze]),(a=!i)&&(s||(s=!0,c(u))),o.dispatch(e)}finally{i=!0}}})}}};(0,r.rF)()},9885:(e,t,n)=>{"use strict";n.d(t,{A:()=>v});var r=n(4067);const o=n(4306).A["__core-js_shared__"];var i=function(){var e=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();const a=function(e){return!!i&&i in e};var s=n(7664),l=n(6166),c=/^\[object .+?Constructor\]$/,u=Function.prototype,d=Object.prototype,h=u.toString,p=d.hasOwnProperty,f=RegExp("^"+h.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const m=function(e){return!(!(0,s.A)(e)||a(e))&&((0,r.A)(e)?f:c).test((0,l.A)(e))};const g=function(e,t){return null==e?void 0:e[t]};const v=function(e,t){var n=g(e,t);return m(n)?n:void 0}},9989:e=>{"use strict";var t=!("undefined"===typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},9993:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(4802),o=n(3903),i=n(3239),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;const s=function(e){return(0,i.A)(e)&&(0,o.A)(e.length)&&!!a[(0,r.A)(e)]};var l=n(7328),c=n(8187),u="object"==typeof exports&&exports&&!exports.nodeType&&exports,d=u&&"object"==typeof module&&module&&!module.nodeType&&module,h=d&&d.exports===u&&c.A.process,p=function(){try{var e=d&&d.require&&d.require("util").types;return e||h&&h.binding&&h.binding("util")}catch(t){}}();var f=p&&p.isTypedArray;const m=f?(0,l.A)(f):s}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};return(()=>{"use strict";n.d(r,{default:()=>Iv});var e=n(4391),t=n(5137);const o=globalThis,i=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),s=new WeakMap;let l=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&s.set(t,e))}return e}toString(){return this.cssText}};const c=e=>new l("string"==typeof e?e:e+"",void 0,a),u=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const o=1===e.length?e[0]:n.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new l(o,e,a)},d=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return c(t)})(e):e,{is:h,defineProperty:p,getOwnPropertyDescriptor:f,getOwnPropertyNames:m,getOwnPropertySymbols:g,getPrototypeOf:v}=Object,b=globalThis,y=b.trustedTypes,x=y?y.emptyScript:"",w=b.reactiveElementPolyfillSupport,S=(e,t)=>e,k={toAttribute(e,t){switch(t){case Boolean:e=e?x:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},_=(e,t)=>!h(e,t),C={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C;if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:o}=f(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);o?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??C}static _$Ei(){if(this.hasOwnProperty(S("elementProperties")))return;const e=v(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(S("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(S("properties"))){const e=this.properties,t=[...m(e),...g(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const e=this._$Eu(t,n);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(d(e))}else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(i)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=o.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:k).toAttribute(t,n.type);this._$Em=e,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:k;this._$Em=r;const i=o.fromAttribute(t,e.type);this[r]=i??this._$Ej?.get(r)??i,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const r=this.constructor,o=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??_)(o,t)||n.useDefault&&n.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,n,r){let{useDefault:o,reflect:i,wrapped:a}=n;o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,n,r)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(Oe){throw e=!1,this._$EM(),Oe}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[S("elementProperties")]=new Map,E[S("finalized")]=new Map,w?.({ReactiveElement:E}),(b.reactiveElementVersions??=[]).push("2.1.1");const A=globalThis,T=A.trustedTypes,O=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,P="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+z,R=`<${D}>`,j=document,N=()=>j.createComment(""),I=e=>null===e||"object"!=typeof e&&"function"!=typeof e,M=Array.isArray,F="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,U=/>/g,V=RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,H=/"/g,W=/^(?:script|style|textarea|title)$/i,K=e=>function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return{_$litType$:e,strings:t,values:r}},$=K(1),Q=(K(2),Symbol.for("lit-noChange")),X=Symbol.for("lit-nothing"),G=new WeakMap,Z=j.createTreeWalker(j,129);function Y(e,t){if(!M(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(t):t}class J{constructor(e,t){let n,{strings:r,_$litType$:o}=e;this.parts=[];let i=0,a=0;const s=r.length-1,l=this.parts,[c,u]=((e,t)=>{const n=e.length-1,r=[];let o,i=2===t?"<svg>":3===t?"<math>":"",a=L;for(let s=0;s<n;s++){const t=e[s];let n,l,c=-1,u=0;for(;u<t.length&&(a.lastIndex=u,l=a.exec(t),null!==l);)u=a.lastIndex,a===L?"!--"===l[1]?a=B:void 0!==l[1]?a=U:void 0!==l[2]?(W.test(l[2])&&(o=RegExp("</"+l[2],"g")),a=V):void 0!==l[3]&&(a=V):a===V?">"===l[0]?(a=o??L,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,n=l[1],a=void 0===l[3]?V:'"'===l[3]?H:q):a===H||a===q?a=V:a===B||a===U?a=L:(a=V,o=void 0);const d=a===V&&e[s+1].startsWith("/>")?" ":"";i+=a===L?t+R:c>=0?(r.push(n),t.slice(0,c)+P+t.slice(c)+z+d):t+z+(-2===c?s:d)}return[Y(e,i+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]})(r,o);if(this.el=J.createElement(c,t),Z.currentNode=this.el.content,2===o||3===o){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=Z.nextNode())&&l.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(P)){const t=u[a++],r=n.getAttribute(e).split(z),o=/([.?@])?(.*)/.exec(t);l.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?oe:"?"===o[1]?ie:"@"===o[1]?ae:re}),n.removeAttribute(e)}else e.startsWith(z)&&(l.push({type:6,index:i}),n.removeAttribute(e));if(W.test(n.tagName)){const e=n.textContent.split(z),t=e.length-1;if(t>0){n.textContent=T?T.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],N()),Z.nextNode(),l.push({type:2,index:++i});n.append(e[t],N())}}}else if(8===n.nodeType)if(n.data===D)l.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(z,e+1));)l.push({type:7,index:i}),e+=z.length-1}i++}}static createElement(e,t){const n=j.createElement("template");return n.innerHTML=e,n}}function ee(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3?arguments[3]:void 0;if(t===Q)return t;let o=void 0!==r?n._$Co?.[r]:n._$Cl;const i=I(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(e),o._$AT(e,n,r)),void 0!==r?(n._$Co??=[])[r]=o:n._$Cl=o),void 0!==o&&(t=ee(e,o._$AS(e,t.values),o,r)),t}class te{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??j).importNode(t,!0);Z.currentNode=r;let o=Z.nextNode(),i=0,a=0,s=n[0];for(;void 0!==s;){if(i===s.index){let t;2===s.type?t=new ne(o,o.nextSibling,this,e):1===s.type?t=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(t=new se(o,this,e)),this._$AV.push(t),s=n[++a]}i!==s?.index&&(o=Z.nextNode(),i++)}return Z.currentNode=j,r}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class ne{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e){e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),I(e)?e===X||null==e||""===e?(this._$AH!==X&&this._$AR(),this._$AH=X):e!==this._$AH&&e!==Q&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>M(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==X&&I(this._$AH)?this._$AA.nextSibling.data=e:this.T(j.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=J.createElement(Y(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new te(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=G.get(e.strings);return void 0===t&&G.set(e.strings,t=new J(e)),t}k(e){M(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,r=0;for(const o of e)r===t.length?t.push(n=new ne(this.O(N()),this.O(N()),this,this.options)):n=t[r],n._$AI(o),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,t=arguments.length>1?arguments[1]:void 0;for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class re{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,o){this.type=1,this._$AH=X,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=X}_$AI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=this.strings;let i=!1;if(void 0===o)e=ee(this,e,t,0),i=!I(e)||e!==this._$AH&&e!==Q,i&&(this._$AH=e);else{const r=e;let a,s;for(e=o[0],a=0;a<o.length-1;a++)s=ee(this,r[n+a],t,a),s===Q&&(s=this._$AH[a]),i||=!I(s)||s!==this._$AH[a],s===X?e=X:e!==X&&(e+=(s??"")+o[a+1]),this._$AH[a]=s}i&&!r&&this.j(e)}j(e){e===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class oe extends re{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===X?void 0:e}}class ie extends re{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==X)}}class ae extends re{constructor(e,t,n,r,o){super(e,t,n,r,o),this.type=5}_$AI(e){if((e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0)??X)===Q)return;const t=this._$AH,n=e===X&&t!==X||e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive,r=e!==X&&(t===X||n);n&&this.element.removeEventListener(this.name,this,t),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class se{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ee(this,e)}}const le={I:ne},ce=A.litHtmlPolyfillSupport;ce?.(J,ne),(A.litHtmlVersions??=[]).push("3.3.1");const ue=globalThis;class de extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const r=n?.renderBefore??t;let o=r._$litPart$;if(void 0===o){const e=n?.renderBefore??null;r._$litPart$=o=new ne(t.insertBefore(N(),e),e,void 0,n??{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}}de._$litElement$=!0,de.finalized=!0,ue.litElementHydrateSupport?.({LitElement:de});const he=ue.litElementPolyfillSupport;he?.({LitElement:de}),(ue.litElementVersions??=[]).push("4.2.1");const pe={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:_};function fe(e){return(t,n)=>"object"==typeof n?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pe,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;const{kind:r,metadata:o}=n;let i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),"setter"===r&&((e=Object.create(e)).wrapped=!0),i.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const o=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,o,e)},init(t){return void 0!==t&&this.C(r,void 0,e,t),t}}}if("setter"===r){const{name:r}=n;return function(n){const o=this[r];t.call(this,n),this.requestUpdate(r,o,e)}}throw Error("Unsupported decorator location: "+r)}(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var me=Object.defineProperty,ge=(e,t,n,r)=>{for(var o,i=void 0,a=e.length-1;a>=0;a--)(o=e[a])&&(i=o(t,n,i)||i);return i&&me(t,n,i),i};const ve=class extends de{constructor(){super(),this.preRender=!1,Object.entries(this.constructor.dependencies).forEach((e=>{let[t,n]=e;this.constructor.define(t,n)}))}emit(e,t){const n=new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:{},...t});return this.dispatchEvent(n),n}static define(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=customElements.get(e);if(!r){try{customElements.define(e,t,n)}catch{customElements.define(e,class extends t{},n)}return}let o=" (unknown version)",i=o;"version"in t&&t.version&&(o=" v"+t.version),"version"in r&&r.version&&(i=" v"+r.version),(!o||!i||o!==i)&&console.warn(`Attempted to register <${e}>${o}, but <${e}>${i} has already been registered.`)}static createProperty(e,t){super.createProperty(e,t),t?.attribute&&"string"==typeof t.attribute&&!Object.prototype.hasOwnProperty.call(this.prototype,t.attribute)&&Object.prototype.hasOwnProperty.call(this.prototype,e)&&Object.defineProperty(this.prototype,t.attribute,{get(){return this[e]},set(t){this[e]=t}})}firstUpdated(e){super.firstUpdated(e),!this.preRender&&this.runFirstUpdated(e)}runFirstUpdated(e){}adoptedCallback(){ye(this)}disconnectedCallback(){super.disconnectedCallback(),ye(this)}};ve.version="1",ve.dependencies={};let be=ve;function ye(e){if(e instanceof be)return;const t=e.localName||e.tagName,n=customElements.get(t.toLowerCase());n&&Object.setPrototypeOf(e,n.prototype)}ge([fe()],be.prototype,"dir"),ge([fe()],be.prototype,"lang"),ge([fe({attribute:"pre-render",type:Boolean})],be.prototype,"preRender");const xe=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.get(e)||window.customElements.define(e,t),t))(e,t):((e,t)=>{const{elements:n,kind:r}=t;return{elements:n,finisher(t){window.customElements.get(e)||window.customElements.define(e,t)},kind:r}})(e,t),we=u`
1041
1041
  :host {
1042
1042
  box-sizing: border-box;
1043
1043
  }