@somosme/webflowutil 3.3.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkout.js +1 -1
- package/package.json +3 -3
package/dist/checkout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var n={planTier:"",sensors:"",sensorQuantity:2},S=250,d=1980,i=
|
|
1
|
+
"use strict";(()=>{var n={planTier:"",sensors:"",sensorQuantity:2},S=250,d=1980,i=1490,T=document.querySelector("#plan-selector"),L=T.querySelectorAll("a");L.forEach(t=>{t.addEventListener("click",function(){g(this.id),u()})});var f=document.querySelectorAll(".minus-counter");f.forEach(t=>{t.addEventListener("click",M)});var H=document.querySelectorAll(".plus-counter");H.forEach(t=>{t.addEventListener("click",M)});E();function g(t){n.planTier=t;let e=document.querySelector("#sensor-summary-free");n.planTier==="yearly-plan"?e.style.display="block":e.style.display="none"}var q=document.querySelectorAll(".sensor-checkout-btn");q.forEach(t=>{t.addEventListener("click",function(){b(this.id),u()})});function b(t){n.sensors=t}function u(){a(n.sensorQuantity);let t=document.querySelector("#next-month-payments"),e=document.querySelector("#sensor-summary-item"),o=document.querySelector("#sensor-summary-free"),s=document.querySelector("#plan-summary-text"),r=document.querySelector("#plan-summary-price"),l=document.querySelector("#checkout-btn");n.planTier==="yearly-plan"?(t.style.display="none",s.innerHTML="Membres\xEDa anual",r.innerHTML=`$${d.toLocaleString("en-US")}`):(t.style.display="flex",s.innerHTML="Membres\xEDa mensual",r.innerHTML=`$${S.toLocaleString("en-US")}`),n.sensors==="no-sensors"?(e.style.display="none",o.style.display="none"):(e.style.display="grid",n.planTier==="yearly-plan"?o.style.display="block":o.style.display="none");let c="https://somos-smart-wellness.chargebee.com/hosted_pages/checkout?subscription_items[item_price_id][0]=",y="somos-app-MXN-Monthly",m="somos-app-MXN-Yearly",h="&subscription[coupon]=sensorincluido",p=`&subscription_items[item_price_id][1]=freestyle-cgm-MXN&subscription_items[quantity][1]=${n.sensorQuantity}`;n.planTier==="yearly-plan"&&n.sensors==="yes-sensors"?(a(n.sensorQuantity),c+=m+p+h):n.planTier==="yearly-plan"&&n.sensors==="no-sensors"?(l.innerHTML=`Pagar $${d}`,c+=m):n.planTier==="monthly-plan"&&n.sensors==="yes-sensors"?(a(n.sensorQuantity),c+=y+p):n.planTier==="monthly-plan"&&n.sensors==="no-sensors"&&(l.innerHTML=`Pagar $${S}`,c+=y),l.setAttribute("href",c)}function E(){let o=new Date().getMonth()+1,r=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"][o],l=document.querySelector("#next-month-name");l.innerHTML=r}function M(t){let e=n.sensorQuantity;t.target instanceof HTMLElement&&(t.target.className==="plus-counter"?(e+=1,a(e)):e>1&&(e-=1,a(e))),n.sensorQuantity=e,u(),document.querySelector("#sensor-counter-monthly").innerHTML=e.toString(),document.querySelector("#sensor-counter-yearly").innerHTML=e.toString(),document.querySelector("#title-sensor-counter-monthly").innerHTML=e.toString(),document.querySelector("#title-sensor-counter-yearly").innerHTML=e.toString()}function a(t){let e=t*i;if(n.planTier==="yearly-plan"&&(e-=i),document.querySelector("#total-sensor-price-monthly").innerHTML=e.toLocaleString("en-US"),document.querySelector("#total-sensor-price-yearly").innerHTML=e.toLocaleString("en-US"),document.querySelector("#summary-sensor-quantity").innerHTML=t.toString()+" ",n.planTier==="yearly-plan"){let r=e+i;document.querySelector("#summary-sensor-total").innerHTML="$"+r.toLocaleString("en-US")}else document.querySelector("#summary-sensor-total").innerHTML="$"+e.toLocaleString("en-US");let o=parseInt(document.querySelector("#plan-summary-price").innerHTML.replace(/[$,]/g,"")),s="$"+(e+o).toLocaleString("en-US");return document.querySelector("#checkout-btn").innerHTML="Pagar "+s,e}})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@somosme/webflowutil",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "SOMOS.ME Developer",
|
|
5
5
|
"homepage": "https://github.com/Somos-Smart-Wellness/webflow_somos#readme",
|
|
6
6
|
"license": "ISC",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/Somos-Smart-Wellness/webflow_somos
|
|
17
|
+
"url": "git+https://github.com/Somos-Smart-Wellness/webflow_somos"
|
|
18
18
|
},
|
|
19
19
|
"bugs": {
|
|
20
20
|
"url": "https://github.com/Somos-Smart-Wellness/webflow_somos/issues"
|
|
@@ -57,4 +57,4 @@
|
|
|
57
57
|
"@finsweet/ts-utils": "^0.33.1",
|
|
58
58
|
"airtable": "^0.11.5"
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|