text: $(function(){"use strict";var e=window.console||{log:function(){}},t=$(".docs-alert"),o=t.find(".message"),a=function(e,a){o.text(e),a&&o.addClass(a),t.fadeIn(),setTimeout(function(){t.fadeOut()},3e3)};!function(){var t=$(".img-container > img"),o=$("#dataX"),r=$("#dataY"),n=$("#dataHeight"),p=$("#dataWidth"),c=$("#dataRotate"),i={aspectRatio:16/9,preview:".img-preview",crop:function(e){o.val(Math.round(e.x)),r.val(Math.round(e.y)),n.val(Math.round(e.height)),p.val(Math.round(e.width)),c.val(Math.round(e.rotate))}};t.on({"build.cropper":function(t){e.log(t.type)},"built.cropper":function(t){e.log(t.type)},"dragstart.cropper":function(t){e.log(t.type,t.dragType)},"dragmove.cropper":function(t){e.log(t.type,t.dragType)},"dragend.cropper":function(t){e.log(t.type,t.dragType)},"zoomin.cropper":function(t){e.log(t.type)},"zoomout.cropper":function(t){e.log(t.type)}}).cropper(i),$(document.body).on("click","[data-method]",function(){var o,a,r=$(this).data();if(r.method){if(r=$.extend({},r),"undefined"!=typeof r.target&&(o=$(r.target),"undefined"==typeof r.option))try{r.option=JSON.parse(o.val())}catch(n){e.log(n.message)}if(a=t.cropper(r.method,r.option),"getCroppedCanvas"===r.method&&$("#getCroppedCanvasModal").modal().find(".modal-body").html(a),$.isPlainObject(a)&&o)try{o.val(JSON.stringify(a))}catch(n){e.log(n.message)}}}).on("keydown",function(e){switch(e.which){case 37:e.preventDefault(),t.cropper("move",-1,0);break;case 38:e.preventDefault(),t.cropper("move",0,-1);break;case 39:e.preventDefault(),t.cropper("move",1,0);break;case 40:e.preventDefault(),t.cropper("move",0,1)}});var d,l=$("#inputImage"),u=window.URL||window.webkitURL;u?l.change(function(){var e,o=this.files;o&&o.length&&(e=o[0],/^image\/\w+$/.test(e.type)?(d=u.createObjectURL(e),t.one("built.cropper",function(){u.revokeObjectURL(d)}).cropper("reset",!0).cropper("replace",d),l.val("")):a("Please choose an image file."))}):l.parent().remove(),$(".docs-options :checkbox").on("change",function(){var e=$(this);i[e.val()]=e.prop("checked"),t.cropper("destroy").cropper(i)}),$('[data-toggle="tooltip"]').tooltip()}()});