PageSourceSearch

https://www.chatbot.com/dist/js/437.ec97192aac07ba3b66b8.js

js chatbot.com collected 2026-09-24 15:17:52 UTC 10,897 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_text_chatbot=self.webpackChunk_text_chatbot||[]).push([[437],{3437(t,e,i){i.r(e),i.d(e,{default:()=>o});var n=i(7578);function r(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:t%1==0?0:2}).format(t)}function a(t,e,i){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const s=new Set([-1,"-1",1/0,"Infinity","infinity"]),l="users";class o extends n.xI{connect(){const t=this.configValue,e=t.sliders||[],i=t.plans||[];this.sliders=e,this.plans=i,this.planDescriptions=t.planDescriptions||{},this.enterpriseThreshold=Number(t.enterpriseThreshold)||0,this.billing="monthly"===new URLSearchParams(window.location.search).get("billing")?"monthly":"yearly",this.sliderElements=new Map;for(const t of this.sliderTargets){const e=t.dataset.sliderId;e&&this.sliderElements.set(e,{slider:t,badge:this.valueBadgeTargets.find(t=>t.dataset.sliderId===e),track:this.sliderTrackTargets.find(t=>t.dataset.sliderId===e)})}this.sliderState={},this.sliderStops=new Map;for(const t of e){const e="number"==typeof t.startValue?t.startValue:Number(t.startValue),i=Number.isFinite(e)?e:t.min,n=Math.min(t.max,Math.max(t.min,i)),r=this.buildSliderStops(t);r&&this.sliderStops.set(t.id,r);const a=r?this.closestStopIndex(r,n):n,s=r?r[a]:n;this.sliderState[t.id]=s;const l=this.sliderElements.get(t.id);if(null!=l&&l.slider&&(r&&(l.slider.min="0",l.slider.max=String(r.length-1),l.slider.step="1"),l.slider.value=String(a),this.syncSliderAria(l.slider,s)),null!=l&&l.badge&&(l.badge.textContent=this.formatSliderBadgeValue(s)),null!=l&&l.track){const e=this.sliderProgress(t,a,s);l.track.style.setProperty("--slider-progress",`${e}%`)}}this.currentPlanId=null,this.pendingTimer=null,this.updatePlanThrottleId=null,this.updatePlanScheduled=!1,this.calculatorUsed=!1,this.pickedPlanId=i.some(e=>e.id===t.defaultPlan)?t.defaultPlan:null,this.renderCalcSummary();const n=this.recommendPlan();this.renderPlan(n),this.currentPlanId=n.id}disconnect(){null!==this.pendingTimer&&(clearTimeout(this.pendingTimer),this.pendingTimer=null),null!==this.updatePlanThrottleId&&(clearTimeout(this.updatePlanThrottleId),this.updatePlanThrottleId=null)}handleSlider(t){const e=t.target.dataset.sliderId,i=Number(t.target.value),n=this.sliders.find(t=>t.id===e);if(!n)return;const r=this.sliderStops.get(e),a=r?r[i]:i;this.sliderState[e]=a;const s=this.sliderElements.get(e);if(null!=s&&s.badge&&(s.badge.textContent=this.formatSliderBadgeValue(a)),null!=s&&s.track){const t=this.sliderProgress(n,i,a);s.track.style.setProperty("--slider-progress",`${t}%`)}this.syncSliderAria(t.target,a),this.markCalculatorUsed(e),this.schedulePlanUpdate()}buildSliderStops(t){const e=Array.isArray(t.tiers)?t.tiers:[];if(0===e.length)return null;const i=Number(t.max);let n=Number(t.min);const r=[n];for(const t of e){const e=Number(t.step),a=Math.min(Number(t.upTo),i);if(e>0&&!(a<=n)){for(;n+e<=a;)n+=e,r.push(n);n<a&&(n=a,r.push(n))}}return n<i&&r.push(i),r}closestStopIndex(t,e){let i=0;for(let n=1;n<t.length;n+=1)Math.abs(t[n]-e)<Math.abs(t[i]-e)&&(i=n);return i}sliderProgress(t,e,i){const n=this.sliderStops.get(t.id);return n?e/(n.length-1)*100:t.max>0?i/t.max*100:0}syncSliderAria(t,e){t.setAttribute("aria-valuenow",String(e)),t.setAttribute("aria-valuetext",Number(e).toLocaleString("en-US"))}markCalculatorUsed(t){if(!this.calculatorUsed){this.calculatorUsed=!0;for(const t of document.querySelectorAll('a[href*="/signup"]')){const e=new URL(t.href);e.searchParams.set("calc_used","1"),t.href=e.toString()}}}handlePlanPick(t){const e=t.currentTarget.dataset.planId;this.plans.some(t=>t.id===e)&&(this.pickedPlanId=e,this.markCalculatorUsed("plan"),this.schedulePlanUpdate())}handleBillingChange(t){var e;
1const i=null===(e=t.detail)||void 0===e?void 0:e.billing;i&&i!==this.billing&&(this.billing=i,this.renderCalcSummary(),this.updatePlan())}schedulePlanUpdate(){this.updatePlanScheduled||(this.updatePlanScheduled=!0,this.updatePlanThrottleId=setTimeout(()=>{this.updatePlanScheduled=!1,this.updatePlanThrottleId=null,this.updatePlan()},100))}recommendPlan(){const t=this.resolveSelectedPlan();if(this.enterpriseThreshold>0){const e=this.plans.find(t=>"enterprise"===t.id),i=this.computePlanTotal(t);if(e&&"number"==typeof i&&i>this.enterpriseThreshold)return e}return t}resolveSelectedPlan(){if(this.pickedPlanId){const t=this.plans.find(t=>t.id===this.pickedPlanId);if(t)return t}return this.plans.find((t,e)=>this.doesPlanMatch(t,this.plans[e+1]??null))??this.plans[this.plans.length-1]}computePlanTotal(t){const e=this.sliderState[l]||1,i="yearly"===this.billing?t.price:t.monthlyPrice??t.price;if("custom"===String(i))return null;const n=Math.round(Number(i)*e*100)/100;return this.computeTotalDisplayPrice(n,this.computeExtraCosts(t))}doesPlanMatch(t,e){return!e||this.sliders.filter(t=>t.id!==l).every(e=>{var i;const n=this.sliderState[e.id],r=this.parseLimitValue(t.limits[e.id]);return!!Boolean(null===(i=t.limitPlusFlags)||void 0===i?void 0:i[e.id])||-1===r||n<=r})}updatePlan(){const t=this.recommendPlan();if(t.id===this.currentPlanId)return this.syncPlanToggle(this.resolveSelectedPlan()),void this.renderBreakdownContent(t);this.animatePlanChange(t)}animatePlanChange(t){null!==this.pendingTimer&&(clearTimeout(this.pendingTimer),this.pendingTimer=null);const e=this.planCardTarget;e.classList.add("pricing-calculator__plan-card--exit"),this.pendingTimer=setTimeout(()=>{this.pendingTimer=null,this.renderPlan(t),this.currentPlanId=t.id,e.classList.remove("pricing-calculator__plan-card--exit"),e.classList.add("pricing-calculator__plan-card--enter"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.classList.remove("pricing-calculator__plan-card--enter")})})},150)}renderPlan(t){const e="enterprise"===t.id;this.hasTrialCtaTarget&&this.trialCtaTarget.classList.toggle("u-hidden",e),this.hasContactSalesCtaTarget&&this.contactSalesCtaTarget.classList.toggle("u-hidden",!e),this.syncPlanToggle(this.resolveSelectedPlan()),this.renderBreakdownContent(t)}syncPlanToggle(t){for(const e of this.planToggleButtonTargets){const i=e.dataset.planId===t.id;e.classList.toggle("pricing-calculator__plan-toggle-button--active",i),e.setAttribute("aria-pressed",String(i))}}renderCalcSummary(){if(!this.hasCalcSummaryTarget)return;const t=this.summaryValue;let e;e=null!=t&&t.trim()?t.replace(/\{\{method\}\}/g,this.billing):`<p>Move the sliders to reflect your expected volume. Your cost updates instantly - per user, per month, billed ${this.billing}.</p>`,this.calcSummaryTarget.innerHTML=e}renderBreakdownContent(t){this.hasBreakdownContentTarget&&this.breakdownContentTarget.replaceChildren(...this.buildBreakdownItems(t))}buildBreakdownItems(t){const e=this.sliderState[l]||1,i="yearly"===this.billing?t.price:t.monthlyPrice??t.price,n="custom"===String(i),a=n?"custom":Math.round(Number(i)*e*100)/100,s=this.computeExtraCosts(t),o=this.computeTotalDisplayPrice(a,s),c=s.length>0,d=this.getPlanBreakdownTooltip(t,i,e),u=document.createElement("div");u.className="pricing-calculator__pricing-breakdown";const h=document.createElement("h3");h.className="pricing-calculator__section-heading",h.textContent="Pricing breakdown",u.append(h);const p=document.createElement("div");p.className="pricing-calculator__breakdown-content";const m=n?"Custom":r(a);if(p.append(this.createBreakdownRow(t.name,d,m,!0)),p.append(this.createBreakdownDivider("pricing-calculator__breakdown-divider")),c){const t=document.createElement("div");t.className="pricing-calculator__breakdown-extras";for(const e of s){const i="custom"===e.cost?"Custom":r(e.cost),n=e.blocks>1?`${e.label} × ${e.blocks}`:e.label;t.append(this.createBreakdownRow(n,e.tooltip,i,!1))}p.append(t),p.append(this.createBreakdownDivider("pricing-calculator__total-divider"))}u.append(p);const g=document.createElement("div");g.className="pricing-calculator__total-section";const b=document.createElement("div");b.className="pricing-calculator__total-row";const f=document.createElement("span");f.className="pricing-calculator__total-label",f.textContent="Total cost";const P=document.createElement("span");return P.className="pricing-calculator__total-value",P.textContent="custom"===o?"Custom"
1:r(o),b.append(f,P),g.append(b),[u,g]}createBreakdownRow(t,e,i,n){const r=document.createElement("div");r.className="pricing-calculator__breakdown-row";const a=document.createElement("span");if(n){e&&(a.className="pricing-calculator__tooltip-trigger",this.applyTippyTooltip(a,e));const i=document.createTextNode("Plan "),n=document.createElement("strong");n.textContent=t,a.append(i,n)}else if(e){a.className="pricing-calculator__tooltip-trigger",this.applyTippyTooltip(a,e);const i=document.createElement("span");i.className="pricing-calculator__tooltip-text",i.textContent=t,a.append(i)}else a.textContent=t;const s=document.createElement("span");return s.textContent=i,r.append(a,s),r}createBreakdownDivider(t){const e=document.createElement("div");return e.className=`${t} b--u-bg-purple-100`,e.setAttribute("aria-hidden","true"),e}computeExtraCosts(t){const e=[];for(const n of this.sliders){var i;if(!n.exceededLimit)continue;const r=Number(this.sliderState[n.id]),a=this.parseLimitValue(null===(i=t.limits)||void 0===i?void 0:i[n.id]),{pricePerBlock:s,blockSize:l,unitLabel:o}=n.exceededLimit;if(void 0===s||void 0===l||void 0===o)continue;if(-1===a)continue;const c=r-a;if(c<=0)continue;const d=Math.ceil(c/l),u=Math.round(d*s*100)/100;e.push({sliderId:n.id,label:n.exceededLimit.label,tooltip:n.exceededLimit.tooltip||"",cost:u,blocks:d,unitLabel:o,pricePerBlock:s})}return e}computeTotalDisplayPrice(t,e){if("custom"===t)return"custom";if(e.some(t=>"custom"===t.cost))return"custom";const i=e.reduce((t,e)=>t+("number"==typeof e.cost?e.cost:0),0);return Math.round(100*(t+i))/100}getPlanBreakdownTooltip(t,e,i){if("custom"===String(e))return"Enterprise plan: yearly plan with custom price";const n="yearly"===this.billing?"billed yearly":"billed monthly",a=r(Number(e));return i>1?`${t.name} plan: ${a}/user/mo × ${i} users, ${n}`:`${t.name} plan: ${a}/user/mo, ${n}`}applyTippyTooltip(t,e){t.dataset.controller="tippy",t.dataset.tooltip=e,t.dataset.placement="top"}parseLimitValue(t){if(null==t)return-1;if(s.has(t))return-1;const e=Number(t);return Number.isFinite(e)?e:-1}formatSliderBadgeValue(t){return Number(t).toLocaleString("en-US")}}a(o,"targets",["slider","valueBadge","sliderTrack","planCard","planToggleButton","breakdownContent","calcSummary","trialCta","contactSalesCta"]),a(o,"values",{config:Object,summary:{type:String,default:""}})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.