@car-cutter/react-webplayer 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),n=require("react"),xe="cc-webplayer",Ie="cc-webplayer-custom-media",Se="cc-webplayer-icon",Me="composition-loading",Te="composition-loaded",Ne="composition-load-error",_e="item-change",ze="extend-mode-on",Ve="extend-mode-off",Re="hotspots-on",Pe="hotspots-off",Oe="gallery-open",Ae="gallery-close",xt=!1,wt=!1,vt=!1,bt="quality",yt=0,Ct=1/0,Et=1,kt=!1,jt="*",Lt="full_screen",De="cc-webplayer:",It=!1,St=!1;function Mt(t,r){return`https://cdn.car-cutter.com/gallery/${t}/${r}/composition_v3.json`}function Tt(t,r){const o=t.split("/"),s=o.pop();return[o.join("/"),r,s].join("/")}function Nt(){return!!customElements.get(xe)&&!!customElements.get(Ie)&&!!customElements.get(Se)}async function _t(t){const r=await fetch(t);if(!r.ok)throw new Error(`Failed to fetch composition: ${r.statusText}`);return await r.json()}const ke=new Map,zt=t=>{const[r,o]=n.useState({status:"pending",isSuccess:!1});return n.useEffect(()=>{const s=l=>o({status:"success",data:l,isSuccess:!0}),c=ke.get(t);if(c&&!(c instanceof Promise)){s(c);return}o({status:"fetching",isSuccess:!1}),async function(){try{let l;if(c)l=await c;else{const f=_t(t);ke.set(t,f),l=await f,ke.set(t,l)}s(l)}catch(l){o({status:"error",isSuccess:!1,error:l})}}()},[t]),r},qe=n.createContext(null),te=()=>{const t=n.useContext(qe);if(!t)throw new Error("useGlobalContext must be used within a GlobalContextProvider");return t},Vt=({children:t,...r})=>e.jsx(qe.Provider,{value:r,children:t}),Ke=n.createContext(null),ie=()=>{const t=n.useContext(Ke);if(!t)throw new Error("useCompositionContext must be used within a CompositionContextProvider");return t},Rt=({composition:t,children:r})=>{const{aspectRatio:o,categories:s,imageHdWidth:c,imageSubWidths:l}=t,{minMediaWidth:f,maxMediaWidth:h,categoriesFilter:y}=te(),j=n.useMemo(()=>{if(y==="*")return s;function _(d){return y.split("|").some(g=>new RegExp(`^${g.replace(/\*/g,".*")}$`).test(d))}return s.filter(({id:d})=>_(d))},[s,y]),L=n.useMemo(()=>j.flatMap(({items:_})=>_),[j]),v={aspectRatio:o.replace(":"," / ")},R=n.useMemo(()=>{const _=l.concat(c),d=_.sort((u,x)=>u-x),g=d.filter(u=>u>=f&&u<=h);if(g.length===0){const u=(f+h)/2,x=_.reduce((p,i)=>Math.abs(i-u)<Math.abs(p-u)?i:p,c);return console.warn(`None of available media widths (${d.join("|")}) match the given constraints (${f>0?`${f} ≤ `:""}width${h<1/0?` ≤ ${h}`:""}).`,`Using the closest width instead (${x}).`),[x]}return g},[l,c,f,h]);return e.jsx(Ke.Provider,{value:{...t,categories:j,items:L,aspectRatioStyle:v,usedMediaWidths:R},children:r})},Je=500,Le=.75,ge=1+Le*2;function ae(t,r,o){return Math.min(Math.max(t,r),o)}const he=(t,r,o)=>t+(r-t)*o,Qe=n.createContext(null),He=()=>n.useContext(Qe),fe=()=>{const t=He();if(!t)throw new Error("useCustomizationContext must be used within a CustomizationContextProvider");return t},Ze="*:size-full",$e="*:object-cover *:size-full",Pt=({children:t})=>{const{compositionUrl:r}=te(),o=n.useCallback(()=>document.querySelector(`${xe}[composition-url="${r}"]`),[r]),s=n.useCallback(d=>{const g=d.querySelectorAll(Se),u=new Map;for(const x of g){const p=x.getAttribute("name");if(!p){console.warn("Icon element is missing a name attribute");continue}const i=x.innerHTML,a=i?e.jsx("div",{className:Ze,dangerouslySetInnerHTML:{__html:i}}):void 0;if(!a){console.warn(`Icon "${p}" customization is empty.`);continue}u.set(p,{Icon:a})}return u},[]),[c,l]=n.useState(()=>{const d=o();return d?s(d):new Map});n.useEffect(()=>{const d=o();if(!d)return;const g=new MutationObserver(()=>{l(s(d))});return g.observe(d,{childList:!0,subtree:!0}),()=>g.disconnect()},[s,o]);const f=n.useCallback(d=>c.get(d),[c]),h=n.useCallback((d,g)=>{l(u=>{const{Icon:x,...p}=g;return new Map(u.set(d,{...p,Icon:e.jsx("div",{className:Ze,children:x})}))})},[]),y=n.useCallback(d=>{l(g=>(g.delete(d),new Map(g)))},[]),j=n.useCallback(d=>{const g=d.querySelectorAll(Ie),u=new Array;for(const x of g){const p=x.innerHTML;if(!p){console.warn("Custom media element is empty");continue}const i=Number(x.getAttribute("index"));if(Number.isNaN(i)){console.warn("Custom media element is missing the 'index' attribute");continue}const a=x.getAttribute("thumbnail-src")??void 0,b=JSON.stringify({index:i,thumbnailSrc:a});u.push({id:b,Media:e.jsx("div",{className:$e,dangerouslySetInnerHTML:{__html:p}}),index:i,thumbnailSrc:a})}return u},[]),[L,v]=n.useState(()=>{const d=o();return d?j(d):[]});n.useEffect(()=>{const d=o();if(!d)return;const g=new MutationObserver(()=>{v(j(d))});return g.observe(d,{childList:!0,subtree:!0}),()=>g.disconnect()},[j,o]);const R=n.useCallback(d=>{const{Media:g,...u}=d,x=e.jsx("div",{className:$e,children:g}),p=JSON.stringify(u);return v(i=>[...i,{id:p,Media:x,...u}]),p},[]),_=n.useCallback(d=>{v(g=>g.filter(u=>u.id!==d))},[]);return e.jsx(Qe.Provider,{value:{getIconConfig:f,registerIconConfig:h,unregisterIconConfig:y,customMediaList:L,registerCustomMedia:R,unregisterCustomMedia:_},children:t})},et=n.createContext(null),J=()=>{const t=n.useContext(et);if(!t)throw new Error("useControlsContext must be used within a ControlsContextProvider");return t},Ot=({children:t})=>{const{infiniteCarrousel:r,extendBehavior:o,emitEvent:s,isFullScreen:c,requestFullscreen:l,exitFullscreen:f}=te(),{customMediaList:h}=fe(),{categories:y,items:j}=ie(),L=n.useMemo(()=>{const A=new Array(...j),q=h.slice().sort((U,K)=>U.index<0&&K.index<0?K.index-U.index:U.index<0?1:K.index<0?-1:U.index-K.index);for(const U of q){let K=U.index;K<0&&(K=A.length+K+1),A.splice(K,0,{type:"custom",...U})}return A},[j,h]),[v,R]=n.useState(L.map(()=>null));n.useEffect(()=>{R(L.map(()=>null))},[L]);const _=n.useCallback((A,q)=>{R(U=>U.map((K,Ee)=>Ee===A?q:K))},[]),[d,g]=n.useState(0),[u,x]=n.useState(null),p=u??d,i=L[p],a=v[p],[b,C]=n.useState(null),E=!!b,M=n.useCallback(()=>C(null),[]),T=n.useCallback(()=>{if(E||u!==null)return;const A=d-1;A>=0?x(A):r&&(C("first_to_last"),x(L.length-1))},[E,u,d,r,L.length]),w=n.useCallback(()=>{if(E||u!==null)return;const A=d+1;A<L.length?x(A):r&&(C("last_to_first"),x(0))},[E,u,d,L.length,r]),S=n.useCallback(A=>{const q=Math.min(d,A),U=Math.max(d,A);v.slice(q,U+1).filter(Ee=>Ee===null).length>2&&C("instant"),x(A)},[d,v]);n.useEffect(()=>{s(_e,{index:p,item:i})},[i,s,p]);const V=n.useMemo(()=>{let A;if(i.type==="custom"){const q=L.slice(0,p).reverse().find(U=>U.type!=="custom")??L.slice(p+1).find(U=>U.type!=="custom");if(!q)throw new Error("No non-custom item found");A=q}else A=i;for(const q of y)if(q.items.includes(A))return q.id;throw new Error("Current item not found in any category")},[y,i,L,p]),z=n.useCallback(A=>{const q=y.find(({id:K})=>K===A)?.items[0];if(q===void 0)throw new Error("Failed to find target category");const U=L.findIndex(K=>K===q);S(U)},[y,L,S]),m=n.useMemo(()=>{switch(i.type){case"image":return!!i.hotspots?.length;case"360":return a==="running"&&i.images.some(A=>!!A.hotspots?.length);default:return!1}},[i,a]),[I,k]=n.useState(!0),N=n.useCallback(()=>{const A=!I;k(A),s(A?Re:Pe)},[s,I]),P=n.useMemo(()=>{switch(i.type){case"video":return a!=="running";default:return!0}},[i,a]),[H,W]=n.useState(!1),Z=n.useCallback(()=>{const A=!H;W(A),s(A?Oe:Ae)},[s,H]),[Y,D]=n.useState(null),F=n.useCallback(()=>D(null),[]),X=!!Y,Q=n.useMemo(()=>{switch(i.type){case"image":return!0;case"360":return a==="running";default:return!1}},[i.type,a]),[$,se]=n.useState(1),B=$!==1,oe=$<ge,ne=$>1,re=n.useCallback(A=>{se(q=>ae(q+A,1,ge))},[]),pe=n.useCallback(()=>se(1),[]),pt=n.useCallback(()=>re(Le),[re]),ft=n.useCallback(()=>re(-Le),[re]),we=n.useCallback(()=>{pe(),F()},[pe,F]),[ce,ht]=n.useState(!1),[ve,Xe]=n.useState(),[be,Ye]=n.useState(!1),le=n.useCallback(async A=>{we(),ht(A),s(A?ze:Ve)},[s,we]),ue=n.useCallback(()=>{clearTimeout(ve);const A=setTimeout(()=>{Xe(void 0)},Je);Xe(A)},[ve]),ye=n.useCallback(async()=>{if(ue(),o==="full_screen"){const A=await l();if(Ye(!A),A)return}le(!0)},[o,le,l,ue]),Ce=n.useCallback(async()=>{ue(),!(o==="full_screen"&&(Ye(!1),await f()))&&le(!1)},[o,le,f,ue]),gt=n.useCallback(()=>{ce?Ce():ye()},[Ce,ye,ce]);return n.useEffect(()=>{o==="full_screen"&&(be&&ce||c!==ce&&(ue(),le(c)))},[o,le,ce,be,c,ue]),e.jsx(et.Provider,{value:{items:L,setItemInteraction:_,slidable:L.length>1,carrouselItemIndex:d,setCarrouselItemIndex:g,itemIndexCommand:u,setItemIndexCommand:x,masterItemIndex:p,specialCommand:b,isRunningSpecialCommand:E,finishSpecialCommand:M,prevItem:T,nextItem:w,scrollToItemIndex:S,displayedCategoryId:V,changeCategory:z,enableHotspotsControl:m,showHotspots:I,toggleHotspots:N,showGalleryControls:P,showGallery:H,toggleGallery:Z,shownDetails:Y,isShowingDetails:X,setShownDetails:D,resetShownDetails:F,showZoomControls:Q,zoom:$,isZooming:B,setZoom:se,resetZoom:pe,canZoomIn:oe,zoomIn:pt,canZoomOut:ne,zoomOut:ft,resetView:we,extendMode:ce,enableExtendMode:ye,disableExtendMode:Ce,toggleExtendMode:gt,extendTransition:!!ve,fakeFullScreen:be},children:t})},tt=["left","center","right","fullW"],nt=["top","middle","bottom","fullH"],At=[...tt,...nt,"top-left","top-center","top-right","top-fullW","middle-left","middle-center","middle-right","middle-fullW","bottom-left","bottom-center","bottom-right","bottom-fullW","fullH-left","fullH-center","fullH-right","fullW-fullW"];function Dt(t){return tt.includes(t)}function Ht(t){return nt.includes(t)}function Wt(t){return At.includes(t)}function Ft(t){if(!Wt(t))throw new Error(`Invalid position: ${t}`);return Ht(t)?[t,void 0]:Dt(t)?[void 0,t]:t.split("-")}function O(...t){return t.filter(r=>!!r).map(r=>r.trim()).join(" ")}function Xt(t){switch(t){case"left":return"left-1 small:left-2";case"right":return"right-1 small:right-2";case"center":return"left-1/2 -translate-x-1/2";case"fullW":return"inset-x-1 small:inset-x-2"}}function rt(t){switch(t){case"top":return"top-1 small:top-2";case"bottom":return"bottom-1 small:bottom-2";case"middle":return"top-1/2 -translate-y-1/2";case"fullH":return"inset-y-1 small:inset-y-2"}}function Yt({positionX:t,positionY:r}){const o=new Array;return t&&o.push(Xt(t)),r&&o.push(rt(r)),o.join(" ")}function de(t){const[r,o]=Ft(t);return Yt({positionX:o,positionY:r})}const G=({customizationKey:t,className:r,children:o})=>{const{getIconConfig:s}=fe(),l=s(t)?.Icon;return l?r?e.jsx("div",{className:r,children:l}):l:o},Zt=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_CLOSE",children:e.jsx("svg",{className:t,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"currentColor"})})}),$t={fill:{primary:"bg-primary text-primary-foreground hover:opacity-80",neutral:"bg-background text-neutral-foreground hover:opacity-80"},ghost:{primary:"bg-transparent text-foreground hover:bg-primary/25",neutral:"bg-transparent text-background hover:bg-foreground/25"}},Ut={button:"h-8 px-2",icon:"size-8 p-2"},ee=({variant:t="fill",shape:r="button",color:o="primary",className:s,children:c,...l})=>{const f=$t[t][o],h=Ut[r];return e.jsx("button",{className:O("flex items-center justify-center rounded-ui text-sm transition-all disabled:opacity-60",f,h,s),...l,children:c})},ot=t=>e.jsx(ee,{color:"neutral",shape:"icon",...t,children:e.jsx(Zt,{className:"size-full"})}),st=({text:t,className:r})=>e.jsxs("div",{className:O("flex size-full flex-col items-center justify-center gap-y-4",r),children:[e.jsx("img",{className:"h-20 small:h-28",src:"https://cdn.car-cutter.com/libs/web-player/v3/assets/car_placeholder.png"}),e.jsx("div",{className:"text-2xl font-bold",children:t})]}),Gt={primary:"border-primary",foreground:"border-foreground",background:"border-background"},Bt={sm:"size-4 border",md:"size-8 border-2",lg:"size-12 border-4"},at=({color:t="foreground",size:r="md"})=>{const o=Gt[t],s=Bt[r];return e.jsx("div",{className:O("inline-block animate-rotation rounded-full border-b-transparent",s,o)})},me=({src:t,className:r,onLoad:o,imgInPlayerWidthRatio:s=1,onlyThumbnail:c,fadeIn:l,...f})=>{const{mediaLoadStrategy:h,playerInViewportWidthRatio:y}=te(),{imageHdWidth:j,usedMediaWidths:L}=ie(),[v,R]=n.useMemo(()=>{const g=L.map(x=>`${x!==j?Tt(t,x):t} ${x}w`);let u;if(c)u=[`${L[0]}px`];else{const x=1/(s*y);switch(h){case"quality":{const p=[...L],i=p.pop();u=p.map(a=>`(max-width: ${x*a}px) ${a}px`),u.push(`${i}px`);break}case"balanced":{u=[];for(let p=0;p<L.length-1;p++){const i=L[p],a=L[p+1],b=Math.round((i+a)/2);u.push(`(max-width: ${x*b}px) ${i}px`)}u.push(`${L[L.length-1]}px`);break}case"speed":{const p=[...L],i=p.shift();u=p.reverse().map(a=>`(min-width: ${x*a}px) ${a}px`),u.push(`${i}px`);break}}}return[g.join(", "),u.join(", ")]},[j,s,h,c,y,t,L]),[_,d]=n.useState();return n.useEffect(()=>{if(_===!0)return;const g=setTimeout(()=>{d(u=>u??!1)},30);return()=>clearTimeout(g)},[_]),e.jsx("img",{src:t,srcSet:v,sizes:R,className:O(r,l&&O(_!==void 0&&"transition-opacity duration-200",_===!1&&"opacity-0",_===!0&&"opacity-100")),onLoad:g=>{d(!0),o?.(g)},...f})},it=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_IMAGE",children:e.jsx("svg",{className:t,viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M9.5 2.5V9.5H2.5V2.5H9.5ZM9.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V2.5C10.5 1.95 10.05 1.5 9.5 1.5ZM7.07 5.93L5.57 7.865L4.5 6.57L3 8.5H9L7.07 5.93Z",fill:"currentColor"})})}),We=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_PLAY",children:e.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})})}),ct=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_360",children:e.jsxs("svg",{className:t,viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxs("g",{clipPath:"url(#clip0_134_843)",children:[e.jsx("path",{d:"M35.2497 43.93C34.4358 43.93 33.7296 43.325 33.6241 42.4966C33.51 41.5977 34.1457 40.7765 35.0442 40.662C40.2284 40.0015 44.8709 38.5967 48.1162 36.7057C51.0843 34.9767 52.7185 32.9438 52.7185 30.9819C52.7185 28.8196 50.8062 27.0504 49.2014 25.9464C48.455 25.4329 48.2662 24.4117 48.7798 23.6649C49.2933 22.9185 50.3148 22.7297 51.0612 23.2432C54.2921 25.4657 55.9998 28.1416 55.9998 30.9823C55.9998 34.2063 53.8452 37.1659 49.7684 39.5409C46.0988 41.6789 41.1509 43.1922 35.4591 43.9172C35.3886 43.9257 35.3185 43.93 35.2497 43.93Z",fill:"currentColor"}),e.jsx("path",{d:"M27.6 41.5797L23.225 37.2047C22.5842 36.5638 21.5455 36.5638 20.9047 37.2047C20.2642 37.8451 20.2642 38.8842 20.9047 39.5246L22.183 40.8029C17.2816 40.2966 12.8289 39.1555 9.38102 37.4973C5.50463 35.6333 3.28124 33.2582 3.28124 30.9818C3.28124 29.0511 4.87316 27.0443 7.76347 25.3311C8.5432 24.8692 8.8004 23.8626 8.33854 23.0833C7.87627 22.3036 6.86968 22.0464 6.09038 22.5083C1.05658 25.4922 0 28.7631 0 30.9818C0 34.622 2.82665 37.9861 7.95915 40.4547C11.9428 42.3701 17.0958 43.6531 22.7098 44.1495L20.9047 45.9546C20.2642 46.5951 20.2642 47.6341 20.9047 48.275C21.2251 48.595 21.6451 48.7552 22.0651 48.7552C22.4846 48.7552 22.9046 48.595 23.225 48.275L27.6 43.9C28.2405 43.2592 28.2405 42.2201 27.6 41.5797Z",fill:"currentColor"}),e.jsx("path",{d:"M17.1827 27.6963V27.3016C17.1827 25.9092 16.3303 25.6391 15.1874 25.6391C14.4808 25.6391 14.2522 25.0158 14.2522 24.3924C14.2522 23.7687 14.4808 23.1453 15.1874 23.1453C15.977 23.1453 16.8084 23.0415 16.8084 21.3581C16.8084 20.1529 16.1227 19.8619 15.2703 19.8619C14.2522 19.8619 13.7327 20.1114 13.7327 20.9219C13.7327 21.6282 13.4208 22.1063 12.2155 22.1063C10.7193 22.1063 10.5326 21.7944 10.5326 20.7967C10.5326 19.1762 11.696 17.0771 15.2703 17.0771C17.9098 17.0771 19.9046 18.0329 19.9046 20.8386C19.9046 22.3553 19.3437 23.7687 18.3046 24.2468C19.5308 24.7039 20.4242 25.6182 20.4242 27.3016V27.6963C20.4242 31.1045 18.076 32.393 15.1665 32.393C11.5922 32.393 10.2207 30.2111 10.2207 28.4654C10.2207 27.5301 10.6155 27.2806 11.7584 27.2806C13.0884 27.2806 13.4208 27.5716 13.4208 28.3616C13.4208 29.3382 14.3355 29.5668 15.2703 29.5668C16.6836 29.5668 17.1827 29.0473 17.1827 27.6963Z",fill:"white"}),e.jsx("path",{d:"M33.0384 27.3016V27.4887C33.0384 31.063 30.8146 32.393 27.9469 32.393C25.0792 32.393 22.8345 31.063 22.8345 27.4887V21.9815C22.8345 18.4072 25.1412 17.0771 28.134 17.0771C31.646 17.0771 33.0384 19.2591 33.0384 20.9839C33.0384 21.9815 32.5603 22.293 31.5212 22.293C30.6279 22.293 29.8379 22.0644 29.8379 21.1086C29.8379 20.3191 29.0069 19.9034 28.0302 19.9034C26.804 19.9034 26.0764 20.5477 26.0764 21.9815V23.8515C26.7416 23.1244 27.6769 22.9372 28.6745 22.9372C31.0431 22.9372 33.0384 23.9763 33.0384 27.3016ZM26.0764 27.7173C26.0764 29.1511 26.7831 29.7745 27.9469 29.7745C29.1107 29.7745 29.7964 29.1511 29.7964 27.7173V27.5301C29.7964 26.013 29.1107 25.4311 27.926 25.4311C26.804 25.4311 26.0764 25.9715 26.0764 27.343V27.7173Z",fill:"white"}),e.jsx("path",{d:"M35.5527 27.4887V21.9815C35.5527 18.4072 37.7761 17.0771 40.6442 17.0771C43.5119 17.0771 45.7562 18.4072 45.7562 21.9815V27.4887C45.7562 31.063 43.5119 32.393 40.6442 32.393C37.7761 32.393 35.5527 31.063 35.5527 27.4887ZM42.5143 21.9815C42.5143 20.5477 41.808 19.9034 40.6442 19.9034C39.4804 19.9034 38.7947 20.5477 38.7947 21.9815V27.4887C38.7947 28.9225 39.4804 29.5668 40.6442 29.5668C41.808 29.5668 42.5143 28.9225 42.5143 27.4887V21.9815Z",fill:"white"}),e.jsx("path",{d:"M49.6948 17.0625C46.9805 17.0625 44.7729 14.8545 44.7729 12.1406C44.7729 9.42675 46.9805 7.21875 49.6948 7.21875C52.4087 7.21875 54.6167 9.42675 54.6167 12.1406C54.6167 14.8545 52.4087 17.0625 49.6948 17.0625ZM49.6948 10.5C48.7899 10.5 48.0542 11.2361 48.0542 12.1406C48.0542 13.0455 48.7899 13.7812 49.6948 13.7812C50.5993 13.7812 51.3354 13.0455 51.3354 12.1406C51.3354 11.2361 50.5993 10.5 49.6948 10.5Z",fill:"white"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_134_843",children:e.jsx("rect",{width:"56",height:"56",fill:"white"})})})]})}),qt=({src:t,withCdn:r})=>{const{permanentGallery:o}=te();if(!t)return null;const s="size-full object-cover";return r?e.jsx(me,{className:s,src:t,onlyThumbnail:!0,fadeIn:!o}):e.jsx("img",{className:s,src:t})},je=({children:t})=>{const{extendMode:r}=J();return e.jsx("div",{className:O("flex aspect-square h-3/4 items-center justify-center rounded-full bg-foreground/50 p-1",r&&"large:h-3/5 large:p-2"),children:t})},Kt=({item:t})=>{const{aspectRatioStyle:r}=ie(),{type:o}=t;let s,c;switch(o){case"360":s=t.images[0].src,c=!0;break;case"image":s=t.src,c=!0;break;case"video":s=t.poster,c=!0;break;case"custom":s=t.thumbnailSrc,c=!1;break}const l=e.jsx(qt,{src:s,withCdn:c});let f;switch(o){case"360":f=e.jsx(je,{children:e.jsx(ct,{className:"size-full text-primary-light"})});break;case"video":f=e.jsx(je,{children:e.jsx(We,{className:"size-full p-0.5 text-background"})});break;case"custom":f=s?null:e.jsx(je,{children:e.jsx(it,{className:"size-full p-0.5 text-background"})});break}return e.jsxs("div",{className:"relative bg-foreground/30",style:r,children:[l,f&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-foreground/25",children:f})]})},Jt={primary:"bg-primary/50",neutral:"bg-neutral/50",background:"bg-background/50",foreground:"bg-foreground/50"},lt=({color:t="neutral",orientation:r="horizontal"})=>{const o=Jt[t],s=r==="horizontal"?"h-px w-full":"w-px h-full";return e.jsx("div",{className:O(o,s)})},ut=({className:t="",containerClassName:r=""})=>{const{hideCategoriesNav:o,infiniteCarrousel:s,permanentGallery:c,isFullScreen:l}=te(),{categories:f,aspectRatioStyle:h}=ie(),{items:y,extendMode:j,extendTransition:L,masterItemIndex:v,prevItem:R,nextItem:_,scrollToItemIndex:d,resetView:g}=J(),u=n.useMemo(()=>{if(o)return[];const w=new Array;let S=f[0];const V=z=>f.find(m=>m.items.some(I=>I===z));for(let z=0;z<y.length;z++){const m=y[z],I=V(m);I&&I!==S&&(w.push(z),S=I)}return w},[f,o,y]),x=n.useRef(null),p=n.useCallback(()=>{if(!x.current)throw new Error("slider.current is null");return x.current},[]),i=n.useRef(!1),a=n.useRef(null),[b,C]=n.useState(!1),E=n.useCallback((w,S)=>{const V=p(),z=V.clientWidth,m=V.scrollWidth/y.length,I=(w+1/2)*m-z/2,k=V.scrollWidth-V.clientWidth;V.scrollTo({left:ae(I,0,k),behavior:S})},[y.length,p]);n.useEffect(()=>{const w=x.current;if(!w)return;const S=m=>{m.preventDefault(),i.current=!0,a.current={x:m.pageX-w.offsetLeft,scrollLeft:w.scrollLeft}},V=m=>{if(!i.current)return;if(a.current===null)throw new Error("[onMouseMove] scrollStart is null");const k=m.pageX-w.offsetLeft-a.current.x;if(!b&&Math.abs(k)<5)return;const N=a.current.scrollLeft-k;C(!0),requestAnimationFrame(()=>{w.scrollLeft=N})},z=()=>{i.current&&(i.current=!1,requestAnimationFrame(()=>{C(!1)}))};return w.addEventListener("mousedown",S),document.addEventListener("mousemove",V),document.addEventListener("mouseleave",z),document.addEventListener("mouseup",z),document.addEventListener("contextmenu",z),()=>{w.removeEventListener("mousedown",S),document.removeEventListener("mousemove",V),document.removeEventListener("mouseleave",z),document.removeEventListener("mouseup",z),document.removeEventListener("contextmenu",z)}},[b]);const M=n.useRef(v);n.useEffect(()=>{x.current&&(E(v,"smooth"),M.current=v)},[v,E]),n.useEffect(()=>{x.current&&E(M.current,"instant")},[E,l,j,L]);const T=w=>{b||(s&&w===y.length-1&&v===0?R():s&&w===0&&v===y.length-1?_():d(w),g())};return e.jsx("div",{ref:x,className:O("relative w-full overflow-x-auto no-scrollbar",b?"cursor-grab":"cursor-grabbing",t),children:e.jsx("div",{className:O("flex h-10 w-fit gap-1 small:h-12 small:gap-2",j&&"large:h-20 large:gap-4",r),children:y.map((w,S)=>e.jsxs(n.Fragment,{children:[u.includes(S)&&e.jsx("div",{className:"my-2",children:e.jsx(lt,{color:c&&!l?"neutral":"background",orientation:"vertical"})}),e.jsx("div",{className:O("relative h-full overflow-hidden rounded-gallery transition-radius",!b&&"cursor-pointer","after:absolute after:inset-0 after:rounded-gallery after:border-2 after:border-primary after:transition-all",S===v?"after:opacity-100":"after:opacity-0 hover:after:opacity-70"),style:h,onClick:()=>T(S),children:e.jsx(Kt,{item:w})})]},S))})})},dt=t=>1-Math.pow(1-t,2),Qt=({Media:t,itemIndex:r})=>{const{setItemInteraction:o}=J();return n.useEffect(()=>{o(r,"ready")},[r,o]),t},Ue=(t,r)=>Math.sqrt((t.clientX-r.clientX)**2+(t.clientY-r.clientY)**2),en=({onlyPreload:t,...r})=>{const{zoom:o,isZooming:s,setZoom:c}=J(),l=n.useRef(null),f=n.useRef(null),h=n.useCallback(i=>{if(!f.current)throw new Error(`[${i??"getTransformElementOrThrow"}] transformElementRef.current is null`);return f.current},[]),y=n.useRef(!1),j=n.useRef(null),L=n.useRef(new Map),v=n.useRef({x:0,y:0,scale:1}),R=n.useRef(null),_=n.useCallback(i=>{const a=h("setTransformStyle"),{x:b,y:C,scale:E}={...v.current,...i},M=ae(E,1,ge),T=a.clientWidth,w=a.clientHeight,S=T*M,V=w*M,z=ae(b,-(S-T),0),m=ae(C,-(V-w),0);v.current={x:z,y:m,scale:M},a.style.transform=`translate(${z}px, ${m}px) scale(${M})`},[h]),d=n.useCallback((i,a)=>{const{x:b,y:C,scale:E}=v.current,{x:M,y:T,scale:w}={...v.current,...i};R.current&&(cancelAnimationFrame(R.current),R.current=null);const S=()=>{_({x:M,y:T,scale:w}),c(w)},V=Math.abs(M-b)<1&&Math.abs(T-C)<1&&Math.abs(w-E)<.005;if(!a||V){S();return}const z=new Date().getTime(),m=()=>{const I=()=>{const N=new Date().getTime()-z;if(N>=a){S(),R.current=null;return}const P=Math.min(N/a,1),H=dt(P),W=he(b,M,H),Z=he(C,T,H),Y=he(E,w,H);_({x:W,y:Z,scale:Y}),m()};R.current=requestAnimationFrame(I)};m()},[_,c]),g=n.useCallback((i,a)=>{let{x:b,y:C}=v.current;i.x&&(b+=i.x),i.y&&(C+=i.y),d({x:b,y:C},a)},[d]),u=n.useCallback((i,a,b)=>{const C=v.current.scale,E=ae(i,1,ge),M=E/C,{x:T,y:w}=v.current,{x:S,y:V}=a,z=-T+S,m=-w+V,I=z*M,k=m*M,N=I-S,P=k-V,H=-N,W=-P;d({x:H,y:W,scale:E},b)},[d]),x=n.useCallback(i=>{const a=h("shiftZoomFromButton"),b=a.clientWidth,C=a.clientHeight;u(i,{x:b/2,y:C/2},200)},[h,u]),p=n.useCallback((i,a,b)=>{const{scale:C}=v.current;u(C+i,a,b)},[u]);return n.useEffect(()=>{t||f.current&&x(o)},[t,x,o]),n.useEffect(()=>{if(t||!s)return;const i=f.current;if(!i)return;const a=E=>{E.preventDefault(),E.stopPropagation(),y.current=!0,j.current={x:E.clientX,y:E.clientY}},b=E=>{if(!y.current)return;if(!j.current)throw new Error("mouseStartXY.current is null");E.stopPropagation();const M=E.clientX-j.current.x,T=E.clientY-j.current.y;g({x:M,y:T}),j.current={x:E.clientX,y:E.clientY}},C=()=>{y.current=!1};return i.addEventListener("mousedown",a),document.addEventListener("mousemove",b),document.addEventListener("mouseleave",C),document.addEventListener("mouseup",C),document.addEventListener("contextmenu",C),()=>{i.removeEventListener("mousedown",a),document.removeEventListener("mousemove",b),document.removeEventListener("mouseleave",C),document.removeEventListener("mouseup",C),document.removeEventListener("contextmenu",C)}},[s,g,t]),n.useEffect(()=>{if(t)return;const i=l.current;if(!i)return;const a=b=>{const{ctrlKey:C,clientX:E,clientY:M,deltaX:T,deltaY:w}=b;if(C){if(!s&&w>=0)return;const{left:S,top:V}=i.getBoundingClientRect(),z=E-S,m=M-V;p(-.01*w,{x:z,y:m})}else{if(!s)return;g({x:-2*T,y:-2*w})}b.preventDefault()};return i.addEventListener("wheel",a),()=>{i.removeEventListener("wheel",a)}},[s,g,p,t]),n.useEffect(()=>{const i=l.current,a=f.current;if(!i||!a)return;const b=L.current,C=T=>{for(let w=0;w<T.changedTouches.length;w++){const S=T.changedTouches[w];b.set(S.identifier,S)}},E=T=>{for(let w=0;w<T.changedTouches.length;w++){const S=T.changedTouches[w];b.delete(S.identifier)}},M=T=>{const w=T.touches.length;if(w===1){if(!s)return;T.preventDefault();const S=T.touches[0],V=b.get(S.identifier);if(!V)throw new Error("touchStart is null");const z=S.clientX-V.clientX,m=S.clientY-V.clientY;g({x:z,y:m}),b.set(S.identifier,S)}else if(w===2){T.preventDefault();const[S,V]=T.touches,z=b.get(S.identifier),m=b.get(V.identifier);if(!z||!m)throw new Error("intialTouch1 or intialTouch2 is null");const I=Ue(z,m),N=Ue(S,V)/I,{left:P,top:H}=i.getBoundingClientRect();p(N-1,{x:(S.clientX+V.clientX)/2-P,y:(S.clientY+V.clientY)/2-H}),b.set(S.identifier,S),b.set(V.identifier,V)}};return a.addEventListener("touchstart",C),a.addEventListener("touchmove",M),a.addEventListener("touchend",E),a.addEventListener("touchcancel",E),()=>{a.removeEventListener("touchstart",C),a.removeEventListener("touchmove",M),a.removeEventListener("touchend",E),a.removeEventListener("touchcancel",E)}},[s,g,p]),e.jsx("div",{ref:l,className:`relative size-full overflow-hidden ${s?"z-zoomed-image cursor-move":""}`,children:e.jsx("div",{ref:f,className:"origin-top-left",children:e.jsx(me,{...r,imgInPlayerWidthRatio:t?1:o})})})},tn=({hotspot:t})=>{const{title:r,icon:o,description:s,position:c,detail:l}=t,{getIconConfig:f}=fe(),h=o?f(o):void 0,{extendMode:y,setShownDetails:j}=J(),L=!!l,v=l?.type==="image",R=!!r||!!s,_=v?e.jsx(it,{className:"size-4"}):e.jsx("div",{className:"size-1"}),d=()=>{v&&j({src:l.src,title:r,text:s})};return e.jsxs("div",{className:O("group absolute z-hotspot -translate-x-1/2 -translate-y-1/2 hover:z-hotspot-hover",L?"cursor-pointer":"cursor-help"),style:{top:`${100*t.position.y}%`,left:`${100*t.position.x}%`},onClick:d,children:[e.jsxs("div",{className:"relative flex items-center justify-center rounded-full border-2 border-background bg-primary text-primary-foreground",children:[e.jsx("div",{className:"pointer-events-none absolute -z-20 size-8 animate-hotspot-ping rounded-full border-2 border-background"}),e.jsx("div",{className:"p-1",children:h?.Icon?e.jsx("div",{className:"size-4",children:h.Icon}):_})]}),!v&&R&&e.jsx("div",{className:O("absolute -z-10 w-max max-w-40 text-pretty rounded-ui bg-background p-2 small:max-w-48",y&&"large:max-w-56",c.y<.55?"-top-1":"-bottom-1",c.x<.55?"-left-1 pl-6 small:pl-8":"-right-1 pr-4 small:pr-6","pointer-events-none opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100"),children:e.jsxs("div",{className:"space-y-1 text-pretty",children:[r&&e.jsx("div",{className:"text-sm font-semibold small:text-base small:font-bold",children:r}),s&&e.jsx("div",{className:"text-xs text-foreground/65 small:text-sm",children:s})]})})]})},nn=({hotspot:t})=>{const{detail:r}=t,o=e.jsx(tn,{hotspot:t});switch(r?.type){case"link":case"pdf":return e.jsx("a",{href:r.src,target:"_blank",rel:"noreferrer",children:o});default:return o}},mt=({hotspots:t,itemIndex:r,className:o,onLoad:s,...c})=>{const{isShowingDetails:l,showHotspots:f,setItemInteraction:h}=J();return e.jsx("div",{className:O("relative size-full overflow-hidden",o),children:e.jsxs("div",{className:O("size-full duration-details",l?"scale-105":"scale-100"),children:[e.jsx(en,{className:"size-full object-cover",onLoad:y=>{r!==void 0&&h(r,"ready"),s?.(y)},...c}),f&&t?.map((y,j)=>e.jsx(nn,{hotspot:y},j))]})})},rn=750,on=1250,sn=360,an=480,cn=({images:t,onlyPreload:r})=>{const{demoSpin:o,reverse360:s}=te(),{isShowingDetails:c,isZooming:l}=J(),f=l||c,h=n.useRef(null),y=n.useRef(null),j=n.useRef(o),L=n.useRef(null),v=n.useCallback(()=>{L.current&&(clearTimeout(L.current),L.current=null)},[]),R=n.useRef(null),_=()=>{R.current&&(cancelAnimationFrame(R.current),R.current=null)},[d,g]=n.useState(0),u=t.length,x=n.useCallback(()=>{g(i=>(i-1+u)%u)},[u]),p=n.useCallback(()=>{g(i=>(i+1)%u)},[u]);return n.useEffect(()=>{if(f){v();return}const i=h.current,a=y.current;if(!i||!a)return;j.current&&(j.current=!1,L.current=setTimeout(()=>{const D=Date.now(),F=()=>{const X=()=>{const $=(Date.now()-D)/on,B=Math.round((ne=>ne*(2-ne))($)*u),oe=ae(B%u,0,u-1);g(oe),!(B>=u)&&F()};R.current=requestAnimationFrame(X)};F()},rn));const b=sn/u;let C=null,E=[];const M=D=>{E.push(D),E.length>20&&E.shift()},T=()=>{const D=(()=>{const se=Date.now(),B=E.filter(re=>se-re.timestamp<50);if(B.length<2)return 0;const oe=B[0],ne=B[B.length-1];return(ne.value-oe.value)/(.001*Math.max(ne.timestamp-oe.timestamp,1))})(),F=Date.now();let X=0,Q=F;const $=()=>{const se=()=>{const B=Date.now(),oe=(B-F)/1e3,ne=Math.pow(.05,oe),re=D*ne,pe=(B-Q)/1e3;if(X+=re*pe,Math.abs(re)<5*b&&Math.abs(X)<b){R.current=null;return}Math.abs(X)>=b&&(X>0!==s?p():x(),X=0),Q=B,$()};R.current=requestAnimationFrame(se)};$()},w=()=>{v(),_()},S=D=>{if(D.button!==0)return;D.preventDefault(),D.stopPropagation(),w();const F=D.clientX;C=F,E=[{timestamp:Date.now(),value:F}]},V=D=>{if(C===null)return;D.stopPropagation();const{clientX:F}=D;M({timestamp:Date.now(),value:F});const X=F-C;Math.abs(X)<b||(X>0!==s?p():x(),C=F)},z=()=>{C!==null&&(C=null,T())};i.addEventListener("mousedown",S),document.addEventListener("mousemove",V),document.addEventListener("mouseleave",z),document.addEventListener("mouseup",z),document.addEventListener("contextmenu",z);const m=an/u,I=()=>a.getBoundingClientRect().width,k=()=>a.scrollWidth/2-I()/2,N=()=>{const D=k();a.scrollLeft=D};N();const P=()=>{const D=a.scrollLeft-k();Math.abs(D)<m||(D<0!==s?p():x(),N())};a.addEventListener("scroll",P);let H=null;const W=D=>{if(H!==null||D.changedTouches.length!==1)return;w();const{identifier:F,clientX:X}=D.changedTouches[0];H=F,C=X,E=[{timestamp:Date.now(),value:X}]},Z=D=>{if(!C)return;const F=Array.from(D.changedTouches).find(({identifier:$})=>$===H);if(!F)return;D.preventDefault();const{clientX:X}=F;M({timestamp:Date.now(),value:X});const Q=X-C;Math.abs(Q)<b||(Q>0!==s?p():x(),C=X)},Y=D=>{!C||!Array.from(D.changedTouches).some(({identifier:X})=>X===H)||(H=null,C=null,T())};return a.addEventListener("touchstart",W),a.addEventListener("touchmove",Z),a.addEventListener("touchend",Y),a.addEventListener("touchcancel",Y),()=>{i.removeEventListener("mousedown",S),document.removeEventListener("mousemove",V),document.removeEventListener("mouseleave",z),document.removeEventListener("mouseup",z),document.removeEventListener("contextmenu",z),a.removeEventListener("scroll",P),a.removeEventListener("touchstart",W),a.removeEventListener("touchmove",Z),a.removeEventListener("touchend",Y),a.removeEventListener("touchcancel",Y)}},[v,p,x,f,s,u]),e.jsx("div",{ref:h,className:"cursor-ew-resize",children:e.jsxs("div",{ref:y,className:"overflow-x-scroll no-scrollbar",children:[e.jsxs("div",{className:"sticky left-0 top-0",children:[t.map(i=>e.jsx(me,{src:i.src,className:"pointer-events-none !absolute left-0 top-0 -z-10"},i.src)),e.jsx(mt,{...t[d],onlyPreload:r})]}),e.jsx("div",{className:"pointer-events-none -mt-px h-px w-[calc(100%+1024px)]"})]})})},ln=({images:t,onPlaceholderImageLoaded:r,onSpinImagesLoaded:o,onError:s})=>{const{autoLoad360:c}=te(),l=n.useMemo(()=>t.map(({src:v})=>v),[t]),[f,h]=n.useState(null),y=f?[...f.values()].filter(v=>v).length/t.length*100:null,j=n.useCallback(()=>{y===null&&h(new Map(l.map(v=>[v,!1])))},[l,y]),L=n.useCallback(v=>{h(R=>{const _=new Map(R);return _.set(v,!0),_})},[]);return n.useEffect(()=>{c&&j()},[c,j]),n.useEffect(()=>{y===100&&o()},[y,o]),e.jsxs("div",{className:"relative size-full",children:[y!==null&&y!==100&&e.jsx("div",{className:"hidden",children:l.map(v=>e.jsx(me,{src:v,onLoad:()=>L(v),onError:s},v))}),e.jsx(me,{className:"size-full",src:l[0],onLoad:r}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-y-4 bg-foreground/35",children:[e.jsx(ct,{className:"size-20 text-primary-light"}),e.jsx(ee,{color:"neutral",shape:"icon",onClick:j,children:e.jsx(We,{className:"size-full"})}),e.jsx("div",{className:O("relative h-1 w-3/5 overflow-hidden rounded-full bg-background",y===null&&"invisible"),children:e.jsx("div",{className:"h-full bg-primary transition-[width]",style:{width:`${y??0}%`}})})]})]})},un=t=>{const{itemIndex:r}=t,{setItemInteraction:o}=J(),[s,c]=n.useState();return n.useEffect(()=>{s===null||s==="error"||o(r,s==="spin"?"running":"ready")},[r,o,s]),s==="error"?e.jsx(st,{className:"text-background",text:"Spin could not be loaded"}):s!=="spin"?e.jsx(ln,{...t,onPlaceholderImageLoaded:()=>c(l=>l===null?"placeholder":l),onSpinImagesLoaded:()=>c("spin"),onError:()=>c("error")}):e.jsx(cn,{...t})},dn=t=>e.jsx(ee,{color:"neutral",shape:"icon",...t,children:e.jsx(We,{className:"size-full"})}),mn=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_PAUSE",children:e.jsx("svg",{className:t,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4 12.6667H6.66667V3.33333H4V12.6667ZM9.33333 3.33333V12.6667H12V3.33333H9.33333Z",fill:"currentColor"})})}),pn=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_VOLUME",children:e.jsx("svg",{className:t,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M2 6V10H4.66667L8 13.3333V2.66667L4.66667 6H2ZM11 8C11 6.82 10.32 5.80667 9.33333 5.31334V10.68C10.32 10.1933 11 9.18 11 8ZM9.33333 2.15334V3.52667C11.26 4.1 12.6667 5.88667 12.6667 8C12.6667 10.1133 11.26 11.9 9.33333 12.4733V13.8467C12.0067 13.24 14 10.8533 14 8C14 5.14667 12.0067 2.76 9.33333 2.15334Z",fill:"currentColor"})})}),fn=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_VOLUME_OFF",children:e.jsx("svg",{className:t,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11 8C11 6.82 10.32 5.80667 9.33333 5.31333V6.78667L10.9667 8.42C10.9867 8.28667 11 8.14667 11 8ZM12.6667 8C12.6667 8.62667 12.5333 9.21333 12.3067 9.76L13.3133 10.7667C13.7533 9.94 14 9 14 8C14 5.14667 12.0067 2.76 9.33333 2.15333V3.52667C11.26 4.1 12.6667 5.88667 12.6667 8ZM2.84667 2L2 2.84667L5.15333 6H2V10H4.66667L8 13.3333V8.84667L10.8333 11.68C10.3867 12.0267 9.88667 12.3 9.33333 12.4667V13.84C10.2533 13.6333 11.0867 13.2067 11.7933 12.6333L13.1533 14L14 13.1533L2.84667 2ZM8 2.66667L6.60667 4.06L8 5.45333V2.66667Z",fill:"currentColor"})})}),Ge=({progress:t})=>e.jsx("div",{className:"h-1 w-full overflow-hidden rounded-ui-sm bg-background/25",children:e.jsx("div",{className:"size-full rounded-ui-sm bg-background transition-transform",style:{transform:`translateX(-${100*(1-t)}%)`}})}),hn=3e3,gn=({src:t,poster:r,itemIndex:o})=>{const{carrouselItemIndex:s,setItemInteraction:c}=J(),l=n.useRef(null),f=n.useRef(null),h=n.useCallback(()=>{if(!f.current)throw new Error("videoRef.current is null");return f.current},[]);n.useEffect(()=>{c(o,"ready")},[o,c]);const y=n.useCallback(()=>{h().play()},[h]),j=n.useCallback(()=>{h().pause()},[h]);n.useEffect(()=>{s===o||j()},[s,o,j]);const[L,v]=n.useState(!1),[R,_]=n.useState(!0),d=()=>{v(!0),c(o,"running")},g=()=>{v(!1),c(o,"ready")},u=()=>{_(!1)},x=()=>{_(!0)},[p,i]=n.useState(null),a=k=>{const N=h(),P=k.currentTarget.getBoundingClientRect(),W=(k.clientX-P.left)/P.width,Z=Math.min(1,Math.max(0,W));N.volume=Z,N.muted=!1},b=k=>{const N=h();N.muted=k};n.useEffect(()=>{const k=f.current;if(!k)return;const N=()=>{i({volume:k.volume,isMuted:k.muted})};return N(),k.addEventListener("volumechange",N),()=>{k.removeEventListener("volumechange",N)}},[]);const[C,E]=n.useState(null),M=C?C.currentTime/C.duration:0;n.useEffect(()=>{const k=f.current;if(!k)return;const N=()=>{const P=k.currentTime,H=k.duration;isNaN(P)||isNaN(H)||E({currentTime:P,duration:H})};return N(),k.addEventListener("timeupdate",N),()=>{k.removeEventListener("timeupdate",N)}},[]);const T=k=>{const N=h(),P=k.currentTarget.getBoundingClientRect(),W=(k.clientX-P.left)/P.width,Z=N.duration*W;N.currentTime=Z},w=k=>{const N=Math.floor(k%3600/60),P=Math.floor(k%60);return`${N}:${P.toString().padStart(2,"0")}`},[S,V]=n.useState(!1),z=n.useRef(void 0),m=n.useCallback(()=>clearTimeout(z.current),[]),I=n.useCallback(()=>{m(),z.current=setTimeout(()=>{V(!1)},hn)},[m]);return n.useEffect(()=>{const k=l.current,N=f.current;if(!k||!N)return;const P=()=>{I(),V(!0)},H=()=>{m(),V(!1)};let W=!1;const Z=()=>{W=!0},Y=()=>{W&&(W=!1,j())},D=()=>{W=!1,P()},F=X=>{X.preventDefault(),X.touches.length===1&&(I(),V($=>!$))};return k.addEventListener("mousedown",Z),k.addEventListener("mouseup",Y),k.addEventListener("mouseenter",P),k.addEventListener("mousemove",D),k.addEventListener("mouseleave",H),N.addEventListener("touchstart",F),()=>{k.removeEventListener("mousedown",Z),k.removeEventListener("mouseup",Y),k.removeEventListener("mouseenter",P),k.removeEventListener("mousemove",P),k.removeEventListener("mouseleave",H),N.removeEventListener("touchstart",F)}},[m,j,I]),e.jsxs("div",{ref:l,className:"relative size-full",children:[e.jsx("video",{ref:f,className:"size-full",src:t,poster:r,disablePictureInPicture:!0,playsInline:!0,onPlay:d,onPause:g,onEnded:g,onCanPlay:u,onWaiting:x}),L?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:O("absolute inset-x-0 bottom-0 cursor-auto space-y-2 bg-gradient-to-t from-foreground to-transparent p-4 pr-12 pt-8 transition-opacity duration-300",S?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"),onMouseDownCapture:k=>k.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between text-background",children:[e.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsx(ee,{shape:"icon",variant:"ghost",color:"neutral",onClick:j,children:e.jsx(mn,{className:"size-full"})}),C&&e.jsxs("span",{className:"text-sm",children:[w(C.currentTime)," /"," ",w(C.duration)]})]}),p&&e.jsxs("div",{className:"group/volume flex items-center gap-x-4 rounded-ui-md p-2 transition-colors hover:bg-foreground/25",children:[e.jsx("div",{className:`w-12 cursor-pointer py-1 opacity-0 transition-opacity ${p.isMuted?"group-hover/volume:opacity-50":"group-hover/volume:opacity-100"}`,onClick:a,children:e.jsx(Ge,{progress:p.volume})}),e.jsx("div",{className:"size-5 cursor-pointer",onClick:()=>b(!p.isMuted),children:p.isMuted?e.jsx(fn,{className:"size-full"}):e.jsx(pn,{className:"size-full"})})]})]}),e.jsx("div",{className:"cursor-pointer py-1",onClick:T,children:e.jsx(Ge,{progress:M})})]}),R&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-foreground/25",children:e.jsx(at,{size:"lg",color:"background"})})]}):e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-foreground/25",children:e.jsx(dn,{onClick:y})})]})},xn=({index:t,item:r,isShown:o})=>{const{type:s}=r;let c;switch(s){case"image":c=e.jsx(mt,{itemIndex:t,onlyPreload:!o,...r});break;case"video":c=e.jsx(gn,{itemIndex:t,...r});break;case"360":c=e.jsx(un,{itemIndex:t,onlyPreload:!o,...r});break;case"custom":c=e.jsx(Qt,{itemIndex:t,...r})}return c=e.jsx("div",{className:"-ml-px h-full w-[calc(100%+2px)]",children:c}),c},wn=t=>{n.useEffect(()=>{const r=o=>{o.key==="Escape"&&t()};return addEventListener("keydown",r),()=>{removeEventListener("keydown",r)}},[t])};function vn(t){return t.target===t.currentTarget}const bn=({currentIndex:t,maxIndex:r})=>e.jsxs("div",{className:"space-x-0.5 rounded-ui bg-foreground/40 px-1.5 py-0.5 text-xs text-background/75 transition-radius small:space-x-1 small:px-2 small:py-1 small:text-sm",children:[e.jsx("span",{children:t+1}),e.jsx("span",{children:"/"}),e.jsx("span",{children:r+1})]}),Be=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_ARROW_RIGHT",children:e.jsx("svg",{className:t,viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M4.07666 13.4868L5.25666 14.6668L11.9233 8.00016L5.25666 1.3335L4.07666 2.5135L9.56333 8.00016L4.07666 13.4868Z",fill:"currentColor"})})}),yn=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_EXTEND",children:e.jsx("svg",{className:t,viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M4.66683 9.3335H3.3335V12.6668H6.66683V11.3335H4.66683V9.3335ZM3.3335 6.66683H4.66683V4.66683H6.66683V3.3335H3.3335V6.66683ZM11.3335 11.3335H9.3335V12.6668H12.6668V9.3335H11.3335V11.3335ZM9.3335 3.3335V4.66683H11.3335V6.66683H12.6668V3.3335H9.3335Z",fill:"currentColor"})})}),Cn=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_GALLERY",children:e.jsx("svg",{className:t,viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.3334 2.66683V10.6668H5.33337V2.66683H13.3334ZM13.3334 1.3335H5.33337C4.60004 1.3335 4.00004 1.9335 4.00004 2.66683V10.6668C4.00004 11.4002 4.60004 12.0002 5.33337 12.0002H13.3334C14.0667 12.0002 14.6667 11.4002 14.6667 10.6668V2.66683C14.6667 1.9335 14.0667 1.3335 13.3334 1.3335ZM7.66671 7.78016L8.79337 9.28683L10.4467 7.22016L12.6667 10.0002H6.00004L7.66671 7.78016ZM1.33337 4.00016V13.3335C1.33337 14.0668 1.93337 14.6668 2.66671 14.6668H12V13.3335H2.66671V4.00016H1.33337Z",fill:"currentColor"})})}),En=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_HOTSPOTS",children:e.jsxs("svg",{className:t,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("g",{clipPath:"url(#clip0_418_982)",children:e.jsx("path",{d:"M6 4C4.895 4 4 4.895 4 6C4 7.105 4.895 8 6 8C7.105 8 8 7.105 8 6C8 4.895 7.105 4 6 4ZM10.47 5.5C10.24 3.415 8.585 1.76 6.5 1.53V0.5H5.5V1.53C3.415 1.76 1.76 3.415 1.53 5.5H0.5V6.5H1.53C1.76 8.585 3.415 10.24 5.5 10.47V11.5H6.5V10.47C8.585 10.24 10.24 8.585 10.47 6.5H11.5V5.5H10.47ZM6 9.5C4.065 9.5 2.5 7.935 2.5 6C2.5 4.065 4.065 2.5 6 2.5C7.935 2.5 9.5 4.065 9.5 6C9.5 7.935 7.935 9.5 6 9.5Z",fill:"currentColor"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_418_982",children:e.jsx("rect",{width:"12",height:"12",fill:"white"})})})]})}),kn=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_MINUS",children:e.jsx("svg",{className:t,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.6666 8.66634H3.33325V7.33301H12.6666V8.66634Z",fill:"currentColor"})})}),jn=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_PLUS",children:e.jsx("svg",{className:t,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.6666 8.66634H8.66659V12.6663H7.33325V8.66634H3.33325V7.33301H7.33325V3.33301H8.66659V7.33301H12.6666V8.66634Z",fill:"currentColor"})})}),Ln=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_REDUCE",children:e.jsx("svg",{className:t,viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M3.33325 10.6668H5.33325V12.6668H6.66659V9.3335H3.33325V10.6668ZM5.33325 5.3335H3.33325V6.66683H6.66659V3.3335H5.33325V5.3335ZM9.33325 12.6668H10.6666V10.6668H12.6666V9.3335H9.33325V12.6668ZM10.6666 5.3335V3.3335H9.33325V6.66683H12.6666V5.3335H10.6666Z",fill:"currentColor"})})}),In=({enabled:t,onToggle:r,label:o,className:s,children:c})=>e.jsxs("label",{className:O("flex cursor-pointer items-center justify-center gap-x-2",s),children:[e.jsx("input",{type:"checkbox",className:"sr-only",checked:t,onChange:r}),o&&e.jsx("div",{className:"text-xs text-background",children:o}),e.jsx("div",{className:O("flex h-5 w-8 items-center justify-center rounded-full transition-colors",t?"bg-primary":"bg-background/60"),children:e.jsx("div",{className:O("flex size-4 items-center justify-center rounded-full p-0.5 transition",t?"translate-x-1.5 bg-primary-foreground text-primary":"-translate-x-1.5 bg-background text-foreground"),children:c})})]}),Sn=({className:t})=>e.jsx(G,{className:t,customizationKey:"UI_BURGER",children:e.jsx("svg",{className:t,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M2 12H14V10.6667H2V12ZM2 8.66667H14V7.33333H2V8.66667ZM2 4V5.33333H14V4H2Z",fill:"currentColor"})})}),Mn=({sharedClassName:t})=>{const{categories:r}=ie(),{displayedCategoryId:o,changeCategory:s}=J(),[c,l]=n.useState(!1),f=()=>{l(!c)},h=()=>{l(!1)};return e.jsxs(e.Fragment,{children:[c&&e.jsx("div",{className:O(t,"inset-0 small:hidden"),onClick:h}),e.jsxs("div",{className:O(t,de("top-left"),"flex gap-x-2 small:hidden"),children:[e.jsx(ee,{shape:"icon",color:c?"primary":"neutral",onClick:f,children:e.jsx(Sn,{})}),c&&e.jsx("div",{className:"rounded-ui-md bg-background transition-radius",children:e.jsx("ul",{className:"space-y-0.5 p-1",children:r.map(({id:y,title:j})=>e.jsx("li",{className:O("cursor-pointer rounded-ui px-2 py-1 text-sm font-bold transition-all hover:bg-primary/30",y===o&&"bg-primary/50"),onClick:()=>{s(y),l(!1)},children:j},y))})})]}),e.jsx("div",{className:O(t,rt("top"),"w-full overflow-x-auto max-small:hidden"),children:e.jsx("div",{className:"mx-auto flex w-fit gap-x-1 rounded-ui-md bg-background p-1 shadow",children:r.map(({id:y,title:j})=>e.jsx(ee,{variant:y===o?"fill":"ghost",onClick:()=>s(y),children:j},y))})})]})},Tn=()=>{const{hideCategoriesNav:t,infiniteCarrousel:r,permanentGallery:o,extendBehavior:s}=te(),{aspectRatioStyle:c,categories:{length:l}}=ie(),{items:{length:f},slidable:h,carrouselItemIndex:y,masterItemIndex:j,prevItem:L,nextItem:v,showGalleryControls:R,enableHotspotsControl:_,showHotspots:d,toggleHotspots:g,showGallery:u,toggleGallery:x,extendMode:p,toggleExtendMode:i,shownDetails:a,isShowingDetails:b,resetShownDetails:C,showZoomControls:E,isZooming:M,canZoomIn:T,zoomIn:w,canZoomOut:S,zoomOut:V,resetView:z}=J(),m=n.useCallback(k=>{vn(k)&&C()},[C]);wn(C);const I="absolute z-overlay";return e.jsxs(e.Fragment,{children:[!t&&l>1&&e.jsx(Mn,{sharedClassName:O(I,"transition-opacity",M?"!pointer-events-none opacity-0":"opacity-100")}),h&&!M&&e.jsx("div",{className:O(I,de("top-right")),children:e.jsx(bn,{currentIndex:y,maxIndex:f-1})}),h&&e.jsxs(e.Fragment,{children:[e.jsx(ee,{shape:"icon",color:"neutral",className:O(I,de("middle-left"),M?"!pointer-events-none opacity-0":"opacity-100"),onClick:L,disabled:!r&&j<=0,children:e.jsx(G,{customizationKey:"CONTROLS_PREV",children:e.jsx(Be,{className:"size-full -scale-x-100"})})}),e.jsx(ee,{shape:"icon",color:"neutral",className:O(I,de("middle-right"),M?"!pointer-events-none opacity-0":"opacity-100"),onClick:v,disabled:!r&&j>=f-1,children:e.jsx(G,{customizationKey:"CONTROLS_NEXT",children:e.jsx(Be,{className:"size-full"})})})]}),e.jsxs("div",{className:O(I,de("bottom-fullW"),"pointer-events-none grid grid-cols-[auto,1fr,auto] items-end *:pointer-events-auto small:gap-x-2"),children:[!o&&h&&e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:R&&!M?"opacity-100":"!pointer-events-none opacity-0",variant:"fill",color:u?"primary":"neutral",shape:"icon",onClick:x,children:e.jsx(Cn,{className:"size-full"})}),u&&e.jsx(ut,{className:O("transition-opacity",R&&!M?"opacity-100":"!pointer-events-none opacity-0","[mask-image:linear-gradient(to_left,transparent_0px,black_4px,black_calc(100%-4px),transparent_100%)]"),containerClassName:"mx-1"})]}),e.jsxs("div",{className:"col-start-3 flex flex-col items-end gap-y-1 small:gap-y-2",children:[_&&e.jsx(In,{className:O("transition-opacity",M?"!pointer-events-none opacity-0":"opacity-100"),enabled:d,onToggle:g,children:e.jsx(En,{className:"size-full"})}),E&&e.jsxs("div",{className:"max-small:hidden",children:[e.jsx(ee,{className:"rounded-b-none",color:"neutral",shape:"icon",disabled:!T,onClick:w,children:e.jsx(jn,{className:"size-full"})}),e.jsx(lt,{color:"background"}),e.jsx(ee,{className:"rounded-t-none",color:"neutral",shape:"icon",disabled:!S,onClick:V,children:e.jsx(kn,{className:"size-full"})})]}),s!=="none"&&e.jsx(ee,{variant:"fill",color:p?"primary":"neutral",shape:"icon",onClick:i,children:p?e.jsx(Ln,{className:"size-full"}):e.jsx(yn,{className:"size-full"})})]})]}),e.jsx("div",{className:O(I,"inset-0 flex justify-end overflow-hidden bg-foreground/60 transition-opacity duration-details",b?"opacity-100":"pointer-events-none opacity-0"),onClick:m,children:e.jsx("div",{className:O("h-full w-3/5 bg-background transition-transform duration-details",b?"translate-x-0":"translate-x-full"),children:!!a&&e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-full bg-foreground/65",style:c,src:a.src,imgInPlayerWidthRatio:.6}),e.jsxs("div",{className:O("space-y-1 px-2 py-1 small:p-3",p&&"large:p-4"),children:[a.title&&e.jsx("span",{className:O("text-sm font-semibold small:text-base small:font-bold",p&&"large:text-lg"),children:a.title}),a.text&&e.jsx("p",{className:O("text-xs text-foreground/65 small:text-sm",p&&"large:text-base"),children:a.text})]})]})})}),(M||b)&&e.jsx(ot,{className:O(I,de("top-right")),onClick:z})]})},Nn=({className:t=""})=>{const{infiniteCarrousel:r,preloadRange:o,isFullScreen:s}=te(),{aspectRatioStyle:c}=ie(),{items:l,slidable:f,carrouselItemIndex:h,setCarrouselItemIndex:y,itemIndexCommand:j,setItemIndexCommand:L,specialCommand:v,isRunningSpecialCommand:R,finishSpecialCommand:_,extendMode:d,extendTransition:g}=J(),u=n.useRef(null),x=n.useCallback(m=>{if(!u.current)throw new Error(`[${m??"sliderOrThrow"}] slider.current is null`);return u.current},[]),p=n.useRef(!1),i=n.useRef(null),a=n.useRef(null),b=n.useRef(null),C=n.useCallback(()=>{b.current&&cancelAnimationFrame(b.current)},[]),E=n.useCallback(()=>{const m=x("computeClosestSnapIndex"),I=Array.from(m.children),k=m.scrollLeft;return I.reduce((P,H,W)=>{const Z=H.offsetLeft;return Math.abs(Z-k)<Math.abs(I[P].offsetLeft-k)?W:P},0)},[x]),M=n.useCallback(m=>{const I=x("setStyleCursor");I.style.cursor=m},[x]),T=n.useCallback(m=>{const I=x("setStyleSnapState");m==="mandatory"?I.style.scrollSnapType="x mandatory":I.style.scrollSnapType="none"},[x]),w=n.useCallback((m,I,k)=>{C();const N=x("scrollToIndex"),P=Array.from(N.children),H=N.scrollLeft,W=P[m].offsetLeft,Z=$=>{N.scrollTo({left:$,behavior:"instant"})},Y=()=>{Z(W),T("mandatory"),k?.()},D=Math.abs(H-W);if(D<1||I==="instant"){Y();return}const F=ae(D/2.5,300,1e3),X=new Date().getTime();T("none");const Q=()=>{const $=()=>{const B=new Date().getTime()-X;if(B>=F){Y();return}const oe=Math.min(B/F,1),ne=dt(oe),re=he(H,W,ne);Z(re),Q()};b.current=requestAnimationFrame($)};Q()},[C,x,T]),[S,V]=n.useState(),z=!!S;return n.useEffect(()=>{const m=()=>{clearTimeout(S);const I=setTimeout(()=>{V(void 0)},Je);V(I)};return addEventListener("resize",m),document.addEventListener("fullscreenchange",m),()=>{removeEventListener("resize",m),document.removeEventListener("fullscreenchange",m)}},[S]),n.useEffect(()=>{if(v)return;const m=E();Number.isNaN(m)||m!==h&&w(h,"instant")},[h,E,w,v,l,S,s,d,g]),n.useEffect(()=>{if(!f||R){M("auto");return}const m=u.current;if(!m)return;M("grab"),T("mandatory");const I=P=>{P.button===0&&(P.preventDefault(),P.stopPropagation(),C(),p.current=!0,i.current=P.pageX-m.offsetLeft,a.current=m.scrollLeft,M("grabbing"))},k=P=>{if(!p.current)return;if(i.current===null)throw new Error("[onMouseMove] startX is null");T("none");const W=P.pageX-m.offsetLeft-i.current;requestAnimationFrame(()=>{if(a.current===null)throw new Error("[onMouseMove] scrollLeft is null");m.scrollLeft=a.current-W})},N=()=>{if(!p.current)return;p.current=!1,M("grab");const P=E();w(P,"smooth")};return m.addEventListener("mousedown",I),document.addEventListener("mousemove",k),document.addEventListener("mouseleave",N),document.addEventListener("mouseup",N),document.addEventListener("contextmenu",N),()=>{m.removeEventListener("mousedown",I),document.removeEventListener("mousemove",k),document.removeEventListener("mouseleave",N),document.removeEventListener("mouseup",N),document.removeEventListener("contextmenu",N)}},[C,E,R,w,M,T,f]),n.useEffect(()=>{if(g||z)return;const m=u.current;if(!m)return;const I=()=>{const k=E();Number.isNaN(k)||(y(k),k===j&&L(null))};return m.addEventListener("scroll",I),()=>{m.removeEventListener("scroll",I)}},[E,g,z,j,y,L]),n.useEffect(()=>{if(j===null)return;const m=()=>{setTimeout(()=>{L(null),_()},75)};switch(v){case"first_to_last":w(l.length-1,"instant",m);break;case"last_to_first":w(0,"instant",m);break;case"instant":w(j,"instant",m);break;default:w(j,"smooth");break}},[v,_,j,l.length,w,L]),e.jsxs("div",{className:O("relative overflow-hidden rounded-carrousel transition-radius",t),style:c,children:[e.jsx("div",{ref:u,className:`flex size-full ${f?"overflow-x-auto no-scrollbar *:snap-start *:snap-always":"justify-center"}`,children:l.map((m,I)=>{const k=I===h,N=I===0,P=I===l.length-1,H=(()=>{if(v==="first_to_last"&&N)return{transform:`translateX(${100*l.length}%)`};if(v==="last_to_first"&&P)return{transform:`translateX(-${100*l.length}%)`}})();let W=Math.abs(I-h)<=o;W||=I===j,r&&(W||=h<o&&l.length-I<=o-h,W||=h>=l.length-o&&I<=o-(l.length-h));const Z=(()=>{let Y;switch(m.type){case"360":Y=m.images[0].src;break;case"image":Y=m.src;break;case"video":Y=m.poster??"video";break;case"custom":Y="custom";break}return`${I}_${Y}`})();return e.jsx("div",{className:O("h-full bg-foreground/35",h===I&&"z-1"),style:{...c,...H},children:W&&e.jsx(xn,{index:I,item:m,isShown:k})},Z)})}),e.jsx(Tn,{})]})},_n=()=>{const{permanentGallery:t}=te(),{aspectRatioStyle:r}=ie(),{prevItem:o,nextItem:s,isShowingDetails:c,resetShownDetails:l,extendMode:f,disableExtendMode:h,isZooming:y,resetZoom:j,fakeFullScreen:L}=J(),v=n.useRef(null),R=n.useRef(null),_=n.useRef(null);return n.useEffect(()=>{if(!f)return;const d=v.current,g=R.current,u=_.current;if(!d||!g||!u)return;let x=!1;const p=b=>[d,g,u].includes(b.target),i=b=>{x=p(b)},a=b=>{x&&(p(b)&&h(),x=!1)};return d.addEventListener("mousedown",i),d.addEventListener("mouseup",a),()=>{d.removeEventListener("mousedown",i),d.removeEventListener("mouseup",a)}},[h,f]),n.useEffect(()=>{const d=g=>{g.key==="Escape"&&(y?j():c?l():h())};return addEventListener("keydown",d),()=>{removeEventListener("keydown",d)}},[h,c,y,s,o,l,j]),e.jsxs("div",{ref:v,className:O("relative",f&&"flex size-full items-center justify-center",L&&"fixed inset-0 z-overlay bg-foreground/75"),children:[e.jsxs("div",{ref:R,className:f?"flex size-full flex-col justify-center gap-y-2 small:gap-y-4":"space-y-2",children:[e.jsx("div",{ref:_,className:O(f&&"mx-auto flex min-h-0 w-full max-w-[1600px] justify-center"),style:r,children:e.jsx(Nn,{className:O(f&&"h-full min-w-0")})}),t&&e.jsx(ut,{className:O(f&&"my-2 shrink-0 small:my-4")})]}),f&&e.jsx(ot,{className:"absolute right-2 top-2 small:right-4 small:top-4",onClick:h})]})},zn=()=>{const{emitEvent:t,compositionUrl:r}=te(),{data:o,status:s,isSuccess:c,error:l}=zt(r);return n.useEffect(()=>{l?t(Ne,l):s==="fetching"?t(Me,r):c&&t(Te,o)},[o,r,t,l,c,s]),l?e.jsx(st,{className:"aspect-square text-foreground/70",text:"Player could not be loaded"}):c?e.jsx(Rt,{composition:o,children:e.jsx(Ot,{children:e.jsx(_n,{})})}):e.jsxs("div",{className:"flex aspect-square size-full flex-col items-center justify-center gap-y-4",children:[e.jsx("div",{className:"animate-pulse text-xl",children:"Loading Player"}),e.jsx(at,{color:"foreground"})]})},Vn=({compositionUrl:t,hideCategoriesNav:r=xt,infiniteCarrousel:o=wt,permanentGallery:s=vt,mediaLoadStrategy:c=bt,minMediaWidth:l=yt,maxMediaWidth:f=Ct,preloadRange:h=Et,autoLoad360:y=kt,categoriesFilter:j=jt,extendBehavior:L=Lt,eventPrefix:v=De,demoSpin:R=It,reverse360:_=St,children:d})=>{const g=n.useRef(null),[u,x]=n.useState(.5),[p,i]=n.useState(!1),a=n.useCallback((E,M)=>{const T=v+E,w=new CustomEvent(T,{detail:M});document.dispatchEvent(w)},[v]);n.useEffect(()=>{if(p){x(1);return}if(!g.current)return;const E=g.current,M=()=>{const T=window.innerWidth,w=E.clientWidth;x(w/T)};return M(),addEventListener("resize",M),()=>{removeEventListener("resize",M)}},[p]),n.useEffect(()=>{if(L!=="full_screen")return;const E=g.current;if(!E)throw new Error("Wrapper not found");const M=()=>{const{fullscreenElement:T}=document;i(T===E||T?.localName===xe)};return document.addEventListener("fullscreenchange",M),()=>{document.removeEventListener("fullscreenchange",M)}},[L]);const b=n.useCallback(async()=>{const E=g.current;if(!E)throw new Error("Wrapper not found");try{return await E.requestFullscreen(),!0}catch{return!1}},[]),C=n.useCallback(async()=>{try{return await document.exitFullscreen(),!0}catch{return!1}},[]);return e.jsx(Vt,{compositionUrl:t,hideCategoriesNav:r,infiniteCarrousel:o,permanentGallery:s,mediaLoadStrategy:c,minMediaWidth:l,maxMediaWidth:f,preloadRange:h,categoriesFilter:j,autoLoad360:y,extendBehavior:L,demoSpin:R,reverse360:_,emitEvent:a,playerInViewportWidthRatio:u,isFullScreen:p,requestFullscreen:b,exitFullscreen:C,children:e.jsxs(Pt,{children:[e.jsx("div",{ref:g,className:"select-none text-foreground",style:{"--background":"var(--cc-webplayer-background, 0 0% 100%)","--foreground":"var(--cc-webplayer-foreground, 240 10% 3.9%)","--primary":"var(--cc-webplayer-primary, 216 100% 52%)","--primary-foreground":"var(--cc-webplayer-primary-foreground, var(--background))","--primary-light":"var(--cc-webplayer-primary-light, var(--primary))","--neutral":"var(--cc-webplayer-neutral, 0 0% 39%)","--neutral-foreground":"var(--cc-webplayer-neutral-foreground, var(--foreground))","--radius-ui":"var(--cc-webplayer-radius-ui, 16px)","--radius-carrousel":"var(--cc-webplayer-radius-carrousel, 0)","--radius-gallery":"var(--cc-webplayer-radius-gallery, 0)"},children:e.jsx(zn,{})}),d]})})},Rn=({children:t,index:r,thumbnailSrc:o})=>{const{registerCustomMedia:s,unregisterCustomMedia:c}=fe();return n.useEffect(()=>{if(!t)return;const l=s({Media:t,index:r,thumbnailSrc:o});return()=>{c(l)}},[t,c,r,s,o]),null},Pn=t=>He()?e.jsx(Rn,{...t}):e.jsx("slot",{}),On=({name:t,children:r})=>{const{registerIconConfig:o,unregisterIconConfig:s}=fe();return n.useEffect(()=>{if(r)return o(t,{Icon:r}),()=>{s(t)}},[r,t,o,s]),null},An=t=>He()?e.jsx(On,{...t}):e.jsx("slot",{}),Dn='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.\\!container{width:100%!important}.container{width:100%}@media (min-width: 1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.\\!pointer-events-none{pointer-events:none!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.fixed{position:fixed}.\\!absolute{position:absolute!important}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-x-1{left:4px;right:4px}.inset-y-1{top:4px;bottom:4px}.-bottom-1{bottom:-4px}.-left-1{left:-4px}.-right-1{right:-4px}.-top-1{top:-4px}.bottom-0{bottom:0}.bottom-1{bottom:4px}.left-0{left:0}.left-1{left:4px}.left-1\\/2{left:50%}.right-1{right:4px}.right-2{right:8px}.top-0{top:0}.top-1{top:4px}.top-1\\/2{top:50%}.top-2{top:8px}.-z-10{z-index:-10}.-z-20{z-index:-20}.z-1{z-index:1}.z-hotspot{z-index:10}.z-overlay{z-index:30}.z-zoomed-image{z-index:20}.col-start-3{grid-column-start:3}.mx-1{margin-left:4px;margin-right:4px}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:8px;margin-bottom:8px}.-ml-px{margin-left:-1px}.-mt-px{margin-top:-1px}.inline-block{display:inline-block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-1{width:4px;height:4px}.size-12{width:48px;height:48px}.size-20{width:80px;height:80px}.size-4{width:16px;height:16px}.size-5{width:20px;height:20px}.size-8{width:32px;height:32px}.size-full{width:100%;height:100%}.h-1{height:4px}.h-10{height:40px}.h-20{height:80px}.h-3\\/4{height:75%}.h-5{height:20px}.h-8{height:32px}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:0}.w-12{width:48px}.w-3\\/5{width:60%}.w-8{width:32px}.w-\\[calc\\(100\\%\\+1024px\\)\\]{width:calc(100% + 1024px)}.w-\\[calc\\(100\\%\\+2px\\)\\]{width:calc(100% + 2px)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-0{min-width:0}.max-w-40{max-width:160px}.max-w-\\[1600px\\]{max-width:1600px}.shrink-0{flex-shrink:0}.origin-top-left{transform-origin:top left}.-translate-x-1\\.5{--tw-translate-x: -6px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\\.5{--tw-translate-x: 6px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-scale-x-100{--tw-scale-x: -1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes hotspot-ping{0%{transform:scale(0)}25%{opacity:1}75%,to{transform:scale(1.5);opacity:0}}.animate-hotspot-ping{animation:hotspot-ping 3s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:1}0%,to{opacity:0}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-rotation{animation:rotation 1s linear infinite}.cursor-auto{cursor:auto}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-help{cursor:help}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-\\[auto\\,1fr\\,auto\\]{grid-template-columns:auto 1fr auto}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-x-1{-moz-column-gap:4px;column-gap:4px}.gap-x-2{-moz-column-gap:8px;column-gap:8px}.gap-x-4{-moz-column-gap:16px;column-gap:16px}.gap-y-1{row-gap:4px}.gap-y-2{row-gap:8px}.gap-y-4{row-gap:16px}.space-x-0\\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2px * var(--tw-space-x-reverse));margin-left:calc(2px * calc(1 - var(--tw-space-x-reverse)))}.space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2px * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-scroll{overflow-x:scroll}.text-pretty{text-wrap:pretty}.rounded-carrousel{border-radius:var(--radius-carrousel)}.rounded-full{border-radius:9999px}.rounded-gallery{border-radius:var(--radius-gallery)}.rounded-ui{border-radius:var(--radius-ui)}.rounded-ui-md{border-radius:calc(var(--radius-ui) + 2px)}.rounded-ui-sm{border-radius:calc(var(--radius-ui) - 2px)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-background{border-color:hsl(var(--background))}.border-foreground{border-color:hsl(var(--foreground))}.border-primary{border-color:hsl(var(--primary))}.border-b-transparent{border-bottom-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-background\\/25{background-color:hsl(var(--background) / .25)}.bg-background\\/50{background-color:hsl(var(--background) / .5)}.bg-background\\/60{background-color:hsl(var(--background) / .6)}.bg-foreground\\/25{background-color:hsl(var(--foreground) / .25)}.bg-foreground\\/30{background-color:hsl(var(--foreground) / .3)}.bg-foreground\\/35{background-color:hsl(var(--foreground) / .35)}.bg-foreground\\/40{background-color:hsl(var(--foreground) / .4)}.bg-foreground\\/50{background-color:hsl(var(--foreground) / .5)}.bg-foreground\\/60{background-color:hsl(var(--foreground) / .6)}.bg-foreground\\/65{background-color:hsl(var(--foreground) / .65)}.bg-foreground\\/75{background-color:hsl(var(--foreground) / .75)}.bg-neutral\\/50{background-color:hsl(var(--neutral) / .5)}.bg-primary{background-color:hsl(var(--primary))}.bg-primary-foreground{background-color:hsl(var(--primary-foreground))}.bg-primary\\/50{background-color:hsl(var(--primary) / .5)}.bg-transparent{background-color:transparent}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-foreground{--tw-gradient-from: hsl(var(--foreground)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--foreground) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-2{padding:8px}.p-4{padding:16px}.px-1\\.5{padding-left:6px;padding-right:6px}.px-2{padding-left:8px;padding-right:8px}.py-0\\.5{padding-top:2px;padding-bottom:2px}.py-1{padding-top:4px;padding-bottom:4px}.pl-6{padding-left:24px}.pr-12{padding-right:48px}.pr-4{padding-right:16px}.pt-8{padding-top:32px}.text-2xl{font-size:24px;line-height:32px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.text-xs{font-size:12px;line-height:16px}.font-bold{font-weight:700}.font-semibold{font-weight:600}.text-background{color:hsl(var(--background))}.text-background\\/75{color:hsl(var(--background) / .75)}.text-foreground{color:hsl(var(--foreground))}.text-foreground\\/65{color:hsl(var(--foreground) / .65)}.text-foreground\\/70{color:hsl(var(--foreground) / .7)}.text-neutral-foreground{color:hsl(var(--neutral-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary-light{color:hsl(var(--primary-light))}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[width\\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-radius{transition-property:border-radius;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-details{transition-duration:.35s}.no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.no-scrollbar::-webkit-scrollbar{display:none}.\\[mask-image\\:linear-gradient\\(to_left\\,transparent_0px\\,black_4px\\,black_calc\\(100\\%-4px\\)\\,transparent_100\\%\\)\\]{-webkit-mask-image:linear-gradient(to left,transparent 0px,black 4px,black calc(100% - 4px),transparent 100%);mask-image:linear-gradient(to left,transparent 0px,black 4px,black calc(100% - 4px),transparent 100%)}.\\*\\:pointer-events-auto>*{pointer-events:auto}.\\*\\:size-full>*{width:100%;height:100%}.\\*\\:snap-start>*{scroll-snap-align:start}.\\*\\:snap-always>*{scroll-snap-stop:always}.\\*\\:object-cover>*{-o-object-fit:cover;object-fit:cover}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-0:after{content:var(--tw-content);inset:0}.after\\:rounded-gallery:after{content:var(--tw-content);border-radius:var(--radius-gallery)}.after\\:border-2:after{content:var(--tw-content);border-width:2px}.after\\:border-primary:after{content:var(--tw-content);border-color:hsl(var(--primary))}.after\\:opacity-0:after{content:var(--tw-content);opacity:0}.after\\:opacity-100:after{content:var(--tw-content);opacity:1}.after\\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\\:z-hotspot-hover:hover{z-index:11}.hover\\:bg-foreground\\/25:hover{background-color:hsl(var(--foreground) / .25)}.hover\\:bg-primary\\/25:hover{background-color:hsl(var(--primary) / .25)}.hover\\:bg-primary\\/30:hover{background-color:hsl(var(--primary) / .3)}.hover\\:opacity-80:hover{opacity:.8}.hover\\:after\\:opacity-70:hover:after{content:var(--tw-content);opacity:.7}.disabled\\:opacity-60:disabled{opacity:.6}.group:hover .group-hover\\:pointer-events-auto{pointer-events:auto}.group\\/volume:hover .group-hover\\/volume\\:opacity-100{opacity:1}.group\\/volume:hover .group-hover\\/volume\\:opacity-50{opacity:.5}.group:hover .group-hover\\:opacity-100{opacity:1}@media ((orientation: portrait) and (max-width: 767px)) or ((orientation: landscape) and (max-width: 1023px)){.max-small\\:hidden{display:none}}@media ((orientation: portrait) and (min-width: 768px)) or ((orientation: landscape) and (min-width: 1024px)){.small\\:inset-x-2{left:8px;right:8px}.small\\:inset-y-2{top:8px;bottom:8px}.small\\:bottom-2{bottom:8px}.small\\:left-2{left:8px}.small\\:right-2{right:8px}.small\\:right-4{right:16px}.small\\:top-2{top:8px}.small\\:top-4{top:16px}.small\\:my-4{margin-top:16px;margin-bottom:16px}.small\\:hidden{display:none}.small\\:h-12{height:48px}.small\\:h-28{height:112px}.small\\:max-w-48{max-width:192px}.small\\:gap-2{gap:8px}.small\\:gap-x-2{-moz-column-gap:8px;column-gap:8px}.small\\:gap-y-2{row-gap:8px}.small\\:gap-y-4{row-gap:16px}.small\\:space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}.small\\:p-3{padding:12px}.small\\:px-2{padding-left:8px;padding-right:8px}.small\\:py-1{padding-top:4px;padding-bottom:4px}.small\\:pl-8{padding-left:32px}.small\\:pr-6{padding-right:24px}.small\\:text-base{font-size:16px;line-height:24px}.small\\:text-sm{font-size:14px;line-height:20px}.small\\:font-bold{font-weight:700}}@media (min-width: 1280px){.large\\:h-20{height:80px}.large\\:h-3\\/5{height:60%}.large\\:max-w-56{max-width:224px}.large\\:gap-4{gap:16px}.large\\:p-2{padding:8px}.large\\:p-4{padding:16px}.large\\:text-base{font-size:16px;line-height:24px}.large\\:text-lg{font-size:18px;line-height:28px}}';function Hn(t){return t.replace(/([a-z0-9])([A-Z])/g,(r,o,s)=>`${o}-${s.toLowerCase()}`)}function Fe(t){return Object.entries(t).reduce((r,[o,s])=>{if(s!==void 0){const c=Hn(o);r[c]=s.toString()}return r},{})}const Wn=t=>e.jsxs(e.Fragment,{children:[e.jsx("style",{children:Dn}),e.jsx(Vn,{...t})]}),Fn=t=>Fe(t),Xn=t=>Fe(t),Yn=t=>Fe(t),Zn=({onCompositionLoading:t,onCompositionLoaded:r,onCompositionLoadError:o,onItemChange:s,onExtendModeOn:c,onExtendModeOff:l,onHotspotsOn:f,onHotspotsOff:h,onGalleryOpen:y,onGalleryClose:j,className:L,style:v={},children:R,..._})=>{const d=n.useMemo(()=>{const g=Fn(_);return L&&Object.assign(g,{class:L}),g},[L,_]);return n.useEffect(()=>{const g=_.eventPrefix??De,u=i=>`${g}${i}`,x={[Me]:t,[Te]:r,[Ne]:o,[_e]:s,[ze]:c,[Ve]:l,[Re]:f,[Pe]:h,[Oe]:y,[Ae]:j},p=new Map;return Object.entries(x).forEach(([i,a])=>{if(!a)return;const b=u(i),C=E=>a(E.detail);p.set(b,C),document.addEventListener(b,C)}),()=>{p.forEach((i,a)=>{document.removeEventListener(a,i)})}},[_.eventPrefix,t,r,o,s,c,l,f,h,y,j]),e.jsx("cc-webplayer",{style:{display:"block",...v},...d,children:R})},$n=({children:t,...r})=>{const o=Xn(r);return e.jsx("cc-webplayer-custom-media",{...o,children:t})},Un=({children:t,...r})=>{const o=Yn(r);return e.jsx("cc-webplayer-icon",{...o,children:t})};exports.DEFAULT_EVENT_PREFIX=De;exports.EVENT_COMPOSITION_LOADED=Te;exports.EVENT_COMPOSITION_LOADING=Me;exports.EVENT_COMPOSITION_LOAD_ERROR=Ne;exports.EVENT_EXTEND_MODE_OFF=Ve;exports.EVENT_EXTEND_MODE_ON=ze;exports.EVENT_GALLERY_CLOSE=Ae;exports.EVENT_GALLERY_OPEN=Oe;exports.EVENT_HOTSPOTS_OFF=Pe;exports.EVENT_HOTSPOTS_ON=Re;exports.EVENT_ITEM_CHANGE=_e;exports.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=Ie;exports.WEB_PLAYER_ICON_WC_TAG=Se;exports.WEB_PLAYER_WC_TAG=xe;exports.WebPlayer=Zn;exports.WebPlayerCustomMedia=Pn;exports.WebPlayerCustomMedia$1=$n;exports.WebPlayerIcon=An;exports.WebPlayerIcon$1=Un;exports.WebPlayerWithInjectedStyles=Wn;exports.checkCustomElementsDefinition=Nt;exports.generateCompositionUrl=Mt;