PageSourceSearch

https://streetball.app/1855.1064284bf9b219fb.js

js streetball.app collected 2026-10-01 12:14:15 UTC 67,996 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[1855],{3436:(ue,G,d)=>{d.d(G,{M:()=>V});var R=d(1413),A=d(2771),u=d(5343),W=d(6648),J=d(5558),T=d(6977),U=d(5964),b=d(1397),P=d(980),Q=d(4366),_=d(3953),H=d(2069),E=d(4742);let V=(()=>{class z{constructor(B,j,Z){this.translocoService=B,this.actionSheetController=j,this.router=Z,this.show=new R.B,this.destroyedSource$=new A.m(1),this.show.pipe((0,J.n)(X=>this.create(X)),(0,T.Q)(this.destroyedSource$)).subscribe({next:u.l,error:u.l}),this.router.events.pipe((0,U.p)(X=>X instanceof Q.wF),(0,T.Q)(this.destroyedSource$)).subscribe({next:()=>this.hide(),error:u.l})}ngOnDestroy(){this.hide(),this.destroyedSource$.next(!0),this.destroyedSource$.complete()}create(B){return this.hide(),B.buttons=[...B.buttons,{text:this.translocoService.translate("common.cancel"),role:"cancel"}],(0,W.H)(this.actionSheetController.create(B)).pipe((0,b.Z)(j=>(this.actionSheetModal=j,j.present())),(0,b.Z)(()=>this.actionSheetModal.onDidDismiss()),(0,P.j)(()=>this.actionSheetModal=null))}hide(){this.actionSheetModal&&(0,W.H)(this.actionSheetModal.dismiss()).pipe((0,P.j)(()=>this.actionSheetModal=null),(0,T.Q)(this.destroyedSource$)).subscribe({next:u.l,error:u.l})}static#e=this.\u0275fac=function(j){return new(j||z)(_.KVO(H.JO),_.KVO(E.GD),_.KVO(Q.Ix))};static#t=this.\u0275prov=_.jDH({token:z,factory:z.\u0275fac,providedIn:"root"})}return z})()},1855:(ue,G,d)=>{d.r(G),d.d(G,{EditProfilePageModule:()=>tt});var R=d(177),A=d(9417),u=d(4742),W=d(4366),J=d(1413),T=d(2771),U=d(6648),b=d(5343),P=d(7673),Q=d(983),_=d(6977),H=d(8141),E=d(5558),V=d(6697),z=d(6354),L=d(980),B=d(8143),j=d(7725);var te=d(5583),e=d(3953),fe=d(2872),O=d(2069),ie=d(4251),I=d(467),y=function(s){return s[s.Up=1]="Up",s[s.Down=3]="Down",s[s.Right=6]="Right",s[s.Left=8]="Left",s[s.UpMirrored=2]="UpMirrored",s[s.DownMirrored=4]="DownMirrored",s[s.LeftMirrored=5]="LeftMirrored",s[s.RightMirrored=7]="RightMirrored",s[s.Default=0]="Default",s[s.NotJpeg=-1]="NotJpeg",s[s.NotDefined=-2]="NotDefined",s}(y||{});class xe{constructor(){this.byteCount=c=>encodeURI(c).split(/%..|./).length-1}getOrientation(c){return new Promise((t,i)=>{try{const r=new FileReader;r.onload=()=>{const a=new DataView(r.result);if(!a.byteLength||65496!==a.getUint16(0,!1))return t(y.NotDefined);const o=a.byteLength;let n=2;for(;n<o;){const h=a.getUint16(n,!1);if(n+=2,65505===h){if(1165519206!==a.getUint32(n+=2,!1))return t(y.NotJpeg);const l=18761===a.getUint16(n+=6,!1);n+=a.getUint32(n+4,l);const g=a.getUint16(n,l);n+=2;for(let p=0;p<g;p++)if(274===a.getUint16(n+12*p,l))return t(a.getUint16(n+12*p+8,l))}else{if(65280&~h)break;n+=a.getUint16(n,!1)}}return t(y.NotJpeg)},r.readAsArrayBuffer(c)}catch{return i(y.Default)}})}uploadFile(c,t=!0,i=!1){return new Promise((r,a)=>{const o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=/iPad|iPhone|iPod/i.test(navigator.userAgent);Promise.resolve(o||n).then(h=>h?this.generateUploadInputNative(window.document,t,i):this.generateUploadInputRenderer(c,t,i)).then(h=>{const l=h?Array.from(h):[],g=l.map(f=>this.getOrientation(f)),p=l.map(f=>this.fileToDataURL(f));let m=[];Promise.all(g).then(f=>(m=f,Promise.all(p))).then(f=>{const x=f.map((w,C)=>({image:w.dataUrl,orientation:m[C],fileName:w.fileName}));r(t?x:x[0])})}).catch(h=>a(h))})}fileToDataURL(c){return new Promise((t,i)=>{const r=new FileReader;r.onload=a=>{t({dataUrl:a.target.result,fileName:c.name})};try{r.readAsDataURL(c)}catch(a){i(`ngx-image-compress - probably no file have been selected: ${a}`)}})}generateUploadInputRenderer(c,t=!0,i=!1){let r=!1;return new Promise((a,o)=>{const n=c.createElement("input");c.setStyle(n,"display","none"),c.setProperty(n,"type","file"),c.setProperty(n,"accept","image/*, .heic"),t&&c.setProperty(n,"multiple","true"),c.listen(n,"click",h=>{h.target.value=""}),c.listen(n,"change",h=>{r=!0,a(h.target.files)}),i&&window.addEventListener("focus",()=>{setTimeout(()=>{r||o(new Error("file upload on blur - no file selected"))},300)},{once:!0}),n.click()})}generateUploadInputNative(c,t=!0,i=!1){let r=!1;return new Promise((a,o)=>{const n=c.createElement("input");n.id="upload-input"+new Date,n.style.display="none",n.setAttribute("type","file"),n.setAttribute("accept","image/*, .heic"),t&&n.setAttribute("multiple","true"),c.body.appendChild(n),n.addEventListener("change",()=>{r=!0,a(n.files),c.body.removeChild(c.getElementById(n.id))},{once:!0}),i&&window.addEventListener("focus",()=>{setTimeout(()=>{!r&&c.getElementById(n.id)&&(o(new Error("file upload on blur - no file selected")),c.body.removeChild(c.getElementById(n.id)))},300)},{once:!0}),n.click()})}compress(c,t,i,r=50,a=50,o=0,n=0){return new Promise(function(h,l){a/=100,r/=100;const g=new Image;g.onload=()=>{const p=i.createElement("canvas"),m=p.getContext("2d");if(!m)return l("No canvas context available");
1let f=g.naturalWidth,x=g.naturalHeight;if(!CSS.supports("image-orientation","from-image")&&(t===y.Right||t===y.Left)){const N=f;f=x,x=N}r=Math.min(r,o?o/f:1,n?n/x:1),p.width=f*r,p.height=x*r;const M=Math.PI/180;CSS.supports("image-orientation","from-image")||t===y.Up?m.drawImage(g,0,0,p.width,p.height):t===y.Right?(m.save(),m.rotate(90*M),m.translate(0,-p.width),m.drawImage(g,0,0,p.height,p.width),m.restore()):t===y.Left?(m.save(),m.rotate(-90*M),m.translate(-p.width,0),m.drawImage(g,0,0,p.height,p.width),m.restore()):t===y.Down?(m.save(),m.rotate(180*M),m.translate(-p.width,-p.height),m.drawImage(g,0,0,p.width,p.height),m.restore()):m.drawImage(g,0,0,p.width,p.height);const v=c.substr(5,c.split(";")[0].length-5),k=p.toDataURL(v,a);h(k)},g.onerror=p=>l(p),g.src=c})}uploadGetImageMaxSize(c,t,i,r=!1){var a=this;return(0,I.A)(function*(){t&&console.debug("Ngxthis - Opening upload window");const o=yield a.uploadFile(i,!1,r);return yield a.getImageMaxSize(o,c,t,i)})()}getImageMaxSize(c,t,i,r){var a=this;return(0,I.A)(function*(){const n=l=>(l/1024/1024).toFixed(2);let h;i&&console.debug("Ngxthis - Opening upload window");for(let l=0;l<10;l++){const g=a.byteCount(c.image);h=yield a.compress(c.image,c.orientation,r,50,100);const p=a.byteCount(h);if(console.debug("Ngxthis -","Compression from",n(g),"MB to",n(p),"MB"),p>=g)throw 0===l?(i&&console.debug("Ngxthis -","File can't be reduced at all - returning the original",n(g),"MB large"),{...c,image:h}):(i&&console.debug("Ngxthis -","File can't be reduced more - returning the best we can, which is ",n(g),"MB large"),{...c,image:h});if(p<1024*t*1024)return i&&console.debug("Ngxthis -","Here your file",n(p),"MB large"),{...c,image:h};if(9===l)throw i&&console.debug("Ngxthis -","File can't reach the desired size after",10,"tries. Returning file ",n(g),"MB large"),{...c,image:h};i&&console.debug("Ngxthis -","Reached",n(p),"MB large. Trying another time after",l+1,"times"),c.image=h}throw i&&console.debug("Ngxthis - Unexpected error"),{}})()}}let re=(()=>{class s{constructor(t){this.DOC_ORIENTATION=y,this.render=t.createRenderer(null,null),this.imageCompress=new xe}byteCount(t){return this.imageCompress.byteCount(t)}getOrientation(t){return this.imageCompress.getOrientation(t)}uploadFile(){return this.imageCompress.uploadFile(this.render,!1)}uploadMultipleFiles(){return this.imageCompress.uploadFile(this.render,!0)}uploadFileOrReject(){return this.imageCompress.uploadFile(this.render,!1,!0)}uploadMultipleFilesOrReject(){return this.imageCompress.uploadFile(this.render,!0,!0)}compressFile(t,i,r=50,a=50,o=0,n=0){return this.imageCompress.compress(t,i,this.render,r,a,o,n)}uploadAndGetImageWithMaxSize(t=1,i=!1,r=!1){return this.imageCompress.uploadGetImageMaxSize(t,i,this.render,r).then(a=>a.image).catch(a=>{throw a.image})}uploadAndGetImageWithMaxSizeAndMetas(t=1,i=!1,r=!1){return this.imageCompress.uploadGetImageMaxSize(t,i,this.render,r)}getImageWithMaxSizeAndMetas(t,i=1,r=!1){return this.imageCompress.getImageMaxSize(t,i,r,this.render)}static#e=this.\u0275fac=function(i){return new(i||s)(e.KVO(e._9s))};static#t=this.\u0275prov=e.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var _e=d(4412),Me=d(1584),ae=d(345),ve=d(1594),ne=d(7786),$=d(3726);const ye=["wrapper"],Ce=["sourceImage"];function be(s,c){if(1&s){const t=e.RV6();e.j41(0,"img",5,1),e.bIt("load",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.imageLoadedInView())})("mousedown",function(r){e.eBV(t);const a=e.XpG();return e.Njj(a.startMove(r,a.moveTypes.Drag))})("touchstart",function(r){e.eBV(t);const a=e.XpG();return e.Njj(a.startMove(r,a.moveTypes.Drag))})("error",function(r){e.eBV(t);const a=e.XpG();return e.Njj(a.loadImageError(r))}),e.k0s()}if(2&s){const t=e.XpG();e.xc7("visibility",t.imageVisible?"visible":"hidden")("transform",t.safeTransformStyle),e.AVh("ngx-ic-draggable",!t.disabled&&t.allowMoveImage),e.Y8G("src",t.safeImgDataUrl,e.B4B),e.BMQ("alt",t.imageAltText)}}function we(s,c){if(1&s){const t=e.RV6();e.qex(0),e.j41(1,"span",9),e.bIt("mousedown",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"topleft"))})("touchstart",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"topleft"))}),e.nrm(2,"span",10),e.k0s(),e.j41(3,"span",11),e.nrm(4,"span",10),e.k0s(),e.j41(5,"span",12),e.bIt("mousedown",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"topright"))})("touchstart",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"topright"))}),e.nrm(6,"span",10),e.k0s(),e.j41(7,"span",13),e.nrm(8,"span",10),e.k0s(),e.j41(9,"span",14),e.bIt("mousedown",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"bottomright"))})("touchstart",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"bottomright"))}),e.nrm(10,"span",10),e.k0s(),e.j41(11,"span",15),e.nrm(12,"span",10),e.k0s(),e.j41(13,"span",16),e.bIt("mousedown",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"bottomleft"))})("touchstart",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"bottomleft"))}),e.nrm(14,"span",10),e.k0s(),e.j41(15,"span",17),e.nrm(16,"span",10),e.k0s(),e.j41(17,"span",18),e.bIt("mousedown",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"top"))})("touchstart",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"top"))}),e.k0s(),e.j41(18,"span",19),e.bIt("mousedown",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"right"))})("touchstart",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"right"))}),e.k0s(),e.j41(19,"span",20),e.bIt("mousedown",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"bottom"))})("touchstart",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"bottom"))}),e.k0s(),e.j41(20,"span",21),e.bIt("mousedown",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"left"))})("touchstart",function(r){e.eBV(t);const a=e.XpG(2);return e.Njj(a.startMove(r,a.moveTypes.Resize,"left"))}),e.k0s(),e.bVm()}}function Ae(s,c){if(1&s){const t=e.RV6();e.j41(0,"div",6),e.bIt("keydown",function(r){e.eBV(t);const a=e.XpG();return e.Njj(a.keyboardAccess(r))}),e.j41(1,"div",7),e.bIt("mousedown",function(r){e.eBV(t);const a=e.XpG();return e.Njj(a.startMove(r,a.moveTypes.Move))})("touchstart",function(r){e.eBV(t);const a=e.XpG();return e.Njj(a.startMove(r,a.moveTypes.Move))}),e.k0s(),e.DNE(2,we,21,0,"ng-container",8),e.k0s()}if(2&s){const t=e.XpG();e.xc7("top",t.cropper.y1,"px")("left",t.cropper.x1,"px")("width",t.cropper.x2-t.cropper.x1,"px")("height",t.cropper.y2-t.cropper.y1,"px")("margin-left","center"===t.alignImage?t.marginLeft:null)("visibility",t.imageVisible?"visible":"hidden"),e.AVh("ngx-ic-round",t.roundCropper),e.BMQ("aria-label",t.cropperFrameAriaLabel),e.R7$(2),e.Y8G("ngIf",!t.hideResizeSquares)}}class Ie{constructor(){this.format="png",this.output="blob",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.cropperFrameAriaLabel="Crop photo",this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20,this.cropperScaledMaxWidth=20,this.cropperScaledMaxHeight=20,this.stepSize=this.initialStepSize}setOptions(c){Object.keys(c).filter(t=>
1t in this).forEach(t=>this[t]=c[t]),this.validateOptions()}setOptionsFromChanges(c){Object.keys(c).filter(t=>t in this).forEach(t=>this[t]=c[t].currentValue),this.validateOptions()}validateOptions(){if(this.maintainAspectRatio&&!this.aspectRatio)throw new Error("`aspectRatio` should > 0 when `maintainAspectRatio` is enabled")}}var S=function(s){return s.Drag="drag",s.Move="move",s.Resize="resize",s.Pinch="pinch",s}(S||{});function oe(s,c){return s/100*c}let Be=(()=>{class s{crop(t,i,r,a,o){const n=this.getImagePosition(t,i,r,o),h=n.x2-n.x1,l=n.y2-n.y1,g=document.createElement("canvas");g.width=h,g.height=l;const p=g.getContext("2d");if(!p)return null;null!=r.backgroundColor&&(p.fillStyle=r.backgroundColor,p.fillRect(0,0,h,l));const m=(r.transform.scale||1)*(r.transform.flipH?-1:1),f=(r.transform.scale||1)*(r.transform.flipV?-1:1),{translateH:x,translateV:w}=this.getCanvasTranslate(t,r,o),C=t.transformed;p.setTransform(m,0,0,f,C.size.width/2+x,C.size.height/2+w),p.translate(-n.x1/m,-n.y1/f),p.rotate((r.transform.rotate||0)*Math.PI/180),p.drawImage(C.image,-C.size.width/2,-C.size.height/2);const M={width:h,height:l,imagePosition:n,cropperPosition:{...i}};r.containWithinAspectRatio&&(M.offsetImagePosition=this.getOffsetImagePosition(t,i,r,o));const v=this.getResizeRatio(h,l,r);return 1!==v&&(M.width=Math.round(h*v),M.height=r.maintainAspectRatio?Math.round(M.width/r.aspectRatio):Math.round(l*v),function ze(s,c,t){const i=s.width,r=s.height,a=i/(c=Math.round(c)),o=r/(t=Math.round(t)),n=Math.ceil(a/2),h=Math.ceil(o/2),l=s.getContext("2d");if(l){const g=l.getImageData(0,0,i,r),p=l.createImageData(c,t),m=g.data,f=p.data;for(let x=0;x<t;x++)for(let w=0;w<c;w++){const C=4*(w+x*c),M=x*o;let v=0,k=0,N=0,he=0,le=0,pe=0,ge=0;const it=Math.floor(w*a),rt=Math.floor(x*o);let q=Math.ceil((w+1)*a),ee=Math.ceil((x+1)*o);q=Math.min(q,i),ee=Math.min(ee,r);for(let Y=rt;Y<ee;Y++){const de=Math.abs(M-Y)/h,at=w*a,nt=de*de;for(let K=it;K<q;K++){const me=Math.abs(at-K)/n,F=Math.sqrt(nt+me*me);if(F>=1)continue;v=2*F*F*F-3*F*F+1;const D=4*(K+Y*i);ge+=v*m[D+3],N+=v,m[D+3]<255&&(v=v*m[D+3]/250),he+=v*m[D],le+=v*m[D+1],pe+=v*m[D+2],k+=v}}f[C]=he/k,f[C+1]=le/k,f[C+2]=pe/k,f[C+3]=ge/N}s.width=c,s.height=t,l.putImageData(p,0,0)}}(g,M.width,M.height)),"blob"===a?this.cropToBlob(M,g,r):(M.base64=g.toDataURL("image/"+r.format,this.getQuality(r)),M)}cropToBlob(t,i,r){var a=this;return(0,I.A)(function*(){return t.blob=yield new Promise(o=>i.toBlob(o,"image/"+r.format,a.getQuality(r))),t.blob&&(t.objectUrl=URL.createObjectURL(t.blob)),t})()}getCanvasTranslate(t,i,r){if("px"===i.transform.translateUnit){const a=this.getRatio(t,r);return{translateH:(i.transform.translateH||0)*a,translateV:(i.transform.translateV||0)*a}}return{translateH:i.transform.translateH?oe(i.transform.translateH,t.transformed.size.width):0,translateV:i.transform.translateV?oe(i.transform.translateV,t.transformed.size.height):0}}getRatio(t,i){return t.transformed.size.width/i.width}getImagePosition(t,i,r,a){const o=this.getRatio(t,a),n={x1:Math.round(i.x1*o),y1:Math.round(i.y1*o),x2:Math.round(i.x2*o),y2:Math.round(i.y2*o)};return r.containWithinAspectRatio||(n.x1=Math.max(n.x1,0),n.y1=Math.max(n.y1,0),n.x2=Math.min(n.x2,t.transformed.size.width),n.y2=Math.min(n.y2,t.transformed.size.height)),n}getOffsetImagePosition(t,i,r,a){const o=r.canvasRotation+t.exifTransform.rotate,n=this.getRatio(t,a);let h,l;o%2?(h=(t.transformed.size.width-t.original.size.height)/2,l=(t.transformed.size.height-t.original.size.width)/2):(h=(t.transformed.size.width-t.original.size.width)/2,l=(t.transformed.size.height-t.original.size.height)/2);const g={x1:Math.round(i.x1*n)-h,y1:Math.round(i.y1*n)-l,x2:Math.round(i.x2*n)-h,y2:Math.round(i.y2*n)-l};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(t,i,r){const a=r.resizeToWidth/t,o=r.resizeToHeight/i,n=new Array;r.resizeToWidth>0&&n.push(a),r.resizeToHeight>0&&n.push(o);const h=0===n.length?1:Math.min(...n);return h>1&&!r.onlyScaleDown?h:Math.min(h,1)}getQuality(t){return Math.min(1,Math.max(0,t.imageQuality/100))}static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275prov=e.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),je=(()=>{class s{resetCropperPosition(t,i,r,a){if(t?.nativeElement)if(r.cropperStaticHeight&&r.cropperStaticWidth)i.x1=0,i.x2=a.width>r.cropperStaticWidth?r.cropperStaticWidth:a.width,i.y1=0,i.y2=a.height>r.cropperStaticHeight?r.cropperStaticHeight:a.height;else{const o=Math.min(r.cropperScaledMaxWidth,a.width),n=Math.min(r.cropperScaledMaxHeight,a.height);if(r.maintainAspectRatio)if(a.width/r.aspectRatio<a.height){i.x1=0,i.x2=o;const h=o/r.aspectRatio;i.y1=(a.height-h)/2,i.y2=i.y1+h}else{i.y1=0,i.y2=n;
1const h=n*r.aspectRatio;i.x1=(a.width-h)/2,i.x2=i.x1+h}else i.x1=0,i.x2=o,i.y1=0,i.y2=n}}move(t,i,r){const a=this.getClientX(t)-i.clientX,o=this.getClientY(t)-i.clientY;r.x1=i.x1+a,r.y1=i.y1+o,r.x2=i.x2+a,r.y2=i.y2+o}resize(t,i,r,a,o){const n=this.getClientX(t)-i.clientX,h=this.getClientY(t)-i.clientY;switch(i.position){case"left":r.x1=Math.min(Math.max(i.x1+n,r.x2-o.cropperScaledMaxWidth),r.x2-o.cropperScaledMinWidth);break;case"topleft":r.x1=Math.min(Math.max(i.x1+n,r.x2-o.cropperScaledMaxWidth),r.x2-o.cropperScaledMinWidth),r.y1=Math.min(Math.max(i.y1+h,r.y2-o.cropperScaledMaxHeight),r.y2-o.cropperScaledMinHeight);break;case"top":r.y1=Math.min(Math.max(i.y1+h,r.y2-o.cropperScaledMaxHeight),r.y2-o.cropperScaledMinHeight);break;case"topright":r.x2=Math.max(Math.min(i.x2+n,r.x1+o.cropperScaledMaxWidth),r.x1+o.cropperScaledMinWidth),r.y1=Math.min(Math.max(i.y1+h,r.y2-o.cropperScaledMaxHeight),r.y2-o.cropperScaledMinHeight);break;case"right":r.x2=Math.max(Math.min(i.x2+n,r.x1+o.cropperScaledMaxWidth),r.x1+o.cropperScaledMinWidth);break;case"bottomright":r.x2=Math.max(Math.min(i.x2+n,r.x1+o.cropperScaledMaxWidth),r.x1+o.cropperScaledMinWidth),r.y2=Math.max(Math.min(i.y2+h,r.y1+o.cropperScaledMaxHeight),r.y1+o.cropperScaledMinHeight);break;case"bottom":r.y2=Math.max(Math.min(i.y2+h,r.y1+o.cropperScaledMaxHeight),r.y1+o.cropperScaledMinHeight);break;case"bottomleft":r.x1=Math.min(Math.max(i.x1+n,r.x2-o.cropperScaledMaxWidth),r.x2-o.cropperScaledMinWidth),r.y2=Math.max(Math.min(i.y2+h,r.y1+o.cropperScaledMaxHeight),r.y1+o.cropperScaledMinHeight);break;case"center":const l=t.scale,g=Math.min(Math.max(o.cropperScaledMinWidth,Math.abs(i.x2-i.x1)*l),o.cropperScaledMaxWidth),p=Math.min(Math.max(o.cropperScaledMinHeight,Math.abs(i.y2-i.y1)*l),o.cropperScaledMaxHeight);r.x1=i.clientX-g/2,r.x2=i.clientX+g/2,r.y1=i.clientY-p/2,r.y2=i.clientY+p/2,r.x1<0?(r.x2-=r.x1,r.x1=0):r.x2>a.width&&(r.x1-=r.x2-a.width,r.x2=a.width),r.y1<0?(r.y2-=r.y1,r.y1=0):r.y2>a.height&&(r.y1-=r.y2-a.height,r.y2=a.height)}o.maintainAspectRatio&&this.checkAspectRatio(i.position,r,a,o)}checkAspectRatio(t,i,r,a){let o=0,n=0;switch(t){case"top":i.x2=i.x1+(i.y2-i.y1)*a.aspectRatio,o=Math.max(i.x2-r.width,0),n=Math.max(0-i.y1,0),(o>0||n>0)&&(i.x2-=n*a.aspectRatio>o?n*a.aspectRatio:o,i.y1+=n*a.aspectRatio>o?n:o/a.aspectRatio);break;case"bottom":i.x2=i.x1+(i.y2-i.y1)*a.aspectRatio,o=Math.max(i.x2-r.width,0),n=Math.max(i.y2-r.height,0),(o>0||n>0)&&(i.x2-=n*a.aspectRatio>o?n*a.aspectRatio:o,i.y2-=n*a.aspectRatio>o?n:o/a.aspectRatio);break;case"topleft":i.y1=i.y2-(i.x2-i.x1)/a.aspectRatio,o=Math.max(0-i.x1,0),n=Math.max(0-i.y1,0),(o>0||n>0)&&(i.x1+=n*a.aspectRatio>o?n*a.aspectRatio:o,i.y1+=n*a.aspectRatio>o?n:o/a.aspectRatio);break;case"topright":i.y1=i.y2-(i.x2-i.x1)/a.aspectRatio,o=Math.max(i.x2-r.width,0),n=Math.max(0-i.y1,0),(o>0||n>0)&&(i.x2-=n*a.aspectRatio>o?n*a.aspectRatio:o,i.y1+=n*a.aspectRatio>o?n:o/a.aspectRatio);break;case"right":case"bottomright":i.y2=i.y1+(i.x2-i.x1)/a.aspectRatio,o=Math.max(i.x2-r.width,0),n=Math.max(i.y2-r.height,0),(o>0||n>0)&&(i.x2-=n*a.aspectRatio>o?n*a.aspectRatio:o,i.y2-=n*a.aspectRatio>o?n:o/a.aspectRatio);break;case"left":case"bottomleft":i.y2=i.y1+(i.x2-i.x1)/a.aspectRatio,o=Math.max(0-i.x1,0),n=Math.max(i.y2-r.height,0),(o>0||n>0)&&(i.x1+=n*a.aspectRatio>o?n*a.aspectRatio:o,i.y2-=n*a.aspectRatio>o?n:o/a.aspectRatio);break;case"center":i.x2=i.x1+(i.y2-i.y1)*a.aspectRatio,i.y2=i.y1+(i.x2-i.x1)/a.aspectRatio;const h=Math.max(0-i.x1,0),l=Math.max(i.x2-r.width,0),g=Math.max(i.y2-r.height,0),p=Math.max(0-i.y1,0);(h>0||l>0||g>0||p>0)&&(i.x1+=g*a.aspectRatio>h?g*a.aspectRatio:h,i.x2-=p*a.aspectRatio>l?p*a.aspectRatio:l,i.y1+=p*a.aspectRatio>l?p:l/a.aspectRatio,i.y2-=g*a.aspectRatio>h?g:h/a.aspectRatio)}}getClientX(t){return"touches"in t&&t.touches[0]?t.touches[0].clientX:"clientX"in t?t.clientX:0}getClientY(t){return"touches"in t&&t.touches[0]?t.touches[0].clientY:"clientX"in t?t.clientY:0}static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275prov=e.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();let ke=(()=>{class s{constructor(){this.autoRotateSupported=function Ue(){return new Promise(s=>{const c=new Image;c.onload=()=>{s(1===c.width&&2===c.height)},c.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q=="})}()}loadImageFile(t,i){var r=this;return(0,I.A)(function*(){const a=yield t.arrayBuffer();return yield r.checkImageTypeAndLoadImageFromArrayBuffer(a,t.type,i)})()}checkImageTypeAndLoadImageFromArrayBuffer(t,i,r){return this.isValidImageType(i)?this.loadImageFromArrayBuffer(t,r,i):Promise.reject(new Error("Invalid image type"))}isValidImageType(t){return/image\/(png|jpg|jpeg|bmp|gif|tiff|svg|webp|x-icon|vnd.microsoft.icon)/.test(t)}loadImageFromURL(t,i){var r=this;return(0,I.A)(function*(){const o=yield(yield fetch(t)).blob(),n=yield o.arrayBuffer();return yield r.loadImageFromArrayBuffer(n,i,o.type)})()}loadBase64Image(t,i){const r=this.base64ToArrayBuffer(t);return this.loadImageFromArrayBuffer(r,i)}base64ToArrayBuffer(t){t=t.replace(/^data:([^;]+);base64,/gim,"");const i=atob(t),r=i.length,a=new Uint8Array(r);for(let o=0;o<r;o++)a[o]=i.charCodeAt(o);return a.buffer}loadImageFromArrayBuffer(t,i,r){var a=this;return(0,I.A)(function*(){const o=yield new Promise(function(){var n=(0,I.A)(function*(h,l){try{const g=new Blob([t],r?{type:r}:void 0),p=URL.createObjectURL(g),m=new Image,x="image/svg+xml"===r?yield a.getSvgImageSize(g):void 0;m.onload=()=>h({originalImage:m,originalImageSize:x,originalObjectUrl:p,originalArrayBuffer:t}),m.onerror=l,m.src=p}catch(g){l(g)}});return function(h,l){return n.apply(this,arguments)}}());return yield a.transformImageFromArrayBuffer(o,i,null!=o.originalImageSize)})()}getSvgImageSize(t){return(0,I.A)(function*(){const a=(new DOMParser).parseFromString(yield t.text(),"image/svg+xml").querySelector("svg");if(!a)throw Error("Failed to parse SVG image");const o=a.getAttribute("width"),n=a.getAttribute("height");if(o&&n)return null;const h=a.getAttribute("viewBox")||a.getAttribute("viewbox");if(h){const l=h.split(" ");return{width:+l[2],height:+l[3]}}throw Error("Failed to load SVG image. SVG must have width + height or viewBox definition.")})()}transformImageFromArrayBuffer(t,i,r=!1){var a=this;return(0,I.A)(function*(){const n=function Pe(s){switch("object"==typeof s&&(s=function Oe(s){const c=new DataView(s);if(65496!==c.getUint16(0,!1))return-2;const t=c.byteLength;let i=2;
1for(;i<t;){if(c.getUint16(i+2,!1)<=8)return-1;const r=c.getUint16(i,!1);if(i+=2,65505==r){if(1165519206!==c.getUint32(i+=2,!1))return-1;const a=18761==c.getUint16(i+=6,!1);i+=c.getUint32(i+4,a);const o=c.getUint16(i,a);i+=2;for(let n=0;n<o;n++)if(274==c.getUint16(i+12*n,a))return c.getUint16(i+12*n+8,a)}else{if(65280&~r)break;i+=c.getUint16(i,!1)}}return-1}(s)),s){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}}}((yield a.autoRotateSupported)?-1:t.originalArrayBuffer);return t.originalImage&&t.originalImage.complete?a.transformLoadedImage({original:{objectUrl:t.originalObjectUrl,image:t.originalImage,size:t.originalImageSize??{width:t.originalImage.naturalWidth,height:t.originalImage.naturalHeight}},exifTransform:n},i,r):Promise.reject(new Error("No image loaded"))})()}transformLoadedImage(t,i,r=!1){var a=this;return(0,I.A)(function*(){const o=i.canvasRotation+t.exifTransform.rotate,n=t.original.size;if(!r&&0===o&&!t.exifTransform.flip&&!i.containWithinAspectRatio)return{original:{objectUrl:t.original.objectUrl,image:t.original.image,size:{...n}},transformed:{objectUrl:t.original.objectUrl,image:t.original.image,size:{...n}},exifTransform:t.exifTransform};const h=a.getTransformedSize(n,t.exifTransform,i),l=document.createElement("canvas");l.width=h.width,l.height=h.height;const g=l.getContext("2d");g?.setTransform(t.exifTransform.flip?-1:1,0,0,1,l.width/2,l.height/2),g?.rotate(Math.PI*(o/2)),g?.drawImage(t.original.image,-n.width/2,-n.height/2);const p=yield new Promise(x=>l.toBlob(x,i.format));if(!p)throw new Error("Failed to get Blob for transformed image.");const m=URL.createObjectURL(p),f=yield a.loadImageFromObjectUrl(m);return{original:{objectUrl:t.original.objectUrl,image:t.original.image,size:{...n}},transformed:{objectUrl:m,image:f,size:{width:f.width,height:f.height}},exifTransform:t.exifTransform}})()}loadImageFromObjectUrl(t){return new Promise((i,r)=>{const a=new Image;a.onload=()=>i(a),a.onerror=r,a.src=t})}getTransformedSize(t,i,r){const a=r.canvasRotation+i.rotate;if(r.containWithinAspectRatio){if(a%2){const n=t.height/r.aspectRatio;return{width:Math.max(t.height,t.width*r.aspectRatio),height:Math.max(t.width,n)}}{const n=t.width/r.aspectRatio;return{width:Math.max(t.width,t.height*r.aspectRatio),height:Math.max(t.height,n)}}}return a%2?{height:t.width,width:t.height}:{width:t.width,height:t.height}}static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275prov=e.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),se=(()=>{class s{constructor(t,i,r,a,o,n,h){this.cropService=t,this.cropperPositionService=i,this.loadImageService=r,this.sanitizer=a,this.cd=o,this.zone=n,this.hammerLoader=h,this.settings=new Ie,this.setImageMaxSizeRetries=0,this.resizedWhileHidden=!1,this.marginLeft="0px",this.maxSize={width:0,height:0},this.moveTypes=S,this.imageVisible=!1,this.cropperFrameAriaLabel=this.settings.cropperFrameAriaLabel,this.output=this.settings.output,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 e.bkB,this.startCropImage=new e.bkB,this.imageLoaded=new e.bkB,this.cropperReady=new e.bkB,this.loadImageFailed=new e.bkB,this.transformChange=new e.bkB,this.reset()}ngOnChanges(t){this.onChangesUpdateSettings(t),this.onChangesInputImage(t),this.loadedImage?.original.image.complete&&(t.containWithinAspectRatio||t.canvasRotation)&&this.loadImageService.transformLoadedImage(this.loadedImage,this.settings).then(i=>this.setLoadedImage(i)).catch(i=>this.loadImageError(i)),(t.cropper||t.maintainAspectRatio||t.aspectRatio)&&(this.setMaxSize(),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize(),!this.maintainAspectRatio||!this.resetCropOnAspectRatioChange&&this.aspectRatioIsCorrect()||!t.maintainAspectRatio&&!t.aspectRatio?t.cropper&&(this.checkCropperPosition(!1),this.doAutoCrop()):this.resetCropperPosition()),t.transform&&(this.transform=this.transform||{},this.setCssTransform(),this.doAutoCrop()),t.hidden&&this.resizedWhileHidden&&!this.hidden&&setTimeout(()=>{this.onResize(),this.resizedWhileHidden=!1})}onChangesUpdateSettings(t){this.settings.setOptionsFromChanges(t),this.settings.cropperStaticHeight&&this.settings.cropperStaticWidth&&(this.hideResizeSquares=!0,this.settings.setOptions({hideResizeSquares:!0,cropperMinWidth:this.settings.cropperStaticWidth,cropperMinHeight:this.settings.cropperStaticHeight,cropperMaxHeight:this.settings.cropperStaticHeight,cropperMaxWidth:this.settings.cropperStaticWidth,maintainAspectRatio:!1}))}onChangesInputImage(t){(t.imageChangedEvent||t.imageURL||t.imageBase64||t.imageFile)&&this.reset(),t.imageChangedEvent&&this.isValidImageChangedEvent()&&this.loadImageFile(this.imageChangedEvent.target.files[0]),t.imageURL&&this.imageURL&&this.loadImageFromURL(this.imageURL),t.imageBase64&&this.imageBase64&&this.loadBase64Image(this.imageBase64),t.imageFile&&this.imageFile&&this.loadImageFile(this.imageFile)}isValidImageChangedEvent(){const t=this.imageChangedEvent?.target?.files;return t instanceof FileList&&t.length>0}setCssTransform(){const t=this.transform?.translateUnit||"%";this.safeTransformStyle=this.sanitizer.bypassSecurityTrustStyle(`translate(${this.transform.translateH||0}${t}, ${this.transform.translateV||0}${t}) 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(t){this.loadImageService.loadImageFile(t,this.settings).then(i=>this.setLoadedImage(i)).catch(i=>this.loadImageError(i))}loadBase64Image(t){this.loadImageService.loadBase64Image(t,this.settings).then(i=>this.setLoadedImage(i)).catch(i=>this.loadImageError(i))}loadImageFromURL(t){this.loadImageService.loadImageFromURL(t,this.settings).then(i=>this.setLoadedImage(i)).catch(i=>this.loadImageError(i))}setLoadedImage(t){this.loadedImage=t,this.safeImgDataUrl=this.sanitizer.bypassSecurityTrustResourceUrl(t.transformed.objectUrl),this.cd.markForCheck()}loadImageError(t){console.error(t),this.loadImageFailed.emit()}imageLoadedInView(){null!=this.loadedImage&&(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({...this.maxSize}),this.cd.markForCheck()):(this.setImageMaxSizeRetries++,setTimeout(()=>this.checkImageMaxSizeRecursively(),50))}sourceImageLoaded(){return this.sourceImage?.nativeElement?.offsetWidth>0}onResize(){if(this.loadedImage)if(this.hidden)this.resizedWhileHidden=!0;else{const t={...this.maxSize};this.setMaxSize(),this.resizeCropperPosition(t),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize()}}activatePinchGesture(){var t=this;
1return(0,I.A)(function*(){yield t.hammerLoader?.();const i=window?.Hammer||null;if(i){const r=new i(t.wrapper.nativeElement);r.get("pinch").set({enable:!0}),r.on("pinchmove",t.onPinch.bind(t)),r.on("pinchend",t.pinchStop.bind(t)),r.on("pinchstart",t.startPinch.bind(t))}else(0,e.naY)()&&console.warn("[NgxImageCropper] Could not find HammerJS - Pinch Gesture won't work")})()}resizeCropperPosition(t){(t.width!==this.maxSize.width||t.height!==this.maxSize.height)&&(this.cropper.x1=this.cropper.x1*this.maxSize.width/t.width,this.cropper.x2=this.cropper.x2*this.maxSize.width/t.width,this.cropper.y1=this.cropper.y1*this.maxSize.height/t.height,this.cropper.y2=this.cropper.y2*this.maxSize.height/t.height)}resetCropperPosition(){this.cropperPositionService.resetCropperPosition(this.sourceImage,this.cropper,this.settings,this.maxSize),this.doAutoCrop(),this.imageVisible=!0}keyboardAccess(t){this.changeKeyboardStepSize(t),this.keyboardMoveCropper(t)}changeKeyboardStepSize(t){const i=+t.key;i>=1&&i<=9&&(this.settings.stepSize=i)}keyboardMoveCropper(t){if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key))return;const r=t.shiftKey?S.Resize:S.Move,a=t.altKey?function Re(s){switch(s){case"ArrowUp":return"bottom";case"ArrowRight":return"left";case"ArrowDown":return"top";default:return"right"}}(t.key):function Se(s){switch(s){case"ArrowUp":return"top";case"ArrowRight":return"right";case"ArrowDown":return"bottom";default:return"left"}}(t.key),o=function Ee(s,c){switch(s){case"ArrowUp":return{clientX:0,clientY:-1*c};case"ArrowRight":return{clientX:c,clientY:0};case"ArrowDown":return{clientX:0,clientY:c};default:return{clientX:-1*c,clientY:0}}}(t.key,this.settings.stepSize);t.preventDefault(),t.stopPropagation(),this.startMove({clientX:0,clientY:0},r,a),this.handleMouseMove(o),this.handleMouseUp()}startMove(t,i,r=null){this.disabled||this.moveStart?.active&&this.moveStart?.type===S.Pinch||i===S.Drag&&!this.allowMoveImage||("preventDefault"in t&&t.preventDefault(),this.moveStart={active:!0,type:i,position:r,transform:{...this.transform},clientX:this.cropperPositionService.getClientX(t),clientY:this.cropperPositionService.getClientY(t),...this.cropper},this.initMouseMove())}initMouseMove(){(0,ne.h)((0,$.R)(document,"mousemove"),(0,$.R)(document,"touchmove")).pipe((0,_.Q)((0,ne.h)((0,$.R)(document,"mouseup"),(0,$.R)(document,"touchend")).pipe((0,ve.$)()))).subscribe({next:t=>this.zone.run(()=>{this.handleMouseMove(t),this.cd.markForCheck()}),complete:()=>this.zone.run(()=>{this.handleMouseUp(),this.cd.markForCheck()})})}startPinch(t){this.safeImgDataUrl&&(t.preventDefault&&t.preventDefault(),this.moveStart={active:!0,type:S.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})}handleMouseMove(t){if(this.moveStart.active)if("stopPropagation"in t&&t.stopPropagation(),"preventDefault"in t&&t.preventDefault(),this.moveStart.type===S.Move)this.cropperPositionService.move(t,this.moveStart,this.cropper),this.checkCropperPosition(!0);else if(this.moveStart.type===S.Resize)!this.cropperStaticWidth&&!this.cropperStaticHeight&&this.cropperPositionService.resize(t,this.moveStart,this.cropper,this.maxSize,this.settings),this.checkCropperPosition(!1);else if(this.moveStart.type===S.Drag){const i=this.cropperPositionService.getClientX(t)-this.moveStart.clientX,r=this.cropperPositionService.getClientY(t)-this.moveStart.clientY;this.transform={...this.transform,translateH:(this.moveStart.transform?.translateH||0)+i,translateV:(this.moveStart.transform?.translateV||0)+r},this.setCssTransform()}}onPinch(t){this.moveStart.active&&(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),this.moveStart.type===S.Pinch&&(this.cropperPositionService.resize(t,this.moveStart,this.cropper,this.maxSize,this.settings),this.checkCropperPosition(!1)),this.cd.markForCheck())}setMaxSize(){if(this.sourceImage){const t=getComputedStyle(this.sourceImage.nativeElement);this.maxSize.width=parseFloat(t.width),this.maxSize.height=parseFloat(t.height),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.settings.cropperScaledMinHeight=this.maintainAspectRatio?Math.max(20,this.settings.cropperScaledMinWidth/this.aspectRatio):this.cropperMinHeight>0?Math.max(20,this.cropperMinHeight/this.loadedImage.transformed.image.height*this.maxSize.height):20}setCropperScaledMaxSize(){if(this.loadedImage?.transformed?.image){const t=this.loadedImage.transformed.size.width/this.maxSize.width;this.settings.cropperScaledMaxWidth=this.cropperMaxWidth>20?this.cropperMaxWidth/t:this.maxSize.width,this.settings.cropperScaledMaxHeight=this.cropperMaxHeight>20?this.cropperMaxHeight/t: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(t=!1){this.cropper.x1<0&&(this.cropper.x2-=t?this.cropper.x1:0,this.cropper.x1=0),this.cropper.y1<0&&(this.cropper.y2-=t?this.cropper.y1:0,this.cropper.y1=0),this.cropper.x2>this.maxSize.width&&(this.cropper.x1-=t?this.cropper.x2-this.maxSize.width:0,this.cropper.x2=this.maxSize.width),this.cropper.y2>this.maxSize.height&&(this.cropper.y1-=t?this.cropper.y2-this.maxSize.height:0,this.cropper.y2=this.maxSize.height)}handleMouseUp(){this.moveStart.active&&(this.moveStart.active=!1,this.moveStart?.type===S.Drag?this.transformChange.emit(this.transform):this.doAutoCrop())}pinchStop(){this.moveStart.active&&(this.moveStart.active=!1,this.doAutoCrop())}doAutoCrop(){this.autoCrop&&this.crop()}crop(t=this.settings.output){if(null!=this.loadedImage?.transformed?.image){if(this.startCropImage.emit(),"blob"===t)return this.cropToBlob();if("base64"===t)return this.cropToBase64()}return null}cropToBlob(){var t=this;return new Promise((i,r)=>this.zone.run((0,I.A)(function*(){const a=yield t.cropService.crop(t.loadedImage,t.cropper,t.settings,"blob",t.maxSize);a?(t.imageCropped.emit(a),i(a)):r("Crop image failed")})))}cropToBase64(){const t=this.cropService.crop(this.loadedImage,this.cropper,this.settings,"base64",this.maxSize);return t?(this.imageCropped.emit(t),t):null}aspectRatioIsCorrect(){return(this.cropper.x2-this.cropper.x1)/(this.cropper.y2-this.cropper.y1)===this.aspectRatio}static#e=this.\u0275fac=function(i){return new(i||s)(e.rXU(Be),e.rXU(je),e.rXU(ke),e.rXU(ae.up),e.rXU(e.gRc),e.rXU(e.SKi),e.rXU(ae.Bn,8))};static#t=this.\u0275cmp=e.VBU({type:s,selectors:[["image-cropper"]],viewQuery:function(i,r){if(1&i&&(e.GBs(ye,7),e.GBs(Ce,5)),2&i){let a;e.mGM(a=e.lsd())&&(r.wrapper=a.first),e.mGM(a=e.lsd())&&(r.sourceImage=a.first)}},hostVars:6,hostBindings:function(i,r){1&i&&e.bIt("resize",function(){return r.onResize()},!1,e.tSv),2&i&&(e.xc7("text-align",r.alignImage),e.AVh("disabled",r.disabled)("ngx-ix-hidden",r.hidden))},inputs:{imageChangedEvent:"imageChangedEvent",imageURL:"imageURL",imageBase64:"imageBase64",imageFile:"imageFile",imageAltText:"imageAltText",cropperFrameAriaLabel:"cropperFrameAriaLabel",output:"output",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:!0,features:[e.OA$,e.aNF],decls:5,vars:10,consts:[["wrapper",""],["sourceImage",""],["class","ngx-ic-source-image","role","presentation",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"],["role","presentation",1,"ngx-ic-source-image",3,"load","mousedown","touchstart","error","src"],["tabindex","0",1,"ngx-ic-cropper",3,"keydown"],["role","presentation",1,"ngx-ic-move",3,"mousedown","touchstart"],[4,"ngIf"],["role","presentation",1,"ngx-ic-resize","ngx-ic-topleft",3,"mousedown","touchstart"],[1,"ngx-ic-square"],[1,"ngx-ic-resize","ngx-ic-top"],["role","presentation",1,"ngx-ic-resize","ngx-ic-topright",3,"mousedown","touchstart"],[1,"ngx-ic-resize","ngx-ic-right"],["role","presentation",1,"ngx-ic-resize","ngx-ic-bottomright",3,"mousedown","touchstart"],[1,"ngx-ic-resize","ngx-ic-bottom"],["role","presentation",1,"ngx-ic-resize","ngx-ic-bottomleft",3,"mousedown","touchstart"],[1,"ngx-ic-resize","ngx-ic-left"],["role","presentation",1,"ngx-ic-resize-bar","ngx-ic-top",3,"mousedown","touchstart"],["role","presentation",1,"ngx-ic-resize-bar","ngx-ic-right",3,"mousedown","touchstart"],["role","presentation",1,"ngx-ic-resize-bar","ngx-ic-bottom",3,"mousedown","touchstart"],["role","presentation",1,"ngx-ic-resize-bar","ngx-ic-left",3,"mousedown","touchstart"]],template:function(i,r){1&i&&(e.j41(0,"div",null,0),e.DNE(2,be,2,8,"img",2),e.nrm(3,"div",3),e.DNE(4,Ae,3,16,"div",4),e.k0s()),2&i&&(e.xc7("background",r.imageVisible&&r.backgroundColor),e.R7$(2),e.Y8G("ngIf",r.safeImgDataUrl),e.R7$(),e.xc7("width",r.maxSize.width,"px")("height",r.maxSize.height,"px")("margin-left","center"===r.alignImage?r.marginLeft:null),e.R7$(),e.Y8G("ngIf",r.imageVisible))},dependencies:[R.bT],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})}return s})();function Fe(s,c){1&s&&e.nrm(0,"ion-progress-bar",4)}function De(s,c){if(1&s){const t=e.RV6();e.j41(0,"div",5)(1,"button",6),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.closeModal())}),e.k0s(),e.j41(2,"button",7),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.done())}),e.k0s()()}}let We=(()=>{class s{constructor(t,i){this.modalController=t,this.ngxImageCompressService=i,this.maxWidth=600,this.cropperReady$=new _e.t(!1),this.destroyedSource$=new T.m(1)}ngOnDestroy(){this.destroyedSource$.next(!0),this.destroyedSource$.complete()}done(){let t;t=this.croppedImage.width>this.maxWidth?Math.round(100*this.maxWidth/this.croppedImage.width):100,(0,U.H)(this.ngxImageCompressService.compressFile(this.croppedImage.base64,y.NotDefined,t,100)).pipe((0,z.T)(i=>this.closeModal(i)),(0,_.Q)(this.destroyedSource$)).subscribe({next:b.l,error:b.l})}closeModal(t=null,i){(0,U.H)(this.modalController.dismiss(t,i)).pipe((0,_.Q)(this.destroyedSource$)).subscribe({next:b.l,error:b.l})}imageCropped(t){this.croppedImage=t}cropperReady(){this.cropperReady$.next(!0)}loadImageFailed(){(0,Me.O)(1e3).pipe((0,z.T)(()=>this.closeModal(null,"error")),(0,_.Q)(this.destroyedSource$)).subscribe({next:b.l,error:b.l})}static#e=this.\u0275fac=function(i){return new(i||s)(e.rXU(u.W3),e.rXU(re))};static#t=this.\u0275cmp=e.VBU({type:s,selectors:[["app-crop-modal"]],inputs:{image:"image",maxWidth:"maxWidth"},decls:6,vars:12,consts:[["type","indeterminate",4,"ngIf"],[1,"ion-page"],["format","png",3,"imageCropped","cropperReady","loadImageFailed","imageChangedEvent","aspectRatio","maintainAspectRatio","containWithinAspectRatio","cropperMinWidth","autoCrop"],["class","sba-button-group",4,"ngIf"],["type","indeterminate"],[1,"sba-button-group"],[1,"sba-round-button","sba-round-button_cancel",3,"click"],[1,"sba-round-button","sba-round-button_done",3,"click"]],template:function(i,r){1&i&&(e.DNE(0,Fe,1,0,"ion-progress-bar",0),e.nI1(1,"async"),e.j41(2,"div",1)(3,"image-cropper",2),e.bIt("imageCropped",function(o){return r.imageCropped(o)})("cropperReady",function(){return r.cropperReady()})("loadImageFailed",function(){return r.loadImageFailed()}),e.k0s(),e.DNE(4,De,3,0,"div",3),e.nI1(5,"async"),e.k0s()),2&i&&(e.Y8G("ngIf",!1===e.bMT(1,8,r.cropperReady$)),e.R7$(3),e.Y8G("imageChangedEvent",r.image)("aspectRatio",1)("maintainAspectRatio",!0)("containWithinAspectRatio",!0)("cropperMinWidth",200)("autoCrop",!0),e.R7$(),e.Y8G("ngIf",e.bMT(5,10,r.cropperReady$)))},dependencies:[R.bT,se,u.FH,R.Jj],styles:[".ion-page[_ngcontent-%COMP%]{justify-content:space-around}.sba-button-group[_ngcontent-%COMP%]{margin:20px auto}"],changeDetection:0})}return s})();var ce=d(1397),He=d(1596),Ve=d(3436);const Le=["fileInput"],Xe=["imgTag"];let Ge=(()=>{class s{constructor(t,i,r,a,o,n,h){this.actionSheetController=t,this.confirmationDialogService=i,this.modalController=r,this.translocoService=a,this.alertNotificationService=o,this.changeDetectorRef=n,this.actionSheetModalService=h,this.imageChange=new e.bkB,this.deleteImage=new e.bkB,this.defaultImage="/assets/images/icons/no-avatar.svg",this.destroyedSource$=new T.m(1)}ngOnDestroy(){this.cropModal&&(0,U.H)(this.cropModal.dismiss()).pipe((0,L.j)(()=>this.cropModal=null),(0,_.Q)(this.destroyedSource$)).subscribe({next:b.l,error:b.l}),this.destroyedSource$.next(!0),this.destroyedSource$.complete()}avatarLoadingError(){this.image&&this.alertNotificationService.show({message:this.translocoService.translate("editProfile.errorLoadingImage"),color:"danger"}),this.imgTag.nativeElement.src=this.defaultImage}edit(){const t=[{text:this.translocoService.translate("common.change"),icon:"image-outline",role:"change",handler:()=>{this.fileInput.nativeElement.click()}},{text:this.translocoService.translate("common.cancel"),role:"cancel"}];this.image&&t.push({text:this.translocoService.translate("common.delete"),icon:"trash",role:"destructive",handler:()=>{this.delete()}}),this.actionSheetModalService.show.next({header:this.translocoService.translate("editProfile.editImage"),cssClass:"edit-image-action-sheet",buttons:t})}delete(){this.confirmationDialogService.show({header:null,message:this.translocoService.translate("editProfile.deleteImageConfirmation"),buttons:[{text:this.translocoService.translate("common.cancel"),role:"cancel",cssClass:"secondary"},{text:this.translocoService.translate("common.yes"),handler:()=>{this.deleteImage.emit()}}]})}fileChangeEvent(t){(0,U.H)(this.modalController.create({component:We,cssClass:"crop-modal",componentProps:{image:t}})).pipe((0,ce.Z)(i=>(this.cropModal=i,this.cropModal.present())),(0,ce.Z)(()=>this.cropModal.onDidDismiss()),(0,L.j)(()=>this.cropModal=null),(0,_.Q)(this.destroyedSource$)).subscribe(i=>{i.data&&this.imageChange.emit(i.data),"error"===i.role&&this.alertNotificationService.show({message:this.translocoService.translate("editProfile.errorLoadingImage"),color:"danger"}),this.fileInput.nativeElement.value="",this.changeDetectorRef.detectChanges()})}static#e=this.\u0275fac=function(i){return new(i||s)(e.rXU(u.GD),e.rXU(He.N),e.rXU(u.W3),e.rXU(O.JO),e.rXU(ie.f),e.rXU(e.gRc),e.rXU(Ve.M))};static#t=this.\u0275cmp=e.VBU({type:s,selectors:[["app-edit-avatar"]],viewQuery:function(i,r){if(1&i&&(e.GBs(Le,7),e.GBs(Xe,7)),2&i){let a;e.mGM(a=e.lsd())&&(r.fileInput=a.first),e.mGM(a=e.lsd())&&(r.imgTag=a.first)}},inputs:{image:"image"},outputs:{imageChange:"imageChange",deleteImage:"deleteImage"},decls:13,vars:7,consts:[["fileInput",""],["imgTag",""],[1,"avatar"],["type","file","accept",".jpg, .jpeg, .png",3,"change"],["lines","none",1,"avatar__row"],[1,"avatar__image"],["alt","user avatar",3,"error","src"],[1,"avatar__description"],["color","light",1,"avatar__change",3,"click"]],template:function(i,r){if(1&i){const a=e.RV6();e.j41(0,"div",2)(1,"input",3,0),e.bIt("change",function(n){return e.eBV(a),e.Njj(r.fileChangeEvent(n))}
1),e.k0s(),e.j41(3,"ion-item",4)(4,"ion-avatar",5)(5,"img",6,1),e.bIt("error",function(){return e.eBV(a),e.Njj(r.avatarLoadingError())}),e.k0s()(),e.j41(7,"p",7),e.EFF(8),e.nI1(9,"transloco"),e.k0s()(),e.j41(10,"ion-button",8),e.bIt("click",function(){return e.eBV(a),e.Njj(r.edit())}),e.EFF(11),e.nI1(12,"transloco"),e.k0s()()}2&i&&(e.R7$(5),e.Y8G("src",r.image,e.B4B),e.R7$(3),e.SpI(" ",e.bMT(9,3,"editProfile.recommendTransparentImage")," "),e.R7$(3),e.SpI(" ",e.bMT(12,5,"common.edit")," "))},dependencies:[u.mC,u.Jm,u.uz,O.Kj],styles:["input[type=file][_ngcontent-%COMP%]{visibility:hidden;width:0;height:0;opacity:0;position:absolute;left:0;top:0}.avatar[_ngcontent-%COMP%]::part(native){--padding-start: 0}.avatar__row[_ngcontent-%COMP%]{margin-bottom:4px}.avatar__image[_ngcontent-%COMP%]{flex:1 0 auto;width:70px;height:70px;margin-right:15px}.avatar__description[_ngcontent-%COMP%]{font-size:12px;color:var(--ion-color-primary);margin:0}@media screen and (min-width: 411px){.avatar__description[_ngcontent-%COMP%]{font-size:14px}}.avatar__change[_ngcontent-%COMP%]{min-width:70px}.avatar__change[_ngcontent-%COMP%]::part(native){box-shadow:none}"],changeDetection:0})}return s})();const Qe=s=>({"disabled-edit-avatar":s});function $e(s,c){1&s&&e.nrm(0,"ion-progress-bar",8)}function Ne(s,c){if(1&s){const t=e.RV6();e.qex(0),e.EFF(1),e.nI1(2,"date"),e.j41(3,"ion-fab-button",32),e.nI1(4,"transloco"),e.bIt("click",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.resetBirthday())}),e.nrm(5,"ion-icon",33),e.k0s(),e.bVm()}if(2&s){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.i5U(2,2,t.userForm.get("birthday").value,"d.MM.yyyy")," "),e.R7$(2),e.Y8G("title",e.bMT(4,5,"common.clear"))}}function Ye(s,c){1&s&&e.EFF(0," \xa0 ")}function Ke(s,c){if(1&s){const t=e.RV6();e.j41(0,"header",34)(1,"ion-icon",35),e.nI1(2,"transloco"),e.bIt("click",function(){e.eBV(t),e.XpG();const r=e.sdS(34);return e.Njj(r.dismiss())}),e.k0s()(),e.nrm(3,"ion-datetime",36)}if(2&s){const t=e.XpG(2);e.R7$(),e.Y8G("title",e.bMT(2,2,"common.cancel")),e.R7$(2),e.Y8G("locale",t.locale)}}function Je(s,c){if(1&s){const t=e.RV6();e.qex(0),e.j41(1,"ion-item",9)(2,"app-edit-avatar",10),e.nI1(3,"async"),e.bIt("imageChange",function(r){e.eBV(t);const a=e.XpG();return e.Njj(a.onImageChange(r))})("deleteImage",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.onImageDelete())}),e.k0s()(),e.j41(4,"form",11),e.bIt("ngSubmit",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.save())}),e.j41(5,"ion-item",12),e.nrm(6,"ion-input",13),e.nI1(7,"transloco"),e.k0s(),e.j41(8,"ion-segment",14)(9,"ion-segment-button",15),e.nrm(10,"ion-icon",16),e.j41(11,"ion-label"),e.EFF(12),e.nI1(13,"transloco"),e.k0s()(),e.j41(14,"ion-segment-button",17),e.nrm(15,"ion-icon",18),e.j41(16,"ion-label"),e.EFF(17),e.nI1(18,"transloco"),e.k0s()(),e.j41(19,"ion-segment-button",19),e.nrm(20,"ion-icon",20),e.j41(21,"ion-label"),e.EFF(22),e.nI1(23,"transloco"),e.k0s()()(),e.j41(24,"ion-item",21)(25,"ion-label",22),e.EFF(26),e.nI1(27,"transloco"),e.k0s(),e.j41(28,"div",23),e.DNE(29,Ne,6,7,"ng-container",24)(30,Ye,1,0,"ng-template",null,0,e.C5r),e.k0s(),e.nrm(32,"ion-button",25),e.j41(33,"ion-modal",26,1),e.DNE(35,Ke,4,4,"ng-template"),e.k0s()(),e.j41(36,"ion-item",12),e.nrm(37,"ion-input",27),e.nI1(38,"transloco"),e.k0s(),e.j41(39,"ion-item",12),e.nrm(40,"ion-input",28),e.nI1(41,"transloco"),e.k0s(),e.j41(42,"div",29)(43,"button",30),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.navigateBack())}),e.k0s(),e.nrm(44,"button",31),e.k0s()(),e.bVm()}if(2&s){const t=c.ngIf,i=e.sdS(31),r=e.XpG();e.R7$(2),e.Y8G("image",t.avatar)("ngClass",e.eq3(30,Qe,e.bMT(3,14,r.loading$))),e.R7$(2),e.Y8G("formGroup",r.userForm),e.R7$(2),e.Y8G("label",e.bMT(7,16,"enrollment.label.fullName")),e.R7$(6),e.SpI(" ",e.bMT(13,18,"editProfile.notSpecified")," "),e.R7$(5),e.SpI(" ",e.bMT(18,20,"editProfile.male")," "),e.R7$(5),e.SpI(" ",e.bMT(23,22,"editProfile.female")," "),e.R7$(3),e.Y8G("position",r.userForm.get("birthday").value?"stacked":"floating"),e.R7$(),e.SpI(" ",e.bMT(27,24,"editProfile.birthday")," "),e.R7$(3),e.Y8G("ngIf",r.userForm.get("birthday").value)("ngIfElse",i),e.R7$(8),e.Y8G("label",e.bMT(38,26,"editProfile.heightCM")),e.R7$(3),e.Y8G("label",e.bMT(41,28,"editProfile.weightKG")),e.R7$(4),e.Y8G("disabled",r.userForm.invali
1d)}}const Ze=[{path:"",component:(()=>{class s{constructor(t,i,r,a,o,n){this.navController=t,this.userService=i,this.formBuilder=r,this.translocoService=a,this.alertNotificationService=o,this.ionRouterOutlet=n,this.loading$=new J.B,this.player$=this.userService.getProfile(),this.savedUserData={username:null,sex:null,birthday:null,height:null,weight:null},this.userForm=this.formBuilder.group({username:[this.savedUserData.username,[A.k0.required,A.k0.minLength(2)]],sex:this.savedUserData.sex,birthday:this.savedUserData.birthday,height:this.savedUserData.height,weight:this.savedUserData.weight}),this.locale=this.translocoService.getActiveLang(),this.destroyedSource$=new T.m(1),this.loading$.pipe((0,_.Q)(this.destroyedSource$)).subscribe(h=>{h?this.userForm.disable():this.userForm.enable()}),this.player$.pipe((0,_.Q)(this.destroyedSource$)).subscribe(h=>{this.savedUserData={username:h.username,sex:h.sex,birthday:h.birthday,height:h.height,weight:h.weight};for(const l in this.savedUserData)this.savedUserData.hasOwnProperty(l)&&this.userForm.get(l).setValue(this.savedUserData[l])})}ngOnDestroy(){this.destroyedSource$.next(!0),this.destroyedSource$.complete()}navigateBack(){this.ionRouterOutlet.canGoBack()?this.navController.back():(0,U.H)(this.navController.navigateBack(`${te.YM.NAVIGATION_PATH.HOOD}/${te.YM.NAVIGATION_PATH.HOOD_PLAYER}`,{replaceUrl:!0})).pipe((0,_.Q)(this.destroyedSource$)).subscribe({next:b.l,error:b.l})}onImageChange(t){(0,P.of)(null).pipe((0,H.M)(()=>this.loading$.next(!0)),(0,E.n)(()=>this.userService.getProfile()),(0,V.s)(1),(0,E.n)(i=>this.userService.uploadAvatar(t).pipe((0,z.T)(r=>({userId:i.id,imageName:r.avatar})))),(0,E.n)(i=>this.userService.updateUserAvatar(i.userId,i.imageName)),(0,L.j)(()=>this.loading$.next(!1)),(0,_.Q)(this.destroyedSource$)).subscribe({next:()=>{this.alertNotificationService.show({message:this.translocoService.translate("editProfile.successProfileUpdate"),color:"success"})},error:()=>{this.alertNotificationService.show({message:this.translocoService.translate("editProfile.errorProfileUpdate"),color:"danger"})}})}onImageDelete(){(0,P.of)(null).pipe((0,H.M)(()=>this.loading$.next(!0)),(0,E.n)(()=>this.userService.getProfile()),(0,V.s)(1),(0,E.n)(t=>this.userService.deleteUserAvatar(t.id)),(0,L.j)(()=>this.loading$.next(!1)),(0,_.Q)(this.destroyedSource$)).subscribe({next:()=>{this.alertNotificationService.show({message:this.translocoService.translate("editProfile.successProfileUpdate"),color:"success"})},error:()=>{this.alertNotificationService.show({message:this.translocoService.translate("editProfile.errorProfileUpdate"),color:"danger"})}})}resetBirthday(){this.userForm.get("birthday").reset()}save(){!function Z(s,c){return(0,j.A)(s,c)}(this.userForm.value,this.savedUserData)?(0,P.of)(null).pipe((0,H.M)(()=>this.loading$.next(!0)),(0,E.n)(()=>this.userService.getProfile()),(0,V.s)(1),(0,E.n)(t=>this.updateProfile(t)),(0,L.j)(()=>this.loading$.next(!1)),(0,_.Q)(this.destroyedSource$)).subscribe({next:()=>{this.navigateBack(),this.alertNotificationService.show({message:this.translocoService.translate("editProfile.successProfileUpdate"),color:"success"})},error:()=>{this.alertNotificationService.show({message:this.translocoService.translate("editProfile.errorProfileUpdate"),color:"danger"})}}):this.navigateBack()}updateProfile(t){if(this.userForm.value.birthday&&Date.parse(this.userForm.value.birthday)>Date.now())return this.alertNotificationService.show({message:this.translocoService.translate("editProfile.error.bornTomorrow"),color:"danger"}),Q.w;const i={...this.userForm.value,height:this.userForm.value.height?parseInt(`${Math.abs(this.userForm.value.height)}`,10):null,weight:this.userForm.value.weight?parseInt(`${Math.abs(this.userForm.value.weight)}`,10):null};return this.userService.updateProfile(t.id,i)}static#e=this.\u0275fac=function(i){return new(i||s)(e.rXU(fe.q9),e.rXU(B.D),e.rXU(A.ze),e.rXU(O.JO),e.rXU(ie.f),e.rXU(u.Rg))};static#t=this.\u0275cmp=e.VBU({type:s,selectors:[["app-edit-profile"]],decls:13,vars:9,consts:[["emptyLine",""],["birthdayModal",""],["mode","md"],["slot","start",1,"sba-back-button",3,"click"],[1,"wrapper","wrapper_padding-bottom"],["class","progress-bar","color","secondary","type","indeterminate",4,"ngIf"],[1,"content"],[4,"ngIf"],["color","secondary","type","indeterminate",1,"progress-bar"],[1,"single-control","single-control_avatar"],[3,"imageChange","deleteImage","image","ngClass"],[3,"ngSubmit","formGroup"],[1,"single-control"],["formControlName","username","type","text","label-placement","floating",3,"label"],["formControlName","sex","mode","ios",1,"single-control"],["value",""],["name","male-female-outline"],["value","male"],["name","male-outline"],["value","female"],["name","female-outline"],[1,"single-control","single-control_birthday"],[1,"label-input",3,"position"],[1,"birthday-value"],[4,"ngIf","ngIfElse"],["id","open-birthday-modal",1,"birthday-modal-button"],["trigger","open-birthday-modal","showBackdrop","true",1,"birthday-modal"],["formControlName","height","type","number","label-placement","floating",1,"type-number",3,"label"],["formControlName","weight","type","number","label-placement","floating",1,"type-number",3,"label"],[1,"sba-button-group"],["type","button",1,"sba-round-button","sba-round-button_cancel",3,"click"],["type","submit",1,"sba-round-button","sba-round-button_done",3,"disabled"],["color","danger","mode","ios","
1size","small",1,"clear-birthday-value",3,"click","title"],["name","trash-outline"],[1,"birthday-modal__header"],["name","close-outline",1,"birthday-modal__close",3,"click","title"],["formControlName","birthday","mode","md","first-day-of-week","1","presentation","date","size","cover","color","secondary","min","1970-01-01",1,"birthday-modal__calendar",3,"locale"]],template:function(i,r){1&i&&(e.j41(0,"ion-header",2)(1,"ion-toolbar")(2,"button",3),e.bIt("click",function(){return r.navigateBack()}),e.k0s(),e.j41(3,"ion-title"),e.EFF(4),e.nI1(5,"transloco"),e.k0s()()(),e.j41(6,"ion-content")(7,"div",4),e.DNE(8,$e,1,0,"ion-progress-bar",5),e.nI1(9,"async"),e.j41(10,"section",6),e.DNE(11,Je,45,32,"ng-container",7),e.nI1(12,"async"),e.k0s()()()),2&i&&(e.R7$(4),e.SpI(" ",e.bMT(5,3,"editProfile.pageTitle")," "),e.R7$(4),e.Y8G("ngIf",e.bMT(9,5,r.loading$)),e.R7$(3),e.Y8G("ngIf",e.bMT(12,7,r.player$)))},dependencies:[R.YU,R.bT,A.qT,A.BC,A.cb,u.Jm,u.W9,u.A9,u.YW,u.eU,u.iq,u.$w,u.uz,u.he,u.FH,u.Gp,u.eP,u.BC,u.ai,u.Sb,u.su,u.Je,u.Gw,Ge,A.j4,A.JD,R.Jj,R.vh,O.Kj],styles:[".single-control[_ngcontent-%COMP%]{margin-bottom:20px}.single-control_avatar[_ngcontent-%COMP%]{display:block;padding-top:30px;margin-bottom:25px;--border-width: 0;--inner-border-width: 0}ion-segment[_ngcontent-%COMP%]{margin-top:40px}.sba-button-group[_ngcontent-%COMP%]{margin-top:40px}.progress-bar[_ngcontent-%COMP%]{position:absolute;left:0;top:0}.type-number[_ngcontent-%COMP%]     input::-webkit-outer-spin-button, .type-number[_ngcontent-%COMP%]     input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.type-number[_ngcontent-%COMP%]     input[type=number]{-moz-appearance:textfield}.disabled-edit-avatar[_ngcontent-%COMP%]{opacity:.5;pointer-events:none;-webkit-user-select:none;user-select:none}.single-control_birthday[_ngcontent-%COMP%]{position:relative}.birthday-value[_ngcontent-%COMP%]{padding:8px 0}.clear-birthday-value[_ngcontent-%COMP%]{position:absolute;right:10px;top:50%;transform:translateY(-50%);z-index:2;margin:0}.clear-birthday-value[_ngcontent-%COMP%]   ion-icon[_ngcontent-%COMP%]{font-size:22px}.birthday-modal-button[_ngcontent-%COMP%]{position:absolute;z-index:0;left:0;top:0;height:100%;width:100%;opacity:0;margin:0;padding:0}.birthday-modal[_ngcontent-%COMP%]::part(content){--width: 300px;--height: 400px}.birthday-modal__header[_ngcontent-%COMP%]{text-align:right;padding:5px 8px 0;font-size:32px}.birthday-modal__header[_ngcontent-%COMP%]   ion-icon[_ngcontent-%COMP%]{cursor:pointer}.birthday-modal__calendar[_ngcontent-%COMP%]{margin-bottom:15px}.birthday-modal__close[_ngcontent-%COMP%]{margin:0}"],changeDetection:0})}return s})()}];let qe=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.$C({type:s});static#i=this.\u0275inj=e.G2t({imports:[W.iI.forChild(Ze),W.iI]})}return s})(),et=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.$C({type:s});static#i=this.\u0275inj=e.G2t({providers:[re],imports:[R.MD,O.Q8,se,u.bv]})}return s})(),tt=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.$C({type:s});static#i=this.\u0275inj=e.G2t({imports:[R.MD,A.YN,u.bv,qe,et,O.Q8,A.X1]})}return s})()}}]);

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.