@everfur/sdk 1.5.3 → 1.6.1

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 (76) hide show
  1. package/chat-cards/package.json +8 -0
  2. package/dist/{Chat.d-BCfyvzX8.d.ts → Chat.d-B4GybUU4.d.ts} +1 -1
  3. package/dist/{Chat.d-Od44h51D.d.cts → Chat.d-DPM2ncxi.d.cts} +1 -1
  4. package/dist/chat/index.cjs +174 -174
  5. package/dist/chat/index.d.cts +4 -4
  6. package/dist/chat/index.d.ts +4 -4
  7. package/dist/chat/index.js +340 -340
  8. package/dist/chat/lite/index.cjs +174 -174
  9. package/dist/chat/lite/index.d.cts +4 -4
  10. package/dist/chat/lite/index.d.ts +4 -4
  11. package/dist/chat/lite/index.js +339 -339
  12. package/dist/chat-cards/index.cjs +18 -0
  13. package/dist/chat-cards/index.d.cts +15 -0
  14. package/dist/chat-cards/index.d.ts +15 -0
  15. package/dist/chat-cards/index.js +18 -0
  16. package/dist/{chatHandoffToken.d-BjfmIxXk.d.cts → chatHandoffToken.d-Cap2z62P.d.cts} +1 -1
  17. package/dist/{chatHandoffToken.d-CFiI6IMc.d.ts → chatHandoffToken.d-zdp23Ukr.d.ts} +1 -1
  18. package/dist/{checkin.d-CokpahFL.d.ts → checkin.d-BoZXWjxX.d.ts} +8 -0
  19. package/dist/{checkin.d-BP3ZWBfX.d.cts → checkin.d-CuIUahcd.d.cts} +8 -0
  20. package/dist/{chunk-CFEHTNKX.js → chunk-CQUKIPRU.js} +1 -1
  21. package/dist/{chunk-ZGL2GEEI.js → chunk-DBQYQLJT.js} +1 -1
  22. package/dist/{chunk-OU5RMGKD.js → chunk-RF4N4WUN.js} +18 -18
  23. package/dist/{chunk-XGF2HYNN.js → chunk-ZSCVH4UW.js} +14 -14
  24. package/dist/client/index.cjs +1 -1
  25. package/dist/client/index.d.cts +1 -1
  26. package/dist/client/index.d.ts +1 -1
  27. package/dist/client/index.js +1 -1
  28. package/dist/{context.d-DS1GXUEY.d.ts → context.d-D7zX6Q0J.d.ts} +1 -1
  29. package/dist/{context.d-Bj6-xYPA.d.cts → context.d-guaLkx5t.d.cts} +1 -1
  30. package/dist/core/index.cjs +22 -22
  31. package/dist/core/index.d.cts +10 -4
  32. package/dist/core/index.d.ts +10 -4
  33. package/dist/core/index.js +31 -31
  34. package/dist/index.cjs +247 -247
  35. package/dist/index.d.cts +7 -7
  36. package/dist/index.d.ts +7 -7
  37. package/dist/index.js +364 -364
  38. package/dist/notifications/index.d.cts +3 -3
  39. package/dist/notifications/index.d.ts +3 -3
  40. package/dist/records/index.cjs +1 -1
  41. package/dist/records/index.js +1 -1
  42. package/dist/{route.d-DtuKY5dM.d.ts → route.d-B3u14HJT.d.ts} +1 -1
  43. package/dist/{route.d-Nt-r-7IO.d.cts → route.d-QBCoO62z.d.cts} +1 -1
  44. package/dist/{runtimeTypes.d-CL4l7ta4.d.cts → runtimeTypes.d-BSxuUCOX.d.cts} +1 -1
  45. package/dist/{runtimeTypes.d-BzUig75K.d.ts → runtimeTypes.d-hjN6xvxm.d.ts} +1 -1
  46. package/dist/server/events/index.cjs +1 -1
  47. package/dist/server/events/index.js +1 -1
  48. package/dist/server/index.cjs +1 -1
  49. package/dist/server/index.js +1 -1
  50. package/dist/testing/index.cjs +1 -1
  51. package/dist/testing/index.js +1 -1
  52. package/dist/testing/rn/index.d.cts +2 -2
  53. package/dist/testing/rn/index.d.ts +2 -2
  54. package/dist/testing/web/index.d.cts +2 -2
  55. package/dist/testing/web/index.d.ts +2 -2
  56. package/dist/{useUnread.d-CedFK4k6.d.ts → useUnread.d-4SbFChbd.d.ts} +30 -3
  57. package/dist/{useUnread.d-DST1GMmL.d.cts → useUnread.d-B0YhhR_D.d.cts} +30 -3
  58. package/dist/web/health-plan/index.cjs +1 -1
  59. package/dist/web/health-plan/index.js +1 -1
  60. package/dist/web/index.cjs +173 -173
  61. package/dist/web/index.d.cts +7 -7
  62. package/dist/web/index.d.ts +7 -7
  63. package/dist/web/index.js +182 -182
  64. package/dist/web/notifications/index.d.cts +2 -2
  65. package/dist/web/notifications/index.d.ts +2 -2
  66. package/dist/web/records-sheet/index.cjs +1 -1
  67. package/dist/web/records-sheet/index.js +1 -1
  68. package/dist/web/shop/index.cjs +1 -1
  69. package/dist/web/shop/index.js +1 -1
  70. package/dist/web/televet/booking/index.cjs +1 -1
  71. package/dist/web/televet/booking/index.js +1 -1
  72. package/dist/web/televet/call/index.cjs +1 -1
  73. package/dist/web/televet/call/index.js +1 -1
  74. package/dist/web/ui/index.cjs +1 -1
  75. package/dist/web/ui/index.js +41 -41
  76. package/package.json +16 -1
