0?a=e.__k[o]=K(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,_=o+h,a.__=e,a.__b=e.__b+1,d=null,(c=a.__i=Re(a,n,_,s))!=-1&&(s--,(d=n[c])&&(d.__u|=2)),d==null||d.__v==null?(c==-1&&(l>p?h--:l_?h--:h++,a.__u|=4))):e.__k[o]=null;if(s)for(o=0;o
(p?1:0)){for(l=n-1,o=n+1;l>=0||o=0?l--:o++])!=null&&(2&c.__u)==0&&d==c.key&&_==c.type)return a}return-1}function xe(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ue.test(t)?n:n+"px"}function G(e,t,n,r,l){var o,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||xe(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||xe(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(me,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n[W]=r[W]:(n[W]=te,e.addEventListener(t,o?oe:ne,o)):e.removeEventListener(t,o?oe:ne,o);else{if(l=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function ke(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[F]==null)t[F]=te++;else if(t[F]0?e:q(e)?e.map($e):L({},e)}function qe(e,t,n,r,l,o,a,d,_){var c,p,s,h,u,m,w,x=n.props||j,y=t.props,g=t.type;if(g=="svg"?l="http://www.w3.org/2000/svg":g=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c{H=e,T=t},ae=()=>({"Content-Type":"application/json","X-Widget-Key":T}),Ge=async()=>{const e=await fetch(`${H}/api/widget/init?key=${T}`);if(!e.ok)throw new Error("Widget init failed");return e.json()},Qe=async()=>{const e=await fetch(`${H}/api/widget/doctors?key=${T}`);if(!e.ok)throw new Error("Failed to load doctors");return e.json()},Xe=async(e,t)=>{const n=await fetch(`${H}/api/widget/slots?key=${T}&doctorId=${e}&date=${t}`);if(!n.ok)throw new Error("Failed to load slots");return n.json()},Ze=async e=>{const t=await fetch(`${H}/api/widget/book?key=${T}`,{method:"POST",headers:ae(),body:JSON.stringify(e)});if(!t.ok)throw new Error("Booking failed");return t.json()},et=async e=>{const t=await fetch(`${H}/api/widget/lead?key=${T}`,{method:"POST",headers:ae(),body:JSON.stringify(e)});if(!t.ok)throw new Error("Submission failed");return t.json()},tt=async(e,t)=>{const n=await fetch(`${H}/api/widget/chat?key=${T}`,{method:"POST",headers:ae(),body:JSON.stringify({messages:e,captchaToken:t})});if(!n.ok||!n.body)throw new Error("Chat failed");return n.body};var E,k,ce,ze,Q=0,Le=[],S=b,Me=S.__b,Te=S.__r,Be=S.diffed,He=S.__c,Pe=S.unmount,Ne=S.__;function de(e,t){S.__h&&S.__h(k,e,Q||t),Q=0;var n=k.__H||(k.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function v(e){return Q=1,nt(Ae,e)}function nt(e,t,n){var r=de(E++,2);if(r.t=e,!r.__c&&(r.__=[Ae(void 0,t),function(d){var _=r.__N?r.__N[0]:r.__[0],c=r.t(_,d);_!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=k,!k.__f)){var l=function(d,_,c){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(h){return h.__c});if(p.every(function(h){return!h.__N}))return!o||o.call(this,d,_,c);var s=r.__c.props!==d;return p.some(function(h){if(h.__N){var u=h.__[0];h.__=h.__N,h.__N=void 0,u!==h.__[0]&&(s=!0)}}),o&&o.call(this,d,_,c)||s};k.__f=!0;var o=k.shouldComponentUpdate,a=k.componentWillUpdate;k.componentWillUpdate=function(d,_,c){if(this.__e){var p=o;o=void 0,l(d,_,c),o=p}a&&a.call(this,d,_,c)},k.shouldComponentUpdate=l}return r.__N||r.__}function X(e,t){var n=de(E++,3);!S.__s&&Ie(n.__H,t)&&(n.__=e,n.u=t,k.__H.__h.push(n))}function ot(e){return Q=5,it(function(){return{current:e}},[])}function it(e,t){var n=de(E++,7);return Ie(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function rt(){for(var e;e=Le.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Z),t.__h.some(_e),t.__h=[]}catch(n){t.__h=[],S.__e(n,e.__v)}}}S.__b=function(e){k=null,Me&&Me(e)},S.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ne&&Ne(e,t)},S.__r=function(e){Te&&Te(e),E=0;var t=(k=e.__c).__H;t&&(ce===k?(t.__h=[],k.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Z),t.__h.some(_e),t.__h=[],E=0)),ce=k},S.diffed=function(e){Be&&Be(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Le.push(t)!==1&&ze===S.requestAnimationFrame||((ze=S.requestAnimationFrame)||st)(rt)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),ce=k=null},S.__c=function(e,t){t.some(function(n){try{n.__h.some(Z),n.__h=n.__h.filter(function(r){return!r.__||_e(r)})}catch(r){t.some(function(l){l.__h&&(l.__h=[])}),t=[],S.__e(r,n.__v)}}),He&&He(e,t)},S.unmount=function(e){Pe&&Pe(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Z(r)}catch(l){t=l}}),n.__H=void 0,t&&S.__e(t,n.__v))};var De=typeof requestAnimationFrame=="function";function st(e){var t,n=function(){clearTimeout(r),De&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);De&&(t=requestAnimationFrame(n))}function Z(e){var t=k,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),k=t}function _e(e){var t=k;e.__c=e.__(),k=t}function Ie(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ae(e,t){return typeof t=="function"?t(e):t}const lt=e=>`
+:host { all: initial; font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; }
+
+* { margin: 0; padding: 0; box-sizing: border-box; }
+
+.widget-bubble {
+ width: 56px; height: 56px; border-radius: 50%;
+ background: ${e.colors.primary}; color: #fff;
+ display: flex; align-items: center; justify-content: center;
+ cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
+ transition: transform 0.2s; border: none; outline: none;
+}
+.widget-bubble:hover { transform: scale(1.08); }
+.widget-bubble img { width: 28px; height: 28px; border-radius: 6px; }
+.widget-bubble svg { width: 24px; height: 24px; fill: currentColor; }
+
+.widget-panel {
+ width: 380px; height: 520px; border-radius: 16px;
+ background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,0.12);
+ display: flex; flex-direction: column; overflow: hidden;
+ border: 1px solid #e5e7eb; position: absolute; bottom: 68px; right: 0;
+ animation: slideUp 0.25s ease-out;
+}
+@keyframes slideUp {
+ from { opacity: 0; transform: translateY(12px); }
+ to { opacity: 1; transform: translateY(0); }
+}
+
+.widget-header {
+ display: flex; align-items: center; gap: 10px;
+ padding: 14px 16px; background: ${e.colors.primary}; color: #fff;
+}
+.widget-header img { width: 32px; height: 32px; border-radius: 8px; }
+.widget-header-text { flex: 1; }
+.widget-header-name { font-size: 14px; font-weight: 600; }
+.widget-header-sub { font-size: 11px; opacity: 0.8; }
+.widget-close {
+ background: none; border: none; color: #fff; cursor: pointer;
+ font-size: 18px; padding: 4px; opacity: 0.8;
+}
+.widget-close:hover { opacity: 1; }
+
+.widget-tabs {
+ display: flex; border-bottom: 1px solid #e5e7eb; background: #fafafa;
+}
+.widget-tab {
+ flex: 1; padding: 10px 0; text-align: center; font-size: 12px;
+ font-weight: 500; cursor: pointer; border: none; background: none;
+ color: #6b7280; border-bottom: 2px solid transparent;
+ transition: all 0.15s;
+}
+.widget-tab.active {
+ color: ${e.colors.primary}; border-bottom-color: ${e.colors.primary};
+ font-weight: 600;
+}
+
+.widget-body { flex: 1; overflow-y: auto; padding: 16px; }
+
+.widget-input {
+ width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
+ border-radius: 8px; font-size: 13px; outline: none;
+ transition: border-color 0.15s;
+}
+.widget-input:focus { border-color: ${e.colors.primary}; }
+.widget-textarea { resize: vertical; min-height: 60px; font-family: inherit; }
+.widget-select {
+ width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
+ border-radius: 8px; font-size: 13px; background: #fff; outline: none;
+}
+.widget-label { font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 4px; display: block; }
+.widget-field { margin-bottom: 12px; }
+
+.widget-btn {
+ width: 100%; padding: 10px 16px; border: none; border-radius: 8px;
+ font-size: 13px; font-weight: 600; cursor: pointer;
+ transition: opacity 0.15s; color: #fff; background: ${e.colors.primary};
+}
+.widget-btn:hover { opacity: 0.9; }
+.widget-btn:disabled { opacity: 0.5; cursor: not-allowed; }
+.widget-btn-secondary { background: #f3f4f6; color: #374151; }
+
+.widget-slots {
+ display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0;
+}
+.widget-slot {
+ padding: 8px; text-align: center; font-size: 12px; border-radius: 6px;
+ border: 1px solid #e5e7eb; cursor: pointer; background: #fff;
+ transition: all 0.15s;
+}
+.widget-slot:hover { border-color: ${e.colors.primary}; }
+.widget-slot.selected { background: ${e.colors.primary}; color: #fff; border-color: ${e.colors.primary}; }
+.widget-slot.unavailable { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }
+
+.widget-success {
+ text-align: center; padding: 24px 16px;
+}
+.widget-success-icon { font-size: 40px; margin-bottom: 12px; }
+.widget-success-title { font-size: 16px; font-weight: 600; color: #059669; margin-bottom: 8px; }
+.widget-success-text { font-size: 13px; color: #6b7280; }
+
+.chat-messages { flex: 1; overflow-y: auto; padding: 12px 0; }
+.chat-msg { margin-bottom: 10px; display: flex; }
+.chat-msg.user { justify-content: flex-end; }
+.chat-bubble {
+ max-width: 80%; padding: 10px 14px; border-radius: 12px;
+ font-size: 13px; line-height: 1.5;
+}
+.chat-msg.user .chat-bubble { background: ${e.colors.primary}; color: #fff; border-bottom-right-radius: 4px; }
+.chat-msg.assistant .chat-bubble { background: #f3f4f6; color: #1f2937; border-bottom-left-radius: 4px; }
+
+.chat-input-row { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid #e5e7eb; }
+.chat-input { flex: 1; }
+.chat-send {
+ width: 36px; height: 36px; border-radius: 8px;
+ background: ${e.colors.primary}; color: #fff;
+ border: none; cursor: pointer; display: flex;
+ align-items: center; justify-content: center; font-size: 16px;
+}
+.chat-send:disabled { opacity: 0.5; }
+
+.quick-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
+.quick-action {
+ padding: 6px 12px; border-radius: 16px; font-size: 11px;
+ border: 1px solid ${e.colors.primary}; color: ${e.colors.primary};
+ background: ${e.colors.primaryLight}; cursor: pointer;
+ transition: all 0.15s;
+}
+.quick-action:hover { background: ${e.colors.primary}; color: #fff; }
+
+.widget-steps { display: flex; gap: 4px; margin-bottom: 16px; }
+.widget-step {
+ flex: 1; height: 3px; border-radius: 2px; background: #e5e7eb;
+}
+.widget-step.active { background: ${e.colors.primary}; }
+.widget-step.done { background: #059669; }
+`,at={chat:'',calendar:'',phone:'',send:'',close:'',check:'',sparkles:''},pe=(e,t=16,n="currentColor")=>at[e].replace("