{"id":2128,"date":"2026-08-01T18:32:56","date_gmt":"2026-08-01T18:32:56","guid":{"rendered":"https:\/\/ranchofamilyappointments.com\/home\/?p=2128"},"modified":"2026-08-01T18:32:57","modified_gmt":"2026-08-01T18:32:57","slug":"redhawk","status":"publish","type":"post","link":"https:\/\/ranchofamilyappointments.com\/home\/redhawk\/","title":{"rendered":"redhawk"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2128\" class=\"elementor elementor-2128\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e63f267 e-con-full e-flex e-con e-parent\" data-id=\"e63f267\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-67e1d18 elementor-widget elementor-widget-html\" data-id=\"67e1d18\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<link rel=\"preconnect\" href=\"https:\/\/fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https:\/\/fonts.gstatic.com\" crossorigin>\n<link href=\"https:\/\/fonts.googleapis.com\/css2?family=Poppins:wght@400;500;600;700&family=Lora:ital,wght@0,500;1,400&display=swap\" rel=\"stylesheet\">\n\n<style>\n  #rfmg-clinic-scheduler, #rfmg-clinic-scheduler * , #rfmg-clinic-scheduler *::before, #rfmg-clinic-scheduler *::after { box-sizing: border-box; }\n  #rfmg-clinic-scheduler { font-family: 'Lora', Georgia, serif; color: #1A2E2A; line-height: 1.4; -webkit-font-smoothing: antialiased; }\n  #rfmg-clinic-scheduler p { margin: 0; }\n  #rfmg-clinic-scheduler a { text-decoration: none; }\n  #rfmg-clinic-scheduler button { font: inherit; background: none; border: none; margin: 0; }\n\n  @keyframes rfmg-shimmer { 0% { background-position: -300px 0; } 100% { background-position: 300px 0; } }\n  #rfmg-clinic-scheduler .rfmg-shimmer { background: linear-gradient(90deg, #ECECEC 0%, #F6F6F6 40%, #ECECEC 80%); background-size: 600px 100%; animation: rfmg-shimmer 1.3s ease-in-out infinite; }\n\n  #rfmg-clinic-scheduler .rfmg-page { background:#F7F9F8; padding:32px 16px; display:flex; justify-content:center; }\n  #rfmg-clinic-scheduler .rfmg-card { width:100%; background:#FFFFFF; border-radius:16px; box-shadow:0 2px 12px rgba(0,0,0,0.08); padding:28px; }\n\n  #rfmg-clinic-scheduler .rfmg-all-header { margin-bottom:22px; }\n  #rfmg-clinic-scheduler .rfmg-all-eyebrow { font-family:'Poppins',sans-serif; font-size:13px; font-weight:500; color:#666666; letter-spacing:0.02em; margin-bottom:6px; }\n  #rfmg-clinic-scheduler .rfmg-all-title { font-family:'Poppins',sans-serif; font-size:26px; font-weight:700; color:#1A2E2A; line-height:1.2; margin-bottom:10px; }\n  #rfmg-clinic-scheduler .rfmg-all-sub { font-size:15px; color:#666666; max-width:640px; }\n\n  #rfmg-clinic-scheduler .rfmg-choose { margin:22px 0 8px; font-family:'Poppins',sans-serif; font-size:13px; font-weight:500; color:#666666; letter-spacing:0.02em; }\n\n  #rfmg-clinic-scheduler .rfmg-tabs { display:flex; gap:8px; margin-bottom:22px; }\n  #rfmg-clinic-scheduler .rfmg-tab { flex:1; text-align:center; padding:12px 6px; border-radius:8px; border:1px solid #E5E5E5; background:#FFFFFF; color:#666666; font-family:'Poppins',sans-serif; font-weight:500; font-size:14px; cursor:pointer; transition:all 150ms ease-out; user-select:none; }\n  #rfmg-clinic-scheduler .rfmg-tab[aria-selected=\"true\"] { border-color:#016756; background:#016756; color:#FFFFFF; font-weight:600; }\n\n  #rfmg-clinic-scheduler .rfmg-select-wrap { position:relative; margin-bottom:22px; }\n  #rfmg-clinic-scheduler .rfmg-select { display:none; width:100%; appearance:none; -webkit-appearance:none; font-family:'Poppins',sans-serif; font-size:16px; font-weight:500; color:#1A2E2A; padding:14px 40px 14px 16px; border-radius:8px; border:1px solid #E5E5E5; background:#FFFFFF; }\n  #rfmg-clinic-scheduler .rfmg-select-chev { position:absolute; right:16px; top:50%; transform:translateY(-50%); pointer-events:none; }\n\n  \/* Two-column layout: provider sidebar (left) + widget (right) *\/\n  #rfmg-clinic-scheduler .rfmg-layout { display:flex; gap:20px; align-items:flex-start; }\n  #rfmg-clinic-scheduler .rfmg-sidebar { width:260px; flex-shrink:0; border:1px solid #E5E5E5; border-radius:12px; background:#FFFFFF; display:flex; flex-direction:column; max-height:520px; }\n  #rfmg-clinic-scheduler .rfmg-sidebar-search-wrap { padding:12px; border-bottom:1px solid #E5E5E5; flex-shrink:0; }\n  #rfmg-clinic-scheduler .rfmg-sidebar-search { width:100%; font-family:'Lora',Georgia,serif; font-size:14px; color:#1A2E2A; padding:9px 12px; border-radius:8px; border:1px solid #E5E5E5; background:#F7F9F8; }\n  #rfmg-clinic-scheduler .rfmg-sidebar-search::placeholder { color:#999999; }\n  #rfmg-clinic-scheduler .rfmg-provider-list { overflow-y:auto; flex:1; }\n  #rfmg-clinic-scheduler .rfmg-provider-row { display:flex; align-items:flex-start; gap:10px; padding:12px; border-bottom:1px solid #F0F0F0; cursor:pointer; transition:background 120ms ease-out; }\n  #rfmg-clinic-scheduler .rfmg-provider-row:last-child { border-bottom:none; }\n  #rfmg-clinic-scheduler .rfmg-provider-row:hover { background:#F7F9F8; }\n  #rfmg-clinic-scheduler .rfmg-provider-row[aria-selected=\"true\"] { background:rgba(1,103,86,0.08); }\n  #rfmg-clinic-scheduler .rfmg-provider-avatar { width:36px; height:36px; flex-shrink:0; border-radius:8px; background:#EAF1EF; color:#016756; display:flex; align-items:center; justify-content:center; font-family:'Poppins',sans-serif; font-weight:600; font-size:13px; }\n  #rfmg-clinic-scheduler .rfmg-provider-info { min-width:0; }\n  #rfmg-clinic-scheduler .rfmg-provider-name { font-family:'Poppins',sans-serif; font-size:13px; font-weight:600; color:#1A2E2A; line-height:1.3; }\n  #rfmg-clinic-scheduler .rfmg-provider-title { font-size:12px; color:#666666; margin-top:1px; }\n  #rfmg-clinic-scheduler .rfmg-provider-empty { padding:24px 16px; text-align:center; font-size:13px; color:#999999; }\n  #rfmg-clinic-scheduler .rfmg-main { flex:1; min-width:0; }\n\n  #rfmg-clinic-scheduler .rfmg-widget-box { border:1px solid #E5E5E5; border-radius:12px; background:#FFFFFF; min-height:300px; overflow:hidden; }\n\n  #rfmg-clinic-scheduler .rfmg-center { padding:48px 24px; display:flex; flex-direction:column; align-items:center; text-align:center; gap:14px; }\n  #rfmg-clinic-scheduler .rfmg-center p { font-size:15px; color:#333333; max-width:340px; }\n  #rfmg-clinic-scheduler .rfmg-btn-green { display:inline-flex; align-items:center; gap:8px; font-family:'Poppins',sans-serif; font-weight:600; font-size:14px; padding:14px 28px; border-radius:100px; background:#016756; color:#FFFFFF; }\n\n  #rfmg-clinic-scheduler .rfmg-skeleton { padding:20px; display:flex; gap:10px; overflow-x:auto; }\n  #rfmg-clinic-scheduler .rfmg-day-col { flex:1; min-width:80px; }\n\n  #rfmg-clinic-scheduler .rfmg-footer { margin-top:16px; font-size:13px; color:#666666; text-align:center; }\n  #rfmg-clinic-scheduler .rfmg-footer a { color:#016756; font-weight:500; }\n\n  #rfmg-clinic-scheduler .rfmg-epic-mount { padding:16px 20px 20px; }\n  #rfmg-clinic-scheduler #ucsdOSWidgetClinic { min-height:240px; }\n\n  .rfmg-hidden { display:none !important; }\n\n  @media (max-width: 768px) {\n    #rfmg-clinic-scheduler .rfmg-layout { flex-direction: column; }\n    #rfmg-clinic-scheduler .rfmg-sidebar { width: 100%; max-height: 280px; }\n  }\n\n  @media (max-width: 640px) {\n    #rfmg-clinic-scheduler .rfmg-tabs { display: none; }\n    #rfmg-clinic-scheduler .rfmg-select { display: block; }\n    #rfmg-clinic-scheduler .rfmg-card { width: 100%; padding: 20px; }\n    #rfmg-clinic-scheduler .rfmg-all-title { font-size:22px; }\n    #rfmg-clinic-scheduler .rfmg-day-col { min-width: 92px; }\n  }\n<\/style>\n\n<div id=\"rfmg-clinic-scheduler\">\n  <div class=\"rfmg-page\">\n    <div class=\"rfmg-card\">\n\n      <div class=\"rfmg-all-header\">\n        <p class=\"rfmg-all-eyebrow\">Schedule an appointment<\/p>\n        <h1 class=\"rfmg-all-title\">Redhawk Office<\/h1>\n        <p class=\"rfmg-all-sub\">Choose a visit type to see the soonest available appointment with a provider at Redhawk Office.<\/p>\n      <\/div>\n\n      <p class=\"rfmg-choose\">Choose a visit type<\/p>\n      <div class=\"rfmg-tabs\" id=\"rfmg-tabs\" role=\"tablist\" aria-label=\"Visit type\"><\/div>\n      <div class=\"rfmg-select-wrap\">\n        <select class=\"rfmg-select\" id=\"rfmg-select\" aria-label=\"Visit type\"><\/select>\n        <svg class=\"rfmg-select-chev\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#666666\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"6 9 12 15 18 9\"><\/polyline><\/svg>\n      <\/div>\n\n      <div class=\"rfmg-layout\">\n\n        <!-- Provider sidebar: every provider at this clinic. Click a row to\n             filter results to that provider. -->\n        <aside class=\"rfmg-sidebar\">\n          <div class=\"rfmg-sidebar-search-wrap\">\n            <input type=\"text\" class=\"rfmg-sidebar-search\" id=\"rfmg-provider-search\" placeholder=\"Search providers\u2026\" aria-label=\"Search providers\">\n          <\/div>\n          <div class=\"rfmg-provider-list\" id=\"rfmg-provider-list\"><\/div>\n        <\/aside>\n\n        <div class=\"rfmg-main\">\n          <div class=\"rfmg-widget-box\">\n\n            <!-- instant: shown until a visit type is picked (keeps the page instant) -->\n            <div class=\"rfmg-state\" data-state=\"instant\">\n              <div class=\"rfmg-center\">\n                <svg width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#999999\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"><\/rect><line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"><\/line><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"><\/line><line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"><\/line><\/svg>\n                <p>Choose a visit type above to see open appointment times.<\/p>\n              <\/div>\n            <\/div>\n\n            <!-- loading: shimmer skeleton while the Epic SDK loads + renders -->\n            <div class=\"rfmg-state rfmg-hidden\" data-state=\"loading\">\n              <div class=\"rfmg-skeleton\" id=\"rfmg-skeleton\"><\/div>\n            <\/div>\n\n            <!-- epic: the real Epic Open Scheduling widget mounts here -->\n            <div class=\"rfmg-state rfmg-hidden\" data-state=\"epic\">\n              <div class=\"rfmg-epic-mount\">\n                <div id=\"ucsdOSWidgetClinic\"><\/div>\n              <\/div>\n            <\/div>\n\n            <!-- unconfigured: no provider at this clinic offers the selected visit type -->\n            <div class=\"rfmg-state rfmg-hidden\" data-state=\"unconfigured\">\n              <div class=\"rfmg-center\">\n                <p>This visit type isn&rsquo;t currently offered at Redhawk Office. Please call to book, or choose a different visit type above.<\/p>\n                <a class=\"rfmg-btn-green\" data-phone-link href=\"#\"><\/a>\n              <\/div>\n            <\/div>\n\n            <!-- error: SDK failed to load -->\n            <div class=\"rfmg-state rfmg-hidden\" data-state=\"error\">\n              <div class=\"rfmg-center\">\n                <p>We couldn&rsquo;t load the scheduling widget right now. You can still book by phone.<\/p>\n                <a class=\"rfmg-btn-green\" data-phone-link href=\"#\"><\/a>\n              <\/div>\n            <\/div>\n\n          <\/div>\n\n          <p class=\"rfmg-footer\">Need help finding the right visit? <a data-phone-link href=\"#\">Call us<\/a>.<\/p>\n        <\/div>\n\n      <\/div>\n    <\/div>\n  <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\n(function () {\n  \"use strict\";\n\n  \/* ========================= CONFIG \u2014 edit me ========================= *\/\n  var CONFIG = {\n    clinicPhone: '(951) 676-4193',\n\n    epic: {\n      sdkUrl:  'https:\/\/mychart.ranchofamilymed.com\/rfm\/Scripts\/lib\/Widget\/widget_sdk.js',\n      baseUrl: 'https:\/\/mychart.ranchofamilymed.com\/rfm',\n      apiKey:  'cxawEqfoR672923',\n      \/\/ NO dept here \u2014 see file header comment for why. Shared by every tab.\n      baseParams: { payor: '-3', useloginsession: '1' },\n      \/\/ Recreate a clean widget instance on each tab change and turn off the\n      \/\/ widget's saved state, so switching visit types reliably re-renders.\n      disableLocalStorage: true\n    },\n\n    \/\/ Each tab's default vt code (used only if this clinic's providers turn\n    \/\/ out to have mixed vt codes for a visit type \u2014 see buildParams()).\n    visitTypes: [\n      { key: 'office',   label: 'Office visit',      defaultVt: '534041' },\n      { key: 'first',    label: 'First time visit',  defaultVt: '534405' },\n      { key: 'physical', label: 'Physical exam',     defaultVt: '534125' },\n      { key: 'virtual',  label: 'Virtual visit',     defaultVt: '534442' }\n    ],\n\n    \/\/ Every provider AT THIS CLINIC, with the vt code THEY use for each\n    \/\/ visit type they offer (a key is simply absent if they don't offer\n    \/\/ it). Regenerate from the master spreadsheet when providers move\n    \/\/ clinics or are added\/removed \u2014 see rancho-generate-provider-pages.py.\n    providers: [\n      { id: '264948', name: 'Dr. William Kyle Vincent', location: 'Redhawk Office', vt: { office: '534041', first: '534405', physical: '534125', virtual: '534442' } },\n      { id: '122747', name: 'Richard Bonnes', location: 'Redhawk Office', vt: { office: '534041', first: '534405', physical: '534125', virtual: '534442' } }\n    ]\n  };\n  \/* =================================================================== *\/\n\n  var root = document.getElementById('rfmg-clinic-scheduler');\n  if (!root) return;\n\n  var qs = new URLSearchParams(window.location.search);\n  var urlVisit = qs.get('visit') || '';\n\n  var $  = function (sel) { return root.querySelector(sel); };\n  var $$ = function (sel) { return Array.prototype.slice.call(root.querySelectorAll(sel)); };\n\n  var phoneDigits = String(CONFIG.clinicPhone || '').replace(\/[^\\d+]\/g, '');\n  var selectedKey = null;\n  var selectedProviderId = '';   \/\/ '' = Any provider\n  var sdkPromise  = null;\n  var observer    = null;\n  var revealTimer = null;\n\n  function uniqueSorted(arr) {\n    var seen = {}, out = [];\n    arr.forEach(function (v) { if (v && !seen[v]) { seen[v] = true; out.push(v); } });\n    return out.sort();\n  }\n\n  \/\/ Every provider at this clinic offering the given visit-type key.\n  function eligibleProviders(visitKey) {\n    return CONFIG.providers.filter(function (p) { return !!p.vt[visitKey]; });\n  }\n\n  var TITLE_PREFIXES = \/^(dr|dr\\.|mr|mr\\.|mrs|mrs\\.|ms|ms\\.|mx|mx\\.)\\s+\/i;\n  function computeInitials(name) {\n    var stripped = name.replace(TITLE_PREFIXES, '').trim();\n    var parts = stripped.split(\/\\s+\/).filter(Boolean);\n    if (parts.length >= 2) return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();\n    if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();\n    return '??';\n  }\n\n  function escapeHtml(s) {\n    return String(s).replace(\/[&<>\"']\/g, function (c) {\n      return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' }[c];\n    });\n  }\n\n  \/* ---------- visit-type tabs + mobile select ---------- *\/\n  function renderVisitTypes() {\n    var tabs = $('#rfmg-tabs');\n    var select = $('#rfmg-select');\n    tabs.innerHTML = '';\n    select.innerHTML = '';\n\n    var placeholder = document.createElement('option');\n    placeholder.value = '';\n    placeholder.textContent = 'Choose a visit type\u2026';\n    placeholder.disabled = true;\n    placeholder.selected = true;\n    select.appendChild(placeholder);\n\n    CONFIG.visitTypes.forEach(function (v) {\n      var btn = document.createElement('button');\n      btn.className = 'rfmg-tab';\n      btn.type = 'button';\n      btn.setAttribute('role', 'tab');\n      btn.setAttribute('aria-selected', String(v.key === selectedKey));\n      btn.textContent = v.label;\n      btn.addEventListener('click', function () { selectVisit(v.key); });\n      tabs.appendChild(btn);\n\n      var opt = document.createElement('option');\n      opt.value = v.key;\n      opt.textContent = v.label;\n      select.appendChild(opt);\n    });\n\n    select.value = selectedKey || '';\n    select.addEventListener('change', function (e) { selectVisit(e.target.value); });\n  }\n\n  function syncTabSelection() {\n    $$('.rfmg-tab').forEach(function (btn, i) {\n      btn.setAttribute('aria-selected', String(CONFIG.visitTypes[i] && CONFIG.visitTypes[i].key === selectedKey));\n    });\n    $('#rfmg-select').value = selectedKey || '';\n  }\n\n  \/* ---------- provider sidebar ---------- *\/\n  function onFilterChange() {\n    var visit = currentVisit();\n    if (visit) loadVisit(visit);\n  }\n\n  \/\/ Re-populates the sidebar based on the currently active visit-type tab\n  \/\/ (or every provider if no tab is picked yet), preserving the selection\n  \/\/ where still valid and resetting where not.\n  function renderProviderFilters() {\n    var visit = currentVisit();\n    var eligible = visit ? eligibleProviders(visit.key) : CONFIG.providers;\n    if (!eligible.some(function (p) { return p.id === selectedProviderId; })) selectedProviderId = '';\n    renderProviderSidebar(eligible);\n  }\n\n  function renderProviderSidebar(providerPool) {\n    var list = $('#rfmg-provider-list');\n    list.innerHTML = '';\n\n    var sorted = providerPool.slice().sort(function (a, b) { return a.name.localeCompare(b.name); });\n    if (!sorted.length) {\n      var empty = document.createElement('p');\n      empty.className = 'rfmg-provider-empty';\n      empty.textContent = 'No providers match this filter.';\n      list.appendChild(empty);\n      return;\n    }\n\n    sorted.forEach(function (p) {\n      var row = document.createElement('div');\n      row.className = 'rfmg-provider-row';\n      row.setAttribute('data-provider-id', p.id);\n      row.setAttribute('data-provider-name', p.name.toLowerCase());\n      row.setAttribute('role', 'button');\n      row.setAttribute('tabindex', '0');\n      row.setAttribute('aria-selected', String(p.id === selectedProviderId));\n\n      row.innerHTML =\n        '<div class=\"rfmg-provider-avatar\">' + escapeHtml(computeInitials(p.name)) + '<\/div>' +\n        '<div class=\"rfmg-provider-info\">' +\n          '<p class=\"rfmg-provider-name\">' + escapeHtml(p.name) + (p.credentials ? ', ' + escapeHtml(p.credentials) : '') + '<\/p>' +\n          '<p class=\"rfmg-provider-title\">' + escapeHtml(p.title || CONFIG.clinicName || '') + '<\/p>' +\n        '<\/div>';\n\n      row.addEventListener('click', function () { selectProvider(p.id); });\n      row.addEventListener('keydown', function (e) {\n        if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); selectProvider(p.id); }\n      });\n\n      list.appendChild(row);\n    });\n  }\n\n  function selectProvider(providerId) {\n    selectedProviderId = (providerId === selectedProviderId) ? '' : providerId; \/\/ click again to deselect\n    renderProviderFilters();\n    onFilterChange();\n  }\n\n  function filterSidebarBySearch(term) {\n    term = term.trim().toLowerCase();\n    $$('.rfmg-provider-row').forEach(function (row) {\n      var matches = !term || row.getAttribute('data-provider-name').indexOf(term) !== -1;\n      row.classList.toggle('rfmg-hidden', !matches);\n    });\n  }\n\n  function wireProviderFilters() {\n    $('#rfmg-provider-search').addEventListener('input', function (e) {\n      filterSidebarBySearch(e.target.value);\n    });\n  }\n\n  \/* ---------- state switching ---------- *\/\n  function showState(name) {\n    $$('.rfmg-state').forEach(function (el) {\n      el.classList.toggle('rfmg-hidden', el.getAttribute('data-state') !== name);\n    });\n  }\n\n  function buildSkeleton() {\n    var host = $('#rfmg-skeleton');\n    if (host.childElementCount) return;\n    for (var c = 0; c < 5; c++) {\n      var col = document.createElement('div');\n      col.className = 'rfmg-day-col';\n      col.innerHTML =\n        '<div class=\"rfmg-shimmer\" style=\"height:14px;border-radius:4px;margin-bottom:10px;\"><\/div>' +\n        '<div class=\"rfmg-shimmer\" style=\"height:36px;border-radius:8px;margin-bottom:8px;\"><\/div>' +\n        '<div class=\"rfmg-shimmer\" style=\"height:36px;border-radius:8px;margin-bottom:8px;\"><\/div>' +\n        '<div class=\"rfmg-shimmer\" style=\"height:36px;border-radius:8px;\"><\/div>';\n      host.appendChild(col);\n    }\n  }\n\n  \/* ---------- Epic SDK ---------- *\/\n  function loadEpicSdk() {\n    if (sdkPromise) return sdkPromise;\n    sdkPromise = new Promise(function (resolve, reject) {\n      if (window.mychartWidget) { resolve(); return; }\n      var s = document.createElement('script');\n      s.src = CONFIG.epic.sdkUrl;\n      s.async = true;\n      s.onload = function () {\n        window.mychartWidget ? resolve() : reject(new Error('SDK loaded but mychartWidget missing'));\n      };\n      s.onerror = function () { sdkPromise = null; reject(new Error('Failed to load Epic SDK')); };\n      document.head.appendChild(s);\n    });\n    return sdkPromise;\n  }\n\n  var WIDGET_MOUNT_ID = 'ucsdOSWidgetClinic'; \/\/ distinct from the individual-page\n                                               \/\/ template's 'ucsdOSWidget' and the\n                                               \/\/ all-providers page's 'ucsdOSWidgetAll'\n                                               \/\/ \u2014 Epic's SDK resolves containerId via\n                                               \/\/ a GLOBAL getElementById, so this must\n                                               \/\/ stay unique across every template.\n\n  \/\/ Builds the additionalParams for the currently filtered set of providers.\n  \/\/ No `dept` is ever sent (see file header). If every provider left in the\n  \/\/ pool shares the same vt code for this visit type, that exact code is\n  \/\/ used; otherwise falls back to the tab's defaultVt and only includes\n  \/\/ providers who use that exact code (so we never send a provider's id\n  \/\/ paired with a vt code that isn't actually theirs).\n  function buildParams(visit) {\n    var eligible = eligibleProviders(visit.key);\n    var pool = eligible;\n    if (selectedProviderId) pool = pool.filter(function (p) { return p.id === selectedProviderId; });\n    if (!pool.length) pool = eligible; \/\/ filter produced nothing (shouldn't happen) \u2014 fall back rather than send an empty id list\n\n    var vtCodes = uniqueSorted(pool.map(function (p) { return p.vt[visit.key]; }));\n    var vt = vtCodes.length === 1 ? vtCodes[0] : visit.defaultVt;\n    var ids = pool.filter(function (p) { return p.vt[visit.key] === vt; }).map(function (p) { return p.id; });\n\n    return Object.assign({}, CONFIG.epic.baseParams, { vt: vt, id: ids.join(', ') });\n  }\n\n  function renderEpicWidget(visit) {\n    var params = buildParams(visit);\n\n    var old = $('#' + WIDGET_MOUNT_ID);\n    var mount = document.createElement('div');\n    mount.id = WIDGET_MOUNT_ID;\n    old.parentNode.replaceChild(mount, old);\n\n    if (observer) observer.disconnect();\n    clearTimeout(revealTimer);\n    var revealed = false;\n    var reveal = function () { if (!revealed) { revealed = true; showState('epic'); } };\n\n    observer = new MutationObserver(function () { if (mount.childElementCount > 0) { reveal(); observer.disconnect(); } });\n    observer.observe(mount, { childList: true, subtree: true });\n    revealTimer = setTimeout(reveal, 10000);\n\n    var cfg = {\n      url: CONFIG.epic.baseUrl,\n      apiKey: CONFIG.epic.apiKey,\n      widgetType: 'openscheduling',\n      containerId: WIDGET_MOUNT_ID,\n      additionalParams: params\n    };\n    if (CONFIG.epic.disableLocalStorage) cfg.isLocalStorageEnabled = false;\n\n    try {\n      window.mychartWidget.renderWidget(cfg);\n    } catch (err) {\n      clearTimeout(revealTimer);\n      showState('error');\n    }\n  }\n\n  \/* ---------- selection flow ---------- *\/\n  function currentVisit() {\n    return CONFIG.visitTypes.filter(function (v) { return v.key === selectedKey; })[0];\n  }\n\n  function loadVisit(visit) {\n    if (!eligibleProviders(visit.key).length) { showState('unconfigured'); return; }\n    buildSkeleton();\n    showState('loading');\n    loadEpicSdk()\n      .then(function () { renderEpicWidget(visit); })\n      .catch(function () { showState('error'); });\n  }\n\n  function selectVisit(key) {\n    if (!key || key === selectedKey) return;\n    selectedKey = key;\n    syncTabSelection();\n    renderProviderFilters(); \/\/ eligibility differs per visit type\n    var visit = currentVisit();\n    if (visit) loadVisit(visit);\n  }\n\n  \/* ---------- misc wiring ---------- *\/\n  function wireStaticLinks() {\n    $$('[data-phone-link]').forEach(function (a) {\n      a.setAttribute('href', 'tel:' + phoneDigits);\n    });\n    ['error', 'unconfigured'].forEach(function (state) {\n      var link = root.querySelector('[data-state=\"' + state + '\"] [data-phone-link]');\n      if (!link) return;\n      link.innerHTML =\n        '<svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z\"><\/path><\/svg>' +\n        ' Book by phone: ' + CONFIG.clinicPhone;\n    });\n  }\n\n  \/* ---------- init ---------- *\/\n  renderVisitTypes();\n  renderProviderFilters();\n  wireProviderFilters();\n  wireStaticLinks();\n  showState('instant');\n\n  if (urlVisit && CONFIG.visitTypes.some(function (v) { return v.key === urlVisit; })) {\n    selectVisit(urlVisit);\n  }\n})();\n<\/script>\n<!-- ============================= PASTE END ============================= -->\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Schedule an appointment Redhawk Office Choose a visit type to see the soonest available appointment with a provider at Redhawk Office. Choose a visit type Choose a visit type above to see open appointment times. This visit type isn&rsquo;t currently offered at Redhawk Office. Please call to book, or choose a different visit type above. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"elementor_header_footer","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2128","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ranchofamilyappointments.com\/home\/wp-json\/wp\/v2\/posts\/2128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ranchofamilyappointments.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ranchofamilyappointments.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ranchofamilyappointments.com\/home\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ranchofamilyappointments.com\/home\/wp-json\/wp\/v2\/comments?post=2128"}],"version-history":[{"count":4,"href":"https:\/\/ranchofamilyappointments.com\/home\/wp-json\/wp\/v2\/posts\/2128\/revisions"}],"predecessor-version":[{"id":2132,"href":"https:\/\/ranchofamilyappointments.com\/home\/wp-json\/wp\/v2\/posts\/2128\/revisions\/2132"}],"wp:attachment":[{"href":"https:\/\/ranchofamilyappointments.com\/home\/wp-json\/wp\/v2\/media?parent=2128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ranchofamilyappointments.com\/home\/wp-json\/wp\/v2\/categories?post=2128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ranchofamilyappointments.com\/home\/wp-json\/wp\/v2\/tags?post=2128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}