@@ -0,0 +1,18 @@
1
+ /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
+ import{createContext,useMemo as e,useEffect as t,createElement as r,useContext as n,Component as i,useRef as o,useState as a,useCallback as l,useSyncExternalStore as s}from"react";import{StyleSheet as d,View as c,Text as u,Platform as p,ActivityIndicator as f,Linking as g,Pressable as h,Animated as m,AccessibilityInfo as b,Easing as y}from"react-native";import{jsx as w,jsxs as v,Fragment as k}from"react/jsx-runtime";var x=/* @__PURE__ */Object.freeze({color:/* @__PURE__ */Object.freeze({efDarkGreen:"#10462E",efWhite:"#FFFFFF",efBlack:"#000000",efDustyPink:"#FFC3BC",efBrightGreen:"#07C168",efYellow:"#F2C763",efDustyBlue:"#A8B9DA",efSkyBlue:"#4E98C9",efCharcoal:"#3D3D3D",efIconHoney:"#926F06",efIconLeaf:"#16864A",efIconSky:"#1E7AB7",efIconTeal:"#05827E",efIconCocoa:"#865B3F",efIconNavy:"#223E80",efIconBerry:"#B6407F",efIconAmber:"#B25E05",efIconMoss:"#5E7E1E",efIconSlate:"#5A6087",efIconRose:"#CA4463",efRedDeep:"#6D1D14",efRedBright:"#C03410",bg:"#FFFFFF",bgBrand:"#10462E",bgAccent:"#FFC3BC",bgAccentB2b:"#A8B9DA",bgWarm:"#F2C763",text:"#000000",textBrand:"#10462E",textOnBrand:"#FFFFFF",textCta:"#07C168",textMuted:"#6B6B6B",bgMist:"#F1F5F2",border:"#E4E4E4",borderStrong:"#3D3D3D",hi:"#DAF6E8",hiStrong:"#ABEACC",hiEdge:"#0B8A4E",now:"#0C844B",alert:"#C03410",alertDeep:"#6D1D14",btnPrimaryBg:"#10462E",btnPrimaryText:"#FFFFFF",btnSecondaryBg:"rgba(0, 0, 0, 0)",btnSecondaryText:"#10462E",btnSecondaryBorder:"#10462E",mixMint:"#7FE8AE",mixLegal:"#A9C4B5",mixPromptGreen:"#BFEFD8",mixPromptYellow:"#F7DC9E",mixRx:"#E0E6F2",mixShelf:"#F3F3F3",mixEar:"#F09FA3",efBone:"#FAF9F6",efTennisBall:"#DCEF5A",efFawn:"#E8CAA4",efPine:"#12301F",efPine70:"rgba(18, 48, 31, 0.72)",efLiver:"#7A4330",efMerle:"#AEB8C1",efNose:"#E9B6A6"}),font:/* @__PURE__ */Object.freeze({family:/* @__PURE__ */Object.freeze({base:'Azeret, "Helvetica Neue", Arial, sans-serif',mono:'"Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace'}),size:/* @__PURE__ */Object.freeze({xs:13,sm:15,md:17,lg:20,xl:24,"2xl":32,"3xl":40,"4xl":56}),lineHeight:/* @__PURE__ */Object.freeze({body:1.55,display:1.15}),weight:/* @__PURE__ */Object.freeze({regular:400,medium:500,bold:700})}),space:/* @__PURE__ */Object.freeze({1:4,2:8,3:12,4:16,5:24,6:32,7:48,8:64,9:96}),radius:/* @__PURE__ */Object.freeze({sm:6,md:10,lg:20,xl:28,pill:999}),shadow:/* @__PURE__ */Object.freeze({sm:/* @__PURE__ */Object.freeze({x:0,y:1,blur:2,spread:0,color:"rgba(16, 70, 46, 0.06)"}),md:/* @__PURE__ */Object.freeze({x:0,y:4,blur:16,spread:0,color:"rgba(16, 70, 46, 0.08)"})}),layout:/* @__PURE__ */Object.freeze({container:1200,containerNarrow:720}),motion:/* @__PURE__ */Object.freeze({easing:/* @__PURE__ */Object.freeze({out:/* @__PURE__ */Object.freeze([.23,1,.32,1]),inOut:/* @__PURE__ */Object.freeze([.77,0,.175,1]),drawer:/* @__PURE__ */Object.freeze([.32,.72,0,1]),expo:/* @__PURE__ */Object.freeze([.16,1,.3,1]),bark:/* @__PURE__ */Object.freeze([.34,1.56,.64,1])}),duration:/* @__PURE__ */Object.freeze({press:160,fade:200,enter:300,sheet:420,sheetOut:240,draw:900})}),web:/* @__PURE__ */Object.freeze({serif:'Azeret, "Helvetica Neue", Arial, sans-serif',sans:'Azeret, "Helvetica Neue", Arial, sans-serif',tSmall:14,max:1312}),role:/* @__PURE__ */Object.freeze({color:/* @__PURE__ */Object.freeze({ink:"#10462E",go:"#07C168",muted:"#6B6B6B",line:"#E4E4E4",pink50:"#FFE1DE",tintSage:"#E6ECE8",tintPink:"#FFEAE8",tintPinkSoft:"#FFF6F5",tintBlue:"#EAEEF6",tintYellow:"#FCF0D6",tintYellowEdge:"#F6D892",tintRed:"#FBF1EE",tintGo:"#DCF6EA",icoGrey:"#6B6B6B",icoSage:"#819E90",icoBlue:"#4E98C9",icoWarm:"#D6D0C2",icoAmber:"#B67B3F",amberText:"#A05E32",wxSun:"#F2C763",wxSunEdge:"#D5AD47",wxCloud:"#FFFFFF",wxCloudEdge:"#DEDEDE",wxCloudDark:"#EAEAEA",wxCloudDarkEdge:"#C5C5C5",wxRain:"#75AFD5",wxSnow:"#AFD1E7",wxMist:"#D4D4D4",cwShelf:"#FFFFFF",cwShelfDeep:"#F1F4F2",cwRx:"#E0E6F2",cwRxInk:"#5A6087",cwEdgeC:"#C6D3CD",nItch:"#CA4463",nJoints:"#5E7E1E",nItchC:"#FFC3BC",nJointsC:"#D8E0C9",lvlGood:"#77DDAC",lvlOk:"#F4CF7A",lvlHot:"#DC8F7C",lvlStorm:"#8DA4BB",mapLand:"#F5F5F5",mapEdge:"#EAEAEA",mapPark:"#D7F5E7",mapWater:"#D8E0EE",mapSand:"#FCF3DD"}),size:/* @__PURE__ */Object.freeze({max:1440,gutter:16,sideW:220,cardPad:16,barH:48,tabH:58,dock:64,side:16,stackGap:12})})});var _={button:{ink:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24},go:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24},outline:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:400,lineHeight:1,iconSize:24},pink:{fill:true,minHeight:60,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:18,fontWeight:700,lineHeight:1,iconSize:24},danger:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1.55,iconSize:20},inkSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},goSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},outlineSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:400,lineHeight:1,iconSize:20},pinkSm:{fill:true,minHeight:46,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},row:{fill:false,minHeight:36,paddingX:14,gap:8,borderWidth:1.5,ring:false,fontSize:14,fontWeight:400,lineHeight:1,iconSize:17},outlineInSheetWeight:700,money:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24,bg:"pink",fg:"ink",edgeColor:"ink"},moneySm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20,bg:"pink",fg:"ink",edgeColor:"ink"},warn:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24,bg:"none",fg:"alertDeep",edgeColor:"alert"},warnSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20,bg:"none",fg:"alertDeep",edgeColor:"alert"},text:{fontSize:15,fontWeight:700,lineHeight:1.4,color:"ink",pressOpacity:.6}},pill:{minHeight:24,paddingX:10,fontSize:12,fontWeight:700,lineHeight:1,letterSpacing:.72,ring:{soon:1.25,overdue:1.25,clear:1.5,later:1.25,plain:1.5,new:1.5},plainRingAlpha:.2,dot:6,dotGap:6,allergyDot:{size:6,gap:6,color:"alert"},mono:true,upper:true,tones:{rx:{bg:"#E0E6F2",fg:"ink",ring:0,ringColor:"ink"},soon:{bg:"surface",fg:"ink",ring:1.25,ringColor:"tintYellowEdge"},overdue:{bg:"surface",fg:"alert",ring:1.25,ringColor:"alert"},clear:{bg:"surface",fg:"go",ring:1.5,ringColor:"go"},stable:{bg:"tintGo",fg:"ink",ring:0,ringColor:"ink"},later:{bg:"surface",fg:"muted",ring:1.25,ringColor:"line"},plain:{bg:"surface",fg:"ink",ring:1.5,ringColor:"ink/0.2"},new:{bg:"surface",fg:"ink",ring:1.5,ringColor:"go"},pink:{bg:"tintPink",fg:"ink",ring:0,ringColor:"ink"},watch:{bg:"#F9E6B9",fg:"ink",ring:0,ringColor:"ink"},high:{bg:"surface",fg:"alert",ring:1.25,ringColor:"alert"},allergy:{bg:"surface",fg:"alertDeep",ring:1.25,ringColor:"alert"}}},chip:{minHeight:42,paddingX:16,gap:8,borderWidth:1,fontSize:15,fontWeight:500,lineHeight:1.3},card:{padding:16,radius:20,borderWidth:1,titleSize:18,titleWeight:700,titleLineHeight:1.25,titleTracking:-.36,titleGap:12,leadSize:15,leadLineHeight:1.5,leadGap:12,headGapX:16,headGapY:8,headGap:12,bodySize:17,bodyLineHeight:1.55,ghost:{borderStyle:"dashed",borderColor:"#B9C9C2"}},sectionHeader:{gapX:12,gapY:8,marginTop:8},kicker:{fontSize:12,fontWeight:700,lineHeight:1.55,letterSpacing:.96,gap:8},quantityStepper:{borderWidth:1,borderColor:"line",ring:false,button:40,icon:18,valueMinWidth:28,offColor:"line",offOpacity:1,valueSize:17,valueWeight:700,valueLineHeight:1.55},tabs:{minHeight:44,gap:6,fontSize:15,fontWeight:500,currentWeight:700,lineHeight:1.55,indicator:3,hairline:1,dot:7},sheet:{radius:28,grabHeight:20,grabBarWidth:36,grabBarHeight:5,grabBarRadius:3,headPaddingTop:4,headPaddingX:16,headPaddingBottom:12,headGap:12,titlesGap:2,titleSize:18,close:36,closeIcon:20,bodyGap:12,bodyPaddingX:16,bodyPaddingBottom:24,actsGap:12,actsMarginTop:4},empty:{gap:8,titleSize:22,titleWeight:500,titleLineHeight:1.2,titleTracking:-.33,leadSize:15,leadLineHeight:1.5,actsGap:12,actsMarginTop:12,buttonMinWidth:200,linkMinHeight:44,linkPaddingX:4,linkSize:15,linkWeight:700,linkUnderlineOffset:3},skeleton:{gap:10,lineHeight:12,widths:[100,82,64]},summary:{paddingX:24,paddingY:0,radius:20,borderWidth:1,background:"surface",shadow:{color:"",x:0,y:0,blur:0,spread:0},rowDivider:1,rowMinHeight:0,rowCenter:false,rowPaddingY:14,termColor:"muted",valueColor:"ink",tabular:false,totalRowMinHeight:0,totalTermSize:15,totalTermWeight:400,totalTermColor:"muted",totalWeight:700,rowGapX:16,rowGapY:2,termSize:15,termLineHeight:1.55,valueSize:15,valueWeight:700,valueLineHeight:1.4,totalSize:20,totalLineHeight:1.4,off:{shown:true,size:15,weight:700,lineHeight:21,color:"go",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},icon:{size:24},timeline:{row:{shown:true,w:361,h:69.281,padding:[0,0,24,0],marginTop:0,marginBottom:0,gap:[16,16],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},done:{shown:true,w:28,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"ink",edge:{width:2,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"surface",fit:"cover",x:0,y:0,dy:0},now:{shown:true,w:28,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"surface",edge:{width:2,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},next:{shown:true,w:28,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"surface",edge:{width:2,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},nowInner:{size:10,color:"go"},check:{shown:true,w:16,h:16,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"surface",fit:"cover",x:0,y:0,dy:0},lineDoneDone:{x:13,top:30,bottom:2,width:2,color:"ink"},lineDoneNow:{x:13,top:30,bottom:2,width:2,color:"ink"},lineNowNext:{x:13,top:30,bottom:2,width:2,color:"line"},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:3},head:{shown:true,w:317,h:27,padding:[3,0,0,0],marginTop:0,marginBottom:0,gap:[8,4],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},nextTitle:{shown:true,size:17,weight:700,lineHeight:22.1,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:3},when:{shown:true,size:13,weight:400,lineHeight:18.2,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0},text:{shown:true,size:15,weight:400,lineHeight:22.5,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0}},thumbnail:{xs:{frame:{shown:true,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"surface",edge:{width:1,color:"line",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},img:{shown:false,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"surface",edge:{width:1,color:"line",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[10,10],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false},sm:{frame:{shown:true,w:64,h:64,padding:[8,8,8,8],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},img:{shown:true,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:64,h:64,padding:[8,8,8,8],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false},md:{frame:{shown:true,w:156,h:156,padding:[0,0,0,0],marginTop:0,marginBottom:6,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F5F5F5",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},img:{shown:true,w:156,h:156,padding:[10,10,10,10],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:156,h:156,padding:[0,0,0,0],marginTop:0,marginBottom:6,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F5F5F5",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false},lg:{frame:{shown:true,w:174.5,h:174.5,padding:[0,0,0,0],marginTop:0,marginBottom:8,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},img:{shown:true,w:174.5,h:174.5,padding:[14,14,18,14],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:174.5,h:174.5,padding:[0,0,0,0],marginTop:0,marginBottom:8,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false}},text:{display:{shown:true,size:40,weight:500,lineHeight:39.2,color:"ink",tracking:-1.2,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},headline:{shown:true,size:30,weight:500,lineHeight:33,color:"ink",tracking:-.45,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},title:{shown:true,size:22,weight:500,lineHeight:26.4,color:"ink",tracking:-.33,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},heading:{shown:true,size:18,weight:700,lineHeight:22.5,color:"ink",tracking:-.36,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},body:{shown:true,size:17,weight:400,lineHeight:26.35,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},lead:{shown:true,size:15,weight:400,lineHeight:21.75,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},label:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},meta:{shown:true,size:13,weight:400,lineHeight:18.85,color:"muted",tracking:0,face:"mono",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},caption:{shown:true,size:13,weight:400,lineHeight:19.5,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},overline:{shown:true,size:12,weight:700,lineHeight:16.8,color:"muted",tracking:.72,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},kicker:{shown:true,size:12,weight:700,lineHeight:18.6,color:"muted",tracking:.96,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},field:{gap:6,label:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},input:{shown:true,w:361,h:52,padding:[0,16,0,16],marginTop:0,marginBottom:0,gap:[10,10],minHeight:52,radius:[10,10],bg:"surface",edge:{width:1.5,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},focusEdge:"ink",errorEdge:"alert",value:{shown:true,size:17,weight:400,lineHeight:26.35,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:1},valueInset:[2,1],icon:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"muted",fit:"cover",x:0,y:0,dy:0},area:{shown:true,w:361,h:158,padding:[12,16,12,16],marginTop:0,marginBottom:0,gap:[10,10],minHeight:52,radius:[10,10],bg:"surface",edge:{width:1.5,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},areaValue:{shown:true,size:17,weight:400,lineHeight:25.5,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:2},areaValueMinHeight:132,areaInset:[2,2],hint:{shown:true,size:13,weight:400,lineHeight:19.5,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},error:{shown:true,size:15,weight:400,lineHeight:21.75,color:"alertDeep",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},placeholder:"muted"},checkbox:{row:{shown:true,w:361,h:45,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},labelX:34,box:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:1,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"surface",edge:{width:1.5,color:"icoSage",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},on:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:1,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"ink",edge:{width:1.5,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},tick:{w:5,h:10,stroke:2,color:"surface",rotate:45,dy:-1},label:{shown:true,size:15,weight:400,lineHeight:22.5,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},boxed:{shown:true,w:361,h:50.5,padding:[14,16,14,16],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"bgMist",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0}},choice:{row:{shown:true,w:361,h:56.344,padding:[14,16,14,16],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"surface",edge:{width:1.5,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},selected:{shown:true,w:361,h:56.344,padding:[14,16,14,16],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"pink",edge:{width:1.5,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},radio:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[10,10],bg:"surface",edge:{width:1.5,color:"icoSage",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},radioOn:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[10,10],bg:"surface",edge:{width:6,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},textX:34,title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},strut:26.35,meta:{shown:true,size:13,weight:400,lineHeight:18.2,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0},end:{shown:true,size:13,weight:400,lineHeight:20.15,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},group:{gap:8,legend:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},legendPaddingX:2,legendGap:0}},switch:{track:{shown:true,w:48,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[999,999],bg:"#D0D6D3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},on:"ink",thumb:{size:22,inset:3,travel:20,color:"surface",shadow:{color:"rgba(16, 70, 46, 0.06)",x:0,y:1,blur:2,spread:0}}},iconButton:{bare:{shown:true,w:44,h:44,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[22,22],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},bareIcon:22,offColor:"line",ring:{shown:true,w:36,h:36,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[18,18],bg:"surface",edge:{width:1.5,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},ringIcon:18,ringPressed:"tintSage",ringPressScale:.94},link:{text:{shown:true,size:17,weight:400,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:3,decoThickness:0,marginTop:0,paddingTop:0},danger:{shown:true,size:15,weight:700,lineHeight:23.25,color:"alert",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:3,decoThickness:0,marginTop:0,paddingTop:0},inline:{shown:true,size:17,weight:400,lineHeight:26.35,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},lists:{rows:{row:{shown:true,w:327,h:94.781,padding:[16,0,16,0],marginTop:0,marginBottom:0,gap:[16,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:1,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},subtitle:{shown:true,size:13,weight:400,lineHeight:18.85,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0}},tiles:{list:{shown:true,w:343,h:175.813,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[4,4],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},outdent:8,row:{shown:true,w:343,h:62.281,padding:[10,8,10,8],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},leading:22,leadingFace:40,icon:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"muted",fit:"cover",x:0,y:0,dy:0},text:{shown:true,w:261,h:42.281,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[2,2],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},subtitle:{shown:true,size:13,weight:400,lineHeight:18.2,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},pressed:"#EDF2EF",alert:{bg:"tintRed",icon:"alert",title:"alertDeep",subtitle:"alert"}},end:{text:{shown:true,size:15,weight:400,lineHeight:23.25,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},gap:8,chevron:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#819D90",fit:"cover",x:0,y:0,dy:0}},section:{title:{shown:true,size:18,weight:700,lineHeight:22.5,color:"ink",tracking:-.36,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},titleGap:12,head:{shown:true,w:361,h:22.5,padding:[0,0,0,0],marginTop:8,marginBottom:0,gap:[12,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},note:{shown:true,size:13,weight:400,lineHeight:19.5,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:12,paddingTop:0}},avatar:{sizes:{xs:20,sm:36,md:48,lg:64,xl:128},face:40,bg:"surface",edge:{width:1,color:"line",ring:true},initials:{shown:true,size:15,weight:700,lineHeight:23.25,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},initialsXs:{shown:true,size:9,weight:700,lineHeight:13.95,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},tints:{default:"tintPink",pink:"#FFCFC9",blue:"#C2CEE5",yellow:"#F6D78F",sage:"#C6D3CD"},ring:{width:2,offset:2,color:"go"},ringXl:{width:3,offset:4,color:"go"},dot:{size:12,edge:2,edgeColor:"surface"}},stack:{size:28,overlap:-8,initialsSize:12,halo:{width:2,color:"surface"}},banner:{box:{shown:true,w:361,h:155.391,padding:[16,16,16,16],marginTop:0,marginBottom:0,gap:[12,4],minHeight:0,radius:[20,20],bg:"#F1F5F2",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:1,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},iconRows:3,kicker:{shown:true,size:12,weight:700,lineHeight:16.8,color:"#5B5B5B",tracking:.72,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},text:{shown:true,size:15,weight:400,lineHeight:21.75,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},acts:{shown:true,w:295,h:21,padding:[0,0,0,0],marginTop:8,marginBottom:0,gap:[16,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},link:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},tones:{info:{bg:"#F1F5F2",icon:"ink"},success:{bg:"tintGo",icon:"ink"},warn:{bg:"#FCF0D6",icon:"#926F06"},danger:{bg:"tintRed",icon:"alert"}}},toast:{box:{shown:true,w:200.281,h:40.25,padding:[10,16,10,16],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[999,999],bg:"ink",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"surface",fit:"cover",x:0,y:0,dy:0},text:{shown:true,size:15,weight:400,lineHeight:20.25,color:"onInk",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:10},inset:16,rise:8,fade:200,hold:2600},spinner:{size:16,border:2,turn:700,openSide:true,reducedOpacity:.5},offbar:{box:{shown:true,w:361,h:56,padding:[6,16,6,16],marginTop:0,marginBottom:0,gap:[10,10],minHeight:44,radius:[0,0],bg:"#FCF0D6",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:48,dy:0},text:{shown:true,size:15,weight:500,lineHeight:19.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},icon:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},action:{shown:true,w:69.859,h:44,padding:[0,2,0,2],marginTop:0,marginBottom:0,gap:[6,6],minHeight:44,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},actionText:{shown:true,size:15,weight:700,lineHeight:19.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:3,decoThickness:0,marginTop:0,paddingTop:0},online:{bg:"ink",color:"onInk"},fade:200},progress:{track:{shown:true,w:361,h:4,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[999,999],bg:"line",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},fill:"go",move:300},divider:{width:1,color:"line",label:{shown:true,size:12,weight:400,lineHeight:18.6,color:"muted",tracking:.72,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},labelGap:12,labelLine:{width:1,color:"line"}},errorInline:{text:{shown:true,size:15,weight:400,lineHeight:21,color:"alertDeep",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},acts:{shown:true,w:361,h:21,padding:[0,0,0,0],marginTop:8,marginBottom:0,gap:[16,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},link:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},linkPressedOpacity:.6},variants:{drawer:{frame:{shown:true,w:393,h:226.594,padding:[10,20,40,20],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[28,0],bg:"surface",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:293.406,dy:0},maxHeight:.8,grab:{shown:true,w:40,h:5,padding:[0,0,0,0],marginTop:0,marginBottom:10,gap:[0,0],minHeight:0,radius:[2.5,2.5],bg:"#DAD7D1",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},top:{shown:true,w:353,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},kicker:{shown:true,size:11,weight:400,lineHeight:16.5,color:"muted",tracking:.88,face:"mono",upper:true,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},close:{shown:true,w:40,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[20,20],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},closeEnd:-8,closeIcon:22,title:{shown:true,size:24,weight:800,lineHeight:27.6,color:"ink",tracking:-.24,face:"serif",upper:false,wrap:"balance",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},body:{shown:true,w:353,h:82,padding:[0,0,0,0],marginTop:12,marginBottom:0,gap:[10,10],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},text:{shown:true,size:16,weight:400,lineHeight:24,color:"text",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},scrim:"ink/0.38",motion:{enterMs:320,enterEasing:[.32,.72,0,1],exitMs:220,exitEasing:[.23,1,.32,1],scrimEnterMs:240,scrimExitMs:200,scrimEasing:[.25,.1,.25,1]}},button:{ink:{fill:false,minHeight:48,paddingX:22,gap:8,borderWidth:0,ring:false,fontSize:16,fontWeight:700,lineHeight:1.5,iconSize:20},outline:{fill:false,minHeight:48,paddingX:22,gap:8,borderWidth:1.5,ring:true,fontSize:16,fontWeight:700,lineHeight:1.5,iconSize:20},sm:{fill:false,minHeight:40,paddingX:16,gap:8,borderWidth:1.5,ring:true,fontSize:15,fontWeight:700,lineHeight:1.5,iconSize:20},lg:{fill:false,minHeight:56,paddingX:28,gap:8,borderWidth:0,ring:false,fontSize:17,fontWeight:700,lineHeight:1.5,iconSize:20},disabledOpacity:.32,press:.97,transition:"transform 160ms cubic-bezier(0.23, 1, 0.32, 1), opacity 160ms ease"},segmented:{track:{shown:true,w:361,h:44,padding:[4,4,4,4],marginTop:0,marginBottom:0,gap:[4,4],minHeight:0,radius:[22,22],bg:"surface",edge:{width:1.5,color:"#DAD7D1",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},option:{shown:true,w:115,h:36,padding:[0,6,0,6],marginTop:0,marginBottom:0,gap:[0,0],minHeight:36,radius:[18,18],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},label:{shown:true,size:14,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},chosen:{shown:true,w:115,h:36,padding:[0,6,0,6],marginTop:0,marginBottom:0,gap:[0,0],minHeight:36,radius:[18,18],bg:"ink",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"onInk",fit:"cover",x:0,y:0,dy:0},chosenLabel:{shown:true,size:14,weight:700,lineHeight:21,color:"onInk",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},press:.96,transition:"background-color 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"},stepper:{track:{shown:true,w:110,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[20,20],bg:"surface",edge:{width:1.5,color:"#DAD7D1",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},button:{shown:true,w:40,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[20,20],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},icon:16,value:{shown:true,size:15.5,weight:800,lineHeight:23.25,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},valueWidth:30,disabledOpacity:.3,press:.9,transition:"transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"},summary:{box:{shown:true,w:361,h:144,padding:[6,16,6,16],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[16,16],bg:"surface",edge:{width:0,color:"line",ring:false},shadow:{color:"rgba(38, 37, 35, 0.06)",x:0,y:1,blur:3,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},row:{shown:true,w:329,h:34,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[12,12],minHeight:34,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},term:{shown:true,size:15,weight:400,lineHeight:22.5,color:"#4A4845",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},value:{shown:true,size:15,weight:400,lineHeight:22.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},totalRow:{shown:true,w:329,h:42,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[12,12],minHeight:42,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},totalTerm:{shown:true,size:17,weight:800,lineHeight:25.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},total:{shown:true,size:17,weight:800,lineHeight:25.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},renewRow:{shown:true,w:329,h:28,padding:[0,0,0,0],marginTop:-6,marginBottom:0,gap:[12,12],minHeight:28,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},renewTerm:{shown:true,size:14,weight:400,lineHeight:21,color:"#4A4845",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},renew:{shown:true,size:14,weight:400,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},inset:{shown:true,w:361,h:88,padding:[6,16,6,16],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[16,16],bg:"bg",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0}},toast:{box:{shown:true,w:361,h:64.594,padding:[12,15,12,15],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[16,16],bg:"ink",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"onInk",fit:"cover",x:16,y:62,dy:0},text:{shown:true,size:14.5,weight:400,lineHeight:20.3,color:"onInk",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:12},motion:{enterMs:220,exitMs:160,easing:[.23,1,.32,1],rise:-8}},focus:{width:2,offset:2,color:"ink"}},press:{button:.97,iconButton:.94,card:.98},colors:{grab:"#C9C9C9",scrim:"rgba(0, 0, 0, 0.32)",watch:"#F9E6B9",planInk:"#262523",planOnInk:"#FFFFFF",planAccent:"#FFCE34",planLink:"#00707C",planAccentWash:"#FFF7DC",planAccentChip:"#FFE7A1",planLinkWash:"#E0FDFF",planLinkChip:"#C8F4F8"}};function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e))for(let t of Object.values(e))deepFreeze(t);return e}var S=x,T=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#preset@v1");function C(e){return Object.defineProperty(e,T,{value:e,enumerable:true}),deepFreeze(e)}var F={content:0,heading:2,control:1.8,compact:1.5,badge:1.3},z=C({name:"everfur",colors:{bg:S.color.bg,surface:S.color.efWhite,text:S.color.text,ink:S.role.color.ink,onInk:S.color.efWhite,muted:S.role.color.muted,line:S.role.color.line,go:S.role.color.go,onGo:S.role.color.ink,pink:S.color.efDustyPink,onPink:S.role.color.ink,alert:S.color.alert,alertDeep:S.color.alertDeep,icoSage:S.role.color.icoSage,bgMist:S.color.bgMist,tintSage:S.role.color.tintSage,tintBlue:S.role.color.tintBlue,tintGo:S.role.color.tintGo,tintPink:S.role.color.tintPink,tintYellowEdge:S.role.color.tintYellowEdge,tintWatch:_.colors.watch,tintRed:S.role.color.tintRed,scrim:_.colors.scrim,grab:_.colors.grab,focus:S.role.color.ink,planInk:_.colors.planInk,planOnInk:_.colors.planOnInk,planAccent:_.colors.planAccent,planLink:_.colors.planLink,planAccentWash:_.colors.planAccentWash,planAccentChip:_.colors.planAccentChip,planLinkWash:_.colors.planLinkWash,planLinkChip:_.colors.planLinkChip},radius:{...S.radius},space:{...S.space},type:{family:S.font.family.base,mono:S.font.family.mono,faces:{regular:"Azeret-Regular",medium:"Azeret-Medium",bold:"Azeret-Bold",mono:"AzeretMono-Regular",monoBold:"AzeretMono-Bold"},namedFaces:true,size:{xs:S.font.size.xs,sm:S.font.size.sm,md:S.font.size.md,lg:S.font.size.lg,xl:S.font.size.xl},weight:{...S.font.weight},lineHeight:{...S.font.lineHeight},scaleCaps:F},motion:{duration:{press:S.motion.duration.press,fade:S.motion.duration.fade,enter:S.motion.duration.enter,sheet:S.motion.duration.sheet,sheetOut:S.motion.duration.sheetOut},easing:{out:S.motion.easing.out,drawer:S.motion.easing.drawer},pop:{duration:S.motion.duration.enter,from:.95,peakAt:.55,amplitude:.035,switchAmplitude:.06},reduced:false},metrics:_});function E(e){return e[T]??z}function I(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function O(e,t){if(!I(e)||!I(t))return t===void 0?e:t;let r={...e};for(let[n,i]of Object.entries(t))i!==void 0&&(r[n]=O(e[n],i));return r}function resolveTheme(e,t=z){if(!e)return t;let r=O(t,e),n=e.colors;if(n){let e=r.colors;for(let[t,r,i]of H){let o=n[r];o!==void 0&&n[t]===void 0&&(e[t]=D(o,i,e.surface)??e[t]??o)}}return deepFreeze(r)}var H=[["planAccentWash","planAccent",.17],["planAccentChip","planAccent",.47],["planLinkWash","planLink",.12],["planLinkChip","planLink",.2]];function D(e,t,r){let n=e=>{let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e??"");return t?[t[1],t[2],t[3]].map(e=>parseInt(e,16)):void 0},[i,o]=[n(e),n(r)];if(!(!i||!o))return`#${i.map((e,r)=>Math.round(e*t+(o[r]??0)*(1-t)).toString(16).padStart(2,"0")).join("").toUpperCase()}`}var B=/* @__PURE__ */(()=>{let e=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#ThemeContext@v1"),t=globalThis,r=t[e]??(t[e]=createContext(null));return r.displayName??(r.displayName="EverfurThemeContext"),r})();function ThemeProvider({theme:t,children:n}){let i=L(),o=t===void 0||R(t)?t:A(t),a=e(()=>R(t)?P(t):resolveTheme(t,i),[o,i]);return r(B.Provider,{value:a},n)}function A(e){return JSON.stringify(e,(e,t)=>I(t)&&!Array.isArray(t)?Object.fromEntries(Object.keys(t).sort().map(e=>[e,t[e]])):t)}function R(e){return e!==void 0&&Object.isFrozen(e)&&j.every(t=>t in e)}var j=["name","colors","radius","space","type","motion","metrics"];function M(e,t){if(e===void 0)return true;if(!I(e))return t!==void 0;if(!I(t))return false;for(let r of Object.keys(e))if(!M(e[r],t[r]))return false;return true}var W=/* @__PURE__ */new WeakMap;function P(e){let t=W.get(e);if(t)return t;if(M(z,e))return W.set(e,e),e;let r=E(e),n=O(z,r===z?e:O(r,e));n[T]=r;let i=deepFreeze(n);return W.set(e,i),i}function L(){let e=n(B);return e?P(e):z}var N=e=>Math.round(e*1e3)/1e3;function q(e,t=false){return t?e>450?"monoBold":"mono":e>500?"bold":e>450?"medium":"regular"}function U(e,t){let r=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;let[n,i,o]=[r[1],r[2],r[3]].map(e=>parseInt(e,16));return`rgba(${n}, ${i}, ${o}, ${t})`}function G(e){let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(t)return[t[1],t[2],t[3]].map(e=>parseInt(e,16));let r=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(e);return r?[r[1],r[2],r[3]].map(Number):void 0}function $(e,t,r,n){let[i,o]=[G(e),G(r)];return!i||!o?n:`rgb(${i.map((e,r)=>Math.round(e*t+(o[r]??0)*(1-t))).join(", ")})`}function X(e,t){let r=/^([a-zA-Z]+)(?:\/([\d.]+))?$/.exec(t),n=r?.[1];if(!r||n===void 0||!(n in e.colors))return t;let i=e.colors[n];return r[2]===void 0?i:U(i,Number(r[2]))}function Y(e,t){return t==="none"?"transparent":X(e,t)}var V=.45;function K(e,t,r,n=false){let i=e.metrics.button;if(t==="text"){let t=i.text;return{minHeight:0,paddingX:0,gap:i.ink.gap,radius:0,borderWidth:0,borderColor:"transparent",background:"transparent",iconSize:i.inkSm.iconSize,text:{size:t.fontSize,weight:t.fontWeight,lineHeight:N(t.fontSize*t.lineHeight),color:X(e,t.color)},pressScale:1,pressOpacity:t.pressOpacity,disabledOpacity:i.blockedOpacity??V,fill:false,ring:false}}let o=e.metrics.variants.button,a=Z(r),l=t==="outline"||t==="danger"||t==="warn",s=a?{...r==="compactSm"?o.sm:r==="compactLg"?o.lg:o.ink,borderWidth:l?o.outline.borderWidth:0,ring:o.outline.ring}:r==="row"?i.row:t==="danger"?i.danger:r==="sm"?i[`${t}Sm`]:i[t],d=e.colors,c=t==="money"||t==="warn"?i[t]:void 0,u={ink:{bg:d.ink,fg:d.onInk,edge:d.ink},go:{bg:d.go,fg:d.onGo,edge:d.ink},outline:{bg:"transparent",fg:d.ink,edge:d.ink},pink:{bg:d.pink,fg:d.onPink,edge:d.ink},danger:{bg:d.surface,fg:d.alert,edge:d.alert}},p=c?{bg:Y(e,c.bg),fg:X(e,c.fg),edge:X(e,c.edgeColor)}:u[t],f=t==="outline"&&n&&!a?i.outlineInSheetWeight:s.fontWeight;return{minHeight:s.minHeight,paddingX:s.paddingX,gap:s.gap,radius:e.radius.pill,borderWidth:s.borderWidth,borderColor:p.edge,background:p.bg,iconSize:s.iconSize,text:{size:s.fontSize,weight:f,lineHeight:N(s.fontSize*s.lineHeight),color:p.fg},pressScale:e.motion.reduced?1:a?o.press:e.metrics.press.button,pressOpacity:1,disabledOpacity:a?o.disabledOpacity:i.blockedOpacity??V,fill:s.fill,ring:s.ring}}function Z(e){return e==="compact"||e==="compactSm"||e==="compactLg"}function Q(e,t){let r=e.metrics.sheet,n=r.titleSize,i=r.titleLineHeight??e.metrics.card.titleLineHeight;return{size:n,weight:r.titleWeight??e.metrics.card.titleWeight,lineHeight:N(n*i),color:X(e,r.titleColor??"ink"),tracking:r.titleTracking??e.metrics.card.titleTracking}}function J(e){let t=e.metrics,r=e.colors;return{cardTitle:{size:t.card.titleSize,weight:t.card.titleWeight,lineHeight:N(t.card.titleSize*t.card.titleLineHeight),color:r.ink,tracking:t.card.titleTracking},cardLead:{size:t.card.leadSize,weight:e.type.weight.regular,lineHeight:N(t.card.leadSize*t.card.leadLineHeight),color:r.text},body:{size:t.card.bodySize,weight:e.type.weight.regular,lineHeight:N(t.card.bodySize*t.card.bodyLineHeight),color:r.text},kicker:{size:t.kicker.fontSize,weight:t.kicker.fontWeight,lineHeight:N(t.kicker.fontSize*t.kicker.lineHeight),color:r.muted,mono:true,tracking:t.kicker.letterSpacing,upper:true},sheetTitle:Q(e),stepperValue:{size:t.quantityStepper.valueSize,weight:t.quantityStepper.valueWeight,lineHeight:N(t.quantityStepper.valueSize*t.quantityStepper.valueLineHeight),color:X(e,t.quantityStepper.valueColor??"text")},tab:{size:t.tabs.fontSize,weight:t.tabs.fontWeight,lineHeight:N(t.tabs.fontSize*t.tabs.lineHeight),color:r.muted},tabCurrent:{size:t.tabs.fontSize,weight:t.tabs.currentWeight,lineHeight:N(t.tabs.fontSize*t.tabs.lineHeight),color:r.ink},emptyTitle:{size:t.empty.titleSize,weight:t.empty.titleWeight,lineHeight:N(t.empty.titleSize*t.empty.titleLineHeight),color:r.ink,tracking:t.empty.titleTracking},emptyLead:{size:t.empty.leadSize,weight:e.type.weight.regular,lineHeight:N(t.empty.leadSize*t.empty.leadLineHeight),color:r.text},emptyLink:{size:t.empty.linkSize,weight:t.empty.linkWeight,lineHeight:N(t.empty.linkSize*t.card.bodyLineHeight),color:r.ink},sumTerm:{size:t.summary.termSize,weight:e.type.weight.regular,lineHeight:N(t.summary.termSize*t.summary.termLineHeight),color:r.muted},sumValue:{size:t.summary.valueSize,weight:t.summary.valueWeight,lineHeight:N(t.summary.valueSize*t.summary.valueLineHeight),color:r.ink},sumTotal:{size:t.summary.totalSize,weight:t.summary.valueWeight,lineHeight:N(t.summary.totalSize*t.summary.totalLineHeight),color:r.ink}}}function ee(e,t){return{size:t.size,weight:t.weight,lineHeight:t.lineHeight,color:X(e,t.color),...t.face==="mono"?{mono:true}:{},...t.face==="serif"?{serif:true}:{},...t.tracking?{tracking:t.tracking}:{},...t.upper?{upper:true}:{},...t.deco==="none"?{}:{deco:t.deco==="strike"?"strike":"underline",decoOffset:t.decoOffset,decoThickness:t.decoThickness},...t.tabular?{tabular:true}:{},...t.wrap==="auto"?{}:{wrap:t.wrap==="balance"?"balance":"pretty"}}}var te=/* @__PURE__ */(()=>{let e=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#SurfaceContext@v1"),t=globalThis;return t[e]??(t[e]=createContext(null))})();function re(){return n(te)}var ne={display:"heading",headline:"heading",title:"heading",heading:"heading",body:"content",lead:"content",label:"control",meta:"compact",caption:"content",overline:"compact",kicker:"compact"};function ie(e,t){let r=e.colors;switch(t){case"ink":return r.ink;case"text":return r.text;case"muted":return r.muted;case"danger":return r.alertDeep;case"inverse":return r.onInk;default:return}}function oe(e,t,r,n){let i=ee(e,e.metrics.text[t]),o=ie(e,r);return{...i,...o?{color:o}:{},...n?{weight:e.type.weight[n]}:{}}}var ae=/* @__PURE__ */(()=>{let e=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#PressFeedbackContext@v1"),t=globalThis,r=t[e]??(t[e]=createContext(null));return r.displayName??(r.displayName="EverfurPressFeedbackContext"),r})();function le(){return n(ae)}function se(e,t,r,n={}){if(!e||n.disabled)return{onPress:r,onPressIn:void 0};let{onPressIn:i,onPress:o,haptic:a}=e,l=n.haptics!==false&&t.haptic&&a?a:void 0;return{onPress:r&&(o||l)?()=>{l?.(t),o?.(t),r()}:r,onPressIn:i?()=>i(t):void 0}}function de(e,t,r=1){return e?.pressScale?.[t]??r}var ce={display:"balance",headline:"balance",title:"balance",heading:"balance",body:"pretty",lead:"pretty",meta:"pretty",caption:"pretty",label:"auto",overline:"auto",kicker:"auto"};function ue(e,t){return e.type.variantTiers?.[t]??ne[t]}var pe=/* @__PURE__ */(()=>{let e=/* @__PURE__ */Symbol.for("@everfur-health/ui-native#ReducedMotionContext@v1"),t=globalThis,r=t[e]??(t[e]=createContext(null));return r.displayName??(r.displayName="EverfurReducedMotionContext"),r})();function fe(){return n(pe)}function ge(e,t){let r=q(t.weight,t.mono===true);return{fontFamily:t.serif?e.type.faces.serif??e.type.faces.bold:e.type.faces[r],...e.type.namedFaces?{}:{fontWeight:String(t.weight)},fontSize:t.size,lineHeight:t.lineHeight,color:t.color,...t.tracking?{letterSpacing:t.tracking}:{},...t.upper?{textTransform:"uppercase"}:{},...t.deco?he(t):{},...t.tabular?{fontVariant:["tabular-nums"]}:{},...t.wrap&&p.OS==="web"?{textWrap:t.wrap}:{}}}function he(e){let t={textDecorationLine:e.deco==="strike"?"line-through":"underline"};return p.OS!=="web"?t:{...t,...e.decoOffset?{textUnderlineOffset:e.decoOffset}:{},...e.decoThickness?{textDecorationThickness:e.decoThickness}:{}}}function me(){if(p.OS!=="web")return false;let e=globalThis;return typeof e.matchMedia=="function"&&e.matchMedia("(prefers-reduced-motion: reduce)").matches}function be(e){let[r,n]=a(()=>e===null&&me());return t(()=>{if(e!==null)return;let t=true,r=b?.isReduceMotionEnabled;if(typeof r=="function"){let e=r.call(b);e!=null&&typeof e.then=="function"&&e.then(e=>{t&&n(e===true)},()=>{})}let i=b?.addEventListener?.("reduceMotionChanged",e=>n(e===true));return()=>{t=false,i?.remove?.()}},[e]),e??r}function ye(e){let t=be(fe());return e.motion.reduced||t}function we(e,t,r){return{...e===void 0?{}:{expanded:e},...t===void 0?{}:{checked:t},...r===void 0?{}:{selected:r!==false}}}function ve(e){let t=Math.max(0,Math.ceil((44-e)/2));return t===0?void 0:{top:t,bottom:t,left:t,right:t}}function ke(e,t,r){let n={position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:r};return p.OS==="web"?{...n,boxShadow:`inset 0 0 0 ${e}px ${t}`}:{...n,borderWidth:e,borderColor:t}}function xe(e){return Math.round(e*100)/100}function _e(e,t){let r=Number(t.weight),n=t.letterSpacing??0;return{...ge(e,{size:t.size,weight:r,lineHeight:xe(t.size*t.lineHeight),color:e.colors.text,tracking:n?xe(t.size*n):0,mono:t.face==="mono",upper:t.uppercase===true}),flexShrink:1}}function Se(e){return e==="auto"?null:p.OS==="ios"?{lineBreakStrategyIOS:"push-out"}:p.OS==="android"&&e==="balance"?{textBreakStrategy:"balanced"}:null}function Te(e,t){let r=e.type.weight[t];return e.type.namedFaces?{fontFamily:e.type.faces[q(r)]}:{fontWeight:String(r)}}function Text({tier:e,variant:t,tone:n,weight:i,level:o,lineBreak:a,typeRole:l,...s}){let d=L();if(l){let t=d.type.scaleCaps[e??l.tier??"content"],n=a?Se(a):null;return r(u,{...t>0?{maxFontSizeMultiplier:t}:{},...n,...s,style:[_e(d,l),s.style]})}let c=d.type.scaleCaps[e??(t?ue(d,t):"content")],f=Se(a??(t?ce[t]:"auto"));if(t===void 0&&n===void 0&&i===void 0&&o===void 0)return f?r(u,{...c>0?{maxFontSizeMultiplier:c}:{},...f,...s}):r(u,c>0?{maxFontSizeMultiplier:c,...s}:s);let g=ie(d,n),h=t?ge(d,oe(d,t,n,i)):{...g?{color:g}:{},...i?Te(d,i):{}},m=o===void 0?{}:{accessibilityRole:"header",...p.OS==="web"?{"aria-level":o}:{}};return r(u,{...c>0?{maxFontSizeMultiplier:c}:{},...f,...m,...s,style:[h,s.style]})}var Ce=24,Fe=16,ze=.8,Ee=e=>Math.round(e*Fe);function Ie(e,t,r,n,i,o){let a=e-r/2,l=t-n/2,s=Math.round(a),d=Math.round(l);return{position:"absolute",left:s,top:d,width:r,height:n,transform:[{translateX:a-s},{translateY:l-d},{rotate:`${Math.atan2(o,i)*180/Math.PI}deg`},{scale:1/Fe}]}}function Oe(e,t,r){for(let n of e.strokes){let e=n.width*t,i=n.points,o=i.length/2,a=n.closed?o:o-1;for(let l=0;l<a;l+=1){let a=(l+1)%o,s=(i[l*2]??0)*t,d=(i[l*2+1]??0)*t,c=(i[a*2]??0)*t-s,u=(i[a*2+1]??0)*t-d,p=Math.hypot(c,u);if(p===0&&!(o===2&&n.cap))continue;let f=p===0?1:c/p,g=p===0?0:u/p,h=n.closed||l>0||n.cap?e/2:0,m=n.closed||a!==o-1||n.cap?e/2:0,b=(p+m-h)/2;r.push({paint:"backgroundColor",style:{...Ie(s+f*b,d+g*b,Ee(p+h+m),Ee(e),f,g),borderTopLeftRadius:h>0?Ee(e)/2:0,borderBottomLeftRadius:h>0?Ee(e)/2:0,borderTopRightRadius:m>0?Ee(e)/2:0,borderBottomRightRadius:m>0?Ee(e)/2:0,...n.opacity===void 0?{}:{opacity:n.opacity}}})}}}function He(e,t,r){for(let n of e.boxes){let e=(n.w+n.width)*t,i=(n.h+n.width)*t;r.push({paint:"borderColor",style:{...Ie((n.x-n.width/2)*t+e/2,(n.y-n.width/2)*t+i/2,Ee(e),Ee(i),1,0),borderWidth:Ee(n.width*t),borderRadius:(n.radius+n.width/2)*t*Fe,...n.opacity===void 0?{}:{opacity:n.opacity}}})}}function De(e,t,r){for(let n of e.triangles){let e=[0,1,2].map(e=>[(n[e*2]??0)*t,(n[e*2+1]??0)*t]),i=0,o=-1;for(let t=0;t<3;t+=1){let r=e[t]??[0,0],n=e[(t+1)%3]??[0,0],a=Math.hypot(n[0]-r[0],n[1]-r[1]);a>o&&(o=a,i=t)}if(o<=0)continue;let a=e[i]??[0,0],l=e[(i+1)%3]??[0,0],s=e[(i+2)%3]??[0,0],d=(l[0]-a[0])/o,c=(l[1]-a[1])/o,u=(s[0]-a[0])*d+(s[1]-a[1])*c,p=(s[0]-a[0])*-c+(s[1]-a[1])*d,f=Math.abs(p),g=p<0,h=g?-f/2:f/2,m=Ee(u),b=Ee(o)-m,y=Ee(f);r.push({paint:g?"borderBottomColor":"borderTopColor",style:{...Ie(a[0]+d*(o/2)-c*h,a[1]+c*(o/2)+d*h,m+b,y,d,c),width:0,height:0,borderLeftWidth:m,borderRightWidth:b,borderLeftColor:"transparent",borderRightColor:"transparent",...g?{borderBottomWidth:y}:{borderTopWidth:y}}})}for(let n of e.seams){let e=(n[0]??0)*t,i=(n[1]??0)*t,o=(n[2]??0)*t-e,a=(n[3]??0)*t-i,l=Math.hypot(o,a),s=ze*(n[4]??0),d=ze*(n[5]??0),c=l-s-d;if(l===0||c<=0)continue;let u=s+c/2;r.push({paint:"backgroundColor",style:Ie(e+o/l*u,i+a/l*u,Ee(c),Ee(ze),o/l,a/l)})}}var Be=/* @__PURE__ */new WeakMap;function Ae(e,t){let r=Be.get(e);r===void 0&&(r=/* @__PURE__ */new Map,Be.set(e,r));let n=r.get(t);if(n!==void 0)return n;let i=[],o=t/Ce;return He(e,o,i),Oe(e,o,i),De(e,o,i),r.set(t,i),i}function Glyph({icon:e,size:t,color:r,label:n,testID:i,style:o}){let a=L(),l=t??a.metrics.icon.size,s=r??a.colors.ink;/* @__PURE__ */
3
+ return w(c,{testID:i,pointerEvents:"none",style:[{width:l,height:l},o],...n?{accessible:true,accessibilityRole:"image",accessibilityLabel:n}:{accessible:false,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"},children:Ae(e,l).map((e,t)=>/* @__PURE__ */w(c,{style:[e.style,{[e.paint]:s}]},t))})}var Re=/* @__PURE__ */(()=>{let e=/* @__PURE__ */Symbol.for("@everfur-health/ui-native#icons@v1"),t=globalThis;return t[e]??(t[e]={icons:{},warned:/* @__PURE__ */new Set})})();function je(e){Object.assign(Re.icons,e)}function Me(e){let t=Re.icons[e];return t===void 0&&(typeof __DEV__<"u"?__DEV__:typeof process<"u"&&process.env.NODE_ENV!=="production")&&!Re.warned.has(e)&&(Re.warned.add(e),console.warn(`@everfur-health/ui-native: no icon "${e}" is registered. The lean entry draws only the icons an app registers: registerIcons({ ... }) with the UI_RN_ICON_* exports, or pass a drawing.`)),t}function Icon({name:e,...t}){let r=Me(e);return r?/* @__PURE__ */w(Glyph,{icon:r,...t}):null}function We(e,t,r,n=1){return Pe(le(),e,t,r,n)}function Pe(e,t,r,n,i=1){let o=se(e,{component:t,testID:r.testID,...r.item===void 0?{}:{item:r.item},label:r.label,trackId:r.trackId,haptic:r.haptic===true},n,{disabled:r.disabled});return{props:o.onPressIn?{onPress:o.onPress,onPressIn:o.onPressIn}:{onPress:o.onPress},scale:de(e,t,i)}}var Le=e=>`cubic-bezier(${e.join(", ")})`,Ne=(e,t)=>typeof e=="function"?e({pressed:t}):e,qe;function Ue(){return qe??(qe=m.createAnimatedComponent(h))}function Ge(e,t,r){let[n,i,o,a]=e.motion.easing.out;return m.timing(t,{toValue:r,duration:e.motion.duration.press,easing:y.bezier(n,i,o,a),useNativeDriver:true})}function PressBox({style:e,scale:t,still:n,pop:i,onPressIn:l,onPressOut:s,...d}){let c=L(),u=o(null),[f,g]=a(false),b=!n&&t!==1,y=!n&&i?.scale!=null;if(p.OS==="web"){let n=b?{transitionProperty:"transform",transitionDuration:`${c.motion.duration.press}ms`,transitionTimingFunction:Le(c.motion.easing.out)}:null;return r(h,{...d,...i?{ref:i.ref}:null,onPressIn:l,onPressOut:s,style:({pressed:r})=>[Ne(e,r),n,b&&r?{transform:[{scale:t}]}:null]})}if(!b&&!y)return r(h,{...d,onPressIn:l,onPressOut:s,style:e});let w=u.current??(u.current=new m.Value(0)),v=b?w.interpolate({inputRange:[0,1],outputRange:[1,t]}):null,k=v&&y?m.multiply(v,i?.scale):v??i?.scale;return r(Ue(),{...d,onPressIn:e=>{d.disabled||(g(true),b&&Ge(c,w,1).start(),l?.(e))},onPressOut:e=>{g(false),b&&Ge(c,w,0).start(),s?.(e)},style:[Ne(e,f),{transform:[{scale:k}]}]})}function Button({label:e,onPress:t,tone:r="ink",size:n="md",icon:i,disabled:o=false,loading:a=false,loadingLabel:l,loadingIndicator:s="spinner",fullWidth:d,accessibilityLabel:u,trackId:p,haptic:g,testID:h,style:m,children:b,nativeID:y,onPressIn:k,"aria-expanded":x,"aria-pressed":_,"aria-current":S}){let T=L(),C=re()==="sheet",F=ye(T),z=K(T,r,n,C),E=o||a,I=d??(C||z.fill),O=a&&s!=="none",H=O&&l?l:u??(O&&l?l:e),D=We("Button",{testID:h,label:H,trackId:p,haptic:g,disabled:E},t,z.pressScale),B=D.props.onPressIn,A=k&&B?()=>{B(),k()}:k??B;/* @__PURE__ */
4
+ return v(PressBox,{...D.props,onPressIn:A,scale:D.scale,still:F,disabled:E,nativeID:y,hitSlop:ve(Math.max(z.minHeight,z.text.lineHeight)),accessibilityRole:"button",accessibilityLabel:H,accessibilityState:{disabled:E,busy:a,...we(x,_,S)},"aria-busy":a,testID:h,style:({pressed:e})=>[$e.base,{minHeight:Math.max(z.minHeight,0),paddingHorizontal:z.paddingX,columnGap:z.gap,borderRadius:z.radius,borderWidth:z.ring?0:z.borderWidth,borderColor:z.borderColor,backgroundColor:z.background},I?$e.block:$e.auto,E?{opacity:z.disabledOpacity}:null,e&&z.pressOpacity!==1&&!E?{opacity:z.pressOpacity}:null,m],children:[O?/* @__PURE__ */w(f,{size:"small",color:z.text.color,animating:!F,hidesWhenStopped:false,accessibilityLabel:H}):i?/* @__PURE__ */w(Icon,{name:i,size:z.iconSize,color:z.text.color}):null,
5
+ /* @__PURE__ */w(c,{style:$e.labelBox,children:/* @__PURE__ */w(Text,{tier:"control",style:[ge(T,z.text),$e.label],children:O&&l?l:b??e})}),z.ring&&z.borderWidth>0?/* @__PURE__ */w(c,{pointerEvents:"none",style:ke(z.borderWidth,z.borderColor,z.radius)}):null]})}var $e=d.create({base:{flexDirection:"row",alignItems:"center",justifyContent:"center"},block:{alignSelf:"stretch"},auto:{alignSelf:"flex-start"},labelBox:{flexShrink:1},label:{textAlign:"center"}}),Xe={bg:"#FDFBF8",radius:10,padding:15,borderWidth:1,borderColor:"rgba(0, 0, 0, 0.15)"};function Card({title:e,action:t,lead:r,children:n,tone:i="default",headGap:o,onPress:a,accessibilityLabel:l,trackId:s,haptic:d,variant:u="standard",tint:p,borderColor:f,testID:g,style:h}){let m=L(),b=ye(m),y=m.metrics.card,x=J(m),_=l??e,S=We("Card",{testID:g,label:_,trackId:s,haptic:d},a,m.metrics.press.card),T=e?/* @__PURE__ */w(Text,{accessibilityRole:"header",tier:"heading",lineBreak:"balance",style:[ge(m,x.cardTitle),Ye.shrink],children:e}):null,C=i==="ghost",F=u==="plain"?Xe:null,z=F?{padding:F.padding,borderWidth:F.borderWidth,borderColor:f??(C?X(m,y.ghost.borderColor):F.borderColor),...C?{borderStyle:y.ghost.borderStyle}:null,borderRadius:F.radius,borderCurve:"continuous",backgroundColor:p??F.bg}:{padding:y.padding,borderWidth:y.borderWidth,borderColor:f??(C?X(m,y.ghost.borderColor):m.colors.line),...C?{borderStyle:y.ghost.borderStyle}:null,borderRadius:y.radius,backgroundColor:p??m.colors.surface},E=/* @__PURE__ */v(k,{children:[t?/* @__PURE__ */v(c,{style:[Ye.head,T?null:Ye.end,{columnGap:y.headGapX,rowGap:y.headGapY,marginBottom:o??y.headGap}],children:[T,t]}):T?/* @__PURE__ */w(c,{style:{marginBottom:r||n?o??y.titleGap:0},children:T}):null,r?/* @__PURE__ */w(Text,{style:[ge(m,x.cardLead),{marginBottom:n?y.leadGap:0}],children:r}):null,n]});return a?/* @__PURE__ */w(PressBox,{testID:g,...S.props,scale:S.scale,still:b,accessibilityRole:"button",accessibilityLabel:_,style:[z,h],children:E}):/* @__PURE__ */w(c,{testID:g,style:[z,h],children:E})}var Ye=d.create({head:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},shrink:{flexShrink:1},end:{justifyContent:"flex-end"}});d.create({chip:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start"}});d.create({st:{alignItems:"center",alignSelf:"stretch"},center:{textAlign:"center"},acts:{alignItems:"center",alignSelf:"stretch"},link:{alignItems:"center",justifyContent:"center"},underline:{textDecorationLine:"underline"},compact:{alignItems:"center"},iconBox:{alignItems:"center",justifyContent:"center"},pill:{alignItems:"center",justifyContent:"center"}});d.create({acts:{flexDirection:"row",flexWrap:"wrap",alignItems:"center"},st:{alignItems:"center",alignSelf:"stretch"},center:{textAlign:"center"},stActs:{alignItems:"center",alignSelf:"stretch"},link:{alignItems:"center",justifyContent:"center"},underline:{textDecorationLine:"underline"}});d.create({pill:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",maxWidth:"100%"},label:{flexShrink:1}});var Ve={strokes:[{width:2,cap:true,closed:false,points:[16,13,21.223,16.482,21.736,16.507,22,16.066,22,7.87,21.749,7.436,21.248,7.438,16,10.5]}],boxes:[{x:2,y:6,w:14,h:12,radius:2,width:2}],triangles:[],seams:[]};d.create({qty:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start"},button:{alignItems:"center",justifyContent:"center"}});d.create({row:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},compact:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},titles:{flexShrink:1},edit:{flexDirection:"row",alignItems:"center",justifyContent:"center"},pressed:{opacity:.6}});d.create({row:{flexDirection:"row",alignSelf:"stretch"},hairline:{position:"absolute",left:0,right:0},tab:{flex:1,flexBasis:0,flexDirection:"row",alignItems:"center",justifyContent:"center"},center:{flexShrink:1,textAlign:"center"}});d.create({scrim:{flex:1,justifyContent:"flex-end"},sheet:{maxHeight:"100%"},grab:{alignItems:"center",justifyContent:"center"},head:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},titles:{flexShrink:1,flexGrow:1},close:{alignItems:"center",justifyContent:"center"},closeEnd:{marginLeft:"auto"},scroll:{flexGrow:0},top:{flexDirection:"row",alignItems:"center"}});d.create({row:{flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},cardRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},value:{marginLeft:"auto",textAlign:"right"},tabular:{fontVariant:["tabular-nums"]}});d.create({row:{flexDirection:"row",alignItems:"flex-start"},noGap:{columnGap:0},box:{alignItems:"center",justifyContent:"center"},grow:{flex:1,minWidth:0}});d.create({row:{flexDirection:"row",alignItems:"center"},words:{flex:1,minWidth:0},center:{alignItems:"center",justifyContent:"center"}});d.create({hintRow:{flexDirection:"row",alignItems:"flex-start"},grow:{flex:1}});d.create({base:{alignItems:"center",justifyContent:"center",alignSelf:"flex-start"}});d.create({base:{alignSelf:"flex-start"}});d.create({track:{alignSelf:"flex-start"},thumb:{position:"absolute"}});d.create({box:{flexDirection:"row"},line:{alignItems:"center"},area:{alignItems:"stretch"},input:{flex:1,minWidth:0,margin:0,borderWidth:0,backgroundColor:"transparent"},hidden:{position:"absolute",width:1,height:1,overflow:"hidden",opacity:0}});d.create({clip:{overflow:"hidden"},center:{alignItems:"center",justifyContent:"center"},stack:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start"}});d.create({leadAuto:{flexShrink:0},words:{flex:1,minWidth:0},below:{alignSelf:"flex-start"},end:{flexDirection:"row",alignItems:"center",flexShrink:1,maxWidth:"45%",justifyContent:"flex-end"},flush:{marginTop:0}});d.create({offRow:{flexDirection:"row",alignItems:"center",alignSelf:"stretch"},offText:{flexShrink:1,minWidth:0},offAction:{flexDirection:"row",alignItems:"center",marginLeft:"auto",flexShrink:0},row:{flexDirection:"row",alignItems:"flex-start"},copy:{flex:1,minWidth:0},acts:{flexDirection:"row",flexWrap:"wrap",alignItems:"center"}});d.create({fill:{flex:1},host:{position:"absolute",left:0,right:0,alignItems:"center"},cardHost:{position:"absolute"},card:{alignSelf:"stretch"},start:{textAlign:"left"},pill:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"center",alignSelf:"center",maxWidth:"100%"},center:{textAlign:"center"},shrink:{flexShrink:1},topHost:{position:"absolute",alignItems:"center",zIndex:1e3},top:{flexDirection:"row",alignItems:"center"},copy:{flex:1}});d.create({row:{flexDirection:"row",alignItems:"center"}});function Ke(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);n<128?t+=1:n<2048?t+=2:n>=55296&&n<=56319&&r+1<e.length?(t+=4,r++):t+=3}return t}var Ze="a2ui",Qe="a2ui_cards";var Je="1.0",et=/* @__PURE__ */Object.freeze({frameBytes:16*1024,surfaceBytes:32*1024,messages:1,updates:8,depth:8,pointer:128,components:64}),tt=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]),rt=/^[A-Za-z0-9_.:-]{1,128}$/,nt=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function it(e){if(typeof e!="string"||e.length>et.pointer||!e.startsWith("/"))return null;let t=e.slice(1).split("/").map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>et.depth||t.some(e=>e===""||tt.has(e))?null:t}function ot(e,t,r){if(t===void 0||t===""||t==="/")return nt(r)?r:null;let n=it(t);if(n===null)return null;let i={...e},o=i;for(let e of n.slice(0,-1)){let t=nt(o[e])?{...o[e]}:{};o[e]=t,o=t}let a=n[n.length-1];return r===null?delete o[a]:o[a]=r,i}var at=(e,t,r)=>{let n=e.revision??t.revision??(nt(r)?r.revision:void 0);return Number.isSafeInteger(n)&&n>=0?n:null},lt=e=>e.path==="/revision"?{revision:e.value}:e.path===void 0||e.path===""||e.path==="/"?e.value:void 0;function st(e){return e.flat().slice(0,8).map(e=>nt(e)&&e.type===void 0&&"messages"in e?{type:Ze,a2ui:e}:e)}function dt(e){let t=/* @__PURE__ */new Map;for(let r of st(e)){if(!nt(r)||r.type!==Ze||!nt(r.a2ui))return{ok:false,reason:"frame"};let e;try{e=Ke(JSON.stringify(r))}catch{return{ok:false,reason:"frame"}}if(e>et.frameBytes)return{ok:false,reason:"too_large"};let n=r.a2ui,i=n.messages;if(n.version!==Je||!Array.isArray(i)||i.length>et.messages)return{ok:false,reason:"version"};let o=/* @__PURE__ */new Set;for(let e of i){if(!nt(e)||e.version!==void 0&&e.version!==Je)return{ok:false,reason:"version"};if([e.createSurface,e.updateDataModel,e.updateComponents].filter(e=>e!==void 0).length!==1)return{ok:false,reason:"message"};let r=nt(e.createSurface)?e.createSurface:null,i=nt(e.updateDataModel)?e.updateDataModel:null,a=nt(e.updateComponents)?e.updateComponents:null,l=r??i??a;if(l===null)return{ok:false,reason:"message"};let s=l.surfaceId;if(typeof s!="string"||!rt.test(s))return{ok:false,reason:"message"};let d=t.get(s);if(r!==null){if(d!==void 0)continue;let e=r.components,i=r.dataModel;if(!Array.isArray(e)||e.length>et.components||!(i===void 0||nt(i)))return{ok:false,reason:"message"};let a={surfaceId:s,catalogId:r.catalogId,revision:at(r,n,i)??0,components:e.filter(nt),dataModel:i??{},updates:0,bytes:0};t.set(s,a),o.add(a);continue}if(d===void 0)continue;let c=at(l,n,i===null?void 0:lt(i));if(!(c===null||c<=d.revision)){if(++d.updates>et.updates)return{ok:false,reason:"updates"};if(i!==null){if(i.value===void 0)return{ok:false,reason:"message"};let e=ot(d.dataModel,i.path,i.value);if(e===null)return{ok:false,reason:"pointer"};d.dataModel=e}else{let e=l.components;if(!Array.isArray(e))return{ok:false,reason:"message"};let t=new Map(d.components.map(e=>[e.id,e]));for(let r of e)nt(r)&&typeof r.id=="string"&&t.set(r.id,r);if(t.size>et.components)return{ok:false,reason:"message"};d.components=[...t.values()]}d.revision=c,o.add(d)}}for(let t of o)if(t.bytes+=e,t.bytes>et.surfaceBytes)return{ok:false,reason:"too_large"}}return{ok:true,surfaces:[...t.values()].map(e=>({surfaceId:e.surfaceId,catalogId:e.catalogId,revision:e.revision,components:e.components,dataModel:e.dataModel}))}}var ct="everfur_chat_cards_v1",ut="chat.cards",pt=/* @__PURE__ */Object.freeze({cards:4,buttons:3,text:200}),ft=["visit"],gt=["book_vet"],ht=["caution"],mt=["ink","outline"],bt=["urgency_soon"],yt=/^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*){0,4}$/,wt=/^[A-Za-z0-9_.-]{1,64}$/,vt=/* @__PURE__ */new Set(["CardStack","ChatCard","ActionRow","ActionButton"]),kt=/<\s*[A-Za-z/!?]|&[A-Za-z#][A-Za-z0-9]*;/,xt=/[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u2028-\u202e\u2060-\u2064\u2066-\u2069\ufeff]/,_t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),St=(e,t)=>e.includes(t);function Tt(e,t){let r=it(t);if(r===null)return;let n=e;for(let e of r)if(nt(n)&&_t(n,e))n=n[e];else return;return n}var Ct=e=>typeof e=="string"&&e.trim()!==""&&e.length<=pt.text&&!kt.test(e)&&!xt.test(e),Ft=class{constructor(e){this.model=e;this.reason=null;this.byId=/* @__PURE__ */new Map;this.used=/* @__PURE__ */new Set(["root"])}refuse(e){return this.reason??=e,null}index(e){for(let t of e){let e=t.id;if(typeof e!="string"||!wt.test(e)||this.byId.has(e))return this.refuse("surface")??false;if(!vt.has(t.component))return this.refuse("component")??false;this.byId.set(e,t)}return true}node(e){return this.byId.get(e)}unused(){return this.byId.size-[...this.used].filter(e=>this.byId.has(e)).length}take(e,t){let r=typeof e=="string"&&!this.used.has(e)?this.byId.get(e):void 0;return r?.component!==t?this.refuse("component"):(this.used.add(e),r)}children(e,t,r){let n=e.children??[];return Array.isArray(n)?n.length>r?this.refuse("limit"):n.length<t?this.refuse("component"):n:this.refuse("component")}text(e,t,r){if(!_t(e,t))return r?void 0:this.refuse("text");let n=e[t],i=nt(n)&&Object.keys(n).length===1?Tt(this.model,n["@path"]):void 0;return Ct(i)?i:this.refuse("text")}pick(e,t){return St(e,t)?t:this.refuse("component")}action(e){let t=nt(e)&&Object.keys(e).length===1&&nt(e.functionCall)?e.functionCall:null,r=t!==null&&nt(t.args)&&Object.keys(t.args).length===1?t.args:null;if(t===null||r===null)return this.refuse("action");switch(t["@call"]){case"navigate":return St(ft,r.route)?{kind:"navigate",route:r.route}:this.refuse("action");case"track":return typeof r.event=="string"&&yt.test(r.event)?{kind:"track",event:r.event}:this.refuse("action");default:return this.refuse("action")}}button(e){let t=this.take(e,"ActionButton");if(t===null)return null;let r=t["@accessibility"],n=this.text(t,"label",false),i=nt(r)?this.text(r,"label",false):this.refuse("text"),o=this.pick(mt,t.tone),a=this.action(t.action);return n==null||i==null||o===null||a===null?null:{id:t.id,label:n,a11y:i,tone:o,action:a}}card(e){let t=this.take(e,"ChatCard"),r=t===null?null:this.children(t,0,1);if(t===null||r===null)return null;let n=[];for(let e of r){let t=this.take(e,"ActionRow"),r=t===null?null:this.children(t,1,pt.buttons);if(r===null)return null;for(let e of r){let t=this.button(e);if(t===null)return null;n.push(t)}}let i=this.pick(gt,t.card),o=this.pick(ht,t.tone),a=this.text(t,"title",false),l=this.text(t,"body",true);return i===null||o===null||a==null||l===null?null:{id:t.id,card:i,tone:o,title:a,body:l??null,buttons:n}}};function zt(e){if(e.catalogId!==ct)return{refused:"catalog"};let t=e.dataModel,r=new Ft(t),n=()=>({refused:r.reason??"surface"});if(!r.index(e.components))return n();let i=r.node("root");if(i?.component!=="CardStack")return{refused:"surface"};let o=r.children(i,1,pt.cards);if(o===null)return n();let a=[];for(let e of o){let t=r.card(e);if(t===null)return n();a.push(t)}let l=Array.isArray(t.covers)?bt.filter(e=>t.covers.includes(e)):[];return{cards:a,covers:l,unused:r.unused()}}function Et(e){let t=dt(e);if(!t.ok)return t;let r=[],n=/* @__PURE__ */new Set,i=0;for(let e of t.surfaces){let t=zt(e);if("refused"in t)return{ok:false,reason:t.refused};r.push(...t.cards);for(let e of t.covers)n.add(e);i+=t.unused}return r.length>pt.cards?{ok:false,reason:"limit"}:r.length===0?{ok:false,reason:"empty"}:{ok:true,cards:{surfaceIds:t.surfaces.map(e=>e.surfaceId),cards:r,covers:[...n],unused:i}}}function It(petRef,e){let t={entry:"chat",petRef:petRef};return e?.returnTo!==void 0&&(t.returnTo=e.returnTo),e?.usState!==void 0&&(t.usState=e.usState),e?.prefer!==void 0&&(t.prefer=e.prefer),t}function ok(e,t){/* @__PURE__ */
6
+ return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
7
+ return Object.freeze({ok:false,error:e})}var Ot=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var Ht=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),Dt=globalThis,Bt=Dt[Ht]??(Dt[Ht]=createContext(null));Bt.displayName??="EverfurContext";function At(){let e=n(Bt);if(e===null)throw new Ot("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}var Rt=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"timezone_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],jt=/* @__PURE__ */Object.freeze(Rt.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(jt.map(e=>e.wireCode));var Mt=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",anonTokenInvalid:"authRejected",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound",timezone_invalid:"validationFailed"}),Wt=/* @__PURE__ */Object.freeze(jt.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Mt[e.wireCode]}))),Pt=new Map(Wt.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Lt=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(Wt.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...Lt]){let t=Pt.get(e+r);if(t)return t}}var Nt=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(e){return Nt[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var qt=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return qt.has(e)}var Ut=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||Ut.has(e)}var Gt=500,$t=8e3,Xt=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(Gt*2**r,$t);return Math.floor(t()*n)}var Yt="This feature isn't available on your account right now.",Vt="Something in that request was not right. Check the details and try again.",Kt=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:Yt,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:Vt,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:Yt,runtimeDisposed:Vt,unknown:"Something went wrong. Please try again."}),Zt="This session has ended. Please sign in again.",Qt="linked_account_read_only";function Jt(e,t,r){return e==="conflict"&&r===Qt?Yt:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?Zt:userFacingError(e)}function userFacingError(e){return Kt[e]}function er(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var tr=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===Qt,i={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:Jt(e,t?.wireCode,n?Qt:null)};t?.httpStatus!==void 0&&(i.httpStatus=t.httpStatus),t?.requestId&&(i.requestId=t.requestId),typeof t?.reasonCode=="string"&&tr.test(t.reasonCode)&&(i.reasonCode=t.reasonCode);let o=t?.retryAfterSeconds;if(typeof o=="number"&&Number.isFinite(o)&&o>=0&&(i.retryAfterSeconds=Math.round(o)),r);return t?.wireMessage&&er(i,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&er(i,"raw",t.raw),/* @__PURE__ */Object.freeze(i)}function errorFrame(e){/* @__PURE__ */
8
+ return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var rr="x-everfur-anon-token",nr="anonTokenInvalid";async function ir(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function or(e,t){let r=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...r?{wireMessage:r}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[rr]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...ar(e.headers),...authHeaders(t)}}}function ar(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e)){let e=r.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===rr||(t[r]=n)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let r=await ir(t),n=await t.transport.request(withAuthHeaders(e,lr(t,r)));if(n.ok||dr(n.error.raw)!==nr||t.anonIdentity===void 0||t.userRef!==null)return n;let i=await t.anonIdentity.token({forceRefresh:true});return i===null||i===r?n:t.transport.request(withAuthHeaders(e,lr(t,i)))}let r;try{r=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(or(e))}let n=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let i;try{i=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(or(e,{wireCode:dr(n.error.raw),requestId:n.error.requestId}))}let o=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!o.ok&&o.error.httpStatus===401?(t.identity.reportRejected?.(),err(sr(o.error))):o}function lr(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function sr(e){let t=e.raw,r=dr(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...r?{wireCode:r}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function dr(e){if(typeof e!="object"||e===null)return null;let t=e,r=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof r=="string"&&r.length>0?r:null}function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:cr(e)})}function cr(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var ur=3e4,pr=$t*2,fr="idempotency-key",gr=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),hr=/* @__PURE__ */Object.freeze({onEvent(){}}),mr=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function br(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??hr,r=e.timers??mr,n=e.rng??Math.random,i=e.sleep??((e,t)=>Dr(e,r,t)),o=e.maxAttempts??Xt,a=e.unaryTimeoutMs??ur,l=e.newIdempotencyKey??wr(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,c){let u=c?.maxAttempts,p=Math.max(1,u??o),f=c?.idempotent??gr.has(d.method),g=c?.idempotencyKey===void 0?null:br(c.idempotencyKey),h=f?g??l():null,m=yr(d,h),b=0;for(;;){let o=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:b,...h?{idempotencyKey:h}:{},...e});s(o({phase:"attempt"}));let l=Or(a,r),c=Hr(l.signal,d.signal),f;try{f=await authedSend({...m,signal:c.signal},e.auth)}catch(e){f=err(networkError(e))}finally{c.dispose(),l.cancel()}if(f.ok)return s(o({phase:"settled",ok:true,reason:"ok"})),f;let g=f.error,y=kr(g,b,{maxAttempts:p,rng:n,now:r.now(),aborted:d.signal?.aborted===true,...u!==void 0?{perCallMaxAttempts:u}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),w={ok:false,code:g.code,reason:y.reason,...g.httpStatus!==void 0?{httpStatus:g.httpStatus}:{},...g.requestId!==void 0?{requestId:g.requestId}:{}};if(!y.retry)return s(o({phase:"settled",...w})),err(g);if(s(o({phase:"retry",...w,delayMs:y.delayMs})),await i(y.delayMs,d.signal),d.signal?.aborted===true)return s(o({phase:"settled",...w,reason:"aborted"})),err(g);b+=1}}async function c(t){return withAuthHeaders(t,await Ir(e.auth))}async function*u(t,r,n){s(
9
+ /* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:r.method,path:r.path,attempt:0}));try{yield*e.auth.transport.stream(r,n)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
10
+ return Object.freeze({send:d,authorize:c,stream:u})}function yr(e,t){let r={};for(let[t,n]of Object.entries(e.headers??{}))t.toLowerCase()!==fr&&(r[t]=n);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}function wr(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var vr=10;function kr(e,t,r){if(r.aborted)return{retry:false,reason:"aborted"};let n=xr(e);if(n==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let i=n==="burst"?"burst-throttle":"retryable-code";if((()=>{if(r.policy===void 0)return false;try{return!r.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let o=()=>{if(r.policy===void 0)return null;let t;try{t=r.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(vr,Math.floor(t)))},a=r.perCallMaxAttempts??o()??r.maxAttempts;if(t+1>=a)return{retry:false,reason:"attempts-exhausted"};let l=_r(e,r.now);return l!==null?l>pr?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:l}:{retry:true,reason:i,delayMs:backoffDelayMs(t,r.rng)}}function xr(e){let t=e.code==="unknown"?fromWire(zr(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function _r(e,t){let r=Tr(e.raw);if(r!==null){let e=r-t;return e>0?e:0}let n=Sr(e.raw);return n===null?null:Math.round(n*1e3)}function Sr(e){for(let t of Cr(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function Tr(e){for(let t of Cr(e)){let e=t.resets_at,r=Fr(e);if(r!==null)return r}return null}function Cr(e){if(!Er(e))return[];let t=[e];for(let r of["error","detail"]){let n=e[r];Er(n)&&t.push(n)}return t}function Fr(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}function zr(e){for(let t of Cr(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function Er(e){return typeof e=="object"&&e!==null}async function Ir(e){if(e.mode==="anonymous"){let t=await ir(e);return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}return{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}function Or(e,t){let r=new AbortController,n=t.setTimeout(()=>r.abort(),e);return{signal:r.signal,cancel:()=>t.clearTimeout(n)}}function Hr(e,t){let r=()=>{};if(!t)return{signal:e,dispose:r};let n=new AbortController;if(e.aborted||t.aborted)return n.abort(),{signal:n.signal,dispose:r};let i=()=>n.abort();return e.addEventListener("abort",i,{once:true}),t.addEventListener("abort",i,{once:true}),{signal:n.signal,dispose:()=>{e.removeEventListener("abort",i),t.removeEventListener("abort",i)}}}function Dr(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(n=>{let i=t.setTimeout(()=>{r?.removeEventListener("abort",o),n()},e),o=()=>{t.clearTimeout(i),n()};r?.addEventListener("abort",o,{once:true})})}var Br=/* @__PURE__ */Object.freeze(["visit","join","summary","messages"]);function isVetVisitIntent(e){return typeof e=="string"&&Br.includes(e)}var Ar="/widget/v1/televet/handoffs",Rr="/widget/v1/televet/availability",jr="/widget/v1/televet/chat-entry",Mr=/^[a-z0-9][a-z0-9_-]{0,39}$/,Wr=/^[A-Za-z0-9_-]{22}$/;var Pr=32,Lr=128,Nr=64;function vetVisitErrorReasonOf(e){let t=e.httpStatus;switch(e.code){case"sessionRequired":return"sessionRequired";case"authExpired":case"authRejected":return"authRejected";case"sdkUpdateRequired":return"sdkUpdateRequired";case"validationFailed":return"invalidRequest";case"rateLimited":case"quotaExceeded":return"rateLimited"}return t===void 0?e.code==="internalError"?"network":"unknown":t===429?"rateLimited":t===404?"unavailable":t===403?"accessDenied":t===401?"authRejected":t===400||t===422?"invalidRequest":t>=500?"serverError":"unknown"}function qr(e){return err(makeEverfurError("validationFailed",{retryable:false,wireMessage:e}))}function Ur(e){return err(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}function Gr(petRef,e){let t={};petRef!==void 0&&(t.pet_ref=petRef);let r=e?.returnTo;if(r!=null){if(typeof r!="string"||!Mr.test(r))return{ok:false,message:"returnTo must be a registered return destination key"};t.return_to=r}let n=e?.entry;if(n!=null){if(n!=="chat"||petRef===void 0)return{ok:false,message:"entry 'chat' needs the pet the chat is about"};t.entry=n}let i=e?.visitRef,o=e?.intent,a=i!=null;if(a){let e=typeof i=="string"?i.trim():"";if(e.length<1||[...e].length>Nr)return{ok:false,message:`visitRef must be 1..${Nr} characters`};t.visit_ref=e}if(o!=null){if(!a)return{ok:false,message:"intent needs the visitRef it opens"};if(!isVetVisitIntent(o))return{ok:false,message:`intent must be one of ${Br.join(", ")}`};t.intent=o}return{ok:true,body:t}}function $r(e){if(typeof e!="object"||e===null)return null;let{visit_ref:t,intent:r}=e;return typeof t!="string"||t.length===0||!isVetVisitIntent(r)?null:/* @__PURE__ */Object.freeze({visitRef:t,intent:r})}function Xr(e){let t=e.funnel??createRequestFunnel({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=e.telemetry,n=e=>(Jr(r,"televet.visit.handoff_failed",{reason:vetVisitErrorReasonOf(e)}),err(e));return{async createHandoff(petRef,e){let i;if(petRef!=null){let e=typeof petRef=="string"?[...petRef].length:0;if(e<1||e>Lr)return n(makeEverfurError("validationFailed",{retryable:false,wireMessage:`pet_ref must be 1..${Lr} characters`}));i=petRef}let o=Gr(i,e);if(!o.ok){let e=qr(o.message);return e.ok?e:n(e.error)}let a=o.body,l=await t.send("televet.visit.handoff",{method:"POST",path:Ar,body:a},{idempotent:false,maxAttempts:1});if(!l.ok)return n(l.error);let s=Yr(l.value),d=a.return_to!==void 0,c=d?l.value?.flow_id:void 0;if(d&&(typeof c!="string"||!Wr.test(c))){let e=Ur("the handoff response carried no usable return flow id");return e.ok?e:n(e.error)}let u=a.visit_ref!==void 0,p=u?$r(l.value?.visit):null;if(u&&p===null){let e=Ur("the handoff response did not confirm the visit it opens");return e.ok?e:n(e.error)}let f=s===null?null:/* @__PURE__ */Object.freeze({...s,...d?{flowId:c}:{},...p!==null?{visit:p}:{}});return f===null?n(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:"the handoff response carried no usable visit url"})):(Jr(r,"televet.visit.handoff_created",{pet_scoped:a.pet_ref!==void 0}),ok(f))},async checkAvailability(e){if(typeof e!="string"||e.length>Pr)return qr(`state must be at most ${Pr} characters`);let r=await t.send("televet.visit.availability",{method:"POST",path:Rr,body:{state:e}},{idempotent:false,maxAttempts:1});if(!r.ok)return err(r.error);let n=r.value?.available;return typeof n!="boolean"?Ur("the availability response carried no usable answer"):ok(/* @__PURE__ */Object.freeze({available:n}))},async chatEntryOpen(){try{let e=await t.send("televet.visit.chat_entry",{method:"GET",path:jr},{maxAttempts:1});return e.ok&&e.value?.open===!0}catch{return false}}}}function Yr(e){if(typeof e!="object"||e===null)return null;let{url:t,expires_at:r}=e;return typeof t!="string"||typeof r!="string"||r.length===0||!Qr(t)?null:/* @__PURE__ */Object.freeze({url:t,expiresAt:r})}var Vr=/* @__PURE__ */new Set(["localhost","127.0.0.1","[::1]"]),Kr=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/,Zr=/[\s\u0000-\u001f\u007f]/;function Qr(e){if(Zr.test(e))return false;let t=Kr.exec(e);if(t===null)return false;let r=(t[1]??"").toLowerCase(),n=t[2]??"";if(n.length===0||n.includes("@"))return false;let i=n.replace(/:\d+$/,"").toLowerCase(),o=r==="https",a=r==="http"&&Vr.has(i);if(!o&&!a)return false;let l=e.indexOf("#");if(l<0)return false;let s=e.slice(l);return s.startsWith("#h=")&&s.length>3}function Jr(e,t,r){if(e)try{e.track(t,r)}catch{}}var en=/* @__PURE__ */Object.freeze({chat:/* @__PURE__ */Object.freeze(["chat.message.create"]),records:/* @__PURE__ */Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:/* @__PURE__ */Object.freeze(["records.clinic.create"]),video:/* @__PURE__ */Object.freeze(["video.gait.execute"]),photo:/* @__PURE__ */Object.freeze(["photo.checkup.execute"]),animations:/* @__PURE__ */Object.freeze(["animations.state.read"]),televet:/* @__PURE__ */Object.freeze(["televet.visit.create"]),texting:/* @__PURE__ */Object.freeze(["sms.identity.read","sms.identity.update"]),healthPlan:/* @__PURE__ */Object.freeze(["shop.plan.read","shop.plan.update"])});function requires(e){return en[e]}function decideCapability(e,t,r){let n=requires(e),i=/* @__PURE__ */new Map;for(let e of t)i.set(e.resource,e);if(r?.isPending===true&&n.some(e=>!i.has(e)))return nn({name:e,enabled:false,isPending:true,limits:{}});let o=tn(n,i);return n.filter(e=>i.get(e)?.granted!==true).length===0?nn({name:e,enabled:true,isPending:false,limits:o}):nn({name:e,enabled:false,isPending:false,limits:o,disabled:rn(n,i)})}function tn(e,t){let r={};for(let n of e){let e=t.get(n)?.limits;if(e)for(let[t,n]of Object.entries(e)){let e=r[t];r[t]=e===void 0?n:Math.min(e,n)}}return r}function rn(e,t){for(let r of e){let e=t.get(r)?.disabled;if(e)/* @__PURE__ */
11
+ return Object.freeze({reason:e.reason,level:e.level,recoverable:e.recoverable})}/* @__PURE__ */
12
+ return Object.freeze({reason:userFacingError("accessDenied"),level:"user_entitlement",recoverable:false})}function nn(e){let t={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:/* @__PURE__ */Object.freeze({...e.limits})};return e.disabled!==void 0&&(t.disabled=e.disabled),/* @__PURE__ */Object.freeze(t)}function useCapability(t){let{runtime:r}=At(),n=r.entitlements,i=s(n.subscribe,n.getSnapshot,n.getSnapshot);return e(()=>decideCapability(t,i.decisions,{isPending:i.isPending}),[t,i])}function on(e,...t){}var an=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function ln(){let e=globalThis,t=e[an];if(t!==void 0)return t;let r={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return e[an]=r,r}function sn(e){let t=ln();t.snapshot=/* @__PURE__ */Object.freeze({...t.snapshot,...e});for(let e of[...t.listeners])try{e()}catch{}}function dn(e){let t=ln().presenter;if(t===null)return"absent";try{return t(e)===!1?"declined":"presented"}catch(e){return console.warn("[everfur] Your registerEverfurTelevetFlow presenter threw; the in-app visit opened instead.",e),"threw"}}function cn(){return ln().hosts.length>0}function un(e){if(!cn())return false;let t=/* @__PURE__ */Object.freeze({...e});return sn({request:t,serial:ln().snapshot.serial+1}),true}var pn=false;function fn(e,t){return t!==void 0?(on(t,e),"onStartInApp"):dn(e)==="presented"?"presenter":un(e)?"experience":(pn||(pn=true,console.warn("[everfur] A vet visit had nowhere to open: mount <EverfurTelevetHost /> in your EverfurProvider, or pass prefer: 'redirect'.")),null)}var gn=/* @__PURE__ */Object.freeze({status:"idle",error:null,errorReason:null});function hn(e,r,n){let{usState:i,chat:o,scope:l}=n,s=r&&(i!==null||o),d=`${i??""}|${o?"chat":""}`,[c,u]=a(null);if(t(()=>{if(!s)return;let t=true,r=e.current;return u(null),(async()=>{try{if(o&&!(r.chatEntryOpen&&await r.chatEntryOpen()))return!1;if(i===null)return!0;if(!r.checkAvailability)return!1;let e=await r.checkAvailability(i);return e.ok&&e.value.available}catch{return false}})().then(e=>{t&&u({key:d,open:e})}),()=>{t=false}},[s,d,i,o,l,e]),!s)return null;let p=c!==null&&c.key===d;return{open:p&&c.open,pending:!p}}var mn=/* @__PURE__ */Object.freeze({status:"opening",error:null,errorReason:null});function bn(t,r={}){let{runtime:n,userRef:userRef,scopeEpoch:i}=At(),s=useCapability("televet"),d=s.enabled&&userRef!==null,c=r.usState??null,u=r.entry==="chat",p=r.petRef??null,f=r.prefer==="redirect",g=e(()=>{if(r.controller)return r.controller;let{services:e}=n.registry;return Xr({auth:e.authFor(userRef),telemetry:e.telemetry,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}})},[n,userRef,i,r.controller]),h=o(g);h.current=g;let m=e(()=>({runtime:n,userRef:userRef,scopeEpoch:i}),[n,userRef,i]),b=hn(h,d,{usState:c,chat:u,scope:m}),y=d&&(b===null||b.open)&&(!u||p!==null),w=r.returnTo??null,[v,k]=a(gn),x=o(null),_=o({runtime:n,userRef:userRef,scopeEpoch:i});_.current={runtime:n,userRef:userRef,scopeEpoch:i};let S=o(g);S.current=g;let T=o(y);T.current=y;let C=l((petRef,e)=>{if(x.current)return x.current;let r=(e,t)=>(k({status:e==="cancelled"?"idle":"error",error:t,errorReason:e==="cancelled"?null:e}),/* @__PURE__ */Object.freeze({opened:false,reason:e,error:t}));if(!T.current)return Promise.resolve(r("unavailable",null));let n=t.prepare();if(!n.ok)return Promise.resolve(r(n.reason,null));let i=_.current,o=S.current;k(mn);let a=(async()=>{let a,l={...w!==null?{returnTo:w}:{},...u?{entry:"chat"}:{},...e!==null?{visitRef:e.visitRef}:{},...e!==null&&e.intent!==null&&e.intent!==void 0?{intent:e.intent}:{}},s=Object.keys(l).length===0?void 0:l,d=petRef===void 0?p:petRef;try{a=await(s===void 0?o.createHandoff(d):o.createHandoff(d,s))}catch{return t.abandon(n.value),r("unknown",null)}let c=_.current;if(c.runtime!==i.runtime||c.userRef!==i.userRef||c.scopeEpoch!==i.scopeEpoch)return t.abandon(n.value),r("cancelled",null);if(!a.ok)return t.abandon(n.value),r(vetVisitErrorReasonOf(a.error),a.error);let f=await t.finish(n.value,a.value);return f!==null?r(f,null):(k(gn),/* @__PURE__ */Object.freeze(a.value.flowId===void 0?{opened:true}:{opened:true,flowId:a.value.flowId}))})().finally(()=>{x.current===a&&(x.current=null)});return x.current=a,a},[t,p,w,u]),F=l((petRef,e)=>{if(!T.current)return k({status:"error",error:null,errorReason:"unavailable"}),Promise.resolve(/* @__PURE__ */Object.freeze({opened:false,reason:"unavailable",error:null}));let t=petRef===void 0?p:petRef,r={...t!==null?{petRef:t}:{},...c!==null?{usState:c}:{},...e!==null&&"consultId"in e?{consultId:e.consultId}:{},...e!==null&&"visitRef"in e?{visitRef:e.visitRef,intent:e.intent}:{}};return fn(r)===null?(k({status:"error",error:null,errorReason:"unavailable"}),Promise.resolve(/* @__PURE__ */Object.freeze({opened:false,reason:"unavailable",error:null}))):(k(gn),Promise.resolve(/* @__PURE__ */Object.freeze({opened:true})))},[p,c]),z=l(petRef=>f?C(petRef,null):F(petRef,null),[f,C,F]),E=l((e,t)=>f?C(void 0,{visitRef:e,intent:t??null}):F(void 0,{visitRef:e,intent:t??null}),[f,C,F]),I=l(e=>f?C(void 0,null):F(void 0,{consultId:e.trim()}),[f,C,F]);return{available:y,isPending:s.isPending||(b?.pending??false),status:v.status,error:v.error,errorReason:v.errorReason,open:z,openVisit:E,joinVisit:I}}var yn=e=>g.openURL(e);function useVetVisit(t={}){let{openUrl:r,...n}=t,i=e(()=>{let e=r??yn;return{prepare:()=>({ok:true,value:null}),async finish(t,r){try{return await e(r.url),null}catch{return"openFailed"}},abandon:()=>{}}},[r]);return bn(i,n)}var wn=class extends i{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey}}static getDerivedStateFromError(){return{failed:true}}static getDerivedStateFromProps(e,t){return Object.is(e.resetKey,t.key)?null:{failed:false,key:e.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};function RenderHost({render:e}){return e()}function HostRender({render:e,fallback:t,resetKey:n}){return r(wn,{fallback:t,resetKey:n,children:r(RenderHost,{render:e})})}var vn=/* @__PURE__ */Object.freeze({display:/* @__PURE__ */Object.freeze({size:29,lineHeight:1.06,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),title:/* @__PURE__ */Object.freeze({size:23,lineHeight:1.12,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),cardTitle:/* @__PURE__ */Object.freeze({size:19,lineHeight:1.22,weight:"800",face:"sans",letterSpacing:0,uppercase:false,tier:"heading"}),rowTitle:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.4,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),body:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),message:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),bodySmall:/* @__PURE__ */Object.freeze({size:14.5,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),caption:/* @__PURE__ */Object.freeze({size:13,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),label:/* @__PURE__ */Object.freeze({size:10.5,lineHeight:1.4,weight:"400",face:"mono",letterSpacing:.05,uppercase:true,tier:"compact"}),eyebrow:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"mono",letterSpacing:.07,uppercase:true,tier:"compact"}),chip:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.3,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),tab:/* @__PURE__ */Object.freeze({size:16,lineHeight:1.5,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"control"}),badge:/* @__PURE__ */Object.freeze({size:12,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"badge"})});var kn=Object.freeze;function xn(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){kn(e);for(let t of Object.keys(e))xn(e[t])}return e}var _n=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var Sn={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Tn={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Cn={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},Fn={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},zn={regular:"400",medium:"500",bold:"700"},En={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},In=0,On="System",Hn="monospace",Dn=["content","heading","control","compact","badge"];function Bn(e){let t={};for(let r of Dn)t[r]=e;return t}var An=[];function Rn(){return{family:On,mono:Hn,fontUrl:null,families:{regular:On,medium:On,bold:On,mono:Hn,monoMedium:Hn,monoBold:Hn},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Cn,tierSizes:Bn(Cn),lineHeight:Fn,weight:zn,letterSpacing:En,scale:1,maxScale:In,scaleCaps:_n,headingFamily:null,headingWeight:null,fontSources:An,roles:vn,typeScale:1}}var jn={},Mn=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(e){return`cubic-bezier(${e.join(", ")})`}var Wn={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(Mn.standard),emphasized:cssCubicBezier(Mn.emphasized),exit:cssCubicBezier(Mn.exit)},reducedMotion:false},Pn={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},Ln=xn({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:Pn,space:Sn,radius:Tn,type:Rn(),motion:Wn,slots:jn}),Nn={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"},qn=xn({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:Nn,space:Sn,radius:Tn,type:Rn(),motion:Wn,slots:jn});var Un=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,n=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:n}:{fontFamily:n,fontWeight:r.weight[Un[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:n}=e.type;if(r===null&&n===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:n??e.type.weight[Un[t]]};let i=face(e,t);return i.fontWeight===void 0||n===null?i:{fontFamily:i.fontFamily,fontWeight:n}}function Gn(e){if(typeof e=="number")return Yn(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return $n(t.slice(1));if(t.toLowerCase().startsWith("0x"))return $n(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return Xn(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=$n(t);if(e!==null)return e}return/^\d+$/.test(t)?Yn(Number.parseInt(t,10)):null}function $n(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:Kn(t[0]),g:Kn(t[1]),b:Kn(t[2]),a:1};if(t.length===6)return{r:Vn(t,0),g:Vn(t,2),b:Vn(t,4),a:1};if(t.length===8){let e=Vn(t,0);return{r:Vn(t,2),g:Vn(t,4),b:Vn(t,6),a:e/255}}return null}function Xn(e){let t=e.indexOf("("),r=e.indexOf(")");if(t<0||r<0||r<t)return null;let n=e.slice(t+1,r).split(",").map(e=>e.trim());if(n.length<3)return null;let i=Zn(Number(n[0])),o=Zn(Number(n[1])),a=Zn(Number(n[2]));if(i===null||o===null||a===null)return null;let l=1;if(n.length>=4){let e=Number(n[3]);if(!Number.isFinite(e))return null;l=Math.min(1,Math.max(0,e))}return{r:i,g:o,b:a,a:l}}function Yn(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,r=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:r===0?1:r/255}}function Vn(e,t){return Number.parseInt(e.slice(t,t+2),16)}function Kn(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function Zn(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function Qn(e,t,r){return`#${Jn(e)}${Jn(t)}${Jn(r)}`.toUpperCase()}function Jn(e){return e.toString(16).padStart(2,"0")}var ei="#111111",ti="#FFFFFF",ri="#000000";function readableOn(e){let t=Gn(e);if(t===null)return ti;let r=oi(t),n=oi({r:17,g:17,b:17}),i=oi({r:255,g:255,b:255});return li(r,i)>=li(r,n)?ti:ei}function ni(e,t){let r=readableOn(e);return contrastRatio(r,e)>=t?r:contrastRatio(ti,e)>=contrastRatio(ri,e)?ti:ri}function ii(e){let t=t=>e.reduce((e,r)=>Math.min(e,contrastRatio(t,r)),Number.POSITIVE_INFINITY);return t(ti)>=t(ri)?ti:ri}function oi(e){let t=ai(e.r/255),r=ai(e.g/255),n=ai(e.b/255);return.2126*t+.7152*r+.0722*n}function ai(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function li(e,t){let r=Math.max(e,t),n=Math.min(e,t);return(r+.05)/(n+.05)}function contrastRatio(e,t){let r=Gn(e),n=Gn(t);if(r===null||n===null)return 1;let i=n.a>=1?n:{...n},o=r.a>=1?r:si(r,i);return li(oi(o),oi(i))}function si(e,t){let r=e.a,n=(e,t)=>Math.round(e*r+t*(1-r));return{r:n(e.r,t.r),g:n(e.g,t.g),b:n(e.b,t.b),a:1}}function di(e,t){let r=Gn(e),n=Gn(t);if(r===null||n===null)return null;let i=r.a>=1?r:si(r,{...n});return Qn(i.r,i.g,i.b)}var ci=.05;function ui(e,t,r,n){let i=t[0];if(i===void 0)return r;let o=e=>t.every(t=>contrastRatio(e,t)>=n);if(Gn(e)===null)return r;if(o(e))return e;let a=di(e,i),l=a===null?null:Gn(a),s=Gn(r);if(l===null||s===null)return r;for(let e=1;e<1/ci;e+=1){let t=e*ci,r=(e,r)=>Math.round(e+(r-e)*t),n=Qn(r(l.r,s.r),r(l.g,s.g),r(l.b,s.b));if(o(n))return n}return r}var pi=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),fi=/* @__PURE__ */new WeakMap;function gi(e){let t=fi.get(e);if(t!==void 0)return t;let r=e.color,n=e.brightness==="dark",i=n?{dark:n,ink:r.text.primary,ink2:r.text.secondary,ink3:r.text.muted,paper:r.background,card:r.surface,line:r.borderRingCream,tile:r.surfaceSubtle,shadow:r.shadow,riskBg:r.badgeBgCritical,riskInk:r.danger,riskDot:r.danger,clearBg:r.badgeBgPositive,clearInk:r.success,clearDot:r.success,watchDot:r.warningStrong}:{dark:n,...pi},o=(e,t)=>ui(e,t,ii(t),hi),a=(e,t)=>contrastRatio(e,t)>=hi?e:ni(t,hi),l=[i.card,i.paper].map(e=>di(r.brandSoft,e)??e),s={primary:r.primary,onPrimary:a(r.onPrimary,r.primary),accent:r.accent,onAccent:a(r.onAccent,r.accent),link:o(r.linkInk,[i.card,i.paper,i.tile]),badge:r.brandSoft,onBadge:o(r.brandInk,l)},d=/* @__PURE__ */Object.freeze({...i,...s});return fi.set(e,d),d}var hi=4.5;var mi=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),bi=globalThis,yi=bi[mi]??(bi[mi]=createContext(Ln));yi.displayName??="EverfurThemeContext";function useEverfurTheme(){return n(yi)}var wi=e=>{let t=e.type.namedFaces,r=t=>face(e,t).fontFamily;return{family:r("regular"),mono:r("mono"),faces:{regular:r("regular"),medium:r("medium"),bold:r("bold"),mono:r("mono"),monoBold:r("monoBold"),serif:headingFace(e,"bold").fontFamily},namedFaces:t.regular&&t.medium&&t.bold}},vi=/* @__PURE__ */new WeakMap;function ki(e,t,r=z){if(r!==z)return xi(e,t,r);let n=vi.get(t);n===void 0&&vi.set(t,n=/* @__PURE__ */new WeakMap);let i=n.get(e);return i===void 0&&n.set(e,i=xi(e,t,r)),i}function xi(e,t,r){let n=e.color,i=Ln.color,o=e.brightness==="dark",a=o?qn:Ln,l=e=>n[e]!==i[e],s={};if(l("primary")?(Object.assign(s,{ink:n.primary,onInk:n.onPrimary,focus:n.primary}),l("accent")||Object.assign(s,{go:n.primary,onGo:n.onPrimary})):l("onPrimary")&&(s.onInk=n.onPrimary),l("accent")&&Object.assign(s,{go:n.accent,onGo:n.onAccent}),l("brandSoft")&&(s.tintSage=n.brandSoft),l("danger")&&Object.assign(s,{alert:n.danger,alertDeep:n.danger}),o)Object.assign(s,{bg:n.background,surface:n.surface,text:n.text.primary,muted:n.text.muted,line:n.borderRingCream});else{let e=a.color;n.background!==e.background&&(s.bg=n.background),n.surface!==e.surface&&(s.surface=n.surface),n.text.primary!==e.text.primary&&(s.text=n.text.primary),n.text.muted!==e.text.muted&&(s.muted=n.text.muted)}let d={};Object.keys(s).length>0&&(d.colors={...s});let c=e.radius,u=a.radius;if(c.xs!==u.xs||c.sm!==u.sm||c.lg!==u.lg||c.xl!==u.xl||c.pill!==u.pill){let e={};c.xs!==u.xs&&(e.sm=c.xs),c.sm!==u.sm&&(e.md=c.sm),c.lg!==u.lg&&(e.lg=c.lg),c.xl!==u.xl&&(e.xl=c.xl),c.pill!==u.pill&&(e.pill=c.pill),d.radius=e,(c.lg!==u.lg||c.xl!==u.xl)&&(d.metrics={...c.lg!==u.lg?{card:{radius:c.lg},summary:{radius:c.lg}}:{},...c.xl!==u.xl?{sheet:{radius:c.xl}}:{}})}if(e.space.xs!==a.space.xs){let t=e.space.xs/a.space.xs,n=r.space,i=e=>Math.round(e*t);d.space={1:i(n[1]),2:i(n[2]),3:i(n[3]),4:i(n[4]),5:i(n[5]),6:i(n[6]),7:i(n[7]),8:i(n[8]),9:i(n[9])}}let p=e.type.size,f=a.type.size,g=p.caption!==f.caption||p.bodyTight!==f.bodyTight||p.body!==f.body||p.subtitle!==f.subtitle||p.verdict!==f.verdict,h=e.type.lineHeight,m=a.type.lineHeight,b=h.relaxed!==m.relaxed||h.tight!==m.tight,y=e.type.scaleCaps,w=a.type.scaleCaps,v=y.content!==w.content||y.heading!==w.heading||y.control!==w.control||y.compact!==w.compact||y.badge!==w.badge,k=g||b||v;d.type={...g?{size:{xs:p.caption,sm:p.bodyTight,md:p.body,lg:p.subtitle,xl:p.verdict}}:{},...b?{lineHeight:{body:h.relaxed,display:h.tight}}:{},...v?{scaleCaps:{content:y.content,heading:y.heading,control:y.control,compact:y.compact,badge:y.badge}}:{},...t(e)},e.motion.reducedMotion&&!r.motion.reduced&&(d.motion={reduced:true});let x=k||Object.keys(s).length>0||Object.keys(d).some(e=>e!=="type"&&e!=="colors")||e.type.families.regular!==Ln.type.families.regular,_=Ti(e,a,s.surface??r.colors.surface),S=Object.entries(_).filter(([e,t])=>t!==r.colors[e]);return S.length>0&&(d.colors={...s,...Object.fromEntries(S)}),x?{name:"partner",...d}:d}var _i={planAccent:z.colors.planAccent,planLink:z.colors.planLink},Si={planAccentWash:["accent",.17],planAccentChip:["accent",.47],planLinkWash:["link",.12],planLinkChip:["link",.2]};function Ti(e,t,r){let n=gi(e),i=gi(t),o=e.color,a={};(o.primary!==t.color.primary||o.onPrimary!==t.color.onPrimary)&&Object.assign(a,{planInk:o.primary,planOnInk:n.onPrimary}),o.accent!==t.color.accent&&(a.planAccent=o.accent),n.link!==i.link&&(a.planLink=n.link);let l={accent:a.planAccent??_i.planAccent,link:a.planLink??_i.planLink},s={planLinkWash:n.dark?void 0:e.slots.planWash?.backgroundColor,planLinkChip:n.dark?void 0:e.slots.planChip?.backgroundColor},d=r.toLowerCase()!==n.card.toLowerCase();for(let[e,[t,r]]of Object.entries(Si)){let i=s[e];i!==void 0?a[e]=i:d&&(a[e]=$(l[t],r,n.card,n.card))}return a}function Ci(t){let r=useEverfurTheme();return e(()=>ki(r,t),[r,t])}function BlockScope({children:e}){let t=Ci(wi);return r(ThemeProvider,{theme:t},e)}var Fi=()=>globalThis[/* @__PURE__ */Symbol.for("everfur.sdk.chatCards.v1")]??={loader:null,lazy:null};var zi=/\/widget\/v1\/conversations\/[^/?]+\/messages(?:\?|$)/,Ei=50,Ii=(e,t)=>{let r=Fi(),n=r.frames??=/* @__PURE__ */new Map;if(r.loader===null||t.method!=="POST"||!zi.test(e))return null;let i=[];return{headers:{"X-Everfur-Client-Capabilities":Qe},watch:e=>e.addEventListener("message",e=>{let t=e.data??"";if(i.length===0&&!t.includes('"a2ui"'))return;let r;try{r=JSON.parse(t)}catch{return}if(r===null||typeof r!="object")return;let o=r;o.type===Ze?i.length<8&&i.push(o):o.done===true&&typeof o.message_id=="string"&&i.length>0&&!n.has(o.message_id)&&(n.set(o.message_id,i),n.size>Ei&&n.delete(n.keys().next().value))})}};var Oi=Fi();Oi.frames??=/* @__PURE__ */new Map;Oi.tap=Ii;var Hi={book_vet:"video"};je({video:Ve});var Di={caution:e=>e.tintWatch};function Bi(e,t,r){try{e.registry.services.telemetry.track(t,r)}catch{}}function Ai(e){let{runtime:t}=At(),r=useVetVisit(It(e.petRef,e.vet));return{run:(e,n)=>{switch(e.kind){case"navigate":return e.route==="visit"&&r.available?()=>{r.open()}:null;case"track":return()=>Bi(t,"slots.track",{slot:ut,part:n,event:e.event})}},opening:r.status==="opening"}}function CardView({card:e,run:t,opening:r}){let n=L();/* @__PURE__ */
13
+ return v(Card,{variant:"plain",tint:Di[e.tone](n.colors),testID:`everfur-card-${e.id}`,children:[
14
+ /* @__PURE__ */v(c,{style:ji.head,children:[
15
+ /* @__PURE__ */w(Icon,{name:Hi[e.card],size:22,color:n.colors.ink}),
16
+ /* @__PURE__ */v(c,{style:ji.words,children:[
17
+ /* @__PURE__ */w(Text,{variant:"heading",level:3,children:e.title}),e.body!==null?/* @__PURE__ */w(Text,{variant:"body",children:e.body}):null]})]}),e.buttons.length===0?null:/* @__PURE__ */w(c,{style:ji.buttons,children:e.buttons.map(n=>/* @__PURE__ */w(Button,{label:n.label,accessibilityLabel:n.a11y,tone:n.tone,loading:r&&n.action.kind==="navigate"&&n.action.route==="visit",loadingIndicator:"none",onPress:t(n.action,e.id)??void 0,testID:`everfur-card-${n.id}`,style:ji.button},n.id))})]})}function Ri(e,t,r){e.cover(e=>r.includes("urgency_soon")?t:e===t?null:e)}function Uncovered({messageId:e,host:r}){return t(()=>Ri(r,e,[]),[e,r]),null}function ServerCards(e){/* @__PURE__ */
18
+ return w(HostRender,{resetKey:e.a2ui,fallback:/* @__PURE__ */w(Uncovered,{messageId:e.message.id,host:e.host}),render:()=>/* @__PURE__ */w(Cards,{...e})})}function Cards({message:r,a2ui:n,host:i}){let o=r.id,{runtime:a}=At(),{run:l,opening:s}=Ai(i),d=e(()=>Et(n),[n]),u=d.ok&&d.cards.cards.every(e=>e.buttons.every(t=>l(t.action,e.id)!==null)),p=d.ok&&u?d.cards:null,f=d.ok?u?null:"unrunnable":d.reason,g=p===null?"":p.covers.join(",");return t(()=>{f!==null?Bi(a,"chat.a2ui.refused",{reason:f}):Bi(a,"chat.a2ui.drawn",{cards:d.ok?d.cards.cards.length:0,unused:d.ok?d.cards.unused:0})},[d,f,a]),t(()=>{Ri(i,o,g===""?[]:g.split(","))},[i,o,g]),p===null?null:/* @__PURE__ */w(BlockScope,{children:/* @__PURE__ */w(c,{style:ji.stack,testID:"everfur-server-cards",children:p.cards.map(e=>/* @__PURE__ */w(CardView,{card:e,run:l,opening:s},e.id))})})}var ji=d.create({stack:{gap:10,marginTop:10,alignSelf:"stretch"},head:{flexDirection:"row",gap:10,alignItems:"flex-start"},words:{flex:1,gap:4},buttons:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:12},button:{minHeight:44}});var Mi=ServerCards;export{Mi as ServerCards};
@@ -2,7 +2,7 @@
2
2
  import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
