@everfur/sdk 1.5.1 → 1.5.3

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.
Files changed (101) hide show
  1. package/dist/{bookingCopy.d-BL2-URcv.d.ts → bookingCopy.d-Bn8bdo89.d.ts} +4 -4
  2. package/dist/{bookingCopy.d-Dfew1pjY.d.cts → bookingCopy.d-Dg7bPM-U.d.cts} +4 -4
  3. package/dist/care/index.cjs +2 -2
  4. package/dist/care/index.js +2 -2
  5. package/dist/chat/index.cjs +235 -234
  6. package/dist/chat/index.js +311 -310
  7. package/dist/chat/lite/index.cjs +339 -338
  8. package/dist/chat/lite/index.js +314 -313
  9. package/dist/{chunk-ZYHPCQVM.js → chunk-CFEHTNKX.js} +1 -1
  10. package/dist/{chunk-NBAOR5TJ.js → chunk-OU5RMGKD.js} +21 -21
  11. package/dist/{chunk-RD6ZGYEJ.js → chunk-XGF2HYNN.js} +16 -16
  12. package/dist/{chunk-IO4CGYHT.js → chunk-ZGL2GEEI.js} +1 -1
  13. package/dist/client/index.cjs +1 -1
  14. package/dist/client/index.d.cts +1 -1
  15. package/dist/client/index.d.ts +1 -1
  16. package/dist/client/index.js +1 -1
  17. package/dist/core/index.cjs +31 -31
  18. package/dist/core/index.js +31 -31
  19. package/dist/health-plan/index.cjs +266 -266
  20. package/dist/health-plan/index.js +443 -443
  21. package/dist/{idempotency.d-dOFfV91-.d.ts → idempotency.d-CbB07p64.d.ts} +10 -8
  22. package/dist/{idempotency.d-CFVMhWcv.d.cts → idempotency.d-DrxKLPPe.d.cts} +10 -8
  23. package/dist/{inbox.d-DJ9xgU1Z.d.ts → inbox.d-B2JXK0uI.d.ts} +1 -1
  24. package/dist/{inbox.d-CPcMMz-Y.d.cts → inbox.d-CwA1ogzV.d.cts} +1 -1
  25. package/dist/index.cjs +257 -256
  26. package/dist/index.js +364 -363
  27. package/dist/notifications/inbox/index.cjs +28 -28
  28. package/dist/notifications/inbox/index.d.cts +5 -5
  29. package/dist/notifications/inbox/index.d.ts +5 -5
  30. package/dist/notifications/inbox/index.js +53 -53
  31. package/dist/notifications/index.cjs +1 -1
  32. package/dist/notifications/index.d.cts +3 -3
  33. package/dist/notifications/index.d.ts +3 -3
  34. package/dist/notifications/index.js +1 -1
  35. package/dist/{optInView.d-ByDJMrMv.d.cts → optInView.d-ChJyJMBA.d.cts} +4 -1
  36. package/dist/{optInView.d-DVshLxbD.d.ts → optInView.d-Cps7aLQN.d.ts} +4 -1
  37. package/dist/{parse.d-Cj3fURer.d.ts → parse.d-QjB2LJCd.d.ts} +19 -10
  38. package/dist/{parse.d-cH7ZmMeo.d.cts → parse.d-_Ttu2h5g.d.cts} +19 -10
  39. package/dist/records/depth/index.cjs +80 -80
  40. package/dist/records/depth/index.js +115 -115
  41. package/dist/records/index.cjs +653 -653
  42. package/dist/records/index.js +1074 -1074
  43. package/dist/{route.d-DSYEd2MR.d.ts → route.d-DtuKY5dM.d.ts} +1 -1
  44. package/dist/{route.d-DCzQh4ix.d.cts → route.d-Nt-r-7IO.d.cts} +1 -1
  45. package/dist/server/events/index.cjs +1 -1
  46. package/dist/server/events/index.js +1 -1
  47. package/dist/server/index.cjs +1 -1
  48. package/dist/server/index.js +1 -1
  49. package/dist/shop/index.cjs +188 -188
  50. package/dist/shop/index.d.cts +2 -2
  51. package/dist/shop/index.d.ts +2 -2
  52. package/dist/shop/index.js +386 -386
  53. package/dist/shop/orders-v2/index.cjs +72 -72
  54. package/dist/shop/orders-v2/index.js +126 -126
  55. package/dist/tabs/index.cjs +114 -111
  56. package/dist/tabs/index.d.cts +18 -5
  57. package/dist/tabs/index.d.ts +18 -5
  58. package/dist/tabs/index.js +191 -188
  59. package/dist/televet/booking/index.cjs +214 -211
  60. package/dist/televet/booking/index.d.cts +2 -2
  61. package/dist/televet/booking/index.d.ts +2 -2
  62. package/dist/televet/booking/index.js +344 -341
  63. package/dist/televet/call/index.cjs +53 -53
  64. package/dist/televet/call/index.js +67 -67
  65. package/dist/texting/index.cjs +8 -8
  66. package/dist/texting/index.d.cts +2 -2
  67. package/dist/texting/index.d.ts +2 -2
  68. package/dist/texting/index.js +8 -8
  69. package/dist/{useInboxUnread.d-CXiaR3BZ.d.ts → useInboxUnread.d-0DrQPn7J.d.ts} +1 -1
  70. package/dist/{useInboxUnread.d-DERpMelw.d.cts → useInboxUnread.d-CRcOTkmu.d.cts} +1 -1
  71. package/dist/web/health-plan/index.cjs +1 -1
  72. package/dist/web/health-plan/index.js +1 -1
  73. package/dist/web/inbox/index.cjs +1 -1
  74. package/dist/web/inbox/index.d.cts +6 -6
  75. package/dist/web/inbox/index.d.ts +6 -6
  76. package/dist/web/inbox/index.js +1 -1
  77. package/dist/web/index.cjs +184 -184
  78. package/dist/web/index.js +181 -181
  79. package/dist/web/notifications/index.cjs +1 -1
  80. package/dist/web/notifications/index.d.cts +2 -2
  81. package/dist/web/notifications/index.d.ts +2 -2
  82. package/dist/web/notifications/index.js +1 -1
  83. package/dist/web/records-sheet/index.cjs +1 -1
  84. package/dist/web/records-sheet/index.js +1 -1
  85. package/dist/web/shop/index.cjs +2 -2
  86. package/dist/web/shop/index.d.cts +2 -2
  87. package/dist/web/shop/index.d.ts +2 -2
  88. package/dist/web/shop/index.js +3 -3
  89. package/dist/web/televet/booking/index.cjs +185 -185
  90. package/dist/web/televet/booking/index.d.cts +2 -2
  91. package/dist/web/televet/booking/index.d.ts +2 -2
  92. package/dist/web/televet/booking/index.js +185 -185
  93. package/dist/web/televet/call/index.cjs +1 -1
  94. package/dist/web/televet/call/index.js +1 -1
  95. package/dist/web/texting/index.cjs +3 -4
  96. package/dist/web/texting/index.d.cts +2 -2
  97. package/dist/web/texting/index.d.ts +2 -2
  98. package/dist/web/texting/index.js +3 -4
  99. package/dist/web/ui/index.cjs +1 -1
  100. package/dist/web/ui/index.js +33 -33
  101. package/package.json +1 -1
