ecplayer 1.0.9 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".ecp-full-width{width:100%}.ecp-h-full{height:100%}.ecp-relative{position:relative}.ecp-absolute{position:absolute}.ecp-inset-0{top:0;right:0;bottom:0;left:0}.ecp-z-10{z-index:10}.ecp-flex{display:flex}.ecp-inline-flex{display:inline-flex}.ecp-flex-col{flex-direction:column}.ecp-flex-wrap{flex-wrap:wrap}.ecp-flex-1{flex:1 1 0%}.ecp-flex-shrink-0{flex-shrink:0}.ecp-grid{display:grid}.ecp-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.ecp-hidden{display:none}.ecp-items-center{align-items:center}.ecp-items-end{align-items:flex-end}.ecp-items-start{align-items:flex-start}.ecp-justify-center{justify-content:center}.ecp-justify-between{justify-content:space-between}.ecp-justify-end{justify-content:flex-end}.ecp-justify-start{justify-content:flex-start}.ecp-text-center{text-align:center}.ecp-text-right{text-align:right}.ecp-self-center{align-self:center}.ecp-gap-1{gap:.25rem}.ecp-gap-2{gap:.5rem}.ecp-gap-3{gap:.75rem}.ecp-gap-px{gap:1px}.ecp-gap-05{gap:2px}.ecp-mb-1{margin-bottom:.25rem}.ecp-mb-2{margin-bottom:.5rem}.ecp-mb-4{margin-bottom:1rem}.ecp-mb-6{margin-bottom:1.5rem}.ecp-mr-2{margin-right:.5rem}.ecp-mt-4{margin-top:1rem}.ecp-mt-6{margin-top:1.5rem}.ecp-ml-auto{margin-left:auto}.ecp-p-1{padding:.25rem}.ecp-p-1-5{padding:.375rem}.ecp-p-2{padding:.5rem}.ecp-p-3{padding:.75rem}.ecp-p-4{padding:1rem}.ecp-p-6{padding:1.5rem}.ecp-p-8{padding:2rem}.ecp-px-2{padding-left:.5rem;padding-right:.5rem}.ecp-px-3{padding-left:.75rem;padding-right:.75rem}.ecp-px-4{padding-left:1rem;padding-right:1rem}.ecp-px-6{padding-left:1.5rem;padding-right:1.5rem}.ecp-py-1{padding-top:.25rem;padding-bottom:.25rem}.ecp-py-2{padding-top:.5rem;padding-bottom:.5rem}.ecp-py-3{padding-top:.75rem;padding-bottom:.75rem}.ecp-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.ecp-pb-2{padding-bottom:.5rem}.ecp-pt-2{padding-top:.5rem}.ecp-w-1{width:.25rem}.ecp-w-3{width:.75rem}.ecp-w-4{width:1rem}.ecp-w-10{width:2.5rem}.ecp-w-12{width:3rem}.ecp-w-20{width:5rem}.ecp-w-24{width:6rem}.ecp-w-px{width:1px}.ecp-w-full{width:100%}.ecp-max-w-xs{max-width:20rem}.ecp-max-w-lg{max-width:32rem}.ecp-max-w-4xl{max-width:56rem}.ecp-h-0-5{height:.125rem}.ecp-h-1{height:.25rem}.ecp-h-1-5{height:.375rem}.ecp-h-2{height:.5rem}.ecp-h-3{height:.75rem}.ecp-h-4{height:1rem}.ecp-h-6{height:1.5rem}.ecp-h-8{height:2rem}.ecp-h-10{height:2.5rem}.ecp-h-12{height:3rem}.ecp-h-20{height:5rem}.ecp-h-40{width:10rem;height:40px}.ecp-h-64{height:16rem}.ecp-h-screen{height:100vh}.ecp-min-h-screen{min-height:100vh}.ecp-min-h-0{min-height:0}.ecp-min-w-12{min-width:3rem}.ecp-min-w-0{min-width:0}.ecp-aspect-square{aspect-ratio:1 / 1}.ecp-text-xs{font-size:.75rem;line-height:1rem}.ecp-text-sm{font-size:.875rem;line-height:1.25rem}.ecp-text-lg{font-size:1.125rem;line-height:1.75rem}.ecp-text-2xl{font-size:1.5rem;line-height:2rem}.ecp-font-medium{font-weight:500}.ecp-font-semibold{font-weight:600}.ecp-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}.ecp-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ecp-text-white{color:#fff}.ecp-text-transparent{color:transparent}.ecp-text-gray-400{color:#9ca3af}.ecp-text-gray-500{color:#6b7280}.ecp-text-gray-600{color:#4b5563}.ecp-text-gray-700{color:#374151}.ecp-text-gray-800{color:#1f2937}.ecp-text-gray-100{color:#f3f4f6}.ecp-text-gray-200{color:#e5e7eb}.ecp-text-gray-300{color:#d1d5db}.ecp-text-red-500{color:#ef4444}.ecp-dark .ecp-text-dark-100{color:#f3f4f6}.ecp-dark .ecp-text-dark-200{color:#e5e7eb}.ecp-dark .ecp-text-dark-300{color:#d1d5db}.ecp-bg-white{background-color:#fff}.ecp-bg-black-20{background-color:#0003}.ecp-bg-black-30{background-color:#0000004d}.ecp-bg-black-40{background-color:#0006}.ecp-bg-black-50{background-color:#00000080}.ecp-bg-gray-100{background-color:#f3f4f6}.ecp-bg-gray-200{background-color:#e5e7eb}.ecp-bg-gray-300{background-color:#d1d5db}.ecp-bg-gray-700{background-color:#374151}.ecp-bg-gray-800{background-color:#1f2937}.ecp-bg-red-50{background-color:#fef2f2}.ecp-bg-transparent{background-color:transparent}.ecp-border{border-width:1px}.ecp-border-2{border-width:2px}.ecp-border-r{border-right-width:1px}.ecp-border-transparent{border-color:transparent}.ecp-border-gray-300{border-color:#d1d5db}.ecp-border-red-300{border-color:#fca5a5}.ecp-border-current{border-color:currentColor}.ecp-border-none{border:none}.ecp-outline-none{outline:none}.ecp-rounded{border-radius:.25rem}.ecp-rounded-lg{border-radius:.5rem}.ecp-rounded-xl{border-radius:.75rem}.ecp-rounded-2xl{border-radius:1rem}.ecp-rounded-full{border-radius:9999px}.ecp-rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.ecp-shadow-sm{box-shadow:0 1px 2px #0000000d}.ecp-shadow-lg{box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a}.ecp-shadow-2xl{box-shadow:0 25px 50px -12px #00000040}.ecp-opacity-20{opacity:.2}.ecp-opacity-40{opacity:.4}.ecp-opacity-70{opacity:.7}.ecp-opacity-80{opacity:.8}.ecp-cursor-pointer{cursor:pointer}.ecp-cursor-not-allowed{cursor:not-allowed}.ecp-pointer-events-none{pointer-events:none}.ecp-transition{transition-property:color,background-color,border-color,opacity,box-shadow,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ecp-transition-all{transition:all .15s cubic-bezier(.4,0,.2,1)}.ecp-duration-75{transition-duration:75ms}.ecp-duration-100{transition-duration:.1s}.ecp-duration-150{transition-duration:.15s}.ecp-duration-300{transition-duration:.3s}.ecp-scale-0{transform:scale(0)}.ecp-translate-y-10{transform:translateY(2.5rem)}.ecp--translate-y-10{transform:translateY(-2.5rem)}.ecp-rotate-180{transform:rotate(180deg)}.ecp-hover-scale-105:hover{transform:scale(1.05)}.ecp-hover-scale-110:hover{transform:scale(1.1)}@keyframes ecp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ecp-animation-spin{animation:ecp-spin 15s infinite linear}.ecp-object-contain{-o-object-fit:contain;object-fit:contain}.ecp-backdrop-blur-xl{-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px)}.ecp-overflow-hidden{overflow:hidden}.ecp-top-0{top:0}.ecp-left-0{left:0}.ecp-fixed{position:fixed}.ecp-z-9999{z-index:9999}.ecp-appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.ecp-page-wrapper{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1rem}@media (min-width: 768px){.ecp-page-wrapper{padding:2rem}}.ecp-demo-container{width:100%;height:100%}@media (min-width: 768px){.ecp-demo-container{height:auto;max-width:56rem}}.ecp-container-glass{border-radius:.75rem;padding:2rem}.ecp-demo-header{margin-bottom:1.5rem;display:flex;justify-content:space-between;align-items:flex-start}.ecp-demo-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin-bottom:.25rem}.ecp-demo-title--dark{color:#e5e7eb}.ecp-demo-subtitle{font-size:.875rem;color:#6b7280}.ecp-theme-btn{background:#fff;border:1px solid #d1d5db;color:#374151;padding:.5rem 1rem;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:.5rem}.ecp-theme-btn:hover{background:#f9fafb}.ecp-demo-actions{margin-top:1.5rem;display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.ecp-action-btn{background:#fff;border:1px solid #d1d5db;color:#374151;padding:.5rem 1.5rem;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:.5rem}.ecp-action-btn:hover{background:#f9fafb}.ecp-file-input-hidden{display:none}.ecp-theme-selector-panel{border-radius:.75rem;padding:1.5rem;margin-bottom:1.5rem}.ecp-theme-selector-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.ecp-theme-selector-title{font-size:1.125rem;font-weight:600;color:#1f2937}.ecp-theme-selector-close{color:#6b7280;font-size:.875rem;font-weight:500;background:none;border:none;cursor:pointer}.ecp-theme-selector-close:hover{color:#374151}.ecp-theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}@media (min-width: 640px){.ecp-theme-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 768px){.ecp-theme-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}.ecp-theme-card{background:#fff;padding:1rem;border-radius:.5rem;cursor:pointer;border:2px solid transparent;transition:all .15s cubic-bezier(.4,0,.2,1)}.ecp-theme-card--active{border-color:currentColor;box-shadow:0 10px 15px -3px #0000001a}.ecp-theme-color-preview{height:2.5rem;border-radius:.25rem;margin-bottom:.5rem}.ecp-theme-name{font-size:.875rem;font-weight:500;color:#374151}.ecp-vp-wrapper{width:100%;border-radius:.75rem;overflow:hidden}.ecp-vp-bg{padding:1rem}.ecp-vp-vu-outer{position:relative}.ecp-vp-vu-bg{border-radius:.5rem;margin-bottom:1.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d}.ecp-vp-vu-bg--light{background:#ffffffb3}.ecp-vp-vu-bg--dark{background:#0006}.ecp-vp-vu-bg--transparent{background:transparent!important;padding:0!important;box-shadow:none!important}.ecp-vp-vu-bg--dimmed{opacity:.3}.ecp-vp-vu-bg--no-margin{margin-bottom:0}.ecp-vp-vu-bars{display:flex;justify-content:center;align-items:flex-end;gap:.25rem;height:16rem}.ecp-vp-eq-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;width:100%;justify-content:center;z-index:10;border-radius:.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d;transition:all .3s cubic-bezier(.4,0,.2,1)}.ecp-vp-eq-overlay--light{background:#ffffffe6}.ecp-vp-eq-overlay--dark{background:#000000b3}.ecp-vp-eq-title{font-size:.875rem;font-weight:500;margin-bottom:1rem}.ecp-vp-eq-title--light{color:#374151}.ecp-vp-eq-title--dark{color:#e5e7eb}.ecp-vp-eq-bands{display:flex;flex-direction:column;gap:1rem}.ecp-vp-eq-band-header{display:flex;justify-content:space-between;margin-bottom:.25rem}.ecp-vp-eq-band-label{font-size:.75rem}.ecp-vp-eq-band-label--light{color:#4b5563}.ecp-vp-eq-band-label--dark{color:#d1d5db}.ecp-vp-eq-band-range{display:flex;align-items:center;gap:.75rem}.ecp-vp-eq-range-bound{font-size:.75rem}.ecp-vp-eq-range-bound--light{color:#6b7280}.ecp-vp-eq-range-bound--dark{color:#9ca3af}.ecp-vp-eq-slider{flex:1;height:2rem;background:#d1d5db;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-vp-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-vp-eq-slider::-moz-range-thumb{width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-vp-eq-footer{display:flex;justify-content:flex-end;margin-top:1rem}.ecp-vp-eq-reset{padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;cursor:pointer;transition:all .15s;border:none}.ecp-vp-eq-reset--light{background:#e5e7eb;color:#374151}.ecp-vp-eq-reset--light:hover{background:#d1d5db}.ecp-vp-eq-reset--dark{background:#374151;color:#e5e7eb}.ecp-vp-eq-reset--dark:hover{background:#4b5563}.ecp-vp-8d-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem}.ecp-vp-8d-title-group,.ecp-vp-8d-toggle-wrap{display:flex;align-items:center;gap:.5rem}.ecp-vp-8d-toggle-label{font-size:.75rem;font-weight:500}.ecp-vp-8d-toggle-label--light{color:#4b5563}.ecp-vp-8d-toggle-label--dark{color:#d1d5db}.ecp-vp-8d-toggle{position:relative;width:2.75rem;height:1.5rem;border-radius:9999px;background:#d1d5db;cursor:pointer;border:none;transition:background .2s}.ecp-vp-8d-toggle--on{background:var(--theme-slider, #8b5cf6)}.ecp-vp-8d-toggle-thumb{position:absolute;top:.125rem;left:.125rem;width:1.25rem;height:1.25rem;border-radius:50%;background:#fff;transition:transform .2s;box-shadow:0 1px 3px #0000004d}.ecp-vp-8d-toggle--on .ecp-vp-8d-toggle-thumb{transform:translate(1.25rem)}.ecp-vp-8d-visualizer{position:relative;height:4.5rem;margin-bottom:.75rem;border-radius:.5rem;display:flex;align-items:center;justify-content:center;overflow:hidden}.ecp-vp-8d-visualizer--light{background:#0000000a}.ecp-vp-8d-visualizer--dark{background:#ffffff0f}.ecp-vp-8d-orbit-ring{position:absolute;width:6rem;height:3rem;border:1.5px dashed var(--theme-slider-alpha, rgba(139, 92, 246, .4));border-radius:50%}.ecp-vp-8d-head-icon{position:relative;z-index:2;color:var(--theme-slider, #8b5cf6)}.ecp-vp-8d-orbit-dot{position:absolute;width:10px;height:10px;border-radius:50%;background:var(--theme-slider, #8b5cf6);box-shadow:0 0 10px var(--theme-slider, #8b5cf6),0 0 15px var(--theme-slider, #8b5cf6);z-index:3}.ecp-vp-8d-live-overlay{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:5;display:flex;flex-direction:column;align-items:center;gap:.3rem;pointer-events:none;animation:ecp-8d-badge-blink 2s ease-in-out infinite}.ecp-vp-8d-live-visualizer{position:relative;width:14rem;height:9.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;overflow:visible}.ecp-vp-8d-live-visualizer--light{background:#fffd;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);box-shadow:inset 0 0 20px #0000000d,0 8px 24px #0000000f}.ecp-vp-8d-live-visualizer--dark{background:#0c0c10d8;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);box-shadow:inset 0 0 30px #0006,0 8px 24px #00000040}.ecp-vp-8d-live-glow{position:absolute;width:14rem;height:9.5rem;border-radius:50%;animation:ecp-8d-pulse 2.5s ease-in-out infinite;pointer-events:none;z-index:0}@keyframes ecp-8d-pulse{0%,to{opacity:.3;transform:scale(.92)}50%{opacity:.75;transform:scale(1.08)}}.ecp-vp-8d-live-svg{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:1;pointer-events:none}.ecp-vp-8d-radar-border{fill:none;stroke:var(--theme-slider, #8b5cf6);stroke-opacity:.25;stroke-width:1.5}.ecp-vp-8d-live-head-icon{position:absolute;z-index:3;filter:drop-shadow(0 0 5px currentColor)}.ecp-vp-8d-live-dot{position:absolute;left:50%;top:50%;width:18px;height:18px;margin-left:-9px;margin-top:-9px;border-radius:50%;z-index:4;display:flex;align-items:center;justify-content:center}.ecp-vp-8d-live-dot-inner{width:5px;height:5px;border-radius:50%;background:#000000bf}@keyframes ecp-8d-badge-blink{0%,to{opacity:1}50%{opacity:.8}}.ecp-vp-8d-tabs{display:flex;gap:.25rem;margin-bottom:.75rem;border-bottom:1px solid rgba(156,163,175,.2);padding-bottom:.25rem}.ecp-vp-8d-tab{padding:.25rem .6rem;font-size:.75rem;font-weight:500;border-radius:.375rem;border:1px solid transparent;background:transparent;cursor:pointer;transition:all .15s}.ecp-vp-8d-tab--light{color:#6b7280}.ecp-vp-8d-tab--light:hover{color:#1f2937;background:#0000000d}.ecp-vp-8d-tab--dark{color:#9ca3af}.ecp-vp-8d-tab--dark:hover{color:#f3f4f6;background:#ffffff14}.ecp-vp-8d-tab--active{background:var(--theme-slider-alpha, rgba(139, 92, 246, .15))!important;color:var(--theme-slider, #8b5cf6)!important;border-color:var(--theme-slider, #8b5cf6)!important}.ecp-vp-8d-controls-grid{display:flex;flex-direction:column;gap:.75rem;padding-top:.25rem}.ecp-vp-eq-bands--horizontal{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:.75rem;width:100%}.ecp-vp-eq-band-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:.35rem;min-width:0}.ecp-vp-eq-band-col .ecp-vp-eq-slider{height:.5rem;border-radius:9999px}.ecp-vp-eq-band-col .ecp-vp-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:14px;height:14px;border-radius:50%;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 1px 4px #0000004d;cursor:pointer}.ecp-vp-eq-band-col .ecp-vp-eq-slider::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 1px 4px #0000004d;cursor:pointer}.ecp-vp-eq-val{font-size:.75rem;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}.ecp-vp-eq-val--light{color:#374151}.ecp-vp-eq-val--dark{color:#f3f4f6}.ecp-vp-eq-label{font-size:.7rem;font-weight:600;letter-spacing:.05em;text-transform:uppercase}.ecp-vp-eq-label--light{color:#6b7280}.ecp-vp-eq-label--dark{color:#9ca3af}.ecp-vp-eq-bar-wrap{width:100%;display:flex;align-items:center}@media (max-width: 640px){.ecp-vp-eq-bands--horizontal{flex-direction:column;gap:.6rem}.ecp-vp-eq-band-col{flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:.6rem}.ecp-vp-eq-label{order:1;width:3.5rem;text-align:left;flex-shrink:0}.ecp-vp-eq-bar-wrap{order:2;flex:1}.ecp-vp-eq-val{order:3;width:3.5rem;text-align:right;flex-shrink:0}}.ecp-vp-track{margin-bottom:1.5rem;display:flex;align-items:center}.ecp-vp-thumbnail-wrap{margin-right:.5rem;width:3rem;flex-shrink:0}.ecp-vp-thumbnail{height:3rem;width:3rem;border-radius:9999px}.ecp-vp-track-info{width:100%;min-width:0}.ecp-vp-track-name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ecp-vp-track-name--light{color:#374151}.ecp-vp-track-name--dark{color:#f3f4f6}.ecp-vp-track-author{font-size:.75rem}.ecp-vp-track-author--light{color:#6b7280}.ecp-vp-track-author--dark{color:#d1d5db}.ecp-vp-seekbar{margin-bottom:1.5rem}.ecp-vp-seekbar-row{display:flex;align-items:center;gap:.25rem}.ecp-vp-time{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:3rem}.ecp-vp-time--right{text-align:right}.ecp-vp-time--light{color:#4b5563}.ecp-vp-time--dark{color:#f3f4f6}.ecp-vp-seek-input{flex:1;height:.5rem;background:#e5e7eb;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-vp-seek-input:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-seek-input::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-vp-seek-input::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-vp-controls{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.ecp-vp-controls--sm{gap:.5rem}.ecp-vp-play-btn{padding:.5rem 1rem;min-width:6rem;border-radius:9999px;font-size:.875rem;font-weight:500;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:opacity .15s}.ecp-vp-play-btn:hover{opacity:.9}.ecp-vp-play-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-play-btn--compact{padding:1.25rem .75rem;min-width:unset}.ecp-vp-play-icon-wrap{position:relative;width:1rem;display:flex;align-items:center}.ecp-vp-stop-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-vp-stop-btn--light{background:#374151;color:#fff}.ecp-vp-stop-btn--light:hover{background:#1f2937}.ecp-vp-stop-btn--dark{background:#f3f4f6;color:#000}.ecp-vp-stop-btn--dark:hover{background:#d1d5db}.ecp-vp-stop-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-stop-btn--wide{padding:.5rem 1rem}.ecp-vp-eq-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-vp-eq-btn--off{background:#f3f4f6;color:#374151}.ecp-vp-eq-btn--off:hover{background:#d1d5db}.ecp-vp-eq-btn--on{color:#fff}.ecp-vp-eq-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-eq-btn--wide{padding:.5rem 1rem}.ecp-vp-loop-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-vp-loop-btn--off{background:#f3f4f6;color:#374151}.ecp-vp-loop-btn--off:hover{background:#d1d5db}.ecp-vp-loop-btn--on{color:#fff}.ecp-vp-loop-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-loop-btn--wide{padding:.5rem 1rem}.ecp-vp-loop-icon--active{transform:rotate(180deg)}.ecp-vp-speed-wrap{display:flex;align-items:center}.ecp-vp-speed-select{border-radius:9999px;font-size:.875rem;font-weight:500;border:none;outline:none;cursor:pointer;transition:all .15s;background:transparent}.ecp-vp-speed-select--light{color:#1f2937}.ecp-vp-speed-select--dark{color:#e5e7eb}.ecp-vp-speed-option--light{background:#fff;color:#1f2937}.ecp-vp-speed-option--dark{background:#1f2937;color:#f3f4f6}.ecp-vp-volume{display:flex;align-items:center;gap:.25rem;margin-left:auto}@media (min-width: 768px){.ecp-vp-volume{gap:.75rem}}.ecp-vp-mute-btn{padding:.5rem;border-radius:9999px;background:none;border:none;cursor:pointer;transition:all .15s}.ecp-vp-mute-btn:hover{background:#f3f4f680}.ecp-vp-mute-icon--light{color:#4b5563}.ecp-vp-mute-icon--dark{color:#f3f4f6}.ecp-vp-volume-slider{width:6rem;height:.5rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-vp-volume-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-vp-volume-slider::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}@media (max-width: 460px){.ecp-vp-volume-slider{display:none}}.ecp-vp-volume-pct{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:2.5rem;text-align:right}.ecp-vp-volume-pct--light{color:#374151}.ecp-vp-volume-pct--dark{color:#f3f4f6}.ecp-vp-error{font-size:.875rem;color:#ef4444;background:#fef2f2;padding:.75rem;border-radius:.25rem;margin-bottom:1rem;border:1px solid #fca5a5}.ecp-wave-outer{width:100%;max-width:32rem;position:relative}.ecp-wave-audio-el{display:none}.ecp-wave-card{border-radius:1rem;box-shadow:0 25px 50px -12px #00000040}.ecp-wave-card-inner{border-radius:1rem;padding:1.5rem;-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px)}.ecp-wave-thumbnail-wrap{width:100%;padding:1rem}.ecp-wave-thumbnail{width:100%;aspect-ratio:1 / 1;border-radius:.75rem}.ecp-wave-seek{position:relative;height:5rem;margin-bottom:1.5rem;cursor:pointer}.ecp-wave-bars{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:flex-end;justify-content:center;height:100%;width:100%;gap:1px}.ecp-wave-bar{width:.25rem;border-radius:.25rem .25rem 0 0;transition:all .15s}.ecp-wave-progress-line{position:absolute;top:0;height:100%;width:.25rem;background:#fff;border-right:1px solid black;border-radius:9999px;transition:all .15s;transform:translate(-50%)}.ecp-wave-times{display:flex;justify-content:space-between;font-size:.875rem;margin-bottom:1.5rem}.ecp-wave-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;justify-content:space-between;margin-bottom:1rem}.ecp-wave-left-controls{display:flex;align-items:center;gap:.5rem}.ecp-wave-vol-btn{padding:.5rem;border-radius:9999px;border:none;cursor:pointer;transition:all .15s}.ecp-wave-vol-slider{width:5rem;height:.375rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-wave-vol-slider::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 1px 3px #0003}.ecp-wave-vol-slider::-moz-range-thumb{width:14px;height:14px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none}.ecp-wave-center-controls{display:flex;justify-content:center}.ecp-wave-play-btn{padding:1rem;border-radius:9999px;border:none;cursor:pointer;transition:all .15s;box-shadow:0 10px 15px -3px #0000001a}.ecp-wave-play-btn:hover{transform:scale(1.05)}.ecp-wave-right-controls{display:flex;align-items:center;gap:.75rem}.ecp-wave-speed-select{padding:.25rem .5rem;border-radius:.5rem;font-size:.875rem;border:none;cursor:pointer}.ecp-wave-speed-select--light{background:#f3f4f6;color:#374151}.ecp-wave-speed-select--dark{background:#1f2937;color:#f3f4f6}.ecp-wave-eq-btn{padding:.5rem;border-radius:9999px;border:none;cursor:pointer;transition:all .15s}.ecp-wave-eq-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#0003;display:flex;align-items:center;justify-content:center;z-index:10;border-radius:1rem;padding:1rem}.ecp-wave-eq-panel{max-width:20rem;width:100%;padding:.5rem 1rem 1rem;border-radius:.75rem}.ecp-wave-eq-panel--light{background:#fff}.ecp-wave-eq-panel--dark{background:#1f2937}.ecp-wave-eq-title{font-size:1.125rem;font-weight:500;margin-bottom:.5rem}.ecp-wave-eq-title--light{color:#374151}.ecp-wave-eq-title--dark{color:#e5e7eb}.ecp-wave-eq-bands{display:flex;flex-direction:column;gap:1rem}.ecp-wave-eq-band-header{display:flex;justify-content:space-between;margin-bottom:.25rem}.ecp-wave-eq-label--light{font-size:.75rem;color:#4b5563}.ecp-wave-eq-label--dark{font-size:.75rem;color:#d1d5db}.ecp-wave-eq-range-row{display:flex;align-items:center;gap:.75rem}.ecp-wave-eq-bound--light{font-size:.75rem;color:#6b7280}.ecp-wave-eq-bound--dark{font-size:.75rem;color:#9ca3af}.ecp-wave-eq-slider{flex:1;height:1rem;background:#d1d5db;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-wave-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-wave-eq-slider::-moz-range-thumb{width:0;height:0;background:transparent;border:none}.ecp-wave-eq-footer{display:flex;justify-content:space-between;margin-top:1.5rem}.ecp-wave-eq-footer-btn{padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;cursor:pointer;border:none;transition:all .15s}.ecp-wave-eq-footer-btn--light{background:#e5e7eb;color:#374151}.ecp-wave-eq-footer-btn--light:hover{background:#d1d5db}.ecp-wave-eq-footer-btn--dark{background:#374151;color:#e5e7eb}.ecp-wave-eq-footer-btn--dark:hover{background:#4b5563}.ecp-wave-error{padding:1.5rem;border-radius:.75rem;text-align:center}.ecp-wave-error-title{font-weight:500}.ecp-wave-error-msg{font-size:.875rem}.ecp-wave-error--light{color:#dc2626}.ecp-wave-error--dark{color:#fca5a5}.ecp-nano-wrapper{position:relative;overflow:hidden;display:inline-flex;flex-direction:column;padding:.5rem .75rem;box-shadow:0 10px 15px -3px #0000001a}.ecp-nano-wrapper--pill{border-radius:9999px;width:110px;height:40px}.ecp-nano-wrapper--card{border-radius:1rem;width:120px;height:150px}.ecp-nano-progress-bg{position:absolute;top:0;left:0;height:100%;opacity:.2}.ecp-nano-content{position:absolute;display:flex;flex-direction:column}.ecp-nano-thumbnail-wrap{width:6rem;padding-bottom:.5rem}.ecp-nano-thumbnail{width:6rem;aspect-ratio:1 / 1;border-radius:.75rem}.ecp-nano-row{display:flex;align-items:center;gap:.5rem}.ecp-nano-play-btn{padding:.375rem;border-radius:9999px;border:none;cursor:pointer;flex-shrink:0;transition:transform .15s}.ecp-nano-play-btn:hover{transform:scale(1.1)}.ecp-nano-waveform{display:flex;width:100%;min-width:3rem;align-items:center;gap:2px;height:1.5rem}.ecp-nano-wave-bar{border-radius:9999px;width:100%;transition:height .2s}.ecp-video-wrapper{border-radius:.75rem;overflow:hidden;transition:all .3s cubic-bezier(.4,0,.2,1)}.ecp-video-wrapper--fullscreen{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;flex-direction:column;height:100vh;width:100vw;background:#000}.ecp-video-inner{height:auto}.ecp-video-inner--fullscreen{display:flex;flex-direction:column;flex:1;min-height:0}.ecp-video-inner--padded{padding:1rem}.ecp-video-name{margin-bottom:1rem;font-weight:500}.ecp-video-name--light{color:#374151}.ecp-video-name--dark{color:#f3f4f6}.ecp-video-layout{position:relative;margin-bottom:1rem}.ecp-video-layout--row{display:flex;gap:.75rem}.ecp-video-layout--col{display:flex;flex-direction:column;gap:.75rem}.ecp-video-layout--fullscreen{flex:1;min-height:0}.ecp-video-vu-top,.ecp-video-vu-bottom{width:100%;height:3rem}.ecp-video-vu-side{width:3rem;background:#00000080;border-radius:.5rem;padding:.25rem}.ecp-video-el-wrap{flex:1;border-radius:.5rem;overflow:hidden;position:relative}.ecp-video-el-wrap--light{background:#ffffffb3}.ecp-video-el-wrap--dark{background:#000000b3}.ecp-video-el{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.ecp-video-eq-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;width:100%;justify-content:center;z-index:10;border-radius:.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d;transition:all .3s}.ecp-video-eq-panel{max-width:600px;width:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:center;border-radius:.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d;transition:all .3s}.ecp-video-eq-panel--light{background:#fffc}.ecp-video-eq-panel--dark{background:#000000b3}.ecp-video-eq-title{font-size:.875rem;font-weight:500;margin-bottom:1rem}.ecp-video-eq-title--light{color:#374151}.ecp-video-eq-title--dark{color:#e5e7eb}.ecp-video-eq-bands{display:flex;flex-direction:column;gap:1rem}.ecp-video-eq-band-header{display:flex;justify-content:space-between;margin-bottom:.25rem}.ecp-video-eq-label--light{font-size:.75rem;color:#4b5563}.ecp-video-eq-label--dark{font-size:.75rem;color:#d1d5db}.ecp-video-eq-range-row{display:flex;align-items:center;gap:.75rem}.ecp-video-eq-bound--light{font-size:.75rem;color:#6b7280}.ecp-video-eq-bound--dark{font-size:.75rem;color:#9ca3af}.ecp-video-eq-slider{flex:1;height:1.5rem;background:#d1d5db;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-video-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-video-eq-slider::-moz-range-thumb{width:0;height:0;background:transparent;border:none}.ecp-video-eq-footer{display:flex;justify-content:space-between;margin-top:1.5rem}.ecp-video-eq-footer-btn{padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;cursor:pointer;border:none;transition:all .15s}.ecp-video-eq-footer-btn--light{background:#e5e7eb;color:#374151}.ecp-video-eq-footer-btn--light:hover{background:#d1d5db}.ecp-video-eq-footer-btn--dark{background:#374151;color:#e5e7eb}.ecp-video-eq-footer-btn--dark:hover{background:#4b5563}.ecp-video-seekbar{margin-bottom:1rem}.ecp-video-seekbar--fullscreen{margin-top:.75rem}.ecp-video-seekbar-row{display:flex;align-items:center;gap:.75rem}.ecp-video-time{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:3rem}.ecp-video-time--right{text-align:right}.ecp-video-time--light{color:#4b5563}.ecp-video-time--dark{color:#f3f4f6}.ecp-video-seek-input{flex:1;height:.5rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-video-seek-input:disabled{opacity:.4;cursor:not-allowed}.ecp-video-seek-input::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-video-seek-input::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-video-controls{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.ecp-video-play-btn{border-radius:9999px;font-size:.875rem;font-weight:500;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:opacity .15s;padding:.5rem 1rem}.ecp-video-play-btn:hover{opacity:.9}.ecp-video-play-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-video-play-btn--compact{padding:1.25rem .75rem}.ecp-video-play-icon-wrap{position:relative;width:1rem;display:flex;align-items:center}.ecp-video-stop-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-video-stop-btn--light{background:#374151;color:#fff}.ecp-video-stop-btn--light:hover{background:#1f2937}.ecp-video-stop-btn--dark{background:#f3f4f6;color:#000}.ecp-video-stop-btn--dark:hover{background:#d1d5db}.ecp-video-stop-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-video-fullscreen-btn{border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s;padding:.75rem}.ecp-video-fullscreen-btn--light{background:#374151;color:#fff}.ecp-video-fullscreen-btn--light:hover{background:#1f2937}.ecp-video-fullscreen-btn--dark{background:#f3f4f6;color:#000}.ecp-video-fullscreen-btn--dark:hover{background:#d1d5db}.ecp-video-fullscreen-btn--wide{padding:.5rem 1rem}.ecp-video-eq-toggle-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-video-eq-toggle-btn--off{background:#f3f4f6;color:#374151}.ecp-video-eq-toggle-btn--off:hover{background:#d1d5db}.ecp-video-eq-toggle-btn--on{color:#fff}.ecp-video-eq-toggle-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-video-eq-toggle-btn--wide{padding:.5rem 1rem}.ecp-video-speed-wrap{display:flex;align-items:center}.ecp-video-speed-select{border-radius:9999px;font-size:.875rem;font-weight:500;border:none;outline:none;cursor:pointer;background:transparent;transition:all .15s}.ecp-video-speed-select--light{color:#1f2937}.ecp-video-speed-select--dark{color:#e5e7eb}.ecp-video-speed-option--light{background:#f3f4f6;color:#1f2937}.ecp-video-speed-option--dark{background:#1f2937;color:#f3f4f6}.ecp-video-volume{display:flex;align-items:center;gap:.25rem;margin-left:auto}@media (min-width: 768px){.ecp-video-volume{gap:.75rem}}.ecp-video-mute-btn{padding:.5rem;border-radius:.5rem;background:none;border:none;cursor:pointer;transition:all .15s}.ecp-video-mute-btn:hover{background:#f3f4f6}.ecp-video-mute-icon--light{color:#4b5563}.ecp-video-mute-icon--dark{color:#f3f4f6}.ecp-video-vol-slider{width:6rem;height:.5rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-video-vol-slider::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-video-vol-slider::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}@media (max-width: 460px){.ecp-video-vol-slider{display:none}}.ecp-video-vol-pct{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:2.5rem;text-align:right}.ecp-video-vol-pct--light{color:#374151}.ecp-video-vol-pct--dark{color:#f3f4f6}.ecp-video-error{font-size:.875rem;color:#ef4444;background:#fef2f2;padding:.75rem;border-radius:.25rem;margin-bottom:1rem;border:1px solid #fca5a5}.ecp-vu-bar-wrap{flex:1;height:100%;position:relative;display:flex;flex-direction:column;justify-content:flex-end}.ecp-vu-bar-fill{border-radius:.25rem .25rem 0 0;transition:height 75ms}.ecp-vu-peak-line{position:absolute;width:100%;height:2px;transition:top .1s}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".ecp-full-width{width:100%}.ecp-h-full{height:100%}.ecp-relative{position:relative}.ecp-absolute{position:absolute}.ecp-inset-0{top:0;right:0;bottom:0;left:0}.ecp-z-10{z-index:10}.ecp-flex{display:flex}.ecp-inline-flex{display:inline-flex}.ecp-flex-col{flex-direction:column}.ecp-flex-wrap{flex-wrap:wrap}.ecp-flex-1{flex:1 1 0%}.ecp-flex-shrink-0{flex-shrink:0}.ecp-grid{display:grid}.ecp-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.ecp-hidden{display:none}.ecp-items-center{align-items:center}.ecp-items-end{align-items:flex-end}.ecp-items-start{align-items:flex-start}.ecp-justify-center{justify-content:center}.ecp-justify-between{justify-content:space-between}.ecp-justify-end{justify-content:flex-end}.ecp-justify-start{justify-content:flex-start}.ecp-text-center{text-align:center}.ecp-text-right{text-align:right}.ecp-self-center{align-self:center}.ecp-gap-1{gap:.25rem}.ecp-gap-2{gap:.5rem}.ecp-gap-3{gap:.75rem}.ecp-gap-px{gap:1px}.ecp-gap-05{gap:2px}.ecp-mb-1{margin-bottom:.25rem}.ecp-mb-2{margin-bottom:.5rem}.ecp-mb-4{margin-bottom:1rem}.ecp-mb-6{margin-bottom:1.5rem}.ecp-mr-2{margin-right:.5rem}.ecp-mt-4{margin-top:1rem}.ecp-mt-6{margin-top:1.5rem}.ecp-ml-auto{margin-left:auto}.ecp-p-1{padding:.25rem}.ecp-p-1-5{padding:.375rem}.ecp-p-2{padding:.5rem}.ecp-p-3{padding:.75rem}.ecp-p-4{padding:1rem}.ecp-p-6{padding:1.5rem}.ecp-p-8{padding:2rem}.ecp-px-2{padding-left:.5rem;padding-right:.5rem}.ecp-px-3{padding-left:.75rem;padding-right:.75rem}.ecp-px-4{padding-left:1rem;padding-right:1rem}.ecp-px-6{padding-left:1.5rem;padding-right:1.5rem}.ecp-py-1{padding-top:.25rem;padding-bottom:.25rem}.ecp-py-2{padding-top:.5rem;padding-bottom:.5rem}.ecp-py-3{padding-top:.75rem;padding-bottom:.75rem}.ecp-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.ecp-pb-2{padding-bottom:.5rem}.ecp-pt-2{padding-top:.5rem}.ecp-w-1{width:.25rem}.ecp-w-3{width:.75rem}.ecp-w-4{width:1rem}.ecp-w-10{width:2.5rem}.ecp-w-12{width:3rem}.ecp-w-20{width:5rem}.ecp-w-24{width:6rem}.ecp-w-px{width:1px}.ecp-w-full{width:100%}.ecp-max-w-xs{max-width:20rem}.ecp-max-w-lg{max-width:32rem}.ecp-max-w-4xl{max-width:56rem}.ecp-h-0-5{height:.125rem}.ecp-h-1{height:.25rem}.ecp-h-1-5{height:.375rem}.ecp-h-2{height:.5rem}.ecp-h-3{height:.75rem}.ecp-h-4{height:1rem}.ecp-h-6{height:1.5rem}.ecp-h-8{height:2rem}.ecp-h-10{height:2.5rem}.ecp-h-12{height:3rem}.ecp-h-20{height:5rem}.ecp-h-40{width:10rem;height:40px}.ecp-h-64{height:16rem}.ecp-h-screen{height:100vh}.ecp-min-h-screen{min-height:100vh}.ecp-min-h-0{min-height:0}.ecp-min-w-12{min-width:3rem}.ecp-min-w-0{min-width:0}.ecp-aspect-square{aspect-ratio:1 / 1}.ecp-text-xs{font-size:.75rem;line-height:1rem}.ecp-text-sm{font-size:.875rem;line-height:1.25rem}.ecp-text-lg{font-size:1.125rem;line-height:1.75rem}.ecp-text-2xl{font-size:1.5rem;line-height:2rem}.ecp-font-medium{font-weight:500}.ecp-font-semibold{font-weight:600}.ecp-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}.ecp-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ecp-text-white{color:#fff}.ecp-text-transparent{color:transparent}.ecp-text-gray-400{color:#9ca3af}.ecp-text-gray-500{color:#6b7280}.ecp-text-gray-600{color:#4b5563}.ecp-text-gray-700{color:#374151}.ecp-text-gray-800{color:#1f2937}.ecp-text-gray-100{color:#f3f4f6}.ecp-text-gray-200{color:#e5e7eb}.ecp-text-gray-300{color:#d1d5db}.ecp-text-red-500{color:#ef4444}.ecp-dark .ecp-text-dark-100{color:#f3f4f6}.ecp-dark .ecp-text-dark-200{color:#e5e7eb}.ecp-dark .ecp-text-dark-300{color:#d1d5db}.ecp-bg-white{background-color:#fff}.ecp-bg-black-20{background-color:#0003}.ecp-bg-black-30{background-color:#0000004d}.ecp-bg-black-40{background-color:#0006}.ecp-bg-black-50{background-color:#00000080}.ecp-bg-gray-100{background-color:#f3f4f6}.ecp-bg-gray-200{background-color:#e5e7eb}.ecp-bg-gray-300{background-color:#d1d5db}.ecp-bg-gray-700{background-color:#374151}.ecp-bg-gray-800{background-color:#1f2937}.ecp-bg-red-50{background-color:#fef2f2}.ecp-bg-transparent{background-color:transparent}.ecp-border{border-width:1px}.ecp-border-2{border-width:2px}.ecp-border-r{border-right-width:1px}.ecp-border-transparent{border-color:transparent}.ecp-border-gray-300{border-color:#d1d5db}.ecp-border-red-300{border-color:#fca5a5}.ecp-border-current{border-color:currentColor}.ecp-border-none{border:none}.ecp-outline-none{outline:none}.ecp-rounded{border-radius:.25rem}.ecp-rounded-lg{border-radius:.5rem}.ecp-rounded-xl{border-radius:.75rem}.ecp-rounded-2xl{border-radius:1rem}.ecp-rounded-full{border-radius:9999px}.ecp-rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.ecp-shadow-sm{box-shadow:0 1px 2px #0000000d}.ecp-shadow-lg{box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a}.ecp-shadow-2xl{box-shadow:0 25px 50px -12px #00000040}.ecp-opacity-20{opacity:.2}.ecp-opacity-40{opacity:.4}.ecp-opacity-70{opacity:.7}.ecp-opacity-80{opacity:.8}.ecp-cursor-pointer{cursor:pointer}.ecp-cursor-not-allowed{cursor:not-allowed}.ecp-pointer-events-none{pointer-events:none}.ecp-transition{transition-property:color,background-color,border-color,opacity,box-shadow,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ecp-transition-all{transition:all .15s cubic-bezier(.4,0,.2,1)}.ecp-duration-75{transition-duration:75ms}.ecp-duration-100{transition-duration:.1s}.ecp-duration-150{transition-duration:.15s}.ecp-duration-300{transition-duration:.3s}.ecp-scale-0{transform:scale(0)}.ecp-translate-y-10{transform:translateY(2.5rem)}.ecp--translate-y-10{transform:translateY(-2.5rem)}.ecp-rotate-180{transform:rotate(180deg)}.ecp-hover-scale-105:hover{transform:scale(1.05)}.ecp-hover-scale-110:hover{transform:scale(1.1)}@keyframes ecp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ecp-animation-spin{animation:ecp-spin 15s infinite linear}.ecp-object-contain{-o-object-fit:contain;object-fit:contain}.ecp-backdrop-blur-xl{-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px)}.ecp-overflow-hidden{overflow:hidden}.ecp-top-0{top:0}.ecp-left-0{left:0}.ecp-fixed{position:fixed}.ecp-z-9999{z-index:9999}.ecp-appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.ecp-page-wrapper{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1rem}@media (min-width: 768px){.ecp-page-wrapper{padding:2rem}}.ecp-demo-container{width:100%;height:100%}@media (min-width: 768px){.ecp-demo-container{height:auto;max-width:56rem}}.ecp-container-glass{border-radius:.75rem;padding:2rem}.ecp-demo-header{margin-bottom:1.5rem;display:flex;justify-content:space-between;align-items:flex-start}.ecp-demo-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin-bottom:.25rem}.ecp-demo-title--dark{color:#e5e7eb}.ecp-demo-subtitle{font-size:.875rem;color:#6b7280}.ecp-theme-btn{background:#fff;border:1px solid #d1d5db;color:#374151;padding:.5rem 1rem;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:.5rem}.ecp-theme-btn:hover{background:#f9fafb}.ecp-demo-actions{margin-top:1.5rem;display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.ecp-action-btn{background:#fff;border:1px solid #d1d5db;color:#374151;padding:.5rem 1.5rem;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:.5rem}.ecp-action-btn:hover{background:#f9fafb}.ecp-file-input-hidden{display:none}.ecp-theme-selector-panel{border-radius:.75rem;padding:1.5rem;margin-bottom:1.5rem}.ecp-theme-selector-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.ecp-theme-selector-title{font-size:1.125rem;font-weight:600;color:#1f2937}.ecp-theme-selector-close{color:#6b7280;font-size:.875rem;font-weight:500;background:none;border:none;cursor:pointer}.ecp-theme-selector-close:hover{color:#374151}.ecp-theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}@media (min-width: 640px){.ecp-theme-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 768px){.ecp-theme-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}.ecp-theme-card{background:#fff;padding:1rem;border-radius:.5rem;cursor:pointer;border:2px solid transparent;transition:all .15s cubic-bezier(.4,0,.2,1)}.ecp-theme-card--active{border-color:currentColor;box-shadow:0 10px 15px -3px #0000001a}.ecp-theme-color-preview{height:2.5rem;border-radius:.25rem;margin-bottom:.5rem}.ecp-theme-name{font-size:.875rem;font-weight:500;color:#374151}.ecp-vp-wrapper{width:100%;border-radius:.75rem;overflow:hidden}.ecp-vp-bg{padding:1rem}.ecp-vp-vu-outer{position:relative}.ecp-vp-vu-bg{border-radius:.5rem;margin-bottom:1.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d}.ecp-vp-vu-bg--light{background:#ffffffb3}.ecp-vp-vu-bg--dark{background:#0006}.ecp-vp-vu-bg--transparent{background:transparent!important;padding:0!important;box-shadow:none!important}.ecp-vp-vu-bg--dimmed{opacity:.3}.ecp-vp-vu-bg--no-margin{margin-bottom:0}.ecp-vp-vu-bars{display:flex;justify-content:center;align-items:flex-end;gap:.25rem;height:16rem}.ecp-vp-eq-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;width:100%;justify-content:center;z-index:10;border-radius:.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d;transition:all .3s cubic-bezier(.4,0,.2,1)}.ecp-vp-eq-overlay--light{background:#ffffffe6}.ecp-vp-eq-overlay--dark{background:#000000b3}.ecp-vp-eq-title{font-size:.875rem;font-weight:500;margin-bottom:1rem}.ecp-vp-eq-title--light{color:#374151}.ecp-vp-eq-title--dark{color:#e5e7eb}.ecp-vp-eq-bands{display:flex;flex-direction:column;gap:1rem}.ecp-vp-eq-band-header{display:flex;justify-content:space-between;margin-bottom:.25rem}.ecp-vp-eq-band-label{font-size:.75rem}.ecp-vp-eq-band-label--light{color:#4b5563}.ecp-vp-eq-band-label--dark{color:#d1d5db}.ecp-vp-eq-band-range{display:flex;align-items:center;gap:.75rem}.ecp-vp-eq-range-bound{font-size:.75rem}.ecp-vp-eq-range-bound--light{color:#6b7280}.ecp-vp-eq-range-bound--dark{color:#9ca3af}.ecp-vp-eq-slider{flex:1;height:1.5rem;background:#d1d5db;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-vp-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-vp-eq-slider::-moz-range-thumb{width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-vp-eq-footer{display:flex;justify-content:flex-end;margin-top:1rem}.ecp-vp-eq-reset{padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;cursor:pointer;transition:all .15s;border:none}.ecp-vp-eq-reset--light{background:#e5e7eb;color:#374151}.ecp-vp-eq-reset--light:hover{background:#d1d5db}.ecp-vp-eq-reset--dark{background:#374151;color:#e5e7eb}.ecp-vp-eq-reset--dark:hover{background:#4b5563}.ecp-vp-8d-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem}.ecp-vp-8d-title-group,.ecp-vp-8d-toggle-wrap{display:flex;align-items:center;gap:.5rem}.ecp-vp-8d-toggle-label{font-size:.75rem;font-weight:500}.ecp-vp-8d-toggle-label--light{color:#4b5563}.ecp-vp-8d-toggle-label--dark{color:#d1d5db}.ecp-vp-8d-toggle{position:relative;width:2.75rem;height:1.5rem;border-radius:9999px;background:#d1d5db;cursor:pointer;border:none;transition:background .2s}.ecp-vp-8d-toggle--on{background:var(--theme-slider, #8b5cf6)}.ecp-vp-8d-toggle-thumb{position:absolute;top:.125rem;left:.125rem;width:1.25rem;height:1.25rem;border-radius:50%;background:#fff;transition:transform .2s;box-shadow:0 1px 3px #0000004d}.ecp-vp-8d-toggle--on .ecp-vp-8d-toggle-thumb{transform:translate(1.25rem)}.ecp-vp-8d-visualizer{position:relative;height:4.5rem;margin-bottom:.75rem;border-radius:.5rem;display:flex;align-items:center;justify-content:center;overflow:hidden}.ecp-vp-8d-visualizer--light{background:#0000000a}.ecp-vp-8d-visualizer--dark{background:#ffffff0f}.ecp-vp-8d-orbit-ring{position:absolute;width:6rem;height:3rem;border:1.5px dashed var(--theme-slider-alpha, rgba(139, 92, 246, .4));border-radius:50%}.ecp-vp-8d-head-icon{position:relative;z-index:2;color:var(--theme-slider, #8b5cf6)}.ecp-vp-8d-orbit-dot{position:absolute;width:10px;height:10px;border-radius:50%;background:var(--theme-slider, #8b5cf6);box-shadow:0 0 10px var(--theme-slider, #8b5cf6),0 0 15px var(--theme-slider, #8b5cf6);z-index:3}.ecp-vp-8d-live-overlay{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:5;display:flex;flex-direction:column;align-items:center;gap:.3rem;pointer-events:none;animation:ecp-8d-badge-blink 2s ease-in-out infinite}.ecp-vp-8d-live-visualizer{position:relative;width:14rem;height:9.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;overflow:visible}.ecp-vp-8d-live-visualizer--light{background:#fffd;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);box-shadow:inset 0 0 20px #0000000d,0 8px 24px #0000000f}.ecp-vp-8d-live-visualizer--dark{background:#0c0c10d8;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);box-shadow:inset 0 0 30px #0006,0 8px 24px #00000040}.ecp-vp-8d-live-glow{position:absolute;width:14rem;height:9.5rem;border-radius:50%;animation:ecp-8d-pulse 2.5s ease-in-out infinite;pointer-events:none;z-index:0}@keyframes ecp-8d-pulse{0%,to{opacity:.3;transform:scale(.92)}50%{opacity:.75;transform:scale(1.08)}}.ecp-vp-8d-live-svg{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:1;pointer-events:none}.ecp-vp-8d-radar-border{fill:none;stroke:var(--theme-slider, #8b5cf6);stroke-opacity:.25;stroke-width:1.5}.ecp-vp-8d-live-head-icon{position:absolute;z-index:3;filter:drop-shadow(0 0 5px currentColor)}.ecp-vp-8d-live-dot{position:absolute;left:50%;top:50%;width:18px;height:18px;margin-left:-9px;margin-top:-9px;border-radius:50%;z-index:4;display:flex;align-items:center;justify-content:center}.ecp-vp-8d-live-dot-inner{width:5px;height:5px;border-radius:50%;background:#000000bf}@keyframes ecp-8d-badge-blink{0%,to{opacity:1}50%{opacity:.8}}.ecp-vp-8d-tabs{display:flex;gap:.25rem;margin-bottom:.75rem;border-bottom:1px solid rgba(156,163,175,.2);padding-bottom:.25rem}.ecp-vp-8d-tab{padding:.25rem .6rem;font-size:.75rem;font-weight:500;border-radius:.375rem;border:1px solid transparent;background:transparent;cursor:pointer;transition:all .15s}.ecp-vp-8d-tab--light{color:#6b7280}.ecp-vp-8d-tab--light:hover{color:#1f2937;background:#0000000d}.ecp-vp-8d-tab--dark{color:#9ca3af}.ecp-vp-8d-tab--dark:hover{color:#f3f4f6;background:#ffffff14}.ecp-vp-8d-tab--active{background:var(--theme-slider-alpha, rgba(139, 92, 246, .15))!important;color:var(--theme-slider, #8b5cf6)!important;border-color:var(--theme-slider, #8b5cf6)!important}.ecp-vp-8d-controls-grid{display:flex;flex-direction:column;gap:.75rem;padding-top:.25rem}.ecp-vp-eq-bands--horizontal{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:.75rem;width:100%}.ecp-vp-eq-band-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:.35rem;min-width:0}.ecp-vp-eq-band-col .ecp-vp-eq-slider{height:.5rem;border-radius:9999px}.ecp-vp-eq-band-col .ecp-vp-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:14px;height:14px;border-radius:50%;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 1px 4px #0000004d;cursor:pointer}.ecp-vp-eq-band-col .ecp-vp-eq-slider::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 1px 4px #0000004d;cursor:pointer}.ecp-vp-eq-val{font-size:.75rem;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}.ecp-vp-eq-val--light{color:#374151}.ecp-vp-eq-val--dark{color:#f3f4f6}.ecp-vp-eq-label{font-size:.7rem;font-weight:600;letter-spacing:.05em;text-transform:uppercase}.ecp-vp-eq-label--light{color:#6b7280}.ecp-vp-eq-label--dark{color:#9ca3af}.ecp-vp-eq-bar-wrap{width:100%;display:flex;align-items:center}@media (max-width: 640px){.ecp-vp-eq-bands--horizontal{flex-direction:column;gap:.6rem}.ecp-vp-eq-band-col{flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:.6rem}.ecp-vp-eq-label{order:1;width:3.5rem;text-align:left;flex-shrink:0}.ecp-vp-eq-bar-wrap{order:2;flex:1}.ecp-vp-eq-val{order:3;width:3.5rem;text-align:right;flex-shrink:0}}.ecp-vp-track{margin-bottom:1.5rem;display:flex;align-items:center}.ecp-vp-thumbnail-wrap{margin-right:.5rem;width:3rem;flex-shrink:0}.ecp-vp-thumbnail{height:3rem;width:3rem;border-radius:9999px}.ecp-vp-track-info{width:100%;min-width:0}.ecp-vp-track-name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ecp-vp-track-name--light{color:#374151}.ecp-vp-track-name--dark{color:#f3f4f6}.ecp-vp-track-author{font-size:.75rem}.ecp-vp-track-author--light{color:#6b7280}.ecp-vp-track-author--dark{color:#d1d5db}.ecp-vp-seekbar{margin-bottom:1.5rem}.ecp-vp-seekbar-row{display:flex;align-items:center;gap:.25rem}.ecp-vp-time{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:3rem}.ecp-vp-time--right{text-align:right}.ecp-vp-time--light{color:#4b5563}.ecp-vp-time--dark{color:#f3f4f6}.ecp-vp-seek-input{flex:1;height:.5rem;background:#e5e7eb;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-vp-seek-input:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-seek-input::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-vp-seek-input::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-vp-controls{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.ecp-vp-controls--sm{gap:.5rem}.ecp-vp-play-btn{padding:.5rem 1rem;min-width:6rem;border-radius:9999px;font-size:.875rem;font-weight:500;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:opacity .15s}.ecp-vp-play-btn:hover{opacity:.9}.ecp-vp-play-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-play-btn--compact{padding:1.25rem .75rem;min-width:unset}.ecp-vp-play-icon-wrap{position:relative;width:1rem;display:flex;align-items:center}.ecp-vp-stop-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-vp-stop-btn--light{background:#374151;color:#fff}.ecp-vp-stop-btn--light:hover{background:#1f2937}.ecp-vp-stop-btn--dark{background:#f3f4f6;color:#000}.ecp-vp-stop-btn--dark:hover{background:#d1d5db}.ecp-vp-stop-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-stop-btn--wide{padding:.5rem 1rem}.ecp-vp-eq-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-vp-eq-btn--off{background:#f3f4f6;color:#374151}.ecp-vp-eq-btn--off:hover{background:#d1d5db}.ecp-vp-eq-btn--on{color:#fff}.ecp-vp-eq-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-eq-btn--wide{padding:.5rem 1rem}.ecp-vp-loop-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-vp-loop-btn--off{background:#f3f4f6;color:#374151}.ecp-vp-loop-btn--off:hover{background:#d1d5db}.ecp-vp-loop-btn--on{color:#fff}.ecp-vp-loop-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-loop-btn--wide{padding:.5rem 1rem}.ecp-vp-loop-icon--active{transform:rotate(180deg)}.ecp-vp-speed-wrap{display:flex;align-items:center}.ecp-vp-speed-select{border-radius:9999px;font-size:.875rem;font-weight:500;border:none;outline:none;cursor:pointer;transition:all .15s;background:transparent}.ecp-vp-speed-select--light{color:#1f2937}.ecp-vp-speed-select--dark{color:#e5e7eb}.ecp-vp-speed-option--light{background:#fff;color:#1f2937}.ecp-vp-speed-option--dark{background:#1f2937;color:#f3f4f6}.ecp-vp-volume{display:flex;align-items:center;gap:.25rem;margin-left:auto}@media (min-width: 768px){.ecp-vp-volume{gap:.75rem}}.ecp-vp-mute-btn{padding:.5rem;border-radius:9999px;background:none;border:none;cursor:pointer;transition:all .15s}.ecp-vp-mute-btn:hover{background:#f3f4f680}.ecp-vp-mute-icon--light{color:#4b5563}.ecp-vp-mute-icon--dark{color:#f3f4f6}.ecp-vp-volume-slider{width:6rem;height:.5rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-vp-volume-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-vp-volume-slider::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}@media (max-width: 460px){.ecp-vp-volume-slider{display:none}}.ecp-vp-volume-pct{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:2.5rem;text-align:right}.ecp-vp-volume-pct--light{color:#374151}.ecp-vp-volume-pct--dark{color:#f3f4f6}.ecp-vp-error{font-size:.875rem;color:#ef4444;background:#fef2f2;padding:.75rem;border-radius:.25rem;margin-bottom:1rem;border:1px solid #fca5a5}.ecp-wave-outer{width:100%;max-width:32rem;position:relative}.ecp-wave-audio-el{display:none}.ecp-wave-card{border-radius:1rem;box-shadow:0 25px 50px -12px #00000040}.ecp-wave-card-inner{border-radius:1rem;padding:1.5rem;-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px)}.ecp-wave-thumbnail-wrap{width:100%;padding:1rem}.ecp-wave-thumbnail{width:100%;aspect-ratio:1 / 1;border-radius:.75rem}.ecp-wave-seek{position:relative;height:5rem;margin-bottom:1.5rem;cursor:pointer}.ecp-wave-bars{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:flex-end;justify-content:center;height:100%;width:100%;gap:1px}.ecp-wave-bar{width:.25rem;border-radius:.25rem .25rem 0 0;transition:all .15s}.ecp-wave-progress-line{position:absolute;top:0;height:100%;width:.25rem;background:#fff;border-right:1px solid black;border-radius:9999px;transition:all .15s;transform:translate(-50%)}.ecp-wave-times{display:flex;justify-content:space-between;font-size:.875rem;margin-bottom:1.5rem}.ecp-wave-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;justify-content:space-between;margin-bottom:1rem}.ecp-wave-left-controls{display:flex;align-items:center;gap:.5rem}.ecp-wave-vol-btn{padding:.5rem;border-radius:9999px;border:none;cursor:pointer;transition:all .15s}.ecp-wave-vol-slider{width:5rem;height:.375rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-wave-vol-slider::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 1px 3px #0003}.ecp-wave-vol-slider::-moz-range-thumb{width:14px;height:14px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none}.ecp-wave-center-controls{display:flex;justify-content:center}.ecp-wave-play-btn{padding:1rem;border-radius:9999px;border:none;cursor:pointer;transition:all .15s;box-shadow:0 10px 15px -3px #0000001a}.ecp-wave-play-btn:hover{transform:scale(1.05)}.ecp-wave-right-controls{display:flex;align-items:center;gap:.75rem}.ecp-wave-speed-select{padding:.25rem .5rem;border-radius:.5rem;font-size:.875rem;border:none;cursor:pointer}.ecp-wave-speed-select--light{background:#f3f4f6;color:#374151}.ecp-wave-speed-select--dark{background:#1f2937;color:#f3f4f6}.ecp-wave-eq-btn{padding:.5rem;border-radius:9999px;border:none;cursor:pointer;transition:all .15s}.ecp-wave-eq-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#0003;display:flex;align-items:center;justify-content:center;z-index:10;border-radius:1rem;padding:1rem}.ecp-wave-eq-panel{max-width:20rem;width:100%;padding:.5rem 1rem 1rem;border-radius:.75rem}.ecp-wave-eq-panel--light{background:#fff}.ecp-wave-eq-panel--dark{background:#1f2937}.ecp-wave-eq-title{font-size:1.125rem;font-weight:500;margin-bottom:.5rem}.ecp-wave-eq-title--light{color:#374151}.ecp-wave-eq-title--dark{color:#e5e7eb}.ecp-wave-eq-bands{display:flex;flex-direction:column;gap:1rem}.ecp-wave-eq-band-header{display:flex;justify-content:space-between;margin-bottom:.25rem}.ecp-wave-eq-label--light{font-size:.75rem;color:#4b5563}.ecp-wave-eq-label--dark{font-size:.75rem;color:#d1d5db}.ecp-wave-eq-range-row{display:flex;align-items:center;gap:.75rem}.ecp-wave-eq-bound--light{font-size:.75rem;color:#6b7280}.ecp-wave-eq-bound--dark{font-size:.75rem;color:#9ca3af}.ecp-wave-eq-slider{flex:1;height:1rem;background:#d1d5db;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-wave-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-wave-eq-slider::-moz-range-thumb{width:0;height:0;background:transparent;border:none}.ecp-wave-eq-footer{display:flex;justify-content:space-between;margin-top:1.5rem}.ecp-wave-eq-footer-btn{padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;cursor:pointer;border:none;transition:all .15s}.ecp-wave-eq-footer-btn--light{background:#e5e7eb;color:#374151}.ecp-wave-eq-footer-btn--light:hover{background:#d1d5db}.ecp-wave-eq-footer-btn--dark{background:#374151;color:#e5e7eb}.ecp-wave-eq-footer-btn--dark:hover{background:#4b5563}.ecp-wave-error{padding:1.5rem;border-radius:.75rem;text-align:center}.ecp-wave-error-title{font-weight:500}.ecp-wave-error-msg{font-size:.875rem}.ecp-wave-error--light{color:#dc2626}.ecp-wave-error--dark{color:#fca5a5}.ecp-nano-wrapper{position:relative;overflow:hidden;display:inline-flex;flex-direction:column;padding:.5rem .75rem;box-shadow:0 10px 15px -3px #0000001a}.ecp-nano-wrapper--pill{border-radius:9999px;width:110px;height:40px}.ecp-nano-wrapper--card{border-radius:1rem;width:120px;height:150px}.ecp-nano-progress-bg{position:absolute;top:0;left:0;height:100%;opacity:.2}.ecp-nano-content{position:absolute;display:flex;flex-direction:column}.ecp-nano-thumbnail-wrap{width:6rem;padding-bottom:.5rem}.ecp-nano-thumbnail{width:6rem;aspect-ratio:1 / 1;border-radius:.75rem}.ecp-nano-row{display:flex;align-items:center;gap:.5rem}.ecp-nano-play-btn{padding:.375rem;border-radius:9999px;border:none;cursor:pointer;flex-shrink:0;transition:transform .15s}.ecp-nano-play-btn:hover{transform:scale(1.1)}.ecp-nano-waveform{display:flex;width:100%;min-width:3rem;align-items:center;gap:2px;height:1.5rem}.ecp-nano-wave-bar{border-radius:9999px;width:100%;transition:height .2s}.ecp-video-wrapper{border-radius:.75rem;overflow:hidden;transition:all .3s cubic-bezier(.4,0,.2,1)}.ecp-video-wrapper--fullscreen{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;flex-direction:column;height:100vh;width:100vw;background:#000}.ecp-video-inner{height:auto}.ecp-video-inner--fullscreen{display:flex;flex-direction:column;flex:1;min-height:0}.ecp-video-inner--padded{padding:1rem}.ecp-video-name{margin-bottom:1rem;font-weight:500}.ecp-video-name--light{color:#374151}.ecp-video-name--dark{color:#f3f4f6}.ecp-video-layout{position:relative;margin-bottom:1rem}.ecp-video-layout--row{display:flex;gap:.75rem}.ecp-video-layout--col{display:flex;flex-direction:column;gap:.75rem}.ecp-video-layout--fullscreen{flex:1;min-height:0}.ecp-video-vu-top,.ecp-video-vu-bottom{width:100%;height:3rem}.ecp-video-vu-side{width:3rem;background:#00000080;border-radius:.5rem;padding:.25rem}.ecp-video-el-wrap{flex:1;border-radius:.5rem;overflow:hidden;position:relative}.ecp-video-el-wrap--light{background:#ffffffb3}.ecp-video-el-wrap--dark{background:#000000b3}.ecp-video-el{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.ecp-video-eq-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;width:100%;justify-content:center;z-index:10;border-radius:.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d;transition:all .3s}.ecp-video-eq-panel{max-width:600px;width:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:center;border-radius:.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d;transition:all .3s}.ecp-video-eq-panel--light{background:#fffc}.ecp-video-eq-panel--dark{background:#000000b3}.ecp-video-eq-title{font-size:.875rem;font-weight:500;margin-bottom:1rem}.ecp-video-eq-title--light{color:#374151}.ecp-video-eq-title--dark{color:#e5e7eb}.ecp-video-eq-bands{display:flex;flex-direction:column;gap:1rem}.ecp-video-eq-band-header{display:flex;justify-content:space-between;margin-bottom:.25rem}.ecp-video-eq-label--light{font-size:.75rem;color:#4b5563}.ecp-video-eq-label--dark{font-size:.75rem;color:#d1d5db}.ecp-video-eq-range-row{display:flex;align-items:center;gap:.75rem}.ecp-video-eq-bound--light{font-size:.75rem;color:#6b7280}.ecp-video-eq-bound--dark{font-size:.75rem;color:#9ca3af}.ecp-video-eq-slider{flex:1;height:1.5rem;background:#d1d5db;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-video-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-video-eq-slider::-moz-range-thumb{width:0;height:0;background:transparent;border:none}.ecp-video-eq-footer{display:flex;justify-content:space-between;margin-top:1.5rem}.ecp-video-eq-footer-btn{padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;cursor:pointer;border:none;transition:all .15s}.ecp-video-eq-footer-btn--light{background:#e5e7eb;color:#374151}.ecp-video-eq-footer-btn--light:hover{background:#d1d5db}.ecp-video-eq-footer-btn--dark{background:#374151;color:#e5e7eb}.ecp-video-eq-footer-btn--dark:hover{background:#4b5563}.ecp-video-seekbar{margin-bottom:1rem}.ecp-video-seekbar--fullscreen{margin-top:.75rem}.ecp-video-seekbar-row{display:flex;align-items:center;gap:.75rem}.ecp-video-time{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:3rem}.ecp-video-time--right{text-align:right}.ecp-video-time--light{color:#4b5563}.ecp-video-time--dark{color:#f3f4f6}.ecp-video-seek-input{flex:1;height:.5rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-video-seek-input:disabled{opacity:.4;cursor:not-allowed}.ecp-video-seek-input::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-video-seek-input::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-video-controls{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.ecp-video-play-btn{border-radius:9999px;font-size:.875rem;font-weight:500;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:opacity .15s;padding:.5rem 1rem}.ecp-video-play-btn:hover{opacity:.9}.ecp-video-play-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-video-play-btn--compact{padding:1.25rem .75rem}.ecp-video-play-icon-wrap{position:relative;width:1rem;display:flex;align-items:center}.ecp-video-stop-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-video-stop-btn--light{background:#374151;color:#fff}.ecp-video-stop-btn--light:hover{background:#1f2937}.ecp-video-stop-btn--dark{background:#f3f4f6;color:#000}.ecp-video-stop-btn--dark:hover{background:#d1d5db}.ecp-video-stop-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-video-fullscreen-btn{border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s;padding:.75rem}.ecp-video-fullscreen-btn--light{background:#374151;color:#fff}.ecp-video-fullscreen-btn--light:hover{background:#1f2937}.ecp-video-fullscreen-btn--dark{background:#f3f4f6;color:#000}.ecp-video-fullscreen-btn--dark:hover{background:#d1d5db}.ecp-video-fullscreen-btn--wide{padding:.5rem 1rem}.ecp-video-eq-toggle-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-video-eq-toggle-btn--off{background:#f3f4f6;color:#374151}.ecp-video-eq-toggle-btn--off:hover{background:#d1d5db}.ecp-video-eq-toggle-btn--on{color:#fff}.ecp-video-eq-toggle-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-video-eq-toggle-btn--wide{padding:.5rem 1rem}.ecp-video-speed-wrap{display:flex;align-items:center}.ecp-video-speed-select{border-radius:9999px;font-size:.875rem;font-weight:500;border:none;outline:none;cursor:pointer;background:transparent;transition:all .15s}.ecp-video-speed-select--light{color:#1f2937}.ecp-video-speed-select--dark{color:#e5e7eb}.ecp-video-speed-option--light{background:#f3f4f6;color:#1f2937}.ecp-video-speed-option--dark{background:#1f2937;color:#f3f4f6}.ecp-video-volume{display:flex;align-items:center;gap:.25rem;margin-left:auto}@media (min-width: 768px){.ecp-video-volume{gap:.75rem}}.ecp-video-mute-btn{padding:.5rem;border-radius:.5rem;background:none;border:none;cursor:pointer;transition:all .15s}.ecp-video-mute-btn:hover{background:#f3f4f6}.ecp-video-mute-icon--light{color:#4b5563}.ecp-video-mute-icon--dark{color:#f3f4f6}.ecp-video-vol-slider{width:6rem;height:.5rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-video-vol-slider::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-video-vol-slider::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}@media (max-width: 460px){.ecp-video-vol-slider{display:none}}.ecp-video-vol-pct{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:2.5rem;text-align:right}.ecp-video-vol-pct--light{color:#374151}.ecp-video-vol-pct--dark{color:#f3f4f6}.ecp-video-error{font-size:.875rem;color:#ef4444;background:#fef2f2;padding:.75rem;border-radius:.25rem;margin-bottom:1rem;border:1px solid #fca5a5}.ecp-vu-bar-wrap{flex:1;height:100%;position:relative;display:flex;flex-direction:column;justify-content:flex-end}.ecp-vu-bar-fill{border-radius:.25rem .25rem 0 0;transition:height 75ms}.ecp-vu-peak-line{position:absolute;width:100%;height:2px;transition:top .1s}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
2
  (function(ie,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],e):(ie=typeof globalThis<"u"?globalThis:ie||self,e(ie.EcPlayer={},ie.ReactJSXRuntime,ie.React))})(this,function(ie,e,r){"use strict";/**
3
3
  * @license lucide-react v0.540.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
- */const Ir=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dr=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(p,u,b)=>b?b.toUpperCase():u.toLowerCase()),lr=l=>{const p=Dr(l);return p.charAt(0).toUpperCase()+p.slice(1)},ir=(...l)=>l.filter((p,u,b)=>!!p&&p.trim()!==""&&b.indexOf(p)===u).join(" ").trim(),_r=l=>{for(const p in l)if(p.startsWith("aria-")||p==="role"||p==="title")return!0};/**
7
+ */const Dr=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ir=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(p,u,b)=>b?b.toUpperCase():u.toLowerCase()),lr=l=>{const p=Ir(l);return p.charAt(0).toUpperCase()+p.slice(1)},ir=(...l)=>l.filter((p,u,b)=>!!p&&p.trim()!==""&&b.indexOf(p)===u).join(" ").trim(),_r=l=>{for(const p in l)if(p.startsWith("aria-")||p==="role"||p==="title")return!0};/**
8
8
  * @license lucide-react v0.540.0 - ISC
9
9
  *
10
10
  * This source code is licensed under the ISC license.
@@ -19,7 +19,7 @@
19
19
  *
20
20
  * This source code is licensed under the ISC license.
21
21
  * See the LICENSE file in the root directory of this source tree.
22
- */const fe=(l,p)=>{const u=r.forwardRef(({className:b,...x},v)=>r.createElement(jr,{ref:v,iconNode:p,className:ir(`lucide-${Ir(lr(l))}`,`lucide-${l}`,b),...x}));return u.displayName=lr(l),u};/**
22
+ */const fe=(l,p)=>{const u=r.forwardRef(({className:b,...x},v)=>r.createElement(jr,{ref:v,iconNode:p,className:ir(`lucide-${Dr(lr(l))}`,`lucide-${l}`,b),...x}));return u.displayName=lr(l),u};/**
23
23
  * @license lucide-react v0.540.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
@@ -74,16 +74,16 @@
74
74
  *
75
75
  * This source code is licensed under the ISC license.
76
76
  * See the LICENSE file in the root directory of this source tree.
77
- */const ar=fe("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]),ke={rainbow:{name:"Rainbow",bg:"linear-gradient(135deg, #ef444422 0%, #f9731622 15%, #f59e0b22 30%, #10b98122 45%, #06b6d422 60%, #3b82f622 75%, #6366f122 85%, #a855f722 92%, #ec489922 100%)",bars:["#ef4444","#f97316","#f59e0b","#eab308","#84cc16","#22c55e","#10b981","#06b6d4","#0ea5e9","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e"],peak:"#a0a0a0ff",button:"#ec4899",buttonHover:"#d946ef",slider:"#ec4899"},ocean:{name:"Ocean Blue",bg:"linear-gradient(135deg, #667eea43 0%, #764ba243 100%)",bars:["#0ea5e9","#38bdf8","#06b6d4","#22d3ee"],peak:"#0369a1",button:"#0ea5e9",buttonHover:"#0284c7",slider:"#0ea5e9"},sunset:{name:"Sunset",bg:"linear-gradient(135deg, #f093fb43 0%, #f5576c43 100%)",bars:["#f43f5e","#fb7185","#fda4af","#fecdd3"],peak:"#be123c",button:"#f43f5e",buttonHover:"#e11d48",slider:"#f43f5e"},forest:{name:"Forest Green",bg:"linear-gradient(135deg, #0ba36043 0%, #3cba9243 100%)",bars:["#10b981","#34d399","#6ee7b7","#a7f3d0"],peak:"#047857",button:"#10b981",buttonHover:"#059669",slider:"#10b981"},midnight:{name:"Midnight",bg:"linear-gradient(135deg, #2c3e5043 0%, #3498db43 100%)",bars:["#3b82f6","#60a5fa","#93c5fd","#bfdbfe"],peak:"#1e40af",button:"#3b82f6",buttonHover:"#2563eb",slider:"#3b82f6"},neon:{name:"Neon Cyan",bg:"linear-gradient(135deg, #13547a43 0%, #80d0c743 100%)",bars:["#06b6d4","#22d3ee","#67e8f9","#a5f3fc"],peak:"#0e7490",button:"#06b6d4",buttonHover:"#0891b2",slider:"#06b6d4"},purple:{name:"Royal Purple",bg:"linear-gradient(135deg, #2f1c5622 0%, #764ba243 100%)",bars:["#8b5cf6","#a78bfa","#baabf9ff","#ddd6fe"],peak:"#6d28d9",button:"#8b5cf6",buttonHover:"#7c3aed",slider:"#8b5cf6"},amber:{name:"Amber Gold",bg:"linear-gradient(135deg, #f59e0b43 0%, #d9770643 100%)",bars:["#f59e0b","#fbbf24","#fcd34d","#fde68a"],peak:"#b45309",button:"#f59e0b",buttonHover:"#d97706",slider:"#f59e0b"},rose:{name:"Rose Pink",bg:"linear-gradient(135deg, #ec489943 0%, #be185d43 100%)",bars:["#ec4899","#f472b6","#f9a8d4","#fbcfe8"],peak:"#9f1239",button:"#ec4899",buttonHover:"#db2777",slider:"#ec4899"}};function pr({theme:l,setTheme:p,close:u}){const b=Object.keys(ke).map(x=>({key:x,name:ke[x].name,colors:ke[x].bars}));return e.jsxs("div",{className:"ecp-theme-selector-panel",children:[e.jsxs("div",{className:"ecp-theme-selector-header",children:[e.jsx("h2",{className:"ecp-theme-selector-title",children:"Choose Color Palette"}),e.jsx("button",{onClick:()=>u(),className:"ecp-theme-selector-close",children:"Close"})]}),e.jsx("div",{className:"ecp-theme-grid",children:b.map(x=>e.jsxs("div",{className:`ecp-theme-card${l===x.key?" ecp-theme-card--active":""}`,onClick:()=>p(x.key),children:[e.jsx("div",{className:"ecp-theme-color-preview",style:{background:`linear-gradient(to right, ${x.colors.join(", ")})`}}),e.jsx("div",{className:"ecp-theme-name",children:x.name})]},x.key))})]})}const dr=(l,p)=>{const u=l.sampleRate,b=Math.max(1,Math.floor(u*Math.max(.1,p))),x=l.createBuffer(2,b,u),v=x.getChannelData(0),y=x.getChannelData(1),J=3/p;for(let E=0;E<b;E++){const F=E/u,G=Math.exp(-F*J);v[E]=(Math.random()*2-1)*G,y[E]=(Math.random()*2-1)*G}return x},ur=l=>{const p=Math.max(0,l),u=44100,b=new Float32Array(u),x=Math.PI/180;if(p===0)for(let v=0;v<u;++v)b[v]=v*2/u-1;else for(let v=0;v<u;++v){const y=v*2/u-1;b[v]=(3+p)*y*20*x/(Math.PI+p*Math.abs(y))}return b};function vr({audio:l,name:p="No track loaded",author:u,theme:b="rainbow",volume:x=100,thumbnail:v=null,controls:y={play:!0,pause:!0,stop:!0,seekbar:!0,volume:!0,loop:!0,trackName:!0,equalizer:!0,speed:!0,dolby8d:!1},mode:J="light",bands:E=null,transparent:F=!1,autoPlay:G=!1,equalizer:W={bass:0,mid:0,treble:0},dolby8d:n=null}){var $r,xr,Er,Cr,Tr,Sr,Pr,Ar,Mr,Fr,zr;const[_,z]=r.useState(!1),[B,V]=r.useState(0),[j,A]=r.useState(0),[S,Pe]=r.useState(x||100),[he,xe]=r.useState(!1),[H,Ae]=r.useState(!1),[ve,ge]=r.useState(!1),[be,U]=r.useState([]),[Z,Me]=r.useState(!1),[X,Ee]=r.useState({bass:W.bass||0,mid:W.mid||0,treble:W.treble||0}),[re,He]=r.useState(1),[k,Ce]=r.useState(0),[te,qe]=r.useState(!1),[o,le]=r.useState({enable:y.dolby8d?(n==null?void 0:n.enable)!==void 0?n.enable:!0:!1,spatial:{rate:(($r=n==null?void 0:n.spatial)==null?void 0:$r.rate)!==void 0?n.spatial.rate:.11,width:((xr=n==null?void 0:n.spatial)==null?void 0:xr.width)!==void 0?n.spatial.width:135,focus:((Er=n==null?void 0:n.spatial)==null?void 0:Er.focus)!==void 0?n.spatial.focus:65},reverb:{size:((Cr=n==null?void 0:n.reverb)==null?void 0:Cr.size)!==void 0?n.reverb.size:2.4,tone:((Tr=n==null?void 0:n.reverb)==null?void 0:Tr.tone)!==void 0?n.reverb.tone:62,mix:((Sr=n==null?void 0:n.reverb)==null?void 0:Sr.mix)!==void 0?n.reverb.mix:30},echo:{time:((Pr=n==null?void 0:n.echo)==null?void 0:Pr.time)!==void 0?n.echo.time:500,feedback:((Ar=n==null?void 0:n.echo)==null?void 0:Ar.feedback)!==void 0?n.echo.feedback:45,mix:((Mr=n==null?void 0:n.echo)==null?void 0:Mr.mix)!==void 0?n.echo.mix:5},tape:{speed:typeof(n==null?void 0:n.tape)=="number"?n.tape:((Fr=n==null?void 0:n.tape)==null?void 0:Fr.speed)!==void 0?n.tape.speed:1,drive:typeof(n==null?void 0:n.tape)=="object"&&((zr=n.tape)==null?void 0:zr.drive)!==void 0?n.tape.drive:0}});r.useEffect(()=>{var t,c,g,f,w,Y,se,R,ee,D,ce;n&&le({enable:n.enable!==void 0?n.enable:!0,spatial:{rate:((t=n.spatial)==null?void 0:t.rate)!==void 0?n.spatial.rate:.2,width:((c=n.spatial)==null?void 0:c.width)!==void 0?n.spatial.width:80,focus:((g=n.spatial)==null?void 0:g.focus)!==void 0?n.spatial.focus:20},reverb:{size:((f=n.reverb)==null?void 0:f.size)!==void 0?n.reverb.size:3,tone:((w=n.reverb)==null?void 0:w.tone)!==void 0?n.reverb.tone:40,mix:((Y=n.reverb)==null?void 0:Y.mix)!==void 0?n.reverb.mix:30},echo:{time:((se=n.echo)==null?void 0:se.time)!==void 0?n.echo.time:50,feedback:((R=n.echo)==null?void 0:R.feedback)!==void 0?n.echo.feedback:20,mix:((ee=n.echo)==null?void 0:ee.mix)!==void 0?n.echo.mix:10},tape:{speed:typeof n.tape=="number"?n.tape:((D=n.tape)==null?void 0:D.speed)!==void 0?n.tape.speed:1,drive:typeof n.tape=="object"&&((ce=n.tape)==null?void 0:ce.drive)!==void 0?n.tape.drive:0}})},[n]);const[oe,me]=r.useState("spatial"),C=r.useRef(o),I=r.useRef(re);r.useEffect(()=>{C.current=o},[o]),r.useEffect(()=>{I.current=re},[re]);const ae=()=>{if(d.current){const t=C.current.enable,c=t?C.current.tape.speed:1,f=!(t&&c!==1);"preservesPitch"in d.current&&(d.current.preservesPitch=f),"webkitPreservesPitch"in d.current&&(d.current.webkitPreservesPitch=f),"mozPreservesPitch"in d.current&&(d.current.mozPreservesPitch=f),d.current.playbackRate=I.current*c}},s=(t,c,g)=>{le(f=>({...f,enable:!0,[t]:{...f[t],[c]:g}}))},q=()=>{le(t=>({...t,enable:!t.enable}))},P=()=>{le({enable:!0,spatial:{rate:.11,width:135,focus:65},reverb:{size:2.4,tone:62,mix:30},echo:{time:500,feedback:45,mix:5},tape:{speed:1,drive:0}})},d=r.useRef(null),$=r.useRef(null),K=r.useRef(null),T=r.useRef(null),pe=r.useRef(null),Te=r.useRef(null),Ne=r.useRef(null),L=r.useRef(null),de=r.useRef(null),Ie=r.useRef(null),Oe=r.useRef(null),We=r.useRef(null),De=r.useRef(null),_e=r.useRef(null),Ue=r.useRef(null),Ge=r.useRef(null),nr=r.useRef(null),Ve=r.useRef(0),Fe=r.useRef(null),we=r.useRef(null),Q=r.useRef(null),ue=r.useRef(null),ze=r.useRef(0),Xe=r.useRef(null),Je=r.useRef(null);r.useEffect(()=>{const t=Je.current;if(!t)return;const c=new ResizeObserver(g=>{for(let f of g)Ce(f.contentRect.width)});return c.observe(t),()=>c.disconnect()},[]),r.useEffect(()=>{const t=[];if(l&&typeof l!="string"&&t.push(["TypeError","audio must be a string (URL or path)"]),p&&typeof p!="string"&&t.push(["TypeError","name must be a string"]),b&&typeof b!="string"&&typeof b!="object")t.push(["TypeError","theme must be a string or a valid theme object"]);else if(typeof b=="object"){const c=["name","bg","bars","peak","button","buttonHover","slider"];for(const g of c)g in b||t.push(["ThemeError",`theme object missing key: ${g}`])}(typeof x!="number"||x<0||x>100)&&t.push(["TypeError","volume must be a number between 0 and 100"]),typeof y!="object"||Array.isArray(y)?t.push(["TypeError","controls must be an object"]):["play","pause","stop","seekbar","volume","loop","trackName","equalizer"].forEach(g=>{y&&g in y&&typeof y[g]!="boolean"&&t.push(["TypeError",`controls.${g} must be a boolean`])}),E&&(Array.isArray(E)?E.length===0?t.push(["ValueError","bands array cannot be empty"]):E.forEach((c,g)=>{typeof c.freq!="number"&&t.push(["TypeError",`bands[${g}].freq must be a number`])}):t.push(["TypeError","bands must be an array"])),t.length>0?(U(t),console.group("%cVisualizePlayer: Prop validation failed","color:red"),t.forEach(c=>console.error(`${c[0]}: ${c[1]}`)),console.groupEnd()):U([])},[l,p,b,x,y,J,E]);const a=E||[{freq:0},{freq:10},{freq:20},{freq:25},{freq:31.5},{freq:40},{freq:50},{freq:63},{freq:80},{freq:100},{freq:125},{freq:160},{freq:200},{freq:250},{freq:315},{freq:400},{freq:500},{freq:630},{freq:800},{freq:1e3},{freq:1250},{freq:1600},{freq:2e3},{freq:2500},{freq:3150},{freq:4e3},{freq:5e3},{freq:6300},{freq:8e3},{freq:1e4},{freq:12500}],h=r.useRef(a.map(()=>0)),N=r.useRef(a.map(()=>0)),M=r.useRef(a.map(()=>0)),O=r.useRef(!1),ne=r.useRef(typeof b=="string"?b:"purple"),i=typeof b=="string"?ke[b]||ke.purple:typeof b=="object"?b:ke.purple,m=J==="dark",sr=typeof y=="object"&&Object.keys(y).length===0;r.useEffect(()=>{typeof b=="string"?ne.current=b:ne.current="purple",Be()},[b]),r.useEffect(()=>{d.current||(d.current=new Audio);const t=d.current,c=()=>{ve||V(t.currentTime)},g=()=>A(t.duration),f=()=>{H||(z(!1),Q.current&&cancelAnimationFrame(Q.current))},w=()=>{z(!0),ae()},Y=()=>z(!1);return t.addEventListener("timeupdate",c),t.addEventListener("loadedmetadata",g),t.addEventListener("ended",f),t.addEventListener("play",w),t.addEventListener("pause",Y),()=>{t.removeEventListener("timeupdate",c),t.removeEventListener("loadedmetadata",g),t.removeEventListener("ended",f),t.removeEventListener("play",w),t.removeEventListener("pause",Y)}},[ve,H]),r.useEffect(()=>()=>{ue.current&&clearInterval(ue.current),d.current&&(d.current.pause(),d.current.src="",d.current.load()),$.current&&$.current.close().catch(t=>console.warn("AudioContext cleanup error:",t)),Q.current&&cancelAnimationFrame(Q.current)},[]),r.useEffect(()=>{if(l){const t=_,c=S,g=H;if(Q.current&&(cancelAnimationFrame(Q.current),Q.current=null),T.current){try{T.current.disconnect()}catch{}T.current=null}if(K.current){try{K.current.disconnect()}catch{}K.current=null}if(pe.current){try{pe.current.disconnect()}catch{}pe.current=null}if(Te.current){try{Te.current.disconnect()}catch{}Te.current=null}if(Ne.current){try{Ne.current.disconnect()}catch{}Ne.current=null}$.current&&($.current.close().catch(D=>console.warn("AudioContext close error:",D)),$.current=null),d.current&&(d.current.pause(),d.current.src="",d.current.load()),d.current=new Audio;try{d.current.crossOrigin="anonymous"}catch{}d.current.src=l,d.current.preload="auto",d.current.muted=!1,d.current.volume=he?0:c/100,d.current.loop=g,d.current.load();const f=d.current,w=()=>{ve||V(f.currentTime)},Y=()=>A(f.duration),se=()=>{H||(z(!1),Q.current&&cancelAnimationFrame(Q.current))},R=()=>{z(!0),ae()},ee=()=>z(!1);f.addEventListener("timeupdate",w),f.addEventListener("loadedmetadata",Y),f.addEventListener("ended",se),f.addEventListener("play",R),f.addEventListener("pause",ee),V(0),z(!1),h.current=a.map(()=>0),N.current=a.map(()=>0),M.current=a.map(()=>0),Be(),t&&d.current.play().catch(D=>console.error("Play failed:",D))}},[l]),r.useEffect(()=>{d.current&&(d.current.volume=he?0:S/100)},[S,he]),r.useEffect(()=>{d.current&&(d.current.loop=H)},[H]),r.useEffect(()=>{ae()},[re,o.tape.speed,o.enable]),r.useEffect(()=>{$.current&&(pe.current&&(pe.current.gain.value=X.bass),Te.current&&(Te.current.gain.value=X.mid),Ne.current&&(Ne.current.gain.value=X.treble))},[X]),r.useEffect(()=>{if($.current){const t=o.enable;if(Ge.current&&(Ge.current.curve=ur(t?o.tape.drive:0)),Oe.current&&(Oe.current.frequency.value=o.reverb.tone/100*8e3+500),We.current&&(We.current.gain.value=t?o.reverb.mix/100:0),Ie.current&&$.current)try{Ie.current.buffer=dr($.current,o.reverb.size)}catch{}if(De.current&&(De.current.delayTime.value=Math.max(.01,o.echo.time/1e3)),_e.current&&(_e.current.gain.value=t?Math.min(.85,o.echo.feedback/100):0),Ue.current&&(Ue.current.gain.value=t?o.echo.mix/100:0),!t&&(de.current&&(de.current.pan.value=0),L.current&&$.current)){const c=$.current.currentTime;L.current.positionX?(L.current.positionX.setTargetAtTime(0,c,.01),L.current.positionY.setTargetAtTime(0,c,.01),L.current.positionZ.setTargetAtTime(-1.4,c,.01)):L.current.setPosition&&L.current.setPosition(0,0,-1.4)}}},[o]);const gr=()=>{if(!$.current||!O.current)return;const t=C.current;if(!t.enable)return;const c=performance.now(),g=ze.current?Math.min(.1,(c-ze.current)/1e3):.016;ze.current=c;const f=t.spatial.rate;Ve.current+=f*5*g;const w=Ve.current,se=2.3*(t.spatial.width/135),R=Math.sin(w)*se,ee=-Math.cos(w)*se,D=Math.sin(w*2)*.4,ce=$.current.currentTime;if(L.current&&(L.current.positionX?(L.current.positionX.setTargetAtTime(R,ce,.04),L.current.positionY.setTargetAtTime(D,ce,.04),L.current.positionZ.setTargetAtTime(ee,ce,.04)):L.current.setPosition&&L.current.setPosition(R,D,ee)),de.current){const ye=Math.sin(w)*(t.spatial.width/180),Se=(t.spatial.focus-50)/100,je=Math.max(-1,Math.min(1,ye+Se));de.current.pan.setTargetAtTime(je,ce,.04)}};r.useEffect(()=>{O.current=_,Q.current&&(cancelAnimationFrame(Q.current),Q.current=null),ue.current&&(clearInterval(ue.current),ue.current=null),_?($.current||Xr(),ze.current=performance.now(),ue.current=window.setInterval(gr,30),yr()):mr()},[_]);const Xr=()=>{if(!$.current&&d.current)try{const t=window.AudioContext||window.webkitAudioContext;if(t){const c=new t;$.current=c;const g=c.createBiquadFilter();g.type="lowshelf",g.frequency.value=320,g.gain.value=X.bass;const f=c.createBiquadFilter();f.type="peaking",f.frequency.value=1e3,f.Q.value=.5,f.gain.value=X.mid;const w=c.createBiquadFilter();w.type="highshelf",w.frequency.value=3200,w.gain.value=X.treble;const Y=c.createWaveShaper();Y.curve=ur(C.current.enable?C.current.tape.drive:0),ae();let se=null;try{const $e=c.createPanner();$e.panningModel="HRTF",$e.distanceModel="inverse",$e.refDistance=1.4,$e.rolloffFactor=.55,se=$e}catch{}let R=null;if(c.createStereoPanner){const $e=c.createStereoPanner();$e.pan.value=0,R=$e}const ee=c.createGain();ee.gain.value=1;const D=c.createConvolver();D.buffer=dr(c,C.current.reverb.size);const ce=c.createBiquadFilter();ce.type="lowpass",ce.frequency.value=C.current.reverb.tone/100*8e3+500;const ye=c.createGain();ye.gain.value=C.current.enable?C.current.reverb.mix/100:0;const Se=c.createDelay(2);Se.delayTime.value=C.current.echo.time/1e3;const je=c.createGain();je.gain.value=Math.min(.85,C.current.echo.feedback/100);const Re=c.createGain();Re.gain.value=C.current.enable?C.current.echo.mix/100:0,Se.connect(je),je.connect(Se);const Le=c.createAnalyser();Le.fftSize=8192,Le.smoothingTimeConstant=.7;const Lr=c.createMediaElementSource(d.current);Lr.connect(g),g.connect(f),f.connect(w),w.connect(Y);const er=se,Ye=R,cr=er||Ye||Y;er?(Y.connect(er),Ye&&er.connect(Ye)):Ye&&Y.connect(Ye),cr.connect(ee),ee.connect(Le),cr.connect(D),D.connect(ce),ce.connect(ye),ye.connect(Le),cr.connect(Se),Se.connect(Re),Re.connect(Le),Le.connect(c.destination),pe.current=g,Te.current=f,Ne.current=w,Ge.current=Y,L.current=se,de.current=R,nr.current=ee,Ie.current=D,Oe.current=ce,We.current=ye,De.current=Se,_e.current=je,Ue.current=Re,K.current=Le,T.current=Lr}}catch(t){console.error("Failed to setup audio context:",t)}},br=t=>{const c=$.current,g=K.current;if(!c||!g)return 0;const f=c.sampleRate/2,w=Math.round(t/f*g.frequencyBinCount);return Math.min(w,g.frequencyBinCount-1)},mr=()=>{if(O.current)return;h.current=h.current.map(f=>f*.7);const t=Date.now();N.current=N.current.map((f,w)=>t-M.current[w]>1500?f*.95:f),Be();const c=Math.max(...h.current),g=Math.max(...N.current);c>.01||g>.01?Q.current=requestAnimationFrame(mr):(O.current||(h.current=a.map(()=>0),N.current=a.map(()=>0),M.current=a.map(()=>0),Be()),Q.current&&cancelAnimationFrame(Q.current),Q.current=null)},yr=()=>{if(!K.current||!O.current)return;const t=C.current;if(t.enable&&$.current){gr();const f=Ve.current,w=t.spatial.width/135;if(Fe.current){const Y=85*(w>0?1:0),se=55*(w>0?1:0),R=Math.sin(f)*Y,ee=-Math.cos(f)*se;Fe.current.style.transform=`translate(${R}px, ${ee}px)`,we.current&&(we.current.setAttribute("x2",`${110+R}`),we.current.setAttribute("y2",`${75+ee}`))}}else if($.current){const f=$.current.currentTime;L.current&&(L.current.positionX?(L.current.positionX.setTargetAtTime(0,f,.04),L.current.positionY.setTargetAtTime(0,f,.04),L.current.positionZ.setTargetAtTime(-1.4,f,.04)):L.current.setPosition&&L.current.setPosition(0,0,-1.4)),de.current&&de.current.pan.setTargetAtTime(0,f,.04),Fe.current&&(Fe.current.style.transform="translate(0px, 0px)"),we.current&&(we.current.setAttribute("x2","110"),we.current.setAttribute("y2","20"))}const c=K.current.frequencyBinCount,g=new Uint8Array(c);K.current.getByteFrequencyData(g),a.forEach((f,w)=>{const Y=br(f.freq),se=w<a.length-1?br(a[w+1].freq):g.length;let R=0,ee=0;for(let ye=Y;ye<se;ye++)R+=g[ye],ee++;let D=ee>0?R/ee/255:0;D=Math.pow(D,.6),h.current[w]=h.current[w]*.8+D*.2;const ce=Date.now();h.current[w]>N.current[w]?(N.current[w]=h.current[w],M.current[w]=ce):ce-M.current[w]>1500&&(N.current[w]*=.95)}),Be(),Q.current=requestAnimationFrame(yr)},Be=()=>{if(!Xe.current)return;const t=ke[ne.current]||ke.rainbow;let c="";a.forEach((g,f)=>{const w=h.current[f]*100,Y=100-N.current[f]*100,se=Math.floor(f/a.length*t.bars.length),R=t.bars[Math.min(se,t.bars.length-1)];c+=`
77
+ */const ar=fe("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]),ke={rainbow:{name:"Rainbow",bg:"linear-gradient(135deg, #ef444422 0%, #f9731622 15%, #f59e0b22 30%, #10b98122 45%, #06b6d422 60%, #3b82f622 75%, #6366f122 85%, #a855f722 92%, #ec489922 100%)",bars:["#ef4444","#f97316","#f59e0b","#eab308","#84cc16","#22c55e","#10b981","#06b6d4","#0ea5e9","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e"],peak:"#a0a0a0ff",button:"#ec4899",buttonHover:"#d946ef",slider:"#ec4899"},ocean:{name:"Ocean Blue",bg:"linear-gradient(135deg, #667eea43 0%, #764ba243 100%)",bars:["#0ea5e9","#38bdf8","#06b6d4","#22d3ee"],peak:"#0369a1",button:"#0ea5e9",buttonHover:"#0284c7",slider:"#0ea5e9"},sunset:{name:"Sunset",bg:"linear-gradient(135deg, #f093fb43 0%, #f5576c43 100%)",bars:["#f43f5e","#fb7185","#fda4af","#fecdd3"],peak:"#be123c",button:"#f43f5e",buttonHover:"#e11d48",slider:"#f43f5e"},forest:{name:"Forest Green",bg:"linear-gradient(135deg, #0ba36043 0%, #3cba9243 100%)",bars:["#10b981","#34d399","#6ee7b7","#a7f3d0"],peak:"#047857",button:"#10b981",buttonHover:"#059669",slider:"#10b981"},midnight:{name:"Midnight",bg:"linear-gradient(135deg, #2c3e5043 0%, #3498db43 100%)",bars:["#3b82f6","#60a5fa","#93c5fd","#bfdbfe"],peak:"#1e40af",button:"#3b82f6",buttonHover:"#2563eb",slider:"#3b82f6"},neon:{name:"Neon Cyan",bg:"linear-gradient(135deg, #13547a43 0%, #80d0c743 100%)",bars:["#06b6d4","#22d3ee","#67e8f9","#a5f3fc"],peak:"#0e7490",button:"#06b6d4",buttonHover:"#0891b2",slider:"#06b6d4"},purple:{name:"Royal Purple",bg:"linear-gradient(135deg, #2f1c5622 0%, #764ba243 100%)",bars:["#8b5cf6","#a78bfa","#baabf9ff","#ddd6fe"],peak:"#6d28d9",button:"#8b5cf6",buttonHover:"#7c3aed",slider:"#8b5cf6"},amber:{name:"Amber Gold",bg:"linear-gradient(135deg, #f59e0b43 0%, #d9770643 100%)",bars:["#f59e0b","#fbbf24","#fcd34d","#fde68a"],peak:"#b45309",button:"#f59e0b",buttonHover:"#d97706",slider:"#f59e0b"},rose:{name:"Rose Pink",bg:"linear-gradient(135deg, #ec489943 0%, #be185d43 100%)",bars:["#ec4899","#f472b6","#f9a8d4","#fbcfe8"],peak:"#9f1239",button:"#ec4899",buttonHover:"#db2777",slider:"#ec4899"}};function pr({theme:l,setTheme:p,close:u}){const b=Object.keys(ke).map(x=>({key:x,name:ke[x].name,colors:ke[x].bars}));return e.jsxs("div",{className:"ecp-theme-selector-panel",children:[e.jsxs("div",{className:"ecp-theme-selector-header",children:[e.jsx("h2",{className:"ecp-theme-selector-title",children:"Choose Color Palette"}),e.jsx("button",{onClick:()=>u(),className:"ecp-theme-selector-close",children:"Close"})]}),e.jsx("div",{className:"ecp-theme-grid",children:b.map(x=>e.jsxs("div",{className:`ecp-theme-card${l===x.key?" ecp-theme-card--active":""}`,onClick:()=>p(x.key),children:[e.jsx("div",{className:"ecp-theme-color-preview",style:{background:`linear-gradient(to right, ${x.colors.join(", ")})`}}),e.jsx("div",{className:"ecp-theme-name",children:x.name})]},x.key))})]})}const dr=(l,p)=>{const u=l.sampleRate,b=Math.max(1,Math.floor(u*Math.max(.1,p))),x=l.createBuffer(2,b,u),v=x.getChannelData(0),y=x.getChannelData(1),J=3/p;for(let E=0;E<b;E++){const F=E/u,G=Math.exp(-F*J);v[E]=(Math.random()*2-1)*G,y[E]=(Math.random()*2-1)*G}return x},ur=l=>{const p=Math.max(0,l),u=44100,b=new Float32Array(u),x=Math.PI/180;if(p===0)for(let v=0;v<u;++v)b[v]=v*2/u-1;else for(let v=0;v<u;++v){const y=v*2/u-1;b[v]=(3+p)*y*20*x/(Math.PI+p*Math.abs(y))}return b};function vr({audio:l,name:p="No track loaded",author:u,theme:b="rainbow",volume:x=100,thumbnail:v=null,controls:y={play:!0,pause:!0,stop:!0,seekbar:!0,volume:!0,loop:!0,trackName:!0,equalizer:!0,speed:!0,dolby8d:!1},mode:J="light",bands:E=null,transparent:F=!1,autoPlay:G=!1,equalizer:W={bass:0,mid:0,treble:0},dolby8d:n=null}){var $r,xr,Er,Cr,Sr,Tr,Pr,Ar,Mr,Fr,zr;const[_,z]=r.useState(!1),[B,V]=r.useState(0),[j,A]=r.useState(0),[T,Pe]=r.useState(x||100),[he,xe]=r.useState(!1),[H,Ae]=r.useState(!1),[ve,ge]=r.useState(!1),[be,U]=r.useState([]),[Z,Me]=r.useState(!1),[X,Ee]=r.useState({bass:W.bass||0,mid:W.mid||0,treble:W.treble||0}),[re,He]=r.useState(1),[k,Ce]=r.useState(0),[te,qe]=r.useState(!1),[o,le]=r.useState({enable:y.dolby8d&&(n==null?void 0:n.enable)!==void 0?n.enable:!1,spatial:{rate:(($r=n==null?void 0:n.spatial)==null?void 0:$r.rate)!==void 0?n.spatial.rate:.11,width:((xr=n==null?void 0:n.spatial)==null?void 0:xr.width)!==void 0?n.spatial.width:135,focus:((Er=n==null?void 0:n.spatial)==null?void 0:Er.focus)!==void 0?n.spatial.focus:65},reverb:{size:((Cr=n==null?void 0:n.reverb)==null?void 0:Cr.size)!==void 0?n.reverb.size:2.4,tone:((Sr=n==null?void 0:n.reverb)==null?void 0:Sr.tone)!==void 0?n.reverb.tone:62,mix:((Tr=n==null?void 0:n.reverb)==null?void 0:Tr.mix)!==void 0?n.reverb.mix:30},echo:{time:((Pr=n==null?void 0:n.echo)==null?void 0:Pr.time)!==void 0?n.echo.time:500,feedback:((Ar=n==null?void 0:n.echo)==null?void 0:Ar.feedback)!==void 0?n.echo.feedback:45,mix:((Mr=n==null?void 0:n.echo)==null?void 0:Mr.mix)!==void 0?n.echo.mix:5},tape:{speed:typeof(n==null?void 0:n.tape)=="number"?n.tape:((Fr=n==null?void 0:n.tape)==null?void 0:Fr.speed)!==void 0?n.tape.speed:1,drive:typeof(n==null?void 0:n.tape)=="object"&&((zr=n.tape)==null?void 0:zr.drive)!==void 0?n.tape.drive:0}});r.useEffect(()=>{var t,c,g,f,w,Y,se,R,ee,I,ce;n&&le({enable:n.enable!==void 0?n.enable:!0,spatial:{rate:((t=n.spatial)==null?void 0:t.rate)!==void 0?n.spatial.rate:.2,width:((c=n.spatial)==null?void 0:c.width)!==void 0?n.spatial.width:80,focus:((g=n.spatial)==null?void 0:g.focus)!==void 0?n.spatial.focus:20},reverb:{size:((f=n.reverb)==null?void 0:f.size)!==void 0?n.reverb.size:3,tone:((w=n.reverb)==null?void 0:w.tone)!==void 0?n.reverb.tone:40,mix:((Y=n.reverb)==null?void 0:Y.mix)!==void 0?n.reverb.mix:30},echo:{time:((se=n.echo)==null?void 0:se.time)!==void 0?n.echo.time:50,feedback:((R=n.echo)==null?void 0:R.feedback)!==void 0?n.echo.feedback:20,mix:((ee=n.echo)==null?void 0:ee.mix)!==void 0?n.echo.mix:10},tape:{speed:typeof n.tape=="number"?n.tape:((I=n.tape)==null?void 0:I.speed)!==void 0?n.tape.speed:1,drive:typeof n.tape=="object"&&((ce=n.tape)==null?void 0:ce.drive)!==void 0?n.tape.drive:0}})},[n]);const[oe,me]=r.useState("spatial"),C=r.useRef(o),D=r.useRef(re);r.useEffect(()=>{C.current=o},[o]),r.useEffect(()=>{D.current=re},[re]);const ae=()=>{if(d.current){const t=C.current.enable,c=t?C.current.tape.speed:1,f=!(t&&c!==1);"preservesPitch"in d.current&&(d.current.preservesPitch=f),"webkitPreservesPitch"in d.current&&(d.current.webkitPreservesPitch=f),"mozPreservesPitch"in d.current&&(d.current.mozPreservesPitch=f),d.current.playbackRate=D.current*c}},s=(t,c,g)=>{le(f=>({...f,enable:!0,[t]:{...f[t],[c]:g}}))},q=()=>{le(t=>({...t,enable:!t.enable}))},P=()=>{le({enable:!0,spatial:{rate:.11,width:135,focus:65},reverb:{size:2.4,tone:62,mix:30},echo:{time:500,feedback:45,mix:5},tape:{speed:1,drive:0}})},d=r.useRef(null),$=r.useRef(null),K=r.useRef(null),S=r.useRef(null),pe=r.useRef(null),Se=r.useRef(null),Ne=r.useRef(null),L=r.useRef(null),de=r.useRef(null),De=r.useRef(null),Oe=r.useRef(null),We=r.useRef(null),Ie=r.useRef(null),_e=r.useRef(null),Ue=r.useRef(null),Ge=r.useRef(null),nr=r.useRef(null),Ve=r.useRef(0),Fe=r.useRef(null),we=r.useRef(null),Q=r.useRef(null),ue=r.useRef(null),ze=r.useRef(0),Xe=r.useRef(null),Je=r.useRef(null);r.useEffect(()=>{const t=Je.current;if(!t)return;const c=new ResizeObserver(g=>{for(let f of g)Ce(f.contentRect.width)});return c.observe(t),()=>c.disconnect()},[]),r.useEffect(()=>{const t=[];if(l&&typeof l!="string"&&t.push(["TypeError","audio must be a string (URL or path)"]),p&&typeof p!="string"&&t.push(["TypeError","name must be a string"]),b&&typeof b!="string"&&typeof b!="object")t.push(["TypeError","theme must be a string or a valid theme object"]);else if(typeof b=="object"){const c=["name","bg","bars","peak","button","buttonHover","slider"];for(const g of c)g in b||t.push(["ThemeError",`theme object missing key: ${g}`])}(typeof x!="number"||x<0||x>100)&&t.push(["TypeError","volume must be a number between 0 and 100"]),typeof y!="object"||Array.isArray(y)?t.push(["TypeError","controls must be an object"]):["play","pause","stop","seekbar","volume","loop","trackName","equalizer"].forEach(g=>{y&&g in y&&typeof y[g]!="boolean"&&t.push(["TypeError",`controls.${g} must be a boolean`])}),E&&(Array.isArray(E)?E.length===0?t.push(["ValueError","bands array cannot be empty"]):E.forEach((c,g)=>{typeof c.freq!="number"&&t.push(["TypeError",`bands[${g}].freq must be a number`])}):t.push(["TypeError","bands must be an array"])),t.length>0?(U(t),console.group("%cVisualizePlayer: Prop validation failed","color:red"),t.forEach(c=>console.error(`${c[0]}: ${c[1]}`)),console.groupEnd()):U([])},[l,p,b,x,y,J,E]);const a=E||[{freq:0},{freq:10},{freq:20},{freq:25},{freq:31.5},{freq:40},{freq:50},{freq:63},{freq:80},{freq:100},{freq:125},{freq:160},{freq:200},{freq:250},{freq:315},{freq:400},{freq:500},{freq:630},{freq:800},{freq:1e3},{freq:1250},{freq:1600},{freq:2e3},{freq:2500},{freq:3150},{freq:4e3},{freq:5e3},{freq:6300},{freq:8e3},{freq:1e4},{freq:12500}],h=r.useRef(a.map(()=>0)),N=r.useRef(a.map(()=>0)),M=r.useRef(a.map(()=>0)),O=r.useRef(!1),ne=r.useRef(typeof b=="string"?b:"purple"),i=typeof b=="string"?ke[b]||ke.purple:typeof b=="object"?b:ke.purple,m=J==="dark",sr=typeof y=="object"&&Object.keys(y).length===0;r.useEffect(()=>{typeof b=="string"?ne.current=b:ne.current="purple",Be()},[b]),r.useEffect(()=>{d.current||(d.current=new Audio);const t=d.current,c=()=>{ve||V(t.currentTime)},g=()=>A(t.duration),f=()=>{H||(z(!1),Q.current&&cancelAnimationFrame(Q.current))},w=()=>{z(!0),ae()},Y=()=>z(!1);return t.addEventListener("timeupdate",c),t.addEventListener("loadedmetadata",g),t.addEventListener("ended",f),t.addEventListener("play",w),t.addEventListener("pause",Y),()=>{t.removeEventListener("timeupdate",c),t.removeEventListener("loadedmetadata",g),t.removeEventListener("ended",f),t.removeEventListener("play",w),t.removeEventListener("pause",Y)}},[ve,H]),r.useEffect(()=>()=>{ue.current&&clearInterval(ue.current),d.current&&(d.current.pause(),d.current.src="",d.current.load()),$.current&&$.current.close().catch(t=>console.warn("AudioContext cleanup error:",t)),Q.current&&cancelAnimationFrame(Q.current)},[]),r.useEffect(()=>{if(l){const t=_,c=T,g=H;if(Q.current&&(cancelAnimationFrame(Q.current),Q.current=null),S.current){try{S.current.disconnect()}catch{}S.current=null}if(K.current){try{K.current.disconnect()}catch{}K.current=null}if(pe.current){try{pe.current.disconnect()}catch{}pe.current=null}if(Se.current){try{Se.current.disconnect()}catch{}Se.current=null}if(Ne.current){try{Ne.current.disconnect()}catch{}Ne.current=null}$.current&&($.current.close().catch(I=>console.warn("AudioContext close error:",I)),$.current=null),d.current&&(d.current.pause(),d.current.src="",d.current.load()),d.current=new Audio;try{d.current.crossOrigin="anonymous"}catch{}d.current.src=l,d.current.preload="auto",d.current.muted=!1,d.current.volume=he?0:c/100,d.current.loop=g,d.current.load();const f=d.current,w=()=>{ve||V(f.currentTime)},Y=()=>A(f.duration),se=()=>{H||(z(!1),Q.current&&cancelAnimationFrame(Q.current))},R=()=>{z(!0),ae()},ee=()=>z(!1);f.addEventListener("timeupdate",w),f.addEventListener("loadedmetadata",Y),f.addEventListener("ended",se),f.addEventListener("play",R),f.addEventListener("pause",ee),V(0),z(!1),h.current=a.map(()=>0),N.current=a.map(()=>0),M.current=a.map(()=>0),Be(),t&&d.current.play().catch(I=>console.error("Play failed:",I))}},[l]),r.useEffect(()=>{d.current&&(d.current.volume=he?0:T/100)},[T,he]),r.useEffect(()=>{d.current&&(d.current.loop=H)},[H]),r.useEffect(()=>{ae()},[re,o.tape.speed,o.enable]),r.useEffect(()=>{$.current&&(pe.current&&(pe.current.gain.value=X.bass),Se.current&&(Se.current.gain.value=X.mid),Ne.current&&(Ne.current.gain.value=X.treble))},[X]),r.useEffect(()=>{if($.current){const t=o.enable;if(Ge.current&&(Ge.current.curve=ur(t?o.tape.drive:0)),Oe.current&&(Oe.current.frequency.value=o.reverb.tone/100*8e3+500),We.current&&(We.current.gain.value=t?o.reverb.mix/100:0),De.current&&$.current)try{De.current.buffer=dr($.current,o.reverb.size)}catch{}if(Ie.current&&(Ie.current.delayTime.value=Math.max(.01,o.echo.time/1e3)),_e.current&&(_e.current.gain.value=t?Math.min(.85,o.echo.feedback/100):0),Ue.current&&(Ue.current.gain.value=t?o.echo.mix/100:0),!t&&(de.current&&(de.current.pan.value=0),L.current&&$.current)){const c=$.current.currentTime;L.current.positionX?(L.current.positionX.setTargetAtTime(0,c,.01),L.current.positionY.setTargetAtTime(0,c,.01),L.current.positionZ.setTargetAtTime(-1.4,c,.01)):L.current.setPosition&&L.current.setPosition(0,0,-1.4)}}},[o]);const gr=()=>{if(!$.current||!O.current)return;const t=C.current;if(!t.enable)return;const c=performance.now(),g=ze.current?Math.min(.1,(c-ze.current)/1e3):.016;ze.current=c;const f=t.spatial.rate;Ve.current+=f*5*g;const w=Ve.current,se=2.3*(t.spatial.width/135),R=Math.sin(w)*se,ee=-Math.cos(w)*se,I=Math.sin(w*2)*.4,ce=$.current.currentTime;if(L.current&&(L.current.positionX?(L.current.positionX.setTargetAtTime(R,ce,.04),L.current.positionY.setTargetAtTime(I,ce,.04),L.current.positionZ.setTargetAtTime(ee,ce,.04)):L.current.setPosition&&L.current.setPosition(R,I,ee)),de.current){const ye=Math.sin(w)*(t.spatial.width/180),Te=(t.spatial.focus-50)/100,je=Math.max(-1,Math.min(1,ye+Te));de.current.pan.setTargetAtTime(je,ce,.04)}};r.useEffect(()=>{O.current=_,Q.current&&(cancelAnimationFrame(Q.current),Q.current=null),ue.current&&(clearInterval(ue.current),ue.current=null),_?($.current||Xr(),ze.current=performance.now(),ue.current=window.setInterval(gr,30),yr()):mr()},[_]);const Xr=()=>{if(!$.current&&d.current)try{const t=window.AudioContext||window.webkitAudioContext;if(t){const c=new t;$.current=c;const g=c.createBiquadFilter();g.type="lowshelf",g.frequency.value=320,g.gain.value=X.bass;const f=c.createBiquadFilter();f.type="peaking",f.frequency.value=1e3,f.Q.value=.5,f.gain.value=X.mid;const w=c.createBiquadFilter();w.type="highshelf",w.frequency.value=3200,w.gain.value=X.treble;const Y=c.createWaveShaper();Y.curve=ur(C.current.enable?C.current.tape.drive:0),ae();let se=null;try{const $e=c.createPanner();$e.panningModel="HRTF",$e.distanceModel="inverse",$e.refDistance=1.4,$e.rolloffFactor=.55,se=$e}catch{}let R=null;if(c.createStereoPanner){const $e=c.createStereoPanner();$e.pan.value=0,R=$e}const ee=c.createGain();ee.gain.value=1;const I=c.createConvolver();I.buffer=dr(c,C.current.reverb.size);const ce=c.createBiquadFilter();ce.type="lowpass",ce.frequency.value=C.current.reverb.tone/100*8e3+500;const ye=c.createGain();ye.gain.value=C.current.enable?C.current.reverb.mix/100:0;const Te=c.createDelay(2);Te.delayTime.value=C.current.echo.time/1e3;const je=c.createGain();je.gain.value=Math.min(.85,C.current.echo.feedback/100);const Re=c.createGain();Re.gain.value=C.current.enable?C.current.echo.mix/100:0,Te.connect(je),je.connect(Te);const Le=c.createAnalyser();Le.fftSize=8192,Le.smoothingTimeConstant=.7;const Lr=c.createMediaElementSource(d.current);Lr.connect(g),g.connect(f),f.connect(w),w.connect(Y);const er=se,Ye=R,cr=er||Ye||Y;er?(Y.connect(er),Ye&&er.connect(Ye)):Ye&&Y.connect(Ye),cr.connect(ee),ee.connect(Le),cr.connect(I),I.connect(ce),ce.connect(ye),ye.connect(Le),cr.connect(Te),Te.connect(Re),Re.connect(Le),Le.connect(c.destination),pe.current=g,Se.current=f,Ne.current=w,Ge.current=Y,L.current=se,de.current=R,nr.current=ee,De.current=I,Oe.current=ce,We.current=ye,Ie.current=Te,_e.current=je,Ue.current=Re,K.current=Le,S.current=Lr}}catch(t){console.error("Failed to setup audio context:",t)}},br=t=>{const c=$.current,g=K.current;if(!c||!g)return 0;const f=c.sampleRate/2,w=Math.round(t/f*g.frequencyBinCount);return Math.min(w,g.frequencyBinCount-1)},mr=()=>{if(O.current)return;h.current=h.current.map(f=>f*.7);const t=Date.now();N.current=N.current.map((f,w)=>t-M.current[w]>1500?f*.95:f),Be();const c=Math.max(...h.current),g=Math.max(...N.current);c>.01||g>.01?Q.current=requestAnimationFrame(mr):(O.current||(h.current=a.map(()=>0),N.current=a.map(()=>0),M.current=a.map(()=>0),Be()),Q.current&&cancelAnimationFrame(Q.current),Q.current=null)},yr=()=>{if(!K.current||!O.current)return;const t=C.current;if(t.enable&&$.current){gr();const f=Ve.current,w=t.spatial.width/135;if(Fe.current){const Y=85*(w>0?1:0),se=55*(w>0?1:0),R=Math.sin(f)*Y,ee=-Math.cos(f)*se;Fe.current.style.transform=`translate(${R}px, ${ee}px)`,we.current&&(we.current.setAttribute("x2",`${110+R}`),we.current.setAttribute("y2",`${75+ee}`))}}else if($.current){const f=$.current.currentTime;L.current&&(L.current.positionX?(L.current.positionX.setTargetAtTime(0,f,.04),L.current.positionY.setTargetAtTime(0,f,.04),L.current.positionZ.setTargetAtTime(-1.4,f,.04)):L.current.setPosition&&L.current.setPosition(0,0,-1.4)),de.current&&de.current.pan.setTargetAtTime(0,f,.04),Fe.current&&(Fe.current.style.transform="translate(0px, 0px)"),we.current&&(we.current.setAttribute("x2","110"),we.current.setAttribute("y2","20"))}const c=K.current.frequencyBinCount,g=new Uint8Array(c);K.current.getByteFrequencyData(g),a.forEach((f,w)=>{const Y=br(f.freq),se=w<a.length-1?br(a[w+1].freq):g.length;let R=0,ee=0;for(let ye=Y;ye<se;ye++)R+=g[ye],ee++;let I=ee>0?R/ee/255:0;I=Math.pow(I,.6),h.current[w]=h.current[w]*.8+I*.2;const ce=Date.now();h.current[w]>N.current[w]?(N.current[w]=h.current[w],M.current[w]=ce):ce-M.current[w]>1500&&(N.current[w]*=.95)}),Be(),Q.current=requestAnimationFrame(yr)},Be=()=>{if(!Xe.current)return;const t=ke[ne.current]||ke.rainbow;let c="";a.forEach((g,f)=>{const w=h.current[f]*100,Y=100-N.current[f]*100,se=Math.floor(f/a.length*t.bars.length),R=t.bars[Math.min(se,t.bars.length-1)];c+=`
78
78
  <div class="ecp-vu-bar-wrap">
79
79
  <div class="ecp-vu-bar-fill" style="height: ${w}%; background: ${R};">
80
80
  ${N.current[f]>.1?`<div class="ecp-vu-peak-line" style="top: ${Y}%; background: ${t.peak};"></div>`:""}
81
81
  </div>
82
82
  </div>
83
- `}),Xe.current.innerHTML=c},kr=()=>{!d.current||!l||(_?d.current.pause():($.current&&$.current.state==="suspended"&&$.current.resume(),d.current.play().catch(t=>console.error("Play failed:",t))))},Yr=()=>{d.current&&(d.current.pause(),d.current.currentTime=0,z(!1),V(0),h.current=a.map(()=>0),N.current=a.map(()=>0),M.current=a.map(()=>0),Be())},Zr=t=>{const g=parseFloat(t.target.value)/100*j;V(g),d.current&&!ve&&(d.current.currentTime=g)},qr=()=>ge(!0),Nr=()=>{d.current&&(d.current.currentTime=B),ge(!1)},Kr=t=>{const c=parseInt(t.target.value);Pe(c),xe(c===0)},Qr=()=>xe(!he),Jr=t=>He(parseFloat(t.target.value)),Rr=()=>Ae(!H),et=(t,c)=>Ee(g=>({...g,[t]:c})),rt=()=>Ee({bass:0,mid:0,treble:0});r.useEffect(()=>{((typeof y=="object"&&Object.keys(y).length===0||!y)&&!_||G)&&kr()},[y]);const wr=t=>{if(isNaN(t))return"0:00";const c=Math.floor(t/60),g=Math.floor(t%60);return`${c}:${g.toString().padStart(2,"0")}`};if(be&&be.length>0)return e.jsx(e.Fragment,{children:be.map((t,c)=>e.jsxs("div",{className:"ecp-vp-error",children:[e.jsxs("strong",{children:[t[0],":"]})," ",t[1]]},c))});const tt=sr||F?void 0:m?"#6060606a":"#ffffffab",at=sr||F?void 0:i.bg,nt=`ecp-vp-vu-bg ${F?" ecp-vp-vu-bg--transparent":m?" ecp-vp-vu-bg--dark":" ecp-vp-vu-bg--light"}${Z&&F?" ecp-vp-vu-bg--dimmed":""}${sr?" ecp-vp-vu-bg--no-margin":""}`;return e.jsx("div",{ref:Je,className:"ecp-vp-wrapper",style:{backgroundColor:tt},children:e.jsxs("div",{className:"ecp-vp-bg",style:{background:at},children:[e.jsxs("div",{className:"ecp-vp-vu-outer",children:[e.jsx("div",{className:nt,children:e.jsx("div",{className:"ecp-vp-vu-bars",ref:Xe})}),o.enable&&_&&e.jsx("div",{className:"ecp-vp-8d-live-overlay",children:e.jsxs("div",{className:`ecp-vp-8d-live-visualizer${m?" ecp-vp-8d-live-visualizer--dark":" ecp-vp-8d-live-visualizer--light"}`,style:{"--theme-slider":i.slider,"--theme-slider-alpha":`${i.slider}33`},children:[e.jsx("div",{className:"ecp-vp-8d-live-glow",style:{background:`radial-gradient(circle, ${i.slider}35 0%, transparent 70%)`}}),e.jsxs("svg",{className:"ecp-vp-8d-live-svg",viewBox:"0 0 220 150",children:[e.jsx("circle",{cx:"110",cy:"75",r:"35",stroke:i.slider,strokeOpacity:"0.2",strokeWidth:"1",fill:"none"}),e.jsx("ellipse",{cx:"110",cy:"75",rx:"85",ry:"55",fill:"none",stroke:i.slider,strokeOpacity:"0.5",strokeWidth:"2",strokeDasharray:"2 7",strokeLinecap:"round"}),e.jsx("line",{ref:we,x1:"110",y1:"75",x2:"110",y2:"20",stroke:i.slider,strokeOpacity:"0.75",strokeWidth:"1.5"}),e.jsxs("g",{transform:"translate(110, 75)",children:[e.jsx("circle",{cx:"0",cy:"0",r:"14",fill:"none",stroke:i.slider,strokeOpacity:"0.8",strokeWidth:"1.5"}),e.jsx("line",{x1:"0",y1:"14",x2:"0",y2:"19",stroke:i.slider,strokeOpacity:"0.8",strokeWidth:"1.5"}),e.jsx("text",{x:"0",y:"29",textAnchor:"middle",fill:i.slider,fillOpacity:"0.75",fontSize:"8",fontWeight:"700",letterSpacing:"0.5px",fontFamily:"monospace",children:"FRONT"})]})]}),e.jsx(rr,{size:14,className:"ecp-vp-8d-live-head-icon",style:{color:i.slider}}),e.jsx("div",{ref:Fe,className:"ecp-vp-8d-live-dot",style:{background:i.slider,boxShadow:`0 0 12px ${i.slider}`},children:e.jsx("span",{className:"ecp-vp-8d-live-dot-inner"})})]})}),Z&&e.jsxs("div",{className:`ecp-vp-eq-overlay${m?" ecp-vp-eq-overlay--dark":" ecp-vp-eq-overlay--light"}`,children:[e.jsx("h3",{className:`ecp-vp-eq-title${m?" ecp-vp-eq-title--dark":" ecp-vp-eq-title--light"}`,children:"Equalizer"}),e.jsx("div",{className:"ecp-vp-eq-bands",children:["bass","mid","treble"].map(t=>e.jsxs("div",{className:"ecp-vp-eq-band",children:[e.jsxs("div",{className:"ecp-vp-eq-band-header",children:[e.jsx("span",{className:`ecp-vp-eq-band-label${m?" ecp-vp-eq-band-label--dark":" ecp-vp-eq-band-label--light"}`,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsxs("span",{className:`ecp-vp-eq-band-label${m?" ecp-vp-eq-band-label--dark":" ecp-vp-eq-band-label--light"}`,children:[X[t]>0?`+${X[t]}`:X[t]," dB"]})]}),e.jsxs("div",{className:"ecp-vp-eq-band-range",children:[e.jsx("span",{className:`ecp-vp-eq-range-bound${m?" ecp-vp-eq-range-bound--dark":" ecp-vp-eq-range-bound--light"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:X[t],onChange:c=>et(t,parseInt(c.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${(X[t]+20)/40*100}%, ${i.slider+"30"} ${(X[t]+20)/40*100}%)`,"--thumb-color":i.slider}}),e.jsx("span",{className:`ecp-vp-eq-range-bound${m?" ecp-vp-eq-range-bound--dark":" ecp-vp-eq-range-bound--light"}`,children:"+20"})]})]},t))}),e.jsx("div",{className:"ecp-vp-eq-footer",children:e.jsx("button",{onClick:rt,className:`ecp-vp-eq-reset${m?" ecp-vp-eq-reset--dark":" ecp-vp-eq-reset--light"}`,children:"Reset"})})]}),te&&e.jsxs("div",{className:`ecp-vp-eq-overlay${m?" ecp-vp-eq-overlay--dark":" ecp-vp-eq-overlay--light"}`,style:{"--theme-slider":i.slider,"--theme-slider-alpha":`${i.slider}33`},children:[e.jsxs("div",{className:"ecp-vp-8d-header",children:[e.jsxs("div",{className:"ecp-vp-8d-title-group",children:[e.jsx(rr,{size:18,style:{color:i.slider}}),e.jsx("h3",{className:`ecp-vp-eq-title${m?" ecp-vp-eq-title--dark":" ecp-vp-eq-title--light"}`,style:{margin:0},children:"8D Spatial Engine"})]}),e.jsxs("div",{className:"ecp-vp-8d-toggle-wrap",children:[e.jsx("span",{className:`ecp-vp-8d-toggle-label${m?" ecp-vp-8d-toggle-label--dark":" ecp-vp-8d-toggle-label--light"}`,children:o.enable?"On":"Off"}),e.jsx("button",{onClick:q,className:`ecp-vp-8d-toggle${o.enable?" ecp-vp-8d-toggle--on":""}`,children:e.jsx("div",{className:"ecp-vp-8d-toggle-thumb"})})]})]}),e.jsx("div",{className:"ecp-vp-8d-tabs",children:["spatial","reverb","echo","tape"].map(t=>e.jsx("button",{onClick:()=>me(t),className:`ecp-vp-8d-tab${m?" ecp-vp-8d-tab--dark":" ecp-vp-8d-tab--light"}${oe===t?" ecp-vp-8d-tab--active":""}`,children:t.charAt(0).toUpperCase()+t.slice(1)},t))}),e.jsxs("div",{className:"ecp-vp-8d-controls-grid",children:[oe==="spatial"&&e.jsxs("div",{className:"ecp-vp-eq-bands--horizontal",children:[e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.spatial.rate.toFixed(2),"x"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0.01",max:"1.00",step:"0.01",value:o.spatial.rate,onChange:t=>s("spatial","rate",parseFloat(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${(o.spatial.rate-.01)/.99*100}%, ${i.slider+"30"} ${(o.spatial.rate-.01)/.99*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"RATE"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.spatial.width,"°"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"180",step:"5",value:o.spatial.width,onChange:t=>s("spatial","width",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.spatial.width/180*100}%, ${i.slider+"30"} ${o.spatial.width/180*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"WIDTH"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.spatial.focus,"%"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:o.spatial.focus,onChange:t=>s("spatial","focus",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.spatial.focus}%, ${i.slider+"30"} ${o.spatial.focus}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"FOCUS"})]})]}),oe==="reverb"&&e.jsxs("div",{className:"ecp-vp-eq-bands--horizontal",children:[e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.reverb.size.toFixed(1),"s"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0.2",max:"5.0",step:"0.1",value:o.reverb.size,onChange:t=>s("reverb","size",parseFloat(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${(o.reverb.size-.2)/4.8*100}%, ${i.slider+"30"} ${(o.reverb.size-.2)/4.8*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"SIZE"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.reverb.tone,"%"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:o.reverb.tone,onChange:t=>s("reverb","tone",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.reverb.tone}%, ${i.slider+"30"} ${o.reverb.tone}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"TONE"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.reverb.mix,"%"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:o.reverb.mix,onChange:t=>s("reverb","mix",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.reverb.mix}%, ${i.slider+"30"} ${o.reverb.mix}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"MIX"})]})]}),oe==="echo"&&e.jsxs("div",{className:"ecp-vp-eq-bands--horizontal",children:[e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.echo.time,"ms"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"50",max:"1000",step:"10",value:o.echo.time,onChange:t=>s("echo","time",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${(o.echo.time-50)/950*100}%, ${i.slider+"30"} ${(o.echo.time-50)/950*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"TIME"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.echo.feedback,"%"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"85",step:"1",value:o.echo.feedback,onChange:t=>s("echo","feedback",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.echo.feedback/85*100}%, ${i.slider+"30"} ${o.echo.feedback/85*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"FEEDBACK"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.echo.mix,"%"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:o.echo.mix,onChange:t=>s("echo","mix",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.echo.mix}%, ${i.slider+"30"} ${o.echo.mix}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"MIX"})]})]}),oe==="tape"&&e.jsxs("div",{className:"ecp-vp-eq-bands--horizontal",children:[e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.tape.speed.toFixed(2),"x"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0.50",max:"2.00",step:"0.05",value:o.tape.speed,onChange:t=>s("tape","speed",parseFloat(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${(o.tape.speed-.5)/1.5*100}%, ${i.slider+"30"} ${(o.tape.speed-.5)/1.5*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"TAPE"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsx("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:o.tape.drive}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"50",step:"1",value:o.tape.drive,onChange:t=>s("tape","drive",parseFloat(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.tape.drive/50*100}%, ${i.slider+"30"} ${o.tape.drive/50*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"DRIVE"})]})]})]}),e.jsx("div",{className:"ecp-vp-eq-footer",children:e.jsx("button",{onClick:P,className:`ecp-vp-eq-reset${m?" ecp-vp-eq-reset--dark":" ecp-vp-eq-reset--light"}`,children:"Reset Defaults"})})]})]}),y.trackName&&e.jsxs("div",{className:"ecp-vp-track",children:[v&&e.jsx("div",{className:"ecp-vp-thumbnail-wrap",children:e.jsx("img",{src:v,alt:"",className:`ecp-vp-thumbnail${_?" ecp-animation-spin":""}`})}),e.jsxs("div",{className:"ecp-vp-track-info",children:[e.jsx("div",{className:`ecp-vp-track-name${m?" ecp-vp-track-name--dark":" ecp-vp-track-name--light"}`,children:p}),u&&typeof u=="string"&&e.jsx("div",{className:`ecp-vp-track-author${m?" ecp-vp-track-author--dark":" ecp-vp-track-author--light"}`,children:u})]})]}),y.seekbar&&e.jsx("div",{className:"ecp-vp-seekbar",children:e.jsxs("div",{className:"ecp-vp-seekbar-row",children:[e.jsx("span",{className:`ecp-vp-time${m?" ecp-vp-time--dark":" ecp-vp-time--light"}`,children:wr(B)}),e.jsx("input",{type:"range",min:"0",max:"100",value:j>0?B/j*100:0,onChange:Zr,onMouseDown:qr,onMouseUp:Nr,onTouchStart:qr,onTouchEnd:Nr,disabled:!l,className:"ecp-vp-seek-input",style:{background:l&&j>0?`linear-gradient(to right, ${i.slider} ${B/j*100}%, ${i.slider+"30"} ${B/j*100}%)`:i.slider+"30","--thumb-color":i.slider}}),e.jsx("span",{className:`ecp-vp-time ecp-vp-time--right${m?" ecp-vp-time--dark":" ecp-vp-time--light"}`,children:wr(j)})]})}),e.jsxs("div",{className:`ecp-vp-controls${k<330?" ecp-vp-controls--sm":""}`,children:[y.play&&e.jsxs("button",{onClick:kr,disabled:!l,className:`ecp-vp-play-btn${k<350?" ecp-vp-play-btn--compact":""}`,style:{backgroundColor:i.button},children:[e.jsxs("div",{className:"ecp-vp-play-icon-wrap",children:[e.jsx(Ze,{size:16,style:{position:"absolute",transform:_?void 0:"scale(0) translateY(2.5rem)",transition:"all 150ms"}}),e.jsx(Ke,{size:16,style:{position:"absolute",transform:_?"scale(0) translateY(-2.5rem)":void 0,transition:"all 150ms"}})]}),e.jsx("span",{style:{display:k<350?"none":"block"},children:_?"Pause":"Play"})]}),y.stop&&e.jsxs("button",{onClick:Yr,disabled:!l,className:`ecp-vp-stop-btn${m?" ecp-vp-stop-btn--dark":" ecp-vp-stop-btn--light"}${k>=600?" ecp-vp-stop-btn--wide":""}`,children:[e.jsx(or,{size:16}),e.jsx("span",{style:{display:k<600?"none":"block"},children:"Stop"})]}),y.equalizer&&e.jsxs("button",{onClick:()=>{Me(!Z),qe(!1)},disabled:!l,className:`ecp-vp-eq-btn${Z?" ecp-vp-eq-btn--on":" ecp-vp-eq-btn--off"}${k>=600?" ecp-vp-eq-btn--wide":""}`,style:Z?{backgroundColor:i.button}:{},children:[e.jsx(Qe,{size:16}),e.jsx("span",{style:{display:k<600?"none":"block"},children:"EQ"})]}),y.loop&&e.jsxs("button",{onClick:Rr,disabled:!l,className:`ecp-vp-loop-btn${H?" ecp-vp-loop-btn--on":" ecp-vp-loop-btn--off"}${k>=700?" ecp-vp-loop-btn--wide":""}`,style:H?{backgroundColor:i.button}:{},children:[e.jsx(Wr,{size:16,className:H?"ecp-vp-loop-icon--active":""}),e.jsx("span",{style:{display:k<700?"none":"block"},children:"Loop"})]}),y.speed&&!y.dolby8d&&e.jsx("div",{className:"ecp-vp-speed-wrap",children:e.jsx("select",{value:re,onChange:Jr,className:`ecp-vp-speed-select${m?" ecp-vp-speed-select--dark":" ecp-vp-speed-select--light"}`,children:["0.5","0.75","1","1.25","1.5","2"].map(t=>e.jsxs("option",{value:t,className:m?"ecp-vp-speed-option--dark":"ecp-vp-speed-option--light",children:[t,"x"]},t))})}),y.dolby8d&&e.jsxs("button",{onClick:()=>{qe(!te),Me(!1)},disabled:!l,className:`ecp-vp-loop-btn${te?" ecp-vp-loop-btn--on":" ecp-vp-loop-btn--off"}${k>=700?" ecp-vp-loop-btn--wide":""}`,style:te?{backgroundColor:i.button}:{},children:[e.jsx(rr,{size:16,className:""}),e.jsx("span",{style:{display:k<700?"none":"block"},children:"Dolby"})]}),y.volume&&e.jsxs("div",{className:"ecp-vp-volume",children:[e.jsx("button",{onClick:Qr,className:"ecp-vp-mute-btn",children:he||S===0?e.jsx(ar,{size:20,className:m?"ecp-vp-mute-icon--dark":"ecp-vp-mute-icon--light"}):e.jsx(tr,{size:20,className:m?"ecp-vp-mute-icon--dark":"ecp-vp-mute-icon--light"})}),e.jsx("input",{type:"range",min:"0",max:"100",value:S,onChange:Kr,className:"ecp-vp-volume-slider",style:{background:`linear-gradient(to right, ${i.slider} ${S}%, ${i.slider+"30"} ${S}%)`,"--thumb-color":i.slider,display:k<460?"none":"block"}}),e.jsxs("span",{className:`ecp-vp-volume-pct${m?" ecp-vp-volume-pct--dark":" ecp-vp-volume-pct--light"}`,style:{display:k<800?"none":"block"},children:[S,"%"]})]})]})]})})}function fr({audio:l,gradient:p=["#cd7eff","#ff00f2"],background:u="#f4e4ffff",autoPlay:b=!1,thumbnail:x=null,width:v,equalizer:y={bass:0,mid:0,treble:0},mode:J="light"}){const[E,F]=r.useState(!1),[G,W]=r.useState(0),[n,_]=r.useState(0),[z,B]=r.useState(!1),[V,j]=r.useState(80),[A,S]=r.useState(1),[Pe,he]=r.useState([]),[xe,H]=r.useState(null),[Ae,ve]=r.useState(!1),[ge,be]=r.useState({bass:y.bass||0,mid:y.mid||0,treble:y.treble||0}),U=r.useRef(null),Z=r.useRef(null),Me=r.useRef(null),X=r.useRef(null),Ee=r.useRef(null),re=r.useRef(null),He=()=>{const s=[];for(let q=0;q<100;q++)s.push(20+Math.random()*60);return s};r.useEffect(()=>{if(!l)return;if(!Array.isArray(p)||p.length<2){H("Gradient must be an array with at least 2 colors");return}const s=U.current;if(!s)return;const q=()=>W(s.currentTime),P=()=>{_(s.duration),he(He())},d=()=>F(!1),$=K=>{var T,pe;return H(`Audio error: ${((pe=(T=K.target)==null?void 0:T.error)==null?void 0:pe.message)||"Failed to load audio"}`)};return s.addEventListener("timeupdate",q),s.addEventListener("loadedmetadata",P),s.addEventListener("ended",d),s.addEventListener("error",$),()=>{s.removeEventListener("timeupdate",q),s.removeEventListener("loadedmetadata",P),s.removeEventListener("ended",d),s.removeEventListener("error",$)}},[l,p,J]),r.useEffect(()=>{l&&U.current&&b&&(U.current.play().catch(s=>{console.error("Play failed:",s),F(!1)}),F(!0))},[l]),r.useEffect(()=>{if(U.current&&!Z.current&&U.current){const s=window.AudioContext||window.webkitAudioContext;if(s){const q=new s;Z.current=q;const P=q.createMediaElementSource(U.current);Me.current=P;const d=q.createBiquadFilter();d.type="lowshelf",d.frequency.value=200,X.current=d;const $=q.createBiquadFilter();$.type="peaking",$.frequency.value=1e3,$.Q.value=1,Ee.current=$;const K=q.createBiquadFilter();K.type="highshelf",K.frequency.value=3e3,re.current=K,P.connect(d).connect($).connect(K).connect(q.destination)}}},[l]),r.useEffect(()=>{U.current&&(U.current.volume=z?0:V/100)},[V,z]),r.useEffect(()=>{U.current&&(U.current.playbackRate=A)},[A]);const k=()=>{U.current&&(E?U.current.pause():U.current.play().catch(s=>H(`Playback failed: ${s instanceof Error?s.message:String(s)}`)),F(!E))},Ce=()=>B(!z),te=s=>{j(parseInt(s.target.value)),z&&parseInt(s.target.value)>0&&B(!1)},qe=s=>S(parseFloat(s.target.value)),o=s=>{const q=s.currentTarget.getBoundingClientRect(),d=(s.clientX-q.left)/q.width*n;U.current&&(U.current.currentTime=d,W(d))},le=(s,q)=>{be(P=>({...P,[s]:q})),s==="bass"&&X.current&&(X.current.gain.value=q),s==="mid"&&Ee.current&&(Ee.current.gain.value=q),s==="treble"&&re.current&&(re.current.gain.value=q)},oe=()=>{le("bass",0),le("mid",0),le("treble",0)},me=s=>{if(isNaN(s))return"0:00";const q=Math.floor(s/60),P=Math.floor(s%60);return`${q}:${P.toString().padStart(2,"0")}`},C=n>0?G/n*100:0,I=J==="dark";if(xe)return e.jsxs("div",{className:"ecp-wave-error",style:{background:u},children:[e.jsx("p",{className:`ecp-wave-error-title${I?" ecp-wave-error--dark":" ecp-wave-error--light"}`,children:"Error"}),e.jsx("p",{className:`ecp-wave-error-msg${I?" ecp-wave-error--dark":" ecp-wave-error--light"}`,children:xe})]});if(!l)return null;const ae=I?"#9ca3af":"#6b7280";return e.jsxs("div",{className:"ecp-wave-outer",style:{width:v?`${v}px`:void 0},children:[e.jsx("audio",{ref:U,src:l,className:"ecp-wave-audio-el"}),e.jsx("div",{className:"ecp-wave-card",children:e.jsxs("div",{className:"ecp-wave-card-inner",style:{background:u},children:[x&&e.jsx("div",{className:"ecp-wave-thumbnail-wrap",children:e.jsx("img",{src:x,alt:"",className:"ecp-wave-thumbnail"})}),e.jsxs("div",{className:"ecp-wave-seek",onClick:o,children:[e.jsx("div",{className:"ecp-wave-bars",children:Pe.map((s,q)=>{const P=q/Pe.length*100<=C;return e.jsx("div",{className:"ecp-wave-bar",style:{height:`${s}%`,background:P?p[0]:p[1],opacity:P?1:.4}},q)})}),e.jsx("div",{className:"ecp-wave-progress-line",style:{left:`${C}%`}})]}),e.jsxs("div",{className:"ecp-wave-times",style:{color:ae},children:[e.jsx("span",{children:me(G)}),e.jsx("span",{children:me(n)})]}),e.jsxs("div",{className:"ecp-wave-controls",children:[e.jsxs("div",{className:"ecp-wave-left-controls",children:[e.jsx("button",{onClick:Ce,className:"ecp-wave-vol-btn",style:{background:`linear-gradient(135deg, ${p[0]}, ${p[1]})`},children:z||V===0?e.jsx(ar,{style:{width:"1rem",height:"1rem",color:"white"}}):e.jsx(tr,{style:{width:"1rem",height:"1rem",color:"white"}})}),e.jsx("input",{type:"range",min:"0",max:"100",value:V,onChange:te,className:"ecp-wave-vol-slider",style:{background:`linear-gradient(to right, ${p[0]} ${V}%, ${I?"#374151":"#d1d5db"} ${V}%)`,"--thumb-color":p[0],display:v&&v<400?"none":void 0}}),v&&v<400&&e.jsx("button",{onClick:()=>ve(!Ae),className:"ecp-wave-eq-btn",style:{background:`linear-gradient(135deg, ${p[0]}, ${p[1]})`},children:e.jsx(Qe,{style:{width:"1rem",height:"1rem",color:"white"}})})]}),e.jsx("div",{className:"ecp-wave-center-controls",children:e.jsx("button",{onClick:k,className:"ecp-wave-play-btn",style:{background:`linear-gradient(135deg, ${p[0]}, ${p[1]})`},children:E?e.jsx(Ze,{style:{width:"1.5rem",height:"1.5rem",color:"white",fill:"white"}}):e.jsx(Ke,{style:{width:"1.5rem",height:"1.5rem",color:"white",fill:"white"}})})}),e.jsxs("div",{className:"ecp-wave-right-controls",children:[e.jsx("select",{value:A,onChange:qe,className:`ecp-wave-speed-select${I?" ecp-wave-speed-select--dark":" ecp-wave-speed-select--light"}`,style:{background:u,color:p[0]},children:["0.5","0.75","1","1.25","1.5","2"].map(s=>e.jsxs("option",{value:s,children:[s,"x"]},s))}),!(v&&v<400)&&e.jsx("button",{onClick:()=>ve(!Ae),className:"ecp-wave-eq-btn",style:{background:`linear-gradient(135deg, ${p[0]}, ${p[1]})`},children:e.jsx(Qe,{style:{width:"1rem",height:"1rem",color:"white"}})})]})]})]})}),Ae&&e.jsx("div",{className:"ecp-wave-eq-overlay",children:e.jsxs("div",{className:`ecp-wave-eq-panel${I?" ecp-wave-eq-panel--dark":" ecp-wave-eq-panel--light"}`,children:[e.jsx("h3",{className:`ecp-wave-eq-title${I?" ecp-wave-eq-title--dark":" ecp-wave-eq-title--light"}`,children:"Equalizer"}),e.jsx("div",{className:"ecp-wave-eq-bands",children:["bass","mid","treble"].map(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"ecp-wave-eq-band-header",children:[e.jsx("span",{className:I?"ecp-wave-eq-label--dark":"ecp-wave-eq-label--light",children:s.charAt(0).toUpperCase()+s.slice(1)}),e.jsxs("span",{className:I?"ecp-wave-eq-label--dark":"ecp-wave-eq-label--light",children:[ge[s]," dB"]})]}),e.jsxs("div",{className:"ecp-wave-eq-range-row",children:[e.jsx("span",{className:I?"ecp-wave-eq-bound--dark":"ecp-wave-eq-bound--light",children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:ge[s],onChange:q=>le(s,parseInt(q.target.value)),className:"ecp-wave-eq-slider",style:{background:`linear-gradient(to right, ${p[0]} ${(ge[s]+20)/40*100}%, ${p[1]+"30"} ${(ge[s]+20)/40*100}%)`,"--thumb-color":p[0]}}),e.jsx("span",{className:I?"ecp-wave-eq-bound--dark":"ecp-wave-eq-bound--light",children:"+20"})]})]},s))}),e.jsxs("div",{className:"ecp-wave-eq-footer",children:[e.jsx("button",{onClick:oe,className:`ecp-wave-eq-footer-btn${I?" ecp-wave-eq-footer-btn--dark":" ecp-wave-eq-footer-btn--light"}`,children:"Reset"}),e.jsx("button",{onClick:()=>ve(!1),className:`ecp-wave-eq-footer-btn${I?" ecp-wave-eq-footer-btn--dark":" ecp-wave-eq-footer-btn--light"}`,children:"Close"})]})]})})]})}function hr({audio:l,thumbnail:p,gradient:u=["#cd7eff","#fe59f6"],background:b="#1f273a",autoPlay:x=!1}){const[v,y]=r.useState(!1),[,J]=r.useState(0),E=r.useRef(null),[F,G]=r.useState(0),[W,n]=r.useState(0),[_,z]=r.useState(0);r.useEffect(()=>{const A=E.current;if(!A)return;const S=()=>J(A.currentTime);return A.addEventListener("timeupdate",S),()=>A.removeEventListener("timeupdate",S)},[]),r.useEffect(()=>{const A=setInterval(()=>{v&&G(S=>S+.1)},100);return()=>clearInterval(A)},[v]),r.useEffect(()=>{const A=setInterval(()=>{v&&z(S=>S+.1)},100);return()=>clearInterval(A)},[v]),r.useEffect(()=>{l&&E.current&&x&&(E.current.play().catch(()=>y(!1)),y(!0))},[l]),r.useEffect(()=>{const A=E.current;if(!A)return;const S=()=>n(A.duration);return z(0),A.addEventListener("loadedmetadata",S),()=>A.removeEventListener("loadedmetadata",S)},[l]);const B=()=>{E.current&&(v?E.current.pause():E.current.play().catch(A=>console.error("NanoPlayer play failed:",A)),y(!v))};if(!l)return null;const V=`linear-gradient(135deg, ${u[0]}, ${u[1]})`,j=`${(W>0?_/W:0)*100}%`;return e.jsxs("div",{className:`ecp-nano-wrapper${p?" ecp-nano-wrapper--card":" ecp-nano-wrapper--pill"}`,style:{backgroundColor:b},children:[e.jsx("audio",{ref:E,src:l,onEnded:()=>{y(!1),z(0)}}),e.jsx("div",{className:"ecp-nano-progress-bg",style:{width:j,backgroundImage:V}}),e.jsxs("div",{className:"ecp-nano-content",children:[p&&e.jsx("div",{className:"ecp-nano-thumbnail-wrap",children:e.jsx("img",{src:p,alt:"",className:"ecp-nano-thumbnail"})}),e.jsxs("div",{className:"ecp-nano-row",children:[e.jsx("button",{onClick:B,className:"ecp-nano-play-btn",style:{background:V},children:v?e.jsx(Ze,{fill:b,style:{width:"0.75rem",height:"0.75rem",color:"transparent"}}):e.jsx(Ke,{fill:b,style:{width:"0.75rem",height:"0.75rem",color:"transparent"}})}),e.jsx("div",{className:"ecp-nano-waveform",children:[...Array(12)].map((A,S)=>e.jsx("div",{className:"ecp-nano-wave-bar",style:{background:`linear-gradient(to top, ${u[0]}, ${u[1]})`,height:v?`${8+Math.sin((F*8+S)*.6)*10}px`:"8px",opacity:v?.8:.4}},S))})]})]})]})}function Gr({video:l,name:p="No video loaded",audioVisual:u=null,volume:b=100,thumbnail:x=null,controls:v={play:!0,pause:!0,stop:!0,seekbar:!0,volume:!0,fullscreen:!0,videoName:!0,equalizer:!0,speed:!0},mode:y="light",transparent:J=!1,autoPlay:E=!1,color:F="#3b82f6",equalizer:G={bass:0,mid:0,treble:0}}){const[W,n]=r.useState(!1),[_,z]=r.useState(0),[B,V]=r.useState(0),[j,A]=r.useState(b||100),[S,Pe]=r.useState(!1),[he,xe]=r.useState(!1),[H,Ae]=r.useState(!1),[ve,ge]=r.useState([]),[be,U]=r.useState(!1),[Z,Me]=r.useState({bass:G.bass||0,mid:G.mid||0,treble:G.treble||0}),[X,Ee]=r.useState(1),[re,He]=r.useState(0),k=r.useRef(null),Ce=r.useRef(null),te=r.useRef(null),qe=r.useRef(null),o=r.useRef(null),le=r.useRef(null),oe=r.useRef(null),me=r.useRef(null),C=r.useRef(null),I=r.useRef(null),ae=r.useRef(0),s=r.useRef(0),q=r.useRef(0),P=r.useRef(0),d=r.useRef(0),$=r.useRef(0),K=r.useRef(!1),T=y==="dark"||H,pe=typeof v=="object"&&Object.keys(v).length===0;r.useEffect(()=>{const a=Ce.current;if(!a)return;const h=new ResizeObserver(N=>{for(let M of N)He(M.contentRect.width)});return h.observe(a),()=>h.disconnect()},[]),r.useEffect(()=>{const a=[];l&&typeof l!="string"&&a.push(["TypeError","video must be a string (URL or path)"]),p&&typeof p!="string"&&a.push(["TypeError","name must be a string"]),(typeof b!="number"||b<0||b>100)&&a.push(["TypeError","volume must be a number between 0 and 100"]),u&&typeof u!="object"?a.push(["TypeError","audioVisual must be an object"]):u&&!["left","right","top","bottom"].includes(u.side)&&a.push(["ValueError","audioVisual.side must be 'left', 'right', 'top', or 'bottom'"]),a.length>0?ge(a):ge([])},[l,p,b,u,v,y]),r.useEffect(()=>{if(!k.current)return;const a=k.current,h=()=>{he||z(a.currentTime)},N=()=>V(a.duration),M=()=>{n(!1),C.current&&cancelAnimationFrame(C.current)},O=()=>n(!0),ne=()=>n(!1);return a.addEventListener("timeupdate",h),a.addEventListener("loadedmetadata",N),a.addEventListener("ended",M),a.addEventListener("play",O),a.addEventListener("pause",ne),()=>{a.removeEventListener("timeupdate",h),a.removeEventListener("loadedmetadata",N),a.removeEventListener("ended",M),a.removeEventListener("play",O),a.removeEventListener("pause",ne)}},[he]),r.useEffect(()=>{if(l){const a=W,h=j;if(k.current){k.current.pause(),k.current.src=l,k.current.volume=S?0:h/100;const N=()=>{a&&k.current&&k.current.play().catch(M=>console.error("Play failed:",M)),k.current&&k.current.removeEventListener("canplay",N)};k.current.addEventListener("canplay",N),k.current.load()}z(0),n(!1),ae.current=0,s.current=0,q.current=0,P.current=0,d.current=0,$.current=0,de()}},[l]),r.useEffect(()=>{k.current&&(k.current.volume=S?0:j/100)},[j,S]),r.useEffect(()=>{k.current&&(k.current.playbackRate=X)},[X]),r.useEffect(()=>{te.current&&(le.current&&(le.current.gain.value=Z.bass),oe.current&&(oe.current.gain.value=Z.mid),me.current&&(me.current.gain.value=Z.treble))},[Z]),r.useEffect(()=>{K.current=W,C.current&&(cancelAnimationFrame(C.current),C.current=null),W&&u?(te.current||Te(),L()):!W&&u&&Ne()},[W,u]),r.useEffect(()=>{const a=()=>Ae(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]),r.useEffect(()=>()=>{C.current&&cancelAnimationFrame(C.current),te.current&&te.current.close().catch(a=>console.warn("AudioContext cleanup error:",a))},[]);const Te=()=>{if(!te.current&&k.current)try{const a=window.AudioContext||window.webkitAudioContext;if(a){const h=new a;te.current=h;const N=h.createBiquadFilter();N.type="lowshelf",N.frequency.value=320,N.gain.value=Z.bass;const M=h.createBiquadFilter();M.type="peaking",M.frequency.value=1e3,M.Q.value=.5,M.gain.value=Z.mid;const O=h.createBiquadFilter();O.type="highshelf",O.frequency.value=3200,O.gain.value=Z.treble;const ne=h.createAnalyser();ne.fftSize=2048,ne.smoothingTimeConstant=.8;const i=h.createMediaElementSource(k.current);i.connect(N),N.connect(M),M.connect(O),O.connect(ne),O.connect(h.destination),le.current=N,oe.current=M,me.current=O,qe.current=ne,o.current=i}}catch(a){console.error("Failed to setup audio context:",a)}},Ne=()=>{if(K.current)return;ae.current*=.7,s.current*=.7;const a=Date.now();a-d.current>1500&&(q.current*=.95),a-$.current>1500&&(P.current*=.95),de();const h=Math.max(ae.current,s.current),N=Math.max(q.current,P.current);h>.01||N>.01?C.current=requestAnimationFrame(Ne):(K.current||(ae.current=0,s.current=0,q.current=0,P.current=0,de()),C.current&&cancelAnimationFrame(C.current),C.current=null)},L=()=>{if(!qe.current||!K.current)return;const a=qe.current.frequencyBinCount,h=new Uint8Array(a);qe.current.getByteFrequencyData(h);let N=0;for(let ne=0;ne<a;ne++)N+=h[ne];let M=Math.pow(N/a/255,.5);ae.current=ae.current*.7+M*.3,s.current=s.current*.7+M*.3;const O=Date.now();ae.current>q.current?(q.current=ae.current,d.current=O):O-d.current>1500&&(q.current*=.95),s.current>P.current?(P.current=s.current,$.current=O):O-$.current>1500&&(P.current*=.95),de(),C.current=requestAnimationFrame(L)},de=()=>{if(!I.current||!u)return;const a=u.color||"#00ff00",h=u.peak||"#ff0000",N=ae.current*100,M=s.current*100,O=100-q.current*100,ne=100-P.current*100;u.side==="top"||u.side==="bottom"?I.current.innerHTML=`
83
+ `}),Xe.current.innerHTML=c},kr=()=>{!d.current||!l||(_?d.current.pause():($.current&&$.current.state==="suspended"&&$.current.resume(),d.current.play().catch(t=>console.error("Play failed:",t))))},Yr=()=>{d.current&&(d.current.pause(),d.current.currentTime=0,z(!1),V(0),h.current=a.map(()=>0),N.current=a.map(()=>0),M.current=a.map(()=>0),Be())},Zr=t=>{const g=parseFloat(t.target.value)/100*j;V(g),d.current&&!ve&&(d.current.currentTime=g)},qr=()=>ge(!0),Nr=()=>{d.current&&(d.current.currentTime=B),ge(!1)},Kr=t=>{const c=parseInt(t.target.value);Pe(c),xe(c===0)},Qr=()=>xe(!he),Jr=t=>He(parseFloat(t.target.value)),Rr=()=>Ae(!H),et=(t,c)=>Ee(g=>({...g,[t]:c})),rt=()=>Ee({bass:0,mid:0,treble:0});r.useEffect(()=>{((typeof y=="object"&&Object.keys(y).length===0||!y)&&!_||G)&&kr()},[y]);const wr=t=>{if(isNaN(t))return"0:00";const c=Math.floor(t/60),g=Math.floor(t%60);return`${c}:${g.toString().padStart(2,"0")}`};if(be&&be.length>0)return e.jsx(e.Fragment,{children:be.map((t,c)=>e.jsxs("div",{className:"ecp-vp-error",children:[e.jsxs("strong",{children:[t[0],":"]})," ",t[1]]},c))});const tt=sr||F?void 0:m?"#6060606a":"#ffffffab",at=sr||F?void 0:i.bg,nt=`ecp-vp-vu-bg ${F?" ecp-vp-vu-bg--transparent":m?" ecp-vp-vu-bg--dark":" ecp-vp-vu-bg--light"}${Z&&F?" ecp-vp-vu-bg--dimmed":""}${sr?" ecp-vp-vu-bg--no-margin":""}`;return e.jsx("div",{ref:Je,className:"ecp-vp-wrapper",style:{backgroundColor:tt},children:e.jsxs("div",{className:"ecp-vp-bg",style:{background:at},children:[e.jsxs("div",{className:"ecp-vp-vu-outer",children:[e.jsx("div",{className:nt,children:e.jsx("div",{className:"ecp-vp-vu-bars",ref:Xe})}),o.enable&&_&&e.jsx("div",{className:"ecp-vp-8d-live-overlay",children:e.jsxs("div",{className:`ecp-vp-8d-live-visualizer${m?" ecp-vp-8d-live-visualizer--dark":" ecp-vp-8d-live-visualizer--light"}`,style:{"--theme-slider":i.slider,"--theme-slider-alpha":`${i.slider}33`},children:[e.jsx("div",{className:"ecp-vp-8d-live-glow",style:{background:`radial-gradient(circle, ${i.slider}35 0%, transparent 70%)`}}),e.jsxs("svg",{className:"ecp-vp-8d-live-svg",viewBox:"0 0 220 150",children:[e.jsx("circle",{cx:"110",cy:"75",r:"35",stroke:i.slider,strokeOpacity:"0.2",strokeWidth:"1",fill:"none"}),e.jsx("ellipse",{cx:"110",cy:"75",rx:"85",ry:"55",fill:"none",stroke:i.slider,strokeOpacity:"0.5",strokeWidth:"2",strokeDasharray:"2 7",strokeLinecap:"round"}),e.jsx("line",{ref:we,x1:"110",y1:"75",x2:"110",y2:"20",stroke:i.slider,strokeOpacity:"0.75",strokeWidth:"1.5"}),e.jsxs("g",{transform:"translate(110, 75)",children:[e.jsx("circle",{cx:"0",cy:"0",r:"14",fill:"none",stroke:i.slider,strokeOpacity:"0.8",strokeWidth:"1.5"}),e.jsx("line",{x1:"0",y1:"14",x2:"0",y2:"19",stroke:i.slider,strokeOpacity:"0.8",strokeWidth:"1.5"}),e.jsx("text",{x:"0",y:"29",textAnchor:"middle",fill:i.slider,fillOpacity:"0.75",fontSize:"8",fontWeight:"700",letterSpacing:"0.5px",fontFamily:"monospace",children:"8D"})]})]}),e.jsx(rr,{size:14,className:"ecp-vp-8d-live-head-icon",style:{color:i.slider}}),e.jsx("div",{ref:Fe,className:"ecp-vp-8d-live-dot",style:{background:i.slider,boxShadow:`0 0 12px ${i.slider}`},children:e.jsx("span",{className:"ecp-vp-8d-live-dot-inner"})})]})}),Z&&e.jsxs("div",{className:`ecp-vp-eq-overlay${m?" ecp-vp-eq-overlay--dark":" ecp-vp-eq-overlay--light"}`,children:[e.jsx("h3",{className:`ecp-vp-eq-title${m?" ecp-vp-eq-title--dark":" ecp-vp-eq-title--light"}`,children:"Equalizer"}),e.jsx("div",{className:"ecp-vp-eq-bands",children:["bass","mid","treble"].map(t=>e.jsxs("div",{className:"ecp-vp-eq-band",children:[e.jsxs("div",{className:"ecp-vp-eq-band-header",children:[e.jsx("span",{className:`ecp-vp-eq-band-label${m?" ecp-vp-eq-band-label--dark":" ecp-vp-eq-band-label--light"}`,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsxs("span",{className:`ecp-vp-eq-band-label${m?" ecp-vp-eq-band-label--dark":" ecp-vp-eq-band-label--light"}`,children:[X[t]>0?`+${X[t]}`:X[t]," dB"]})]}),e.jsxs("div",{className:"ecp-vp-eq-band-range",children:[e.jsx("span",{className:`ecp-vp-eq-range-bound${m?" ecp-vp-eq-range-bound--dark":" ecp-vp-eq-range-bound--light"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:X[t],onChange:c=>et(t,parseInt(c.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${(X[t]+20)/40*100}%, ${i.slider+"30"} ${(X[t]+20)/40*100}%)`,"--thumb-color":i.slider}}),e.jsx("span",{className:`ecp-vp-eq-range-bound${m?" ecp-vp-eq-range-bound--dark":" ecp-vp-eq-range-bound--light"}`,children:"+20"})]})]},t))}),e.jsx("div",{className:"ecp-vp-eq-footer",children:e.jsx("button",{onClick:rt,className:`ecp-vp-eq-reset${m?" ecp-vp-eq-reset--dark":" ecp-vp-eq-reset--light"}`,children:"Reset"})})]}),te&&e.jsxs("div",{className:`ecp-vp-eq-overlay${m?" ecp-vp-eq-overlay--dark":" ecp-vp-eq-overlay--light"}`,style:{"--theme-slider":i.slider,"--theme-slider-alpha":`${i.slider}33`},children:[e.jsxs("div",{className:"ecp-vp-8d-header",children:[e.jsxs("div",{className:"ecp-vp-8d-title-group",children:[e.jsx(rr,{size:18,style:{color:i.slider}}),e.jsx("h3",{className:`ecp-vp-eq-title${m?" ecp-vp-eq-title--dark":" ecp-vp-eq-title--light"}`,style:{margin:0},children:"8D Spatial Engine"})]}),e.jsxs("div",{className:"ecp-vp-8d-toggle-wrap",children:[e.jsx("span",{className:`ecp-vp-8d-toggle-label${m?" ecp-vp-8d-toggle-label--dark":" ecp-vp-8d-toggle-label--light"}`,children:o.enable?"On":"Off"}),e.jsx("button",{onClick:q,className:`ecp-vp-8d-toggle${o.enable?" ecp-vp-8d-toggle--on":""}`,children:e.jsx("div",{className:"ecp-vp-8d-toggle-thumb"})})]})]}),e.jsx("div",{className:"ecp-vp-8d-tabs",children:["spatial","reverb","echo","tape"].map(t=>e.jsx("button",{onClick:()=>me(t),className:`ecp-vp-8d-tab${m?" ecp-vp-8d-tab--dark":" ecp-vp-8d-tab--light"}${oe===t?" ecp-vp-8d-tab--active":""}`,children:t.charAt(0).toUpperCase()+t.slice(1)},t))}),e.jsxs("div",{className:"ecp-vp-8d-controls-grid",children:[oe==="spatial"&&e.jsxs("div",{className:"ecp-vp-eq-bands--horizontal",children:[e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.spatial.rate.toFixed(2),"x"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0.01",max:"1.00",step:"0.01",value:o.spatial.rate,onChange:t=>s("spatial","rate",parseFloat(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${(o.spatial.rate-.01)/.99*100}%, ${i.slider+"30"} ${(o.spatial.rate-.01)/.99*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"RATE"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.spatial.width,"°"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"180",step:"5",value:o.spatial.width,onChange:t=>s("spatial","width",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.spatial.width/180*100}%, ${i.slider+"30"} ${o.spatial.width/180*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"WIDTH"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.spatial.focus,"%"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:o.spatial.focus,onChange:t=>s("spatial","focus",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.spatial.focus}%, ${i.slider+"30"} ${o.spatial.focus}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"FOCUS"})]})]}),oe==="reverb"&&e.jsxs("div",{className:"ecp-vp-eq-bands--horizontal",children:[e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.reverb.size.toFixed(1),"s"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0.2",max:"5.0",step:"0.1",value:o.reverb.size,onChange:t=>s("reverb","size",parseFloat(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${(o.reverb.size-.2)/4.8*100}%, ${i.slider+"30"} ${(o.reverb.size-.2)/4.8*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"SIZE"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.reverb.tone,"%"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:o.reverb.tone,onChange:t=>s("reverb","tone",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.reverb.tone}%, ${i.slider+"30"} ${o.reverb.tone}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"TONE"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.reverb.mix,"%"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:o.reverb.mix,onChange:t=>s("reverb","mix",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.reverb.mix}%, ${i.slider+"30"} ${o.reverb.mix}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"MIX"})]})]}),oe==="echo"&&e.jsxs("div",{className:"ecp-vp-eq-bands--horizontal",children:[e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.echo.time,"ms"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"50",max:"1000",step:"10",value:o.echo.time,onChange:t=>s("echo","time",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${(o.echo.time-50)/950*100}%, ${i.slider+"30"} ${(o.echo.time-50)/950*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"TIME"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.echo.feedback,"%"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"85",step:"1",value:o.echo.feedback,onChange:t=>s("echo","feedback",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.echo.feedback/85*100}%, ${i.slider+"30"} ${o.echo.feedback/85*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"FEEDBACK"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.echo.mix,"%"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:o.echo.mix,onChange:t=>s("echo","mix",parseInt(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.echo.mix}%, ${i.slider+"30"} ${o.echo.mix}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"MIX"})]})]}),oe==="tape"&&e.jsxs("div",{className:"ecp-vp-eq-bands--horizontal",children:[e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsxs("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:[o.tape.speed.toFixed(2),"x"]}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0.50",max:"2.00",step:"0.01",value:o.tape.speed,onChange:t=>s("tape","speed",parseFloat(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${(o.tape.speed-.5)/1.5*100}%, ${i.slider+"30"} ${(o.tape.speed-.5)/1.5*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"SPEED"})]}),e.jsxs("div",{className:"ecp-vp-eq-band-col",children:[e.jsx("div",{className:`ecp-vp-eq-val${m?" ecp-vp-eq-val--dark":" ecp-vp-eq-val--light"}`,children:o.tape.drive}),e.jsx("div",{className:"ecp-vp-eq-bar-wrap",children:e.jsx("input",{type:"range",min:"0",max:"50",step:"1",value:o.tape.drive,onChange:t=>s("tape","drive",parseFloat(t.target.value)),className:"ecp-vp-eq-slider",style:{background:`linear-gradient(to right, ${i.slider} ${o.tape.drive/50*100}%, ${i.slider+"30"} ${o.tape.drive/50*100}%)`,"--thumb-color":i.slider}})}),e.jsx("div",{className:`ecp-vp-eq-label${m?" ecp-vp-eq-label--dark":" ecp-vp-eq-label--light"}`,children:"DRIVE"})]})]})]}),e.jsx("div",{className:"ecp-vp-eq-footer",children:e.jsx("button",{onClick:P,className:`ecp-vp-eq-reset${m?" ecp-vp-eq-reset--dark":" ecp-vp-eq-reset--light"}`,children:"Reset Defaults"})})]})]}),y.trackName&&e.jsxs("div",{className:"ecp-vp-track",children:[v&&e.jsx("div",{className:"ecp-vp-thumbnail-wrap",children:e.jsx("img",{src:v,alt:"",className:`ecp-vp-thumbnail${_?" ecp-animation-spin":""}`})}),e.jsxs("div",{className:"ecp-vp-track-info",children:[e.jsx("div",{className:`ecp-vp-track-name${m?" ecp-vp-track-name--dark":" ecp-vp-track-name--light"}`,children:p}),u&&typeof u=="string"&&e.jsx("div",{className:`ecp-vp-track-author${m?" ecp-vp-track-author--dark":" ecp-vp-track-author--light"}`,children:u})]})]}),y.seekbar&&e.jsx("div",{className:"ecp-vp-seekbar",children:e.jsxs("div",{className:"ecp-vp-seekbar-row",children:[e.jsx("span",{className:`ecp-vp-time${m?" ecp-vp-time--dark":" ecp-vp-time--light"}`,children:wr(B)}),e.jsx("input",{type:"range",min:"0",max:"100",value:j>0?B/j*100:0,onChange:Zr,onMouseDown:qr,onMouseUp:Nr,onTouchStart:qr,onTouchEnd:Nr,disabled:!l,className:"ecp-vp-seek-input",style:{background:l&&j>0?`linear-gradient(to right, ${i.slider} ${B/j*100}%, ${i.slider+"30"} ${B/j*100}%)`:i.slider+"30","--thumb-color":i.slider}}),e.jsx("span",{className:`ecp-vp-time ecp-vp-time--right${m?" ecp-vp-time--dark":" ecp-vp-time--light"}`,children:wr(j)})]})}),e.jsxs("div",{className:`ecp-vp-controls${k<330?" ecp-vp-controls--sm":""}`,children:[y.play&&e.jsxs("button",{onClick:kr,disabled:!l,className:`ecp-vp-play-btn${k<350?" ecp-vp-play-btn--compact":""}`,style:{backgroundColor:i.button},children:[e.jsxs("div",{className:"ecp-vp-play-icon-wrap",children:[e.jsx(Ze,{size:16,style:{position:"absolute",transform:_?void 0:"scale(0) translateY(2.5rem)",transition:"all 150ms"}}),e.jsx(Ke,{size:16,style:{position:"absolute",transform:_?"scale(0) translateY(-2.5rem)":void 0,transition:"all 150ms"}})]}),e.jsx("span",{style:{display:k<350?"none":"block"},children:_?"Pause":"Play"})]}),y.stop&&e.jsxs("button",{onClick:Yr,disabled:!l,className:`ecp-vp-stop-btn${m?" ecp-vp-stop-btn--dark":" ecp-vp-stop-btn--light"}${k>=600?" ecp-vp-stop-btn--wide":""}`,children:[e.jsx(or,{size:16}),e.jsx("span",{style:{display:k<600?"none":"block"},children:"Stop"})]}),y.equalizer&&e.jsxs("button",{onClick:()=>{Me(!Z),qe(!1)},disabled:!l,className:`ecp-vp-eq-btn${Z?" ecp-vp-eq-btn--on":" ecp-vp-eq-btn--off"}${k>=600?" ecp-vp-eq-btn--wide":""}`,style:Z?{backgroundColor:i.button}:{},children:[e.jsx(Qe,{size:16}),e.jsx("span",{style:{display:k<600?"none":"block"},children:"EQ"})]}),y.loop&&e.jsxs("button",{onClick:Rr,disabled:!l,className:`ecp-vp-loop-btn${H?" ecp-vp-loop-btn--on":" ecp-vp-loop-btn--off"}${k>=700?" ecp-vp-loop-btn--wide":""}`,style:H?{backgroundColor:i.button}:{},children:[e.jsx(Wr,{size:16,className:H?"ecp-vp-loop-icon--active":""}),e.jsx("span",{style:{display:k<700?"none":"block"},children:"Loop"})]}),y.speed&&!y.dolby8d&&e.jsx("div",{className:"ecp-vp-speed-wrap",children:e.jsx("select",{value:re,onChange:Jr,className:`ecp-vp-speed-select${m?" ecp-vp-speed-select--dark":" ecp-vp-speed-select--light"}`,children:["0.5","0.75","1","1.25","1.5","2"].map(t=>e.jsxs("option",{value:t,className:m?"ecp-vp-speed-option--dark":"ecp-vp-speed-option--light",children:[t,"x"]},t))})}),y.dolby8d&&e.jsxs("button",{onClick:()=>{qe(!te),Me(!1)},disabled:!l,className:`ecp-vp-loop-btn${te?" ecp-vp-loop-btn--on":" ecp-vp-loop-btn--off"}${k>=700?" ecp-vp-loop-btn--wide":""}`,style:te?{backgroundColor:i.button}:{},children:[e.jsx(rr,{size:16,className:""}),e.jsx("span",{style:{display:k<700?"none":"block"},children:"Dolby"})]}),y.volume&&e.jsxs("div",{className:"ecp-vp-volume",children:[e.jsx("button",{onClick:Qr,className:"ecp-vp-mute-btn",children:he||T===0?e.jsx(ar,{size:20,className:m?"ecp-vp-mute-icon--dark":"ecp-vp-mute-icon--light"}):e.jsx(tr,{size:20,className:m?"ecp-vp-mute-icon--dark":"ecp-vp-mute-icon--light"})}),e.jsx("input",{type:"range",min:"0",max:"100",value:T,onChange:Kr,className:"ecp-vp-volume-slider",style:{background:`linear-gradient(to right, ${i.slider} ${T}%, ${i.slider+"30"} ${T}%)`,"--thumb-color":i.slider,display:k<460?"none":"block"}}),e.jsxs("span",{className:`ecp-vp-volume-pct${m?" ecp-vp-volume-pct--dark":" ecp-vp-volume-pct--light"}`,style:{display:k<800?"none":"block"},children:[T,"%"]})]})]})]})})}function fr({audio:l,gradient:p=["#cd7eff","#ff00f2"],background:u="#f4e4ffff",autoPlay:b=!1,thumbnail:x=null,width:v,equalizer:y={bass:0,mid:0,treble:0},mode:J="light"}){const[E,F]=r.useState(!1),[G,W]=r.useState(0),[n,_]=r.useState(0),[z,B]=r.useState(!1),[V,j]=r.useState(80),[A,T]=r.useState(1),[Pe,he]=r.useState([]),[xe,H]=r.useState(null),[Ae,ve]=r.useState(!1),[ge,be]=r.useState({bass:y.bass||0,mid:y.mid||0,treble:y.treble||0}),U=r.useRef(null),Z=r.useRef(null),Me=r.useRef(null),X=r.useRef(null),Ee=r.useRef(null),re=r.useRef(null),He=()=>{const s=[];for(let q=0;q<100;q++)s.push(20+Math.random()*60);return s};r.useEffect(()=>{if(!l)return;if(!Array.isArray(p)||p.length<2){H("Gradient must be an array with at least 2 colors");return}const s=U.current;if(!s)return;const q=()=>W(s.currentTime),P=()=>{_(s.duration),he(He())},d=()=>F(!1),$=K=>{var S,pe;return H(`Audio error: ${((pe=(S=K.target)==null?void 0:S.error)==null?void 0:pe.message)||"Failed to load audio"}`)};return s.addEventListener("timeupdate",q),s.addEventListener("loadedmetadata",P),s.addEventListener("ended",d),s.addEventListener("error",$),()=>{s.removeEventListener("timeupdate",q),s.removeEventListener("loadedmetadata",P),s.removeEventListener("ended",d),s.removeEventListener("error",$)}},[l,p,J]),r.useEffect(()=>{l&&U.current&&b&&(U.current.play().catch(s=>{console.error("Play failed:",s),F(!1)}),F(!0))},[l]),r.useEffect(()=>{if(U.current&&!Z.current&&U.current){const s=window.AudioContext||window.webkitAudioContext;if(s){const q=new s;Z.current=q;const P=q.createMediaElementSource(U.current);Me.current=P;const d=q.createBiquadFilter();d.type="lowshelf",d.frequency.value=200,X.current=d;const $=q.createBiquadFilter();$.type="peaking",$.frequency.value=1e3,$.Q.value=1,Ee.current=$;const K=q.createBiquadFilter();K.type="highshelf",K.frequency.value=3e3,re.current=K,P.connect(d).connect($).connect(K).connect(q.destination)}}},[l]),r.useEffect(()=>{U.current&&(U.current.volume=z?0:V/100)},[V,z]),r.useEffect(()=>{U.current&&(U.current.playbackRate=A)},[A]);const k=()=>{U.current&&(E?U.current.pause():U.current.play().catch(s=>H(`Playback failed: ${s instanceof Error?s.message:String(s)}`)),F(!E))},Ce=()=>B(!z),te=s=>{j(parseInt(s.target.value)),z&&parseInt(s.target.value)>0&&B(!1)},qe=s=>T(parseFloat(s.target.value)),o=s=>{const q=s.currentTarget.getBoundingClientRect(),d=(s.clientX-q.left)/q.width*n;U.current&&(U.current.currentTime=d,W(d))},le=(s,q)=>{be(P=>({...P,[s]:q})),s==="bass"&&X.current&&(X.current.gain.value=q),s==="mid"&&Ee.current&&(Ee.current.gain.value=q),s==="treble"&&re.current&&(re.current.gain.value=q)},oe=()=>{le("bass",0),le("mid",0),le("treble",0)},me=s=>{if(isNaN(s))return"0:00";const q=Math.floor(s/60),P=Math.floor(s%60);return`${q}:${P.toString().padStart(2,"0")}`},C=n>0?G/n*100:0,D=J==="dark";if(xe)return e.jsxs("div",{className:"ecp-wave-error",style:{background:u},children:[e.jsx("p",{className:`ecp-wave-error-title${D?" ecp-wave-error--dark":" ecp-wave-error--light"}`,children:"Error"}),e.jsx("p",{className:`ecp-wave-error-msg${D?" ecp-wave-error--dark":" ecp-wave-error--light"}`,children:xe})]});if(!l)return null;const ae=D?"#9ca3af":"#6b7280";return e.jsxs("div",{className:"ecp-wave-outer",style:{width:v?`${v}px`:void 0},children:[e.jsx("audio",{ref:U,src:l,className:"ecp-wave-audio-el"}),e.jsx("div",{className:"ecp-wave-card",children:e.jsxs("div",{className:"ecp-wave-card-inner",style:{background:u},children:[x&&e.jsx("div",{className:"ecp-wave-thumbnail-wrap",children:e.jsx("img",{src:x,alt:"",className:"ecp-wave-thumbnail"})}),e.jsxs("div",{className:"ecp-wave-seek",onClick:o,children:[e.jsx("div",{className:"ecp-wave-bars",children:Pe.map((s,q)=>{const P=q/Pe.length*100<=C;return e.jsx("div",{className:"ecp-wave-bar",style:{height:`${s}%`,background:P?p[0]:p[1],opacity:P?1:.4}},q)})}),e.jsx("div",{className:"ecp-wave-progress-line",style:{left:`${C}%`}})]}),e.jsxs("div",{className:"ecp-wave-times",style:{color:ae},children:[e.jsx("span",{children:me(G)}),e.jsx("span",{children:me(n)})]}),e.jsxs("div",{className:"ecp-wave-controls",children:[e.jsxs("div",{className:"ecp-wave-left-controls",children:[e.jsx("button",{onClick:Ce,className:"ecp-wave-vol-btn",style:{background:`linear-gradient(135deg, ${p[0]}, ${p[1]})`},children:z||V===0?e.jsx(ar,{style:{width:"1rem",height:"1rem",color:"white"}}):e.jsx(tr,{style:{width:"1rem",height:"1rem",color:"white"}})}),e.jsx("input",{type:"range",min:"0",max:"100",value:V,onChange:te,className:"ecp-wave-vol-slider",style:{background:`linear-gradient(to right, ${p[0]} ${V}%, ${D?"#374151":"#d1d5db"} ${V}%)`,"--thumb-color":p[0],display:v&&v<400?"none":void 0}}),v&&v<400&&e.jsx("button",{onClick:()=>ve(!Ae),className:"ecp-wave-eq-btn",style:{background:`linear-gradient(135deg, ${p[0]}, ${p[1]})`},children:e.jsx(Qe,{style:{width:"1rem",height:"1rem",color:"white"}})})]}),e.jsx("div",{className:"ecp-wave-center-controls",children:e.jsx("button",{onClick:k,className:"ecp-wave-play-btn",style:{background:`linear-gradient(135deg, ${p[0]}, ${p[1]})`},children:E?e.jsx(Ze,{style:{width:"1.5rem",height:"1.5rem",color:"white",fill:"white"}}):e.jsx(Ke,{style:{width:"1.5rem",height:"1.5rem",color:"white",fill:"white"}})})}),e.jsxs("div",{className:"ecp-wave-right-controls",children:[e.jsx("select",{value:A,onChange:qe,className:`ecp-wave-speed-select${D?" ecp-wave-speed-select--dark":" ecp-wave-speed-select--light"}`,style:{background:u,color:p[0]},children:["0.5","0.75","1","1.25","1.5","2"].map(s=>e.jsxs("option",{value:s,children:[s,"x"]},s))}),!(v&&v<400)&&e.jsx("button",{onClick:()=>ve(!Ae),className:"ecp-wave-eq-btn",style:{background:`linear-gradient(135deg, ${p[0]}, ${p[1]})`},children:e.jsx(Qe,{style:{width:"1rem",height:"1rem",color:"white"}})})]})]})]})}),Ae&&e.jsx("div",{className:"ecp-wave-eq-overlay",children:e.jsxs("div",{className:`ecp-wave-eq-panel${D?" ecp-wave-eq-panel--dark":" ecp-wave-eq-panel--light"}`,children:[e.jsx("h3",{className:`ecp-wave-eq-title${D?" ecp-wave-eq-title--dark":" ecp-wave-eq-title--light"}`,children:"Equalizer"}),e.jsx("div",{className:"ecp-wave-eq-bands",children:["bass","mid","treble"].map(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"ecp-wave-eq-band-header",children:[e.jsx("span",{className:D?"ecp-wave-eq-label--dark":"ecp-wave-eq-label--light",children:s.charAt(0).toUpperCase()+s.slice(1)}),e.jsxs("span",{className:D?"ecp-wave-eq-label--dark":"ecp-wave-eq-label--light",children:[ge[s]," dB"]})]}),e.jsxs("div",{className:"ecp-wave-eq-range-row",children:[e.jsx("span",{className:D?"ecp-wave-eq-bound--dark":"ecp-wave-eq-bound--light",children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:ge[s],onChange:q=>le(s,parseInt(q.target.value)),className:"ecp-wave-eq-slider",style:{background:`linear-gradient(to right, ${p[0]} ${(ge[s]+20)/40*100}%, ${p[1]+"30"} ${(ge[s]+20)/40*100}%)`,"--thumb-color":p[0]}}),e.jsx("span",{className:D?"ecp-wave-eq-bound--dark":"ecp-wave-eq-bound--light",children:"+20"})]})]},s))}),e.jsxs("div",{className:"ecp-wave-eq-footer",children:[e.jsx("button",{onClick:oe,className:`ecp-wave-eq-footer-btn${D?" ecp-wave-eq-footer-btn--dark":" ecp-wave-eq-footer-btn--light"}`,children:"Reset"}),e.jsx("button",{onClick:()=>ve(!1),className:`ecp-wave-eq-footer-btn${D?" ecp-wave-eq-footer-btn--dark":" ecp-wave-eq-footer-btn--light"}`,children:"Close"})]})]})})]})}function hr({audio:l,thumbnail:p,gradient:u=["#cd7eff","#fe59f6"],background:b="#1f273a",autoPlay:x=!1}){const[v,y]=r.useState(!1),[,J]=r.useState(0),E=r.useRef(null),[F,G]=r.useState(0),[W,n]=r.useState(0),[_,z]=r.useState(0);r.useEffect(()=>{const A=E.current;if(!A)return;const T=()=>J(A.currentTime);return A.addEventListener("timeupdate",T),()=>A.removeEventListener("timeupdate",T)},[]),r.useEffect(()=>{const A=setInterval(()=>{v&&G(T=>T+.1)},100);return()=>clearInterval(A)},[v]),r.useEffect(()=>{const A=setInterval(()=>{v&&z(T=>T+.1)},100);return()=>clearInterval(A)},[v]),r.useEffect(()=>{l&&E.current&&x&&(E.current.play().catch(()=>y(!1)),y(!0))},[l]),r.useEffect(()=>{const A=E.current;if(!A)return;const T=()=>n(A.duration);return z(0),A.addEventListener("loadedmetadata",T),()=>A.removeEventListener("loadedmetadata",T)},[l]);const B=()=>{E.current&&(v?E.current.pause():E.current.play().catch(A=>console.error("NanoPlayer play failed:",A)),y(!v))};if(!l)return null;const V=`linear-gradient(135deg, ${u[0]}, ${u[1]})`,j=`${(W>0?_/W:0)*100}%`;return e.jsxs("div",{className:`ecp-nano-wrapper${p?" ecp-nano-wrapper--card":" ecp-nano-wrapper--pill"}`,style:{backgroundColor:b},children:[e.jsx("audio",{ref:E,src:l,onEnded:()=>{y(!1),z(0)}}),e.jsx("div",{className:"ecp-nano-progress-bg",style:{width:j,backgroundImage:V}}),e.jsxs("div",{className:"ecp-nano-content",children:[p&&e.jsx("div",{className:"ecp-nano-thumbnail-wrap",children:e.jsx("img",{src:p,alt:"",className:"ecp-nano-thumbnail"})}),e.jsxs("div",{className:"ecp-nano-row",children:[e.jsx("button",{onClick:B,className:"ecp-nano-play-btn",style:{background:V},children:v?e.jsx(Ze,{fill:b,style:{width:"0.75rem",height:"0.75rem",color:"transparent"}}):e.jsx(Ke,{fill:b,style:{width:"0.75rem",height:"0.75rem",color:"transparent"}})}),e.jsx("div",{className:"ecp-nano-waveform",children:[...Array(12)].map((A,T)=>e.jsx("div",{className:"ecp-nano-wave-bar",style:{background:`linear-gradient(to top, ${u[0]}, ${u[1]})`,height:v?`${8+Math.sin((F*8+T)*.6)*10}px`:"8px",opacity:v?.8:.4}},T))})]})]})]})}function Gr({video:l,name:p="No video loaded",audioVisual:u=null,volume:b=100,thumbnail:x=null,controls:v={play:!0,pause:!0,stop:!0,seekbar:!0,volume:!0,fullscreen:!0,videoName:!0,equalizer:!0,speed:!0},mode:y="light",transparent:J=!1,autoPlay:E=!1,color:F="#3b82f6",equalizer:G={bass:0,mid:0,treble:0}}){const[W,n]=r.useState(!1),[_,z]=r.useState(0),[B,V]=r.useState(0),[j,A]=r.useState(b||100),[T,Pe]=r.useState(!1),[he,xe]=r.useState(!1),[H,Ae]=r.useState(!1),[ve,ge]=r.useState([]),[be,U]=r.useState(!1),[Z,Me]=r.useState({bass:G.bass||0,mid:G.mid||0,treble:G.treble||0}),[X,Ee]=r.useState(1),[re,He]=r.useState(0),k=r.useRef(null),Ce=r.useRef(null),te=r.useRef(null),qe=r.useRef(null),o=r.useRef(null),le=r.useRef(null),oe=r.useRef(null),me=r.useRef(null),C=r.useRef(null),D=r.useRef(null),ae=r.useRef(0),s=r.useRef(0),q=r.useRef(0),P=r.useRef(0),d=r.useRef(0),$=r.useRef(0),K=r.useRef(!1),S=y==="dark"||H,pe=typeof v=="object"&&Object.keys(v).length===0;r.useEffect(()=>{const a=Ce.current;if(!a)return;const h=new ResizeObserver(N=>{for(let M of N)He(M.contentRect.width)});return h.observe(a),()=>h.disconnect()},[]),r.useEffect(()=>{const a=[];l&&typeof l!="string"&&a.push(["TypeError","video must be a string (URL or path)"]),p&&typeof p!="string"&&a.push(["TypeError","name must be a string"]),(typeof b!="number"||b<0||b>100)&&a.push(["TypeError","volume must be a number between 0 and 100"]),u&&typeof u!="object"?a.push(["TypeError","audioVisual must be an object"]):u&&!["left","right","top","bottom"].includes(u.side)&&a.push(["ValueError","audioVisual.side must be 'left', 'right', 'top', or 'bottom'"]),a.length>0?ge(a):ge([])},[l,p,b,u,v,y]),r.useEffect(()=>{if(!k.current)return;const a=k.current,h=()=>{he||z(a.currentTime)},N=()=>V(a.duration),M=()=>{n(!1),C.current&&cancelAnimationFrame(C.current)},O=()=>n(!0),ne=()=>n(!1);return a.addEventListener("timeupdate",h),a.addEventListener("loadedmetadata",N),a.addEventListener("ended",M),a.addEventListener("play",O),a.addEventListener("pause",ne),()=>{a.removeEventListener("timeupdate",h),a.removeEventListener("loadedmetadata",N),a.removeEventListener("ended",M),a.removeEventListener("play",O),a.removeEventListener("pause",ne)}},[he]),r.useEffect(()=>{if(l){const a=W,h=j;if(k.current){k.current.pause(),k.current.src=l,k.current.volume=T?0:h/100;const N=()=>{a&&k.current&&k.current.play().catch(M=>console.error("Play failed:",M)),k.current&&k.current.removeEventListener("canplay",N)};k.current.addEventListener("canplay",N),k.current.load()}z(0),n(!1),ae.current=0,s.current=0,q.current=0,P.current=0,d.current=0,$.current=0,de()}},[l]),r.useEffect(()=>{k.current&&(k.current.volume=T?0:j/100)},[j,T]),r.useEffect(()=>{k.current&&(k.current.playbackRate=X)},[X]),r.useEffect(()=>{te.current&&(le.current&&(le.current.gain.value=Z.bass),oe.current&&(oe.current.gain.value=Z.mid),me.current&&(me.current.gain.value=Z.treble))},[Z]),r.useEffect(()=>{K.current=W,C.current&&(cancelAnimationFrame(C.current),C.current=null),W&&u?(te.current||Se(),L()):!W&&u&&Ne()},[W,u]),r.useEffect(()=>{const a=()=>Ae(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]),r.useEffect(()=>()=>{C.current&&cancelAnimationFrame(C.current),te.current&&te.current.close().catch(a=>console.warn("AudioContext cleanup error:",a))},[]);const Se=()=>{if(!te.current&&k.current)try{const a=window.AudioContext||window.webkitAudioContext;if(a){const h=new a;te.current=h;const N=h.createBiquadFilter();N.type="lowshelf",N.frequency.value=320,N.gain.value=Z.bass;const M=h.createBiquadFilter();M.type="peaking",M.frequency.value=1e3,M.Q.value=.5,M.gain.value=Z.mid;const O=h.createBiquadFilter();O.type="highshelf",O.frequency.value=3200,O.gain.value=Z.treble;const ne=h.createAnalyser();ne.fftSize=2048,ne.smoothingTimeConstant=.8;const i=h.createMediaElementSource(k.current);i.connect(N),N.connect(M),M.connect(O),O.connect(ne),O.connect(h.destination),le.current=N,oe.current=M,me.current=O,qe.current=ne,o.current=i}}catch(a){console.error("Failed to setup audio context:",a)}},Ne=()=>{if(K.current)return;ae.current*=.7,s.current*=.7;const a=Date.now();a-d.current>1500&&(q.current*=.95),a-$.current>1500&&(P.current*=.95),de();const h=Math.max(ae.current,s.current),N=Math.max(q.current,P.current);h>.01||N>.01?C.current=requestAnimationFrame(Ne):(K.current||(ae.current=0,s.current=0,q.current=0,P.current=0,de()),C.current&&cancelAnimationFrame(C.current),C.current=null)},L=()=>{if(!qe.current||!K.current)return;const a=qe.current.frequencyBinCount,h=new Uint8Array(a);qe.current.getByteFrequencyData(h);let N=0;for(let ne=0;ne<a;ne++)N+=h[ne];let M=Math.pow(N/a/255,.5);ae.current=ae.current*.7+M*.3,s.current=s.current*.7+M*.3;const O=Date.now();ae.current>q.current?(q.current=ae.current,d.current=O):O-d.current>1500&&(q.current*=.95),s.current>P.current?(P.current=s.current,$.current=O):O-$.current>1500&&(P.current*=.95),de(),C.current=requestAnimationFrame(L)},de=()=>{if(!D.current||!u)return;const a=u.color||"#00ff00",h=u.peak||"#ff0000",N=ae.current*100,M=s.current*100,O=100-q.current*100,ne=100-P.current*100;u.side==="top"||u.side==="bottom"?D.current.innerHTML=`
84
84
  <div style="display:flex;flex-direction:column;gap:0.25rem;height:100%;justify-content:center;">
85
85
  <div style="display:flex;align-items:center;justify-content:center;gap:0.5rem;">
86
- <div style="font-size:0.75rem;opacity:0.8;width:1rem;text-align:center;color:${T?"#f3f4f6":"#111827"}">L</div>
86
+ <div style="font-size:0.75rem;opacity:0.8;width:1rem;text-align:center;color:${S?"#f3f4f6":"#111827"}">L</div>
87
87
  <div style="position:relative;flex:1;height:0.75rem;background:rgba(0,0,0,0.4);border-radius:9999px;overflow:hidden;display:flex;justify-content:flex-end;">
88
88
  <div style="height:100%;border-radius:9999px 0 0 9999px;transition:width 75ms;width:${N}%;background:${a};"></div>
89
89
  ${q.current>.1?`<div style="position:absolute;top:0;width:0.25rem;height:100%;transition:right 100ms;right:${q.current*100}%;background:${h};"></div>`:""}
@@ -93,10 +93,10 @@
93
93
  <div style="height:100%;border-radius:0 9999px 9999px 0;transition:width 75ms;width:${M}%;background:${a};"></div>
94
94
  ${P.current>.1?`<div style="position:absolute;top:0;width:0.25rem;height:100%;transition:left 100ms;left:${P.current*100}%;background:${h};"></div>`:""}
95
95
  </div>
96
- <div style="font-size:0.75rem;opacity:0.8;width:1rem;text-align:center;color:${T?"#f3f4f6":"#111827"}">R</div>
96
+ <div style="font-size:0.75rem;opacity:0.8;width:1rem;text-align:center;color:${S?"#f3f4f6":"#111827"}">R</div>
97
97
  </div>
98
98
  </div>
99
- `:I.current.innerHTML=`
99
+ `:D.current.innerHTML=`
100
100
  <div style="display:flex;gap:0.5rem;height:100%;">
101
101
  <div style="flex:1;display:flex;flex-direction:column;">
102
102
  <div style="font-size:0.75rem;color:white;opacity:0.7;text-align:center;margin-bottom:0.25rem;">L</div>
@@ -115,4 +115,4 @@
115
115
  </div>
116
116
  </div>
117
117
  </div>
118
- `},Ie=()=>{!k.current||!l||(W?k.current.pause():(te.current&&te.current.state==="suspended"&&te.current.resume(),k.current.play().catch(a=>console.error("Play failed:",a))))},Oe=()=>{k.current&&(k.current.pause(),k.current.currentTime=0,n(!1),z(0),ae.current=0,s.current=0,q.current=0,P.current=0,de())},We=a=>{const N=parseFloat(a.target.value)/100*B;z(N),k.current&&!he&&(k.current.currentTime=N)},De=()=>xe(!0),_e=()=>{k.current&&(k.current.currentTime=_),xe(!1)},Ue=a=>{const h=parseInt(a.target.value);A(h),Pe(h===0)},Ge=a=>Ee(parseFloat(a.target.value)),nr=()=>Pe(!S),Ve=()=>{Ce.current&&(document.fullscreenElement?document.exitFullscreen():Ce.current.requestFullscreen().catch(a=>console.error("Fullscreen failed:",a)))},Fe=(a,h)=>{Me(N=>({...N,[a]:h})),te.current&&(a==="bass"&&le.current&&(le.current.gain.value=h),a==="mid"&&oe.current&&(oe.current.gain.value=h),a==="treble"&&me.current&&(me.current.gain.value=h))},we=()=>Me({bass:0,mid:0,treble:0}),Q=a=>{if(isNaN(a))return"0:00";const h=Math.floor(a/60),N=Math.floor(a%60);return`${h}:${N.toString().padStart(2,"0")}`};if(r.useEffect(()=>{(pe&&!W||E)&&Ie()},[v]),ve&&ve.length>0)return e.jsx(e.Fragment,{children:ve.map((a,h)=>e.jsxs("div",{className:"ecp-video-error",children:[e.jsxs("strong",{children:[a[0],":"]})," ",a[1]]},h))});const ue=u?u.side:null,ze=ue==="top"||ue==="bottom",Xe=pe||J?void 0:T?"#49494937":"white",Je=pe||J?void 0:T?"#1a1a1ab0":"#f5f5f5";return e.jsx("div",{ref:Ce,className:`ecp-video-wrapper${H?" ecp-video-wrapper--fullscreen":""}`,style:{backgroundColor:Xe},children:e.jsxs("div",{className:`ecp-video-inner${H?" ecp-video-inner--fullscreen":""}${J?"":" ecp-video-inner--padded"}`,style:{background:Je},children:[v.videoName&&!H&&e.jsx("div",{className:`ecp-video-name${T?" ecp-video-name--dark":" ecp-video-name--light"}`,children:p}),e.jsxs("div",{className:`ecp-video-layout${ze?" ecp-video-layout--col":" ecp-video-layout--row"}${H?" ecp-video-layout--fullscreen":""}`,children:[u&&ue==="top"&&e.jsx("div",{className:"ecp-video-vu-top",ref:I}),e.jsxs("div",{style:{display:"flex",flex:ze?void 0:1,gap:"0.75rem"},children:[u&&ue==="left"&&e.jsx("div",{className:"ecp-video-vu-side",ref:I}),e.jsxs("div",{className:`ecp-video-el-wrap${T?" ecp-video-el-wrap--dark":" ecp-video-el-wrap--light"}`,children:[e.jsxs("video",{ref:k,className:"ecp-video-el",poster:x||void 0,children:[l&&e.jsx("source",{src:l}),"Your browser does not support the video tag."]}),be&&e.jsx("div",{className:"ecp-video-eq-overlay",children:e.jsxs("div",{className:`ecp-video-eq-panel${T?" ecp-video-eq-panel--dark":" ecp-video-eq-panel--light"}`,children:[e.jsx("h3",{className:`ecp-video-eq-title${T?" ecp-video-eq-title--dark":" ecp-video-eq-title--light"}`,children:"Equalizer"}),e.jsx("div",{className:"ecp-video-eq-bands",children:["bass","mid","treble"].map(a=>e.jsxs("div",{children:[e.jsxs("div",{className:"ecp-video-eq-band-header",children:[e.jsx("span",{className:T?"ecp-video-eq-label--dark":"ecp-video-eq-label--light",children:a.charAt(0).toUpperCase()+a.slice(1)}),e.jsxs("span",{className:T?"ecp-video-eq-label--dark":"ecp-video-eq-label--light",children:[Z[a]," dB"]})]}),e.jsxs("div",{className:"ecp-video-eq-range-row",children:[e.jsx("span",{className:T?"ecp-video-eq-bound--dark":"ecp-video-eq-bound--light",children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:Z[a],onChange:h=>Fe(a,parseInt(h.target.value)),className:"ecp-video-eq-slider",style:{background:`linear-gradient(to right, ${F} ${(Z[a]+20)/40*100}%, #e5e7eb ${(Z[a]+20)/40*100}%)`,"--thumb-color":F}}),e.jsx("span",{className:T?"ecp-video-eq-bound--dark":"ecp-video-eq-bound--light",children:"+20"})]})]},a))}),e.jsxs("div",{className:"ecp-video-eq-footer",children:[e.jsx("button",{onClick:we,className:`ecp-video-eq-footer-btn${T?" ecp-video-eq-footer-btn--dark":" ecp-video-eq-footer-btn--light"}`,children:"Reset"}),e.jsx("button",{onClick:()=>U(!1),className:`ecp-video-eq-footer-btn${T?" ecp-video-eq-footer-btn--dark":" ecp-video-eq-footer-btn--light"}`,style:{marginLeft:"0.5rem"},children:"Close"})]})]})})]}),u&&ue==="right"&&e.jsx("div",{className:"ecp-video-vu-side",ref:I})]}),u&&ue==="bottom"&&e.jsx("div",{className:"ecp-video-vu-bottom",ref:I})]}),v.seekbar&&e.jsx("div",{className:`ecp-video-seekbar${H?" ecp-video-seekbar--fullscreen":""}`,children:e.jsxs("div",{className:"ecp-video-seekbar-row",children:[e.jsx("span",{className:`ecp-video-time${T?" ecp-video-time--dark":" ecp-video-time--light"}`,children:Q(_)}),e.jsx("input",{type:"range",min:"0",max:"100",value:B>0?_/B*100:0,onChange:We,onMouseDown:De,onMouseUp:_e,onTouchStart:De,onTouchEnd:_e,disabled:!l,className:"ecp-video-seek-input",style:{background:l&&B>0?`linear-gradient(to right, ${F} ${_/B*100}%, #e5e7eb ${_/B*100}%)`:"#e5e7eb","--thumb-color":F}}),e.jsx("span",{className:`ecp-video-time ecp-video-time--right${T?" ecp-video-time--dark":" ecp-video-time--light"}`,children:Q(B)})]})}),e.jsxs("div",{className:"ecp-video-controls",children:[v.play&&e.jsxs("button",{onClick:Ie,disabled:!l,className:`ecp-video-play-btn${re<=400?" ecp-video-play-btn--compact":""}`,style:{backgroundColor:F},children:[e.jsxs("div",{className:"ecp-video-play-icon-wrap",children:[e.jsx(Ze,{size:16,style:{position:"absolute",transform:W?void 0:"scale(0) translateY(2.5rem)",transition:"all 150ms"}}),e.jsx(Ke,{size:16,style:{position:"absolute",transform:W?"scale(0) translateY(-2.5rem)":void 0,transition:"all 150ms"}})]}),re>400&&(W?"Pause":"Play")]}),v.stop&&e.jsx("button",{onClick:Oe,disabled:!l,className:`ecp-video-stop-btn${T?" ecp-video-stop-btn--dark":" ecp-video-stop-btn--light"}`,children:e.jsx(or,{size:16})}),v.fullscreen&&e.jsxs("button",{onClick:Ve,className:`ecp-video-fullscreen-btn${T?" ecp-video-fullscreen-btn--dark":" ecp-video-fullscreen-btn--light"}${re>=800?" ecp-video-fullscreen-btn--wide":""}`,children:[H?e.jsx(Or,{size:16}):e.jsx(Hr,{size:16}),e.jsx("span",{style:{display:re<800?"none":"block"},children:H?"Exit":"Full"})]}),v.equalizer&&e.jsxs("button",{onClick:()=>U(!be),disabled:!l,className:`ecp-video-eq-toggle-btn${be?" ecp-video-eq-toggle-btn--on":" ecp-video-eq-toggle-btn--off"}${re>=700?" ecp-video-eq-toggle-btn--wide":""}`,style:be?{backgroundColor:F}:{},children:[e.jsx(Qe,{size:16}),e.jsx("span",{style:{display:re<700?"none":"block"},children:"EQ"})]}),v.speed&&e.jsx("div",{className:"ecp-video-speed-wrap",children:e.jsx("select",{value:X,onChange:Ge,className:`ecp-video-speed-select${T?" ecp-video-speed-select--dark":" ecp-video-speed-select--light"}`,children:["0.5","0.75","1","1.25","1.5","2"].map(a=>e.jsxs("option",{value:a,className:T?"ecp-video-speed-option--dark":"ecp-video-speed-option--light",children:[a,"x"]},a))})}),v.volume&&e.jsxs("div",{className:"ecp-video-volume",children:[e.jsx("button",{onClick:nr,className:"ecp-video-mute-btn",children:S||j===0?e.jsx(ar,{size:20,className:T?"ecp-video-mute-icon--dark":"ecp-video-mute-icon--light"}):e.jsx(tr,{size:20,className:T?"ecp-video-mute-icon--dark":"ecp-video-mute-icon--light"})}),e.jsx("input",{type:"range",min:"0",max:"100",value:j,onChange:Ue,className:"ecp-video-vol-slider",style:{background:`linear-gradient(to right, ${F} ${j}%, #e5e7eb ${j}%)`,"--thumb-color":F,display:re<460?"none":"block"}}),e.jsxs("span",{className:`ecp-video-vol-pct${T?" ecp-video-vol-pct--dark":" ecp-video-vol-pct--light"}`,style:{display:re<800?"none":"block"},children:[j,"%"]})]})]})]})})}function Vr(){const[l,p]=r.useState(null),[u,b]=r.useState("No track loaded"),[x,v]=r.useState("purple"),[y,J]=r.useState(!1),[E,F]=r.useState(!1),[G,W]=r.useState("light"),n=r.useRef(null),_=B=>{var j;const V=(j=B.target.files)==null?void 0:j[0];if(V){const A=URL.createObjectURL(V);p(A),b(V.name)}},z=()=>{var B;return(B=n.current)==null?void 0:B.click()};return e.jsx("div",{className:"ecp-page-wrapper",style:{backgroundColor:G==="dark"?"#222":"white"},children:e.jsxs("div",{className:"ecp-demo-container",children:[y&&e.jsx(pr,{theme:x,setTheme:v,close:()=>J(!1)}),e.jsxs("div",{className:"ecp-container-glass",children:[e.jsxs("div",{className:"ecp-demo-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:`ecp-demo-title${G==="dark"?" ecp-demo-title--dark":""}`,children:"Audio Visualizer"}),e.jsx("p",{className:"ecp-demo-subtitle",children:"Professional frequency analyzer"})]}),e.jsxs("button",{onClick:()=>J(!y),className:"ecp-theme-btn",children:[e.jsx("span",{children:"🎨"})," Themes"]})]}),e.jsx(vr,{audio:l||void 0,name:u||void 0,author:"K.Prabhasha",theme:x,autoPlay:!1,thumbnail:"https://cdn-icons-png.flaticon.com/512/3845/3845874.png",mode:G,transparent:E,volume:70,controls:{play:!0,pause:!0,stop:!0,seekbar:!0,volume:!0,loop:!0,trackName:!0}}),e.jsx(fr,{audio:l||"",width:400,thumbnail:"https://cdn-icons-png.flaticon.com/512/8316/8316619.png",autoPlay:!1,gradient:["#26ce3aff","#39eed9ff"],background:"#c0ffefff"}),e.jsx(hr,{audio:l||"",thumbnail:"https://cdn-icons-png.flaticon.com/512/17524/17524837.png",autoPlay:!1,gradient:["#26ce3aff","#39eed9ff"],background:"#c0ffefff"}),e.jsxs("div",{className:"ecp-demo-actions",children:[e.jsx("input",{type:"file",ref:n,onChange:_,accept:"audio/*",className:"ecp-file-input-hidden"}),e.jsxs("button",{onClick:z,className:"ecp-action-btn",children:[e.jsx(Ur,{size:16}),"Load Audio"]}),e.jsx("button",{onClick:()=>W(G==="dark"?"light":"dark"),className:"ecp-action-btn",children:G==="dark"?"Light":"Dark"}),e.jsxs("button",{onClick:()=>F(!E),className:"ecp-action-btn",children:["Transparent: ",String(E)]})]})]})]})})}ie.DemoVisualizePlayer=Vr,ie.NanoAudioPlayer=hr,ie.ThemeSelector=pr,ie.VideoPlayer=Gr,ie.VisualizePlayer=vr,ie.WaveAudioPlayer=fr,ie.themes=ke,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})});
118
+ `},De=()=>{!k.current||!l||(W?k.current.pause():(te.current&&te.current.state==="suspended"&&te.current.resume(),k.current.play().catch(a=>console.error("Play failed:",a))))},Oe=()=>{k.current&&(k.current.pause(),k.current.currentTime=0,n(!1),z(0),ae.current=0,s.current=0,q.current=0,P.current=0,de())},We=a=>{const N=parseFloat(a.target.value)/100*B;z(N),k.current&&!he&&(k.current.currentTime=N)},Ie=()=>xe(!0),_e=()=>{k.current&&(k.current.currentTime=_),xe(!1)},Ue=a=>{const h=parseInt(a.target.value);A(h),Pe(h===0)},Ge=a=>Ee(parseFloat(a.target.value)),nr=()=>Pe(!T),Ve=()=>{Ce.current&&(document.fullscreenElement?document.exitFullscreen():Ce.current.requestFullscreen().catch(a=>console.error("Fullscreen failed:",a)))},Fe=(a,h)=>{Me(N=>({...N,[a]:h})),te.current&&(a==="bass"&&le.current&&(le.current.gain.value=h),a==="mid"&&oe.current&&(oe.current.gain.value=h),a==="treble"&&me.current&&(me.current.gain.value=h))},we=()=>Me({bass:0,mid:0,treble:0}),Q=a=>{if(isNaN(a))return"0:00";const h=Math.floor(a/60),N=Math.floor(a%60);return`${h}:${N.toString().padStart(2,"0")}`};if(r.useEffect(()=>{(pe&&!W||E)&&De()},[v]),ve&&ve.length>0)return e.jsx(e.Fragment,{children:ve.map((a,h)=>e.jsxs("div",{className:"ecp-video-error",children:[e.jsxs("strong",{children:[a[0],":"]})," ",a[1]]},h))});const ue=u?u.side:null,ze=ue==="top"||ue==="bottom",Xe=pe||J?void 0:S?"#49494937":"white",Je=pe||J?void 0:S?"#1a1a1ab0":"#f5f5f5";return e.jsx("div",{ref:Ce,className:`ecp-video-wrapper${H?" ecp-video-wrapper--fullscreen":""}`,style:{backgroundColor:Xe},children:e.jsxs("div",{className:`ecp-video-inner${H?" ecp-video-inner--fullscreen":""}${J?"":" ecp-video-inner--padded"}`,style:{background:Je},children:[v.videoName&&!H&&e.jsx("div",{className:`ecp-video-name${S?" ecp-video-name--dark":" ecp-video-name--light"}`,children:p}),e.jsxs("div",{className:`ecp-video-layout${ze?" ecp-video-layout--col":" ecp-video-layout--row"}${H?" ecp-video-layout--fullscreen":""}`,children:[u&&ue==="top"&&e.jsx("div",{className:"ecp-video-vu-top",ref:D}),e.jsxs("div",{style:{display:"flex",flex:ze?void 0:1,gap:"0.75rem"},children:[u&&ue==="left"&&e.jsx("div",{className:"ecp-video-vu-side",ref:D}),e.jsxs("div",{className:`ecp-video-el-wrap${S?" ecp-video-el-wrap--dark":" ecp-video-el-wrap--light"}`,children:[e.jsxs("video",{ref:k,className:"ecp-video-el",poster:x||void 0,children:[l&&e.jsx("source",{src:l}),"Your browser does not support the video tag."]}),be&&e.jsx("div",{className:"ecp-video-eq-overlay",children:e.jsxs("div",{className:`ecp-video-eq-panel${S?" ecp-video-eq-panel--dark":" ecp-video-eq-panel--light"}`,children:[e.jsx("h3",{className:`ecp-video-eq-title${S?" ecp-video-eq-title--dark":" ecp-video-eq-title--light"}`,children:"Equalizer"}),e.jsx("div",{className:"ecp-video-eq-bands",children:["bass","mid","treble"].map(a=>e.jsxs("div",{children:[e.jsxs("div",{className:"ecp-video-eq-band-header",children:[e.jsx("span",{className:S?"ecp-video-eq-label--dark":"ecp-video-eq-label--light",children:a.charAt(0).toUpperCase()+a.slice(1)}),e.jsxs("span",{className:S?"ecp-video-eq-label--dark":"ecp-video-eq-label--light",children:[Z[a]," dB"]})]}),e.jsxs("div",{className:"ecp-video-eq-range-row",children:[e.jsx("span",{className:S?"ecp-video-eq-bound--dark":"ecp-video-eq-bound--light",children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:Z[a],onChange:h=>Fe(a,parseInt(h.target.value)),className:"ecp-video-eq-slider",style:{background:`linear-gradient(to right, ${F} ${(Z[a]+20)/40*100}%, #e5e7eb ${(Z[a]+20)/40*100}%)`,"--thumb-color":F}}),e.jsx("span",{className:S?"ecp-video-eq-bound--dark":"ecp-video-eq-bound--light",children:"+20"})]})]},a))}),e.jsxs("div",{className:"ecp-video-eq-footer",children:[e.jsx("button",{onClick:we,className:`ecp-video-eq-footer-btn${S?" ecp-video-eq-footer-btn--dark":" ecp-video-eq-footer-btn--light"}`,children:"Reset"}),e.jsx("button",{onClick:()=>U(!1),className:`ecp-video-eq-footer-btn${S?" ecp-video-eq-footer-btn--dark":" ecp-video-eq-footer-btn--light"}`,style:{marginLeft:"0.5rem"},children:"Close"})]})]})})]}),u&&ue==="right"&&e.jsx("div",{className:"ecp-video-vu-side",ref:D})]}),u&&ue==="bottom"&&e.jsx("div",{className:"ecp-video-vu-bottom",ref:D})]}),v.seekbar&&e.jsx("div",{className:`ecp-video-seekbar${H?" ecp-video-seekbar--fullscreen":""}`,children:e.jsxs("div",{className:"ecp-video-seekbar-row",children:[e.jsx("span",{className:`ecp-video-time${S?" ecp-video-time--dark":" ecp-video-time--light"}`,children:Q(_)}),e.jsx("input",{type:"range",min:"0",max:"100",value:B>0?_/B*100:0,onChange:We,onMouseDown:Ie,onMouseUp:_e,onTouchStart:Ie,onTouchEnd:_e,disabled:!l,className:"ecp-video-seek-input",style:{background:l&&B>0?`linear-gradient(to right, ${F} ${_/B*100}%, #e5e7eb ${_/B*100}%)`:"#e5e7eb","--thumb-color":F}}),e.jsx("span",{className:`ecp-video-time ecp-video-time--right${S?" ecp-video-time--dark":" ecp-video-time--light"}`,children:Q(B)})]})}),e.jsxs("div",{className:"ecp-video-controls",children:[v.play&&e.jsxs("button",{onClick:De,disabled:!l,className:`ecp-video-play-btn${re<=400?" ecp-video-play-btn--compact":""}`,style:{backgroundColor:F},children:[e.jsxs("div",{className:"ecp-video-play-icon-wrap",children:[e.jsx(Ze,{size:16,style:{position:"absolute",transform:W?void 0:"scale(0) translateY(2.5rem)",transition:"all 150ms"}}),e.jsx(Ke,{size:16,style:{position:"absolute",transform:W?"scale(0) translateY(-2.5rem)":void 0,transition:"all 150ms"}})]}),re>400&&(W?"Pause":"Play")]}),v.stop&&e.jsx("button",{onClick:Oe,disabled:!l,className:`ecp-video-stop-btn${S?" ecp-video-stop-btn--dark":" ecp-video-stop-btn--light"}`,children:e.jsx(or,{size:16})}),v.fullscreen&&e.jsxs("button",{onClick:Ve,className:`ecp-video-fullscreen-btn${S?" ecp-video-fullscreen-btn--dark":" ecp-video-fullscreen-btn--light"}${re>=800?" ecp-video-fullscreen-btn--wide":""}`,children:[H?e.jsx(Or,{size:16}):e.jsx(Hr,{size:16}),e.jsx("span",{style:{display:re<800?"none":"block"},children:H?"Exit":"Full"})]}),v.equalizer&&e.jsxs("button",{onClick:()=>U(!be),disabled:!l,className:`ecp-video-eq-toggle-btn${be?" ecp-video-eq-toggle-btn--on":" ecp-video-eq-toggle-btn--off"}${re>=700?" ecp-video-eq-toggle-btn--wide":""}`,style:be?{backgroundColor:F}:{},children:[e.jsx(Qe,{size:16}),e.jsx("span",{style:{display:re<700?"none":"block"},children:"EQ"})]}),v.speed&&e.jsx("div",{className:"ecp-video-speed-wrap",children:e.jsx("select",{value:X,onChange:Ge,className:`ecp-video-speed-select${S?" ecp-video-speed-select--dark":" ecp-video-speed-select--light"}`,children:["0.5","0.75","1","1.25","1.5","2"].map(a=>e.jsxs("option",{value:a,className:S?"ecp-video-speed-option--dark":"ecp-video-speed-option--light",children:[a,"x"]},a))})}),v.volume&&e.jsxs("div",{className:"ecp-video-volume",children:[e.jsx("button",{onClick:nr,className:"ecp-video-mute-btn",children:T||j===0?e.jsx(ar,{size:20,className:S?"ecp-video-mute-icon--dark":"ecp-video-mute-icon--light"}):e.jsx(tr,{size:20,className:S?"ecp-video-mute-icon--dark":"ecp-video-mute-icon--light"})}),e.jsx("input",{type:"range",min:"0",max:"100",value:j,onChange:Ue,className:"ecp-video-vol-slider",style:{background:`linear-gradient(to right, ${F} ${j}%, #e5e7eb ${j}%)`,"--thumb-color":F,display:re<460?"none":"block"}}),e.jsxs("span",{className:`ecp-video-vol-pct${S?" ecp-video-vol-pct--dark":" ecp-video-vol-pct--light"}`,style:{display:re<800?"none":"block"},children:[j,"%"]})]})]})]})})}function Vr(){const[l,p]=r.useState(null),[u,b]=r.useState("No track loaded"),[x,v]=r.useState("purple"),[y,J]=r.useState(!1),[E,F]=r.useState(!1),[G,W]=r.useState("light"),n=r.useRef(null),_=B=>{var j;const V=(j=B.target.files)==null?void 0:j[0];if(V){const A=URL.createObjectURL(V);p(A),b(V.name)}},z=()=>{var B;return(B=n.current)==null?void 0:B.click()};return e.jsx("div",{className:"ecp-page-wrapper",style:{backgroundColor:G==="dark"?"#222":"white"},children:e.jsxs("div",{className:"ecp-demo-container",children:[y&&e.jsx(pr,{theme:x,setTheme:v,close:()=>J(!1)}),e.jsxs("div",{className:"ecp-container-glass",children:[e.jsxs("div",{className:"ecp-demo-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:`ecp-demo-title${G==="dark"?" ecp-demo-title--dark":""}`,children:"Audio Visualizer"}),e.jsx("p",{className:"ecp-demo-subtitle",children:"Professional frequency analyzer"})]}),e.jsxs("button",{onClick:()=>J(!y),className:"ecp-theme-btn",children:[e.jsx("span",{children:"🎨"})," Themes"]})]}),e.jsx(vr,{audio:l||void 0,name:u||void 0,author:"K.Prabhasha",theme:x,autoPlay:!1,thumbnail:"https://cdn-icons-png.flaticon.com/512/3845/3845874.png",mode:G,transparent:E,volume:70,controls:{play:!0,pause:!0,stop:!0,seekbar:!0,volume:!0,loop:!0,trackName:!0}}),e.jsx(fr,{audio:l||"",width:400,thumbnail:"https://cdn-icons-png.flaticon.com/512/8316/8316619.png",autoPlay:!1,gradient:["#26ce3aff","#39eed9ff"],background:"#c0ffefff"}),e.jsx(hr,{audio:l||"",thumbnail:"https://cdn-icons-png.flaticon.com/512/17524/17524837.png",autoPlay:!1,gradient:["#26ce3aff","#39eed9ff"],background:"#c0ffefff"}),e.jsxs("div",{className:"ecp-demo-actions",children:[e.jsx("input",{type:"file",ref:n,onChange:_,accept:"audio/*",className:"ecp-file-input-hidden"}),e.jsxs("button",{onClick:z,className:"ecp-action-btn",children:[e.jsx(Ur,{size:16}),"Load Audio"]}),e.jsx("button",{onClick:()=>W(G==="dark"?"light":"dark"),className:"ecp-action-btn",children:G==="dark"?"Light":"Dark"}),e.jsxs("button",{onClick:()=>F(!E),className:"ecp-action-btn",children:["Transparent: ",String(E)]})]})]})]})})}ie.DemoVisualizePlayer=Vr,ie.NanoAudioPlayer=hr,ie.ThemeSelector=pr,ie.VideoPlayer=Gr,ie.VisualizePlayer=vr,ie.WaveAudioPlayer=fr,ie.themes=ke,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecplayer",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "Professional audio and video players with advanced visualization, customizable themes, and seamless responsive design",
5
5
  "license": "MIT",
6
6
  "author": "K.Prabhasha",