{"version":3,"sources":["jsdelivr-header.js","/src/@awesome-cordova-plugins/plugins/camera/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,mgBCLO,2BAAA,YAAqD,uCAsF5D,IAAY,iBAAZ,SAAY,GACV,IAAA,uBACA,IAAA,uBACA,IAAA,0BACD,CAJD,CAAY,kCAAe,YAM3B,IAAY,cAAZ,SAAY,GACV,IAAA,eACA,IAAA,YACD,CAHD,CAAY,4BAAY,YAKxB,IAAY,WAAZ,SAAY,GACV,IAAA,qBACA,IAAA,iBACA,IAAA,sBACD,CAJD,CAAY,sBAAS,YAMrB,IAAY,mBAAZ,SAAY,GACV,IAAA,+BACA,IAAA,mBACA,IAAA,oCACD,CAJD,CAAY,sCAAiB,YAM7B,IAAY,uBAAZ,SAAY,GACV,IAAA,uBACA,IAAA,2BACA,IAAA,2BACA,IAAA,6BACA,IAAA,wBACD,CAND,CAAY,8CAAqB,YAQjC,IAAY,WAAZ,SAAY,GACV,IAAA,eACA,IAAA,gBACD,CAHD,CAAY,sBAAS,K,iGA4DnB,EAAA,gBAAkB,CAEhB,SAAU,EAEV,SAAU,EAEV,WAAY,GAMd,EAAA,aAAe,CAEb,KAAM,EAEN,IAAK,GAMP,EAAA,UAAY,CAEV,QAAS,EAET,MAAO,EAEP,SAAU,GAMZ,EAAA,kBAAoB,CAElB,aAAc,EAEd,OAAQ,EAER,gBAAiB,GAMnB,EAAA,sBAAwB,CACtB,SAAU,EACV,WAAY,EACZ,WAAY,EACZ,YAAa,EACb,UAAW,IAMb,EAAA,UAAY,CAEV,KAAM,EAEN,MAAO,G,SAjEiB,UAAA,EAA0B,GA6EpD,EAAA,UAAA,WAAU,SAAwB,GAAA,OAAA,QAAA,KAAA,cAAA,cAAA,WAAA,UAAA,EAalC,EAAA,UAAO,QAAA,kBAAA,QAAA,KAAA,WAAA,UAAA,SAAA,UAAA,E,oMA1FmB,4B,OAAf,IAAM,sB","file":"/npm/@awesome-cordova-plugins/camera@8.1.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@awesome-cordova-plugins/camera@8.1.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { Injectable } from '@angular/core';\nimport { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core';\n\nexport interface CameraOptions {\n  /** Picture quality in range 0-100. Default is 50 */\n  quality?: number;\n  /**\n   * Choose the format of the return value.\n   * Defined in Camera.DestinationType. Default is FILE_URI.\n   *      DATA_URL : 0,   Return image as base64-encoded string (DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible),\n   *      FILE_URI : 1,   Return image file URI,\n   *      NATIVE_URI : 2  Return image native URI\n   *          (e.g., assets-library:// on iOS or content:// on Android)\n   */\n  destinationType?: number;\n  /**\n   * Set the source of the picture.\n   * Defined in Camera.PictureSourceType. Default is CAMERA.\n   *      PHOTOLIBRARY : 0,\n   *      CAMERA : 1,\n   *      SAVEDPHOTOALBUM : 2\n   */\n  sourceType?: number;\n  /** Allow simple editing of image before selection. */\n  allowEdit?: boolean;\n  /**\n   * Choose the returned image file's encoding.\n   * Defined in Camera.EncodingType. Default is JPEG\n   *      JPEG : 0    Return JPEG encoded image\n   *      PNG : 1     Return PNG encoded image\n   */\n  encodingType?: number;\n  /**\n   * Width in pixels to scale image. Must be used with targetHeight.\n   * Aspect ratio remains constant.\n   */\n  targetWidth?: number;\n  /**\n   * Height in pixels to scale image. Must be used with targetWidth.\n   * Aspect ratio remains constant.\n   */\n  targetHeight?: number;\n  /**\n   * Set the type of media to select from. Only works when PictureSourceType\n   * is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in Camera.MediaType\n   *      PICTURE: 0      allow selection of still pictures only. DEFAULT.\n   *          Will return format specified via DestinationType\n   *      VIDEO: 1        allow selection of video only, WILL ALWAYS RETURN FILE_URI\n   *      ALLMEDIA : 2    allow selection from all media types\n   */\n  mediaType?: number;\n  /** Rotate the image to correct for the orientation of the device during capture. */\n  correctOrientation?: boolean;\n  /** Save the image to the photo album on the device after capture. */\n  saveToPhotoAlbum?: boolean;\n  /**\n   * Choose the camera to use (front- or back-facing).\n   * Defined in Camera.Direction. Default is BACK.\n   *      BACK: 0\n   *      FRONT: 1\n   */\n  cameraDirection?: number;\n  /** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */\n  popoverOptions?: CameraPopoverOptions;\n}\n\n/**\n * iOS-only parameters that specify the anchor element location and arrow direction\n * of the popover when selecting images from an iPad's library or album.\n */\nexport interface CameraPopoverOptions {\n  x: number;\n  y: number;\n  width: number;\n  height: number;\n  /**\n   * Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection\n   * Matches iOS UIPopoverArrowDirection constants.\n   *      ARROW_UP : 1,\n   *      ARROW_DOWN : 2,\n   *      ARROW_LEFT : 4,\n   *      ARROW_RIGHT : 8,\n   *      ARROW_ANY : 15\n   */\n  arrowDir: number;\n}\n\nexport enum DestinationType {\n  DATA_URL = 0,\n  FILE_URL,\n  NATIVE_URI,\n}\n\nexport enum EncodingType {\n  JPEG = 0,\n  PNG,\n}\n\nexport enum MediaType {\n  PICTURE = 0,\n  VIDEO,\n  ALLMEDIA,\n}\n\nexport enum PictureSourceType {\n  PHOTOLIBRARY = 0,\n  CAMERA,\n  SAVEDPHOTOALBUM,\n}\n\nexport enum PopoverArrowDirection {\n  ARROW_UP = 1,\n  ARROW_DOWN,\n  ARROW_LEFT,\n  ARROW_RIGHT,\n  ARROW_ANY,\n}\n\nexport enum Direction {\n  BACK = 0,\n  FRONT,\n}\n\n/**\n * @name Camera\n * @premier camera\n * @description\n * Take a photo or capture video.\n *\n * Requires the Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera).\n *\n * [Warning] Since IOS 10 the camera requires permissions to be placed in your config.xml add\n * ```xml\n * <config-file parent=\"NSCameraUsageDescription\" platform=\"ios\" target=\"*-Info.plist\">\n *   <string>You can take photos</string>\n * </config-file>\n * ```\n * inside of the `<platform name='ios>` section\n * @usage\n * ```typescript\n * import { Camera, CameraOptions } from '@awesome-cordova-plugins/camera/ngx';\n *\n * constructor(private camera: Camera) { }\n *\n * ...\n *\n *\n * const options: CameraOptions = {\n *   quality: 100,\n *   destinationType: this.camera.DestinationType.FILE_URI,\n *   encodingType: this.camera.EncodingType.JPEG,\n *   mediaType: this.camera.MediaType.PICTURE\n * }\n *\n * this.camera.getPicture(options).then((imageData) => {\n *  // imageData is either a base64 encoded string or a file URI\n *  // If it's base64 (DATA_URL):\n *  let base64Image = 'data:image/jpeg;base64,' + imageData;\n * }, (err) => {\n *  // Handle error\n * });\n * ```\n * @interfaces\n * CameraOptions\n * CameraPopoverOptions\n */\n@Plugin({\n  pluginName: 'Camera',\n  plugin: 'cordova-plugin-camera',\n  pluginRef: 'navigator.camera',\n  repo: 'https://github.com/apache/cordova-plugin-camera',\n  platforms: ['Android', 'Browser', 'iOS', 'Windows'],\n})\n@Injectable()\nexport class Camera extends AwesomeCordovaNativePlugin {\n  /**\n   * Constant for possible destination types\n   */\n  DestinationType = {\n    /** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */\n    DATA_URL: 0,\n    /** Return file uri (content://media/external/images/media/2 for Android) */\n    FILE_URI: 1,\n    /** Return native uri (eg. asset-library://... for iOS) */\n    NATIVE_URI: 2,\n  };\n\n  /**\n   * Convenience constant\n   */\n  EncodingType = {\n    /** Return JPEG encoded image */\n    JPEG: 0,\n    /** Return PNG encoded image */\n    PNG: 1,\n  };\n\n  /**\n   * Convenience constant\n   */\n  MediaType = {\n    /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */\n    PICTURE: 0,\n    /** Allow selection of video only, ONLY RETURNS URL */\n    VIDEO: 1,\n    /** Allow selection from all media types */\n    ALLMEDIA: 2,\n  };\n\n  /**\n   * Convenience constant\n   */\n  PictureSourceType = {\n    /** Choose image from picture library (same as PHOTOLIBRARY for Android) */\n    PHOTOLIBRARY: 0,\n    /** Take picture from camera */\n    CAMERA: 1,\n    /** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */\n    SAVEDPHOTOALBUM: 2,\n  };\n\n  /**\n   * Convenience constant\n   */\n  PopoverArrowDirection = {\n    ARROW_UP: 1,\n    ARROW_DOWN: 2,\n    ARROW_LEFT: 4,\n    ARROW_RIGHT: 8,\n    ARROW_ANY: 15,\n  };\n\n  /**\n   * Convenience constant\n   */\n  Direction = {\n    /** Use the back-facing camera */\n    BACK: 0,\n    /** Use the front-facing camera */\n    FRONT: 1,\n  };\n\n  /**\n   * Take a picture or video, or load one from the library.\n   *\n   * @param {CameraOptions} [options] Options that you want to pass to the camera. Encoding type, quality, etc. Platform-specific quirks are described in the [Cordova plugin docs](https://github.com/apache/cordova-plugin-camera#cameraoptions-errata-).\n   * @returns {Promise<any>} Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error.\n   */\n  @Cordova({\n    callbackOrder: 'reverse',\n  })\n  getPicture(options?: CameraOptions): Promise<any> {\n    return;\n  }\n\n  /**\n   * Remove intermediate image files that are kept in temporary storage after calling camera.getPicture.\n   * Applies only when the value of Camera.sourceType equals Camera.PictureSourceType.CAMERA and the Camera.destinationType equals Camera.DestinationType.FILE_URI.\n   *\n   * @returns {Promise<any>}\n   */\n  @Cordova({\n    platforms: ['iOS'],\n  })\n  cleanup(): Promise<any> {\n    return;\n  }\n}\n"]}