@ssgoi/core 3.1.3 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var J=Object.defineProperty;var Q=(n,e,t)=>e in n?J(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var d=(n,e,t)=>Q(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./types.cjs"),Z=require("./jaemin-BG8HRXG1.cjs");class tt{constructor(){d(this,"listeners",new Set);d(this,"rafId",null);d(this,"isRunning",!1);d(this,"startTime",Date.now());d(this,"lastUpdate",this.startTime);d(this,"elapsed",0);d(this,"lagThreshold",500);d(this,"adjustedLag",33);d(this,"maxDeltaTime",33);d(this,"gap",1e3/240);d(this,"nextTime",this.gap);d(this,"tick",()=>{const e=Date.now();let i=e-this.lastUpdate;i>this.lagThreshold||i<0?(this.startTime+=i-this.adjustedLag,i=this.adjustedLag):i>this.maxDeltaTime&&(i=this.maxDeltaTime),this.lastUpdate=e;const r=e-this.startTime,o=r-this.nextTime;if(o>0){const a=i/1e3;this.elapsed=r/1e3,this.nextTime+=o+(o>=this.gap?4:this.gap-o),this.listeners.forEach(c=>{c(a,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(e){return this.listeners.add(e),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(e)}}unsubscribe(e){this.listeners.delete(e),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(e,t){this.lagThreshold=e,this.adjustedLag=Math.min(t,e)}fps(e){this.gap=1e3/e,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const P=new tt;function N(n){const e=n.stiffness,t=n.damping,i=1,r=Math.sqrt(e/i),o=t/(2*Math.sqrt(e*i));return{omega:r,zeta:o}}function Y(n,e,t,i){const{omega:r,zeta:o}=t,{position:a,velocity:c}=n,s=Math.min(i,.033),l=-2*s*o*r*c,f=s*r*r*(e-a),w=c+l+f;return{position:a+s*w,velocity:w}}const et=.01,it=.01,H=.05;function j(n,e){const t=Math.abs(e-n.position),i=Math.abs(n.velocity);return t<et&&i<it}function nt(n){const{from:e,to:t,spring:i,velocity:r=0,onUpdate:o,onComplete:a,onStart:c}=n;let s={position:e,velocity:r},l=!0,f=0,w=!1;const u=N(i),h=p=>{if(l){if(w||(w=!0,c==null||c()),s=Y(s,t,u,p),j(s,t)){if(f+=Math.min(p,.033),f>=H){s={position:t,velocity:0},l=!1,o(s.position),P.unsubscribe(h),a();return}}else f=0;o(s.position)}};return P.subscribe(h),{stop:()=>{l&&(l=!1,P.unsubscribe(h))},getPosition:()=>s.position,getVelocity:()=>s.velocity,isRunning:()=>l}}const b=1e3/60;function ot(n,e,t,i=0){const r=N(t),o=600;let a={position:n,velocity:i},c=0;const s=[];for(let l=0;l<o;l++){const f=l*b;if(s.push({time:f,position:a.position,velocity:a.velocity}),a=Y(a,e,r,b/1e3),j(a,e)){if(c+=b/1e3,c>=H){s.push({time:(l+1)*b,position:e,velocity:0});break}}else c=0}return s}function D(n,e){if(n.length===0)return{position:0,velocity:0};const t=n[0],i=n[n.length-1];if(e<=0)return{position:t.position,velocity:t.velocity};if(e>=i.time)return{position:i.position,velocity:i.velocity};let r=0,o=n.length-1;for(;r<o-1;){const l=Math.floor((r+o)/2);n[l].time<=e?r=l:o=l}const a=n[r],c=n[o],s=(e-a.time)/(c.time-a.time);return{position:a.position+(c.position-a.position)*s,velocity:a.velocity+(c.velocity-a.velocity)*s}}function rt(n,e){return n.map(t=>e(t.position))}function st(n){const{element:e,from:t,to:i,spring:r,velocity:o=0,style:a,onComplete:c,onStart:s}=n,l=ot(t,i,r,o);if(l.length===0)return s==null||s(),c(),{stop:()=>{},getPosition:()=>i,getVelocity:()=>0,isRunning:()=>!1};const f=rt(l,a),w=l[l.length-1],u=w.time,h=e.animate(f,{duration:u,fill:"forwards",easing:"linear"});let p=!0;const S=performance.now();return s==null||s(),h.onfinish=()=>{p&&(p=!1,c())},{stop:()=>{p&&(p=!1,h.cancel())},getPosition:()=>{if(!p)return w.position;const y=performance.now()-S;return D(l,y).position},getVelocity:()=>{if(!p)return 0;const y=performance.now()-S;return D(l,y).velocity},isRunning:()=>p}}function at(n){const{from:e,to:t,spring:i,velocity:r,onComplete:o,onStart:a,tick:c,css:s}=n;if(c&&s)throw new Error("Cannot use both 'tick' and 'css' options together");return!c&&!s?(a==null||a(),o(),{stop:()=>{},getPosition:()=>t,getVelocity:()=>0,isRunning:()=>!1}):s?st({element:s.element,from:e,to:t,spring:i,velocity:r,style:s.style,onComplete:o,onStart:a}):nt({from:e,to:t,spring:i,velocity:r,onUpdate:c,onComplete:o,onStart:a})}class X{}class V extends X{constructor(t){super();d(this,"options");d(this,"controls",null);d(this,"isAnimating",!1);d(this,"currentValue");d(this,"currentVelocity",0);if(t.tick&&t.css)throw new Error("Cannot use both 'tick' and 'css' options together");this.options={from:t.from??0,to:t.to??1,spring:t.spring??{stiffness:300,damping:30},tick:t.tick,css:t.css,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from}runAnimation(t){this.isAnimating=!0,this.controls=at({from:this.currentValue,to:t,spring:this.options.spring,velocity:this.currentVelocity,tick:this.options.tick,css:this.options.css,onStart:this.options.onStart,onComplete:()=>{this.currentValue=t,this.currentVelocity=0,this.isAnimating=!1,this.controls=null,this.options.onComplete()}})}forward(){this.stop(),this.runAnimation(this.options.to)}backward(){this.stop(),this.runAnimation(this.options.from)}reverse(){const t=this.options.from;this.options.from=this.options.to,this.options.to=t,this.isAnimating&&(this.stop(),this.runAnimation(this.options.to))}stop(){this.controls&&(this.currentValue=this.controls.getPosition(),this.currentVelocity=this.controls.getVelocity(),this.controls.stop(),this.controls=null),this.isAnimating=!1}getVelocity(){var t;return((t=this.controls)==null?void 0:t.getVelocity())??this.currentVelocity}getCurrentValue(){var t;return((t=this.controls)==null?void 0:t.getPosition())??this.currentValue}getIsAnimating(){return this.isAnimating}getCurrentState(){return{position:this.getCurrentValue(),velocity:this.getVelocity(),from:this.options.from,to:this.options.to}}setValue(t){this.currentValue=t}setVelocity(t){this.currentVelocity=t}updateOptions(t){this.options={...this.options,...t}}static fromState(t,i){const r=new V(i);return r.setValue(t.position),r.setVelocity(t.velocity),r}}class I extends X{constructor(t){super();d(this,"config");d(this,"animators",new Map);d(this,"springOrder",[]);d(this,"completedCount",0);d(this,"completedAnimators",new Set);d(this,"direction","forward");d(this,"idCounter",0);d(this,"rafId",null);d(this,"from");d(this,"to");this.config=t.config,this.from=t.from,this.to=t.to,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const i=this.generateId(),r=new V({from:this.from,to:this.to,spring:t.spring,tick:t.tick,css:t.css,onComplete:()=>this.onAnimatorComplete(i),onStart:t.onStart});this.animators.set(i,{id:i,item:t,animator:r,started:!1}),this.springOrder.push(i)})}getAnimatorProgress(t){const i=t.animator.getCurrentState(),r=Math.abs(i.to-i.from);return r===0?1:Math.abs(i.position-i.from)/r}getOrderedIds(){return this.direction==="forward"?this.springOrder:[...this.springOrder].reverse()}onAnimatorComplete(t){var r,o,a,c,s,l;const i=this.animators.get(t);!i||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(o=(r=i.item).onComplete)==null||o.call(r),(c=(a=this.config).onProgress)==null||c.call(a,this.completedCount,this.config.springs.length),this.completedCount===this.config.springs.length&&(this.stopScheduler(),(l=(s=this.config).onEnd)==null||l.call(s)))}checkAndStartSprings(){const t=this.getOrderedIds();for(let i=0;i<t.length;i++){const r=t[i],o=this.animators.get(r);if(!o||o.started)continue;if(i===0){this.startAnimator(r);continue}const a=t[i-1],c=this.animators.get(a);if(!c||!c.started)continue;const s=this.getAnimatorProgress(c),l=o.item.normalizedOffset;s>=l&&this.startAnimator(r)}}startAnimator(t){const i=this.animators.get(t);!i||i.started||(i.started=!0,this.direction==="forward"?i.animator.forward():i.animator.backward())}startScheduler(){const t=()=>{this.checkAndStartSprings(),this.getIsAnimating()&&(this.rafId=requestAnimationFrame(t))};t()}stopScheduler(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getFirstAnimator(){var i;const t=this.springOrder[0];return t?((i=this.animators.get(t))==null?void 0:i.animator)??null:null}forward(){var t,i;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}backward(){var t,i;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}resetStartedFlags(){this.animators.forEach(t=>{t.started=!1})}stop(){this.stopScheduler(),this.animators.forEach(t=>{t.animator.stop(),t.started=!1})}reverse(){this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(t=>{if(!t.started)return;const i=t.animator.getCurrentState();if(i.position===i.to){const o=V.fromState({position:this.to,velocity:0},{from:this.to,to:this.from,spring:t.item.spring,tick:t.item.tick,css:t.item.css,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});o.forward(),t.animator=o}else t.animator.reverse()})}getCurrentState(){const t=this.getFirstAnimator();return t?t.getCurrentState():{position:0,velocity:0,from:0,to:1}}getCurrentValue(){const t=this.getFirstAnimator();return(t==null?void 0:t.getCurrentValue())??0}getVelocity(){const t=this.getFirstAnimator();return(t==null?void 0:t.getVelocity())??0}setValue(t){const i=this.getFirstAnimator();i==null||i.setValue(t)}setVelocity(t){const i=this.getFirstAnimator();i==null||i.setVelocity(t)}getIsAnimating(){for(const t of this.animators.values())if(t.animator.getIsAnimating())return!0;return!1}static fromState(t,i){const r=new I(i);return r.setValue(t.position),r.setVelocity(t.velocity),r}}const x=Symbol.for("TRANSITION_STRATEGY"),$=n=>({runIn:async e=>{const{currentAnimation:t}=n;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),e.out)return{config:await e.out,state:{position:r,velocity:o},from:1,to:0,direction:"backward"}}return e.in?{config:await e.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"}},runOut:async e=>{const{currentAnimation:t}=n;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),e.in)return{config:await e.in,state:{position:r,velocity:o},from:0,to:1,direction:"backward"}}return e.out?{config:await e.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}}),K=()=>({runIn:async n=>n.in?{config:await n.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"},runOut:async n=>n.out?{config:await n.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}),F="data-ssgoi-scope",z="data-ssgoi-scope-ready";function ct(){return n=>{if(n)return n.setAttribute(F,""),queueMicrotask(()=>{queueMicrotask(()=>{n.setAttribute(z,"true")})}),()=>{}}}function W(n){return n.hasAttribute(z)}function U(n){return n.closest(`[${F}]`)}function lt(n,e){var w;let t=null,i=null,r=null,o=null;const a={get currentAnimation(){return t}},c=((w=e==null?void 0:e.strategy)==null?void 0:w.call(e,a))||$(a),s=async u=>{var E;i&&(i.remove(),i=null);const h=n(),p=h.in&&h.in(u),S=!(e!=null&&e.strategy)&&h.out?h.out(u):void 0;if(!p)return;const y={in:v.normalizeToMultiSpring(p),out:S?v.normalizeToMultiSpring(S):void 0},m=await c.runIn(y);if(!m.config){t&&(t.direction="in");return}const g=m.config;(E=g.prepare)==null||E.call(g,u),g.wait&&await g.wait();const A=v.normalizeMultiSpringSchedule({...g,onEnd:()=>{var T;t=null,(T=g.onEnd)==null||T.call(g)}},u),C=I.fromState(m.state,{config:A,from:m.from,to:m.to});t={controller:C,direction:"in"},m.direction==="forward"?C.forward():C.backward()},l=async u=>{var T;i=u;const h=n(),p=!(e!=null&&e.strategy)&&h.in?h.in(u):void 0,S=h.out&&h.out(u);if(!S)return;const y={in:p?v.normalizeToMultiSpring(p):void 0,out:v.normalizeToMultiSpring(S)},m=await c.runOut(y);if(!m.config){t&&(t.direction="out"),i&&(i.remove(),i=null);return}const g=m.config;(T=g.prepare)==null||T.call(g,u),E(),g.wait&&await g.wait();const A=v.normalizeMultiSpringSchedule({...g,onEnd:()=>{var R,_;(R=g.onEnd)==null||R.call(g),i&&(i.remove(),i=null),t=null,(_=e==null?void 0:e.onCleanupEnd)==null||_.call(e)}},u),C=I.fromState(m.state,{config:A,from:m.from,to:m.to});t={controller:C,direction:"out"},m.direction==="forward"?C.forward():C.backward();function E(){!r||!i||(o&&r.contains(o)?r.insertBefore(i,o):r.appendChild(i))}};let f=null;return u=>{if(u)return r=u.parentElement,o=u.nextElementSibling,(e==null?void 0:e.scope)==="local"?queueMicrotask(()=>{f=U(u),!(f&&!W(f))&&s(u)}):s(u),()=>{const h=u.isConnected?u.cloneNode(!0):u;f?queueMicrotask(()=>{document.contains(f)&&l(h)}):l(h)}}}const ut=3,ft=n=>{if(!n)return null;const e=n.split(`
2
- `).map(t=>t.trim());for(let t=ut;t<Math.min(e.length,6);t++){const i=e[t],r=i==null?void 0:i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!r)continue;const o=r[1]??"",a=r[2]??"0",c=r[3]??"0";return{file:o.split(/[\\/]/).pop()||o,line:a,column:c}}return null},M=new Map,O=new Map;function dt(n,e,t){M.set(n,e);let i=O.get(n);if(i)return i;const r=e;return i=lt(()=>{const o=M.get(n);return o||(console.warn(`Transition "${String(n)}" not found`),{})},{strategy:t==null?void 0:t.strategy,scope:t==null?void 0:t.scope,onCleanupEnd:()=>{M.get(n)===r&&G(n)}}),O.set(n,i),i}function G(n){M.delete(n),O.delete(n)}function B(){const n=ft(new Error().stack);return n?`auto_${n.file}_${n.line}_${n.column}`:Symbol(`ssgoi_auto_${Date.now()}`)}const L=globalThis.FinalizationRegistry,q=L?new L(n=>{try{G(n)}catch{}}):void 0;function mt(n){const e=n.key??B();if(n.ref&&q)try{q.register(n.ref,e)}catch{}return dt(e,{in:n.in,out:n.out},{strategy:n[x],scope:n.scope})}function ht(n){const e=n.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...n,...e]}function gt(n){let e=!1,t=0,i=0,r=!1;const o=50,a=p=>{if(!n)return;const S=p.touches[0];S&&(r=S.clientX<o,r&&(t=S.clientX,i=S.clientY))},c=p=>{if(!n||!r)return;const S=p.touches[0];if(!S)return;const y=S.clientX-t,m=S.clientY-i;y>window.outerWidth/2-5&&Math.abs(y)>Math.abs(m)?e=!0:e=!1},s=()=>{n&&(r=!1,t=0,i=0)},l=()=>e,f=()=>{typeof window>"u"||n&&(window.addEventListener("touchstart",a,{passive:!0}),window.addEventListener("touchmove",c,{passive:!0}),window.addEventListener("touchend",s,{passive:!0}))},w=()=>{typeof window>"u"||(window.removeEventListener("touchstart",a),window.removeEventListener("touchmove",c),window.removeEventListener("touchend",s))};let u=0;return{initialize:f,cleanup:w,isSwipePending:l,resetSwipeDetection:()=>{u++,u>1&&(u=0,e=!1)}}}const pt=n=>{let e=n.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e),i=t.overflow+t.overflowY+t.overflowX;if(i.includes("auto")||i.includes("scroll")||e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)return e;e=e.parentElement}return document.documentElement},wt=n=>{let e=n.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return e;e=e.parentElement}return document.body};function yt(){let n=null,e=null;const t=new Map;let i=null;const r=()=>{n&&i&&t.set(i,{x:n.scrollLeft,y:n.scrollTop})};return{initializeContext:(f,w)=>{e=f,n||(n=pt(f),(n===document.documentElement?window:n).addEventListener("scroll",r,{passive:!0})),i=w},calculateScrollOffset:(f,w)=>{const u=f&&t.has(f)?t.get(f):{x:0,y:0},h=w&&t.has(w)?t.get(w):{x:0,y:0};return{x:-h.x+u.x,y:-h.y+u.y}},getScrollContainer:()=>n,getPositionedParentElement:()=>e?wt(e):document.body,getScrollPosition:f=>f&&t.has(f)?t.get(f):{x:0,y:0}}}function k(n,e){if(e==="*")return!0;if(e.endsWith("/*")){const t=e.slice(0,-2);return n===t||n.startsWith(t+"/")}return n===e}function St(n,e,t){for(const i of t)if(k(n,i.from)&&k(e,i.to))return i.transition;for(const i of t)if((i.from==="*"||k(n,i.from))&&(i.to==="*"||k(e,i.to)))return i.transition;return null}function vt(n){const{transitions:e=[],defaultTransition:t,middleware:i=(y,m)=>({from:y,to:m}),skipOnIosSwipe:r=!0}=n;let o=null;const a=ht(e),{initializeContext:c,calculateScrollOffset:s,getScrollContainer:l,getPositionedParentElement:f,getScrollPosition:w}=yt(),u=gt(r);u.initialize();function h(){if(o!=null&&o.from&&(o!=null&&o.to)){const{from:y,to:m}=i(o.from,o.to),A=St(y,m,a)||t,C=s(o.from,o.to),E={scrollOffset:C,scroll:w(o.from),get scrollingElement(){return l()||document.documentElement},get positionedParent(){return f()}},T={scrollOffset:C,get scroll(){return o?w(o.to):{x:0,y:0}},get scrollingElement(){return l()||document.documentElement},get positionedParent(){return f()}};A&&(A.out&&o.outResolve&&o.outResolve(R=>A.out(R,E)),A.in&&o.inResolve&&o.inResolve(R=>A.in(R,T))),o=null}}const p=async(y,m)=>u.isSwipePending()?(u.resetSwipeDetection(),()=>({})):m==="in"&&(!o||!o.from)?()=>({}):(o||(o={}),m==="out"?(o.from=y,new Promise(g=>{o.outResolve=g,h()})):(o.to=y,new Promise(g=>{o.inResolve=g,h()})));return y=>({key:y,in:async m=>(c(m,y),(await p(y,"in"))(m)),out:async m=>(await p(y,"out"))(m),[x]:K})}exports.isCssAnimation=v.isCssAnimation;exports.isMultiSpring=v.isMultiSpring;exports.isSingleSpring=v.isSingleSpring;exports.isTickAnimation=v.isTickAnimation;exports.normalizeMultiSpringSchedule=v.normalizeMultiSpringSchedule;exports.normalizeToMultiSpring=v.normalizeToMultiSpring;exports.validateAnimationMode=v.validateAnimationMode;exports.validateSpringItem=v.validateSpringItem;exports.jaeminInternal=Z.jaeminInternal;exports.SCOPE_ATTR=F;exports.SCOPE_READY_ATTR=z;exports.TRANSITION_STRATEGY=x;exports.createDefaultStrategy=$;exports.createPageTransitionStrategy=K;exports.createSggoiTransitionContext=vt;exports.createTransitionScope=ct;exports.findScope=U;exports.generateAutoKey=B;exports.isScopeReady=W;exports.transition=mt;
1
+ "use strict";var rt=Object.defineProperty;var st=(i,e,t)=>e in i?rt(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var m=(i,e,t)=>st(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./types.cjs"),ct=require("./jaemin-BG8HRXG1.cjs");class at{constructor(){m(this,"listeners",new Set);m(this,"rafId",null);m(this,"isRunning",!1);m(this,"startTime",Date.now());m(this,"lastUpdate",this.startTime);m(this,"elapsed",0);m(this,"lagThreshold",500);m(this,"adjustedLag",33);m(this,"maxDeltaTime",33);m(this,"gap",1e3/240);m(this,"nextTime",this.gap);m(this,"tick",()=>{const e=Date.now();let n=e-this.lastUpdate;n>this.lagThreshold||n<0?(this.startTime+=n-this.adjustedLag,n=this.adjustedLag):n>this.maxDeltaTime&&(n=this.maxDeltaTime),this.lastUpdate=e;const r=e-this.startTime,s=r-this.nextTime;if(s>0){const a=n/1e3;this.elapsed=r/1e3,this.nextTime+=s+(s>=this.gap?4:this.gap-s),this.listeners.forEach(o=>{o(a,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(e){return this.listeners.add(e),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(e)}}unsubscribe(e){this.listeners.delete(e),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(e,t){this.lagThreshold=e,this.adjustedLag=Math.min(t,e)}fps(e){this.gap=1e3/e,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const D=new at;function X(i){const e=i.stiffness,t=i.damping,n=1,r=Math.sqrt(e/n),s=t/(2*Math.sqrt(e*n));return{omega:r,zeta:s}}function $(i,e,t,n){const{omega:r,zeta:s}=t,{position:a,velocity:o}=i,c=Math.min(n,.033),u=-2*c*s*r*o,f=c*r*r*(e-a),g=o+u+f;return{position:a+c*g,velocity:g}}const lt=.01,ut=.01,K=.05;function G(i,e){const t=Math.abs(e-i.position),n=Math.abs(i.velocity);return t<lt&&n<ut}function ft(i){const{from:e,to:t,spring:n,velocity:r=0,onUpdate:s,onComplete:a,onStart:o}=i;let c={position:e,velocity:r},u=!0,f=0,g=!1;const y=X(n),S=l=>{if(u){if(g||(g=!0,o==null||o()),c=$(c,t,y,l),G(c,t)){if(f+=Math.min(l,.033),f>=K){c={position:t,velocity:0},u=!1,s(c.position),D.unsubscribe(S),a();return}}else f=0;s(c.position)}};return D.subscribe(S),{stop:()=>{u&&(u=!1,D.unsubscribe(S))},getPosition:()=>c.position,getVelocity:()=>c.velocity,isRunning:()=>u}}const V=1e3/60;function dt(i,e,t,n=0){const r=X(t),s=600;let a={position:i,velocity:n},o=0;const c=[];for(let u=0;u<s;u++){const f=u*V;if(c.push({time:f,position:a.position,velocity:a.velocity}),a=$(a,e,r,V/1e3),G(a,e)){if(o+=V/1e3,o>=K){c.push({time:(u+1)*V,position:e,velocity:0});break}}else o=0}return c}function U(i,e){if(i.length===0)return{position:0,velocity:0};const t=i[0],n=i[i.length-1];if(e<=0)return{position:t.position,velocity:t.velocity};if(e>=n.time)return{position:n.position,velocity:n.velocity};let r=0,s=i.length-1;for(;r<s-1;){const u=Math.floor((r+s)/2);i[u].time<=e?r=u:s=u}const a=i[r],o=i[s],c=(e-a.time)/(o.time-a.time);return{position:a.position+(o.position-a.position)*c,velocity:a.velocity+(o.velocity-a.velocity)*c}}function mt(i,e){return i.map(t=>e(t.position))}function gt(i){const{element:e,from:t,to:n,spring:r,velocity:s=0,style:a,onComplete:o,onStart:c}=i,u=dt(t,n,r,s);if(u.length===0)return c==null||c(),o(),{stop:()=>{},getPosition:()=>n,getVelocity:()=>0,isRunning:()=>!1};const f=mt(u,a),g=u[u.length-1],y=g.time,S=e.animate(f,{duration:y,fill:"forwards",easing:"linear"});let l=!0;const d=performance.now();return c==null||c(),S.onfinish=()=>{l&&(l=!1,o())},{stop:()=>{l&&(l=!1,S.cancel())},getPosition:()=>{if(!l)return g.position;const T=performance.now()-d;return U(u,T).position},getVelocity:()=>{if(!l)return 0;const T=performance.now()-d;return U(u,T).velocity},isRunning:()=>l}}function ht(i){const{from:e,to:t,spring:n,velocity:r,onComplete:s,onStart:a,tick:o,css:c}=i;if(o&&c)throw new Error("Cannot use both 'tick' and 'css' options together");return!o&&!c?(a==null||a(),s(),{stop:()=>{},getPosition:()=>t,getVelocity:()=>0,isRunning:()=>!1}):c?gt({element:c.element,from:e,to:t,spring:n,velocity:r,style:c.style,onComplete:s,onStart:a}):ft({from:e,to:t,spring:n,velocity:r,onUpdate:o,onComplete:s,onStart:a})}class B{}class F extends B{constructor(t){super();m(this,"options");m(this,"controls",null);m(this,"isAnimating",!1);m(this,"currentValue");m(this,"currentVelocity",0);if(t.tick&&t.css)throw new Error("Cannot use both 'tick' and 'css' options together");this.options={from:t.from??0,to:t.to??1,spring:t.spring??{stiffness:300,damping:30},tick:t.tick,css:t.css,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from}runAnimation(t){this.isAnimating=!0,this.controls=ht({from:this.currentValue,to:t,spring:this.options.spring,velocity:this.currentVelocity,tick:this.options.tick,css:this.options.css,onStart:this.options.onStart,onComplete:()=>{this.currentValue=t,this.currentVelocity=0,this.isAnimating=!1,this.controls=null,this.options.onComplete()}})}forward(){this.stop(),this.runAnimation(this.options.to)}backward(){this.stop(),this.runAnimation(this.options.from)}reverse(){const t=this.options.from;this.options.from=this.options.to,this.options.to=t,this.isAnimating&&(this.stop(),this.runAnimation(this.options.to))}stop(){this.controls&&(this.currentValue=this.controls.getPosition(),this.currentVelocity=this.controls.getVelocity(),this.controls.stop(),this.controls=null),this.isAnimating=!1}getVelocity(){var t;return((t=this.controls)==null?void 0:t.getVelocity())??this.currentVelocity}getCurrentValue(){var t;return((t=this.controls)==null?void 0:t.getPosition())??this.currentValue}getIsAnimating(){return this.isAnimating}getCurrentState(){return{position:this.getCurrentValue(),velocity:this.getVelocity(),from:this.options.from,to:this.options.to}}setValue(t){this.currentValue=t}setVelocity(t){this.currentVelocity=t}updateOptions(t){this.options={...this.options,...t}}static fromState(t,n){const r=new F(n);return r.setValue(t.position),r.setVelocity(t.velocity),r}}class z extends B{constructor(t){super();m(this,"config");m(this,"animators",new Map);m(this,"springOrder",[]);m(this,"completedCount",0);m(this,"completedAnimators",new Set);m(this,"direction","forward");m(this,"idCounter",0);m(this,"rafId",null);m(this,"from");m(this,"to");this.config=t.config,this.from=t.from,this.to=t.to,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const n=this.generateId(),r=new F({from:this.from,to:this.to,spring:t.spring,tick:t.tick,css:t.css,onComplete:()=>this.onAnimatorComplete(n),onStart:t.onStart});this.animators.set(n,{id:n,item:t,animator:r,started:!1}),this.springOrder.push(n)})}getAnimatorProgress(t){const n=t.animator.getCurrentState(),r=Math.abs(n.to-n.from);return r===0?1:Math.abs(n.position-n.from)/r}getOrderedIds(){return this.direction==="forward"?this.springOrder:[...this.springOrder].reverse()}onAnimatorComplete(t){var r,s,a,o,c,u;const n=this.animators.get(t);!n||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(s=(r=n.item).onComplete)==null||s.call(r),(o=(a=this.config).onProgress)==null||o.call(a,this.completedCount,this.config.springs.length),this.completedCount===this.config.springs.length&&(this.stopScheduler(),(u=(c=this.config).onEnd)==null||u.call(c)))}checkAndStartSprings(){const t=this.getOrderedIds();for(let n=0;n<t.length;n++){const r=t[n],s=this.animators.get(r);if(!s||s.started)continue;if(n===0){this.startAnimator(r);continue}const a=t[n-1],o=this.animators.get(a);if(!o||!o.started)continue;const c=this.getAnimatorProgress(o),u=s.item.normalizedOffset;c>=u&&this.startAnimator(r)}}startAnimator(t){const n=this.animators.get(t);!n||n.started||(n.started=!0,this.direction==="forward"?n.animator.forward():n.animator.backward())}startScheduler(){const t=()=>{this.checkAndStartSprings(),this.getIsAnimating()&&(this.rafId=requestAnimationFrame(t))};t()}stopScheduler(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getFirstAnimator(){var n;const t=this.springOrder[0];return t?((n=this.animators.get(t))==null?void 0:n.animator)??null:null}forward(){var t,n;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(n=(t=this.config).onStart)==null||n.call(t),this.startScheduler()}backward(){var t,n;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(n=(t=this.config).onStart)==null||n.call(t),this.startScheduler()}resetStartedFlags(){this.animators.forEach(t=>{t.started=!1})}stop(){this.stopScheduler(),this.animators.forEach(t=>{t.animator.stop(),t.started=!1})}reverse(){this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(t=>{if(!t.started)return;const n=t.animator.getCurrentState();if(n.position===n.to){const s=F.fromState({position:this.to,velocity:0},{from:this.to,to:this.from,spring:t.item.spring,tick:t.item.tick,css:t.item.css,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});s.forward(),t.animator=s}else t.animator.reverse()})}getCurrentState(){const t=this.getFirstAnimator();return t?t.getCurrentState():{position:0,velocity:0,from:0,to:1}}getCurrentValue(){const t=this.getFirstAnimator();return(t==null?void 0:t.getCurrentValue())??0}getVelocity(){const t=this.getFirstAnimator();return(t==null?void 0:t.getVelocity())??0}setValue(t){const n=this.getFirstAnimator();n==null||n.setValue(t)}setVelocity(t){const n=this.getFirstAnimator();n==null||n.setVelocity(t)}getIsAnimating(){for(const t of this.animators.values())if(t.animator.getIsAnimating())return!0;return!1}static fromState(t,n){const r=new z(n);return r.setValue(t.position),r.setVelocity(t.velocity),r}}const q=Symbol.for("TRANSITION_STRATEGY"),J=i=>({runIn:async e=>{const{currentAnimation:t}=i;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),s=t.controller.getVelocity();if(t.controller.stop(),e.out)return{config:await e.out,state:{position:r,velocity:s},from:1,to:0,direction:"backward"}}return e.in?{config:await e.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"}},runOut:async e=>{const{currentAnimation:t}=i;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),s=t.controller.getVelocity();if(t.controller.stop(),e.in)return{config:await e.in,state:{position:r,velocity:s},from:0,to:1,direction:"backward"}}return e.out?{config:await e.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}}),Q=()=>({runIn:async i=>i.in?{config:await i.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"},runOut:async i=>i.out?{config:await i.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}),H="data-ssgoi-scope",Y="data-ssgoi-scope-ready";function pt(){return i=>{if(i)return i.setAttribute(H,""),queueMicrotask(()=>{queueMicrotask(()=>{i.setAttribute(Y,"true")})}),()=>{}}}function Z(i){return i.hasAttribute(Y)}function tt(i){return i.closest(`[${H}]`)}function wt(i,e){var S;let t=null,n=null,r=null,s=null;const a={get currentAnimation(){return t}},o=((S=e==null?void 0:e.strategy)==null?void 0:S.call(e,a))||J(a),c=async l=>{var E;n&&(n.remove(),n=null);const d=i(),T=d.in&&d.in(l),M=!(e!=null&&e.strategy)&&d.out?d.out(l):void 0;if(!T)return;const P={in:A.normalizeToMultiSpring(T),out:M?A.normalizeToMultiSpring(M):void 0},v=await o.runIn(P);if(!v.config){t&&(t.direction="in");return}const p=v.config;(E=p.prepare)==null||E.call(p,l),p.wait&&await p.wait();const w=A.normalizeMultiSpringSchedule({...p,onEnd:()=>{var C;t=null,(C=p.onEnd)==null||C.call(p)}},l),h=z.fromState(v.state,{config:w,from:v.from,to:v.to});t={controller:h,direction:"in"},v.direction==="forward"?h.forward():h.backward()},u=async l=>{var C;n=l;const d=i(),T=!(e!=null&&e.strategy)&&d.in?d.in(l):void 0,M=d.out&&d.out(l);if(!M)return;const P={in:T?A.normalizeToMultiSpring(T):void 0,out:A.normalizeToMultiSpring(M)},v=await o.runOut(P);if(!v.config){t&&(t.direction="out"),n&&(n.remove(),n=null);return}const p=v.config;(C=p.prepare)==null||C.call(p,l),E(),p.wait&&await p.wait();const w=A.normalizeMultiSpringSchedule({...p,onEnd:()=>{var k,I;(k=p.onEnd)==null||k.call(p),n&&(n.remove(),n=null),t=null,(I=e==null?void 0:e.onCleanupEnd)==null||I.call(e)}},l),h=z.fromState(v.state,{config:w,from:v.from,to:v.to});t={controller:h,direction:"out"},v.direction==="forward"?h.forward():h.backward();function E(){!r||!n||(s&&r.contains(s)?r.insertBefore(n,s):r.appendChild(n))}};let f=null,g=!1;const y=l=>()=>{if(g)return;g=!0;const d=l.cloneNode(!0);f?queueMicrotask(()=>{document.contains(f)&&u(d)}):u(d)};return l=>{if(l)return r=l.parentElement,s=l.nextElementSibling,g=!1,(e==null?void 0:e.scope)==="local"?queueMicrotask(()=>{f=tt(l),!(f&&!Z(f))&&c(l)}):c(l),y(l)}}const yt=3,St=i=>{if(!i)return null;const e=i.split(`
2
+ `).map(t=>t.trim());for(let t=yt;t<Math.min(e.length,6);t++){const n=e[t],r=n==null?void 0:n.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!r)continue;const s=r[1]??"",a=r[2]??"0",o=r[3]??"0";return{file:s.split(/[\\/]/).pop()||s,line:a,column:o}}return null},x=new Map,_=new Map;function vt(i,e,t){x.set(i,e);let n=_.get(i);if(n)return n;const r=e;return n=wt(()=>{const s=x.get(i);return s||(console.warn(`Transition "${String(i)}" not found`),{})},{strategy:t==null?void 0:t.strategy,scope:t==null?void 0:t.scope,onCleanupEnd:()=>{x.get(i)===r&&et(i)}}),_.set(i,n),n}function et(i){x.delete(i),_.delete(i)}function nt(){const i=St(new Error().stack);return i?`auto_${i.file}_${i.line}_${i.column}`:Symbol(`ssgoi_auto_${Date.now()}`)}const W=globalThis.FinalizationRegistry,j=W?new W(i=>{try{et(i)}catch{}}):void 0;function Ct(i){const e=i.key??nt();if(i.ref&&j)try{j.register(i.ref,e)}catch{}return vt(e,{in:i.in,out:i.out},{strategy:i[q],scope:i.scope})}const R=new Map;let b=null,N=!1;function it(i){if(i instanceof HTMLElement&&R.has(i)){const t=R.get(i);R.delete(i),queueMicrotask(()=>{t()})}const e=i.childNodes;for(let t=0;t<e.length;t++){const n=e[t];n&&it(n)}}function Tt(){N||typeof document>"u"||(N=!0,b=new MutationObserver(i=>{for(const e of i){const t=e.removedNodes;for(let n=0;n<t.length;n++){const r=t[n];r&&it(r)}}}),document.body?b.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{b==null||b.observe(document.body,{childList:!0,subtree:!0})},{once:!0}))}function At(i,e){Tt(),R.set(i,e)}function Et(i){return R.has(i)}function bt(){return R.size}function Rt(i){const e=R.get(i);return e?(R.delete(i),e(),!0):!1}function Mt(){R.clear(),b==null||b.disconnect(),b=null,N=!1}function kt(i){const e=i.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...i,...e]}function Pt(i){let e=!1,t=0,n=0,r=!1;const s=50,a=l=>{if(!i)return;const d=l.touches[0];d&&(r=d.clientX<s,r&&(t=d.clientX,n=d.clientY))},o=l=>{if(!i||!r)return;const d=l.touches[0];if(!d)return;const T=d.clientX-t,M=d.clientY-n;T>window.outerWidth/2-5&&Math.abs(T)>Math.abs(M)?e=!0:e=!1},c=()=>{i&&(r=!1,t=0,n=0)},u=()=>e,f=()=>{typeof window>"u"||i&&(window.addEventListener("touchstart",a,{passive:!0}),window.addEventListener("touchmove",o,{passive:!0}),window.addEventListener("touchend",c,{passive:!0}))},g=()=>{typeof window>"u"||(window.removeEventListener("touchstart",a),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",c))};let y=0;return{initialize:f,cleanup:g,isSwipePending:u,resetSwipeDetection:()=>{y++,y>1&&(y=0,e=!1)}}}const It=i=>{let e=i.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e),n=t.overflow+t.overflowY+t.overflowX;if(n.includes("auto")||n.includes("scroll")||e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)return e;e=e.parentElement}return document.documentElement},Vt=i=>{let e=i.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return e;e=e.parentElement}return document.body};function Ot(){let i=null,e=null;const t=new Map;let n=null;const r=()=>{i&&n&&t.set(n,{x:i.scrollLeft,y:i.scrollTop})};return{initializeContext:(f,g)=>{e=f,i||(i=It(f),(i===document.documentElement?window:i).addEventListener("scroll",r,{passive:!0})),n=g},calculateScrollOffset:(f,g)=>{const y=f&&t.has(f)?t.get(f):{x:0,y:0},S=g&&t.has(g)?t.get(g):{x:0,y:0};return{x:-S.x+y.x,y:-S.y+y.y}},getScrollContainer:()=>i,getPositionedParentElement:()=>e?Vt(e):document.body,getScrollPosition:f=>f&&t.has(f)?t.get(f):{x:0,y:0}}}function O(i,e){if(e==="*")return!0;if(e.endsWith("/*")){const t=e.slice(0,-2);return i===t||i.startsWith(t+"/")}return i===e}function xt(i,e,t){for(const n of t)if(O(i,n.from)&&O(e,n.to))return n.transition;for(const n of t)if((n.from==="*"||O(i,n.from))&&(n.to==="*"||O(e,n.to)))return n.transition;return null}function Ft(i,e){const{transitions:t=[],defaultTransition:n,middleware:r=(w,h)=>({from:w,to:h}),skipOnIosSwipe:s=!0}=i,{outFirst:a=!0}=e||{};let o=null;const c=kt(t),{initializeContext:u,calculateScrollOffset:f,getScrollContainer:g,getPositionedParentElement:y,getScrollPosition:S}=Ot(),l=Pt(s);l.initialize();function d(){if(o!=null&&o.from&&(o!=null&&o.to)){const{from:w,to:h}=r(o.from,o.to),C=xt(w,h,c)||n,k=f(o.from,o.to),I={scrollOffset:k,scroll:S(o.from),get scrollingElement(){return g()||document.documentElement},get positionedParent(){return y()}},ot={scrollOffset:k,get scroll(){return o?S(o.to):{x:0,y:0}},get scrollingElement(){return g()||document.documentElement},get positionedParent(){return y()}};C&&(C.out&&o.outResolve&&o.outResolve(L=>C.out(L,I)),C.in&&o.inResolve&&o.inResolve(L=>C.in(L,ot))),o=null}}function T(){o&&(o.inResolve&&o.inResolve(()=>({})),o.outResolve&&o.outResolve(()=>({})),o=null)}const v=a?async(w,h)=>l.isSwipePending()?(l.resetSwipeDetection(),()=>({})):h==="in"&&(!o||!o.from)?()=>({}):(o||(o={}),h==="out"?(o.from=w,new Promise(E=>{o.outResolve=E,d()})):(o.to=w,new Promise(E=>{o.inResolve=E,d()}))):async(w,h)=>l.isSwipePending()?(l.resetSwipeDetection(),()=>({})):(o&&(h==="out"&&o.from&&o.from!==w||h==="in"&&o.to&&o.to!==w)&&T(),o||(o={}),h==="out"?(o.from=w,new Promise(C=>{o.outResolve=C,d()})):(o.to=w,new Promise(C=>{o.inResolve=C,d()})));return w=>({key:w,in:async h=>(u(h,w),(await v(w,"in"))(h)),out:async h=>(await v(w,"out"))(h),[q]:Q})}exports.isCssAnimation=A.isCssAnimation;exports.isMultiSpring=A.isMultiSpring;exports.isSingleSpring=A.isSingleSpring;exports.isTickAnimation=A.isTickAnimation;exports.normalizeMultiSpringSchedule=A.normalizeMultiSpringSchedule;exports.normalizeToMultiSpring=A.normalizeToMultiSpring;exports.validateAnimationMode=A.validateAnimationMode;exports.validateSpringItem=A.validateSpringItem;exports.jaeminInternal=ct.jaeminInternal;exports.SCOPE_ATTR=H;exports.SCOPE_READY_ATTR=Y;exports.TRANSITION_STRATEGY=q;exports.createDefaultStrategy=J;exports.createPageTransitionStrategy=Q;exports.createSggoiTransitionContext=Ft;exports.createTransitionScope=pt;exports.findScope=tt;exports.generateAutoKey=nt;exports.getWatchedCount=bt;exports.isScopeReady=Z;exports.isWatched=Et;exports.resetObserver=Mt;exports.transition=Ct;exports.triggerUnmount=Rt;exports.watchUnmount=At;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './types';
2
2
  export * from './transition/transition';
3
3
  export * from './transition/transition-scope';
4
+ export * from './transition/unmount-observer';
4
5
  export * from './ssgoi-transition/create-ssgoi-transition-context';
5
6
  export * from './transition/transition-strategy';
6
7
  export { jaeminInternal } from './view-transitions/jaemin';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oDAAoD,CAAC;AACnE,cAAc,kCAAkC,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oDAAoD,CAAC;AACnE,cAAc,kCAAkC,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}