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AAA,CAAQ,KAAK,YAAY,CAAA;AAAA,EAC3B;AAGA,EAAA,IAAI,eAAe,MAAA,EAAQ;AACzB,IAAA,IAAI,YAAY,OAAA,EAAS;AACvB,MAAA,OAAA,CAAQ,KAAK,4BAA4B,CAAA;AAAA,IAC3C,CAAA,MAAA,IAAW,YAAY,MAAA,EAAQ;AAC7B,MAAA,OAAA,CAAQ,KAAK,2BAA2B,CAAA;AAAA,IAC1C,CAAA,MAAO;AACL,MAAA,OAAA,CAAQ,KAAK,4BAA4B,CAAA;AAAA,IAC3C;AAAA,EACF;AAEA,EAAA,OAAO,OAAA,CAAQ,KAAK,GAAG,CAAA;AACzB;AAgBO,SAAS,mBAAA,GAA4B;AAC1C,EAAA,IAAI,OAAO,aAAa,WAAA,EAAa;AACnC,IAAA;AAAA,EACF;AAGA,EAAA,MAAM,aAAA,GAAgB,QAAA,CAAS,cAAA,CAAe,2BAA2B,CAAA;AACzE,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,YAAA,GAAe,QAAA,CAAS,aAAA,CAAc,OAAO,CAAA;AACnD,EAAA,YAAA,CAAa,EAAA,GAAK,2BAAA;AAClB,EAAA,YAAA,CAAa,WAAA,GAAc,aAAA;AAC3B,EAAA,QAAA,CAAS,IAAA,CAAK,YAAY,YAAY,CAAA;AACxC;AAKO,SAAS,mBAAA,GAA4B;AAC1C,EAAA,IAAI,OAAO,aAAa,WAAA,EAAa;AACnC,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,YAAA,GAAe,QAAA,CAAS,cAAA,CAAe,2BAA2B,CAAA;AACxE,EAAA,IAAI,YAAA,EAAc;AAChB,IAAA,YAAA,CAAa,MAAA,EAAO;AAAA,EACtB;AACF","file":"chunk-PLCTGVWN.mjs","sourcesContent":["/**\n * CSS-only animation fallback system\n *\n * Provides CSS keyframe animations that mirror the motion types.\n * Use this for projects that don't want the Motion dependency.\n */\n\n/**\n * CSS animation keyframes for each motion type\n */\nexport const cssKeyframes = `\n/* MotionIcon CSS Animations */\n\n/* Scale animation */\n@keyframes motionicon-scale {\n  0%, 100% { transform: scale(1); }\n  50% { transform: scale(1.15); }\n}\n\n/* Rotate animation */\n@keyframes motionicon-rotate {\n  from { transform: rotate(0deg); }\n  to { transform: rotate(180deg); }\n}\n\n/* Translate animation */\n@keyframes motionicon-translate {\n  0%, 100% { transform: translate(0, 0); }\n  50% { transform: translate(2px, -2px); }\n}\n\n/* Shake animation */\n@keyframes motionicon-shake {\n  0%, 100% { transform: translateX(0); }\n  20% { transform: translateX(-3px); }\n  40% { transform: translateX(3px); }\n  60% { transform: translateX(-3px); }\n  80% { transform: translateX(3px); }\n}\n\n/* Pulse animation */\n@keyframes motionicon-pulse {\n  0%, 100% { transform: scale(1); opacity: 1; }\n  50% { transform: scale(1.1); opacity: 0.8; }\n}\n\n/* Bounce animation */\n@keyframes motionicon-bounce {\n  0%, 100% { transform: translateY(0); }\n  50% { transform: translateY(-6px); }\n}\n\n/* Draw animation (opacity/scale fallback) */\n@keyframes motionicon-draw {\n  0% { opacity: 0.4; transform: scale(0.9); }\n  100% { opacity: 1; transform: scale(1); }\n}\n\n/* Spin animation */\n@keyframes motionicon-spin {\n  from { transform: rotate(0deg); }\n  to { transform: rotate(360deg); }\n}\n\n/* Fade animation */\n@keyframes motionicon-fade {\n  0% { opacity: 0.6; }\n  100% { opacity: 1; }\n}\n\n/* Pop animation */\n@keyframes motionicon-pop {\n  0%, 100% { transform: scale(1) rotate(0deg); }\n  50% { transform: scale(1.15) rotate(5deg); }\n}\n\n/* Wiggle animation (custom) */\n@keyframes motionicon-wiggle {\n  0%, 100% { transform: rotate(0deg); }\n  15% { transform: rotate(-12deg); }\n  30% { transform: rotate(12deg); }\n  45% { transform: rotate(-8deg); }\n  60% { transform: rotate(8deg); }\n  75% { transform: rotate(-4deg); }\n  90% { transform: rotate(4deg); }\n}\n\n/* Heartbeat animation (custom) */\n@keyframes motionicon-heartbeat {\n  0%, 100% { transform: scale(1); }\n  14% { transform: scale(1.15); }\n  28% { transform: scale(1); }\n  42% { transform: scale(1.1); }\n}\n\n/* Swing animation (custom) */\n@keyframes motionicon-swing {\n  0%, 100% { transform: rotate(0deg); }\n  20% { transform: rotate(15deg); }\n  40% { transform: rotate(-10deg); }\n  60% { transform: rotate(5deg); }\n  80% { transform: rotate(-5deg); }\n}\n\n/* Float animation (custom) */\n@keyframes motionicon-float {\n  0%, 100% { transform: translateY(0); }\n  50% { transform: translateY(-8px); }\n}\n\n/* Path drawing animation for SVG strokes */\n@keyframes motionicon-draw-path {\n  0% { stroke-dashoffset: var(--path-length, 100); opacity: 0.3; }\n  100% { stroke-dashoffset: 0; opacity: 1; }\n}\n\n/* Path drawing loop animation */\n@keyframes motionicon-draw-path-loop {\n  0% { stroke-dashoffset: var(--path-length, 100); opacity: 0.5; }\n  40% { stroke-dashoffset: 0; opacity: 1; }\n  60% { stroke-dashoffset: 0; opacity: 1; }\n  100% { stroke-dashoffset: var(--path-length, 100); opacity: 0.5; }\n}\n`;\n\n/**\n * CSS classes for each motion type\n */\nexport const cssAnimationClasses = `\n/* MotionIcon CSS Animation Classes */\n\n/* Base hover animation behavior */\n.motionicon-animated {\n  transition: transform 0.2s ease;\n}\n\n/* Scale on hover */\n.motionicon-scale:hover {\n  animation: motionicon-scale 0.3s ease forwards;\n}\n\n/* Rotate on hover */\n.motionicon-rotate:hover {\n  animation: motionicon-rotate 0.4s ease forwards;\n}\n\n/* Translate on hover */\n.motionicon-translate:hover {\n  animation: motionicon-translate 0.3s ease forwards;\n}\n\n/* Shake on hover */\n.motionicon-shake:hover {\n  animation: motionicon-shake 0.4s ease;\n}\n\n/* Pulse loop */\n.motionicon-pulse {\n  animation: motionicon-pulse 0.6s ease-in-out infinite;\n}\n\n/* Bounce on hover */\n.motionicon-bounce:hover {\n  animation: motionicon-bounce 0.4s ease;\n}\n\n/* Draw on hover */\n.motionicon-draw:hover {\n  animation: motionicon-draw 0.5s ease forwards;\n}\n\n/* Spin continuous */\n.motionicon-spin {\n  animation: motionicon-spin 0.8s linear infinite;\n}\n\n/* Fade on hover */\n.motionicon-fade {\n  opacity: 0.6;\n  transition: opacity 0.2s ease;\n}\n.motionicon-fade:hover {\n  opacity: 1;\n}\n\n/* Pop on hover */\n.motionicon-pop:hover {\n  animation: motionicon-pop 0.3s ease forwards;\n}\n\n/* Wiggle on hover */\n.motionicon-wiggle:hover {\n  animation: motionicon-wiggle 0.6s ease;\n}\n\n/* Heartbeat on hover */\n.motionicon-heartbeat:hover {\n  animation: motionicon-heartbeat 0.8s ease;\n}\n\n/* Swing on hover */\n.motionicon-swing:hover {\n  animation: motionicon-swing 0.6s ease;\n}\n\n/* Float continuous */\n.motionicon-float {\n  animation: motionicon-float 1.5s ease-in-out infinite;\n}\n\n/* Trigger modes */\n.motionicon-trigger-hover:hover {\n  animation-play-state: running;\n}\n\n.motionicon-trigger-loop {\n  animation-iteration-count: infinite;\n}\n\n.motionicon-trigger-mount {\n  animation-iteration-count: 1;\n  animation-fill-mode: forwards;\n}\n\n/* SVG path drawing */\n.motionicon-draw-path {\n  stroke-dasharray: var(--path-length, 100);\n  stroke-dashoffset: var(--path-length, 100);\n}\n\n.motionicon-draw-path-hover:hover .motionicon-draw-path {\n  animation: motionicon-draw-path 1.5s ease-in-out forwards;\n}\n\n.motionicon-draw-path-loop .motionicon-draw-path {\n  animation: motionicon-draw-path-loop 3s ease-in-out infinite;\n}\n\n.motionicon-draw-path-mount .motionicon-draw-path {\n  animation: motionicon-draw-path 1.5s ease-in-out forwards;\n}\n\n/* Reduced motion support */\n@media (prefers-reduced-motion: reduce) {\n  .motionicon-animated,\n  .motionicon-scale,\n  .motionicon-rotate,\n  .motionicon-translate,\n  .motionicon-shake,\n  .motionicon-pulse,\n  .motionicon-bounce,\n  .motionicon-draw,\n  .motionicon-spin,\n  .motionicon-fade,\n  .motionicon-pop,\n  .motionicon-wiggle,\n  .motionicon-heartbeat,\n  .motionicon-swing,\n  .motionicon-float {\n    animation: none !important;\n    transition: none !important;\n  }\n}\n`;\n\n/**\n * Complete CSS stylesheet with keyframes and classes\n */\nexport const cssStylesheet = `${cssKeyframes}\\n${cssAnimationClasses}`;\n\n/**\n * Map of motion type to CSS class name\n */\nexport const motionTypeToCssClass: Record<string, string> = {\n  scale: 'motionicon-scale',\n  rotate: 'motionicon-rotate',\n  translate: 'motionicon-translate',\n  shake: 'motionicon-shake',\n  pulse: 'motionicon-pulse',\n  bounce: 'motionicon-bounce',\n  draw: 'motionicon-draw',\n  spin: 'motionicon-spin',\n  fade: 'motionicon-fade',\n  pop: 'motionicon-pop',\n  none: '',\n  // Custom presets\n  wiggle: 'motionicon-wiggle',\n  heartbeat: 'motionicon-heartbeat',\n  swing: 'motionicon-swing',\n  float: 'motionicon-float'\n};\n\n/**\n * Map of trigger type to CSS class modifier\n */\nexport const triggerTypeToCssClass: Record<string, string> = {\n  hover: 'motionicon-trigger-hover',\n  loop: 'motionicon-trigger-loop',\n  mount: 'motionicon-trigger-mount',\n  inView: 'motionicon-trigger-mount' // Falls back to mount for CSS\n};\n\n/**\n * Get CSS classes for an icon based on motion type and trigger\n *\n * @param motionType - The type of animation\n * @param trigger - When to trigger the animation\n * @returns Space-separated CSS class string\n */\nexport function getCssAnimationClasses(\n  motionType: string = 'scale',\n  trigger: string = 'hover'\n): string {\n  const classes: string[] = ['motionicon-animated'];\n\n  const motionClass = motionTypeToCssClass[motionType];\n  if (motionClass) {\n    classes.push(motionClass);\n  }\n\n  const triggerClass = triggerTypeToCssClass[trigger];\n  if (triggerClass) {\n    classes.push(triggerClass);\n  }\n\n  // Special handling for draw animation with different triggers\n  if (motionType === 'draw') {\n    if (trigger === 'hover') {\n      classes.push('motionicon-draw-path-hover');\n    } else if (trigger === 'loop') {\n      classes.push('motionicon-draw-path-loop');\n    } else {\n      classes.push('motionicon-draw-path-mount');\n    }\n  }\n\n  return classes.join(' ');\n}\n\n/**\n * Inject CSS animations into the document head\n *\n * Call this once at app initialization to enable CSS animations.\n * Only runs in browser environment.\n *\n * @example\n * ```tsx\n * // In your app entry point\n * import { injectCssAnimations } from 'motionicon/css';\n *\n * injectCssAnimations();\n * ```\n */\nexport function injectCssAnimations(): void {\n  if (typeof document === 'undefined') {\n    return;\n  }\n\n  // Check if already injected\n  const existingStyle = document.getElementById('motionicon-css-animations');\n  if (existingStyle) {\n    return;\n  }\n\n  const styleElement = document.createElement('style');\n  styleElement.id = 'motionicon-css-animations';\n  styleElement.textContent = cssStylesheet;\n  document.head.appendChild(styleElement);\n}\n\n/**\n * Remove injected CSS animations from the document\n */\nexport function removeCssAnimations(): void {\n  if (typeof document === 'undefined') {\n    return;\n  }\n\n  const styleElement = document.getElementById('motionicon-css-animations');\n  if (styleElement) {\n    styleElement.remove();\n  }\n}\n"]}