1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6563],{86563:(t,e,i)=>{i.d(e,{default:()=>tj});let s="u">typeof window&&void 0!==window.document,n=s?window:{},a=!!s&&"ontouchstart"in n.document.documentElement,o=!!s&&"PointerEvent"in n,r="cropper",h=`${r}-canvas`,l=`${r}-crosshair`,c=`${r}-grid`,d=`${r}-handle`,u=`${r}-image`,$=`${r}-selection`,p=`${r}-shade`,g=`${r}-viewer`,m="select",b="move",f="scale",v="rotate",w="transform",y="none",C="n-resize",S="e-resize",k="s-resize",x="w-resize",A="ne-resize",z="nw-resize",E="se-resize",T="sw-resize",M=o?"pointerdown":a?"touchstart":"mousedown",D=o?"pointermove":a?"touchmove":"mousemove",P=o?"pointerup pointercancel":a?"touchend touchcancel":"mouseup",O="error",R="keydown",N="load",I="resize",W="wheel",X="action",Y="actionend",L="actionstart",j="change",q="transform";function H(t){return"string"==typeof t}let B=Number.isNaN||n.isNaN;function U(t){return"number"==typeof t&&!B(t)}function K(t){return U(t)&&t>0&&t<1/0}function F(t){return"object"==typeof t&&null!==t}let{hasOwnProperty:_}=Object.prototype;function Z(t){if(!F(t))return!1;try{let{constructor:e}=t,{prototype:i}=e;return e&&i&&_.call(i,"isPrototypeOf")}catch(t){return!1}}function G(t){return"function"==typeof t}function J(t){return"object"==typeof t&&null!==t&&1===t.nodeType}let Q=/([a-z\d])([A-Z])/g;function V(t){return String(t).replace(Q,"$1-$2").toLowerCase()}let tt=/-[A-z\d]/g;function te(t){return t.replace(tt,t=>t.slice(1).toUpperCase())}let ti=/\s\s*/;function ts(t,e,i,s){e.trim().split(ti).forEach(e=>{t.removeEventListener(e,i,s)})}function tn(t,e,i,s){e.trim().split(ti).forEach(e=>{t.addEventListener(e,i,s)})}function ta(t,e,i,s){tn(t,e,i,Object.assign(Object.assign({},s),{once:!0}))}let to={bubbles:!0,cancelable:!0,composed:!0},tr=Promise.resolve();function th(t){let e=t.getRootNode();switch(e.nodeType){case 1:return e.ownerDocument;case 9:case 11:return e}return null}function tl(t){let{documentElement:e}=t.ownerDocument,i=t.getBoundingClientRect();return{left:i.left+(n.pageXOffset-e.clientLeft),top:i.top+(n.pageYOffset-e.clientTop)}}let tc=/deg|g?rad|turn$/i;function td(t){let e=parseFloat(t)||0;if(0!==e){let[i="rad"]=String(t).match(tc)||[];switch(i.toLowerCase()){case"deg":return e/360*(2*Math.PI);case"grad":return e/400*(2*Math.PI);case"turn":return 2*Math.PI*e}}return e}let tu="contain";function t$(t,e=tu){let{aspectRatio:i}=t,{width:s,height:n}=t,a=K(s),o=K(n);if(a&&o){let t=n*i;e===tu&&t>s||"cover"===e&&t<s?n=s/i:s=n*i}else a?n=s/i:o&&(s=n*i);return{width:s,height:n}}let tp=/left|top|width|height/i,tg="open",tm=new WeakMap,tb=new WeakMap,tf=new Map,tv=n.document&&Array.isArray(n.document.adoptedStyleSheets)&&"replaceSync"in n.CSSStyleSheet.prototype;class tw extends HTMLElement{get $sharedStyle(){return`${this.themeColor?`:host{--theme-color: ${this.themeColor};}`:""}:host([hidden]){display:none!important}`}constructor(){var t,e;super(),this.shadowRootMode=tg,this.slottable=!0;const i=null==(e=null==(t=Object.getPrototypeOf(this))?void 0:t.constructor)?void 0:e.$name;i&&tf.set(i,this.tagName.toLowerCase())}static get observedAttributes(){return["shadow-root-mode","slottable","theme-color"]}attributeChangedCallback(t,e,i){if(Object.is(i,e))return;let s=te(t),n=this[s],a=i;switch(typeof n){case"boolean":a=null!==i&&"false"!==i;break;case"number":a=Number(i)}if(this[s]=a,"theme-color"===t){let t=tb.get(this),e=this.$sharedStyle;t&&e&&(tv?t.replaceSync(e):t.textContent=e)}}$propertyChangedCallback(t,e,i){if(!Object.is(i,e))switch(t=V(t),typeof i){case"boolean":!0===i?this.hasAttribute(t)||this.setAttribute(t,""):this.removeAttribute(t);break;case"number":i=B(i)?"":String(i);default:i?this.getAttribute(t)!==i&&this.setAttribute(t,i):this.removeAttribute(t)}}connectedCallback(){Object.getPrototypeOf(this).constructor.observedAttributes.forEach(t=>{let e=te(t),i=this[e];void 0!==i&&this.$propertyChangedCallback(e,void 0,i),Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>i,set(t){let s=i;i=t,this.$propertyChangedCallback(e,s,t)}})});let t=this.shadowRoot||this.attachShadow({mode:this.shadowRootMode||tg});if(tm.set(this,t),tb.set(this,this.$addStyles(this.$sharedStyle)),this.$style&&this.$addStyles(this.$style),this.$template){let e=document.createElement("template");e.innerHTML=this.$template,t.appendChild(e.content)}if(this.slottable){let e=document.createElement("slot");t.appendChild(e)}}disconnectedCallback(){tb.has(this)&&tb.delete(this),tm.has(this)&&tm.delete(this)}$getTagNameOf(t){var e;return null!=(e=tf.get(t))?e:t}
1$setStyles(t){return Object.keys(t).forEach(e=>{let i=t[e];U(i)&&(i=0!==i&&tp.test(e)?`${i}px`:String(i)),this.style[e]=i}),this}$getShadowRoot(){return this.shadowRoot||tm.get(this)}$addStyles(t){let e,i=this.$getShadowRoot();return tv?((e=new CSSStyleSheet).replaceSync(t),i.adoptedStyleSheets=i.adoptedStyleSheets.concat(e)):((e=document.createElement("style")).textContent=t,i.appendChild(e)),e}$emit(t,e,i){return this.dispatchEvent(new CustomEvent(t,Object.assign(Object.assign(Object.assign({},to),{detail:e}),i)))}$nextTick(t){return t?tr.then(this?t.bind(this):t):tr}static $define(t,e){F(t)&&(e=t,t=""),t||(t=this.$name||this.name),t=V(t),s&&n.customElements&&!n.customElements.get(t)&&customElements.define(t,this,e)}}tw.$version="2.1.1";class ty extends tw{constructor(){super(...arguments),this.$onPointerDown=null,this.$onPointerMove=null,this.$onPointerUp=null,this.$onWheel=null,this.$wheeling=!1,this.$pointers=new Map,this.$style=':host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}',this.$action=y,this.background=!1,this.disabled=!1,this.scaleStep=.1,this.themeColor="#39f"}static get observedAttributes(){return super.observedAttributes.concat(["background","disabled","scale-step"])}connectedCallback(){super.connectedCallback(),this.disabled||this.$bind()}disconnectedCallback(){this.disabled||this.$unbind(),super.disconnectedCallback()}$propertyChangedCallback(t,e,i){Object.is(i,e)||(super.$propertyChangedCallback(t,e,i),"disabled"===t&&(i?this.$unbind():this.$bind()))}$bind(){this.$onPointerDown||(this.$onPointerDown=this.$handlePointerDown.bind(this),tn(this,M,this.$onPointerDown)),this.$onPointerMove||(this.$onPointerMove=this.$handlePointerMove.bind(this),tn(this.ownerDocument,D,this.$onPointerMove)),this.$onPointerUp||(this.$onPointerUp=this.$handlePointerUp.bind(this),tn(this.ownerDocument,P,this.$onPointerUp)),this.$onWheel||(this.$onWheel=this.$handleWheel.bind(this),tn(this,W,this.$onWheel,{passive:!1,capture:!0}))}$unbind(){this.$onPointerDown&&(ts(this,M,this.$onPointerDown),this.$onPointerDown=null),this.$onPointerMove&&(ts(this.ownerDocument,D,this.$onPointerMove),this.$onPointerMove=null),this.$onPointerUp&&(ts(this.ownerDocument,P,this.$onPointerUp),this.$onPointerUp=null),this.$onWheel&&(ts(this,W,this.$onWheel,{capture:!0}),this.$onWheel=null)}$handlePointerDown(t){let{buttons:e,button:i,type:s}=t;if(this.disabled||("pointerdown"===s&&"mouse"===t.pointerType||"mousedown"===s)&&(U(e)&&1!==e||U(i)&&0!==i||t.ctrlKey))return;let{$pointers:n}=this,a="";if(t.changedTouches)Array.from(t.changedTouches).forEach(({identifier:t,pageX:e,pageY:i})=>{n.set(t,{startX:e,startY:i,endX:e,endY:i})});else{let{pointerId:e=0,pageX:i,pageY:s}=t;n.set(e,{startX:i,startY:s,endX:i,endY:s})}n.size>1?a=w:J(t.target)&&(a=t.target.action||t.target.getAttribute("action")||""),!1!==this.$emit(L,{action:a,relatedEvent:t})&&(t.preventDefault(),this.$action=a,this.style.willChange="transform")}$handlePointerMove(t){let{$action:e,$pointers:i}=this;if(this.disabled||e===y||0===i.size||!1===this.$emit("actionmove",{action:e,relatedEvent:t}))return;if(t.preventDefault(),t.changedTouches)Array.from(t.changedTouches).forEach(({identifier:t,pageX:e,pageY:s})=>{let n=i.get(t);n&&Object.assign(n,{endX:e,endY:s})});else{let{pointerId:e=0,pageX:s,pageY:n}=t,a=i.get(e);a&&Object.assign(a,{endX:s,endY:n})}let s={action:e,relatedEvent:t};if(e===w){let e=new Map(i),n=0,a=0,o=0,r=0,h=t.pageX,l=t.pageY;
1i.forEach((t,i)=>{e.delete(i),e.forEach(e=>{let i=e.startX-t.startX,s=e.startY-t.startY,c=e.endX-t.endX,d=e.endY-t.endY,u=0,$=0,p=0,g=0;if(0===i?s<0?p=2*Math.PI:s>0&&(p=Math.PI):i>0?p=Math.PI/2+Math.atan(s/i):i<0&&(p=1.5*Math.PI+Math.atan(s/i)),0===c?d<0?g=2*Math.PI:d>0&&(g=Math.PI):c>0?g=Math.PI/2+Math.atan(d/c):c<0&&(g=1.5*Math.PI+Math.atan(d/c)),g>0||p>0){let i=g-p,s=Math.abs(i);s>n&&(n=s,o=i,h=(t.startX+e.startX)/2,l=(t.startY+e.startY)/2)}if(i=Math.abs(i),s=Math.abs(s),c=Math.abs(c),d=Math.abs(d),i>0&&s>0?u=Math.sqrt(i*i+s*s):i>0?u=i:s>0&&(u=s),c>0&&d>0?$=Math.sqrt(c*c+d*d):c>0?$=c:d>0&&($=d),u>0&&$>0){let i=($-u)/u,s=Math.abs(i);s>a&&(a=s,r=i,h=(t.startX+e.startX)/2,l=(t.startY+e.startY)/2)}})});let c=n>0,d=a>0;c&&d?(s.rotate=o,s.scale=r,s.centerX=h,s.centerY=l):c?(s.action=v,s.rotate=o,s.centerX=h,s.centerY=l):d?(s.action=f,s.scale=r,s.centerX=h,s.centerY=l):s.action=y}else{let[t]=Array.from(i.values());Object.assign(s,t)}i.forEach(t=>{t.startX=t.endX,t.startY=t.endY}),s.action!==y&&this.$emit(X,s,{cancelable:!1})}$handlePointerUp(t){let{$action:e,$pointers:i}=this;if(!this.disabled&&e!==y&&!1!==this.$emit(Y,{action:e,relatedEvent:t})){if(t.preventDefault(),t.changedTouches)Array.from(t.changedTouches).forEach(({identifier:t})=>{i.delete(t)});else{let{pointerId:e=0}=t;i.delete(e)}0===i.size&&(this.style.willChange="",this.$action=y)}}$handleWheel(t){if(this.disabled||(t.preventDefault(),this.$wheeling))return;this.$wheeling=!0,setTimeout(()=>{this.$wheeling=!1},50);let e=(t.deltaY>0?-1:1)*this.scaleStep;this.$emit(X,{action:f,scale:e,relatedEvent:t},{cancelable:!1})}$setAction(t){return H(t)&&(this.$action=t),this}$toCanvas(t){return new Promise((e,i)=>{if(!this.isConnected)return void i(Error("The current element is not connected to the DOM."));let s=document.createElement("canvas"),n=this.offsetWidth,a=this.offsetHeight,o=1;Z(t)&&(K(t.width)||K(t.height))&&({width:n,height:a}=t$({aspectRatio:n/a,width:t.width,height:t.height}),o=n/this.offsetWidth),s.width=n,s.height=a;let r=this.querySelector(this.$getTagNameOf(u));r?r.$ready().then(i=>{let h=s.getContext("2d");if(h){let[e,l,c,d,u,$]=r.$getTransform(),p=u,g=$,m=i.naturalWidth,b=i.naturalHeight;1!==o&&(p*=o,g*=o,m*=o,b*=o);let f=m/2,v=b/2;h.fillStyle="transparent",h.fillRect(0,0,n,a),Z(t)&&G(t.beforeDraw)&&t.beforeDraw.call(this,h,s),h.save(),h.translate(f,v),h.transform(e,l,c,d,p,g),h.translate(-f,-v),h.drawImage(i,0,0,m,b),h.restore(
1)}e(s)}).catch(i):e(s)})}}ty.$name=h,ty.$version="2.1.1";let tC=new WeakMap,tS=["alt","crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","src","srcset"];class tk extends tw{constructor(){super(...arguments),this.$isReady=!1,this.$matrix=[1,0,0,1,0,0],this.$onLoad=null,this.$onCanvasAction=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$actionStartTarget=null,this.$style=":host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}",this.$image=new Image,this.initialCenterSize="contain",this.rotatable=!1,this.scalable=!1,this.skewable=!1,this.slottable=!1,this.translatable=!1,this.alt="",this.crossorigin="",this.decoding="",this.elementtiming="",this.fetchpriority="",this.loading="",this.referrerpolicy="",this.sizes="",this.src="",this.srcset=""}set $canvas(t){tC.set(this,t)}get $canvas(){return tC.get(this)}static get observedAttributes(){return super.observedAttributes.concat(tS,["initial-center-size","rotatable","scalable","skewable","translatable"])}attributeChangedCallback(t,e,i){!Object.is(i,e)&&(super.attributeChangedCallback(t,e,i),tS.includes(t)&&this.$image.setAttribute(t,i))}$propertyChangedCallback(t,e,i){if(!Object.is(i,e))switch(super.$propertyChangedCallback(t,e,i),t){case"initialCenterSize":this.$nextTick(()=>{this.$center(i)});break;case"src":this.$isReady=!1}}connectedCallback(){super.connectedCallback();let{$image:t}=this,e=this.closest(this.$getTagNameOf(h));e&&(this.$canvas=e,this.$setStyles({display:"block",position:"absolute"}),this.$onCanvasActionStart=t=>{var e,i;this.$actionStartTarget=null==(i=null==(e=t.detail)?void 0:e.relatedEvent)?void 0:i.target},this.$onCanvasActionEnd=()=>{this.$actionStartTarget=null},this.$onCanvasAction=this.$handleAction.bind(this),tn(e,L,this.$onCanvasActionStart),tn(e,Y,this.$onCanvasActionEnd),tn(e,X,this.$onCanvasAction)),this.$onLoad=this.$handleLoad.bind(this),tn(t,N,this.$onLoad),this.$getShadowRoot().appendChild(t)}disconnectedCallback(){let{$image:t,$canvas:e}=this;e&&(this.$onCanvasActionStart&&(ts(e,L,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(ts(e,Y,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(ts(e,X,this.$onCanvasAction),this.$onCanvasAction=null)),t&&this.$onLoad&&(ts(t,N,this.$onLoad),this.$onLoad=null),this.$getShadowRoot().removeChild(t),super.disconnectedCallback()}$handleLoad(){let{$image:t}=this;this.$setStyles({width:t.naturalWidth,height:t.naturalHeight}),this.$canvas&&this.$center(this.initialCenterSize),this.$isReady=!0}$handleAction(t){if(this.hidden||!(this.rotatable||this.scalable||this.translatable))return;let{$canvas:e}=this,{detail:i}=t;if(i){let{relatedEvent:t}=i,{action:s}=i;switch(s===w&&(!this.rotatable||!this.scalable)&&(s=this.rotatable?v:this.scalable?f:y),s){case b:if(this.translatable){let s=null;t&&(s=t.target.closest(this.$getTagNameOf($))),s||(s=e.querySelector(this.$getTagNameOf($))),s&&s.multiple&&!s.active&&(s=e.querySelector(`${this.$getTagNameOf($)}[active]`)),s&&!s.hidden&&s.movable&&!s.dynamic&&this.$actionStartTarget&&s.contains(this.$actionStartTarget)||this.$move(i.endX-i.startX,i.endY-i.startY)}break;case v:if(this.rotatable)if(t){let{x:e,y:s}=this.getBoundingClientRect();this.$rotate(i.rotate,t.clientX-e,t.clientY-s)}else this.$rotate(i.rotate);break;case f:if(this.scalable)if(t){let e=t.target.closest(this.$getTagNameOf($));if(!e||!e.zoomable||e.zoomable&&e.dynamic){let{x:e,y:s}=this.getBoundingClientRect();this.$zoom(i.scale,t.clientX-e,t.clientY-s)}}else this.$zoom(i.scale);break;case w:if(this.rotatable&&this.scalable){let{rotate:e}=i,{scale:s}=i;s<0?s=1/(1-s):s+=1;let n=Math.cos(e),a=Math.sin(e),[o,r,h,l]=[n*s,a*s,-a*s,n*s];if(t){let e=this.getBoundingClientRect(),i=t.clientX-e.x,s=t.clientY-e.y,[n,a,c,d]=this.$matrix,u=e.width/2,$=e.height/2,p=i-u,g=s-$,m=(p*d-c*g)/(n*d-c*a),b=(g*n-a*p)/(n*d-c*a);this.$transform(o,r,h,l,m*(1-o)+b*h,b*(1-l)+m*r)}else this.$transform(o,r,h,l,0,0)}}}}$ready(t){let{$image:e}=this,i=new Promise((t,i)=>{let s=Error("Failed to load the image source");
1if(e.complete)e.naturalWidth>0&&e.naturalHeight>0?t(e):i(s);else{let n=()=>{ts(e,O,a),setTimeout(()=>{t(e)})},a=()=>{ts(e,N,n),i(s)};ta(e,N,n),ta(e,O,a)}});return G(t)&&i.then(e=>(t(e),e)),i}$center(t){let{parentElement:e}=this;if(!e)return this;let i=e.getBoundingClientRect(),s=i.width,n=i.height,{x:a,y:o,width:r,height:h}=this.getBoundingClientRect(),l=i.x+s/2,c=i.y+n/2,{translatable:d}=this;if(d||this.$isReady||(this.translatable=!0,this.$nextTick(()=>{this.translatable=d})),this.$move(l-(a+r/2),c-(o+h/2)),t&&(r!==s||h!==n)){let e=s/r,i=n/h,{scalable:a}=this;switch(t&&!a&&!this.$isReady&&(this.scalable=!0,this.$nextTick(()=>{this.scalable=a})),t){case"cover":this.$scale(Math.max(e,i));break;case"contain":this.$scale(Math.min(e,i))}}return this}$move(t,e=t){if(this.translatable&&U(t)&&U(e)){let[i,s,n,a]=this.$matrix;this.$translate((t*a-n*e)/(i*a-n*s),(e*i-s*t)/(i*a-n*s))}return this}$moveTo(t,e=t){if(this.translatable&&U(t)&&U(e)){let[i,s,n,a]=this.$matrix;this.$setTransform(i,s,n,a,(t*a-n*e)/(i*a-n*s),(e*i-s*t)/(i*a-n*s))}return this}$rotate(t,e,i){if(this.rotatable){let s=td(t),n=Math.cos(s),a=Math.sin(s),[o,r,h,l]=[n,a,-a,n];if(U(e)&&U(i)){let[t,s,n,a]=this.$matrix,{width:c,height:d}=this.getBoundingClientRect(),u=e-c/2,$=i-d/2,p=(u*a-n*$)/(t*a-n*s),g=($*t-s*u)/(t*a-n*s);this.$transform(o,r,h,l,p*(1-o)-g*h,g*(1-l)-p*r)}else this.$transform(o,r,h,l,0,0)}return this}$zoom(t,e,i){if(!this.scalable||0===t)return this;if(t<0?t=1/(1-t):t+=1,U(e)&&U(i)){let[s,n,a,o]=this.$matrix,{width:r,height:h}=this.getBoundingClientRect(),l=e-r/2,c=i-h/2;this.$transform(t,0,0,t,(l*o-a*c)/(s*o-a*n)*(1-t),(c*s-n*l)/(s*o-a*n)*(1-t))}else this.$scale(t);return this}$scale(t,e=t){return this.scalable&&this.$transform(t,0,0,e,0,0),this}$skew(t,e=0){if(this.skewable){let i=td(t),s=td(e);this.$transform(1,Math.tan(s),Math.tan(i),1,0,0)}return this}$translate(t,e=t){return this.translatable&&U(t)&&U(e)&&this.$transform(1,0,0,1,t,e),this}$transform(t,e,i,s,n,a){return U(t)&&U(e)&&U(i)&&U(s)&&U(n)&&U(a)?this.$setTransform(function t(e,...i){if(0===i.length)return e;let[s,n,a,o,r,h]=e,[l,c,d,u,$,p]=i[0];return t(e=[s*l+a*c,n*l+o*c,s*d+a*u,n*d+o*u,s*$+a*p+r,n*$+o*p+h],...i.slice(1))}(this.$matrix,[t,e,i,s,n,a])):this}$setTransform(t,e,i,s,n,a){if((this.rotatable||this.scalable||this.skewable||this.translatable)&&(Array.isArray(t)&&([t,e,i,s,n,a]=t),U(t)&&U(e)&&U(i)&&U(s)&&U(n)&&U(a))){let o=[...this.$matrix],r=[t,e,i,s,n,a];if(!1===this.$emit(q,{matrix:r,oldMatrix:o}))return this;this.$matrix=r,this.style.transform=`matrix(${r.join(", ")})`}return this}$getTransform(){return this.$matrix.slice()}$resetTransform(){return this.$setTransform([1,0,0,1,0,0])}}tk.$name=u,tk.$version="2.1.1";let tx=new WeakMap;class tA extends tw{constructor(){super(...arguments),this.$onWindowResize=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$onSelectionChange=null,this.$style=":host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}",this.x=0,this.y=0,this.width=0,this.height=0,this.slottable=!1,this.themeColor="rgba(0, 0, 0, 0.65)"}set $canvas(t){tx.set(this,t)}get $canvas(){return tx.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["height","width","x","y"])}connectedCallback(){super.connectedCallback();let t=this.closest(this.$getTagNameOf(h));if(t){this.$canvas=t,this.style.position="absolute";let e=t.querySelector(this.$getTagNameOf($));e&&(this.$onWindowResize=this.$render.bind(this),this.$onCanvasActionStart=t=>{e.hidden&&t.detail.action===m&&(this.hidden=!1)},this.$onCanvasActionEnd=t=>{e.hidden&&t.detail.action===m&&(this.hidden=!0)},this.$onSelectionChange=t=>{let{x:i,y:s,width:n,height:a}=t.defaultPrevented?e:t.detail;this.$change(i,s,n,a),(e.hidden||0===i&&0===s&&0===n&&0===a)&&(this.hidden=!0)},tn(window,I,this.$onWindowResize),tn(t,L,this.$onCanvasActionStart),tn(t,Y,this.$onCanvasActionEnd),tn(t,j,this.$onSelectionChange))}this.$render()}disconnectedCallback(){let{$canvas:t}=this;t&&(this.$onWindowResize&&(ts(window,I,this.$onWindowResize),this.$onWindowResize=null),this.$onCanvasActionStart&&(ts(t,L,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(ts(t,Y,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onSelectionChange&&(ts(t,j,this.$onSelectionChange),this.$onSelectionChange=null)),super.disconnectedCallback()}$change(t,e,i=this.width,s=this.height){return U(t)&&U(e)&&U(i)&&U(s)&&(t!==this.x||e!==this.y||i!==this.width||s!==this.height)?(this.hidden&&(this.hidden=!1),this.x=t,this.y=e,this.width=i,this.height=s,this.$render()):this}$reset(){return this.$change(0,0,0,0)}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height,outlineWidth:n.innerWidth*n.devicePixelRatio})}}tA.$name=p,tA.$version="2.1.1";
1class tz extends tw{constructor(){super(...arguments),this.$onCanvasCropEnd=null,this.$onCanvasCropStart=null,this.$style=':host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}',this.action=y,this.plain=!1,this.slottable=!1,this.themeColor="rgba(51, 153, 255, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["action","plain"])}}tz.$name=d,tz.$version="2.1.1";let tE=new WeakMap;class tT extends tw{constructor(){super(...arguments),this.$onCanvasAction=null,this.$onCanvasActionStart=null,this.$onCanvasActionEnd=null,this.$onDocumentKeyDown=null,this.$action="",this.$actionStartTarget=null,this.$changing=!1,this.$style=':host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}',this.$initialSelection={x:0,y:0,width:0,height:0},this.x=0,this.y=0,this.width=0,this.height=0,this.aspectRatio=NaN,this.initialAspectRatio=NaN,this.initialCoverage=NaN,this.active=!1,this.linked=!1,this.dynamic=!1,this.movable=!1,this.resizable=!1,this.zoomable=!1,this.multiple=!1,this.keyboard=!1,this.outlined=!1,this.precise=!1}set $canvas(t){tE.set(this,t)}get $canvas(){return tE.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["active","aspect-ratio","dynamic","height","initial-aspect-ratio","initial-coverage","keyboard","linked","movable","multiple","outlined","precise","resizable","width","x","y","zoomable"])}$propertyChangedCallback(t,e,i){if(!Object.is(i,e))switch(super.$propertyChangedCallback(t,e,i),t){case"x":case"y":case"width":case"height":this.$changing||this.$nextTick(()=>{this.$change(this.x,this.y,this.width,this.height,this.aspectRatio,!0)});break;case"aspectRatio":case"initialAspectRatio":this.$nextTick(()=>{this.$initSelection()});break;case"initialCoverage":this.$nextTick(()=>{K(i)&&i<=1&&this.$initSelection(!0,!0)});break;case"keyboard":this.$nextTick(()=>{this.$canvas&&(i?this.$onDocumentKeyDown||(this.$onDocumentKeyDown=this.$handleKeyDown.bind(this),tn(this.ownerDocument,R,this.$onDocumentKeyDown)):this.$onDocumentKeyDown&&(ts(this.ownerDocument,R,this.$onDocumentKeyDown),this.$onDocumentKeyDown=null))});break;case"multiple":this.$nextTick(()=>{if(this.$canvas){let t=this.$getSelections();i?(t.forEach(t=>{t.active=!1}),this.active=!0,this.$emit(j,{x:this.x,y:this.y,width:this.width,height:this.height})):(this.active=!1,t.slice(1).forEach(t=>{this.$removeSelection(t)}))}});break;case"precise":this.$nextTick(()=>{this.$change(this.x,this.y)});break;case"linked":i&&(this.dynamic=!0)}}connectedCallback(){super.connectedCallback();let t=this.closest(this.$getTagNameOf(h));t?(this.$canvas=t,this.$setStyles({position:"absolute",transform:`translate(${this.x}px, ${this.y}px)`}),this.hidden||this.$render(),this.$initSelection(!0),this.$onCanvasActionStart=this.$handleActionStart.bind(this),this.$onCanvasActionEnd=this.$handleActionEnd.bind(this),this.$onCanvasAction=this.$handleAction.bind(this),tn(t,L,this.$onCanvasActionStart),tn(t,Y,this.$onCanvasActionEnd),tn(t,X,this.$onCanvasAction)):this.$render()}disconnectedCallback(){let{$canvas:t}=this;t&&(this.$onCanvasActionStart&&(ts(t,L,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(ts(t,Y,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(ts(t,X,this.$onCanvasAction),this.$onCanvasAction=null)),super.disconnectedCallback()}$getSelections(){let t=[];return this.parentElement&&(t=Array.from(this.parentElement.querySelectorAll(this.$getTagNameOf($)))),t}$initSelection(t=!1,e=!1){let{initialCoverage:i,parentElement:s}=this;if(K(i)&&s){let n=this.aspectRatio||this.initialAspectRatio,a=(e?0:this.width)||s.offsetWidth*i,o=(e?0:this.height)||s.offsetHeight*i;K(n)&&({width:a,height:o}=t$({aspectRatio:n,width:a,height:o})),this.$change(this.x,this.y,a,o),t&&this.$center(),this.$initialSelection={x:this.x,y:this.y,width:this.width,height:this.height}}}$createSelection(){let t=this.cloneNode(!0);return this.hasAttribute("id")&&t.removeAttribute("id"),t.initialCoverage=NaN,this.active=!1,this.parentElement&&this.parentElement.insertBefore(t,this.nextSibling),t}$removeSelection(t=this){if(this.parentElement){let e=this.$getSelections();if(e.length>1){let i=e.indexOf(t),s=e[i+1]||e[i-1];s&&(t.active=!1,this.parentElement.removeChild(t),s.active=!0,s.$emit(j,{x:s.x,y:s.y,width:s.width,height:s.height}))}else this.$clear()}}$handleActionStart(t){var e,i;let s=null==(i=null==(e=t.detail)?void 0:e.relatedEvent)?void 0:i.target;this.$action="",this.$actionStartTarget=s,!this.hidden&&this.multiple&&!this.active&&s===this&&this.parentElement&&(this.$getSelections().forEac
1h(t=>{t.active=!1}),this.active=!0,this.$emit(j,{x:this.x,y:this.y,width:this.width,height:this.height}))}$handleAction(t){let{currentTarget:e,detail:i}=t;if(!e||!i)return;let{relatedEvent:s}=i,{action:n}=i,a=s?"function"==typeof s.composedPath&&s.composedPath().find(J)||s.target:null;if(!n&&this.multiple&&(n=this.$action||(null==a?void 0:a.action),this.$action=n),!n||this.hidden&&n!==m||this.multiple&&!this.active&&n!==f)return;let{width:o,height:r}=this,h=i.endX-i.startX,l=i.endY-i.startY,{aspectRatio:c}=this;switch(!K(c)&&s.shiftKey&&(c=K(o)&&K(r)?o/r:1),n){case m:if(0!==h||0!==l){0===h?h=l:0===l&&(l=h);let{$canvas:t}=this,s=tl(e);(this.multiple&&!this.hidden?this.$createSelection():this).$change(i.startX-s.left,i.startY-s.top,Math.abs(h),Math.abs(l),c),h<0?l<0?n=z:l>0&&(n=T):h>0&&(l<0?n=A:l>0&&(n=E)),t&&(t.$action=n)}break;case b:this.movable&&(this.dynamic||this.$actionStartTarget&&this.contains(this.$actionStartTarget))&&this.$move(h,l);break;case f:if(s&&this.zoomable&&(this.dynamic||this.contains(s.target))){let t=tl(e);this.$zoom(i.scale,s.pageX-t.left,s.pageY-t.top)}break;default:this.$resize(n,h,l,c)}}$handleActionEnd(){this.$action="",this.$actionStartTarget=null}$handleKeyDown(t){if(this.hidden||!this.keyboard||this.multiple&&!this.active||t.defaultPrevented)return;let{activeElement:e}=document;if(!(e&&(["INPUT","TEXTAREA"].includes(e.tagName)||["true","plaintext-only"].includes(e.contentEditable))))switch(t.key){case"Backspace":t.metaKey&&(t.preventDefault(),this.$removeSelection());break;case"Delete":t.preventDefault(),this.$removeSelection();break;case"ArrowLeft":t.preventDefault(),this.$move(-1,0);break;case"ArrowRight":t.preventDefault(),this.$move(1,0);break;case"ArrowUp":t.preventDefault(),this.$move(0,-1);break;case"ArrowDown":t.preventDefault(),this.$move(0,1);break;case"+":t.preventDefault(),this.$zoom(.1);break;case"-":t.preventDefault(),this.$zoom(-.1)}}$center(){let{parentElement:t}=this;if(!t)return this;let e=(t.offsetWidth-this.width)/2,i=(t.offsetHeight-this.height)/2;return this.$change(e,i)}$move(t,e=t){return this.$moveTo(this.x+t,this.y+e)}$moveTo(t,e=t){return this.movable?this.$change(t,e):this}$resize(t,e=0,i=0,s=this.aspectRatio){if(!this.resizable)return this;let n=K(s),{$canvas:a}=this,{x:o,y:r,width:h,height:l}=this;switch(t){case C:r+=i,(l-=i)<0&&(t=k,r-=l=-l),n&&(o+=(e=i*s)/2,(h-=e)<0&&(o-=h=-h));break;
1case S:(h+=e)<0&&(t=x,o-=h=-h),n&&(r-=(i=e/s)/2,(l+=i)<0&&(r-=l=-l));break;case k:(l+=i)<0&&(t=C,r-=l=-l),n&&(o-=(e=i*s)/2,(h+=e)<0&&(o-=h=-h));break;case x:o+=e,(h-=e)<0&&(t=S,o-=h=-h),n&&(r+=(i=e/s)/2,(l-=i)<0&&(r-=l=-l));break;case A:n&&(i=-e/s),r+=i,l-=i,(h+=e)<0&&l<0?(t=T,l=-l,o-=h=-h,r-=l):h<0?(t=z,o-=h=-h):l<0&&(t=E,r-=l=-l);break;case z:n&&(i=e/s),o+=e,r+=i,h-=e,l-=i,h<0&&l<0?(t=E,l=-l,o-=h=-h,r-=l):h<0?(t=A,o-=h=-h):l<0&&(t=T,r-=l=-l);break;case E:n&&(i=e/s),h+=e,l+=i,h<0&&l<0?(t=z,l=-l,o-=h=-h,r-=l):h<0?(t=T,o-=h=-h):l<0&&(t=A,r-=l=-l);break;case T:n&&(i=-e/s),o+=e,h-=e,l+=i,h<0&&l<0?(t=A,l=-l,o-=h=-h,r-=l):h<0?(t=E,o-=h=-h):l<0&&(t=z,r-=l=-l)}return a&&a.$setAction(t),this.$change(o,r,h,l)}$zoom(t,e,i){if(!this.zoomable||0===t)return this;t<0?t=1/(1-t):t+=1;let{width:s,height:n}=this,a=s*t,o=n*t,r=this.x,h=this.y;return U(e)&&U(i)?(r-=(a-s)*((e-this.x)/s),h-=(o-n)*((i-this.y)/n)):(r-=(a-s)/2,h-=(o-n)/2),this.$change(r,h,a,o)}$change(t,e,i=this.width,s=this.height,n=this.aspectRatio,a=!1){return!this.$changing&&U(t)&&U(e)&&U(i)&&U(s)&&!(i<0)&&!(s<0)?(K(n)&&({width:i,height:s}=t$({aspectRatio:n,width:i,height:s},"cover")),this.precise||(t=Math.round(t),e=Math.round(e),i=Math.round(i),s=Math.round(s)),t===this.x&&e===this.y&&i===this.width&&s===this.height&&Object.is(n,this.aspectRatio)&&!a||(this.hidden&&(this.hidden=!1),!1===this.$emit(j,{x:t,y:e,width:i,height:s})))?this:(this.$changing=!0,this.x=t,this.y=e,this.width=i,this.height=s,this.$changing=!1,this.$render()):this}$reset(){let{x:t,y:e,width:i,height:s}=this.$initialSelection;return this.$change(t,e,i,s)}$clear(){return this.$change(0,0,0,0,NaN,!0),this.hidden=!0,this}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height})}$toCanvas(t){return new Promise((e,i)=>{if(!this.isConnected)return void i(Error("The current element is not connected to the DOM."));let s=document.createElement("canvas"),{width:n,height:a}=this,o=1;if(Z(t)&&(K(t.width)||K(t.height))&&({width:n,height:a}=t$({aspectRatio:n/a,width:t.width,height:t.height}),o=n/this.width),s.width=n,s.height=a,!this.$canvas)return void e(s);let r=this.$canvas.querySelector(this.$getTagNameOf(u));r?r.$ready().then(i=>{let h=s.getContext("2d");if(h){let[e,l,c,d,u,$]=r.$getTransform(),p=-this.x,g=-this.y,m=(p*d-c*g)/(e*d-c*l),b=(g*e-l*p)/(e*d-c*l),f=e*m+c*b+u,v=l*m+d*b+$,w=i.naturalWidth,y=i.naturalHeight;1!==o&&(f*=o,v*=o,w*=o,y*=o);let C=w/2,S=y/2;h.fillStyle="transparent",h.fillRect(0,0,n,a),Z(t)&&G(t.beforeDraw)&&t.beforeDraw.call(this,h,s),h.save(),h.translate(C,S),h.transform(e,l,c,d,f,v),h.translate(-C,-S),h.drawImage(i,0,0,w,y),h.restore()}e(s)}).catch(i):e(s)})}}tT.$name=$,tT.$version="2.1.1";class tM extends tw{constructor(){super(...arguments),this.$style=":host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}",this.bordered=!1,this.columns=3,this.covered=!1,this.rows=3,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["bordered","columns","covered","rows"])}$propertyChangedCallback(t,e,i){Object.is(i,e)||(super.$propertyChangedCallback(t,e,i),("rows"===t||"columns"===t)&&this.$nextTick(()=>{this.$render()}))}connectedCallback(){super.connectedCallback(),this.$render()}$render(){let t=this.$getShadowRoot(),e=document.createDocumentFragment();for(let t=0;t<this.rows;t+=1){let t=document.createElement("span");t.setAttribute("role","row");for(let e=0;e<this.columns;e+=1){let e=document.createElement("span");e.setAttribute("role","gridcell"),t.appendChild(e)}e.appendChild(t)}t&&(t.innerHTML="",t.appendChild(e))}}tM.$name=c,tM.$version="2.1.1";class tD extends tw{constructor(){super(...arguments),this.$style=':host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;
1top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}',this.centered=!1,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["centered"])}}tD.$name=l,tD.$version="2.1.1";let tP=new WeakMap,tO=new WeakMap,tR=new WeakMap,tN=new WeakMap,tI="vertical";class tW extends tw{constructor(){super(...arguments),this.$onSelectionChange=null,this.$onSourceImageLoad=null,this.$onSourceImageTransform=null,this.$scale=1,this.$style=":host{display:block;height:100%;overflow:hidden;position:relative;width:100%}",this.resize=tI,this.selection="",this.slottable=!1}set $image(t){tO.set(this,t)}get $image(){return tO.get(this)}set $sourceImage(t){tN.set(this,t)}get $sourceImage(){return tN.get(this)}set $canvas(t){tP.set(this,t)}get $canvas(){return tP.get(this)}set $selection(t){tR.set(this,t)}get $selection(){return tR.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["resize","selection"])}connectedCallback(){var t,e;super.connectedCallback();let i=null;if(J(i=this.selection?null!=(e=null==(t=th(this))?void 0:t.querySelector(this.selection))?e:null:this.closest(this.$getTagNameOf($)))){this.$selection=i,this.$onSelectionChange=this.$handleSelectionChange.bind(this),tn(i,j,this.$onSelectionChange);let t=i.closest(this.$getTagNameOf(h));if(t){this.$canvas=t;let e=t.querySelector(this.$getTagNameOf(u));e&&(this.$sourceImage=e,this.$image=e.cloneNode(!0),this.$getShadowRoot().appendChild(this.$image),this.$onSourceImageLoad=this.$handleSourceImageLoad.bind(this),this.$onSourceImageTransform=this.$handleSourceImageTransform.bind(this),tn(e.$image,N,this.$onSourceImageLoad),tn(e,q,this.$onSourceImageTransform))}this.$render()}}disconnectedCallback(){let{$selection:t,$sourceImage:e}=this;t&&this.$onSelectionChange&&(ts(t,j,this.$onSelectionChange),this.$onSelectionChange=null),e&&this.$onSourceImageLoad&&(ts(e.$image,N,this.$onSourceImageLoad),this.$onSourceImageLoad=null),e&&this.$onSourceImageTransform&&(ts(e,q,this.$onSourceImageTransform),this.$onSourceImageTransform=null),super.disconnectedCallback()}$handleSelectionChange(t){this.$render(t.defaultPrevented?this.$selection:t.detail)}$handleSourceImageLoad(){let{$image:t,$sourceImage:e}=this,i=t.getAttribute("src"),s=e.getAttribute("src");s&&s!==i&&(t.setAttribute("src",s),t.$ready(()=>{this.$render()}))}$handleSourceImageTransform(t){this.$render(void 0,t.detail.matrix)}$render(t,e){let{$canvas:i,$selection:s}=this;t||s.hidden||(t=s),t&&(0!==t.x||0!==t.y||0!==t.width||0!==t.height)||(t={x:0,y:0,width:i.offsetWidth,height:i.offsetHeight});let{x:n,y:a,width:o,height:r}=t,h={},{clientWidth:l,clientHeight:c}=this,d=NaN;switch(this.resize){case"both":d=1,h.width=o,h.height=r;break;case"horizontal":h.width=o*(d=r>0?c/r:0);break;case tI:h.height=r*(d=o>0?l/o:0);break;default:l>0?d=o>0?l/o:0:c>0&&(d=r>0?c/r:0)}this.$scale=d,this.$setStyles(h),this.$sourceImage&&setTimeout(()=>{this.$transformImageByOffset(null!=e?e:this.$sourceImage.$getTransform(),-n,-a)})}$transformImageByOffset(t,e,i){let{$image:s,$scale:n,$sourceImage:a}=this;if(a&&s&&n>=0){let[o,r,h,l,c,d]=t,u=(e*l-h*i)/(o*l-h*r),$=(i*o-r*e)/(o*l-h*r),p=o*u+h*$+c,g=r*u+l*$+d;a.$ready(t=>{this.$setStyles.call(s,{width:t.naturalWidth*n,height:t.naturalHeight*n})}),s.$setTransform(o,r,h,l,p*n,g*n)}}}tW.$name=g,tW.$version="2.1.1";let tX=/^img|canvas$/,tY=/<(\/?(?:script|style)[^>]*)>/gi,tL={template:'<cropper-canvas background><cropper-image rotatable scalable skewable translatable></cropper-image><cropper-shade hidden></cropper-shade><cropper-handle action="select" plain></cropper-handle><cropper-selection initial-coverage="0.5" movable resizable><cropper-grid role="grid" bordered covered></cropper-grid><cropper-crosshair centered></cropper-crosshair><cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle><cropper-handle action="n-resize"></cropper-handle><cropper-handle action="e-resize"></cropper-handle><cropper-handle action="s-resize"></cropper-handle><cropper-handle action="w-resize"></cropper-handle><cropper-handle action="ne-resize"></cropper-handle><cropper-handle action="nw-resize"></cropper-handle><cropper-handle action="se-resize"></cropper-handle><cropper-handle action="sw-resize"></cropper-handle></cropper-selection></cropper-canvas>'};ty.$define(),tD.$define(),tM.$define(),tz.$define(),tk.$define(),tT.$define(),tA.$define(),tW.$define();class tj{constructor(t,e){var i;if(this.options=tL,H(t)&&(t=document.querySelector(t)),!J(t)||!tX.test(t.localName))throw Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,e=Object.assign(Object.assign({},tL),e),this.options=e;let{container:s}=e;if(s&&(H(s)&&(s=null==(i=th(t))?void 0:i.querySelector(s)),!J(s)))throw Error("The `container` option must be an element or a valid selector.");J(s)||(s=t.parentElement?t.parentElement:t.ownerDocument.body),this.container=s;const n=t.localName;let a="";"img"===n?{src:a}=t:"canvas"===n&&window.HTMLCanvasElement&&(a=t.toDataURL());const{template:o}=e;if(o&&H(o)){const e=document.createElement("template"),i=document.createDocumentFragment();e.innerHTML=o.replace(tY,"<$1>"),i.appendChild(e.content),Array.from(i.querySelectorAll(u)).forEac
1h(e=>{e.setAttribute("src",a),e.setAttribute("alt",t.alt||"The image to crop"),"img"===n&&["crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","srcset"].forEach(i=>{t.hasAttribute(i)&&e.setAttribute(i,t.getAttribute(i)||"")})}),t.parentElement?(t.style.display="none",s.insertBefore(i,t.nextSibling)):s.appendChild(i)}}getCropperCanvas(){return this.container.querySelector(h)}getCropperImage(){return this.container.querySelector(u)}getCropperSelection(){return this.container.querySelector($)}getCropperSelections(){return this.container.querySelectorAll($)}destroy(){var t;let e=this.getCropperCanvas();e&&(null==(t=e.parentElement)||t.removeChild(e)),this.element&&(this.element.style.display="")}}tj.version="2.1.1"}}]);
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.