{"version":3,"file":"DataLinkInput.cjs","sources":["../../../../src/components/DataLinks/DataLinkInput.tsx"],"sourcesContent":["import { lazy, memo, Suspense } from 'react';\n\nimport { type VariableSuggestion } from '@grafana/data';\n\nimport { Input } from '../Input/Input';\n\nimport { type DataLinkInterpolationMode } from './codemirrorUtils';\n\nexport interface DataLinkInputProps {\n  value: string;\n  onChange: (url: string, callback?: () => void) => void;\n  suggestions: VariableSuggestion[];\n  placeholder?: string;\n  // For accessibility, this should be the id of the label that describes this input.\n  // This is needed because the input is rendered as a contenteditable element and can't use the normal label/htmlFor logic.\n  ['aria-labelledby']?: string;\n  // DOM id applied to the input wrapper. Defaults to the URL field's historical\n  // id; pass a distinct id when more than one DataLinkInput renders together\n  // (e.g. a title alongside a URL) to keep ids unique.\n  id?: string;\n  // Selects the completion semantics: 'url' (default) treats `=` as a query-param\n  // trigger and encodes template vars as `${var:queryparam}`; 'text' triggers on\n  // `$` only and applies plain `${var}`, matching how non-URL fields interpolate.\n  interpolationMode?: DataLinkInterpolationMode;\n  // Forwarded to the inline input; `false` renders the proportional UI font.\n  monospace?: boolean;\n}\n\nconst DataLinkInputImplementation = lazy(() =>\n  import(/* webpackChunkName: \"react-codemirror-data-link-input\" */ './DataLinkInputImplementation').then((module) => ({\n    default: module.DataLinkInputImplementation,\n  }))\n);\n\nexport const DataLinkInput = memo(function DataLinkInput(props: DataLinkInputProps) {\n  return (\n    <Suspense\n      fallback={\n        <Input\n          id={`${props.id ?? 'data-link-input'}-loading`}\n          value={props.value}\n          placeholder={props.placeholder ?? 'http://your-grafana.com/d/000000010/annotations'}\n          readOnly\n          tabIndex={-1}\n          aria-label=\"\"\n          aria-labelledby=\"\"\n          aria-hidden\n        />\n      }\n    >\n      <DataLinkInputImplementation {...props} />\n    </Suspense>\n  );\n});\n"],"names":["lazy","memo","DataLinkInput","jsx","Suspense","Input"],"mappings":";;;;;;;;;AA4BA,MAAM,2BAAA,GAA8BA,UAAA;AAAA,EAAK,MACvC;AAAA;AAAA,IAAkE;AAAA,EAA+B,KAAA,CAAE,IAAA,CAAK,CAAC,MAAA,MAAY;AAAA,IACnH,SAAS,MAAA,CAAO;AAAA,GAClB,CAAE;AACJ,CAAA;AAEO,MAAM,aAAA,GAAgBC,UAAA,CAAK,SAASC,cAAAA,CAAc,KAAA,EAA2B;AAlCpF,EAAA,IAAA,EAAA,EAAA,EAAA;AAmCE,EAAA,uBACEC,cAAA;AAAA,IAACC,cAAA;AAAA,IAAA;AAAA,MACC,QAAA,kBACED,cAAA;AAAA,QAACE,WAAA;AAAA,QAAA;AAAA,UACC,EAAA,EAAI,CAAA,EAAA,CAAG,EAAA,GAAA,KAAA,CAAM,EAAA,KAAN,YAAY,iBAAiB,CAAA,QAAA,CAAA;AAAA,UACpC,OAAO,KAAA,CAAM,KAAA;AAAA,UACb,WAAA,EAAA,CAAa,EAAA,GAAA,KAAA,CAAM,WAAA,KAAN,IAAA,GAAA,EAAA,GAAqB,iDAAA;AAAA,UAClC,QAAA,EAAQ,IAAA;AAAA,UACR,QAAA,EAAU,CAAA,CAAA;AAAA,UACV,YAAA,EAAW,EAAA;AAAA,UACX,iBAAA,EAAgB,EAAA;AAAA,UAChB,aAAA,EAAW;AAAA;AAAA,OACb;AAAA,MAGF,QAAA,kBAAAF,cAAA,CAAC,2BAAA,EAAA,EAA6B,GAAG,KAAA,EAAO;AAAA;AAAA,GAC1C;AAEJ,CAAC;;;;"}