Add javascript function to filament custom field

I have a custom field filament for image capture as below, but I am confused about how to add a javascript function to capture image. with the code below the function is always undefined.
here is the code, thank you
https://gist.github.com/athoulmuwafiq/e3d6d3b3a051f8e5db5b7f4199f4cb4f
Gist
GitHub Gist: instantly share code, notes, and snippets.
Was this page helpful?