
/**
 *   WARNING: This file is intended to be used within MySheerID.
 *   This file is not intended for use in other contexts and there are no guarantees about its behavior outside of MySheerID.
 */ 
/**
 *   VERSION: 2.240.0-alpha.1
 *   BUILD_TIMESTAMP: 1780360182346
 *   BUILD_DATE: Tue Jun 02 2026 00:29:42 GMT+0000 (Coordinated Universal Time)
 *   BUILD_COMMIT: 758cedd37e00f49a728d704d9ed36884f0f12d79
 */
import { R as i, l as h, b as s, m as u } from "../_mysheerid-preview.js";
const d = "collect-info-submission-time", m = "collect-info-submit", C = "doc-upload-submit", g = "doc-upload-submission-time", l = () => Math.random().toString(36).substr(2, 9), S = {
  OrgSearchNumReworks: "org-search-num-reworks",
  OrgSearchQueryLength: "org-search-query-length",
  OrgSearchResultRank: "org-search-result-rank",
  OrgSearchTimeUntilSelection: "org-search-time-until-selection",
  OrgSearchOpenSortMenu: "org-search-open-sort-menu",
  OrgSearchSortDistance: "org-search-sort-distance",
  OrgSearchSortRelevance: "org-search-sort-relevance",
  AsrTipsShown: "asr-tips-shown",
  AsrSearchAfterTips: "asr-search-after-tips",
  AsrClickThrough: "asr-click-through",
  CaptchaUnmountedBeforeRender: "captcha-unmounted-before-render",
  CaptchaAbandonedAfterRender: "captcha-abandoned-after-render",
  CaptchaRendered: "captcha-rendered",
  CaptchaVerified: "captcha-verified",
  CaptchaErrorClient: "captcha-error-client",
  CaptchaErrorClientCode: "captcha-error-client-code",
  CaptchaErrorScriptLoad: "captcha-error-script-load",
  CaptchaErrorServer: "captcha-error-server",
  CaptchaErrorBrowserCompatibility: "captcha-error-browser-compatibility",
  CaptchaRetryClicked: "captcha-retry-clicked",
  CaptchaErrorLoadTimeout: "captcha-error-load-timeout"
}, O = ({ segment: a, programId: n }) => {
  const [t] = i.useState(l()), e = h();
  return i.useEffect(() => {
    try {
      performance.mark(t);
    } catch {
    }
  }, []), {
    // @TODO move GA and NR events into this?
    userDidConvert: (r, c) => {
      if (s()._launchDarklyUserTargeting)
        try {
          const o = performance.measure("timeOnForm", t);
          e.track(r, {
            segment: a
          }), e.track(
            c,
            {
              segment: a
            },
            o.duration
          );
        } catch (o) {
          u.error("Unable to submit metrics", o);
        }
    },
    recordNumericMetric: (r, c) => {
      s()._launchDarklyUserTargeting && e.track(
        r,
        {
          segment: a,
          programId: n
        },
        c
      );
    },
    trackEvent: (r) => {
      s()._launchDarklyUserTargeting && e.track(r, {
        segment: a,
        programId: n
      });
    },
    flush: () => {
      e.flush();
    },
    /**
     * @deprecated use userDidConvert instead
     */
    getTimeOnForm: () => {
      try {
        return performance.measure("timeOnForm", t);
      } catch {
      }
    }
  };
};
export {
  m as C,
  C as D,
  S as M,
  d as a,
  g as b,
  O as u
};