3
3
  import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
4
4
  import { C as ConversationId, P as PetRef, b as ResponseId } from './ids.d-B2GAAifq.cjs';
5
- import { f as ChatFeedbackType, m as ChatStatus, j as ChatMessage, c as ChatConversationListOptions, d as ChatConversationPage, g as ChatHistoryOptions, h as ChatMessagePage, u as ChatPendingCheckin, a as ChatCheckinTarget, i as ChatRefreshOptions, e as ChatFeedbackReceipt } from './checkin.d-BP3ZWBfX.cjs';
5
+ import { f as ChatFeedbackType, m as ChatStatus, j as ChatMessage, c as ChatConversationListOptions, d as ChatConversationPage, g as ChatHistoryOptions, h as ChatMessagePage, u as ChatPendingCheckin, a as ChatCheckinTarget, i as ChatRefreshOptions, e as ChatFeedbackReceipt } from './checkin.d-CuIUahcd.cjs';
6
6
  import { C as CheckinAnswer, a as CheckinOutcome } from './casesRepository.d-CVuKTkJo.cjs';
7
7
  import { j as UrgencyLevel } from './config.d-ClAI2RZ6.cjs';
8
8
  import { W as WidgetPet } from './petsRepository.d-ai_tZ3lu.cjs';
@@ -2,7 +2,7 @@
2
2
  import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
