{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../demo7/src/js/pages/features/miscellaneous/cropper.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iDAAiD,wBAAwB;;AAEzE;AACA;AACA,iDAAiD,uBAAuB;;AAExE;AACA;AACA,iDAAiD,sBAAsB;;AAEvE;AACA;AACA,iDAAiD,sBAAsB;AACvE,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,qDAAqD,YAAY,yBAAyB;AAC1F,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA,OAAO;AACP,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA,CAAC","file":"js/pages/features/miscellaneous/cropper.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"../demo7/src/js/pages/features/miscellaneous/cropper.js\");\n","'use strict';\r\n\r\n// Class definition\r\nvar KTCropperDemo = function() {\r\n\r\n // Private functions\r\n var initCropperDemo = function() {\r\n var image = document.getElementById('image');\r\n\r\n var options = {\r\n crop: function(event) {\r\n document.getElementById('dataX').value = Math.round(event.detail.x);\r\n document.getElementById('dataY').value = Math.round(event.detail.y);\r\n document.getElementById('dataWidth').value = Math.round(event.detail.width);\r\n document.getElementById('dataHeight').value = Math.round(event.detail.height);\r\n document.getElementById('dataRotate').value = event.detail.rotate;\r\n document.getElementById('dataScaleX').value = event.detail.scaleX;\r\n document.getElementById('dataScaleY').value = event.detail.scaleY;\r\n\r\n var lg = document.getElementById('cropper-preview-lg');\r\n lg.innerHTML = '';\r\n lg.appendChild(cropper.getCroppedCanvas({width: 256, height: 160}));\r\n\r\n var md = document.getElementById('cropper-preview-md');\r\n md.innerHTML = '';\r\n md.appendChild(cropper.getCroppedCanvas({width: 128, height: 80}));\r\n\r\n var sm = document.getElementById('cropper-preview-sm');\r\n sm.innerHTML = '';\r\n sm.appendChild(cropper.getCroppedCanvas({width: 64, height: 40}));\r\n\r\n var xs = document.getElementById('cropper-preview-xs');\r\n xs.innerHTML = '';\r\n xs.appendChild(cropper.getCroppedCanvas({width: 32, height: 20}));\r\n },\r\n };\r\n\r\n var cropper = new Cropper(image, options);\r\n\r\n var buttons = document.getElementById('cropper-buttons');\r\n var methods = buttons.querySelectorAll('[data-method]');\r\n methods.forEach(function(button) {\r\n button.addEventListener('click', function(e) {\r\n var method = button.getAttribute('data-method');\r\n var option = button.getAttribute('data-option');\r\n var option2 = button.getAttribute('data-second-option');\r\n\r\n try {\r\n option = JSON.parse(option);\r\n }\r\n catch (e) {\r\n }\r\n\r\n var result;\r\n if (!option2) {\r\n result = cropper[method](option, option2);\r\n }\r\n else if (option) {\r\n result = cropper[method](option);\r\n }\r\n else {\r\n result = cropper[method]();\r\n }\r\n\r\n if (method === 'getCroppedCanvas') {\r\n var modal = document.getElementById('getCroppedCanvasModal');\r\n var modalBody = modal.querySelector('.modal-body');\r\n modalBody.innerHTML = '';\r\n modalBody.appendChild(result);\r\n }\r\n\r\n var input = document.querySelector('#putData');\r\n try {\r\n input.value = JSON.stringify(result);\r\n }\r\n catch (e) {\r\n if (!result) {\r\n input.value = result;\r\n }\r\n }\r\n });\r\n });\r\n\r\n // set aspect ratio option buttons\r\n var radioOptions = document.getElementById('setAspectRatio').querySelectorAll('[name=\"aspectRatio\"]');\r\n radioOptions.forEach(function(button) {\r\n button.addEventListener('click', function(e) {\r\n cropper.setAspectRatio(e.target.value);\r\n });\r\n });\r\n\r\n // set view mode\r\n var viewModeOptions = document.getElementById('viewMode').querySelectorAll('[name=\"viewMode\"]');\r\n viewModeOptions.forEach(function(button) {\r\n button.addEventListener('click', function(e) {\r\n cropper.destroy();\r\n cropper = new Cropper(image, Object.assign({}, options, {viewMode: e.target.value}));\r\n });\r\n });\r\n\r\n var toggleoptions = document.getElementById('toggleOptionButtons').querySelectorAll('[type=\"checkbox\"]');\r\n toggleoptions.forEach(function(checkbox) {\r\n checkbox.addEventListener('click', function(e) {\r\n var appendOption = {};\r\n appendOption[e.target.getAttribute('name')] = e.target.checked;\r\n options = Object.assign({}, options, appendOption);\r\n cropper.destroy();\r\n cropper = new Cropper(image, options);\r\n })\r\n })\r\n\r\n };\r\n\r\n return {\r\n // public functions\r\n init: function() {\r\n initCropperDemo();\r\n },\r\n };\r\n}();\r\n\r\njQuery(document).ready(function() {\r\n KTCropperDemo.init();\r\n});\r\n"],"sourceRoot":""}