System.register(["../../../../common/index-legacy.sLMPZLm9.js","../../../../common/index-legacy.DWOuG56R.js","../../../../common/_plugin-vue_export-helper-legacy.DgAO6S8O.js","../../../../common/index-legacy.DjPCm-Xr.js","../../../../common/index-legacy.5srSrAru.js","../../../../common/_getTag-legacy.CG1mexpa.js","../../../../common/useState-legacy.VsKoz4di.js","../../../../common/devWarning-legacy.QuSHKYiX.js","../../../../common/compact-item-legacy.3e1PWnds.js","../../../../common/Compact-legacy.f4toi_Qn.js"],(function(a,e){"use strict";var o,i,l,n,r,s,t,u,d,c,v,g,p,m,f,x;return{setters:[a=>{o=a.d,i=a.i,l=a.s,n=a.m,r=a.v,s=a.n,t=a.A,u=a.q,d=a.M,c=a.z,v=a.u,g=a.x,p=a.y,m=a.N},a=>{f=a.B},a=>{x=a._},null,null,null,null,null,null,null],execute:function(){var e=document.createElement("style");e.textContent=".saai-usage-indicator[data-v-0222c73f]{display:flex;align-items:center;gap:8px;max-width:420px;flex-shrink:1;min-width:0}@media (prefers-reduced-motion: no-preference){.saai-usage-indicator.is-pulsing .saai-usage-bar[data-v-0222c73f]{animation:usage-pulse-0222c73f 1.5s ease-in-out infinite}}.saai-usage-bar-wrap[data-v-0222c73f]{width:120px;min-width:80px;height:8px;background-color:#f0f0f0;border-radius:4px;overflow:hidden;flex-shrink:0}.saai-usage-bar[data-v-0222c73f]{height:100%;border-radius:4px;transition:width .3s ease,background-color .3s ease}.saai-usage-label[data-v-0222c73f]{font-size:13px;color:#374151;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.saai-usage-upgrade-link[data-v-0222c73f]{font-size:13px;white-space:nowrap;text-decoration:none;font-weight:500;flex-shrink:0}.saai-usage-upgrade-link[data-v-0222c73f]:hover{text-decoration:underline}.saai-usage-upgrade-btn[data-v-0222c73f]{flex-shrink:0;font-size:12px;height:28px;border-radius:6px}@keyframes usage-pulse-0222c73f{0%,to{opacity:1}50%{opacity:.5}}@media (max-width: 600px){.saai-usage-label[data-v-0222c73f],.saai-usage-upgrade-link[data-v-0222c73f],.saai-usage-upgrade-btn[data-v-0222c73f]{display:none}.saai-usage-indicator[data-v-0222c73f]{max-width:80px}.saai-usage-bar-wrap[data-v-0222c73f]{width:60px;min-width:60px;height:6px}}\n/*$vite$:1*/",document.head.appendChild(e);const h={class:"saai-usage-bar-wrap"},w=["aria-valuenow","aria-label"],y={class:"saai-usage-label"},b=["href"];a("default",x(o({__name:"UsageIndicator",setup(a){const{__:e,sprintf:o}=window.wp.i18n,x=i((()=>l().usageData)),k=i((()=>l().usageBarUpgradeUrl)),_=i((()=>l().isConnected)),j=i((()=>{var a,e;return null!==(a=null===(e=x.value)||void 0===e?void 0:e.percentage)&&void 0!==a?a:0})),$=i((()=>{var a,e;return null!==(a=null===(e=x.value)||void 0===e?void 0:e.used)&&void 0!==a?a:0})),z=i((()=>{var a,e;return null!==(a=null===(e=x.value)||void 0===e?void 0:e.limit)&&void 0!==a?a:0})),C=i((()=>{var a,e;return null!==(a=null===(e=x.value)||void 0===e?void 0:e.resource)&&void 0!==a?a:""})),U=i((()=>{var a,e;return null!==(a=null===(e=x.value)||void 0===e?void 0:e.nextPlanName)&&void 0!==a?a:""})),P=i((()=>_.value&&C.value&&z.value>0)),S=i((()=>{const a=j.value;return a>=90?"#ff4d4f":a>=75?"#fa8c16":a>=50?"#faad14":"#52c41a"})),q=i((()=>{const a=j.value,i=o(e("%1$s/%2$s %3$s used","storeagent-ai-for-woocommerce"),$.value,z.value,C.value);return a>=100?U.value?e("Plan paused — upgrade to continue","storeagent-ai-for-woocommerce"):e("Plan paused — contact support to continue","storeagent-ai-for-woocommerce"):a>=90?o(e("%s — almost out!","storeagent-ai-for-woocommerce"),i):a>=75?o(e("%s — running low","storeagent-ai-for-woocommerce"),i):i})),B=i((()=>j.value>=50&&U.value)),I=i((()=>j.value>=75?`${e("Upgrade now","storeagent-ai-for-woocommerce")} →`:`${e("Upgrade for more","storeagent-ai-for-woocommerce")} →`)),M=i((()=>j.value>=90)),N=i((()=>j.value>=100));return(a,e)=>P.value?(s(),n("div",{key:0,class:m(["saai-usage-indicator",{"is-pulsing":N.value}])},[t("div",h,[t("div",{class:"saai-usage-bar",role:"progressbar","aria-valuenow":j.value,"aria-valuemin":"0","aria-valuemax":"100","aria-label":q.value,style:d({width:`${Math.min(j.value,100)}%`,backgroundColor:S.value})},null,12,w)]),t("span",y,c(q.value),1),B.value&&!M.value?(s(),n("a",{key:0,href:k.value,target:"_blank",class:"saai-usage-upgrade-link",style:d({color:S.value})},c(I.value),13,b)):r("",!0),B.value&&M.value?(s(),u(v(f),{key:1,type:"primary",size:"small",danger:"",href:k.value,target:"_blank",class:"saai-usage-upgrade-btn"},{default:g((()=>[p(c(I.value),1)])),_:1},8,["href"])):r("",!0)],2)):r("",!0)}}),[["__scopeId","data-v-0222c73f"]]))}}}));