3
3
  import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
4
4
  import { C as ConversationId, P as PetRef, b as ResponseId } from './ids.d-B2GAAifq.js';
5
- import { f as ChatFeedbackType, m as ChatStatus, j as ChatMessage, c as ChatConversationListOptions, d as ChatConversationPage, g as ChatHistoryOptions, h as ChatMessagePage, u as ChatPendingCheckin, a as ChatCheckinTarget, i as ChatRefreshOptions, e as ChatFeedbackReceipt } from './checkin.d-CokpahFL.js';
5
+ import { f as ChatFeedbackType, m as ChatStatus, j as ChatMessage, c as ChatConversationListOptions, d as ChatConversationPage, g as ChatHistoryOptions, h as ChatMessagePage, u as ChatPendingCheckin, a as ChatCheckinTarget, i as ChatRefreshOptions, e as ChatFeedbackReceipt } from './checkin.d-BoZXWjxX.js';
6
6
  import { C as CheckinAnswer, a as CheckinOutcome } from './casesRepository.d-Dn1fK1b2.js';
7
7
  import { j as UrgencyLevel } from './config.d-B7Z-KTGq.js';
8
8
  import { W as WidgetPet } from './petsRepository.d-_QfM7F6T.js';
@@ -105,6 +105,14 @@ interface ChatMessage {
105
105
  readonly proactiveOriginRef?: string;
106
106
  /** The answerable check-in behind this message, when `proactiveOriginRef` names one (see `answerCheckin`). */
107
107
  readonly checkin?: ChatCheckin;
108
+ /**
109
+ * The server-sent A2UI cards of this reply as the history row saved them (`a2ui`, unvalidated). Only the opt-in
110
+ * React Native renderer (`@everfur/sdk/chat-cards`) reads them, and it validates them before it draws anything.
111
+ * Everfur internal preview, not part of the partner API.
112
+ *
113
+ * @internal
114
+ */
115
+ readonly a2ui?: readonly Readonly<Record<string, unknown>>[];
108
116
  }
109
117
  interface ChatSnapshot {
110
118
  readonly status: ChatStatus;
@@ -105,6 +105,14 @@ interface ChatMessage {
105
105
  readonly proactiveOriginRef?: string;
106
106
  /** The answerable check-in behind this message, when `proactiveOriginRef` names one (see `answerCheckin`). */
107
107
  readonly checkin?: ChatCheckin;
108
+ /**
109
+ * The server-sent A2UI cards of this reply as the history row saved them (`a2ui`, unvalidated). Only the opt-in
110
+ * React Native renderer (`@everfur/sdk/chat-cards`) reads them, and it validates them before it draws anything.
111
+ * Everfur internal preview, not part of the partner API.
112
+ *
113
+ * @internal
114
+ */
115
+ readonly a2ui?: readonly Readonly<Record<string, unknown>>[];
108
116
  }
109
117
  interface ChatSnapshot {
110
118
  readonly status: ChatStatus;