1import{a as $e}from"./chunk-JVPMPTUI.js";import{b as Je,c as et}from"./chunk-AOAPN2JW.js";import{a as ce,b as he,d as Ye,e as Xe,f as ge,g as Ne}from"./chunk-WF2XGPD3.js";import{c as le}from"./chunk-TDZ2CK3Y.js";import{h as Ke,p as Ge}from"./chunk-4MFP4PYB.js";import{b as Ze}from"./chunk-6LBFX4AW.js";import{Ta as je,e as qe,j as Ue,p as se}from"./chunk-HIAPKIFK.js";import{$b as I,Aa as F,Ac as _e,Db as X,Eb as ne,Fc as B,Gc as ae,Hd as Be,Id as Le,Ja as Ae,Jc as k,Kb as re,Kc as Te,Rc as He,S as Me,Sc as Pe,Tc as We,Zb as Ie,aa as we,bc as S,cd as Ve,dc as Se,ec as Re,fb as De,fc as Oe,g as ye,gb as Y,gc as E,ge as Fe,hc as u,ia as j,ic as _,ja as te,jb as ie,jc as O,je as Qe,kb as $,lb as w,ma as ve,nc as Ee,oc as ze,qc as V,sa as b,sc as D,ta as y,te as oe,uc as m,vb as z,yc as ke,zc as ue}from"./chunk-O5LBM3VT.js";import{a as P,b as K,h as G}from"./chunk-WWX6BADO.js";var pt=["wrapper"],mt=["sourceImage"];function ft(l,n){if(l&1){let e=V();u(0,"img",5,1),D("load",function(){b(e);let i=m();return y(i.imageLoadedInView())})("mousedown",function(i){b(e);let r=m();return y(r.startMove(i,r.moveTypes.Drag))})("touchstart",function(i){b(e);let r=m();return y(r.startMove(i,r.moveTypes.Drag))})("error",function(i){b(e);let r=m();return y(r.loadImageError(i))}),_()}if(l&2){let e=m();B("visibility",e.imageVisible?"visible":"hidden")("transform",e.safeTransformStyle),ae("ngx-ic-draggable",!e.disabled&&e.allowMoveImage),E("src",e.safeImgDataUrl,Y),Ie("alt",e.imageAltText)}}function dt(l,n){if(l&1){let e=V();Ee(0),u(1,"span",9),D("mousedown",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"topleft"))})("touchstart",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"topleft"))}),O(2,"span",10),_(),u(3,"span",11),O(4,"span",10),_(),u(5,"span",12),D("mousedown",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"topright"))})("touchstart",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"topright"))}),O(6,"span",10),_(),u(7,"span",13),O(8,"span",10),_(),u(9,"span",14),D("mousedown",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"bottomright"))})("touchstart",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"bottomright"))}),O(10,"span",10),_(),u(11,"span",15),O(12,"span",10),_(),u(13,"span",16),D("mousedown",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"bottomleft"))})("touchstart",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"bottomleft"))}),O(14,"span",10),_(),u(15,"span",17),O(16,"span",10),_(),u(17,"span",18),D("mousedown",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"top"))})("touchstart",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"top"))}),_(),u(18,"span",19),D("mousedown",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"right"))})("touchstart",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"right"))}),_(),u(19,"span",20),D("mousedown",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"bottom"))})("touchstart",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"bottom"))}),_(),u(20,"span",21),D("mousedown",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"left"))})("touchstart",function(i){b(e);let r=m(2);return y(r.startMove(i,r.moveTypes.Resize,"left"))}),_(),ze()}}function ut(l,n){if(l&1){let e=V();u(0,"div",6),D("keydown",function(i){b(e);let r=m();return y(r.keyboardAccess(i))}),u(1,"div",7),D("mousedown",function(i){b(e);let r=m();return y(r.startMove(i,r.moveTypes.Move))})("touchstart",function(i){b(e);let r=m();return y(r.startMove(i,r.moveTypes.Move))}),_(),re(2,dt,21,0,"ng-container",8),_()}if(l&2){let e=m();B("top",e.cropper.y1,"px")("left",e.cropper.x1,"px")("width",e.cropper.x2-e.cropper.x1,"px")("height",e.cropper.y2-e.cropper.y1,"px")("margin-left",e.alignImage==="center"?e.marginLeft:null)("visibility",e.imageVisible?"visible":"hidden"),ae("ngx-ic-round",e.roundCropper),w(2),E("ngIf",!e.hideResizeSquares)}}var xe=class{constructor(){this.format="png",this.maintainAspectRatio=!0,this.transform={},this.aspectRatio=1,this.resetCropOnAspectRatioChange=!0,this.resizeToWidth=0,this.resizeToHeight=0,this.cropperMinWidth=0,this.cropperMinHeight=0,this.cropperMaxHeight=0,this.cropperMaxWidth=0,this.cropperStaticWidth=0,this.cropperStaticHeight=0,this.canvasRotation=0,this.initialStepSize=3,this.roundCropper=!1,this.onlyScaleDown=!1,this.imageQuality=92,this.autoCrop=!0,this.backgroundColor=null,this.containWithinAspectRatio=!1,this.hideResizeSquares=!1,this.alignImage="center",this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20,this.cropperScaledMaxWidth=20,this.cropperScaledMaxHeight=20,this.stepSize=this.initialStepSize}setOptions(n){Object.keys(n).filter(e=>
1e in this).forEach(e=>this[e]=n[e]),this.validateOptions()}setOptionsFromChanges(n){Object.keys(n).filter(e=>e in this).forEach(e=>this[e]=n[e].currentValue),this.validateOptions()}validateOptions(){if(this.maintainAspectRatio&&!this.aspectRatio)throw new Error("`aspectRatio` should > 0 when `maintainAspectRatio` is enabled")}},W=(function(l){return l.Drag="drag",l.Move="move",l.Resize="resize",l.Pinch="pinch",l})(W||{});function _t(l){switch(l){case"ArrowUp":return"top";case"ArrowRight":return"right";case"ArrowDown":return"bottom";default:return"left"}}function xt(l){switch(l){case"ArrowUp":return"bottom";case"ArrowRight":return"left";case"ArrowDown":return"top";default:return"right"}}function Ct(l,n){switch(l){case"ArrowUp":return{clientX:0,clientY:n*-1};case"ArrowRight":return{clientX:n,clientY:0};case"ArrowDown":return{clientX:0,clientY:n};default:return{clientX:n*-1,clientY:0}}}function bt(l,n,e){let t=l.width,i=l.height;n=Math.round(n),e=Math.round(e);let r=t/n,a=i/e,o=Math.ceil(r/2),s=Math.ceil(a/2),c=l.getContext("2d");if(c){let h=c.getImageData(0,0,t,i),g=c.createImageData(n,e),p=h.data,f=g.data;for(let d=0;d<e;d++)for(let x=0;x<n;
1x++){let M=(x+d*n)*4,v=d*a,C=0,R=0,A=0,T=0,H=0,L=0,Z=0,ot=Math.floor(x*r),st=Math.floor(d*a),fe=Math.ceil((x+1)*r),de=Math.ceil((d+1)*a);fe=Math.min(fe,t),de=Math.min(de,i);for(let J=st;J<de;J++){let Ce=Math.abs(v-J)/s,lt=x*r,ct=Ce*Ce;for(let ee=ot;ee<fe;ee++){let be=Math.abs(lt-ee)/o,q=Math.sqrt(ct+be*be);if(q>=1)continue;C=2*q*q*q-3*q*q+1;let U=4*(ee+J*t);Z+=C*p[U+3],A+=C,p[U+3]<255&&(C=C*p[U+3]/250),T+=C*p[U],H+=C*p[U+1],L+=C*p[U+2],R+=C}}f[M]=T/R,f[M+1]=H/R,f[M+2]=L/R,f[M+3]=Z/A}l.width=n,l.height=e,c.putImageData(g,0,0)}}function tt(l,n){return l/100*n}var yt=(()=>{class l{crop(e,t,i,r){let a=this.getImagePosition(e,t,i,r),o=a.x2-a.x1,s=a.y2-a.y1,c=document.createElement("canvas");c.width=o,c.height=s;let h=c.getContext("2d");if(!h)return null;r.backgroundColor!=null&&(h.fillStyle=r.backgroundColor,h.fillRect(0,0,o,s));let g=(r.transform.scale||1)*(r.transform.flipH?-1:1),p=(r.transform.scale||1)*(r.transform.flipV?-1:1),{translateH:f,translateV:d}=this.getCanvasTranslate(e,t,r),x=t.transformed;h.setTransform(g,0,0,p,x.size.width/2+f,x.size.height/2+d),h.translate(-a.x1/g,-a.y1/p),h.rotate((r.transform.rotate||0)*Math.PI/180),h.drawImage(x.image,-x.size.width/2,-x.size.height/2);let M={width:o,height:s,imagePosition:a,cropperPosition:P({},i)};r.containWithinAspectRatio&&(M.offsetImagePosition=this.getOffsetImagePosition(e,t,i,r));let v=this.getResizeRatio(o,s,r);return v!==1&&(M.width=Math.round(o*v),M.height=r.maintainAspectRatio?Math.round(M.width/r.aspectRatio):Math.round(s*v),bt(c,M.width,M.height)),M.base64=c.toDataURL("image/"+r.format,this.getQuality(r)),M}getCanvasTranslate(e,t,i){if(i.transform.translateUnit==="px"){let r=this.getRatio(e,t);return{translateH:(i.transform.translateH||0)*r,translateV:(i.transform.translateV||0)*r}}else return{translateH:i.transform.translateH?tt(i.transform.translateH,t.transformed.size.width):0,translateV:i.transform.translateV?tt(i.transform.translateV,t.transformed.size.height):0}}getRatio(e,t){let i=e.nativeElement;return t.transformed.size.width/i.offsetWidth}getImagePosition(e,t,i,r){let a=this.getRatio(e,t),o={x1:Math.round(i.x1*a),y1:Math.round(i.y1*a),x2:Math.round(i.x2*a),y2:Math.round(i.y2*a)};return r.containWithinAspectRatio||(o.x1=Math.max(o.x1,0),o.y1=Math.max(o.y1,0),o.x2=Math.min(o.x2,t.transformed.size.width),o.y2=Math.min(o.y2,t.transformed.size.height)),o}getOffsetImagePosition(e,t,i,r){let a=r.canvasRotation+t.exifTransform.rotate,o=e.nativeElement,s=t.transformed.size.width/o.offsetWidth,c,h;a%2?(c=(t.transformed.size.width-t.original.size.height)/2,h=(t.transformed.size.height-t.original.size.width)/2):(c=(t.transformed.size.width-t.original.size.width)/2,h=(t.transformed.size.height-t.original.size.height)/2);let g={x1:Math.round(i.x1*s)-c,y1:Math.round(i.y1*s)-h,x2:Math.round(i.x2*s)-c,y2:Math.round(i.y2*s)-h};return r.containWithinAspectRatio||(g.x1=Math.max(g.x1,0),g.y1=Math.max(g.y1,0),g.x2=Math.min(g.x2,t.transformed.size.width),g.y2=Math.min(g.y2,t.transformed.size.height)),g}getResizeRatio(e,t,i){let r=i.resizeToWidth/e,a=i.resizeToHeight/t,o=new Array;i.resizeToWidth>0&&o.push(r),i.resizeToHeight>0&&o.push(a);let s=o.length===0?1:Math.min(...o);return s>1&&!i.onlyScaleDown?s:Math.min(s,1)}getQuality(e){return Math.min(1,Math.max(0,e.imageQuality/100))}}return l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=j({token:l,factory:l.\u0275fac,providedIn:"root"}),l})(),Mt=(()=>{class l{resetCropperPosition(e,t,i){if(!e?.nativeElement)return;let r=e.nativeElement;if(i.cropperStaticHeight&&i.cropperStaticWidth)t.x1=0,t.x2=r.offsetWidth>i.cropperStaticWidth?i.cropperStaticWidth:r.offsetWidth,t.y1=0,t.y2=r.offsetHeight>i.cropperStaticHeight?i.cropperStaticHeight:r.offsetHeight;else{let a=Math.min(i.cropperScaledMaxWidth,r.offsetWidth),o=Math.min(i.cropperScaledMaxHeight,r.offsetHeight);if(!i.maintainAspectRatio)t.x1=0,t.x2=a,t.y1=0,t.y2=o;else if(r.offsetWidth/i.aspectRatio<r.offsetHeight){t.x1=0,t.x2=a;let s=a/i.aspectRatio;t.y1=(r.offsetHeight-s)/2,t.y2=t.y1+s}else{t.y1=0,t.y2=o;let s=o*i.aspectRatio;t.x1=(r.offsetWidth-s)/2,t.x2=t.x1+s}}}move(e,t,i){let r=this.getClientX(e)-t.clientX,a=this.getClientY(e)-t.clientY;i.x1=t.x1+r,i.y1=t.y1+a,i.x2=t.x2+r,i.y2=t.y2+a}resize(e,t,i,r,a){let o=this.getClientX(e)-t.clientX,s=this.getClientY(e)-t.clientY;switch(t.position){case"left":i.x1=Math.min(Math.max(t.x1+o,i.x2-a.cropperScaledMaxWidth),i.x2-a.cropperScaledMinWidth);break;case"topleft":i.x1=Math.min(Math.max(t.x1+o,i.x2-a.cropperScaledMaxWidth),i.x2-a.cropperScaledMinWidth),i.y1=Math.min(Math.max(t.y1+s,i.y2-a.cropperScaledMaxHeight),i.y2-a.cropperScaledMinHeight);break;case"top":i.y1=Math.min(Math.max(t.y1+s,i.y2-a.cropperScaledMaxHeight),i.y2-a.cropperScaledMinHeight);break;case"topright":i.x2=Math.max(Math.min(t.x2+o,i.x1+a.cropperScaledMaxWidth),i.x1+a.cropperScaledMinWidth),i.y1=Math.min(Math.max(t.y1+s,i.y2-a.cropperScaledMaxHeight),i.y2-a.cropperScaledMinHeight);break;case"right":i.x2=Math.max(Math.min(t.x2+o,i.x1+a.cropperScaledMaxWidth),i.x1+a.cropperScaledMinWidth);break;case"bottomright":i.x2=Math.max(Math.min(t.x2+o,i.x1+a.cropperScaledMaxWidth),i.x1+a.cropperScaledMinWidth),i.y2=Math.max(Math.min(t.y2+s,i.y1+a.cropperScaledMaxHeight),i.y1+a.cropperScaledMinHeight);break;case"bottom":i.y2=Math.max(Math.min(t.y2+s,i.y1+a.cropperScaledMaxHeight),i.y1+a.cropperScaledMinHeight);break;case"bottomleft":i.x1=Math.min(Math.max(t.x1+o,i.x2-a.cropperScaledMaxWidth),i.x2-a.cropperScaledMinWidth),i.y2=Math.max(Math.min(t.y2+s,i.y1+a.cropperScaledMaxHeight),i.y1+a.cropperScaledMinHeight);break;case"center":let c=e.scale,h=Math.min(Math.max(a.cropperScaledMinWidth,Math.abs(t.x2-t.x1)*c),a.cropperScaledMaxWidth),g=Math.min(Math.max(a.cropperScaledMinHeight,Math.abs(t.y2-t.y1)*c),a.cropperScaledMaxHeight);i.x1=t.clientX-h/2,i.x2=t.clientX+h/2,i.y1=t.clientY-g/2,i.y2=t.clientY+g/2,i.x1<0?(i.x2-=i.x1,i.x1=0):i.x2>r.width&&(i.x1-=i.x2-r.width,i.x2=r.width),i.y1<0?(i.y2-=i.y1,i.y1=0):i.y2>r.height&&(i.y1-=i.y2-r.height,i.y2=r.height);break}a.maintainAspectRatio&&this.checkAspectRatio(t.position,i,r,a)}checkAspectRatio(e,t,i,r){let a=0,o=0;switch(e){case"top":t.x2=t.x1+(t.y2-t.y1)*r.aspectRatio,a=Math.max(t.x2-i.width,0),o=Math.max(0-t.y1,0),(a>0||o>0)&&(t.x2-=o*r.aspectRatio>a?o*r.aspectRatio:a,t.y1+=o*r.aspectRatio>a?o:a/r.aspectRatio);break;case"bottom":t.x2=t.x1+(t.y2-t.y1)*r.aspectRatio,a=Math.max(t.x2-i.width,0),o=Math.max(t.y2-i.height,0),(a>0||o>0)&&(t.x2-=o*r.aspectRatio>a?o*r.aspectRatio:a,t.y2-=o*r.aspectRatio>a?o:a/r.aspectRatio);break;case"topleft":t.y1=t.y2-(t.x2-t.x1)/r.aspectRatio,a=Math.max(0-t.x1,0),o=Math.max(0-t.y1,0),(a>0||o>0)&&(t.x1+=o*r.aspectRatio>a?o*r.aspectRatio:a,t.y1+=o*r.aspectRatio>a?o:a/r.aspectRatio);break;case"topright":t.y1=t.y2-(t.x2-t.x1)/r.aspectRatio,a=Math.max(t.x2-i.width,0),o=Math.max(0-t.y1,0),(a>0||o>0)&&(t.x2-=o*r.aspectRatio>a?o*r.aspectRatio:a,t.y1+=o*r.aspectRatio>a?o:a/r.aspectRatio);break;case"right":case"bottomright":t.y2=t.y1+(t.x2-t.x1)/r.aspectRatio,a=Math.max(t.x2-i.width,0),o=Math.max(t.y2-i.height,0),(a>0||o>0)&&(t.x2-=o*r.aspectRatio>a?o*r.aspectRatio:a,t.y2-=o*r.aspectRatio>a?o:a/r.aspectRatio);break;case"left":case"bottomleft":t.y2=t.y1+(t.x2-t.x1)/r.aspectRatio,a=Math.max(0-t.x1,0),o=Math.max(t.y2-i.height,0),(a>0||o>0)&&(t.x1+=o*r.aspectRatio>a?o*r.aspectRatio:a,t.y2-=o*r.aspectRatio>a?o:a/r.aspectRatio);break;case"center":t.x2=t.x1+(t.y2-t.y1)*r.aspectRatio,t.y2=t.y1+(t.x2-t.x1)/r.aspectRatio;let s=Math.max(0-t.x1,0),c=Math.max(t.x2-i.width,0),h=Math.max(t.y2-i.height,0),g=Math.max(0-t.y1,0);(s>0||c>0||h>0||g>0)&&(t.x1+=h*r.aspectRatio>s?h*r.aspectRatio:s,t.x2-=g*r.aspectRatio>c?g*r.aspectRatio:c,t.y1+=g*r.aspectRatio>c?g:c/r.aspectRatio,t.y2-=h*r.aspectRatio>s?h:s/r.aspectRatio);break}}getClientX(e){return e.touches?.[0].clientX||e.clientX||0}getClientY(e){return e.touches?.[0].clientY||e.clientY||0}}return l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=j({token:l,factory:l.\u0275fac,providedIn:"root"}),l})(),wt="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==";function vt(){return new Promise(l=>{let n=new Image;n.onload=()=>{let e=n.width===1&&n.height===2;l(e)},n.src=wt})}function At(l){switch(typeof l=="string"&&(l=Dt(l)),l){case 2:return{rotate:0,flip:!0};case 3:return{rotate:2,flip:!1};case 4:return{rotate:2,flip:!0};case 5:return{rotate:1,flip:!0};case 6:return{rotate:1,flip:!1};case 7:return{rotate:3,flip:!0};case 8:return{rotate:3,flip:!1};default:return{rotate:0,flip:!1}}}function Dt(l){let n=new DataView(It(l));if(n.getUint16(0,!1)!==65496)return-2;let e=n.byteLength,t=2;for(;t<e;){if(n.getUint16(t+2,!1)<=8)return-1;let i=n.getUint16(t,!1);if(t+=2,i==65505){if(n.getUint32(t+=2,!1)!==1165519206)return-1;let r=n.getUint16(t+=6,!1)==18761;t+=n.getUint32(t+4,r);let a=n.getUint16(t,r);t+=2;
1for(let o=0;o<a;o++)if(n.getUint16(t+o*12,r)==274)return n.getUint16(t+o*12+8,r)}else{if((i&65280)!==65280)break;t+=n.getUint16(t,!1)}}return-1}function It(l){l=l.replace(/^data\:([^\;]+)\;base64,/gmi,"");let n=atob(l),e=n.length,t=new Uint8Array(e);for(let i=0;i<e;i++)t[i]=n.charCodeAt(i);return t.buffer}var St=(()=>{class l{constructor(){this.autoRotateSupported=vt()}loadImageFile(e,t){return new Promise((i,r)=>{let a=new FileReader;a.onload=o=>{this.loadImage(o.target.result,e.type,t).then(i).catch(r)},a.readAsDataURL(e)})}loadImage(e,t,i){return this.isValidImageType(t)?this.loadBase64Image(e,i):Promise.reject(new Error("Invalid image type"))}isValidImageType(e){return/image\/(png|jpg|jpeg|bmp|gif|tiff|webp|x-icon|vnd.microsoft.icon)/.test(e)}loadImageFromURL(e,t){return new Promise((i,r)=>{let a=new Image;a.onerror=()=>r,a.onload=()=>{let o=document.createElement("canvas"),s=o.getContext("2d");o.width=a.width,o.height=a.height,s?.drawImage(a,0,0),this.loadBase64Image(o.toDataURL(),t).then(i)},a.crossOrigin="anonymous",a.src=e})}loadBase64Image(e,t){return new Promise((i,r)=>{let a=new Image;a.onload=()=>i({originalImage:a,originalBase64:e}),a.onerror=r,a.src=e}).then(i=>this.transformImageBase64(i,t))}transformImageBase64(e,t){return G(this,null,function*(){let i=yield this.autoRotateSupported,r=yield At(i?-1:e.originalBase64);if(!e.originalImage||!e.originalImage.complete)return Promise.reject(new Error("No image loaded"));let a={original:{base64:e.originalBase64,image:e.originalImage,size:{width:e.originalImage.naturalWidth,height:e.originalImage.naturalHeight}},exifTransform:r};return this.transformLoadedImage(a,t)})}transformLoadedImage(e,t){return G(this,null,function*(){let i=t.canvasRotation+e.exifTransform.rotate,r={width:e.original.image.naturalWidth,height:e.original.image.naturalHeight};if(i===0&&!e.exifTransform.flip&&!t.containWithinAspectRatio)return{original:{base64:e.original.base64,image:e.original.image,size:P({},r)},transformed:{base64:e.original.base64,image:e.original.image,size:P({},r)},exifTransform:e.exifTransform};let a=this.getTransformedSize(r,e.exifTransform,t),o=document.createElement("canvas");o.width=a.width,o.height=a.height;let s=o.getContext("2d");s?.setTransform(e.exifTransform.flip?-1:1,0,0,1,o.width/2,o.height/2),s?.rotate(Math.PI*(i/2)),s?.drawImage(e.original.image,-r.width/2,-r.height/2);let c=o.toDataURL(),h=yield this.loadImageFromBase64(c);return{original:{base64:e.original.base64,image:e.original.image,size:P({},r)},transformed:{base64:c,image:h,size:{width:h.width,height:h.height}},exifTransform:e.exifTransform}})}loadImageFromBase64(e){return new Promise((t,i)=>{let r=new Image;r.onload=()=>t(r),r.onerror=i,r.src=e})}getTransformedSize(e,t,i){let r=i.canvasRotation+t.rotate;if(i.containWithinAspectRatio)if(r%2){let a=e.width*i.aspectRatio,o=e.height/i.aspectRatio;return{width:Math.max(e.height,a),height:Math.max(e.width,o)}}else{let a=e.height*i.aspectRatio,o=e.width/i.aspectRatio;return{width:Math.max(e.width,a),height:Math.max(e.height,o)}}return r%2?{height:e.width,width:e.height}:{width:e.width,height:e.height}}}return l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=j({token:l,factory:l.\u0275fac,providedIn:"root"}),l})(),it=(()=>{class l{constructor(e,t,i,r,a){this.cropService=e,this.cropperPositionService=t,this.loadImageService=i,this.sanitizer=r,this.cd=a,this.Hammer=window?.Hammer||null,this.settings=new xe,this.setImageMaxSizeRetries=0,this.resizedWhileHidden=!1,this.marginLeft="0px",this.maxSize={width:0,height:0},this.moveTypes=W,this.imageVisible=!1,this.format=this.settings.format,this.transform={},this.maintainAspectRatio=this.settings.maintainAspectRatio,this.aspectRatio=this.settings.aspectRatio,this.resetCropOnAspectRatioChange=this.settings.resetCropOnAspectRatioChange,this.resizeToWidth=this.settings.resizeToWidth,this.resizeToHeight=this.settings.resizeToHeight,this.cropperMinWidth=this.settings.cropperMinWidth,this.cropperMinHeight=this.settings.cropperMinHeight,this.cropperMaxHeight=this.settings.cropperMaxHeight,this.cropperMaxWidth=this.settings.cropperMaxWidth,this.cropperStaticWidth=this.settings.cropperStaticWidth,this.cropperStaticHeight=this.settings.cropperStaticHeight,this.canvasRotation=this.settings.canvasRotation,this.initialStepSize=this.settings.initialStepSize,this.roundCropper=this.settings.roundCropper,this.onlyScaleDown=this.settings.onlyScaleDown,this.imageQuality=this.settings.imageQuality,this.autoCrop=this.settings.autoCrop,this.backgroundColor=this.settings.backgroundColor,this.containWithinAspectRatio=this.settings.containWithinAspectRatio,this.hideResizeSquares=this.settings.hideResizeSquares,this.allowMoveImage=!1,this.cropper={x1:-100,y1:-100,x2:1e4,y2:1e4},this.alignImage=this.settings.alignImage,this.disabled=!1,this.hidden=!1,this.imageCropped=new F,this.startCropImage=new F,this.imageLoaded=new F,this.cropperReady=new F,this.loadImageFailed=new F,this.transformChange=new F,this.reset()}ngOnChanges(e){this.onChangesUpdateSettings(e),this.onChangesInputImage(e),this.loadedImage?.original.image.complete&&(e.containWithinAspectRatio||e.canvasRotation)&&this.loadImageService.transformLoadedImage(this.loadedImage,this.settings).then(t=>this.setLoadedImage(t)).catch(t=>this.loadImageError(t)),(e.cropper||e.maintainAspectRatio||e.aspectRatio)&&(this.setMaxSize(),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize(),this.maintainAspectRatio&&(this.resetCropOnAspectRatioChange||!this.aspectRatioIsCorrect())&&(e.maintainAspectRatio||e.aspectRatio)?this.resetCropperPosition():e.cropper&&(this.checkCropperPosition(!1),this.doAutoCrop()),this.cd.markForCheck()),e.transform&&(this.transform=this.transform||{},this.setCssTransform(),this.doAutoCrop(),this.cd.markForCheck()),e.hidden&&this.resizedWhileHidden&&!this.hidden&&setTimeout(()=>{this.onResize(),this.resizedWhileHidden=!1})}onChangesUpdateSettings(e){this.settings.setOptionsFromChanges(e),this.settings.cropperStaticHeight&&this.settings.cropperStaticWidth&&this.settings.setOptions({hideResizeSquares:!0,cropperMinWidth:this.settings.cropperStaticWidth,cropperMinHeight:this.settings.cropperStaticHeight,cropperMaxHeight:this.settings.cropperStaticHeight,cropperMaxWidth:this.settings.cropperStaticWidth,maintainAspectRatio:!1})}onChangesInputImage(e){(e.imageChangedEvent||e.imageURL||e.imageBase64||e.imageFile)&&this.reset(),e.
1imageChangedEvent&&this.isValidImageChangedEvent()&&this.loadImageFile(this.imageChangedEvent.target.files[0]),e.imageURL&&this.imageURL&&this.loadImageFromURL(this.imageURL),e.imageBase64&&this.imageBase64&&this.loadBase64Image(this.imageBase64),e.imageFile&&this.imageFile&&this.loadImageFile(this.imageFile)}isValidImageChangedEvent(){return this.imageChangedEvent?.target?.files?.length>0}setCssTransform(){let e=this.transform?.translateUnit||"%";this.safeTransformStyle=this.sanitizer.bypassSecurityTrustStyle(`translate(${this.transform.translateH||0}${e}, ${this.transform.translateV||0}${e}) scaleX(`+(this.transform.scale||1)*(this.transform.flipH?-1:1)+") scaleY("+(this.transform.scale||1)*(this.transform.flipV?-1:1)+") rotate("+(this.transform.rotate||0)+"deg)")}ngOnInit(){this.settings.stepSize=this.initialStepSize,this.activatePinchGesture()}reset(){this.imageVisible=!1,this.loadedImage=void 0,this.safeImgDataUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.moveStart={active:!1,type:null,position:null,x1:0,y1:0,x2:0,y2:0,clientX:0,clientY:0},this.maxSize={width:0,height:0},this.cropper.x1=-100,this.cropper.y1=-100,this.cropper.x2=1e4,this.cropper.y2=1e4}loadImageFile(e){this.loadImageService.loadImageFile(e,this.settings).then(t=>this.setLoadedImage(t)).catch(t=>this.loadImageError(t))}loadBase64Image(e){this.loadImageService.loadBase64Image(e,this.settings).then(t=>this.setLoadedImage(t)).catch(t=>this.loadImageError(t))}loadImageFromURL(e){this.loadImageService.loadImageFromURL(e,this.settings).then(t=>this.setLoadedImage(t)).catch(t=>this.loadImageError(t))}setLoadedImage(e){this.loadedImage=e,this.safeImgDataUrl=this.sanitizer.bypassSecurityTrustResourceUrl(e.transformed.base64),this.cd.markForCheck()}loadImageError(e){console.error(e),this.loadImageFailed.emit()}imageLoadedInView(){this.loadedImage!=null&&(this.imageLoaded.emit(this.loadedImage),this.setImageMaxSizeRetries=0,setTimeout(()=>this.checkImageMaxSizeRecursively()))}checkImageMaxSizeRecursively(){this.setImageMaxSizeRetries>40?this.loadImageFailed.emit():this.sourceImageLoaded()?(this.setMaxSize(),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize(),this.resetCropperPosition(),this.cropperReady.emit(P({},this.maxSize)),this.cd.markForCheck()):(this.setImageMaxSizeRetries++,setTimeout(()=>this.checkImageMaxSizeRecursively(),50))}sourceImageLoaded(){return this.sourceImage?.nativeElement?.offsetWidth>0}onResize(){this.loadedImage&&(this.hidden?this.resizedWhileHidden=!0:(this.resizeCropperPosition(),this.setMaxSize(),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize()))}activatePinchGesture(){if(this.Hammer){let e=new this.Hammer(this.wrapper.nativeElement);e.get("pinch").set({enable:!0}),e.on("pinchmove",this.onPinch.bind(this)),e.on("pinchend",this.pinchStop.bind(this)),e.on("pinchstart",this.startPinch.bind(this))}else Be()&&console.warn("[NgxImageCropper] Could not find HammerJS - Pinch Gesture won't work")}resizeCropperPosition(){let e=this.sourceImage.nativeElement;(this.maxSize.width!==e.offsetWidth||this.maxSize.height!==e.offsetHeight)&&(this.cropper.x1=this.cropper.x1*e.offsetWidth/this.maxSize.width,this.cropper.x2=this.cropper.x2*e.offsetWidth/this.maxSize.width,this.cropper.y1=this.cropper.y1*e.offsetHeight/this.maxSize.height,this.cropper.y2=this.cropper.y2*e.offsetHeight/this.maxSize.height)}resetCropperPosition(){this.cropperPositionService.resetCropperPosition(this.sourceImage,this.cropper,this.settings),this.doAutoCrop(),this.imageVisible=!0}keyboardAccess(e){this.changeKeyboardStepSize(e),this.keyboardMoveCropper(e)}changeKeyboardStepSize(e){let t=+e.key;t>=1&&t<=9&&(this.settings.stepSize=t)}keyboardMoveCropper(e){if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(e.key))return;let i=e.shiftKey?W.Resize:W.Move,r=e.altKey?xt(e.key):_t(e.key),a=Ct(e.key,this.settings.stepSize);e.preventDefault(),e.stopPropagation(),this.startMove({clientX:0,clientY:0},i,r),this.moveImg(a),this.moveStop()}startMove(e,t,i=null){this.disabled||this.moveStart?.active&&this.moveStart?.type===W.Pinch||t===W.Drag&&!this.allowMoveImage||(e.preventDefault&&e.preventDefault(),this.moveStart=P({active:!0,type:t,position:i,transform:P({},this.transform),clientX:this.cropperPositionService.getClientX(e),clientY:this.cropperPositionService.getClientY(e)},this.cropper))}startPinch(e){this.safeImgDataUrl&&(e.preventDefault&&e.preventDefault(),this.moveStart=P({active:!0,type:W.Pinch,position:"center",clientX:this.cropper.x1+(this.cropper.x2-this.cropper.x1)/2,clientY:this.cropper.y1+(this.cropper.y2-this.cropper.y1)/2},this.cropper))}moveImg(e){if(this.moveStart.active){if(e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),this.moveStart.type===W.Move)this.cropperPositionService.move(e,this.moveStart,this.cropper),this.checkCropperPosition(!0);else if(this.moveStart.type===W.Resize)!this.cropperStaticWidth&&!this.cropperStaticHeight&&this.cropperPositionService.resize(e,this.moveStart,this.cropper,this.maxSize,this.settings),this.checkCropperPosition(!1);else if(this.moveStart.type===W.Drag){let t=this.cropperPositionService.getClientX(e)-this.moveStart.clientX,i=this.cropperPositionService.getClientY(e)-this.moveStart.clientY;this.transform=K(P({},this.transform),{translateH:(this.moveStart.transform?.translateH||0)+t,translateV:(this.moveStart.transform?.translateV||0)+i}),this.setCssTransform()}this.cd.detectChanges()}}onPinch(e){this.moveStart.active&&(e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),this.moveStart.type===W.Pinch&&(this.cropperPositionService.resize(e,this.moveStart,this.cropper,this.maxSize,this.settings),this.checkCropperPosition(!1)),this.cd.detectChanges())}setMaxSize(){if(this.sourceImage){let e=this.sourceImage.nativeElement;this.maxSize.width=e.offsetWidth,this.maxSize.height=e.offsetHeight,this.marginLeft=this.sanitizer.bypassSecurityTrustStyle("calc(50% - "+this.maxSize.width/2+"px)")}}setCropperScaledMinSize(){this.loadedImage?.transformed?.image?(this.setCropperScaledMinWidth(),this.setCropperScaledMinHeight()):(this.settings.cropperScaledMinWidth=20,this.settings.cropperScaledMinHeight=20)}setCropperScaledMinWidth(){this.settings.cropperScaledMinWidth=this.cropperMinWidth>0?Math.max(20,this.cropperMinWidth/this.loadedImage.transformed.image.width*this.maxSize.width):20}setCropperScaledMinHeight(){this.maintainAspectRatio?this.settings.cropperScaledMinHeight=Math.max(20,this.settings.cropperScaledMinWidth/this.aspectRatio):this.cropperMinHeight>0?this.settings.cropperScaledMinHeight=Math.max(20,this.cropperMinHeight/this.loadedImage.transformed.image.height*this.maxSize.height):this.settings.cropperScaledMinHeight=20}setCropperScaledMaxSize(){if(this.loadedImage?.transformed?.image){let e=this.loadedImage.transformed.size.width/this.maxSize.width;this.settings.cropperScaledMaxWidth=this.cropperMaxWidth>20?this.cropperMaxWidth/e:this.maxSize.width,this.settings.cropperScaledMaxHeight=this.cropperMaxHeight>20?this.cropperMaxHeight/e:this.maxSize.height,this.maintainAspectRatio&&(this.settings.cropperScaledMaxWidth>this.settings.cropperScaledMaxHeight*this.aspectRatio?this.settings.cropperScaledMaxWidth=this.settings.cropperScaledMaxHeight*this.aspectRatio:this.settings.cropperScaledMaxWidth<this.settings.cropperScaledMaxHeight*this.aspectRatio&&(this.settings.cropperScaledMaxHeight=this.settings.cropperScaledMaxWidth/this.aspectRatio))}else this.settings.cropperScaledMaxWidth=this.maxSize.width,this.settings.cropperScaledMaxHeight=this.maxSize.height}checkCropperPosition(e=!1){this.cropper.x1<0&&(this.cropper.x2-=e?this.cropper.x1:0,this.cropper.x1=0),this.cropper.y1<0&&(this.cropper.y2-=e?this.cropper.y1:0,this.cropper.y1=0),this.cropper.x2>this.maxSize.width&&(this.cropper.x1-=e?this.cropper.x2-this.maxSize.width:0,this.cropper.x2=this.maxSize.width),this.cropper.y2>this.maxSize.height&&(this.cropper.y1-=e?this.cropper.y2-this.maxSize.height:0,this.cropper.y2=this.maxSize.height)}moveStop(){this.moveStart.active&&(this.moveStart.active=!1,this.moveStart?.type===W.Drag?this.transformChange.emit(this.transform):this.doAutoCrop())}pinchStop(){this.moveStart.active&&(this.moveStart.active=!1,this.doAutoCrop())}doAutoCrop(){this.autoCrop&&this.crop()}crop(){if(this.loadedImage?.transformed?.image!=null){this.startCropImage.emit();let e=this.cropService.crop(this.sourceImage,this.loadedImage,this.cropper,this.settings);return e!=null&&this.imageCropped.emit(e),e}return null}aspectRatioIsCorrect(){return(this.cropper.x2-this.cropper.x1)/(this.cropper.y2-this.cropper.y1)===this.aspectRatio}}return l.\u0275fac=function(e){return new(e||l)(z(yt),z(Mt),z(St),z(se),z(Le))},l.\u0275cmp=X({type:l,selectors:[["image-cropper"]],viewQuery:function(e,t){if(e&1&&ke(pt,7)(mt,5),e&2){let i;ue(i=_e())&&(t.wrapper=i.first),ue(i=_e())&&(t.sourceImage=i.first)}},hostVars:6,hostBindings:function(e,t){e&1&&D("resize",function(){return t.onResize()},ie)("mousemove",function(r){return t.moveImg(r)},$)("touchmove",function(r){return t.moveImg(r)},$)("mouseup",function(){return t.moveStop()},$)("touchend",function(){return t.moveStop()},$),e&2&&(B("text-align",t.alignImage),ae("disabled",t.disabled)("ngx-ix-hidden",t.hidden))},inputs:{imageChangedEvent:"imageChangedEvent",imageURL:"imageURL",imageBase64:"imageBase64",imageFile:"imageFile",imageAltText:"imageAltText",format:"format",transform:"transform",maintainAspectRatio:"maintainAspectRatio",as
1pectRatio:"aspectRatio",resetCropOnAspectRatioChange:"resetCropOnAspectRatioChange",resizeToWidth:"resizeToWidth",resizeToHeight:"resizeToHeight",cropperMinWidth:"cropperMinWidth",cropperMinHeight:"cropperMinHeight",cropperMaxHeight:"cropperMaxHeight",cropperMaxWidth:"cropperMaxWidth",cropperStaticWidth:"cropperStaticWidth",cropperStaticHeight:"cropperStaticHeight",canvasRotation:"canvasRotation",initialStepSize:"initialStepSize",roundCropper:"roundCropper",onlyScaleDown:"onlyScaleDown",imageQuality:"imageQuality",autoCrop:"autoCrop",backgroundColor:"backgroundColor",containWithinAspectRatio:"containWithinAspectRatio",hideResizeSquares:"hideResizeSquares",allowMoveImage:"allowMoveImage",cropper:"cropper",alignImage:"alignImage",disabled:"disabled",hidden:"hidden"},outputs:{imageCropped:"imageCropped",startCropImage:"startCropImage",imageLoaded:"imageLoaded",cropperReady:"cropperReady",loadImageFailed:"loadImageFailed",transformChange:"transformChange"},standalone:!1,features:[Ae],decls:5,vars:10,consts:[["wrapper",""],["sourceImage",""],["class","ngx-ic-source-image",3,"src","visibility","transform","ngx-ic-draggable","load","mousedown","touchstart","error",4,"ngIf"],[1,"ngx-ic-overlay"],["class","ngx-ic-cropper","tabindex","0",3,"ngx-ic-round","top","left","width","height","margin-left","visibility","keydown",4,"ngIf"],[1,"ngx-ic-source-image",3,"load","mousedown","touchstart","error","src"],["tabindex","0",1,"ngx-ic-cropper",3,"keydown"],[1,"ngx-ic-move",3,"mousedown","touchstart"],[4,"ngIf"],[1,"ngx-ic-resize","ngx-ic-topleft",3,"mousedown","touchstart"],[1,"ngx-ic-square"],[1,"ngx-ic-resize","ngx-ic-top"],[1,"ngx-ic-resize","ngx-ic-topright",3,"mousedown","touchstart"],[1,"ngx-ic-resize","ngx-ic-right"],[1,"ngx-ic-resize","ngx-ic-bottomright",3,"mousedown","touchstart"],[1,"ngx-ic-resize","ngx-ic-bottom"],[1,"ngx-ic-resize","ngx-ic-bottomleft",3,"mousedown","touchstart"],[1,"ngx-ic-resize","ngx-ic-left"],[1,"ngx-ic-resize-bar","ngx-ic-top",3,"mousedown","touchstart"],[1,"ngx-ic-resize-bar","ngx-ic-right",3,"mousedown","touchstart"],[1,"ngx-ic-resize-bar","ngx-ic-bottom",3,"mousedown","touchstart"],[1,"ngx-ic-resize-bar","ngx-ic-left",3,"mousedown","touchstart"]],template:function(e,t){e&1&&(u(0,"div",null,0),re(2,ft,2,8,"img",2),O(3,"div",3),re(4,ut,3,15,"div",4),_()),e&2&&(B("background",t.imageVisible&&t.backgroundColor),w(2),E("ngIf",t.safeImgDataUrl),w(),B("width",t.maxSize.width,"px")("height",t.maxSize.height,"px")("margin-left",t.alignImage==="center"?t.marginLeft:null),w(),E("ngIf",t.imageVisible))},dependencies:[Fe],styles:['[_nghost-%COMP%]{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center}[_nghost-%COMP%] > div[_ngcontent-%COMP%]{width:100%;position:relative}[_nghost-%COMP%] > div[_ngcontent-%COMP%] img.ngx-ic-source-image[_ngcontent-%COMP%]{max-width:100%;max-height:100%;transform-origin:center}[_nghost-%COMP%] > div[_ngcontent-%COMP%] img.ngx-ic-source-image.ngx-ic-draggable[_ngcontent-%COMP%]{user-drag:none;-webkit-user-drag:none;user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;cursor:grab}[_nghost-%COMP%] .ngx-ic-overlay[_ngcontent-%COMP%]{position:absolute;pointer-events:none;touch-action:none;outline:var(--cropper-overlay-color, white) solid 100vw;top:0;left:0}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%]{position:absolute;display:flex;color:#53535c;background:transparent;outline:rgba(255,255,255,.3) solid 100vw;outline:var(--cropper-outline-color, rgba(255, 255, 255, .3)) solid 100vw;touch-action:none}@media (orientation: portrait){[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%]{outline-width:100vh}}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%]:after{position:absolute;content:"";inset:0;pointer-events:none;border:dashed 1px;opacity:.75;color:inherit;z-index:1}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-move[_ngcontent-%COMP%]{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%]:focus .ngx-ic-move[_ngcontent-%COMP%]{border-color:#1e90ff;border-width:2px}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize[_ngcontent-%COMP%]{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize[_ngcontent-%COMP%] .ngx-ic-square[_ngcontent-%COMP%]{display:inline-block;background:#53535C;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-topleft[_ngcontent-%COMP%]{top:-12px;left:-12px;cursor:nwse-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-top[_ngcontent-%COMP%]{top:-12px;left:calc(50% - 12px);cursor:ns-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-topright[_ngcontent-%COMP%]{top:-12px;right:-12px;cursor:nesw-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-right[_ngcontent-%COMP%]{top:calc(50% - 12px);right:-12px;cursor:ew-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-bottomright[_ngcontent-%COMP%]{bottom:-12px;right:-12px;cursor:nwse-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-bottom[_ngcontent-%COMP%]{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-bottomleft[_ngcontent-%COMP%]{bottom:-12px;left:-12px;cursor:nesw-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-left[_ngcontent-%COMP%]{top:calc(50% - 12px);left:-12px;cursor:ew-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar[_ngcontent-%COMP%]{position:absolute;z-index:1}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar.ngx-ic-top[_ngcontent-%COMP%]{top:-11px;left:11px;width:calc(100% - 22px);height:22px;
1cursor:ns-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar.ngx-ic-right[_ngcontent-%COMP%]{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar.ngx-ic-bottom[_ngcontent-%COMP%]{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar.ngx-ic-left[_ngcontent-%COMP%]{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}[_nghost-%COMP%] .ngx-ic-cropper.ngx-ic-round[_ngcontent-%COMP%]{outline-color:transparent}[_nghost-%COMP%] .ngx-ic-cropper.ngx-ic-round[_ngcontent-%COMP%]:after{border-radius:100%;box-shadow:0 0 0 100vw #ffffff4d;box-shadow:0 0 0 100vw var(--cropper-outline-color, rgba(255, 255, 255, .3))}@media (orientation: portrait){[_nghost-%COMP%] .ngx-ic-cropper.ngx-ic-round[_ngcontent-%COMP%]:after{box-shadow:0 0 0 100vh #ffffff4d;box-shadow:0 0 0 100vh var(--cropper-outline-color, rgba(255, 255, 255, .3))}}[_nghost-%COMP%] .ngx-ic-cropper.ngx-ic-round[_ngcontent-%COMP%] .ngx-ic-move[_ngcontent-%COMP%]{border-radius:100%}.disabled[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize[_ngcontent-%COMP%], .disabled[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar[_ngcontent-%COMP%], .disabled[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-move[_ngcontent-%COMP%]{display:none}.ngx-ix-hidden[_nghost-%COMP%]{display:none}'],changeDetection:0}),l})(),pi=(()=>{class l{}return l.\u0275fac=function(e){return new(e||l)},l.\u0275mod=ne({type:l}),l.\u0275inj=te({imports:[[oe]]}),l})();var N=class{constructor(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=.5;this.Match_Distance=1e3;this.Patch_DeleteThreshold=.5;this.Patch_Margin=4;this.Match_MaxBits=32;this.whitespaceRegex_=new RegExp("/s/");this.linebreakRegex_=new RegExp(`/[\r 2]/`);this.blanklineEndRegex_=new RegExp(`/ 3\r? 4$/`);this.blanklineStartRegex_=new RegExp(`/^\r? 5\r? 6/`);this.diff_prettyHtml=function(n){let e=[],t=/&/g,i=/</g,r=/>/g,a=/\n/g;for(let o=0;o<n.length;o++){let s=n[o][0],h=n[o][1].replace(t,"&").replace(i,"<").replace(r,">").replace(a,"¶<br>");switch(s){case 1:e[o]='<ins style="background:#e6ffe6;">'+h+"</ins>";break;case-1:e[o]='<del style="background:#ffe6e6;">'+h+"</del>";break;case 0:e[o]="<span>"+h+"</span>";break}}return e.join("")};this.patch_splitMax=function(n){let e=this.Match_MaxBits;for(let t=0;t<n.length;t++){if(n[t].length1<=e)continue;let i=n[t];n.splice(t--,1);let r=i.start1,a=i.start2,o="";for(;i.diffs.length!==0;){let s=new Q,c=!0;for(s.start1=r-o.length,s.start2=a-o.length,o!==""&&(s.length1=s.length2=o.length,s.diffs.push([0,o]));i.diffs.length!==0&&s.length1<e-this.Patch_Margin;){let g=i.diffs[0][0],p=i.diffs[0][1];g===1?(s.length2+=p.length,a+=p.length,s.diffs.push(i.diffs.shift()),c=!1):g===-1&&s.diffs.length==1&&s.diffs[0][0]==0&&p.length>2*e?(s.length1+=p.length,r+=p.length,c=!1,s.diffs.push([g,p]),i.diffs.shift()):(p=p.substring(0,e-s.length1-this.Patch_Margin),s.length1+=p.length,r+=p.length,g===0?(s.length2+=p.length,a+=p.length):c=!1,s.diffs.push([g,p]),p==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(p.length))}o=this.diff_text2(s.diffs),o=o.substring(o.length-this.Patch_Margin);let h=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);h!==""&&(s.length1+=h.length,s.length2+=h.length,s.diffs.length!==0&&s.diffs[s.diffs.length-1][0]===0?s.diffs[s.diffs.length-1][1]+=h:s.diffs.push([0,h])),c||n.splice(++t,0,s)}}}}diff_main(n,e,t,i){typeof i>"u"&&(this.Diff_Timeout<=0?i=Number.MAX_VALUE:i=new Date().getTime()+this.Diff_Timeout*1e3);let r=i;if(n==null||e==null)throw new Error("Null input. (diff_main)");if(n==e)return n?[[0,n]]:[];typeof t>"u"&&(t=!0);let a=t,o=this.diff_commonPrefix(n,e),s=n.substring(0,o);n=n.substring(o),e=e.substring(o),o=this.diff_commonSuffix(n,e);let c=n.substring(n.length-o);n=n.substring(0,n.length-o),e=e.substring(0,e.length-o);let h=this.diff_compute_(n,e,a,r);return s&&h.unshift([0,s]),c&&h.push([0,c]),this.diff_cleanupMerge(h),h}diff_compute_(n,e,t,i){let r;if(!n)return[[1,e]];if(!e)return[[-1,n]];let a=n.length>e.length?n:e,o=n.length>e.length?e:n,s=a.indexOf(o);if(s!=-1)return r=[[1,a.substring(0,s)],[0,o],[1,a.substring(s+o.length)]],n.length>e.length&&(r[0][0]=r[2][0]=-1),r;if(o.length==1)return[[-1,n],[1,e]];let c=this.diff_halfMatch_(n,e);if(c){let h=c[0],g=c[1],p=c[2],f=c[3],d=c[4],x=this.diff_main(h,p,t,i),M=this.diff_main(g,f,t,i);return x.concat([[0,d]],M)}return t&&n.length>100&&e.length>100?this.diff_lineMode_(n,e,i):this.diff_bisect_(n,e,i)}diff_lineMode_(n,e,t){let i=this.diff_linesToChars_(n,e);n=i.chars1,e=i.chars2;let r=i.lineArray,a=this.diff_main(n,e,!1,t);this.diff_charsToLines_(a,r),this.diff_cleanupSemantic(a),a.push([0,""]);let o=0,s=0,c=0,h="",g="";for(;o<a.length;){switch(a[o][0]){case 1:c++,g+=a[o][1];break;case-1:s++,h+=a[o][1];break;case 0:if(s>=1&&c>=1){a.splice(o-s-c,s+c),o=o-s-c;let p=this.diff_main(h,g,!1,t);for(let f=p.length-1;f>=0;f--)a.splice(o,0,p[f]);o=o+p.length}c=0,s=0,h="",g="";break}o++}return a.pop(),a}
6diff_bisect_(n,e,t){let i=n.length,r=e.length,a=Math.ceil((i+r)/2),o=a,s=2*a,c=new Array(s),h=new Array(s);for(let v=0;v<s;v++)c[v]=-1,h[v]=-1;c[o+1]=0,h[o+1]=0;let g=i-r,p=g%2!=0,f=0,d=0,x=0,M=0;for(let v=0;v<a&&!(new Date().getTime()>t);v++){for(let C=-v+f;C<=v-d;C+=2){let R=o+C,A;C==-v||C!=v&&c[R-1]<c[R+1]?A=c[R+1]:A=c[R-1]+1;let T=A-C;for(;A<i&&T<r&&n.charAt(A)==e.charAt(T);)A++,T++;if(c[R]=A,A>i)d+=2;else if(T>r)f+=2;else if(p){let H=o+g-C;if(H>=0&&H<s&&h[H]!=-1){let L=i-h[H];if(A>=L)return this.diff_bisectSplit_(n,e,A,T,t)}}}for(let C=-v+x;C<=v-M;C+=2){let R=o+C,A;C==-v||C!=v&&h[R-1]<h[R+1]?A=h[R+1]:A=h[R-1]+1;let T=A-C;for(;A<i&&T<r&&n.charAt(i-A-1)==e.charAt(r-T-1);)A++,T++;if(h[R]=A,A>i)M+=2;else if(T>r)x+=2;else if(!p){let H=o+g-C;if(H>=0&&H<s&&c[H]!=-1){let L=c[H],Z=o+L-H;if(A=i-A,L>=A)return this.diff_bisectSplit_(n,e,L,Z,t)}}}}return[[-1,n],[1,e]]}diff_bisectSplit_(n,e,t,i,r){let a=n.substring(0,t),o=e.substring(0,i),s=n.substring(t),c=e.substring(i),h=this.diff_main(a,o,!1,r),g=this.diff_main(s,c,!1,r);return h.concat(g)}diff_linesToChars_(n,e){let t=[],i={};t[0]="";let r=this.diff_linesToCharsMunge_(n,t,i),a=this.diff_linesToCharsMunge_(e,t,i);return{chars1:r,chars2:a,lineArray:t}}diff_linesToCharsMunge_(n,e,t){let i="",r=0,a=-1,o=e.length;for(;a<n.length-1;){a=n.indexOf(` 7`,r),a==-1&&(a=n.length-1);let s=n.substring(r,a+1);r=a+1,(t.hasOwnProperty?t.hasOwnProperty(s):t[s]!==void 0)?i+=String.fromCharCode(t[s]):(i+=String.fromCharCode(o),t[s]=o,e[o++]=s)}return i}diff_charsToLines_(n,e){for(let t=0;t<n.length;t++){let i=n[t][1],r=[];for(let a=0;a<i.length;a++)r[a]=e[i.charCodeAt(a)];n[t][1]=r.join("")}}diff_commonPrefix(n,e){if(!n||!e||n.charAt(0)!=e.charAt(0))return 0;let t=0,i=Math.min(n.length,e.length),r=i,a=0;for(;t<r;)n.substring(a,r)==e.substring(a,r)?(t=r,a=t):i=r,r=Math.floor((i-t)/2+t);return r}diff_commonSuffix(n,e){if(!n||!e||n.charAt(n.length-1)!=e.charAt(e.length-1))return 0;let t=0,i=Math.min(n.length,e.length),r=i,a=0;for(;t<r;)n.substring(n.length-r,n.length-a)==e.substring(e.length-r,e.length-a)?(t=r,a=t):i=r,r=Math.floor((i-t)/2+t);return r}diff_commonOverlap_(n,e){let t=n.length,i=e.length;if(t==0||i==0)return 0;t>i?n=n.substring(t-i):t<i&&(e=e.substring(0,t));let r=Math.min(t,i);if(n==e)return r;let a=0,o=1;for(;;){let s=n.substring(r-o),c=e.indexOf(s);if(c==-1)return a;o+=c,(c==0||n.substring(r-o)==e.substring(0,o))&&(a=o,o++)}}diff_halfMatch_(n,e){if(this.Diff_Timeout<=0)return null;let t=n.length>e.length?n:e,i=n.length>e.length?e:n;if(t.length<4||i.length*2<t.length)return null;let r=this,a=this.diff_halfMatchI_(t,i,Math.ceil(t.length/4),r),o=this.diff_halfMatchI_(t,i,Math.ceil(t.length/2),r),s;if(!a&&!o)return null;o?a?s=a[4].length>o[4].length?a:o:s=o:s=a;let c,h,g,p;n.length>e.length?(c=s[0],h=s[1],g=s[2],p=s[3]):(g=s[0],p=s[1],c=s[2],h=s[3]);let f=s[4];return[c,h,g,p,f]}diff_halfMatchI_(n,e,t,i){let r=n.substring(t,t+Math.floor(n.length/4)),a=-1,o="",s,c,h,g;for(;(a=e.indexOf(r,a+1))!=-1;){let p=i.diff_commonPrefix(n.substring(t),e.substring(a)),f=i.diff_commonSuffix(n.substring(0,t),e.substring(0,a));o.length<f+p&&(o=e.substring(a-f,a)+e.substring(a,a+p),s=n.substring(0,t-f),c=n.substring(t+p),h=e.substring(0,a-f),g=e.substring(a+p))}return o.length*2>=n.length?[s,c,h,g,o]:null}diff_cleanupSemantic(n){let e=!1,t=[],i=0,r=null,a=0,o=0,s=0,c=0,h=0;for(;a<n.length;)n[a][0]==0?(t[i++]=a,o=c,s=h,c=0,h=0,r=n[a][1]):(n[a][0]==1?c+=n[a][1].length:h+=n[a][1].length,r&&r.length<=Math.max(o,s)&&r.length<=Math.max(c,h)&&(n.splice(t[i-1],0,[-1,r]),n[t[i-1]+1][0]=1,i--,i--,a=i>0?t[i-1]:-1,o=0,s=0,c=0,h=0,r=null,e=!0)),a++;for(e&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),a=1;a<n.length;){if(n[a-1][0]==-1&&n[a][0]==1){let g=n[a-1][1],p=n[a][1],f=this.diff_commonOverlap_(g,p),d=this.diff_commonOverlap_(p,g);f>=d?(f>=g.length/2||f>=p.length/2)&&(n.splice(a,0,[0,p.substring(0,f)]),n[a-1][1]=g.substring(0,g.length-f),n[a+1][1]=p.substring(f),a++):(d>=g.length/2||d>=p.length/2)&&(n.splice(a,0,[0,g.substring(0,d)]),n[a-1][0]=1,n[a-1][1]=p.substring(0,p.length-d),n[a+1][0]=-1,n[a+1][1]=g.substring(d),a++),a++}a++}}diff_cleanupSemanticLossless(n){function e(i,r){if(!i||!r)return 6;let a=new RegExp("/[^a-zA-Z0-9]/"),o=i.charAt(i.length-1),s=r.charAt(0),c=o.match(a),h=s.match(a),g=c&&o.match(this.whitespaceRegex_),p=h&&s.match(this.whitespaceRegex_),f=g&&o.match(this.linebreakRegex_),d=p&&s.match(this.linebreakRegex_),x=f&&i.match(this.blanklineEndRegex_),M=d&&r.match(this.blanklineStartRegex_);return x||M?5:f||d?4:c&&!g&&p?3:g||p?2:c||h?1:0}let t=1;for(;t<n.length-1;){if(n[t-1][0]==0&&n[t+1][0]==0){let i=n[t-1][1],r=n[t][1],a=n[t+1][1],o=this.diff_commonSuffix(i,r);if(o){let p=r.substring(r.length-o);i=i.substring(0,i.length-o),r=p+r.substring(0,r.length-o),a=p+a}let s=i,c=r,h=a,g=e(i,r)+e(r,a);for(;r.charAt(0)===a.charAt(0);){i+=r.charAt(0),r=r.substring(1)+a.charAt(0),a=a.substring(1);let p=e(i,r)+e(r,a);p>=g&&(g=p,s=i,c=r,h=a)}n[t-1][1]!=s&&(s?n[t-1][1]=s:(n.splice(t-1,1),t--),n[t][1]=c,h?n[t+1][1]=h:(n.splice(t+1,1),t--))}t++}}diff_cleanupEfficiency(n){let e=!1,t=[],i=0,r=null,a=0,o=!1,s=!1,c=!1,h=!1;for(;a<n.length;)n[a][0]==0?(n[a][1].length<this.Diff_EditCost&&(c||h)?(t[i++]=a,o=c,s=h,r=n[a][
71]):(i=0,r=null),c=h=!1):(n[a][0]==-1?h=!0:c=!0,r&&(o&&s&&c&&h||r.length<this.Diff_EditCost/2&&(o?1:0)+(s?1:0)+(c?1:0)+(h?1:0)==3)&&(n.splice(t[i-1],0,[-1,r]),n[t[i-1]+1][0]=1,i--,r=null,o&&s?(c=h=!0,i=0):(i--,a=i>0?t[i-1]:-1,c=h=!1),e=!0)),a++;e&&this.diff_cleanupMerge(n)}diff_cleanupMerge(n){n.push([0,""]);let e=0,t=0,i=0,r="",a="",o;for(;e<n.length;)switch(n[e][0]){case 1:i++,a+=n[e][1],e++;break;case-1:t++,r+=n[e][1],e++;break;case 0:t+i>1?(t!==0&&i!==0&&(o=this.diff_commonPrefix(a,r),o!==0&&(e-t-i>0&&n[e-t-i-1][0]==0?n[e-t-i-1][1]+=a.substring(0,o):(n.splice(0,0,[0,a.substring(0,o)]),e++),a=a.substring(o),r=r.substring(o)),o=this.diff_commonSuffix(a,r),o!==0&&(n[e][1]=a.substring(a.length-o)+n[e][1],a=a.substring(0,a.length-o),r=r.substring(0,r.length-o))),t===0?n.splice(e-i,t+i,[1,a]):i===0?n.splice(e-t,t+i,[-1,r]):n.splice(e-t-i,t+i,[-1,r],[1,a]),e=e-t-i+(t?1:0)+(i?1:0)+1):e!==0&&n[e-1][0]==0?(n[e-1][1]+=n[e][1],n.splice(e,1)):e++,i=0,t=0,r="",a="";break}n[n.length-1][1]===""&&n.pop();let s=!1;for(e=1;e<n.length-1;)n[e-1][0]==0&&n[e+1][0]==0&&(n[e][1].substring(n[e][1].length-n[e-1][1].length)==n[e-1][1]?(n[e][1]=n[e-1][1]+n[e][1].substring(0,n[e][1].length-n[e-1][1].length),n[e+1][1]=n[e-1][1]+n[e+1][1],n.splice(e-1,1),s=!0):n[e][1].substring(0,n[e+1][1].length)==n[e+1][1]&&(n[e-1][1]+=n[e+1][1],n[e][1]=n[e][1].substring(n[e+1][1].length)+n[e+1][1],n.splice(e+1,1),s=!0)),e++;s&&this.diff_cleanupMerge(n)}diff_xIndex(n,e){let t=0,i=0,r=0,a=0,o;for(o=0;o<n.length&&(n[o][0]!==1&&(t+=n[o][1].length),n[o][0]!==-1&&(i+=n[o][1].length),!(t>e));o++)r=t,a=i;return n.length!=o&&n[o][0]===-1?a:a+(e-r)}diff_text1(n){let e=[];for(let t=0;t<n.length;t++)n[t][0]!==1&&(e[t]=n[t][1]);return e.join("")}diff_text2(n){let e=[];for(let t=0;t<n.length;t++)n[t][0]!==-1&&(e[t]=n[t][1]);return e.join("")}diff_levenshtein(n){let e=0,t=0,i=0;for(let r=0;r<n.length;r++){let a=n[r][0],o=n[r][1];switch(a){case 1:t+=o.length;break;case-1:i+=o.length;break;case 0:e+=Math.max(t,i),t=0,i=0;break}}return e+=Math.max(t,i),e}diff_toDelta(n){let e=[];for(let t=0;t<n.length;t++)switch(n[t][0]){case 1:e[t]="+"+encodeURI(n[t][1]);break;case-1:e[t]="-"+n[t][1].length;break;case 0:e[t]="="+n[t][1].length;break}return e.join(" ").replace(/%20/g," ")}diff_fromDelta(n,e){let t=[],i=0,r=0,a=e.split(/\t/g);for(let o=0;o<a.length;o++){let s=a[o].substring(1);switch(a[o].charAt(0)){case"+":try{t[i++]=[1,decodeURI(s)]}catch(g){throw new Error("Illegal escape in diff_fromDelta: "+s)}break;case"-":case"=":let c=parseInt(s,10);if(isNaN(c)||c<0)throw new Error("Invalid number in diff_fromDelta: "+s);let h=n.substring(r,r+=c);a[o].charAt(0)=="="?t[i++]=[0,h]:t[i++]=[-1,h];break;default:if(a[o])throw new Error("Invalid diff operation in diff_fromDelta: "+a[o])}}if(r!=n.length)throw new Error("Delta length ("+r+") does not equal source text length ("+n.length+").");return t}match_main(n,e,t){if(n==null||e==null||t==null)throw new Error("Null input. (match_main)");return t=Math.max(0,Math.min(t,n.length)),n==e?0:n.length?n.substring(t,t+e.length)==e?t:this.match_bitap_(n,e,t):-1}match_bitap_(n,e,t){if(e.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");let i=this.match_alphabet_(e),r=this;function a(d,x){let M=d/e.length,v=Math.abs(t-x);return r.Match_Distance?M+v/r.Match_Distance:v?1:M}let o=this.Match_Threshold,s=n.indexOf(e,t);s!=-1&&(o=Math.min(a(0,s),o),s=n.lastIndexOf(e,t+e.length),s!=-1&&(o=Math.min(a(0,s),o)));let c=1<<e.length-1;s=-1;let h,g,p=e.length+n.length,f;for(let d=0;d<e.length;d++){for(h=0,g=p;h<g;)a(d,t+g)<=o?h=g:p=g,g=Math.floor((p-h)/2+h);p=g;let x=Math.max(1,t-g+1),M=Math.min(t+g,n.length)+e.length,v=Array(M+2);v[M+1]=(1<<d)-1;for(let C=M;C>=x;C--){let R=i[n.charAt(C-1)];if(d===0?v[C]=(v[C+1]<<1|1)&R:v[C]=(v[C+1]<<1|1)&R|((f[C+1]|f[C])<<1|1)|f[C+1],v[C]&c){let A=a(d,C-1);if(A<=o)if(o=A,s=C-1,s>t)x=Math.max(1,2*t-s);else break}}if(a(d+1,t)>o)break;f=v}return s}match_alphabet_(n){let e={};for(let t=0;t<n.length;t++)e[n.charAt(t)]=0;for(let t=0;t<n.length;t++)e[n.charAt(t)]|=1<<n.length-t-1;return e}patch_addContext_(n,e){if(e.length==0)return;let t=e.substring(n.start2,n.start2+n.length1),i=0;for(;e.indexOf(t)!=e.lastIndexOf(t)&&t.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,t=e.substring(n.start2-i,n.start2+n.length1+i);i+=this.Patch_Margin;let r=e.substring(n.start2-i,n.start2);r&&n.diffs.unshift([0,r]);let a=e.substring(n.start2+n.length1,n.start2+n.length1+i);a&&n.diffs.push([0,a]),n.start1-=r.length,n.start2-=r.length,n.length1+=r.length+a.length,n.length2+=r.length+a.length}patch_make(n,e,t){let i,r;if(typeof n=="string"&&typeof e=="string"&&typeof t>"u")i=n,r=this.diff_main(i,e,!0),r.length>2&&(this.diff_cleanupSemantic(r),this.diff_cleanupEfficiency(r));else if(n&&typeof n=="object"&&typeof e>"u"&&typeof t>"u")r=n,i=this.diff_text1(r);else if(typeof n=="string"&&e&&typeof e=="object"&&typeof t>"u")i=n,r=e;else if(typeof n=="string"&&typeof e=="string"&&t&&typeof t=="object")i=n,r=t;else throw new Error("Unknown call format to patch_make.");if(r.length===0)return[];let a=[],o=new Q,s=0,c=0,h=0,g=i,p=i;for(let f=0;f<r.length;f++){let d=r[f][0],x=r[f][1];switch(!s&&d!==0&&(o.start1=c,o.start2=h),d){case 1:o.diffs[s++]=r[f],o.length2+=x.length,p=p.substring(0,h)+x+p.substring(h);break;case-1:o.length1+=x.length,o.diffs[s++]=r[f],p=p.substring(0,h)+p.substring(h+x.length);break;case 0:x.length<=2*this.Patch_Margin&&s&&r.length!=f+1?(o.diffs[s++]=r[f],o.length1+=x.length,o.length2+=x.length):x.length>
7=2*this.Patch_Margin&&s&&(this.patch_addContext_(o,g),a.push(o),o=new Q,s=0,g=p,c=h);break}d!==1&&(c+=x.length),d!==-1&&(h+=x.length)}return s&&(this.patch_addContext_(o,g),a.push(o)),a}patch_deepCopy(n){let e=[];for(let t=0;t<n.length;t++){let i=n[t],r=new Q;r.diffs=[];for(let a=0;a<i.diffs.length;a++)r.diffs[a]=[i.diffs[a][0],i.diffs[a][1]];r.start1=i.start1,r.start2=i.start2,r.length1=i.length1,r.length2=i.length2,e[t]=r}return e}patch_apply(n,e){if(n.length==0)return[e,[]];n=this.patch_deepCopy(n);let t=this.patch_addPadding(n);e=t+e+t,this.patch_splitMax(n);let i=0,r=[];for(let a=0;a<n.length;a++){let o=n[a].start2+i,s=this.diff_text1(n[a].diffs),c,h=-1;if(s.length>this.Match_MaxBits?(c=this.match_main(e,s.substring(0,this.Match_MaxBits),o),c!=-1&&(h=this.match_main(e,s.substring(s.length-this.Match_MaxBits),o+s.length-this.Match_MaxBits),(h==-1||c>=h)&&(c=-1))):c=this.match_main(e,s,o),c==-1)r[a]=!1,i-=n[a].length2-n[a].length1;else{r[a]=!0,i=c-o;let g;if(h==-1?g=e.substring(c,c+s.length):g=e.substring(c,h+this.Match_MaxBits),s==g)e=e.substring(0,c)+this.diff_text2(n[a].diffs)+e.substring(c+s.length);else{let p=this.diff_main(s,g,!1);if(s.length>this.Match_MaxBits&&this.diff_levenshtein(p)/s.length>this.Patch_DeleteThreshold)r[a]=!1;else{this.diff_cleanupSemanticLossless(p);let f=0,d;for(let x=0;x<n[a].diffs.length;x++){let M=n[a].diffs[x];M[0]!==0&&(d=this.diff_xIndex(p,f)),M[0]===1?e=e.substring(0,c+d)+M[1]+e.substring(c+d):M[0]===-1&&(e=e.substring(0,c+d)+e.substring(c+this.diff_xIndex(p,f+M[1].length))),M[0]!==-1&&(f+=M[1].length)}}}}}return e=e.substring(t.length,e.length-t.length),[e,r]}patch_addPadding(n){let e=this.Patch_Margin,t="";for(let a=1;a<=e;a++)t+=String.fromCharCode(a);for(let a=0;a<n.length;a++)n[a].start1+=e,n[a].start2+=e;let i=n[0],r=i.diffs;if(r.length==0||r[0][0]!=0)r.unshift([0,t]),i.start1-=e,i.start2-=e,i.length1+=e,i.length2+=e;else if(e>r[0][1].length){let a=e-r[0][1].length;r[0][1]=t.substring(r[0][1].length)+r[0][1],i.start1-=a,i.start2-=a,i.length1+=a,i.length2+=a}if(i=n[n.length-1],r=i.diffs,r.length==0||r[r.length-1][0]!=0)r.push([0,t]),i.length1+=e,i.length2+=e;else if(e>r[r.length-1][1].length){let a=e-r[r.length-1][1].length;r[r.length-1][1]+=t.substring(0,a),i.length1+=a,i.length2+=a}return t}patch_toText(n){let e=[];for(let t=0;t<n.length;t++)e[t]=n[t];return e.join("")}patch_fromText(n){let e=[];
7if(!n)return e;let t=n.split(` 8`),i=0,r=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;for(;i<t.length;){let a=t[i].match(r);if(!a)throw new Error("Invalid patch string: "+t[i]);let o=new Q;for(e.push(o),o.start1=parseInt(a[1],10),a[2]===""?(o.start1--,o.length1=1):a[2]=="0"?o.length1=0:(o.start1--,o.length1=parseInt(a[2],10)),o.start2=parseInt(a[3],10),a[4]===""?(o.start2--,o.length2=1):a[4]=="0"?o.length2=0:(o.start2--,o.length2=parseInt(a[4],10)),i++;i<t.length;){let s=t[i].charAt(0),c;try{c=decodeURI(t[i].substring(1))}catch(h){throw new Error("Illegal escape in patch_fromText: "+c)}if(s=="-")o.diffs.push([-1,c]);else if(s=="+")o.diffs.push([1,c]);else if(s==" ")o.diffs.push([0,c]);else{if(s=="@")break;if(s!=="")throw new Error('Invalid patch mode "'+s+'" in: '+c)}i++}}return e}},Q=class{constructor(){this.diffs=[];this.start1=null;this.start2=null;this.length1=0;this.length2=0;this.toString=function(){let n,e;this.length1===0?n=this.start1+",0":this.length1==1?n=this.start1+1:n=this.start1+1+","+this.length1,this.length2===0?e=this.start2+",0":this.length2==1?e=this.start2+1:e=this.start2+1+","+this.length2;let t=["@@ -"+n+" +"+e+` @@ 9`],i;for(let r=0;r<this.diffs.length;r++){switch(this.diffs[r][0]){case 1:i="+";break;case-1:i="-";break;case 0:i=" ";break}t[r+1]=i+encodeURI(this.diffs[r][1])+` 10`}return t.join("").replace(/%20/g," ")}}};var me=class l{constructor(n){this.dmp=n}ngOnInit(){}getDiff(n,e){return this.dmp.diff_main(n,e)}getSemanticDiff(n,e){let t=this.dmp.diff_main(n,e);return this.dmp.diff_cleanupSemantic(t),t}getProcessingDiff(n,e){let t=this.dmp.diff_main(n,e);return this.dmp.diff_cleanupEfficiency(t),t}getLineDiff(n,e){let t=this.dmp.diff_linesToChars_(n,e),i=this.dmp.diff_main(t.chars1,t.chars2,!1);return this.dmp.diff_charsToLines_(i,t.lineArray),i}getDmp(){return this.dmp}static{this.\u0275fac=function(e){return new(e||l)(ve(N))}}static{this.\u0275prov=j({token:l,factory:l.\u0275fac})}};var nt=class l{static{this.\u0275fac=function(e){return new(e||l)}}static{this.\u0275mod=ne({type:l})}static{this.\u0275inj=te({providers:[N,me],imports:[oe]})}};var Tt=l=>({"background-image":l,"background-size":"cover"});function Ht(l,n){l&1&&(u(0,"title",0),k(1,"Select Photo"),_())}function Pt(l,n){l&1&&(u(0,"title",0),k(1,"Crop Photo"),_())}function Wt(l,n){l&1&&(u(0,"title",0),k(1,"Cropped Photo"),_())}function Vt(l,n){l&1&&(u(0,"span"),k(1,"No program photo"),_())}function Bt(l,n){if(l&1&&(u(0,"div",8),I(1,Vt,2,0,"span"),_()),l&2){let e=m(2);w(),S(e.pictures!=null&&e.pictures.length?-1:1)}}function Lt(l,n){if(l&1&&O(0,"div",11),l&2){let e=m().$implicit,t=m(3);E("ngStyle",Ve(1,Tt,"url("+t.getImageURL(e.id)+")"))}}function Ft(l,n){if(l&1&&O(0,"img",12),l&2){let e=m().$implicit;E("src",e.base64,Y)}}function Qt(l,n){if(l&1&&(u(0,"mat-radio-button",10),I(1,Lt,1,3,"div",11),I(2,Ft,1,1,"img",12),u(3,"div",13),k(4),_()()),l&2){let e=n.$implicit;E("value",e),w(),S(e.id!=""?1:-1),w(),S(e.id==""?2:-1),w(2),Te(e.name)}}function qt(l,n){if(l&1){let e=V();u(0,"div",8)(1,"mat-radio-group",9),We("ngModelChange",function(i){b(e);let r=m(2);return Pe(r.selectedPhoto,i)||(r.selectedPhoto=i),y(i)}),Re(2,Qt,5,4,"mat-radio-button",10,Se),_()()}if(l&2){let e=m(2);w(),He("ngModel",e.selectedPhoto),w(),Oe(e.pictures)}}function Ut(l,n){if(l&1&&(u(0,"div",3),I(1,Bt,2,1,"div",8),I(2,qt,4,1,"div",8),_()),l&2){let e=m();w(),S(!(e.pictures!=null&&e.pictures.length)||(e.pictures==null?null:e.pictures.length)==0?1:-1),w(),S((e.pictures==null?null:e.pictures.length)>0?2:-1)}}function jt(l,n){l&1&&O(0,"mat-progress-bar",14)}function Yt(l,n){l&1&&(u(0,"div",15),k(1," Drag the rectangle to crop the photo. "),_())}function Xt(l,n){if(l&1){let e=V();u(0,"div",16)(1,"div",18)(2,"button",19),D("click",function(){b(e);let i=m(2);return y(i.zoomOut())}),k(3,"Zoom -"),_(),u(4,"button",19),D("click",function(){b(e);let i=m(2);return y(i.zoomIn())}),k(5,"Zoom +"),_(),u(6,"button",19),D("click",function(){b(e);let i=m(2);return y(i.resetImage())}),k(7,"Reset image"),_()()()}}function Nt(l,n){if(l&1){let e=V();u(0,"div",4),I(1,jt,1,0,"mat-progress-bar",14),I(2,Yt,2,0,"div",15),I(3,Xt,8,0,"div",16),u(4,"image-cropper",17),D("imageCropped",function(i){b(e);let r=m();return y(r.imageCropped(i))})("imageLoaded",function(){b(e);let i=m();return y(i.imageLoaded())})("cropperReady",function(){b(e);let i=m();return y(i.cropperReady())})("loadImageFailed",function(){b(e);let i=m();return y(i.loadImageFailed())}),_()()}if(l&2){let e=m();w(),S(e.isSelectedImageLoading?1:-1),w(),S(e.isSelectedImageLoading?-1:2),w(),S(!e.isSelectedImageLoading&&e.data.can_move?3:-1),w(),B("display",!1),E("imageBase64",e.imageBase64String)("maintainAspectRatio",e.data.can_move)("c
10ontainWithinAspectRatio",e.data.can_move)("aspectRatio",21/9)("resizeToWidth",2e3)("cropperStaticWidth",e.data.max_width?e.data.max_width:2e3)("cropperStaticHeight",e.data.max_height?e.data.max_height:329)("onlyScaleDown",!0)("roundCropper",!1)("canvasRotation",0)("alignImage","left")("transform",e.transform)}}function Kt(l,n){if(l&1&&(u(0,"div"),O(1,"div",20),_()),l&2){let e=m();w(),B("min-height",e.isMobile?"180px":"329px")("max-height",e.isMobile?"180px":"329px")("height",e.isMobile?"180px":"329px")("background-image",e.croppedImage?"url("+e.croppedImage+")":"")}}function Gt(l,n){if(l&1){let e=V();u(0,"button",21),D("click",function(){b(e);let i=m();return y(i.Back())}),k(1,"Back"),_()}if(l&2){let e=m();E("disabled",!e.selectedPhoto)}}function $t(l,n){if(l&1){let e=V();u(0,"button",22),D("click",function(){b(e);let i=m();return y(i.Next())}),k(1,"Next"),_()}if(l&2){let e=m();E("disabled",!e.selectedPhoto)}}function Zt(l,n){if(l&1){let e=V();u(0,"button",22),D("click",function(){b(e);let i=m();return y(i.ok())}),k(1,"OK"),_()}if(l&2){let e=m();E("disabled",!e.selectedPhoto)}}var rt=class l{constructor(n,e,t,i){this._coreFunction=n;this.dialogRef=e;this.data=t;this.http=i;this.httpUnsubscribe=new ye;this.step=1;this.isSelectedImageLoading=!1;this.selectedRatio=21/9;this.imageChangedEvent="";this.croppedImage="";this.scale=1;this.transform={};this.pictures=t.pictures.filter(r=>r.type!="video")}onResize(n){this.setMobileIndicator()}ngOnInit(){this.primary_server=this._coreFunction.getBasePrimaryHref,this.setMobileIndicator()}setMobileIndicator(){this.windowsInnerWidth=window.innerWidth,window.innerWidth<600?this.isMobile=!0:window.innerWidth>599&&window.innerWidth<=1024?this.isMobile=!1:this.isMobile=!1}fileChangeEvent(n){this.imageChangedEvent=n}imageCropped(n){this.croppedImage=n.base64}imageLoaded(){}cropperReady(){}loadImageFailed(){}getImageURL(n){let e=this.primary_server+"ProgramPlanning/helper/getFile.ashx?img="+n+"&page=hfs&w250";return this.data.from_page=="homepage"&&(e=this.primary_server+"ProgramPlanning/helper/getFile.ashx?img="+n+"&page=attachment&w250"),e}getImageDataurl(n){return this.primary_server+"OneAFS/Marketplace/Programs/getImageObject.ashx?id="+n+"&from_page="+this.data.from_page}Back(){this.step-=1}Next(){this.step+=1,this.step==2&&(this.isSelectedImageLoading=!0,this.selectedPhoto.id!=""?(this.imageBase64String="",this.http.get(this.primary_server+"OneAFS/Marketplace/Programs/getImageObject.ashx",{params:new qe().set("id",this.selectedPhoto.id).set("from_page",this.data.from_page||""),withCredentials:!0}).pipe(Me(),we(this.httpUnsubscribe)).subscribe(n=>{n.imgData&&(this.imageBase64String="data:image/png;base64,"+n.imgData,this.isSelectedImageLoading=!1)})):(this.imageBase64String=this.selectedPhoto.base64,this.isSelectedImageLoading=!1))}ok(){this.dialogRef.close(this.croppedImage)}cancel(){this.dialogRef.close()}getBase64ImageFromUrl(n){return G(this,null,function*(){var e=yield fetch(n),t=yield e.blob();return new Promise((i,r)=>{var a=new FileReader;a.addEventListener("load",function(){i(function(){a.result})},!1),a.onerror=()=>r(this),a.readAsDataURL(t)})})}zoomOut(){this.scale-=.1,this.transform=K(P({},this.transform),{scale:this.scale})}zoomIn(){this.scale+=.1,this.transform=K(P({},this.transform),{scale:this.scale})}resetImage(){this.scale=1,this.transform={}}static{this.\u0275fac=function(e){return new(e||l)(z(le),z(ce),z(he),z(Ue))}}static{this.\u0275cmp=X({type:l,selectors:[["app-dialog-cover-photo"]],hostBindings:function(e,t){e&1&&D("resize",function(r){return t.onResize(r)},ie)},standalone:!1,decls:14,vars:15,consts:[["mat-dialog-title","",2,"width","100%"],[1,"dialog-cover"],[2,"width","100%","min-height","500px"],[2,"width","100%"],[2,"position","relative"],["mat-button","",3,"disabled"],["mat-button","","color","primary",3,"disabled"],["mat-button","",3,"click"],[2,"background-color","#fff","display","block"],["name","optCover",1,"flex-row","flex-wrap",3,"ngModelChange","ngModel"],[1,"cover-photo",3,"value"],[1,"thumbnail","defalut-thumnail","flex-col",2,"height","100px","width","180px","border-radius","5px","background-repeat","no-repeat","background-position","center","cursor","pointer","border","1p
10x solid transparent","border-color","var(--ck-color-base-border)",3,"ngStyle"],[2,"height","100px","width","180px","border-radius","5px","background-repeat","no-repeat","background-position","center","cursor","pointer","border","1px solid transparent","border-color","var(--ck-color-base-border)",3,"src"],[1,"label",2,"text-align","center","width","180px","overflow","hidden","white-space","nowrap","text-overflow","ellipsis"],["mode","indeterminate",1,"loader-bar",2,"margin-top","8px","width","90%","margin-left","5%"],[2,"width","100%","text-align","center"],[1,"mt-16","mb-16"],["format","png",3,"imageCropped","imageLoaded","cropperReady","loadImageFailed","imageBase64","maintainAspectRatio","containWithinAspectRatio","aspectRatio","resizeToWidth","cropperStaticWidth","cropperStaticHeight","onlyScaleDown","roundCropper","canvasRotation","alignImage","transform"],[1,"flex-row","flex-wrap","gap-8"],["mat-stroked-button","",3,"click"],[2,"width","100%","height","329px","overflow","hidden","background-size","contain","background-repeat","no-repeat"],["mat-button","",3,"click","disabled"],["mat-button","","color","primary",3,"click","disabled"]],template:function(e,t){e&1&&(I(0,Ht,2,0,"title",0),I(1,Pt,2,0,"title",0),I(2,Wt,2,0,"title",0),u(3,"mat-dialog-content",1)(4,"div",2),I(5,Ut,3,2,"div",3),I(6,Nt,5,17,"div",4),I(7,Kt,2,8,"div"),_()(),u(8,"mat-dialog-actions"),I(9,Gt,2,1,"button",5),I(10,$t,2,1,"button",6),I(11,Zt,2,1,"button",6),u(12,"button",7),D("click",function(){return t.cancel()}),k(13,"Cancel"),_()()),e&2&&(S(t.step==1?0:-1),w(),S(t.step==2?1:-1),w(),S(t.step==3?2:-1),w(2),B("min-height",t.isMobile?"200px":"400px")("max-height",t.isMobile?"200px":"400px")("height",t.isMobile?"200px":"400px"),w(),S(t.step==1?5:-1),w(),S(t.step==2?6:-1),w(),S(t.step==3?7:-1),w(2),S(t.step==2||t.step==3?9:-1),w(),S(t.step==1||t.step==2?10:-1),w(),S(t.step==3?11:-1))},dependencies:[Qe,Ke,Ge,je,Xe,Ne,ge,$e,Je,et,it],styles:[".cover-photo.mat-mdc-radio-button{margin-left:0!important;margin-right:16px!important}.label[_ngcontent-%COMP%]{font-size:13px;line-height:17px;color:#999} .dialog-cover .mat-mdc-dialog-content{overflow-y:hidden!important}"]})}};function Jt(l,n){if(l&1&&(u(0,"div",3),O(1,"img",5),_()),l&2){let e=m();w(),E("src",e.data.url?e.data.url:e.data.base64,Y)}}function ei(l,n){if(l&1&&O(0,"div",4),l&2){let e=m();E("innerHTML",e.data.videoHtml,De)}}var at=class l{constructor(n,e,t,i){this._coreFunction=n;this.domSanitizer=e;this.dialogRef=t;this.data=i;i.type=="video"&&(i.videoHtml=this.getVideoHtml(i.id))}ngOnInit(){}getVideoHtml(n){let e=" width: 100%; height: 100vh; max-height: 500px;",t=" height:100%; margin: auto; z-index:100; position: relative; display: block; overflow: hidden;",i=this._coreFunction.getVideoEmbedUrl(n);this.domSanitizer.bypassSecurityTrustUrl(n);let r;return n.indexOf("spotify.com")>=0?r="<div style='"+e+"'><div style='"+t+"'><iframe src='"+i+"' width='250' height='140' frameborder='0' allowtransparency='true'></iframe></div></div>":r="<div style='"+e+"'><div style='"+t+"'><iframe src='"+i+"' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen style='display: block; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; position: absolute;'></iframe></div></div>",this.domSanitizer.bypassSecurityTrustHtml(r)}static{this.\u0275fac=function(e){return new(e||l)(z(le),z(se),z(ce),z(he))}}static{this.\u0275cmp=X({type:l,selectors:[["app-dialog-picture"]],standalone:!1,decls:5,vars:3,consts:[[1,"modal-img"],[1,"modal-warpper"],["svgIcon","close",1,"close-icon","cusor-pointer",2,"width","36px","height","36px",3,"mat-dialog-close"],[2,"display","grid"],[1,"vdo-item",3,"innerHTML"],[1,"img-item",3,"src"]],template:function(e,t){e&1&&(u(0,"mat-dialog-content",0)(1,"div",1),O(2,"mat-icon",2),I(3,Jt,2,1,"div",3),I(4,ei,1,1,"div",4),_()()),e&2&&(w(2),E("mat-dialog-close",!0),w(),S(t.data.type!="video"?3:-1),w(),S(t.data.type=="video"?4:-1))},dependencies:[Ye,ge,Ze],styles:[".label[_ngcontent-%COMP%]{font-size:13px;line-height:17px;color:#999}.img-item[_ngcontent-%COMP%]{width:100%;object-fit:cover;transition:1s}.vdo-item[_ngcontent-%COMP%]{margin-top:auto;width:100%;overflow:hidden}.modal-img[_ngcontent-%COMP%]{padding:0!important;max-height:unset!important;width:100%;overflow:auto;max-height:600px}.modal-warpper[_ngcontent-%COMP%]{position:relative}.close-icon[_ngcontent-%COMP%]{position:absolute;right:3%;top:3%}"]})}};export{pi as a,rt as b,at as c,me as d,nt as e};
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.