{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/pdv14813sxongiNqBiq1/73Z35LNlhDsVVckrfiBJ/Tracking_Component.js"],
  "sourcesContent": ["function _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n  return obj;\n}\nimport * as React from \"react\";\nimport { ControlType } from \"framer\";\nvar _Component;\nexport class TrackEventOnLoad extends (_Component = React.Component) {\n  componentDidMount() {\n    this.trackEvent();\n  }\n  trackEvent() {\n    const headers = {\n      \"Content-Type\": \"application/json\",\n      Authorization: \"Bearer /xC2oS60RgZlQjiV/3g56th+gm1aVyHY371ctDoB038=\"\n    };\n    const userId = this.getOrCreateUserId();\n    let eventName = \"Page Loaded\";\n    if (this.props.tag) {\n      eventName = `${eventName} - ${this.props.tag}`;\n    }\n    fetch(\"https://api.usertrail.io/v1/events\", {\n      method: \"POST\",\n      headers: headers,\n      body: JSON.stringify({\n        user_id: userId,\n        event_name: eventName\n      })\n    }).catch(error => console.error(\"Error tracking event:\", error));\n  }\n  getOrCreateUserId() {\n    let userId = localStorage.getItem(\"userId\");\n    if (!userId) {\n      userId = `user-${Math.floor(Math.random() * 1e6)}`;\n      localStorage.setItem(\"userId\", userId);\n    }\n    return userId;\n  }\n  render() {\n    return null // This component doesn't render anything visibly\n    ;\n  }\n}\n_defineProperty(TrackEventOnLoad, \"propertyControls\", {\n  tag: {\n    type: ControlType.String,\n    title: \"Tag\"\n  }\n});\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"TrackEventOnLoad\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"TrackEventOnLoad\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./Tracking_Component.map"],
  "mappings": "gDAAA,SAASA,EAAgBC,EAAKC,EAAKC,EAAO,CACxC,OAAID,KAAOD,EACT,OAAO,eAAeA,EAAKC,EAAK,CAC9B,MAAOC,EACP,WAAY,GACZ,aAAc,GACd,SAAU,EACZ,CAAC,EAEDF,EAAIC,CAAG,EAAIC,EAENF,CACT,CAGA,IAAIG,EACSC,EAAN,cAAgCD,EAAmBE,EAAW,CACnE,mBAAoB,CAClB,KAAK,WAAW,CAClB,CACA,YAAa,CACX,IAAMC,EAAU,CACd,eAAgB,mBAChB,cAAe,qDACjB,EACMC,EAAS,KAAK,kBAAkB,EAClCC,EAAY,cACZ,KAAK,MAAM,MACbA,EAAY,GAAGA,OAAe,KAAK,MAAM,OAE3C,MAAM,qCAAsC,CAC1C,OAAQ,OACR,QAASF,EACT,KAAM,KAAK,UAAU,CACnB,QAASC,EACT,WAAYC,CACd,CAAC,CACH,CAAC,EAAE,MAAMC,GAAS,QAAQ,MAAM,wBAAyBA,CAAK,CAAC,CACjE,CACA,mBAAoB,CAClB,IAAIF,EAAS,aAAa,QAAQ,QAAQ,EAC1C,OAAKA,IACHA,EAAS,QAAQ,KAAK,MAAM,KAAK,OAAO,EAAI,GAAG,IAC/C,aAAa,QAAQ,SAAUA,CAAM,GAEhCA,CACT,CACA,QAAS,CACP,OAAO,IAET,CACF,EACAR,EAAgBK,EAAkB,mBAAoB,CACpD,IAAK,CACH,KAAMM,EAAY,OAClB,MAAO,KACT,CACF,CAAC",
  "names": ["_defineProperty", "obj", "key", "value", "_Component", "TrackEventOnLoad", "I", "headers", "userId", "eventName", "error", "ControlType"]
}