@@ -24,4 +24,4 @@ return t.jsxs("section",{className:s,"data-testid":"everfur-vet-call-lobby",styl
24
24
  /* @__PURE__ */t.jsx("p",{style:d.prepLabel,children:p.lobbyTipsTitle(a)}),
25
25
  /* @__PURE__ */t.jsx("ol",{style:d.tips,children:[p.lobbyTipSpot,g].map((e,r)=>/* @__PURE__ */t.jsxs("li",{style:d.tip,children:[
26
26
  /* @__PURE__ */t.jsx("span",{"aria-hidden":"true",style:d.tipNumber,children:String(r+1).padStart(2,"0")}),
27
- /* @__PURE__ */t.jsx("span",{style:d.prepBody,children:e})]},e))})]}),c===null?null:/* @__PURE__ */t.jsx("p",{"data-testid":"everfur-vet-call-lobby-duration",style:d.duration,children:p.lobbyDuration(c)})]})}function De(e){let{space:t,radius:r,type:a}=e,n=Re(e),l=112;return{root:{...te,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:t.lg,padding:t.xl,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:n.line,backgroundColor:n.surface,color:n.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:Te,padding:`0 ${t.lg}px`,margin:0,borderRadius:r.pill,borderStyle:"solid",borderWidth:1.5,borderColor:n.line,background:n.surface,color:n.ink,cursor:"pointer",...faceCss(e,"bold"),fontSize:a.size.bodyTight},label:{margin:0,...faceCss(e,"monoBold"),color:n.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.md},avatar:{position:"relative",width:l,height:l,borderRadius:r.pill,overflow:"hidden",backgroundColor:n.mist,boxShadow:`0 0 0 4px ${n.surface}, 0 0 0 6px ${n.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:l*.24,width:l*.28,height:l*.28,borderRadius:r.pill,backgroundColor:n.ink,opacity:.35},avatarBody:{position:"absolute",top:l*.58,width:l*.52,height:l*.34,borderTopLeftRadius:l*.26,borderTopRightRadius:l*.26,backgroundColor:n.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(e,"medium"),fontSize:K(e,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:n.ink},prepCard:{display:"flex",flexDirection:"column",gap:t.sm,padding:t.lg,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:n.line},prepLabel:{margin:0,...faceCss(e,"bold"),fontSize:19,color:n.ink},tips:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},tip:{display:"grid",gridTemplateColumns:"44px 1fr",gap:10,paddingTop:12,paddingBottom:12,borderTop:`1px solid ${n.line}`},tipNumber:{...faceCss(e,"monoBold"),color:n.ink,fontSize:13,paddingTop:2},prepBody:{margin:0,...faceCss(e,"regular"),fontSize:a.size.body,lineHeight:1.5,color:n.text},duration:{margin:0,textAlign:"center",...faceCss(e,"regular"),fontSize:a.size.bodyTight,color:n.muted}}}var Ne="1.5.1";var Ue=/* @__PURE__ */Object.freeze({k1:"X4wc1hwVONs4I9Vmclo9ExrfPZlH8-tgY7NmzxuA5lI"});function Ie(e,t){let r=Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join(",");return`v${1}|${e}|${r}`}var Me=Ie(Ne,Ue);var Pe=/* @__PURE__ */Symbol.for(`@everfur/sdk#WebRuntimeRenderer@${Me}`),Ve=globalThis;function We(t,r){let a=Ve[Pe];return a===void 0?e.createElement(t.bundled,r):a(t,r)}var _e={part:"televet-call",name:"EverfurVetCall",bundled:EverfurVetCall},Ye={part:"televet-call",name:"EverfurVetCallLobby",bundled:EverfurVetCallLobby};function EverfurVetCall2(e){return We(_e,e)}function EverfurVetCallLobby2(e){return We(Ye,e)}exports.EVERFUR_DAILY_SETUP=re;exports.EverfurVetCall=EverfurVetCall2;exports.EverfurVetCallLobby=EverfurVetCallLobby2;exports.VET_CALL_CONSULT_MINUTES=b;exports.VET_CALL_COPY=p;exports.isEverfurDailyModule=isEverfurDailyModule;exports.isSafeRoomUrl=isSafeRoomUrl;exports.isUsableRoomCredential=isUsableRoomCredential;exports.loadEverfurDaily=loadEverfurDaily;exports.registerEverfurDaily=registerEverfurDaily;
27
+ /* @__PURE__ */t.jsx("span",{style:d.prepBody,children:e})]},e))})]}),c===null?null:/* @__PURE__ */t.jsx("p",{"data-testid":"everfur-vet-call-lobby-duration",style:d.duration,children:p.lobbyDuration(c)})]})}function De(e){let{space:t,radius:r,type:a}=e,n=Re(e),l=112;return{root:{...te,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:t.lg,padding:t.xl,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:n.line,backgroundColor:n.surface,color:n.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:Te,padding:`0 ${t.lg}px`,margin:0,borderRadius:r.pill,borderStyle:"solid",borderWidth:1.5,borderColor:n.line,background:n.surface,color:n.ink,cursor:"pointer",...faceCss(e,"bold"),fontSize:a.size.bodyTight},label:{margin:0,...faceCss(e,"monoBold"),color:n.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.md},avatar:{position:"relative",width:l,height:l,borderRadius:r.pill,overflow:"hidden",backgroundColor:n.mist,boxShadow:`0 0 0 4px ${n.surface}, 0 0 0 6px ${n.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:l*.24,width:l*.28,height:l*.28,borderRadius:r.pill,backgroundColor:n.ink,opacity:.35},avatarBody:{position:"absolute",top:l*.58,width:l*.52,height:l*.34,borderTopLeftRadius:l*.26,borderTopRightRadius:l*.26,backgroundColor:n.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(e,"medium"),fontSize:K(e,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:n.ink},prepCard:{display:"flex",flexDirection:"column",gap:t.sm,padding:t.lg,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:n.line},prepLabel:{margin:0,...faceCss(e,"bold"),fontSize:19,color:n.ink},tips:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},tip:{display:"grid",gridTemplateColumns:"44px 1fr",gap:10,paddingTop:12,paddingBottom:12,borderTop:`1px solid ${n.line}`},tipNumber:{...faceCss(e,"monoBold"),color:n.ink,fontSize:13,paddingTop:2},prepBody:{margin:0,...faceCss(e,"regular"),fontSize:a.size.body,lineHeight:1.5,color:n.text},duration:{margin:0,textAlign:"center",...faceCss(e,"regular"),fontSize:a.size.bodyTight,color:n.muted}}}var Ne="1.5.3";var Ue=/* @__PURE__ */Object.freeze({k1:"X4wc1hwVONs4I9Vmclo9ExrfPZlH8-tgY7NmzxuA5lI"});function Ie(e,t){let r=Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join(",");return`v${1}|${e}|${r}`}var Me=Ie(Ne,Ue);var Pe=/* @__PURE__ */Symbol.for(`@everfur/sdk#WebRuntimeRenderer@${Me}`),Ve=globalThis;function We(t,r){let a=Ve[Pe];return a===void 0?e.createElement(t.bundled,r):a(t,r)}var _e={part:"televet-call",name:"EverfurVetCall",bundled:EverfurVetCall},Ye={part:"televet-call",name:"EverfurVetCallLobby",bundled:EverfurVetCallLobby};function EverfurVetCall2(e){return We(_e,e)}function EverfurVetCallLobby2(e){return We(Ye,e)}exports.EVERFUR_DAILY_SETUP=re;exports.EverfurVetCall=EverfurVetCall2;exports.EverfurVetCallLobby=EverfurVetCallLobby2;exports.VET_CALL_CONSULT_MINUTES=b;exports.VET_CALL_COPY=p;exports.isEverfurDailyModule=isEverfurDailyModule;exports.isSafeRoomUrl=isSafeRoomUrl;exports.isUsableRoomCredential=isUsableRoomCredential;exports.loadEverfurDaily=loadEverfurDaily;exports.registerEverfurDaily=registerEverfurDaily;
@@ -24,4 +24,4 @@ return s("section",{className:o,"data-testid":"everfur-vet-call-lobby",style:{..
24
24
  /* @__PURE__ */c("p",{style:f.prepLabel,children:k.lobbyTipsTitle(r)}),
25
25
  /* @__PURE__ */c("ol",{style:f.tips,children:[k.lobbyTipSpot,b].map((e,t)=>/* @__PURE__ */s("li",{style:f.tip,children:[
26
26
  /* @__PURE__ */c("span",{"aria-hidden":"true",style:f.tipNumber,children:String(t+1).padStart(2,"0")}),
27
- /* @__PURE__ */c("span",{style:f.prepBody,children:e})]},e))})]}),d===null?null:/* @__PURE__ */c("p",{"data-testid":"everfur-vet-call-lobby-duration",style:f.duration,children:k.lobbyDuration(d)})]})}function Ye(e){let{space:t,radius:r,type:n}=e,a=Ue(e),l=112;return{root:{...se,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:t.lg,padding:t.xl,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:a.line,backgroundColor:a.surface,color:a.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:Ie,padding:`0 ${t.lg}px`,margin:0,borderRadius:r.pill,borderStyle:"solid",borderWidth:1.5,borderColor:a.line,background:a.surface,color:a.ink,cursor:"pointer",...faceCss(e,"bold"),fontSize:n.size.bodyTight},label:{margin:0,...faceCss(e,"monoBold"),color:a.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.md},avatar:{position:"relative",width:l,height:l,borderRadius:r.pill,overflow:"hidden",backgroundColor:a.mist,boxShadow:`0 0 0 4px ${a.surface}, 0 0 0 6px ${a.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:l*.24,width:l*.28,height:l*.28,borderRadius:r.pill,backgroundColor:a.ink,opacity:.35},avatarBody:{position:"absolute",top:l*.58,width:l*.52,height:l*.34,borderTopLeftRadius:l*.26,borderTopRightRadius:l*.26,backgroundColor:a.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(e,"medium"),fontSize:ae(e,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:a.ink},prepCard:{display:"flex",flexDirection:"column",gap:t.sm,padding:t.lg,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:a.line},prepLabel:{margin:0,...faceCss(e,"bold"),fontSize:19,color:a.ink},tips:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},tip:{display:"grid",gridTemplateColumns:"44px 1fr",gap:10,paddingTop:12,paddingBottom:12,borderTop:`1px solid ${a.line}`},tipNumber:{...faceCss(e,"monoBold"),color:a.ink,fontSize:13,paddingTop:2},prepBody:{margin:0,...faceCss(e,"regular"),fontSize:n.size.body,lineHeight:1.5,color:a.text},duration:{margin:0,textAlign:"center",...faceCss(e,"regular"),fontSize:n.size.bodyTight,color:a.muted}}}var qe="1.5.1";var _e=/* @__PURE__ */Object.freeze({k1:"X4wc1hwVONs4I9Vmclo9ExrfPZlH8-tgY7NmzxuA5lI"});function Ke(e,t){let r=Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join(",");return`v${1}|${e}|${r}`}var Xe=Ke(qe,_e);var Ze=/* @__PURE__ */Symbol.for(`@everfur/sdk#WebRuntimeRenderer@${Xe}`),Je=globalThis;function Qe(t,r){let n=Je[Ze];return n===void 0?e(t.bundled,r):n(t,r)}var et={part:"televet-call",name:"EverfurVetCall",bundled:EverfurVetCall},tt={part:"televet-call",name:"EverfurVetCallLobby",bundled:EverfurVetCallLobby};function EverfurVetCall2(e){return Qe(et,e)}function EverfurVetCallLobby2(e){return Qe(tt,e)}export{ue as EVERFUR_DAILY_SETUP,EverfurVetCall2 as EverfurVetCall,EverfurVetCallLobby2 as EverfurVetCallLobby,x as VET_CALL_CONSULT_MINUTES,k as VET_CALL_COPY,isEverfurDailyModule,isSafeRoomUrl,isUsableRoomCredential,loadEverfurDaily,registerEverfurDaily};
27
+ /* @__PURE__ */c("span",{style:f.prepBody,children:e})]},e))})]}),d===null?null:/* @__PURE__ */c("p",{"data-testid":"everfur-vet-call-lobby-duration",style:f.duration,children:k.lobbyDuration(d)})]})}function Ye(e){let{space:t,radius:r,type:n}=e,a=Ue(e),l=112;return{root:{...se,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:t.lg,padding:t.xl,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:a.line,backgroundColor:a.surface,color:a.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:Ie,padding:`0 ${t.lg}px`,margin:0,borderRadius:r.pill,borderStyle:"solid",borderWidth:1.5,borderColor:a.line,background:a.surface,color:a.ink,cursor:"pointer",...faceCss(e,"bold"),fontSize:n.size.bodyTight},label:{margin:0,...faceCss(e,"monoBold"),color:a.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.md},avatar:{position:"relative",width:l,height:l,borderRadius:r.pill,overflow:"hidden",backgroundColor:a.mist,boxShadow:`0 0 0 4px ${a.surface}, 0 0 0 6px ${a.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:l*.24,width:l*.28,height:l*.28,borderRadius:r.pill,backgroundColor:a.ink,opacity:.35},avatarBody:{position:"absolute",top:l*.58,width:l*.52,height:l*.34,borderTopLeftRadius:l*.26,borderTopRightRadius:l*.26,backgroundColor:a.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(e,"medium"),fontSize:ae(e,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:a.ink},prepCard:{display:"flex",flexDirection:"column",gap:t.sm,padding:t.lg,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:a.line},prepLabel:{margin:0,...faceCss(e,"bold"),fontSize:19,color:a.ink},tips:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},tip:{display:"grid",gridTemplateColumns:"44px 1fr",gap:10,paddingTop:12,paddingBottom:12,borderTop:`1px solid ${a.line}`},tipNumber:{...faceCss(e,"monoBold"),color:a.ink,fontSize:13,paddingTop:2},prepBody:{margin:0,...faceCss(e,"regular"),fontSize:n.size.body,lineHeight:1.5,color:a.text},duration:{margin:0,textAlign:"center",...faceCss(e,"regular"),fontSize:n.size.bodyTight,color:a.muted}}}var qe="1.5.3";var _e=/* @__PURE__ */Object.freeze({k1:"X4wc1hwVONs4I9Vmclo9ExrfPZlH8-tgY7NmzxuA5lI"});function Ke(e,t){let r=Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join(",");return`v${1}|${e}|${r}`}var Xe=Ke(qe,_e);var Ze=/* @__PURE__ */Symbol.for(`@everfur/sdk#WebRuntimeRenderer@${Xe}`),Je=globalThis;function Qe(t,r){let n=Je[Ze];return n===void 0?e(t.bundled,r):n(t,r)}var et={part:"televet-call",name:"EverfurVetCall",bundled:EverfurVetCall},tt={part:"televet-call",name:"EverfurVetCallLobby",bundled:EverfurVetCallLobby};function EverfurVetCall2(e){return Qe(et,e)}function EverfurVetCallLobby2(e){return Qe(tt,e)}export{ue as EVERFUR_DAILY_SETUP,EverfurVetCall2 as EverfurVetCall,EverfurVetCallLobby2 as EverfurVetCallLobby,x as VET_CALL_CONSULT_MINUTES,k as VET_CALL_COPY,isEverfurDailyModule,isSafeRoomUrl,isUsableRoomCredential,loadEverfurDaily,registerEverfurDaily};
@@ -17,9 +17,9 @@ return Object.freeze({reason:userFacingError("accessDenied"),level:"user_entitle
17
17
  return t.jsx("div",{role:"status","aria-busy":"true","aria-label":`Loading ${r}`,className:i,style:{...a.offstate,...n},children:/* @__PURE__ */t.jsx("div",{style:a.skeletonBar})})}function OffState({decision:r,style:n,className:i}){let o=useEverfurTheme(),a=e.useMemo(()=>zr(o),[o]),l=r.disabled?.reason??"";/* @__PURE__ */
18
18
  return t.jsx("div",{className:i,style:{...a.offstate,...n},children:l.length>0?/* @__PURE__ */t.jsx("p",{style:a.offstateText,children:l}):null})}function zr(e){let{color:t,space:r,radius:n,type:i}=e;return{offstate:{...Fr,boxSizing:"border-box",minHeight:Dr,display:"flex",flexDirection:"column",justifyContent:"center",padding:`${r.md}px ${r.lg}px`,backgroundColor:t.surfaceCream,borderRadius:n.md,border:`1px solid ${t.brandBorder}`},offstateText:{margin:0,...faceCss(e,"regular"),fontSize:i.size.body,lineHeight:`${Math.round(i.size.body*i.lineHeight.normal)}px`,color:t.text.muted},skeletonBar:{height:r.md,borderRadius:n.xs,backgroundColor:t.brandSofter}}}function Pr(e,t){if(e===void 0)return{};let r={};return e.backgroundColor!==void 0&&(r.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(r.borderColor=e.borderColor,r.borderWidth=t??1),e.borderRadius!==void 0&&(r.borderRadius=e.borderRadius),r}function Mr(e){return e?.textColor===void 0?{}:{color:e.textColor}}function Lr(e,t){let r=Pr(e,t),n={};return r.backgroundColor!==void 0&&(n.backgroundColor=r.backgroundColor),r.borderColor!==void 0&&(n.border=`${r.borderWidth??1}px solid ${r.borderColor}`),r.borderRadius!==void 0&&(n.borderRadius=r.borderRadius),n}function qr(e,t){return{...Lr(e,t),...Mr(e)}}function EverfurTextingOptIn(r){let n=l(r,["onStatusChange"]),i=e.useMemo(()=>({copy:xt(r.copy),brandCopy:Ct(r.brandCopy)}),[r.copy,r.brandCopy]),{copy:o,brandCopy:a}=i,s=useEverfurTheme(),u=e.useMemo(()=>$r(s),[s]),d=useEverfurTexting();return d.status==="signedOut"?/* @__PURE__ */t.jsxs("section",{className:n.className,style:{...u.card,...n.style},children:[
19
19
  /* @__PURE__ */t.jsx("h2",{style:u.title,children:a.introTitle(s.meta.displayName)}),
20
- /* @__PURE__ */t.jsx("p",{style:u.body,children:o.signedOut})]}):/* @__PURE__ */t.jsx(CapabilityGate,{capability:"texting",...n.renderDisabled?{renderDisabled:n.renderDisabled}:{},style:n.style,className:n.className,children:/* @__PURE__ */t.jsx(wt.Provider,{value:i,children:/* @__PURE__ */t.jsx(OptInBody,{...n,texting:d,styles:u})})})}function OptInBody({texting:r,styles:n,onStatusChange:i,renderNotice:o,style:a,className:l}){let{copy:s,brandCopy:u}=St(),d=useEverfurTheme(),c=e.useId(),{status:p,profile:f,snapshot:h}=r,b=f?.brandName??d.meta.displayName,[y,g]=e.useState(""),[m,v]=e.useState(false),[_,x]=e.useState(""),[C,w]=e.useState(null),[S,E]=e.useState(false),[k,T]=e.useState(""),[j,F]=e.useState(false);e.useEffect(()=>{i?.(p)},[i,p]),e.useEffect(()=>{w(null),E(false)},[p]);let O=(e,r=false)=>/* @__PURE__ */t.jsx("section",{className:l,style:{...n.card,...a},"aria-busy":r?"true":void 0,children:e}),I=(e,r)=>{let i=textingErrorText(e,h.failedAction,h.codeRefusal,s),a=textingSupportText(e,s);/* @__PURE__ */
20
+ /* @__PURE__ */t.jsx("p",{style:u.body,children:o.signedOut})]}):/* @__PURE__ */t.jsx(CapabilityGate,{capability:"texting",...n.renderDisabled?{renderDisabled:n.renderDisabled}:{},style:n.style,className:n.className,children:/* @__PURE__ */t.jsx(wt.Provider,{value:i,children:/* @__PURE__ */t.jsx(OptInBody,{...n,texting:d,styles:u})})})}function OptInBody({texting:r,styles:n,onStatusChange:i,renderNotice:o,style:a,className:l}){let{copy:s,brandCopy:u}=St(),d=useEverfurTheme(),c=e.useId(),{status:p,profile:f,snapshot:h}=r,b=f?.brandName??d.meta.displayName,[y,g]=e.useState(""),[m,v]=e.useState(false),[_,x]=e.useState(""),[C,w]=e.useState(null),[S,E]=e.useState(false),[k,T]=e.useState(""),[j,F]=e.useState(false);e.useEffect(()=>{i?.(p)},[i,p]),e.useEffect(()=>{w(null),E(false)},[p]);let O=(e,r=false)=>/* @__PURE__ */t.jsx("section",{className:l,style:{...n.card,...a},"aria-busy":r?"true":void 0,children:e}),I=(e,r)=>{let i=textingErrorText(e,h.failedAction,h.codeRefusal,s);/* @__PURE__ */
21
21
  return t.jsxs("div",{style:n.notice,role:"alert",children:[
22
- /* @__PURE__ */t.jsx(HostRender,{resetKey:e,render:()=>o?o(e):/* @__PURE__ */t.jsx("p",{style:n.noticeText,children:i}),fallback:/* @__PURE__ */t.jsx("p",{style:n.noticeText,children:i})}),a===null?null:/* @__PURE__ */t.jsx("p",{style:n.footnote,children:a}),r===void 0?null:/* @__PURE__ */t.jsx("button",{type:"button",onClick:r,style:n.link,children:s.retry})]})};if(p==="unavailable")return O(
22
+ /* @__PURE__ */t.jsx(HostRender,{resetKey:e,render:()=>o?o(e):/* @__PURE__ */t.jsx("p",{style:n.noticeText,children:i}),fallback:/* @__PURE__ */t.jsx("p",{style:n.noticeText,children:i})}),r===void 0?null:/* @__PURE__ */t.jsx("button",{type:"button",onClick:r,style:n.link,children:s.retry})]})};if(p==="unavailable")return O(
23
23
  /* @__PURE__ */t.jsxs(t.Fragment,{children:[
24
24
  /* @__PURE__ */t.jsx("h2",{style:n.title,children:s.unavailableTitle}),
25
25
  /* @__PURE__ */t.jsx("p",{style:n.body,children:s.unavailableBody})]}));if(f===null)return null;if(p==="loading")/* @__PURE__ */
@@ -63,8 +63,7 @@ return t.jsxs("div",{style:r.petRow,children:[
63
63
  /* @__PURE__ */t.jsxs("select",{id:`${d}-pet`,value:p,disabled:o,onChange:e=>l(e.currentTarget.value),style:r.input,children:[p===""?/* @__PURE__ */t.jsx("option",{value:"",children:u.noPetSelected}):null,c.map(e=>/* @__PURE__ */t.jsx("option",{value:e.petRef,children:e.name??e.petRef},e.petRef))]}),
64
64
  /* @__PURE__ */t.jsxs("div",{style:r.links,children:[
65
65
  /* @__PURE__ */t.jsx("button",{type:"button",disabled:!f||o,"aria-busy":o?"true":void 0,onClick:()=>s(p),style:r.secondary,children:o?u.savingPet:u.savePet}),a&&!f?/* @__PURE__ */t.jsx("p",{style:r.footnote,role:"status",children:u.petSaved}):null]})]})}function $r(e){let{color:t,radius:r,space:n,type:i,slots:o}=e,a=e=>`${Math.round(e*i.lineHeight.snug)}px`,l=(t,r,n)=>({margin:0,...faceCss(e,n),fontSize:t,lineHeight:a(t),color:r}),s=o.card?.textColor;return{card:{boxSizing:"border-box",display:"flex",flexDirection:"column",gap:n.md,padding:n.lg,borderRadius:r.lg,border:`1px solid ${t.brandBorder}`,backgroundColor:t.surface,...qr(o.card,1)},title:l(i.size.subtitle,s??t.text.primary,"bold"),subtitle:l(i.size.body,s??t.text.primary,"bold"),body:l(i.size.body,s??t.text.secondary,"regular"),footnote:l(i.size.caption,t.text.muted,"regular"),phone:l(i.size.body,s??t.text.primary,"bold"),label:l(i.size.caption,s??t.text.primary,"bold"),input:{boxSizing:"border-box",width:"100%",minHeight:44,padding:`0 ${n.md}px`,borderRadius:r.md,border:`1px solid ${t.controlEdge}`,backgroundColor:t.surface,...faceCss(e,"regular"),fontSize:i.size.body,color:t.text.primary,...qr(o.input,1)},consentRow:{display:"flex",alignItems:"flex-start",gap:n.sm,cursor:"pointer"},box:{width:24,height:24,minWidth:24,margin:0,accentColor:t.brand,cursor:"pointer"},consentText:{...l(i.size.caption,s??t.text.secondary,"regular"),whiteSpace:"pre-wrap"},primary:{minHeight:44,padding:`0 ${n.lg}px`,borderRadius:r.pill,border:"none",backgroundColor:t.brand,color:t.text.onBrand,cursor:"pointer",...faceCss(e,"bold"),fontSize:i.size.body,...qr(o.primaryButton)},secondary:{minHeight:44,padding:`0 ${n.lg}px`,borderRadius:r.pill,border:`1px solid ${t.brandBorder}`,backgroundColor:t.surface,color:t.brandInk,cursor:"pointer",...faceCss(e,"bold"),fontSize:i.size.caption},link:{alignSelf:"flex-start",minHeight:44,padding:0,border:"none",background:"none",cursor:"pointer",...faceCss(e,"bold"),fontSize:i.size.caption,color:t.linkInk,...qr(o.link)},links:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:n.md},notice:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:n.xs},noticeText:l(i.size.caption,t.errorRed,"regular"),confirm:{display:"flex",flexDirection:"column",gap:n.sm,padding:n.md,borderRadius:r.md,backgroundColor:t.surfaceSubtle},petRow:{display:"flex",flexDirection:"column",gap:n.xs},skeleton:{height:96,borderRadius:r.md,backgroundColor:t.skeleton}}}var Br=/* @__PURE__ */Symbol.for("@everfur/sdk#IntroOpen@v1"),Ur=globalThis;function Hr(e){if(typeof e!="object"||e===null)return false;let t=e;return t.holds instanceof Set&&t.listeners instanceof Set}var Vr=Ur[Br],Yr=()=>({holds:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set}),Kr=Hr(Vr)?Vr:Ur[Br]=Yr();function Wr(){return Kr.holds.size>0}function Gr(e){return Kr.listeners.add(e),()=>{Kr.listeners.delete(e)}}function Xr(){return e.useSyncExternalStore(Gr,Wr,Wr)}function resolveTextingAskDue(e){let t=e.enabled&&e.capabilityGranted&&e.hasProfile&&e.signedIn&&e.scheduleEligible&&!e.offeredThisSession,r=t&&e.identity==="none"&&e.surfaceReady;return{readEnabled:t,due:r}}var Qr=/* @__PURE__ */new Set(["emergency","schedule_soon"]);function textingAskThreadReady(e){if(e.isBootstrapping===true||e.isLoadingHistory===true||e.isStreaming===true||e.status==="error"||e.stopped===true)return false;let t=e.messages[e.messages.length-1];return t===void 0||t.role!=="assistant"||t.pending===true||t.checkin!==void 0||t.text.trim().length===0?false:!(typeof t.urgencyLevel=="string"&&Qr.has(t.urgencyLevel))}var Jr=/* @__PURE__ */new WeakSet;function Zr(e){return Jr.has(e)}var en="everfur.texting.askSchedule.v1",tn=2880*60*1e3,rn=3,nn=/* @__PURE__ */Object.freeze({askCount:0,nextAskAt:null,completed:false});function isTextingAskEligible(e,t){if(e.status!=="ok")return false;let{entry:r}=e;return r.completed||r.askCount>=rn?false:r.nextAskAt===null||t>=r.nextAskAt}function on(e,t){return{askCount:Math.min(e.askCount+1,rn),nextAskAt:t+tn,completed:e.completed}}function an(e,t){return{...e,nextAskAt:t+tn}}function ln(e){return{...e,completed:true}}function sn(e){return e.askCount<=0?1:e.askCount===1?2:3}function un(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=e,{askCount:r,nextAskAt:n,completed:i}=t;return typeof r!="number"||!Number.isInteger(r)||r<0||n!==null&&(typeof n!="number"||!Number.isFinite(n))||typeof i!="boolean"?null:{askCount:Math.min(r,rn),nextAskAt:n,completed:i}}function dn(e){let t;try{t=JSON.parse(e)}catch{return null}if(t===null||typeof t!="object"||Array.isArray(t))return null;let r={};for(let[e,n]of Object.entries(t)){let t=un(n);if(t===null)return null;r[e]=t}return r}var cn=/* @__PURE__ */Symbol.for("@everfur/sdk/texting/ask-schedule@v1");function pn(){let e=globalThis,t=e[cn];return t===void 0&&(t={sessions:/* @__PURE__ */new Map,sessionListeners:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set,writeChain:Promise.resolve()},e[cn]=t),t.sessionListeners===void 0&&(t.sessionListeners=/* @__PURE__ */new Set),t}async function fn(e){if(Zr(e))return{status:"unreadable"};let t;try{t=await e.getItem(en)}catch{return{status:"unreadable"}}if(t===null)try{return await e.setItem(en,"{}"),await e.getItem(en)===null?{status:"unreadable"}:{status:"ok",map:{}}}catch{return{status:"unreadable"}}let r=dn(t);if(r!==null)return{status:"ok",map:r};try{await e.removeItem(en)}catch{}return{status:"unreadable"}}function hn(e){let{listeners:t}=pn();return t.add(e),()=>{t.delete(e)}}function bn(e,userRef,t){let r=pn(),n=async()=>{let n=await fn(e);if(n.status!=="ok")return;let i=n.map[userRef]??nn;try{await e.setItem(en,JSON.stringify({...n.map,[userRef]:t(i)}))}catch{return}for(let e of[...r.listeners])e()},i=r.writeChain.then(n,n);return r.writeChain=i.catch(()=>{}),i}async function yn(e,userRef){let t=await fn(e);return t.status!=="ok"?{status:"unreadable"}:{status:"ok",entry:t.map[userRef]??nn}}function gn(e,userRef,t=Date.now()){return bn(e,userRef,e=>on(e,t))}function mn(e,userRef,t=Date.now()){return bn(e,userRef,e=>an(e,t))}function vn(e,userRef){return bn(e,userRef,ln)}function _n(userRef){return pn().sessions.get(userRef)??null}function xn(userRef,e){let t=pn();t.sessions.set(userRef,e);for(let e of[...t.sessionListeners])e()}function Cn(e){let{sessionListeners:t}=pn();return t.add(e),()=>{t.delete(e)}}var NO_SNAPSHOT=()=>null;function wn(){let{runtime:t}=yt(),r=t.entitlements??null,n=e.useCallback(e=>r===null?()=>{}:r.subscribe(e),[r]),i=r===null?NO_SNAPSHOT:r.getSnapshot,o=e.useSyncExternalStore(n,i,i);return e.useMemo(()=>o!==null&&decideCapability("texting",o.decisions,{isPending:o.isPending}).enabled,[o])}var Sn=/* @__PURE__ */Object.freeze({status:"idle"});function En(userRef){let{runtime:t}=yt(),r=t.registry.services.kv,[n,i]=e.useState({user:null,value:Sn});return e.useEffect(()=>{if(userRef===null)return;let e=true,t=()=>{yn(r,userRef).then(t=>{e&&i({user:userRef,value:{status:"ready",read:t}})})};t();let n=hn(t);return()=>{e=false,n()}},[r,userRef]),n.user===userRef?n.value:Sn}function kn(e){switch(e.status){case"enroll":case"requesting":case"code":case"confirming":return"none";case"verified":case"optingOut":case"optedOut":return"exists";default:return"unknown"}}function useTextingAsk(t={}){let r=t.enabled!==false,n=t.ready!==false,i=t.surface??"prompt",o=t.entry===true,{runtime:a,userRef:userRef}=yt(),l=a.registry.services.kv,s=wn(),u=En(r&&userRef!==null?userRef:null),d=e.useCallback(()=>userRef===null?null:_n(userRef),[userRef]),c=e.useSyncExternalStore(Cn,d,d),p=e.useCallback(e=>{userRef!==null&&xn(userRef,e)},[userRef]),f=c!==null&&c.surface===i,h=c!==null&&c.fromPrompt===true,b=f?c.stage==="handoff"?"hidden":c.stage:i==="prompt"&&h?"dismissed":"hidden",y=Date.now(),g=u.status==="ready"&&isTextingAskEligible(u.read,y),[m,v]=e.useState(null),_=o&&userRef!==null&&s,x=Qt(userRef!==null&&m===userRef||b!=="hidden"||f||_),C=kn(x),{readEnabled:w,due:S}=resolveTextingAskDue({enabled:r,capabilityGranted:s,hasProfile:x.profile!==null,signedIn:userRef!==null,scheduleEligible:g,offeredThisSession:c!==null,identity:C,surfaceReady:n});e.useEffect(()=>{w&&userRef!==null&&v(userRef)},[w,userRef]);let E=c?.askNumber??(u.status==="ready"&&u.read.status==="ok"?sn(u.read.entry):1);e.useEffect(()=>{!S||userRef===null||_n(userRef)!==null||p({surface:i,stage:"offered",answered:false,askNumber:E})},[S,userRef,p,E,i]),e.useEffect(()=>{!f||c.stage!=="handoff"||r&&n&&s&&x.profile!==null&&C==="none"&&p({...c,stage:"offered"})},[f,c,r,n,s,x.profile,C,p]);let k=u.status==="ready"&&u.read.status==="ok"&&u.read.entry.completed;e.useEffect(()=>{userRef===null||C!=="exists"||k||u.status!=="ready"||vn(l,userRef)},[C,k,u.status,l,userRef]),e.useEffect(()=>{f&&c.stage==="enrolling"&&x.status==="verified"&&p({...c,stage:"verified"})},[f,c,x.status,p]);let T=e.useCallback(e=>userRef===null||e.answered?e:(gn(l,userRef),{...e,answered:true}),[l,userRef]),j=e.useCallback(()=>{f&&c.stage==="offered"&&p({...c,stage:"enrolling"})},[f,c,p]),F=e.useCallback(()=>{if(!f||c.stage!=="enrolling")return;let{back:e,...t}=c;p({...t,stage:e??"offered"})},[f,c,p]),O=e.useCallback(()=>{if(!(!f||c.stage!=="offered"&&c.stage!=="enrolling")){if(i==="prompt"){p({...T(c),surface:"chat",stage:"handoff",fromPrompt:true});return}c.fromPrompt===true&&c.answered&&userRef!==null&&mn(l,userRef),p({...T(c),stage:"dismissed"})}},[f,c,i,p,T,l,userRef]),{start:I}=x,A=e.useCallback(async e=>!f||c.stage!=="enrolling"?false:(c.answered||p(T(c)),I(e)),[f,c,p,T,I]),R=_&&x.profile!==null&&C==="none"&&b!=="enrolling"&&b!=="verified",D=e.useCallback(()=>{if(!R||userRef===null)return;let e=f?c:null;p({surface:i,stage:"enrolling",answered:e?.answered??false,askNumber:c?.askNumber??E,...e?.fromPrompt===true?{fromPrompt:true}:{},back:e?.stage==="offered"?"offered":"dismissed"})},[R,userRef,f,c,p,i,E]),N=x.profile?.brandName??"";return e.useMemo(()=>({stage:userRef===null?"hidden":b,brand:N,askNumber:E,texting:x,accept:j,dismiss:O,close:F,start:A,canOpen:R,open:D}),[userRef,b,N,E,x,j,O,F,A,R,D])}var Tn=/* @__PURE__ */new Set(["signedOut","unavailable","failed","verified","optingOut","optedOut"]);function jn(t,r,n,o){let{userRef:userRef}=yt(),a=e.useRef(null),{canOpen:l,open:s,stage:u,texting:d}=t;e.useEffect(()=>{if(!r){a.current=null;return}if(!(userRef===null||a.current===userRef)){if(l){a.current=userRef,s();return}if(u==="enrolling"||u==="verified"){a.current=userRef;return}(!n||Tn.has(d.status))&&(a.current=userRef,i(o,"skipped"))}},[r,userRef,l,s,u,d.status,n,o])}var Fn='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])';function On(e){return e.tagName==="DIALOG"}function In(e){if(typeof document>"u")return null;let t=e?.getRootNode();return t&&t!==document&&"activeElement"in t?t.activeElement:document.activeElement}function An(t,r,n,i){let o=i?.escapeAtKeyDown===true,a=e.useRef(null),l=e.useRef(false),s=e.useRef(null),u=e.useRef(n);u.current=n;let d=e.useCallback(()=>{if(!l.current)return;l.current=false;let e=u.current===void 0?s.current:u.current.current;e&&e.isConnected&&e.focus(),(!e||!e.isConnected||In(e)===e)&&(s.current=null)},[]);e.useEffect(()=>{if(!t){d();return}let e=a.current;if(!l.current){let t=In(e);t!==null&&e!==null&&e.contains(t)||(s.current=t instanceof HTMLElement?t:null)}if(l.current=true,e===null)return;if(!On(e)){e.contains(In(e))||(e.querySelector(Fn)??e).focus();return}let r=e;typeof r.showModal=="function"?r.open||r.showModal():r.setAttribute("open","")},[t,d]),e.useEffect(()=>d,[d]),e.useEffect(()=>{let e=a.current;if(!t||e===null||!On(e))return;let r=e;if(typeof r.showModal!="function")return;let n=null,i=e=>{e.target instanceof HTMLElement&&(n=e.target)},o=()=>{if(!r.isConnected||r.open)return;let e=n;r.showModal(),e!==null&&e.isConnected&&r.contains(e)&&In(r)!==e&&e.focus()};return r.addEventListener("focusin",i),r.addEventListener("close",o),()=>{r.removeEventListener("focusin",i),r.removeEventListener("close",o)}},[t]);let c=e.useCallback(e=>{let t=a.current;if(t===null)return;if(e.key==="Escape"&&!On(t)){e.preventDefault(),e.stopPropagation(),r();return}if(e.key==="Escape"&&o);if(e.key!=="Tab")return;let n=Array.from(t.querySelectorAll(Fn)),i=n[0],l=n[n.length-1];if(!i||!l){e.preventDefault();return}let s=In(t);e.shiftKey&&(s===i||!t.contains(s))?(e.preventDefault(),l.focus()):!e.shiftKey&&(s===l||!t.contains(s))&&(e.preventDefault(),i.focus())},[r,o]),p=e.useCallback(e=>{e.target===e.currentTarget&&(e.preventDefault(),r())},[r]);return{dialogRef:a,onKeyDown:c,onCancel:p}}var Rn=2,Dn="data-ef-focus-ring";function ChatTextingAskController({enabled:t,ready:r,onAsk:n,entry:o=false}){let a=useTextingAsk({enabled:t,ready:r,surface:"chat",entry:o});return e.useEffect(()=>{i(n,a)},[a,n]),null}function textingAskLines(e){return{line:vt.chatAskLine(e.brand),accept:mt.promptAccept,dismiss:mt.promptDismiss,verified:vt.chatAskVerified(e.brand)}}function ChatTextingAskComposer({ask:r}){let n=useEverfurTheme(),i=e.useMemo(()=>Nn(n),[n]);/* @__PURE__ */
66
- return t.jsx(AskEntry,{ask:r,styles:i})}function AskEntry({ask:r,styles:n}){let i=e.useId(),{texting:o}=r,{status:a,profile:l,snapshot:s}=o,[u,d]=e.useState(""),[c,p]=e.useState(false),[f,h]=e.useState(""),[b,y]=e.useState(null),g=e.useRef(null),m=e.useRef(null),[v,_]=e.useState(false),x={[Dn]:"self",onFocus:()=>_(true),onBlur:()=>_(false)},C=v?{...n.pill,...n.pillFocused}:n.pill,w=a==="enroll"||a==="requesting"&&!s.resending,S=a==="code"||a==="confirming"||a==="requesting";e.useEffect(()=>{y(null)},[a]),e.useEffect(()=>{w?g.current?.focus():S&&m.current?.focus()},[w,S]);let E=/* @__PURE__ */t.jsx("button",{type:"button","aria-label":mt.close,onClick:r.close,style:n.close,children:/* @__PURE__ */t.jsx("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",fill:"none"})})}),k=s.error===null?null:/* @__PURE__ */t.jsxs("div",{role:"alert",style:n.notice,children:[
67
- /* @__PURE__ */t.jsx("p",{style:n.noticeText,children:textingErrorText(s.error,s.failedAction,s.codeRefusal)}),textingSupportText(s.error)===null?null:/* @__PURE__ */t.jsx("p",{style:n.footnote,children:textingSupportText(s.error)})]}),T=b===null?null:/* @__PURE__ */t.jsx("p",{role:"alert",style:n.noticeText,children:textingInputProblemText(b)});if(l===null)return null;if(a==="loading"||a==="failed"||a==="signedOut"||a==="unavailable")/* @__PURE__ */
66
+ return t.jsx(AskEntry,{ask:r,styles:i})}function AskEntry({ask:r,styles:n}){let i=e.useId(),{texting:o}=r,{status:a,profile:l,snapshot:s}=o,[u,d]=e.useState(""),[c,p]=e.useState(false),[f,h]=e.useState(""),[b,y]=e.useState(null),g=e.useRef(null),m=e.useRef(null),[v,_]=e.useState(false),x={[Dn]:"self",onFocus:()=>_(true),onBlur:()=>_(false)},C=v?{...n.pill,...n.pillFocused}:n.pill,w=a==="enroll"||a==="requesting"&&!s.resending,S=a==="code"||a==="confirming"||a==="requesting";e.useEffect(()=>{y(null)},[a]),e.useEffect(()=>{w?g.current?.focus():S&&m.current?.focus()},[w,S]);let E=/* @__PURE__ */t.jsx("button",{type:"button","aria-label":mt.close,onClick:r.close,style:n.close,children:/* @__PURE__ */t.jsx("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",fill:"none"})})}),k=s.error===null?null:/* @__PURE__ */t.jsx("div",{role:"alert",style:n.notice,children:/* @__PURE__ */t.jsx("p",{style:n.noticeText,children:textingErrorText(s.error,s.failedAction,s.codeRefusal)})}),T=b===null?null:/* @__PURE__ */t.jsx("p",{role:"alert",style:n.noticeText,children:textingInputProblemText(b)});if(l===null)return null;if(a==="loading"||a==="failed"||a==="signedOut"||a==="unavailable")/* @__PURE__ */
68
67
  return t.jsx("div",{style:n.root,"data-everfur-texting-ask":"entry","aria-busy":a==="loading"?"true":void 0,children:/* @__PURE__ */t.jsxs("div",{style:n.head,children:[
69
68
  /* @__PURE__ */t.jsx("div",{style:n.headBody,children:a==="failed"?k:null}),E]})});if(w){let e=a==="requesting",o=()=>{let e=validateTextingEnroll(u,c);y(e),e===null&&r.start(u)};/* @__PURE__ */
70
69
  return t.jsxs("div",{style:n.root,"data-everfur-texting-ask":"phone",children:[
@@ -3,8 +3,8 @@ import { ReactNode, CSSProperties } from 'react';
3
3
  import { a as CapabilityDecision } from '../../resolve.d-BTC3b6FW.cjs';
4
4
  import { E as EverfurError } from '../../EverfurError.d-8NHtlgzA.cjs';
5
5
  export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.cjs';
6
- import { E as EverfurTextingViewStatus, T as TextingCopy, a as TextingBrandCopy, b as TextingAsk } from '../../optInView.d-ByDJMrMv.cjs';
7
- export { C as COPY_PLACEHOLDER_PREFIX, c as EVERFUR_TEXTING_STATUSES, d as EverfurTextingChallenge, e as EverfurTextingIdentity, f as EverfurTextingInputProblem, g as EverfurTextingProfile, h as EverfurTextingReason, i as EverfurTextingState, j as EverfurTextingStatus, k as EverfurTextingVerificationInput, l as TEXTING_ASK_MAX_ASKS, m as TEXTING_ASK_SCHEDULE_KEY, n as TEXTING_ASK_SNOOZE_MS, o as TEXTING_BRAND_COPY, p as TEXTING_CODE_PATTERN, q as TEXTING_COPY, r as TEXTING_COPY_PLACEHOLDERS, s as TEXTING_UI_CODE_LENGTH, t as TextingAction, u as TextingAskDue, v as TextingAskDueInput, w as TextingAskEntry, x as TextingAskIdentity, y as TextingAskOptions, z as TextingAskScheduleRead, A as TextingAskStage, B as TextingAskThreadMessage, D as TextingAskThreadState, F as TextingCodeRefusal, G as TextingController, H as TextingPhase, I as TextingRepository, J as TextingRepositoryDeps, K as TextingRuntime, L as TextingSnapshot, M as createTextingRepository, N as createTextingRepositoryOver, O as formatTextingPhone, P as isE164, Q as isTextingAskEligible, R as parseTextingProfile, S as resolveTextingAskDue, U as textingAskThreadReady, V as textingErrorText, W as textingIdentityFromWire, X as textingInputProblemText, Y as textingOptedOutBody, Z as textingReasonOf, _ as textingSupportText, $ as toTextingE164, a0 as useEverfurTexting, a1 as useEverfurTextingProfile, a2 as useEverfurTextingRepository, a3 as useTextingAsk, a4 as validateTextingCode, a5 as validateTextingEnroll } from '../../optInView.d-ByDJMrMv.cjs';
6
+ import { E as EverfurTextingViewStatus, T as TextingCopy, a as TextingBrandCopy, b as TextingAsk } from '../../optInView.d-ChJyJMBA.cjs';
7
+ export { C as COPY_PLACEHOLDER_PREFIX, c as EVERFUR_TEXTING_STATUSES, d as EverfurTextingChallenge, e as EverfurTextingIdentity, f as EverfurTextingInputProblem, g as EverfurTextingProfile, h as EverfurTextingReason, i as EverfurTextingState, j as EverfurTextingStatus, k as EverfurTextingVerificationInput, l as TEXTING_ASK_MAX_ASKS, m as TEXTING_ASK_SCHEDULE_KEY, n as TEXTING_ASK_SNOOZE_MS, o as TEXTING_BRAND_COPY, p as TEXTING_CODE_PATTERN, q as TEXTING_COPY, r as TEXTING_COPY_PLACEHOLDERS, s as TEXTING_UI_CODE_LENGTH, t as TextingAction, u as TextingAskDue, v as TextingAskDueInput, w as TextingAskEntry, x as TextingAskIdentity, y as TextingAskOptions, z as TextingAskScheduleRead, A as TextingAskStage, B as TextingAskThreadMessage, D as TextingAskThreadState, F as TextingCodeRefusal, G as TextingController, H as TextingPhase, I as TextingRepository, J as TextingRepositoryDeps, K as TextingRuntime, L as TextingSnapshot, M as createTextingRepository, N as createTextingRepositoryOver, O as formatTextingPhone, P as isE164, Q as isTextingAskEligible, R as parseTextingProfile, S as resolveTextingAskDue, U as textingAskThreadReady, V as textingErrorText, W as textingIdentityFromWire, X as textingInputProblemText, Y as textingOptedOutBody, Z as textingReasonOf, _ as textingSupportText, $ as toTextingE164, a0 as useEverfurTexting, a1 as useEverfurTextingProfile, a2 as useEverfurTextingRepository, a3 as useTextingAsk, a4 as validateTextingCode, a5 as validateTextingEnroll } from '../../optInView.d-ChJyJMBA.cjs';
8
8
  export { a as AnonIdentityProvider, A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity.d-DDpXOtas.cjs';
9
9
  export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, h as FreeCapRefusal, H as HeartbeatFrame, i as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, j as UrgencyLevel } from '../../config.d-ClAI2RZ6.cjs';
10
10
  export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../../ids.d-B2GAAifq.cjs';
@@ -3,8 +3,8 @@ import { ReactNode, CSSProperties } from 'react';
3
3
  import { a as CapabilityDecision } from '../../resolve.d-BTC3b6FW.js';
4
4
  import { E as EverfurError } from '../../EverfurError.d-8NHtlgzA.js';
5
5
  export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.js';
6
- import { E as EverfurTextingViewStatus, T as TextingCopy, a as TextingBrandCopy, b as TextingAsk } from '../../optInView.d-DVshLxbD.js';
7
- export { C as COPY_PLACEHOLDER_PREFIX, c as EVERFUR_TEXTING_STATUSES, d as EverfurTextingChallenge, e as EverfurTextingIdentity, f as EverfurTextingInputProblem, g as EverfurTextingProfile, h as EverfurTextingReason, i as EverfurTextingState, j as EverfurTextingStatus, k as EverfurTextingVerificationInput, l as TEXTING_ASK_MAX_ASKS, m as TEXTING_ASK_SCHEDULE_KEY, n as TEXTING_ASK_SNOOZE_MS, o as TEXTING_BRAND_COPY, p as TEXTING_CODE_PATTERN, q as TEXTING_COPY, r as TEXTING_COPY_PLACEHOLDERS, s as TEXTING_UI_CODE_LENGTH, t as TextingAction, u as TextingAskDue, v as TextingAskDueInput, w as TextingAskEntry, x as TextingAskIdentity, y as TextingAskOptions, z as TextingAskScheduleRead, A as TextingAskStage, B as TextingAskThreadMessage, D as TextingAskThreadState, F as TextingCodeRefusal, G as TextingController, H as TextingPhase, I as TextingRepository, J as TextingRepositoryDeps, K as TextingRuntime, L as TextingSnapshot, M as createTextingRepository, N as createTextingRepositoryOver, O as formatTextingPhone, P as isE164, Q as isTextingAskEligible, R as parseTextingProfile, S as resolveTextingAskDue, U as textingAskThreadReady, V as textingErrorText, W as textingIdentityFromWire, X as textingInputProblemText, Y as textingOptedOutBody, Z as textingReasonOf, _ as textingSupportText, $ as toTextingE164, a0 as useEverfurTexting, a1 as useEverfurTextingProfile, a2 as useEverfurTextingRepository, a3 as useTextingAsk, a4 as validateTextingCode, a5 as validateTextingEnroll } from '../../optInView.d-DVshLxbD.js';
6
+ import { E as EverfurTextingViewStatus, T as TextingCopy, a as TextingBrandCopy, b as TextingAsk } from '../../optInView.d-Cps7aLQN.js';
7
+ export { C as COPY_PLACEHOLDER_PREFIX, c as EVERFUR_TEXTING_STATUSES, d as EverfurTextingChallenge, e as EverfurTextingIdentity, f as EverfurTextingInputProblem, g as EverfurTextingProfile, h as EverfurTextingReason, i as EverfurTextingState, j as EverfurTextingStatus, k as EverfurTextingVerificationInput, l as TEXTING_ASK_MAX_ASKS, m as TEXTING_ASK_SCHEDULE_KEY, n as TEXTING_ASK_SNOOZE_MS, o as TEXTING_BRAND_COPY, p as TEXTING_CODE_PATTERN, q as TEXTING_COPY, r as TEXTING_COPY_PLACEHOLDERS, s as TEXTING_UI_CODE_LENGTH, t as TextingAction, u as TextingAskDue, v as TextingAskDueInput, w as TextingAskEntry, x as TextingAskIdentity, y as TextingAskOptions, z as TextingAskScheduleRead, A as TextingAskStage, B as TextingAskThreadMessage, D as TextingAskThreadState, F as TextingCodeRefusal, G as TextingController, H as TextingPhase, I as TextingRepository, J as TextingRepositoryDeps, K as TextingRuntime, L as TextingSnapshot, M as createTextingRepository, N as createTextingRepositoryOver, O as formatTextingPhone, P as isE164, Q as isTextingAskEligible, R as parseTextingProfile, S as resolveTextingAskDue, U as textingAskThreadReady, V as textingErrorText, W as textingIdentityFromWire, X as textingInputProblemText, Y as textingOptedOutBody, Z as textingReasonOf, _ as textingSupportText, $ as toTextingE164, a0 as useEverfurTexting, a1 as useEverfurTextingProfile, a2 as useEverfurTextingRepository, a3 as useTextingAsk, a4 as validateTextingCode, a5 as validateTextingEnroll } from '../../optInView.d-Cps7aLQN.js';
8
8
  export { a as AnonIdentityProvider, A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity.d-D4VtpqRr.js';
9
9
  export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, h as FreeCapRefusal, H as HeartbeatFrame, i as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, j as UrgencyLevel } from '../../config.d-B7Z-KTGq.js';
10
10
  export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../../ids.d-B2GAAifq.js';
@@ -17,9 +17,9 @@ return Object.freeze({reason:userFacingError("accessDenied"),level:"user_entitle
17
17
  return c("div",{role:"status","aria-busy":"true","aria-label":`Loading ${t}`,className:n,style:{...o.offstate,...r},children:/* @__PURE__ */c("div",{style:o.skeletonBar})})}function OffState({decision:t,style:r,className:n}){let i=useEverfurTheme(),o=e(()=>Kr(i),[i]),a=t.disabled?.reason??"";/* @__PURE__ */
18
18
  return c("div",{className:n,style:{...o.offstate,...r},children:a.length>0?/* @__PURE__ */c("p",{style:o.offstateText,children:a}):null})}function Kr(e){let{color:t,space:r,radius:n,type:i}=e;return{offstate:{...qr,boxSizing:"border-box",minHeight:Vr,display:"flex",flexDirection:"column",justifyContent:"center",padding:`${r.md}px ${r.lg}px`,backgroundColor:t.surfaceCream,borderRadius:n.md,border:`1px solid ${t.brandBorder}`},offstateText:{margin:0,...faceCss(e,"regular"),fontSize:i.size.body,lineHeight:`${Math.round(i.size.body*i.lineHeight.normal)}px`,color:t.text.muted},skeletonBar:{height:r.md,borderRadius:n.xs,backgroundColor:t.brandSofter}}}function Wr(e,t){if(e===void 0)return{};let r={};return e.backgroundColor!==void 0&&(r.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(r.borderColor=e.borderColor,r.borderWidth=t??1),e.borderRadius!==void 0&&(r.borderRadius=e.borderRadius),r}function Gr(e){return e?.textColor===void 0?{}:{color:e.textColor}}function Qr(e,t){let r=Wr(e,t),n={};return r.backgroundColor!==void 0&&(n.backgroundColor=r.backgroundColor),r.borderColor!==void 0&&(n.border=`${r.borderWidth??1}px solid ${r.borderColor}`),r.borderRadius!==void 0&&(n.borderRadius=r.borderRadius),n}function Jr(e,t){return{...Qr(e,t),...Gr(e)}}function EverfurTextingOptIn(t){let r=m(t,["onStatusChange"]),n=e(()=>({copy:Rt(t.copy),brandCopy:Dt(t.brandCopy)}),[t.copy,t.brandCopy]),{copy:i,brandCopy:o}=n,a=useEverfurTheme(),l=e(()=>Xr(a),[a]),s=useEverfurTexting();return s.status==="signedOut"?/* @__PURE__ */u("section",{className:r.className,style:{...l.card,...r.style},children:[
19
19
  /* @__PURE__ */c("h2",{style:l.title,children:o.introTitle(a.meta.displayName)}),
20
- /* @__PURE__ */c("p",{style:l.body,children:i.signedOut})]}):/* @__PURE__ */c(CapabilityGate,{capability:"texting",...r.renderDisabled?{renderDisabled:r.renderDisabled}:{},style:r.style,className:r.className,children:/* @__PURE__ */c(zt.Provider,{value:n,children:/* @__PURE__ */c(OptInBody,{...r,texting:s,styles:l})})})}function OptInBody({texting:e,styles:t,onStatusChange:n,renderNotice:i,style:l,className:s}){let{copy:d,brandCopy:f}=Nt(),h=useEverfurTheme(),b=o(),{status:y,profile:g,snapshot:m}=e,v=g?.brandName??h.meta.displayName,[_,w]=a(""),[C,S]=a(false),[k,x]=a(""),[E,F]=a(null),[T,O]=a(false),[I,A]=a(""),[R,D]=a(false);r(()=>{n?.(y)},[n,y]),r(()=>{F(null),O(false)},[y]);let z=(e,r=false)=>/* @__PURE__ */c("section",{className:s,style:{...t.card,...l},"aria-busy":r?"true":void 0,children:e}),N=(e,r)=>{let n=textingErrorText(e,m.failedAction,m.codeRefusal,d),o=textingSupportText(e,d);/* @__PURE__ */
20
+ /* @__PURE__ */c("p",{style:l.body,children:i.signedOut})]}):/* @__PURE__ */c(CapabilityGate,{capability:"texting",...r.renderDisabled?{renderDisabled:r.renderDisabled}:{},style:r.style,className:r.className,children:/* @__PURE__ */c(zt.Provider,{value:n,children:/* @__PURE__ */c(OptInBody,{...r,texting:s,styles:l})})})}function OptInBody({texting:e,styles:t,onStatusChange:n,renderNotice:i,style:l,className:s}){let{copy:d,brandCopy:f}=Nt(),h=useEverfurTheme(),b=o(),{status:y,profile:g,snapshot:m}=e,v=g?.brandName??h.meta.displayName,[_,w]=a(""),[C,S]=a(false),[k,x]=a(""),[E,F]=a(null),[T,O]=a(false),[I,A]=a(""),[R,D]=a(false);r(()=>{n?.(y)},[n,y]),r(()=>{F(null),O(false)},[y]);let z=(e,r=false)=>/* @__PURE__ */c("section",{className:s,style:{...t.card,...l},"aria-busy":r?"true":void 0,children:e}),N=(e,r)=>{let n=textingErrorText(e,m.failedAction,m.codeRefusal,d);/* @__PURE__ */
21
21
  return u("div",{style:t.notice,role:"alert",children:[
22
- /* @__PURE__ */c(HostRender,{resetKey:e,render:()=>i?i(e):/* @__PURE__ */c("p",{style:t.noticeText,children:n}),fallback:/* @__PURE__ */c("p",{style:t.noticeText,children:n})}),o===null?null:/* @__PURE__ */c("p",{style:t.footnote,children:o}),r===void 0?null:/* @__PURE__ */c("button",{type:"button",onClick:r,style:t.link,children:d.retry})]})};if(y==="unavailable")return z(
22
+ /* @__PURE__ */c(HostRender,{resetKey:e,render:()=>i?i(e):/* @__PURE__ */c("p",{style:t.noticeText,children:n}),fallback:/* @__PURE__ */c("p",{style:t.noticeText,children:n})}),r===void 0?null:/* @__PURE__ */c("button",{type:"button",onClick:r,style:t.link,children:d.retry})]})};if(y==="unavailable")return z(
23
23
  /* @__PURE__ */u(p,{children:[
24
24
  /* @__PURE__ */c("h2",{style:t.title,children:d.unavailableTitle}),
25
25
  /* @__PURE__ */c("p",{style:t.body,children:d.unavailableBody})]}));if(g===null)return null;if(y==="loading")/* @__PURE__ */
@@ -63,8 +63,7 @@ return u("div",{style:e.petRow,children:[
63
63
  /* @__PURE__ */u("select",{id:`${d}-pet`,value:f,disabled:n,onChange:e=>a(e.currentTarget.value),style:e.input,children:[f===""?/* @__PURE__ */c("option",{value:"",children:s.noPetSelected}):null,p.map(e=>/* @__PURE__ */c("option",{value:e.petRef,children:e.name??e.petRef},e.petRef))]}),
64
64
  /* @__PURE__ */u("div",{style:e.links,children:[
65
65
  /* @__PURE__ */c("button",{type:"button",disabled:!h||n,"aria-busy":n?"true":void 0,onClick:()=>l(f),style:e.secondary,children:n?s.savingPet:s.savePet}),i&&!h?/* @__PURE__ */c("p",{style:e.footnote,role:"status",children:s.petSaved}):null]})]})}function Xr(e){let{color:t,radius:r,space:n,type:i,slots:o}=e,a=e=>`${Math.round(e*i.lineHeight.snug)}px`,l=(t,r,n)=>({margin:0,...faceCss(e,n),fontSize:t,lineHeight:a(t),color:r}),s=o.card?.textColor;return{card:{boxSizing:"border-box",display:"flex",flexDirection:"column",gap:n.md,padding:n.lg,borderRadius:r.lg,border:`1px solid ${t.brandBorder}`,backgroundColor:t.surface,...Jr(o.card,1)},title:l(i.size.subtitle,s??t.text.primary,"bold"),subtitle:l(i.size.body,s??t.text.primary,"bold"),body:l(i.size.body,s??t.text.secondary,"regular"),footnote:l(i.size.caption,t.text.muted,"regular"),phone:l(i.size.body,s??t.text.primary,"bold"),label:l(i.size.caption,s??t.text.primary,"bold"),input:{boxSizing:"border-box",width:"100%",minHeight:44,padding:`0 ${n.md}px`,borderRadius:r.md,border:`1px solid ${t.controlEdge}`,backgroundColor:t.surface,...faceCss(e,"regular"),fontSize:i.size.body,color:t.text.primary,...Jr(o.input,1)},consentRow:{display:"flex",alignItems:"flex-start",gap:n.sm,cursor:"pointer"},box:{width:24,height:24,minWidth:24,margin:0,accentColor:t.brand,cursor:"pointer"},consentText:{...l(i.size.caption,s??t.text.secondary,"regular"),whiteSpace:"pre-wrap"},primary:{minHeight:44,padding:`0 ${n.lg}px`,borderRadius:r.pill,border:"none",backgroundColor:t.brand,color:t.text.onBrand,cursor:"pointer",...faceCss(e,"bold"),fontSize:i.size.body,...Jr(o.primaryButton)},secondary:{minHeight:44,padding:`0 ${n.lg}px`,borderRadius:r.pill,border:`1px solid ${t.brandBorder}`,backgroundColor:t.surface,color:t.brandInk,cursor:"pointer",...faceCss(e,"bold"),fontSize:i.size.caption},link:{alignSelf:"flex-start",minHeight:44,padding:0,border:"none",background:"none",cursor:"pointer",...faceCss(e,"bold"),fontSize:i.size.caption,color:t.linkInk,...Jr(o.link)},links:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:n.md},notice:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:n.xs},noticeText:l(i.size.caption,t.errorRed,"regular"),confirm:{display:"flex",flexDirection:"column",gap:n.sm,padding:n.md,borderRadius:r.md,backgroundColor:t.surfaceSubtle},petRow:{display:"flex",flexDirection:"column",gap:n.xs},skeleton:{height:96,borderRadius:r.md,backgroundColor:t.skeleton}}}var Zr=/* @__PURE__ */Symbol.for("@everfur/sdk#IntroOpen@v1"),en=globalThis;function tn(e){if(typeof e!="object"||e===null)return false;let t=e;return t.holds instanceof Set&&t.listeners instanceof Set}var rn=en[Zr],nn=()=>({holds:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set}),on=tn(rn)?rn:en[Zr]=nn();function an(){return on.holds.size>0}function ln(e){return on.listeners.add(e),()=>{on.listeners.delete(e)}}function sn(){return n(ln,an,an)}function resolveTextingAskDue(e){let t=e.enabled&&e.capabilityGranted&&e.hasProfile&&e.signedIn&&e.scheduleEligible&&!e.offeredThisSession,r=t&&e.identity==="none"&&e.surfaceReady;return{readEnabled:t,due:r}}var dn=/* @__PURE__ */new Set(["emergency","schedule_soon"]);function textingAskThreadReady(e){if(e.isBootstrapping===true||e.isLoadingHistory===true||e.isStreaming===true||e.status==="error"||e.stopped===true)return false;let t=e.messages[e.messages.length-1];return t===void 0||t.role!=="assistant"||t.pending===true||t.checkin!==void 0||t.text.trim().length===0?false:!(typeof t.urgencyLevel=="string"&&dn.has(t.urgencyLevel))}var un=/* @__PURE__ */new WeakSet;function cn(e){return un.has(e)}var pn="everfur.texting.askSchedule.v1",fn=2880*60*1e3,hn=3,bn=/* @__PURE__ */Object.freeze({askCount:0,nextAskAt:null,completed:false});function isTextingAskEligible(e,t){if(e.status!=="ok")return false;let{entry:r}=e;return r.completed||r.askCount>=hn?false:r.nextAskAt===null||t>=r.nextAskAt}function yn(e,t){return{askCount:Math.min(e.askCount+1,hn),nextAskAt:t+fn,completed:e.completed}}function gn(e,t){return{...e,nextAskAt:t+fn}}function mn(e){return{...e,completed:true}}function vn(e){return e.askCount<=0?1:e.askCount===1?2:3}function _n(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=e,{askCount:r,nextAskAt:n,completed:i}=t;return typeof r!="number"||!Number.isInteger(r)||r<0||n!==null&&(typeof n!="number"||!Number.isFinite(n))||typeof i!="boolean"?null:{askCount:Math.min(r,hn),nextAskAt:n,completed:i}}function wn(e){let t;try{t=JSON.parse(e)}catch{return null}if(t===null||typeof t!="object"||Array.isArray(t))return null;let r={};for(let[e,n]of Object.entries(t)){let t=_n(n);if(t===null)return null;r[e]=t}return r}var Cn=/* @__PURE__ */Symbol.for("@everfur/sdk/texting/ask-schedule@v1");function Sn(){let e=globalThis,t=e[Cn];return t===void 0&&(t={sessions:/* @__PURE__ */new Map,sessionListeners:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set,writeChain:Promise.resolve()},e[Cn]=t),t.sessionListeners===void 0&&(t.sessionListeners=/* @__PURE__ */new Set),t}async function kn(e){if(cn(e))return{status:"unreadable"};let t;try{t=await e.getItem(pn)}catch{return{status:"unreadable"}}if(t===null)try{return await e.setItem(pn,"{}"),await e.getItem(pn)===null?{status:"unreadable"}:{status:"ok",map:{}}}catch{return{status:"unreadable"}}let r=wn(t);if(r!==null)return{status:"ok",map:r};try{await e.removeItem(pn)}catch{}return{status:"unreadable"}}function xn(e){let{listeners:t}=Sn();return t.add(e),()=>{t.delete(e)}}function En(e,userRef,t){let r=Sn(),n=async()=>{let n=await kn(e);if(n.status!=="ok")return;let i=n.map[userRef]??bn;try{await e.setItem(pn,JSON.stringify({...n.map,[userRef]:t(i)}))}catch{return}for(let e of[...r.listeners])e()},i=r.writeChain.then(n,n);return r.writeChain=i.catch(()=>{}),i}async function Fn(e,userRef){let t=await kn(e);return t.status!=="ok"?{status:"unreadable"}:{status:"ok",entry:t.map[userRef]??bn}}function Tn(e,userRef,t=Date.now()){return En(e,userRef,e=>yn(e,t))}function On(e,userRef,t=Date.now()){return En(e,userRef,e=>gn(e,t))}function In(e,userRef){return En(e,userRef,mn)}function An(userRef){return Sn().sessions.get(userRef)??null}function Rn(userRef,e){let t=Sn();t.sessions.set(userRef,e);for(let e of[...t.sessionListeners])e()}function Dn(e){let{sessionListeners:t}=Sn();return t.add(e),()=>{t.delete(e)}}var NO_SNAPSHOT=()=>null;function zn(){let{runtime:t}=Ft(),r=t.entitlements??null,o=i(e=>r===null?()=>{}:r.subscribe(e),[r]),a=r===null?NO_SNAPSHOT:r.getSnapshot,l=n(o,a,a);return e(()=>l!==null&&decideCapability("texting",l.decisions,{isPending:l.isPending}).enabled,[l])}var Nn=/* @__PURE__ */Object.freeze({status:"idle"});function Pn(userRef){let{runtime:e}=Ft(),t=e.registry.services.kv,[n,i]=a({user:null,value:Nn});return r(()=>{if(userRef===null)return;let e=true,r=()=>{Fn(t,userRef).then(t=>{e&&i({user:userRef,value:{status:"ready",read:t}})})};r();let n=xn(r);return()=>{e=false,n()}},[t,userRef]),n.user===userRef?n.value:Nn}function jn(e){switch(e.status){case"enroll":case"requesting":case"code":case"confirming":return"none";case"verified":case"optingOut":case"optedOut":return"exists";default:return"unknown"}}function useTextingAsk(t={}){let o=t.enabled!==false,l=t.ready!==false,s=t.surface??"prompt",d=t.entry===true,{runtime:u,userRef:userRef}=Ft(),c=u.registry.services.kv,p=zn(),f=Pn(o&&userRef!==null?userRef:null),h=i(()=>userRef===null?null:An(userRef),[userRef]),b=n(Dn,h,h),y=i(e=>{userRef!==null&&Rn(userRef,e)},[userRef]),g=b!==null&&b.surface===s,m=b!==null&&b.fromPrompt===true,v=g?b.stage==="handoff"?"hidden":b.stage:s==="prompt"&&m?"dismissed":"hidden",_=Date.now(),w=f.status==="ready"&&isTextingAskEligible(f.read,_),[C,S]=a(null),k=d&&userRef!==null&&p,x=sr(userRef!==null&&C===userRef||v!=="hidden"||g||k),E=jn(x),{readEnabled:F,due:T}=resolveTextingAskDue({enabled:o,capabilityGranted:p,hasProfile:x.profile!==null,signedIn:userRef!==null,scheduleEligible:w,offeredThisSession:b!==null,identity:E,surfaceReady:l});r(()=>{F&&userRef!==null&&S(userRef)},[F,userRef]);let O=b?.askNumber??(f.status==="ready"&&f.read.status==="ok"?vn(f.read.entry):1);r(()=>{!T||userRef===null||An(userRef)!==null||y({surface:s,stage:"offered",answered:false,askNumber:O})},[T,userRef,y,O,s]),r(()=>{!g||b.stage!=="handoff"||o&&l&&p&&x.profile!==null&&E==="none"&&y({...b,stage:"offered"})},[g,b,o,l,p,x.profile,E,y]);let I=f.status==="ready"&&f.read.status==="ok"&&f.read.entry.completed;r(()=>{userRef===null||E!=="exists"||I||f.status!=="ready"||In(c,userRef)},[E,I,f.status,c,userRef]),r(()=>{g&&b.stage==="enrolling"&&x.status==="verified"&&y({...b,stage:"verified"})},[g,b,x.status,y]);let A=i(e=>userRef===null||e.answered?e:(Tn(c,userRef),{...e,answered:true}),[c,userRef]),R=i(()=>{g&&b.stage==="offered"&&y({...b,stage:"enrolling"})},[g,b,y]),D=i(()=>{if(!g||b.stage!=="enrolling")return;let{back:e,...t}=b;y({...t,stage:e??"offered"})},[g,b,y]),z=i(()=>{if(!(!g||b.stage!=="offered"&&b.stage!=="enrolling")){if(s==="prompt"){y({...A(b),surface:"chat",stage:"handoff",fromPrompt:true});return}b.fromPrompt===true&&b.answered&&userRef!==null&&On(c,userRef),y({...A(b),stage:"dismissed"})}},[g,b,s,y,A,c,userRef]),{start:N}=x,P=i(async e=>!g||b.stage!=="enrolling"?false:(b.answered||y(A(b)),N(e)),[g,b,y,A,N]),j=k&&x.profile!==null&&E==="none"&&v!=="enrolling"&&v!=="verified",M=i(()=>{if(!j||userRef===null)return;let e=g?b:null;y({surface:s,stage:"enrolling",answered:e?.answered??false,askNumber:b?.askNumber??O,...e?.fromPrompt===true?{fromPrompt:true}:{},back:e?.stage==="offered"?"offered":"dismissed"})},[j,userRef,g,b,y,s,O]),L=x.profile?.brandName??"";return e(()=>({stage:userRef===null?"hidden":v,brand:L,askNumber:O,texting:x,accept:R,dismiss:z,close:D,start:P,canOpen:j,open:M}),[userRef,v,L,O,x,R,z,D,P,j,M])}var Mn=/* @__PURE__ */new Set(["signedOut","unavailable","failed","verified","optingOut","optedOut"]);function Ln(e,n,i,o){let{userRef:userRef}=Ft(),a=t(null),{canOpen:l,open:s,stage:d,texting:u}=e;r(()=>{if(!n){a.current=null;return}if(!(userRef===null||a.current===userRef)){if(l){a.current=userRef,s();return}if(d==="enrolling"||d==="verified"){a.current=userRef;return}(!i||Mn.has(u.status))&&(a.current=userRef,b(o,"skipped"))}},[n,userRef,l,s,d,u.status,i,o])}var qn='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])';function $n(e){return e.tagName==="DIALOG"}function Bn(e){if(typeof document>"u")return null;let t=e?.getRootNode();return t&&t!==document&&"activeElement"in t?t.activeElement:document.activeElement}function Un(e,n,o,a){let l=a?.escapeAtKeyDown===true,s=t(null),d=t(false),u=t(null),c=t(o);c.current=o;let p=i(()=>{if(!d.current)return;d.current=false;let e=c.current===void 0?u.current:c.current.current;e&&e.isConnected&&e.focus(),(!e||!e.isConnected||Bn(e)===e)&&(u.current=null)},[]);r(()=>{if(!e){p();return}let t=s.current;if(!d.current){let e=Bn(t);e!==null&&t!==null&&t.contains(e)||(u.current=e instanceof HTMLElement?e:null)}if(d.current=true,t===null)return;if(!$n(t)){t.contains(Bn(t))||(t.querySelector(qn)??t).focus();return}let r=t;typeof r.showModal=="function"?r.open||r.showModal():r.setAttribute("open","")},[e,p]),r(()=>p,[p]),r(()=>{let t=s.current;if(!e||t===null||!$n(t))return;let r=t;if(typeof r.showModal!="function")return;let n=null,i=e=>{e.target instanceof HTMLElement&&(n=e.target)},o=()=>{if(!r.isConnected||r.open)return;let e=n;r.showModal(),e!==null&&e.isConnected&&r.contains(e)&&Bn(r)!==e&&e.focus()};return r.addEventListener("focusin",i),r.addEventListener("close",o),()=>{r.removeEventListener("focusin",i),r.removeEventListener("close",o)}},[e]);let f=i(e=>{let t=s.current;if(t===null)return;if(e.key==="Escape"&&!$n(t)){e.preventDefault(),e.stopPropagation(),n();return}if(e.key==="Escape"&&l);if(e.key!=="Tab")return;let r=Array.from(t.querySelectorAll(qn)),i=r[0],o=r[r.length-1];if(!i||!o){e.preventDefault();return}let a=Bn(t);e.shiftKey&&(a===i||!t.contains(a))?(e.preventDefault(),o.focus()):!e.shiftKey&&(a===o||!t.contains(a))&&(e.preventDefault(),i.focus())},[n,l]),h=i(e=>{e.target===e.currentTarget&&(e.preventDefault(),n())},[n]);return{dialogRef:s,onKeyDown:f,onCancel:h}}var Hn=2,Vn="data-ef-focus-ring";function ChatTextingAskController({enabled:e,ready:t,onAsk:n,entry:i=false}){let o=useTextingAsk({enabled:e,ready:t,surface:"chat",entry:i});return r(()=>{b(n,o)},[o,n]),null}function textingAskLines(e){return{line:It.chatAskLine(e.brand),accept:Ot.promptAccept,dismiss:Ot.promptDismiss,verified:It.chatAskVerified(e.brand)}}function ChatTextingAskComposer({ask:t}){let r=useEverfurTheme(),n=e(()=>Yn(r),[r]);/* @__PURE__ */
66
- return c(AskEntry,{ask:t,styles:n})}function AskEntry({ask:e,styles:n}){let i=o(),{texting:l}=e,{status:s,profile:d,snapshot:p}=l,[f,h]=a(""),[b,y]=a(false),[g,m]=a(""),[v,_]=a(null),w=t(null),C=t(null),[S,k]=a(false),x={[Vn]:"self",onFocus:()=>k(true),onBlur:()=>k(false)},E=S?{...n.pill,...n.pillFocused}:n.pill,F=s==="enroll"||s==="requesting"&&!p.resending,T=s==="code"||s==="confirming"||s==="requesting";r(()=>{_(null)},[s]),r(()=>{F?w.current?.focus():T&&C.current?.focus()},[F,T]);let O=/* @__PURE__ */c("button",{type:"button","aria-label":Ot.close,onClick:e.close,style:n.close,children:/* @__PURE__ */c("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */c("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",fill:"none"})})}),I=p.error===null?null:/* @__PURE__ */u("div",{role:"alert",style:n.notice,children:[
67
- /* @__PURE__ */c("p",{style:n.noticeText,children:textingErrorText(p.error,p.failedAction,p.codeRefusal)}),textingSupportText(p.error)===null?null:/* @__PURE__ */c("p",{style:n.footnote,children:textingSupportText(p.error)})]}),A=v===null?null:/* @__PURE__ */c("p",{role:"alert",style:n.noticeText,children:textingInputProblemText(v)});if(d===null)return null;if(s==="loading"||s==="failed"||s==="signedOut"||s==="unavailable")/* @__PURE__ */
66
+ return c(AskEntry,{ask:t,styles:n})}function AskEntry({ask:e,styles:n}){let i=o(),{texting:l}=e,{status:s,profile:d,snapshot:p}=l,[f,h]=a(""),[b,y]=a(false),[g,m]=a(""),[v,_]=a(null),w=t(null),C=t(null),[S,k]=a(false),x={[Vn]:"self",onFocus:()=>k(true),onBlur:()=>k(false)},E=S?{...n.pill,...n.pillFocused}:n.pill,F=s==="enroll"||s==="requesting"&&!p.resending,T=s==="code"||s==="confirming"||s==="requesting";r(()=>{_(null)},[s]),r(()=>{F?w.current?.focus():T&&C.current?.focus()},[F,T]);let O=/* @__PURE__ */c("button",{type:"button","aria-label":Ot.close,onClick:e.close,style:n.close,children:/* @__PURE__ */c("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */c("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",fill:"none"})})}),I=p.error===null?null:/* @__PURE__ */c("div",{role:"alert",style:n.notice,children:/* @__PURE__ */c("p",{style:n.noticeText,children:textingErrorText(p.error,p.failedAction,p.codeRefusal)})}),A=v===null?null:/* @__PURE__ */c("p",{role:"alert",style:n.noticeText,children:textingInputProblemText(v)});if(d===null)return null;if(s==="loading"||s==="failed"||s==="signedOut"||s==="unavailable")/* @__PURE__ */
68
67
  return c("div",{style:n.root,"data-everfur-texting-ask":"entry","aria-busy":s==="loading"?"true":void 0,children:/* @__PURE__ */u("div",{style:n.head,children:[
69
68
  /* @__PURE__ */c("div",{style:n.headBody,children:s==="failed"?I:null}),O]})});if(F){let t=s==="requesting",r=()=>{let t=validateTextingEnroll(f,b);_(t),t===null&&e.start(f)};/* @__PURE__ */
70
69
  return u("div",{style:n.root,"data-everfur-texting-ask":"phone",children:[
@@ -125,4 +125,4 @@ return t.jsx(jt,{ref:i,...e})}function PriceSummary3(e){/* @__PURE__ */
125
125
  return t.jsx(BlockScope,{children:/* @__PURE__ */t.jsx(PriceSummaryBody,{...e})})}function PriceSummaryBody(e){let i=ln(gn);/* @__PURE__ */
126
126
  return t.jsx(St,{ref:i,...e})}function ProductTile3(e){return fn(),/* @__PURE__ */t.jsx(BlockScope,{children:/* @__PURE__ */t.jsx(ProductTileBody,{...e})})}function ProductTileBody(e){let i=ln(hn);/* @__PURE__ */
127
127
  return t.jsx(Nt,{ref:i,...e})}function TipCard3(e){return fn(),/* @__PURE__ */t.jsx(BlockScope,{children:/* @__PURE__ */t.jsx(TipCardBody,{...e})})}function TipCardBody(e){let i=ln(bn);/* @__PURE__ */
128
- return t.jsx(Dt,{ref:i,...e})}var vn="1.5.1";var wn=/* @__PURE__ */Object.freeze({k1:"X4wc1hwVONs4I9Vmclo9ExrfPZlH8-tgY7NmzxuA5lI"});function xn(e,t){let i=Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join(",");return`v${1}|${e}|${i}`}var yn=xn(vn,wn);var kn=/* @__PURE__ */Symbol.for(`@everfur/sdk#WebRuntimeRenderer@${yn}`),_n=globalThis;function zn(t,i){let r=_n[kn];return r===void 0?e.createElement(t.bundled,i):r(t,i)}var jn=(e,t)=>({part:"ui",name:e,bundled:t,wait:"bundled"}),Fn=jn("CartLine",CartLine3),Sn=jn("OrderRow",OrderRow3),Cn=jn("PlanNeedCard",PlanNeedCard3),Ln=jn("PriceSummary",PriceSummary3),Tn=jn("ProductTile",ProductTile3),Hn=jn("TipCard",TipCard3);function CartLine4(e){return zn(Fn,e)}function OrderRow4(e){return zn(Sn,e)}function PlanNeedCard4(e){return zn(Cn,e)}function PriceSummary4(e){return zn(Ln,e)}function ProductTile4(e){return zn(Tn,e)}function TipCard4(e){return zn(Hn,e)}exports.CartLine=CartLine4;exports.OrderRow=OrderRow4;exports.PlanNeedCard=PlanNeedCard4;exports.PriceSummary=PriceSummary4;exports.ProductTile=ProductTile4;exports.TipCard=TipCard4;
128
+ return t.jsx(Dt,{ref:i,...e})}var vn="1.5.3";var wn=/* @__PURE__ */Object.freeze({k1:"X4wc1hwVONs4I9Vmclo9ExrfPZlH8-tgY7NmzxuA5lI"});function xn(e,t){let i=Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join(",");return`v${1}|${e}|${i}`}var yn=xn(vn,wn);var kn=/* @__PURE__ */Symbol.for(`@everfur/sdk#WebRuntimeRenderer@${yn}`),_n=globalThis;function zn(t,i){let r=_n[kn];return r===void 0?e.createElement(t.bundled,i):r(t,i)}var jn=(e,t)=>({part:"ui",name:e,bundled:t,wait:"bundled"}),Fn=jn("CartLine",CartLine3),Sn=jn("OrderRow",OrderRow3),Cn=jn("PlanNeedCard",PlanNeedCard3),Ln=jn("PriceSummary",PriceSummary3),Tn=jn("ProductTile",ProductTile3),Hn=jn("TipCard",TipCard3);function CartLine4(e){return zn(Fn,e)}function OrderRow4(e){return zn(Sn,e)}function PlanNeedCard4(e){return zn(Cn,e)}function PriceSummary4(e){return zn(Ln,e)}function ProductTile4(e){return zn(Tn,e)}function TipCard4(e){return zn(Hn,e)}exports.CartLine=CartLine4;exports.OrderRow=OrderRow4;exports.PlanNeedCard=PlanNeedCard4;exports.PriceSummary=PriceSummary4;exports.ProductTile=ProductTile4;exports.TipCard=TipCard4;