1angular.module("tw.directives.cropper",["tw.services.fileReader"]),angular.module("tw.directives.cropper").directive("twCropper",["$parse","$window","$document","twFileReader",function(t,e,n,i){n[0];var o=e.Math;return{restrict:"A",controller:["$scope","$attrs","$element",function(e,n,i){var o=i[0];n.twCropper&&t(n.twCropper).assign(e,this),this.toDataURL=function(){return o.toDataURL()}}],link:function(t,e,h){if("canvas"===angular.lowercase(e[0].nodeName)){var c,r,u,a,l,s=e[0],d=s.getContext("2d"),w=new Image,f=function(){var t=c,e=r,n=s.width*u,i=s.height*u,o=s.width,h=s.height;d.drawImage(w,t,e,n,i,0,0,o,h)},g=function(t){var e=u;(u+=t)<l?u=l:u>a&&(u=a);var n=u*s.width,i=u*s.height,o=e*s.width,h=e*s.height;r-=(i-h)/2,(c-=(n-o)/2)<0?c=0:c+n>w.width&&(c=w.width-n),r<0?r=0:r+i>w.height&&(r=w.height-i)};t.$watch(h.source,function(t){t?i.readAsDataURL(t).then(function(t){w.onload=function(){c=0,r=0,u=l=1,a=w.width>w.height?w.height/s.height:w.width/s.width,w.height<s.height&&(u=l=a),w.width<s.width&&(u=l=a),f()},w.src=t}):d.clearRect(0,0,s.width,s.height)});var v,p,m=function(t,e){if(c+=(v-t)*u,r+=(p-e)*u,c<0)c=0;else{var n=s.width*u;c+n>w.width&&(c=w.width-n)}if(r<0)r=0;else{var i=s.height*u;r+i>w.height&&(r=w.height-i)}f(),v=t,p=e},Y=function(t){m(t.clientX,t.clientY)},$=null,R=function(t){1===(t=t.originalEvent||t).touches.length?m(t.touches[0].clientX,t.touches[0].clientY):2===t.touches.length&&function(t,e){var n=t.clientX,i=t.clientY,h=e.clientX,c=e.clientY,r=o.sqrt(o.pow(h-n,2)+o.pow(c-i,2));null!==$&&(g(-.015*(r-$)),f());$=r}(t.touches[0],t.touches[1])},X=function(t,e){w.src&&(v=t,p=e,n.on("mousemove",Y),n.on("touchmove",R))};e.on("mousedown",function(t){X(t.clientX,t.clientY)}),e.on("touchstart",function(t){(t=t.originalEvent||t).preventDefault(),1===t.touches.length&&X(t.touches[0].clientX,t.touches[0].clientY)});n.on("mouseup touchend",function(){n.off("mousemove",Y),n.off("touchmove",R),$=null}),e.on("wheel",function(t){t.preventDefault(),t=t.originalEvent||t,w.src&&(t.deltaY<0?g(-.15):g(.15),f())})}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.