@frybynite/image-cloud 0.3.5 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/image-cloud-auto-init.js +1026 -1018
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +848 -840
- package/dist/image-cloud.js.map +1 -1
- package/dist/image-cloud.umd.js +3 -3
- package/dist/image-cloud.umd.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/package.json +1 -1
package/dist/image-cloud.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(A,st){typeof exports=="object"&&typeof module<"u"?st(exports):typeof define=="function"&&define.amd?define(["exports"],st):(A=typeof globalThis<"u"?globalThis:A||self,st(A.ImageCloud={}))})(this,function(A){"use strict";const st=Object.freeze({none:"none",sm:"0 2px 4px rgba(0,0,0,0.1)",md:"0 4px 16px rgba(0,0,0,0.4)",lg:"0 8px 32px rgba(0,0,0,0.5)",glow:"0 0 30px rgba(255,255,255,0.6)"}),yt=Object.freeze({energetic:Object.freeze({overshoot:.25,bounces:2,decayRatio:.5}),playful:Object.freeze({overshoot:.15,bounces:1,decayRatio:.5}),subtle:Object.freeze({overshoot:.08,bounces:1,decayRatio:.5})}),vt=Object.freeze({gentle:Object.freeze({stiffness:150,damping:30,mass:1,oscillations:2}),bouncy:Object.freeze({stiffness:300,damping:15,mass:1,oscillations:4}),wobbly:Object.freeze({stiffness:180,damping:12,mass:1.5,oscillations:5}),snappy:Object.freeze({stiffness:400,damping:25,mass:.8,oscillations:2})}),wt=Object.freeze({gentle:Object.freeze({amplitude:30,frequency:1.5,decay:!0,decayRate:.9,phase:0}),playful:Object.freeze({amplitude:50,frequency:2.5,decay:!0,decayRate:.7,phase:0}),serpentine:Object.freeze({amplitude:60,frequency:3,decay:!1,decayRate:1,phase:0}),flutter:Object.freeze({amplitude:20,frequency:4,decay:!0,decayRate:.5,phase:0})}),Et=Object.freeze({type:"linear"}),St=Object.freeze({mode:"none"}),xt=Object.freeze({mode:"none"}),Ot=Object.freeze({default:Object.freeze({border:Object.freeze({width:0,color:"#000000",radius:0,style:"solid"}),shadow:"none",filter:Object.freeze({}),opacity:1,cursor:"pointer",outline:Object.freeze({width:0,color:"#000000",style:"solid",offset:0})}),hover:Object.freeze({shadow:"none"}),focused:Object.freeze({shadow:"none"})}),oe=Object.freeze({rows:1,amplitude:100,frequency:2,phaseShift:0,synchronization:"offset"}),se=Object.freeze({mobile:Object.freeze({maxWidth:767}),tablet:Object.freeze({maxWidth:1199})}),ae=Object.freeze({mode:"adaptive",minSize:50,maxSize:400,variance:Object.freeze({min:1,max:1})}),re=Object.freeze({mode:"none",range:Object.freeze({min:-15,max:15})}),$t=Object.freeze({sizing:ae,rotation:re}),It=Object.freeze({validateUrls:!0,validationTimeout:5e3,validationMethod:"head",failOnAllMissing:!0,allowedExtensions:["jpg","jpeg","png","gif","webp","bmp"],debugLogging:!1}),w=Object.freeze({loaders:[],config:Object.freeze({loaders:It}),image:$t,layout:Object.freeze({algorithm:"radial",scaleDecay:0,responsive:se,targetCoverage:.6,densityFactor:1,spacing:Object.freeze({padding:50,minGap:20}),debugRadials:!1,debugCenters:!1}),animation:Object.freeze({duration:600,easing:Object.freeze({default:"cubic-bezier(0.4, 0.0, 0.2, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",focus:"cubic-bezier(0.4, 0.0, 0.2, 1)"}),queue:Object.freeze({enabled:!0,interval:150,maxConcurrent:void 0}),performance:Object.freeze({useGPU:void 0,reduceMotion:void 0}),entry:Object.freeze({start:Object.freeze({position:"nearest-edge",offset:100,circular:Object.freeze({radius:"120%",distribution:"even"})}),timing:Object.freeze({duration:600,stagger:150}),easing:"cubic-bezier(0.25, 1, 0.5, 1)",path:Et,rotation:St,scale:xt})}),interaction:Object.freeze({focus:Object.freeze({scalePercent:.8,zIndex:1e3,animationDuration:void 0}),navigation:Object.freeze({keyboard:void 0,swipe:void 0,mouseWheel:void 0}),gestures:Object.freeze({pinchToZoom:void 0,doubleTapToFocus:void 0})}),rendering:Object.freeze({responsive:Object.freeze({breakpoints:Object.freeze({mobile:768,tablet:void 0,desktop:void 0}),mobileDetection:()=>typeof window>"u"?!1:window.innerWidth<=768}),ui:Object.freeze({showLoadingSpinner:!1,showImageCounter:!1,showThumbnails:void 0,theme:void 0}),performance:Object.freeze({lazyLoad:void 0,preloadCount:void 0,imageQuality:void 0})}),styling:Ot,debug:!1});function lt(o,t){if(!o)return t||{};if(!t)return{...o};const e={...o};return t.border!==void 0&&(e.border={...o.border,...t.border}),t.borderTop!==void 0&&(e.borderTop={...o.borderTop,...t.borderTop}),t.borderRight!==void 0&&(e.borderRight={...o.borderRight,...t.borderRight}),t.borderBottom!==void 0&&(e.borderBottom={...o.borderBottom,...t.borderBottom}),t.borderLeft!==void 0&&(e.borderLeft={...o.borderLeft,...t.borderLeft}),t.filter!==void 0&&(e.filter={...o.filter,...t.filter}),t.outline!==void 0&&(e.outline={...o.outline,...t.outline}),t.shadow!==void 0&&(e.shadow=t.shadow),t.opacity!==void 0&&(e.opacity=t.opacity),t.cursor!==void 0&&(e.cursor=t.cursor),t.className!==void 0&&(e.className=t.className),t.objectFit!==void 0&&(e.objectFit=t.objectFit),t.aspectRatio!==void 0&&(e.aspectRatio=t.aspectRatio),t.borderRadiusTopLeft!==void 0&&(e.borderRadiusTopLeft=t.borderRadiusTopLeft),t.borderRadiusTopRight!==void 0&&(e.borderRadiusTopRight=t.borderRadiusTopRight),t.borderRadiusBottomRight!==void 0&&(e.borderRadiusBottomRight=t.borderRadiusBottomRight),t.borderRadiusBottomLeft!==void 0&&(e.borderRadiusBottomLeft=t.borderRadiusBottomLeft),e}function ce(o,t){if(!t)return{...o};const e=lt(o.default,t.default),i=lt(lt(e,o.hover),t.hover),n=lt(lt(e,o.focused),t.focused);return{default:e,hover:i,focused:n}}function le(o,t){var i,n,a,r,s,h,l,u;if(!t)return{...o};const e={...o};if(t.sizing!==void 0&&(e.sizing={...o.sizing,...t.sizing},t.sizing.variance)){const c=t.sizing.variance,d=c.min!==void 0&&c.min>=.25&&c.min<=1?c.min:((n=(i=o.sizing)==null?void 0:i.variance)==null?void 0:n.min)??1,f=c.max!==void 0&&c.max>=1&&c.max<=1.75?c.max:((r=(a=o.sizing)==null?void 0:a.variance)==null?void 0:r.max)??1;e.sizing.variance={min:d,max:f}}if(t.rotation!==void 0&&(e.rotation={...o.rotation,...t.rotation},t.rotation.range)){const c=t.rotation.range,d=c.min!==void 0&&c.min>=-180&&c.min<=0?c.min:((h=(s=o.rotation)==null?void 0:s.range)==null?void 0:h.min)??-15,f=c.max!==void 0&&c.max>=0&&c.max<=180?c.max:((u=(l=o.rotation)==null?void 0:l.range)==null?void 0:u.max)??15;e.rotation.range={min:d,max:f}}return e}function he(o){var e;const t=(e=o.layout)==null?void 0:e.rotation;if(t&&"enabled"in t)return{rotation:{mode:t.enabled?"random":"none",range:t.range}}}function de(o){var e,i;const t=(i=(e=o.layout)==null?void 0:e.sizing)==null?void 0:i.variance;if(t)return{sizing:{mode:"adaptive",variance:t}}}function ue(o={}){var h,l;const t=he(o),e=de(o);let i=o.image;(t||e)&&(i={...e||{},...t||{},...i},i.rotation&&(t!=null&&t.rotation)&&((h=o.image)!=null&&h.rotation)&&(i.rotation={...t.rotation,...o.image.rotation}));const n=[...o.loaders??[]];o.images&&o.images.length>0&&n.unshift({static:{sources:[{urls:o.images}]}});const r={loaders:{...It,...((l=o.config)==null?void 0:l.loaders)??{}}},s={loaders:n,config:r,image:le($t,i),layout:{...w.layout},animation:{...w.animation},interaction:{...w.interaction},rendering:{...w.rendering},styling:ce(Ot,o.styling),debug:w.debug};return o.layout&&(s.layout={...w.layout,...o.layout},o.layout.responsive&&(s.layout.responsive={...w.layout.responsive,mobile:o.layout.responsive.mobile?{...w.layout.responsive.mobile,...o.layout.responsive.mobile}:w.layout.responsive.mobile,tablet:o.layout.responsive.tablet?{...w.layout.responsive.tablet,...o.layout.responsive.tablet}:w.layout.responsive.tablet}),o.layout.spacing&&(s.layout.spacing={...w.layout.spacing,...o.layout.spacing})),o.animation&&(s.animation={...w.animation,...o.animation},o.animation.easing&&(s.animation.easing={...w.animation.easing,...o.animation.easing}),o.animation.queue&&(s.animation.queue={...w.animation.queue,...o.animation.queue}),o.animation.performance&&(s.animation.performance={...w.animation.performance,...o.animation.performance}),o.animation.entry&&(s.animation.entry={...w.animation.entry,...o.animation.entry,start:o.animation.entry.start?{...w.animation.entry.start,...o.animation.entry.start,circular:o.animation.entry.start.circular?{...w.animation.entry.start.circular,...o.animation.entry.start.circular}:w.animation.entry.start.circular}:w.animation.entry.start,timing:o.animation.entry.timing?{...w.animation.entry.timing,...o.animation.entry.timing}:w.animation.entry.timing,path:o.animation.entry.path?{...Et,...o.animation.entry.path}:w.animation.entry.path,rotation:o.animation.entry.rotation?{...St,...o.animation.entry.rotation}:w.animation.entry.rotation,scale:o.animation.entry.scale?{...xt,...o.animation.entry.scale}:w.animation.entry.scale})),o.interaction&&(s.interaction={...w.interaction,...o.interaction},o.interaction.focus&&(s.interaction.focus={...w.interaction.focus,...o.interaction.focus}),o.interaction.navigation&&(s.interaction.navigation={...w.interaction.navigation,...o.interaction.navigation}),o.interaction.gestures&&(s.interaction.gestures={...w.interaction.gestures,...o.interaction.gestures})),o.rendering&&(s.rendering={...w.rendering,...o.rendering},o.rendering.responsive&&(s.rendering.responsive={...w.rendering.responsive,...o.rendering.responsive,breakpoints:o.rendering.responsive.breakpoints?{...w.rendering.responsive.breakpoints,...o.rendering.responsive.breakpoints}:w.rendering.responsive.breakpoints,mobileDetection:o.rendering.responsive.mobileDetection?o.rendering.responsive.mobileDetection:w.rendering.responsive.mobileDetection}),o.rendering.ui&&(s.rendering.ui={...w.rendering.ui,...o.rendering.ui}),o.rendering.performance&&(s.rendering.performance={...w.rendering.performance,...o.rendering.performance})),o.debug!==void 0&&(s.debug=o.debug),s}function ge(o,t){return{...o?yt[o]:yt.playful,...t}}function me(o,t){return{...o?vt[o]:vt.gentle,...t}}function fe(o,t){return{...o?wt[o]:wt.gentle,...t}}class Dt{constructor(t){this.activeAnimations=new Map,this.animationIdCounter=0,this.config=t}buildTransformString(t){const e=["translate(-50%, -50%)"];if(t.x!==void 0||t.y!==void 0){const i=t.x??0,n=t.y??0;e.push(`translate(${i}px, ${n}px)`)}return t.rotation!==void 0&&e.push(`rotate(${t.rotation}deg)`),t.scale!==void 0&&e.push(`scale(${t.scale})`),e.join(" ")}animateTransformCancellable(t,e,i,n=null,a=null){this.cancelAllAnimations(t);const r=n??this.config.duration,s=a??this.config.easing.default,h=this.buildTransformString(e),l=this.buildTransformString(i);t.style.transition="none";const u=t.animate([{transform:h},{transform:l}],{duration:r,easing:s,fill:"forwards"}),c={id:`anim-${++this.animationIdCounter}`,element:t,animation:u,fromState:e,toState:i,startTime:performance.now(),duration:r};return this.activeAnimations.set(t,c),u.finished.then(()=>{t.style.transform=l,this.activeAnimations.delete(t)}).catch(()=>{this.activeAnimations.delete(t)}),c}cancelAnimation(t,e=!0){const i=this.getCurrentTransform(t.element);if(t.animation.cancel(),e){const n=this.buildTransformString({x:i.x,y:i.y,rotation:i.rotation,scale:i.scale});t.element.style.transform=n}return this.activeAnimations.delete(t.element),i}cancelAllAnimations(t){const e=this.activeAnimations.get(t);e&&this.cancelAnimation(e,!1);const i=t.getAnimations();for(const n of i)n.cancel()}getCurrentTransform(t){const i=getComputedStyle(t).transform;if(i==="none"||!i)return{x:0,y:0,rotation:0,scale:1};const n=new DOMMatrix(i),a=Math.sqrt(n.a*n.a+n.b*n.b),r=Math.atan2(n.b,n.a)*(180/Math.PI),s=n.e,h=n.f;return{x:s,y:h,rotation:r,scale:a}}hasActiveAnimation(t){return this.activeAnimations.has(t)}getAnimationHandle(t){return this.activeAnimations.get(t)}animateTransform(t,e,i=null,n=null){return new Promise(a=>{const r=i??this.config.duration,s=n??this.config.easing.default;t.style.transition=`transform ${r}ms ${s}, box-shadow ${r}ms ${s}`,t.style.transform=this.buildTransformString(e),setTimeout(()=>{a()},r)})}resetTransform(t,e){return this.animateTransform(t,e)}clearTransition(t){t.style.transition=""}wait(t){return new Promise(e=>setTimeout(e,t))}}function at(o,t,e){return o+(t-o)*e}function pe(o,t,e,i){const{overshoot:n,bounces:a,decayRatio:r}=i,s=e.x-t.x,h=e.y-t.y,l=be(a,r);let u=0,c=0,d=1,f=n,b=!1;for(let g=0;g<l.length;g++)if(o<=l[g].time){c=g===0?0:l[g-1].time,d=l[g].time,f=l[g].overshoot,b=l[g].isOvershoot;break}const p=(o-c)/(d-c);if(b)u=1+f*gt(p);else if(c===0)u=gt(p);else{const g=l.find((y,v)=>y.time>c&&v>0&&l[v-1].isOvershoot),m=1+((g==null?void 0:g.overshoot)||f);u=at(m,1,gt(p))}return{x:t.x+s*u,y:t.y+h*u}}function be(o,t){const e=[];let i=.6;e.push({time:i,overshoot:0,isOvershoot:!1});let n=.15;const r=.4/(o*2);for(let s=0;s<o;s++)i+=r,e.push({time:i,overshoot:n,isOvershoot:!0}),i+=r,e.push({time:i,overshoot:n*t,isOvershoot:!1}),n*=t;return e.push({time:1,overshoot:0,isOvershoot:!1}),e}function ye(o,t,e,i){const{stiffness:n,damping:a,mass:r,oscillations:s}=i,h=e.x-t.x,l=e.y-t.y,u=Math.sqrt(n/r),c=a/(2*Math.sqrt(n*r));let d;if(c<1){const f=u*Math.sqrt(1-c*c),b=Math.exp(-c*u*o*3),p=Math.cos(f*o*s*Math.PI);d=1-b*p}else d=1-Math.exp(-u*o*3);return d=Math.max(0,Math.min(d,1.3)),{x:t.x+h*d,y:t.y+l*d}}function ve(o,t,e,i){const{amplitude:n,frequency:a,decay:r,decayRate:s,phase:h}=i,l=e.x-t.x,u=e.y-t.y,c=Math.sqrt(l*l+u*u),d=c>0?-u/c:0,f=c>0?l/c:1,b=a*Math.PI*2*o+h,p=r?Math.pow(1-o,s):1,g=n*Math.sin(b)*p,m=we(o);return{x:at(t.x,e.x,m)+g*d,y:at(t.y,e.y,m)+g*f}}function gt(o){return 1-(1-o)*(1-o)}function we(o){return 1-Math.pow(1-o,3)}function Ee(o,t,e){const{amplitude:i,frequency:n,decay:a}=e,r=Math.sin(o*n*Math.PI*2),s=a?Math.pow(1-o,2):1,h=i*r*s;return t+h}function Se(o,t,e){const{overshoot:i,bounces:n}=e,a=[];a.push({time:.5,scale:i});let r=i;const s=.5,l=.5/(n*2);let u=.5;for(let d=0;d<n;d++){const f=1-(r-1)*s;u+=l,a.push({time:u,scale:f}),r=1+(r-1)*s*s,u+=l,d<n-1&&a.push({time:u,scale:r})}a.push({time:1,scale:1});let c=1;for(let d=0;d<a.length;d++)if(o<=a[d].time){const f=d===0?0:a[d-1].time,b=d===0?1:a[d-1].scale,p=(o-f)/(a[d].time-f),g=gt(p);c=b+(a[d].scale-b)*g;break}return c*t}function Pt(o){const{element:t,startPosition:e,endPosition:i,pathConfig:n,duration:a,imageWidth:r,imageHeight:s,rotation:h,scale:l,onComplete:u,rotationConfig:c,startRotation:d,scaleConfig:f,startScale:b}=o,p=n.type,g=d!==void 0&&d!==h,m=(c==null?void 0:c.mode)==="wobble",y=(c==null?void 0:c.wobble)||{amplitude:15,frequency:3,decay:!0},v=g||m,I=b!==void 0&&b!==l,R=(f==null?void 0:f.mode)==="pop",E=(f==null?void 0:f.pop)||{overshoot:1.2,bounces:1};if((p==="linear"||p==="arc")&&!v&&!(I||R)){u&&u();return}const j=performance.now(),_=-r/2,P=-s/2;function U(G){const F=G-j,S=Math.min(F/a,1);let C;switch(p){case"bounce":{const N=ge(n.bouncePreset,n.bounce);C=pe(S,e,i,N);break}case"elastic":{const N=me(n.elasticPreset,n.elastic);C=ye(S,e,i,N);break}case"wave":{const N=fe(n.wavePreset,n.wave);C=ve(S,e,i,N);break}default:C={x:at(e.x,i.x,S),y:at(e.y,i.y,S)}}const $=C.x-i.x,L=C.y-i.y;let T;m?T=Ee(S,h,y):g?T=at(d,h,S):T=h;let M;R?M=Se(S,l,E):I?M=at(b,l,S):M=l,t.style.transform=`translate(${_}px, ${P}px) translate(${$}px, ${L}px) rotate(${T}deg) scale(${M})`,S<1?requestAnimationFrame(U):(t.style.transform=`translate(${_}px, ${P}px) rotate(${h}deg) scale(${l})`,u&&u())}requestAnimationFrame(U)}function Ut(o){return o==="bounce"||o==="elastic"||o==="wave"}const xe={radial:"center",spiral:"center",grid:"top",cluster:"nearest-edge",random:"nearest-edge",wave:"left"};class _t{constructor(t,e){this.config=t,this.layoutAlgorithm=e,this.resolvedStartPosition=this.resolveStartPosition(),this.pathConfig=t.path||Et,this.rotationConfig=t.rotation||St,this.scaleConfig=t.scale||xt}resolveStartPosition(){return this.config.start.position?this.config.start.position:xe[this.layoutAlgorithm]||"nearest-edge"}calculateStartPosition(t,e,i,n,a){const r=this.resolvedStartPosition,s=this.config.start.offset??100;switch(r){case"nearest-edge":return this.calculateNearestEdge(t,e,i,s);case"top":return this.calculateEdgePosition("top",t,e,i,s);case"bottom":return this.calculateEdgePosition("bottom",t,e,i,s);case"left":return this.calculateEdgePosition("left",t,e,i,s);case"right":return this.calculateEdgePosition("right",t,e,i,s);case"center":return this.calculateCenterPosition(i,t,e);case"random-edge":return this.calculateRandomEdge(t,e,i,s);case"circular":return this.calculateCircularPosition(t,e,i,n,a);default:return this.calculateNearestEdge(t,e,i,s)}}calculateNearestEdge(t,e,i,n){const a=t.x,r=t.y,s=a,h=i.width-a,l=r,u=i.height-r,c=Math.min(s,h,l,u);let d=t.x,f=t.y;return c===s?d=-(e.width+n):c===h?d=i.width+n:c===l?f=-(e.height+n):f=i.height+n,{x:d,y:f}}calculateEdgePosition(t,e,i,n,a){let r=e.x,s=e.y;switch(t){case"top":s=-(i.height+a);break;case"bottom":s=n.height+a;break;case"left":r=-(i.width+a);break;case"right":r=n.width+a;break}return{x:r,y:s}}calculateCenterPosition(t,e,i){const n=t.width/2,a=t.height/2;return{x:n,y:a,useScale:!0}}calculateRandomEdge(t,e,i,n){const a=["top","bottom","left","right"],r=a[Math.floor(Math.random()*a.length)];return this.calculateEdgePosition(r,t,e,i,n)}calculateCircularPosition(t,e,i,n,a){const r=this.config.start.circular||{},s=r.distribution||"even";let h;const l=r.radius||"120%";if(typeof l=="string"&&l.endsWith("%")){const p=parseFloat(l)/100;h=Math.sqrt(i.width**2+i.height**2)*p/2}else h=typeof l=="number"?l:500;let u;s==="even"?u=n/a*2*Math.PI:u=Math.random()*2*Math.PI;const c=i.width/2,d=i.height/2,f=c+Math.cos(u)*h,b=d+Math.sin(u)*h;return{x:f,y:b}}getAnimationParams(t){const e=this.config.timing.duration,i=this.config.timing.stagger,n=this.config.easing;return{startTransform:"",duration:e,delay:t*i,easing:n}}buildStartTransform(t,e,i,n,a,r,s,h){const l=t.x-e.x,u=t.y-e.y,c=s!==void 0?s:i,d=h!==void 0?h:n,f=a!==void 0?-a/2:0,b=r!==void 0?-r/2:0,p=a!==void 0?`translate(${f}px, ${b}px)`:"translate(-50%, -50%)";return t.useScale?`${p} translate(${l}px, ${u}px) rotate(${c}deg) scale(0)`:`${p} translate(${l}px, ${u}px) rotate(${c}deg) scale(${d})`}buildFinalTransform(t,e,i,n){if(i!==void 0&&n!==void 0){const a=-i/2,r=-n/2;return`translate(${a}px, ${r}px) rotate(${t}deg) scale(${e})`}return`translate(-50%, -50%) rotate(${t}deg) scale(${e})`}getTransitionCSS(){const t=this.config.timing.duration,e=this.config.easing;return this.requiresJSAnimation()?`opacity ${t}ms ease-out`:`opacity ${t}ms ease-out, transform ${t}ms ${e}`}requiresJSAnimation(){return Ut(this.pathConfig.type)}getPathConfig(){return this.pathConfig}getPathType(){return this.pathConfig.type}getTiming(){return{duration:this.config.timing.duration,stagger:this.config.timing.stagger}}getRotationConfig(){return this.rotationConfig}getRotationMode(){return this.rotationConfig.mode}calculateStartRotation(t){switch(this.rotationConfig.mode){case"none":return t;case"settle":{const i=this.rotationConfig.startRotation;if(i===void 0)return t+(Math.random()-.5)*60;if(typeof i=="number")return i;const n=i.max-i.min;return i.min+Math.random()*n}case"spin":{const i=this.rotationConfig.spinCount??1,n=this.resolveSpinDirection(t);return t+i*360*n}case"random":return t+(Math.random()-.5)*60;case"wobble":return t;default:return t}}resolveSpinDirection(t){switch(this.rotationConfig.direction??"auto"){case"clockwise":return-1;case"counterclockwise":return 1;case"random":return Math.random()<.5?1:-1;case"auto":default:return t>=0?1:-1}}requiresJSRotation(){return this.rotationConfig.mode==="wobble"}calculateWobbleRotation(t,e){if(this.rotationConfig.mode!=="wobble")return e;const i=this.rotationConfig.wobble||{amplitude:15,frequency:3,decay:!0},{amplitude:n,frequency:a,decay:r}=i,s=Math.sin(t*a*Math.PI*2),h=r?Math.pow(1-t,2):1,l=n*s*h;return e+l}getScaleConfig(){return this.scaleConfig}getScaleMode(){return this.scaleConfig.mode}calculateStartScale(t){switch(this.scaleConfig.mode){case"none":return t;case"grow":return(this.scaleConfig.startScale??.3)*t;case"shrink":return(this.scaleConfig.startScale??1.5)*t;case"pop":return t;case"random":{const i=this.scaleConfig.range??{min:.5,max:1};return(i.min+Math.random()*(i.max-i.min))*t}default:return t}}requiresJSScale(){return this.scaleConfig.mode==="pop"}calculatePopScale(t,e){if(this.scaleConfig.mode!=="pop")return e;const i=this.scaleConfig.pop||{overshoot:1.2,bounces:1},{overshoot:n,bounces:a}=i,r=this.generateScaleBounceKeyframes(a,n);let s=e;for(let h=0;h<r.length;h++)if(t<=r[h].time){const l=h===0?0:r[h-1].time,u=h===0?e:r[h-1].scale,c=(t-l)/(r[h].time-l),d=this.easeOutQuad(c);s=u+(r[h].scale-u)*d;break}return s*e}generateScaleBounceKeyframes(t,e){const i=[];i.push({time:.5,scale:e});let n=e;const a=.5,s=.5/(t*2);let h=.5;for(let l=0;l<t;l++){const u=1-(n-1)*a;h+=s,i.push({time:h,scale:u}),n=1+(n-1)*a*a,h+=s,l<t-1&&i.push({time:h,scale:n})}return i.push({time:1,scale:1}),i}easeOutQuad(t){return 1-(1-t)*(1-t)}}class Ht{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var E,O,j,_,P,U,G,F,S;const n=[],{width:a,height:r}=e,s=this.config.spacing.padding,h=i.fixedHeight??200,l=((E=this.imageConfig.rotation)==null?void 0:E.mode)??"none",u=((j=(O=this.imageConfig.rotation)==null?void 0:O.range)==null?void 0:j.min)??-15,c=((P=(_=this.imageConfig.rotation)==null?void 0:_.range)==null?void 0:P.max)??15,d=((G=(U=this.imageConfig.sizing)==null?void 0:U.variance)==null?void 0:G.min)??1,f=((S=(F=this.imageConfig.sizing)==null?void 0:F.variance)==null?void 0:S.max)??1,b=d!==1||f!==1,g=h*1.5/2,m=h/2,y=a-s-g,v=r-s-m,I=s+g,R=s+m;for(let C=0;C<t;C++){const $=this.random(I,y),L=this.random(R,v),T=l==="random"?this.random(u,c):0,M=b?this.random(d,f):1,N=h*M,K={id:C,x:$,y:L,rotation:T,scale:M,baseSize:N};n.push(K)}return n}random(t,e){return Math.random()*(e-t)+t}}class Nt{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var O,j,_,P,U,G,F,S,C;const n=[],{width:a,height:r}=e,{debugRadials:s}=this.config,h=i.fixedHeight??200,l=((O=this.imageConfig.rotation)==null?void 0:O.mode)??"none",u=((_=(j=this.imageConfig.rotation)==null?void 0:j.range)==null?void 0:_.min)??-15,c=((U=(P=this.imageConfig.rotation)==null?void 0:P.range)==null?void 0:U.max)??15,d=((F=(G=this.imageConfig.sizing)==null?void 0:G.variance)==null?void 0:F.min)??1,f=((C=(S=this.imageConfig.sizing)==null?void 0:S.variance)==null?void 0:C.max)??1,b=d!==1||f!==1,p=this.config.scaleDecay??0,g=["green","blue","red","yellow","orange","purple"],m=i.fixedHeight??h,y=a/2,v=r/2,I=Math.ceil(Math.sqrt(t));if(t>0){const $=b?this.random(d,f):1,L=m*$;n.push({id:0,x:y,y:v,rotation:l==="random"?this.random(u*.33,c*.33):0,scale:$,baseSize:L,zIndex:100,borderColor:s?"cyan":void 0})}let R=1,E=1;for(;R<t;){const $=E/I,L=p>0?1-$*p*.5:1,T=E*(m*.8),M=T*1.5,N=Math.PI*(3*(M+T)-Math.sqrt((3*M+T)*(M+3*T))),K=this.estimateWidth(m),B=Math.floor(N/(K*.7));if(B===0){E++;continue}const J=2*Math.PI/B,Q=E*(20*Math.PI/180);for(let q=0;q<B&&R<t;q++){const tt=q*J+Q,et=b?this.random(d,f):1,Y=L*et,it=m*Y;let X=y+Math.cos(tt)*M,z=v+Math.sin(tt)*T;const D=this.config.spacing.padding??50,W=it*1.5/2,H=it/2;X-W<D?X=D+W:X+W>a-D&&(X=a-D-W),z-H<D?z=D+H:z+H>r-D&&(z=r-D-H);const nt=l==="random"?this.random(u,c):0;n.push({id:R,x:X,y:z,rotation:nt,scale:Y,baseSize:it,zIndex:Math.max(1,100-E),borderColor:s?g[(E-1)%g.length]:void 0}),R++}E++}return n}estimateWidth(t){return t*1.4}random(t,e){return Math.random()*(e-t)+t}}const Ie={columns:"auto",rows:"auto",stagger:"none",jitter:0,overlap:0,fillDirection:"row",alignment:"center",gap:10,overflowOffset:.25},jt=[{x:1,y:1},{x:-1,y:-1},{x:1,y:-1},{x:-1,y:1},{x:-1,y:0},{x:1,y:0},{x:0,y:-1},{x:0,y:1}];class Gt{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var B,J,Q,q,tt,et,Y,it,X;const n=[],{width:a,height:r}=e,s={...Ie,...this.config.grid},h=this.config.spacing.padding,l=i.fixedHeight??200,u=((B=this.imageConfig.rotation)==null?void 0:B.mode)??"none",c=((Q=(J=this.imageConfig.sizing)==null?void 0:J.variance)==null?void 0:Q.min)??1,d=((tt=(q=this.imageConfig.sizing)==null?void 0:q.variance)==null?void 0:tt.max)??1,f=c!==1||d!==1,b=a-2*h,p=r-2*h,{columns:g,rows:m}=this.calculateGridDimensions(t,b,p,l,s),y=s.stagger==="row",v=s.stagger==="column",I=y?g+.5:g,R=v?m+.5:m,E=(b-s.gap*(g-1))/I,O=(p-s.gap*(m-1))/R,j=y?E/2:0,_=v?O/2:0,P=1+s.overlap,U=Math.min(E,O)*P,G=i.fixedHeight?Math.min(i.fixedHeight,U):U,F=g*E+(g-1)*s.gap+j,S=m*O+(m-1)*s.gap+_,C=h+(b-F)/2,$=h+(p-S)/2,L=g*m,T=s.columns!=="auto"&&s.rows!=="auto",M=T&&t>L;typeof window<"u"&&(window.__gridOverflowDebug={gridConfigColumns:s.columns,gridConfigRows:s.rows,columns:g,rows:m,cellCount:L,hasFixedGrid:T,imageCount:t,isOverflowMode:M});const N=M?new Array(L).fill(0):[],K=Math.min(E,O)*s.overflowOffset;for(let z=0;z<t;z++){let D,k,W=0;if(M&&z>=L){const Z=z-L,V=Z%L;W=Math.floor(Z/L)+1,N[V]++,s.fillDirection==="row"?(D=V%g,k=Math.floor(V/g)):(k=V%m,D=Math.floor(V/m))}else s.fillDirection==="row"?(D=z%g,k=Math.floor(z/g)):(k=z%m,D=Math.floor(z/m));let H=C+D*(E+s.gap)+E/2,nt=$+k*(O+s.gap)+O/2;if(s.stagger==="row"&&k%2===1?H+=E/2:s.stagger==="column"&&D%2===1&&(nt+=O/2),W>0){const Z=(W-1)%jt.length,V=jt[Z];H+=V.x*K,nt+=V.y*K}if(s.jitter>0){const Z=E/2*s.jitter,V=O/2*s.jitter;H+=this.random(-Z,Z),nt+=this.random(-V,V)}let ot=H,rt=nt;if(!M&&s.fillDirection==="row"){const Z=t%g||g;if(k===Math.floor((t-1)/g)&&Z<g){const ne=Z*E+(Z-1)*s.gap;let zt=0;s.alignment==="center"?zt=(F-ne)/2:s.alignment==="end"&&(zt=F-ne),ot+=zt}}const At=f?this.random(c,d):1,ct=G*At,pt=ct*1.5/2,bt=ct/2,Ct=h+pt,Mt=a-h-pt,_e=h+bt,He=r-h-bt;ot=Math.max(Ct,Math.min(ot,Mt)),rt=Math.max(_e,Math.min(rt,He));let Lt=0;if(u==="random"){const Z=((Y=(et=this.imageConfig.rotation)==null?void 0:et.range)==null?void 0:Y.min)??-15,V=((X=(it=this.imageConfig.rotation)==null?void 0:it.range)==null?void 0:X.max)??15;s.jitter>0?Lt=this.random(Z*s.jitter,V*s.jitter):Lt=this.random(Z,V)}let Ft;M&&W>0?Ft=50-W:Ft=M?100+z:z+1,n.push({id:z,x:ot,y:rt,rotation:Lt,scale:At,baseSize:ct,zIndex:Ft})}return n}calculateGridDimensions(t,e,i,n,a){let r,s;if(a.columns!=="auto"&&a.rows!=="auto")r=a.columns,s=a.rows;else if(a.columns!=="auto")r=a.columns,s=Math.ceil(t/r);else if(a.rows!=="auto")s=a.rows,r=Math.ceil(t/s);else{const h=e/i;for(r=Math.max(1,Math.round(Math.sqrt(t*h/1.4))),s=Math.ceil(t/r);r>1&&(r-1)*s>=t;)r--}return{columns:Math.max(1,r),rows:Math.max(1,s)}}random(t,e){return Math.random()*(e-t)+t}}const Te=Math.PI*(3-Math.sqrt(5)),Ae={spiralType:"golden",direction:"counterclockwise",tightness:1,scaleDecay:0,startAngle:0};class kt{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var R,E,O,j,_,P,U,G,F;const n=[],{width:a,height:r}=e,s={...Ae,...this.config.spiral},h=this.config.spacing.padding,l=i.fixedHeight??200,u=((R=this.imageConfig.rotation)==null?void 0:R.mode)??"none",c=((O=(E=this.imageConfig.rotation)==null?void 0:E.range)==null?void 0:O.min)??-15,d=((_=(j=this.imageConfig.rotation)==null?void 0:j.range)==null?void 0:_.max)??15,f=((U=(P=this.imageConfig.sizing)==null?void 0:P.variance)==null?void 0:U.min)??1,b=((F=(G=this.imageConfig.sizing)==null?void 0:G.variance)==null?void 0:F.max)??1,p=f!==1||b!==1,g=this.config.scaleDecay??s.scaleDecay,m=a/2,y=r/2,v=Math.min(m-h-l/2,y-h-l/2),I=s.direction==="clockwise"?-1:1;for(let S=0;S<t;S++){let C,$;if(s.spiralType==="golden")C=S*Te*I+s.startAngle,$=this.calculateGoldenRadius(S,t,v,s.tightness);else if(s.spiralType==="archimedean"){const H=S*.5*s.tightness;C=H*I+s.startAngle,$=this.calculateArchimedeanRadius(H,t,v,s.tightness)}else{const H=S*.3*s.tightness;C=H*I+s.startAngle,$=this.calculateLogarithmicRadius(H,t,v,s.tightness)}const L=m+Math.cos(C)*$,T=y+Math.sin(C)*$,M=$/v,N=g>0?1-M*g*.5:1,K=p?this.random(f,b):1,B=N*K,J=l*B,q=J*1.5/2,tt=J/2,et=h+q,Y=a-h-q,it=h+tt,X=r-h-tt,z=Math.max(et,Math.min(L,Y)),D=Math.max(it,Math.min(T,X));let k=0;if(u==="random"){const H=C*180/Math.PI%360,nt=this.random(c,d);k=s.spiralType==="golden"?nt:H*.1+nt*.9}else u==="tangent"&&(k=this.calculateSpiralTangent(C,$,s));const W=t-S;n.push({id:S,x:z,y:D,rotation:k,scale:B,baseSize:J,zIndex:W})}return n}calculateSpiralTangent(t,e,i){let n;if(i.spiralType==="golden")n=t+Math.PI/2;else if(i.spiralType==="archimedean"){const r=1/i.tightness,s=Math.atan(e/r);n=t+s}else{const r=.15/i.tightness,s=Math.atan(1/r);n=t+s}return n*180/Math.PI%360-90}calculateGoldenRadius(t,e,i,n){const r=i/Math.sqrt(e)*Math.sqrt(t)/n;return Math.min(r,i)}calculateArchimedeanRadius(t,e,i,n){const a=e*.5*n;return t/a*i}calculateLogarithmicRadius(t,e,i,n){const a=i*.05,r=.15/n,s=a*Math.exp(r*t),h=e*.3*n,l=a*Math.exp(r*h);return s/l*i}random(t,e){return Math.random()*(e-t)+t}}const Re={clusterCount:"auto",clusterSpread:150,clusterSpacing:200,density:"uniform",overlap:.3,distribution:"gaussian"};class Wt{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var I,R,E,O,j,_,P,U,G;const n=[],{width:a,height:r}=e,s={...Re,...this.config.cluster},h=this.config.spacing.padding,l=i.fixedHeight??200,u=((I=this.imageConfig.rotation)==null?void 0:I.mode)??"none",c=((E=(R=this.imageConfig.rotation)==null?void 0:R.range)==null?void 0:E.min)??-15,d=((j=(O=this.imageConfig.rotation)==null?void 0:O.range)==null?void 0:j.max)??15,f=((P=(_=this.imageConfig.sizing)==null?void 0:_.variance)==null?void 0:P.min)??1,b=((G=(U=this.imageConfig.sizing)==null?void 0:U.variance)==null?void 0:G.max)??1,p=f!==1||b!==1,g=this.calculateClusterCount(t,s.clusterCount,a,r,s.clusterSpacing),m=this.generateClusterCenters(g,a,r,h,s),y=new Array(g).fill(0);for(let F=0;F<t;F++)y[F%g]++;let v=0;for(let F=0;F<g;F++){const S=m[F],C=y[F];for(let $=0;$<C;$++){let L,T;if(s.distribution==="gaussian")L=this.gaussianRandom()*S.spread,T=this.gaussianRandom()*S.spread;else{const k=this.random(0,Math.PI*2),W=this.random(0,S.spread);L=Math.cos(k)*W,T=Math.sin(k)*W}const M=1+s.overlap*.5,N=1+s.overlap*.3;L/=M,T/=M;const K=p?this.random(f,b):1,B=N*K,J=l*B;let Q=S.x+L,q=S.y+T;const et=J*1.5/2,Y=J/2;Q=Math.max(h+et,Math.min(Q,a-h-et)),q=Math.max(h+Y,Math.min(q,r-h-Y));const it=u==="random"?this.random(c,d):0,z=Math.sqrt(L*L+T*T)/S.spread,D=Math.round((1-z)*50)+1;n.push({id:v,x:Q,y:q,rotation:it,scale:B,baseSize:J,zIndex:D}),v++}}return n}calculateClusterCount(t,e,i,n,a){if(e!=="auto")return Math.max(1,Math.min(e,t));const s=Math.max(1,Math.ceil(t/8)),h=Math.floor(i/a*(n/a)*.6);return Math.max(1,Math.min(s,h,10))}generateClusterCenters(t,e,i,n,a){const r=[],h=n+a.clusterSpread,l=e-n-a.clusterSpread,u=n+a.clusterSpread,c=i-n-a.clusterSpread;for(let d=0;d<t;d++){let f=null,b=-1;for(let p=0;p<100;p++){const g={x:this.random(h,l),y:this.random(u,c),spread:this.calculateClusterSpread(a)};let m=1/0;for(const y of r){const v=g.x-y.x,I=g.y-y.y,R=Math.sqrt(v*v+I*I);m=Math.min(m,R)}if((r.length===0||m>b)&&(f=g,b=m),m>=a.clusterSpacing)break}f&&r.push(f)}return r}calculateClusterSpread(t){return t.density==="uniform"?t.clusterSpread:t.clusterSpread*this.random(.5,1.5)}gaussianRandom(){let t=0,e=0;for(;t===0;)t=Math.random();for(;e===0;)e=Math.random();const i=Math.sqrt(-2*Math.log(t))*Math.cos(2*Math.PI*e);return Math.max(-3,Math.min(3,i))/3}random(t,e){return Math.random()*(e-t)+t}}class Ce{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var M,N,K,B,J,Q,q,tt,et;const n=[],{width:a,height:r}=e,s=i.fixedHeight??200,h=this.config.spacing.padding??50,l=((M=this.imageConfig.rotation)==null?void 0:M.mode)??"none",u=((K=(N=this.imageConfig.rotation)==null?void 0:N.range)==null?void 0:K.min)??-15,c=((J=(B=this.imageConfig.rotation)==null?void 0:B.range)==null?void 0:J.max)??15,d=((q=(Q=this.imageConfig.sizing)==null?void 0:Q.variance)==null?void 0:q.min)??1,f=((et=(tt=this.imageConfig.sizing)==null?void 0:tt.variance)==null?void 0:et.max)??1,b=d!==1||f!==1,p=i.fixedHeight??s,g={...oe,...this.config.wave},{rows:m,amplitude:y,frequency:v,phaseShift:I,synchronization:R}=g,E=Math.ceil(t/m),_=p*1.5/2,P=h+_,U=a-h-_,G=U-P,F=E>1?G/(E-1):0,S=h+y+p/2,C=r-h-y-p/2,$=C-S,L=m>1?$/(m-1):0;let T=0;for(let Y=0;Y<m&&T<t;Y++){const it=m===1?(S+C)/2:S+Y*L;let X=0;R==="offset"?X=Y*I:R==="alternating"&&(X=Y*Math.PI);for(let z=0;z<E&&T<t;z++){const D=E===1?(P+U)/2:P+z*F,k=this.calculateWaveY(D,a,y,v,X),W=D,H=it+k,nt=b?this.random(d,f):1,ot=p*nt;let rt=0;l==="tangent"?rt=this.calculateRotation(D,a,y,v,X):l==="random"&&(rt=this.random(u,c));const ct=ot*1.5/2,Rt=ot/2,pt=h+ct,bt=a-h-ct,Ct=h+Rt,Mt=r-h-Rt;n.push({id:T,x:Math.max(pt,Math.min(W,bt)),y:Math.max(Ct,Math.min(H,Mt)),rotation:rt,scale:nt,baseSize:ot,zIndex:T+1}),T++}}return n}calculateWaveY(t,e,i,n,a){const r=t/e;return i*Math.sin(n*r*2*Math.PI+a)}calculateRotation(t,e,i,n,a){const r=t/e,s=i*n*2*Math.PI*Math.cos(n*r*2*Math.PI+a)/e;return Math.atan(s)*(180/Math.PI)}random(t,e){return Math.random()*(e-t)+t}}class qt{constructor(t){this.config=t.layout,this.imageConfig=t.image,this.layouts=new Map,this.generator=this.initGenerator()}initGenerator(){switch(this.config.algorithm){case"radial":return new Nt(this.config,this.imageConfig);case"grid":return new Gt(this.config,this.imageConfig);case"spiral":return new kt(this.config,this.imageConfig);case"cluster":return new Wt(this.config,this.imageConfig);case"wave":return new Ce(this.config,this.imageConfig);case"random":default:return new Ht(this.config,this.imageConfig)}}generateLayout(t,e,i={}){const n=this.generator.generate(t,e,i);return n.forEach(a=>{this.layouts.set(a.id,a)}),n}getOriginalState(t){return this.layouts.get(Number(t))}reset(){this.layouts.clear()}updateConfig(t){t.layout&&(Object.assign(this.config,t.layout),t.layout.algorithm&&t.layout.algorithm!==this.config.algorithm&&(this.generator=this.initGenerator())),t.image&&Object.assign(this.imageConfig,t.image)}getBreakpoints(){return this.config.responsive??{mobile:{maxWidth:767},tablet:{maxWidth:1199}}}resolveBreakpoint(t){const e=this.getBreakpoints();return t<=e.mobile.maxWidth?"mobile":t<=e.tablet.maxWidth?"tablet":"screen"}resolveBaseHeight(t){const e=this.imageConfig.sizing;if(!e||e.mode==="adaptive")return;const i=e.height;if(i===void 0)return;if(typeof i=="number")return i;const n=i,a=this.resolveBreakpoint(t);return a==="mobile"?n.mobile??n.tablet??n.screen:a==="tablet"?n.tablet??n.screen??n.mobile:n.screen??n.tablet??n.mobile}calculateAdaptiveSize(t,e,i,n){const a=this.imageConfig.sizing,r=this.resolveBaseHeight(n);if(r!==void 0)return{height:r};const s=(a==null?void 0:a.minSize)??50,h=(a==null?void 0:a.maxSize)??400,l=this.config.targetCoverage??.6,u=this.config.densityFactor??1,{width:c,height:d}=t,p=c*d*l/e;let m=Math.sqrt(p/1.4);m*=u,m=Math.min(m,i);let y=this.clamp(m,s,h);if(y===s&&m<s){const v=Math.max(s*.05,20);y=Math.max(v,m)}return{height:y}}clamp(t,e,i){return Math.max(e,Math.min(i,t))}}var x=(o=>(o.IDLE="idle",o.FOCUSING="focusing",o.FOCUSED="focused",o.UNFOCUSING="unfocusing",o.CROSS_ANIMATING="cross_animating",o))(x||{});function Me(o){return o in st}function Le(o){return o?Me(o)?st[o]:o:st.md}function Fe(o){if(!o)return"";const t=[];if(o.grayscale!==void 0&&t.push(`grayscale(${o.grayscale})`),o.blur!==void 0&&t.push(`blur(${o.blur}px)`),o.brightness!==void 0&&t.push(`brightness(${o.brightness})`),o.contrast!==void 0&&t.push(`contrast(${o.contrast})`),o.saturate!==void 0&&t.push(`saturate(${o.saturate})`),o.opacity!==void 0&&t.push(`opacity(${o.opacity})`),o.sepia!==void 0&&t.push(`sepia(${o.sepia})`),o.hueRotate!==void 0&&t.push(`hue-rotate(${o.hueRotate}deg)`),o.invert!==void 0&&t.push(`invert(${o.invert})`),o.dropShadow!==void 0)if(typeof o.dropShadow=="string")t.push(`drop-shadow(${o.dropShadow})`);else{const e=o.dropShadow;t.push(`drop-shadow(${e.x}px ${e.y}px ${e.blur}px ${e.color})`)}return t.join(" ")}function ht(o){if(!o||o.style==="none"||o.width===0)return"none";const t=o.width??0,e=o.style??"solid",i=o.color??"#000000";return`${t}px ${e} ${i}`}function mt(o){var a,r;if(!o)return{};const t={};if(o.borderRadiusTopLeft!==void 0||o.borderRadiusTopRight!==void 0||o.borderRadiusBottomRight!==void 0||o.borderRadiusBottomLeft!==void 0){const s=((a=o.border)==null?void 0:a.radius)??0;o.borderRadiusTopLeft!==void 0?t.borderTopLeftRadius=`${o.borderRadiusTopLeft}px`:s&&(t.borderTopLeftRadius=`${s}px`),o.borderRadiusTopRight!==void 0?t.borderTopRightRadius=`${o.borderRadiusTopRight}px`:s&&(t.borderTopRightRadius=`${s}px`),o.borderRadiusBottomRight!==void 0?t.borderBottomRightRadius=`${o.borderRadiusBottomRight}px`:s&&(t.borderBottomRightRadius=`${s}px`),o.borderRadiusBottomLeft!==void 0?t.borderBottomLeftRadius=`${o.borderRadiusBottomLeft}px`:s&&(t.borderBottomLeftRadius=`${s}px`)}else((r=o.border)==null?void 0:r.radius)!==void 0&&(t.borderRadius=`${o.border.radius}px`);if(o.borderTop||o.borderRight||o.borderBottom||o.borderLeft){const s=o.border||{},h={...s,...o.borderTop},l={...s,...o.borderRight},u={...s,...o.borderBottom},c={...s,...o.borderLeft};t.borderTop=ht(h),t.borderRight=ht(l),t.borderBottom=ht(u),t.borderLeft=ht(c)}else o.border&&(t.border=ht(o.border));o.shadow!==void 0&&(t.boxShadow=Le(o.shadow));const n=Fe(o.filter);if(t.filter=n||"none",o.opacity!==void 0&&(t.opacity=String(o.opacity)),o.cursor!==void 0&&(t.cursor=o.cursor),o.outline&&o.outline.style!=="none"&&(o.outline.width??0)>0){const s=o.outline.width??0,h=o.outline.style??"solid",l=o.outline.color??"#000000";t.outline=`${s}px ${h} ${l}`,o.outline.offset!==void 0&&(t.outlineOffset=`${o.outline.offset}px`)}return o.objectFit!==void 0&&(t.objectFit=o.objectFit),o.aspectRatio!==void 0&&(t.aspectRatio=o.aspectRatio),t}function dt(o,t){t.borderRadius!==void 0&&(o.style.borderRadius=t.borderRadius),t.borderTopLeftRadius!==void 0&&(o.style.borderTopLeftRadius=t.borderTopLeftRadius),t.borderTopRightRadius!==void 0&&(o.style.borderTopRightRadius=t.borderTopRightRadius),t.borderBottomRightRadius!==void 0&&(o.style.borderBottomRightRadius=t.borderBottomRightRadius),t.borderBottomLeftRadius!==void 0&&(o.style.borderBottomLeftRadius=t.borderBottomLeftRadius),t.border!==void 0&&(o.style.border=t.border),t.borderTop!==void 0&&(o.style.borderTop=t.borderTop),t.borderRight!==void 0&&(o.style.borderRight=t.borderRight),t.borderBottom!==void 0&&(o.style.borderBottom=t.borderBottom),t.borderLeft!==void 0&&(o.style.borderLeft=t.borderLeft),t.boxShadow!==void 0&&(o.style.boxShadow=t.boxShadow),t.filter!==void 0&&(o.style.filter=t.filter),t.opacity!==void 0&&(o.style.opacity=t.opacity),t.cursor!==void 0&&(o.style.cursor=t.cursor),t.outline!==void 0&&(o.style.outline=t.outline),t.outlineOffset!==void 0&&(o.style.outlineOffset=t.outlineOffset),t.objectFit!==void 0&&(o.style.objectFit=t.objectFit),t.aspectRatio!==void 0&&(o.style.aspectRatio=t.aspectRatio)}function Yt(o){return o?Array.isArray(o)?o.join(" "):o:""}function ut(o,t){const e=Yt(t);e&&e.split(" ").forEach(i=>{i.trim()&&o.classList.add(i.trim())})}function Xt(o,t){const e=Yt(t);e&&e.split(" ").forEach(i=>{i.trim()&&o.classList.remove(i.trim())})}const Bt={UNFOCUSING:999,FOCUSING:1e3};class Jt{constructor(t,e,i){var n,a;this.state=x.IDLE,this.currentFocus=null,this.focusData=null,this.outgoing=null,this.incoming=null,this.focusGeneration=0,this.config=t,this.animationEngine=e,this.defaultStyles=mt(i==null?void 0:i.default),this.focusedStyles=mt(i==null?void 0:i.focused),this.defaultClassName=(n=i==null?void 0:i.default)==null?void 0:n.className,this.focusedClassName=(a=i==null?void 0:i.focused)==null?void 0:a.className}getState(){return this.state}isAnimating(){return this.state!==x.IDLE&&this.state!==x.FOCUSED}normalizeScalePercent(t){return t>1?t/100:t}calculateFocusDimensions(t,e,i){const n=this.normalizeScalePercent(this.config.scalePercent),a=i.height*n,r=t/e;let s=a,h=s*r;const l=i.width*n;return h>l&&(h=l,s=h/r),{width:h,height:s}}calculateFocusTransform(t,e){const i=t.width/2,n=t.height/2,a=i-e.x,r=n-e.y;return{x:a,y:r,rotation:0,scale:1}}buildDimensionZoomTransform(t){const e=["translate(-50%, -50%)"];if(t.x!==void 0||t.y!==void 0){const i=t.x??0,n=t.y??0;e.push(`translate(${i}px, ${n}px)`)}return t.rotation!==void 0&&e.push(`rotate(${t.rotation}deg)`),e.join(" ")}animateWithDimensions(t,e,i,n,a,r,s,h){const l=this.buildDimensionZoomTransform(e),u=this.buildDimensionZoomTransform(i);return t.style.transition="none",t.animate([{transform:l,width:`${n}px`,height:`${a}px`},{transform:u,width:`${r}px`,height:`${s}px`}],{duration:h,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards"})}applyFocusedStyling(t,e){t.style.zIndex=String(e),t.classList.add("fbn-ic-focused"),dt(t,this.focusedStyles),ut(t,this.focusedClassName)}removeFocusedStyling(t,e){t.style.zIndex=e,t.classList.remove("fbn-ic-focused"),Xt(t,this.focusedClassName),dt(t,this.defaultStyles),ut(t,this.defaultClassName)}startFocusAnimation(t,e,i,n,a){const r=t.style.zIndex||"",s=t.offsetWidth,h=t.offsetHeight,l=this.calculateFocusDimensions(s,h,e),u=this.calculateFocusTransform(e,i);this.applyFocusedStyling(t,Bt.FOCUSING),this.animationEngine.cancelAllAnimations(t);const c=n??{x:0,y:0,rotation:i.rotation,scale:1},d=(a==null?void 0:a.width)??s,f=(a==null?void 0:a.height)??h,b=this.config.animationDuration??600,p=this.animateWithDimensions(t,c,u,d,f,l.width,l.height,b),g={id:`focus-${Date.now()}`,element:t,animation:p,fromState:c,toState:u,startTime:performance.now(),duration:b};return this.focusData={element:t,originalState:i,focusTransform:u,originalZIndex:r,originalWidth:s,originalHeight:h,focusWidth:l.width,focusHeight:l.height},{element:t,originalState:i,animationHandle:g,direction:"in",originalWidth:s,originalHeight:h}}startUnfocusAnimation(t,e,i,n){var b,p,g,m,y;t.style.zIndex=String(Bt.UNFOCUSING),this.animationEngine.cancelAllAnimations(t);const a=i??((b=this.focusData)==null?void 0:b.focusTransform)??{x:0,y:0,rotation:0,scale:1},r=(n==null?void 0:n.width)??((p=this.focusData)==null?void 0:p.focusWidth)??t.offsetWidth,s=(n==null?void 0:n.height)??((g=this.focusData)==null?void 0:g.focusHeight)??t.offsetHeight,h={x:0,y:0,rotation:e.rotation,scale:1},l=((m=this.focusData)==null?void 0:m.originalWidth)??t.offsetWidth,u=((y=this.focusData)==null?void 0:y.originalHeight)??t.offsetHeight,c=this.config.animationDuration??600,d=this.animateWithDimensions(t,a,h,r,s,l,u,c),f={id:`unfocus-${Date.now()}`,element:t,animation:d,fromState:a,toState:h,startTime:performance.now(),duration:c};return{element:t,originalState:e,animationHandle:f,direction:"out",originalWidth:l,originalHeight:u}}async waitForAnimation(t){try{await t.animation.finished}catch{}}resetElementInstantly(t,e,i,n,a){this.animationEngine.cancelAllAnimations(t);const r=["translate(-50%, -50%)"];r.push("translate(0px, 0px)"),r.push(`rotate(${e.rotation}deg)`),t.style.transition="none",t.style.transform=r.join(" "),n!==void 0&&a!==void 0&&(t.style.width=`${n}px`,t.style.height=`${a}px`),this.removeFocusedStyling(t,i)}async focusImage(t,e,i){var a,r,s,h,l,u,c,d,f,b,p,g;if(this.currentFocus===t&&this.state===x.FOCUSED)return this.unfocusImage();if(((a=this.incoming)==null?void 0:a.element)===t&&this.state===x.FOCUSING){const m=this.animationEngine.cancelAnimation(this.incoming.animationHandle,!0),y={x:m.x,y:m.y,rotation:m.rotation,scale:1},v={width:t.offsetWidth,height:t.offsetHeight};this.outgoing=this.startUnfocusAnimation(t,this.incoming.originalState,y,v),this.incoming=null,this.state=x.UNFOCUSING,await this.waitForAnimation(this.outgoing.animationHandle),this.removeFocusedStyling(this.outgoing.element,((r=this.focusData)==null?void 0:r.originalZIndex)||""),this.outgoing=null,this.currentFocus=null,this.focusData=null,this.state=x.IDLE;return}const n=++this.focusGeneration;switch(this.state){case x.IDLE:if(this.state=x.FOCUSING,this.incoming=this.startFocusAnimation(t,e,i),await this.waitForAnimation(this.incoming.animationHandle),this.focusGeneration!==n)return;this.currentFocus=t,this.incoming=null,this.state=x.FOCUSED;break;case x.FOCUSED:if(this.state=x.CROSS_ANIMATING,this.currentFocus&&this.focusData&&(this.outgoing=this.startUnfocusAnimation(this.currentFocus,this.focusData.originalState)),this.incoming=this.startFocusAnimation(t,e,i),await Promise.all([this.outgoing?this.waitForAnimation(this.outgoing.animationHandle):Promise.resolve(),this.waitForAnimation(this.incoming.animationHandle)]),this.focusGeneration!==n)return;this.outgoing&&(this.removeFocusedStyling(this.outgoing.element,((s=this.outgoing.originalState.zIndex)==null?void 0:s.toString())||""),this.outgoing=null),this.currentFocus=t,this.incoming=null,this.state=x.FOCUSED;break;case x.FOCUSING:if(this.incoming&&(this.animationEngine.cancelAnimation(this.incoming.animationHandle,!1),this.resetElementInstantly(this.incoming.element,this.incoming.originalState,((h=this.focusData)==null?void 0:h.originalZIndex)||"",(l=this.focusData)==null?void 0:l.originalWidth,(u=this.focusData)==null?void 0:u.originalHeight),this.incoming=null),this.incoming=this.startFocusAnimation(t,e,i),await this.waitForAnimation(this.incoming.animationHandle),this.focusGeneration!==n)return;this.currentFocus=t,this.incoming=null,this.state=x.FOCUSED;break;case x.UNFOCUSING:if(this.state=x.CROSS_ANIMATING,this.incoming=this.startFocusAnimation(t,e,i),await Promise.all([this.outgoing?this.waitForAnimation(this.outgoing.animationHandle):Promise.resolve(),this.waitForAnimation(this.incoming.animationHandle)]),this.focusGeneration!==n)return;this.outgoing&&(this.removeFocusedStyling(this.outgoing.element,((c=this.outgoing.originalState.zIndex)==null?void 0:c.toString())||""),this.outgoing=null),this.currentFocus=t,this.incoming=null,this.state=x.FOCUSED;break;case x.CROSS_ANIMATING:if(((d=this.incoming)==null?void 0:d.element)===t)return;if(((f=this.outgoing)==null?void 0:f.element)===t){const m=this.animationEngine.cancelAnimation(this.outgoing.animationHandle,!0),y={x:m.x,y:m.y,rotation:m.rotation,scale:1},v={width:t.offsetWidth,height:t.offsetHeight};if(this.incoming){const I=this.animationEngine.cancelAnimation(this.incoming.animationHandle,!0),R={x:I.x,y:I.y,rotation:I.rotation,scale:1},E={width:this.incoming.element.offsetWidth,height:this.incoming.element.offsetHeight};this.outgoing=this.startUnfocusAnimation(this.incoming.element,this.incoming.originalState,R,E)}else this.outgoing=null;if(this.incoming=this.startFocusAnimation(t,e,i,y,v),await Promise.all([this.outgoing?this.waitForAnimation(this.outgoing.animationHandle):Promise.resolve(),this.waitForAnimation(this.incoming.animationHandle)]),this.focusGeneration!==n)return;this.outgoing&&(this.removeFocusedStyling(this.outgoing.element,((b=this.outgoing.originalState.zIndex)==null?void 0:b.toString())||""),this.outgoing=null),this.currentFocus=t,this.incoming=null,this.state=x.FOCUSED;return}if(this.outgoing&&(this.animationEngine.cancelAnimation(this.outgoing.animationHandle,!1),this.resetElementInstantly(this.outgoing.element,this.outgoing.originalState,((p=this.outgoing.originalState.zIndex)==null?void 0:p.toString())||"",this.outgoing.originalWidth,this.outgoing.originalHeight),this.outgoing=null),this.incoming){const m=this.animationEngine.cancelAnimation(this.incoming.animationHandle,!0),y={x:m.x,y:m.y,rotation:m.rotation,scale:1},v={width:this.incoming.element.offsetWidth,height:this.incoming.element.offsetHeight};this.outgoing=this.startUnfocusAnimation(this.incoming.element,this.incoming.originalState,y,v)}if(this.incoming=this.startFocusAnimation(t,e,i),await Promise.all([this.outgoing?this.waitForAnimation(this.outgoing.animationHandle):Promise.resolve(),this.waitForAnimation(this.incoming.animationHandle)]),this.focusGeneration!==n)return;this.outgoing&&(this.removeFocusedStyling(this.outgoing.element,((g=this.outgoing.originalState.zIndex)==null?void 0:g.toString())||""),this.outgoing=null),this.currentFocus=t,this.incoming=null,this.state=x.FOCUSED;break}}async unfocusImage(){var a,r,s;const t=++this.focusGeneration;if(!this.currentFocus||!this.focusData){if(this.incoming&&this.state===x.FOCUSING){const h=this.animationEngine.cancelAnimation(this.incoming.animationHandle,!0),l={x:h.x,y:h.y,rotation:h.rotation,scale:1},u={width:this.incoming.element.offsetWidth,height:this.incoming.element.offsetHeight};if(this.outgoing=this.startUnfocusAnimation(this.incoming.element,this.incoming.originalState,l,u),this.incoming=null,this.state=x.UNFOCUSING,await this.waitForAnimation(this.outgoing.animationHandle),this.focusGeneration!==t)return;this.removeFocusedStyling(this.outgoing.element,((a=this.focusData)==null?void 0:a.originalZIndex)||""),this.outgoing=null,this.focusData=null,this.state=x.IDLE}return}if(this.state===x.CROSS_ANIMATING&&this.incoming){const h=this.animationEngine.cancelAnimation(this.incoming.animationHandle,!0),l={x:h.x,y:h.y,rotation:h.rotation,scale:1},u={width:this.incoming.element.offsetWidth,height:this.incoming.element.offsetHeight},c=this.startUnfocusAnimation(this.incoming.element,this.incoming.originalState,l,u);if(await Promise.all([this.outgoing?this.waitForAnimation(this.outgoing.animationHandle):Promise.resolve(),this.waitForAnimation(c.animationHandle)]),this.focusGeneration!==t)return;this.outgoing&&this.removeFocusedStyling(this.outgoing.element,((r=this.outgoing.originalState.zIndex)==null?void 0:r.toString())||""),this.removeFocusedStyling(c.element,((s=this.incoming.originalState.zIndex)==null?void 0:s.toString())||""),this.outgoing=null,this.incoming=null,this.currentFocus=null,this.focusData=null,this.state=x.IDLE;return}this.state=x.UNFOCUSING;const e=this.currentFocus,i=this.focusData.originalState,n=this.focusData.originalZIndex;this.outgoing=this.startUnfocusAnimation(e,i),await this.waitForAnimation(this.outgoing.animationHandle),this.focusGeneration===t&&(this.removeFocusedStyling(e,n),this.outgoing=null,this.currentFocus=null,this.focusData=null,this.state=x.IDLE)}async swapFocus(t,e,i){return this.focusImage(t,e,i)}getCurrentFocus(){return this.currentFocus}isFocused(t){return this.currentFocus===t&&this.state===x.FOCUSED}isTargetingFocus(t){var e;return((e=this.incoming)==null?void 0:e.element)===t}isInvolved(t){var e,i;return this.currentFocus===t||((e=this.incoming)==null?void 0:e.element)===t||((i=this.outgoing)==null?void 0:i.element)===t}setDragOffset(t){if(!this.currentFocus||!this.focusData||this.state!==x.FOCUSED)return;const e=this.currentFocus,i=this.focusData.focusTransform,n=["translate(-50%, -50%)"],a=(i.x??0)+t,r=i.y??0;n.push(`translate(${a}px, ${r}px)`),i.rotation!==void 0&&n.push(`rotate(${i.rotation}deg)`),e.style.transition="none",e.style.transform=n.join(" ")}clearDragOffset(t,e=150){if(!this.currentFocus||!this.focusData||this.state!==x.FOCUSED)return;const i=this.currentFocus,n=this.focusData.focusTransform,a=["translate(-50%, -50%)"],r=n.x??0,s=n.y??0;a.push(`translate(${r}px, ${s}px)`),n.rotation!==void 0&&a.push(`rotate(${n.rotation}deg)`);const h=a.join(" ");t?(i.style.transition=`transform ${e}ms ease-out`,i.style.transform=h,setTimeout(()=>{this.currentFocus===i&&(i.style.transition="none")},e)):(i.style.transition="none",i.style.transform=h)}reset(){var t,e,i,n;this.outgoing&&(this.animationEngine.cancelAnimation(this.outgoing.animationHandle,!1),this.resetElementInstantly(this.outgoing.element,this.outgoing.originalState,((t=this.outgoing.originalState.zIndex)==null?void 0:t.toString())||"",this.outgoing.originalWidth,this.outgoing.originalHeight)),this.incoming&&(this.animationEngine.cancelAnimation(this.incoming.animationHandle,!1),this.resetElementInstantly(this.incoming.element,this.incoming.originalState,((e=this.focusData)==null?void 0:e.originalZIndex)||"",(i=this.focusData)==null?void 0:i.originalWidth,(n=this.focusData)==null?void 0:n.originalHeight)),this.currentFocus&&this.focusData&&this.resetElementInstantly(this.currentFocus,this.focusData.originalState,this.focusData.originalZIndex,this.focusData.originalWidth,this.focusData.originalHeight),this.state=x.IDLE,this.currentFocus=null,this.focusData=null,this.outgoing=null,this.incoming=null}}const ze=50,Oe=.5,$e=20,De=.3,Pe=150,Ue=30,ft=class ft{constructor(t,e){this.enabled=!1,this.touchState=null,this.recentTouchTimestamp=0,this.container=t,this.callbacks=e,this.boundTouchStart=this.handleTouchStart.bind(this),this.boundTouchMove=this.handleTouchMove.bind(this),this.boundTouchEnd=this.handleTouchEnd.bind(this),this.boundTouchCancel=this.handleTouchCancel.bind(this)}enable(){this.enabled||(this.enabled=!0,this.container.style.touchAction="pan-y",this.container.addEventListener("touchstart",this.boundTouchStart,{passive:!1}),this.container.addEventListener("touchmove",this.boundTouchMove,{passive:!1}),this.container.addEventListener("touchend",this.boundTouchEnd,{passive:!0}),this.container.addEventListener("touchcancel",this.boundTouchCancel,{passive:!0}))}disable(){var t;this.enabled&&(this.enabled=!1,this.container.style.touchAction="",this.container.removeEventListener("touchstart",this.boundTouchStart),this.container.removeEventListener("touchmove",this.boundTouchMove),this.container.removeEventListener("touchend",this.boundTouchEnd),this.container.removeEventListener("touchcancel",this.boundTouchCancel),(t=this.touchState)!=null&&t.isDragging&&this.callbacks.onDragEnd(!1),this.touchState=null)}destroy(){this.disable()}hadRecentTouch(){return Date.now()-this.recentTouchTimestamp<ft.TOUCH_CLICK_DELAY}handleTouchStart(t){if(t.touches.length!==1)return;this.recentTouchTimestamp=Date.now();const e=t.touches[0];this.touchState={startX:e.clientX,startY:e.clientY,startTime:performance.now(),currentX:e.clientX,isDragging:!1,isHorizontalSwipe:null}}handleTouchMove(t){if(!this.touchState||t.touches.length!==1)return;const e=t.touches[0],i=e.clientX-this.touchState.startX,n=e.clientY-this.touchState.startY;if(this.touchState.isHorizontalSwipe===null&&Math.sqrt(i*i+n*n)>10){const s=Math.atan2(Math.abs(n),Math.abs(i))*(180/Math.PI);this.touchState.isHorizontalSwipe=s<=Ue}if(this.touchState.isHorizontalSwipe!==!1&&this.touchState.isHorizontalSwipe===!0){t.preventDefault(),this.touchState.isDragging=!0,this.touchState.currentX=e.clientX;const a=i*De;this.callbacks.onDragOffset(a)}}handleTouchEnd(t){if(!this.touchState)return;this.recentTouchTimestamp=Date.now();const e=this.touchState.currentX-this.touchState.startX,i=performance.now()-this.touchState.startTime,n=Math.abs(e)/i,a=Math.abs(e);let r=!1;this.touchState.isHorizontalSwipe===!0&&this.touchState.isDragging&&(a>=ze||n>=Oe&&a>=$e)&&(r=!0,e<0?this.callbacks.onNext():this.callbacks.onPrev()),this.touchState.isDragging&&this.callbacks.onDragEnd(r),this.touchState=null}handleTouchCancel(t){var e;(e=this.touchState)!=null&&e.isDragging&&this.callbacks.onDragEnd(!1),this.touchState=null}};ft.TOUCH_CLICK_DELAY=300;let Tt=ft;class Vt{constructor(t){if(this._prepared=!1,this._discoveredUrls=[],this.apiKey=t.apiKey??"",this.apiEndpoint=t.apiEndpoint??"https://www.googleapis.com/drive/v3/files",this.debugLogging=t.debugLogging??!1,this.sources=t.sources??[],!this.sources||this.sources.length===0)throw new Error("GoogleDriveLoader requires at least one source to be configured")}async prepare(t){this._discoveredUrls=[];for(const e of this.sources)if("folders"in e)for(const i of e.folders){const n=e.recursive!==void 0?e.recursive:!0,a=await this.loadFromFolder(i,t,n);this._discoveredUrls.push(...a)}else if("files"in e){const i=await this.loadFiles(e.files,t);this._discoveredUrls.push(...i)}this._prepared=!0}imagesLength(){if(!this._prepared)throw new Error("GoogleDriveLoader.imagesLength() called before prepare()");return this._discoveredUrls.length}imageURLs(){if(!this._prepared)throw new Error("GoogleDriveLoader.imageURLs() called before prepare()");return[...this._discoveredUrls]}isPrepared(){return this._prepared}extractFolderId(t){const e=[/\/folders\/([a-zA-Z0-9_-]+)/,/id=([a-zA-Z0-9_-]+)/];for(const i of e){const n=t.match(i);if(n&&n[1])return n[1]}return null}async loadFromFolder(t,e,i=!0){const n=this.extractFolderId(t);if(!n)throw new Error("Invalid Google Drive folder URL. Please check the URL format.");if(!this.apiKey||this.apiKey==="YOUR_API_KEY_HERE")return this.loadImagesDirectly(n,e);try{return i?await this.loadImagesRecursively(n,e):await this.loadImagesFromSingleFolder(n,e)}catch(a){return console.error("Error loading from Google Drive API:",a),this.loadImagesDirectly(n,e)}}async loadImagesFromSingleFolder(t,e){const i=[],n=`'${t}' in parents and trashed=false`,r=`${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`,s=await fetch(r);if(!s.ok)throw new Error(`API request failed: ${s.status} ${s.statusText}`);const l=(await s.json()).files.filter(u=>u.mimeType.startsWith("image/")&&e.isAllowed(u.name));return this.log(`Found ${l.length} images in folder ${t} (non-recursive)`),l.forEach(u=>{i.push(`https://lh3.googleusercontent.com/d/${u.id}=s1600`),this.log(`Added file: ${u.name}`)}),i}async loadFiles(t,e){const i=[];for(const n of t){const a=this.extractFileId(n);if(!a){this.log(`Skipping invalid file URL: ${n}`);continue}if(this.apiKey&&this.apiKey!=="YOUR_API_KEY_HERE")try{const r=`${this.apiEndpoint}/${a}?fields=name,mimeType&key=${this.apiKey}`,s=await fetch(r);if(s.ok){const h=await s.json();h.mimeType.startsWith("image/")&&e.isAllowed(h.name)?(i.push(`https://lh3.googleusercontent.com/d/${a}=s1600`),this.log(`Added file: ${h.name}`)):this.log(`Skipping non-image file: ${h.name} (${h.mimeType})`)}else this.log(`Failed to fetch metadata for file ${a}: ${s.status}`)}catch(r){this.log(`Error fetching metadata for file ${a}:`,r)}else i.push(`https://lh3.googleusercontent.com/d/${a}=s1600`)}return i}extractFileId(t){if(!/[/:.]/.test(t))return t;const e=[/\/file\/d\/([a-zA-Z0-9_-]+)/,/\/open\?id=([a-zA-Z0-9_-]+)/,/id=([a-zA-Z0-9_-]+)/];for(const i of e){const n=t.match(i);if(n&&n[1])return n[1]}return null}async loadImagesRecursively(t,e){const i=[],n=`'${t}' in parents and trashed=false`,r=`${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`,s=await fetch(r);if(!s.ok)throw new Error(`API request failed: ${s.status} ${s.statusText}`);const h=await s.json(),l=h.files.filter(c=>c.mimeType.startsWith("image/")&&e.isAllowed(c.name)),u=h.files.filter(c=>c.mimeType==="application/vnd.google-apps.folder");this.log(`Found ${h.files.length} total items in folder ${t}`),h.files.forEach(c=>this.log(` - File: ${c.name} (${c.mimeType})`)),this.log(`- ${l.length} valid files (images only)`),this.log(`- ${u.length} subfolders`),l.forEach(c=>{i.push(`https://lh3.googleusercontent.com/d/${c.id}=s1600`),this.log(`Added file: ${c.name}`)});for(const c of u){this.log(`Loading images from subfolder: ${c.name}`);const d=await this.loadImagesRecursively(c.id,e);i.push(...d)}return i}async loadImagesDirectly(t,e){try{const i=`https://drive.google.com/embeddedfolderview?id=${t}`,n=await fetch(i,{mode:"cors"});if(!n.ok)throw new Error("Cannot access folder directly (CORS or permissions issue)");const a=await n.text(),r=/\/file\/d\/([a-zA-Z0-9_-]+)/g,s=[...a.matchAll(r)];return[...new Set(s.map(u=>u[1]))].map(u=>`https://drive.google.com/uc?export=view&id=${u}`)}catch(i){throw console.error("Direct loading failed:",i),new Error(`Unable to load images. Please ensure:
|
|
1
|
+
(function(T,st){typeof exports=="object"&&typeof module<"u"?st(exports):typeof define=="function"&&define.amd?define(["exports"],st):(T=typeof globalThis<"u"?globalThis:T||self,st(T.ImageCloud={}))})(this,function(T){"use strict";const st=Object.freeze({none:"none",sm:"0 2px 4px rgba(0,0,0,0.1)",md:"0 4px 16px rgba(0,0,0,0.4)",lg:"0 8px 32px rgba(0,0,0,0.5)",glow:"0 0 30px rgba(255,255,255,0.6)"}),yt=Object.freeze({energetic:Object.freeze({overshoot:.25,bounces:2,decayRatio:.5}),playful:Object.freeze({overshoot:.15,bounces:1,decayRatio:.5}),subtle:Object.freeze({overshoot:.08,bounces:1,decayRatio:.5})}),vt=Object.freeze({gentle:Object.freeze({stiffness:150,damping:30,mass:1,oscillations:2}),bouncy:Object.freeze({stiffness:300,damping:15,mass:1,oscillations:4}),wobbly:Object.freeze({stiffness:180,damping:12,mass:1.5,oscillations:5}),snappy:Object.freeze({stiffness:400,damping:25,mass:.8,oscillations:2})}),wt=Object.freeze({gentle:Object.freeze({amplitude:30,frequency:1.5,decay:!0,decayRate:.9,phase:0}),playful:Object.freeze({amplitude:50,frequency:2.5,decay:!0,decayRate:.7,phase:0}),serpentine:Object.freeze({amplitude:60,frequency:3,decay:!1,decayRate:1,phase:0}),flutter:Object.freeze({amplitude:20,frequency:4,decay:!0,decayRate:.5,phase:0})}),Et=Object.freeze({type:"linear"}),St=Object.freeze({mode:"none"}),xt=Object.freeze({mode:"none"}),Ot=Object.freeze({default:Object.freeze({border:Object.freeze({width:0,color:"#000000",radius:0,style:"solid"}),shadow:"none",filter:Object.freeze({}),opacity:1,cursor:"pointer",outline:Object.freeze({width:0,color:"#000000",style:"solid",offset:0})}),hover:Object.freeze({shadow:"none"}),focused:Object.freeze({shadow:"none"})}),se=Object.freeze({rows:1,amplitude:100,frequency:2,phaseShift:0,synchronization:"offset"}),ae=Object.freeze({mobile:Object.freeze({maxWidth:767}),tablet:Object.freeze({maxWidth:1199})}),re=Object.freeze({mode:"adaptive",minSize:50,maxSize:400,variance:Object.freeze({min:1,max:1})}),ce=Object.freeze({mode:"none",range:Object.freeze({min:-15,max:15})}),$t=Object.freeze({sizing:re,rotation:ce}),It=Object.freeze({validateUrls:!0,validationTimeout:5e3,validationMethod:"head",failOnAllMissing:!0,allowedExtensions:["jpg","jpeg","png","gif","webp","bmp"]}),Dt=Object.freeze({enabled:!1,centers:!1,loaders:!1}),E=Object.freeze({loaders:[],config:Object.freeze({loaders:It,debug:Dt}),image:$t,layout:Object.freeze({algorithm:"radial",scaleDecay:0,responsive:ae,targetCoverage:.6,densityFactor:1,spacing:Object.freeze({padding:50,minGap:20})}),animation:Object.freeze({duration:600,easing:Object.freeze({default:"cubic-bezier(0.4, 0.0, 0.2, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",focus:"cubic-bezier(0.4, 0.0, 0.2, 1)"}),queue:Object.freeze({enabled:!0,interval:150,maxConcurrent:void 0}),performance:Object.freeze({useGPU:void 0,reduceMotion:void 0}),entry:Object.freeze({start:Object.freeze({position:"nearest-edge",offset:100,circular:Object.freeze({radius:"120%",distribution:"even"})}),timing:Object.freeze({duration:600,stagger:150}),easing:"cubic-bezier(0.25, 1, 0.5, 1)",path:Et,rotation:St,scale:xt})}),interaction:Object.freeze({focus:Object.freeze({scalePercent:.8,zIndex:1e3,animationDuration:void 0}),navigation:Object.freeze({keyboard:void 0,swipe:void 0,mouseWheel:void 0}),gestures:Object.freeze({pinchToZoom:void 0,doubleTapToFocus:void 0})}),rendering:Object.freeze({responsive:Object.freeze({breakpoints:Object.freeze({mobile:768,tablet:void 0,desktop:void 0}),mobileDetection:()=>typeof window>"u"?!1:window.innerWidth<=768}),ui:Object.freeze({showLoadingSpinner:!1,showImageCounter:!1,showThumbnails:void 0,theme:void 0}),performance:Object.freeze({lazyLoad:void 0,preloadCount:void 0,imageQuality:void 0})}),styling:Ot});function lt(o,t){if(!o)return t||{};if(!t)return{...o};const e={...o};return t.border!==void 0&&(e.border={...o.border,...t.border}),t.borderTop!==void 0&&(e.borderTop={...o.borderTop,...t.borderTop}),t.borderRight!==void 0&&(e.borderRight={...o.borderRight,...t.borderRight}),t.borderBottom!==void 0&&(e.borderBottom={...o.borderBottom,...t.borderBottom}),t.borderLeft!==void 0&&(e.borderLeft={...o.borderLeft,...t.borderLeft}),t.filter!==void 0&&(e.filter={...o.filter,...t.filter}),t.outline!==void 0&&(e.outline={...o.outline,...t.outline}),t.shadow!==void 0&&(e.shadow=t.shadow),t.opacity!==void 0&&(e.opacity=t.opacity),t.cursor!==void 0&&(e.cursor=t.cursor),t.className!==void 0&&(e.className=t.className),t.objectFit!==void 0&&(e.objectFit=t.objectFit),t.aspectRatio!==void 0&&(e.aspectRatio=t.aspectRatio),t.borderRadiusTopLeft!==void 0&&(e.borderRadiusTopLeft=t.borderRadiusTopLeft),t.borderRadiusTopRight!==void 0&&(e.borderRadiusTopRight=t.borderRadiusTopRight),t.borderRadiusBottomRight!==void 0&&(e.borderRadiusBottomRight=t.borderRadiusBottomRight),t.borderRadiusBottomLeft!==void 0&&(e.borderRadiusBottomLeft=t.borderRadiusBottomLeft),e}function le(o,t){if(!t)return{...o};const e=lt(o.default,t.default),i=lt(lt(e,o.hover),t.hover),n=lt(lt(e,o.focused),t.focused);return{default:e,hover:i,focused:n}}function he(o,t){var i,n,s,r,a,c,u,l;if(!t)return{...o};const e={...o};if(t.sizing!==void 0&&(e.sizing={...o.sizing,...t.sizing},t.sizing.variance)){const d=t.sizing.variance,h=d.min!==void 0&&d.min>=.25&&d.min<=1?d.min:((n=(i=o.sizing)==null?void 0:i.variance)==null?void 0:n.min)??1,g=d.max!==void 0&&d.max>=1&&d.max<=1.75?d.max:((r=(s=o.sizing)==null?void 0:s.variance)==null?void 0:r.max)??1;e.sizing.variance={min:h,max:g}}if(t.rotation!==void 0&&(e.rotation={...o.rotation,...t.rotation},t.rotation.range)){const d=t.rotation.range,h=d.min!==void 0&&d.min>=-180&&d.min<=0?d.min:((c=(a=o.rotation)==null?void 0:a.range)==null?void 0:c.min)??-15,g=d.max!==void 0&&d.max>=0&&d.max<=180?d.max:((l=(u=o.rotation)==null?void 0:u.range)==null?void 0:l.max)??15;e.rotation.range={min:h,max:g}}return e}function de(o){var e;const t=(e=o.layout)==null?void 0:e.rotation;if(t&&"enabled"in t)return{rotation:{mode:t.enabled?"random":"none",range:t.range}}}function ue(o){var e,i;const t=(i=(e=o.layout)==null?void 0:e.sizing)==null?void 0:i.variance;if(t)return{sizing:{mode:"adaptive",variance:t}}}function ge(o={}){var c,u,l;const t=de(o),e=ue(o);let i=o.image;(t||e)&&(i={...e||{},...t||{},...i},i.rotation&&(t!=null&&t.rotation)&&((c=o.image)!=null&&c.rotation)&&(i.rotation={...t.rotation,...o.image.rotation}));const n=[...o.loaders??[]];o.images&&o.images.length>0&&n.unshift({static:{sources:[{urls:o.images}]}});const r={loaders:{...It,...((u=o.config)==null?void 0:u.loaders)??{}}},a={loaders:n,config:r,image:he($t,i),layout:{...E.layout},animation:{...E.animation},interaction:{...E.interaction},rendering:{...E.rendering},styling:le(Ot,o.styling)};return o.layout&&(a.layout={...E.layout,...o.layout},o.layout.responsive&&(a.layout.responsive={...E.layout.responsive,mobile:o.layout.responsive.mobile?{...E.layout.responsive.mobile,...o.layout.responsive.mobile}:E.layout.responsive.mobile,tablet:o.layout.responsive.tablet?{...E.layout.responsive.tablet,...o.layout.responsive.tablet}:E.layout.responsive.tablet}),o.layout.spacing&&(a.layout.spacing={...E.layout.spacing,...o.layout.spacing})),o.animation&&(a.animation={...E.animation,...o.animation},o.animation.easing&&(a.animation.easing={...E.animation.easing,...o.animation.easing}),o.animation.queue&&(a.animation.queue={...E.animation.queue,...o.animation.queue}),o.animation.performance&&(a.animation.performance={...E.animation.performance,...o.animation.performance}),o.animation.entry&&(a.animation.entry={...E.animation.entry,...o.animation.entry,start:o.animation.entry.start?{...E.animation.entry.start,...o.animation.entry.start,circular:o.animation.entry.start.circular?{...E.animation.entry.start.circular,...o.animation.entry.start.circular}:E.animation.entry.start.circular}:E.animation.entry.start,timing:o.animation.entry.timing?{...E.animation.entry.timing,...o.animation.entry.timing}:E.animation.entry.timing,path:o.animation.entry.path?{...Et,...o.animation.entry.path}:E.animation.entry.path,rotation:o.animation.entry.rotation?{...St,...o.animation.entry.rotation}:E.animation.entry.rotation,scale:o.animation.entry.scale?{...xt,...o.animation.entry.scale}:E.animation.entry.scale})),o.interaction&&(a.interaction={...E.interaction,...o.interaction},o.interaction.focus&&(a.interaction.focus={...E.interaction.focus,...o.interaction.focus}),o.interaction.navigation&&(a.interaction.navigation={...E.interaction.navigation,...o.interaction.navigation}),o.interaction.gestures&&(a.interaction.gestures={...E.interaction.gestures,...o.interaction.gestures})),o.rendering&&(a.rendering={...E.rendering,...o.rendering},o.rendering.responsive&&(a.rendering.responsive={...E.rendering.responsive,...o.rendering.responsive,breakpoints:o.rendering.responsive.breakpoints?{...E.rendering.responsive.breakpoints,...o.rendering.responsive.breakpoints}:E.rendering.responsive.breakpoints,mobileDetection:o.rendering.responsive.mobileDetection?o.rendering.responsive.mobileDetection:E.rendering.responsive.mobileDetection}),o.rendering.ui&&(a.rendering.ui={...E.rendering.ui,...o.rendering.ui}),o.rendering.performance&&(a.rendering.performance={...E.rendering.performance,...o.rendering.performance})),a.config.debug={...Dt,...((l=o.config)==null?void 0:l.debug)??{}},a}function fe(o,t){return{...o?yt[o]:yt.playful,...t}}function me(o,t){return{...o?vt[o]:vt.gentle,...t}}function pe(o,t){return{...o?wt[o]:wt.gentle,...t}}class Pt{constructor(t){this.activeAnimations=new Map,this.animationIdCounter=0,this.config=t}buildTransformString(t){const e=["translate(-50%, -50%)"];if(t.x!==void 0||t.y!==void 0){const i=t.x??0,n=t.y??0;e.push(`translate(${i}px, ${n}px)`)}return t.rotation!==void 0&&e.push(`rotate(${t.rotation}deg)`),t.scale!==void 0&&e.push(`scale(${t.scale})`),e.join(" ")}animateTransformCancellable(t,e,i,n=null,s=null){this.cancelAllAnimations(t);const r=n??this.config.duration,a=s??this.config.easing.default,c=this.buildTransformString(e),u=this.buildTransformString(i);t.style.transition="none";const l=t.animate([{transform:c},{transform:u}],{duration:r,easing:a,fill:"forwards"}),d={id:`anim-${++this.animationIdCounter}`,element:t,animation:l,fromState:e,toState:i,startTime:performance.now(),duration:r};return this.activeAnimations.set(t,d),l.finished.then(()=>{t.style.transform=u,this.activeAnimations.delete(t)}).catch(()=>{this.activeAnimations.delete(t)}),d}cancelAnimation(t,e=!0){const i=this.getCurrentTransform(t.element);if(t.animation.cancel(),e){const n=this.buildTransformString({x:i.x,y:i.y,rotation:i.rotation,scale:i.scale});t.element.style.transform=n}return this.activeAnimations.delete(t.element),i}cancelAllAnimations(t){const e=this.activeAnimations.get(t);e&&this.cancelAnimation(e,!1);const i=t.getAnimations();for(const n of i)n.cancel()}getCurrentTransform(t){const i=getComputedStyle(t).transform;if(i==="none"||!i)return{x:0,y:0,rotation:0,scale:1};const n=new DOMMatrix(i),s=Math.sqrt(n.a*n.a+n.b*n.b),r=Math.atan2(n.b,n.a)*(180/Math.PI),a=n.e,c=n.f;return{x:a,y:c,rotation:r,scale:s}}hasActiveAnimation(t){return this.activeAnimations.has(t)}getAnimationHandle(t){return this.activeAnimations.get(t)}animateTransform(t,e,i=null,n=null){return new Promise(s=>{const r=i??this.config.duration,a=n??this.config.easing.default;t.style.transition=`transform ${r}ms ${a}, box-shadow ${r}ms ${a}`,t.style.transform=this.buildTransformString(e),setTimeout(()=>{s()},r)})}resetTransform(t,e){return this.animateTransform(t,e)}clearTransition(t){t.style.transition=""}wait(t){return new Promise(e=>setTimeout(e,t))}}function at(o,t,e){return o+(t-o)*e}function be(o,t,e,i){const{overshoot:n,bounces:s,decayRatio:r}=i,a=e.x-t.x,c=e.y-t.y,u=ye(s,r);let l=0,d=0,h=1,g=n,p=!1;for(let f=0;f<u.length;f++)if(o<=u[f].time){d=f===0?0:u[f-1].time,h=u[f].time,g=u[f].overshoot,p=u[f].isOvershoot;break}const b=(o-d)/(h-d);if(p)l=1+g*gt(b);else if(d===0)l=gt(b);else{const f=u.find((y,v)=>y.time>d&&v>0&&u[v-1].isOvershoot),m=1+((f==null?void 0:f.overshoot)||g);l=at(m,1,gt(b))}return{x:t.x+a*l,y:t.y+c*l}}function ye(o,t){const e=[];let i=.6;e.push({time:i,overshoot:0,isOvershoot:!1});let n=.15;const r=.4/(o*2);for(let a=0;a<o;a++)i+=r,e.push({time:i,overshoot:n,isOvershoot:!0}),i+=r,e.push({time:i,overshoot:n*t,isOvershoot:!1}),n*=t;return e.push({time:1,overshoot:0,isOvershoot:!1}),e}function ve(o,t,e,i){const{stiffness:n,damping:s,mass:r,oscillations:a}=i,c=e.x-t.x,u=e.y-t.y,l=Math.sqrt(n/r),d=s/(2*Math.sqrt(n*r));let h;if(d<1){const g=l*Math.sqrt(1-d*d),p=Math.exp(-d*l*o*3),b=Math.cos(g*o*a*Math.PI);h=1-p*b}else h=1-Math.exp(-l*o*3);return h=Math.max(0,Math.min(h,1.3)),{x:t.x+c*h,y:t.y+u*h}}function we(o,t,e,i){const{amplitude:n,frequency:s,decay:r,decayRate:a,phase:c}=i,u=e.x-t.x,l=e.y-t.y,d=Math.sqrt(u*u+l*l),h=d>0?-l/d:0,g=d>0?u/d:1,p=s*Math.PI*2*o+c,b=r?Math.pow(1-o,a):1,f=n*Math.sin(p)*b,m=Ee(o);return{x:at(t.x,e.x,m)+f*h,y:at(t.y,e.y,m)+f*g}}function gt(o){return 1-(1-o)*(1-o)}function Ee(o){return 1-Math.pow(1-o,3)}function Se(o,t,e){const{amplitude:i,frequency:n,decay:s}=e,r=Math.sin(o*n*Math.PI*2),a=s?Math.pow(1-o,2):1,c=i*r*a;return t+c}function xe(o,t,e){const{overshoot:i,bounces:n}=e,s=[];s.push({time:.5,scale:i});let r=i;const a=.5,u=.5/(n*2);let l=.5;for(let h=0;h<n;h++){const g=1-(r-1)*a;l+=u,s.push({time:l,scale:g}),r=1+(r-1)*a*a,l+=u,h<n-1&&s.push({time:l,scale:r})}s.push({time:1,scale:1});let d=1;for(let h=0;h<s.length;h++)if(o<=s[h].time){const g=h===0?0:s[h-1].time,p=h===0?1:s[h-1].scale,b=(o-g)/(s[h].time-g),f=gt(b);d=p+(s[h].scale-p)*f;break}return d*t}function Ut(o){const{element:t,startPosition:e,endPosition:i,pathConfig:n,duration:s,imageWidth:r,imageHeight:a,rotation:c,scale:u,onComplete:l,rotationConfig:d,startRotation:h,scaleConfig:g,startScale:p}=o,b=n.type,f=h!==void 0&&h!==c,m=(d==null?void 0:d.mode)==="wobble",y=(d==null?void 0:d.wobble)||{amplitude:15,frequency:3,decay:!0},v=f||m,S=p!==void 0&&p!==u,R=(g==null?void 0:g.mode)==="pop",x=(g==null?void 0:g.pop)||{overshoot:1.2,bounces:1};if((b==="linear"||b==="arc")&&!v&&!(S||R)){l&&l();return}const H=performance.now(),N=-r/2,D=-a/2;function P(W){const L=W-H,w=Math.min(L/s,1);let A;switch(b){case"bounce":{const U=fe(n.bouncePreset,n.bounce);A=be(w,e,i,U);break}case"elastic":{const U=me(n.elasticPreset,n.elastic);A=ve(w,e,i,U);break}case"wave":{const U=pe(n.wavePreset,n.wave);A=we(w,e,i,U);break}default:A={x:at(e.x,i.x,w),y:at(e.y,i.y,w)}}const F=A.x-i.x,C=A.y-i.y;let M;m?M=Se(w,c,y):f?M=at(h,c,w):M=c;let z;R?z=xe(w,u,x):S?z=at(p,u,w):z=u,t.style.transform=`translate(${N}px, ${D}px) translate(${F}px, ${C}px) rotate(${M}deg) scale(${z})`,w<1?requestAnimationFrame(P):(t.style.transform=`translate(${N}px, ${D}px) rotate(${c}deg) scale(${u})`,l&&l())}requestAnimationFrame(P)}function _t(o){return o==="bounce"||o==="elastic"||o==="wave"}const Ie={radial:"center",spiral:"center",grid:"top",cluster:"nearest-edge",random:"nearest-edge",wave:"left"};class Ht{constructor(t,e){this.config=t,this.layoutAlgorithm=e,this.resolvedStartPosition=this.resolveStartPosition(),this.pathConfig=t.path||Et,this.rotationConfig=t.rotation||St,this.scaleConfig=t.scale||xt}resolveStartPosition(){return this.config.start.position?this.config.start.position:Ie[this.layoutAlgorithm]||"nearest-edge"}calculateStartPosition(t,e,i,n,s){const r=this.resolvedStartPosition,a=this.config.start.offset??100;switch(r){case"nearest-edge":return this.calculateNearestEdge(t,e,i,a);case"top":return this.calculateEdgePosition("top",t,e,i,a);case"bottom":return this.calculateEdgePosition("bottom",t,e,i,a);case"left":return this.calculateEdgePosition("left",t,e,i,a);case"right":return this.calculateEdgePosition("right",t,e,i,a);case"center":return this.calculateCenterPosition(i,t,e);case"random-edge":return this.calculateRandomEdge(t,e,i,a);case"circular":return this.calculateCircularPosition(t,e,i,n,s);default:return this.calculateNearestEdge(t,e,i,a)}}calculateNearestEdge(t,e,i,n){const s=t.x,r=t.y,a=s,c=i.width-s,u=r,l=i.height-r,d=Math.min(a,c,u,l);let h=t.x,g=t.y;return d===a?h=-(e.width+n):d===c?h=i.width+n:d===u?g=-(e.height+n):g=i.height+n,{x:h,y:g}}calculateEdgePosition(t,e,i,n,s){let r=e.x,a=e.y;switch(t){case"top":a=-(i.height+s);break;case"bottom":a=n.height+s;break;case"left":r=-(i.width+s);break;case"right":r=n.width+s;break}return{x:r,y:a}}calculateCenterPosition(t,e,i){const n=t.width/2,s=t.height/2;return{x:n,y:s,useScale:!0}}calculateRandomEdge(t,e,i,n){const s=["top","bottom","left","right"],r=s[Math.floor(Math.random()*s.length)];return this.calculateEdgePosition(r,t,e,i,n)}calculateCircularPosition(t,e,i,n,s){const r=this.config.start.circular||{},a=r.distribution||"even";let c;const u=r.radius||"120%";if(typeof u=="string"&&u.endsWith("%")){const b=parseFloat(u)/100;c=Math.sqrt(i.width**2+i.height**2)*b/2}else c=typeof u=="number"?u:500;let l;a==="even"?l=n/s*2*Math.PI:l=Math.random()*2*Math.PI;const d=i.width/2,h=i.height/2,g=d+Math.cos(l)*c,p=h+Math.sin(l)*c;return{x:g,y:p}}getAnimationParams(t){const e=this.config.timing.duration,i=this.config.timing.stagger,n=this.config.easing;return{startTransform:"",duration:e,delay:t*i,easing:n}}buildStartTransform(t,e,i,n,s,r,a,c){const u=t.x-e.x,l=t.y-e.y,d=a!==void 0?a:i,h=c!==void 0?c:n,g=s!==void 0?-s/2:0,p=r!==void 0?-r/2:0,b=s!==void 0?`translate(${g}px, ${p}px)`:"translate(-50%, -50%)";return t.useScale?`${b} translate(${u}px, ${l}px) rotate(${d}deg) scale(0)`:`${b} translate(${u}px, ${l}px) rotate(${d}deg) scale(${h})`}buildFinalTransform(t,e,i,n){if(i!==void 0&&n!==void 0){const s=-i/2,r=-n/2;return`translate(${s}px, ${r}px) rotate(${t}deg) scale(${e})`}return`translate(-50%, -50%) rotate(${t}deg) scale(${e})`}getTransitionCSS(){const t=this.config.timing.duration,e=this.config.easing;return this.requiresJSAnimation()?`opacity ${t}ms ease-out`:`opacity ${t}ms ease-out, transform ${t}ms ${e}`}requiresJSAnimation(){return _t(this.pathConfig.type)}getPathConfig(){return this.pathConfig}getPathType(){return this.pathConfig.type}getTiming(){return{duration:this.config.timing.duration,stagger:this.config.timing.stagger}}getRotationConfig(){return this.rotationConfig}getRotationMode(){return this.rotationConfig.mode}calculateStartRotation(t){switch(this.rotationConfig.mode){case"none":return t;case"settle":{const i=this.rotationConfig.startRotation;if(i===void 0)return t+(Math.random()-.5)*60;if(typeof i=="number")return i;const n=i.max-i.min;return i.min+Math.random()*n}case"spin":{const i=this.rotationConfig.spinCount??1,n=this.resolveSpinDirection(t);return t+i*360*n}case"random":return t+(Math.random()-.5)*60;case"wobble":return t;default:return t}}resolveSpinDirection(t){switch(this.rotationConfig.direction??"auto"){case"clockwise":return-1;case"counterclockwise":return 1;case"random":return Math.random()<.5?1:-1;case"auto":default:return t>=0?1:-1}}requiresJSRotation(){return this.rotationConfig.mode==="wobble"}calculateWobbleRotation(t,e){if(this.rotationConfig.mode!=="wobble")return e;const i=this.rotationConfig.wobble||{amplitude:15,frequency:3,decay:!0},{amplitude:n,frequency:s,decay:r}=i,a=Math.sin(t*s*Math.PI*2),c=r?Math.pow(1-t,2):1,u=n*a*c;return e+u}getScaleConfig(){return this.scaleConfig}getScaleMode(){return this.scaleConfig.mode}calculateStartScale(t){switch(this.scaleConfig.mode){case"none":return t;case"grow":return(this.scaleConfig.startScale??.3)*t;case"shrink":return(this.scaleConfig.startScale??1.5)*t;case"pop":return t;case"random":{const i=this.scaleConfig.range??{min:.5,max:1};return(i.min+Math.random()*(i.max-i.min))*t}default:return t}}requiresJSScale(){return this.scaleConfig.mode==="pop"}calculatePopScale(t,e){if(this.scaleConfig.mode!=="pop")return e;const i=this.scaleConfig.pop||{overshoot:1.2,bounces:1},{overshoot:n,bounces:s}=i,r=this.generateScaleBounceKeyframes(s,n);let a=e;for(let c=0;c<r.length;c++)if(t<=r[c].time){const u=c===0?0:r[c-1].time,l=c===0?e:r[c-1].scale,d=(t-u)/(r[c].time-u),h=this.easeOutQuad(d);a=l+(r[c].scale-l)*h;break}return a*e}generateScaleBounceKeyframes(t,e){const i=[];i.push({time:.5,scale:e});let n=e;const s=.5,a=.5/(t*2);let c=.5;for(let u=0;u<t;u++){const l=1-(n-1)*s;c+=a,i.push({time:c,scale:l}),n=1+(n-1)*s*s,c+=a,u<t-1&&i.push({time:c,scale:n})}return i.push({time:1,scale:1}),i}easeOutQuad(t){return 1-(1-t)*(1-t)}}class Nt{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var x,O,H,N,D,P,W,L,w;const n=[],{width:s,height:r}=e,a=this.config.spacing.padding,c=i.fixedHeight??200,u=((x=this.imageConfig.rotation)==null?void 0:x.mode)??"none",l=((H=(O=this.imageConfig.rotation)==null?void 0:O.range)==null?void 0:H.min)??-15,d=((D=(N=this.imageConfig.rotation)==null?void 0:N.range)==null?void 0:D.max)??15,h=((W=(P=this.imageConfig.sizing)==null?void 0:P.variance)==null?void 0:W.min)??1,g=((w=(L=this.imageConfig.sizing)==null?void 0:L.variance)==null?void 0:w.max)??1,p=h!==1||g!==1,f=c*1.5/2,m=c/2,y=s-a-f,v=r-a-m,S=a+f,R=a+m;for(let A=0;A<t;A++){const F=this.random(S,y),C=this.random(R,v),M=u==="random"?this.random(l,d):0,z=p?this.random(h,g):1,U=c*z,Q={id:A,x:F,y:C,rotation:M,scale:z,baseSize:U};n.push(Q)}return n}random(t,e){return Math.random()*(e-t)+t}}class Gt{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var R,x,O,H,N,D,P,W,L;const n=[],{width:s,height:r}=e,a=i.fixedHeight??200,c=((R=this.imageConfig.rotation)==null?void 0:R.mode)??"none",u=((O=(x=this.imageConfig.rotation)==null?void 0:x.range)==null?void 0:O.min)??-15,l=((N=(H=this.imageConfig.rotation)==null?void 0:H.range)==null?void 0:N.max)??15,d=((P=(D=this.imageConfig.sizing)==null?void 0:D.variance)==null?void 0:P.min)??1,h=((L=(W=this.imageConfig.sizing)==null?void 0:W.variance)==null?void 0:L.max)??1,g=d!==1||h!==1,p=this.config.scaleDecay??0,b=i.fixedHeight??a,f=s/2,m=r/2,y=Math.ceil(Math.sqrt(t));if(t>0){const w=g?this.random(d,h):1,A=b*w;n.push({id:0,x:f,y:m,rotation:c==="random"?this.random(u*.33,l*.33):0,scale:w,baseSize:A,zIndex:100})}let v=1,S=1;for(;v<t;){const w=S/y,A=p>0?1-w*p*.5:1,F=S*(b*.8),C=F*1.5,M=Math.PI*(3*(C+F)-Math.sqrt((3*C+F)*(C+3*F))),z=this.estimateWidth(b),U=Math.floor(M/(z*.7));if(U===0){S++;continue}const Q=2*Math.PI/U,tt=S*(20*Math.PI/180);for(let q=0;q<U&&v<t;q++){const et=q*Q+tt,X=g?this.random(d,h):1,it=A*X,B=b*it;let G=f+Math.cos(et)*C,J=m+Math.sin(et)*F;const j=this.config.spacing.padding??50,k=B*1.5/2,$=B/2;G-k<j?G=j+k:G+k>s-j&&(G=s-j-k),J-$<j?J=j+$:J+$>r-j&&(J=r-j-$);const V=c==="random"?this.random(u,l):0;n.push({id:v,x:G,y:J,rotation:V,scale:it,baseSize:B,zIndex:Math.max(1,100-S)}),v++}S++}return n}estimateWidth(t){return t*1.4}random(t,e){return Math.random()*(e-t)+t}}const Te={columns:"auto",rows:"auto",stagger:"none",jitter:0,overlap:0,fillDirection:"row",alignment:"center",gap:10,overflowOffset:.25},jt=[{x:1,y:1},{x:-1,y:-1},{x:1,y:-1},{x:-1,y:1},{x:-1,y:0},{x:1,y:0},{x:0,y:-1},{x:0,y:1}];class kt{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var tt,q,et,X,it,B,G,J,j;const n=[],{width:s,height:r}=e,a={...Te,...this.config.grid},c=this.config.spacing.padding,u=i.fixedHeight??200,l=((tt=this.imageConfig.rotation)==null?void 0:tt.mode)??"none",d=((et=(q=this.imageConfig.sizing)==null?void 0:q.variance)==null?void 0:et.min)??1,h=((it=(X=this.imageConfig.sizing)==null?void 0:X.variance)==null?void 0:it.max)??1,g=d!==1||h!==1,p=s-2*c,b=r-2*c,{columns:f,rows:m}=this.calculateGridDimensions(t,p,b,u,a),y=a.stagger==="row",v=a.stagger==="column",S=y?f+.5:f,R=v?m+.5:m,x=(p-a.gap*(f-1))/S,O=(b-a.gap*(m-1))/R,H=y?x/2:0,N=v?O/2:0,D=1+a.overlap,P=Math.min(x,O)*D,W=i.fixedHeight?Math.min(i.fixedHeight,P):P,L=f*x+(f-1)*a.gap+H,w=m*O+(m-1)*a.gap+N,A=c+(p-L)/2,F=c+(b-w)/2,C=f*m,M=a.columns!=="auto"&&a.rows!=="auto",z=M&&t>C;typeof window<"u"&&(window.__gridOverflowDebug={gridConfigColumns:a.columns,gridConfigRows:a.rows,columns:f,rows:m,cellCount:C,hasFixedGrid:M,imageCount:t,isOverflowMode:z});const U=z?new Array(C).fill(0):[],Q=Math.min(x,O)*a.overflowOffset;for(let _=0;_<t;_++){let k,$,V=0;if(z&&_>=C){const K=_-C,Y=K%C;V=Math.floor(K/C)+1,U[Y]++,a.fillDirection==="row"?(k=Y%f,$=Math.floor(Y/f)):($=Y%m,k=Math.floor(Y/m))}else a.fillDirection==="row"?(k=_%f,$=Math.floor(_/f)):($=_%m,k=Math.floor(_/m));let Z=A+k*(x+a.gap)+x/2,nt=F+$*(O+a.gap)+O/2;if(a.stagger==="row"&&$%2===1?Z+=x/2:a.stagger==="column"&&k%2===1&&(nt+=O/2),V>0){const K=(V-1)%jt.length,Y=jt[K];Z+=Y.x*Q,nt+=Y.y*Q}if(a.jitter>0){const K=x/2*a.jitter,Y=O/2*a.jitter;Z+=this.random(-K,K),nt+=this.random(-Y,Y)}let ot=Z,rt=nt;if(!z&&a.fillDirection==="row"){const K=t%f||f;if($===Math.floor((t-1)/f)&&K<f){const oe=K*x+(K-1)*a.gap;let zt=0;a.alignment==="center"?zt=(L-oe)/2:a.alignment==="end"&&(zt=L-oe),ot+=zt}}const At=g?this.random(d,h):1,ct=W*At,pt=ct*1.5/2,bt=ct/2,Ct=c+pt,Mt=s-c-pt,He=c+bt,Ne=r-c-bt;ot=Math.max(Ct,Math.min(ot,Mt)),rt=Math.max(He,Math.min(rt,Ne));let Lt=0;if(l==="random"){const K=((G=(B=this.imageConfig.rotation)==null?void 0:B.range)==null?void 0:G.min)??-15,Y=((j=(J=this.imageConfig.rotation)==null?void 0:J.range)==null?void 0:j.max)??15;a.jitter>0?Lt=this.random(K*a.jitter,Y*a.jitter):Lt=this.random(K,Y)}let Ft;z&&V>0?Ft=50-V:Ft=z?100+_:_+1,n.push({id:_,x:ot,y:rt,rotation:Lt,scale:At,baseSize:ct,zIndex:Ft})}return n}calculateGridDimensions(t,e,i,n,s){let r,a;if(s.columns!=="auto"&&s.rows!=="auto")r=s.columns,a=s.rows;else if(s.columns!=="auto")r=s.columns,a=Math.ceil(t/r);else if(s.rows!=="auto")a=s.rows,r=Math.ceil(t/a);else{const c=e/i;for(r=Math.max(1,Math.round(Math.sqrt(t*c/1.4))),a=Math.ceil(t/r);r>1&&(r-1)*a>=t;)r--}return{columns:Math.max(1,r),rows:Math.max(1,a)}}random(t,e){return Math.random()*(e-t)+t}}const Ae=Math.PI*(3-Math.sqrt(5)),Re={spiralType:"golden",direction:"counterclockwise",tightness:1,scaleDecay:0,startAngle:0};class Wt{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var R,x,O,H,N,D,P,W,L;const n=[],{width:s,height:r}=e,a={...Re,...this.config.spiral},c=this.config.spacing.padding,u=i.fixedHeight??200,l=((R=this.imageConfig.rotation)==null?void 0:R.mode)??"none",d=((O=(x=this.imageConfig.rotation)==null?void 0:x.range)==null?void 0:O.min)??-15,h=((N=(H=this.imageConfig.rotation)==null?void 0:H.range)==null?void 0:N.max)??15,g=((P=(D=this.imageConfig.sizing)==null?void 0:D.variance)==null?void 0:P.min)??1,p=((L=(W=this.imageConfig.sizing)==null?void 0:W.variance)==null?void 0:L.max)??1,b=g!==1||p!==1,f=this.config.scaleDecay??a.scaleDecay,m=s/2,y=r/2,v=Math.min(m-c-u/2,y-c-u/2),S=a.direction==="clockwise"?-1:1;for(let w=0;w<t;w++){let A,F;if(a.spiralType==="golden")A=w*Ae*S+a.startAngle,F=this.calculateGoldenRadius(w,t,v,a.tightness);else if(a.spiralType==="archimedean"){const Z=w*.5*a.tightness;A=Z*S+a.startAngle,F=this.calculateArchimedeanRadius(Z,t,v,a.tightness)}else{const Z=w*.3*a.tightness;A=Z*S+a.startAngle,F=this.calculateLogarithmicRadius(Z,t,v,a.tightness)}const C=m+Math.cos(A)*F,M=y+Math.sin(A)*F,z=F/v,U=f>0?1-z*f*.5:1,Q=b?this.random(g,p):1,tt=U*Q,q=u*tt,X=q*1.5/2,it=q/2,B=c+X,G=s-c-X,J=c+it,j=r-c-it,_=Math.max(B,Math.min(C,G)),k=Math.max(J,Math.min(M,j));let $=0;if(l==="random"){const Z=A*180/Math.PI%360,nt=this.random(d,h);$=a.spiralType==="golden"?nt:Z*.1+nt*.9}else l==="tangent"&&($=this.calculateSpiralTangent(A,F,a));const V=t-w;n.push({id:w,x:_,y:k,rotation:$,scale:tt,baseSize:q,zIndex:V})}return n}calculateSpiralTangent(t,e,i){let n;if(i.spiralType==="golden")n=t+Math.PI/2;else if(i.spiralType==="archimedean"){const r=1/i.tightness,a=Math.atan(e/r);n=t+a}else{const r=.15/i.tightness,a=Math.atan(1/r);n=t+a}return n*180/Math.PI%360-90}calculateGoldenRadius(t,e,i,n){const r=i/Math.sqrt(e)*Math.sqrt(t)/n;return Math.min(r,i)}calculateArchimedeanRadius(t,e,i,n){const s=e*.5*n;return t/s*i}calculateLogarithmicRadius(t,e,i,n){const s=i*.05,r=.15/n,a=s*Math.exp(r*t),c=e*.3*n,u=s*Math.exp(r*c);return a/u*i}random(t,e){return Math.random()*(e-t)+t}}const Ce={clusterCount:"auto",clusterSpread:150,clusterSpacing:200,density:"uniform",overlap:.3,distribution:"gaussian"};class qt{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var S,R,x,O,H,N,D,P,W;const n=[],{width:s,height:r}=e,a={...Ce,...this.config.cluster},c=this.config.spacing.padding,u=i.fixedHeight??200,l=((S=this.imageConfig.rotation)==null?void 0:S.mode)??"none",d=((x=(R=this.imageConfig.rotation)==null?void 0:R.range)==null?void 0:x.min)??-15,h=((H=(O=this.imageConfig.rotation)==null?void 0:O.range)==null?void 0:H.max)??15,g=((D=(N=this.imageConfig.sizing)==null?void 0:N.variance)==null?void 0:D.min)??1,p=((W=(P=this.imageConfig.sizing)==null?void 0:P.variance)==null?void 0:W.max)??1,b=g!==1||p!==1,f=this.calculateClusterCount(t,a.clusterCount,s,r,a.clusterSpacing),m=this.generateClusterCenters(f,s,r,c,a),y=new Array(f).fill(0);for(let L=0;L<t;L++)y[L%f]++;let v=0;for(let L=0;L<f;L++){const w=m[L],A=y[L];for(let F=0;F<A;F++){let C,M;if(a.distribution==="gaussian")C=this.gaussianRandom()*w.spread,M=this.gaussianRandom()*w.spread;else{const $=this.random(0,Math.PI*2),V=this.random(0,w.spread);C=Math.cos($)*V,M=Math.sin($)*V}const z=1+a.overlap*.5,U=1+a.overlap*.3;C/=z,M/=z;const Q=b?this.random(g,p):1,tt=U*Q,q=u*tt;let et=w.x+C,X=w.y+M;const B=q*1.5/2,G=q/2;et=Math.max(c+B,Math.min(et,s-c-B)),X=Math.max(c+G,Math.min(X,r-c-G));const J=l==="random"?this.random(d,h):0,_=Math.sqrt(C*C+M*M)/w.spread,k=Math.round((1-_)*50)+1;n.push({id:v,x:et,y:X,rotation:J,scale:tt,baseSize:q,zIndex:k}),v++}}return n}calculateClusterCount(t,e,i,n,s){if(e!=="auto")return Math.max(1,Math.min(e,t));const a=Math.max(1,Math.ceil(t/8)),c=Math.floor(i/s*(n/s)*.6);return Math.max(1,Math.min(a,c,10))}generateClusterCenters(t,e,i,n,s){const r=[],c=n+s.clusterSpread,u=e-n-s.clusterSpread,l=n+s.clusterSpread,d=i-n-s.clusterSpread;for(let h=0;h<t;h++){let g=null,p=-1;for(let b=0;b<100;b++){const f={x:this.random(c,u),y:this.random(l,d),spread:this.calculateClusterSpread(s)};let m=1/0;for(const y of r){const v=f.x-y.x,S=f.y-y.y,R=Math.sqrt(v*v+S*S);m=Math.min(m,R)}if((r.length===0||m>p)&&(g=f,p=m),m>=s.clusterSpacing)break}g&&r.push(g)}return r}calculateClusterSpread(t){return t.density==="uniform"?t.clusterSpread:t.clusterSpread*this.random(.5,1.5)}gaussianRandom(){let t=0,e=0;for(;t===0;)t=Math.random();for(;e===0;)e=Math.random();const i=Math.sqrt(-2*Math.log(t))*Math.cos(2*Math.PI*e);return Math.max(-3,Math.min(3,i))/3}random(t,e){return Math.random()*(e-t)+t}}class Me{constructor(t,e={}){this.config=t,this.imageConfig=e}generate(t,e,i={}){var z,U,Q,tt,q,et,X,it,B;const n=[],{width:s,height:r}=e,a=i.fixedHeight??200,c=this.config.spacing.padding??50,u=((z=this.imageConfig.rotation)==null?void 0:z.mode)??"none",l=((Q=(U=this.imageConfig.rotation)==null?void 0:U.range)==null?void 0:Q.min)??-15,d=((q=(tt=this.imageConfig.rotation)==null?void 0:tt.range)==null?void 0:q.max)??15,h=((X=(et=this.imageConfig.sizing)==null?void 0:et.variance)==null?void 0:X.min)??1,g=((B=(it=this.imageConfig.sizing)==null?void 0:it.variance)==null?void 0:B.max)??1,p=h!==1||g!==1,b=i.fixedHeight??a,f={...se,...this.config.wave},{rows:m,amplitude:y,frequency:v,phaseShift:S,synchronization:R}=f,x=Math.ceil(t/m),N=b*1.5/2,D=c+N,P=s-c-N,W=P-D,L=x>1?W/(x-1):0,w=c+y+b/2,A=r-c-y-b/2,F=A-w,C=m>1?F/(m-1):0;let M=0;for(let G=0;G<m&&M<t;G++){const J=m===1?(w+A)/2:w+G*C;let j=0;R==="offset"?j=G*S:R==="alternating"&&(j=G*Math.PI);for(let _=0;_<x&&M<t;_++){const k=x===1?(D+P)/2:D+_*L,$=this.calculateWaveY(k,s,y,v,j),V=k,Z=J+$,nt=p?this.random(h,g):1,ot=b*nt;let rt=0;u==="tangent"?rt=this.calculateRotation(k,s,y,v,j):u==="random"&&(rt=this.random(l,d));const ct=ot*1.5/2,Rt=ot/2,pt=c+ct,bt=s-c-ct,Ct=c+Rt,Mt=r-c-Rt;n.push({id:M,x:Math.max(pt,Math.min(V,bt)),y:Math.max(Ct,Math.min(Z,Mt)),rotation:rt,scale:nt,baseSize:ot,zIndex:M+1}),M++}}return n}calculateWaveY(t,e,i,n,s){const r=t/e;return i*Math.sin(n*r*2*Math.PI+s)}calculateRotation(t,e,i,n,s){const r=t/e,a=i*n*2*Math.PI*Math.cos(n*r*2*Math.PI+s)/e;return Math.atan(a)*(180/Math.PI)}random(t,e){return Math.random()*(e-t)+t}}class Yt{constructor(t){this.config=t.layout,this.imageConfig=t.image,this.layouts=new Map,this.generator=this.initGenerator()}initGenerator(){switch(this.config.algorithm){case"radial":return new Gt(this.config,this.imageConfig);case"grid":return new kt(this.config,this.imageConfig);case"spiral":return new Wt(this.config,this.imageConfig);case"cluster":return new qt(this.config,this.imageConfig);case"wave":return new Me(this.config,this.imageConfig);case"random":default:return new Nt(this.config,this.imageConfig)}}generateLayout(t,e,i={}){const n=this.generator.generate(t,e,i);return n.forEach(s=>{this.layouts.set(s.id,s)}),n}getOriginalState(t){return this.layouts.get(Number(t))}reset(){this.layouts.clear()}updateConfig(t){t.layout&&(Object.assign(this.config,t.layout),t.layout.algorithm&&t.layout.algorithm!==this.config.algorithm&&(this.generator=this.initGenerator())),t.image&&Object.assign(this.imageConfig,t.image)}getBreakpoints(){return this.config.responsive??{mobile:{maxWidth:767},tablet:{maxWidth:1199}}}resolveBreakpoint(t){const e=this.getBreakpoints();return t<=e.mobile.maxWidth?"mobile":t<=e.tablet.maxWidth?"tablet":"screen"}resolveBaseHeight(t){const e=this.imageConfig.sizing;if(!e||e.mode==="adaptive")return;const i=e.height;if(i===void 0)return;if(typeof i=="number")return i;const n=i,s=this.resolveBreakpoint(t);return s==="mobile"?n.mobile??n.tablet??n.screen:s==="tablet"?n.tablet??n.screen??n.mobile:n.screen??n.tablet??n.mobile}calculateAdaptiveSize(t,e,i,n){const s=this.imageConfig.sizing,r=this.resolveBaseHeight(n);if(r!==void 0)return{height:r};const a=(s==null?void 0:s.minSize)??50,c=(s==null?void 0:s.maxSize)??400,u=this.config.targetCoverage??.6,l=this.config.densityFactor??1,{width:d,height:h}=t,b=d*h*u/e;let m=Math.sqrt(b/1.4);m*=l,m=Math.min(m,i);let y=this.clamp(m,a,c);if(y===a&&m<a){const v=Math.max(a*.05,20);y=Math.max(v,m)}return{height:y}}clamp(t,e,i){return Math.max(e,Math.min(i,t))}}var I=(o=>(o.IDLE="idle",o.FOCUSING="focusing",o.FOCUSED="focused",o.UNFOCUSING="unfocusing",o.CROSS_ANIMATING="cross_animating",o))(I||{});function Le(o){return o in st}function Fe(o){return o?Le(o)?st[o]:o:st.md}function ze(o){if(!o)return"";const t=[];if(o.grayscale!==void 0&&t.push(`grayscale(${o.grayscale})`),o.blur!==void 0&&t.push(`blur(${o.blur}px)`),o.brightness!==void 0&&t.push(`brightness(${o.brightness})`),o.contrast!==void 0&&t.push(`contrast(${o.contrast})`),o.saturate!==void 0&&t.push(`saturate(${o.saturate})`),o.opacity!==void 0&&t.push(`opacity(${o.opacity})`),o.sepia!==void 0&&t.push(`sepia(${o.sepia})`),o.hueRotate!==void 0&&t.push(`hue-rotate(${o.hueRotate}deg)`),o.invert!==void 0&&t.push(`invert(${o.invert})`),o.dropShadow!==void 0)if(typeof o.dropShadow=="string")t.push(`drop-shadow(${o.dropShadow})`);else{const e=o.dropShadow;t.push(`drop-shadow(${e.x}px ${e.y}px ${e.blur}px ${e.color})`)}return t.join(" ")}function ht(o){if(!o||o.style==="none"||o.width===0)return"none";const t=o.width??0,e=o.style??"solid",i=o.color??"#000000";return`${t}px ${e} ${i}`}function ft(o){var s,r;if(!o)return{};const t={};if(o.borderRadiusTopLeft!==void 0||o.borderRadiusTopRight!==void 0||o.borderRadiusBottomRight!==void 0||o.borderRadiusBottomLeft!==void 0){const a=((s=o.border)==null?void 0:s.radius)??0;o.borderRadiusTopLeft!==void 0?t.borderTopLeftRadius=`${o.borderRadiusTopLeft}px`:a&&(t.borderTopLeftRadius=`${a}px`),o.borderRadiusTopRight!==void 0?t.borderTopRightRadius=`${o.borderRadiusTopRight}px`:a&&(t.borderTopRightRadius=`${a}px`),o.borderRadiusBottomRight!==void 0?t.borderBottomRightRadius=`${o.borderRadiusBottomRight}px`:a&&(t.borderBottomRightRadius=`${a}px`),o.borderRadiusBottomLeft!==void 0?t.borderBottomLeftRadius=`${o.borderRadiusBottomLeft}px`:a&&(t.borderBottomLeftRadius=`${a}px`)}else((r=o.border)==null?void 0:r.radius)!==void 0&&(t.borderRadius=`${o.border.radius}px`);if(o.borderTop||o.borderRight||o.borderBottom||o.borderLeft){const a=o.border||{},c={...a,...o.borderTop},u={...a,...o.borderRight},l={...a,...o.borderBottom},d={...a,...o.borderLeft};t.borderTop=ht(c),t.borderRight=ht(u),t.borderBottom=ht(l),t.borderLeft=ht(d)}else o.border&&(t.border=ht(o.border));o.shadow!==void 0&&(t.boxShadow=Fe(o.shadow));const n=ze(o.filter);if(t.filter=n||"none",o.opacity!==void 0&&(t.opacity=String(o.opacity)),o.cursor!==void 0&&(t.cursor=o.cursor),o.outline&&o.outline.style!=="none"&&(o.outline.width??0)>0){const a=o.outline.width??0,c=o.outline.style??"solid",u=o.outline.color??"#000000";t.outline=`${a}px ${c} ${u}`,o.outline.offset!==void 0&&(t.outlineOffset=`${o.outline.offset}px`)}return o.objectFit!==void 0&&(t.objectFit=o.objectFit),o.aspectRatio!==void 0&&(t.aspectRatio=o.aspectRatio),t}function dt(o,t){t.borderRadius!==void 0&&(o.style.borderRadius=t.borderRadius),t.borderTopLeftRadius!==void 0&&(o.style.borderTopLeftRadius=t.borderTopLeftRadius),t.borderTopRightRadius!==void 0&&(o.style.borderTopRightRadius=t.borderTopRightRadius),t.borderBottomRightRadius!==void 0&&(o.style.borderBottomRightRadius=t.borderBottomRightRadius),t.borderBottomLeftRadius!==void 0&&(o.style.borderBottomLeftRadius=t.borderBottomLeftRadius),t.border!==void 0&&(o.style.border=t.border),t.borderTop!==void 0&&(o.style.borderTop=t.borderTop),t.borderRight!==void 0&&(o.style.borderRight=t.borderRight),t.borderBottom!==void 0&&(o.style.borderBottom=t.borderBottom),t.borderLeft!==void 0&&(o.style.borderLeft=t.borderLeft),t.boxShadow!==void 0&&(o.style.boxShadow=t.boxShadow),t.filter!==void 0&&(o.style.filter=t.filter),t.opacity!==void 0&&(o.style.opacity=t.opacity),t.cursor!==void 0&&(o.style.cursor=t.cursor),t.outline!==void 0&&(o.style.outline=t.outline),t.outlineOffset!==void 0&&(o.style.outlineOffset=t.outlineOffset),t.objectFit!==void 0&&(o.style.objectFit=t.objectFit),t.aspectRatio!==void 0&&(o.style.aspectRatio=t.aspectRatio)}function Xt(o){return o?Array.isArray(o)?o.join(" "):o:""}function ut(o,t){const e=Xt(t);e&&e.split(" ").forEach(i=>{i.trim()&&o.classList.add(i.trim())})}function Bt(o,t){const e=Xt(t);e&&e.split(" ").forEach(i=>{i.trim()&&o.classList.remove(i.trim())})}const Jt={UNFOCUSING:999,FOCUSING:1e3};class Vt{constructor(t,e,i){var n,s;this.state=I.IDLE,this.currentFocus=null,this.focusData=null,this.outgoing=null,this.incoming=null,this.focusGeneration=0,this.config=t,this.animationEngine=e,this.defaultStyles=ft(i==null?void 0:i.default),this.focusedStyles=ft(i==null?void 0:i.focused),this.defaultClassName=(n=i==null?void 0:i.default)==null?void 0:n.className,this.focusedClassName=(s=i==null?void 0:i.focused)==null?void 0:s.className}getState(){return this.state}isAnimating(){return this.state!==I.IDLE&&this.state!==I.FOCUSED}normalizeScalePercent(t){return t>1?t/100:t}calculateFocusDimensions(t,e,i){const n=this.normalizeScalePercent(this.config.scalePercent),s=i.height*n,r=t/e;let a=s,c=a*r;const u=i.width*n;return c>u&&(c=u,a=c/r),{width:c,height:a}}calculateFocusTransform(t,e){const i=t.width/2,n=t.height/2,s=i-e.x,r=n-e.y;return{x:s,y:r,rotation:0,scale:1}}buildDimensionZoomTransform(t){const e=["translate(-50%, -50%)"];if(t.x!==void 0||t.y!==void 0){const i=t.x??0,n=t.y??0;e.push(`translate(${i}px, ${n}px)`)}return t.rotation!==void 0&&e.push(`rotate(${t.rotation}deg)`),e.join(" ")}animateWithDimensions(t,e,i,n,s,r,a,c){const u=this.buildDimensionZoomTransform(e),l=this.buildDimensionZoomTransform(i);return t.style.transition="none",t.animate([{transform:u,width:`${n}px`,height:`${s}px`},{transform:l,width:`${r}px`,height:`${a}px`}],{duration:c,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards"})}applyFocusedStyling(t,e){t.style.zIndex=String(e),t.classList.add("fbn-ic-focused"),dt(t,this.focusedStyles),ut(t,this.focusedClassName)}removeFocusedStyling(t,e){t.style.zIndex=e,t.classList.remove("fbn-ic-focused"),Bt(t,this.focusedClassName),dt(t,this.defaultStyles),ut(t,this.defaultClassName)}startFocusAnimation(t,e,i,n,s){const r=t.style.zIndex||"",a=t.offsetWidth,c=t.offsetHeight,u=this.calculateFocusDimensions(a,c,e),l=this.calculateFocusTransform(e,i);this.applyFocusedStyling(t,Jt.FOCUSING),this.animationEngine.cancelAllAnimations(t);const d=n??{x:0,y:0,rotation:i.rotation,scale:1},h=(s==null?void 0:s.width)??a,g=(s==null?void 0:s.height)??c,p=this.config.animationDuration??600,b=this.animateWithDimensions(t,d,l,h,g,u.width,u.height,p),f={id:`focus-${Date.now()}`,element:t,animation:b,fromState:d,toState:l,startTime:performance.now(),duration:p};return this.focusData={element:t,originalState:i,focusTransform:l,originalZIndex:r,originalWidth:a,originalHeight:c,focusWidth:u.width,focusHeight:u.height},{element:t,originalState:i,animationHandle:f,direction:"in",originalWidth:a,originalHeight:c}}startUnfocusAnimation(t,e,i,n){var p,b,f,m,y;t.style.zIndex=String(Jt.UNFOCUSING),this.animationEngine.cancelAllAnimations(t);const s=i??((p=this.focusData)==null?void 0:p.focusTransform)??{x:0,y:0,rotation:0,scale:1},r=(n==null?void 0:n.width)??((b=this.focusData)==null?void 0:b.focusWidth)??t.offsetWidth,a=(n==null?void 0:n.height)??((f=this.focusData)==null?void 0:f.focusHeight)??t.offsetHeight,c={x:0,y:0,rotation:e.rotation,scale:1},u=((m=this.focusData)==null?void 0:m.originalWidth)??t.offsetWidth,l=((y=this.focusData)==null?void 0:y.originalHeight)??t.offsetHeight,d=this.config.animationDuration??600,h=this.animateWithDimensions(t,s,c,r,a,u,l,d),g={id:`unfocus-${Date.now()}`,element:t,animation:h,fromState:s,toState:c,startTime:performance.now(),duration:d};return{element:t,originalState:e,animationHandle:g,direction:"out",originalWidth:u,originalHeight:l}}async waitForAnimation(t){try{await t.animation.finished}catch{}}resetElementInstantly(t,e,i,n,s){this.animationEngine.cancelAllAnimations(t);const r=["translate(-50%, -50%)"];r.push("translate(0px, 0px)"),r.push(`rotate(${e.rotation}deg)`),t.style.transition="none",t.style.transform=r.join(" "),n!==void 0&&s!==void 0&&(t.style.width=`${n}px`,t.style.height=`${s}px`),this.removeFocusedStyling(t,i)}async focusImage(t,e,i){var s,r,a,c,u,l,d,h,g,p,b,f;if(this.currentFocus===t&&this.state===I.FOCUSED)return this.unfocusImage();if(((s=this.incoming)==null?void 0:s.element)===t&&this.state===I.FOCUSING){const m=this.animationEngine.cancelAnimation(this.incoming.animationHandle,!0),y={x:m.x,y:m.y,rotation:m.rotation,scale:1},v={width:t.offsetWidth,height:t.offsetHeight};this.outgoing=this.startUnfocusAnimation(t,this.incoming.originalState,y,v),this.incoming=null,this.state=I.UNFOCUSING,await this.waitForAnimation(this.outgoing.animationHandle),this.removeFocusedStyling(this.outgoing.element,((r=this.focusData)==null?void 0:r.originalZIndex)||""),this.outgoing=null,this.currentFocus=null,this.focusData=null,this.state=I.IDLE;return}const n=++this.focusGeneration;switch(this.state){case I.IDLE:if(this.state=I.FOCUSING,this.incoming=this.startFocusAnimation(t,e,i),await this.waitForAnimation(this.incoming.animationHandle),this.focusGeneration!==n)return;this.currentFocus=t,this.incoming=null,this.state=I.FOCUSED;break;case I.FOCUSED:if(this.state=I.CROSS_ANIMATING,this.currentFocus&&this.focusData&&(this.outgoing=this.startUnfocusAnimation(this.currentFocus,this.focusData.originalState)),this.incoming=this.startFocusAnimation(t,e,i),await Promise.all([this.outgoing?this.waitForAnimation(this.outgoing.animationHandle):Promise.resolve(),this.waitForAnimation(this.incoming.animationHandle)]),this.focusGeneration!==n)return;this.outgoing&&(this.removeFocusedStyling(this.outgoing.element,((a=this.outgoing.originalState.zIndex)==null?void 0:a.toString())||""),this.outgoing=null),this.currentFocus=t,this.incoming=null,this.state=I.FOCUSED;break;case I.FOCUSING:if(this.incoming&&(this.animationEngine.cancelAnimation(this.incoming.animationHandle,!1),this.resetElementInstantly(this.incoming.element,this.incoming.originalState,((c=this.focusData)==null?void 0:c.originalZIndex)||"",(u=this.focusData)==null?void 0:u.originalWidth,(l=this.focusData)==null?void 0:l.originalHeight),this.incoming=null),this.incoming=this.startFocusAnimation(t,e,i),await this.waitForAnimation(this.incoming.animationHandle),this.focusGeneration!==n)return;this.currentFocus=t,this.incoming=null,this.state=I.FOCUSED;break;case I.UNFOCUSING:if(this.state=I.CROSS_ANIMATING,this.incoming=this.startFocusAnimation(t,e,i),await Promise.all([this.outgoing?this.waitForAnimation(this.outgoing.animationHandle):Promise.resolve(),this.waitForAnimation(this.incoming.animationHandle)]),this.focusGeneration!==n)return;this.outgoing&&(this.removeFocusedStyling(this.outgoing.element,((d=this.outgoing.originalState.zIndex)==null?void 0:d.toString())||""),this.outgoing=null),this.currentFocus=t,this.incoming=null,this.state=I.FOCUSED;break;case I.CROSS_ANIMATING:if(((h=this.incoming)==null?void 0:h.element)===t)return;if(((g=this.outgoing)==null?void 0:g.element)===t){const m=this.animationEngine.cancelAnimation(this.outgoing.animationHandle,!0),y={x:m.x,y:m.y,rotation:m.rotation,scale:1},v={width:t.offsetWidth,height:t.offsetHeight};if(this.incoming){const S=this.animationEngine.cancelAnimation(this.incoming.animationHandle,!0),R={x:S.x,y:S.y,rotation:S.rotation,scale:1},x={width:this.incoming.element.offsetWidth,height:this.incoming.element.offsetHeight};this.outgoing=this.startUnfocusAnimation(this.incoming.element,this.incoming.originalState,R,x)}else this.outgoing=null;if(this.incoming=this.startFocusAnimation(t,e,i,y,v),await Promise.all([this.outgoing?this.waitForAnimation(this.outgoing.animationHandle):Promise.resolve(),this.waitForAnimation(this.incoming.animationHandle)]),this.focusGeneration!==n)return;this.outgoing&&(this.removeFocusedStyling(this.outgoing.element,((p=this.outgoing.originalState.zIndex)==null?void 0:p.toString())||""),this.outgoing=null),this.currentFocus=t,this.incoming=null,this.state=I.FOCUSED;return}if(this.outgoing&&(this.animationEngine.cancelAnimation(this.outgoing.animationHandle,!1),this.resetElementInstantly(this.outgoing.element,this.outgoing.originalState,((b=this.outgoing.originalState.zIndex)==null?void 0:b.toString())||"",this.outgoing.originalWidth,this.outgoing.originalHeight),this.outgoing=null),this.incoming){const m=this.animationEngine.cancelAnimation(this.incoming.animationHandle,!0),y={x:m.x,y:m.y,rotation:m.rotation,scale:1},v={width:this.incoming.element.offsetWidth,height:this.incoming.element.offsetHeight};this.outgoing=this.startUnfocusAnimation(this.incoming.element,this.incoming.originalState,y,v)}if(this.incoming=this.startFocusAnimation(t,e,i),await Promise.all([this.outgoing?this.waitForAnimation(this.outgoing.animationHandle):Promise.resolve(),this.waitForAnimation(this.incoming.animationHandle)]),this.focusGeneration!==n)return;this.outgoing&&(this.removeFocusedStyling(this.outgoing.element,((f=this.outgoing.originalState.zIndex)==null?void 0:f.toString())||""),this.outgoing=null),this.currentFocus=t,this.incoming=null,this.state=I.FOCUSED;break}}async unfocusImage(){var s,r,a;const t=++this.focusGeneration;if(!this.currentFocus||!this.focusData){if(this.incoming&&this.state===I.FOCUSING){const c=this.animationEngine.cancelAnimation(this.incoming.animationHandle,!0),u={x:c.x,y:c.y,rotation:c.rotation,scale:1},l={width:this.incoming.element.offsetWidth,height:this.incoming.element.offsetHeight};if(this.outgoing=this.startUnfocusAnimation(this.incoming.element,this.incoming.originalState,u,l),this.incoming=null,this.state=I.UNFOCUSING,await this.waitForAnimation(this.outgoing.animationHandle),this.focusGeneration!==t)return;this.removeFocusedStyling(this.outgoing.element,((s=this.focusData)==null?void 0:s.originalZIndex)||""),this.outgoing=null,this.focusData=null,this.state=I.IDLE}return}if(this.state===I.CROSS_ANIMATING&&this.incoming){const c=this.animationEngine.cancelAnimation(this.incoming.animationHandle,!0),u={x:c.x,y:c.y,rotation:c.rotation,scale:1},l={width:this.incoming.element.offsetWidth,height:this.incoming.element.offsetHeight},d=this.startUnfocusAnimation(this.incoming.element,this.incoming.originalState,u,l);if(await Promise.all([this.outgoing?this.waitForAnimation(this.outgoing.animationHandle):Promise.resolve(),this.waitForAnimation(d.animationHandle)]),this.focusGeneration!==t)return;this.outgoing&&this.removeFocusedStyling(this.outgoing.element,((r=this.outgoing.originalState.zIndex)==null?void 0:r.toString())||""),this.removeFocusedStyling(d.element,((a=this.incoming.originalState.zIndex)==null?void 0:a.toString())||""),this.outgoing=null,this.incoming=null,this.currentFocus=null,this.focusData=null,this.state=I.IDLE;return}this.state=I.UNFOCUSING;const e=this.currentFocus,i=this.focusData.originalState,n=this.focusData.originalZIndex;this.outgoing=this.startUnfocusAnimation(e,i),await this.waitForAnimation(this.outgoing.animationHandle),this.focusGeneration===t&&(this.removeFocusedStyling(e,n),this.outgoing=null,this.currentFocus=null,this.focusData=null,this.state=I.IDLE)}async swapFocus(t,e,i){return this.focusImage(t,e,i)}getCurrentFocus(){return this.currentFocus}isFocused(t){return this.currentFocus===t&&this.state===I.FOCUSED}isTargetingFocus(t){var e;return((e=this.incoming)==null?void 0:e.element)===t}isInvolved(t){var e,i;return this.currentFocus===t||((e=this.incoming)==null?void 0:e.element)===t||((i=this.outgoing)==null?void 0:i.element)===t}setDragOffset(t){if(!this.currentFocus||!this.focusData||this.state!==I.FOCUSED)return;const e=this.currentFocus,i=this.focusData.focusTransform,n=["translate(-50%, -50%)"],s=(i.x??0)+t,r=i.y??0;n.push(`translate(${s}px, ${r}px)`),i.rotation!==void 0&&n.push(`rotate(${i.rotation}deg)`),e.style.transition="none",e.style.transform=n.join(" ")}clearDragOffset(t,e=150){if(!this.currentFocus||!this.focusData||this.state!==I.FOCUSED)return;const i=this.currentFocus,n=this.focusData.focusTransform,s=["translate(-50%, -50%)"],r=n.x??0,a=n.y??0;s.push(`translate(${r}px, ${a}px)`),n.rotation!==void 0&&s.push(`rotate(${n.rotation}deg)`);const c=s.join(" ");t?(i.style.transition=`transform ${e}ms ease-out`,i.style.transform=c,setTimeout(()=>{this.currentFocus===i&&(i.style.transition="none")},e)):(i.style.transition="none",i.style.transform=c)}reset(){var t,e,i,n;this.outgoing&&(this.animationEngine.cancelAnimation(this.outgoing.animationHandle,!1),this.resetElementInstantly(this.outgoing.element,this.outgoing.originalState,((t=this.outgoing.originalState.zIndex)==null?void 0:t.toString())||"",this.outgoing.originalWidth,this.outgoing.originalHeight)),this.incoming&&(this.animationEngine.cancelAnimation(this.incoming.animationHandle,!1),this.resetElementInstantly(this.incoming.element,this.incoming.originalState,((e=this.focusData)==null?void 0:e.originalZIndex)||"",(i=this.focusData)==null?void 0:i.originalWidth,(n=this.focusData)==null?void 0:n.originalHeight)),this.currentFocus&&this.focusData&&this.resetElementInstantly(this.currentFocus,this.focusData.originalState,this.focusData.originalZIndex,this.focusData.originalWidth,this.focusData.originalHeight),this.state=I.IDLE,this.currentFocus=null,this.focusData=null,this.outgoing=null,this.incoming=null}}const Oe=50,$e=.5,De=20,Pe=.3,Ue=150,_e=30,mt=class mt{constructor(t,e){this.enabled=!1,this.touchState=null,this.recentTouchTimestamp=0,this.container=t,this.callbacks=e,this.boundTouchStart=this.handleTouchStart.bind(this),this.boundTouchMove=this.handleTouchMove.bind(this),this.boundTouchEnd=this.handleTouchEnd.bind(this),this.boundTouchCancel=this.handleTouchCancel.bind(this)}enable(){this.enabled||(this.enabled=!0,this.container.style.touchAction="pan-y",this.container.addEventListener("touchstart",this.boundTouchStart,{passive:!1}),this.container.addEventListener("touchmove",this.boundTouchMove,{passive:!1}),this.container.addEventListener("touchend",this.boundTouchEnd,{passive:!0}),this.container.addEventListener("touchcancel",this.boundTouchCancel,{passive:!0}))}disable(){var t;this.enabled&&(this.enabled=!1,this.container.style.touchAction="",this.container.removeEventListener("touchstart",this.boundTouchStart),this.container.removeEventListener("touchmove",this.boundTouchMove),this.container.removeEventListener("touchend",this.boundTouchEnd),this.container.removeEventListener("touchcancel",this.boundTouchCancel),(t=this.touchState)!=null&&t.isDragging&&this.callbacks.onDragEnd(!1),this.touchState=null)}destroy(){this.disable()}hadRecentTouch(){return Date.now()-this.recentTouchTimestamp<mt.TOUCH_CLICK_DELAY}handleTouchStart(t){if(t.touches.length!==1)return;this.recentTouchTimestamp=Date.now();const e=t.touches[0];this.touchState={startX:e.clientX,startY:e.clientY,startTime:performance.now(),currentX:e.clientX,isDragging:!1,isHorizontalSwipe:null}}handleTouchMove(t){if(!this.touchState||t.touches.length!==1)return;const e=t.touches[0],i=e.clientX-this.touchState.startX,n=e.clientY-this.touchState.startY;if(this.touchState.isHorizontalSwipe===null&&Math.sqrt(i*i+n*n)>10){const a=Math.atan2(Math.abs(n),Math.abs(i))*(180/Math.PI);this.touchState.isHorizontalSwipe=a<=_e}if(this.touchState.isHorizontalSwipe!==!1&&this.touchState.isHorizontalSwipe===!0){t.preventDefault(),this.touchState.isDragging=!0,this.touchState.currentX=e.clientX;const s=i*Pe;this.callbacks.onDragOffset(s)}}handleTouchEnd(t){if(!this.touchState)return;this.recentTouchTimestamp=Date.now();const e=this.touchState.currentX-this.touchState.startX,i=performance.now()-this.touchState.startTime,n=Math.abs(e)/i,s=Math.abs(e);let r=!1;this.touchState.isHorizontalSwipe===!0&&this.touchState.isDragging&&(s>=Oe||n>=$e&&s>=De)&&(r=!0,e<0?this.callbacks.onNext():this.callbacks.onPrev()),this.touchState.isDragging&&this.callbacks.onDragEnd(r),this.touchState=null}handleTouchCancel(t){var e;(e=this.touchState)!=null&&e.isDragging&&this.callbacks.onDragEnd(!1),this.touchState=null}};mt.TOUCH_CLICK_DELAY=300;let Tt=mt;class Zt{constructor(t){if(this._prepared=!1,this._discoveredUrls=[],this.apiKey=t.apiKey??"",this.apiEndpoint=t.apiEndpoint??"https://www.googleapis.com/drive/v3/files",this.debugLogging=t.debugLogging??!1,this.sources=t.sources??[],!this.sources||this.sources.length===0)throw new Error("GoogleDriveLoader requires at least one source to be configured")}async prepare(t){this._discoveredUrls=[];for(const e of this.sources)if("folders"in e)for(const i of e.folders){const n=e.recursive!==void 0?e.recursive:!0,s=await this.loadFromFolder(i,t,n);this._discoveredUrls.push(...s)}else if("files"in e){const i=await this.loadFiles(e.files,t);this._discoveredUrls.push(...i)}this._prepared=!0}imagesLength(){if(!this._prepared)throw new Error("GoogleDriveLoader.imagesLength() called before prepare()");return this._discoveredUrls.length}imageURLs(){if(!this._prepared)throw new Error("GoogleDriveLoader.imageURLs() called before prepare()");return[...this._discoveredUrls]}isPrepared(){return this._prepared}extractFolderId(t){const e=[/\/folders\/([a-zA-Z0-9_-]+)/,/id=([a-zA-Z0-9_-]+)/];for(const i of e){const n=t.match(i);if(n&&n[1])return n[1]}return null}async loadFromFolder(t,e,i=!0){const n=this.extractFolderId(t);if(!n)throw new Error("Invalid Google Drive folder URL. Please check the URL format.");if(!this.apiKey||this.apiKey==="YOUR_API_KEY_HERE")return this.loadImagesDirectly(n,e);try{return i?await this.loadImagesRecursively(n,e):await this.loadImagesFromSingleFolder(n,e)}catch(s){return console.error("Error loading from Google Drive API:",s),this.loadImagesDirectly(n,e)}}async loadImagesFromSingleFolder(t,e){const i=[],n=`'${t}' in parents and trashed=false`,r=`${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`,a=await fetch(r);if(!a.ok)throw new Error(`API request failed: ${a.status} ${a.statusText}`);const u=(await a.json()).files.filter(l=>l.mimeType.startsWith("image/")&&e.isAllowed(l.name));return this.log(`Found ${u.length} images in folder ${t} (non-recursive)`),u.forEach(l=>{i.push(`https://lh3.googleusercontent.com/d/${l.id}=s1600`),this.log(`Added file: ${l.name}`)}),i}async loadFiles(t,e){const i=[];for(const n of t){const s=this.extractFileId(n);if(!s){this.log(`Skipping invalid file URL: ${n}`);continue}if(this.apiKey&&this.apiKey!=="YOUR_API_KEY_HERE")try{const r=`${this.apiEndpoint}/${s}?fields=name,mimeType&key=${this.apiKey}`,a=await fetch(r);if(a.ok){const c=await a.json();c.mimeType.startsWith("image/")&&e.isAllowed(c.name)?(i.push(`https://lh3.googleusercontent.com/d/${s}=s1600`),this.log(`Added file: ${c.name}`)):this.log(`Skipping non-image file: ${c.name} (${c.mimeType})`)}else this.log(`Failed to fetch metadata for file ${s}: ${a.status}`)}catch(r){this.log(`Error fetching metadata for file ${s}:`,r)}else i.push(`https://lh3.googleusercontent.com/d/${s}=s1600`)}return i}extractFileId(t){if(!/[/:.]/.test(t))return t;const e=[/\/file\/d\/([a-zA-Z0-9_-]+)/,/\/open\?id=([a-zA-Z0-9_-]+)/,/id=([a-zA-Z0-9_-]+)/];for(const i of e){const n=t.match(i);if(n&&n[1])return n[1]}return null}async loadImagesRecursively(t,e){const i=[],n=`'${t}' in parents and trashed=false`,r=`${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`,a=await fetch(r);if(!a.ok)throw new Error(`API request failed: ${a.status} ${a.statusText}`);const c=await a.json(),u=c.files.filter(d=>d.mimeType.startsWith("image/")&&e.isAllowed(d.name)),l=c.files.filter(d=>d.mimeType==="application/vnd.google-apps.folder");this.log(`Found ${c.files.length} total items in folder ${t}`),c.files.forEach(d=>this.log(` - File: ${d.name} (${d.mimeType})`)),this.log(`- ${u.length} valid files (images only)`),this.log(`- ${l.length} subfolders`),u.forEach(d=>{i.push(`https://lh3.googleusercontent.com/d/${d.id}=s1600`),this.log(`Added file: ${d.name}`)});for(const d of l){this.log(`Loading images from subfolder: ${d.name}`);const h=await this.loadImagesRecursively(d.id,e);i.push(...h)}return i}async loadImagesDirectly(t,e){try{const i=`https://drive.google.com/embeddedfolderview?id=${t}`,n=await fetch(i,{mode:"cors"});if(!n.ok)throw new Error("Cannot access folder directly (CORS or permissions issue)");const s=await n.text(),r=/\/file\/d\/([a-zA-Z0-9_-]+)/g,a=[...s.matchAll(r)];return[...new Set(a.map(l=>l[1]))].map(l=>`https://drive.google.com/uc?export=view&id=${l}`)}catch(i){throw console.error("Direct loading failed:",i),new Error(`Unable to load images. Please ensure:
|
|
2
2
|
1. The folder is shared publicly (Anyone with the link can view)
|
|
3
3
|
2. The folder contains image files
|
|
4
|
-
3. Consider adding a Google Drive API key in config.js for better reliability`)}}manualImageUrls(t){return t.map(e=>`https://drive.google.com/uc?export=view&id=${e}`)}log(...t){this.debugLogging&&typeof console<"u"&&console.log(...t)}}class
|
|
4
|
+
3. Consider adding a Google Drive API key in config.js for better reliability`)}}manualImageUrls(t){return t.map(e=>`https://drive.google.com/uc?export=view&id=${e}`)}log(...t){this.debugLogging&&typeof console<"u"&&console.log(...t)}}class Kt{constructor(t){if(this._prepared=!1,this._discoveredUrls=[],this.validateUrls=t.validateUrls!==!1,this.validationTimeout=t.validationTimeout??5e3,this.validationMethod=t.validationMethod??"head",this.debugLogging=t.debugLogging??!1,this.sources=t.sources??[],!this.sources||this.sources.length===0)throw new Error("StaticImageLoader requires at least one source to be configured");this.log("StaticImageLoader initialized with config:",t)}async prepare(t){this._discoveredUrls=[],this.log(`Processing ${this.sources.length} source(s)`);for(const e of this.sources)try{const i=await this.processSource(e,t);this._discoveredUrls.push(...i)}catch(i){console.warn("Failed to process source:",e,i)}this._prepared=!0,this.log(`Successfully loaded ${this._discoveredUrls.length} image(s)`)}imagesLength(){if(!this._prepared)throw new Error("StaticImageLoader.imagesLength() called before prepare()");return this._discoveredUrls.length}imageURLs(){if(!this._prepared)throw new Error("StaticImageLoader.imageURLs() called before prepare()");return[...this._discoveredUrls]}isPrepared(){return this._prepared}async processSource(t,e){return t?"urls"in t?await this.processUrls(t.urls,e):"path"in t?await this.processPath(t.path,t.files,e):"json"in t?await this.processJson(t.json,e):(console.warn("Unknown source shape:",t),[]):(console.warn("Invalid source object:",t),[])}async processUrls(t,e){if(!Array.isArray(t))return console.warn("URLs must be an array:",t),[];const i=[];for(const n of t){const s=n.split("/").pop()||n;if(!e.isAllowed(s)){this.log(`Skipping filtered URL: ${n}`);continue}this.validateUrls?await this.validateUrl(n)?i.push(n):console.warn(`Skipping invalid/missing URL: ${n}`):i.push(n)}return i}async processPath(t,e,i){if(!Array.isArray(e))return console.warn("files must be an array:",e),[];const n=[];for(const s of e){if(!i.isAllowed(s)){this.log(`Skipping filtered file: ${s}`);continue}const r=this.constructUrl(t,s);this.validateUrls?await this.validateUrl(r)?n.push(r):console.warn(`Skipping invalid/missing file: ${r}`):n.push(r)}return n}async processJson(t,e){this.log(`Fetching JSON endpoint: ${t}`);const i=new AbortController,n=setTimeout(()=>i.abort(),1e4);try{const s=await fetch(t,{signal:i.signal});if(clearTimeout(n),!s.ok)throw new Error(`HTTP ${s.status} fetching ${t}`);const r=await s.json();if(!r||!Array.isArray(r.images))throw new Error('JSON source must return JSON with shape { "images": ["url1", "url2", ...] }');return this.log(`JSON endpoint returned ${r.images.length} image(s)`),await this.processUrls(r.images,e)}catch(s){throw clearTimeout(n),s instanceof Error&&s.name==="AbortError"?new Error(`Timeout fetching JSON endpoint: ${t}`):s}}async validateUrl(t){if(this.validationMethod==="none")return!0;if(this.validationMethod==="simple")try{return typeof window<"u"?new URL(t,window.location.origin):new URL(t),!0}catch{return!1}if(typeof window>"u")return!0;if(!(t.startsWith(window.location.origin)||t.startsWith("/")))return this.log(`Skipping validation for cross-origin URL: ${t}`),!0;try{const i=new AbortController,n=setTimeout(()=>i.abort(),this.validationTimeout),s=await fetch(t,{method:"HEAD",signal:i.signal});return clearTimeout(n),s.ok?!0:(this.log(`Validation failed for ${t}: HTTP ${s.status}`),!1)}catch(i){return i instanceof Error&&(i.name==="AbortError"?this.log(`Validation timeout for ${t}`):this.log(`Validation failed for ${t}:`,i.message)),!1}}constructUrl(t,e){const i=t.replace(/\/$/,"");if(this.isAbsoluteUrl(t))return`${i}/${e}`;if(typeof window>"u")return`${i}/${e}`;const n=window.location.origin,r=(t.startsWith("/")?t:"/"+t).replace(/\/$/,"");return`${n}${r}/${e}`}isAbsoluteUrl(t){try{return new URL(t),!0}catch{return!1}}log(...t){this.debugLogging&&typeof console<"u"&&console.log(...t)}}class Qt{constructor(t){if(this._prepared=!1,this._discoveredUrls=[],this.loaders=t.loaders,this.debugLogging=t.debugLogging??!1,!this.loaders||this.loaders.length===0)throw new Error("CompositeLoader requires at least one loader to be configured");this.log(`CompositeLoader initialized with ${this.loaders.length} loader(s)`)}async prepare(t){this._discoveredUrls=[],this.log(`Preparing ${this.loaders.length} loader(s) in parallel`);const e=this.loaders.map((i,n)=>i.prepare(t).then(()=>{this.log(`Loader ${n} prepared with ${i.imagesLength()} images`)}).catch(s=>{console.warn(`Loader ${n} failed to prepare:`,s)}));await Promise.all(e);for(const i of this.loaders)if(i.isPrepared()){const n=i.imageURLs();this._discoveredUrls.push(...n)}this._prepared=!0,this.log(`CompositeLoader prepared with ${this._discoveredUrls.length} total images`)}imagesLength(){if(!this._prepared)throw new Error("CompositeLoader.imagesLength() called before prepare()");return this._discoveredUrls.length}imageURLs(){if(!this._prepared)throw new Error("CompositeLoader.imageURLs() called before prepare()");return[...this._discoveredUrls]}isPrepared(){return this._prepared}log(...t){this.debugLogging&&typeof console<"u"&&console.log("[CompositeLoader]",...t)}}class te{constructor(t){this.allowedExtensions=t||["jpg","jpeg","png","gif","webp","bmp"]}isAllowed(t){var n;const i=(n=t.split("?")[0].split(".").pop())==null?void 0:n.toLowerCase();return i?this.allowedExtensions.includes(i):!1}getAllowedExtensions(){return[...this.allowedExtensions]}}const ee=`
|
|
5
5
|
.fbn-ic-gallery {
|
|
6
6
|
position: relative;
|
|
7
7
|
width: 100%;
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
.fbn-ic-hidden {
|
|
51
51
|
display: none !important;
|
|
52
52
|
}
|
|
53
|
-
`;function ee(){if(typeof document>"u")return;const o="fbn-ic-functional-styles";if(document.getElementById(o))return;const t=document.createElement("style");t.id=o,t.textContent=te,document.head.appendChild(t)}class ie{constructor(t={}){var i,n,a,r,s,h;this.fullConfig=ue(t),t.container instanceof HTMLElement?(this.containerRef=t.container,this.containerId=null):(this.containerRef=null,this.containerId=t.container||"imageCloud"),this.imagesLoaded=!1,this.imageElements=[],this.imageLayouts=[],this.currentImageHeight=225,this.currentFocusIndex=null,this.hoveredImage=null,this.resizeTimeout=null,this.displayQueue=[],this.queueInterval=null,this.loadGeneration=0,this.loadingElAutoCreated=!1,this.errorElAutoCreated=!1,this.counterEl=null,this.counterElAutoCreated=!1,this.animationEngine=new Dt(this.fullConfig.animation),this.layoutEngine=new qt({layout:this.fullConfig.layout,image:this.fullConfig.image}),this.zoomEngine=new Jt(this.fullConfig.interaction.focus,this.animationEngine,this.fullConfig.styling),this.defaultStyles=mt((i=this.fullConfig.styling)==null?void 0:i.default),this.hoverStyles=mt((n=this.fullConfig.styling)==null?void 0:n.hover),this.defaultClassName=(r=(a=this.fullConfig.styling)==null?void 0:a.default)==null?void 0:r.className,this.hoverClassName=(h=(s=this.fullConfig.styling)==null?void 0:s.hover)==null?void 0:h.className;const e=this.fullConfig.animation.entry||w.animation.entry;this.entryAnimationEngine=new _t(e,this.fullConfig.layout.algorithm),this.swipeEngine=null,this.imageFilter=this.createImageFilter(),this.imageLoader=this.createLoader(),this.containerEl=null,this.loadingEl=null,this.errorEl=null}createImageFilter(){var e;const t=(e=this.fullConfig.config.loaders)==null?void 0:e.allowedExtensions;return new Qt(t)}createLoader(){const t=this.fullConfig.loaders,e=this.fullConfig.config.loaders??{};if(!t||t.length===0)throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");const i=t.map(n=>this.createLoaderFromEntry(n,e));return i.length===1?i[0]:new Kt({loaders:i,debugLogging:e.debugLogging})}createLoaderFromEntry(t,e){if("static"in t){const i=t.static,n={...i,validateUrls:i.validateUrls??e.validateUrls,validationTimeout:i.validationTimeout??e.validationTimeout,validationMethod:i.validationMethod??e.validationMethod,failOnAllMissing:i.failOnAllMissing??e.failOnAllMissing,allowedExtensions:i.allowedExtensions??e.allowedExtensions,debugLogging:i.debugLogging??e.debugLogging};return new Zt(n)}else if("googleDrive"in t){const i=t.googleDrive,n={...i,allowedExtensions:i.allowedExtensions??e.allowedExtensions,debugLogging:i.debugLogging??e.debugLogging};return new Vt(n)}else throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`)}async init(){try{if(ee(),this.containerRef)this.containerEl=this.containerRef;else if(this.containerEl=document.getElementById(this.containerId),!this.containerEl)throw new Error(`Container #${this.containerId} not found`);this.containerEl.classList.add("fbn-ic-gallery"),this.swipeEngine=new Tt(this.containerEl,{onNext:()=>this.navigateToNextImage(),onPrev:()=>this.navigateToPreviousImage(),onDragOffset:t=>this.zoomEngine.setDragOffset(t),onDragEnd:t=>{t?this.zoomEngine.clearDragOffset(!1):this.zoomEngine.clearDragOffset(!0,Pe)}}),this.setupUI(),this.setupEventListeners(),this.logDebug("ImageCloud initialized"),await this.loadImages()}catch(t){console.error("Gallery initialization failed:",t),this.errorEl&&t instanceof Error&&this.showError("Gallery failed to initialize: "+t.message)}}setupUI(){const t=this.fullConfig.rendering.ui;t.showLoadingSpinner&&(t.loadingElement?(this.loadingEl=this.resolveElement(t.loadingElement),this.loadingElAutoCreated=!1):(this.loadingEl=this.createDefaultLoadingElement(),this.loadingElAutoCreated=!0)),t.errorElement?(this.errorEl=this.resolveElement(t.errorElement),this.errorElAutoCreated=!1):(this.errorEl=this.createDefaultErrorElement(),this.errorElAutoCreated=!0),t.showImageCounter&&(t.counterElement?(this.counterEl=this.resolveElement(t.counterElement),this.counterElAutoCreated=!1):(this.counterEl=this.createDefaultCounterElement(),this.counterElAutoCreated=!0))}resolveElement(t){return t instanceof HTMLElement?t:document.getElementById(t)}createDefaultLoadingElement(){const t=document.createElement("div");t.className="fbn-ic-loading fbn-ic-hidden";const e=document.createElement("div");e.className="fbn-ic-spinner",t.appendChild(e);const i=document.createElement("p");return i.textContent="Loading images...",t.appendChild(i),this.containerEl.appendChild(t),t}createDefaultErrorElement(){const t=document.createElement("div");return t.className="fbn-ic-error fbn-ic-hidden",this.containerEl.appendChild(t),t}createDefaultCounterElement(){const t=document.createElement("div");return t.className="fbn-ic-counter fbn-ic-hidden",this.containerEl.appendChild(t),t}setupEventListeners(){document.addEventListener("keydown",t=>{var e;t.key==="Escape"?(this.zoomEngine.unfocusImage(),this.currentFocusIndex=null,(e=this.swipeEngine)==null||e.disable(),this.hideCounter()):t.key==="ArrowRight"?this.navigateToNextImage():t.key==="ArrowLeft"?this.navigateToPreviousImage():(t.key==="Enter"||t.key===" ")&&this.hoveredImage&&(this.handleImageClick(this.hoveredImage.element,this.hoveredImage.layout),t.preventDefault())}),document.addEventListener("click",t=>{var e,i;(e=this.swipeEngine)!=null&&e.hadRecentTouch()||t.target.closest(".fbn-ic-image")||(this.zoomEngine.unfocusImage(),this.currentFocusIndex=null,(i=this.swipeEngine)==null||i.disable(),this.hideCounter())}),window.addEventListener("resize",()=>this.handleResize())}navigateToNextImage(){if(this.currentFocusIndex===null||this.imageElements.length===0)return;const t=(this.currentFocusIndex+1)%this.imageElements.length;this.navigateToImage(t),this.updateCounter(t)}navigateToPreviousImage(){if(this.currentFocusIndex===null||this.imageElements.length===0)return;const t=(this.currentFocusIndex-1+this.imageElements.length)%this.imageElements.length;this.navigateToImage(t),this.updateCounter(t)}async navigateToImage(t){if(t<0||t>=this.imageElements.length)return;const e=this.imageElements[t],i=this.imageLayouts[t];!e||!i||await this.handleImageClick(e,i)}handleResize(){this.imagesLoaded&&(this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{const t=this.getImageHeight();t!==this.currentImageHeight?(this.logDebug(`Window resized to new breakpoint (height: ${t}px). Reloading images...`),this.loadImages()):this.logDebug("Window resized (no breakpoint change)")},500))}getImageHeight(){const t=window.innerWidth,e=this.fullConfig.layout.responsive,i=this.fullConfig.image.sizing,n=(i==null?void 0:i.maxSize)??400;return e?t<=e.mobile.maxWidth?Math.min(100,n):t<=e.tablet.maxWidth?Math.min(180,n):Math.min(225,n):t<=767?Math.min(100,n):t<=1199?Math.min(180,n):Math.min(225,n)}getContainerBounds(){return this.containerEl?{width:this.containerEl.offsetWidth,height:this.containerEl.offsetHeight||window.innerHeight*.7}:{width:window.innerWidth,height:window.innerHeight*.7}}async loadImages(){try{this.showLoading(!0),this.hideError(),this.clearImageCloud(),await this.imageLoader.prepare(this.imageFilter);const t=this.imageLoader.imagesLength();let e=this.imageLoader.imageURLs();if(t===0){this.showError("No images found."),this.showLoading(!1);return}const i=this.getContainerBounds(),n=this.getImageHeight(),a=window.innerWidth;this.logDebug(`Adaptive sizing input: container=${i.width}x${i.height}px, images=${t}, responsiveMax=${n}px`);const r=this.layoutEngine.calculateAdaptiveSize(i,t,n,a);this.logDebug(`Adaptive sizing result: height=${r.height}px`),await this.createImageCloud(e,r.height),this.showLoading(!1),this.imagesLoaded=!0}catch(t){console.error("Error loading images:",t),t instanceof Error&&this.showError(t.message||"Failed to load images."),this.showLoading(!1)}}logDebug(...t){this.fullConfig.debug&&typeof console<"u"&&console.log(...t)}async createImageCloud(t,e){if(!this.containerEl)return;const i=this.getContainerBounds();this.currentImageHeight=e;const n=this.loadGeneration,a=this.layoutEngine.generateLayout(t.length,i,{fixedHeight:e});this.imageLayouts=a,this.displayQueue=[];let r=0;const s=l=>{this.containerEl&&(this.containerEl.appendChild(l),this.imageElements.push(l),requestAnimationFrame(()=>{if(l.offsetWidth,l.style.opacity=this.defaultStyles.opacity??"1",l.dataset.startX&&(this.entryAnimationEngine.requiresJSAnimation()||this.entryAnimationEngine.requiresJSRotation()||this.entryAnimationEngine.requiresJSScale()||l.dataset.startRotation!==l.dataset.rotation||l.dataset.startScale!==l.dataset.scale)){const d={x:parseFloat(l.dataset.startX),y:parseFloat(l.dataset.startY)},f={x:parseFloat(l.dataset.endX),y:parseFloat(l.dataset.endY)},b=parseFloat(l.dataset.imageWidth),p=parseFloat(l.dataset.imageHeight),g=parseFloat(l.dataset.rotation),m=parseFloat(l.dataset.scale),y=l.dataset.startRotation?parseFloat(l.dataset.startRotation):g,v=l.dataset.startScale?parseFloat(l.dataset.startScale):m,I=this.entryAnimationEngine.getTiming();Pt({element:l,startPosition:d,endPosition:f,pathConfig:this.entryAnimationEngine.getPathConfig(),duration:I.duration,imageWidth:b,imageHeight:p,rotation:g,scale:m,rotationConfig:this.entryAnimationEngine.getRotationConfig(),startRotation:y,scaleConfig:this.entryAnimationEngine.getScaleConfig(),startScale:v})}else{const d=l.dataset.finalTransform||"";l.style.transform=d}const c=parseInt(l.dataset.imageId||"0");if(this.fullConfig.debug&&c<3){const d=l.dataset.finalTransform||"";console.log(`Image ${c} final state:`,{left:l.style.left,top:l.style.top,width:l.style.width,height:l.style.height,computedWidth:l.offsetWidth,computedHeight:l.offsetHeight,transform:d,pathType:this.entryAnimationEngine.getPathType()})}}),r++)},h=()=>{if(this.logDebug("Starting queue processing, enabled:",this.fullConfig.animation.queue.enabled),!this.fullConfig.animation.queue.enabled){for(;this.displayQueue.length>0;){const l=this.displayQueue.shift();l&&s(l)}return}this.queueInterval!==null&&clearInterval(this.queueInterval),this.queueInterval=window.setInterval(()=>{if(n!==this.loadGeneration){this.queueInterval!==null&&(clearInterval(this.queueInterval),this.queueInterval=null);return}if(this.displayQueue.length>0){const l=this.displayQueue.shift();l&&s(l)}r>=t.length&&this.displayQueue.length===0&&this.queueInterval!==null&&(clearInterval(this.queueInterval),this.queueInterval=null)},this.fullConfig.animation.queue.interval)};if("IntersectionObserver"in window&&this.containerEl){const l=new IntersectionObserver(u=>{u.forEach(c=>{c.isIntersecting&&(h(),l.disconnect())})},{threshold:.1,rootMargin:"50px"});l.observe(this.containerEl)}else h();this.fullConfig.layout.debugCenters&&this.containerEl&&(this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach(l=>l.remove()),a.forEach((l,u)=>{const c=document.createElement("div");c.className="fbn-ic-debug-center",c.style.position="absolute",c.style.width="12px",c.style.height="12px",c.style.borderRadius="50%",c.style.backgroundColor="red",c.style.border="2px solid yellow",c.style.zIndex="9999",c.style.pointerEvents="none";const d=l.x,f=l.y;c.style.left=`${d-6}px`,c.style.top=`${f-6}px`,c.title=`Image ${u}: center (${Math.round(d)}, ${Math.round(f)})`,this.containerEl.appendChild(c)})),t.forEach((l,u)=>{var f,b;const c=document.createElement("img");c.referrerPolicy="no-referrer",c.classList.add("fbn-ic-image"),c.dataset.imageId=String(u);const d=a[u];c.style.position="absolute",c.style.width="auto",c.style.height=`${e}px`,c.style.left=`${d.x}px`,c.style.top=`${d.y}px`,d.borderColor&&!((b=(f=this.fullConfig.styling)==null?void 0:f.default)!=null&&b.border)&&(c.style.border=`5px solid ${d.borderColor}`,c.style.boxSizing="border-box"),d.zIndex&&(c.style.zIndex=String(d.zIndex)),dt(c,this.defaultStyles),ut(c,this.defaultClassName),c.addEventListener("mouseenter",()=>{this.hoveredImage={element:c,layout:d},this.zoomEngine.isInvolved(c)||(dt(c,this.hoverStyles),ut(c,this.hoverClassName))}),c.addEventListener("mouseleave",()=>{this.hoveredImage=null,this.zoomEngine.isInvolved(c)||(dt(c,this.defaultStyles),Xt(c,this.hoverClassName),ut(c,this.defaultClassName))}),c.addEventListener("click",p=>{p.stopPropagation(),this.handleImageClick(c,d)}),c.style.opacity="0",c.style.transition=this.entryAnimationEngine.getTransitionCSS(),c.onload=()=>{if(n!==this.loadGeneration)return;const p=c.naturalWidth/c.naturalHeight,g=e*p;c.style.width=`${g}px`;const m={x:d.x,y:d.y},y={width:g,height:e},v=this.entryAnimationEngine.calculateStartPosition(m,y,i,u,t.length),I=this.entryAnimationEngine.calculateStartRotation(d.rotation),R=this.entryAnimationEngine.calculateStartScale(d.scale),E=this.entryAnimationEngine.buildFinalTransform(d.rotation,d.scale,g,e),O=this.entryAnimationEngine.buildStartTransform(v,m,d.rotation,d.scale,g,e,I,R);this.fullConfig.debug&&u<3&&console.log(`Image ${u}:`,{finalPosition:m,imageSize:y,left:d.x,top:d.y,finalTransform:E,renderedWidth:g,renderedHeight:e}),c.style.transform=O,c.dataset.finalTransform=E,(this.entryAnimationEngine.requiresJSAnimation()||this.entryAnimationEngine.requiresJSRotation()||this.entryAnimationEngine.requiresJSScale()||I!==d.rotation||R!==d.scale)&&(c.dataset.startX=String(v.x),c.dataset.startY=String(v.y),c.dataset.endX=String(m.x),c.dataset.endY=String(m.y),c.dataset.imageWidth=String(g),c.dataset.imageHeight=String(e),c.dataset.rotation=String(d.rotation),c.dataset.scale=String(d.scale),c.dataset.startRotation=String(I),c.dataset.startScale=String(R)),this.displayQueue.push(c)},c.onerror=()=>r++,c.src=l})}async handleImageClick(t,e){var a,r;if(!this.containerEl)return;const i=this.zoomEngine.isFocused(t),n={width:this.containerEl.offsetWidth,height:this.containerEl.offsetHeight};if(i)await this.zoomEngine.unfocusImage(),this.currentFocusIndex=null,(a=this.swipeEngine)==null||a.disable(),this.hideCounter();else{const s=t.dataset.imageId;this.currentFocusIndex=s!==void 0?parseInt(s,10):null,(r=this.swipeEngine)==null||r.enable(),await this.zoomEngine.focusImage(t,n,e),this.currentFocusIndex!==null&&this.updateCounter(this.currentFocusIndex)}}clearImageCloud(){this.queueInterval!==null&&(clearInterval(this.queueInterval),this.queueInterval=null),this.loadGeneration++,this.displayQueue=[],this.containerEl&&this.containerEl.querySelectorAll(".fbn-ic-image, .fbn-ic-debug-center").forEach(t=>t.remove()),this.imageElements=[],this.imageLayouts=[],this.currentFocusIndex=null,this.hoveredImage=null,this.layoutEngine.reset(),this.zoomEngine.reset(),this.imagesLoaded=!1}showLoading(t){!this.fullConfig.rendering.ui.showLoadingSpinner||!this.loadingEl||(t?this.loadingEl.classList.remove("fbn-ic-hidden"):this.loadingEl.classList.add("fbn-ic-hidden"))}showError(t){this.errorEl&&(this.errorEl.textContent=t,this.errorEl.classList.remove("fbn-ic-hidden"))}hideError(){this.errorEl&&this.errorEl.classList.add("fbn-ic-hidden")}updateCounter(t){!this.fullConfig.rendering.ui.showImageCounter||!this.counterEl||(this.counterEl.textContent=`${t+1} of ${this.imageElements.length}`,this.counterEl.classList.remove("fbn-ic-hidden"))}hideCounter(){this.counterEl&&this.counterEl.classList.add("fbn-ic-hidden")}destroy(){var t;this.clearImageCloud(),this.loadingElAutoCreated&&this.loadingEl&&(this.loadingEl.remove(),this.loadingEl=null),this.errorElAutoCreated&&this.errorEl&&(this.errorEl.remove(),this.errorEl=null),this.counterElAutoCreated&&this.counterEl&&(this.counterEl.remove(),this.counterEl=null),this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),(t=this.swipeEngine)==null||t.destroy()}}A.AnimationEngine=Dt,A.BOUNCE_PRESETS=yt,A.ClusterPlacementGenerator=Wt,A.CompositeLoader=Kt,A.DEFAULT_CONFIG=w,A.DEFAULT_SHARED_LOADER_CONFIG=It,A.ELASTIC_PRESETS=vt,A.EntryAnimationEngine=_t,A.FUNCTIONAL_CSS=te,A.GoogleDriveLoader=Vt,A.GridPlacementGenerator=Gt,A.ImageCloud=ie,A.ImageFilter=Qt,A.ImageGallery=ie,A.LayoutEngine=qt,A.RadialPlacementGenerator=Nt,A.RandomPlacementGenerator=Ht,A.SpiralPlacementGenerator=kt,A.StaticImageLoader=Zt,A.WAVE_PATH_PRESETS=wt,A.ZoomEngine=Jt,A.animatePath=Pt,A.injectFunctionalStyles=ee,A.requiresJSAnimation=Ut,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
53
|
+
`;function ie(){if(typeof document>"u")return;const o="fbn-ic-functional-styles";if(document.getElementById(o))return;const t=document.createElement("style");t.id=o,t.textContent=ee,document.head.appendChild(t)}class ne{constructor(t={}){var i,n,s,r,a,c;this.fullConfig=ge(t),t.container instanceof HTMLElement?(this.containerRef=t.container,this.containerId=null):(this.containerRef=null,this.containerId=t.container||"imageCloud"),this.imagesLoaded=!1,this.imageElements=[],this.imageLayouts=[],this.currentImageHeight=225,this.currentFocusIndex=null,this.hoveredImage=null,this.resizeTimeout=null,this.displayQueue=[],this.queueInterval=null,this.loadGeneration=0,this.loadingElAutoCreated=!1,this.errorElAutoCreated=!1,this.counterEl=null,this.counterElAutoCreated=!1,this.animationEngine=new Pt(this.fullConfig.animation),this.layoutEngine=new Yt({layout:this.fullConfig.layout,image:this.fullConfig.image}),this.zoomEngine=new Vt(this.fullConfig.interaction.focus,this.animationEngine,this.fullConfig.styling),this.defaultStyles=ft((i=this.fullConfig.styling)==null?void 0:i.default),this.hoverStyles=ft((n=this.fullConfig.styling)==null?void 0:n.hover),this.defaultClassName=(r=(s=this.fullConfig.styling)==null?void 0:s.default)==null?void 0:r.className,this.hoverClassName=(c=(a=this.fullConfig.styling)==null?void 0:a.hover)==null?void 0:c.className;const e=this.fullConfig.animation.entry||E.animation.entry;this.entryAnimationEngine=new Ht(e,this.fullConfig.layout.algorithm),this.swipeEngine=null,this.imageFilter=this.createImageFilter(),this.imageLoader=this.createLoader(),this.containerEl=null,this.loadingEl=null,this.errorEl=null}createImageFilter(){var e;const t=(e=this.fullConfig.config.loaders)==null?void 0:e.allowedExtensions;return new te(t)}createLoader(){var n;const t=this.fullConfig.loaders,e=this.fullConfig.config.loaders??{};if(!t||t.length===0)throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");const i=t.map(s=>this.createLoaderFromEntry(s,e));return i.length===1?i[0]:new Qt({loaders:i,debugLogging:(n=this.fullConfig.config.debug)==null?void 0:n.loaders})}createLoaderFromEntry(t,e){var i,n;if("static"in t){const s=t.static,r={...s,validateUrls:s.validateUrls??e.validateUrls,validationTimeout:s.validationTimeout??e.validationTimeout,validationMethod:s.validationMethod??e.validationMethod,failOnAllMissing:s.failOnAllMissing??e.failOnAllMissing,allowedExtensions:s.allowedExtensions??e.allowedExtensions,debugLogging:s.debugLogging??((i=this.fullConfig.config.debug)==null?void 0:i.loaders)};return new Kt(r)}else if("googleDrive"in t){const s=t.googleDrive,r={...s,allowedExtensions:s.allowedExtensions??e.allowedExtensions,debugLogging:s.debugLogging??((n=this.fullConfig.config.debug)==null?void 0:n.loaders)};return new Zt(r)}else throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`)}async init(){try{if(ie(),this.containerRef)this.containerEl=this.containerRef;else if(this.containerEl=document.getElementById(this.containerId),!this.containerEl)throw new Error(`Container #${this.containerId} not found`);this.containerEl.classList.add("fbn-ic-gallery"),this.swipeEngine=new Tt(this.containerEl,{onNext:()=>this.navigateToNextImage(),onPrev:()=>this.navigateToPreviousImage(),onDragOffset:t=>this.zoomEngine.setDragOffset(t),onDragEnd:t=>{t?this.zoomEngine.clearDragOffset(!1):this.zoomEngine.clearDragOffset(!0,Ue)}}),this.setupUI(),this.setupEventListeners(),this.logDebug("ImageCloud initialized"),await this.loadImages()}catch(t){console.error("Gallery initialization failed:",t),this.errorEl&&t instanceof Error&&this.showError("Gallery failed to initialize: "+t.message)}}setupUI(){const t=this.fullConfig.rendering.ui;t.showLoadingSpinner&&(t.loadingElement?(this.loadingEl=this.resolveElement(t.loadingElement),this.loadingElAutoCreated=!1):(this.loadingEl=this.createDefaultLoadingElement(),this.loadingElAutoCreated=!0)),t.errorElement?(this.errorEl=this.resolveElement(t.errorElement),this.errorElAutoCreated=!1):(this.errorEl=this.createDefaultErrorElement(),this.errorElAutoCreated=!0),t.showImageCounter&&(t.counterElement?(this.counterEl=this.resolveElement(t.counterElement),this.counterElAutoCreated=!1):(this.counterEl=this.createDefaultCounterElement(),this.counterElAutoCreated=!0))}resolveElement(t){return t instanceof HTMLElement?t:document.getElementById(t)}createDefaultLoadingElement(){const t=document.createElement("div");t.className="fbn-ic-loading fbn-ic-hidden";const e=document.createElement("div");e.className="fbn-ic-spinner",t.appendChild(e);const i=document.createElement("p");return i.textContent="Loading images...",t.appendChild(i),this.containerEl.appendChild(t),t}createDefaultErrorElement(){const t=document.createElement("div");return t.className="fbn-ic-error fbn-ic-hidden",this.containerEl.appendChild(t),t}createDefaultCounterElement(){const t=document.createElement("div");return t.className="fbn-ic-counter fbn-ic-hidden",this.containerEl.appendChild(t),t}setupEventListeners(){document.addEventListener("keydown",t=>{var e;t.key==="Escape"?(this.zoomEngine.unfocusImage(),this.currentFocusIndex=null,(e=this.swipeEngine)==null||e.disable(),this.hideCounter()):t.key==="ArrowRight"?this.navigateToNextImage():t.key==="ArrowLeft"?this.navigateToPreviousImage():(t.key==="Enter"||t.key===" ")&&this.hoveredImage&&(this.handleImageClick(this.hoveredImage.element,this.hoveredImage.layout),t.preventDefault())}),document.addEventListener("click",t=>{var e,i;(e=this.swipeEngine)!=null&&e.hadRecentTouch()||t.target.closest(".fbn-ic-image")||(this.zoomEngine.unfocusImage(),this.currentFocusIndex=null,(i=this.swipeEngine)==null||i.disable(),this.hideCounter())}),window.addEventListener("resize",()=>this.handleResize())}navigateToNextImage(){if(this.currentFocusIndex===null||this.imageElements.length===0)return;const t=(this.currentFocusIndex+1)%this.imageLayouts.length,e=this.imageElements.find(n=>n.dataset.imageId===String(t));if(!e)return;const i=this.imageLayouts[t];i&&(this.currentFocusIndex=t,this.handleImageClick(e,i),this.updateCounter(t))}navigateToPreviousImage(){if(this.currentFocusIndex===null||this.imageElements.length===0)return;const t=(this.currentFocusIndex-1+this.imageLayouts.length)%this.imageLayouts.length,e=this.imageElements.find(n=>n.dataset.imageId===String(t));if(!e)return;const i=this.imageLayouts[t];i&&(this.currentFocusIndex=t,this.handleImageClick(e,i),this.updateCounter(t))}handleResize(){this.imagesLoaded&&(this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{const t=this.getImageHeight();t!==this.currentImageHeight?(this.logDebug(`Window resized to new breakpoint (height: ${t}px). Reloading images...`),this.loadImages()):this.logDebug("Window resized (no breakpoint change)")},500))}getImageHeight(){const t=window.innerWidth,e=this.fullConfig.layout.responsive,i=this.fullConfig.image.sizing,n=(i==null?void 0:i.maxSize)??400;return e?t<=e.mobile.maxWidth?Math.min(100,n):t<=e.tablet.maxWidth?Math.min(180,n):Math.min(225,n):t<=767?Math.min(100,n):t<=1199?Math.min(180,n):Math.min(225,n)}getContainerBounds(){return this.containerEl?{width:this.containerEl.offsetWidth,height:this.containerEl.offsetHeight||window.innerHeight*.7}:{width:window.innerWidth,height:window.innerHeight*.7}}async loadImages(){try{this.showLoading(!0),this.hideError(),this.clearImageCloud(),await this.imageLoader.prepare(this.imageFilter);const t=this.imageLoader.imagesLength();let e=this.imageLoader.imageURLs();if(t===0){this.showError("No images found."),this.showLoading(!1);return}const i=this.getContainerBounds(),n=this.getImageHeight(),s=window.innerWidth;this.logDebug(`Adaptive sizing input: container=${i.width}x${i.height}px, images=${t}, responsiveMax=${n}px`);const r=this.layoutEngine.calculateAdaptiveSize(i,t,n,s);this.logDebug(`Adaptive sizing result: height=${r.height}px`),await this.createImageCloud(e,r.height),this.showLoading(!1),this.imagesLoaded=!0}catch(t){console.error("Error loading images:",t),t instanceof Error&&this.showError(t.message||"Failed to load images."),this.showLoading(!1)}}logDebug(...t){var e;(e=this.fullConfig.config.debug)!=null&&e.enabled&&typeof console<"u"&&console.log(...t)}async createImageCloud(t,e){var u;if(!this.containerEl)return;const i=this.getContainerBounds();this.currentImageHeight=e;const n=this.loadGeneration,s=this.layoutEngine.generateLayout(t.length,i,{fixedHeight:e});this.imageLayouts=s,this.displayQueue=[];let r=0;const a=l=>{this.containerEl&&(this.containerEl.appendChild(l),this.imageElements.push(l),requestAnimationFrame(()=>{var g;if(l.offsetWidth,l.style.opacity=this.defaultStyles.opacity??"1",l.dataset.startX&&(this.entryAnimationEngine.requiresJSAnimation()||this.entryAnimationEngine.requiresJSRotation()||this.entryAnimationEngine.requiresJSScale()||l.dataset.startRotation!==l.dataset.rotation||l.dataset.startScale!==l.dataset.scale)){const p={x:parseFloat(l.dataset.startX),y:parseFloat(l.dataset.startY)},b={x:parseFloat(l.dataset.endX),y:parseFloat(l.dataset.endY)},f=parseFloat(l.dataset.imageWidth),m=parseFloat(l.dataset.imageHeight),y=parseFloat(l.dataset.rotation),v=parseFloat(l.dataset.scale),S=l.dataset.startRotation?parseFloat(l.dataset.startRotation):y,R=l.dataset.startScale?parseFloat(l.dataset.startScale):v,x=this.entryAnimationEngine.getTiming();Ut({element:l,startPosition:p,endPosition:b,pathConfig:this.entryAnimationEngine.getPathConfig(),duration:x.duration,imageWidth:f,imageHeight:m,rotation:y,scale:v,rotationConfig:this.entryAnimationEngine.getRotationConfig(),startRotation:S,scaleConfig:this.entryAnimationEngine.getScaleConfig(),startScale:R})}else{const p=l.dataset.finalTransform||"";l.style.transform=p}const h=parseInt(l.dataset.imageId||"0");if((g=this.fullConfig.config.debug)!=null&&g.enabled&&h<3){const p=l.dataset.finalTransform||"";console.log(`Image ${h} final state:`,{left:l.style.left,top:l.style.top,width:l.style.width,height:l.style.height,computedWidth:l.offsetWidth,computedHeight:l.offsetHeight,transform:p,pathType:this.entryAnimationEngine.getPathType()})}}),r++)},c=()=>{if(this.logDebug("Starting queue processing, enabled:",this.fullConfig.animation.queue.enabled),!this.fullConfig.animation.queue.enabled){for(;this.displayQueue.length>0;){const l=this.displayQueue.shift();l&&a(l)}return}this.queueInterval!==null&&clearInterval(this.queueInterval),this.queueInterval=window.setInterval(()=>{if(n!==this.loadGeneration){this.queueInterval!==null&&(clearInterval(this.queueInterval),this.queueInterval=null);return}if(this.displayQueue.length>0){const l=this.displayQueue.shift();l&&a(l)}r>=t.length&&this.displayQueue.length===0&&this.queueInterval!==null&&(clearInterval(this.queueInterval),this.queueInterval=null)},this.fullConfig.animation.queue.interval)};if("IntersectionObserver"in window&&this.containerEl){const l=new IntersectionObserver(d=>{d.forEach(h=>{h.isIntersecting&&(c(),l.disconnect())})},{threshold:.1,rootMargin:"50px"});l.observe(this.containerEl)}else c();(u=this.fullConfig.config.debug)!=null&&u.centers&&this.containerEl&&(this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach(l=>l.remove()),s.forEach((l,d)=>{const h=document.createElement("div");h.className="fbn-ic-debug-center",h.style.position="absolute",h.style.width="12px",h.style.height="12px",h.style.borderRadius="50%",h.style.backgroundColor="red",h.style.border="2px solid yellow",h.style.zIndex="9999",h.style.pointerEvents="none";const g=l.x,p=l.y;h.style.left=`${g-6}px`,h.style.top=`${p-6}px`,h.title=`Image ${d}: center (${Math.round(g)}, ${Math.round(p)})`,this.containerEl.appendChild(h)})),t.forEach((l,d)=>{const h=document.createElement("img");h.referrerPolicy="no-referrer",h.classList.add("fbn-ic-image"),h.dataset.imageId=String(d);const g=s[d];h.style.position="absolute",h.style.width="auto",h.style.height=`${e}px`,h.style.left=`${g.x}px`,h.style.top=`${g.y}px`,g.zIndex&&(h.style.zIndex=String(g.zIndex)),dt(h,this.defaultStyles),ut(h,this.defaultClassName),h.addEventListener("mouseenter",()=>{this.hoveredImage={element:h,layout:g},this.zoomEngine.isInvolved(h)||(dt(h,this.hoverStyles),ut(h,this.hoverClassName))}),h.addEventListener("mouseleave",()=>{this.hoveredImage=null,this.zoomEngine.isInvolved(h)||(dt(h,this.defaultStyles),Bt(h,this.hoverClassName),ut(h,this.defaultClassName))}),h.addEventListener("click",p=>{p.stopPropagation(),this.handleImageClick(h,g)}),h.style.opacity="0",h.style.transition=this.entryAnimationEngine.getTransitionCSS(),h.onload=()=>{var H;if(n!==this.loadGeneration)return;const p=h.naturalWidth/h.naturalHeight,b=e*p;h.style.width=`${b}px`;const f={x:g.x,y:g.y},m={width:b,height:e},y=this.entryAnimationEngine.calculateStartPosition(f,m,i,d,t.length),v=this.entryAnimationEngine.calculateStartRotation(g.rotation),S=this.entryAnimationEngine.calculateStartScale(g.scale),R=this.entryAnimationEngine.buildFinalTransform(g.rotation,g.scale,b,e),x=this.entryAnimationEngine.buildStartTransform(y,f,g.rotation,g.scale,b,e,v,S);(H=this.fullConfig.config.debug)!=null&&H.enabled&&d<3&&console.log(`Image ${d}:`,{finalPosition:f,imageSize:m,left:g.x,top:g.y,finalTransform:R,renderedWidth:b,renderedHeight:e}),h.style.transform=x,h.dataset.finalTransform=R,(this.entryAnimationEngine.requiresJSAnimation()||this.entryAnimationEngine.requiresJSRotation()||this.entryAnimationEngine.requiresJSScale()||v!==g.rotation||S!==g.scale)&&(h.dataset.startX=String(y.x),h.dataset.startY=String(y.y),h.dataset.endX=String(f.x),h.dataset.endY=String(f.y),h.dataset.imageWidth=String(b),h.dataset.imageHeight=String(e),h.dataset.rotation=String(g.rotation),h.dataset.scale=String(g.scale),h.dataset.startRotation=String(v),h.dataset.startScale=String(S)),this.displayQueue.push(h)},h.onerror=()=>r++,h.src=l})}async handleImageClick(t,e){var s,r;if(!this.containerEl)return;const i=this.zoomEngine.isFocused(t),n={width:this.containerEl.offsetWidth,height:this.containerEl.offsetHeight};if(i)await this.zoomEngine.unfocusImage(),this.currentFocusIndex=null,(s=this.swipeEngine)==null||s.disable(),this.hideCounter();else{const a=t.dataset.imageId;this.currentFocusIndex=a!==void 0?parseInt(a,10):null,(r=this.swipeEngine)==null||r.enable(),await this.zoomEngine.focusImage(t,n,e),this.currentFocusIndex!==null&&this.updateCounter(this.currentFocusIndex)}}clearImageCloud(){this.queueInterval!==null&&(clearInterval(this.queueInterval),this.queueInterval=null),this.loadGeneration++,this.displayQueue=[],this.containerEl&&this.containerEl.querySelectorAll(".fbn-ic-image, .fbn-ic-debug-center").forEach(t=>t.remove()),this.imageElements=[],this.imageLayouts=[],this.currentFocusIndex=null,this.hoveredImage=null,this.layoutEngine.reset(),this.zoomEngine.reset(),this.imagesLoaded=!1}showLoading(t){!this.fullConfig.rendering.ui.showLoadingSpinner||!this.loadingEl||(t?this.loadingEl.classList.remove("fbn-ic-hidden"):this.loadingEl.classList.add("fbn-ic-hidden"))}showError(t){this.errorEl&&(this.errorEl.textContent=t,this.errorEl.classList.remove("fbn-ic-hidden"))}hideError(){this.errorEl&&this.errorEl.classList.add("fbn-ic-hidden")}updateCounter(t){!this.fullConfig.rendering.ui.showImageCounter||!this.counterEl||(this.counterEl.textContent=`${t+1} of ${this.imageElements.length}`,this.counterEl.classList.remove("fbn-ic-hidden"))}hideCounter(){this.counterEl&&this.counterEl.classList.add("fbn-ic-hidden")}destroy(){var t;this.clearImageCloud(),this.loadingElAutoCreated&&this.loadingEl&&(this.loadingEl.remove(),this.loadingEl=null),this.errorElAutoCreated&&this.errorEl&&(this.errorEl.remove(),this.errorEl=null),this.counterElAutoCreated&&this.counterEl&&(this.counterEl.remove(),this.counterEl=null),this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),(t=this.swipeEngine)==null||t.destroy()}}T.AnimationEngine=Pt,T.BOUNCE_PRESETS=yt,T.ClusterPlacementGenerator=qt,T.CompositeLoader=Qt,T.DEFAULT_CONFIG=E,T.DEFAULT_SHARED_LOADER_CONFIG=It,T.ELASTIC_PRESETS=vt,T.EntryAnimationEngine=Ht,T.FUNCTIONAL_CSS=ee,T.GoogleDriveLoader=Zt,T.GridPlacementGenerator=kt,T.ImageCloud=ne,T.ImageFilter=te,T.ImageGallery=ne,T.LayoutEngine=Yt,T.RadialPlacementGenerator=Gt,T.RandomPlacementGenerator=Nt,T.SpiralPlacementGenerator=Wt,T.StaticImageLoader=Kt,T.WAVE_PATH_PRESETS=wt,T.ZoomEngine=Vt,T.animatePath=Ut,T.injectFunctionalStyles=ie,T.requiresJSAnimation=_t,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
54
54
|
//# sourceMappingURL=image-cloud.umd.js.map
|