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,YAAc,KAC1G,EAAQ,QAAQ,IACd,EAAS,KAAK,CACZ,UACA,SAAU,IAAM,EAAQ,UAAU,IAAI,WAAY,GAClD,QAAU,QAIT,CACT,EAEA,OAAM,IACG,CAAC,CACN,QAAS,SAAS,cAAc,WAChC,OAAS,CAAE,QAAS","file":"/npm/hexo-theme-next@8.29.0/source/js/motion.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/hexo-theme-next@8.29.0/source/js/motion.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/* global NexT, CONFIG */\n\nNexT.motion = {};\n\nNexT.motion.integrator = {\n  queue: [],\n  init() {\n    this.queue = [];\n    return this;\n  },\n  add(fn) {\n    const sequence = fn();\n    this.queue.push(sequence);\n    return this;\n  },\n  bootstrap() {\n    if (typeof Element.prototype.animate !== 'function') {\n      document.body.classList.remove('use-motion');\n      CONFIG.motion.enable = false;\n      return;\n    }\n    if (!CONFIG.motion.async) this.queue = [this.queue.flat()];\n    this.queue.forEach(sequence => this.schedule(sequence));\n  },\n  schedule(sequence) {\n    let cursor = 0;\n    sequence.forEach(item => {\n      const duration = item.duration ?? CONFIG.motion?.duration ?? 200;\n      const start = Math.max(0, cursor - (item.overlap ?? 0));\n      const end = start + duration;\n      cursor = Math.max(cursor, end);\n\n      if (item.styles) {\n        const targets = typeof item.targets === 'string' ? document.querySelectorAll(item.targets) : [item.targets].filter(Boolean);\n        targets.forEach(target => {\n          const animation = target.animate([{}, item.styles], {\n            delay : start,\n            duration,\n            easing: 'linear',\n            fill  : 'forwards'\n          });\n          animation.finished.then(() => {\n            Object.assign(target.style, item.styles);\n            animation.cancel();\n          }).catch(() => {});\n        });\n      }\n      if (item.complete) setTimeout(item.complete, end);\n    });\n  }\n};\n\nNexT.motion.middleWares = {\n  header() {\n    const sequence = [];\n\n    function getMistLineSettings(targets) {\n      sequence.push({\n        targets,\n        styles  : { transform: 'scaleX(1)' },\n        duration: 500,\n        overlap : 200\n      });\n    }\n\n    function pushToSequence(targets, sequenceQueue = false) {\n      sequence.push({\n        targets,\n        styles : { opacity: 1, top: '0px' },\n        overlap: sequenceQueue ? 200 : 0\n      });\n    }\n\n    pushToSequence('.column');\n    CONFIG.scheme === 'Mist' && getMistLineSettings('.logo-line');\n    CONFIG.scheme === 'Muse' && pushToSequence('.custom-logo-image');\n    pushToSequence('.site-title');\n    pushToSequence('.site-brand-container .toggle', true);\n    pushToSequence('.site-subtitle');\n    (CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') && pushToSequence('.custom-logo-image');\n\n    const menuItemTransition = CONFIG.motion.transition.menu_item;\n    if (menuItemTransition) {\n      document.querySelectorAll('.menu-item').forEach(targets => {\n        sequence.push({\n          targets,\n          complete: () => targets.classList.add('animated', menuItemTransition),\n          overlap : 200\n        });\n      });\n    }\n\n    return sequence;\n  },\n\n  subMenu() {\n    const subMenuItem = document.querySelectorAll('.sub-menu .menu-item');\n    if (subMenuItem.length > 0) {\n      subMenuItem.forEach(element => {\n        element.classList.add('animated');\n      });\n    }\n    return [];\n  },\n\n  postList() {\n    const sequence = [];\n    const { post_block, post_header, post_body, coll_header } = CONFIG.motion.transition;\n\n    function animate(animation, elements) {\n      if (!animation) return;\n      elements.forEach(targets => {\n        sequence.push({\n          targets,\n          complete: () => targets.classList.add('animated', animation),\n          overlap : 100\n        });\n      });\n    }\n\n    document.querySelectorAll('.post-block').forEach(targets => {\n      sequence.push({\n        targets,\n        complete: () => targets.classList.add('animated', post_block),\n        overlap : 100\n      });\n      animate(coll_header, targets.querySelectorAll('.collection-header'));\n      animate(post_header, targets.querySelectorAll('.post-header'));\n      animate(post_body, targets.querySelectorAll('.post-body'));\n    });\n\n    animate(post_block, document.querySelectorAll('.pagination, .comments'));\n\n    return sequence;\n  },\n\n  sidebar() {\n    const sequence = [];\n    const sidebar = document.querySelectorAll('.sidebar-inner');\n    const sidebarTransition = CONFIG.motion.transition.sidebar;\n    // Only for desktop of Pisces | Gemini.\n    if (sidebarTransition && (CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') && window.innerWidth >= 992) {\n      sidebar.forEach(targets => {\n        sequence.push({\n          targets,\n          complete: () => targets.classList.add('animated', sidebarTransition),\n          overlap : 100\n        });\n      });\n    }\n    return sequence;\n  },\n\n  footer() {\n    return [{\n      targets: document.querySelector('.footer'),\n      styles : { opacity: 1 }\n    }];\n  }\n};\n"]}